From ec519d19c0a85a4dcf74d847a5b053944a1036f8 Mon Sep 17 00:00:00 2001 From: Evrim Date: Fri, 23 Feb 2024 10:56:55 -0500 Subject: [PATCH] Registration system updates --- node_modules/.bin/color-support | 16 + node_modules/.bin/color-support.cmd | 17 + node_modules/.bin/color-support.ps1 | 28 + node_modules/.bin/mkdirp | 16 + node_modules/.bin/mkdirp.cmd | 17 + node_modules/.bin/mkdirp.ps1 | 28 + node_modules/.bin/node-pre-gyp | 16 + node_modules/.bin/node-pre-gyp.cmd | 17 + node_modules/.bin/node-pre-gyp.ps1 | 28 + node_modules/.bin/rimraf | 16 + node_modules/.bin/rimraf.cmd | 17 + node_modules/.bin/rimraf.ps1 | 28 + node_modules/.package-lock.json | 238 +- .../node-pre-gyp/.github/workflows/codeql.yml | 74 + .../@mapbox/node-pre-gyp/CHANGELOG.md | 510 ++ node_modules/@mapbox/node-pre-gyp/LICENSE | 27 + node_modules/@mapbox/node-pre-gyp/README.md | 742 ++ .../@mapbox/node-pre-gyp/bin/node-pre-gyp | 4 + .../@mapbox/node-pre-gyp/bin/node-pre-gyp.cmd | 2 + .../@mapbox/node-pre-gyp/contributing.md | 10 + .../@mapbox/node-pre-gyp/lib/build.js | 51 + .../@mapbox/node-pre-gyp/lib/clean.js | 31 + .../@mapbox/node-pre-gyp/lib/configure.js | 52 + node_modules/@mapbox/node-pre-gyp/lib/info.js | 38 + .../@mapbox/node-pre-gyp/lib/install.js | 235 + node_modules/@mapbox/node-pre-gyp/lib/main.js | 125 + .../@mapbox/node-pre-gyp/lib/node-pre-gyp.js | 309 + .../@mapbox/node-pre-gyp/lib/package.js | 73 + .../@mapbox/node-pre-gyp/lib/pre-binding.js | 34 + .../@mapbox/node-pre-gyp/lib/publish.js | 81 + .../@mapbox/node-pre-gyp/lib/rebuild.js | 20 + .../@mapbox/node-pre-gyp/lib/reinstall.js | 19 + .../@mapbox/node-pre-gyp/lib/reveal.js | 32 + .../@mapbox/node-pre-gyp/lib/testbinary.js | 79 + .../@mapbox/node-pre-gyp/lib/testpackage.js | 53 + .../@mapbox/node-pre-gyp/lib/unpublish.js | 41 + .../node-pre-gyp/lib/util/abi_crosswalk.json | 2602 +++++++ .../@mapbox/node-pre-gyp/lib/util/compile.js | 93 + .../node-pre-gyp/lib/util/handle_gyp_opts.js | 102 + .../@mapbox/node-pre-gyp/lib/util/napi.js | 205 + .../lib/util/nw-pre-gyp/index.html | 26 + .../lib/util/nw-pre-gyp/package.json | 9 + .../@mapbox/node-pre-gyp/lib/util/s3_setup.js | 163 + .../node-pre-gyp/lib/util/versioning.js | 335 + .../node-pre-gyp/node_modules/.bin/nopt | 16 + .../node-pre-gyp/node_modules/.bin/nopt.cmd | 17 + .../node-pre-gyp/node_modules/.bin/nopt.ps1 | 28 + .../node_modules/nopt/CHANGELOG.md | 58 + .../node-pre-gyp/node_modules/nopt/LICENSE | 15 + .../node-pre-gyp/node_modules/nopt/README.md | 213 + .../node_modules/nopt/bin/nopt.js | 54 + .../node_modules/nopt/lib/nopt.js | 441 ++ .../node_modules/nopt/package.json | 34 + .../@mapbox/node-pre-gyp/package.json | 62 + node_modules/agent-base/README.md | 145 + node_modules/agent-base/dist/src/index.d.ts | 78 + node_modules/agent-base/dist/src/index.js | 203 + node_modules/agent-base/dist/src/index.js.map | 1 + .../agent-base/dist/src/promisify.d.ts | 4 + node_modules/agent-base/dist/src/promisify.js | 18 + .../agent-base/dist/src/promisify.js.map | 1 + .../agent-base/node_modules/debug/LICENSE | 20 + .../agent-base/node_modules/debug/README.md | 481 ++ .../node_modules/debug/package.json | 59 + .../node_modules/debug/src/browser.js | 269 + .../node_modules/debug/src/common.js | 274 + .../node_modules/debug/src/index.js | 10 + .../agent-base/node_modules/debug/src/node.js | 263 + .../agent-base/node_modules/ms/index.js | 162 + .../agent-base/node_modules/ms/license.md | 21 + .../agent-base/node_modules/ms/package.json | 37 + .../agent-base/node_modules/ms/readme.md | 60 + node_modules/agent-base/package.json | 64 + node_modules/agent-base/src/index.ts | 345 + node_modules/agent-base/src/promisify.ts | 33 + node_modules/ansi-regex/index.d.ts | 37 + node_modules/ansi-regex/index.js | 10 + node_modules/ansi-regex/license | 9 + node_modules/ansi-regex/package.json | 55 + node_modules/ansi-regex/readme.md | 78 + node_modules/aproba/CHANGELOG.md | 4 + node_modules/aproba/LICENSE | 14 + node_modules/aproba/README.md | 94 + node_modules/aproba/index.js | 105 + node_modules/aproba/package.json | 35 + node_modules/are-we-there-yet/LICENSE.md | 18 + node_modules/are-we-there-yet/README.md | 208 + node_modules/are-we-there-yet/lib/index.js | 4 + .../are-we-there-yet/lib/tracker-base.js | 11 + .../are-we-there-yet/lib/tracker-group.js | 116 + .../are-we-there-yet/lib/tracker-stream.js | 36 + node_modules/are-we-there-yet/lib/tracker.js | 32 + node_modules/are-we-there-yet/package.json | 53 + node_modules/asynckit/LICENSE | 21 + node_modules/asynckit/README.md | 233 + node_modules/asynckit/bench.js | 76 + node_modules/asynckit/index.js | 6 + node_modules/asynckit/lib/abort.js | 29 + node_modules/asynckit/lib/async.js | 34 + node_modules/asynckit/lib/defer.js | 26 + node_modules/asynckit/lib/iterate.js | 75 + .../asynckit/lib/readable_asynckit.js | 91 + .../asynckit/lib/readable_parallel.js | 25 + node_modules/asynckit/lib/readable_serial.js | 25 + .../asynckit/lib/readable_serial_ordered.js | 29 + node_modules/asynckit/lib/state.js | 37 + node_modules/asynckit/lib/streamify.js | 141 + node_modules/asynckit/lib/terminator.js | 29 + node_modules/asynckit/package.json | 63 + node_modules/asynckit/parallel.js | 43 + node_modules/asynckit/serial.js | 17 + node_modules/asynckit/serialOrdered.js | 75 + node_modules/asynckit/stream.js | 21 + node_modules/axios/CHANGELOG.md | 855 +++ node_modules/axios/LICENSE | 7 + node_modules/axios/MIGRATION_GUIDE.md | 3 + node_modules/axios/README.md | 1647 +++++ node_modules/axios/SECURITY.md | 6 + node_modules/axios/dist/axios.js | 3422 +++++++++ node_modules/axios/dist/axios.js.map | 1 + node_modules/axios/dist/axios.min.js | 2 + node_modules/axios/dist/axios.min.js.map | 1 + node_modules/axios/dist/browser/axios.cjs | 3258 +++++++++ node_modules/axios/dist/browser/axios.cjs.map | 1 + node_modules/axios/dist/esm/axios.js | 3281 +++++++++ node_modules/axios/dist/esm/axios.js.map | 1 + node_modules/axios/dist/esm/axios.min.js | 2 + node_modules/axios/dist/esm/axios.min.js.map | 1 + node_modules/axios/dist/node/axios.cjs | 4355 ++++++++++++ node_modules/axios/dist/node/axios.cjs.map | 1 + node_modules/axios/index.d.cts | 542 ++ node_modules/axios/index.d.ts | 559 ++ node_modules/axios/index.js | 43 + node_modules/axios/lib/adapters/README.md | 37 + node_modules/axios/lib/adapters/adapters.js | 77 + node_modules/axios/lib/adapters/http.js | 685 ++ node_modules/axios/lib/adapters/xhr.js | 260 + node_modules/axios/lib/axios.js | 89 + node_modules/axios/lib/cancel/CancelToken.js | 121 + .../axios/lib/cancel/CanceledError.js | 25 + node_modules/axios/lib/cancel/isCancel.js | 5 + node_modules/axios/lib/core/Axios.js | 225 + node_modules/axios/lib/core/AxiosError.js | 100 + node_modules/axios/lib/core/AxiosHeaders.js | 298 + .../axios/lib/core/InterceptorManager.js | 71 + node_modules/axios/lib/core/README.md | 8 + node_modules/axios/lib/core/buildFullPath.js | 21 + .../axios/lib/core/dispatchRequest.js | 81 + node_modules/axios/lib/core/mergeConfig.js | 106 + node_modules/axios/lib/core/settle.js | 27 + node_modules/axios/lib/core/transformData.js | 28 + node_modules/axios/lib/defaults/index.js | 156 + .../axios/lib/defaults/transitional.js | 7 + node_modules/axios/lib/env/README.md | 3 + .../axios/lib/env/classes/FormData.js | 2 + node_modules/axios/lib/env/data.js | 1 + .../axios/lib/helpers/AxiosTransformStream.js | 191 + .../axios/lib/helpers/AxiosURLSearchParams.js | 58 + .../axios/lib/helpers/HttpStatusCode.js | 71 + node_modules/axios/lib/helpers/README.md | 7 + .../lib/helpers/ZlibHeaderTransformStream.js | 28 + node_modules/axios/lib/helpers/bind.js | 7 + node_modules/axios/lib/helpers/buildURL.js | 63 + node_modules/axios/lib/helpers/callbackify.js | 16 + node_modules/axios/lib/helpers/combineURLs.js | 15 + node_modules/axios/lib/helpers/cookies.js | 42 + .../axios/lib/helpers/deprecatedMethod.js | 26 + .../axios/lib/helpers/formDataToJSON.js | 95 + .../axios/lib/helpers/formDataToStream.js | 111 + node_modules/axios/lib/helpers/fromDataURI.js | 53 + .../axios/lib/helpers/isAbsoluteURL.js | 15 + .../axios/lib/helpers/isAxiosError.js | 14 + .../axios/lib/helpers/isURLSameOrigin.js | 67 + node_modules/axios/lib/helpers/null.js | 2 + .../axios/lib/helpers/parseHeaders.js | 55 + .../axios/lib/helpers/parseProtocol.js | 6 + node_modules/axios/lib/helpers/readBlob.js | 15 + node_modules/axios/lib/helpers/speedometer.js | 55 + node_modules/axios/lib/helpers/spread.js | 28 + node_modules/axios/lib/helpers/throttle.js | 33 + node_modules/axios/lib/helpers/toFormData.js | 219 + .../axios/lib/helpers/toURLEncodedForm.js | 18 + node_modules/axios/lib/helpers/validator.js | 91 + .../lib/platform/browser/classes/Blob.js | 3 + .../lib/platform/browser/classes/FormData.js | 3 + .../browser/classes/URLSearchParams.js | 4 + .../axios/lib/platform/browser/index.js | 13 + .../axios/lib/platform/common/utils.js | 47 + node_modules/axios/lib/platform/index.js | 7 + .../lib/platform/node/classes/FormData.js | 3 + .../platform/node/classes/URLSearchParams.js | 4 + node_modules/axios/lib/platform/node/index.js | 12 + node_modules/axios/lib/utils.js | 723 ++ node_modules/axios/package.json | 218 + node_modules/bcrypt/.editorconfig | 19 + node_modules/bcrypt/.github/workflows/ci.yaml | 59 + node_modules/bcrypt/.travis.yml | 62 + node_modules/bcrypt/CHANGELOG.md | 178 + node_modules/bcrypt/ISSUE_TEMPLATE.md | 18 + node_modules/bcrypt/LICENSE | 19 + node_modules/bcrypt/Makefile | 19 + node_modules/bcrypt/README.md | 388 + node_modules/bcrypt/SECURITY.md | 15 + node_modules/bcrypt/appveyor.yml | 39 + node_modules/bcrypt/bcrypt.js | 236 + node_modules/bcrypt/binding.gyp | 61 + node_modules/bcrypt/examples/async_compare.js | 28 + .../bcrypt/examples/forever_gen_salt.js | 8 + .../lib/binding/napi-v3/bcrypt_lib.node | Bin 0 -> 190464 bytes node_modules/bcrypt/package.json | 67 + node_modules/bcrypt/promises.js | 42 + node_modules/bcrypt/src/bcrypt.cc | 315 + node_modules/bcrypt/src/bcrypt_node.cc | 288 + node_modules/bcrypt/src/blowfish.cc | 679 ++ node_modules/bcrypt/src/node_blf.h | 132 + node_modules/bcrypt/test-docker.sh | 15 + node_modules/bcrypt/test/async.test.js | 209 + .../bcrypt/test/implementation.test.js | 48 + node_modules/bcrypt/test/promise.test.js | 168 + node_modules/bcrypt/test/repetitions.test.js | 46 + node_modules/bcrypt/test/sync.test.js | 125 + .../buffer-equal-constant-time/.npmignore | 2 + .../buffer-equal-constant-time/.travis.yml | 4 + .../buffer-equal-constant-time/LICENSE.txt | 12 + .../buffer-equal-constant-time/README.md | 50 + .../buffer-equal-constant-time/index.js | 41 + .../buffer-equal-constant-time/package.json | 21 + .../buffer-equal-constant-time/test.js | 42 + node_modules/chownr/LICENSE | 15 + node_modules/chownr/README.md | 3 + node_modules/chownr/chownr.js | 167 + node_modules/chownr/package.json | 32 + node_modules/color-support/LICENSE | 15 + node_modules/color-support/README.md | 129 + node_modules/color-support/bin.js | 3 + node_modules/color-support/browser.js | 14 + node_modules/color-support/index.js | 134 + node_modules/color-support/package.json | 36 + node_modules/combined-stream/License | 19 + node_modules/combined-stream/Readme.md | 138 + .../combined-stream/lib/combined_stream.js | 208 + node_modules/combined-stream/package.json | 25 + node_modules/combined-stream/yarn.lock | 17 + node_modules/console-control-strings/LICENSE | 13 + .../console-control-strings/README.md | 145 + .../console-control-strings/README.md~ | 140 + node_modules/console-control-strings/index.js | 125 + .../console-control-strings/package.json | 27 + node_modules/dayjs/.editorconfig | 7 + node_modules/dayjs/CHANGELOG.md | 919 +++ node_modules/dayjs/LICENSE | 21 + node_modules/dayjs/README.md | 149 + node_modules/dayjs/dayjs.min.js | 1 + node_modules/dayjs/esm/constant.js | 25 + node_modules/dayjs/esm/index.d.ts | 429 ++ node_modules/dayjs/esm/index.js | 541 ++ node_modules/dayjs/esm/locale/af.js | 39 + node_modules/dayjs/esm/locale/am.js | 40 + node_modules/dayjs/esm/locale/ar-dz.js | 41 + node_modules/dayjs/esm/locale/ar-iq.js | 42 + node_modules/dayjs/esm/locale/ar-kw.js | 41 + node_modules/dayjs/esm/locale/ar-ly.js | 27 + node_modules/dayjs/esm/locale/ar-ma.js | 42 + node_modules/dayjs/esm/locale/ar-sa.js | 41 + node_modules/dayjs/esm/locale/ar-tn.js | 42 + node_modules/dayjs/esm/locale/ar.js | 77 + node_modules/dayjs/esm/locale/az.js | 39 + node_modules/dayjs/esm/locale/be.js | 24 + node_modules/dayjs/esm/locale/bg.js | 55 + node_modules/dayjs/esm/locale/bi.js | 39 + node_modules/dayjs/esm/locale/bm.js | 39 + node_modules/dayjs/esm/locale/bn-bd.js | 81 + node_modules/dayjs/esm/locale/bn.js | 72 + node_modules/dayjs/esm/locale/bo.js | 38 + node_modules/dayjs/esm/locale/br.js | 93 + node_modules/dayjs/esm/locale/bs.js | 24 + node_modules/dayjs/esm/locale/ca.js | 44 + node_modules/dayjs/esm/locale/cs.js | 120 + node_modules/dayjs/esm/locale/cv.js | 24 + node_modules/dayjs/esm/locale/cy.js | 39 + node_modules/dayjs/esm/locale/da.js | 39 + node_modules/dayjs/esm/locale/de-at.js | 63 + node_modules/dayjs/esm/locale/de-ch.js | 63 + node_modules/dayjs/esm/locale/de.js | 64 + node_modules/dayjs/esm/locale/dv.js | 39 + node_modules/dayjs/esm/locale/el.js | 39 + node_modules/dayjs/esm/locale/en-au.js | 39 + node_modules/dayjs/esm/locale/en-ca.js | 38 + node_modules/dayjs/esm/locale/en-gb.js | 42 + node_modules/dayjs/esm/locale/en-ie.js | 39 + node_modules/dayjs/esm/locale/en-il.js | 38 + node_modules/dayjs/esm/locale/en-in.js | 42 + node_modules/dayjs/esm/locale/en-nz.js | 41 + node_modules/dayjs/esm/locale/en-sg.js | 39 + node_modules/dayjs/esm/locale/en-tt.js | 42 + node_modules/dayjs/esm/locale/en.js | 12 + node_modules/dayjs/esm/locale/eo.js | 39 + node_modules/dayjs/esm/locale/es-do.js | 39 + node_modules/dayjs/esm/locale/es-mx.js | 38 + node_modules/dayjs/esm/locale/es-pr.js | 39 + node_modules/dayjs/esm/locale/es-us.js | 38 + node_modules/dayjs/esm/locale/es.js | 39 + node_modules/dayjs/esm/locale/et.js | 65 + node_modules/dayjs/esm/locale/eu.js | 43 + node_modules/dayjs/esm/locale/fa.js | 39 + node_modules/dayjs/esm/locale/fi.js | 88 + node_modules/dayjs/esm/locale/fo.js | 39 + node_modules/dayjs/esm/locale/fr-ca.js | 38 + node_modules/dayjs/esm/locale/fr-ch.js | 39 + node_modules/dayjs/esm/locale/fr.js | 41 + node_modules/dayjs/esm/locale/fy.js | 39 + node_modules/dayjs/esm/locale/ga.js | 39 + node_modules/dayjs/esm/locale/gd.js | 39 + node_modules/dayjs/esm/locale/gl.js | 39 + node_modules/dayjs/esm/locale/gom-latn.js | 25 + node_modules/dayjs/esm/locale/gu.js | 38 + node_modules/dayjs/esm/locale/he.js | 78 + node_modules/dayjs/esm/locale/hi.js | 38 + node_modules/dayjs/esm/locale/hr.js | 53 + node_modules/dayjs/esm/locale/ht.js | 38 + node_modules/dayjs/esm/locale/hu.js | 61 + node_modules/dayjs/esm/locale/hy-am.js | 39 + node_modules/dayjs/esm/locale/id.js | 39 + node_modules/dayjs/esm/locale/index.d.ts | 11 + node_modules/dayjs/esm/locale/is.js | 68 + node_modules/dayjs/esm/locale/it-ch.js | 39 + node_modules/dayjs/esm/locale/it.js | 39 + node_modules/dayjs/esm/locale/ja.js | 45 + node_modules/dayjs/esm/locale/jv.js | 39 + node_modules/dayjs/esm/locale/ka.js | 39 + node_modules/dayjs/esm/locale/kk.js | 39 + node_modules/dayjs/esm/locale/km.js | 39 + node_modules/dayjs/esm/locale/kn.js | 38 + node_modules/dayjs/esm/locale/ko.js | 45 + node_modules/dayjs/esm/locale/ku.js | 77 + node_modules/dayjs/esm/locale/ky.js | 39 + node_modules/dayjs/esm/locale/lb.js | 24 + node_modules/dayjs/esm/locale/lo.js | 38 + node_modules/dayjs/esm/locale/lt.js | 70 + node_modules/dayjs/esm/locale/lv.js | 39 + node_modules/dayjs/esm/locale/me.js | 24 + node_modules/dayjs/esm/locale/mi.js | 39 + node_modules/dayjs/esm/locale/mk.js | 39 + node_modules/dayjs/esm/locale/ml.js | 38 + node_modules/dayjs/esm/locale/mn.js | 38 + node_modules/dayjs/esm/locale/mr.js | 23 + node_modules/dayjs/esm/locale/ms-my.js | 39 + node_modules/dayjs/esm/locale/ms.js | 39 + node_modules/dayjs/esm/locale/mt.js | 39 + node_modules/dayjs/esm/locale/my.js | 39 + node_modules/dayjs/esm/locale/nb.js | 40 + node_modules/dayjs/esm/locale/ne.js | 40 + node_modules/dayjs/esm/locale/nl-be.js | 39 + node_modules/dayjs/esm/locale/nl.js | 40 + node_modules/dayjs/esm/locale/nn.js | 39 + node_modules/dayjs/esm/locale/oc-lnc.js | 39 + node_modules/dayjs/esm/locale/pa-in.js | 38 + node_modules/dayjs/esm/locale/pl.js | 87 + node_modules/dayjs/esm/locale/pt-br.js | 38 + node_modules/dayjs/esm/locale/pt.js | 40 + node_modules/dayjs/esm/locale/rn.js | 39 + node_modules/dayjs/esm/locale/ro.js | 39 + node_modules/dayjs/esm/locale/ru.js | 99 + node_modules/dayjs/esm/locale/rw.js | 35 + node_modules/dayjs/esm/locale/sd.js | 39 + node_modules/dayjs/esm/locale/se.js | 39 + node_modules/dayjs/esm/locale/si.js | 38 + node_modules/dayjs/esm/locale/sk.js | 121 + node_modules/dayjs/esm/locale/sl.js | 141 + node_modules/dayjs/esm/locale/sq.js | 39 + node_modules/dayjs/esm/locale/sr-cyrl.js | 74 + node_modules/dayjs/esm/locale/sr.js | 74 + node_modules/dayjs/esm/locale/ss.js | 39 + node_modules/dayjs/esm/locale/sv-fi.js | 46 + node_modules/dayjs/esm/locale/sv.js | 44 + node_modules/dayjs/esm/locale/sw.js | 39 + node_modules/dayjs/esm/locale/ta.js | 38 + node_modules/dayjs/esm/locale/te.js | 38 + node_modules/dayjs/esm/locale/tet.js | 39 + node_modules/dayjs/esm/locale/tg.js | 39 + node_modules/dayjs/esm/locale/th.js | 38 + node_modules/dayjs/esm/locale/tk.js | 39 + node_modules/dayjs/esm/locale/tl-ph.js | 39 + node_modules/dayjs/esm/locale/tlh.js | 24 + node_modules/dayjs/esm/locale/tr.js | 39 + node_modules/dayjs/esm/locale/types.d.ts | 33 + node_modules/dayjs/esm/locale/tzl.js | 24 + node_modules/dayjs/esm/locale/tzm-latn.js | 39 + node_modules/dayjs/esm/locale/tzm.js | 39 + node_modules/dayjs/esm/locale/ug-cn.js | 39 + node_modules/dayjs/esm/locale/uk.js | 77 + node_modules/dayjs/esm/locale/ur.js | 39 + node_modules/dayjs/esm/locale/uz-latn.js | 39 + node_modules/dayjs/esm/locale/uz.js | 39 + node_modules/dayjs/esm/locale/vi.js | 43 + node_modules/dayjs/esm/locale/x-pseudo.js | 39 + node_modules/dayjs/esm/locale/yo.js | 39 + node_modules/dayjs/esm/locale/zh-cn.js | 67 + node_modules/dayjs/esm/locale/zh-hk.js | 44 + node_modules/dayjs/esm/locale/zh-tw.js | 65 + node_modules/dayjs/esm/locale/zh.js | 67 + .../esm/plugin/advancedFormat/index.d.ts | 4 + .../dayjs/esm/plugin/advancedFormat/index.js | 66 + .../dayjs/esm/plugin/arraySupport/index.d.ts | 10 + .../dayjs/esm/plugin/arraySupport/index.js | 33 + .../dayjs/esm/plugin/badMutable/index.d.ts | 4 + .../dayjs/esm/plugin/badMutable/index.js | 61 + .../dayjs/esm/plugin/bigIntSupport/index.d.ts | 11 + .../dayjs/esm/plugin/bigIntSupport/index.js | 32 + .../dayjs/esm/plugin/buddhistEra/index.d.ts | 4 + .../dayjs/esm/plugin/buddhistEra/index.js | 21 + .../dayjs/esm/plugin/calendar/index.d.ts | 10 + .../dayjs/esm/plugin/calendar/index.js | 32 + .../esm/plugin/customParseFormat/index.d.ts | 8 + .../esm/plugin/customParseFormat/index.js | 320 + .../dayjs/esm/plugin/dayOfYear/index.d.ts | 11 + .../dayjs/esm/plugin/dayOfYear/index.js | 9 + .../dayjs/esm/plugin/devHelper/index.d.ts | 4 + .../dayjs/esm/plugin/devHelper/index.js | 38 + .../dayjs/esm/plugin/duration/index.d.ts | 88 + .../dayjs/esm/plugin/duration/index.js | 356 + .../dayjs/esm/plugin/isBetween/index.d.ts | 10 + .../dayjs/esm/plugin/isBetween/index.js | 10 + .../dayjs/esm/plugin/isLeapYear/index.d.ts | 10 + .../dayjs/esm/plugin/isLeapYear/index.js | 7 + .../dayjs/esm/plugin/isMoment/index.d.ts | 10 + .../dayjs/esm/plugin/isMoment/index.js | 5 + .../dayjs/esm/plugin/isSameOrAfter/index.d.ts | 10 + .../dayjs/esm/plugin/isSameOrAfter/index.js | 5 + .../esm/plugin/isSameOrBefore/index.d.ts | 10 + .../dayjs/esm/plugin/isSameOrBefore/index.js | 5 + .../dayjs/esm/plugin/isToday/index.d.ts | 10 + .../dayjs/esm/plugin/isToday/index.js | 9 + .../dayjs/esm/plugin/isTomorrow/index.d.ts | 10 + .../dayjs/esm/plugin/isTomorrow/index.js | 9 + .../dayjs/esm/plugin/isYesterday/index.d.ts | 10 + .../dayjs/esm/plugin/isYesterday/index.js | 9 + .../dayjs/esm/plugin/isoWeek/index.d.ts | 27 + .../dayjs/esm/plugin/isoWeek/index.js | 57 + .../esm/plugin/isoWeeksInYear/index.d.ts | 10 + .../dayjs/esm/plugin/isoWeeksInYear/index.js | 15 + .../dayjs/esm/plugin/localeData/index.d.ts | 44 + .../dayjs/esm/plugin/localeData/index.js | 114 + .../esm/plugin/localizedFormat/index.d.ts | 4 + .../dayjs/esm/plugin/localizedFormat/index.js | 20 + .../dayjs/esm/plugin/localizedFormat/utils.js | 20 + .../dayjs/esm/plugin/minMax/index.d.ts | 11 + node_modules/dayjs/esm/plugin/minMax/index.js | 39 + .../dayjs/esm/plugin/objectSupport/index.d.ts | 48 + .../dayjs/esm/plugin/objectSupport/index.js | 97 + .../dayjs/esm/plugin/pluralGetSet/index.d.ts | 44 + .../dayjs/esm/plugin/pluralGetSet/index.js | 7 + .../esm/plugin/preParsePostFormat/index.d.ts | 4 + .../esm/plugin/preParsePostFormat/index.js | 40 + .../dayjs/esm/plugin/quarterOfYear/index.d.ts | 26 + .../dayjs/esm/plugin/quarterOfYear/index.js | 41 + .../dayjs/esm/plugin/relativeTime/index.d.ts | 24 + .../dayjs/esm/plugin/relativeTime/index.js | 130 + .../dayjs/esm/plugin/timezone/index.d.ts | 20 + .../dayjs/esm/plugin/timezone/index.js | 189 + .../dayjs/esm/plugin/toArray/index.d.ts | 10 + .../dayjs/esm/plugin/toArray/index.js | 7 + .../dayjs/esm/plugin/toObject/index.d.ts | 20 + .../dayjs/esm/plugin/toObject/index.js | 15 + .../dayjs/esm/plugin/updateLocale/index.d.ts | 8 + .../dayjs/esm/plugin/updateLocale/index.js | 12 + node_modules/dayjs/esm/plugin/utc/index.d.ts | 19 + node_modules/dayjs/esm/plugin/utc/index.js | 188 + .../dayjs/esm/plugin/weekOfYear/index.d.ts | 12 + .../dayjs/esm/plugin/weekOfYear/index.js | 44 + .../dayjs/esm/plugin/weekYear/index.d.ts | 10 + .../dayjs/esm/plugin/weekYear/index.js | 19 + .../dayjs/esm/plugin/weekday/index.d.ts | 12 + .../dayjs/esm/plugin/weekday/index.js | 15 + node_modules/dayjs/esm/utils.js | 58 + node_modules/dayjs/index.d.ts | 429 ++ node_modules/dayjs/locale.json | 1 + node_modules/dayjs/locale/af.js | 1 + node_modules/dayjs/locale/am.js | 1 + node_modules/dayjs/locale/ar-dz.js | 1 + node_modules/dayjs/locale/ar-iq.js | 1 + node_modules/dayjs/locale/ar-kw.js | 1 + node_modules/dayjs/locale/ar-ly.js | 1 + node_modules/dayjs/locale/ar-ma.js | 1 + node_modules/dayjs/locale/ar-sa.js | 1 + node_modules/dayjs/locale/ar-tn.js | 1 + node_modules/dayjs/locale/ar.js | 1 + node_modules/dayjs/locale/az.js | 1 + node_modules/dayjs/locale/be.js | 1 + node_modules/dayjs/locale/bg.js | 1 + node_modules/dayjs/locale/bi.js | 1 + node_modules/dayjs/locale/bm.js | 1 + node_modules/dayjs/locale/bn-bd.js | 1 + node_modules/dayjs/locale/bn.js | 1 + node_modules/dayjs/locale/bo.js | 1 + node_modules/dayjs/locale/br.js | 1 + node_modules/dayjs/locale/bs.js | 1 + node_modules/dayjs/locale/ca.js | 1 + node_modules/dayjs/locale/cs.js | 1 + node_modules/dayjs/locale/cv.js | 1 + node_modules/dayjs/locale/cy.js | 1 + node_modules/dayjs/locale/da.js | 1 + node_modules/dayjs/locale/de-at.js | 1 + node_modules/dayjs/locale/de-ch.js | 1 + node_modules/dayjs/locale/de.js | 1 + node_modules/dayjs/locale/dv.js | 1 + node_modules/dayjs/locale/el.js | 1 + node_modules/dayjs/locale/en-au.js | 1 + node_modules/dayjs/locale/en-ca.js | 1 + node_modules/dayjs/locale/en-gb.js | 1 + node_modules/dayjs/locale/en-ie.js | 1 + node_modules/dayjs/locale/en-il.js | 1 + node_modules/dayjs/locale/en-in.js | 1 + node_modules/dayjs/locale/en-nz.js | 1 + node_modules/dayjs/locale/en-sg.js | 1 + node_modules/dayjs/locale/en-tt.js | 1 + node_modules/dayjs/locale/en.js | 1 + node_modules/dayjs/locale/eo.js | 1 + node_modules/dayjs/locale/es-do.js | 1 + node_modules/dayjs/locale/es-mx.js | 1 + node_modules/dayjs/locale/es-pr.js | 1 + node_modules/dayjs/locale/es-us.js | 1 + node_modules/dayjs/locale/es.js | 1 + node_modules/dayjs/locale/et.js | 1 + node_modules/dayjs/locale/eu.js | 1 + node_modules/dayjs/locale/fa.js | 1 + node_modules/dayjs/locale/fi.js | 1 + node_modules/dayjs/locale/fo.js | 1 + node_modules/dayjs/locale/fr-ca.js | 1 + node_modules/dayjs/locale/fr-ch.js | 1 + node_modules/dayjs/locale/fr.js | 1 + node_modules/dayjs/locale/fy.js | 1 + node_modules/dayjs/locale/ga.js | 1 + node_modules/dayjs/locale/gd.js | 1 + node_modules/dayjs/locale/gl.js | 1 + node_modules/dayjs/locale/gom-latn.js | 1 + node_modules/dayjs/locale/gu.js | 1 + node_modules/dayjs/locale/he.js | 1 + node_modules/dayjs/locale/hi.js | 1 + node_modules/dayjs/locale/hr.js | 1 + node_modules/dayjs/locale/ht.js | 1 + node_modules/dayjs/locale/hu.js | 1 + node_modules/dayjs/locale/hy-am.js | 1 + node_modules/dayjs/locale/id.js | 1 + node_modules/dayjs/locale/index.d.ts | 11 + node_modules/dayjs/locale/is.js | 1 + node_modules/dayjs/locale/it-ch.js | 1 + node_modules/dayjs/locale/it.js | 1 + node_modules/dayjs/locale/ja.js | 1 + node_modules/dayjs/locale/jv.js | 1 + node_modules/dayjs/locale/ka.js | 1 + node_modules/dayjs/locale/kk.js | 1 + node_modules/dayjs/locale/km.js | 1 + node_modules/dayjs/locale/kn.js | 1 + node_modules/dayjs/locale/ko.js | 1 + node_modules/dayjs/locale/ku.js | 1 + node_modules/dayjs/locale/ky.js | 1 + node_modules/dayjs/locale/lb.js | 1 + node_modules/dayjs/locale/lo.js | 1 + node_modules/dayjs/locale/lt.js | 1 + node_modules/dayjs/locale/lv.js | 1 + node_modules/dayjs/locale/me.js | 1 + node_modules/dayjs/locale/mi.js | 1 + node_modules/dayjs/locale/mk.js | 1 + node_modules/dayjs/locale/ml.js | 1 + node_modules/dayjs/locale/mn.js | 1 + node_modules/dayjs/locale/mr.js | 1 + node_modules/dayjs/locale/ms-my.js | 1 + node_modules/dayjs/locale/ms.js | 1 + node_modules/dayjs/locale/mt.js | 1 + node_modules/dayjs/locale/my.js | 1 + node_modules/dayjs/locale/nb.js | 1 + node_modules/dayjs/locale/ne.js | 1 + node_modules/dayjs/locale/nl-be.js | 1 + node_modules/dayjs/locale/nl.js | 1 + node_modules/dayjs/locale/nn.js | 1 + node_modules/dayjs/locale/oc-lnc.js | 1 + node_modules/dayjs/locale/pa-in.js | 1 + node_modules/dayjs/locale/pl.js | 1 + node_modules/dayjs/locale/pt-br.js | 1 + node_modules/dayjs/locale/pt.js | 1 + node_modules/dayjs/locale/rn.js | 1 + node_modules/dayjs/locale/ro.js | 1 + node_modules/dayjs/locale/ru.js | 1 + node_modules/dayjs/locale/rw.js | 1 + node_modules/dayjs/locale/sd.js | 1 + node_modules/dayjs/locale/se.js | 1 + node_modules/dayjs/locale/si.js | 1 + node_modules/dayjs/locale/sk.js | 1 + node_modules/dayjs/locale/sl.js | 1 + node_modules/dayjs/locale/sq.js | 1 + node_modules/dayjs/locale/sr-cyrl.js | 1 + node_modules/dayjs/locale/sr.js | 1 + node_modules/dayjs/locale/ss.js | 1 + node_modules/dayjs/locale/sv-fi.js | 1 + node_modules/dayjs/locale/sv.js | 1 + node_modules/dayjs/locale/sw.js | 1 + node_modules/dayjs/locale/ta.js | 1 + node_modules/dayjs/locale/te.js | 1 + node_modules/dayjs/locale/tet.js | 1 + node_modules/dayjs/locale/tg.js | 1 + node_modules/dayjs/locale/th.js | 1 + node_modules/dayjs/locale/tk.js | 1 + node_modules/dayjs/locale/tl-ph.js | 1 + node_modules/dayjs/locale/tlh.js | 1 + node_modules/dayjs/locale/tr.js | 1 + node_modules/dayjs/locale/types.d.ts | 33 + node_modules/dayjs/locale/tzl.js | 1 + node_modules/dayjs/locale/tzm-latn.js | 1 + node_modules/dayjs/locale/tzm.js | 1 + node_modules/dayjs/locale/ug-cn.js | 1 + node_modules/dayjs/locale/uk.js | 1 + node_modules/dayjs/locale/ur.js | 1 + node_modules/dayjs/locale/uz-latn.js | 1 + node_modules/dayjs/locale/uz.js | 1 + node_modules/dayjs/locale/vi.js | 1 + node_modules/dayjs/locale/x-pseudo.js | 1 + node_modules/dayjs/locale/yo.js | 1 + node_modules/dayjs/locale/zh-cn.js | 1 + node_modules/dayjs/locale/zh-hk.js | 1 + node_modules/dayjs/locale/zh-tw.js | 1 + node_modules/dayjs/locale/zh.js | 1 + node_modules/dayjs/package.json | 84 + node_modules/dayjs/plugin/advancedFormat.d.ts | 4 + node_modules/dayjs/plugin/advancedFormat.js | 1 + node_modules/dayjs/plugin/arraySupport.d.ts | 10 + node_modules/dayjs/plugin/arraySupport.js | 1 + node_modules/dayjs/plugin/badMutable.d.ts | 4 + node_modules/dayjs/plugin/badMutable.js | 1 + node_modules/dayjs/plugin/bigIntSupport.d.ts | 11 + node_modules/dayjs/plugin/bigIntSupport.js | 1 + node_modules/dayjs/plugin/buddhistEra.d.ts | 4 + node_modules/dayjs/plugin/buddhistEra.js | 1 + node_modules/dayjs/plugin/calendar.d.ts | 10 + node_modules/dayjs/plugin/calendar.js | 1 + .../dayjs/plugin/customParseFormat.d.ts | 8 + .../dayjs/plugin/customParseFormat.js | 1 + node_modules/dayjs/plugin/dayOfYear.d.ts | 11 + node_modules/dayjs/plugin/dayOfYear.js | 1 + node_modules/dayjs/plugin/devHelper.d.ts | 4 + node_modules/dayjs/plugin/devHelper.js | 1 + node_modules/dayjs/plugin/duration.d.ts | 88 + node_modules/dayjs/plugin/duration.js | 1 + node_modules/dayjs/plugin/isBetween.d.ts | 10 + node_modules/dayjs/plugin/isBetween.js | 1 + node_modules/dayjs/plugin/isLeapYear.d.ts | 10 + node_modules/dayjs/plugin/isLeapYear.js | 1 + node_modules/dayjs/plugin/isMoment.d.ts | 10 + node_modules/dayjs/plugin/isMoment.js | 1 + node_modules/dayjs/plugin/isSameOrAfter.d.ts | 10 + node_modules/dayjs/plugin/isSameOrAfter.js | 1 + node_modules/dayjs/plugin/isSameOrBefore.d.ts | 10 + node_modules/dayjs/plugin/isSameOrBefore.js | 1 + node_modules/dayjs/plugin/isToday.d.ts | 10 + node_modules/dayjs/plugin/isToday.js | 1 + node_modules/dayjs/plugin/isTomorrow.d.ts | 10 + node_modules/dayjs/plugin/isTomorrow.js | 1 + node_modules/dayjs/plugin/isYesterday.d.ts | 10 + node_modules/dayjs/plugin/isYesterday.js | 1 + node_modules/dayjs/plugin/isoWeek.d.ts | 27 + node_modules/dayjs/plugin/isoWeek.js | 1 + node_modules/dayjs/plugin/isoWeeksInYear.d.ts | 10 + node_modules/dayjs/plugin/isoWeeksInYear.js | 1 + node_modules/dayjs/plugin/localeData.d.ts | 44 + node_modules/dayjs/plugin/localeData.js | 1 + .../dayjs/plugin/localizedFormat.d.ts | 4 + node_modules/dayjs/plugin/localizedFormat.js | 1 + node_modules/dayjs/plugin/minMax.d.ts | 11 + node_modules/dayjs/plugin/minMax.js | 1 + node_modules/dayjs/plugin/objectSupport.d.ts | 48 + node_modules/dayjs/plugin/objectSupport.js | 1 + node_modules/dayjs/plugin/pluralGetSet.d.ts | 44 + node_modules/dayjs/plugin/pluralGetSet.js | 1 + .../dayjs/plugin/preParsePostFormat.d.ts | 4 + .../dayjs/plugin/preParsePostFormat.js | 1 + node_modules/dayjs/plugin/quarterOfYear.d.ts | 26 + node_modules/dayjs/plugin/quarterOfYear.js | 1 + node_modules/dayjs/plugin/relativeTime.d.ts | 24 + node_modules/dayjs/plugin/relativeTime.js | 1 + node_modules/dayjs/plugin/timezone.d.ts | 20 + node_modules/dayjs/plugin/timezone.js | 1 + node_modules/dayjs/plugin/toArray.d.ts | 10 + node_modules/dayjs/plugin/toArray.js | 1 + node_modules/dayjs/plugin/toObject.d.ts | 20 + node_modules/dayjs/plugin/toObject.js | 1 + node_modules/dayjs/plugin/updateLocale.d.ts | 8 + node_modules/dayjs/plugin/updateLocale.js | 1 + node_modules/dayjs/plugin/utc.d.ts | 19 + node_modules/dayjs/plugin/utc.js | 1 + node_modules/dayjs/plugin/weekOfYear.d.ts | 12 + node_modules/dayjs/plugin/weekOfYear.js | 1 + node_modules/dayjs/plugin/weekYear.d.ts | 10 + node_modules/dayjs/plugin/weekYear.js | 1 + node_modules/dayjs/plugin/weekday.d.ts | 12 + node_modules/dayjs/plugin/weekday.js | 1 + node_modules/delayed-stream/.npmignore | 1 + node_modules/delayed-stream/License | 19 + node_modules/delayed-stream/Makefile | 7 + node_modules/delayed-stream/Readme.md | 141 + .../delayed-stream/lib/delayed_stream.js | 107 + node_modules/delayed-stream/package.json | 27 + node_modules/delegates/.npmignore | 1 + node_modules/delegates/History.md | 22 + node_modules/delegates/License | 20 + node_modules/delegates/Makefile | 8 + node_modules/delegates/Readme.md | 94 + node_modules/delegates/index.js | 121 + node_modules/delegates/package.json | 13 + node_modules/delegates/test/index.js | 94 + node_modules/detect-libc/LICENSE | 201 + node_modules/detect-libc/README.md | 163 + node_modules/detect-libc/index.d.ts | 14 + node_modules/detect-libc/lib/detect-libc.js | 279 + node_modules/detect-libc/lib/filesystem.js | 41 + node_modules/detect-libc/lib/process.js | 19 + node_modules/detect-libc/package.json | 40 + node_modules/ecdsa-sig-formatter/CODEOWNERS | 1 + node_modules/ecdsa-sig-formatter/LICENSE | 201 + node_modules/ecdsa-sig-formatter/README.md | 65 + node_modules/ecdsa-sig-formatter/package.json | 46 + .../src/ecdsa-sig-formatter.d.ts | 17 + .../src/ecdsa-sig-formatter.js | 187 + .../src/param-bytes-for-alg.js | 23 + node_modules/emoji-regex/LICENSE-MIT.txt | 20 + node_modules/emoji-regex/README.md | 73 + node_modules/emoji-regex/es2015/index.js | 6 + node_modules/emoji-regex/es2015/text.js | 6 + node_modules/emoji-regex/index.d.ts | 23 + node_modules/emoji-regex/index.js | 6 + node_modules/emoji-regex/package.json | 50 + node_modules/emoji-regex/text.js | 6 + node_modules/follow-redirects/LICENSE | 18 + node_modules/follow-redirects/README.md | 155 + node_modules/follow-redirects/debug.js | 15 + node_modules/follow-redirects/http.js | 1 + node_modules/follow-redirects/https.js | 1 + node_modules/follow-redirects/index.js | 672 ++ node_modules/follow-redirects/package.json | 58 + node_modules/form-data/License | 19 + node_modules/form-data/README.md.bak | 358 + node_modules/form-data/Readme.md | 358 + node_modules/form-data/index.d.ts | 62 + node_modules/form-data/lib/browser.js | 2 + node_modules/form-data/lib/form_data.js | 501 ++ node_modules/form-data/lib/populate.js | 10 + node_modules/form-data/package.json | 68 + node_modules/fs-minipass/LICENSE | 15 + node_modules/fs-minipass/README.md | 70 + node_modules/fs-minipass/index.js | 422 ++ .../fs-minipass/node_modules/minipass/LICENSE | 15 + .../node_modules/minipass/README.md | 728 ++ .../node_modules/minipass/index.d.ts | 155 + .../node_modules/minipass/index.js | 649 ++ .../node_modules/minipass/package.json | 56 + node_modules/fs-minipass/package.json | 39 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 26 + node_modules/gauge/CHANGELOG.md | 163 + node_modules/gauge/LICENSE | 13 + node_modules/gauge/README.md | 402 ++ node_modules/gauge/base-theme.js | 14 + node_modules/gauge/error.js | 24 + node_modules/gauge/has-color.js | 4 + node_modules/gauge/index.js | 233 + node_modules/gauge/package.json | 66 + node_modules/gauge/plumbing.js | 48 + node_modules/gauge/process.js | 3 + node_modules/gauge/progress-bar.js | 35 + node_modules/gauge/render-template.js | 178 + node_modules/gauge/set-immediate.js | 7 + node_modules/gauge/set-interval.js | 3 + node_modules/gauge/spin.js | 5 + node_modules/gauge/template-item.js | 72 + node_modules/gauge/theme-set.js | 114 + node_modules/gauge/themes.js | 56 + node_modules/gauge/wide-truncate.js | 25 + node_modules/glob/LICENSE | 21 + node_modules/glob/README.md | 378 + node_modules/glob/common.js | 238 + node_modules/glob/glob.js | 790 +++ node_modules/glob/package.json | 55 + node_modules/glob/sync.js | 486 ++ node_modules/has-unicode/LICENSE | 14 + node_modules/has-unicode/README.md | 43 + node_modules/has-unicode/index.js | 16 + node_modules/has-unicode/package.json | 30 + node_modules/https-proxy-agent/README.md | 137 + .../https-proxy-agent/dist/agent.d.ts | 30 + node_modules/https-proxy-agent/dist/agent.js | 177 + .../https-proxy-agent/dist/agent.js.map | 1 + .../https-proxy-agent/dist/index.d.ts | 23 + node_modules/https-proxy-agent/dist/index.js | 14 + .../https-proxy-agent/dist/index.js.map | 1 + .../dist/parse-proxy-response.d.ts | 7 + .../dist/parse-proxy-response.js | 66 + .../dist/parse-proxy-response.js.map | 1 + .../node_modules/debug/LICENSE | 20 + .../node_modules/debug/README.md | 481 ++ .../node_modules/debug/package.json | 59 + .../node_modules/debug/src/browser.js | 269 + .../node_modules/debug/src/common.js | 274 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/node.js | 263 + .../node_modules/ms/index.js | 162 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 37 + .../node_modules/ms/readme.md | 60 + node_modules/https-proxy-agent/package.json | 56 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 29 + .../is-fullwidth-code-point/index.d.ts | 17 + node_modules/is-fullwidth-code-point/index.js | 50 + node_modules/is-fullwidth-code-point/license | 9 + .../is-fullwidth-code-point/package.json | 42 + .../is-fullwidth-code-point/readme.md | 39 + node_modules/jsonwebtoken/LICENSE | 21 + node_modules/jsonwebtoken/README.md | 396 ++ node_modules/jsonwebtoken/decode.js | 30 + node_modules/jsonwebtoken/index.js | 8 + .../jsonwebtoken/lib/JsonWebTokenError.js | 14 + .../jsonwebtoken/lib/NotBeforeError.js | 13 + .../jsonwebtoken/lib/TokenExpiredError.js | 13 + .../lib/asymmetricKeyDetailsSupported.js | 3 + node_modules/jsonwebtoken/lib/psSupported.js | 3 + .../lib/rsaPssKeyDetailsSupported.js | 3 + node_modules/jsonwebtoken/lib/timespan.js | 18 + .../jsonwebtoken/lib/validateAsymmetricKey.js | 66 + .../jsonwebtoken/node_modules/ms/index.js | 162 + .../jsonwebtoken/node_modules/ms/license.md | 21 + .../jsonwebtoken/node_modules/ms/package.json | 38 + .../jsonwebtoken/node_modules/ms/readme.md | 59 + node_modules/jsonwebtoken/package.json | 71 + node_modules/jsonwebtoken/sign.js | 253 + node_modules/jsonwebtoken/verify.js | 263 + node_modules/jwa/LICENSE | 17 + node_modules/jwa/README.md | 150 + node_modules/jwa/index.js | 252 + node_modules/jwa/package.json | 37 + node_modules/jws/CHANGELOG.md | 34 + node_modules/jws/LICENSE | 17 + node_modules/jws/index.js | 22 + node_modules/jws/lib/data-stream.js | 55 + node_modules/jws/lib/sign-stream.js | 78 + node_modules/jws/lib/tostring.js | 10 + node_modules/jws/lib/verify-stream.js | 120 + node_modules/jws/package.json | 34 + node_modules/jws/readme.md | 255 + node_modules/lodash.includes/LICENSE | 47 + node_modules/lodash.includes/README.md | 18 + node_modules/lodash.includes/index.js | 745 ++ node_modules/lodash.includes/package.json | 17 + node_modules/lodash.isboolean/LICENSE | 22 + node_modules/lodash.isboolean/README.md | 18 + node_modules/lodash.isboolean/index.js | 70 + node_modules/lodash.isboolean/package.json | 17 + node_modules/lodash.isinteger/LICENSE | 47 + node_modules/lodash.isinteger/README.md | 18 + node_modules/lodash.isinteger/index.js | 265 + node_modules/lodash.isinteger/package.json | 17 + node_modules/lodash.isnumber/LICENSE | 22 + node_modules/lodash.isnumber/README.md | 18 + node_modules/lodash.isnumber/index.js | 79 + node_modules/lodash.isnumber/package.json | 17 + node_modules/lodash.isplainobject/LICENSE | 47 + node_modules/lodash.isplainobject/README.md | 18 + node_modules/lodash.isplainobject/index.js | 139 + .../lodash.isplainobject/package.json | 17 + node_modules/lodash.isstring/LICENSE | 22 + node_modules/lodash.isstring/README.md | 18 + node_modules/lodash.isstring/index.js | 95 + node_modules/lodash.isstring/package.json | 17 + node_modules/lodash.once/LICENSE | 47 + node_modules/lodash.once/README.md | 18 + node_modules/lodash.once/index.js | 294 + node_modules/lodash.once/package.json | 17 + node_modules/make-dir/index.d.ts | 66 + node_modules/make-dir/index.js | 156 + node_modules/make-dir/license | 9 + .../make-dir/node_modules/.bin/semver | 16 + .../make-dir/node_modules/.bin/semver.cmd | 17 + .../make-dir/node_modules/.bin/semver.ps1 | 28 + .../make-dir/node_modules/semver/LICENSE | 15 + .../make-dir/node_modules/semver/README.md | 443 ++ .../node_modules/semver/bin/semver.js | 174 + .../make-dir/node_modules/semver/package.json | 38 + .../make-dir/node_modules/semver/range.bnf | 16 + .../make-dir/node_modules/semver/semver.js | 1643 +++++ node_modules/make-dir/package.json | 59 + node_modules/make-dir/readme.md | 125 + node_modules/minipass/LICENSE | 15 + node_modules/minipass/README.md | 769 ++ node_modules/minipass/index.d.ts | 152 + node_modules/minipass/index.js | 702 ++ node_modules/minipass/index.mjs | 702 ++ node_modules/minipass/package.json | 76 + node_modules/minizlib/LICENSE | 26 + node_modules/minizlib/README.md | 60 + node_modules/minizlib/constants.js | 115 + node_modules/minizlib/index.js | 348 + .../minizlib/node_modules/minipass/LICENSE | 15 + .../minizlib/node_modules/minipass/README.md | 728 ++ .../minizlib/node_modules/minipass/index.d.ts | 155 + .../minizlib/node_modules/minipass/index.js | 649 ++ .../node_modules/minipass/package.json | 56 + node_modules/minizlib/package.json | 42 + node_modules/mkdirp/CHANGELOG.md | 15 + node_modules/mkdirp/LICENSE | 21 + node_modules/mkdirp/bin/cmd.js | 68 + node_modules/mkdirp/index.js | 31 + node_modules/mkdirp/lib/find-made.js | 29 + node_modules/mkdirp/lib/mkdirp-manual.js | 64 + node_modules/mkdirp/lib/mkdirp-native.js | 39 + node_modules/mkdirp/lib/opts-arg.js | 23 + node_modules/mkdirp/lib/path-arg.js | 29 + node_modules/mkdirp/lib/use-native.js | 10 + node_modules/mkdirp/package.json | 44 + node_modules/mkdirp/readme.markdown | 266 + node_modules/node-addon-api/LICENSE.md | 13 + node_modules/node-addon-api/README.md | 317 + node_modules/node-addon-api/common.gypi | 21 + node_modules/node-addon-api/except.gypi | 25 + node_modules/node-addon-api/index.js | 11 + .../node-addon-api/napi-inl.deprecated.h | 186 + node_modules/node-addon-api/napi-inl.h | 6303 +++++++++++++++++ node_modules/node-addon-api/napi.h | 3114 ++++++++ node_modules/node-addon-api/node_api.gyp | 9 + node_modules/node-addon-api/noexcept.gypi | 26 + node_modules/node-addon-api/nothing.c | 0 .../node-addon-api/package-support.json | 21 + node_modules/node-addon-api/package.json | 456 ++ node_modules/node-addon-api/tools/README.md | 73 + .../node-addon-api/tools/check-napi.js | 99 + .../node-addon-api/tools/clang-format.js | 71 + .../node-addon-api/tools/conversion.js | 301 + .../node-addon-api/tools/eslint-format.js | 79 + node_modules/node-fetch/LICENSE.md | 22 + node_modules/node-fetch/README.md | 634 ++ node_modules/node-fetch/browser.js | 25 + node_modules/node-fetch/lib/index.es.js | 1777 +++++ node_modules/node-fetch/lib/index.js | 1787 +++++ node_modules/node-fetch/lib/index.mjs | 1775 +++++ .../node-fetch/node_modules/tr46/.npmignore | 4 + .../node-fetch/node_modules/tr46/index.js | 193 + .../node-fetch/node_modules/tr46/lib/.gitkeep | 0 .../node_modules/tr46/lib/mappingTable.json | 1 + .../node-fetch/node_modules/tr46/package.json | 31 + .../webidl-conversions/LICENSE.md | 12 + .../node_modules/webidl-conversions/README.md | 53 + .../webidl-conversions/lib/index.js | 189 + .../webidl-conversions/package.json | 23 + .../node_modules/whatwg-url/LICENSE.txt | 21 + .../node_modules/whatwg-url/README.md | 67 + .../node_modules/whatwg-url/lib/URL-impl.js | 200 + .../node_modules/whatwg-url/lib/URL.js | 196 + .../node_modules/whatwg-url/lib/public-api.js | 11 + .../whatwg-url/lib/url-state-machine.js | 1297 ++++ .../node_modules/whatwg-url/lib/utils.js | 20 + .../node_modules/whatwg-url/package.json | 32 + node_modules/node-fetch/package.json | 89 + node_modules/npmlog/LICENSE | 15 + node_modules/npmlog/README.md | 216 + node_modules/npmlog/log.js | 403 ++ node_modules/npmlog/package.json | 33 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 42 + node_modules/object-assign/readme.md | 61 + node_modules/once/LICENSE | 15 + node_modules/once/README.md | 79 + node_modules/once/once.js | 42 + node_modules/once/package.json | 33 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 43 + node_modules/path-is-absolute/readme.md | 59 + node_modules/proxy-from-env/.eslintrc | 29 + node_modules/proxy-from-env/.travis.yml | 10 + node_modules/proxy-from-env/LICENSE | 20 + node_modules/proxy-from-env/README.md | 131 + node_modules/proxy-from-env/index.js | 108 + node_modules/proxy-from-env/package.json | 34 + node_modules/proxy-from-env/test.js | 483 ++ node_modules/querystringify/LICENSE | 22 + node_modules/querystringify/README.md | 61 + node_modules/querystringify/index.js | 118 + node_modules/querystringify/package.json | 38 + node_modules/readable-stream/CONTRIBUTING.md | 38 + node_modules/readable-stream/GOVERNANCE.md | 136 + node_modules/readable-stream/LICENSE | 47 + node_modules/readable-stream/README.md | 106 + .../readable-stream/errors-browser.js | 127 + node_modules/readable-stream/errors.js | 116 + .../readable-stream/experimentalWarning.js | 17 + .../readable-stream/lib/_stream_duplex.js | 126 + .../lib/_stream_passthrough.js | 37 + .../readable-stream/lib/_stream_readable.js | 1027 +++ .../readable-stream/lib/_stream_transform.js | 190 + .../readable-stream/lib/_stream_writable.js | 641 ++ .../lib/internal/streams/async_iterator.js | 180 + .../lib/internal/streams/buffer_list.js | 183 + .../lib/internal/streams/destroy.js | 96 + .../lib/internal/streams/end-of-stream.js | 86 + .../lib/internal/streams/from-browser.js | 3 + .../lib/internal/streams/from.js | 52 + .../lib/internal/streams/pipeline.js | 86 + .../lib/internal/streams/state.js | 22 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + node_modules/readable-stream/package.json | 68 + .../readable-stream/readable-browser.js | 9 + node_modules/readable-stream/readable.js | 16 + node_modules/requires-port/.npmignore | 2 + node_modules/requires-port/.travis.yml | 19 + node_modules/requires-port/LICENSE | 22 + node_modules/requires-port/README.md | 47 + node_modules/requires-port/index.js | 38 + node_modules/requires-port/package.json | 47 + node_modules/requires-port/test.js | 98 + node_modules/rimraf/CHANGELOG.md | 65 + node_modules/rimraf/LICENSE | 15 + node_modules/rimraf/README.md | 101 + node_modules/rimraf/bin.js | 68 + node_modules/rimraf/package.json | 32 + node_modules/rimraf/rimraf.js | 360 + node_modules/scmp/.travis.yml | 5 + node_modules/scmp/HISTORY.md | 12 + node_modules/scmp/LICENSE | 24 + node_modules/scmp/README.md | 42 + node_modules/scmp/benchmark/benchmark.js | 26 + node_modules/scmp/benchmark/crypto-check.js | 31 + node_modules/scmp/index.js | 33 + node_modules/scmp/lib/scmpCompare.js | 10 + node_modules/scmp/package.json | 33 + node_modules/scmp/test/test.js | 31 + node_modules/set-blocking/CHANGELOG.md | 26 + node_modules/set-blocking/LICENSE.txt | 14 + node_modules/set-blocking/README.md | 31 + node_modules/set-blocking/index.js | 7 + node_modules/set-blocking/package.json | 42 + node_modules/signal-exit/LICENSE.txt | 16 + node_modules/signal-exit/README.md | 39 + node_modules/signal-exit/index.js | 202 + node_modules/signal-exit/package.json | 38 + node_modules/signal-exit/signals.js | 53 + node_modules/string-width/index.d.ts | 29 + node_modules/string-width/index.js | 47 + node_modules/string-width/license | 9 + node_modules/string-width/package.json | 56 + node_modules/string-width/readme.md | 50 + node_modules/string_decoder/LICENSE | 48 + node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + node_modules/string_decoder/package.json | 34 + node_modules/strip-ansi/index.d.ts | 17 + node_modules/strip-ansi/index.js | 4 + node_modules/strip-ansi/license | 9 + node_modules/strip-ansi/package.json | 54 + node_modules/strip-ansi/readme.md | 46 + node_modules/tar/LICENSE | 15 + node_modules/tar/README.md | 1070 +++ node_modules/tar/index.js | 18 + node_modules/tar/lib/create.js | 111 + node_modules/tar/lib/extract.js | 113 + node_modules/tar/lib/get-write-flag.js | 20 + node_modules/tar/lib/header.js | 304 + node_modules/tar/lib/high-level-opt.js | 29 + node_modules/tar/lib/large-numbers.js | 104 + node_modules/tar/lib/list.js | 139 + node_modules/tar/lib/mkdir.js | 229 + node_modules/tar/lib/mode-fix.js | 27 + node_modules/tar/lib/normalize-unicode.js | 12 + .../tar/lib/normalize-windows-path.js | 8 + node_modules/tar/lib/pack.js | 432 ++ node_modules/tar/lib/parse.js | 552 ++ node_modules/tar/lib/path-reservations.js | 156 + node_modules/tar/lib/pax.js | 150 + node_modules/tar/lib/read-entry.js | 107 + node_modules/tar/lib/replace.js | 246 + node_modules/tar/lib/strip-absolute-path.js | 24 + .../tar/lib/strip-trailing-slashes.js | 13 + node_modules/tar/lib/types.js | 44 + node_modules/tar/lib/unpack.js | 906 +++ node_modules/tar/lib/update.js | 40 + node_modules/tar/lib/warn-mixin.js | 24 + node_modules/tar/lib/winchars.js | 23 + node_modules/tar/lib/write-entry.js | 546 ++ node_modules/tar/package.json | 70 + node_modules/twilio/LICENSE | 21 + node_modules/twilio/README.md | 305 + node_modules/twilio/index.d.ts | 2 + node_modules/twilio/index.js | 9 + node_modules/twilio/lib/base/BaseTwilio.d.ts | 86 + node_modules/twilio/lib/base/BaseTwilio.js | 182 + node_modules/twilio/lib/base/Domain.d.ts | 29 + node_modules/twilio/lib/base/Domain.js | 53 + node_modules/twilio/lib/base/Page.d.ts | 104 + node_modules/twilio/lib/base/Page.js | 192 + .../twilio/lib/base/RequestClient.d.ts | 145 + node_modules/twilio/lib/base/RequestClient.js | 222 + .../twilio/lib/base/RestException.d.ts | 16 + node_modules/twilio/lib/base/RestException.js | 33 + node_modules/twilio/lib/base/Version.d.ts | 129 + node_modules/twilio/lib/base/Version.js | 336 + node_modules/twilio/lib/base/deserialize.d.ts | 41 + node_modules/twilio/lib/base/deserialize.js | 76 + node_modules/twilio/lib/base/serialize.d.ts | 53 + node_modules/twilio/lib/base/serialize.js | 122 + node_modules/twilio/lib/base/utility.d.ts | 2 + node_modules/twilio/lib/base/utility.js | 13 + node_modules/twilio/lib/base/values.d.ts | 10 + node_modules/twilio/lib/base/values.js | 16 + node_modules/twilio/lib/http/request.d.ts | 25 + node_modules/twilio/lib/http/request.js | 85 + node_modules/twilio/lib/http/response.d.ts | 7 + node_modules/twilio/lib/http/response.js | 13 + node_modules/twilio/lib/index.d.ts | 55 + node_modules/twilio/lib/index.js | 70 + node_modules/twilio/lib/interfaces.d.ts | 94 + node_modules/twilio/lib/interfaces.js | 2 + node_modules/twilio/lib/jwt/AccessToken.d.ts | 186 + node_modules/twilio/lib/jwt/AccessToken.js | 256 + .../twilio/lib/jwt/ClientCapability.d.ts | 61 + .../twilio/lib/jwt/ClientCapability.js | 122 + .../jwt/taskrouter/TaskRouterCapability.d.ts | 74 + .../jwt/taskrouter/TaskRouterCapability.js | 101 + .../twilio/lib/jwt/taskrouter/util.d.ts | 66 + .../twilio/lib/jwt/taskrouter/util.js | 169 + node_modules/twilio/lib/rest/Accounts.d.ts | 19 + node_modules/twilio/lib/rest/Accounts.js | 29 + .../twilio/lib/rest/AccountsBase.d.ts | 13 + node_modules/twilio/lib/rest/AccountsBase.js | 31 + node_modules/twilio/lib/rest/Api.d.ts | 127 + node_modules/twilio/lib/rest/Api.js | 182 + node_modules/twilio/lib/rest/ApiBase.d.ts | 13 + node_modules/twilio/lib/rest/ApiBase.js | 31 + node_modules/twilio/lib/rest/Bulkexports.d.ts | 14 + node_modules/twilio/lib/rest/Bulkexports.js | 22 + .../twilio/lib/rest/BulkexportsBase.d.ts | 13 + .../twilio/lib/rest/BulkexportsBase.js | 31 + node_modules/twilio/lib/rest/Chat.d.ts | 19 + node_modules/twilio/lib/rest/Chat.js | 29 + node_modules/twilio/lib/rest/ChatBase.d.ts | 19 + node_modules/twilio/lib/rest/ChatBase.js | 41 + node_modules/twilio/lib/rest/Content.d.ts | 9 + node_modules/twilio/lib/rest/Content.js | 15 + node_modules/twilio/lib/rest/ContentBase.d.ts | 13 + node_modules/twilio/lib/rest/ContentBase.js | 31 + .../twilio/lib/rest/Conversations.d.ts | 44 + node_modules/twilio/lib/rest/Conversations.js | 64 + .../twilio/lib/rest/ConversationsBase.d.ts | 13 + .../twilio/lib/rest/ConversationsBase.js | 31 + node_modules/twilio/lib/rest/Events.d.ts | 24 + node_modules/twilio/lib/rest/Events.js | 36 + node_modules/twilio/lib/rest/EventsBase.d.ts | 13 + node_modules/twilio/lib/rest/EventsBase.js | 31 + node_modules/twilio/lib/rest/FlexApi.d.ts | 39 + node_modules/twilio/lib/rest/FlexApi.js | 57 + node_modules/twilio/lib/rest/FlexApiBase.d.ts | 16 + node_modules/twilio/lib/rest/FlexApiBase.js | 36 + .../twilio/lib/rest/FrontlineApi.d.ts | 9 + node_modules/twilio/lib/rest/FrontlineApi.js | 15 + .../twilio/lib/rest/FrontlineApiBase.d.ts | 13 + .../twilio/lib/rest/FrontlineApiBase.js | 31 + node_modules/twilio/lib/rest/Insights.d.ts | 29 + node_modules/twilio/lib/rest/Insights.js | 43 + .../twilio/lib/rest/InsightsBase.d.ts | 13 + node_modules/twilio/lib/rest/InsightsBase.js | 31 + .../twilio/lib/rest/Intelligence.d.ts | 4 + node_modules/twilio/lib/rest/Intelligence.js | 8 + .../twilio/lib/rest/IntelligenceBase.d.ts | 13 + .../twilio/lib/rest/IntelligenceBase.js | 31 + node_modules/twilio/lib/rest/IpMessaging.d.ts | 14 + node_modules/twilio/lib/rest/IpMessaging.js | 22 + .../twilio/lib/rest/IpMessagingBase.d.ts | 16 + .../twilio/lib/rest/IpMessagingBase.js | 36 + node_modules/twilio/lib/rest/Lookups.d.ts | 9 + node_modules/twilio/lib/rest/Lookups.js | 15 + node_modules/twilio/lib/rest/LookupsBase.d.ts | 16 + node_modules/twilio/lib/rest/LookupsBase.js | 36 + node_modules/twilio/lib/rest/Media.d.ts | 4 + node_modules/twilio/lib/rest/Media.js | 8 + node_modules/twilio/lib/rest/MediaBase.d.ts | 13 + node_modules/twilio/lib/rest/MediaBase.js | 31 + node_modules/twilio/lib/rest/Messaging.d.ts | 39 + node_modules/twilio/lib/rest/Messaging.js | 57 + .../twilio/lib/rest/MessagingBase.d.ts | 13 + node_modules/twilio/lib/rest/MessagingBase.js | 31 + node_modules/twilio/lib/rest/Microvisor.d.ts | 14 + node_modules/twilio/lib/rest/Microvisor.js | 22 + .../twilio/lib/rest/MicrovisorBase.d.ts | 13 + .../twilio/lib/rest/MicrovisorBase.js | 31 + node_modules/twilio/lib/rest/Monitor.d.ts | 14 + node_modules/twilio/lib/rest/Monitor.js | 22 + node_modules/twilio/lib/rest/MonitorBase.d.ts | 13 + node_modules/twilio/lib/rest/MonitorBase.js | 31 + node_modules/twilio/lib/rest/Notify.d.ts | 14 + node_modules/twilio/lib/rest/Notify.js | 22 + node_modules/twilio/lib/rest/NotifyBase.d.ts | 13 + node_modules/twilio/lib/rest/NotifyBase.js | 31 + node_modules/twilio/lib/rest/Numbers.d.ts | 9 + node_modules/twilio/lib/rest/Numbers.js | 15 + node_modules/twilio/lib/rest/NumbersBase.d.ts | 16 + node_modules/twilio/lib/rest/NumbersBase.js | 36 + node_modules/twilio/lib/rest/Preview.d.ts | 49 + node_modules/twilio/lib/rest/Preview.js | 71 + node_modules/twilio/lib/rest/PreviewBase.d.ts | 25 + node_modules/twilio/lib/rest/PreviewBase.js | 52 + node_modules/twilio/lib/rest/Pricing.d.ts | 29 + node_modules/twilio/lib/rest/Pricing.js | 43 + node_modules/twilio/lib/rest/PricingBase.d.ts | 16 + node_modules/twilio/lib/rest/PricingBase.js | 36 + node_modules/twilio/lib/rest/Proxy.d.ts | 9 + node_modules/twilio/lib/rest/Proxy.js | 15 + node_modules/twilio/lib/rest/ProxyBase.d.ts | 13 + node_modules/twilio/lib/rest/ProxyBase.js | 31 + node_modules/twilio/lib/rest/Routes.d.ts | 19 + node_modules/twilio/lib/rest/Routes.js | 29 + node_modules/twilio/lib/rest/RoutesBase.d.ts | 13 + node_modules/twilio/lib/rest/RoutesBase.js | 31 + node_modules/twilio/lib/rest/Serverless.d.ts | 9 + node_modules/twilio/lib/rest/Serverless.js | 15 + .../twilio/lib/rest/ServerlessBase.d.ts | 13 + .../twilio/lib/rest/ServerlessBase.js | 31 + node_modules/twilio/lib/rest/Studio.d.ts | 14 + node_modules/twilio/lib/rest/Studio.js | 22 + node_modules/twilio/lib/rest/StudioBase.d.ts | 16 + node_modules/twilio/lib/rest/StudioBase.js | 36 + node_modules/twilio/lib/rest/Supersim.d.ts | 49 + node_modules/twilio/lib/rest/Supersim.js | 71 + .../twilio/lib/rest/SupersimBase.d.ts | 13 + node_modules/twilio/lib/rest/SupersimBase.js | 31 + node_modules/twilio/lib/rest/Sync.d.ts | 9 + node_modules/twilio/lib/rest/Sync.js | 15 + node_modules/twilio/lib/rest/SyncBase.d.ts | 13 + node_modules/twilio/lib/rest/SyncBase.js | 31 + node_modules/twilio/lib/rest/Taskrouter.d.ts | 9 + node_modules/twilio/lib/rest/Taskrouter.js | 15 + .../twilio/lib/rest/TaskrouterBase.d.ts | 13 + .../twilio/lib/rest/TaskrouterBase.js | 31 + node_modules/twilio/lib/rest/Trunking.d.ts | 9 + node_modules/twilio/lib/rest/Trunking.js | 15 + .../twilio/lib/rest/TrunkingBase.d.ts | 13 + node_modules/twilio/lib/rest/TrunkingBase.js | 31 + node_modules/twilio/lib/rest/Trusthub.d.ts | 39 + node_modules/twilio/lib/rest/Trusthub.js | 57 + .../twilio/lib/rest/TrusthubBase.d.ts | 13 + node_modules/twilio/lib/rest/TrusthubBase.js | 31 + node_modules/twilio/lib/rest/Twilio.d.ts | 267 + node_modules/twilio/lib/rest/Twilio.js | 313 + node_modules/twilio/lib/rest/Verify.d.ts | 29 + node_modules/twilio/lib/rest/Verify.js | 43 + node_modules/twilio/lib/rest/VerifyBase.d.ts | 13 + node_modules/twilio/lib/rest/VerifyBase.js | 31 + node_modules/twilio/lib/rest/Video.d.ts | 34 + node_modules/twilio/lib/rest/Video.js | 50 + node_modules/twilio/lib/rest/VideoBase.d.ts | 13 + node_modules/twilio/lib/rest/VideoBase.js | 31 + node_modules/twilio/lib/rest/Voice.d.ts | 34 + node_modules/twilio/lib/rest/Voice.js | 50 + node_modules/twilio/lib/rest/VoiceBase.d.ts | 13 + node_modules/twilio/lib/rest/VoiceBase.js | 31 + node_modules/twilio/lib/rest/Wireless.d.ts | 24 + node_modules/twilio/lib/rest/Wireless.js | 36 + .../twilio/lib/rest/WirelessBase.d.ts | 13 + node_modules/twilio/lib/rest/WirelessBase.js | 31 + node_modules/twilio/lib/rest/accounts/V1.d.ts | 30 + node_modules/twilio/lib/rest/accounts/V1.js | 56 + .../rest/accounts/v1/authTokenPromotion.d.ts | 105 + .../rest/accounts/v1/authTokenPromotion.js | 109 + .../lib/rest/accounts/v1/credential.d.ts | 22 + .../twilio/lib/rest/accounts/v1/credential.js | 51 + .../lib/rest/accounts/v1/credential/aws.d.ts | 296 + .../lib/rest/accounts/v1/credential/aws.js | 251 + .../accounts/v1/credential/publicKey.d.ts | 296 + .../rest/accounts/v1/credential/publicKey.js | 252 + .../twilio/lib/rest/accounts/v1/safelist.d.ts | 107 + .../twilio/lib/rest/accounts/v1/safelist.js | 119 + .../rest/accounts/v1/secondaryAuthToken.d.ts | 122 + .../rest/accounts/v1/secondaryAuthToken.js | 128 + node_modules/twilio/lib/rest/api/V2010.d.ts | 20 + node_modules/twilio/lib/rest/api/V2010.js | 42 + .../twilio/lib/rest/api/v2010/account.d.ts | 509 ++ .../twilio/lib/rest/api/v2010/account.js | 546 ++ .../lib/rest/api/v2010/account/address.d.ts | 414 ++ .../lib/rest/api/v2010/account/address.js | 338 + .../account/address/dependentPhoneNumber.d.ts | 290 + .../account/address/dependentPhoneNumber.js | 175 + .../rest/api/v2010/account/application.d.ts | 458 ++ .../lib/rest/api/v2010/account/application.js | 349 + .../v2010/account/authorizedConnectApp.d.ts | 232 + .../api/v2010/account/authorizedConnectApp.js | 194 + .../account/availablePhoneNumberCountry.d.ts | 269 + .../account/availablePhoneNumberCountry.js | 279 + .../availablePhoneNumberCountry/local.d.ts | 322 + .../availablePhoneNumberCountry/local.js | 185 + .../machineToMachine.d.ts | 322 + .../machineToMachine.js | 185 + .../availablePhoneNumberCountry/mobile.d.ts | 322 + .../availablePhoneNumberCountry/mobile.js | 185 + .../availablePhoneNumberCountry/national.d.ts | 322 + .../availablePhoneNumberCountry/national.js | 185 + .../sharedCost.d.ts | 322 + .../availablePhoneNumberCountry/sharedCost.js | 185 + .../availablePhoneNumberCountry/tollFree.d.ts | 322 + .../availablePhoneNumberCountry/tollFree.js | 185 + .../availablePhoneNumberCountry/voip.d.ts | 322 + .../availablePhoneNumberCountry/voip.js | 185 + .../lib/rest/api/v2010/account/balance.d.ts | 58 + .../lib/rest/api/v2010/account/balance.js | 70 + .../lib/rest/api/v2010/account/call.d.ts | 633 ++ .../twilio/lib/rest/api/v2010/account/call.js | 531 ++ .../rest/api/v2010/account/call/event.d.ts | 150 + .../lib/rest/api/v2010/account/call/event.js | 127 + .../rest/api/v2010/account/call/feedback.d.ts | 160 + .../rest/api/v2010/account/call/feedback.js | 154 + .../v2010/account/call/feedbackSummary.d.ts | 201 + .../api/v2010/account/call/feedbackSummary.js | 189 + .../api/v2010/account/call/notification.d.ts | 311 + .../api/v2010/account/call/notification.js | 223 + .../rest/api/v2010/account/call/payment.d.ts | 182 + .../rest/api/v2010/account/call/payment.js | 198 + .../api/v2010/account/call/recording.d.ts | 386 + .../rest/api/v2010/account/call/recording.js | 303 + .../rest/api/v2010/account/call/siprec.d.ts | 559 ++ .../lib/rest/api/v2010/account/call/siprec.js | 562 ++ .../rest/api/v2010/account/call/stream.d.ts | 551 ++ .../lib/rest/api/v2010/account/call/stream.js | 560 ++ .../account/call/userDefinedMessage.d.ts | 75 + .../v2010/account/call/userDefinedMessage.js | 89 + .../call/userDefinedMessageSubscription.d.ts | 130 + .../call/userDefinedMessageSubscription.js | 150 + .../rest/api/v2010/account/conference.d.ts | 362 + .../lib/rest/api/v2010/account/conference.js | 272 + .../v2010/account/conference/participant.d.ts | 476 ++ .../v2010/account/conference/participant.js | 411 ++ .../v2010/account/conference/recording.d.ts | 346 + .../api/v2010/account/conference/recording.js | 267 + .../rest/api/v2010/account/connectApp.d.ts | 323 + .../lib/rest/api/v2010/account/connectApp.js | 257 + .../v2010/account/incomingPhoneNumber.d.ts | 588 ++ .../api/v2010/account/incomingPhoneNumber.js | 450 ++ .../incomingPhoneNumber/assignedAddOn.d.ts | 292 + .../incomingPhoneNumber/assignedAddOn.js | 257 + .../assignedAddOn/assignedAddOnExtension.d.ts | 241 + .../assignedAddOn/assignedAddOnExtension.js | 210 + .../account/incomingPhoneNumber/local.d.ts | 412 ++ .../account/incomingPhoneNumber/local.js | 261 + .../account/incomingPhoneNumber/mobile.d.ts | 412 ++ .../account/incomingPhoneNumber/mobile.js | 261 + .../account/incomingPhoneNumber/tollFree.d.ts | 412 ++ .../account/incomingPhoneNumber/tollFree.js | 261 + .../lib/rest/api/v2010/account/key.d.ts | 266 + .../twilio/lib/rest/api/v2010/account/key.js | 229 + .../lib/rest/api/v2010/account/message.d.ts | 471 ++ .../lib/rest/api/v2010/account/message.js | 364 + .../api/v2010/account/message/feedback.d.ts | 91 + .../api/v2010/account/message/feedback.js | 93 + .../rest/api/v2010/account/message/media.d.ts | 262 + .../rest/api/v2010/account/message/media.js | 220 + .../lib/rest/api/v2010/account/newKey.d.ts | 86 + .../lib/rest/api/v2010/account/newKey.js | 88 + .../rest/api/v2010/account/newSigningKey.d.ts | 86 + .../rest/api/v2010/account/newSigningKey.js | 88 + .../rest/api/v2010/account/notification.d.ts | 309 + .../rest/api/v2010/account/notification.js | 217 + .../api/v2010/account/outgoingCallerId.d.ts | 296 + .../api/v2010/account/outgoingCallerId.js | 239 + .../lib/rest/api/v2010/account/queue.d.ts | 324 + .../lib/rest/api/v2010/account/queue.js | 278 + .../rest/api/v2010/account/queue/member.d.ts | 249 + .../rest/api/v2010/account/queue/member.js | 220 + .../lib/rest/api/v2010/account/recording.d.ts | 387 + .../lib/rest/api/v2010/account/recording.js | 276 + .../v2010/account/recording/addOnResult.d.ts | 268 + .../v2010/account/recording/addOnResult.js | 233 + .../recording/addOnResult/payload.d.ts | 270 + .../account/recording/addOnResult/payload.js | 233 + .../account/recording/transcription.d.ts | 278 + .../v2010/account/recording/transcription.js | 226 + .../lib/rest/api/v2010/account/shortCode.d.ts | 319 + .../lib/rest/api/v2010/account/shortCode.js | 240 + .../rest/api/v2010/account/signingKey.d.ts | 254 + .../lib/rest/api/v2010/account/signingKey.js | 229 + .../lib/rest/api/v2010/account/sip.d.ts | 26 + .../twilio/lib/rest/api/v2010/account/sip.js | 64 + .../api/v2010/account/sip/credentialList.d.ts | 292 + .../api/v2010/account/sip/credentialList.js | 269 + .../sip/credentialList/credential.d.ts | 304 + .../account/sip/credentialList/credential.js | 266 + .../rest/api/v2010/account/sip/domain.d.ts | 456 ++ .../lib/rest/api/v2010/account/sip/domain.js | 371 + .../v2010/account/sip/domain/authTypes.d.ts | 24 + .../api/v2010/account/sip/domain/authTypes.js | 58 + .../sip/domain/authTypes/authTypeCalls.d.ts | 24 + .../sip/domain/authTypes/authTypeCalls.js | 60 + .../authCallsCredentialListMapping.d.ts | 248 + .../authCallsCredentialListMapping.js | 232 + .../authCallsIpAccessControlListMapping.d.ts | 248 + .../authCallsIpAccessControlListMapping.js | 232 + .../authTypes/authTypeRegistrations.d.ts | 21 + .../domain/authTypes/authTypeRegistrations.js | 50 + ...uthRegistrationsCredentialListMapping.d.ts | 248 + .../authRegistrationsCredentialListMapping.js | 232 + .../sip/domain/credentialListMapping.d.ts | 260 + .../sip/domain/credentialListMapping.js | 236 + .../domain/ipAccessControlListMapping.d.ts | 260 + .../sip/domain/ipAccessControlListMapping.js | 236 + .../account/sip/ipAccessControlList.d.ts | 292 + .../v2010/account/sip/ipAccessControlList.js | 269 + .../sip/ipAccessControlList/ipAddress.d.ts | 322 + .../sip/ipAccessControlList/ipAddress.js | 281 + .../lib/rest/api/v2010/account/token.d.ts | 104 + .../lib/rest/api/v2010/account/token.js | 95 + .../rest/api/v2010/account/transcription.d.ts | 276 + .../rest/api/v2010/account/transcription.js | 220 + .../lib/rest/api/v2010/account/usage.d.ts | 24 + .../lib/rest/api/v2010/account/usage.js | 55 + .../rest/api/v2010/account/usage/record.d.ts | 273 + .../rest/api/v2010/account/usage/record.js | 230 + .../v2010/account/usage/record/allTime.d.ts | 249 + .../api/v2010/account/usage/record/allTime.js | 158 + .../api/v2010/account/usage/record/daily.d.ts | 249 + .../api/v2010/account/usage/record/daily.js | 158 + .../v2010/account/usage/record/lastMonth.d.ts | 249 + .../v2010/account/usage/record/lastMonth.js | 158 + .../v2010/account/usage/record/monthly.d.ts | 249 + .../api/v2010/account/usage/record/monthly.js | 158 + .../v2010/account/usage/record/thisMonth.d.ts | 249 + .../v2010/account/usage/record/thisMonth.js | 158 + .../api/v2010/account/usage/record/today.d.ts | 249 + .../api/v2010/account/usage/record/today.js | 158 + .../v2010/account/usage/record/yearly.d.ts | 249 + .../api/v2010/account/usage/record/yearly.js | 158 + .../v2010/account/usage/record/yesterday.d.ts | 249 + .../v2010/account/usage/record/yesterday.js | 158 + .../rest/api/v2010/account/usage/trigger.d.ts | 382 + .../rest/api/v2010/account/usage/trigger.js | 302 + .../api/v2010/account/validationRequest.d.ts | 88 + .../api/v2010/account/validationRequest.js | 96 + .../twilio/lib/rest/bulkexports/V1.d.ts | 20 + .../twilio/lib/rest/bulkexports/V1.js | 43 + .../lib/rest/bulkexports/v1/export.d.ts | 113 + .../twilio/lib/rest/bulkexports/v1/export.js | 144 + .../lib/rest/bulkexports/v1/export/day.d.ts | 216 + .../lib/rest/bulkexports/v1/export/day.js | 187 + .../v1/export/exportCustomJob.d.ts | 229 + .../bulkexports/v1/export/exportCustomJob.js | 178 + .../lib/rest/bulkexports/v1/export/job.d.ts | 162 + .../lib/rest/bulkexports/v1/export/job.js | 146 + .../bulkexports/v1/exportConfiguration.d.ts | 152 + .../bulkexports/v1/exportConfiguration.js | 145 + node_modules/twilio/lib/rest/chat/V1.d.ts | 20 + node_modules/twilio/lib/rest/chat/V1.js | 42 + node_modules/twilio/lib/rest/chat/V2.d.ts | 20 + node_modules/twilio/lib/rest/chat/V2.js | 42 + node_modules/twilio/lib/rest/chat/V3.d.ts | 15 + node_modules/twilio/lib/rest/chat/V3.js | 36 + .../twilio/lib/rest/chat/v1/credential.d.ts | 324 + .../twilio/lib/rest/chat/v1/credential.js | 274 + .../twilio/lib/rest/chat/v1/service.d.ts | 512 ++ .../twilio/lib/rest/chat/v1/service.js | 454 ++ .../lib/rest/chat/v1/service/channel.d.ts | 388 + .../lib/rest/chat/v1/service/channel.js | 323 + .../rest/chat/v1/service/channel/invite.d.ts | 286 + .../rest/chat/v1/service/channel/invite.js | 245 + .../rest/chat/v1/service/channel/member.d.ts | 336 + .../rest/chat/v1/service/channel/member.js | 276 + .../rest/chat/v1/service/channel/message.d.ts | 351 + .../rest/chat/v1/service/channel/message.js | 282 + .../twilio/lib/rest/chat/v1/service/role.d.ts | 298 + .../twilio/lib/rest/chat/v1/service/role.js | 267 + .../twilio/lib/rest/chat/v1/service/user.d.ts | 360 + .../twilio/lib/rest/chat/v1/service/user.js | 293 + .../chat/v1/service/user/userChannel.d.ts | 184 + .../rest/chat/v1/service/user/userChannel.js | 139 + .../twilio/lib/rest/chat/v2/credential.d.ts | 324 + .../twilio/lib/rest/chat/v2/credential.js | 274 + .../twilio/lib/rest/chat/v2/service.d.ts | 486 ++ .../twilio/lib/rest/chat/v2/service.js | 401 ++ .../lib/rest/chat/v2/service/binding.d.ts | 282 + .../lib/rest/chat/v2/service/binding.js | 222 + .../lib/rest/chat/v2/service/channel.d.ts | 438 ++ .../lib/rest/chat/v2/service/channel.js | 358 + .../rest/chat/v2/service/channel/invite.d.ts | 286 + .../rest/chat/v2/service/channel/invite.js | 245 + .../rest/chat/v2/service/channel/member.d.ts | 390 + .../rest/chat/v2/service/channel/member.js | 306 + .../rest/chat/v2/service/channel/message.d.ts | 423 ++ .../rest/chat/v2/service/channel/message.js | 316 + .../rest/chat/v2/service/channel/webhook.d.ts | 338 + .../rest/chat/v2/service/channel/webhook.js | 288 + .../twilio/lib/rest/chat/v2/service/role.d.ts | 298 + .../twilio/lib/rest/chat/v2/service/role.js | 267 + .../twilio/lib/rest/chat/v2/service/user.d.ts | 373 + .../twilio/lib/rest/chat/v2/service/user.js | 310 + .../chat/v2/service/user/userBinding.d.ts | 278 + .../rest/chat/v2/service/user/userBinding.js | 226 + .../chat/v2/service/user/userChannel.d.ts | 336 + .../rest/chat/v2/service/user/userChannel.js | 263 + .../twilio/lib/rest/chat/v3/channel.d.ts | 189 + .../twilio/lib/rest/chat/v3/channel.js | 149 + node_modules/twilio/lib/rest/content/V1.d.ts | 25 + node_modules/twilio/lib/rest/content/V1.js | 50 + .../twilio/lib/rest/content/v1/content.d.ts | 266 + .../twilio/lib/rest/content/v1/content.js | 221 + .../content/v1/content/approvalFetch.d.ts | 101 + .../rest/content/v1/content/approvalFetch.js | 115 + .../rest/content/v1/contentAndApprovals.d.ts | 190 + .../rest/content/v1/contentAndApprovals.js | 134 + .../lib/rest/content/v1/legacyContent.d.ts | 202 + .../lib/rest/content/v1/legacyContent.js | 138 + .../twilio/lib/rest/conversations/V1.d.ts | 50 + .../twilio/lib/rest/conversations/V1.js | 82 + .../v1/addressConfiguration.d.ts | 363 + .../conversations/v1/addressConfiguration.js | 302 + .../rest/conversations/v1/configuration.d.ts | 168 + .../rest/conversations/v1/configuration.js | 155 + .../v1/configuration/webhook.d.ts | 163 + .../conversations/v1/configuration/webhook.js | 147 + .../rest/conversations/v1/conversation.d.ts | 455 ++ .../lib/rest/conversations/v1/conversation.js | 359 + .../v1/conversation/message.d.ts | 427 ++ .../conversations/v1/conversation/message.js | 325 + .../conversation/message/deliveryReceipt.d.ts | 249 + .../conversation/message/deliveryReceipt.js | 203 + .../v1/conversation/participant.d.ts | 398 ++ .../v1/conversation/participant.js | 312 + .../v1/conversation/webhook.d.ts | 328 + .../conversations/v1/conversation/webhook.js | 278 + .../lib/rest/conversations/v1/credential.d.ts | 326 + .../lib/rest/conversations/v1/credential.js | 276 + .../v1/participantConversation.d.ts | 242 + .../v1/participantConversation.js | 152 + .../lib/rest/conversations/v1/role.d.ts | 296 + .../twilio/lib/rest/conversations/v1/role.js | 260 + .../lib/rest/conversations/v1/service.d.ts | 304 + .../lib/rest/conversations/v1/service.js | 299 + .../conversations/v1/service/binding.d.ts | 276 + .../rest/conversations/v1/service/binding.js | 220 + .../v1/service/configuration.d.ts | 173 + .../conversations/v1/service/configuration.js | 174 + .../service/configuration/notification.d.ts | 185 + .../v1/service/configuration/notification.js | 176 + .../v1/service/configuration/webhook.d.ts | 165 + .../v1/service/configuration/webhook.js | 154 + .../v1/service/conversation.d.ts | 457 ++ .../conversations/v1/service/conversation.js | 367 + .../v1/service/conversation/message.d.ts | 435 ++ .../v1/service/conversation/message.js | 333 + .../conversation/message/deliveryReceipt.d.ts | 257 + .../conversation/message/deliveryReceipt.js | 216 + .../v1/service/conversation/participant.d.ts | 406 ++ .../v1/service/conversation/participant.js | 320 + .../v1/service/conversation/webhook.d.ts | 336 + .../v1/service/conversation/webhook.js | 286 + .../v1/service/participantConversation.d.ts | 243 + .../v1/service/participantConversation.js | 156 + .../rest/conversations/v1/service/role.d.ts | 298 + .../lib/rest/conversations/v1/service/role.js | 267 + .../rest/conversations/v1/service/user.d.ts | 381 + .../lib/rest/conversations/v1/service/user.js | 301 + .../v1/service/user/userConversation.d.ts | 349 + .../v1/service/user/userConversation.js | 271 + .../lib/rest/conversations/v1/user.d.ts | 379 + .../twilio/lib/rest/conversations/v1/user.js | 294 + .../v1/user/userConversation.d.ts | 347 + .../conversations/v1/user/userConversation.js | 264 + node_modules/twilio/lib/rest/events/V1.d.ts | 30 + node_modules/twilio/lib/rest/events/V1.js | 54 + .../twilio/lib/rest/events/v1/eventType.d.ts | 226 + .../twilio/lib/rest/events/v1/eventType.js | 185 + .../twilio/lib/rest/events/v1/schema.d.ts | 114 + .../twilio/lib/rest/events/v1/schema.js | 126 + .../rest/events/v1/schema/schemaVersion.d.ts | 210 + .../rest/events/v1/schema/schemaVersion.js | 185 + .../twilio/lib/rest/events/v1/sink.d.ts | 322 + .../twilio/lib/rest/events/v1/sink.js | 289 + .../lib/rest/events/v1/sink/sinkTest.d.ts | 46 + .../lib/rest/events/v1/sink/sinkTest.js | 66 + .../lib/rest/events/v1/sink/sinkValidate.d.ts | 54 + .../lib/rest/events/v1/sink/sinkValidate.js | 78 + .../lib/rest/events/v1/subscription.d.ts | 324 + .../twilio/lib/rest/events/v1/subscription.js | 277 + .../v1/subscription/subscribedEvent.d.ts | 290 + .../events/v1/subscription/subscribedEvent.js | 254 + node_modules/twilio/lib/rest/flexApi/V1.d.ts | 105 + node_modules/twilio/lib/rest/flexApi/V1.js | 165 + node_modules/twilio/lib/rest/flexApi/V2.d.ts | 15 + node_modules/twilio/lib/rest/flexApi/V2.js | 36 + .../lib/rest/flexApi/v1/assessments.d.ts | 322 + .../twilio/lib/rest/flexApi/v1/assessments.js | 277 + .../twilio/lib/rest/flexApi/v1/channel.d.ts | 280 + .../twilio/lib/rest/flexApi/v1/channel.js | 251 + .../lib/rest/flexApi/v1/configuration.d.ts | 392 + .../lib/rest/flexApi/v1/configuration.js | 203 + .../twilio/lib/rest/flexApi/v1/flexFlow.d.ts | 406 ++ .../twilio/lib/rest/flexApi/v1/flexFlow.js | 336 + .../v1/insightsAssessmentsComment.d.ts | 251 + .../flexApi/v1/insightsAssessmentsComment.js | 190 + .../flexApi/v1/insightsConversationalAi.d.ts | 165 + .../flexApi/v1/insightsConversationalAi.js | 136 + ...nsightsConversationalAiReportInsights.d.ts | 149 + .../insightsConversationalAiReportInsights.js | 130 + .../flexApi/v1/insightsConversations.d.ts | 172 + .../rest/flexApi/v1/insightsConversations.js | 128 + .../flexApi/v1/insightsQuestionnaires.d.ts | 357 + .../rest/flexApi/v1/insightsQuestionnaires.js | 282 + .../v1/insightsQuestionnairesCategory.d.ts | 279 + .../v1/insightsQuestionnairesCategory.js | 234 + .../v1/insightsQuestionnairesQuestion.d.ts | 337 + .../v1/insightsQuestionnairesQuestion.js | 270 + .../lib/rest/flexApi/v1/insightsSegments.d.ts | 277 + .../lib/rest/flexApi/v1/insightsSegments.js | 166 + .../lib/rest/flexApi/v1/insightsSession.d.ts | 130 + .../lib/rest/flexApi/v1/insightsSession.js | 115 + .../v1/insightsSettingsAnswerSets.d.ts | 82 + .../flexApi/v1/insightsSettingsAnswerSets.js | 83 + .../flexApi/v1/insightsSettingsComment.d.ts | 67 + .../flexApi/v1/insightsSettingsComment.js | 79 + .../rest/flexApi/v1/insightsUserRoles.d.ts | 109 + .../lib/rest/flexApi/v1/insightsUserRoles.js | 109 + .../lib/rest/flexApi/v1/interaction.d.ts | 131 + .../twilio/lib/rest/flexApi/v1/interaction.js | 156 + .../v1/interaction/interactionChannel.d.ts | 266 + .../v1/interaction/interactionChannel.js | 244 + .../interactionChannelInvite.d.ts | 181 + .../interactionChannelInvite.js | 154 + .../interactionChannelParticipant.d.ts | 238 + .../interactionChannelParticipant.js | 222 + .../rest/flexApi/v1/provisioningStatus.d.ts | 85 + .../lib/rest/flexApi/v1/provisioningStatus.js | 103 + .../lib/rest/flexApi/v1/webChannel.d.ts | 305 + .../twilio/lib/rest/flexApi/v1/webChannel.js | 268 + .../lib/rest/flexApi/v2/webChannels.d.ts | 65 + .../twilio/lib/rest/flexApi/v2/webChannels.js | 82 + .../twilio/lib/rest/frontlineApi/V1.d.ts | 15 + .../twilio/lib/rest/frontlineApi/V1.js | 36 + .../twilio/lib/rest/frontlineApi/v1/user.d.ts | 164 + .../twilio/lib/rest/frontlineApi/v1/user.js | 150 + node_modules/twilio/lib/rest/insights/V1.d.ts | 35 + node_modules/twilio/lib/rest/insights/V1.js | 61 + .../twilio/lib/rest/insights/v1/call.d.ts | 117 + .../twilio/lib/rest/insights/v1/call.js | 159 + .../lib/rest/insights/v1/call/annotation.d.ts | 184 + .../lib/rest/insights/v1/call/annotation.js | 166 + .../rest/insights/v1/call/callSummary.d.ts | 232 + .../lib/rest/insights/v1/call/callSummary.js | 159 + .../lib/rest/insights/v1/call/event.d.ts | 205 + .../twilio/lib/rest/insights/v1/call/event.js | 144 + .../lib/rest/insights/v1/call/metric.d.ts | 199 + .../lib/rest/insights/v1/call/metric.js | 142 + .../lib/rest/insights/v1/callSummaries.d.ts | 409 ++ .../lib/rest/insights/v1/callSummaries.js | 211 + .../lib/rest/insights/v1/conference.d.ts | 377 + .../twilio/lib/rest/insights/v1/conference.js | 248 + .../v1/conference/conferenceParticipant.d.ts | 375 + .../v1/conference/conferenceParticipant.js | 246 + .../twilio/lib/rest/insights/v1/room.d.ts | 362 + .../twilio/lib/rest/insights/v1/room.js | 244 + .../rest/insights/v1/room/participant.d.ts | 280 + .../lib/rest/insights/v1/room/participant.js | 212 + .../twilio/lib/rest/insights/v1/setting.d.ts | 170 + .../twilio/lib/rest/insights/v1/setting.js | 143 + .../twilio/lib/rest/intelligence/V2.d.ts | 20 + .../twilio/lib/rest/intelligence/V2.js | 42 + .../lib/rest/intelligence/v2/service.d.ts | 378 + .../lib/rest/intelligence/v2/service.js | 300 + .../lib/rest/intelligence/v2/transcript.d.ts | 374 + .../lib/rest/intelligence/v2/transcript.js | 301 + .../intelligence/v2/transcript/media.d.ts | 132 + .../rest/intelligence/v2/transcript/media.js | 122 + .../v2/transcript/operatorResult.d.ts | 302 + .../v2/transcript/operatorResult.js | 216 + .../intelligence/v2/transcript/sentence.d.ts | 182 + .../intelligence/v2/transcript/sentence.js | 136 + .../twilio/lib/rest/ipMessaging/V1.d.ts | 20 + .../twilio/lib/rest/ipMessaging/V1.js | 42 + .../twilio/lib/rest/ipMessaging/V2.d.ts | 20 + .../twilio/lib/rest/ipMessaging/V2.js | 42 + .../lib/rest/ipMessaging/v1/credential.d.ts | 303 + .../lib/rest/ipMessaging/v1/credential.js | 274 + .../lib/rest/ipMessaging/v1/service.d.ts | 449 ++ .../twilio/lib/rest/ipMessaging/v1/service.js | 454 ++ .../rest/ipMessaging/v1/service/channel.d.ts | 349 + .../rest/ipMessaging/v1/service/channel.js | 323 + .../v1/service/channel/invite.d.ts | 256 + .../ipMessaging/v1/service/channel/invite.js | 245 + .../v1/service/channel/member.d.ts | 303 + .../ipMessaging/v1/service/channel/member.js | 276 + .../v1/service/channel/message.d.ts | 312 + .../ipMessaging/v1/service/channel/message.js | 282 + .../lib/rest/ipMessaging/v1/service/role.d.ts | 274 + .../lib/rest/ipMessaging/v1/service/role.js | 267 + .../lib/rest/ipMessaging/v1/service/user.d.ts | 318 + .../lib/rest/ipMessaging/v1/service/user.js | 293 + .../v1/service/user/userChannel.d.ts | 163 + .../v1/service/user/userChannel.js | 139 + .../lib/rest/ipMessaging/v2/credential.d.ts | 303 + .../lib/rest/ipMessaging/v2/credential.js | 274 + .../lib/rest/ipMessaging/v2/service.d.ts | 417 ++ .../twilio/lib/rest/ipMessaging/v2/service.js | 401 ++ .../rest/ipMessaging/v2/service/binding.d.ts | 249 + .../rest/ipMessaging/v2/service/binding.js | 222 + .../rest/ipMessaging/v2/service/channel.d.ts | 399 ++ .../rest/ipMessaging/v2/service/channel.js | 358 + .../v2/service/channel/invite.d.ts | 256 + .../ipMessaging/v2/service/channel/invite.js | 245 + .../v2/service/channel/member.d.ts | 354 + .../ipMessaging/v2/service/channel/member.js | 306 + .../v2/service/channel/message.d.ts | 375 + .../ipMessaging/v2/service/channel/message.js | 316 + .../v2/service/channel/webhook.d.ts | 311 + .../ipMessaging/v2/service/channel/webhook.js | 288 + .../lib/rest/ipMessaging/v2/service/role.d.ts | 274 + .../lib/rest/ipMessaging/v2/service/role.js | 267 + .../lib/rest/ipMessaging/v2/service/user.d.ts | 331 + .../lib/rest/ipMessaging/v2/service/user.js | 310 + .../v2/service/user/userBinding.d.ts | 245 + .../v2/service/user/userBinding.js | 226 + .../v2/service/user/userChannel.d.ts | 283 + .../v2/service/user/userChannel.js | 257 + node_modules/twilio/lib/rest/lookups/V1.d.ts | 15 + node_modules/twilio/lib/rest/lookups/V1.js | 36 + node_modules/twilio/lib/rest/lookups/V2.d.ts | 15 + node_modules/twilio/lib/rest/lookups/V2.js | 36 + .../lib/rest/lookups/v1/phoneNumber.d.ts | 149 + .../twilio/lib/rest/lookups/v1/phoneNumber.js | 133 + .../lib/rest/lookups/v2/phoneNumber.d.ts | 222 + .../twilio/lib/rest/lookups/v2/phoneNumber.js | 166 + node_modules/twilio/lib/rest/media/V1.d.ts | 25 + node_modules/twilio/lib/rest/media/V1.js | 51 + .../lib/rest/media/v1/mediaProcessor.d.ts | 317 + .../lib/rest/media/v1/mediaProcessor.js | 256 + .../lib/rest/media/v1/mediaRecording.d.ts | 309 + .../lib/rest/media/v1/mediaRecording.js | 226 + .../lib/rest/media/v1/playerStreamer.d.ts | 327 + .../lib/rest/media/v1/playerStreamer.js | 264 + .../v1/playerStreamer/playbackGrant.d.ts | 151 + .../media/v1/playerStreamer/playbackGrant.js | 146 + .../twilio/lib/rest/messaging/V1.d.ts | 65 + node_modules/twilio/lib/rest/messaging/V1.js | 106 + .../rest/messaging/v1/brandRegistration.d.ts | 352 + .../rest/messaging/v1/brandRegistration.js | 288 + .../brandRegistrationOtp.d.ts | 52 + .../brandRegistration/brandRegistrationOtp.js | 68 + .../v1/brandRegistration/brandVetting.d.ts | 265 + .../v1/brandRegistration/brandVetting.js | 224 + .../lib/rest/messaging/v1/deactivations.d.ts | 106 + .../lib/rest/messaging/v1/deactivations.js | 107 + .../lib/rest/messaging/v1/domainCerts.d.ts | 164 + .../lib/rest/messaging/v1/domainCerts.js | 164 + .../lib/rest/messaging/v1/domainConfig.d.ts | 175 + .../lib/rest/messaging/v1/domainConfig.js | 155 + .../v1/domainConfigMessagingService.d.ts | 127 + .../v1/domainConfigMessagingService.js | 124 + .../rest/messaging/v1/externalCampaign.d.ts | 79 + .../lib/rest/messaging/v1/externalCampaign.js | 87 + .../v1/linkshorteningMessagingService.d.ts | 109 + .../v1/linkshorteningMessagingService.js | 135 + ...ningMessagingServiceDomainAssociation.d.ts | 91 + ...teningMessagingServiceDomainAssociation.js | 112 + .../twilio/lib/rest/messaging/v1/service.d.ts | 500 ++ .../twilio/lib/rest/messaging/v1/service.js | 421 ++ .../messaging/v1/service/alphaSender.d.ts | 264 + .../rest/messaging/v1/service/alphaSender.js | 231 + .../messaging/v1/service/channelSender.d.ts | 237 + .../messaging/v1/service/channelSender.js | 193 + .../messaging/v1/service/phoneNumber.d.ts | 270 + .../rest/messaging/v1/service/phoneNumber.js | 234 + .../rest/messaging/v1/service/shortCode.d.ts | 270 + .../rest/messaging/v1/service/shortCode.js | 234 + .../messaging/v1/service/usAppToPerson.d.ts | 452 ++ .../messaging/v1/service/usAppToPerson.js | 371 + .../v1/service/usAppToPersonUsecase.d.ts | 62 + .../v1/service/usAppToPersonUsecase.js | 79 + .../messaging/v1/tollfreeVerification.d.ts | 564 ++ .../rest/messaging/v1/tollfreeVerification.js | 425 ++ .../twilio/lib/rest/messaging/v1/usecase.d.ts | 45 + .../twilio/lib/rest/messaging/v1/usecase.js | 62 + .../twilio/lib/rest/microvisor/V1.d.ts | 30 + node_modules/twilio/lib/rest/microvisor/V1.js | 56 + .../lib/rest/microvisor/v1/accountConfig.d.ts | 263 + .../lib/rest/microvisor/v1/accountConfig.js | 246 + .../lib/rest/microvisor/v1/accountSecret.d.ts | 257 + .../lib/rest/microvisor/v1/accountSecret.js | 244 + .../twilio/lib/rest/microvisor/v1/app.d.ts | 251 + .../twilio/lib/rest/microvisor/v1/app.js | 216 + .../rest/microvisor/v1/app/appManifest.d.ts | 101 + .../lib/rest/microvisor/v1/app/appManifest.js | 115 + .../twilio/lib/rest/microvisor/v1/device.d.ts | 299 + .../twilio/lib/rest/microvisor/v1/device.js | 245 + .../microvisor/v1/device/deviceConfig.d.ts | 271 + .../rest/microvisor/v1/device/deviceConfig.js | 254 + .../microvisor/v1/device/deviceSecret.d.ts | 265 + .../rest/microvisor/v1/device/deviceSecret.js | 252 + node_modules/twilio/lib/rest/monitor/V1.d.ts | 20 + node_modules/twilio/lib/rest/monitor/V1.js | 42 + .../twilio/lib/rest/monitor/v1/alert.d.ts | 313 + .../twilio/lib/rest/monitor/v1/alert.js | 212 + .../twilio/lib/rest/monitor/v1/event.d.ts | 301 + .../twilio/lib/rest/monitor/v1/event.js | 208 + node_modules/twilio/lib/rest/notify/V1.d.ts | 20 + node_modules/twilio/lib/rest/notify/V1.js | 42 + .../twilio/lib/rest/notify/v1/credential.d.ts | 324 + .../twilio/lib/rest/notify/v1/credential.js | 274 + .../twilio/lib/rest/notify/v1/service.d.ts | 458 ++ .../twilio/lib/rest/notify/v1/service.js | 369 + .../lib/rest/notify/v1/service/binding.d.ts | 337 + .../lib/rest/notify/v1/service/binding.js | 268 + .../rest/notify/v1/service/notification.d.ts | 208 + .../rest/notify/v1/service/notification.js | 152 + node_modules/twilio/lib/rest/numbers/V1.d.ts | 30 + node_modules/twilio/lib/rest/numbers/V1.js | 59 + node_modules/twilio/lib/rest/numbers/V2.d.ts | 30 + node_modules/twilio/lib/rest/numbers/V2.js | 58 + .../lib/rest/numbers/v1/bulkEligibility.d.ts | 112 + .../lib/rest/numbers/v1/bulkEligibility.js | 118 + .../numbers/v1/portingBulkPortability.d.ts | 120 + .../rest/numbers/v1/portingBulkPortability.js | 136 + .../rest/numbers/v1/portingPortInFetch.d.ts | 136 + .../lib/rest/numbers/v1/portingPortInFetch.js | 126 + .../rest/numbers/v1/portingPortability.d.ts | 165 + .../lib/rest/numbers/v1/portingPortability.js | 132 + .../numbers/v2/authorizationDocument.d.ts | 290 + .../rest/numbers/v2/authorizationDocument.js | 262 + .../dependentHostedNumberOrder.d.ts | 265 + .../dependentHostedNumberOrder.js | 164 + .../numbers/v2/bulkHostedNumberOrder.d.ts | 153 + .../rest/numbers/v2/bulkHostedNumberOrder.js | 128 + .../rest/numbers/v2/hostedNumberOrder.d.ts | 384 + .../lib/rest/numbers/v2/hostedNumberOrder.js | 294 + .../rest/numbers/v2/regulatoryCompliance.d.ts | 35 + .../rest/numbers/v2/regulatoryCompliance.js | 87 + .../v2/regulatoryCompliance/bundle.d.ts | 445 ++ .../numbers/v2/regulatoryCompliance/bundle.js | 354 + .../bundle/bundleCopy.d.ts | 219 + .../regulatoryCompliance/bundle/bundleCopy.js | 163 + .../bundle/evaluation.d.ts | 231 + .../regulatoryCompliance/bundle/evaluation.js | 200 + .../bundle/itemAssignment.d.ts | 252 + .../bundle/itemAssignment.js | 227 + .../bundle/replaceItems.d.ts | 106 + .../bundle/replaceItems.js | 97 + .../v2/regulatoryCompliance/endUser.d.ts | 308 + .../v2/regulatoryCompliance/endUser.js | 261 + .../v2/regulatoryCompliance/endUserType.d.ts | 211 + .../v2/regulatoryCompliance/endUserType.js | 179 + .../v2/regulatoryCompliance/regulation.d.ts | 239 + .../v2/regulatoryCompliance/regulation.js | 189 + .../supportingDocument.d.ts | 326 + .../supportingDocument.js | 267 + .../supportingDocumentType.d.ts | 211 + .../supportingDocumentType.js | 179 + .../lib/rest/preview/DeployedDevices.d.ts | 15 + .../lib/rest/preview/DeployedDevices.js | 36 + .../lib/rest/preview/HostedNumbers.d.ts | 20 + .../twilio/lib/rest/preview/HostedNumbers.js | 44 + .../twilio/lib/rest/preview/Marketplace.d.ts | 20 + .../twilio/lib/rest/preview/Marketplace.js | 44 + .../twilio/lib/rest/preview/Sync.d.ts | 15 + node_modules/twilio/lib/rest/preview/Sync.js | 36 + .../twilio/lib/rest/preview/Wireless.d.ts | 25 + .../twilio/lib/rest/preview/Wireless.js | 48 + .../rest/preview/deployed_devices/fleet.d.ts | 352 + .../rest/preview/deployed_devices/fleet.js | 307 + .../deployed_devices/fleet/certificate.d.ts | 324 + .../deployed_devices/fleet/certificate.js | 269 + .../deployed_devices/fleet/deployment.d.ts | 318 + .../deployed_devices/fleet/deployment.js | 264 + .../deployed_devices/fleet/device.d.ts | 358 + .../preview/deployed_devices/fleet/device.js | 284 + .../preview/deployed_devices/fleet/key.d.ts | 330 + .../preview/deployed_devices/fleet/key.js | 268 + .../hosted_numbers/authorizationDocument.d.ts | 327 + .../hosted_numbers/authorizationDocument.js | 285 + .../dependentHostedNumberOrder.d.ts | 293 + .../dependentHostedNumberOrder.js | 174 + .../hosted_numbers/hostedNumberOrder.d.ts | 468 ++ .../hosted_numbers/hostedNumberOrder.js | 345 + .../preview/marketplace/availableAddOn.d.ts | 231 + .../preview/marketplace/availableAddOn.js | 196 + .../availableAddOnExtension.d.ts | 219 + .../availableAddOn/availableAddOnExtension.js | 187 + .../preview/marketplace/installedAddOn.d.ts | 332 + .../preview/marketplace/installedAddOn.js | 281 + .../installedAddOnExtension.d.ts | 251 + .../installedAddOn/installedAddOnExtension.js | 214 + .../twilio/lib/rest/preview/sync/service.d.ts | 330 + .../twilio/lib/rest/preview/sync/service.js | 308 + .../rest/preview/sync/service/document.d.ts | 295 + .../lib/rest/preview/sync/service/document.js | 281 + .../service/document/documentPermission.d.ts | 280 + .../service/document/documentPermission.js | 253 + .../rest/preview/sync/service/syncList.d.ts | 270 + .../lib/rest/preview/sync/service/syncList.js | 263 + .../sync/service/syncList/syncListItem.d.ts | 321 + .../sync/service/syncList/syncListItem.js | 280 + .../service/syncList/syncListPermission.d.ts | 280 + .../service/syncList/syncListPermission.js | 253 + .../rest/preview/sync/service/syncMap.d.ts | 270 + .../lib/rest/preview/sync/service/syncMap.js | 263 + .../sync/service/syncMap/syncMapItem.d.ts | 323 + .../sync/service/syncMap/syncMapItem.js | 284 + .../service/syncMap/syncMapPermission.d.ts | 280 + .../sync/service/syncMap/syncMapPermission.js | 253 + .../lib/rest/preview/wireless/command.d.ts | 266 + .../lib/rest/preview/wireless/command.js | 232 + .../lib/rest/preview/wireless/ratePlan.d.ts | 326 + .../lib/rest/preview/wireless/ratePlan.js | 286 + .../twilio/lib/rest/preview/wireless/sim.d.ts | 357 + .../twilio/lib/rest/preview/wireless/sim.js | 291 + .../lib/rest/preview/wireless/sim/usage.d.ts | 131 + .../lib/rest/preview/wireless/sim/usage.js | 133 + node_modules/twilio/lib/rest/pricing/V1.d.ts | 25 + node_modules/twilio/lib/rest/pricing/V1.js | 48 + node_modules/twilio/lib/rest/pricing/V2.d.ts | 25 + node_modules/twilio/lib/rest/pricing/V2.js | 48 + .../twilio/lib/rest/pricing/v1/messaging.d.ts | 19 + .../twilio/lib/rest/pricing/v1/messaging.js | 42 + .../rest/pricing/v1/messaging/country.d.ts | 233 + .../lib/rest/pricing/v1/messaging/country.js | 190 + .../lib/rest/pricing/v1/phoneNumber.d.ts | 19 + .../twilio/lib/rest/pricing/v1/phoneNumber.js | 42 + .../rest/pricing/v1/phoneNumber/country.d.ts | 216 + .../rest/pricing/v1/phoneNumber/country.js | 182 + .../twilio/lib/rest/pricing/v1/voice.d.ts | 22 + .../twilio/lib/rest/pricing/v1/voice.js | 51 + .../lib/rest/pricing/v1/voice/country.d.ts | 228 + .../lib/rest/pricing/v1/voice/country.js | 187 + .../lib/rest/pricing/v1/voice/number.d.ts | 127 + .../lib/rest/pricing/v1/voice/number.js | 130 + .../twilio/lib/rest/pricing/v2/country.d.ts | 229 + .../twilio/lib/rest/pricing/v2/country.js | 187 + .../twilio/lib/rest/pricing/v2/number.d.ts | 158 + .../twilio/lib/rest/pricing/v2/number.js | 137 + .../twilio/lib/rest/pricing/v2/voice.d.ts | 22 + .../twilio/lib/rest/pricing/v2/voice.js | 51 + .../lib/rest/pricing/v2/voice/country.d.ts | 229 + .../lib/rest/pricing/v2/voice/country.js | 187 + .../lib/rest/pricing/v2/voice/number.d.ts | 159 + .../lib/rest/pricing/v2/voice/number.js | 137 + node_modules/twilio/lib/rest/proxy/V1.d.ts | 15 + node_modules/twilio/lib/rest/proxy/V1.js | 36 + .../twilio/lib/rest/proxy/v1/service.d.ts | 388 + .../twilio/lib/rest/proxy/v1/service.js | 330 + .../rest/proxy/v1/service/phoneNumber.d.ts | 340 + .../lib/rest/proxy/v1/service/phoneNumber.js | 272 + .../lib/rest/proxy/v1/service/session.d.ts | 388 + .../lib/rest/proxy/v1/service/session.js | 316 + .../proxy/v1/service/session/interaction.d.ts | 309 + .../proxy/v1/service/session/interaction.js | 238 + .../proxy/v1/service/session/participant.d.ts | 310 + .../proxy/v1/service/session/participant.js | 266 + .../participant/messageInteraction.d.ts | 326 + .../session/participant/messageInteraction.js | 257 + .../lib/rest/proxy/v1/service/shortCode.d.ts | 316 + .../lib/rest/proxy/v1/service/shortCode.js | 262 + node_modules/twilio/lib/rest/routes/V2.d.ts | 25 + node_modules/twilio/lib/rest/routes/V2.js | 48 + .../lib/rest/routes/v2/phoneNumber.d.ts | 168 + .../twilio/lib/rest/routes/v2/phoneNumber.js | 149 + .../twilio/lib/rest/routes/v2/sipDomain.d.ts | 144 + .../twilio/lib/rest/routes/v2/sipDomain.js | 149 + .../twilio/lib/rest/routes/v2/trunk.d.ts | 168 + .../twilio/lib/rest/routes/v2/trunk.js | 149 + .../twilio/lib/rest/serverless/V1.d.ts | 15 + node_modules/twilio/lib/rest/serverless/V1.js | 36 + .../lib/rest/serverless/v1/service.d.ts | 364 + .../twilio/lib/rest/serverless/v1/service.js | 321 + .../lib/rest/serverless/v1/service/asset.d.ts | 298 + .../lib/rest/serverless/v1/service/asset.js | 271 + .../v1/service/asset/assetVersion.d.ts | 231 + .../v1/service/asset/assetVersion.js | 197 + .../lib/rest/serverless/v1/service/build.d.ts | 303 + .../lib/rest/serverless/v1/service/build.js | 260 + .../v1/service/build/buildStatus.d.ts | 107 + .../v1/service/build/buildStatus.js | 123 + .../serverless/v1/service/environment.d.ts | 308 + .../rest/serverless/v1/service/environment.js | 278 + .../v1/service/environment/deployment.d.ts | 257 + .../v1/service/environment/deployment.js | 220 + .../v1/service/environment/log.d.ts | 273 + .../serverless/v1/service/environment/log.js | 211 + .../v1/service/environment/variable.d.ts | 318 + .../v1/service/environment/variable.js | 272 + .../rest/serverless/v1/service/function.d.ts | 298 + .../rest/serverless/v1/service/function.js | 271 + .../v1/service/function/functionVersion.d.ts | 242 + .../v1/service/function/functionVersion.js | 212 + .../functionVersionContent.d.ts | 114 + .../functionVersion/functionVersionContent.js | 131 + node_modules/twilio/lib/rest/studio/V1.d.ts | 15 + node_modules/twilio/lib/rest/studio/V1.js | 36 + node_modules/twilio/lib/rest/studio/V2.d.ts | 20 + node_modules/twilio/lib/rest/studio/V2.js | 42 + .../twilio/lib/rest/studio/v1/flow.d.ts | 266 + .../twilio/lib/rest/studio/v1/flow.js | 231 + .../lib/rest/studio/v1/flow/engagement.d.ts | 300 + .../lib/rest/studio/v1/flow/engagement.js | 269 + .../v1/flow/engagement/engagementContext.d.ts | 109 + .../v1/flow/engagement/engagementContext.js | 123 + .../rest/studio/v1/flow/engagement/step.d.ts | 265 + .../rest/studio/v1/flow/engagement/step.js | 218 + .../v1/flow/engagement/step/stepContext.d.ts | 117 + .../v1/flow/engagement/step/stepContext.js | 131 + .../lib/rest/studio/v1/flow/execution.d.ts | 338 + .../lib/rest/studio/v1/flow/execution.js | 298 + .../v1/flow/execution/executionContext.d.ts | 109 + .../v1/flow/execution/executionContext.js | 123 + .../v1/flow/execution/executionStep.d.ts | 265 + .../studio/v1/flow/execution/executionStep.js | 218 + .../executionStep/executionStepContext.d.ts | 117 + .../executionStep/executionStepContext.js | 131 + .../twilio/lib/rest/studio/v2/flow.d.ts | 361 + .../twilio/lib/rest/studio/v2/flow.js | 319 + .../lib/rest/studio/v2/flow/execution.d.ts | 332 + .../lib/rest/studio/v2/flow/execution.js | 296 + .../v2/flow/execution/executionContext.d.ts | 109 + .../v2/flow/execution/executionContext.js | 123 + .../v2/flow/execution/executionStep.d.ts | 265 + .../studio/v2/flow/execution/executionStep.js | 218 + .../executionStep/executionStepContext.d.ts | 117 + .../executionStep/executionStepContext.js | 131 + .../lib/rest/studio/v2/flow/flowRevision.d.ts | 253 + .../lib/rest/studio/v2/flow/flowRevision.js | 199 + .../lib/rest/studio/v2/flow/flowTestUser.d.ts | 121 + .../lib/rest/studio/v2/flow/flowTestUser.js | 138 + .../lib/rest/studio/v2/flowValidate.d.ts | 60 + .../twilio/lib/rest/studio/v2/flowValidate.js | 85 + node_modules/twilio/lib/rest/supersim/V1.d.ts | 55 + node_modules/twilio/lib/rest/supersim/V1.js | 86 + .../lib/rest/supersim/v1/esimProfile.d.ts | 311 + .../lib/rest/supersim/v1/esimProfile.js | 232 + .../twilio/lib/rest/supersim/v1/fleet.d.ts | 361 + .../twilio/lib/rest/supersim/v1/fleet.js | 277 + .../lib/rest/supersim/v1/ipCommand.d.ts | 303 + .../twilio/lib/rest/supersim/v1/ipCommand.js | 238 + .../twilio/lib/rest/supersim/v1/network.d.ts | 229 + .../twilio/lib/rest/supersim/v1/network.js | 185 + .../supersim/v1/networkAccessProfile.d.ts | 296 + .../rest/supersim/v1/networkAccessProfile.js | 248 + .../networkAccessProfileNetwork.d.ts | 252 + .../networkAccessProfileNetwork.js | 227 + .../lib/rest/supersim/v1/settingsUpdate.d.ts | 194 + .../lib/rest/supersim/v1/settingsUpdate.js | 136 + .../twilio/lib/rest/supersim/v1/sim.d.ts | 341 + .../twilio/lib/rest/supersim/v1/sim.js | 283 + .../rest/supersim/v1/sim/billingPeriod.d.ts | 183 + .../lib/rest/supersim/v1/sim/billingPeriod.js | 136 + .../rest/supersim/v1/sim/simIpAddress.d.ts | 147 + .../lib/rest/supersim/v1/sim/simIpAddress.js | 124 + .../lib/rest/supersim/v1/smsCommand.d.ts | 271 + .../twilio/lib/rest/supersim/v1/smsCommand.js | 222 + .../lib/rest/supersim/v1/usageRecord.d.ts | 252 + .../lib/rest/supersim/v1/usageRecord.js | 154 + node_modules/twilio/lib/rest/sync/V1.d.ts | 15 + node_modules/twilio/lib/rest/sync/V1.js | 36 + .../twilio/lib/rest/sync/v1/service.d.ts | 404 ++ .../twilio/lib/rest/sync/v1/service.js | 344 + .../lib/rest/sync/v1/service/document.d.ts | 354 + .../lib/rest/sync/v1/service/document.js | 289 + .../service/document/documentPermission.d.ts | 280 + .../v1/service/document/documentPermission.js | 253 + .../lib/rest/sync/v1/service/syncList.d.ts | 354 + .../lib/rest/sync/v1/service/syncList.js | 298 + .../v1/service/syncList/syncListItem.d.ts | 385 + .../sync/v1/service/syncList/syncListItem.js | 296 + .../service/syncList/syncListPermission.d.ts | 280 + .../v1/service/syncList/syncListPermission.js | 253 + .../lib/rest/sync/v1/service/syncMap.d.ts | 354 + .../lib/rest/sync/v1/service/syncMap.js | 298 + .../sync/v1/service/syncMap/syncMapItem.d.ts | 387 + .../sync/v1/service/syncMap/syncMapItem.js | 300 + .../v1/service/syncMap/syncMapPermission.d.ts | 280 + .../v1/service/syncMap/syncMapPermission.js | 253 + .../lib/rest/sync/v1/service/syncStream.d.ts | 336 + .../lib/rest/sync/v1/service/syncStream.js | 279 + .../v1/service/syncStream/streamMessage.d.ts | 61 + .../v1/service/syncStream/streamMessage.js | 83 + .../twilio/lib/rest/taskrouter/V1.d.ts | 15 + node_modules/twilio/lib/rest/taskrouter/V1.js | 36 + .../lib/rest/taskrouter/v1/workspace.d.ts | 452 ++ .../lib/rest/taskrouter/v1/workspace.js | 418 ++ .../taskrouter/v1/workspace/activity.d.ts | 323 + .../rest/taskrouter/v1/workspace/activity.js | 267 + .../rest/taskrouter/v1/workspace/event.d.ts | 351 + .../lib/rest/taskrouter/v1/workspace/event.js | 231 + .../rest/taskrouter/v1/workspace/task.d.ts | 505 ++ .../lib/rest/taskrouter/v1/workspace/task.js | 347 + .../v1/workspace/task/reservation.d.ts | 414 ++ .../v1/workspace/task/reservation.js | 346 + .../taskrouter/v1/workspace/taskChannel.d.ts | 324 + .../taskrouter/v1/workspace/taskChannel.js | 271 + .../taskrouter/v1/workspace/taskQueue.d.ts | 417 ++ .../rest/taskrouter/v1/workspace/taskQueue.js | 349 + .../taskQueueCumulativeStatistics.d.ts | 244 + .../taskQueueCumulativeStatistics.js | 172 + .../taskQueueRealTimeStatistics.d.ts | 188 + .../taskQueue/taskQueueRealTimeStatistics.js | 148 + .../taskQueue/taskQueueStatistics.d.ts | 148 + .../taskQueue/taskQueueStatistics.js | 139 + .../taskQueue/taskQueuesStatistics.d.ts | 203 + .../taskQueue/taskQueuesStatistics.js | 142 + .../rest/taskrouter/v1/workspace/worker.d.ts | 454 ++ .../rest/taskrouter/v1/workspace/worker.js | 370 + .../v1/workspace/worker/reservation.d.ts | 403 ++ .../v1/workspace/worker/reservation.js | 340 + .../v1/workspace/worker/workerChannel.d.ts | 307 + .../v1/workspace/worker/workerChannel.js | 236 + .../v1/workspace/worker/workerStatistics.d.ts | 140 + .../v1/workspace/worker/workerStatistics.js | 135 + .../worker/workersCumulativeStatistics.d.ts | 180 + .../worker/workersCumulativeStatistics.js | 143 + .../worker/workersRealTimeStatistics.d.ts | 132 + .../worker/workersRealTimeStatistics.js | 123 + .../workspace/worker/workersStatistics.d.ts | 144 + .../v1/workspace/worker/workersStatistics.js | 135 + .../taskrouter/v1/workspace/workflow.d.ts | 384 + .../rest/taskrouter/v1/workspace/workflow.js | 334 + .../workflowCumulativeStatistics.d.ts | 244 + .../workflow/workflowCumulativeStatistics.js | 171 + .../workflow/workflowRealTimeStatistics.d.ts | 158 + .../workflow/workflowRealTimeStatistics.js | 137 + .../workflow/workflowStatistics.d.ts | 148 + .../workspace/workflow/workflowStatistics.js | 139 + .../workspaceCumulativeStatistics.d.ts | 236 + .../workspaceCumulativeStatistics.js | 163 + .../workspaceRealTimeStatistics.d.ts | 162 + .../workspace/workspaceRealTimeStatistics.js | 133 + .../v1/workspace/workspaceStatistics.d.ts | 140 + .../v1/workspace/workspaceStatistics.js | 131 + node_modules/twilio/lib/rest/trunking/V1.d.ts | 15 + node_modules/twilio/lib/rest/trunking/V1.js | 36 + .../twilio/lib/rest/trunking/v1/trunk.d.ts | 430 ++ .../twilio/lib/rest/trunking/v1/trunk.js | 364 + .../trunking/v1/trunk/credentialList.d.ts | 258 + .../rest/trunking/v1/trunk/credentialList.js | 230 + .../v1/trunk/ipAccessControlList.d.ts | 258 + .../trunking/v1/trunk/ipAccessControlList.js | 230 + .../trunking/v1/trunk/originationUrl.d.ts | 340 + .../rest/trunking/v1/trunk/originationUrl.js | 289 + .../rest/trunking/v1/trunk/phoneNumber.d.ts | 370 + .../lib/rest/trunking/v1/trunk/phoneNumber.js | 268 + .../lib/rest/trunking/v1/trunk/recording.d.ts | 129 + .../lib/rest/trunking/v1/trunk/recording.js | 140 + node_modules/twilio/lib/rest/trusthub/V1.d.ts | 60 + node_modules/twilio/lib/rest/trusthub/V1.js | 99 + .../rest/trusthub/v1/complianceInquiries.d.ts | 127 + .../rest/trusthub/v1/complianceInquiries.js | 142 + .../v1/complianceRegistrationInquiries.d.ts | 132 + .../v1/complianceRegistrationInquiries.js | 150 + .../v1/complianceTollfreeInquiries.d.ts | 112 + .../v1/complianceTollfreeInquiries.js | 125 + .../rest/trusthub/v1/customerProfiles.d.ts | 380 + .../lib/rest/trusthub/v1/customerProfiles.js | 322 + ...omerProfilesChannelEndpointAssignment.d.ts | 272 + ...stomerProfilesChannelEndpointAssignment.js | 239 + .../customerProfilesEntityAssignments.d.ts | 252 + .../customerProfilesEntityAssignments.js | 227 + .../customerProfilesEvaluations.d.ts | 239 + .../customerProfilesEvaluations.js | 212 + .../twilio/lib/rest/trusthub/v1/endUser.d.ts | 310 + .../twilio/lib/rest/trusthub/v1/endUser.js | 261 + .../lib/rest/trusthub/v1/endUserType.d.ts | 211 + .../lib/rest/trusthub/v1/endUserType.js | 179 + .../twilio/lib/rest/trusthub/v1/policies.d.ts | 205 + .../twilio/lib/rest/trusthub/v1/policies.js | 177 + .../rest/trusthub/v1/supportingDocument.d.ts | 320 + .../rest/trusthub/v1/supportingDocument.js | 265 + .../trusthub/v1/supportingDocumentType.d.ts | 211 + .../trusthub/v1/supportingDocumentType.js | 179 + .../lib/rest/trusthub/v1/trustProducts.d.ts | 380 + .../lib/rest/trusthub/v1/trustProducts.js | 322 + ...rustProductsChannelEndpointAssignment.d.ts | 272 + .../trustProductsChannelEndpointAssignment.js | 239 + .../trustProductsEntityAssignments.d.ts | 252 + .../trustProductsEntityAssignments.js | 227 + .../trustProductsEvaluations.d.ts | 239 + .../trustProducts/trustProductsEvaluations.js | 212 + node_modules/twilio/lib/rest/verify/V2.d.ts | 40 + node_modules/twilio/lib/rest/verify/V2.js | 69 + .../twilio/lib/rest/verify/v2/form.d.ts | 98 + .../twilio/lib/rest/verify/v2/form.js | 112 + .../twilio/lib/rest/verify/v2/safelist.d.ts | 127 + .../twilio/lib/rest/verify/v2/safelist.js | 150 + .../twilio/lib/rest/verify/v2/service.d.ts | 491 ++ .../twilio/lib/rest/verify/v2/service.js | 433 ++ .../rest/verify/v2/service/accessToken.d.ts | 158 + .../lib/rest/verify/v2/service/accessToken.js | 159 + .../lib/rest/verify/v2/service/entity.d.ts | 288 + .../lib/rest/verify/v2/service/entity.js | 270 + .../verify/v2/service/entity/challenge.d.ts | 384 + .../verify/v2/service/entity/challenge.js | 296 + .../entity/challenge/notification.d.ts | 112 + .../service/entity/challenge/notification.js | 102 + .../rest/verify/v2/service/entity/factor.d.ts | 335 + .../rest/verify/v2/service/entity/factor.js | 270 + .../verify/v2/service/entity/newFactor.d.ts | 157 + .../verify/v2/service/entity/newFactor.js | 137 + .../v2/service/messagingConfiguration.d.ts | 286 + .../v2/service/messagingConfiguration.js | 260 + .../lib/rest/verify/v2/service/rateLimit.d.ts | 322 + .../lib/rest/verify/v2/service/rateLimit.js | 275 + .../verify/v2/service/rateLimit/bucket.d.ts | 318 + .../verify/v2/service/rateLimit/bucket.js | 272 + .../rest/verify/v2/service/verification.d.ts | 242 + .../rest/verify/v2/service/verification.js | 221 + .../verify/v2/service/verificationCheck.d.ts | 134 + .../verify/v2/service/verificationCheck.js | 110 + .../lib/rest/verify/v2/service/webhook.d.ts | 340 + .../lib/rest/verify/v2/service/webhook.js | 287 + .../twilio/lib/rest/verify/v2/template.d.ts | 172 + .../twilio/lib/rest/verify/v2/template.js | 128 + .../rest/verify/v2/verificationAttempt.d.ts | 288 + .../lib/rest/verify/v2/verificationAttempt.js | 207 + .../v2/verificationAttemptsSummary.d.ts | 138 + .../verify/v2/verificationAttemptsSummary.js | 126 + node_modules/twilio/lib/rest/video/V1.d.ts | 40 + node_modules/twilio/lib/rest/video/V1.js | 69 + .../twilio/lib/rest/video/v1/composition.d.ts | 376 + .../twilio/lib/rest/video/v1/composition.js | 275 + .../lib/rest/video/v1/compositionHook.d.ts | 388 + .../lib/rest/video/v1/compositionHook.js | 310 + .../rest/video/v1/compositionSettings.d.ts | 159 + .../lib/rest/video/v1/compositionSettings.js | 151 + .../twilio/lib/rest/video/v1/recording.d.ts | 334 + .../twilio/lib/rest/video/v1/recording.js | 236 + .../lib/rest/video/v1/recordingSettings.d.ts | 159 + .../lib/rest/video/v1/recordingSettings.js | 151 + .../twilio/lib/rest/video/v1/room.d.ts | 448 ++ node_modules/twilio/lib/rest/video/v1/room.js | 339 + .../lib/rest/video/v1/room/participant.d.ts | 351 + .../lib/rest/video/v1/room/participant.js | 286 + .../video/v1/room/participant/anonymize.d.ts | 143 + .../video/v1/room/participant/anonymize.js | 135 + .../v1/room/participant/publishedTrack.d.ts | 237 + .../v1/room/participant/publishedTrack.js | 199 + .../v1/room/participant/subscribeRules.d.ts | 103 + .../v1/room/participant/subscribeRules.js | 103 + .../v1/room/participant/subscribedTrack.d.ts | 243 + .../v1/room/participant/subscribedTrack.js | 201 + .../rest/video/v1/room/recordingRules.d.ts | 95 + .../lib/rest/video/v1/room/recordingRules.js | 98 + .../lib/rest/video/v1/room/roomRecording.d.ts | 318 + .../lib/rest/video/v1/room/roomRecording.js | 236 + node_modules/twilio/lib/rest/voice/V1.d.ts | 40 + node_modules/twilio/lib/rest/voice/V1.js | 69 + .../lib/rest/voice/v1/archivedCall.d.ts | 51 + .../twilio/lib/rest/voice/v1/archivedCall.js | 71 + .../twilio/lib/rest/voice/v1/byocTrunk.d.ts | 390 + .../twilio/lib/rest/voice/v1/byocTrunk.js | 304 + .../lib/rest/voice/v1/connectionPolicy.d.ts | 314 + .../lib/rest/voice/v1/connectionPolicy.js | 265 + .../connectionPolicyTarget.d.ts | 340 + .../connectionPolicyTarget.js | 280 + .../lib/rest/voice/v1/dialingPermissions.d.ts | 25 + .../lib/rest/voice/v1/dialingPermissions.js | 60 + .../dialingPermissions/bulkCountryUpdate.d.ts | 59 + .../dialingPermissions/bulkCountryUpdate.js | 77 + .../voice/v1/dialingPermissions/country.d.ts | 279 + .../voice/v1/dialingPermissions/country.js | 214 + .../country/highriskSpecialPrefix.d.ts | 143 + .../country/highriskSpecialPrefix.js | 122 + .../voice/v1/dialingPermissions/settings.d.ts | 129 + .../voice/v1/dialingPermissions/settings.js | 130 + .../twilio/lib/rest/voice/v1/ipRecord.d.ts | 308 + .../twilio/lib/rest/voice/v1/ipRecord.js | 256 + .../lib/rest/voice/v1/sourceIpMapping.d.ts | 278 + .../lib/rest/voice/v1/sourceIpMapping.js | 252 + node_modules/twilio/lib/rest/wireless/V1.d.ts | 30 + node_modules/twilio/lib/rest/wireless/V1.js | 54 + .../twilio/lib/rest/wireless/v1/command.d.ts | 314 + .../twilio/lib/rest/wireless/v1/command.js | 253 + .../twilio/lib/rest/wireless/v1/ratePlan.d.ts | 382 + .../twilio/lib/rest/wireless/v1/ratePlan.js | 293 + .../twilio/lib/rest/wireless/v1/sim.d.ts | 460 ++ .../twilio/lib/rest/wireless/v1/sim.js | 332 + .../lib/rest/wireless/v1/sim/dataSession.d.ts | 233 + .../lib/rest/wireless/v1/sim/dataSession.js | 152 + .../lib/rest/wireless/v1/sim/usageRecord.d.ts | 186 + .../lib/rest/wireless/v1/sim/usageRecord.js | 136 + .../lib/rest/wireless/v1/usageRecord.d.ts | 179 + .../lib/rest/wireless/v1/usageRecord.js | 130 + .../twilio/lib/twiml/FaxResponse.d.ts | 66 + node_modules/twilio/lib/twiml/FaxResponse.js | 66 + .../twilio/lib/twiml/MessagingResponse.d.ts | 117 + .../twilio/lib/twiml/MessagingResponse.js | 119 + node_modules/twilio/lib/twiml/TwiML.d.ts | 42 + node_modules/twilio/lib/twiml/TwiML.js | 83 + .../twilio/lib/twiml/VoiceResponse.d.ts | 2457 +++++++ .../twilio/lib/twiml/VoiceResponse.js | 1433 ++++ .../twilio/lib/webhooks/webhooks.d.ts | 136 + node_modules/twilio/lib/webhooks/webhooks.js | 302 + node_modules/twilio/package.json | 79 + node_modules/url-parse/LICENSE | 22 + node_modules/url-parse/README.md | 153 + node_modules/url-parse/dist/url-parse.js | 755 ++ node_modules/url-parse/dist/url-parse.min.js | 1 + .../url-parse/dist/url-parse.min.js.map | 1 + node_modules/url-parse/index.js | 589 ++ node_modules/url-parse/package.json | 49 + node_modules/util-deprecate/History.md | 16 + node_modules/util-deprecate/LICENSE | 24 + node_modules/util-deprecate/README.md | 53 + node_modules/util-deprecate/browser.js | 67 + node_modules/util-deprecate/node.js | 6 + node_modules/util-deprecate/package.json | 27 + node_modules/wide-align/LICENSE | 14 + node_modules/wide-align/README.md | 47 + node_modules/wide-align/align.js | 65 + node_modules/wide-align/package.json | 33 + node_modules/wrappy/LICENSE | 15 + node_modules/wrappy/README.md | 36 + node_modules/wrappy/package.json | 29 + node_modules/wrappy/wrappy.js | 33 + node_modules/xmlbuilder/.nycrc | 6 + node_modules/xmlbuilder/CHANGELOG.md | 563 ++ node_modules/xmlbuilder/LICENSE | 21 + node_modules/xmlbuilder/README.md | 97 + node_modules/xmlbuilder/lib/Derivation.js | 10 + .../xmlbuilder/lib/DocumentPosition.js | 12 + node_modules/xmlbuilder/lib/NodeType.js | 25 + node_modules/xmlbuilder/lib/OperationType.js | 11 + node_modules/xmlbuilder/lib/Utility.js | 88 + node_modules/xmlbuilder/lib/WriterState.js | 10 + node_modules/xmlbuilder/lib/XMLAttribute.js | 130 + node_modules/xmlbuilder/lib/XMLCData.js | 41 + .../xmlbuilder/lib/XMLCharacterData.js | 86 + node_modules/xmlbuilder/lib/XMLComment.js | 41 + .../xmlbuilder/lib/XMLDOMConfiguration.js | 80 + .../xmlbuilder/lib/XMLDOMErrorHandler.js | 20 + .../xmlbuilder/lib/XMLDOMImplementation.js | 55 + .../xmlbuilder/lib/XMLDOMStringList.js | 44 + node_modules/xmlbuilder/lib/XMLDTDAttList.js | 66 + node_modules/xmlbuilder/lib/XMLDTDElement.js | 44 + node_modules/xmlbuilder/lib/XMLDTDEntity.js | 115 + node_modules/xmlbuilder/lib/XMLDTDNotation.js | 66 + node_modules/xmlbuilder/lib/XMLDeclaration.js | 51 + node_modules/xmlbuilder/lib/XMLDocType.js | 235 + node_modules/xmlbuilder/lib/XMLDocument.js | 282 + node_modules/xmlbuilder/lib/XMLDocumentCB.js | 650 ++ .../xmlbuilder/lib/XMLDocumentFragment.js | 21 + node_modules/xmlbuilder/lib/XMLDummy.js | 39 + node_modules/xmlbuilder/lib/XMLElement.js | 334 + .../xmlbuilder/lib/XMLNamedNodeMap.js | 77 + node_modules/xmlbuilder/lib/XMLNode.js | 999 +++ node_modules/xmlbuilder/lib/XMLNodeFilter.js | 51 + node_modules/xmlbuilder/lib/XMLNodeList.js | 45 + .../lib/XMLProcessingInstruction.js | 56 + node_modules/xmlbuilder/lib/XMLRaw.js | 40 + .../xmlbuilder/lib/XMLStreamWriter.js | 209 + .../xmlbuilder/lib/XMLStringWriter.js | 40 + node_modules/xmlbuilder/lib/XMLStringifier.js | 287 + node_modules/xmlbuilder/lib/XMLText.js | 82 + node_modules/xmlbuilder/lib/XMLTypeInfo.js | 23 + .../xmlbuilder/lib/XMLUserDataHandler.js | 27 + node_modules/xmlbuilder/lib/XMLWriterBase.js | 485 ++ node_modules/xmlbuilder/lib/index.js | 120 + node_modules/xmlbuilder/package.json | 38 + node_modules/xmlbuilder/typings/index.d.ts | 1761 +++++ package-lock.json | 226 +- package.json | 1 + public/css/homePage.css | 54 +- public/jsForPages/index.js | 9 + public/jsForPages/shiftTracker.js | 42 + views/aboutUs.html | 7 +- views/index.html | 2 + views/shiftTracker.html | 5 +- 2373 files changed, 361036 insertions(+), 33 deletions(-) create mode 100644 node_modules/.bin/color-support create mode 100644 node_modules/.bin/color-support.cmd create mode 100644 node_modules/.bin/color-support.ps1 create mode 100644 node_modules/.bin/mkdirp create mode 100644 node_modules/.bin/mkdirp.cmd create mode 100644 node_modules/.bin/mkdirp.ps1 create mode 100644 node_modules/.bin/node-pre-gyp create mode 100644 node_modules/.bin/node-pre-gyp.cmd create mode 100644 node_modules/.bin/node-pre-gyp.ps1 create mode 100644 node_modules/.bin/rimraf create mode 100644 node_modules/.bin/rimraf.cmd create mode 100644 node_modules/.bin/rimraf.ps1 create mode 100644 node_modules/@mapbox/node-pre-gyp/.github/workflows/codeql.yml create mode 100644 node_modules/@mapbox/node-pre-gyp/CHANGELOG.md create mode 100644 node_modules/@mapbox/node-pre-gyp/LICENSE create mode 100644 node_modules/@mapbox/node-pre-gyp/README.md create mode 100644 node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp create mode 100644 node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp.cmd create mode 100644 node_modules/@mapbox/node-pre-gyp/contributing.md create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/build.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/clean.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/configure.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/info.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/install.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/main.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/package.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/publish.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/rebuild.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/reinstall.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/reveal.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/testbinary.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/testpackage.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/unpublish.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/util/compile.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/util/handle_gyp_opts.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/util/napi.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/package.json create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js create mode 100644 node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt.cmd create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt.ps1 create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/nopt/CHANGELOG.md create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/nopt/LICENSE create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/nopt/README.md create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/nopt/bin/nopt.js create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/nopt/lib/nopt.js create mode 100644 node_modules/@mapbox/node-pre-gyp/node_modules/nopt/package.json create mode 100644 node_modules/@mapbox/node-pre-gyp/package.json create mode 100644 node_modules/agent-base/README.md create mode 100644 node_modules/agent-base/dist/src/index.d.ts create mode 100644 node_modules/agent-base/dist/src/index.js create mode 100644 node_modules/agent-base/dist/src/index.js.map create mode 100644 node_modules/agent-base/dist/src/promisify.d.ts create mode 100644 node_modules/agent-base/dist/src/promisify.js create mode 100644 node_modules/agent-base/dist/src/promisify.js.map create mode 100644 node_modules/agent-base/node_modules/debug/LICENSE create mode 100644 node_modules/agent-base/node_modules/debug/README.md create mode 100644 node_modules/agent-base/node_modules/debug/package.json create mode 100644 node_modules/agent-base/node_modules/debug/src/browser.js create mode 100644 node_modules/agent-base/node_modules/debug/src/common.js create mode 100644 node_modules/agent-base/node_modules/debug/src/index.js create mode 100644 node_modules/agent-base/node_modules/debug/src/node.js create mode 100644 node_modules/agent-base/node_modules/ms/index.js create mode 100644 node_modules/agent-base/node_modules/ms/license.md create mode 100644 node_modules/agent-base/node_modules/ms/package.json create mode 100644 node_modules/agent-base/node_modules/ms/readme.md create mode 100644 node_modules/agent-base/package.json create mode 100644 node_modules/agent-base/src/index.ts create mode 100644 node_modules/agent-base/src/promisify.ts create mode 100644 node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/license create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/aproba/CHANGELOG.md create mode 100644 node_modules/aproba/LICENSE create mode 100644 node_modules/aproba/README.md create mode 100644 node_modules/aproba/index.js create mode 100644 node_modules/aproba/package.json create mode 100644 node_modules/are-we-there-yet/LICENSE.md create mode 100644 node_modules/are-we-there-yet/README.md create mode 100644 node_modules/are-we-there-yet/lib/index.js create mode 100644 node_modules/are-we-there-yet/lib/tracker-base.js create mode 100644 node_modules/are-we-there-yet/lib/tracker-group.js create mode 100644 node_modules/are-we-there-yet/lib/tracker-stream.js create mode 100644 node_modules/are-we-there-yet/lib/tracker.js create mode 100644 node_modules/are-we-there-yet/package.json create mode 100644 node_modules/asynckit/LICENSE create mode 100644 node_modules/asynckit/README.md create mode 100644 node_modules/asynckit/bench.js create mode 100644 node_modules/asynckit/index.js create mode 100644 node_modules/asynckit/lib/abort.js create mode 100644 node_modules/asynckit/lib/async.js create mode 100644 node_modules/asynckit/lib/defer.js create mode 100644 node_modules/asynckit/lib/iterate.js create mode 100644 node_modules/asynckit/lib/readable_asynckit.js create mode 100644 node_modules/asynckit/lib/readable_parallel.js create mode 100644 node_modules/asynckit/lib/readable_serial.js create mode 100644 node_modules/asynckit/lib/readable_serial_ordered.js create mode 100644 node_modules/asynckit/lib/state.js create mode 100644 node_modules/asynckit/lib/streamify.js create mode 100644 node_modules/asynckit/lib/terminator.js create mode 100644 node_modules/asynckit/package.json create mode 100644 node_modules/asynckit/parallel.js create mode 100644 node_modules/asynckit/serial.js create mode 100644 node_modules/asynckit/serialOrdered.js create mode 100644 node_modules/asynckit/stream.js create mode 100644 node_modules/axios/CHANGELOG.md create mode 100644 node_modules/axios/LICENSE create mode 100644 node_modules/axios/MIGRATION_GUIDE.md create mode 100644 node_modules/axios/README.md create mode 100644 node_modules/axios/SECURITY.md create mode 100644 node_modules/axios/dist/axios.js create mode 100644 node_modules/axios/dist/axios.js.map create mode 100644 node_modules/axios/dist/axios.min.js create mode 100644 node_modules/axios/dist/axios.min.js.map create mode 100644 node_modules/axios/dist/browser/axios.cjs create mode 100644 node_modules/axios/dist/browser/axios.cjs.map create mode 100644 node_modules/axios/dist/esm/axios.js create mode 100644 node_modules/axios/dist/esm/axios.js.map create mode 100644 node_modules/axios/dist/esm/axios.min.js create mode 100644 node_modules/axios/dist/esm/axios.min.js.map create mode 100644 node_modules/axios/dist/node/axios.cjs create mode 100644 node_modules/axios/dist/node/axios.cjs.map create mode 100644 node_modules/axios/index.d.cts create mode 100644 node_modules/axios/index.d.ts create mode 100644 node_modules/axios/index.js create mode 100644 node_modules/axios/lib/adapters/README.md create mode 100644 node_modules/axios/lib/adapters/adapters.js create mode 100644 node_modules/axios/lib/adapters/http.js create mode 100644 node_modules/axios/lib/adapters/xhr.js create mode 100644 node_modules/axios/lib/axios.js create mode 100644 node_modules/axios/lib/cancel/CancelToken.js create mode 100644 node_modules/axios/lib/cancel/CanceledError.js create mode 100644 node_modules/axios/lib/cancel/isCancel.js create mode 100644 node_modules/axios/lib/core/Axios.js create mode 100644 node_modules/axios/lib/core/AxiosError.js create mode 100644 node_modules/axios/lib/core/AxiosHeaders.js create mode 100644 node_modules/axios/lib/core/InterceptorManager.js create mode 100644 node_modules/axios/lib/core/README.md create mode 100644 node_modules/axios/lib/core/buildFullPath.js create mode 100644 node_modules/axios/lib/core/dispatchRequest.js create mode 100644 node_modules/axios/lib/core/mergeConfig.js create mode 100644 node_modules/axios/lib/core/settle.js create mode 100644 node_modules/axios/lib/core/transformData.js create mode 100644 node_modules/axios/lib/defaults/index.js create mode 100644 node_modules/axios/lib/defaults/transitional.js create mode 100644 node_modules/axios/lib/env/README.md create mode 100644 node_modules/axios/lib/env/classes/FormData.js create mode 100644 node_modules/axios/lib/env/data.js create mode 100644 node_modules/axios/lib/helpers/AxiosTransformStream.js create mode 100644 node_modules/axios/lib/helpers/AxiosURLSearchParams.js create mode 100644 node_modules/axios/lib/helpers/HttpStatusCode.js create mode 100644 node_modules/axios/lib/helpers/README.md create mode 100644 node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js create mode 100644 node_modules/axios/lib/helpers/bind.js create mode 100644 node_modules/axios/lib/helpers/buildURL.js create mode 100644 node_modules/axios/lib/helpers/callbackify.js create mode 100644 node_modules/axios/lib/helpers/combineURLs.js create mode 100644 node_modules/axios/lib/helpers/cookies.js create mode 100644 node_modules/axios/lib/helpers/deprecatedMethod.js create mode 100644 node_modules/axios/lib/helpers/formDataToJSON.js create mode 100644 node_modules/axios/lib/helpers/formDataToStream.js create mode 100644 node_modules/axios/lib/helpers/fromDataURI.js create mode 100644 node_modules/axios/lib/helpers/isAbsoluteURL.js create mode 100644 node_modules/axios/lib/helpers/isAxiosError.js create mode 100644 node_modules/axios/lib/helpers/isURLSameOrigin.js create mode 100644 node_modules/axios/lib/helpers/null.js create mode 100644 node_modules/axios/lib/helpers/parseHeaders.js create mode 100644 node_modules/axios/lib/helpers/parseProtocol.js create mode 100644 node_modules/axios/lib/helpers/readBlob.js create mode 100644 node_modules/axios/lib/helpers/speedometer.js create mode 100644 node_modules/axios/lib/helpers/spread.js create mode 100644 node_modules/axios/lib/helpers/throttle.js create mode 100644 node_modules/axios/lib/helpers/toFormData.js create mode 100644 node_modules/axios/lib/helpers/toURLEncodedForm.js create mode 100644 node_modules/axios/lib/helpers/validator.js create mode 100644 node_modules/axios/lib/platform/browser/classes/Blob.js create mode 100644 node_modules/axios/lib/platform/browser/classes/FormData.js create mode 100644 node_modules/axios/lib/platform/browser/classes/URLSearchParams.js create mode 100644 node_modules/axios/lib/platform/browser/index.js create mode 100644 node_modules/axios/lib/platform/common/utils.js create mode 100644 node_modules/axios/lib/platform/index.js create mode 100644 node_modules/axios/lib/platform/node/classes/FormData.js create mode 100644 node_modules/axios/lib/platform/node/classes/URLSearchParams.js create mode 100644 node_modules/axios/lib/platform/node/index.js create mode 100644 node_modules/axios/lib/utils.js create mode 100644 node_modules/axios/package.json create mode 100644 node_modules/bcrypt/.editorconfig create mode 100644 node_modules/bcrypt/.github/workflows/ci.yaml create mode 100644 node_modules/bcrypt/.travis.yml create mode 100644 node_modules/bcrypt/CHANGELOG.md create mode 100644 node_modules/bcrypt/ISSUE_TEMPLATE.md create mode 100644 node_modules/bcrypt/LICENSE create mode 100644 node_modules/bcrypt/Makefile create mode 100644 node_modules/bcrypt/README.md create mode 100644 node_modules/bcrypt/SECURITY.md create mode 100644 node_modules/bcrypt/appveyor.yml create mode 100644 node_modules/bcrypt/bcrypt.js create mode 100644 node_modules/bcrypt/binding.gyp create mode 100644 node_modules/bcrypt/examples/async_compare.js create mode 100644 node_modules/bcrypt/examples/forever_gen_salt.js create mode 100644 node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node create mode 100644 node_modules/bcrypt/package.json create mode 100644 node_modules/bcrypt/promises.js create mode 100644 node_modules/bcrypt/src/bcrypt.cc create mode 100644 node_modules/bcrypt/src/bcrypt_node.cc create mode 100644 node_modules/bcrypt/src/blowfish.cc create mode 100644 node_modules/bcrypt/src/node_blf.h create mode 100644 node_modules/bcrypt/test-docker.sh create mode 100644 node_modules/bcrypt/test/async.test.js create mode 100644 node_modules/bcrypt/test/implementation.test.js create mode 100644 node_modules/bcrypt/test/promise.test.js create mode 100644 node_modules/bcrypt/test/repetitions.test.js create mode 100644 node_modules/bcrypt/test/sync.test.js create mode 100644 node_modules/buffer-equal-constant-time/.npmignore create mode 100644 node_modules/buffer-equal-constant-time/.travis.yml create mode 100644 node_modules/buffer-equal-constant-time/LICENSE.txt create mode 100644 node_modules/buffer-equal-constant-time/README.md create mode 100644 node_modules/buffer-equal-constant-time/index.js create mode 100644 node_modules/buffer-equal-constant-time/package.json create mode 100644 node_modules/buffer-equal-constant-time/test.js create mode 100644 node_modules/chownr/LICENSE create mode 100644 node_modules/chownr/README.md create mode 100644 node_modules/chownr/chownr.js create mode 100644 node_modules/chownr/package.json create mode 100644 node_modules/color-support/LICENSE create mode 100644 node_modules/color-support/README.md create mode 100644 node_modules/color-support/bin.js create mode 100644 node_modules/color-support/browser.js create mode 100644 node_modules/color-support/index.js create mode 100644 node_modules/color-support/package.json create mode 100644 node_modules/combined-stream/License create mode 100644 node_modules/combined-stream/Readme.md create mode 100644 node_modules/combined-stream/lib/combined_stream.js create mode 100644 node_modules/combined-stream/package.json create mode 100644 node_modules/combined-stream/yarn.lock create mode 100644 node_modules/console-control-strings/LICENSE create mode 100644 node_modules/console-control-strings/README.md create mode 100644 node_modules/console-control-strings/README.md~ create mode 100644 node_modules/console-control-strings/index.js create mode 100644 node_modules/console-control-strings/package.json create mode 100644 node_modules/dayjs/.editorconfig create mode 100644 node_modules/dayjs/CHANGELOG.md create mode 100644 node_modules/dayjs/LICENSE create mode 100644 node_modules/dayjs/README.md create mode 100644 node_modules/dayjs/dayjs.min.js create mode 100644 node_modules/dayjs/esm/constant.js create mode 100644 node_modules/dayjs/esm/index.d.ts create mode 100644 node_modules/dayjs/esm/index.js create mode 100644 node_modules/dayjs/esm/locale/af.js create mode 100644 node_modules/dayjs/esm/locale/am.js create mode 100644 node_modules/dayjs/esm/locale/ar-dz.js create mode 100644 node_modules/dayjs/esm/locale/ar-iq.js create mode 100644 node_modules/dayjs/esm/locale/ar-kw.js create mode 100644 node_modules/dayjs/esm/locale/ar-ly.js create mode 100644 node_modules/dayjs/esm/locale/ar-ma.js create mode 100644 node_modules/dayjs/esm/locale/ar-sa.js create mode 100644 node_modules/dayjs/esm/locale/ar-tn.js create mode 100644 node_modules/dayjs/esm/locale/ar.js create mode 100644 node_modules/dayjs/esm/locale/az.js create mode 100644 node_modules/dayjs/esm/locale/be.js create mode 100644 node_modules/dayjs/esm/locale/bg.js create mode 100644 node_modules/dayjs/esm/locale/bi.js create mode 100644 node_modules/dayjs/esm/locale/bm.js create mode 100644 node_modules/dayjs/esm/locale/bn-bd.js create mode 100644 node_modules/dayjs/esm/locale/bn.js create mode 100644 node_modules/dayjs/esm/locale/bo.js create mode 100644 node_modules/dayjs/esm/locale/br.js create mode 100644 node_modules/dayjs/esm/locale/bs.js create mode 100644 node_modules/dayjs/esm/locale/ca.js create mode 100644 node_modules/dayjs/esm/locale/cs.js create mode 100644 node_modules/dayjs/esm/locale/cv.js create mode 100644 node_modules/dayjs/esm/locale/cy.js create mode 100644 node_modules/dayjs/esm/locale/da.js create mode 100644 node_modules/dayjs/esm/locale/de-at.js create mode 100644 node_modules/dayjs/esm/locale/de-ch.js create mode 100644 node_modules/dayjs/esm/locale/de.js create mode 100644 node_modules/dayjs/esm/locale/dv.js create mode 100644 node_modules/dayjs/esm/locale/el.js create mode 100644 node_modules/dayjs/esm/locale/en-au.js create mode 100644 node_modules/dayjs/esm/locale/en-ca.js create mode 100644 node_modules/dayjs/esm/locale/en-gb.js create mode 100644 node_modules/dayjs/esm/locale/en-ie.js create mode 100644 node_modules/dayjs/esm/locale/en-il.js create mode 100644 node_modules/dayjs/esm/locale/en-in.js create mode 100644 node_modules/dayjs/esm/locale/en-nz.js create mode 100644 node_modules/dayjs/esm/locale/en-sg.js create mode 100644 node_modules/dayjs/esm/locale/en-tt.js create mode 100644 node_modules/dayjs/esm/locale/en.js create mode 100644 node_modules/dayjs/esm/locale/eo.js create mode 100644 node_modules/dayjs/esm/locale/es-do.js create mode 100644 node_modules/dayjs/esm/locale/es-mx.js create mode 100644 node_modules/dayjs/esm/locale/es-pr.js create mode 100644 node_modules/dayjs/esm/locale/es-us.js create mode 100644 node_modules/dayjs/esm/locale/es.js create mode 100644 node_modules/dayjs/esm/locale/et.js create mode 100644 node_modules/dayjs/esm/locale/eu.js create mode 100644 node_modules/dayjs/esm/locale/fa.js create mode 100644 node_modules/dayjs/esm/locale/fi.js create mode 100644 node_modules/dayjs/esm/locale/fo.js create mode 100644 node_modules/dayjs/esm/locale/fr-ca.js create mode 100644 node_modules/dayjs/esm/locale/fr-ch.js create mode 100644 node_modules/dayjs/esm/locale/fr.js create mode 100644 node_modules/dayjs/esm/locale/fy.js create mode 100644 node_modules/dayjs/esm/locale/ga.js create mode 100644 node_modules/dayjs/esm/locale/gd.js create mode 100644 node_modules/dayjs/esm/locale/gl.js create mode 100644 node_modules/dayjs/esm/locale/gom-latn.js create mode 100644 node_modules/dayjs/esm/locale/gu.js create mode 100644 node_modules/dayjs/esm/locale/he.js create mode 100644 node_modules/dayjs/esm/locale/hi.js create mode 100644 node_modules/dayjs/esm/locale/hr.js create mode 100644 node_modules/dayjs/esm/locale/ht.js create mode 100644 node_modules/dayjs/esm/locale/hu.js create mode 100644 node_modules/dayjs/esm/locale/hy-am.js create mode 100644 node_modules/dayjs/esm/locale/id.js create mode 100644 node_modules/dayjs/esm/locale/index.d.ts create mode 100644 node_modules/dayjs/esm/locale/is.js create mode 100644 node_modules/dayjs/esm/locale/it-ch.js create mode 100644 node_modules/dayjs/esm/locale/it.js create mode 100644 node_modules/dayjs/esm/locale/ja.js create mode 100644 node_modules/dayjs/esm/locale/jv.js create mode 100644 node_modules/dayjs/esm/locale/ka.js create mode 100644 node_modules/dayjs/esm/locale/kk.js create mode 100644 node_modules/dayjs/esm/locale/km.js create mode 100644 node_modules/dayjs/esm/locale/kn.js create mode 100644 node_modules/dayjs/esm/locale/ko.js create mode 100644 node_modules/dayjs/esm/locale/ku.js create mode 100644 node_modules/dayjs/esm/locale/ky.js create mode 100644 node_modules/dayjs/esm/locale/lb.js create mode 100644 node_modules/dayjs/esm/locale/lo.js create mode 100644 node_modules/dayjs/esm/locale/lt.js create mode 100644 node_modules/dayjs/esm/locale/lv.js create mode 100644 node_modules/dayjs/esm/locale/me.js create mode 100644 node_modules/dayjs/esm/locale/mi.js create mode 100644 node_modules/dayjs/esm/locale/mk.js create mode 100644 node_modules/dayjs/esm/locale/ml.js create mode 100644 node_modules/dayjs/esm/locale/mn.js create mode 100644 node_modules/dayjs/esm/locale/mr.js create mode 100644 node_modules/dayjs/esm/locale/ms-my.js create mode 100644 node_modules/dayjs/esm/locale/ms.js create mode 100644 node_modules/dayjs/esm/locale/mt.js create mode 100644 node_modules/dayjs/esm/locale/my.js create mode 100644 node_modules/dayjs/esm/locale/nb.js create mode 100644 node_modules/dayjs/esm/locale/ne.js create mode 100644 node_modules/dayjs/esm/locale/nl-be.js create mode 100644 node_modules/dayjs/esm/locale/nl.js create mode 100644 node_modules/dayjs/esm/locale/nn.js create mode 100644 node_modules/dayjs/esm/locale/oc-lnc.js create mode 100644 node_modules/dayjs/esm/locale/pa-in.js create mode 100644 node_modules/dayjs/esm/locale/pl.js create mode 100644 node_modules/dayjs/esm/locale/pt-br.js create mode 100644 node_modules/dayjs/esm/locale/pt.js create mode 100644 node_modules/dayjs/esm/locale/rn.js create mode 100644 node_modules/dayjs/esm/locale/ro.js create mode 100644 node_modules/dayjs/esm/locale/ru.js create mode 100644 node_modules/dayjs/esm/locale/rw.js create mode 100644 node_modules/dayjs/esm/locale/sd.js create mode 100644 node_modules/dayjs/esm/locale/se.js create mode 100644 node_modules/dayjs/esm/locale/si.js create mode 100644 node_modules/dayjs/esm/locale/sk.js create mode 100644 node_modules/dayjs/esm/locale/sl.js create mode 100644 node_modules/dayjs/esm/locale/sq.js create mode 100644 node_modules/dayjs/esm/locale/sr-cyrl.js create mode 100644 node_modules/dayjs/esm/locale/sr.js create mode 100644 node_modules/dayjs/esm/locale/ss.js create mode 100644 node_modules/dayjs/esm/locale/sv-fi.js create mode 100644 node_modules/dayjs/esm/locale/sv.js create mode 100644 node_modules/dayjs/esm/locale/sw.js create mode 100644 node_modules/dayjs/esm/locale/ta.js create mode 100644 node_modules/dayjs/esm/locale/te.js create mode 100644 node_modules/dayjs/esm/locale/tet.js create mode 100644 node_modules/dayjs/esm/locale/tg.js create mode 100644 node_modules/dayjs/esm/locale/th.js create mode 100644 node_modules/dayjs/esm/locale/tk.js create mode 100644 node_modules/dayjs/esm/locale/tl-ph.js create mode 100644 node_modules/dayjs/esm/locale/tlh.js create mode 100644 node_modules/dayjs/esm/locale/tr.js create mode 100644 node_modules/dayjs/esm/locale/types.d.ts create mode 100644 node_modules/dayjs/esm/locale/tzl.js create mode 100644 node_modules/dayjs/esm/locale/tzm-latn.js create mode 100644 node_modules/dayjs/esm/locale/tzm.js create mode 100644 node_modules/dayjs/esm/locale/ug-cn.js create mode 100644 node_modules/dayjs/esm/locale/uk.js create mode 100644 node_modules/dayjs/esm/locale/ur.js create mode 100644 node_modules/dayjs/esm/locale/uz-latn.js create mode 100644 node_modules/dayjs/esm/locale/uz.js create mode 100644 node_modules/dayjs/esm/locale/vi.js create mode 100644 node_modules/dayjs/esm/locale/x-pseudo.js create mode 100644 node_modules/dayjs/esm/locale/yo.js create mode 100644 node_modules/dayjs/esm/locale/zh-cn.js create mode 100644 node_modules/dayjs/esm/locale/zh-hk.js create mode 100644 node_modules/dayjs/esm/locale/zh-tw.js create mode 100644 node_modules/dayjs/esm/locale/zh.js create mode 100644 node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/advancedFormat/index.js create mode 100644 node_modules/dayjs/esm/plugin/arraySupport/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/arraySupport/index.js create mode 100644 node_modules/dayjs/esm/plugin/badMutable/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/badMutable/index.js create mode 100644 node_modules/dayjs/esm/plugin/bigIntSupport/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/bigIntSupport/index.js create mode 100644 node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/buddhistEra/index.js create mode 100644 node_modules/dayjs/esm/plugin/calendar/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/calendar/index.js create mode 100644 node_modules/dayjs/esm/plugin/customParseFormat/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/customParseFormat/index.js create mode 100644 node_modules/dayjs/esm/plugin/dayOfYear/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/dayOfYear/index.js create mode 100644 node_modules/dayjs/esm/plugin/devHelper/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/devHelper/index.js create mode 100644 node_modules/dayjs/esm/plugin/duration/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/duration/index.js create mode 100644 node_modules/dayjs/esm/plugin/isBetween/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isBetween/index.js create mode 100644 node_modules/dayjs/esm/plugin/isLeapYear/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isLeapYear/index.js create mode 100644 node_modules/dayjs/esm/plugin/isMoment/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isMoment/index.js create mode 100644 node_modules/dayjs/esm/plugin/isSameOrAfter/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isSameOrAfter/index.js create mode 100644 node_modules/dayjs/esm/plugin/isSameOrBefore/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isSameOrBefore/index.js create mode 100644 node_modules/dayjs/esm/plugin/isToday/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isToday/index.js create mode 100644 node_modules/dayjs/esm/plugin/isTomorrow/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isTomorrow/index.js create mode 100644 node_modules/dayjs/esm/plugin/isYesterday/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isYesterday/index.js create mode 100644 node_modules/dayjs/esm/plugin/isoWeek/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isoWeek/index.js create mode 100644 node_modules/dayjs/esm/plugin/isoWeeksInYear/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/isoWeeksInYear/index.js create mode 100644 node_modules/dayjs/esm/plugin/localeData/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/localeData/index.js create mode 100644 node_modules/dayjs/esm/plugin/localizedFormat/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/localizedFormat/index.js create mode 100644 node_modules/dayjs/esm/plugin/localizedFormat/utils.js create mode 100644 node_modules/dayjs/esm/plugin/minMax/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/minMax/index.js create mode 100644 node_modules/dayjs/esm/plugin/objectSupport/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/objectSupport/index.js create mode 100644 node_modules/dayjs/esm/plugin/pluralGetSet/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/pluralGetSet/index.js create mode 100644 node_modules/dayjs/esm/plugin/preParsePostFormat/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/preParsePostFormat/index.js create mode 100644 node_modules/dayjs/esm/plugin/quarterOfYear/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/quarterOfYear/index.js create mode 100644 node_modules/dayjs/esm/plugin/relativeTime/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/relativeTime/index.js create mode 100644 node_modules/dayjs/esm/plugin/timezone/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/timezone/index.js create mode 100644 node_modules/dayjs/esm/plugin/toArray/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/toArray/index.js create mode 100644 node_modules/dayjs/esm/plugin/toObject/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/toObject/index.js create mode 100644 node_modules/dayjs/esm/plugin/updateLocale/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/updateLocale/index.js create mode 100644 node_modules/dayjs/esm/plugin/utc/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/utc/index.js create mode 100644 node_modules/dayjs/esm/plugin/weekOfYear/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/weekOfYear/index.js create mode 100644 node_modules/dayjs/esm/plugin/weekYear/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/weekYear/index.js create mode 100644 node_modules/dayjs/esm/plugin/weekday/index.d.ts create mode 100644 node_modules/dayjs/esm/plugin/weekday/index.js create mode 100644 node_modules/dayjs/esm/utils.js create mode 100644 node_modules/dayjs/index.d.ts create mode 100644 node_modules/dayjs/locale.json create mode 100644 node_modules/dayjs/locale/af.js create mode 100644 node_modules/dayjs/locale/am.js create mode 100644 node_modules/dayjs/locale/ar-dz.js create mode 100644 node_modules/dayjs/locale/ar-iq.js create mode 100644 node_modules/dayjs/locale/ar-kw.js create mode 100644 node_modules/dayjs/locale/ar-ly.js create mode 100644 node_modules/dayjs/locale/ar-ma.js create mode 100644 node_modules/dayjs/locale/ar-sa.js create mode 100644 node_modules/dayjs/locale/ar-tn.js create mode 100644 node_modules/dayjs/locale/ar.js create mode 100644 node_modules/dayjs/locale/az.js create mode 100644 node_modules/dayjs/locale/be.js create mode 100644 node_modules/dayjs/locale/bg.js create mode 100644 node_modules/dayjs/locale/bi.js create mode 100644 node_modules/dayjs/locale/bm.js create mode 100644 node_modules/dayjs/locale/bn-bd.js create mode 100644 node_modules/dayjs/locale/bn.js create mode 100644 node_modules/dayjs/locale/bo.js create mode 100644 node_modules/dayjs/locale/br.js create mode 100644 node_modules/dayjs/locale/bs.js create mode 100644 node_modules/dayjs/locale/ca.js create mode 100644 node_modules/dayjs/locale/cs.js create mode 100644 node_modules/dayjs/locale/cv.js create mode 100644 node_modules/dayjs/locale/cy.js create mode 100644 node_modules/dayjs/locale/da.js create mode 100644 node_modules/dayjs/locale/de-at.js create mode 100644 node_modules/dayjs/locale/de-ch.js create mode 100644 node_modules/dayjs/locale/de.js create mode 100644 node_modules/dayjs/locale/dv.js create mode 100644 node_modules/dayjs/locale/el.js create mode 100644 node_modules/dayjs/locale/en-au.js create mode 100644 node_modules/dayjs/locale/en-ca.js create mode 100644 node_modules/dayjs/locale/en-gb.js create mode 100644 node_modules/dayjs/locale/en-ie.js create mode 100644 node_modules/dayjs/locale/en-il.js create mode 100644 node_modules/dayjs/locale/en-in.js create mode 100644 node_modules/dayjs/locale/en-nz.js create mode 100644 node_modules/dayjs/locale/en-sg.js create mode 100644 node_modules/dayjs/locale/en-tt.js create mode 100644 node_modules/dayjs/locale/en.js create mode 100644 node_modules/dayjs/locale/eo.js create mode 100644 node_modules/dayjs/locale/es-do.js create mode 100644 node_modules/dayjs/locale/es-mx.js create mode 100644 node_modules/dayjs/locale/es-pr.js create mode 100644 node_modules/dayjs/locale/es-us.js create mode 100644 node_modules/dayjs/locale/es.js create mode 100644 node_modules/dayjs/locale/et.js create mode 100644 node_modules/dayjs/locale/eu.js create mode 100644 node_modules/dayjs/locale/fa.js create mode 100644 node_modules/dayjs/locale/fi.js create mode 100644 node_modules/dayjs/locale/fo.js create mode 100644 node_modules/dayjs/locale/fr-ca.js create mode 100644 node_modules/dayjs/locale/fr-ch.js create mode 100644 node_modules/dayjs/locale/fr.js create mode 100644 node_modules/dayjs/locale/fy.js create mode 100644 node_modules/dayjs/locale/ga.js create mode 100644 node_modules/dayjs/locale/gd.js create mode 100644 node_modules/dayjs/locale/gl.js create mode 100644 node_modules/dayjs/locale/gom-latn.js create mode 100644 node_modules/dayjs/locale/gu.js create mode 100644 node_modules/dayjs/locale/he.js create mode 100644 node_modules/dayjs/locale/hi.js create mode 100644 node_modules/dayjs/locale/hr.js create mode 100644 node_modules/dayjs/locale/ht.js create mode 100644 node_modules/dayjs/locale/hu.js create mode 100644 node_modules/dayjs/locale/hy-am.js create mode 100644 node_modules/dayjs/locale/id.js create mode 100644 node_modules/dayjs/locale/index.d.ts create mode 100644 node_modules/dayjs/locale/is.js create mode 100644 node_modules/dayjs/locale/it-ch.js create mode 100644 node_modules/dayjs/locale/it.js create mode 100644 node_modules/dayjs/locale/ja.js create mode 100644 node_modules/dayjs/locale/jv.js create mode 100644 node_modules/dayjs/locale/ka.js create mode 100644 node_modules/dayjs/locale/kk.js create mode 100644 node_modules/dayjs/locale/km.js create mode 100644 node_modules/dayjs/locale/kn.js create mode 100644 node_modules/dayjs/locale/ko.js create mode 100644 node_modules/dayjs/locale/ku.js create mode 100644 node_modules/dayjs/locale/ky.js create mode 100644 node_modules/dayjs/locale/lb.js create mode 100644 node_modules/dayjs/locale/lo.js create mode 100644 node_modules/dayjs/locale/lt.js create mode 100644 node_modules/dayjs/locale/lv.js create mode 100644 node_modules/dayjs/locale/me.js create mode 100644 node_modules/dayjs/locale/mi.js create mode 100644 node_modules/dayjs/locale/mk.js create mode 100644 node_modules/dayjs/locale/ml.js create mode 100644 node_modules/dayjs/locale/mn.js create mode 100644 node_modules/dayjs/locale/mr.js create mode 100644 node_modules/dayjs/locale/ms-my.js create mode 100644 node_modules/dayjs/locale/ms.js create mode 100644 node_modules/dayjs/locale/mt.js create mode 100644 node_modules/dayjs/locale/my.js create mode 100644 node_modules/dayjs/locale/nb.js create mode 100644 node_modules/dayjs/locale/ne.js create mode 100644 node_modules/dayjs/locale/nl-be.js create mode 100644 node_modules/dayjs/locale/nl.js create mode 100644 node_modules/dayjs/locale/nn.js create mode 100644 node_modules/dayjs/locale/oc-lnc.js create mode 100644 node_modules/dayjs/locale/pa-in.js create mode 100644 node_modules/dayjs/locale/pl.js create mode 100644 node_modules/dayjs/locale/pt-br.js create mode 100644 node_modules/dayjs/locale/pt.js create mode 100644 node_modules/dayjs/locale/rn.js create mode 100644 node_modules/dayjs/locale/ro.js create mode 100644 node_modules/dayjs/locale/ru.js create mode 100644 node_modules/dayjs/locale/rw.js create mode 100644 node_modules/dayjs/locale/sd.js create mode 100644 node_modules/dayjs/locale/se.js create mode 100644 node_modules/dayjs/locale/si.js create mode 100644 node_modules/dayjs/locale/sk.js create mode 100644 node_modules/dayjs/locale/sl.js create mode 100644 node_modules/dayjs/locale/sq.js create mode 100644 node_modules/dayjs/locale/sr-cyrl.js create mode 100644 node_modules/dayjs/locale/sr.js create mode 100644 node_modules/dayjs/locale/ss.js create mode 100644 node_modules/dayjs/locale/sv-fi.js create mode 100644 node_modules/dayjs/locale/sv.js create mode 100644 node_modules/dayjs/locale/sw.js create mode 100644 node_modules/dayjs/locale/ta.js create mode 100644 node_modules/dayjs/locale/te.js create mode 100644 node_modules/dayjs/locale/tet.js create mode 100644 node_modules/dayjs/locale/tg.js create mode 100644 node_modules/dayjs/locale/th.js create mode 100644 node_modules/dayjs/locale/tk.js create mode 100644 node_modules/dayjs/locale/tl-ph.js create mode 100644 node_modules/dayjs/locale/tlh.js create mode 100644 node_modules/dayjs/locale/tr.js create mode 100644 node_modules/dayjs/locale/types.d.ts create mode 100644 node_modules/dayjs/locale/tzl.js create mode 100644 node_modules/dayjs/locale/tzm-latn.js create mode 100644 node_modules/dayjs/locale/tzm.js create mode 100644 node_modules/dayjs/locale/ug-cn.js create mode 100644 node_modules/dayjs/locale/uk.js create mode 100644 node_modules/dayjs/locale/ur.js create mode 100644 node_modules/dayjs/locale/uz-latn.js create mode 100644 node_modules/dayjs/locale/uz.js create mode 100644 node_modules/dayjs/locale/vi.js create mode 100644 node_modules/dayjs/locale/x-pseudo.js create mode 100644 node_modules/dayjs/locale/yo.js create mode 100644 node_modules/dayjs/locale/zh-cn.js create mode 100644 node_modules/dayjs/locale/zh-hk.js create mode 100644 node_modules/dayjs/locale/zh-tw.js create mode 100644 node_modules/dayjs/locale/zh.js create mode 100644 node_modules/dayjs/package.json create mode 100644 node_modules/dayjs/plugin/advancedFormat.d.ts create mode 100644 node_modules/dayjs/plugin/advancedFormat.js create mode 100644 node_modules/dayjs/plugin/arraySupport.d.ts create mode 100644 node_modules/dayjs/plugin/arraySupport.js create mode 100644 node_modules/dayjs/plugin/badMutable.d.ts create mode 100644 node_modules/dayjs/plugin/badMutable.js create mode 100644 node_modules/dayjs/plugin/bigIntSupport.d.ts create mode 100644 node_modules/dayjs/plugin/bigIntSupport.js create mode 100644 node_modules/dayjs/plugin/buddhistEra.d.ts create mode 100644 node_modules/dayjs/plugin/buddhistEra.js create mode 100644 node_modules/dayjs/plugin/calendar.d.ts create mode 100644 node_modules/dayjs/plugin/calendar.js create mode 100644 node_modules/dayjs/plugin/customParseFormat.d.ts create mode 100644 node_modules/dayjs/plugin/customParseFormat.js create mode 100644 node_modules/dayjs/plugin/dayOfYear.d.ts create mode 100644 node_modules/dayjs/plugin/dayOfYear.js create mode 100644 node_modules/dayjs/plugin/devHelper.d.ts create mode 100644 node_modules/dayjs/plugin/devHelper.js create mode 100644 node_modules/dayjs/plugin/duration.d.ts create mode 100644 node_modules/dayjs/plugin/duration.js create mode 100644 node_modules/dayjs/plugin/isBetween.d.ts create mode 100644 node_modules/dayjs/plugin/isBetween.js create mode 100644 node_modules/dayjs/plugin/isLeapYear.d.ts create mode 100644 node_modules/dayjs/plugin/isLeapYear.js create mode 100644 node_modules/dayjs/plugin/isMoment.d.ts create mode 100644 node_modules/dayjs/plugin/isMoment.js create mode 100644 node_modules/dayjs/plugin/isSameOrAfter.d.ts create mode 100644 node_modules/dayjs/plugin/isSameOrAfter.js create mode 100644 node_modules/dayjs/plugin/isSameOrBefore.d.ts create mode 100644 node_modules/dayjs/plugin/isSameOrBefore.js create mode 100644 node_modules/dayjs/plugin/isToday.d.ts create mode 100644 node_modules/dayjs/plugin/isToday.js create mode 100644 node_modules/dayjs/plugin/isTomorrow.d.ts create mode 100644 node_modules/dayjs/plugin/isTomorrow.js create mode 100644 node_modules/dayjs/plugin/isYesterday.d.ts create mode 100644 node_modules/dayjs/plugin/isYesterday.js create mode 100644 node_modules/dayjs/plugin/isoWeek.d.ts create mode 100644 node_modules/dayjs/plugin/isoWeek.js create mode 100644 node_modules/dayjs/plugin/isoWeeksInYear.d.ts create mode 100644 node_modules/dayjs/plugin/isoWeeksInYear.js create mode 100644 node_modules/dayjs/plugin/localeData.d.ts create mode 100644 node_modules/dayjs/plugin/localeData.js create mode 100644 node_modules/dayjs/plugin/localizedFormat.d.ts create mode 100644 node_modules/dayjs/plugin/localizedFormat.js create mode 100644 node_modules/dayjs/plugin/minMax.d.ts create mode 100644 node_modules/dayjs/plugin/minMax.js create mode 100644 node_modules/dayjs/plugin/objectSupport.d.ts create mode 100644 node_modules/dayjs/plugin/objectSupport.js create mode 100644 node_modules/dayjs/plugin/pluralGetSet.d.ts create mode 100644 node_modules/dayjs/plugin/pluralGetSet.js create mode 100644 node_modules/dayjs/plugin/preParsePostFormat.d.ts create mode 100644 node_modules/dayjs/plugin/preParsePostFormat.js create mode 100644 node_modules/dayjs/plugin/quarterOfYear.d.ts create mode 100644 node_modules/dayjs/plugin/quarterOfYear.js create mode 100644 node_modules/dayjs/plugin/relativeTime.d.ts create mode 100644 node_modules/dayjs/plugin/relativeTime.js create mode 100644 node_modules/dayjs/plugin/timezone.d.ts create mode 100644 node_modules/dayjs/plugin/timezone.js create mode 100644 node_modules/dayjs/plugin/toArray.d.ts create mode 100644 node_modules/dayjs/plugin/toArray.js create mode 100644 node_modules/dayjs/plugin/toObject.d.ts create mode 100644 node_modules/dayjs/plugin/toObject.js create mode 100644 node_modules/dayjs/plugin/updateLocale.d.ts create mode 100644 node_modules/dayjs/plugin/updateLocale.js create mode 100644 node_modules/dayjs/plugin/utc.d.ts create mode 100644 node_modules/dayjs/plugin/utc.js create mode 100644 node_modules/dayjs/plugin/weekOfYear.d.ts create mode 100644 node_modules/dayjs/plugin/weekOfYear.js create mode 100644 node_modules/dayjs/plugin/weekYear.d.ts create mode 100644 node_modules/dayjs/plugin/weekYear.js create mode 100644 node_modules/dayjs/plugin/weekday.d.ts create mode 100644 node_modules/dayjs/plugin/weekday.js create mode 100644 node_modules/delayed-stream/.npmignore create mode 100644 node_modules/delayed-stream/License create mode 100644 node_modules/delayed-stream/Makefile create mode 100644 node_modules/delayed-stream/Readme.md create mode 100644 node_modules/delayed-stream/lib/delayed_stream.js create mode 100644 node_modules/delayed-stream/package.json create mode 100644 node_modules/delegates/.npmignore create mode 100644 node_modules/delegates/History.md create mode 100644 node_modules/delegates/License create mode 100644 node_modules/delegates/Makefile create mode 100644 node_modules/delegates/Readme.md create mode 100644 node_modules/delegates/index.js create mode 100644 node_modules/delegates/package.json create mode 100644 node_modules/delegates/test/index.js create mode 100644 node_modules/detect-libc/LICENSE create mode 100644 node_modules/detect-libc/README.md create mode 100644 node_modules/detect-libc/index.d.ts create mode 100644 node_modules/detect-libc/lib/detect-libc.js create mode 100644 node_modules/detect-libc/lib/filesystem.js create mode 100644 node_modules/detect-libc/lib/process.js create mode 100644 node_modules/detect-libc/package.json create mode 100644 node_modules/ecdsa-sig-formatter/CODEOWNERS create mode 100644 node_modules/ecdsa-sig-formatter/LICENSE create mode 100644 node_modules/ecdsa-sig-formatter/README.md create mode 100644 node_modules/ecdsa-sig-formatter/package.json create mode 100644 node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts create mode 100644 node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js create mode 100644 node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js create mode 100644 node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/emoji-regex/README.md create mode 100644 node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/emoji-regex/index.js create mode 100644 node_modules/emoji-regex/package.json create mode 100644 node_modules/emoji-regex/text.js create mode 100644 node_modules/follow-redirects/LICENSE create mode 100644 node_modules/follow-redirects/README.md create mode 100644 node_modules/follow-redirects/debug.js create mode 100644 node_modules/follow-redirects/http.js create mode 100644 node_modules/follow-redirects/https.js create mode 100644 node_modules/follow-redirects/index.js create mode 100644 node_modules/follow-redirects/package.json create mode 100644 node_modules/form-data/License create mode 100644 node_modules/form-data/README.md.bak create mode 100644 node_modules/form-data/Readme.md create mode 100644 node_modules/form-data/index.d.ts create mode 100644 node_modules/form-data/lib/browser.js create mode 100644 node_modules/form-data/lib/form_data.js create mode 100644 node_modules/form-data/lib/populate.js create mode 100644 node_modules/form-data/package.json create mode 100644 node_modules/fs-minipass/LICENSE create mode 100644 node_modules/fs-minipass/README.md create mode 100644 node_modules/fs-minipass/index.js create mode 100644 node_modules/fs-minipass/node_modules/minipass/LICENSE create mode 100644 node_modules/fs-minipass/node_modules/minipass/README.md create mode 100644 node_modules/fs-minipass/node_modules/minipass/index.d.ts create mode 100644 node_modules/fs-minipass/node_modules/minipass/index.js create mode 100644 node_modules/fs-minipass/node_modules/minipass/package.json create mode 100644 node_modules/fs-minipass/package.json create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/gauge/CHANGELOG.md create mode 100644 node_modules/gauge/LICENSE create mode 100644 node_modules/gauge/README.md create mode 100644 node_modules/gauge/base-theme.js create mode 100644 node_modules/gauge/error.js create mode 100644 node_modules/gauge/has-color.js create mode 100644 node_modules/gauge/index.js create mode 100644 node_modules/gauge/package.json create mode 100644 node_modules/gauge/plumbing.js create mode 100644 node_modules/gauge/process.js create mode 100644 node_modules/gauge/progress-bar.js create mode 100644 node_modules/gauge/render-template.js create mode 100644 node_modules/gauge/set-immediate.js create mode 100644 node_modules/gauge/set-interval.js create mode 100644 node_modules/gauge/spin.js create mode 100644 node_modules/gauge/template-item.js create mode 100644 node_modules/gauge/theme-set.js create mode 100644 node_modules/gauge/themes.js create mode 100644 node_modules/gauge/wide-truncate.js create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/has-unicode/LICENSE create mode 100644 node_modules/has-unicode/README.md create mode 100644 node_modules/has-unicode/index.js create mode 100644 node_modules/has-unicode/package.json create mode 100644 node_modules/https-proxy-agent/README.md create mode 100644 node_modules/https-proxy-agent/dist/agent.d.ts create mode 100644 node_modules/https-proxy-agent/dist/agent.js create mode 100644 node_modules/https-proxy-agent/dist/agent.js.map create mode 100644 node_modules/https-proxy-agent/dist/index.d.ts create mode 100644 node_modules/https-proxy-agent/dist/index.js create mode 100644 node_modules/https-proxy-agent/dist/index.js.map create mode 100644 node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts create mode 100644 node_modules/https-proxy-agent/dist/parse-proxy-response.js create mode 100644 node_modules/https-proxy-agent/dist/parse-proxy-response.js.map create mode 100644 node_modules/https-proxy-agent/node_modules/debug/LICENSE create mode 100644 node_modules/https-proxy-agent/node_modules/debug/README.md create mode 100644 node_modules/https-proxy-agent/node_modules/debug/package.json create mode 100644 node_modules/https-proxy-agent/node_modules/debug/src/browser.js create mode 100644 node_modules/https-proxy-agent/node_modules/debug/src/common.js create mode 100644 node_modules/https-proxy-agent/node_modules/debug/src/index.js create mode 100644 node_modules/https-proxy-agent/node_modules/debug/src/node.js create mode 100644 node_modules/https-proxy-agent/node_modules/ms/index.js create mode 100644 node_modules/https-proxy-agent/node_modules/ms/license.md create mode 100644 node_modules/https-proxy-agent/node_modules/ms/package.json create mode 100644 node_modules/https-proxy-agent/node_modules/ms/readme.md create mode 100644 node_modules/https-proxy-agent/package.json create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/is-fullwidth-code-point/index.d.ts create mode 100644 node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/is-fullwidth-code-point/readme.md create mode 100644 node_modules/jsonwebtoken/LICENSE create mode 100644 node_modules/jsonwebtoken/README.md create mode 100644 node_modules/jsonwebtoken/decode.js create mode 100644 node_modules/jsonwebtoken/index.js create mode 100644 node_modules/jsonwebtoken/lib/JsonWebTokenError.js create mode 100644 node_modules/jsonwebtoken/lib/NotBeforeError.js create mode 100644 node_modules/jsonwebtoken/lib/TokenExpiredError.js create mode 100644 node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js create mode 100644 node_modules/jsonwebtoken/lib/psSupported.js create mode 100644 node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js create mode 100644 node_modules/jsonwebtoken/lib/timespan.js create mode 100644 node_modules/jsonwebtoken/lib/validateAsymmetricKey.js create mode 100644 node_modules/jsonwebtoken/node_modules/ms/index.js create mode 100644 node_modules/jsonwebtoken/node_modules/ms/license.md create mode 100644 node_modules/jsonwebtoken/node_modules/ms/package.json create mode 100644 node_modules/jsonwebtoken/node_modules/ms/readme.md create mode 100644 node_modules/jsonwebtoken/package.json create mode 100644 node_modules/jsonwebtoken/sign.js create mode 100644 node_modules/jsonwebtoken/verify.js create mode 100644 node_modules/jwa/LICENSE create mode 100644 node_modules/jwa/README.md create mode 100644 node_modules/jwa/index.js create mode 100644 node_modules/jwa/package.json create mode 100644 node_modules/jws/CHANGELOG.md create mode 100644 node_modules/jws/LICENSE create mode 100644 node_modules/jws/index.js create mode 100644 node_modules/jws/lib/data-stream.js create mode 100644 node_modules/jws/lib/sign-stream.js create mode 100644 node_modules/jws/lib/tostring.js create mode 100644 node_modules/jws/lib/verify-stream.js create mode 100644 node_modules/jws/package.json create mode 100644 node_modules/jws/readme.md create mode 100644 node_modules/lodash.includes/LICENSE create mode 100644 node_modules/lodash.includes/README.md create mode 100644 node_modules/lodash.includes/index.js create mode 100644 node_modules/lodash.includes/package.json create mode 100644 node_modules/lodash.isboolean/LICENSE create mode 100644 node_modules/lodash.isboolean/README.md create mode 100644 node_modules/lodash.isboolean/index.js create mode 100644 node_modules/lodash.isboolean/package.json create mode 100644 node_modules/lodash.isinteger/LICENSE create mode 100644 node_modules/lodash.isinteger/README.md create mode 100644 node_modules/lodash.isinteger/index.js create mode 100644 node_modules/lodash.isinteger/package.json create mode 100644 node_modules/lodash.isnumber/LICENSE create mode 100644 node_modules/lodash.isnumber/README.md create mode 100644 node_modules/lodash.isnumber/index.js create mode 100644 node_modules/lodash.isnumber/package.json create mode 100644 node_modules/lodash.isplainobject/LICENSE create mode 100644 node_modules/lodash.isplainobject/README.md create mode 100644 node_modules/lodash.isplainobject/index.js create mode 100644 node_modules/lodash.isplainobject/package.json create mode 100644 node_modules/lodash.isstring/LICENSE create mode 100644 node_modules/lodash.isstring/README.md create mode 100644 node_modules/lodash.isstring/index.js create mode 100644 node_modules/lodash.isstring/package.json create mode 100644 node_modules/lodash.once/LICENSE create mode 100644 node_modules/lodash.once/README.md create mode 100644 node_modules/lodash.once/index.js create mode 100644 node_modules/lodash.once/package.json create mode 100644 node_modules/make-dir/index.d.ts create mode 100644 node_modules/make-dir/index.js create mode 100644 node_modules/make-dir/license create mode 100644 node_modules/make-dir/node_modules/.bin/semver create mode 100644 node_modules/make-dir/node_modules/.bin/semver.cmd create mode 100644 node_modules/make-dir/node_modules/.bin/semver.ps1 create mode 100644 node_modules/make-dir/node_modules/semver/LICENSE create mode 100644 node_modules/make-dir/node_modules/semver/README.md create mode 100644 node_modules/make-dir/node_modules/semver/bin/semver.js create mode 100644 node_modules/make-dir/node_modules/semver/package.json create mode 100644 node_modules/make-dir/node_modules/semver/range.bnf create mode 100644 node_modules/make-dir/node_modules/semver/semver.js create mode 100644 node_modules/make-dir/package.json create mode 100644 node_modules/make-dir/readme.md create mode 100644 node_modules/minipass/LICENSE create mode 100644 node_modules/minipass/README.md create mode 100644 node_modules/minipass/index.d.ts create mode 100644 node_modules/minipass/index.js create mode 100644 node_modules/minipass/index.mjs create mode 100644 node_modules/minipass/package.json create mode 100644 node_modules/minizlib/LICENSE create mode 100644 node_modules/minizlib/README.md create mode 100644 node_modules/minizlib/constants.js create mode 100644 node_modules/minizlib/index.js create mode 100644 node_modules/minizlib/node_modules/minipass/LICENSE create mode 100644 node_modules/minizlib/node_modules/minipass/README.md create mode 100644 node_modules/minizlib/node_modules/minipass/index.d.ts create mode 100644 node_modules/minizlib/node_modules/minipass/index.js create mode 100644 node_modules/minizlib/node_modules/minipass/package.json create mode 100644 node_modules/minizlib/package.json create mode 100644 node_modules/mkdirp/CHANGELOG.md create mode 100644 node_modules/mkdirp/LICENSE create mode 100644 node_modules/mkdirp/bin/cmd.js create mode 100644 node_modules/mkdirp/index.js create mode 100644 node_modules/mkdirp/lib/find-made.js create mode 100644 node_modules/mkdirp/lib/mkdirp-manual.js create mode 100644 node_modules/mkdirp/lib/mkdirp-native.js create mode 100644 node_modules/mkdirp/lib/opts-arg.js create mode 100644 node_modules/mkdirp/lib/path-arg.js create mode 100644 node_modules/mkdirp/lib/use-native.js create mode 100644 node_modules/mkdirp/package.json create mode 100644 node_modules/mkdirp/readme.markdown create mode 100644 node_modules/node-addon-api/LICENSE.md create mode 100644 node_modules/node-addon-api/README.md create mode 100644 node_modules/node-addon-api/common.gypi create mode 100644 node_modules/node-addon-api/except.gypi create mode 100644 node_modules/node-addon-api/index.js create mode 100644 node_modules/node-addon-api/napi-inl.deprecated.h create mode 100644 node_modules/node-addon-api/napi-inl.h create mode 100644 node_modules/node-addon-api/napi.h create mode 100644 node_modules/node-addon-api/node_api.gyp create mode 100644 node_modules/node-addon-api/noexcept.gypi create mode 100644 node_modules/node-addon-api/nothing.c create mode 100644 node_modules/node-addon-api/package-support.json create mode 100644 node_modules/node-addon-api/package.json create mode 100644 node_modules/node-addon-api/tools/README.md create mode 100644 node_modules/node-addon-api/tools/check-napi.js create mode 100644 node_modules/node-addon-api/tools/clang-format.js create mode 100644 node_modules/node-addon-api/tools/conversion.js create mode 100644 node_modules/node-addon-api/tools/eslint-format.js create mode 100644 node_modules/node-fetch/LICENSE.md create mode 100644 node_modules/node-fetch/README.md create mode 100644 node_modules/node-fetch/browser.js create mode 100644 node_modules/node-fetch/lib/index.es.js create mode 100644 node_modules/node-fetch/lib/index.js create mode 100644 node_modules/node-fetch/lib/index.mjs create mode 100644 node_modules/node-fetch/node_modules/tr46/.npmignore create mode 100644 node_modules/node-fetch/node_modules/tr46/index.js create mode 100644 node_modules/node-fetch/node_modules/tr46/lib/.gitkeep create mode 100644 node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json create mode 100644 node_modules/node-fetch/node_modules/tr46/package.json create mode 100644 node_modules/node-fetch/node_modules/webidl-conversions/LICENSE.md create mode 100644 node_modules/node-fetch/node_modules/webidl-conversions/README.md create mode 100644 node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js create mode 100644 node_modules/node-fetch/node_modules/webidl-conversions/package.json create mode 100644 node_modules/node-fetch/node_modules/whatwg-url/LICENSE.txt create mode 100644 node_modules/node-fetch/node_modules/whatwg-url/README.md create mode 100644 node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js create mode 100644 node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js create mode 100644 node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js create mode 100644 node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js create mode 100644 node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js create mode 100644 node_modules/node-fetch/node_modules/whatwg-url/package.json create mode 100644 node_modules/node-fetch/package.json create mode 100644 node_modules/npmlog/LICENSE create mode 100644 node_modules/npmlog/README.md create mode 100644 node_modules/npmlog/log.js create mode 100644 node_modules/npmlog/package.json create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/once/LICENSE create mode 100644 node_modules/once/README.md create mode 100644 node_modules/once/once.js create mode 100644 node_modules/once/package.json create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/proxy-from-env/.eslintrc create mode 100644 node_modules/proxy-from-env/.travis.yml create mode 100644 node_modules/proxy-from-env/LICENSE create mode 100644 node_modules/proxy-from-env/README.md create mode 100644 node_modules/proxy-from-env/index.js create mode 100644 node_modules/proxy-from-env/package.json create mode 100644 node_modules/proxy-from-env/test.js create mode 100644 node_modules/querystringify/LICENSE create mode 100644 node_modules/querystringify/README.md create mode 100644 node_modules/querystringify/index.js create mode 100644 node_modules/querystringify/package.json create mode 100644 node_modules/readable-stream/CONTRIBUTING.md create mode 100644 node_modules/readable-stream/GOVERNANCE.md create mode 100644 node_modules/readable-stream/LICENSE create mode 100644 node_modules/readable-stream/README.md create mode 100644 node_modules/readable-stream/errors-browser.js create mode 100644 node_modules/readable-stream/errors.js create mode 100644 node_modules/readable-stream/experimentalWarning.js create mode 100644 node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 node_modules/readable-stream/lib/_stream_readable.js create mode 100644 node_modules/readable-stream/lib/_stream_transform.js create mode 100644 node_modules/readable-stream/lib/_stream_writable.js create mode 100644 node_modules/readable-stream/lib/internal/streams/async_iterator.js create mode 100644 node_modules/readable-stream/lib/internal/streams/buffer_list.js create mode 100644 node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 node_modules/readable-stream/lib/internal/streams/end-of-stream.js create mode 100644 node_modules/readable-stream/lib/internal/streams/from-browser.js create mode 100644 node_modules/readable-stream/lib/internal/streams/from.js create mode 100644 node_modules/readable-stream/lib/internal/streams/pipeline.js create mode 100644 node_modules/readable-stream/lib/internal/streams/state.js create mode 100644 node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 node_modules/readable-stream/package.json create mode 100644 node_modules/readable-stream/readable-browser.js create mode 100644 node_modules/readable-stream/readable.js create mode 100644 node_modules/requires-port/.npmignore create mode 100644 node_modules/requires-port/.travis.yml create mode 100644 node_modules/requires-port/LICENSE create mode 100644 node_modules/requires-port/README.md create mode 100644 node_modules/requires-port/index.js create mode 100644 node_modules/requires-port/package.json create mode 100644 node_modules/requires-port/test.js create mode 100644 node_modules/rimraf/CHANGELOG.md create mode 100644 node_modules/rimraf/LICENSE create mode 100644 node_modules/rimraf/README.md create mode 100644 node_modules/rimraf/bin.js create mode 100644 node_modules/rimraf/package.json create mode 100644 node_modules/rimraf/rimraf.js create mode 100644 node_modules/scmp/.travis.yml create mode 100644 node_modules/scmp/HISTORY.md create mode 100644 node_modules/scmp/LICENSE create mode 100644 node_modules/scmp/README.md create mode 100644 node_modules/scmp/benchmark/benchmark.js create mode 100644 node_modules/scmp/benchmark/crypto-check.js create mode 100644 node_modules/scmp/index.js create mode 100644 node_modules/scmp/lib/scmpCompare.js create mode 100644 node_modules/scmp/package.json create mode 100644 node_modules/scmp/test/test.js create mode 100644 node_modules/set-blocking/CHANGELOG.md create mode 100644 node_modules/set-blocking/LICENSE.txt create mode 100644 node_modules/set-blocking/README.md create mode 100644 node_modules/set-blocking/index.js create mode 100644 node_modules/set-blocking/package.json create mode 100644 node_modules/signal-exit/LICENSE.txt create mode 100644 node_modules/signal-exit/README.md create mode 100644 node_modules/signal-exit/index.js create mode 100644 node_modules/signal-exit/package.json create mode 100644 node_modules/signal-exit/signals.js create mode 100644 node_modules/string-width/index.d.ts create mode 100644 node_modules/string-width/index.js create mode 100644 node_modules/string-width/license create mode 100644 node_modules/string-width/package.json create mode 100644 node_modules/string-width/readme.md create mode 100644 node_modules/string_decoder/LICENSE create mode 100644 node_modules/string_decoder/README.md create mode 100644 node_modules/string_decoder/lib/string_decoder.js create mode 100644 node_modules/string_decoder/package.json create mode 100644 node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/tar/LICENSE create mode 100644 node_modules/tar/README.md create mode 100644 node_modules/tar/index.js create mode 100644 node_modules/tar/lib/create.js create mode 100644 node_modules/tar/lib/extract.js create mode 100644 node_modules/tar/lib/get-write-flag.js create mode 100644 node_modules/tar/lib/header.js create mode 100644 node_modules/tar/lib/high-level-opt.js create mode 100644 node_modules/tar/lib/large-numbers.js create mode 100644 node_modules/tar/lib/list.js create mode 100644 node_modules/tar/lib/mkdir.js create mode 100644 node_modules/tar/lib/mode-fix.js create mode 100644 node_modules/tar/lib/normalize-unicode.js create mode 100644 node_modules/tar/lib/normalize-windows-path.js create mode 100644 node_modules/tar/lib/pack.js create mode 100644 node_modules/tar/lib/parse.js create mode 100644 node_modules/tar/lib/path-reservations.js create mode 100644 node_modules/tar/lib/pax.js create mode 100644 node_modules/tar/lib/read-entry.js create mode 100644 node_modules/tar/lib/replace.js create mode 100644 node_modules/tar/lib/strip-absolute-path.js create mode 100644 node_modules/tar/lib/strip-trailing-slashes.js create mode 100644 node_modules/tar/lib/types.js create mode 100644 node_modules/tar/lib/unpack.js create mode 100644 node_modules/tar/lib/update.js create mode 100644 node_modules/tar/lib/warn-mixin.js create mode 100644 node_modules/tar/lib/winchars.js create mode 100644 node_modules/tar/lib/write-entry.js create mode 100644 node_modules/tar/package.json create mode 100644 node_modules/twilio/LICENSE create mode 100644 node_modules/twilio/README.md create mode 100644 node_modules/twilio/index.d.ts create mode 100644 node_modules/twilio/index.js create mode 100644 node_modules/twilio/lib/base/BaseTwilio.d.ts create mode 100644 node_modules/twilio/lib/base/BaseTwilio.js create mode 100644 node_modules/twilio/lib/base/Domain.d.ts create mode 100644 node_modules/twilio/lib/base/Domain.js create mode 100644 node_modules/twilio/lib/base/Page.d.ts create mode 100644 node_modules/twilio/lib/base/Page.js create mode 100644 node_modules/twilio/lib/base/RequestClient.d.ts create mode 100644 node_modules/twilio/lib/base/RequestClient.js create mode 100644 node_modules/twilio/lib/base/RestException.d.ts create mode 100644 node_modules/twilio/lib/base/RestException.js create mode 100644 node_modules/twilio/lib/base/Version.d.ts create mode 100644 node_modules/twilio/lib/base/Version.js create mode 100644 node_modules/twilio/lib/base/deserialize.d.ts create mode 100644 node_modules/twilio/lib/base/deserialize.js create mode 100644 node_modules/twilio/lib/base/serialize.d.ts create mode 100644 node_modules/twilio/lib/base/serialize.js create mode 100644 node_modules/twilio/lib/base/utility.d.ts create mode 100644 node_modules/twilio/lib/base/utility.js create mode 100644 node_modules/twilio/lib/base/values.d.ts create mode 100644 node_modules/twilio/lib/base/values.js create mode 100644 node_modules/twilio/lib/http/request.d.ts create mode 100644 node_modules/twilio/lib/http/request.js create mode 100644 node_modules/twilio/lib/http/response.d.ts create mode 100644 node_modules/twilio/lib/http/response.js create mode 100644 node_modules/twilio/lib/index.d.ts create mode 100644 node_modules/twilio/lib/index.js create mode 100644 node_modules/twilio/lib/interfaces.d.ts create mode 100644 node_modules/twilio/lib/interfaces.js create mode 100644 node_modules/twilio/lib/jwt/AccessToken.d.ts create mode 100644 node_modules/twilio/lib/jwt/AccessToken.js create mode 100644 node_modules/twilio/lib/jwt/ClientCapability.d.ts create mode 100644 node_modules/twilio/lib/jwt/ClientCapability.js create mode 100644 node_modules/twilio/lib/jwt/taskrouter/TaskRouterCapability.d.ts create mode 100644 node_modules/twilio/lib/jwt/taskrouter/TaskRouterCapability.js create mode 100644 node_modules/twilio/lib/jwt/taskrouter/util.d.ts create mode 100644 node_modules/twilio/lib/jwt/taskrouter/util.js create mode 100644 node_modules/twilio/lib/rest/Accounts.d.ts create mode 100644 node_modules/twilio/lib/rest/Accounts.js create mode 100644 node_modules/twilio/lib/rest/AccountsBase.d.ts create mode 100644 node_modules/twilio/lib/rest/AccountsBase.js create mode 100644 node_modules/twilio/lib/rest/Api.d.ts create mode 100644 node_modules/twilio/lib/rest/Api.js create mode 100644 node_modules/twilio/lib/rest/ApiBase.d.ts create mode 100644 node_modules/twilio/lib/rest/ApiBase.js create mode 100644 node_modules/twilio/lib/rest/Bulkexports.d.ts create mode 100644 node_modules/twilio/lib/rest/Bulkexports.js create mode 100644 node_modules/twilio/lib/rest/BulkexportsBase.d.ts create mode 100644 node_modules/twilio/lib/rest/BulkexportsBase.js create mode 100644 node_modules/twilio/lib/rest/Chat.d.ts create mode 100644 node_modules/twilio/lib/rest/Chat.js create mode 100644 node_modules/twilio/lib/rest/ChatBase.d.ts create mode 100644 node_modules/twilio/lib/rest/ChatBase.js create mode 100644 node_modules/twilio/lib/rest/Content.d.ts create mode 100644 node_modules/twilio/lib/rest/Content.js create mode 100644 node_modules/twilio/lib/rest/ContentBase.d.ts create mode 100644 node_modules/twilio/lib/rest/ContentBase.js create mode 100644 node_modules/twilio/lib/rest/Conversations.d.ts create mode 100644 node_modules/twilio/lib/rest/Conversations.js create mode 100644 node_modules/twilio/lib/rest/ConversationsBase.d.ts create mode 100644 node_modules/twilio/lib/rest/ConversationsBase.js create mode 100644 node_modules/twilio/lib/rest/Events.d.ts create mode 100644 node_modules/twilio/lib/rest/Events.js create mode 100644 node_modules/twilio/lib/rest/EventsBase.d.ts create mode 100644 node_modules/twilio/lib/rest/EventsBase.js create mode 100644 node_modules/twilio/lib/rest/FlexApi.d.ts create mode 100644 node_modules/twilio/lib/rest/FlexApi.js create mode 100644 node_modules/twilio/lib/rest/FlexApiBase.d.ts create mode 100644 node_modules/twilio/lib/rest/FlexApiBase.js create mode 100644 node_modules/twilio/lib/rest/FrontlineApi.d.ts create mode 100644 node_modules/twilio/lib/rest/FrontlineApi.js create mode 100644 node_modules/twilio/lib/rest/FrontlineApiBase.d.ts create mode 100644 node_modules/twilio/lib/rest/FrontlineApiBase.js create mode 100644 node_modules/twilio/lib/rest/Insights.d.ts create mode 100644 node_modules/twilio/lib/rest/Insights.js create mode 100644 node_modules/twilio/lib/rest/InsightsBase.d.ts create mode 100644 node_modules/twilio/lib/rest/InsightsBase.js create mode 100644 node_modules/twilio/lib/rest/Intelligence.d.ts create mode 100644 node_modules/twilio/lib/rest/Intelligence.js create mode 100644 node_modules/twilio/lib/rest/IntelligenceBase.d.ts create mode 100644 node_modules/twilio/lib/rest/IntelligenceBase.js create mode 100644 node_modules/twilio/lib/rest/IpMessaging.d.ts create mode 100644 node_modules/twilio/lib/rest/IpMessaging.js create mode 100644 node_modules/twilio/lib/rest/IpMessagingBase.d.ts create mode 100644 node_modules/twilio/lib/rest/IpMessagingBase.js create mode 100644 node_modules/twilio/lib/rest/Lookups.d.ts create mode 100644 node_modules/twilio/lib/rest/Lookups.js create mode 100644 node_modules/twilio/lib/rest/LookupsBase.d.ts create mode 100644 node_modules/twilio/lib/rest/LookupsBase.js create mode 100644 node_modules/twilio/lib/rest/Media.d.ts create mode 100644 node_modules/twilio/lib/rest/Media.js create mode 100644 node_modules/twilio/lib/rest/MediaBase.d.ts create mode 100644 node_modules/twilio/lib/rest/MediaBase.js create mode 100644 node_modules/twilio/lib/rest/Messaging.d.ts create mode 100644 node_modules/twilio/lib/rest/Messaging.js create mode 100644 node_modules/twilio/lib/rest/MessagingBase.d.ts create mode 100644 node_modules/twilio/lib/rest/MessagingBase.js create mode 100644 node_modules/twilio/lib/rest/Microvisor.d.ts create mode 100644 node_modules/twilio/lib/rest/Microvisor.js create mode 100644 node_modules/twilio/lib/rest/MicrovisorBase.d.ts create mode 100644 node_modules/twilio/lib/rest/MicrovisorBase.js create mode 100644 node_modules/twilio/lib/rest/Monitor.d.ts create mode 100644 node_modules/twilio/lib/rest/Monitor.js create mode 100644 node_modules/twilio/lib/rest/MonitorBase.d.ts create mode 100644 node_modules/twilio/lib/rest/MonitorBase.js create mode 100644 node_modules/twilio/lib/rest/Notify.d.ts create mode 100644 node_modules/twilio/lib/rest/Notify.js create mode 100644 node_modules/twilio/lib/rest/NotifyBase.d.ts create mode 100644 node_modules/twilio/lib/rest/NotifyBase.js create mode 100644 node_modules/twilio/lib/rest/Numbers.d.ts create mode 100644 node_modules/twilio/lib/rest/Numbers.js create mode 100644 node_modules/twilio/lib/rest/NumbersBase.d.ts create mode 100644 node_modules/twilio/lib/rest/NumbersBase.js create mode 100644 node_modules/twilio/lib/rest/Preview.d.ts create mode 100644 node_modules/twilio/lib/rest/Preview.js create mode 100644 node_modules/twilio/lib/rest/PreviewBase.d.ts create mode 100644 node_modules/twilio/lib/rest/PreviewBase.js create mode 100644 node_modules/twilio/lib/rest/Pricing.d.ts create mode 100644 node_modules/twilio/lib/rest/Pricing.js create mode 100644 node_modules/twilio/lib/rest/PricingBase.d.ts create mode 100644 node_modules/twilio/lib/rest/PricingBase.js create mode 100644 node_modules/twilio/lib/rest/Proxy.d.ts create mode 100644 node_modules/twilio/lib/rest/Proxy.js create mode 100644 node_modules/twilio/lib/rest/ProxyBase.d.ts create mode 100644 node_modules/twilio/lib/rest/ProxyBase.js create mode 100644 node_modules/twilio/lib/rest/Routes.d.ts create mode 100644 node_modules/twilio/lib/rest/Routes.js create mode 100644 node_modules/twilio/lib/rest/RoutesBase.d.ts create mode 100644 node_modules/twilio/lib/rest/RoutesBase.js create mode 100644 node_modules/twilio/lib/rest/Serverless.d.ts create mode 100644 node_modules/twilio/lib/rest/Serverless.js create mode 100644 node_modules/twilio/lib/rest/ServerlessBase.d.ts create mode 100644 node_modules/twilio/lib/rest/ServerlessBase.js create mode 100644 node_modules/twilio/lib/rest/Studio.d.ts create mode 100644 node_modules/twilio/lib/rest/Studio.js create mode 100644 node_modules/twilio/lib/rest/StudioBase.d.ts create mode 100644 node_modules/twilio/lib/rest/StudioBase.js create mode 100644 node_modules/twilio/lib/rest/Supersim.d.ts create mode 100644 node_modules/twilio/lib/rest/Supersim.js create mode 100644 node_modules/twilio/lib/rest/SupersimBase.d.ts create mode 100644 node_modules/twilio/lib/rest/SupersimBase.js create mode 100644 node_modules/twilio/lib/rest/Sync.d.ts create mode 100644 node_modules/twilio/lib/rest/Sync.js create mode 100644 node_modules/twilio/lib/rest/SyncBase.d.ts create mode 100644 node_modules/twilio/lib/rest/SyncBase.js create mode 100644 node_modules/twilio/lib/rest/Taskrouter.d.ts create mode 100644 node_modules/twilio/lib/rest/Taskrouter.js create mode 100644 node_modules/twilio/lib/rest/TaskrouterBase.d.ts create mode 100644 node_modules/twilio/lib/rest/TaskrouterBase.js create mode 100644 node_modules/twilio/lib/rest/Trunking.d.ts create mode 100644 node_modules/twilio/lib/rest/Trunking.js create mode 100644 node_modules/twilio/lib/rest/TrunkingBase.d.ts create mode 100644 node_modules/twilio/lib/rest/TrunkingBase.js create mode 100644 node_modules/twilio/lib/rest/Trusthub.d.ts create mode 100644 node_modules/twilio/lib/rest/Trusthub.js create mode 100644 node_modules/twilio/lib/rest/TrusthubBase.d.ts create mode 100644 node_modules/twilio/lib/rest/TrusthubBase.js create mode 100644 node_modules/twilio/lib/rest/Twilio.d.ts create mode 100644 node_modules/twilio/lib/rest/Twilio.js create mode 100644 node_modules/twilio/lib/rest/Verify.d.ts create mode 100644 node_modules/twilio/lib/rest/Verify.js create mode 100644 node_modules/twilio/lib/rest/VerifyBase.d.ts create mode 100644 node_modules/twilio/lib/rest/VerifyBase.js create mode 100644 node_modules/twilio/lib/rest/Video.d.ts create mode 100644 node_modules/twilio/lib/rest/Video.js create mode 100644 node_modules/twilio/lib/rest/VideoBase.d.ts create mode 100644 node_modules/twilio/lib/rest/VideoBase.js create mode 100644 node_modules/twilio/lib/rest/Voice.d.ts create mode 100644 node_modules/twilio/lib/rest/Voice.js create mode 100644 node_modules/twilio/lib/rest/VoiceBase.d.ts create mode 100644 node_modules/twilio/lib/rest/VoiceBase.js create mode 100644 node_modules/twilio/lib/rest/Wireless.d.ts create mode 100644 node_modules/twilio/lib/rest/Wireless.js create mode 100644 node_modules/twilio/lib/rest/WirelessBase.d.ts create mode 100644 node_modules/twilio/lib/rest/WirelessBase.js create mode 100644 node_modules/twilio/lib/rest/accounts/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/accounts/V1.js create mode 100644 node_modules/twilio/lib/rest/accounts/v1/authTokenPromotion.d.ts create mode 100644 node_modules/twilio/lib/rest/accounts/v1/authTokenPromotion.js create mode 100644 node_modules/twilio/lib/rest/accounts/v1/credential.d.ts create mode 100644 node_modules/twilio/lib/rest/accounts/v1/credential.js create mode 100644 node_modules/twilio/lib/rest/accounts/v1/credential/aws.d.ts create mode 100644 node_modules/twilio/lib/rest/accounts/v1/credential/aws.js create mode 100644 node_modules/twilio/lib/rest/accounts/v1/credential/publicKey.d.ts create mode 100644 node_modules/twilio/lib/rest/accounts/v1/credential/publicKey.js create mode 100644 node_modules/twilio/lib/rest/accounts/v1/safelist.d.ts create mode 100644 node_modules/twilio/lib/rest/accounts/v1/safelist.js create mode 100644 node_modules/twilio/lib/rest/accounts/v1/secondaryAuthToken.d.ts create mode 100644 node_modules/twilio/lib/rest/accounts/v1/secondaryAuthToken.js create mode 100644 node_modules/twilio/lib/rest/api/V2010.d.ts create mode 100644 node_modules/twilio/lib/rest/api/V2010.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/address.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/address.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/address/dependentPhoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/address/dependentPhoneNumber.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/application.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/application.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/authorizedConnectApp.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/authorizedConnectApp.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/balance.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/balance.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/event.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/event.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/feedback.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/feedback.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/feedbackSummary.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/feedbackSummary.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/notification.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/notification.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/payment.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/payment.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/recording.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/recording.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/siprec.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/siprec.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/stream.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/stream.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessage.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessage.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/conference.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/conference.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/conference/participant.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/conference/participant.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/conference/recording.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/conference/recording.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/connectApp.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/connectApp.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/local.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/key.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/key.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/message.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/message.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/message/feedback.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/message/feedback.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/message/media.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/message/media.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/newKey.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/newKey.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/newSigningKey.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/newSigningKey.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/notification.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/notification.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/outgoingCallerId.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/outgoingCallerId.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/queue.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/queue.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/queue/member.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/queue/member.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/recording.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/recording.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult/payload.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult/payload.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/recording/transcription.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/recording/transcription.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/shortCode.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/shortCode.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/signingKey.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/signingKey.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList/credential.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList/credential.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsCredentialListMapping.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsCredentialListMapping.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsIpAccessControlListMapping.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsIpAccessControlListMapping.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations/authRegistrationsCredentialListMapping.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations/authRegistrationsCredentialListMapping.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/credentialListMapping.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/token.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/token.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/transcription.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/transcription.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/allTime.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/allTime.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/daily.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/daily.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/lastMonth.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/monthly.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/monthly.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/thisMonth.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/today.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/today.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/yearly.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/yearly.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/yesterday.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/record/yesterday.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/trigger.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/usage/trigger.js create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/validationRequest.d.ts create mode 100644 node_modules/twilio/lib/rest/api/v2010/account/validationRequest.js create mode 100644 node_modules/twilio/lib/rest/bulkexports/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/bulkexports/V1.js create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/export.d.ts create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/export.js create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/export/day.d.ts create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/export/day.js create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/export/exportCustomJob.d.ts create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/export/exportCustomJob.js create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/export/job.d.ts create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/export/job.js create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/exportConfiguration.d.ts create mode 100644 node_modules/twilio/lib/rest/bulkexports/v1/exportConfiguration.js create mode 100644 node_modules/twilio/lib/rest/chat/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/V1.js create mode 100644 node_modules/twilio/lib/rest/chat/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/V2.js create mode 100644 node_modules/twilio/lib/rest/chat/V3.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/V3.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/credential.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/credential.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/service.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/service.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/channel.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/channel.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/channel/invite.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/channel/invite.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/channel/member.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/channel/member.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/channel/message.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/channel/message.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/role.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/role.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/user.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/user.js create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/user/userChannel.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v1/service/user/userChannel.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/credential.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/credential.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/binding.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/binding.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel/invite.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel/invite.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel/member.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel/member.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel/message.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel/message.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel/webhook.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/channel/webhook.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/role.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/role.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/user.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/user.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/user/userBinding.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/user/userBinding.js create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/user/userChannel.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v2/service/user/userChannel.js create mode 100644 node_modules/twilio/lib/rest/chat/v3/channel.d.ts create mode 100644 node_modules/twilio/lib/rest/chat/v3/channel.js create mode 100644 node_modules/twilio/lib/rest/content/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/content/V1.js create mode 100644 node_modules/twilio/lib/rest/content/v1/content.d.ts create mode 100644 node_modules/twilio/lib/rest/content/v1/content.js create mode 100644 node_modules/twilio/lib/rest/content/v1/content/approvalFetch.d.ts create mode 100644 node_modules/twilio/lib/rest/content/v1/content/approvalFetch.js create mode 100644 node_modules/twilio/lib/rest/content/v1/contentAndApprovals.d.ts create mode 100644 node_modules/twilio/lib/rest/content/v1/contentAndApprovals.js create mode 100644 node_modules/twilio/lib/rest/content/v1/legacyContent.d.ts create mode 100644 node_modules/twilio/lib/rest/content/v1/legacyContent.js create mode 100644 node_modules/twilio/lib/rest/conversations/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/V1.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/addressConfiguration.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/addressConfiguration.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/configuration.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/configuration.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/configuration/webhook.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/configuration/webhook.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation/message.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation/message.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation/message/deliveryReceipt.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation/message/deliveryReceipt.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation/participant.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation/participant.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation/webhook.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/conversation/webhook.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/credential.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/credential.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/participantConversation.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/participantConversation.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/role.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/role.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/binding.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/binding.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/configuration.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/configuration.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/configuration/notification.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/configuration/notification.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/configuration/webhook.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/configuration/webhook.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation/message.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation/message.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation/participant.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation/participant.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation/webhook.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/conversation/webhook.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/participantConversation.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/participantConversation.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/role.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/role.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/user.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/user.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/user/userConversation.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/service/user/userConversation.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/user.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/user.js create mode 100644 node_modules/twilio/lib/rest/conversations/v1/user/userConversation.d.ts create mode 100644 node_modules/twilio/lib/rest/conversations/v1/user/userConversation.js create mode 100644 node_modules/twilio/lib/rest/events/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/events/V1.js create mode 100644 node_modules/twilio/lib/rest/events/v1/eventType.d.ts create mode 100644 node_modules/twilio/lib/rest/events/v1/eventType.js create mode 100644 node_modules/twilio/lib/rest/events/v1/schema.d.ts create mode 100644 node_modules/twilio/lib/rest/events/v1/schema.js create mode 100644 node_modules/twilio/lib/rest/events/v1/schema/schemaVersion.d.ts create mode 100644 node_modules/twilio/lib/rest/events/v1/schema/schemaVersion.js create mode 100644 node_modules/twilio/lib/rest/events/v1/sink.d.ts create mode 100644 node_modules/twilio/lib/rest/events/v1/sink.js create mode 100644 node_modules/twilio/lib/rest/events/v1/sink/sinkTest.d.ts create mode 100644 node_modules/twilio/lib/rest/events/v1/sink/sinkTest.js create mode 100644 node_modules/twilio/lib/rest/events/v1/sink/sinkValidate.d.ts create mode 100644 node_modules/twilio/lib/rest/events/v1/sink/sinkValidate.js create mode 100644 node_modules/twilio/lib/rest/events/v1/subscription.d.ts create mode 100644 node_modules/twilio/lib/rest/events/v1/subscription.js create mode 100644 node_modules/twilio/lib/rest/events/v1/subscription/subscribedEvent.d.ts create mode 100644 node_modules/twilio/lib/rest/events/v1/subscription/subscribedEvent.js create mode 100644 node_modules/twilio/lib/rest/flexApi/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/V1.js create mode 100644 node_modules/twilio/lib/rest/flexApi/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/V2.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/assessments.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/assessments.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/channel.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/channel.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/configuration.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/configuration.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/flexFlow.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/flexFlow.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsAssessmentsComment.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAi.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAi.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAiReportInsights.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAiReportInsights.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsConversations.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsConversations.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnaires.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsSegments.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsSegments.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsSession.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsSession.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsAnswerSets.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsAnswerSets.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsComment.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsComment.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsUserRoles.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/insightsUserRoles.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/interaction.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/interaction.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/provisioningStatus.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/provisioningStatus.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/webChannel.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v1/webChannel.js create mode 100644 node_modules/twilio/lib/rest/flexApi/v2/webChannels.d.ts create mode 100644 node_modules/twilio/lib/rest/flexApi/v2/webChannels.js create mode 100644 node_modules/twilio/lib/rest/frontlineApi/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/frontlineApi/V1.js create mode 100644 node_modules/twilio/lib/rest/frontlineApi/v1/user.d.ts create mode 100644 node_modules/twilio/lib/rest/frontlineApi/v1/user.js create mode 100644 node_modules/twilio/lib/rest/insights/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/V1.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/call.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/call.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/call/annotation.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/call/annotation.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/call/callSummary.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/call/callSummary.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/call/event.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/call/event.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/call/metric.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/call/metric.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/callSummaries.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/callSummaries.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/conference.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/conference.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/conference/conferenceParticipant.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/conference/conferenceParticipant.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/room.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/room.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/room/participant.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/room/participant.js create mode 100644 node_modules/twilio/lib/rest/insights/v1/setting.d.ts create mode 100644 node_modules/twilio/lib/rest/insights/v1/setting.js create mode 100644 node_modules/twilio/lib/rest/intelligence/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/intelligence/V2.js create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/service.d.ts create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/service.js create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/transcript.d.ts create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/transcript.js create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/transcript/media.d.ts create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/transcript/media.js create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/transcript/operatorResult.d.ts create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/transcript/operatorResult.js create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/transcript/sentence.d.ts create mode 100644 node_modules/twilio/lib/rest/intelligence/v2/transcript/sentence.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/V1.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/V2.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/credential.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/credential.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/channel.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/channel.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/invite.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/invite.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/member.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/member.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/message.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/message.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/role.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/role.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/user.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/user.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/user/userChannel.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v1/service/user/userChannel.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/credential.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/credential.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/binding.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/binding.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/invite.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/invite.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/member.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/member.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/message.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/message.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/webhook.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/webhook.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/role.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/role.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/user.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/user.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userBinding.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userBinding.js create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts create mode 100644 node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userChannel.js create mode 100644 node_modules/twilio/lib/rest/lookups/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/lookups/V1.js create mode 100644 node_modules/twilio/lib/rest/lookups/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/lookups/V2.js create mode 100644 node_modules/twilio/lib/rest/lookups/v1/phoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/lookups/v1/phoneNumber.js create mode 100644 node_modules/twilio/lib/rest/lookups/v2/phoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/lookups/v2/phoneNumber.js create mode 100644 node_modules/twilio/lib/rest/media/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/media/V1.js create mode 100644 node_modules/twilio/lib/rest/media/v1/mediaProcessor.d.ts create mode 100644 node_modules/twilio/lib/rest/media/v1/mediaProcessor.js create mode 100644 node_modules/twilio/lib/rest/media/v1/mediaRecording.d.ts create mode 100644 node_modules/twilio/lib/rest/media/v1/mediaRecording.js create mode 100644 node_modules/twilio/lib/rest/media/v1/playerStreamer.d.ts create mode 100644 node_modules/twilio/lib/rest/media/v1/playerStreamer.js create mode 100644 node_modules/twilio/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts create mode 100644 node_modules/twilio/lib/rest/media/v1/playerStreamer/playbackGrant.js create mode 100644 node_modules/twilio/lib/rest/messaging/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/V1.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/brandRegistration.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/brandRegistration.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandRegistrationOtp.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandRegistrationOtp.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandVetting.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/deactivations.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/deactivations.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/domainCerts.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/domainCerts.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/domainConfig.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/domainConfig.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/domainConfigMessagingService.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/domainConfigMessagingService.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/externalCampaign.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/externalCampaign.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingService.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingService.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/alphaSender.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/alphaSender.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/channelSender.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/channelSender.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/phoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/phoneNumber.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/shortCode.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/shortCode.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/usAppToPerson.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/usAppToPerson.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/usAppToPersonUsecase.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/service/usAppToPersonUsecase.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/tollfreeVerification.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/tollfreeVerification.js create mode 100644 node_modules/twilio/lib/rest/messaging/v1/usecase.d.ts create mode 100644 node_modules/twilio/lib/rest/messaging/v1/usecase.js create mode 100644 node_modules/twilio/lib/rest/microvisor/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/microvisor/V1.js create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/accountConfig.d.ts create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/accountConfig.js create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/accountSecret.d.ts create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/accountSecret.js create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/app.d.ts create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/app.js create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/app/appManifest.d.ts create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/app/appManifest.js create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/device.d.ts create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/device.js create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/device/deviceConfig.d.ts create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/device/deviceConfig.js create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/device/deviceSecret.d.ts create mode 100644 node_modules/twilio/lib/rest/microvisor/v1/device/deviceSecret.js create mode 100644 node_modules/twilio/lib/rest/monitor/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/monitor/V1.js create mode 100644 node_modules/twilio/lib/rest/monitor/v1/alert.d.ts create mode 100644 node_modules/twilio/lib/rest/monitor/v1/alert.js create mode 100644 node_modules/twilio/lib/rest/monitor/v1/event.d.ts create mode 100644 node_modules/twilio/lib/rest/monitor/v1/event.js create mode 100644 node_modules/twilio/lib/rest/notify/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/notify/V1.js create mode 100644 node_modules/twilio/lib/rest/notify/v1/credential.d.ts create mode 100644 node_modules/twilio/lib/rest/notify/v1/credential.js create mode 100644 node_modules/twilio/lib/rest/notify/v1/service.d.ts create mode 100644 node_modules/twilio/lib/rest/notify/v1/service.js create mode 100644 node_modules/twilio/lib/rest/notify/v1/service/binding.d.ts create mode 100644 node_modules/twilio/lib/rest/notify/v1/service/binding.js create mode 100644 node_modules/twilio/lib/rest/notify/v1/service/notification.d.ts create mode 100644 node_modules/twilio/lib/rest/notify/v1/service/notification.js create mode 100644 node_modules/twilio/lib/rest/numbers/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/V1.js create mode 100644 node_modules/twilio/lib/rest/numbers/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/V2.js create mode 100644 node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.js create mode 100644 node_modules/twilio/lib/rest/numbers/v1/portingBulkPortability.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v1/portingBulkPortability.js create mode 100644 node_modules/twilio/lib/rest/numbers/v1/portingPortInFetch.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v1/portingPortInFetch.js create mode 100644 node_modules/twilio/lib/rest/numbers/v1/portingPortability.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v1/portingPortability.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.d.ts create mode 100644 node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.js create mode 100644 node_modules/twilio/lib/rest/preview/DeployedDevices.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/DeployedDevices.js create mode 100644 node_modules/twilio/lib/rest/preview/HostedNumbers.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/HostedNumbers.js create mode 100644 node_modules/twilio/lib/rest/preview/Marketplace.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/Marketplace.js create mode 100644 node_modules/twilio/lib/rest/preview/Sync.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/Sync.js create mode 100644 node_modules/twilio/lib/rest/preview/Wireless.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/Wireless.js create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet.js create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet/certificate.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet/certificate.js create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet/deployment.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet/deployment.js create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet/device.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet/device.js create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet/key.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/deployed_devices/fleet/key.js create mode 100644 node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument.js create mode 100644 node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.js create mode 100644 node_modules/twilio/lib/rest/preview/hosted_numbers/hostedNumberOrder.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/hosted_numbers/hostedNumberOrder.js create mode 100644 node_modules/twilio/lib/rest/preview/marketplace/availableAddOn.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/marketplace/availableAddOn.js create mode 100644 node_modules/twilio/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js create mode 100644 node_modules/twilio/lib/rest/preview/marketplace/installedAddOn.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/marketplace/installedAddOn.js create mode 100644 node_modules/twilio/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/document.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/document.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/document/documentPermission.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/document/documentPermission.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncList.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncList.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListItem.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListItem.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListPermission.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListPermission.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncMap.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncMap.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapItem.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapItem.js create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapPermission.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapPermission.js create mode 100644 node_modules/twilio/lib/rest/preview/wireless/command.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/wireless/command.js create mode 100644 node_modules/twilio/lib/rest/preview/wireless/ratePlan.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/wireless/ratePlan.js create mode 100644 node_modules/twilio/lib/rest/preview/wireless/sim.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/wireless/sim.js create mode 100644 node_modules/twilio/lib/rest/preview/wireless/sim/usage.d.ts create mode 100644 node_modules/twilio/lib/rest/preview/wireless/sim/usage.js create mode 100644 node_modules/twilio/lib/rest/pricing/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/V1.js create mode 100644 node_modules/twilio/lib/rest/pricing/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/V2.js create mode 100644 node_modules/twilio/lib/rest/pricing/v1/messaging.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v1/messaging.js create mode 100644 node_modules/twilio/lib/rest/pricing/v1/messaging/country.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v1/messaging/country.js create mode 100644 node_modules/twilio/lib/rest/pricing/v1/phoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v1/phoneNumber.js create mode 100644 node_modules/twilio/lib/rest/pricing/v1/phoneNumber/country.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v1/phoneNumber/country.js create mode 100644 node_modules/twilio/lib/rest/pricing/v1/voice.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v1/voice.js create mode 100644 node_modules/twilio/lib/rest/pricing/v1/voice/country.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v1/voice/country.js create mode 100644 node_modules/twilio/lib/rest/pricing/v1/voice/number.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v1/voice/number.js create mode 100644 node_modules/twilio/lib/rest/pricing/v2/country.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v2/country.js create mode 100644 node_modules/twilio/lib/rest/pricing/v2/number.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v2/number.js create mode 100644 node_modules/twilio/lib/rest/pricing/v2/voice.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v2/voice.js create mode 100644 node_modules/twilio/lib/rest/pricing/v2/voice/country.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v2/voice/country.js create mode 100644 node_modules/twilio/lib/rest/pricing/v2/voice/number.d.ts create mode 100644 node_modules/twilio/lib/rest/pricing/v2/voice/number.js create mode 100644 node_modules/twilio/lib/rest/proxy/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/proxy/V1.js create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service.d.ts create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service.js create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/phoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/phoneNumber.js create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/session.d.ts create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/session.js create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/session/interaction.d.ts create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/session/interaction.js create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/session/participant.d.ts create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/session/participant.js create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/session/participant/messageInteraction.d.ts create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/session/participant/messageInteraction.js create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/shortCode.d.ts create mode 100644 node_modules/twilio/lib/rest/proxy/v1/service/shortCode.js create mode 100644 node_modules/twilio/lib/rest/routes/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/routes/V2.js create mode 100644 node_modules/twilio/lib/rest/routes/v2/phoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/routes/v2/phoneNumber.js create mode 100644 node_modules/twilio/lib/rest/routes/v2/sipDomain.d.ts create mode 100644 node_modules/twilio/lib/rest/routes/v2/sipDomain.js create mode 100644 node_modules/twilio/lib/rest/routes/v2/trunk.d.ts create mode 100644 node_modules/twilio/lib/rest/routes/v2/trunk.js create mode 100644 node_modules/twilio/lib/rest/serverless/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/V1.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/asset.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/asset.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/asset/assetVersion.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/asset/assetVersion.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/build.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/build.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/build/buildStatus.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/build/buildStatus.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/environment.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/environment.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/environment/deployment.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/environment/deployment.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/environment/log.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/environment/log.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/environment/variable.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/environment/variable.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/function.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/function.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion.js create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion/functionVersionContent.d.ts create mode 100644 node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion/functionVersionContent.js create mode 100644 node_modules/twilio/lib/rest/studio/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/V1.js create mode 100644 node_modules/twilio/lib/rest/studio/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/V2.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/engagement.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/engagement.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/engagement/engagementContext.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/engagement/engagementContext.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/engagement/step.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/engagement/step.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/engagement/step/stepContext.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/engagement/step/stepContext.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/execution.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/execution.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/execution/executionContext.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/execution/executionContext.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep.js create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.js create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow.js create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/execution.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/execution.js create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/execution/executionContext.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/execution/executionContext.js create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep.js create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep/executionStepContext.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep/executionStepContext.js create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/flowRevision.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/flowRevision.js create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/flowTestUser.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v2/flow/flowTestUser.js create mode 100644 node_modules/twilio/lib/rest/studio/v2/flowValidate.d.ts create mode 100644 node_modules/twilio/lib/rest/studio/v2/flowValidate.js create mode 100644 node_modules/twilio/lib/rest/supersim/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/V1.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/esimProfile.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/esimProfile.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/fleet.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/fleet.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/ipCommand.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/ipCommand.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/network.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/network.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/settingsUpdate.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/settingsUpdate.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/sim.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/sim.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/sim/billingPeriod.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/sim/billingPeriod.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/sim/simIpAddress.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/sim/simIpAddress.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/smsCommand.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/smsCommand.js create mode 100644 node_modules/twilio/lib/rest/supersim/v1/usageRecord.d.ts create mode 100644 node_modules/twilio/lib/rest/supersim/v1/usageRecord.js create mode 100644 node_modules/twilio/lib/rest/sync/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/V1.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/document.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/document.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/document/documentPermission.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/document/documentPermission.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncList.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncList.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListItem.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListItem.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListPermission.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListPermission.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncMap.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncMap.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapPermission.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapPermission.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncStream.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncStream.js create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncStream/streamMessage.d.ts create mode 100644 node_modules/twilio/lib/rest/sync/v1/service/syncStream/streamMessage.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/V1.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/activity.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/activity.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/event.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/event.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/task.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/task.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/task/reservation.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskChannel.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskChannel.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/reservation.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerChannel.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.js create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceStatistics.d.ts create mode 100644 node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceStatistics.js create mode 100644 node_modules/twilio/lib/rest/trunking/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/trunking/V1.js create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk.d.ts create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk.js create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/credentialList.d.ts create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/credentialList.js create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/ipAccessControlList.d.ts create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/ipAccessControlList.js create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/originationUrl.d.ts create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/originationUrl.js create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/phoneNumber.d.ts create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/phoneNumber.js create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/recording.d.ts create mode 100644 node_modules/twilio/lib/rest/trunking/v1/trunk/recording.js create mode 100644 node_modules/twilio/lib/rest/trusthub/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/V1.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/complianceInquiries.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/complianceInquiries.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/complianceRegistrationInquiries.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/complianceRegistrationInquiries.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/complianceTollfreeInquiries.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/customerProfiles.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/customerProfiles.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/endUser.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/endUser.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/endUserType.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/endUserType.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/policies.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/policies.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/supportingDocument.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/supportingDocument.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/supportingDocumentType.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/supportingDocumentType.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/trustProducts.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/trustProducts.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.js create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.d.ts create mode 100644 node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.js create mode 100644 node_modules/twilio/lib/rest/verify/V2.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/V2.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/form.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/form.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/safelist.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/safelist.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/accessToken.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/accessToken.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity/challenge.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity/challenge.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity/challenge/notification.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity/challenge/notification.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity/factor.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity/factor.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity/newFactor.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/entity/newFactor.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/messagingConfiguration.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/messagingConfiguration.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/rateLimit.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/rateLimit.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/rateLimit/bucket.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/rateLimit/bucket.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/verification.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/verification.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/verificationCheck.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/verificationCheck.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/webhook.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/service/webhook.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/template.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/template.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/verificationAttempt.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/verificationAttempt.js create mode 100644 node_modules/twilio/lib/rest/verify/v2/verificationAttemptsSummary.d.ts create mode 100644 node_modules/twilio/lib/rest/verify/v2/verificationAttemptsSummary.js create mode 100644 node_modules/twilio/lib/rest/video/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/video/V1.js create mode 100644 node_modules/twilio/lib/rest/video/v1/composition.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/composition.js create mode 100644 node_modules/twilio/lib/rest/video/v1/compositionHook.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/compositionHook.js create mode 100644 node_modules/twilio/lib/rest/video/v1/compositionSettings.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/compositionSettings.js create mode 100644 node_modules/twilio/lib/rest/video/v1/recording.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/recording.js create mode 100644 node_modules/twilio/lib/rest/video/v1/recordingSettings.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/recordingSettings.js create mode 100644 node_modules/twilio/lib/rest/video/v1/room.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/room.js create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant.js create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.js create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.js create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.js create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.js create mode 100644 node_modules/twilio/lib/rest/video/v1/room/recordingRules.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/room/recordingRules.js create mode 100644 node_modules/twilio/lib/rest/video/v1/room/roomRecording.d.ts create mode 100644 node_modules/twilio/lib/rest/video/v1/room/roomRecording.js create mode 100644 node_modules/twilio/lib/rest/voice/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/V1.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/archivedCall.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/archivedCall.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/byocTrunk.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/byocTrunk.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/connectionPolicy.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/connectionPolicy.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/ipRecord.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/ipRecord.js create mode 100644 node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.d.ts create mode 100644 node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.js create mode 100644 node_modules/twilio/lib/rest/wireless/V1.d.ts create mode 100644 node_modules/twilio/lib/rest/wireless/V1.js create mode 100644 node_modules/twilio/lib/rest/wireless/v1/command.d.ts create mode 100644 node_modules/twilio/lib/rest/wireless/v1/command.js create mode 100644 node_modules/twilio/lib/rest/wireless/v1/ratePlan.d.ts create mode 100644 node_modules/twilio/lib/rest/wireless/v1/ratePlan.js create mode 100644 node_modules/twilio/lib/rest/wireless/v1/sim.d.ts create mode 100644 node_modules/twilio/lib/rest/wireless/v1/sim.js create mode 100644 node_modules/twilio/lib/rest/wireless/v1/sim/dataSession.d.ts create mode 100644 node_modules/twilio/lib/rest/wireless/v1/sim/dataSession.js create mode 100644 node_modules/twilio/lib/rest/wireless/v1/sim/usageRecord.d.ts create mode 100644 node_modules/twilio/lib/rest/wireless/v1/sim/usageRecord.js create mode 100644 node_modules/twilio/lib/rest/wireless/v1/usageRecord.d.ts create mode 100644 node_modules/twilio/lib/rest/wireless/v1/usageRecord.js create mode 100644 node_modules/twilio/lib/twiml/FaxResponse.d.ts create mode 100644 node_modules/twilio/lib/twiml/FaxResponse.js create mode 100644 node_modules/twilio/lib/twiml/MessagingResponse.d.ts create mode 100644 node_modules/twilio/lib/twiml/MessagingResponse.js create mode 100644 node_modules/twilio/lib/twiml/TwiML.d.ts create mode 100644 node_modules/twilio/lib/twiml/TwiML.js create mode 100644 node_modules/twilio/lib/twiml/VoiceResponse.d.ts create mode 100644 node_modules/twilio/lib/twiml/VoiceResponse.js create mode 100644 node_modules/twilio/lib/webhooks/webhooks.d.ts create mode 100644 node_modules/twilio/lib/webhooks/webhooks.js create mode 100644 node_modules/twilio/package.json create mode 100644 node_modules/url-parse/LICENSE create mode 100644 node_modules/url-parse/README.md create mode 100644 node_modules/url-parse/dist/url-parse.js create mode 100644 node_modules/url-parse/dist/url-parse.min.js create mode 100644 node_modules/url-parse/dist/url-parse.min.js.map create mode 100644 node_modules/url-parse/index.js create mode 100644 node_modules/url-parse/package.json create mode 100644 node_modules/util-deprecate/History.md create mode 100644 node_modules/util-deprecate/LICENSE create mode 100644 node_modules/util-deprecate/README.md create mode 100644 node_modules/util-deprecate/browser.js create mode 100644 node_modules/util-deprecate/node.js create mode 100644 node_modules/util-deprecate/package.json create mode 100644 node_modules/wide-align/LICENSE create mode 100644 node_modules/wide-align/README.md create mode 100644 node_modules/wide-align/align.js create mode 100644 node_modules/wide-align/package.json create mode 100644 node_modules/wrappy/LICENSE create mode 100644 node_modules/wrappy/README.md create mode 100644 node_modules/wrappy/package.json create mode 100644 node_modules/wrappy/wrappy.js create mode 100644 node_modules/xmlbuilder/.nycrc create mode 100644 node_modules/xmlbuilder/CHANGELOG.md create mode 100644 node_modules/xmlbuilder/LICENSE create mode 100644 node_modules/xmlbuilder/README.md create mode 100644 node_modules/xmlbuilder/lib/Derivation.js create mode 100644 node_modules/xmlbuilder/lib/DocumentPosition.js create mode 100644 node_modules/xmlbuilder/lib/NodeType.js create mode 100644 node_modules/xmlbuilder/lib/OperationType.js create mode 100644 node_modules/xmlbuilder/lib/Utility.js create mode 100644 node_modules/xmlbuilder/lib/WriterState.js create mode 100644 node_modules/xmlbuilder/lib/XMLAttribute.js create mode 100644 node_modules/xmlbuilder/lib/XMLCData.js create mode 100644 node_modules/xmlbuilder/lib/XMLCharacterData.js create mode 100644 node_modules/xmlbuilder/lib/XMLComment.js create mode 100644 node_modules/xmlbuilder/lib/XMLDOMConfiguration.js create mode 100644 node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js create mode 100644 node_modules/xmlbuilder/lib/XMLDOMImplementation.js create mode 100644 node_modules/xmlbuilder/lib/XMLDOMStringList.js create mode 100644 node_modules/xmlbuilder/lib/XMLDTDAttList.js create mode 100644 node_modules/xmlbuilder/lib/XMLDTDElement.js create mode 100644 node_modules/xmlbuilder/lib/XMLDTDEntity.js create mode 100644 node_modules/xmlbuilder/lib/XMLDTDNotation.js create mode 100644 node_modules/xmlbuilder/lib/XMLDeclaration.js create mode 100644 node_modules/xmlbuilder/lib/XMLDocType.js create mode 100644 node_modules/xmlbuilder/lib/XMLDocument.js create mode 100644 node_modules/xmlbuilder/lib/XMLDocumentCB.js create mode 100644 node_modules/xmlbuilder/lib/XMLDocumentFragment.js create mode 100644 node_modules/xmlbuilder/lib/XMLDummy.js create mode 100644 node_modules/xmlbuilder/lib/XMLElement.js create mode 100644 node_modules/xmlbuilder/lib/XMLNamedNodeMap.js create mode 100644 node_modules/xmlbuilder/lib/XMLNode.js create mode 100644 node_modules/xmlbuilder/lib/XMLNodeFilter.js create mode 100644 node_modules/xmlbuilder/lib/XMLNodeList.js create mode 100644 node_modules/xmlbuilder/lib/XMLProcessingInstruction.js create mode 100644 node_modules/xmlbuilder/lib/XMLRaw.js create mode 100644 node_modules/xmlbuilder/lib/XMLStreamWriter.js create mode 100644 node_modules/xmlbuilder/lib/XMLStringWriter.js create mode 100644 node_modules/xmlbuilder/lib/XMLStringifier.js create mode 100644 node_modules/xmlbuilder/lib/XMLText.js create mode 100644 node_modules/xmlbuilder/lib/XMLTypeInfo.js create mode 100644 node_modules/xmlbuilder/lib/XMLUserDataHandler.js create mode 100644 node_modules/xmlbuilder/lib/XMLWriterBase.js create mode 100644 node_modules/xmlbuilder/lib/index.js create mode 100644 node_modules/xmlbuilder/package.json create mode 100644 node_modules/xmlbuilder/typings/index.d.ts diff --git a/node_modules/.bin/color-support b/node_modules/.bin/color-support new file mode 100644 index 00000000..f77f9d5b --- /dev/null +++ b/node_modules/.bin/color-support @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../color-support/bin.js" "$@" +else + exec node "$basedir/../color-support/bin.js" "$@" +fi diff --git a/node_modules/.bin/color-support.cmd b/node_modules/.bin/color-support.cmd new file mode 100644 index 00000000..005f9a56 --- /dev/null +++ b/node_modules/.bin/color-support.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\color-support\bin.js" %* diff --git a/node_modules/.bin/color-support.ps1 b/node_modules/.bin/color-support.ps1 new file mode 100644 index 00000000..f5c9fe49 --- /dev/null +++ b/node_modules/.bin/color-support.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../color-support/bin.js" $args + } else { + & "$basedir/node$exe" "$basedir/../color-support/bin.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../color-support/bin.js" $args + } else { + & "node$exe" "$basedir/../color-support/bin.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 100644 index 00000000..1ab9c81a --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" +else + exec node "$basedir/../mkdirp/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/mkdirp.cmd b/node_modules/.bin/mkdirp.cmd new file mode 100644 index 00000000..a865dd9f --- /dev/null +++ b/node_modules/.bin/mkdirp.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %* diff --git a/node_modules/.bin/mkdirp.ps1 b/node_modules/.bin/mkdirp.ps1 new file mode 100644 index 00000000..911e8546 --- /dev/null +++ b/node_modules/.bin/mkdirp.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } else { + & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/node-pre-gyp b/node_modules/.bin/node-pre-gyp new file mode 100644 index 00000000..d1619e49 --- /dev/null +++ b/node_modules/.bin/node-pre-gyp @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" "$@" +else + exec node "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" "$@" +fi diff --git a/node_modules/.bin/node-pre-gyp.cmd b/node_modules/.bin/node-pre-gyp.cmd new file mode 100644 index 00000000..a2fc5085 --- /dev/null +++ b/node_modules/.bin/node-pre-gyp.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@mapbox\node-pre-gyp\bin\node-pre-gyp" %* diff --git a/node_modules/.bin/node-pre-gyp.ps1 b/node_modules/.bin/node-pre-gyp.ps1 new file mode 100644 index 00000000..ed297ff9 --- /dev/null +++ b/node_modules/.bin/node-pre-gyp.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" $args + } else { + & "$basedir/node$exe" "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" $args + } else { + & "node$exe" "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 100644 index 00000000..6d6240a8 --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../rimraf/bin.js" "$@" +else + exec node "$basedir/../rimraf/bin.js" "$@" +fi diff --git a/node_modules/.bin/rimraf.cmd b/node_modules/.bin/rimraf.cmd new file mode 100644 index 00000000..13f45eca --- /dev/null +++ b/node_modules/.bin/rimraf.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rimraf\bin.js" %* diff --git a/node_modules/.bin/rimraf.ps1 b/node_modules/.bin/rimraf.ps1 new file mode 100644 index 00000000..17167914 --- /dev/null +++ b/node_modules/.bin/rimraf.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args + } else { + & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../rimraf/bin.js" $args + } else { + & "node$exe" "$basedir/../rimraf/bin.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 0477f098..a24b3d07 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -150,6 +150,21 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "dependencies": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -168,11 +183,6 @@ "node": ">= 10.0.0" } }, - "node_modules/bcryptjs": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", - "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -234,6 +244,11 @@ "node": ">=16.20.1" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -298,6 +313,17 @@ "color-support": "bin.js" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -349,6 +375,11 @@ "url": "https://github.com/sponsors/kossnocorp" } }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -370,6 +401,14 @@ "node": ">= 0.4" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -411,6 +450,14 @@ "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -512,6 +559,38 @@ "node": ">= 0.8" } }, + "node_modules/follow-redirects": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -555,20 +634,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -852,6 +917,51 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/kareem": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", @@ -860,6 +970,41 @@ "node": ">=12.0.0" } }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -1355,6 +1500,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -1383,6 +1533,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -1453,6 +1608,11 @@ "node": ">=8.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -1499,6 +1659,11 @@ "loose-envify": "^1.1.0" } }, + "node_modules/scmp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scmp/-/scmp-2.1.0.tgz", + "integrity": "sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==" + }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", @@ -1734,6 +1899,24 @@ "node": ">=14" } }, + "node_modules/twilio": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/twilio/-/twilio-4.22.0.tgz", + "integrity": "sha512-Dn4x9FxhuCorz2ddJ8/Z8o3G0rLmrQo0frF1MMwWqtLrOwQzhL7Ca/Fup8jqbfjD+JSG1L8DE9a3MGBDETDrNg==", + "dependencies": { + "axios": "^1.6.0", + "dayjs": "^1.11.9", + "https-proxy-agent": "^5.0.0", + "jsonwebtoken": "^9.0.0", + "qs": "^6.9.4", + "scmp": "^2.1.0", + "url-parse": "^1.5.9", + "xmlbuilder": "^13.0.2" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1760,6 +1943,15 @@ "node": ">= 0.8" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1826,6 +2018,14 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, + "node_modules/xmlbuilder": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz", + "integrity": "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ==", + "engines": { + "node": ">=6.0" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/node_modules/@mapbox/node-pre-gyp/.github/workflows/codeql.yml b/node_modules/@mapbox/node-pre-gyp/.github/workflows/codeql.yml new file mode 100644 index 00000000..70eaa56f --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/.github/workflows/codeql.yml @@ -0,0 +1,74 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '24 5 * * 4' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md b/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md new file mode 100644 index 00000000..990e9297 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md @@ -0,0 +1,510 @@ +# node-pre-gyp changelog + +## 1.0.11 +- Fixes dependabot alert [CVE-2021-44906](https://nvd.nist.gov/vuln/detail/CVE-2021-44906) + +## 1.0.10 +- Upgraded minimist to 1.2.6 to address dependabot alert [CVE-2021-44906](https://nvd.nist.gov/vuln/detail/CVE-2021-44906) + +## 1.0.9 +- Upgraded node-fetch to 2.6.7 to address [CVE-2022-0235](https://www.cve.org/CVERecord?id=CVE-2022-0235) +- Upgraded detect-libc to 2.0.0 to use non-blocking NodeJS(>=12) Report API + +## 1.0.8 +- Downgraded npmlog to maintain node v10 and v8 support (https://github.com/mapbox/node-pre-gyp/pull/624) + +## 1.0.7 +- Upgraded nyc and npmlog to address https://github.com/advisories/GHSA-93q8-gq69-wqmw + +## 1.0.6 +- Added node v17 to the internal node releases listing +- Upgraded various dependencies declared in package.json to latest major versions (node-fetch from 2.6.1 to 2.6.5, npmlog from 4.1.2 to 5.01, semver from 7.3.4 to 7.3.5, and tar from 6.1.0 to 6.1.11) +- Fixed bug in `staging_host` parameter (https://github.com/mapbox/node-pre-gyp/pull/590) + + +## 1.0.5 +- Fix circular reference warning with node >= v14 + +## 1.0.4 +- Added node v16 to the internal node releases listing + +## 1.0.3 +- Improved support configuring s3 uploads (solves https://github.com/mapbox/node-pre-gyp/issues/571) + - New options added in https://github.com/mapbox/node-pre-gyp/pull/576: 'bucket', 'region', and `s3ForcePathStyle` + +## 1.0.2 +- Fixed regression in proxy support (https://github.com/mapbox/node-pre-gyp/issues/572) + +## 1.0.1 +- Switched from mkdirp@1.0.4 to make-dir@3.1.0 to avoid this bug: https://github.com/isaacs/node-mkdirp/issues/31 + +## 1.0.0 +- Module is now name-spaced at `@mapbox/node-pre-gyp` and the original `node-pre-gyp` is deprecated. +- New: support for staging and production s3 targets (see README.md) +- BREAKING: no longer supporting `node_pre_gyp_accessKeyId` & `node_pre_gyp_secretAccessKey`, use `AWS_ACCESS_KEY_ID` & `AWS_SECRET_ACCESS_KEY` instead to authenticate against s3 for `info`, `publish`, and `unpublish` commands. +- Dropped node v6 support, added node v14 support +- Switched tests to use mapbox-owned bucket for testing +- Added coverage tracking and linting with eslint +- Added back support for symlinks inside the tarball +- Upgraded all test apps to N-API/node-addon-api +- New: support for staging and production s3 targets (see README.md) +- Added `node_pre_gyp_s3_host` env var which has priority over the `--s3_host` option or default. +- Replaced needle with node-fetch +- Added proxy support for node-fetch +- Upgraded to mkdirp@1.x + +## 0.17.0 +- Got travis + appveyor green again +- Added support for more node versions + +## 0.16.0 + +- Added Node 15 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/520) + +## 0.15.0 + +- Bump dependency on `mkdirp` from `^0.5.1` to `^0.5.3` (https://github.com/mapbox/node-pre-gyp/pull/492) +- Bump dependency on `needle` from `^2.2.1` to `^2.5.0` (https://github.com/mapbox/node-pre-gyp/pull/502) +- Added Node 14 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/501) + +## 0.14.0 + +- Defer modules requires in napi.js (https://github.com/mapbox/node-pre-gyp/pull/434) +- Bump dependency on `tar` from `^4` to `^4.4.2` (https://github.com/mapbox/node-pre-gyp/pull/454) +- Support extracting compiled binary from local offline mirror (https://github.com/mapbox/node-pre-gyp/pull/459) +- Added Node 13 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/483) + +## 0.13.0 + +- Added Node 12 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/449) + +## 0.12.0 + +- Fixed double-build problem with node v10 (https://github.com/mapbox/node-pre-gyp/pull/428) +- Added node 11 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/422) + +## 0.11.0 + +- Fixed double-install problem with node v10 +- Significant N-API improvements (https://github.com/mapbox/node-pre-gyp/pull/405) + +## 0.10.3 + +- Now will use `request` over `needle` if request is installed. By default `needle` is used for `https`. This should unbreak proxy support that regressed in v0.9.0 + +## 0.10.2 + +- Fixed rc/deep-extent security vulnerability +- Fixed broken reinstall script do to incorrectly named get_best_napi_version + +## 0.10.1 + +- Fix needle error event (@medns) + +## 0.10.0 + +- Allow for a single-level module path when packing @allenluce (https://github.com/mapbox/node-pre-gyp/pull/371) +- Log warnings instead of errors when falling back @xzyfer (https://github.com/mapbox/node-pre-gyp/pull/366) +- Add Node.js v10 support to tests (https://github.com/mapbox/node-pre-gyp/pull/372) +- Remove retire.js from CI (https://github.com/mapbox/node-pre-gyp/pull/372) +- Remove support for Node.js v4 due to [EOL on April 30th, 2018](https://github.com/nodejs/Release/blob/7dd52354049cae99eed0e9fe01345b0722a86fde/schedule.json#L14) +- Update appveyor tests to install default NPM version instead of NPM v2.x for all Windows builds (https://github.com/mapbox/node-pre-gyp/pull/375) + +## 0.9.1 + +- Fixed regression (in v0.9.0) with support for http redirects @allenluce (https://github.com/mapbox/node-pre-gyp/pull/361) + +## 0.9.0 + +- Switched from using `request` to `needle` to reduce size of module deps (https://github.com/mapbox/node-pre-gyp/pull/350) + +## 0.8.0 + +- N-API support (@inspiredware) + +## 0.7.1 + +- Upgraded to tar v4.x + +## 0.7.0 + + - Updated request and hawk (#347) + - Dropped node v0.10.x support + +## 0.6.40 + + - Improved error reporting if an install fails + +## 0.6.39 + + - Support for node v9 + - Support for versioning on `{libc}` to allow binaries to work on non-glic linux systems like alpine linux + + +## 0.6.38 + + - Maintaining compatibility (for v0.6.x series) with node v0.10.x + +## 0.6.37 + + - Solved one part of #276: now now deduce the node ABI from the major version for node >= 2 even when not stored in the abi_crosswalk.json + - Fixed docs to avoid mentioning the deprecated and dangerous `prepublish` in package.json (#291) + - Add new node versions to crosswalk + - Ported tests to use tape instead of mocha + - Got appveyor tests passing by downgrading npm and node-gyp + +## 0.6.36 + + - Removed the running of `testbinary` during install. Because this was regressed for so long, it is too dangerous to re-enable by default. Developers needing validation can call `node-pre-gyp testbinary` directory. + - Fixed regression in v0.6.35 for electron installs (now skipping binary validation which is not yet supported for electron) + +## 0.6.35 + + - No longer recommending `npm ls` in `prepublish` (#291) + - Fixed testbinary command (#283) @szdavid92 + +## 0.6.34 + + - Added new node versions to crosswalk, including v8 + - Upgraded deps to latest versions, started using `^` instead of `~` for all deps. + +## 0.6.33 + + - Improved support for yarn + +## 0.6.32 + + - Honor npm configuration for CA bundles (@heikkipora) + - Add node-pre-gyp and npm versions to user agent (@addaleax) + - Updated various deps + - Add known node version for v7.x + +## 0.6.31 + + - Updated various deps + +## 0.6.30 + + - Update to npmlog@4.x and semver@5.3.x + - Add known node version for v6.5.0 + +## 0.6.29 + + - Add known node versions for v0.10.45, v0.12.14, v4.4.4, v5.11.1, and v6.1.0 + +## 0.6.28 + + - Now more verbose when remote binaries are not available. This is needed since npm is increasingly more quiet by default + and users need to know why builds are falling back to source compiles that might then error out. + +## 0.6.27 + + - Add known node version for node v6 + - Stopped bundling dependencies + - Documented method for module authors to avoid bundling node-pre-gyp + - See https://github.com/mapbox/node-pre-gyp/tree/master#configuring for details + +## 0.6.26 + + - Skip validation for nw runtime (https://github.com/mapbox/node-pre-gyp/pull/181) via @fleg + +## 0.6.25 + + - Improved support for auto-detection of electron runtime in `node-pre-gyp.find()` + - Pull request from @enlight - https://github.com/mapbox/node-pre-gyp/pull/187 + - Add known node version for 4.4.1 and 5.9.1 + +## 0.6.24 + + - Add known node version for 5.8.0, 5.9.0, and 4.4.0. + +## 0.6.23 + + - Add known node version for 0.10.43, 0.12.11, 4.3.2, and 5.7.1. + +## 0.6.22 + + - Add known node version for 4.3.1, and 5.7.0. + +## 0.6.21 + + - Add known node version for 0.10.42, 0.12.10, 4.3.0, and 5.6.0. + +## 0.6.20 + + - Add known node version for 4.2.5, 4.2.6, 5.4.0, 5.4.1,and 5.5.0. + +## 0.6.19 + + - Add known node version for 4.2.4 + +## 0.6.18 + + - Add new known node versions for 0.10.x, 0.12.x, 4.x, and 5.x + +## 0.6.17 + + - Re-tagged to fix packaging problem of `Error: Cannot find module 'isarray'` + +## 0.6.16 + + - Added known version in crosswalk for 5.1.0. + +## 0.6.15 + + - Upgraded tar-pack (https://github.com/mapbox/node-pre-gyp/issues/182) + - Support custom binary hosting mirror (https://github.com/mapbox/node-pre-gyp/pull/170) + - Added known version in crosswalk for 4.2.2. + +## 0.6.14 + + - Added node 5.x version + +## 0.6.13 + + - Added more known node 4.x versions + +## 0.6.12 + + - Added support for [Electron](http://electron.atom.io/). Just pass the `--runtime=electron` flag when building/installing. Thanks @zcbenz + +## 0.6.11 + + - Added known node and io.js versions including more 3.x and 4.x versions + +## 0.6.10 + + - Added known node and io.js versions including 3.x and 4.x versions + - Upgraded `tar` dep + +## 0.6.9 + + - Upgraded `rc` dep + - Updated known io.js version: v2.4.0 + +## 0.6.8 + + - Upgraded `semver` and `rimraf` deps + - Updated known node and io.js versions + +## 0.6.7 + + - Fixed `node_abi` versions for io.js 1.1.x -> 1.8.x (should be 43, but was stored as 42) (refs https://github.com/iojs/build/issues/94) + +## 0.6.6 + + - Updated with known io.js 2.0.0 version + +## 0.6.5 + + - Now respecting `npm_config_node_gyp` (https://github.com/npm/npm/pull/4887) + - Updated to semver@4.3.2 + - Updated known node v0.12.x versions and io.js 1.x versions. + +## 0.6.4 + + - Improved support for `io.js` (@fengmk2) + - Test coverage improvements (@mikemorris) + - Fixed support for `--dist-url` that regressed in 0.6.3 + +## 0.6.3 + + - Added support for passing raw options to node-gyp using `--` separator. Flags passed after + the `--` to `node-pre-gyp configure` will be passed directly to gyp while flags passed + after the `--` will be passed directly to make/visual studio. + - Added `node-pre-gyp configure` command to be able to call `node-gyp configure` directly + - Fix issue with require validation not working on windows 7 (@edgarsilva) + +## 0.6.2 + + - Support for io.js >= v1.0.2 + - Deferred require of `request` and `tar` to help speed up command line usage of `node-pre-gyp`. + +## 0.6.1 + + - Fixed bundled `tar` version + +## 0.6.0 + + - BREAKING: node odd releases like v0.11.x now use `major.minor.patch` for `{node_abi}` instead of `NODE_MODULE_VERSION` (#124) + - Added support for `toolset` option in versioning. By default is an empty string but `--toolset` can be passed to publish or install to select alternative binaries that target a custom toolset like C++11. For example to target Visual Studio 2014 modules like node-sqlite3 use `--toolset=v140`. + - Added support for `--no-rollback` option to request that a failed binary test does not remove the binary module leaves it in place. + - Added support for `--update-binary` option to request an existing binary be re-installed and the check for a valid local module be skipped. + - Added support for passing build options from `npm` through `node-pre-gyp` to `node-gyp`: `--nodedir`, `--disturl`, `--python`, and `--msvs_version` + +## 0.5.31 + + - Added support for deducing node_abi for node.js runtime from previous release if the series is even + - Added support for --target=0.10.33 + +## 0.5.30 + + - Repackaged with latest bundled deps + +## 0.5.29 + + - Added support for semver `build`. + - Fixed support for downloading from urls that include `+`. + +## 0.5.28 + + - Now reporting unix style paths only in reveal command + +## 0.5.27 + + - Fixed support for auto-detecting s3 bucket name when it contains `.` - @taavo + - Fixed support for installing when path contains a `'` - @halfdan + - Ported tests to mocha + +## 0.5.26 + + - Fix node-webkit support when `--target` option is not provided + +## 0.5.25 + + - Fix bundling of deps + +## 0.5.24 + + - Updated ABI crosswalk to incldue node v0.10.30 and v0.10.31 + +## 0.5.23 + + - Added `reveal` command. Pass no options to get all versioning data as json. Pass a second arg to grab a single versioned property value + - Added support for `--silent` (shortcut for `--loglevel=silent`) + +## 0.5.22 + + - Fixed node-webkit versioning name (NOTE: node-webkit support still experimental) + +## 0.5.21 + + - New package to fix `shasum check failed` error with v0.5.20 + +## 0.5.20 + + - Now versioning node-webkit binaries based on major.minor.patch - assuming no compatible ABI across versions (#90) + +## 0.5.19 + + - Updated to know about more node-webkit releases + +## 0.5.18 + + - Updated to know about more node-webkit releases + +## 0.5.17 + + - Updated to know about node v0.10.29 release + +## 0.5.16 + + - Now supporting all aws-sdk configuration parameters (http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html) (#86) + +## 0.5.15 + + - Fixed installation of windows packages sub directories on unix systems (#84) + +## 0.5.14 + + - Finished support for cross building using `--target_platform` option (#82) + - Now skipping binary validation on install if target arch/platform do not match the host. + - Removed multi-arch validing for OS X since it required a FAT node.js binary + +## 0.5.13 + + - Fix problem in 0.5.12 whereby the wrong versions of mkdirp and semver where bundled. + +## 0.5.12 + + - Improved support for node-webkit (@Mithgol) + +## 0.5.11 + + - Updated target versions listing + +## 0.5.10 + + - Fixed handling of `-debug` flag passed directory to node-pre-gyp (#72) + - Added optional second arg to `node_pre_gyp.find` to customize the default versioning options used to locate the runtime binary + - Failed install due to `testbinary` check failure no longer leaves behind binary (#70) + +## 0.5.9 + + - Fixed regression in `testbinary` command causing installs to fail on windows with 0.5.7 (#60) + +## 0.5.8 + + - Started bundling deps + +## 0.5.7 + + - Fixed the `testbinary` check, which is used to determine whether to re-download or source compile, to work even in complex dependency situations (#63) + - Exposed the internal `testbinary` command in node-pre-gyp command line tool + - Fixed minor bug so that `fallback_to_build` option is always respected + +## 0.5.6 + + - Added support for versioning on the `name` value in `package.json` (#57). + - Moved to using streams for reading tarball when publishing (#52) + +## 0.5.5 + + - Improved binary validation that also now works with node-webkit (@Mithgol) + - Upgraded test apps to work with node v0.11.x + - Improved test coverage + +## 0.5.4 + + - No longer depends on external install of node-gyp for compiling builds. + +## 0.5.3 + + - Reverted fix for debian/nodejs since it broke windows (#45) + +## 0.5.2 + + - Support for debian systems where the node binary is named `nodejs` (#45) + - Added `bin/node-pre-gyp.cmd` to be able to run command on windows locally (npm creates an .npm automatically when globally installed) + - Updated abi-crosswalk with node v0.10.26 entry. + +## 0.5.1 + + - Various minor bug fixes, several improving windows support for publishing. + +## 0.5.0 + + - Changed property names in `binary` object: now required are `module_name`, `module_path`, and `host`. + - Now `module_path` supports versioning, which allows developers to opt-in to using a versioned install path (#18). + - Added `remote_path` which also supports versioning. + - Changed `remote_uri` to `host`. + +## 0.4.2 + + - Added support for `--target` flag to request cross-compile against a specific node/node-webkit version. + - Added preliminary support for node-webkit + - Fixed support for `--target_arch` option being respected in all cases. + +## 0.4.1 + + - Fixed exception when only stderr is available in binary test (@bendi / #31) + +## 0.4.0 + + - Enforce only `https:` based remote publishing access. + - Added `node-pre-gyp info` command to display listing of published binaries + - Added support for changing the directory node-pre-gyp should build in with the `-C/--directory` option. + - Added support for S3 prefixes. + +## 0.3.1 + + - Added `unpublish` command. + - Fixed module path construction in tests. + - Added ability to disable falling back to build behavior via `npm install --fallback-to-build=false` which overrides setting in a depedencies package.json `install` target. + +## 0.3.0 + + - Support for packaging all files in `module_path` directory - see `app4` for example + - Added `testpackage` command. + - Changed `clean` command to only delete `.node` not entire `build` directory since node-gyp will handle that. + - `.node` modules must be in a folder of there own since tar-pack will remove everything when it unpacks. diff --git a/node_modules/@mapbox/node-pre-gyp/LICENSE b/node_modules/@mapbox/node-pre-gyp/LICENSE new file mode 100644 index 00000000..8f5fce91 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/LICENSE @@ -0,0 +1,27 @@ +Copyright (c), Mapbox + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of node-pre-gyp nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@mapbox/node-pre-gyp/README.md b/node_modules/@mapbox/node-pre-gyp/README.md new file mode 100644 index 00000000..203285a8 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/README.md @@ -0,0 +1,742 @@ +# @mapbox/node-pre-gyp + +#### @mapbox/node-pre-gyp makes it easy to publish and install Node.js C++ addons from binaries + +[![Build Status](https://travis-ci.com/mapbox/node-pre-gyp.svg?branch=master)](https://travis-ci.com/mapbox/node-pre-gyp) +[![Build status](https://ci.appveyor.com/api/projects/status/3nxewb425y83c0gv)](https://ci.appveyor.com/project/Mapbox/node-pre-gyp) + +`@mapbox/node-pre-gyp` stands between [npm](https://github.com/npm/npm) and [node-gyp](https://github.com/Tootallnate/node-gyp) and offers a cross-platform method of binary deployment. + +### Special note on previous package + +On Feb 9th, 2021 `@mapbox/node-pre-gyp@1.0.0` was [released](./CHANGELOG.md). Older, unscoped versions that are not part of the `@mapbox` org are deprecated and only `@mapbox/node-pre-gyp` will see updates going forward. To upgrade to the new package do: + +``` +npm uninstall node-pre-gyp --save +npm install @mapbox/node-pre-gyp --save +``` + +### Features + + - A command line tool called `node-pre-gyp` that can install your package's C++ module from a binary. + - A variety of developer targeted commands for packaging, testing, and publishing binaries. + - A JavaScript module that can dynamically require your installed binary: `require('@mapbox/node-pre-gyp').find` + +For a hello world example of a module packaged with `node-pre-gyp` see and [the wiki ](https://github.com/mapbox/node-pre-gyp/wiki/Modules-using-node-pre-gyp) for real world examples. + +## Credits + + - The module is modeled after [node-gyp](https://github.com/Tootallnate/node-gyp) by [@Tootallnate](https://github.com/Tootallnate) + - Motivation for initial development came from [@ErisDS](https://github.com/ErisDS) and the [Ghost Project](https://github.com/TryGhost/Ghost). + - Development is sponsored by [Mapbox](https://www.mapbox.com/) + +## FAQ + +See the [Frequently Ask Questions](https://github.com/mapbox/node-pre-gyp/wiki/FAQ). + +## Depends + + - Node.js >= node v8.x + +## Install + +`node-pre-gyp` is designed to be installed as a local dependency of your Node.js C++ addon and accessed like: + + ./node_modules/.bin/node-pre-gyp --help + +But you can also install it globally: + + npm install @mapbox/node-pre-gyp -g + +## Usage + +### Commands + +View all possible commands: + + node-pre-gyp --help + +- clean - Remove the entire folder containing the compiled .node module +- install - Install pre-built binary for module +- reinstall - Run "clean" and "install" at once +- build - Compile the module by dispatching to node-gyp or nw-gyp +- rebuild - Run "clean" and "build" at once +- package - Pack binary into tarball +- testpackage - Test that the staged package is valid +- publish - Publish pre-built binary +- unpublish - Unpublish pre-built binary +- info - Fetch info on published binaries + +You can also chain commands: + + node-pre-gyp clean build unpublish publish info + +### Options + +Options include: + + - `-C/--directory`: run the command in this directory + - `--build-from-source`: build from source instead of using pre-built binary + - `--update-binary`: reinstall by replacing previously installed local binary with remote binary + - `--runtime=node-webkit`: customize the runtime: `node`, `electron` and `node-webkit` are the valid options + - `--fallback-to-build`: fallback to building from source if pre-built binary is not available + - `--target=0.4.0`: Pass the target node or node-webkit version to compile against + - `--target_arch=ia32`: Pass the target arch and override the host `arch`. Any value that is [supported by Node.js](https://nodejs.org/api/os.html#osarch) is valid. + - `--target_platform=win32`: Pass the target platform and override the host `platform`. Valid values are `linux`, `darwin`, `win32`, `sunos`, `freebsd`, `openbsd`, and `aix`. + +Both `--build-from-source` and `--fallback-to-build` can be passed alone or they can provide values. You can pass `--fallback-to-build=false` to override the option as declared in package.json. In addition to being able to pass `--build-from-source` you can also pass `--build-from-source=myapp` where `myapp` is the name of your module. + +For example: `npm install --build-from-source=myapp`. This is useful if: + + - `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependency with `npm install`. + - The larger app also depends on other modules installed with `node-pre-gyp` + - You only want to trigger a source compile for `myapp` and the other modules. + +### Configuring + +This is a guide to configuring your module to use node-pre-gyp. + +#### 1) Add new entries to your `package.json` + + - Add `@mapbox/node-pre-gyp` to `dependencies` + - Add `aws-sdk` as a `devDependency` + - Add a custom `install` script + - Declare a `binary` object + +This looks like: + +```js + "dependencies" : { + "@mapbox/node-pre-gyp": "1.x" + }, + "devDependencies": { + "aws-sdk": "2.x" + } + "scripts": { + "install": "node-pre-gyp install --fallback-to-build" + }, + "binary": { + "module_name": "your_module", + "module_path": "./lib/binding/", + "host": "https://your_module.s3-us-west-1.amazonaws.com" + } +``` + +For a full example see [node-addon-examples's package.json](https://github.com/springmeyer/node-addon-example/blob/master/package.json). + +Let's break this down: + + - Dependencies need to list `node-pre-gyp` + - Your devDependencies should list `aws-sdk` so that you can run `node-pre-gyp publish` locally or a CI system. We recommend using `devDependencies` only since `aws-sdk` is large and not needed for `node-pre-gyp install` since it only uses http to fetch binaries + - Your `scripts` section should override the `install` target with `"install": "node-pre-gyp install --fallback-to-build"`. This allows node-pre-gyp to be used instead of the default npm behavior of always source compiling with `node-gyp` directly. + - Your package.json should contain a `binary` section describing key properties you provide to allow node-pre-gyp to package optimally. They are detailed below. + +Note: in the past we recommended putting `@mapbox/node-pre-gyp` in the `bundledDependencies`, but we no longer recommend this. In the past there were npm bugs (with node versions 0.10.x) that could lead to node-pre-gyp not being available at the right time during install (unless we bundled). This should no longer be the case. Also, for a time we recommended using `"preinstall": "npm install @mapbox/node-pre-gyp"` as an alternative method to avoid needing to bundle. But this did not behave predictably across all npm versions - see https://github.com/mapbox/node-pre-gyp/issues/260 for the details. So we do not recommend using `preinstall` to install `@mapbox/node-pre-gyp`. More history on this at https://github.com/strongloop/fsevents/issues/157#issuecomment-265545908. + +##### The `binary` object has three required properties + +###### module_name + +The name of your native node module. This value must: + + - Match the name passed to [the NODE_MODULE macro](http://nodejs.org/api/addons.html#addons_hello_world) + - Must be a valid C variable name (e.g. it cannot contain `-`) + - Should not include the `.node` extension. + +###### module_path + +The location your native module is placed after a build. This should be an empty directory without other Javascript files. This entire directory will be packaged in the binary tarball. When installing from a remote package this directory will be overwritten with the contents of the tarball. + +Note: This property supports variables based on [Versioning](#versioning). + +###### host + +A url to the remote location where you've published tarball binaries (must be `https` not `http`). + +It is highly recommended that you use Amazon S3. The reasons are: + + - Various node-pre-gyp commands like `publish` and `info` only work with an S3 host. + - S3 is a very solid hosting platform for distributing large files. + - We provide detail documentation for using [S3 hosting](#s3-hosting) with node-pre-gyp. + +Why then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a GitHub repo. This is not recommended, but if an author really wants to host in a non-S3 location then it should be possible. + +It should also be mentioned that there is an optional and entirely separate npm module called [node-pre-gyp-github](https://github.com/bchr02/node-pre-gyp-github) which is intended to complement node-pre-gyp and be installed along with it. It provides the ability to store and publish your binaries within your repositories GitHub Releases if you would rather not use S3 directly. Installation and usage instructions can be found [here](https://github.com/bchr02/node-pre-gyp-github), but the basic premise is that instead of using the ```node-pre-gyp publish``` command you would use ```node-pre-gyp-github publish```. + +##### The `binary` object other optional S3 properties + +If you are not using a standard s3 path like `bucket_name.s3(.-)region.amazonaws.com`, you might get an error on `publish` because node-pre-gyp extracts the region and bucket from the `host` url. For example, you may have an on-premises s3-compatible storage server, or may have configured a specific dns redirecting to an s3 endpoint. In these cases, you can explicitly set the `region` and `bucket` properties to tell node-pre-gyp to use these values instead of guessing from the `host` property. The following values can be used in the `binary` section: + +###### host + +The url to the remote server root location (must be `https` not `http`). + +###### bucket + +The bucket name where your tarball binaries should be located. + +###### region + +Your S3 server region. + +###### s3ForcePathStyle + +Set `s3ForcePathStyle` to true if the endpoint url should not be prefixed with the bucket name. If false (default), the server endpoint would be constructed as `bucket_name.your_server.com`. + +##### The `binary` object has optional properties + +###### remote_path + +It **is recommended** that you customize this property. This is an extra path to use for publishing and finding remote tarballs. The default value for `remote_path` is `""` meaning that if you do not provide it then all packages will be published at the base of the `host`. It is recommended to provide a value like `./{name}/v{version}` to help organize remote packages in the case that you choose to publish multiple node addons to the same `host`. + +Note: This property supports variables based on [Versioning](#versioning). + +###### package_name + +It is **not recommended** to override this property unless you are also overriding the `remote_path`. This is the versioned name of the remote tarball containing the binary `.node` module and any supporting files you've placed inside the `module_path` directory. Unless you specify `package_name` in your `package.json` then it defaults to `{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz` which allows your binary to work across node versions, platforms, and architectures. If you are using `remote_path` that is also versioned by `./{module_name}/v{version}` then you could remove these variables from the `package_name` and just use: `{node_abi}-{platform}-{arch}.tar.gz`. Then your remote tarball will be looked up at, for example, `https://example.com/your-module/v0.1.0/node-v11-linux-x64.tar.gz`. + +Avoiding the version of your module in the `package_name` and instead only embedding in a directory name can be useful when you want to make a quick tag of your module that does not change any C++ code. In this case you can just copy binaries to the new version behind the scenes like: + +```sh +aws s3 sync --acl public-read s3://mapbox-node-binary/sqlite3/v3.0.3/ s3://mapbox-node-binary/sqlite3/v3.0.4/ +``` + +Note: This property supports variables based on [Versioning](#versioning). + +#### 2) Add a new target to binding.gyp + +`node-pre-gyp` calls out to `node-gyp` to compile the module and passes variables along like [module_name](#module_name) and [module_path](#module_path). + +A new target must be added to `binding.gyp` that moves the compiled `.node` module from `./build/Release/module_name.node` into the directory specified by `module_path`. + +Add a target like this at the end of your `targets` list: + +```js + { + "target_name": "action_after_build", + "type": "none", + "dependencies": [ "<(module_name)" ], + "copies": [ + { + "files": [ "<(PRODUCT_DIR)/<(module_name).node" ], + "destination": "<(module_path)" + } + ] + } +``` + +For a full example see [node-addon-example's binding.gyp](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/binding.gyp). + +#### 3) Dynamically require your `.node` + +Inside the main js file that requires your addon module you are likely currently doing: + +```js +var binding = require('../build/Release/binding.node'); +``` + +or: + +```js +var bindings = require('./bindings') +``` + +Change those lines to: + +```js +var binary = require('@mapbox/node-pre-gyp'); +var path = require('path'); +var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json'))); +var binding = require(binding_path); +``` + +For a full example see [node-addon-example's index.js](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/index.js#L1-L4) + +#### 4) Build and package your app + +Now build your module from source: + + npm install --build-from-source + +The `--build-from-source` tells `node-pre-gyp` to not look for a remote package and instead dispatch to node-gyp to build. + +Now `node-pre-gyp` should now also be installed as a local dependency so the command line tool it offers can be found at `./node_modules/.bin/node-pre-gyp`. + +#### 5) Test + +Now `npm test` should work just as it did before. + +#### 6) Publish the tarball + +Then package your app: + + ./node_modules/.bin/node-pre-gyp package + +Once packaged, now you can publish: + + ./node_modules/.bin/node-pre-gyp publish + +Currently the `publish` command pushes your binary to S3. This requires: + + - You have installed `aws-sdk` with `npm install aws-sdk` + - You have created a bucket already. + - The `host` points to an S3 http or https endpoint. + - You have configured node-pre-gyp to read your S3 credentials (see [S3 hosting](#s3-hosting) for details). + +You can also host your binaries elsewhere. To do this requires: + + - You manually publish the binary created by the `package` command to an `https` endpoint + - Ensure that the `host` value points to your custom `https` endpoint. + +#### 7) Automate builds + +Now you need to publish builds for all the platforms and node versions you wish to support. This is best automated. + + - See [Appveyor Automation](#appveyor-automation) for how to auto-publish builds on Windows. + - See [Travis Automation](#travis-automation) for how to auto-publish builds on OS X and Linux. + +#### 8) You're done! + +Now publish your module to the npm registry. Users will now be able to install your module from a binary. + +What will happen is this: + +1. `npm install ` will pull from the npm registry +2. npm will run the `install` script which will call out to `node-pre-gyp` +3. `node-pre-gyp` will fetch the binary `.node` module and unpack in the right place +4. Assuming that all worked, you are done + +If a a binary was not available for a given platform and `--fallback-to-build` was used then `node-gyp rebuild` will be called to try to source compile the module. + +#### 9) One more option + +It may be that you want to work with two s3 buckets, one for staging and one for production; this +arrangement makes it less likely to accidentally overwrite a production binary. It also allows the production +environment to have more restrictive permissions than staging while still enabling publishing when +developing and testing. + +The binary.host property can be set at execution time. In order to do so all of the following conditions +must be true. + +- binary.host is falsey or not present +- binary.staging_host is not empty +- binary.production_host is not empty + +If any of these checks fail then the operation will not perform execution time determination of the s3 target. + +If the command being executed is either "publish" or "unpublish" then the default is set to `binary.staging_host`. In all other cases +the default is `binary.production_host`. + +The command-line options `--s3_host=staging` or `--s3_host=production` override the default. If `s3_host` +is present and not `staging` or `production` an exception is thrown. + +This allows installing from staging by specifying `--s3_host=staging`. And it requires specifying +`--s3_option=production` in order to publish to, or unpublish from, production, making accidental errors less likely. + +## Node-API Considerations + +[Node-API](https://nodejs.org/api/n-api.html#n_api_node_api), which was previously known as N-API, is an ABI-stable alternative to previous technologies such as [nan](https://github.com/nodejs/nan) which are tied to a specific Node runtime engine. Node-API is Node runtime engine agnostic and guarantees modules created today will continue to run, without changes, into the future. + +Using `node-pre-gyp` with Node-API projects requires a handful of additional configuration values and imposes some additional requirements. + +The most significant difference is that an Node-API module can be coded to target multiple Node-API versions. Therefore, an Node-API module must declare in its `package.json` file which Node-API versions the module is designed to run against. In addition, since multiple builds may be required for a single module, path and file names must be specified in way that avoids naming conflicts. + +### The `napi_versions` array property + +A Node-API module must declare in its `package.json` file, the Node-API versions the module is intended to support. This is accomplished by including an `napi-versions` array property in the `binary` object. For example: + +```js +"binary": { + "module_name": "your_module", + "module_path": "your_module_path", + "host": "https://your_bucket.s3-us-west-1.amazonaws.com", + "napi_versions": [1,3] + } +``` + +If the `napi_versions` array property is *not* present, `node-pre-gyp` operates as it always has. Including the `napi_versions` array property instructs `node-pre-gyp` that this is a Node-API module build. + +When the `napi_versions` array property is present, `node-pre-gyp` fires off multiple operations, one for each of the Node-API versions in the array. In the example above, two operations are initiated, one for Node-API version 1 and second for Node-API version 3. How this version number is communicated is described next. + +### The `napi_build_version` value + +For each of the Node-API module operations `node-pre-gyp` initiates, it ensures that the `napi_build_version` is set appropriately. + +This value is of importance in two areas: + +1. The C/C++ code which needs to know against which Node-API version it should compile. +2. `node-pre-gyp` itself which must assign appropriate path and file names to avoid collisions. + +### Defining `NAPI_VERSION` for the C/C++ code + +The `napi_build_version` value is communicated to the C/C++ code by adding this code to the `binding.gyp` file: + +``` +"defines": [ + "NAPI_VERSION=<(napi_build_version)", +] +``` + +This ensures that `NAPI_VERSION`, an integer value, is declared appropriately to the C/C++ code for each build. + +> Note that earlier versions of this document recommended defining the symbol `NAPI_BUILD_VERSION`. `NAPI_VERSION` is preferred because it used by the Node-API C/C++ headers to configure the specific Node-API versions being requested. + +### Path and file naming requirements in `package.json` + +Since `node-pre-gyp` fires off multiple operations for each request, it is essential that path and file names be created in such a way as to avoid collisions. This is accomplished by imposing additional path and file naming requirements. + +Specifically, when performing Node-API builds, the `{napi_build_version}` text configuration value *must* be present in the `module_path` property. In addition, the `{napi_build_version}` text configuration value *must* be present in either the `remote_path` or `package_name` property. (No problem if it's in both.) + +Here's an example: + +```js +"binary": { + "module_name": "your_module", + "module_path": "./lib/binding/napi-v{napi_build_version}", + "remote_path": "./{module_name}/v{version}/{configuration}/", + "package_name": "{platform}-{arch}-napi-v{napi_build_version}.tar.gz", + "host": "https://your_bucket.s3-us-west-1.amazonaws.com", + "napi_versions": [1,3] + } +``` + +## Supporting both Node-API and NAN builds + +You may have a legacy native add-on that you wish to continue supporting for those versions of Node that do not support Node-API, as you add Node-API support for later Node versions. This can be accomplished by specifying the `node_napi_label` configuration value in the package.json `binary.package_name` property. + +Placing the configuration value `node_napi_label` in the package.json `binary.package_name` property instructs `node-pre-gyp` to build all viable Node-API binaries supported by the current Node instance. If the current Node instance does not support Node-API, `node-pre-gyp` will request a traditional, non-Node-API build. + +The configuration value `node_napi_label` is set by `node-pre-gyp` to the type of build created, `napi` or `node`, and the version number. For Node-API builds, the string contains the Node-API version nad has values like `napi-v3`. For traditional, non-Node-API builds, the string contains the ABI version with values like `node-v46`. + +Here's how the `binary` configuration above might be changed to support both Node-API and NAN builds: + +```js +"binary": { + "module_name": "your_module", + "module_path": "./lib/binding/{node_napi_label}", + "remote_path": "./{module_name}/v{version}/{configuration}/", + "package_name": "{platform}-{arch}-{node_napi_label}.tar.gz", + "host": "https://your_bucket.s3-us-west-1.amazonaws.com", + "napi_versions": [1,3] + } +``` + +The C/C++ symbol `NAPI_VERSION` can be used to distinguish Node-API and non-Node-API builds. The value of `NAPI_VERSION` is set to the integer Node-API version for Node-API builds and is set to `0` for non-Node-API builds. + +For example: + +```C +#if NAPI_VERSION +// Node-API code goes here +#else +// NAN code goes here +#endif +``` + +### Two additional configuration values + +The following two configuration values, which were implemented in previous versions of `node-pre-gyp`, continue to exist, but have been replaced by the `node_napi_label` configuration value described above. + +1. `napi_version` If Node-API is supported by the currently executing Node instance, this value is the Node-API version number supported by Node. If Node-API is not supported, this value is an empty string. + +2. `node_abi_napi` If the value returned for `napi_version` is non empty, this value is `'napi'`. If the value returned for `napi_version` is empty, this value is the value returned for `node_abi`. + +These values are present for use in the `binding.gyp` file and may be used as `{napi_version}` and `{node_abi_napi}` for text substituion in the `binary` properties of the `package.json` file. + +## S3 Hosting + +You can host wherever you choose but S3 is cheap, `node-pre-gyp publish` expects it, and S3 can be integrated well with [Travis.ci](http://travis-ci.org) to automate builds for OS X and Ubuntu, and with [Appveyor](http://appveyor.com) to automate builds for Windows. Here is an approach to do this: + +First, get setup locally and test the workflow: + +#### 1) Create an S3 bucket + +And have your **key** and **secret key** ready for writing to the bucket. + +It is recommended to create a IAM user with a policy that only gives permissions to the specific bucket you plan to publish to. This can be done in the [IAM console](https://console.aws.amazon.com/iam/) by: 1) adding a new user, 2) choosing `Attach User Policy`, 3) Using the `Policy Generator`, 4) selecting `Amazon S3` for the service, 5) adding the actions: `DeleteObject`, `GetObject`, `GetObjectAcl`, `ListBucket`, `HeadBucket`, `PutObject`, `PutObjectAcl`, 6) adding an ARN of `arn:aws:s3:::bucket/*` (replacing `bucket` with your bucket name), and finally 7) clicking `Add Statement` and saving the policy. It should generate a policy like: + +```js +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "objects", + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObjectAcl", + "s3:GetObject", + "s3:DeleteObject", + "s3:PutObjectAcl" + ], + "Resource": "arn:aws:s3:::your-bucket-name/*" + }, + { + "Sid": "bucket", + "Effect": "Allow", + "Action": "s3:ListBucket", + "Resource": "arn:aws:s3:::your-bucket-name" + }, + { + "Sid": "buckets", + "Effect": "Allow", + "Action": "s3:HeadBucket", + "Resource": "*" + } + ] +} +``` + +#### 2) Install node-pre-gyp + +Either install it globally: + + npm install node-pre-gyp -g + +Or put the local version on your PATH + + export PATH=`pwd`/node_modules/.bin/:$PATH + +#### 3) Configure AWS credentials + +It is recommended to configure the AWS JS SDK v2 used internally by `node-pre-gyp` by setting these environment variables: + +- AWS_ACCESS_KEY_ID +- AWS_SECRET_ACCESS_KEY + +But also you can also use the `Shared Config File` mentioned [in the AWS JS SDK v2 docs](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/configuring-the-jssdk.html) + +#### 4) Package and publish your build + +Install the `aws-sdk`: + + npm install aws-sdk + +Then publish: + + node-pre-gyp package publish + +Note: if you hit an error like `Hostname/IP doesn't match certificate's altnames` it may mean that you need to provide the `region` option in your config. + +## Appveyor Automation + +[Appveyor](http://www.appveyor.com/) can build binaries and publish the results per commit and supports: + + - Windows Visual Studio 2013 and related compilers + - Both 64 bit (x64) and 32 bit (x86) build configurations + - Multiple Node.js versions + +For an example of doing this see [node-sqlite3's appveyor.yml](https://github.com/mapbox/node-sqlite3/blob/master/appveyor.yml). + +Below is a guide to getting set up: + +#### 1) Create a free Appveyor account + +Go to https://ci.appveyor.com/signup/free and sign in with your GitHub account. + +#### 2) Create a new project + +Go to https://ci.appveyor.com/projects/new and select the GitHub repo for your module + +#### 3) Add appveyor.yml and push it + +Once you have committed an `appveyor.yml` ([appveyor.yml reference](http://www.appveyor.com/docs/appveyor-yml)) to your GitHub repo and pushed it AppVeyor should automatically start building your project. + +#### 4) Create secure variables + +Encrypt your S3 AWS keys by going to and hitting the `encrypt` button. + +Then paste the result into your `appveyor.yml` + +```yml +environment: + AWS_ACCESS_KEY_ID: + secure: Dn9HKdLNYvDgPdQOzRq/DqZ/MPhjknRHB1o+/lVU8MA= + AWS_SECRET_ACCESS_KEY: + secure: W1rwNoSnOku1r+28gnoufO8UA8iWADmL1LiiwH9IOkIVhDTNGdGPJqAlLjNqwLnL +``` + +NOTE: keys are per account but not per repo (this is difference than Travis where keys are per repo but not related to the account used to encrypt them). + +#### 5) Hook up publishing + +Just put `node-pre-gyp package publish` in your `appveyor.yml` after `npm install`. + +#### 6) Publish when you want + +You might wish to publish binaries only on a specific commit. To do this you could borrow from the [Travis CI idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`: + + SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE% + if not "%CM%" == "%CM:[publish binary]=%" node-pre-gyp --msvs_version=2013 publish + +If your commit message contains special characters (e.g. `&`) this method might fail. An alternative is to use PowerShell, which gives you additional possibilities, like ignoring case by using `ToLower()`: + + ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains('[publish binary]')) { node-pre-gyp --msvs_version=2013 publish } + +Remember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. + +## Travis Automation + +[Travis](https://travis-ci.org/) can push to S3 after a successful build and supports both: + + - Ubuntu Precise and OS X (64 bit) + - Multiple Node.js versions + +For an example of doing this see [node-add-example's .travis.yml](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/.travis.yml). + +Note: if you need 32 bit binaries, this can be done from a 64 bit Travis machine. See [the node-sqlite3 scripts for an example of doing this](https://github.com/mapbox/node-sqlite3/blob/bae122aa6a2b8a45f6b717fab24e207740e32b5d/scripts/build_against_node.sh#L54-L74). + +Below is a guide to getting set up: + +#### 1) Install the Travis gem + + gem install travis + +#### 2) Create secure variables + +Make sure you run this command from within the directory of your module. + +Use `travis-encrypt` like: + + travis encrypt AWS_ACCESS_KEY_ID=${node_pre_gyp_accessKeyId} + travis encrypt AWS_SECRET_ACCESS_KEY=${node_pre_gyp_secretAccessKey} + +Then put those values in your `.travis.yml` like: + +```yaml +env: + global: + - secure: F+sEL/v56CzHqmCSSES4pEyC9NeQlkoR0Gs/ZuZxX1ytrj8SKtp3MKqBj7zhIclSdXBz4Ev966Da5ctmcTd410p0b240MV6BVOkLUtkjZJyErMBOkeb8n8yVfSoeMx8RiIhBmIvEn+rlQq+bSFis61/JkE9rxsjkGRZi14hHr4M= + - secure: o2nkUQIiABD139XS6L8pxq3XO5gch27hvm/gOdV+dzNKc/s2KomVPWcOyXNxtJGhtecAkABzaW8KHDDi5QL1kNEFx6BxFVMLO8rjFPsMVaBG9Ks6JiDQkkmrGNcnVdxI/6EKTLHTH5WLsz8+J7caDBzvKbEfTux5EamEhxIWgrI= +``` + +More details on Travis encryption at http://about.travis-ci.org/docs/user/encryption-keys/. + +#### 3) Hook up publishing + +Just put `node-pre-gyp package publish` in your `.travis.yml` after `npm install`. + +##### OS X publishing + +If you want binaries for OS X in addition to linux you can enable [multi-os for Travis](http://docs.travis-ci.com/user/multi-os/#Setting-.travis.yml) + +Use a configuration like: + +```yml + +language: cpp + +os: +- linux +- osx + +env: + matrix: + - NODE_VERSION="4" + - NODE_VERSION="6" + +before_install: +- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm +- source ~/.nvm/nvm.sh +- nvm install $NODE_VERSION +- nvm use $NODE_VERSION +``` + +See [Travis OS X Gotchas](#travis-os-x-gotchas) for why we replace `language: node_js` and `node_js:` sections with `language: cpp` and a custom matrix. + +Also create platform specific sections for any deps that need install. For example if you need libpng: + +```yml +- if [ $(uname -s) == 'Linux' ]; then apt-get install libpng-dev; fi; +- if [ $(uname -s) == 'Darwin' ]; then brew install libpng; fi; +``` + +For detailed multi-OS examples see [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/.travis.yml) and [node-sqlite3](https://github.com/mapbox/node-sqlite3/blob/master/.travis.yml). + +##### Travis OS X Gotchas + +First, unlike the Travis Linux machines, the OS X machines do not put `node-pre-gyp` on PATH by default. To do so you will need to: + +```sh +export PATH=$(pwd)/node_modules/.bin:${PATH} +``` + +Second, the OS X machines do not support using a matrix for installing different Node.js versions. So you need to bootstrap the installation of Node.js in a cross platform way. + +By doing: + +```yml +env: + matrix: + - NODE_VERSION="4" + - NODE_VERSION="6" + +before_install: + - rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm + - source ~/.nvm/nvm.sh + - nvm install $NODE_VERSION + - nvm use $NODE_VERSION +``` + +You can easily recreate the previous behavior of this matrix: + +```yml +node_js: + - "4" + - "6" +``` + +#### 4) Publish when you want + +You might wish to publish binaries only on a specific commit. To do this you could borrow from the [Travis CI idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`: + + COMMIT_MESSAGE=$(git log --format=%B --no-merges -n 1 | tr -d '\n') + if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then node-pre-gyp publish; fi; + +Then you can trigger new binaries to be built like: + + git commit -a -m "[publish binary]" + +Or, if you don't have any changes to make simply run: + + git commit --allow-empty -m "[publish binary]" + +WARNING: if you are working in a pull request and publishing binaries from there then you will want to avoid double publishing when Travis CI builds both the `push` and `pr`. You only want to run the publish on the `push` commit. See https://github.com/Project-OSRM/node-osrm/blob/8eb837abe2e2e30e595093d16e5354bc5c573575/scripts/is_pr_merge.sh which is called from https://github.com/Project-OSRM/node-osrm/blob/8eb837abe2e2e30e595093d16e5354bc5c573575/scripts/publish.sh for an example of how to do this. + +Remember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. To automate the publishing of your entire package to npm on Travis see http://about.travis-ci.org/docs/user/deployment/npm/ + +# Versioning + +The `binary` properties of `module_path`, `remote_path`, and `package_name` support variable substitution. The strings are evaluated by `node-pre-gyp` depending on your system and any custom build flags you passed. + + - `node_abi`: The node C++ `ABI` number. This value is available in Javascript as `process.versions.modules` as of [`>= v0.10.4 >= v0.11.7`](https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e) and in C++ as the `NODE_MODULE_VERSION` define much earlier. For versions of Node before this was available we fallback to the V8 major and minor version. + - `platform` matches node's `process.platform` like `linux`, `darwin`, and `win32` unless the user passed the `--target_platform` option to override. + - `arch` matches node's `process.arch` like `x64` or `ia32` unless the user passes the `--target_arch` option to override. + - `libc` matches `require('detect-libc').family` like `glibc` or `musl` unless the user passes the `--target_libc` option to override. + - `configuration` - Either 'Release' or 'Debug' depending on if `--debug` is passed during the build. + - `module_name` - the `binary.module_name` attribute from `package.json`. + - `version` - the semver `version` value for your module from `package.json` (NOTE: ignores the `semver.build` property). + - `major`, `minor`, `patch`, and `prelease` match the individual semver values for your module's `version` + - `build` - the sevmer `build` value. For example it would be `this.that` if your package.json `version` was `v1.0.0+this.that` + - `prerelease` - the semver `prerelease` value. For example it would be `alpha.beta` if your package.json `version` was `v1.0.0-alpha.beta` + + +The options are visible in the code at + +# Download binary files from a mirror + +S3 is broken in China for the well known reason. + +Using the `npm` config argument: `--{module_name}_binary_host_mirror` can download binary files through a mirror, `-` in `module_name` will be replaced with `_`. + +e.g.: Install [v8-profiler](https://www.npmjs.com/package/v8-profiler) from `npm`. + +```bash +$ npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/ +``` + +e.g.: Install [canvas-prebuilt](https://www.npmjs.com/package/canvas-prebuilt) from `npm`. + +```bash +$ npm install canvas-prebuilt --canvas_prebuilt_binary_host_mirror=https://npm.taobao.org/mirrors/canvas-prebuilt/ +``` diff --git a/node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp b/node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp new file mode 100644 index 00000000..c38d34d1 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp @@ -0,0 +1,4 @@ +#!/usr/bin/env node +'use strict'; + +require('../lib/main'); diff --git a/node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp.cmd b/node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp.cmd new file mode 100644 index 00000000..46e14b54 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp.cmd @@ -0,0 +1,2 @@ +@echo off +node "%~dp0\node-pre-gyp" %* diff --git a/node_modules/@mapbox/node-pre-gyp/contributing.md b/node_modules/@mapbox/node-pre-gyp/contributing.md new file mode 100644 index 00000000..4038fa6a --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/contributing.md @@ -0,0 +1,10 @@ +# Contributing + + +### Releasing a new version: + +- Ensure tests are passing on travis and appveyor +- Run `node scripts/abi_crosswalk.js` and commit any changes +- Update the changelog +- Tag a new release like: `git tag -a v0.6.34 -m "tagging v0.6.34" && git push --tags` +- Run `npm publish` diff --git a/node_modules/@mapbox/node-pre-gyp/lib/build.js b/node_modules/@mapbox/node-pre-gyp/lib/build.js new file mode 100644 index 00000000..e8a1459d --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/build.js @@ -0,0 +1,51 @@ +'use strict'; + +module.exports = exports = build; + +exports.usage = 'Attempts to compile the module by dispatching to node-gyp or nw-gyp'; + +const napi = require('./util/napi.js'); +const compile = require('./util/compile.js'); +const handle_gyp_opts = require('./util/handle_gyp_opts.js'); +const configure = require('./configure.js'); + +function do_build(gyp, argv, callback) { + handle_gyp_opts(gyp, argv, (err, result) => { + let final_args = ['build'].concat(result.gyp).concat(result.pre); + if (result.unparsed.length > 0) { + final_args = final_args. + concat(['--']). + concat(result.unparsed); + } + if (!err && result.opts.napi_build_version) { + napi.swap_build_dir_in(result.opts.napi_build_version); + } + compile.run_gyp(final_args, result.opts, (err2) => { + if (result.opts.napi_build_version) { + napi.swap_build_dir_out(result.opts.napi_build_version); + } + return callback(err2); + }); + }); +} + +function build(gyp, argv, callback) { + + // Form up commands to pass to node-gyp: + // We map `node-pre-gyp build` to `node-gyp configure build` so that we do not + // trigger a clean and therefore do not pay the penalty of a full recompile + if (argv.length && (argv.indexOf('rebuild') > -1)) { + argv.shift(); // remove `rebuild` + // here we map `node-pre-gyp rebuild` to `node-gyp rebuild` which internally means + // "clean + configure + build" and triggers a full recompile + compile.run_gyp(['clean'], {}, (err3) => { + if (err3) return callback(err3); + configure(gyp, argv, (err4) => { + if (err4) return callback(err4); + return do_build(gyp, argv, callback); + }); + }); + } else { + return do_build(gyp, argv, callback); + } +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/clean.js b/node_modules/@mapbox/node-pre-gyp/lib/clean.js new file mode 100644 index 00000000..e6933923 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/clean.js @@ -0,0 +1,31 @@ +'use strict'; + +module.exports = exports = clean; + +exports.usage = 'Removes the entire folder containing the compiled .node module'; + +const rm = require('rimraf'); +const exists = require('fs').exists || require('path').exists; +const versioning = require('./util/versioning.js'); +const napi = require('./util/napi.js'); +const path = require('path'); + +function clean(gyp, argv, callback) { + const package_json = gyp.package_json; + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + const to_delete = opts.module_path; + if (!to_delete) { + return callback(new Error('module_path is empty, refusing to delete')); + } else if (path.normalize(to_delete) === path.normalize(process.cwd())) { + return callback(new Error('module_path is not set, refusing to delete')); + } else { + exists(to_delete, (found) => { + if (found) { + if (!gyp.opts.silent_clean) console.log('[' + package_json.name + '] Removing "%s"', to_delete); + return rm(to_delete, callback); + } + return callback(); + }); + } +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/configure.js b/node_modules/@mapbox/node-pre-gyp/lib/configure.js new file mode 100644 index 00000000..1337c0cb --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/configure.js @@ -0,0 +1,52 @@ +'use strict'; + +module.exports = exports = configure; + +exports.usage = 'Attempts to configure node-gyp or nw-gyp build'; + +const napi = require('./util/napi.js'); +const compile = require('./util/compile.js'); +const handle_gyp_opts = require('./util/handle_gyp_opts.js'); + +function configure(gyp, argv, callback) { + handle_gyp_opts(gyp, argv, (err, result) => { + let final_args = result.gyp.concat(result.pre); + // pull select node-gyp configure options out of the npm environ + const known_gyp_args = ['dist-url', 'python', 'nodedir', 'msvs_version']; + known_gyp_args.forEach((key) => { + const val = gyp.opts[key] || gyp.opts[key.replace('-', '_')]; + if (val) { + final_args.push('--' + key + '=' + val); + } + }); + // --ensure=false tell node-gyp to re-install node development headers + // but it is only respected by node-gyp install, so we have to call install + // as a separate step if the user passes it + if (gyp.opts.ensure === false) { + const install_args = final_args.concat(['install', '--ensure=false']); + compile.run_gyp(install_args, result.opts, (err2) => { + if (err2) return callback(err2); + if (result.unparsed.length > 0) { + final_args = final_args. + concat(['--']). + concat(result.unparsed); + } + compile.run_gyp(['configure'].concat(final_args), result.opts, (err3) => { + return callback(err3); + }); + }); + } else { + if (result.unparsed.length > 0) { + final_args = final_args. + concat(['--']). + concat(result.unparsed); + } + compile.run_gyp(['configure'].concat(final_args), result.opts, (err4) => { + if (!err4 && result.opts.napi_build_version) { + napi.swap_build_dir_out(result.opts.napi_build_version); + } + return callback(err4); + }); + } + }); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/info.js b/node_modules/@mapbox/node-pre-gyp/lib/info.js new file mode 100644 index 00000000..ba22f327 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/info.js @@ -0,0 +1,38 @@ +'use strict'; + +module.exports = exports = info; + +exports.usage = 'Lists all published binaries (requires aws-sdk)'; + +const log = require('npmlog'); +const versioning = require('./util/versioning.js'); +const s3_setup = require('./util/s3_setup.js'); + +function info(gyp, argv, callback) { + const package_json = gyp.package_json; + const opts = versioning.evaluate(package_json, gyp.opts); + const config = {}; + s3_setup.detect(opts, config); + const s3 = s3_setup.get_s3(config); + const s3_opts = { + Bucket: config.bucket, + Prefix: config.prefix + }; + s3.listObjects(s3_opts, (err, meta) => { + if (err && err.code === 'NotFound') { + return callback(new Error('[' + package_json.name + '] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + config.prefix)); + } else if (err) { + return callback(err); + } else { + log.verbose(JSON.stringify(meta, null, 1)); + if (meta && meta.Contents) { + meta.Contents.forEach((obj) => { + console.log(obj.Key); + }); + } else { + console.error('[' + package_json.name + '] No objects found at https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + config.prefix); + } + return callback(); + } + }); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/install.js b/node_modules/@mapbox/node-pre-gyp/lib/install.js new file mode 100644 index 00000000..617dd866 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/install.js @@ -0,0 +1,235 @@ +'use strict'; + +module.exports = exports = install; + +exports.usage = 'Attempts to install pre-built binary for module'; + +const fs = require('fs'); +const path = require('path'); +const log = require('npmlog'); +const existsAsync = fs.exists || path.exists; +const versioning = require('./util/versioning.js'); +const napi = require('./util/napi.js'); +const makeDir = require('make-dir'); +// for fetching binaries +const fetch = require('node-fetch'); +const tar = require('tar'); + +let npgVersion = 'unknown'; +try { + // Read own package.json to get the current node-pre-pyp version. + const ownPackageJSON = fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'); + npgVersion = JSON.parse(ownPackageJSON).version; +} catch (e) { + // do nothing +} + +function place_binary(uri, targetDir, opts, callback) { + log.http('GET', uri); + + // Try getting version info from the currently running npm. + const envVersionInfo = process.env.npm_config_user_agent || + 'node ' + process.version; + + const sanitized = uri.replace('+', '%2B'); + const requestOpts = { + uri: sanitized, + headers: { + 'User-Agent': 'node-pre-gyp (v' + npgVersion + ', ' + envVersionInfo + ')' + }, + follow_max: 10 + }; + + if (opts.cafile) { + try { + requestOpts.ca = fs.readFileSync(opts.cafile); + } catch (e) { + return callback(e); + } + } else if (opts.ca) { + requestOpts.ca = opts.ca; + } + + const proxyUrl = opts.proxy || + process.env.http_proxy || + process.env.HTTP_PROXY || + process.env.npm_config_proxy; + let agent; + if (proxyUrl) { + const ProxyAgent = require('https-proxy-agent'); + agent = new ProxyAgent(proxyUrl); + log.http('download', 'proxy agent configured using: "%s"', proxyUrl); + } + + fetch(sanitized, { agent }) + .then((res) => { + if (!res.ok) { + throw new Error(`response status ${res.status} ${res.statusText} on ${sanitized}`); + } + const dataStream = res.body; + + return new Promise((resolve, reject) => { + let extractions = 0; + const countExtractions = (entry) => { + extractions += 1; + log.info('install', 'unpacking %s', entry.path); + }; + + dataStream.pipe(extract(targetDir, countExtractions)) + .on('error', (e) => { + reject(e); + }); + dataStream.on('end', () => { + resolve(`extracted file count: ${extractions}`); + }); + dataStream.on('error', (e) => { + reject(e); + }); + }); + }) + .then((text) => { + log.info(text); + callback(); + }) + .catch((e) => { + log.error(`install ${e.message}`); + callback(e); + }); +} + +function extract(to, onentry) { + return tar.extract({ + cwd: to, + strip: 1, + onentry + }); +} + +function extract_from_local(from, targetDir, callback) { + if (!fs.existsSync(from)) { + return callback(new Error('Cannot find file ' + from)); + } + log.info('Found local file to extract from ' + from); + + // extract helpers + let extractCount = 0; + function countExtractions(entry) { + extractCount += 1; + log.info('install', 'unpacking ' + entry.path); + } + function afterExtract(err) { + if (err) return callback(err); + if (extractCount === 0) { + return callback(new Error('There was a fatal problem while extracting the tarball')); + } + log.info('tarball', 'done parsing tarball'); + callback(); + } + + fs.createReadStream(from).pipe(extract(targetDir, countExtractions)) + .on('close', afterExtract) + .on('error', afterExtract); +} + +function do_build(gyp, argv, callback) { + const args = ['rebuild'].concat(argv); + gyp.todo.push({ name: 'build', args: args }); + process.nextTick(callback); +} + +function print_fallback_error(err, opts, package_json) { + const fallback_message = ' (falling back to source compile with node-gyp)'; + let full_message = ''; + if (err.statusCode !== undefined) { + // If we got a network response it but failed to download + // it means remote binaries are not available, so let's try to help + // the user/developer with the info to debug why + full_message = 'Pre-built binaries not found for ' + package_json.name + '@' + package_json.version; + full_message += ' and ' + opts.runtime + '@' + (opts.target || process.versions.node) + ' (' + opts.node_abi + ' ABI, ' + opts.libc + ')'; + full_message += fallback_message; + log.warn('Tried to download(' + err.statusCode + '): ' + opts.hosted_tarball); + log.warn(full_message); + log.http(err.message); + } else { + // If we do not have a statusCode that means an unexpected error + // happened and prevented an http response, so we output the exact error + full_message = 'Pre-built binaries not installable for ' + package_json.name + '@' + package_json.version; + full_message += ' and ' + opts.runtime + '@' + (opts.target || process.versions.node) + ' (' + opts.node_abi + ' ABI, ' + opts.libc + ')'; + full_message += fallback_message; + log.warn(full_message); + log.warn('Hit error ' + err.message); + } +} + +// +// install +// +function install(gyp, argv, callback) { + const package_json = gyp.package_json; + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const source_build = gyp.opts['build-from-source'] || gyp.opts.build_from_source; + const update_binary = gyp.opts['update-binary'] || gyp.opts.update_binary; + const should_do_source_build = source_build === package_json.name || (source_build === true || source_build === 'true'); + if (should_do_source_build) { + log.info('build', 'requesting source compile'); + return do_build(gyp, argv, callback); + } else { + const fallback_to_build = gyp.opts['fallback-to-build'] || gyp.opts.fallback_to_build; + let should_do_fallback_build = fallback_to_build === package_json.name || (fallback_to_build === true || fallback_to_build === 'true'); + // but allow override from npm + if (process.env.npm_config_argv) { + const cooked = JSON.parse(process.env.npm_config_argv).cooked; + const match = cooked.indexOf('--fallback-to-build'); + if (match > -1 && cooked.length > match && cooked[match + 1] === 'false') { + should_do_fallback_build = false; + log.info('install', 'Build fallback disabled via npm flag: --fallback-to-build=false'); + } + } + let opts; + try { + opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + } catch (err) { + return callback(err); + } + + opts.ca = gyp.opts.ca; + opts.cafile = gyp.opts.cafile; + + const from = opts.hosted_tarball; + const to = opts.module_path; + const binary_module = path.join(to, opts.module_name + '.node'); + existsAsync(binary_module, (found) => { + if (!update_binary) { + if (found) { + console.log('[' + package_json.name + '] Success: "' + binary_module + '" already installed'); + console.log('Pass --update-binary to reinstall or --build-from-source to recompile'); + return callback(); + } + log.info('check', 'checked for "' + binary_module + '" (not found)'); + } + + makeDir(to).then(() => { + const fileName = from.startsWith('file://') && from.slice('file://'.length); + if (fileName) { + extract_from_local(fileName, to, after_place); + } else { + place_binary(from, to, opts, after_place); + } + }).catch((err) => { + after_place(err); + }); + + function after_place(err) { + if (err && should_do_fallback_build) { + print_fallback_error(err, opts, package_json); + return do_build(gyp, argv, callback); + } else if (err) { + return callback(err); + } else { + console.log('[' + package_json.name + '] Success: "' + binary_module + '" is installed via remote'); + return callback(); + } + } + }); + } +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/main.js b/node_modules/@mapbox/node-pre-gyp/lib/main.js new file mode 100644 index 00000000..bae32acb --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/main.js @@ -0,0 +1,125 @@ +'use strict'; + +/** + * Set the title. + */ + +process.title = 'node-pre-gyp'; + +const node_pre_gyp = require('../'); +const log = require('npmlog'); + +/** + * Process and execute the selected commands. + */ + +const prog = new node_pre_gyp.Run({ argv: process.argv }); +let completed = false; + +if (prog.todo.length === 0) { + if (~process.argv.indexOf('-v') || ~process.argv.indexOf('--version')) { + console.log('v%s', prog.version); + process.exit(0); + } else if (~process.argv.indexOf('-h') || ~process.argv.indexOf('--help')) { + console.log('%s', prog.usage()); + process.exit(0); + } + console.log('%s', prog.usage()); + process.exit(1); +} + +// if --no-color is passed +if (prog.opts && Object.hasOwnProperty.call(prog, 'color') && !prog.opts.color) { + log.disableColor(); +} + +log.info('it worked if it ends with', 'ok'); +log.verbose('cli', process.argv); +log.info('using', process.title + '@%s', prog.version); +log.info('using', 'node@%s | %s | %s', process.versions.node, process.platform, process.arch); + + +/** + * Change dir if -C/--directory was passed. + */ + +const dir = prog.opts.directory; +if (dir) { + const fs = require('fs'); + try { + const stat = fs.statSync(dir); + if (stat.isDirectory()) { + log.info('chdir', dir); + process.chdir(dir); + } else { + log.warn('chdir', dir + ' is not a directory'); + } + } catch (e) { + if (e.code === 'ENOENT') { + log.warn('chdir', dir + ' is not a directory'); + } else { + log.warn('chdir', 'error during chdir() "%s"', e.message); + } + } +} + +function run() { + const command = prog.todo.shift(); + if (!command) { + // done! + completed = true; + log.info('ok'); + return; + } + + // set binary.host when appropriate. host determines the s3 target bucket. + const target = prog.setBinaryHostProperty(command.name); + if (target && ['install', 'publish', 'unpublish', 'info'].indexOf(command.name) >= 0) { + log.info('using binary.host: ' + prog.package_json.binary.host); + } + + prog.commands[command.name](command.args, function(err) { + if (err) { + log.error(command.name + ' error'); + log.error('stack', err.stack); + errorMessage(); + log.error('not ok'); + console.log(err.message); + return process.exit(1); + } + const args_array = [].slice.call(arguments, 1); + if (args_array.length) { + console.log.apply(console, args_array); + } + // now run the next command in the queue + process.nextTick(run); + }); +} + +process.on('exit', (code) => { + if (!completed && !code) { + log.error('Completion callback never invoked!'); + errorMessage(); + process.exit(6); + } +}); + +process.on('uncaughtException', (err) => { + log.error('UNCAUGHT EXCEPTION'); + log.error('stack', err.stack); + errorMessage(); + process.exit(7); +}); + +function errorMessage() { + // copied from npm's lib/util/error-handler.js + const os = require('os'); + log.error('System', os.type() + ' ' + os.release()); + log.error('command', process.argv.map(JSON.stringify).join(' ')); + log.error('cwd', process.cwd()); + log.error('node -v', process.version); + log.error(process.title + ' -v', 'v' + prog.package.version); +} + +// start running the given commands! +run(); diff --git a/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js b/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js new file mode 100644 index 00000000..dc18e749 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js @@ -0,0 +1,309 @@ +'use strict'; + +/** + * Module exports. + */ + +module.exports = exports; + +/** + * Module dependencies. + */ + +// load mocking control function for accessing s3 via https. the function is a noop always returning +// false if not mocking. +exports.mockS3Http = require('./util/s3_setup').get_mockS3Http(); +exports.mockS3Http('on'); +const mocking = exports.mockS3Http('get'); + + +const fs = require('fs'); +const path = require('path'); +const nopt = require('nopt'); +const log = require('npmlog'); +log.disableProgress(); +const napi = require('./util/napi.js'); + +const EE = require('events').EventEmitter; +const inherits = require('util').inherits; +const cli_commands = [ + 'clean', + 'install', + 'reinstall', + 'build', + 'rebuild', + 'package', + 'testpackage', + 'publish', + 'unpublish', + 'info', + 'testbinary', + 'reveal', + 'configure' +]; +const aliases = {}; + +// differentiate node-pre-gyp's logs from npm's +log.heading = 'node-pre-gyp'; + +if (mocking) { + log.warn(`mocking s3 to ${process.env.node_pre_gyp_mock_s3}`); +} + +// this is a getter to avoid circular reference warnings with node v14. +Object.defineProperty(exports, 'find', { + get: function() { + return require('./pre-binding').find; + }, + enumerable: true +}); + +// in the following, "my_module" is using node-pre-gyp to +// prebuild and install pre-built binaries. "main_module" +// is using "my_module". +// +// "bin/node-pre-gyp" invokes Run() without a path. the +// expectation is that the working directory is the package +// root "my_module". this is true because in all cases npm is +// executing a script in the context of "my_module". +// +// "pre-binding.find()" is executed by "my_module" but in the +// context of "main_module". this is because "main_module" is +// executing and requires "my_module" which is then executing +// "pre-binding.find()" via "node-pre-gyp.find()", so the working +// directory is that of "main_module". +// +// that's why "find()" must pass the path to package.json. +// +function Run({ package_json_path = './package.json', argv }) { + this.package_json_path = package_json_path; + this.commands = {}; + + const self = this; + cli_commands.forEach((command) => { + self.commands[command] = function(argvx, callback) { + log.verbose('command', command, argvx); + return require('./' + command)(self, argvx, callback); + }; + }); + + this.parseArgv(argv); + + // this is set to true after the binary.host property was set to + // either staging_host or production_host. + this.binaryHostSet = false; +} +inherits(Run, EE); +exports.Run = Run; +const proto = Run.prototype; + +/** + * Export the contents of the package.json. + */ + +proto.package = require('../package.json'); + +/** + * nopt configuration definitions + */ + +proto.configDefs = { + help: Boolean, // everywhere + arch: String, // 'configure' + debug: Boolean, // 'build' + directory: String, // bin + proxy: String, // 'install' + loglevel: String // everywhere +}; + +/** + * nopt shorthands + */ + +proto.shorthands = { + release: '--no-debug', + C: '--directory', + debug: '--debug', + j: '--jobs', + silent: '--loglevel=silent', + silly: '--loglevel=silly', + verbose: '--loglevel=verbose' +}; + +/** + * expose the command aliases for the bin file to use. + */ + +proto.aliases = aliases; + +/** + * Parses the given argv array and sets the 'opts', 'argv', + * 'command', and 'package_json' properties. + */ + +proto.parseArgv = function parseOpts(argv) { + this.opts = nopt(this.configDefs, this.shorthands, argv); + this.argv = this.opts.argv.remain.slice(); + const commands = this.todo = []; + + // create a copy of the argv array with aliases mapped + argv = this.argv.map((arg) => { + // is this an alias? + if (arg in this.aliases) { + arg = this.aliases[arg]; + } + return arg; + }); + + // process the mapped args into "command" objects ("name" and "args" props) + argv.slice().forEach((arg) => { + if (arg in this.commands) { + const args = argv.splice(0, argv.indexOf(arg)); + argv.shift(); + if (commands.length > 0) { + commands[commands.length - 1].args = args; + } + commands.push({ name: arg, args: [] }); + } + }); + if (commands.length > 0) { + commands[commands.length - 1].args = argv.splice(0); + } + + + // if a directory was specified package.json is assumed to be relative + // to it. + let package_json_path = this.package_json_path; + if (this.opts.directory) { + package_json_path = path.join(this.opts.directory, package_json_path); + } + + this.package_json = JSON.parse(fs.readFileSync(package_json_path)); + + // expand commands entries for multiple napi builds + this.todo = napi.expand_commands(this.package_json, this.opts, commands); + + // support for inheriting config env variables from npm + const npm_config_prefix = 'npm_config_'; + Object.keys(process.env).forEach((name) => { + if (name.indexOf(npm_config_prefix) !== 0) return; + const val = process.env[name]; + if (name === npm_config_prefix + 'loglevel') { + log.level = val; + } else { + // add the user-defined options to the config + name = name.substring(npm_config_prefix.length); + // avoid npm argv clobber already present args + // which avoids problem of 'npm test' calling + // script that runs unique npm install commands + if (name === 'argv') { + if (this.opts.argv && + this.opts.argv.remain && + this.opts.argv.remain.length) { + // do nothing + } else { + this.opts[name] = val; + } + } else { + this.opts[name] = val; + } + } + }); + + if (this.opts.loglevel) { + log.level = this.opts.loglevel; + } + log.resume(); +}; + +/** + * allow the binary.host property to be set at execution time. + * + * for this to take effect requires all the following to be true. + * - binary is a property in package.json + * - binary.host is falsey + * - binary.staging_host is not empty + * - binary.production_host is not empty + * + * if any of the previous checks fail then the function returns an empty string + * and makes no changes to package.json's binary property. + * + * + * if command is "publish" then the default is set to "binary.staging_host" + * if command is not "publish" the the default is set to "binary.production_host" + * + * if the command-line option '--s3_host' is set to "staging" or "production" then + * "binary.host" is set to the specified "staging_host" or "production_host". if + * '--s3_host' is any other value an exception is thrown. + * + * if '--s3_host' is not present then "binary.host" is set to the default as above. + * + * this strategy was chosen so that any command other than "publish" or "unpublish" uses "production" + * as the default without requiring any command-line options but that "publish" and "unpublish" require + * '--s3_host production_host' to be specified in order to *really* publish (or unpublish). publishing + * to staging can be done freely without worrying about disturbing any production releases. + */ +proto.setBinaryHostProperty = function(command) { + if (this.binaryHostSet) { + return this.package_json.binary.host; + } + const p = this.package_json; + // don't set anything if host is present. it must be left blank to trigger this. + if (!p || !p.binary || p.binary.host) { + return ''; + } + // and both staging and production must be present. errors will be reported later. + if (!p.binary.staging_host || !p.binary.production_host) { + return ''; + } + let target = 'production_host'; + if (command === 'publish' || command === 'unpublish') { + target = 'staging_host'; + } + // the environment variable has priority over the default or the command line. if + // either the env var or the command line option are invalid throw an error. + const npg_s3_host = process.env.node_pre_gyp_s3_host; + if (npg_s3_host === 'staging' || npg_s3_host === 'production') { + target = `${npg_s3_host}_host`; + } else if (this.opts['s3_host'] === 'staging' || this.opts['s3_host'] === 'production') { + target = `${this.opts['s3_host']}_host`; + } else if (this.opts['s3_host'] || npg_s3_host) { + throw new Error(`invalid s3_host ${this.opts['s3_host'] || npg_s3_host}`); + } + + p.binary.host = p.binary[target]; + this.binaryHostSet = true; + + return p.binary.host; +}; + +/** + * Returns the usage instructions for node-pre-gyp. + */ + +proto.usage = function usage() { + const str = [ + '', + ' Usage: node-pre-gyp [options]', + '', + ' where is one of:', + cli_commands.map((c) => { + return ' - ' + c + ' - ' + require('./' + c).usage; + }).join('\n'), + '', + 'node-pre-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'), + 'node@' + process.versions.node + ].join('\n'); + return str; +}; + +/** + * Version number getter. + */ + +Object.defineProperty(proto, 'version', { + get: function() { + return this.package.version; + }, + enumerable: true +}); diff --git a/node_modules/@mapbox/node-pre-gyp/lib/package.js b/node_modules/@mapbox/node-pre-gyp/lib/package.js new file mode 100644 index 00000000..07349846 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/package.js @@ -0,0 +1,73 @@ +'use strict'; + +module.exports = exports = _package; + +exports.usage = 'Packs binary (and enclosing directory) into locally staged tarball'; + +const fs = require('fs'); +const path = require('path'); +const log = require('npmlog'); +const versioning = require('./util/versioning.js'); +const napi = require('./util/napi.js'); +const existsAsync = fs.exists || path.exists; +const makeDir = require('make-dir'); +const tar = require('tar'); + +function readdirSync(dir) { + let list = []; + const files = fs.readdirSync(dir); + + files.forEach((file) => { + const stats = fs.lstatSync(path.join(dir, file)); + if (stats.isDirectory()) { + list = list.concat(readdirSync(path.join(dir, file))); + } else { + list.push(path.join(dir, file)); + } + }); + return list; +} + +function _package(gyp, argv, callback) { + const package_json = gyp.package_json; + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + const from = opts.module_path; + const binary_module = path.join(from, opts.module_name + '.node'); + existsAsync(binary_module, (found) => { + if (!found) { + return callback(new Error('Cannot package because ' + binary_module + ' missing: run `node-pre-gyp rebuild` first')); + } + const tarball = opts.staged_tarball; + const filter_func = function(entry) { + const basename = path.basename(entry); + if (basename.length && basename[0] !== '.') { + console.log('packing ' + entry); + return true; + } else { + console.log('skipping ' + entry); + } + return false; + }; + makeDir(path.dirname(tarball)).then(() => { + let files = readdirSync(from); + const base = path.basename(from); + files = files.map((file) => { + return path.join(base, path.relative(from, file)); + }); + tar.create({ + portable: false, + gzip: true, + filter: filter_func, + file: tarball, + cwd: path.dirname(from) + }, files, (err2) => { + if (err2) console.error('[' + package_json.name + '] ' + err2.message); + else log.info('package', 'Binary staged at "' + tarball + '"'); + return callback(err2); + }); + }).catch((err) => { + return callback(err); + }); + }); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js b/node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js new file mode 100644 index 00000000..e110fe38 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js @@ -0,0 +1,34 @@ +'use strict'; + +const npg = require('..'); +const versioning = require('../lib/util/versioning.js'); +const napi = require('../lib/util/napi.js'); +const existsSync = require('fs').existsSync || require('path').existsSync; +const path = require('path'); + +module.exports = exports; + +exports.usage = 'Finds the require path for the node-pre-gyp installed module'; + +exports.validate = function(package_json, opts) { + versioning.validate_config(package_json, opts); +}; + +exports.find = function(package_json_path, opts) { + if (!existsSync(package_json_path)) { + throw new Error(package_json_path + 'does not exist'); + } + const prog = new npg.Run({ package_json_path, argv: process.argv }); + prog.setBinaryHostProperty(); + const package_json = prog.package_json; + + versioning.validate_config(package_json, opts); + let napi_build_version; + if (napi.get_napi_build_versions(package_json, opts)) { + napi_build_version = napi.get_best_napi_build_version(package_json, opts); + } + opts = opts || {}; + if (!opts.module_root) opts.module_root = path.dirname(package_json_path); + const meta = versioning.evaluate(package_json, opts, napi_build_version); + return meta.module; +}; diff --git a/node_modules/@mapbox/node-pre-gyp/lib/publish.js b/node_modules/@mapbox/node-pre-gyp/lib/publish.js new file mode 100644 index 00000000..8367b150 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/publish.js @@ -0,0 +1,81 @@ +'use strict'; + +module.exports = exports = publish; + +exports.usage = 'Publishes pre-built binary (requires aws-sdk)'; + +const fs = require('fs'); +const path = require('path'); +const log = require('npmlog'); +const versioning = require('./util/versioning.js'); +const napi = require('./util/napi.js'); +const s3_setup = require('./util/s3_setup.js'); +const existsAsync = fs.exists || path.exists; +const url = require('url'); + +function publish(gyp, argv, callback) { + const package_json = gyp.package_json; + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + const tarball = opts.staged_tarball; + existsAsync(tarball, (found) => { + if (!found) { + return callback(new Error('Cannot publish because ' + tarball + ' missing: run `node-pre-gyp package` first')); + } + + log.info('publish', 'Detecting s3 credentials'); + const config = {}; + s3_setup.detect(opts, config); + const s3 = s3_setup.get_s3(config); + + const key_name = url.resolve(config.prefix, opts.package_name); + const s3_opts = { + Bucket: config.bucket, + Key: key_name + }; + log.info('publish', 'Authenticating with s3'); + log.info('publish', config); + + log.info('publish', 'Checking for existing binary at ' + opts.hosted_path); + s3.headObject(s3_opts, (err, meta) => { + if (meta) log.info('publish', JSON.stringify(meta)); + if (err && err.code === 'NotFound') { + // we are safe to publish because + // the object does not already exist + log.info('publish', 'Preparing to put object'); + const s3_put_opts = { + ACL: 'public-read', + Body: fs.createReadStream(tarball), + Key: key_name, + Bucket: config.bucket + }; + log.info('publish', 'Putting object', s3_put_opts.ACL, s3_put_opts.Bucket, s3_put_opts.Key); + try { + s3.putObject(s3_put_opts, (err2, resp) => { + log.info('publish', 'returned from putting object'); + if (err2) { + log.info('publish', 's3 putObject error: "' + err2 + '"'); + return callback(err2); + } + if (resp) log.info('publish', 's3 putObject response: "' + JSON.stringify(resp) + '"'); + log.info('publish', 'successfully put object'); + console.log('[' + package_json.name + '] published to ' + opts.hosted_path); + return callback(); + }); + } catch (err3) { + log.info('publish', 's3 putObject error: "' + err3 + '"'); + return callback(err3); + } + } else if (err) { + log.info('publish', 's3 headObject error: "' + err + '"'); + return callback(err); + } else { + log.error('publish', 'Cannot publish over existing version'); + log.error('publish', "Update the 'version' field in package.json and try again"); + log.error('publish', 'If the previous version was published in error see:'); + log.error('publish', '\t node-pre-gyp unpublish'); + return callback(new Error('Failed publishing to ' + opts.hosted_path)); + } + }); + }); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/rebuild.js b/node_modules/@mapbox/node-pre-gyp/lib/rebuild.js new file mode 100644 index 00000000..31510fbd --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/rebuild.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = exports = rebuild; + +exports.usage = 'Runs "clean" and "build" at once'; + +const napi = require('./util/napi.js'); + +function rebuild(gyp, argv, callback) { + const package_json = gyp.package_json; + let commands = [ + { name: 'clean', args: [] }, + { name: 'build', args: ['rebuild'] } + ]; + commands = napi.expand_commands(package_json, gyp.opts, commands); + for (let i = commands.length; i !== 0; i--) { + gyp.todo.unshift(commands[i - 1]); + } + process.nextTick(callback); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/reinstall.js b/node_modules/@mapbox/node-pre-gyp/lib/reinstall.js new file mode 100644 index 00000000..a29b5c9b --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/reinstall.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = exports = rebuild; + +exports.usage = 'Runs "clean" and "install" at once'; + +const napi = require('./util/napi.js'); + +function rebuild(gyp, argv, callback) { + const package_json = gyp.package_json; + let installArgs = []; + const napi_build_version = napi.get_best_napi_build_version(package_json, gyp.opts); + if (napi_build_version != null) installArgs = [napi.get_command_arg(napi_build_version)]; + gyp.todo.unshift( + { name: 'clean', args: [] }, + { name: 'install', args: installArgs } + ); + process.nextTick(callback); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/reveal.js b/node_modules/@mapbox/node-pre-gyp/lib/reveal.js new file mode 100644 index 00000000..7255e5f0 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/reveal.js @@ -0,0 +1,32 @@ +'use strict'; + +module.exports = exports = reveal; + +exports.usage = 'Reveals data on the versioned binary'; + +const versioning = require('./util/versioning.js'); +const napi = require('./util/napi.js'); + +function unix_paths(key, val) { + return val && val.replace ? val.replace(/\\/g, '/') : val; +} + +function reveal(gyp, argv, callback) { + const package_json = gyp.package_json; + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + let hit = false; + // if a second arg is passed look to see + // if it is a known option + // console.log(JSON.stringify(gyp.opts,null,1)) + const remain = gyp.opts.argv.remain[gyp.opts.argv.remain.length - 1]; + if (remain && Object.hasOwnProperty.call(opts, remain)) { + console.log(opts[remain].replace(/\\/g, '/')); + hit = true; + } + // otherwise return all options as json + if (!hit) { + console.log(JSON.stringify(opts, unix_paths, 2)); + } + return callback(); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/testbinary.js b/node_modules/@mapbox/node-pre-gyp/lib/testbinary.js new file mode 100644 index 00000000..429cb130 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/testbinary.js @@ -0,0 +1,79 @@ +'use strict'; + +module.exports = exports = testbinary; + +exports.usage = 'Tests that the binary.node can be required'; + +const path = require('path'); +const log = require('npmlog'); +const cp = require('child_process'); +const versioning = require('./util/versioning.js'); +const napi = require('./util/napi.js'); + +function testbinary(gyp, argv, callback) { + const args = []; + const options = {}; + let shell_cmd = process.execPath; + const package_json = gyp.package_json; + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + // skip validation for runtimes we don't explicitly support (like electron) + if (opts.runtime && + opts.runtime !== 'node-webkit' && + opts.runtime !== 'node') { + return callback(); + } + const nw = (opts.runtime && opts.runtime === 'node-webkit'); + // ensure on windows that / are used for require path + const binary_module = opts.module.replace(/\\/g, '/'); + if ((process.arch !== opts.target_arch) || + (process.platform !== opts.target_platform)) { + let msg = 'skipping validation since host platform/arch ('; + msg += process.platform + '/' + process.arch + ')'; + msg += ' does not match target ('; + msg += opts.target_platform + '/' + opts.target_arch + ')'; + log.info('validate', msg); + return callback(); + } + if (nw) { + options.timeout = 5000; + if (process.platform === 'darwin') { + shell_cmd = 'node-webkit'; + } else if (process.platform === 'win32') { + shell_cmd = 'nw.exe'; + } else { + shell_cmd = 'nw'; + } + const modulePath = path.resolve(binary_module); + const appDir = path.join(__dirname, 'util', 'nw-pre-gyp'); + args.push(appDir); + args.push(modulePath); + log.info('validate', "Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'"); + cp.execFile(shell_cmd, args, options, (err, stdout, stderr) => { + // check for normal timeout for node-webkit + if (err) { + if (err.killed === true && err.signal && err.signal.indexOf('SIG') > -1) { + return callback(); + } + const stderrLog = stderr.toString(); + log.info('stderr', stderrLog); + if (/^\s*Xlib:\s*extension\s*"RANDR"\s*missing\s*on\s*display\s*":\d+\.\d+"\.\s*$/.test(stderrLog)) { + log.info('RANDR', 'stderr contains only RANDR error, ignored'); + return callback(); + } + return callback(err); + } + return callback(); + }); + return; + } + args.push('--eval'); + args.push("require('" + binary_module.replace(/'/g, '\'') + "')"); + log.info('validate', "Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'"); + cp.execFile(shell_cmd, args, options, (err, stdout, stderr) => { + if (err) { + return callback(err, { stdout: stdout, stderr: stderr }); + } + return callback(); + }); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/testpackage.js b/node_modules/@mapbox/node-pre-gyp/lib/testpackage.js new file mode 100644 index 00000000..fab1911b --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/testpackage.js @@ -0,0 +1,53 @@ +'use strict'; + +module.exports = exports = testpackage; + +exports.usage = 'Tests that the staged package is valid'; + +const fs = require('fs'); +const path = require('path'); +const log = require('npmlog'); +const existsAsync = fs.exists || path.exists; +const versioning = require('./util/versioning.js'); +const napi = require('./util/napi.js'); +const testbinary = require('./testbinary.js'); +const tar = require('tar'); +const makeDir = require('make-dir'); + +function testpackage(gyp, argv, callback) { + const package_json = gyp.package_json; + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + const tarball = opts.staged_tarball; + existsAsync(tarball, (found) => { + if (!found) { + return callback(new Error('Cannot test package because ' + tarball + ' missing: run `node-pre-gyp package` first')); + } + const to = opts.module_path; + function filter_func(entry) { + log.info('install', 'unpacking [' + entry.path + ']'); + } + + makeDir(to).then(() => { + tar.extract({ + file: tarball, + cwd: to, + strip: 1, + onentry: filter_func + }).then(after_extract, callback); + }).catch((err) => { + return callback(err); + }); + + function after_extract() { + testbinary(gyp, argv, (err) => { + if (err) { + return callback(err); + } else { + console.log('[' + package_json.name + '] Package appears valid'); + return callback(); + } + }); + } + }); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/unpublish.js b/node_modules/@mapbox/node-pre-gyp/lib/unpublish.js new file mode 100644 index 00000000..12c9f561 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/unpublish.js @@ -0,0 +1,41 @@ +'use strict'; + +module.exports = exports = unpublish; + +exports.usage = 'Unpublishes pre-built binary (requires aws-sdk)'; + +const log = require('npmlog'); +const versioning = require('./util/versioning.js'); +const napi = require('./util/napi.js'); +const s3_setup = require('./util/s3_setup.js'); +const url = require('url'); + +function unpublish(gyp, argv, callback) { + const package_json = gyp.package_json; + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + const config = {}; + s3_setup.detect(opts, config); + const s3 = s3_setup.get_s3(config); + const key_name = url.resolve(config.prefix, opts.package_name); + const s3_opts = { + Bucket: config.bucket, + Key: key_name + }; + s3.headObject(s3_opts, (err, meta) => { + if (err && err.code === 'NotFound') { + console.log('[' + package_json.name + '] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key); + return callback(); + } else if (err) { + return callback(err); + } else { + log.info('unpublish', JSON.stringify(meta)); + s3.deleteObject(s3_opts, (err2, resp) => { + if (err2) return callback(err2); + log.info(JSON.stringify(resp)); + console.log('[' + package_json.name + '] Success: removed https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key); + return callback(); + }); + } + }); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json b/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json new file mode 100644 index 00000000..7f529727 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json @@ -0,0 +1,2602 @@ +{ + "0.1.14": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.15": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.16": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.17": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.18": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.19": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.20": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.21": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.22": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.23": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.24": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.25": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.26": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.27": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.28": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.29": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.30": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.31": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.32": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.33": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.90": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.91": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.92": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.93": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.94": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.95": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.96": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.97": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.98": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.99": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.100": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.101": { + "node_abi": null, + "v8": "2.3" + }, + "0.1.102": { + "node_abi": null, + "v8": "2.3" + }, + "0.1.103": { + "node_abi": null, + "v8": "2.3" + }, + "0.1.104": { + "node_abi": null, + "v8": "2.3" + }, + "0.2.0": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.1": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.2": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.3": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.4": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.5": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.6": { + "node_abi": 1, + "v8": "2.3" + }, + "0.3.0": { + "node_abi": 1, + "v8": "2.5" + }, + "0.3.1": { + "node_abi": 1, + "v8": "2.5" + }, + "0.3.2": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.3": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.4": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.5": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.6": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.7": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.8": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.0": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.1": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.2": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.3": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.4": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.5": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.6": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.7": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.8": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.9": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.10": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.11": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.12": { + "node_abi": 1, + "v8": "3.1" + }, + "0.5.0": { + "node_abi": 1, + "v8": "3.1" + }, + "0.5.1": { + "node_abi": 1, + "v8": "3.4" + }, + "0.5.2": { + "node_abi": 1, + "v8": "3.4" + }, + "0.5.3": { + "node_abi": 1, + "v8": "3.4" + }, + "0.5.4": { + "node_abi": 1, + "v8": "3.5" + }, + "0.5.5": { + "node_abi": 1, + "v8": "3.5" + }, + "0.5.6": { + "node_abi": 1, + "v8": "3.6" + }, + "0.5.7": { + "node_abi": 1, + "v8": "3.6" + }, + "0.5.8": { + "node_abi": 1, + "v8": "3.6" + }, + "0.5.9": { + "node_abi": 1, + "v8": "3.6" + }, + "0.5.10": { + "node_abi": 1, + "v8": "3.7" + }, + "0.6.0": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.1": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.2": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.3": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.4": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.5": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.6": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.7": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.8": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.9": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.10": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.11": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.12": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.13": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.14": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.15": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.16": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.17": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.18": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.19": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.20": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.21": { + "node_abi": 1, + "v8": "3.6" + }, + "0.7.0": { + "node_abi": 1, + "v8": "3.8" + }, + "0.7.1": { + "node_abi": 1, + "v8": "3.8" + }, + "0.7.2": { + "node_abi": 1, + "v8": "3.8" + }, + "0.7.3": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.4": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.5": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.6": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.7": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.8": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.9": { + "node_abi": 1, + "v8": "3.11" + }, + "0.7.10": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.11": { + "node_abi": 1, + "v8": "3.11" + }, + "0.7.12": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.0": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.1": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.2": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.3": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.4": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.5": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.6": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.7": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.8": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.9": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.10": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.11": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.12": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.13": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.14": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.15": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.16": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.17": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.18": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.19": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.20": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.21": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.22": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.23": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.24": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.25": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.26": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.27": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.28": { + "node_abi": 1, + "v8": "3.11" + }, + "0.9.0": { + "node_abi": 1, + "v8": "3.11" + }, + "0.9.1": { + "node_abi": 10, + "v8": "3.11" + }, + "0.9.2": { + "node_abi": 10, + "v8": "3.11" + }, + "0.9.3": { + "node_abi": 10, + "v8": "3.13" + }, + "0.9.4": { + "node_abi": 10, + "v8": "3.13" + }, + "0.9.5": { + "node_abi": 10, + "v8": "3.13" + }, + "0.9.6": { + "node_abi": 10, + "v8": "3.15" + }, + "0.9.7": { + "node_abi": 10, + "v8": "3.15" + }, + "0.9.8": { + "node_abi": 10, + "v8": "3.15" + }, + "0.9.9": { + "node_abi": 11, + "v8": "3.15" + }, + "0.9.10": { + "node_abi": 11, + "v8": "3.15" + }, + "0.9.11": { + "node_abi": 11, + "v8": "3.14" + }, + "0.9.12": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.0": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.1": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.2": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.3": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.4": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.5": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.6": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.7": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.8": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.9": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.10": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.11": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.12": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.13": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.14": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.15": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.16": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.17": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.18": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.19": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.20": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.21": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.22": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.23": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.24": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.25": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.26": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.27": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.28": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.29": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.30": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.31": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.32": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.33": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.34": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.35": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.36": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.37": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.38": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.39": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.40": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.41": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.42": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.43": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.44": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.45": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.46": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.47": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.48": { + "node_abi": 11, + "v8": "3.14" + }, + "0.11.0": { + "node_abi": 12, + "v8": "3.17" + }, + "0.11.1": { + "node_abi": 12, + "v8": "3.18" + }, + "0.11.2": { + "node_abi": 12, + "v8": "3.19" + }, + "0.11.3": { + "node_abi": 12, + "v8": "3.19" + }, + "0.11.4": { + "node_abi": 12, + "v8": "3.20" + }, + "0.11.5": { + "node_abi": 12, + "v8": "3.20" + }, + "0.11.6": { + "node_abi": 12, + "v8": "3.20" + }, + "0.11.7": { + "node_abi": 12, + "v8": "3.20" + }, + "0.11.8": { + "node_abi": 13, + "v8": "3.21" + }, + "0.11.9": { + "node_abi": 13, + "v8": "3.22" + }, + "0.11.10": { + "node_abi": 13, + "v8": "3.22" + }, + "0.11.11": { + "node_abi": 14, + "v8": "3.22" + }, + "0.11.12": { + "node_abi": 14, + "v8": "3.22" + }, + "0.11.13": { + "node_abi": 14, + "v8": "3.25" + }, + "0.11.14": { + "node_abi": 14, + "v8": "3.26" + }, + "0.11.15": { + "node_abi": 14, + "v8": "3.28" + }, + "0.11.16": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.0": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.1": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.2": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.3": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.4": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.5": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.6": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.7": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.8": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.9": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.10": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.11": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.12": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.13": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.14": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.15": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.16": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.17": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.18": { + "node_abi": 14, + "v8": "3.28" + }, + "1.0.0": { + "node_abi": 42, + "v8": "3.31" + }, + "1.0.1": { + "node_abi": 42, + "v8": "3.31" + }, + "1.0.2": { + "node_abi": 42, + "v8": "3.31" + }, + "1.0.3": { + "node_abi": 42, + "v8": "4.1" + }, + "1.0.4": { + "node_abi": 42, + "v8": "4.1" + }, + "1.1.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.2.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.3.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.4.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.4.2": { + "node_abi": 43, + "v8": "4.1" + }, + "1.4.3": { + "node_abi": 43, + "v8": "4.1" + }, + "1.5.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.5.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.2": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.3": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.4": { + "node_abi": 43, + "v8": "4.1" + }, + "1.7.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.8.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.8.2": { + "node_abi": 43, + "v8": "4.1" + }, + "1.8.3": { + "node_abi": 43, + "v8": "4.1" + }, + "1.8.4": { + "node_abi": 43, + "v8": "4.1" + }, + "2.0.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.0.1": { + "node_abi": 44, + "v8": "4.2" + }, + "2.0.2": { + "node_abi": 44, + "v8": "4.2" + }, + "2.1.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.2.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.2.1": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.1": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.2": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.3": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.4": { + "node_abi": 44, + "v8": "4.2" + }, + "2.4.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.5.0": { + "node_abi": 44, + "v8": "4.2" + }, + "3.0.0": { + "node_abi": 45, + "v8": "4.4" + }, + "3.1.0": { + "node_abi": 45, + "v8": "4.4" + }, + "3.2.0": { + "node_abi": 45, + "v8": "4.4" + }, + "3.3.0": { + "node_abi": 45, + "v8": "4.4" + }, + "3.3.1": { + "node_abi": 45, + "v8": "4.4" + }, + "4.0.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.1.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.1.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.1.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.3": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.4": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.5": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.6": { + "node_abi": 46, + "v8": "4.5" + }, + "4.3.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.3.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.3.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.3": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.4": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.5": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.6": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.7": { + "node_abi": 46, + "v8": "4.5" + }, + "4.5.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.6.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.6.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.6.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.7.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.7.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.7.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.7.3": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.3": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.4": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.5": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.6": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.7": { + "node_abi": 46, + "v8": "4.5" + }, + "4.9.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.9.1": { + "node_abi": 46, + "v8": "4.5" + }, + "5.0.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.1.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.1.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.2.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.3.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.4.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.4.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.5.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.6.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.7.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.7.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.8.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.9.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.9.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.10.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.10.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.11.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.11.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.12.0": { + "node_abi": 47, + "v8": "4.6" + }, + "6.0.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.1.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.2.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.2.1": { + "node_abi": 48, + "v8": "5.0" + }, + "6.2.2": { + "node_abi": 48, + "v8": "5.0" + }, + "6.3.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.3.1": { + "node_abi": 48, + "v8": "5.0" + }, + "6.4.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.5.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.6.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.7.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.8.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.8.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.4": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.5": { + "node_abi": 48, + "v8": "5.1" + }, + "6.10.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.10.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.10.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.10.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.4": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.5": { + "node_abi": 48, + "v8": "5.1" + }, + "6.12.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.12.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.12.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.12.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.13.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.13.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.4": { + "node_abi": 48, + "v8": "5.1" + }, + "6.15.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.15.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.16.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.17.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.17.1": { + "node_abi": 48, + "v8": "5.1" + }, + "7.0.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.1.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.2.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.2.1": { + "node_abi": 51, + "v8": "5.4" + }, + "7.3.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.4.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.5.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.6.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.1": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.2": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.3": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.4": { + "node_abi": 51, + "v8": "5.5" + }, + "7.8.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.9.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.10.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.10.1": { + "node_abi": 51, + "v8": "5.5" + }, + "8.0.0": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.0": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.1": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.2": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.3": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.4": { + "node_abi": 57, + "v8": "5.8" + }, + "8.2.0": { + "node_abi": 57, + "v8": "5.8" + }, + "8.2.1": { + "node_abi": 57, + "v8": "5.8" + }, + "8.3.0": { + "node_abi": 57, + "v8": "6.0" + }, + "8.4.0": { + "node_abi": 57, + "v8": "6.0" + }, + "8.5.0": { + "node_abi": 57, + "v8": "6.0" + }, + "8.6.0": { + "node_abi": 57, + "v8": "6.0" + }, + "8.7.0": { + "node_abi": 57, + "v8": "6.1" + }, + "8.8.0": { + "node_abi": 57, + "v8": "6.1" + }, + "8.8.1": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.0": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.1": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.2": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.3": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.4": { + "node_abi": 57, + "v8": "6.1" + }, + "8.10.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.1": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.2": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.3": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.4": { + "node_abi": 57, + "v8": "6.2" + }, + "8.12.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.13.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.14.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.14.1": { + "node_abi": 57, + "v8": "6.2" + }, + "8.15.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.15.1": { + "node_abi": 57, + "v8": "6.2" + }, + "8.16.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.16.1": { + "node_abi": 57, + "v8": "6.2" + }, + "8.16.2": { + "node_abi": 57, + "v8": "6.2" + }, + "8.17.0": { + "node_abi": 57, + "v8": "6.2" + }, + "9.0.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.1.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.2.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.2.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.3.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.4.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.5.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.6.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.6.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.7.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.7.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.8.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.9.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.10.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.10.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.11.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.11.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.11.2": { + "node_abi": 59, + "v8": "6.2" + }, + "10.0.0": { + "node_abi": 64, + "v8": "6.6" + }, + "10.1.0": { + "node_abi": 64, + "v8": "6.6" + }, + "10.2.0": { + "node_abi": 64, + "v8": "6.6" + }, + "10.2.1": { + "node_abi": 64, + "v8": "6.6" + }, + "10.3.0": { + "node_abi": 64, + "v8": "6.6" + }, + "10.4.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.4.1": { + "node_abi": 64, + "v8": "6.7" + }, + "10.5.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.6.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.7.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.8.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.9.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.10.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.11.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.12.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.13.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.14.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.14.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.14.2": { + "node_abi": 64, + "v8": "6.8" + }, + "10.15.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.15.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.15.2": { + "node_abi": 64, + "v8": "6.8" + }, + "10.15.3": { + "node_abi": 64, + "v8": "6.8" + }, + "10.16.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.16.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.16.2": { + "node_abi": 64, + "v8": "6.8" + }, + "10.16.3": { + "node_abi": 64, + "v8": "6.8" + }, + "10.17.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.18.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.18.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.19.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.20.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.20.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.21.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.22.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.22.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.23.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.23.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.23.2": { + "node_abi": 64, + "v8": "6.8" + }, + "10.23.3": { + "node_abi": 64, + "v8": "6.8" + }, + "10.24.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.24.1": { + "node_abi": 64, + "v8": "6.8" + }, + "11.0.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.1.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.2.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.3.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.4.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.5.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.6.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.7.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.8.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.9.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.10.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.10.1": { + "node_abi": 67, + "v8": "7.0" + }, + "11.11.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.12.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.13.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.14.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.15.0": { + "node_abi": 67, + "v8": "7.0" + }, + "12.0.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.1.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.2.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.3.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.3.1": { + "node_abi": 72, + "v8": "7.4" + }, + "12.4.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.5.0": { + "node_abi": 72, + "v8": "7.5" + }, + "12.6.0": { + "node_abi": 72, + "v8": "7.5" + }, + "12.7.0": { + "node_abi": 72, + "v8": "7.5" + }, + "12.8.0": { + "node_abi": 72, + "v8": "7.5" + }, + "12.8.1": { + "node_abi": 72, + "v8": "7.5" + }, + "12.9.0": { + "node_abi": 72, + "v8": "7.6" + }, + "12.9.1": { + "node_abi": 72, + "v8": "7.6" + }, + "12.10.0": { + "node_abi": 72, + "v8": "7.6" + }, + "12.11.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.11.1": { + "node_abi": 72, + "v8": "7.7" + }, + "12.12.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.13.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.13.1": { + "node_abi": 72, + "v8": "7.7" + }, + "12.14.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.14.1": { + "node_abi": 72, + "v8": "7.7" + }, + "12.15.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.16.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.16.1": { + "node_abi": 72, + "v8": "7.8" + }, + "12.16.2": { + "node_abi": 72, + "v8": "7.8" + }, + "12.16.3": { + "node_abi": 72, + "v8": "7.8" + }, + "12.17.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.1": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.2": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.3": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.4": { + "node_abi": 72, + "v8": "7.8" + }, + "12.19.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.19.1": { + "node_abi": 72, + "v8": "7.8" + }, + "12.20.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.20.1": { + "node_abi": 72, + "v8": "7.8" + }, + "12.20.2": { + "node_abi": 72, + "v8": "7.8" + }, + "12.21.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.22.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.22.1": { + "node_abi": 72, + "v8": "7.8" + }, + "12.22.2": { + "node_abi": 72, + "v8": "7.8" + }, + "12.22.3": { + "node_abi": 72, + "v8": "7.8" + }, + "12.22.4": { + "node_abi": 72, + "v8": "7.8" + }, + "12.22.5": { + "node_abi": 72, + "v8": "7.8" + }, + "12.22.6": { + "node_abi": 72, + "v8": "7.8" + }, + "12.22.7": { + "node_abi": 72, + "v8": "7.8" + }, + "13.0.0": { + "node_abi": 79, + "v8": "7.8" + }, + "13.0.1": { + "node_abi": 79, + "v8": "7.8" + }, + "13.1.0": { + "node_abi": 79, + "v8": "7.8" + }, + "13.2.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.3.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.4.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.5.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.6.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.7.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.8.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.9.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.10.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.10.1": { + "node_abi": 79, + "v8": "7.9" + }, + "13.11.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.12.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.13.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.14.0": { + "node_abi": 79, + "v8": "7.9" + }, + "14.0.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.1.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.2.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.3.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.4.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.5.0": { + "node_abi": 83, + "v8": "8.3" + }, + "14.6.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.7.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.8.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.9.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.10.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.10.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.11.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.12.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.13.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.13.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.14.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.15.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.15.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.15.2": { + "node_abi": 83, + "v8": "8.4" + }, + "14.15.3": { + "node_abi": 83, + "v8": "8.4" + }, + "14.15.4": { + "node_abi": 83, + "v8": "8.4" + }, + "14.15.5": { + "node_abi": 83, + "v8": "8.4" + }, + "14.16.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.16.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.17.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.17.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.17.2": { + "node_abi": 83, + "v8": "8.4" + }, + "14.17.3": { + "node_abi": 83, + "v8": "8.4" + }, + "14.17.4": { + "node_abi": 83, + "v8": "8.4" + }, + "14.17.5": { + "node_abi": 83, + "v8": "8.4" + }, + "14.17.6": { + "node_abi": 83, + "v8": "8.4" + }, + "14.18.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.18.1": { + "node_abi": 83, + "v8": "8.4" + }, + "15.0.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.0.1": { + "node_abi": 88, + "v8": "8.6" + }, + "15.1.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.2.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.2.1": { + "node_abi": 88, + "v8": "8.6" + }, + "15.3.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.4.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.5.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.5.1": { + "node_abi": 88, + "v8": "8.6" + }, + "15.6.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.7.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.8.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.9.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.10.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.11.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.12.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.13.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.14.0": { + "node_abi": 88, + "v8": "8.6" + }, + "16.0.0": { + "node_abi": 93, + "v8": "9.0" + }, + "16.1.0": { + "node_abi": 93, + "v8": "9.0" + }, + "16.2.0": { + "node_abi": 93, + "v8": "9.0" + }, + "16.3.0": { + "node_abi": 93, + "v8": "9.0" + }, + "16.4.0": { + "node_abi": 93, + "v8": "9.1" + }, + "16.4.1": { + "node_abi": 93, + "v8": "9.1" + }, + "16.4.2": { + "node_abi": 93, + "v8": "9.1" + }, + "16.5.0": { + "node_abi": 93, + "v8": "9.1" + }, + "16.6.0": { + "node_abi": 93, + "v8": "9.2" + }, + "16.6.1": { + "node_abi": 93, + "v8": "9.2" + }, + "16.6.2": { + "node_abi": 93, + "v8": "9.2" + }, + "16.7.0": { + "node_abi": 93, + "v8": "9.2" + }, + "16.8.0": { + "node_abi": 93, + "v8": "9.2" + }, + "16.9.0": { + "node_abi": 93, + "v8": "9.3" + }, + "16.9.1": { + "node_abi": 93, + "v8": "9.3" + }, + "16.10.0": { + "node_abi": 93, + "v8": "9.3" + }, + "16.11.0": { + "node_abi": 93, + "v8": "9.4" + }, + "16.11.1": { + "node_abi": 93, + "v8": "9.4" + }, + "16.12.0": { + "node_abi": 93, + "v8": "9.4" + }, + "16.13.0": { + "node_abi": 93, + "v8": "9.4" + }, + "17.0.0": { + "node_abi": 102, + "v8": "9.5" + }, + "17.0.1": { + "node_abi": 102, + "v8": "9.5" + }, + "17.1.0": { + "node_abi": 102, + "v8": "9.5" + } +} \ No newline at end of file diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js b/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js new file mode 100644 index 00000000..956e5aa6 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js @@ -0,0 +1,93 @@ +'use strict'; + +module.exports = exports; + +const fs = require('fs'); +const path = require('path'); +const win = process.platform === 'win32'; +const existsSync = fs.existsSync || path.existsSync; +const cp = require('child_process'); + +// try to build up the complete path to node-gyp +/* priority: + - node-gyp on ENV:npm_config_node_gyp (https://github.com/npm/npm/pull/4887) + - node-gyp on NODE_PATH + - node-gyp inside npm on NODE_PATH (ignore on iojs) + - node-gyp inside npm beside node exe +*/ +function which_node_gyp() { + let node_gyp_bin; + if (process.env.npm_config_node_gyp) { + try { + node_gyp_bin = process.env.npm_config_node_gyp; + if (existsSync(node_gyp_bin)) { + return node_gyp_bin; + } + } catch (err) { + // do nothing + } + } + try { + const node_gyp_main = require.resolve('node-gyp'); // eslint-disable-line node/no-missing-require + node_gyp_bin = path.join(path.dirname( + path.dirname(node_gyp_main)), + 'bin/node-gyp.js'); + if (existsSync(node_gyp_bin)) { + return node_gyp_bin; + } + } catch (err) { + // do nothing + } + if (process.execPath.indexOf('iojs') === -1) { + try { + const npm_main = require.resolve('npm'); // eslint-disable-line node/no-missing-require + node_gyp_bin = path.join(path.dirname( + path.dirname(npm_main)), + 'node_modules/node-gyp/bin/node-gyp.js'); + if (existsSync(node_gyp_bin)) { + return node_gyp_bin; + } + } catch (err) { + // do nothing + } + } + const npm_base = path.join(path.dirname( + path.dirname(process.execPath)), + 'lib/node_modules/npm/'); + node_gyp_bin = path.join(npm_base, 'node_modules/node-gyp/bin/node-gyp.js'); + if (existsSync(node_gyp_bin)) { + return node_gyp_bin; + } +} + +module.exports.run_gyp = function(args, opts, callback) { + let shell_cmd = ''; + const cmd_args = []; + if (opts.runtime && opts.runtime === 'node-webkit') { + shell_cmd = 'nw-gyp'; + if (win) shell_cmd += '.cmd'; + } else { + const node_gyp_path = which_node_gyp(); + if (node_gyp_path) { + shell_cmd = process.execPath; + cmd_args.push(node_gyp_path); + } else { + shell_cmd = 'node-gyp'; + if (win) shell_cmd += '.cmd'; + } + } + const final_args = cmd_args.concat(args); + const cmd = cp.spawn(shell_cmd, final_args, { cwd: undefined, env: process.env, stdio: [0, 1, 2] }); + cmd.on('error', (err) => { + if (err) { + return callback(new Error("Failed to execute '" + shell_cmd + ' ' + final_args.join(' ') + "' (" + err + ')')); + } + callback(null, opts); + }); + cmd.on('close', (code) => { + if (code && code !== 0) { + return callback(new Error("Failed to execute '" + shell_cmd + ' ' + final_args.join(' ') + "' (" + code + ')')); + } + callback(null, opts); + }); +}; diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/handle_gyp_opts.js b/node_modules/@mapbox/node-pre-gyp/lib/util/handle_gyp_opts.js new file mode 100644 index 00000000..d702f785 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/util/handle_gyp_opts.js @@ -0,0 +1,102 @@ +'use strict'; + +module.exports = exports = handle_gyp_opts; + +const versioning = require('./versioning.js'); +const napi = require('./napi.js'); + +/* + +Here we gather node-pre-gyp generated options (from versioning) and pass them along to node-gyp. + +We massage the args and options slightly to account for differences in what commands mean between +node-pre-gyp and node-gyp (e.g. see the difference between "build" and "rebuild" below) + +Keep in mind: the values inside `argv` and `gyp.opts` below are different depending on whether +node-pre-gyp is called directory, or if it is called in a `run-script` phase of npm. + +We also try to preserve any command line options that might have been passed to npm or node-pre-gyp. +But this is fairly difficult without passing way to much through. For example `gyp.opts` contains all +the process.env and npm pushes a lot of variables into process.env which node-pre-gyp inherits. So we have +to be very selective about what we pass through. + +For example: + +`npm install --build-from-source` will give: + +argv == [ 'rebuild' ] +gyp.opts.argv == { remain: [ 'install' ], + cooked: [ 'install', '--fallback-to-build' ], + original: [ 'install', '--fallback-to-build' ] } + +`./bin/node-pre-gyp build` will give: + +argv == [] +gyp.opts.argv == { remain: [ 'build' ], + cooked: [ 'build' ], + original: [ '-C', 'test/app1', 'build' ] } + +*/ + +// select set of node-pre-gyp versioning info +// to share with node-gyp +const share_with_node_gyp = [ + 'module', + 'module_name', + 'module_path', + 'napi_version', + 'node_abi_napi', + 'napi_build_version', + 'node_napi_label' +]; + +function handle_gyp_opts(gyp, argv, callback) { + + // Collect node-pre-gyp specific variables to pass to node-gyp + const node_pre_gyp_options = []; + // generate custom node-pre-gyp versioning info + const napi_build_version = napi.get_napi_build_version_from_command_args(argv); + const opts = versioning.evaluate(gyp.package_json, gyp.opts, napi_build_version); + share_with_node_gyp.forEach((key) => { + const val = opts[key]; + if (val) { + node_pre_gyp_options.push('--' + key + '=' + val); + } else if (key === 'napi_build_version') { + node_pre_gyp_options.push('--' + key + '=0'); + } else { + if (key !== 'napi_version' && key !== 'node_abi_napi') + return callback(new Error('Option ' + key + ' required but not found by node-pre-gyp')); + } + }); + + // Collect options that follow the special -- which disables nopt parsing + const unparsed_options = []; + let double_hyphen_found = false; + gyp.opts.argv.original.forEach((opt) => { + if (double_hyphen_found) { + unparsed_options.push(opt); + } + if (opt === '--') { + double_hyphen_found = true; + } + }); + + // We try respect and pass through remaining command + // line options (like --foo=bar) to node-gyp + const cooked = gyp.opts.argv.cooked; + const node_gyp_options = []; + cooked.forEach((value) => { + if (value.length > 2 && value.slice(0, 2) === '--') { + const key = value.slice(2); + const val = cooked[cooked.indexOf(value) + 1]; + if (val && val.indexOf('--') === -1) { // handle '--foo=bar' or ['--foo','bar'] + node_gyp_options.push('--' + key + '=' + val); + } else { // pass through --foo + node_gyp_options.push(value); + } + } + }); + + const result = { 'opts': opts, 'gyp': node_gyp_options, 'pre': node_pre_gyp_options, 'unparsed': unparsed_options }; + return callback(null, result); +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/napi.js b/node_modules/@mapbox/node-pre-gyp/lib/util/napi.js new file mode 100644 index 00000000..5d14ad6d --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/util/napi.js @@ -0,0 +1,205 @@ +'use strict'; + +const fs = require('fs'); + +module.exports = exports; + +const versionArray = process.version + .substr(1) + .replace(/-.*$/, '') + .split('.') + .map((item) => { + return +item; + }); + +const napi_multiple_commands = [ + 'build', + 'clean', + 'configure', + 'package', + 'publish', + 'reveal', + 'testbinary', + 'testpackage', + 'unpublish' +]; + +const napi_build_version_tag = 'napi_build_version='; + +module.exports.get_napi_version = function() { + // returns the non-zero numeric napi version or undefined if napi is not supported. + // correctly supporting target requires an updated cross-walk + let version = process.versions.napi; // can be undefined + if (!version) { // this code should never need to be updated + if (versionArray[0] === 9 && versionArray[1] >= 3) version = 2; // 9.3.0+ + else if (versionArray[0] === 8) version = 1; // 8.0.0+ + } + return version; +}; + +module.exports.get_napi_version_as_string = function(target) { + // returns the napi version as a string or an empty string if napi is not supported. + const version = module.exports.get_napi_version(target); + return version ? '' + version : ''; +}; + +module.exports.validate_package_json = function(package_json, opts) { // throws Error + + const binary = package_json.binary; + const module_path_ok = pathOK(binary.module_path); + const remote_path_ok = pathOK(binary.remote_path); + const package_name_ok = pathOK(binary.package_name); + const napi_build_versions = module.exports.get_napi_build_versions(package_json, opts, true); + const napi_build_versions_raw = module.exports.get_napi_build_versions_raw(package_json); + + if (napi_build_versions) { + napi_build_versions.forEach((napi_build_version)=> { + if (!(parseInt(napi_build_version, 10) === napi_build_version && napi_build_version > 0)) { + throw new Error('All values specified in napi_versions must be positive integers.'); + } + }); + } + + if (napi_build_versions && (!module_path_ok || (!remote_path_ok && !package_name_ok))) { + throw new Error('When napi_versions is specified; module_path and either remote_path or ' + + "package_name must contain the substitution string '{napi_build_version}`."); + } + + if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions_raw) { + throw new Error("When the substitution string '{napi_build_version}` is specified in " + + 'module_path, remote_path, or package_name; napi_versions must also be specified.'); + } + + if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json, opts) && + module.exports.build_napi_only(package_json)) { + throw new Error( + 'The Node-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' + + 'This module supports Node-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' + + 'This Node instance cannot run this module.'); + } + + if (napi_build_versions_raw && !napi_build_versions && module.exports.build_napi_only(package_json)) { + throw new Error( + 'The Node-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' + + 'This module supports Node-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' + + 'This Node instance cannot run this module.'); + } + +}; + +function pathOK(path) { + return path && (path.indexOf('{napi_build_version}') !== -1 || path.indexOf('{node_napi_label}') !== -1); +} + +module.exports.expand_commands = function(package_json, opts, commands) { + const expanded_commands = []; + const napi_build_versions = module.exports.get_napi_build_versions(package_json, opts); + commands.forEach((command)=> { + if (napi_build_versions && command.name === 'install') { + const napi_build_version = module.exports.get_best_napi_build_version(package_json, opts); + const args = napi_build_version ? [napi_build_version_tag + napi_build_version] : []; + expanded_commands.push({ name: command.name, args: args }); + } else if (napi_build_versions && napi_multiple_commands.indexOf(command.name) !== -1) { + napi_build_versions.forEach((napi_build_version)=> { + const args = command.args.slice(); + args.push(napi_build_version_tag + napi_build_version); + expanded_commands.push({ name: command.name, args: args }); + }); + } else { + expanded_commands.push(command); + } + }); + return expanded_commands; +}; + +module.exports.get_napi_build_versions = function(package_json, opts, warnings) { // opts may be undefined + const log = require('npmlog'); + let napi_build_versions = []; + const supported_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined); + // remove duplicates, verify each napi version can actaully be built + if (package_json.binary && package_json.binary.napi_versions) { + package_json.binary.napi_versions.forEach((napi_version) => { + const duplicated = napi_build_versions.indexOf(napi_version) !== -1; + if (!duplicated && supported_napi_version && napi_version <= supported_napi_version) { + napi_build_versions.push(napi_version); + } else if (warnings && !duplicated && supported_napi_version) { + log.info('This Node instance does not support builds for Node-API version', napi_version); + } + }); + } + if (opts && opts['build-latest-napi-version-only']) { + let latest_version = 0; + napi_build_versions.forEach((napi_version) => { + if (napi_version > latest_version) latest_version = napi_version; + }); + napi_build_versions = latest_version ? [latest_version] : []; + } + return napi_build_versions.length ? napi_build_versions : undefined; +}; + +module.exports.get_napi_build_versions_raw = function(package_json) { + const napi_build_versions = []; + // remove duplicates + if (package_json.binary && package_json.binary.napi_versions) { + package_json.binary.napi_versions.forEach((napi_version) => { + if (napi_build_versions.indexOf(napi_version) === -1) { + napi_build_versions.push(napi_version); + } + }); + } + return napi_build_versions.length ? napi_build_versions : undefined; +}; + +module.exports.get_command_arg = function(napi_build_version) { + return napi_build_version_tag + napi_build_version; +}; + +module.exports.get_napi_build_version_from_command_args = function(command_args) { + for (let i = 0; i < command_args.length; i++) { + const arg = command_args[i]; + if (arg.indexOf(napi_build_version_tag) === 0) { + return parseInt(arg.substr(napi_build_version_tag.length), 10); + } + } + return undefined; +}; + +module.exports.swap_build_dir_out = function(napi_build_version) { + if (napi_build_version) { + const rm = require('rimraf'); + rm.sync(module.exports.get_build_dir(napi_build_version)); + fs.renameSync('build', module.exports.get_build_dir(napi_build_version)); + } +}; + +module.exports.swap_build_dir_in = function(napi_build_version) { + if (napi_build_version) { + const rm = require('rimraf'); + rm.sync('build'); + fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build'); + } +}; + +module.exports.get_build_dir = function(napi_build_version) { + return 'build-tmp-napi-v' + napi_build_version; +}; + +module.exports.get_best_napi_build_version = function(package_json, opts) { + let best_napi_build_version = 0; + const napi_build_versions = module.exports.get_napi_build_versions(package_json, opts); + if (napi_build_versions) { + const our_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined); + napi_build_versions.forEach((napi_build_version)=> { + if (napi_build_version > best_napi_build_version && + napi_build_version <= our_napi_version) { + best_napi_build_version = napi_build_version; + } + }); + } + return best_napi_build_version === 0 ? undefined : best_napi_build_version; +}; + +module.exports.build_napi_only = function(package_json) { + return package_json.binary && package_json.binary.package_name && + package_json.binary.package_name.indexOf('{node_napi_label}') === -1; +}; diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html b/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html new file mode 100644 index 00000000..244466c4 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html @@ -0,0 +1,26 @@ + + + + +Node-webkit-based module test + + + +

Node-webkit-based module test

+ + diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/package.json b/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/package.json new file mode 100644 index 00000000..71d03f82 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/package.json @@ -0,0 +1,9 @@ +{ +"main": "index.html", +"name": "nw-pre-gyp-module-test", +"description": "Node-webkit-based module test.", +"version": "0.0.1", +"window": { + "show": false +} +} diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js b/node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js new file mode 100644 index 00000000..6b1b1a6c --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js @@ -0,0 +1,163 @@ +'use strict'; + +module.exports = exports; + +const url = require('url'); +const fs = require('fs'); +const path = require('path'); + +module.exports.detect = function(opts, config) { + const to = opts.hosted_path; + const uri = url.parse(to); + config.prefix = (!uri.pathname || uri.pathname === '/') ? '' : uri.pathname.replace('/', ''); + if (opts.bucket && opts.region) { + config.bucket = opts.bucket; + config.region = opts.region; + config.endpoint = opts.host; + config.s3ForcePathStyle = opts.s3ForcePathStyle; + } else { + const parts = uri.hostname.split('.s3'); + const bucket = parts[0]; + if (!bucket) { + return; + } + if (!config.bucket) { + config.bucket = bucket; + } + if (!config.region) { + const region = parts[1].slice(1).split('.')[0]; + if (region === 'amazonaws') { + config.region = 'us-east-1'; + } else { + config.region = region; + } + } + } +}; + +module.exports.get_s3 = function(config) { + + if (process.env.node_pre_gyp_mock_s3) { + // here we're mocking. node_pre_gyp_mock_s3 is the scratch directory + // for the mock code. + const AWSMock = require('mock-aws-s3'); + const os = require('os'); + + AWSMock.config.basePath = `${os.tmpdir()}/mock`; + + const s3 = AWSMock.S3(); + + // wrapped callback maker. fs calls return code of ENOENT but AWS.S3 returns + // NotFound. + const wcb = (fn) => (err, ...args) => { + if (err && err.code === 'ENOENT') { + err.code = 'NotFound'; + } + return fn(err, ...args); + }; + + return { + listObjects(params, callback) { + return s3.listObjects(params, wcb(callback)); + }, + headObject(params, callback) { + return s3.headObject(params, wcb(callback)); + }, + deleteObject(params, callback) { + return s3.deleteObject(params, wcb(callback)); + }, + putObject(params, callback) { + return s3.putObject(params, wcb(callback)); + } + }; + } + + // if not mocking then setup real s3. + const AWS = require('aws-sdk'); + + AWS.config.update(config); + const s3 = new AWS.S3(); + + // need to change if additional options need to be specified. + return { + listObjects(params, callback) { + return s3.listObjects(params, callback); + }, + headObject(params, callback) { + return s3.headObject(params, callback); + }, + deleteObject(params, callback) { + return s3.deleteObject(params, callback); + }, + putObject(params, callback) { + return s3.putObject(params, callback); + } + }; + + + +}; + +// +// function to get the mocking control function. if not mocking it returns a no-op. +// +// if mocking it sets up the mock http interceptors that use the mocked s3 file system +// to fulfill reponses. +module.exports.get_mockS3Http = function() { + let mock_s3 = false; + if (!process.env.node_pre_gyp_mock_s3) { + return () => mock_s3; + } + + const nock = require('nock'); + // the bucket used for testing, as addressed by https. + const host = 'https://mapbox-node-pre-gyp-public-testing-bucket.s3.us-east-1.amazonaws.com'; + const mockDir = process.env.node_pre_gyp_mock_s3 + '/mapbox-node-pre-gyp-public-testing-bucket'; + + // function to setup interceptors. they are "turned off" by setting mock_s3 to false. + const mock_http = () => { + // eslint-disable-next-line no-unused-vars + function get(uri, requestBody) { + const filepath = path.join(mockDir, uri.replace('%2B', '+')); + + try { + fs.accessSync(filepath, fs.constants.R_OK); + } catch (e) { + return [404, 'not found\n']; + } + + // the mock s3 functions just write to disk, so just read from it. + return [200, fs.createReadStream(filepath)]; + } + + // eslint-disable-next-line no-unused-vars + return nock(host) + .persist() + .get(() => mock_s3) // mock any uri for s3 when true + .reply(get); + }; + + // setup interceptors. they check the mock_s3 flag to determine whether to intercept. + mock_http(nock, host, mockDir); + // function to turn matching all requests to s3 on/off. + const mockS3Http = (action) => { + const previous = mock_s3; + if (action === 'off') { + mock_s3 = false; + } else if (action === 'on') { + mock_s3 = true; + } else if (action !== 'get') { + throw new Error(`illegal action for setMockHttp ${action}`); + } + return previous; + }; + + // call mockS3Http with the argument + // - 'on' - turn it on + // - 'off' - turn it off (used by fetch.test.js so it doesn't interfere with redirects) + // - 'get' - return true or false for 'on' or 'off' + return mockS3Http; +}; + + + diff --git a/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js b/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js new file mode 100644 index 00000000..825cfa1d --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js @@ -0,0 +1,335 @@ +'use strict'; + +module.exports = exports; + +const path = require('path'); +const semver = require('semver'); +const url = require('url'); +const detect_libc = require('detect-libc'); +const napi = require('./napi.js'); + +let abi_crosswalk; + +// This is used for unit testing to provide a fake +// ABI crosswalk that emulates one that is not updated +// for the current version +if (process.env.NODE_PRE_GYP_ABI_CROSSWALK) { + abi_crosswalk = require(process.env.NODE_PRE_GYP_ABI_CROSSWALK); +} else { + abi_crosswalk = require('./abi_crosswalk.json'); +} + +const major_versions = {}; +Object.keys(abi_crosswalk).forEach((v) => { + const major = v.split('.')[0]; + if (!major_versions[major]) { + major_versions[major] = v; + } +}); + +function get_electron_abi(runtime, target_version) { + if (!runtime) { + throw new Error('get_electron_abi requires valid runtime arg'); + } + if (typeof target_version === 'undefined') { + // erroneous CLI call + throw new Error('Empty target version is not supported if electron is the target.'); + } + // Electron guarantees that patch version update won't break native modules. + const sem_ver = semver.parse(target_version); + return runtime + '-v' + sem_ver.major + '.' + sem_ver.minor; +} +module.exports.get_electron_abi = get_electron_abi; + +function get_node_webkit_abi(runtime, target_version) { + if (!runtime) { + throw new Error('get_node_webkit_abi requires valid runtime arg'); + } + if (typeof target_version === 'undefined') { + // erroneous CLI call + throw new Error('Empty target version is not supported if node-webkit is the target.'); + } + return runtime + '-v' + target_version; +} +module.exports.get_node_webkit_abi = get_node_webkit_abi; + +function get_node_abi(runtime, versions) { + if (!runtime) { + throw new Error('get_node_abi requires valid runtime arg'); + } + if (!versions) { + throw new Error('get_node_abi requires valid process.versions object'); + } + const sem_ver = semver.parse(versions.node); + if (sem_ver.major === 0 && sem_ver.minor % 2) { // odd series + // https://github.com/mapbox/node-pre-gyp/issues/124 + return runtime + '-v' + versions.node; + } else { + // process.versions.modules added in >= v0.10.4 and v0.11.7 + // https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e + return versions.modules ? runtime + '-v' + (+versions.modules) : + 'v8-' + versions.v8.split('.').slice(0, 2).join('.'); + } +} +module.exports.get_node_abi = get_node_abi; + +function get_runtime_abi(runtime, target_version) { + if (!runtime) { + throw new Error('get_runtime_abi requires valid runtime arg'); + } + if (runtime === 'node-webkit') { + return get_node_webkit_abi(runtime, target_version || process.versions['node-webkit']); + } else if (runtime === 'electron') { + return get_electron_abi(runtime, target_version || process.versions.electron); + } else { + if (runtime !== 'node') { + throw new Error("Unknown Runtime: '" + runtime + "'"); + } + if (!target_version) { + return get_node_abi(runtime, process.versions); + } else { + let cross_obj; + // abi_crosswalk generated with ./scripts/abi_crosswalk.js + if (abi_crosswalk[target_version]) { + cross_obj = abi_crosswalk[target_version]; + } else { + const target_parts = target_version.split('.').map((i) => { return +i; }); + if (target_parts.length !== 3) { // parse failed + throw new Error('Unknown target version: ' + target_version); + } + /* + The below code tries to infer the last known ABI compatible version + that we have recorded in the abi_crosswalk.json when an exact match + is not possible. The reasons for this to exist are complicated: + + - We support passing --target to be able to allow developers to package binaries for versions of node + that are not the same one as they are running. This might also be used in combination with the + --target_arch or --target_platform flags to also package binaries for alternative platforms + - When --target is passed we can't therefore determine the ABI (process.versions.modules) from the node + version that is running in memory + - So, therefore node-pre-gyp keeps an "ABI crosswalk" (lib/util/abi_crosswalk.json) to be able to look + this info up for all versions + - But we cannot easily predict what the future ABI will be for released versions + - And node-pre-gyp needs to be a `bundledDependency` in apps that depend on it in order to work correctly + by being fully available at install time. + - So, the speed of node releases and the bundled nature of node-pre-gyp mean that a new node-pre-gyp release + need to happen for every node.js/io.js/node-webkit/nw.js/atom-shell/etc release that might come online if + you want the `--target` flag to keep working for the latest version + - Which is impractical ^^ + - Hence the below code guesses about future ABI to make the need to update node-pre-gyp less demanding. + + In practice then you can have a dependency of your app like `node-sqlite3` that bundles a `node-pre-gyp` that + only knows about node v0.10.33 in the `abi_crosswalk.json` but target node v0.10.34 (which is assumed to be + ABI compatible with v0.10.33). + + TODO: use semver module instead of custom version parsing + */ + const major = target_parts[0]; + let minor = target_parts[1]; + let patch = target_parts[2]; + // io.js: yeah if node.js ever releases 1.x this will break + // but that is unlikely to happen: https://github.com/iojs/io.js/pull/253#issuecomment-69432616 + if (major === 1) { + // look for last release that is the same major version + // e.g. we assume io.js 1.x is ABI compatible with >= 1.0.0 + while (true) { + if (minor > 0) --minor; + if (patch > 0) --patch; + const new_iojs_target = '' + major + '.' + minor + '.' + patch; + if (abi_crosswalk[new_iojs_target]) { + cross_obj = abi_crosswalk[new_iojs_target]; + console.log('Warning: node-pre-gyp could not find exact match for ' + target_version); + console.log('Warning: but node-pre-gyp successfully choose ' + new_iojs_target + ' as ABI compatible target'); + break; + } + if (minor === 0 && patch === 0) { + break; + } + } + } else if (major >= 2) { + // look for last release that is the same major version + if (major_versions[major]) { + cross_obj = abi_crosswalk[major_versions[major]]; + console.log('Warning: node-pre-gyp could not find exact match for ' + target_version); + console.log('Warning: but node-pre-gyp successfully choose ' + major_versions[major] + ' as ABI compatible target'); + } + } else if (major === 0) { // node.js + if (target_parts[1] % 2 === 0) { // for stable/even node.js series + // look for the last release that is the same minor release + // e.g. we assume node 0.10.x is ABI compatible with >= 0.10.0 + while (--patch > 0) { + const new_node_target = '' + major + '.' + minor + '.' + patch; + if (abi_crosswalk[new_node_target]) { + cross_obj = abi_crosswalk[new_node_target]; + console.log('Warning: node-pre-gyp could not find exact match for ' + target_version); + console.log('Warning: but node-pre-gyp successfully choose ' + new_node_target + ' as ABI compatible target'); + break; + } + } + } + } + } + if (!cross_obj) { + throw new Error('Unsupported target version: ' + target_version); + } + // emulate process.versions + const versions_obj = { + node: target_version, + v8: cross_obj.v8 + '.0', + // abi_crosswalk uses 1 for node versions lacking process.versions.modules + // process.versions.modules added in >= v0.10.4 and v0.11.7 + modules: cross_obj.node_abi > 1 ? cross_obj.node_abi : undefined + }; + return get_node_abi(runtime, versions_obj); + } + } +} +module.exports.get_runtime_abi = get_runtime_abi; + +const required_parameters = [ + 'module_name', + 'module_path', + 'host' +]; + +function validate_config(package_json, opts) { + const msg = package_json.name + ' package.json is not node-pre-gyp ready:\n'; + const missing = []; + if (!package_json.main) { + missing.push('main'); + } + if (!package_json.version) { + missing.push('version'); + } + if (!package_json.name) { + missing.push('name'); + } + if (!package_json.binary) { + missing.push('binary'); + } + const o = package_json.binary; + if (o) { + required_parameters.forEach((p) => { + if (!o[p] || typeof o[p] !== 'string') { + missing.push('binary.' + p); + } + }); + } + + if (missing.length >= 1) { + throw new Error(msg + 'package.json must declare these properties: \n' + missing.join('\n')); + } + if (o) { + // enforce https over http + const protocol = url.parse(o.host).protocol; + if (protocol === 'http:') { + throw new Error("'host' protocol (" + protocol + ") is invalid - only 'https:' is accepted"); + } + } + napi.validate_package_json(package_json, opts); +} + +module.exports.validate_config = validate_config; + +function eval_template(template, opts) { + Object.keys(opts).forEach((key) => { + const pattern = '{' + key + '}'; + while (template.indexOf(pattern) > -1) { + template = template.replace(pattern, opts[key]); + } + }); + return template; +} + +// url.resolve needs single trailing slash +// to behave correctly, otherwise a double slash +// may end up in the url which breaks requests +// and a lacking slash may not lead to proper joining +function fix_slashes(pathname) { + if (pathname.slice(-1) !== '/') { + return pathname + '/'; + } + return pathname; +} + +// remove double slashes +// note: path.normalize will not work because +// it will convert forward to back slashes +function drop_double_slashes(pathname) { + return pathname.replace(/\/\//g, '/'); +} + +function get_process_runtime(versions) { + let runtime = 'node'; + if (versions['node-webkit']) { + runtime = 'node-webkit'; + } else if (versions.electron) { + runtime = 'electron'; + } + return runtime; +} + +module.exports.get_process_runtime = get_process_runtime; + +const default_package_name = '{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz'; +const default_remote_path = ''; + +module.exports.evaluate = function(package_json, options, napi_build_version) { + options = options || {}; + validate_config(package_json, options); // options is a suitable substitute for opts in this case + const v = package_json.version; + const module_version = semver.parse(v); + const runtime = options.runtime || get_process_runtime(process.versions); + const opts = { + name: package_json.name, + configuration: options.debug ? 'Debug' : 'Release', + debug: options.debug, + module_name: package_json.binary.module_name, + version: module_version.version, + prerelease: module_version.prerelease.length ? module_version.prerelease.join('.') : '', + build: module_version.build.length ? module_version.build.join('.') : '', + major: module_version.major, + minor: module_version.minor, + patch: module_version.patch, + runtime: runtime, + node_abi: get_runtime_abi(runtime, options.target), + node_abi_napi: napi.get_napi_version(options.target) ? 'napi' : get_runtime_abi(runtime, options.target), + napi_version: napi.get_napi_version(options.target), // non-zero numeric, undefined if unsupported + napi_build_version: napi_build_version || '', + node_napi_label: napi_build_version ? 'napi-v' + napi_build_version : get_runtime_abi(runtime, options.target), + target: options.target || '', + platform: options.target_platform || process.platform, + target_platform: options.target_platform || process.platform, + arch: options.target_arch || process.arch, + target_arch: options.target_arch || process.arch, + libc: options.target_libc || detect_libc.familySync() || 'unknown', + module_main: package_json.main, + toolset: options.toolset || '', // address https://github.com/mapbox/node-pre-gyp/issues/119 + bucket: package_json.binary.bucket, + region: package_json.binary.region, + s3ForcePathStyle: package_json.binary.s3ForcePathStyle || false + }; + // support host mirror with npm config `--{module_name}_binary_host_mirror` + // e.g.: https://github.com/node-inspector/v8-profiler/blob/master/package.json#L25 + // > npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/ + const validModuleName = opts.module_name.replace('-', '_'); + const host = process.env['npm_config_' + validModuleName + '_binary_host_mirror'] || package_json.binary.host; + opts.host = fix_slashes(eval_template(host, opts)); + opts.module_path = eval_template(package_json.binary.module_path, opts); + // now we resolve the module_path to ensure it is absolute so that binding.gyp variables work predictably + if (options.module_root) { + // resolve relative to known module root: works for pre-binding require + opts.module_path = path.join(options.module_root, opts.module_path); + } else { + // resolve relative to current working directory: works for node-pre-gyp commands + opts.module_path = path.resolve(opts.module_path); + } + opts.module = path.join(opts.module_path, opts.module_name + '.node'); + opts.remote_path = package_json.binary.remote_path ? drop_double_slashes(fix_slashes(eval_template(package_json.binary.remote_path, opts))) : default_remote_path; + const package_name = package_json.binary.package_name ? package_json.binary.package_name : default_package_name; + opts.package_name = eval_template(package_name, opts); + opts.staged_tarball = path.join('build/stage', opts.remote_path, opts.package_name); + opts.hosted_path = url.resolve(opts.host, opts.remote_path); + opts.hosted_tarball = url.resolve(opts.hosted_path, opts.package_name); + return opts; +}; diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt b/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt new file mode 100644 index 00000000..0808130f --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@" +else + exec node "$basedir/../nopt/bin/nopt.js" "$@" +fi diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt.cmd b/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt.cmd new file mode 100644 index 00000000..a7f38b3d --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nopt\bin\nopt.js" %* diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt.ps1 b/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt.ps1 new file mode 100644 index 00000000..9d6ba56f --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/.bin/nopt.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args + } else { + & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../nopt/bin/nopt.js" $args + } else { + & "node$exe" "$basedir/../nopt/bin/nopt.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/CHANGELOG.md b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/CHANGELOG.md new file mode 100644 index 00000000..82a09fb4 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/CHANGELOG.md @@ -0,0 +1,58 @@ +### v4.0.1 (2016-12-14) + +#### WHOOPS + +* [`fb9b1ce`](https://github.com/npm/nopt/commit/fb9b1ce57b3c69b4f7819015be87719204f77ef6) + Merged so many patches at once that the code fencing + ([@adius](https://github.com/adius)) added got broken. Sorry, + ([@adius](https://github.com/adius))! + ([@othiym23](https://github.com/othiym23)) + +### v4.0.0 (2016-12-13) + +#### BREAKING CHANGES + +* [`651d447`](https://github.com/npm/nopt/commit/651d4473946096d341a480bbe56793de3fc706aa) + When parsing String-typed arguments, if the next value is `""`, don't simply + swallow it. ([@samjonester](https://github.com/samjonester)) + +#### PERFORMANCE TWEAKS + +* [`3370ce8`](https://github.com/npm/nopt/commit/3370ce87a7618ba228883861db84ddbcdff252a9) + Simplify initialization. ([@elidoran](https://github.com/elidoran)) +* [`356e58e`](https://github.com/npm/nopt/commit/356e58e3b3b431a4b1af7fd7bdee44c2c0526a09) + Store `Array.isArray(types[arg])` for reuse. + ([@elidoran](https://github.com/elidoran)) +* [`0d95e90`](https://github.com/npm/nopt/commit/0d95e90515844f266015b56d2c80b94e5d14a07e) + Interpret single-item type arrays as a single type. + ([@samjonester](https://github.com/samjonester)) +* [`07c69d3`](https://github.com/npm/nopt/commit/07c69d38b5186450941fbb505550becb78a0e925) + Simplify key-value extraction. ([@elidoran](https://github.com/elidoran)) +* [`39b6e5c`](https://github.com/npm/nopt/commit/39b6e5c65ac47f60cd43a1fbeece5cd4c834c254) + Only call `Date.parse(val)` once. ([@elidoran](https://github.com/elidoran)) +* [`934943d`](https://github.com/npm/nopt/commit/934943dffecb55123a2b15959fe2a359319a5dbd) + Use `osenv.home()` to find a user's home directory instead of assuming it's + always `$HOME`. ([@othiym23](https://github.com/othiym23)) + +#### TEST & CI IMPROVEMENTS + +* [`326ffff`](https://github.com/npm/nopt/commit/326ffff7f78a00bcd316adecf69075f8a8093619) + Fix `/tmp` test to work on Windows. + ([@elidoran](https://github.com/elidoran)) +* [`c89d31a`](https://github.com/npm/nopt/commit/c89d31a49d14f2238bc6672db08da697bbc57f1b) + Only run Windows tests on Windows, only run Unix tests on a Unix. + ([@elidoran](https://github.com/elidoran)) +* [`affd3d1`](https://github.com/npm/nopt/commit/affd3d1d0addffa93006397b2013b18447339366) + Refresh Travis to run the tests against the currently-supported batch of npm + versions. ([@helio](https://github.com/helio)-frota) +* [`55f9449`](https://github.com/npm/nopt/commit/55f94497d163ed4d16dd55fd6c4fb95cc440e66d) + `tap@8.0.1` ([@othiym23](https://github.com/othiym23)) + +#### DOC TWEAKS + +* [`5271229`](https://github.com/npm/nopt/commit/5271229ee7c810217dd51616c086f5d9ab224581) + Use JavaScript code block for syntax highlighting. + ([@adius](https://github.com/adius)) +* [`c0d156f`](https://github.com/npm/nopt/commit/c0d156f229f9994c5dfcec4a8886eceff7a07682) + The code sample in the README had `many2: [ oneThing ]`, and now it has + `many2: [ two, things ]`. ([@silkentrance](https://github.com/silkentrance)) diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/LICENSE b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/README.md b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/README.md new file mode 100644 index 00000000..a99531c0 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/README.md @@ -0,0 +1,213 @@ +If you want to write an option parser, and have it be good, there are +two ways to do it. The Right Way, and the Wrong Way. + +The Wrong Way is to sit down and write an option parser. We've all done +that. + +The Right Way is to write some complex configurable program with so many +options that you hit the limit of your frustration just trying to +manage them all, and defer it with duct-tape solutions until you see +exactly to the core of the problem, and finally snap and write an +awesome option parser. + +If you want to write an option parser, don't write an option parser. +Write a package manager, or a source control system, or a service +restarter, or an operating system. You probably won't end up with a +good one of those, but if you don't give up, and you are relentless and +diligent enough in your procrastination, you may just end up with a very +nice option parser. + +## USAGE + +```javascript +// my-program.js +var nopt = require("nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + , "many1" : [String, Array] + , "many2" : [path, Array] + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag"] + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) +console.log(parsed) +``` + +This would give you support for any of the following: + +```console +$ node my-program.js --foo "blerp" --no-flag +{ "foo" : "blerp", "flag" : false } + +$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag +{ bar: 7, foo: "Mr. Hand", flag: true } + +$ node my-program.js --foo "blerp" -f -----p +{ foo: "blerp", flag: true, pick: true } + +$ node my-program.js -fp --foofoo +{ foo: "Mr. Foo", flag: true, pick: true } + +$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. +{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } + +$ node my-program.js --blatzk -fp # unknown opts are ok. +{ blatzk: true, flag: true, pick: true } + +$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value +{ blatzk: 1000, flag: true, pick: true } + +$ node my-program.js --no-blatzk -fp # unless they start with "no-" +{ blatzk: false, flag: true, pick: true } + +$ node my-program.js --baz b/a/z # known paths are resolved. +{ baz: "/Users/isaacs/b/a/z" } + +# if Array is one of the types, then it can take many +# values, and will always be an array. The other types provided +# specify what types are allowed in the list. + +$ node my-program.js --many1 5 --many1 null --many1 foo +{ many1: ["5", "null", "foo"] } + +$ node my-program.js --many2 foo --many2 bar +{ many2: ["/path/to/foo", "path/to/bar"] } +``` + +Read the tests at the bottom of `lib/nopt.js` for more examples of +what this puppy can do. + +## Types + +The following types are supported, and defined on `nopt.typeDefs` + +* String: A normal string. No parsing is done. +* path: A file system path. Gets resolved against cwd if not absolute. +* url: A url. If it doesn't parse, it isn't accepted. +* Number: Must be numeric. +* Date: Must parse as a date. If it does, and `Date` is one of the options, + then it will return a Date object, not a string. +* Boolean: Must be either `true` or `false`. If an option is a boolean, + then it does not need a value, and its presence will imply `true` as + the value. To negate boolean flags, do `--no-whatever` or `--whatever + false` +* NaN: Means that the option is strictly not allowed. Any value will + fail. +* Stream: An object matching the "Stream" class in node. Valuable + for use when validating programmatically. (npm uses this to let you + supply any WriteStream on the `outfd` and `logfd` config options.) +* Array: If `Array` is specified as one of the types, then the value + will be parsed as a list of options. This means that multiple values + can be specified, and that the value will always be an array. + +If a type is an array of values not on this list, then those are +considered valid values. For instance, in the example above, the +`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, +and any other value will be rejected. + +When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be +interpreted as their JavaScript equivalents. + +You can also mix types and values, or multiple types, in a list. For +instance `{ blah: [Number, null] }` would allow a value to be set to +either a Number or null. When types are ordered, this implies a +preference, and the first type that can be used to properly interpret +the value will be used. + +To define a new type, add it to `nopt.typeDefs`. Each item in that +hash is an object with a `type` member and a `validate` method. The +`type` member is an object that matches what goes in the type list. The +`validate` method is a function that gets called with `validate(data, +key, val)`. Validate methods should assign `data[key]` to the valid +value of `val` if it can be handled properly, or return boolean +`false` if it cannot. + +You can also call `nopt.clean(data, types, typeDefs)` to clean up a +config object and remove its invalid properties. + +## Error Handling + +By default, nopt outputs a warning to standard error when invalid values for +known options are found. You can change this behavior by assigning a method +to `nopt.invalidHandler`. This method will be called with +the offending `nopt.invalidHandler(key, val, types)`. + +If no `nopt.invalidHandler` is assigned, then it will console.error +its whining. If it is assigned to boolean `false` then the warning is +suppressed. + +## Abbreviations + +Yes, they are supported. If you define options like this: + +```javascript +{ "foolhardyelephants" : Boolean +, "pileofmonkeys" : Boolean } +``` + +Then this will work: + +```bash +node program.js --foolhar --pil +node program.js --no-f --pileofmon +# etc. +``` + +## Shorthands + +Shorthands are a hash of shorter option names to a snippet of args that +they expand to. + +If multiple one-character shorthands are all combined, and the +combination does not unambiguously match any other option or shorthand, +then they will be broken up into their constituent parts. For example: + +```json +{ "s" : ["--loglevel", "silent"] +, "g" : "--global" +, "f" : "--force" +, "p" : "--parseable" +, "l" : "--long" +} +``` + +```bash +npm ls -sgflp +# just like doing this: +npm ls --loglevel silent --global --force --long --parseable +``` + +## The Rest of the args + +The config object returned by nopt is given a special member called +`argv`, which is an object with the following fields: + +* `remain`: The remaining args after all the parsing has occurred. +* `original`: The args as they originally appeared. +* `cooked`: The args after flags and shorthands are expanded. + +## Slicing + +Node programs are called with more or less the exact argv as it appears +in C land, after the v8 and node-specific options have been plucked off. +As such, `argv[0]` is always `node` and `argv[1]` is always the +JavaScript program being run. + +That's usually not very useful to you. So they're sliced off by +default. If you want them, then you can pass in `0` as the last +argument, or any other number that you'd like to slice off the start of +the list. diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/bin/nopt.js b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/bin/nopt.js new file mode 100644 index 00000000..3232d4c5 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/bin/nopt.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node +var nopt = require("../lib/nopt") + , path = require("path") + , types = { num: Number + , bool: Boolean + , help: Boolean + , list: Array + , "num-list": [Number, Array] + , "str-list": [String, Array] + , "bool-list": [Boolean, Array] + , str: String + , clear: Boolean + , config: Boolean + , length: Number + , file: path + } + , shorthands = { s: [ "--str", "astring" ] + , b: [ "--bool" ] + , nb: [ "--no-bool" ] + , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] + , "?": ["--help"] + , h: ["--help"] + , H: ["--help"] + , n: [ "--num", "125" ] + , c: ["--config"] + , l: ["--length"] + , f: ["--file"] + } + , parsed = nopt( types + , shorthands + , process.argv + , 2 ) + +console.log("parsed", parsed) + +if (parsed.help) { + console.log("") + console.log("nopt cli tester") + console.log("") + console.log("types") + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (type) { return type.name })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log("") + console.log("shorthands") + console.log(shorthands) +} diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/lib/nopt.js b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/lib/nopt.js new file mode 100644 index 00000000..ecfa5da9 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/lib/nopt.js @@ -0,0 +1,441 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("abbrev") + , os = require("os") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , argv = { + remain: [], + cooked: args, + original: args.slice(0) + } + + parse(args, data, argv.remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = argv + Object.defineProperty(data.argv, 'toString', { value: function () { + return this.original.map(JSON.stringify).join(" ") + }, enumerable: false }) + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Array] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + // if we allow Array specifically, then an empty array is how we + // express 'no value here', not null. Allow it. + if (!val.length && type.indexOf(Array) === -1) { + debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array)) + delete data[k] + } + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + if (val === true) return false + if (val === null) return true + + val = String(val) + + var isWin = process.platform === 'win32' + , homePattern = isWin ? /^~(\/|\\)/ : /^~\// + , home = os.homedir() + + if (home && val.match(homePattern)) { + data[k] = path.resolve(home, val.substr(2)) + } else { + data[k] = path.resolve(val) + } + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + var s = Date.parse(val) + debug("validate Date %j %j %j", k, val, s) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && + ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + var hadEq = false + if (arg.charAt(0) === "-" && arg.length > 1) { + var at = arg.indexOf('=') + if (at > -1) { + hadEq = true + var v = arg.substr(at + 1) + arg = arg.substr(0, at) + args.splice(i, 1, arg, v) + } + + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = null + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var argType = types[arg] + var isTypeArray = Array.isArray(argType) + if (isTypeArray && argType.length === 1) { + isTypeArray = false + argType = argType[0] + } + + var isArray = argType === Array || + isTypeArray && argType.indexOf(Array) !== -1 + + // allow unknown things to be arrays if specified multiple times. + if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { + if (!Array.isArray(data[arg])) + data[arg] = [data[arg]] + isArray = true + } + + var val + , la = args[i + 1] + + var isBool = typeof no === 'boolean' || + argType === Boolean || + isTypeArray && argType.indexOf(Boolean) !== -1 || + (typeof argType === 'undefined' && !hadEq) || + (la === "false" && + (argType === null || + isTypeArray && ~argType.indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (isTypeArray && la) { + if (~argType.indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~argType.indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~argType.indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (argType === String) { + if (la === undefined) { + la = "" + } else if (la.match(/^-{1,2}[^-]+/)) { + la = "" + i -- + } + } + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + + // if it's an exact known option, then don't go any further + if (abbrevs[arg] === arg) + return null + + // if it's an exact known shortopt, same deal + if (shorthands[arg]) { + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] + } + + // first check to see if this arg is a set of single-char shorthands + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { + l[r] = true + return l + }, {}) + shorthands.___singles = singles + debug('shorthand singles', singles) + } + + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + + + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg + if (abbrevs[arg] && !shorthands[arg]) + return null + + // if it's an abbr for a shorthand, then use that + if (shortAbbr[arg]) + arg = shortAbbr[arg] + + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] +} diff --git a/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/package.json b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/package.json new file mode 100644 index 00000000..12ed02da --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/node_modules/nopt/package.json @@ -0,0 +1,34 @@ +{ + "name": "nopt", + "version": "5.0.0", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "main": "lib/nopt.js", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/nopt.git" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "license": "ISC", + "dependencies": { + "abbrev": "1" + }, + "devDependencies": { + "tap": "^14.10.6" + }, + "files": [ + "bin", + "lib" + ], + "engines": { + "node": ">=6" + } +} diff --git a/node_modules/@mapbox/node-pre-gyp/package.json b/node_modules/@mapbox/node-pre-gyp/package.json new file mode 100644 index 00000000..5e1d6fd5 --- /dev/null +++ b/node_modules/@mapbox/node-pre-gyp/package.json @@ -0,0 +1,62 @@ +{ + "name": "@mapbox/node-pre-gyp", + "description": "Node.js native addon binary install tool", + "version": "1.0.11", + "keywords": [ + "native", + "addon", + "module", + "c", + "c++", + "bindings", + "binary" + ], + "license": "BSD-3-Clause", + "author": "Dane Springmeyer ", + "repository": { + "type": "git", + "url": "git://github.com/mapbox/node-pre-gyp.git" + }, + "bin": "./bin/node-pre-gyp", + "main": "./lib/node-pre-gyp.js", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "devDependencies": { + "@mapbox/cloudfriend": "^5.1.0", + "@mapbox/eslint-config-mapbox": "^3.0.0", + "aws-sdk": "^2.1087.0", + "codecov": "^3.8.3", + "eslint": "^7.32.0", + "eslint-plugin-node": "^11.1.0", + "mock-aws-s3": "^4.0.2", + "nock": "^12.0.3", + "node-addon-api": "^4.3.0", + "nyc": "^15.1.0", + "tape": "^5.5.2", + "tar-fs": "^2.1.1" + }, + "nyc": { + "all": true, + "skip-full": false, + "exclude": [ + "test/**" + ] + }, + "scripts": { + "coverage": "nyc --all --include index.js --include lib/ npm test", + "upload-coverage": "nyc report --reporter json && codecov --clear --flags=unit --file=./coverage/coverage-final.json", + "lint": "eslint bin/node-pre-gyp lib/*js lib/util/*js test/*js scripts/*js", + "fix": "npm run lint -- --fix", + "update-crosswalk": "node scripts/abi_crosswalk.js", + "test": "tape test/*test.js" + } +} diff --git a/node_modules/agent-base/README.md b/node_modules/agent-base/README.md new file mode 100644 index 00000000..256f1f32 --- /dev/null +++ b/node_modules/agent-base/README.md @@ -0,0 +1,145 @@ +agent-base +========== +### Turn a function into an [`http.Agent`][http.Agent] instance +[![Build Status](https://github.com/TooTallNate/node-agent-base/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI) + +This module provides an `http.Agent` generator. That is, you pass it an async +callback function, and it returns a new `http.Agent` instance that will invoke the +given callback function when sending outbound HTTP requests. + +#### Some subclasses: + +Here's some more interesting uses of `agent-base`. +Send a pull request to list yours! + + * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints + * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints + * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS + * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install agent-base +``` + + +Example +------- + +Here's a minimal example that creates a new `net.Socket` connection to the server +for every HTTP request (i.e. the equivalent of `agent: false` option): + +```js +var net = require('net'); +var tls = require('tls'); +var url = require('url'); +var http = require('http'); +var agent = require('agent-base'); + +var endpoint = 'http://nodejs.org/api/'; +var parsed = url.parse(endpoint); + +// This is the important part! +parsed.agent = agent(function (req, opts) { + var socket; + // `secureEndpoint` is true when using the https module + if (opts.secureEndpoint) { + socket = tls.connect(opts); + } else { + socket = net.connect(opts); + } + return socket; +}); + +// Everything else works just like normal... +http.get(parsed, function (res) { + console.log('"response" event!', res.headers); + res.pipe(process.stdout); +}); +``` + +Returning a Promise or using an `async` function is also supported: + +```js +agent(async function (req, opts) { + await sleep(1000); + // etc… +}); +``` + +Return another `http.Agent` instance to "pass through" the responsibility +for that HTTP request to that agent: + +```js +agent(function (req, opts) { + return opts.secureEndpoint ? https.globalAgent : http.globalAgent; +}); +``` + + +API +--- + +## Agent(Function callback[, Object options]) → [http.Agent][] + +Creates a base `http.Agent` that will execute the callback function `callback` +for every HTTP request that it is used as the `agent` for. The callback function +is responsible for creating a `stream.Duplex` instance of some kind that will be +used as the underlying socket in the HTTP request. + +The `options` object accepts the following properties: + + * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional). + +The callback function should have the following signature: + +### callback(http.ClientRequest req, Object options, Function cb) → undefined + +The ClientRequest `req` can be accessed to read request headers and +and the path, etc. The `options` object contains the options passed +to the `http.request()`/`https.request()` function call, and is formatted +to be directly passed to `net.connect()`/`tls.connect()`, or however +else you want a Socket to be created. Pass the created socket to +the callback function `cb` once created, and the HTTP request will +continue to proceed. + +If the `https` module is used to invoke the HTTP request, then the +`secureEndpoint` property on `options` _will be set to `true`_. + + +License +------- + +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent +[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent +[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent +[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent +[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent diff --git a/node_modules/agent-base/dist/src/index.d.ts b/node_modules/agent-base/dist/src/index.d.ts new file mode 100644 index 00000000..bc4ab744 --- /dev/null +++ b/node_modules/agent-base/dist/src/index.d.ts @@ -0,0 +1,78 @@ +/// +import net from 'net'; +import http from 'http'; +import https from 'https'; +import { Duplex } from 'stream'; +import { EventEmitter } from 'events'; +declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; +declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent; +declare namespace createAgent { + interface ClientRequest extends http.ClientRequest { + _last?: boolean; + _hadError?: boolean; + method: string; + } + interface AgentRequestOptions { + host?: string; + path?: string; + port: number; + } + interface HttpRequestOptions extends AgentRequestOptions, Omit { + secureEndpoint: false; + } + interface HttpsRequestOptions extends AgentRequestOptions, Omit { + secureEndpoint: true; + } + type RequestOptions = HttpRequestOptions | HttpsRequestOptions; + type AgentLike = Pick | http.Agent; + type AgentCallbackReturn = Duplex | AgentLike; + type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void; + type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise; + type AgentCallback = typeof Agent.prototype.callback; + type AgentOptions = { + timeout?: number; + }; + /** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + * + * @param {Function} callback + * @api public + */ + class Agent extends EventEmitter { + timeout: number | null; + maxFreeSockets: number; + maxTotalSockets: number; + maxSockets: number; + sockets: { + [key: string]: net.Socket[]; + }; + freeSockets: { + [key: string]: net.Socket[]; + }; + requests: { + [key: string]: http.IncomingMessage[]; + }; + options: https.AgentOptions; + private promisifiedCallback?; + private explicitDefaultPort?; + private explicitProtocol?; + constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions); + get defaultPort(): number; + set defaultPort(v: number); + get protocol(): string; + set protocol(v: string); + callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void; + callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise; + /** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ + addRequest(req: ClientRequest, _opts: RequestOptions): void; + freeSocket(socket: net.Socket, opts: AgentOptions): void; + destroy(): void; + } +} +export = createAgent; diff --git a/node_modules/agent-base/dist/src/index.js b/node_modules/agent-base/dist/src/index.js new file mode 100644 index 00000000..bfd9e220 --- /dev/null +++ b/node_modules/agent-base/dist/src/index.js @@ -0,0 +1,203 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const events_1 = require("events"); +const debug_1 = __importDefault(require("debug")); +const promisify_1 = __importDefault(require("./promisify")); +const debug = debug_1.default('agent-base'); +function isAgent(v) { + return Boolean(v) && typeof v.addRequest === 'function'; +} +function isSecureEndpoint() { + const { stack } = new Error(); + if (typeof stack !== 'string') + return false; + return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); +} +function createAgent(callback, opts) { + return new createAgent.Agent(callback, opts); +} +(function (createAgent) { + /** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + * + * @param {Function} callback + * @api public + */ + class Agent extends events_1.EventEmitter { + constructor(callback, _opts) { + super(); + let opts = _opts; + if (typeof callback === 'function') { + this.callback = callback; + } + else if (callback) { + opts = callback; + } + // Timeout for the socket to be returned from the callback + this.timeout = null; + if (opts && typeof opts.timeout === 'number') { + this.timeout = opts.timeout; + } + // These aren't actually used by `agent-base`, but are required + // for the TypeScript definition files in `@types/node` :/ + this.maxFreeSockets = 1; + this.maxSockets = 1; + this.maxTotalSockets = Infinity; + this.sockets = {}; + this.freeSockets = {}; + this.requests = {}; + this.options = {}; + } + get defaultPort() { + if (typeof this.explicitDefaultPort === 'number') { + return this.explicitDefaultPort; + } + return isSecureEndpoint() ? 443 : 80; + } + set defaultPort(v) { + this.explicitDefaultPort = v; + } + get protocol() { + if (typeof this.explicitProtocol === 'string') { + return this.explicitProtocol; + } + return isSecureEndpoint() ? 'https:' : 'http:'; + } + set protocol(v) { + this.explicitProtocol = v; + } + callback(req, opts, fn) { + throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); + } + /** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ + addRequest(req, _opts) { + const opts = Object.assign({}, _opts); + if (typeof opts.secureEndpoint !== 'boolean') { + opts.secureEndpoint = isSecureEndpoint(); + } + if (opts.host == null) { + opts.host = 'localhost'; + } + if (opts.port == null) { + opts.port = opts.secureEndpoint ? 443 : 80; + } + if (opts.protocol == null) { + opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; + } + if (opts.host && opts.path) { + // If both a `host` and `path` are specified then it's most + // likely the result of a `url.parse()` call... we need to + // remove the `path` portion so that `net.connect()` doesn't + // attempt to open that as a unix socket file. + delete opts.path; + } + delete opts.agent; + delete opts.hostname; + delete opts._defaultAgent; + delete opts.defaultPort; + delete opts.createConnection; + // Hint to use "Connection: close" + // XXX: non-documented `http` module API :( + req._last = true; + req.shouldKeepAlive = false; + let timedOut = false; + let timeoutId = null; + const timeoutMs = opts.timeout || this.timeout; + const onerror = (err) => { + if (req._hadError) + return; + req.emit('error', err); + // For Safety. Some additional errors might fire later on + // and we need to make sure we don't double-fire the error event. + req._hadError = true; + }; + const ontimeout = () => { + timeoutId = null; + timedOut = true; + const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); + err.code = 'ETIMEOUT'; + onerror(err); + }; + const callbackError = (err) => { + if (timedOut) + return; + if (timeoutId !== null) { + clearTimeout(timeoutId); + timeoutId = null; + } + onerror(err); + }; + const onsocket = (socket) => { + if (timedOut) + return; + if (timeoutId != null) { + clearTimeout(timeoutId); + timeoutId = null; + } + if (isAgent(socket)) { + // `socket` is actually an `http.Agent` instance, so + // relinquish responsibility for this `req` to the Agent + // from here on + debug('Callback returned another Agent instance %o', socket.constructor.name); + socket.addRequest(req, opts); + return; + } + if (socket) { + socket.once('free', () => { + this.freeSocket(socket, opts); + }); + req.onSocket(socket); + return; + } + const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); + onerror(err); + }; + if (typeof this.callback !== 'function') { + onerror(new Error('`callback` is not defined')); + return; + } + if (!this.promisifiedCallback) { + if (this.callback.length >= 3) { + debug('Converting legacy callback function to promise'); + this.promisifiedCallback = promisify_1.default(this.callback); + } + else { + this.promisifiedCallback = this.callback; + } + } + if (typeof timeoutMs === 'number' && timeoutMs > 0) { + timeoutId = setTimeout(ontimeout, timeoutMs); + } + if ('port' in opts && typeof opts.port !== 'number') { + opts.port = Number(opts.port); + } + try { + debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); + Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); + } + catch (err) { + Promise.reject(err).catch(callbackError); + } + } + freeSocket(socket, opts) { + debug('Freeing socket %o %o', socket.constructor.name, opts); + socket.destroy(); + } + destroy() { + debug('Destroying agent %o', this.constructor.name); + } + } + createAgent.Agent = Agent; + // So that `instanceof` works correctly + createAgent.prototype = createAgent.Agent.prototype; +})(createAgent || (createAgent = {})); +module.exports = createAgent; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/agent-base/dist/src/index.js.map b/node_modules/agent-base/dist/src/index.js.map new file mode 100644 index 00000000..bd118ab6 --- /dev/null +++ b/node_modules/agent-base/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAIA,mCAAsC;AACtC,kDAAgC;AAChC,4DAAoC;AAEpC,MAAM,KAAK,GAAG,eAAW,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,OAAO,CAAC,CAAM;IACtB,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAED,SAAS,gBAAgB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAK,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAOD,SAAS,WAAW,CACnB,QAA+D,EAC/D,IAA+B;IAE/B,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,WAAU,WAAW;IAmDpB;;;;;;OAMG;IACH,MAAa,KAAM,SAAQ,qBAAY;QAmBtC,YACC,QAA+D,EAC/D,KAAgC;YAEhC,KAAK,EAAE,CAAC;YAER,IAAI,IAAI,GAAG,KAAK,CAAC;YACjB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;gBACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;aACzB;iBAAM,IAAI,QAAQ,EAAE;gBACpB,IAAI,GAAG,QAAQ,CAAC;aAChB;YAED,0DAA0D;YAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;aAC5B;YAED,+DAA+D;YAC/D,0DAA0D;YAC1D,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;YACpB,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;YAChC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;YAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QACnB,CAAC;QAED,IAAI,WAAW;YACd,IAAI,OAAO,IAAI,CAAC,mBAAmB,KAAK,QAAQ,EAAE;gBACjD,OAAO,IAAI,CAAC,mBAAmB,CAAC;aAChC;YACD,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC;QAED,IAAI,WAAW,CAAC,CAAS;YACxB,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,QAAQ;YACX,IAAI,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ,EAAE;gBAC9C,OAAO,IAAI,CAAC,gBAAgB,CAAC;aAC7B;YACD,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;QAChD,CAAC;QAED,IAAI,QAAQ,CAAC,CAAS;YACrB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC3B,CAAC;QAaD,QAAQ,CACP,GAA8B,EAC9B,IAA8B,EAC9B,EAAsC;YAKtC,MAAM,IAAI,KAAK,CACd,yFAAyF,CACzF,CAAC;QACH,CAAC;QAED;;;;;WAKG;QACH,UAAU,CAAC,GAAkB,EAAE,KAAqB;YACnD,MAAM,IAAI,qBAAwB,KAAK,CAAE,CAAC;YAE1C,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE;gBAC7C,IAAI,CAAC,cAAc,GAAG,gBAAgB,EAAE,CAAC;aACzC;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;aACxB;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3C;YAED,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE;gBAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;aACzD;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;gBAC3B,2DAA2D;gBAC3D,0DAA0D;gBAC1D,4DAA4D;gBAC5D,8CAA8C;gBAC9C,OAAO,IAAI,CAAC,IAAI,CAAC;aACjB;YAED,OAAO,IAAI,CAAC,KAAK,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;YACrB,OAAO,IAAI,CAAC,aAAa,CAAC;YAC1B,OAAO,IAAI,CAAC,WAAW,CAAC;YACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAE7B,kCAAkC;YAClC,2CAA2C;YAC3C,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC;YACjB,GAAG,CAAC,eAAe,GAAG,KAAK,CAAC;YAE5B,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,IAAI,SAAS,GAAyC,IAAI,CAAC;YAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;YAE/C,MAAM,OAAO,GAAG,CAAC,GAA0B,EAAE,EAAE;gBAC9C,IAAI,GAAG,CAAC,SAAS;oBAAE,OAAO;gBAC1B,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACvB,yDAAyD;gBACzD,iEAAiE;gBACjE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,CAAC,CAAC;YAEF,MAAM,SAAS,GAAG,GAAG,EAAE;gBACtB,SAAS,GAAG,IAAI,CAAC;gBACjB,QAAQ,GAAG,IAAI,CAAC;gBAChB,MAAM,GAAG,GAA0B,IAAI,KAAK,CAC3C,sDAAsD,SAAS,IAAI,CACnE,CAAC;gBACF,GAAG,CAAC,IAAI,GAAG,UAAU,CAAC;gBACtB,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,MAAM,aAAa,GAAG,CAAC,GAA0B,EAAE,EAAE;gBACpD,IAAI,QAAQ;oBAAE,OAAO;gBACrB,IAAI,SAAS,KAAK,IAAI,EAAE;oBACvB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBACD,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,MAAM,QAAQ,GAAG,CAAC,MAA2B,EAAE,EAAE;gBAChD,IAAI,QAAQ;oBAAE,OAAO;gBACrB,IAAI,SAAS,IAAI,IAAI,EAAE;oBACtB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBAED,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;oBACpB,oDAAoD;oBACpD,wDAAwD;oBACxD,eAAe;oBACf,KAAK,CACJ,6CAA6C,EAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CACvB,CAAC;oBACD,MAA4B,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;oBACpD,OAAO;iBACP;gBAED,IAAI,MAAM,EAAE;oBACX,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;wBACxB,IAAI,CAAC,UAAU,CAAC,MAAoB,EAAE,IAAI,CAAC,CAAC;oBAC7C,CAAC,CAAC,CAAC;oBACH,GAAG,CAAC,QAAQ,CAAC,MAAoB,CAAC,CAAC;oBACnC,OAAO;iBACP;gBAED,MAAM,GAAG,GAAG,IAAI,KAAK,CACpB,qDAAqD,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,CAC/E,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,UAAU,EAAE;gBACxC,OAAO,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;gBAChD,OAAO;aACP;YAED,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE;oBAC9B,KAAK,CAAC,gDAAgD,CAAC,CAAC;oBACxD,IAAI,CAAC,mBAAmB,GAAG,mBAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACpD;qBAAM;oBACN,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,QAAQ,CAAC;iBACzC;aACD;YAED,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,GAAG,CAAC,EAAE;gBACnD,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAC7C;YAED,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACpD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YAED,IAAI;gBACH,KAAK,CACJ,qCAAqC,EACrC,IAAI,CAAC,QAAQ,EACb,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAC3B,CAAC;gBACF,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CACxD,QAAQ,EACR,aAAa,CACb,CAAC;aACF;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;aACzC;QACF,CAAC;QAED,UAAU,CAAC,MAAkB,EAAE,IAAkB;YAChD,KAAK,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;QAED,OAAO;YACN,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;KACD;IAxPY,iBAAK,QAwPjB,CAAA;IAED,uCAAuC;IACvC,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;AACrD,CAAC,EAtTS,WAAW,KAAX,WAAW,QAsTpB;AAED,iBAAS,WAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/agent-base/dist/src/promisify.d.ts b/node_modules/agent-base/dist/src/promisify.d.ts new file mode 100644 index 00000000..02688696 --- /dev/null +++ b/node_modules/agent-base/dist/src/promisify.d.ts @@ -0,0 +1,4 @@ +import { ClientRequest, RequestOptions, AgentCallbackCallback, AgentCallbackPromise } from './index'; +declare type LegacyCallback = (req: ClientRequest, opts: RequestOptions, fn: AgentCallbackCallback) => void; +export default function promisify(fn: LegacyCallback): AgentCallbackPromise; +export {}; diff --git a/node_modules/agent-base/dist/src/promisify.js b/node_modules/agent-base/dist/src/promisify.js new file mode 100644 index 00000000..b2f6132a --- /dev/null +++ b/node_modules/agent-base/dist/src/promisify.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function promisify(fn) { + return function (req, opts) { + return new Promise((resolve, reject) => { + fn.call(this, req, opts, (err, rtn) => { + if (err) { + reject(err); + } + else { + resolve(rtn); + } + }); + }); + }; +} +exports.default = promisify; +//# sourceMappingURL=promisify.js.map \ No newline at end of file diff --git a/node_modules/agent-base/dist/src/promisify.js.map b/node_modules/agent-base/dist/src/promisify.js.map new file mode 100644 index 00000000..4bff9bfc --- /dev/null +++ b/node_modules/agent-base/dist/src/promisify.js.map @@ -0,0 +1 @@ +{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../src/promisify.ts"],"names":[],"mappings":";;AAeA,SAAwB,SAAS,CAAC,EAAkB;IACnD,OAAO,UAAsB,GAAkB,EAAE,IAAoB;QACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,EAAE,CAAC,IAAI,CACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,CAAC,GAA6B,EAAE,GAAyB,EAAE,EAAE;gBAC5D,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;iBACZ;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,CAAC;iBACb;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAjBD,4BAiBC"} \ No newline at end of file diff --git a/node_modules/agent-base/node_modules/debug/LICENSE b/node_modules/agent-base/node_modules/debug/LICENSE new file mode 100644 index 00000000..1a9820e2 --- /dev/null +++ b/node_modules/agent-base/node_modules/debug/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/agent-base/node_modules/debug/README.md b/node_modules/agent-base/node_modules/debug/README.md new file mode 100644 index 00000000..e9c3e047 --- /dev/null +++ b/node_modules/agent-base/node_modules/debug/README.md @@ -0,0 +1,481 @@ +# debug +[![Build Status](https://travis-ci.org/debug-js/debug.svg?branch=master)](https://travis-ci.org/debug-js/debug) [![Coverage Status](https://coveralls.io/repos/github/debug-js/debug/badge.svg?branch=master)](https://coveralls.io/github/debug-js/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. + + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +`disable()` + +Will disable all namespaces. The functions returns the namespaces currently +enabled (and skipped). This can be useful if you want to disable debugging +temporarily without knowing what was enabled to begin with. + +For example: + +```js +let debug = require('debug'); +debug.enable('foo:*,-foo:bar'); +let namespaces = debug.disable(); +debug.enable(namespaces); +``` + +Note: There is no guarantee that the string will be identical to the initial +enable string, but semantically they will be identical. + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + +## Usage in child processes + +Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. +For example: + +```javascript +worker = fork(WORKER_WRAP_PATH, [workerPath], { + stdio: [ + /* stdin: */ 0, + /* stdout: */ 'pipe', + /* stderr: */ 'pipe', + 'ipc', + ], + env: Object.assign({}, process.env, { + DEBUG_COLORS: 1 // without this settings, colors won't be shown + }), +}); + +worker.stderr.pipe(process.stderr, { end: false }); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + - Josh Junon + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/agent-base/node_modules/debug/package.json b/node_modules/agent-base/node_modules/debug/package.json new file mode 100644 index 00000000..3bcdc242 --- /dev/null +++ b/node_modules/agent-base/node_modules/debug/package.json @@ -0,0 +1,59 @@ +{ + "name": "debug", + "version": "4.3.4", + "repository": { + "type": "git", + "url": "git://github.com/debug-js/debug.git" + }, + "description": "Lightweight debugging utility for Node.js and the browser", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "Josh Junon ", + "contributors": [ + "TJ Holowaychuk ", + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "istanbul cover _mocha -- test.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, + "dependencies": { + "ms": "2.1.2" + }, + "devDependencies": { + "brfs": "^2.0.1", + "browserify": "^16.2.3", + "coveralls": "^3.0.2", + "istanbul": "^0.4.5", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "xo": "^0.23.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + } +} diff --git a/node_modules/agent-base/node_modules/debug/src/browser.js b/node_modules/agent-base/node_modules/debug/src/browser.js new file mode 100644 index 00000000..cd0fc35d --- /dev/null +++ b/node_modules/agent-base/node_modules/debug/src/browser.js @@ -0,0 +1,269 @@ +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; diff --git a/node_modules/agent-base/node_modules/debug/src/common.js b/node_modules/agent-base/node_modules/debug/src/common.js new file mode 100644 index 00000000..e3291b20 --- /dev/null +++ b/node_modules/agent-base/node_modules/debug/src/common.js @@ -0,0 +1,274 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; diff --git a/node_modules/agent-base/node_modules/debug/src/index.js b/node_modules/agent-base/node_modules/debug/src/index.js new file mode 100644 index 00000000..bf4c57f2 --- /dev/null +++ b/node_modules/agent-base/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/agent-base/node_modules/debug/src/node.js b/node_modules/agent-base/node_modules/debug/src/node.js new file mode 100644 index 00000000..79bc085c --- /dev/null +++ b/node_modules/agent-base/node_modules/debug/src/node.js @@ -0,0 +1,263 @@ +/** + * Module dependencies. + */ + +const tty = require('tty'); +const util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + */ + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; + +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; diff --git a/node_modules/agent-base/node_modules/ms/index.js b/node_modules/agent-base/node_modules/ms/index.js new file mode 100644 index 00000000..c4498bcc --- /dev/null +++ b/node_modules/agent-base/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/node_modules/agent-base/node_modules/ms/license.md b/node_modules/agent-base/node_modules/ms/license.md new file mode 100644 index 00000000..69b61253 --- /dev/null +++ b/node_modules/agent-base/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/agent-base/node_modules/ms/package.json b/node_modules/agent-base/node_modules/ms/package.json new file mode 100644 index 00000000..eea666e1 --- /dev/null +++ b/node_modules/agent-base/node_modules/ms/package.json @@ -0,0 +1,37 @@ +{ + "name": "ms", + "version": "2.1.2", + "description": "Tiny millisecond conversion utility", + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.12.1", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1" + } +} diff --git a/node_modules/agent-base/node_modules/ms/readme.md b/node_modules/agent-base/node_modules/ms/readme.md new file mode 100644 index 00000000..9a1996b1 --- /dev/null +++ b/node_modules/agent-base/node_modules/ms/readme.md @@ -0,0 +1,60 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/agent-base/package.json b/node_modules/agent-base/package.json new file mode 100644 index 00000000..fadce3ad --- /dev/null +++ b/node_modules/agent-base/package.json @@ -0,0 +1,64 @@ +{ + "name": "agent-base", + "version": "6.0.2", + "description": "Turn a function into an `http.Agent` instance", + "main": "dist/src/index", + "typings": "dist/src/index", + "files": [ + "dist/src", + "src" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "postbuild": "cpy --parents src test '!**/*.ts' dist", + "test": "mocha --reporter spec dist/test/*.js", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-agent-base.git" + }, + "keywords": [ + "http", + "agent", + "base", + "barebones", + "https" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/node-agent-base/issues" + }, + "dependencies": { + "debug": "4" + }, + "devDependencies": { + "@types/debug": "4", + "@types/mocha": "^5.2.7", + "@types/node": "^14.0.20", + "@types/semver": "^7.1.0", + "@types/ws": "^6.0.3", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "async-listen": "^1.2.0", + "cpy-cli": "^2.0.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.0", + "rimraf": "^3.0.0", + "semver": "^7.1.2", + "typescript": "^3.5.3", + "ws": "^3.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } +} diff --git a/node_modules/agent-base/src/index.ts b/node_modules/agent-base/src/index.ts new file mode 100644 index 00000000..a47ccd49 --- /dev/null +++ b/node_modules/agent-base/src/index.ts @@ -0,0 +1,345 @@ +import net from 'net'; +import http from 'http'; +import https from 'https'; +import { Duplex } from 'stream'; +import { EventEmitter } from 'events'; +import createDebug from 'debug'; +import promisify from './promisify'; + +const debug = createDebug('agent-base'); + +function isAgent(v: any): v is createAgent.AgentLike { + return Boolean(v) && typeof v.addRequest === 'function'; +} + +function isSecureEndpoint(): boolean { + const { stack } = new Error(); + if (typeof stack !== 'string') return false; + return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); +} + +function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; +function createAgent( + callback: createAgent.AgentCallback, + opts?: createAgent.AgentOptions +): createAgent.Agent; +function createAgent( + callback?: createAgent.AgentCallback | createAgent.AgentOptions, + opts?: createAgent.AgentOptions +) { + return new createAgent.Agent(callback, opts); +} + +namespace createAgent { + export interface ClientRequest extends http.ClientRequest { + _last?: boolean; + _hadError?: boolean; + method: string; + } + + export interface AgentRequestOptions { + host?: string; + path?: string; + // `port` on `http.RequestOptions` can be a string or undefined, + // but `net.TcpNetConnectOpts` expects only a number + port: number; + } + + export interface HttpRequestOptions + extends AgentRequestOptions, + Omit { + secureEndpoint: false; + } + + export interface HttpsRequestOptions + extends AgentRequestOptions, + Omit { + secureEndpoint: true; + } + + export type RequestOptions = HttpRequestOptions | HttpsRequestOptions; + + export type AgentLike = Pick | http.Agent; + + export type AgentCallbackReturn = Duplex | AgentLike; + + export type AgentCallbackCallback = ( + err?: Error | null, + socket?: createAgent.AgentCallbackReturn + ) => void; + + export type AgentCallbackPromise = ( + req: createAgent.ClientRequest, + opts: createAgent.RequestOptions + ) => + | createAgent.AgentCallbackReturn + | Promise; + + export type AgentCallback = typeof Agent.prototype.callback; + + export type AgentOptions = { + timeout?: number; + }; + + /** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + * + * @param {Function} callback + * @api public + */ + export class Agent extends EventEmitter { + public timeout: number | null; + public maxFreeSockets: number; + public maxTotalSockets: number; + public maxSockets: number; + public sockets: { + [key: string]: net.Socket[]; + }; + public freeSockets: { + [key: string]: net.Socket[]; + }; + public requests: { + [key: string]: http.IncomingMessage[]; + }; + public options: https.AgentOptions; + private promisifiedCallback?: createAgent.AgentCallbackPromise; + private explicitDefaultPort?: number; + private explicitProtocol?: string; + + constructor( + callback?: createAgent.AgentCallback | createAgent.AgentOptions, + _opts?: createAgent.AgentOptions + ) { + super(); + + let opts = _opts; + if (typeof callback === 'function') { + this.callback = callback; + } else if (callback) { + opts = callback; + } + + // Timeout for the socket to be returned from the callback + this.timeout = null; + if (opts && typeof opts.timeout === 'number') { + this.timeout = opts.timeout; + } + + // These aren't actually used by `agent-base`, but are required + // for the TypeScript definition files in `@types/node` :/ + this.maxFreeSockets = 1; + this.maxSockets = 1; + this.maxTotalSockets = Infinity; + this.sockets = {}; + this.freeSockets = {}; + this.requests = {}; + this.options = {}; + } + + get defaultPort(): number { + if (typeof this.explicitDefaultPort === 'number') { + return this.explicitDefaultPort; + } + return isSecureEndpoint() ? 443 : 80; + } + + set defaultPort(v: number) { + this.explicitDefaultPort = v; + } + + get protocol(): string { + if (typeof this.explicitProtocol === 'string') { + return this.explicitProtocol; + } + return isSecureEndpoint() ? 'https:' : 'http:'; + } + + set protocol(v: string) { + this.explicitProtocol = v; + } + + callback( + req: createAgent.ClientRequest, + opts: createAgent.RequestOptions, + fn: createAgent.AgentCallbackCallback + ): void; + callback( + req: createAgent.ClientRequest, + opts: createAgent.RequestOptions + ): + | createAgent.AgentCallbackReturn + | Promise; + callback( + req: createAgent.ClientRequest, + opts: createAgent.AgentOptions, + fn?: createAgent.AgentCallbackCallback + ): + | createAgent.AgentCallbackReturn + | Promise + | void { + throw new Error( + '"agent-base" has no default implementation, you must subclass and override `callback()`' + ); + } + + /** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ + addRequest(req: ClientRequest, _opts: RequestOptions): void { + const opts: RequestOptions = { ..._opts }; + + if (typeof opts.secureEndpoint !== 'boolean') { + opts.secureEndpoint = isSecureEndpoint(); + } + + if (opts.host == null) { + opts.host = 'localhost'; + } + + if (opts.port == null) { + opts.port = opts.secureEndpoint ? 443 : 80; + } + + if (opts.protocol == null) { + opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; + } + + if (opts.host && opts.path) { + // If both a `host` and `path` are specified then it's most + // likely the result of a `url.parse()` call... we need to + // remove the `path` portion so that `net.connect()` doesn't + // attempt to open that as a unix socket file. + delete opts.path; + } + + delete opts.agent; + delete opts.hostname; + delete opts._defaultAgent; + delete opts.defaultPort; + delete opts.createConnection; + + // Hint to use "Connection: close" + // XXX: non-documented `http` module API :( + req._last = true; + req.shouldKeepAlive = false; + + let timedOut = false; + let timeoutId: ReturnType | null = null; + const timeoutMs = opts.timeout || this.timeout; + + const onerror = (err: NodeJS.ErrnoException) => { + if (req._hadError) return; + req.emit('error', err); + // For Safety. Some additional errors might fire later on + // and we need to make sure we don't double-fire the error event. + req._hadError = true; + }; + + const ontimeout = () => { + timeoutId = null; + timedOut = true; + const err: NodeJS.ErrnoException = new Error( + `A "socket" was not created for HTTP request before ${timeoutMs}ms` + ); + err.code = 'ETIMEOUT'; + onerror(err); + }; + + const callbackError = (err: NodeJS.ErrnoException) => { + if (timedOut) return; + if (timeoutId !== null) { + clearTimeout(timeoutId); + timeoutId = null; + } + onerror(err); + }; + + const onsocket = (socket: AgentCallbackReturn) => { + if (timedOut) return; + if (timeoutId != null) { + clearTimeout(timeoutId); + timeoutId = null; + } + + if (isAgent(socket)) { + // `socket` is actually an `http.Agent` instance, so + // relinquish responsibility for this `req` to the Agent + // from here on + debug( + 'Callback returned another Agent instance %o', + socket.constructor.name + ); + (socket as createAgent.Agent).addRequest(req, opts); + return; + } + + if (socket) { + socket.once('free', () => { + this.freeSocket(socket as net.Socket, opts); + }); + req.onSocket(socket as net.Socket); + return; + } + + const err = new Error( + `no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\`` + ); + onerror(err); + }; + + if (typeof this.callback !== 'function') { + onerror(new Error('`callback` is not defined')); + return; + } + + if (!this.promisifiedCallback) { + if (this.callback.length >= 3) { + debug('Converting legacy callback function to promise'); + this.promisifiedCallback = promisify(this.callback); + } else { + this.promisifiedCallback = this.callback; + } + } + + if (typeof timeoutMs === 'number' && timeoutMs > 0) { + timeoutId = setTimeout(ontimeout, timeoutMs); + } + + if ('port' in opts && typeof opts.port !== 'number') { + opts.port = Number(opts.port); + } + + try { + debug( + 'Resolving socket for %o request: %o', + opts.protocol, + `${req.method} ${req.path}` + ); + Promise.resolve(this.promisifiedCallback(req, opts)).then( + onsocket, + callbackError + ); + } catch (err) { + Promise.reject(err).catch(callbackError); + } + } + + freeSocket(socket: net.Socket, opts: AgentOptions) { + debug('Freeing socket %o %o', socket.constructor.name, opts); + socket.destroy(); + } + + destroy() { + debug('Destroying agent %o', this.constructor.name); + } + } + + // So that `instanceof` works correctly + createAgent.prototype = createAgent.Agent.prototype; +} + +export = createAgent; diff --git a/node_modules/agent-base/src/promisify.ts b/node_modules/agent-base/src/promisify.ts new file mode 100644 index 00000000..60cc6627 --- /dev/null +++ b/node_modules/agent-base/src/promisify.ts @@ -0,0 +1,33 @@ +import { + Agent, + ClientRequest, + RequestOptions, + AgentCallbackCallback, + AgentCallbackPromise, + AgentCallbackReturn +} from './index'; + +type LegacyCallback = ( + req: ClientRequest, + opts: RequestOptions, + fn: AgentCallbackCallback +) => void; + +export default function promisify(fn: LegacyCallback): AgentCallbackPromise { + return function(this: Agent, req: ClientRequest, opts: RequestOptions) { + return new Promise((resolve, reject) => { + fn.call( + this, + req, + opts, + (err: Error | null | undefined, rtn?: AgentCallbackReturn) => { + if (err) { + reject(err); + } else { + resolve(rtn); + } + } + ); + }); + }; +} diff --git a/node_modules/ansi-regex/index.d.ts b/node_modules/ansi-regex/index.d.ts new file mode 100644 index 00000000..2dbf6af2 --- /dev/null +++ b/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js new file mode 100644 index 00000000..616ff837 --- /dev/null +++ b/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json new file mode 100644 index 00000000..017f5311 --- /dev/null +++ b/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000..4d848bc3 --- /dev/null +++ b/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/aproba/CHANGELOG.md b/node_modules/aproba/CHANGELOG.md new file mode 100644 index 00000000..bab30ecb --- /dev/null +++ b/node_modules/aproba/CHANGELOG.md @@ -0,0 +1,4 @@ +2.0.0 + * Drop support for 0.10 and 0.12. They haven't been in travis but still, + since we _know_ we'll break with them now it's only polite to do a + major bump. diff --git a/node_modules/aproba/LICENSE b/node_modules/aproba/LICENSE new file mode 100644 index 00000000..f4be44d8 --- /dev/null +++ b/node_modules/aproba/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/aproba/README.md b/node_modules/aproba/README.md new file mode 100644 index 00000000..0bfc594c --- /dev/null +++ b/node_modules/aproba/README.md @@ -0,0 +1,94 @@ +aproba +====== + +A ridiculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +| type | description +| :--: | :---------- +| * | matches any type +| A | `Array.isArray` OR an `arguments` object +| S | typeof == string +| N | typeof == number +| F | typeof == function +| O | typeof == object and not type A and not type E +| B | typeof == boolean +| E | `instanceof Error` OR `null` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. + diff --git a/node_modules/aproba/index.js b/node_modules/aproba/index.js new file mode 100644 index 00000000..fd947481 --- /dev/null +++ b/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' +module.exports = validate + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +const types = { + '*': {label: 'any', check: () => true}, + A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)}, + S: {label: 'string', check: _ => typeof _ === 'string'}, + N: {label: 'number', check: _ => typeof _ === 'number'}, + F: {label: 'function', check: _ => typeof _ === 'function'}, + O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)}, + B: {label: 'boolean', check: _ => typeof _ === 'boolean'}, + E: {label: 'error', check: _ => _ instanceof Error}, + Z: {label: 'null', check: _ => _ == null} +} + +function addSchema (schema, arity) { + const group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +function validate (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + const schemas = rawSchemas.split('|') + const arity = {} + + schemas.forEach(schema => { + for (let ii = 0; ii < schema.length; ++ii) { + const type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + let matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (let ii = 0; ii < args.length; ++ii) { + let newMatching = matching.filter(schema => { + const type = schema[ii] + const typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) +} + +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) +} + +function invalidType (num, expectedTypes, value) { + let valueType + Object.keys(types).forEach(typeCode => { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + const english = englishList(expected) + const args = expected.every(ex => ex.length === 1) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + const err = new Error(msg) + err.code = code + /* istanbul ignore else */ + if (Error.captureStackTrace) Error.captureStackTrace(err, validate) + return err +} diff --git a/node_modules/aproba/package.json b/node_modules/aproba/package.json new file mode 100644 index 00000000..d2212d30 --- /dev/null +++ b/node_modules/aproba/package.json @@ -0,0 +1,35 @@ +{ + "name": "aproba", + "version": "2.0.0", + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "files": [ + "index.js" + ], + "scripts": { + "pretest": "standard", + "test": "tap --100 -J test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/aproba" + }, + "keywords": [ + "argument", + "validate" + ], + "author": "Rebecca Turner ", + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "homepage": "https://github.com/iarna/aproba" +} diff --git a/node_modules/are-we-there-yet/LICENSE.md b/node_modules/are-we-there-yet/LICENSE.md new file mode 100644 index 00000000..845be76f --- /dev/null +++ b/node_modules/are-we-there-yet/LICENSE.md @@ -0,0 +1,18 @@ +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/are-we-there-yet/README.md b/node_modules/are-we-there-yet/README.md new file mode 100644 index 00000000..caae19b0 --- /dev/null +++ b/node_modules/are-we-there-yet/README.md @@ -0,0 +1,208 @@ +are-we-there-yet +---------------- + +Track complex hierarchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudimentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +* var completed = tracker.completed() + +Implemented in: `Tracker`, `TrackerGroup`, `TrackerStream` + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Implemented in: `Tracker`, `TrackerGroup` + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers added to this aggregation group. + +Ex. + +```javascript +var tracker = new TrackerGroup("parent") +var foo = tracker.newItem("firstChild", 100) +var bar = tracker.newItem("secondChild", 100) + +foo.finish() +console.log(tracker.completed()) // 0.5 +bar.finish() +console.log(tracker.completed()) // 1 +``` + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/node_modules/are-we-there-yet/lib/index.js b/node_modules/are-we-there-yet/lib/index.js new file mode 100644 index 00000000..57d8743f --- /dev/null +++ b/node_modules/are-we-there-yet/lib/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/node_modules/are-we-there-yet/lib/tracker-base.js b/node_modules/are-we-there-yet/lib/tracker-base.js new file mode 100644 index 00000000..6f436875 --- /dev/null +++ b/node_modules/are-we-there-yet/lib/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/node_modules/are-we-there-yet/lib/tracker-group.js b/node_modules/are-we-there-yet/lib/tracker-group.js new file mode 100644 index 00000000..9da13f8a --- /dev/null +++ b/node_modules/are-we-there-yet/lib/tracker-group.js @@ -0,0 +1,116 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) { + return + } + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) { + this.emit('change', unit.name, this.completion[unit.id], unit) + } + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) { + return 0 + } + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += + valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) { + this.addUnit(new Tracker(), 1, true) + } + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/node_modules/are-we-there-yet/lib/tracker-stream.js b/node_modules/are-we-there-yet/lib/tracker-stream.js new file mode 100644 index 00000000..e1cf8505 --- /dev/null +++ b/node_modules/are-we-there-yet/lib/tracker-stream.js @@ -0,0 +1,36 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') + .method('finish') diff --git a/node_modules/are-we-there-yet/lib/tracker.js b/node_modules/are-we-there-yet/lib/tracker.js new file mode 100644 index 00000000..a8f8b3ba --- /dev/null +++ b/node_modules/are-we-there-yet/lib/tracker.js @@ -0,0 +1,32 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) { + this.workDone = this.workTodo + } + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/node_modules/are-we-there-yet/package.json b/node_modules/are-we-there-yet/package.json new file mode 100644 index 00000000..5714e09c --- /dev/null +++ b/node_modules/are-we-there-yet/package.json @@ -0,0 +1,53 @@ +{ + "name": "are-we-there-yet", + "version": "2.0.0", + "description": "Keep track of the overall completion of many disparate processes", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "npmclilint": "npmcli-lint", + "lint": "eslint '**/*.js'", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/are-we-there-yet.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/are-we-there-yet/issues" + }, + "homepage": "https://github.com/npm/are-we-there-yet", + "devDependencies": { + "@npmcli/eslint-config": "^1.0.0", + "@npmcli/template-oss": "^1.0.2", + "eslint": "^7.32.0", + "eslint-plugin-node": "^11.1.0", + "tap": "^15.0.9" + }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "files": [ + "bin", + "lib" + ], + "engines": { + "node": ">=10" + }, + "tap": { + "branches": 68, + "statements": 92, + "functions": 86, + "lines": 92 + }, + "templateVersion": "1.0.2" +} diff --git a/node_modules/asynckit/LICENSE b/node_modules/asynckit/LICENSE new file mode 100644 index 00000000..c9eca5dd --- /dev/null +++ b/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/asynckit/README.md b/node_modules/asynckit/README.md new file mode 100644 index 00000000..ddcc7e6b --- /dev/null +++ b/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/node_modules/asynckit/bench.js b/node_modules/asynckit/bench.js new file mode 100644 index 00000000..c612f1a5 --- /dev/null +++ b/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/node_modules/asynckit/index.js b/node_modules/asynckit/index.js new file mode 100644 index 00000000..455f9454 --- /dev/null +++ b/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/node_modules/asynckit/lib/abort.js b/node_modules/asynckit/lib/abort.js new file mode 100644 index 00000000..114367e5 --- /dev/null +++ b/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/node_modules/asynckit/lib/async.js b/node_modules/asynckit/lib/async.js new file mode 100644 index 00000000..7f1288a4 --- /dev/null +++ b/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/node_modules/asynckit/lib/defer.js b/node_modules/asynckit/lib/defer.js new file mode 100644 index 00000000..b67110c7 --- /dev/null +++ b/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/node_modules/asynckit/lib/iterate.js b/node_modules/asynckit/lib/iterate.js new file mode 100644 index 00000000..5d2839a5 --- /dev/null +++ b/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/node_modules/asynckit/lib/readable_asynckit.js b/node_modules/asynckit/lib/readable_asynckit.js new file mode 100644 index 00000000..78ad240f --- /dev/null +++ b/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/node_modules/asynckit/lib/readable_parallel.js b/node_modules/asynckit/lib/readable_parallel.js new file mode 100644 index 00000000..5d2929f7 --- /dev/null +++ b/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/node_modules/asynckit/lib/readable_serial.js b/node_modules/asynckit/lib/readable_serial.js new file mode 100644 index 00000000..78226982 --- /dev/null +++ b/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/node_modules/asynckit/lib/readable_serial_ordered.js b/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100644 index 00000000..3de89c47 --- /dev/null +++ b/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/node_modules/asynckit/lib/state.js b/node_modules/asynckit/lib/state.js new file mode 100644 index 00000000..cbea7ad8 --- /dev/null +++ b/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/node_modules/asynckit/lib/streamify.js b/node_modules/asynckit/lib/streamify.js new file mode 100644 index 00000000..f56a1c92 --- /dev/null +++ b/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/node_modules/asynckit/lib/terminator.js b/node_modules/asynckit/lib/terminator.js new file mode 100644 index 00000000..d6eb9921 --- /dev/null +++ b/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/node_modules/asynckit/package.json b/node_modules/asynckit/package.json new file mode 100644 index 00000000..51147d65 --- /dev/null +++ b/node_modules/asynckit/package.json @@ -0,0 +1,63 @@ +{ + "name": "asynckit", + "version": "0.4.0", + "description": "Minimal async jobs utility library, with streams support", + "main": "index.js", + "scripts": { + "clean": "rimraf coverage", + "lint": "eslint *.js lib/*.js test/*.js", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js", + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "debug": "tape test/test-*.js" + }, + "pre-commit": [ + "clean", + "lint", + "test", + "browser", + "report", + "size" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "keywords": [ + "async", + "jobs", + "parallel", + "serial", + "iterator", + "array", + "object", + "stream", + "destroy", + "terminate", + "abort" + ], + "author": "Alex Indigo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "homepage": "https://github.com/alexindigo/asynckit#readme", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "dependencies": {} +} diff --git a/node_modules/asynckit/parallel.js b/node_modules/asynckit/parallel.js new file mode 100644 index 00000000..3c50344d --- /dev/null +++ b/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/node_modules/asynckit/serial.js b/node_modules/asynckit/serial.js new file mode 100644 index 00000000..6cd949a6 --- /dev/null +++ b/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/node_modules/asynckit/serialOrdered.js b/node_modules/asynckit/serialOrdered.js new file mode 100644 index 00000000..607eafea --- /dev/null +++ b/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/node_modules/asynckit/stream.js b/node_modules/asynckit/stream.js new file mode 100644 index 00000000..d43465f9 --- /dev/null +++ b/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/node_modules/axios/CHANGELOG.md b/node_modules/axios/CHANGELOG.md new file mode 100644 index 00000000..ea5ffa24 --- /dev/null +++ b/node_modules/axios/CHANGELOG.md @@ -0,0 +1,855 @@ +# Changelog + +## [1.6.7](https://github.com/axios/axios/compare/v1.6.6...v1.6.7) (2024-01-25) + + +### Bug Fixes + +* capture async stack only for rejections with native error objects; ([#6203](https://github.com/axios/axios/issues/6203)) ([1a08f90](https://github.com/axios/axios/commit/1a08f90f402336e4d00e9ee82f211c6adb1640b0)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+30/-26 (#6203 )") +- avatar [zhoulixiang](https://github.com/zh-lx "+0/-3 (#6186 )") + +## [1.6.6](https://github.com/axios/axios/compare/v1.6.5...v1.6.6) (2024-01-24) + + +### Bug Fixes + +* fixed missed dispatchBeforeRedirect argument ([#5778](https://github.com/axios/axios/issues/5778)) ([a1938ff](https://github.com/axios/axios/commit/a1938ff073fcb0f89011f001dfbc1fa1dc995e39)) +* wrap errors to improve async stack trace ([#5987](https://github.com/axios/axios/issues/5987)) ([123f354](https://github.com/axios/axios/commit/123f354b920f154a209ea99f76b7b2ef3d9ebbab)) + +### Contributors to this release + +- avatar [Ilya Priven](https://github.com/ikonst "+91/-8 (#5987 )") +- avatar [Zao Soula](https://github.com/zaosoula "+6/-6 (#5778 )") + +## [1.6.5](https://github.com/axios/axios/compare/v1.6.4...v1.6.5) (2024-01-05) + + +### Bug Fixes + +* **ci:** refactor notify action as a job of publish action; ([#6176](https://github.com/axios/axios/issues/6176)) ([0736f95](https://github.com/axios/axios/commit/0736f95ce8776366dc9ca569f49ba505feb6373c)) +* **dns:** fixed lookup error handling; ([#6175](https://github.com/axios/axios/issues/6175)) ([f4f2b03](https://github.com/axios/axios/commit/f4f2b039dd38eb4829e8583caede4ed6d2dd59be)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+41/-6 (#6176 #6175 )") +- avatar [Jay](https://github.com/jasonsaayman "+6/-1 ()") + +## [1.6.4](https://github.com/axios/axios/compare/v1.6.3...v1.6.4) (2024-01-03) + + +### Bug Fixes + +* **security:** fixed formToJSON prototype pollution vulnerability; ([#6167](https://github.com/axios/axios/issues/6167)) ([3c0c11c](https://github.com/axios/axios/commit/3c0c11cade045c4412c242b5727308cff9897a0e)) +* **security:** fixed security vulnerability in follow-redirects ([#6163](https://github.com/axios/axios/issues/6163)) ([75af1cd](https://github.com/axios/axios/commit/75af1cdff5b3a6ca3766d3d3afbc3115bb0811b8)) + +### Contributors to this release + +- avatar [Jay](https://github.com/jasonsaayman "+34/-6 ()") +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+34/-3 (#6172 #6167 )") +- avatar [Guy Nesher](https://github.com/gnesher "+10/-10 (#6163 )") + +## [1.6.3](https://github.com/axios/axios/compare/v1.6.2...v1.6.3) (2023-12-26) + + +### Bug Fixes + +* Regular Expression Denial of Service (ReDoS) ([#6132](https://github.com/axios/axios/issues/6132)) ([5e7ad38](https://github.com/axios/axios/commit/5e7ad38fb0f819fceb19fb2ee5d5d38f56aa837d)) + +### Contributors to this release + +- avatar [Jay](https://github.com/jasonsaayman "+15/-6 (#6145 )") +- avatar [Willian Agostini](https://github.com/WillianAgostini "+17/-2 (#6132 )") +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+3/-0 (#6084 )") + +## [1.6.2](https://github.com/axios/axios/compare/v1.6.1...v1.6.2) (2023-11-14) + + +### Features + +* **withXSRFToken:** added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ([#6046](https://github.com/axios/axios/issues/6046)) ([cff9967](https://github.com/axios/axios/commit/cff996779b272a5e94c2b52f5503ccf668bc42dc)) + +### PRs +- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) ) +``` + +📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour. +You should now use withXSRFToken along with withCredential to get the old behavior. +This functionality is considered as a fix. +``` + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+271/-146 (#6081 #6080 #6079 #6078 #6046 #6064 #6063 )") +- avatar [Ng Choon Khon (CK)](https://github.com/ckng0221 "+4/-4 (#6073 )") +- avatar [Muhammad Noman](https://github.com/mnomanmemon "+2/-2 (#6048 )") + +## [1.6.1](https://github.com/axios/axios/compare/v1.6.0...v1.6.1) (2023-11-08) + + +### Bug Fixes + +* **formdata:** fixed content-type header normalization for non-standard browser environments; ([#6056](https://github.com/axios/axios/issues/6056)) ([dd465ab](https://github.com/axios/axios/commit/dd465ab22bbfa262c6567be6574bf46a057d5288)) +* **platform:** fixed emulated browser detection in node.js environment; ([#6055](https://github.com/axios/axios/issues/6055)) ([3dc8369](https://github.com/axios/axios/commit/3dc8369e505e32a4e12c22f154c55fd63ac67fbb)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+432/-65 (#6059 #6056 #6055 )") +- avatar [Fabian Meyer](https://github.com/meyfa "+5/-2 (#5835 )") + +### PRs +- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) ) +``` + +📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour. +You should now use withXSRFToken along with withCredential to get the old behavior. +This functionality is considered as a fix. +``` + +# [1.6.0](https://github.com/axios/axios/compare/v1.5.1...v1.6.0) (2023-10-26) + + +### Bug Fixes + +* **CSRF:** fixed CSRF vulnerability CVE-2023-45857 ([#6028](https://github.com/axios/axios/issues/6028)) ([96ee232](https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0)) +* **dns:** fixed lookup function decorator to work properly in node v20; ([#6011](https://github.com/axios/axios/issues/6011)) ([5aaff53](https://github.com/axios/axios/commit/5aaff532a6b820bb9ab6a8cd0f77131b47e2adb8)) +* **types:** fix AxiosHeaders types; ([#5931](https://github.com/axios/axios/issues/5931)) ([a1c8ad0](https://github.com/axios/axios/commit/a1c8ad008b3c13d53e135bbd0862587fb9d3fc09)) + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+449/-114 (#6032 #6021 #6011 #5932 #5931 )") +- avatar [Valentin Panov](https://github.com/valentin-panov "+4/-4 (#6028 )") +- avatar [Rinku Chaudhari](https://github.com/therealrinku "+1/-1 (#5889 )") + +## [1.5.1](https://github.com/axios/axios/compare/v1.5.0...v1.5.1) (2023-09-26) + + +### Bug Fixes + +* **adapters:** improved adapters loading logic to have clear error messages; ([#5919](https://github.com/axios/axios/issues/5919)) ([e410779](https://github.com/axios/axios/commit/e4107797a7a1376f6209fbecfbbce73d3faa7859)) +* **formdata:** fixed automatic addition of the `Content-Type` header for FormData in non-browser environments; ([#5917](https://github.com/axios/axios/issues/5917)) ([bc9af51](https://github.com/axios/axios/commit/bc9af51b1886d1b3529617702f2a21a6c0ed5d92)) +* **headers:** allow `content-encoding` header to handle case-insensitive values ([#5890](https://github.com/axios/axios/issues/5890)) ([#5892](https://github.com/axios/axios/issues/5892)) ([4c89f25](https://github.com/axios/axios/commit/4c89f25196525e90a6e75eda9cb31ae0a2e18acd)) +* **types:** removed duplicated code ([9e62056](https://github.com/axios/axios/commit/9e6205630e1c9cf863adf141c0edb9e6d8d4b149)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+89/-18 (#5919 #5917 )") +- avatar [David Dallas](https://github.com/DavidJDallas "+11/-5 ()") +- avatar [Sean Sattler](https://github.com/fb-sean "+2/-8 ()") +- avatar [Mustafa Ateş Uzun](https://github.com/0o001 "+4/-4 ()") +- avatar [Przemyslaw Motacki](https://github.com/sfc-gh-pmotacki "+2/-1 (#5892 )") +- avatar [Michael Di Prisco](https://github.com/Cadienvan "+1/-1 ()") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +# [1.5.0](https://github.com/axios/axios/compare/v1.4.0...v1.5.0) (2023-08-26) + + +### Bug Fixes + +* **adapter:** make adapter loading error more clear by using platform-specific adapters explicitly ([#5837](https://github.com/axios/axios/issues/5837)) ([9a414bb](https://github.com/axios/axios/commit/9a414bb6c81796a95c6c7fe668637825458e8b6d)) +* **dns:** fixed `cacheable-lookup` integration; ([#5836](https://github.com/axios/axios/issues/5836)) ([b3e327d](https://github.com/axios/axios/commit/b3e327dcc9277bdce34c7ef57beedf644b00d628)) +* **headers:** added support for setting header names that overlap with class methods; ([#5831](https://github.com/axios/axios/issues/5831)) ([d8b4ca0](https://github.com/axios/axios/commit/d8b4ca0ea5f2f05efa4edfe1e7684593f9f68273)) +* **headers:** fixed common Content-Type header merging; ([#5832](https://github.com/axios/axios/issues/5832)) ([8fda276](https://github.com/axios/axios/commit/8fda2766b1e6bcb72c3fabc146223083ef13ce17)) + + +### Features + +* export getAdapter function ([#5324](https://github.com/axios/axios/issues/5324)) ([ca73eb8](https://github.com/axios/axios/commit/ca73eb878df0ae2dace81fe3a7f1fb5986231bf1)) +* **export:** export adapters without `unsafe` prefix ([#5839](https://github.com/axios/axios/issues/5839)) ([1601f4a](https://github.com/axios/axios/commit/1601f4a27a81ab47fea228f1e244b2c4e3ce28bf)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+66/-29 (#5839 #5837 #5836 #5832 #5831 )") +- avatar [夜葬](https://github.com/geekact "+42/-0 (#5324 )") +- avatar [Jonathan Budiman](https://github.com/JBudiman00 "+30/-0 (#5788 )") +- avatar [Michael Di Prisco](https://github.com/Cadienvan "+3/-5 (#5791 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27) + + +### Bug Fixes + +* **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1)) +* **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09)) + + +### Features + +* **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb)) +* **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf)) + + +### Performance Improvements + +* **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+151/-16 (#5684 #5339 #5679 #5678 #5677 )") +- avatar [Arthur Fiorette](https://github.com/arthurfiorette "+19/-19 (#5525 )") +- avatar [PIYUSH NEGI](https://github.com/npiyush97 "+2/-18 (#5670 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19) + + +### Bug Fixes + +* **types:** added transport to RawAxiosRequestConfig ([#5445](https://github.com/axios/axios/issues/5445)) ([6f360a2](https://github.com/axios/axios/commit/6f360a2531d8d70363fd9becef6a45a323f170e2)) +* **utils:** make isFormData detection logic stricter to avoid unnecessary calling of the `toString` method on the target; ([#5661](https://github.com/axios/axios/issues/5661)) ([aa372f7](https://github.com/axios/axios/commit/aa372f7306295dfd1100c1c2c77ce95c95808e76)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+48/-10 (#5665 #5661 #5663 )") +- avatar [Michael Di Prisco](https://github.com/Cadienvan "+2/-0 (#5445 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.3.5](https://github.com/axios/axios/compare/v1.3.4...v1.3.5) (2023-04-05) + + +### Bug Fixes + +* **headers:** fixed isValidHeaderName to support full list of allowed characters; ([#5584](https://github.com/axios/axios/issues/5584)) ([e7decef](https://github.com/axios/axios/commit/e7decef6a99f4627e27ed9ea5b00ce8e201c3841)) +* **params:** re-added the ability to set the function as `paramsSerializer` config; ([#5633](https://github.com/axios/axios/issues/5633)) ([a56c866](https://github.com/axios/axios/commit/a56c8661209d5ce5a645a05f294a0e08a6c1f6b3)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+28/-10 (#5633 #5584 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.3.4](https://github.com/axios/axios/compare/v1.3.3...v1.3.4) (2023-02-22) + + +### Bug Fixes + +* **blob:** added a check to make sure the Blob class is available in the browser's global scope; ([#5548](https://github.com/axios/axios/issues/5548)) ([3772c8f](https://github.com/axios/axios/commit/3772c8fe74112a56e3e9551f894d899bc3a9443a)) +* **http:** fixed regression bug when handling synchronous errors inside the adapter; ([#5564](https://github.com/axios/axios/issues/5564)) ([a3b246c](https://github.com/axios/axios/commit/a3b246c9de5c3bc4b5a742e15add55b375479451)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+38/-26 (#5564 )") +- avatar [lcysgsg](https://github.com/lcysgsg "+4/-0 (#5548 )") +- avatar [Michael Di Prisco](https://github.com/Cadienvan "+3/-0 (#5444 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.3.3](https://github.com/axios/axios/compare/v1.3.2...v1.3.3) (2023-02-13) + + +### Bug Fixes + +* **formdata:** added a check to make sure the FormData class is available in the browser's global scope; ([#5545](https://github.com/axios/axios/issues/5545)) ([a6dfa72](https://github.com/axios/axios/commit/a6dfa72010db5ad52db8bd13c0f98e537e8fd05d)) +* **formdata:** fixed setting NaN as Content-Length for form payload in some cases; ([#5535](https://github.com/axios/axios/issues/5535)) ([c19f7bf](https://github.com/axios/axios/commit/c19f7bf770f90ae8307f4ea3104f227056912da1)) +* **headers:** fixed the filtering logic of the clear method; ([#5542](https://github.com/axios/axios/issues/5542)) ([ea87ebf](https://github.com/axios/axios/commit/ea87ebfe6d1699af072b9e7cd40faf8f14b0ab93)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+11/-7 (#5545 #5535 #5542 )") +- avatar [陈若枫](https://github.com/ruofee "+2/-2 (#5467 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.3.2](https://github.com/axios/axios/compare/v1.3.1...v1.3.2) (2023-02-03) + + +### Bug Fixes + +* **http:** treat http://localhost as base URL for relative paths to avoid `ERR_INVALID_URL` error; ([#5528](https://github.com/axios/axios/issues/5528)) ([128d56f](https://github.com/axios/axios/commit/128d56f4a0fb8f5f2ed6e0dd80bc9225fee9538c)) +* **http:** use explicit import instead of TextEncoder global; ([#5530](https://github.com/axios/axios/issues/5530)) ([6b3c305](https://github.com/axios/axios/commit/6b3c305fc40c56428e0afabedc6f4d29c2830f6f)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+2/-1 (#5530 #5528 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.3.1](https://github.com/axios/axios/compare/v1.3.0...v1.3.1) (2023-02-01) + + +### Bug Fixes + +* **formdata:** add hotfix to use the asynchronous API to compute the content-length header value; ([#5521](https://github.com/axios/axios/issues/5521)) ([96d336f](https://github.com/axios/axios/commit/96d336f527619f21da012fe1f117eeb53e5a2120)) +* **serializer:** fixed serialization of array-like objects; ([#5518](https://github.com/axios/axios/issues/5518)) ([08104c0](https://github.com/axios/axios/commit/08104c028c0f9353897b1b6691d74c440fd0c32d)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+27/-8 (#5521 #5518 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +# [1.3.0](https://github.com/axios/axios/compare/v1.2.6...v1.3.0) (2023-01-31) + + +### Bug Fixes + +* **headers:** fixed & optimized clear method; ([#5507](https://github.com/axios/axios/issues/5507)) ([9915635](https://github.com/axios/axios/commit/9915635c69d0ab70daca5738488421f67ca60959)) +* **http:** add zlib headers if missing ([#5497](https://github.com/axios/axios/issues/5497)) ([65e8d1e](https://github.com/axios/axios/commit/65e8d1e28ce829f47a837e45129730e541950d3c)) + + +### Features + +* **fomdata:** added support for spec-compliant FormData & Blob types; ([#5316](https://github.com/axios/axios/issues/5316)) ([6ac574e](https://github.com/axios/axios/commit/6ac574e00a06731288347acea1e8246091196953)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+352/-67 (#5514 #5512 #5510 #5509 #5508 #5316 #5507 )") +- avatar [ItsNotGoodName](https://github.com/ItsNotGoodName "+43/-2 (#5497 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.2.6](https://github.com/axios/axios/compare/v1.2.5...v1.2.6) (2023-01-28) + + +### Bug Fixes + +* **headers:** added missed Authorization accessor; ([#5502](https://github.com/axios/axios/issues/5502)) ([342c0ba](https://github.com/axios/axios/commit/342c0ba9a16ea50f5ed7d2366c5c1a2c877e3f26)) +* **types:** fixed `CommonRequestHeadersList` & `CommonResponseHeadersList` types to be private in commonJS; ([#5503](https://github.com/axios/axios/issues/5503)) ([5a3d0a3](https://github.com/axios/axios/commit/5a3d0a3234d77361a1bc7cedee2da1e11df08e2c)) + +### Contributors to this release + +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+24/-9 (#5503 #5502 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.2.5](https://github.com/axios/axios/compare/v1.2.4...v1.2.5) (2023-01-26) + + +### Bug Fixes + +* **types:** fixed AxiosHeaders to handle spread syntax by making all methods non-enumerable; ([#5499](https://github.com/axios/axios/issues/5499)) ([580f1e8](https://github.com/axios/axios/commit/580f1e8033a61baa38149d59fd16019de3932c22)) + +### Contributors to this release + +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+82/-54 (#5499 )") +- ![avatar](https://avatars.githubusercontent.com/u/20516159?v=4&s=16) [Elliot Ford](https://github.com/EFord36 "+1/-1 (#5462 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.2.4](https://github.com/axios/axios/compare/v1.2.3...v1.2.4) (2023-01-22) + + +### Bug Fixes + +* **types:** renamed `RawAxiosRequestConfig` back to `AxiosRequestConfig`; ([#5486](https://github.com/axios/axios/issues/5486)) ([2a71f49](https://github.com/axios/axios/commit/2a71f49bc6c68495fa419003a3107ed8bd703ad0)) +* **types:** fix `AxiosRequestConfig` generic; ([#5478](https://github.com/axios/axios/issues/5478)) ([9bce81b](https://github.com/axios/axios/commit/186ea062da8b7d578ae78b1a5c220986b9bce81b)) + +### Contributors to this release + +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+242/-108 (#5486 #5482 )") +- ![avatar](https://avatars.githubusercontent.com/u/9430821?v=4&s=16) [Daniel Hillmann](https://github.com/hilleer "+1/-1 (#5478 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.2.3](https://github.com/axios/axios/compare/1.2.2...1.2.3) (2023-01-10) + + +### Bug Fixes + +* **types:** fixed AxiosRequestConfig header interface by refactoring it to RawAxiosRequestConfig; ([#5420](https://github.com/axios/axios/issues/5420)) ([0811963](https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc)) + +### Contributors to this release + +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+938/-442 (#5456 #5455 #5453 #5451 #5449 #5447 #5446 #5443 #5442 #5439 #5420 )") + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.2.2] - 2022-12-29 + +### Fixed +- fix(ci): fix release script inputs [#5392](https://github.com/axios/axios/pull/5392) +- fix(ci): prerelease scipts [#5377](https://github.com/axios/axios/pull/5377) +- fix(ci): release scripts [#5376](https://github.com/axios/axios/pull/5376) +- fix(ci): typescript tests [#5375](https://github.com/axios/axios/pull/5375) +- fix: Brotli decompression [#5353](https://github.com/axios/axios/pull/5353) +- fix: add missing HttpStatusCode [#5345](https://github.com/axios/axios/pull/5345) + +### Chores +- chore(ci): set conventional-changelog header config [#5406](https://github.com/axios/axios/pull/5406) +- chore(ci): fix automatic contributors resolving [#5403](https://github.com/axios/axios/pull/5403) +- chore(ci): improved logging for the contributors list generator [#5398](https://github.com/axios/axios/pull/5398) +- chore(ci): fix release action [#5397](https://github.com/axios/axios/pull/5397) +- chore(ci): fix version bump script by adding bump argument for target version [#5393](https://github.com/axios/axios/pull/5393) +- chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 [#5342](https://github.com/axios/axios/pull/5342) +- chore(ci): GitHub Actions Release script [#5384](https://github.com/axios/axios/pull/5384) +- chore(ci): release scripts [#5364](https://github.com/axios/axios/pull/5364) + +### Contributors to this release +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- ![avatar](https://avatars.githubusercontent.com/u/1652293?v=4&s=16) [Winnie](https://github.com/winniehell) + +## [1.2.1] - 2022-12-05 + +### Changed +- feat(exports): export mergeConfig [#5151](https://github.com/axios/axios/pull/5151) + +### Fixed +- fix(CancelledError): include config [#4922](https://github.com/axios/axios/pull/4922) +- fix(general): removing multiple/trailing/leading whitespace [#5022](https://github.com/axios/axios/pull/5022) +- fix(headers): decompression for responses without Content-Length header [#5306](https://github.com/axios/axios/pull/5306) +- fix(webWorker): exception to sending form data in web worker [#5139](https://github.com/axios/axios/pull/5139) + +### Refactors +- refactor(types): AxiosProgressEvent.event type to any [#5308](https://github.com/axios/axios/pull/5308) +- refactor(types): add missing types for static AxiosError.from method [#4956](https://github.com/axios/axios/pull/4956) + +### Chores +- chore(docs): remove README link to non-existent upgrade guide [#5307](https://github.com/axios/axios/pull/5307) +- chore(docs): typo in issue template name [#5159](https://github.com/axios/axios/pull/5159) + +### Contributors to this release + +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Zachary Lysobey](https://github.com/zachlysobey) +- [Kevin Ennis](https://github.com/kevincennis) +- [Philipp Loose](https://github.com/phloose) +- [secondl1ght](https://github.com/secondl1ght) +- [wenzheng](https://github.com/0x30) +- [Ivan Barsukov](https://github.com/ovarn) +- [Arthur Fiorette](https://github.com/arthurfiorette) + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.2.0] - 2022-11-10 + +### Changed + +- changed: refactored module exports [#5162](https://github.com/axios/axios/pull/5162) +- change: re-added support for loading Axios with require('axios').default [#5225](https://github.com/axios/axios/pull/5225) + +### Fixed + +- fix: improve AxiosHeaders class [#5224](https://github.com/axios/axios/pull/5224) +- fix: TypeScript type definitions for commonjs [#5196](https://github.com/axios/axios/pull/5196) +- fix: type definition of use method on AxiosInterceptorManager to match the the README [#5071](https://github.com/axios/axios/pull/5071) +- fix: __dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269) +- fix: AxiosError.toJSON method to avoid circular references [#5247](https://github.com/axios/axios/pull/5247) +- fix: Z_BUF_ERROR when content-encoding is set but the response body is empty [#5250](https://github.com/axios/axios/pull/5250) + +### Refactors +- refactor: allowing adapters to be loaded by name [#5277](https://github.com/axios/axios/pull/5277) + +### Chores + +- chore: force CI restart [#5243](https://github.com/axios/axios/pull/5243) +- chore: update ECOSYSTEM.md [#5077](https://github.com/axios/axios/pull/5077) +- chore: update get/index.html [#5116](https://github.com/axios/axios/pull/5116) +- chore: update Sandbox UI/UX [#5205](https://github.com/axios/axios/pull/5205) +- chore:(actions): remove git credentials after checkout [#5235](https://github.com/axios/axios/pull/5235) +- chore(actions): bump actions/dependency-review-action from 2 to 3 [#5266](https://github.com/axios/axios/pull/5266) +- chore(packages): bump loader-utils from 1.4.1 to 1.4.2 [#5295](https://github.com/axios/axios/pull/5295) +- chore(packages): bump engine.io from 6.2.0 to 6.2.1 [#5294](https://github.com/axios/axios/pull/5294) +- chore(packages): bump socket.io-parser from 4.0.4 to 4.0.5 [#5241](https://github.com/axios/axios/pull/5241) +- chore(packages): bump loader-utils from 1.4.0 to 1.4.1 [#5245](https://github.com/axios/axios/pull/5245) +- chore(docs): update Resources links in README [#5119](https://github.com/axios/axios/pull/5119) +- chore(docs): update the link for JSON url [#5265](https://github.com/axios/axios/pull/5265) +- chore(docs): fix broken links [#5218](https://github.com/axios/axios/pull/5218) +- chore(docs): update and rename UPGRADE_GUIDE.md to MIGRATION_GUIDE.md [#5170](https://github.com/axios/axios/pull/5170) +- chore(docs): typo fix line #856 and #920 [#5194](https://github.com/axios/axios/pull/5194) +- chore(docs): typo fix #800 [#5193](https://github.com/axios/axios/pull/5193) +- chore(docs): fix typos [#5184](https://github.com/axios/axios/pull/5184) +- chore(docs): fix punctuation in README.md [#5197](https://github.com/axios/axios/pull/5197) +- chore(docs): update readme in the Handling Errors section - issue reference #5260 [#5261](https://github.com/axios/axios/pull/5261) +- chore: remove \b from filename [#5207](https://github.com/axios/axios/pull/5207) +- chore(docs): update CHANGELOG.md [#5137](https://github.com/axios/axios/pull/5137) +- chore: add sideEffects false to package.json [#5025](https://github.com/axios/axios/pull/5025) + +### Contributors to this release + +- [Maddy Miller](https://github.com/me4502) +- [Amit Saini](https://github.com/amitsainii) +- [ecyrbe](https://github.com/ecyrbe) +- [Ikko Ashimine](https://github.com/eltociear) +- [Geeth Gunnampalli](https://github.com/thetechie7) +- [Shreem Asati](https://github.com/shreem-123) +- [Frieder Bluemle](https://github.com/friederbluemle) +- [윤세영](https://github.com/yunseyeong) +- [Claudio Busatto](https://github.com/cjcbusatto) +- [Remco Haszing](https://github.com/remcohaszing) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Csaba Maulis](https://github.com/om4csaba) +- [MoPaMo](https://github.com/MoPaMo) +- [Daniel Fjeldstad](https://github.com/w3bdesign) +- [Adrien Brunet](https://github.com/adrien-may) +- [Frazer Smith](https://github.com/Fdawgs) +- [HaiTao](https://github.com/836334258) +- [AZM](https://github.com/aziyatali) +- [relbns](https://github.com/relbns) + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.1.3] - 2022-10-15 + +### Added + +- Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113) + +### Fixed + +- Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109) +- Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108) +- Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097) +- Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103) +- Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060) +- Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085) + +### Chores + +- docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046) +- chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054) +- chore: update issue template [#5061](https://github.com/axios/axios/pull/5061) +- chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084) + +### Contributors to this release + +- [Jason Saayman](https://github.com/jasonsaayman) +- [scarf](https://github.com/scarf005) +- [Lenz Weber-Tronic](https://github.com/phryneas) +- [Arvindh](https://github.com/itsarvindh) +- [Félix Legrelle](https://github.com/FelixLgr) +- [Patrick Petrovic](https://github.com/ppati000) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [littledian](https://github.com/littledian) +- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime) + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.1.2] - 2022-10-07 + +### Fixed + +- Fixed broken exports for UMD builds. + +### Contributors to this release + +- [Jason Saayman](https://github.com/jasonsaayman) + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.1.1] - 2022-10-07 + +### Fixed + +- Fixed broken exports for common js. This fix breaks a prior fix, I will fix both issues ASAP but the commonJS use is more impactful. + +### Contributors to this release + +- [Jason Saayman](https://github.com/jasonsaayman) + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.1.0] - 2022-10-06 + +### Fixed + +- Fixed missing exports in type definition index.d.ts [#5003](https://github.com/axios/axios/pull/5003) +- Fixed query params composing [#5018](https://github.com/axios/axios/pull/5018) +- Fixed GenericAbortSignal interface by making it more generic [#5021](https://github.com/axios/axios/pull/5021) +- Fixed adding "clear" to AxiosInterceptorManager [#5010](https://github.com/axios/axios/pull/5010) +- Fixed commonjs & umd exports [#5030](https://github.com/axios/axios/pull/5030) +- Fixed inability to access response headers when using axios 1.x with Jest [#5036](https://github.com/axios/axios/pull/5036) + +### Contributors to this release + +- [Trim21](https://github.com/trim21) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [shingo.sasaki](https://github.com/s-sasaki-0529) +- [Ivan Pepelko](https://github.com/ivanpepelko) +- [Richard Kořínek](https://github.com/risa) + +### PRs +- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) +``` + +⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 +``` + +## [1.0.0] - 2022-10-04 + +### Added + +- Added stack trace to AxiosError [#4624](https://github.com/axios/axios/pull/4624) +- Add AxiosError to AxiosStatic [#4654](https://github.com/axios/axios/pull/4654) +- Replaced Rollup as our build runner [#4596](https://github.com/axios/axios/pull/4596) +- Added generic TS types for the exposed toFormData helper [#4668](https://github.com/axios/axios/pull/4668) +- Added listen callback function [#4096](https://github.com/axios/axios/pull/4096) +- Added instructions for installing using PNPM [#4207](https://github.com/axios/axios/pull/4207) +- Added generic AxiosAbortSignal TS interface to avoid importing AbortController polyfill [#4229](https://github.com/axios/axios/pull/4229) +- Added axios-url-template in ECOSYSTEM.md [#4238](https://github.com/axios/axios/pull/4238) +- Added a clear() function to the request and response interceptors object so a user can ensure that all interceptors have been removed from an axios instance [#4248](https://github.com/axios/axios/pull/4248) +- Added react hook plugin [#4319](https://github.com/axios/axios/pull/4319) +- Adding HTTP status code for transformResponse [#4580](https://github.com/axios/axios/pull/4580) +- Added blob to the list of protocols supported by the browser [#4678](https://github.com/axios/axios/pull/4678) +- Resolving proxy from env on redirect [#4436](https://github.com/axios/axios/pull/4436) +- Added enhanced toFormData implementation with additional options [4704](https://github.com/axios/axios/pull/4704) +- Adding Canceler parameters config and request [#4711](https://github.com/axios/axios/pull/4711) +- Added automatic payload serialization to application/x-www-form-urlencoded [#4714](https://github.com/axios/axios/pull/4714) +- Added the ability for webpack users to overwrite built-ins [#4715](https://github.com/axios/axios/pull/4715) +- Added string[] to AxiosRequestHeaders type [#4322](https://github.com/axios/axios/pull/4322) +- Added the ability for the url-encoded-form serializer to respect the formSerializer config [#4721](https://github.com/axios/axios/pull/4721) +- Added isCancel type assert [#4293](https://github.com/axios/axios/pull/4293) +- Added data URL support for node.js [#4725](https://github.com/axios/axios/pull/4725) +- Adding types for progress event callbacks [#4675](https://github.com/axios/axios/pull/4675) +- URL params serializer [#4734](https://github.com/axios/axios/pull/4734) +- Added axios.formToJSON method [#4735](https://github.com/axios/axios/pull/4735) +- Bower platform add data protocol [#4804](https://github.com/axios/axios/pull/4804) +- Use WHATWG URL API instead of url.parse() [#4852](https://github.com/axios/axios/pull/4852) +- Add ENUM containing Http Status Codes to typings [#4903](https://github.com/axios/axios/pull/4903) +- Improve typing of timeout in index.d.ts [#4934](https://github.com/axios/axios/pull/4934) + +### Changed + +- Updated AxiosError.config to be optional in the type definition [#4665](https://github.com/axios/axios/pull/4665) +- Updated README emphasizing the URLSearchParam built-in interface over other solutions [#4590](https://github.com/axios/axios/pull/4590) +- Include request and config when creating a CanceledError instance [#4659](https://github.com/axios/axios/pull/4659) +- Changed func-names eslint rule to as-needed [#4492](https://github.com/axios/axios/pull/4492) +- Replacing deprecated substr() with slice() as substr() is deprecated [#4468](https://github.com/axios/axios/pull/4468) +- Updating HTTP links in README.md to use HTTPS [#4387](https://github.com/axios/axios/pull/4387) +- Updated to a better trim() polyfill [#4072](https://github.com/axios/axios/pull/4072) +- Updated types to allow specifying partial default headers on instance create [#4185](https://github.com/axios/axios/pull/4185) +- Expanded isAxiosError types [#4344](https://github.com/axios/axios/pull/4344) +- Updated type definition for axios instance methods [#4224](https://github.com/axios/axios/pull/4224) +- Updated eslint config [#4722](https://github.com/axios/axios/pull/4722) +- Updated Docs [#4742](https://github.com/axios/axios/pull/4742) +- Refactored Axios to use ES2017 [#4787](https://github.com/axios/axios/pull/4787) + + +### Deprecated +- There are multiple deprecations, refactors and fixes provided in this release. Please read through the full release notes to see how this may impact your project and use case. + +### Removed + +- Removed incorrect argument for NetworkError constructor [#4656](https://github.com/axios/axios/pull/4656) +- Removed Webpack [#4596](https://github.com/axios/axios/pull/4596) +- Removed function that transform arguments to array [#4544](https://github.com/axios/axios/pull/4544) + +### Fixed + +- Fixed grammar in README [#4649](https://github.com/axios/axios/pull/4649) +- Fixed code error in README [#4599](https://github.com/axios/axios/pull/4599) +- Optimized the code that checks cancellation [#4587](https://github.com/axios/axios/pull/4587) +- Fix url pointing to defaults.js in README [#4532](https://github.com/axios/axios/pull/4532) +- Use type alias instead of interface for AxiosPromise [#4505](https://github.com/axios/axios/pull/4505) +- Fix some word spelling and lint style in code comments [#4500](https://github.com/axios/axios/pull/4500) +- Edited readme with 3 updated browser icons of Chrome, FireFox and Safari [#4414](https://github.com/axios/axios/pull/4414) +- Bump follow-redirects from 1.14.9 to 1.15.0 [#4673](https://github.com/axios/axios/pull/4673) +- Fixing http tests to avoid hanging when assertions fail [#4435](https://github.com/axios/axios/pull/4435) +- Fix TS definition for AxiosRequestTransformer [#4201](https://github.com/axios/axios/pull/4201) +- Fix grammatical issues in README [#4232](https://github.com/axios/axios/pull/4232) +- Fixing instance.defaults.headers type [#4557](https://github.com/axios/axios/pull/4557) +- Fixed race condition on immediate requests cancellation [#4261](https://github.com/axios/axios/pull/4261) +- Fixing Z_BUF_ERROR when no content [#4701](https://github.com/axios/axios/pull/4701) +- Fixing proxy beforeRedirect regression [#4708](https://github.com/axios/axios/pull/4708) +- Fixed AxiosError status code type [#4717](https://github.com/axios/axios/pull/4717) +- Fixed AxiosError stack capturing [#4718](https://github.com/axios/axios/pull/4718) +- Fixing AxiosRequestHeaders typings [#4334](https://github.com/axios/axios/pull/4334) +- Fixed max body length defaults [#4731](https://github.com/axios/axios/pull/4731) +- Fixed toFormData Blob issue on node>v17 [#4728](https://github.com/axios/axios/pull/4728) +- Bump grunt from 1.5.2 to 1.5.3 [#4743](https://github.com/axios/axios/pull/4743) +- Fixing content-type header repeated [#4745](https://github.com/axios/axios/pull/4745) +- Fixed timeout error message for http [4738](https://github.com/axios/axios/pull/4738) +- Request ignores false, 0 and empty string as body values [#4785](https://github.com/axios/axios/pull/4785) +- Added back missing minified builds [#4805](https://github.com/axios/axios/pull/4805) +- Fixed a type error [#4815](https://github.com/axios/axios/pull/4815) +- Fixed a regression bug with unsubscribing from cancel token; [#4819](https://github.com/axios/axios/pull/4819) +- Remove repeated compression algorithm [#4820](https://github.com/axios/axios/pull/4820) +- The error of calling extend to pass parameters [#4857](https://github.com/axios/axios/pull/4857) +- SerializerOptions.indexes allows boolean | null | undefined [#4862](https://github.com/axios/axios/pull/4862) +- Require interceptors to return values [#4874](https://github.com/axios/axios/pull/4874) +- Removed unused imports [#4949](https://github.com/axios/axios/pull/4949) +- Allow null indexes on formSerializer and paramsSerializer [#4960](https://github.com/axios/axios/pull/4960) + +### Chores +- Set permissions for GitHub actions [#4765](https://github.com/axios/axios/pull/4765) +- Included githubactions in the dependabot config [#4770](https://github.com/axios/axios/pull/4770) +- Included dependency review [#4771](https://github.com/axios/axios/pull/4771) +- Update security.md [#4784](https://github.com/axios/axios/pull/4784) +- Remove unnecessary spaces [#4854](https://github.com/axios/axios/pull/4854) +- Simplify the import path of AxiosError [#4875](https://github.com/axios/axios/pull/4875) +- Fix Gitpod dead link [#4941](https://github.com/axios/axios/pull/4941) +- Enable syntax highlighting for a code block [#4970](https://github.com/axios/axios/pull/4970) +- Using Logo Axios in Readme.md [#4993](https://github.com/axios/axios/pull/4993) +- Fix markup for note in README [#4825](https://github.com/axios/axios/pull/4825) +- Fix typo and formatting, add colons [#4853](https://github.com/axios/axios/pull/4853) +- Fix typo in readme [#4942](https://github.com/axios/axios/pull/4942) + +### Security + +- Update SECURITY.md [#4687](https://github.com/axios/axios/pull/4687) + +### Contributors to this release + +- [Bertrand Marron](https://github.com/tusbar) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Dan Mooney](https://github.com/danmooney) +- [Michael Li](https://github.com/xiaoyu-tamu) +- [aong](https://github.com/yxwzaxns) +- [Des Preston](https://github.com/despreston) +- [Ted Robertson](https://github.com/tredondo) +- [zhoulixiang](https://github.com/zh-lx) +- [Arthur Fiorette](https://github.com/arthurfiorette) +- [Kumar Shanu](https://github.com/Kr-Shanu) +- [JALAL](https://github.com/JLL32) +- [Jingyi Lin](https://github.com/MageeLin) +- [Philipp Loose](https://github.com/phloose) +- [Alexander Shchukin](https://github.com/sashsvamir) +- [Dave Cardwell](https://github.com/davecardwell) +- [Cat Scarlet](https://github.com/catscarlet) +- [Luca Pizzini](https://github.com/lpizzinidev) +- [Kai](https://github.com/Schweinepriester) +- [Maxime Bargiel](https://github.com/mbargiel) +- [Brian Helba](https://github.com/brianhelba) +- [reslear](https://github.com/reslear) +- [Jamie Slome](https://github.com/JamieSlome) +- [Landro3](https://github.com/Landro3) +- [rafw87](https://github.com/rafw87) +- [Afzal Sayed](https://github.com/afzalsayed96) +- [Koki Oyatsu](https://github.com/kaishuu0123) +- [Dave](https://github.com/wangcch) +- [暴走老七](https://github.com/baozouai) +- [Spencer](https://github.com/spalger) +- [Adrian Wieprzkowicz](https://github.com/Argeento) +- [Jamie Telin](https://github.com/lejahmie) +- [毛呆](https://github.com/aweikalee) +- [Kirill Shakirov](https://github.com/turisap) +- [Rraji Abdelbari](https://github.com/estarossa0) +- [Jelle Schutter](https://github.com/jelleschutter) +- [Tom Ceuppens](https://github.com/KyorCode) +- [Johann Cooper](https://github.com/JohannCooper) +- [Dimitris Halatsis](https://github.com/mitsos1os) +- [chenjigeng](https://github.com/chenjigeng) +- [João Gabriel Quaresma](https://github.com/joaoGabriel55) +- [Victor Augusto](https://github.com/VictorAugDB) +- [neilnaveen](https://github.com/neilnaveen) +- [Pavlos](https://github.com/psmoros) +- [Kiryl Valkovich](https://github.com/visortelle) +- [Naveen](https://github.com/naveensrinivasan) +- [wenzheng](https://github.com/0x30) +- [hcwhan](https://github.com/hcwhan) +- [Bassel Rachid](https://github.com/basselworkforce) +- [Grégoire Pineau](https://github.com/lyrixx) +- [felipedamin](https://github.com/felipedamin) +- [Karl Horky](https://github.com/karlhorky) +- [Yue JIN](https://github.com/kingyue737) +- [Usman Ali Siddiqui](https://github.com/usman250994) +- [WD](https://github.com/techbirds) +- [Günther Foidl](https://github.com/gfoidl) +- [Stephen Jennings](https://github.com/jennings) +- [C.T.Lin](https://github.com/chentsulin) +- [mia-z](https://github.com/mia-z) +- [Parth Banathia](https://github.com/Parth0105) +- [parth0105pluang](https://github.com/parth0105pluang) +- [Marco Weber](https://github.com/mrcwbr) +- [Luca Pizzini](https://github.com/lpizzinidev) +- [Willian Agostini](https://github.com/WillianAgostini) +- [Huyen Nguyen](https://github.com/huyenltnguyen) \ No newline at end of file diff --git a/node_modules/axios/LICENSE b/node_modules/axios/LICENSE new file mode 100644 index 00000000..05006a51 --- /dev/null +++ b/node_modules/axios/LICENSE @@ -0,0 +1,7 @@ +# Copyright (c) 2014-present Matt Zabriskie & Collaborators + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/axios/MIGRATION_GUIDE.md b/node_modules/axios/MIGRATION_GUIDE.md new file mode 100644 index 00000000..ec3ae0da --- /dev/null +++ b/node_modules/axios/MIGRATION_GUIDE.md @@ -0,0 +1,3 @@ +# Migration Guide + +## 0.x.x -> 1.1.0 diff --git a/node_modules/axios/README.md b/node_modules/axios/README.md new file mode 100644 index 00000000..f012e446 --- /dev/null +++ b/node_modules/axios/README.md @@ -0,0 +1,1647 @@ +

+ Platinum sponsors +
+

+ +
+ + + + + + + + +

Alloy is the integration development platform that makes it simple and
fast for SaaS companies to launch critical user-facing integrations.

+

+ Sign up free • + Documentation +

+

+
+ +

+ Gold sponsors +

+

+ +
+ + + + + + + +

API-first authentication, authorization, and fraud prevention

+

+ Website • + DocumentationNode.js Backend SDK +

+
+ + +

+
+
+
+ +

Promise based HTTP client for the browser and node.js

+ +

+ Website • + Documentation +

+ +
+ +[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) +[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) +[![Build status](https://img.shields.io/github/actions/workflow/status/axios/axios/ci.yml?branch=v1.x&label=CI&logo=github&style=flat-square)](https://github.com/axios/axios/actions/workflows/ci.yml) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod&style=flat-square)](https://gitpod.io/#https://github.com/axios/axios) +[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) +[![install size](https://img.shields.io/badge/dynamic/json?url=https://packagephobia.com/v2/api.json?p=axios&query=$.install.pretty&label=install%20size&style=flat-square)](https://packagephobia.now.sh/result?p=axios) +[![npm bundle size](https://img.shields.io/bundlephobia/minzip/axios?style=flat-square)](https://bundlephobia.com/package/axios@latest) +[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](https://npm-stat.com/charts.html?package=axios) +[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) +[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) +[![Known Vulnerabilities](https://snyk.io/test/npm/axios/badge.svg)](https://snyk.io/test/npm/axios) + + + + +
+ +## Table of Contents + + - [Features](#features) + - [Browser Support](#browser-support) + - [Installing](#installing) + - [Package manager](#package-manager) + - [CDN](#cdn) + - [Example](#example) + - [Axios API](#axios-api) + - [Request method aliases](#request-method-aliases) + - [Concurrency 👎](#concurrency-deprecated) + - [Creating an instance](#creating-an-instance) + - [Instance methods](#instance-methods) + - [Request Config](#request-config) + - [Response Schema](#response-schema) + - [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) + - [Interceptors](#interceptors) + - [Multiple Interceptors](#multiple-interceptors) + - [Handling Errors](#handling-errors) + - [Cancellation](#cancellation) + - [AbortController](#abortcontroller) + - [CancelToken 👎](#canceltoken-deprecated) + - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [URLSearchParams](#urlsearchparams) + - [Query string](#query-string-older-browsers) + - [🆕 Automatic serialization](#-automatic-serialization-to-urlsearchparams) + - [Using multipart/form-data format](#using-multipartform-data-format) + - [FormData](#formdata) + - [🆕 Automatic serialization](#-automatic-serialization-to-formdata) + - [Files Posting](#files-posting) + - [HTML Form Posting](#-html-form-posting-browser) + - [🆕 Progress capturing](#-progress-capturing) + - [🆕 Rate limiting](#-progress-capturing) + - [🆕 AxiosHeaders](#-axiosheaders) + - [Semver](#semver) + - [Promises](#promises) + - [TypeScript](#typescript) + - [Resources](#resources) + - [Credits](#credits) + - [License](#license) + +## Features + +- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser +- Make [http](https://nodejs.org/api/http.html) requests from node.js +- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API +- Intercept request and response +- Transform request and response data +- Cancel requests +- Automatic transforms for [JSON](https://www.json.org/json-en.html) data +- 🆕 Automatic data object serialization to `multipart/form-data` and `x-www-form-urlencoded` body encodings +- Client side support for protecting against [XSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) + +## Browser Support + +![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) | ![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | +--- | --- | --- | --- | --- | --- | +Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | + +[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) + +## Installing + +### Package manager + +Using npm: + +```bash +$ npm install axios +``` + +Using bower: + +```bash +$ bower install axios +``` + +Using yarn: + +```bash +$ yarn add axios +``` + +Using pnpm: + +```bash +$ pnpm add axios +``` + +Once the package is installed, you can import the library using `import` or `require` approach: + +```js +import axios, {isCancel, AxiosError} from 'axios'; +``` + +You can also use the default export, since the named export is just a re-export from the Axios factory: + +```js +import axios from 'axios'; + +console.log(axios.isCancel('something')); +```` + +If you use `require` for importing, **only default export is available**: + +```js +const axios = require('axios'); + +console.log(axios.isCancel('something')); +``` + +For cases where something went wrong when trying to import a module into a custom or legacy environment, +you can try importing the module package directly: + +```js +const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017) +// const axios = require('axios/dist/node/axios.cjs'); // node commonJS bundle (ES2017) +``` + +### CDN + +Using jsDelivr CDN (ES5 UMD browser module): + +```html + +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +> **Note**: CommonJS usage +> In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()`, use the following approach: + +```js +import axios from 'axios'; +//const axios = require('axios'); // legacy way + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .finally(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .finally(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **Note**: `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'https://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience, aliases have been provided for all common request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional config that allows you to customize serializing `params`. + paramsSerializer: { + + //Custom encoder function which sends key/value pairs in an iterative fashion. + encode?: (param: string): string => { /* Do custom operations here and return transformed string */ }, + + // Custom serializer function for the entire parameter. Allows user to mimic pre 1.x behaviour. + serialize?: (params: Record, options?: ParamsSerializerOptions ), + + //Configuration for formatting array indexes in the params. + indexes: false // Three available options: (1) indexes: null (leads to no brackets), (2) (default) indexes: false (leads to empty brackets), (3) indexes: true (leads to brackets with indexes). + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer, FormData (form-data package) + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md). + adapter: function (config) { + /* ... */ + }, + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `undefined` (default) - set XSRF header only for the same origin requests + withXSRFToken: boolean | undefined | ((config: InternalAxiosRequestConfig) => boolean | undefined), + + // `onUploadProgress` allows handling of progress events for uploads + // browser & node.js + onUploadProgress: function ({loaded, total, progress, bytes, estimated, rate, upload = true}) { + // Do whatever you want with the Axios progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser & node.js + onDownloadProgress: function ({loaded, total, progress, bytes, estimated, rate, download = true}) { + // Do whatever you want with the Axios progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 21, // default + + // `beforeRedirect` defines a function that will be called before redirect. + // Use this to adjust the request options upon redirecting, + // to inspect the latest response headers, + // or to cancel the request by throwing an error + // If maxRedirects is set to 0, `beforeRedirect` is not used. + beforeRedirect: (options, { headers }) => { + if (options.hostname === "example.com") { + options.auth = "user:password"; + } + }, + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `transport` determines the transport method that will be used to make the request. If defined, it will be used. Otherwise, if `maxRedirects` is 0, the default `http` or `https` library will be used, depending on the protocol specified in `protocol`. Otherwise, the `httpFollow` or `httpsFollow` library will be used, again depending on the protocol, which can handle redirects. + transport: undefined, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + // hostname: '127.0.0.1' // Takes precedence over 'host' if both are defined + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // an alternative way to cancel Axios requests using AbortController + signal: new AbortController().signal, + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // `insecureHTTPParser` boolean. + // Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers. + // This may allow interoperability with non-conformant HTTP implementations. + // Using the insecure parser should be avoided. + // see options https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback + // see also https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#strict-http-header-parsing-none + insecureHTTPParser: undefined, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + }, + + env: { + // The FormData class to be used to automatically serialize the payload into a FormData object + FormData: window?.FormData || global?.FormData + }, + + formSerializer: { + visitor: (value, key, path, helpers) => {}; // custom visitor function to serialize form values + dots: boolean; // use dots instead of brackets format + metaTokens: boolean; // keep special endings like {} in parameter key + indexes: boolean; // array indexes format null - no brackets, false - empty brackets, true - brackets with indexes + }, + + // http adapter only (node.js) + maxRate: [ + 100 * 1024, // 100KB/s upload limit, + 100 * 1024 // 100KB/s download limit + ] +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lowercase and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults/index.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js +// Add a request interceptor +axios.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can also clear all interceptors for requests or responses. +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +instance.interceptors.request.clear(); // Removes interceptors from requests +instance.interceptors.response.use(function () {/*...*/}); +instance.interceptors.response.clear(); // Removes interceptors from responses +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +### Multiple Interceptors + +Given you add multiple response interceptors +and when the response was fulfilled +- then each interceptor is executed +- then they are executed in the order they were added +- then only the last interceptor's result is returned +- then every interceptor receives the result of its predecessor +- and when the fulfillment-interceptor throws + - then the following fulfillment-interceptor is not called + - then the following rejection-interceptor is called + - once caught, another following fulfill-interceptor is called again (just like in a promise chain). + +Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all this in code. + +## Error Types + +There are many different axios error messages that can appear that can provide basic information about the specifics of the error and where opportunities may lie in debugging. + +The general structure of axios errors is as follows: +| Property | Definition | +| -------- | ---------- | +| message | A quick summary of the error message and the status it failed with. | +| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. | +| stack | Provides the stack trace of the error. | +| config | An axios config object with specific instance configurations defined by the user from when the request was made | +| code | Represents an axios identified error. The table below lists out specific definitions for internal axios error. | +| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings. + +Below is a list of potential axios identified error +| Code | Definition | +| -------- | ---------- | +| ERR_BAD_OPTION_VALUE | Invalid or unsupported value provided in axios configuration. | +| ERR_BAD_OPTION | Invalid option provided in axios configuration. | +| ECONNABORTED | Request timed out due to exceeding timeout specified in axios configuration. | +| ETIMEDOUT | Request timed out due to exceeding default axios timelimit. | +| ERR_NETWORK | Network-related issue. +| ERR_FR_TOO_MANY_REDIRECTS | Request is redirected too many times; exceeds max redirects specified in axios configuration. +| ERR_DEPRECATED | Deprecated feature or method used in axios. +| ERR_BAD_RESPONSE | Response cannot be parsed properly or is in an unexpected format. +| ERR_BAD_REQUEST | Requested has unexpected format or missing required parameters. | +| ERR_CANCELED | Feature or method is canceled explicitly by the user. +| ERR_NOT_SUPPORT | Feature or method not supported in the current axios environment. +| ERR_INVALID_URL | Invalid URL provided for axios request. + +## Handling Errors + +the default behavior is to reject every response that returns with a status code that falls out of the range of 2xx and treat it as an error. + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can override the default condition (status >= 200 && status < 300) and define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +### AbortController + +Starting from `v0.22.0` Axios supports AbortController to cancel requests in fetch API way: + +```js +const controller = new AbortController(); + +axios.get('/foo/bar', { + signal: controller.signal +}).then(function(response) { + //... +}); +// cancel the request +controller.abort() +``` + +### CancelToken `👎deprecated` + +You can also cancel a request using a *CancelToken*. + +> The axios cancel token API is based on the withdrawn [cancellable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +> This API is deprecated since v0.22.0 and shouldn't be used in new projects + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +> **Note:** you can cancel several requests with the same cancel token/abort controller. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make a real request. + +> During the transition period, you can use both cancellation APIs, even for the same request: + +## Using `application/x-www-form-urlencoded` format + +### URLSearchParams + +By default, axios serializes JavaScript objects to `JSON`. To send data in the [`application/x-www-form-urlencoded` format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) instead, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API, which is [supported](http://www.caniuse.com/#feat=urlsearchparams) in the vast majority of browsers,and [ Node](https://nodejs.org/api/url.html#url_class_urlsearchparams) starting with v10 (released in 2018). + +```js +const params = new URLSearchParams({ foo: 'bar' }); +params.append('extraparam', 'value'); +axios.post('/foo', params); +``` + +### Query string (Older browsers) + +For compatibility with very old browsers, there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Older Node.js versions + +For older Node.js engines, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('https://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +> **Note**: The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has [known issues](https://github.com/nodejs/node-v0.x-archive/issues/1665) with that use case. + +### 🆕 Automatic serialization to URLSearchParams + +Axios will automatically serialize the data object to urlencoded format if the content-type header is set to "application/x-www-form-urlencoded". + +```js +const data = { + x: 1, + arr: [1, 2, 3], + arr2: [1, [2], 3], + users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}], +}; + +await axios.postForm('https://postman-echo.com/post', data, + {headers: {'content-type': 'application/x-www-form-urlencoded'}} +); +``` + +The server will handle it as: + +```js + { + x: '1', + 'arr[]': [ '1', '2', '3' ], + 'arr2[0]': '1', + 'arr2[1][0]': '2', + 'arr2[2]': '3', + 'arr3[]': [ '1', '2', '3' ], + 'users[0][name]': 'Peter', + 'users[0][surname]': 'griffin', + 'users[1][name]': 'Thomas', + 'users[1][surname]': 'Anderson' + } +```` + +If your backend body-parser (like `body-parser` of `express.js`) supports nested objects decoding, you will get the same object on the server-side automatically + +```js + var app = express(); + + app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies + + app.post('/', function (req, res, next) { + // echo body as JSON + res.send(JSON.stringify(req.body)); + }); + + server = app.listen(3000); +``` + +## Using `multipart/form-data` format + +### FormData + +To send the data as a `multipart/formdata` you need to pass a formData instance as a payload. +Setting the `Content-Type` header is not required as Axios guesses it based on the payload type. + +```js +const formData = new FormData(); +formData.append('foo', 'bar'); + +axios.post('https://httpbin.org/post', formData); +``` + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form) +``` + +### 🆕 Automatic serialization to FormData + +Starting from `v0.27.0`, Axios supports automatic object serialization to a FormData object if the request `Content-Type` +header is set to `multipart/form-data`. + +The following request will submit the data in a FormData format (Browser & Node.js): + +```js +import axios from 'axios'; + +axios.post('https://httpbin.org/post', {x: 1}, { + headers: { + 'Content-Type': 'multipart/form-data' + } +}).then(({data}) => console.log(data)); +``` + +In the `node.js` build, the ([`form-data`](https://github.com/form-data/form-data)) polyfill is used by default. + +You can overload the FormData class by setting the `env.FormData` config variable, +but you probably won't need it in most cases: + +```js +const axios = require('axios'); +var FormData = require('form-data'); + +axios.post('https://httpbin.org/post', {x: 1, buf: new Buffer(10)}, { + headers: { + 'Content-Type': 'multipart/form-data' + } +}).then(({data}) => console.log(data)); +``` + +Axios FormData serializer supports some special endings to perform the following operations: + +- `{}` - serialize the value with JSON.stringify +- `[]` - unwrap the array-like object as separate fields with the same key + +> **Note**: unwrap/expand operation will be used by default on arrays and FileList objects + +FormData serializer supports additional options via `config.formSerializer: object` property to handle rare cases: + +- `visitor: Function` - user-defined visitor function that will be called recursively to serialize the data object +to a `FormData` object by following custom rules. + +- `dots: boolean = false` - use dot notation instead of brackets to serialize arrays and objects; + +- `metaTokens: boolean = true` - add the special ending (e.g `user{}: '{"name": "John"}'`) in the FormData key. +The back-end body-parser could potentially use this meta-information to automatically parse the value as JSON. + +- `indexes: null|false|true = false` - controls how indexes will be added to unwrapped keys of `flat` array-like objects + + - `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`) + - `false`(default) - add empty brackets (`arr[]: 1`, `arr[]: 2`, `arr[]: 3`) + - `true` - add brackets with indexes (`arr[0]: 1`, `arr[1]: 2`, `arr[2]: 3`) + +Let's say we have an object like this one: + +```js +const obj = { + x: 1, + arr: [1, 2, 3], + arr2: [1, [2], 3], + users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}], + 'obj2{}': [{x:1}] +}; +``` + +The following steps will be executed by the Axios serializer internally: + +```js +const formData = new FormData(); +formData.append('x', '1'); +formData.append('arr[]', '1'); +formData.append('arr[]', '2'); +formData.append('arr[]', '3'); +formData.append('arr2[0]', '1'); +formData.append('arr2[1][0]', '2'); +formData.append('arr2[2]', '3'); +formData.append('users[0][name]', 'Peter'); +formData.append('users[0][surname]', 'Griffin'); +formData.append('users[1][name]', 'Thomas'); +formData.append('users[1][surname]', 'Anderson'); +formData.append('obj2{}', '[{"x":1}]'); +``` + +Axios supports the following shortcut methods: `postForm`, `putForm`, `patchForm` +which are just the corresponding http methods with the `Content-Type` header preset to `multipart/form-data`. + +## Files Posting + +You can easily submit a single file: + +```js +await axios.postForm('https://httpbin.org/post', { + 'myVar' : 'foo', + 'file': document.querySelector('#fileInput').files[0] +}); +``` + +or multiple files as `multipart/form-data`: + +```js +await axios.postForm('https://httpbin.org/post', { + 'files[]': document.querySelector('#fileInput').files +}); +``` + +`FileList` object can be passed directly: + +```js +await axios.postForm('https://httpbin.org/post', document.querySelector('#fileInput').files) +``` + +All files will be sent with the same field names: `files[]`. + +## 🆕 HTML Form Posting (browser) + +Pass HTML Form element as a payload to submit it as `multipart/form-data` content. + +```js +await axios.postForm('https://httpbin.org/post', document.querySelector('#htmlForm')); +``` + +`FormData` and `HTMLForm` objects can also be posted as `JSON` by explicitly setting the `Content-Type` header to `application/json`: + +```js +await axios.post('https://httpbin.org/post', document.querySelector('#htmlForm'), { + headers: { + 'Content-Type': 'application/json' + } +}) +``` + +For example, the Form + +```html +
+ + + + + + + + + +
+``` + +will be submitted as the following JSON object: + +```js +{ + "foo": "1", + "deep": { + "prop": { + "spaced": "3" + } + }, + "baz": [ + "4", + "5" + ], + "user": { + "age": "value2" + } +} +```` + +Sending `Blobs`/`Files` as JSON (`base64`) is not currently supported. + +## 🆕 Progress capturing + +Axios supports both browser and node environments to capture request upload/download progress. + +```js +await axios.post(url, data, { + onUploadProgress: function (axiosProgressEvent) { + /*{ + loaded: number; + total?: number; + progress?: number; // in range [0..1] + bytes: number; // how many bytes have been transferred since the last trigger (delta) + estimated?: number; // estimated time in seconds + rate?: number; // upload speed in bytes + upload: true; // upload sign + }*/ + }, + + onDownloadProgress: function (axiosProgressEvent) { + /*{ + loaded: number; + total?: number; + progress?: number; + bytes: number; + estimated?: number; + rate?: number; // download speed in bytes + download: true; // download sign + }*/ + } +}); +``` + +You can also track stream upload/download progress in node.js: + +```js +const {data} = await axios.post(SERVER_URL, readableStream, { + onUploadProgress: ({progress}) => { + console.log((progress * 100).toFixed(2)); + }, + + headers: { + 'Content-Length': contentLength + }, + + maxRedirects: 0 // avoid buffering the entire stream +}); +```` + +> **Note:** +> Capturing FormData upload progress is not currently supported in node.js environments. + +> **⚠️ Warning** +> It is recommended to disable redirects by setting maxRedirects: 0 to upload the stream in the **node.js** environment, +> as follow-redirects package will buffer the entire stream in RAM without following the "backpressure" algorithm. + + +## 🆕 Rate limiting + +Download and upload rate limits can only be set for the http adapter (node.js): + +```js +const {data} = await axios.post(LOCAL_SERVER_URL, myBuffer, { + onUploadProgress: ({progress, rate}) => { + console.log(`Upload [${(progress*100).toFixed(2)}%]: ${(rate / 1024).toFixed(2)}KB/s`) + }, + + maxRate: [100 * 1024], // 100KB/s limit +}); +``` + +## 🆕 AxiosHeaders + +Axios has its own `AxiosHeaders` class to manipulate headers using a Map-like API that guarantees caseless work. +Although HTTP is case-insensitive in headers, Axios will retain the case of the original header for stylistic reasons +and for a workaround when servers mistakenly consider the header's case. +The old approach of directly manipulating headers object is still available, but deprecated and not recommended for future usage. + +### Working with headers + +An AxiosHeaders object instance can contain different types of internal values. that control setting and merging logic. +The final headers object with string values is obtained by Axios by calling the `toJSON` method. + +> Note: By JSON here we mean an object consisting only of string values intended to be sent over the network. + +The header value can be one of the following types: +- `string` - normal string value that will be sent to the server +- `null` - skip header when rendering to JSON +- `false` - skip header when rendering to JSON, additionally indicates that `set` method must be called with `rewrite` option set to `true` + to overwrite this value (Axios uses this internally to allow users to opt out of installing certain headers like `User-Agent` or `Content-Type`) +- `undefined` - value is not set + +> Note: The header value is considered set if it is not equal to undefined. + +The headers object is always initialized inside interceptors and transformers: + +```ts + axios.interceptors.request.use((request: InternalAxiosRequestConfig) => { + request.headers.set('My-header', 'value'); + + request.headers.set({ + "My-set-header1": "my-set-value1", + "My-set-header2": "my-set-value2" + }); + + request.headers.set('User-Agent', false); // disable subsequent setting the header by Axios + + request.headers.setContentType('text/plain'); + + request.headers['My-set-header2'] = 'newValue' // direct access is deprecated + + return request; + } + ); +```` + +You can iterate over an `AxiosHeaders` instance using a `for...of` statement: + +````js +const headers = new AxiosHeaders({ + foo: '1', + bar: '2', + baz: '3' +}); + +for(const [header, value] of headers) { + console.log(header, value); +} + +// foo 1 +// bar 2 +// baz 3 +```` + +### new AxiosHeaders(headers?) + +Constructs a new `AxiosHeaders` instance. + +``` +constructor(headers?: RawAxiosHeaders | AxiosHeaders | string); +``` + +If the headers object is a string, it will be parsed as RAW HTTP headers. + +````js +const headers = new AxiosHeaders(` +Host: www.bing.com +User-Agent: curl/7.54.0 +Accept: */*`); + +console.log(headers); + +// Object [AxiosHeaders] { +// host: 'www.bing.com', +// 'user-agent': 'curl/7.54.0', +// accept: '*/*' +// } +```` + +### AxiosHeaders#set + +```ts +set(headerName, value: Axios, rewrite?: boolean); +set(headerName, value, rewrite?: (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean); +set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean); +``` + +The `rewrite` argument controls the overwriting behavior: +- `false` - do not overwrite if header's value is set (is not `undefined`) +- `undefined` (default) - overwrite the header unless its value is set to `false` +- `true` - rewrite anyway + +The option can also accept a user-defined function that determines whether the value should be overwritten or not. + +Returns `this`. + +### AxiosHeaders#get(header) + +``` + get(headerName: string, matcher?: true | AxiosHeaderMatcher): AxiosHeaderValue; + get(headerName: string, parser: RegExp): RegExpExecArray | null; +```` + +Returns the internal value of the header. It can take an extra argument to parse the header's value with `RegExp.exec`, +matcher function or internal key-value parser. + +```ts +const headers = new AxiosHeaders({ + 'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h' +}); + +console.log(headers.get('Content-Type')); +// multipart/form-data; boundary=Asrf456BGe4h + +console.log(headers.get('Content-Type', true)); // parse key-value pairs from a string separated with \s,;= delimiters: +// [Object: null prototype] { +// 'multipart/form-data': undefined, +// boundary: 'Asrf456BGe4h' +// } + + +console.log(headers.get('Content-Type', (value, name, headers) => { + return String(value).replace(/a/g, 'ZZZ'); +})); +// multipZZZrt/form-dZZZtZZZ; boundZZZry=Asrf456BGe4h + +console.log(headers.get('Content-Type', /boundary=(\w+)/)?.[0]); +// boundary=Asrf456BGe4h + +``` + +Returns the value of the header. + +### AxiosHeaders#has(header, matcher?) + +``` +has(header: string, matcher?: AxiosHeaderMatcher): boolean; +``` + +Returns `true` if the header is set (has no `undefined` value). + +### AxiosHeaders#delete(header, matcher?) + +``` +delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; +``` + +Returns `true` if at least one header has been removed. + +### AxiosHeaders#clear(matcher?) + +``` +clear(matcher?: AxiosHeaderMatcher): boolean; +``` + +Removes all headers. +Unlike the `delete` method matcher, this optional matcher will be used to match against the header name rather than the value. + +```ts +const headers = new AxiosHeaders({ + 'foo': '1', + 'x-foo': '2', + 'x-bar': '3', +}); + +console.log(headers.clear(/^x-/)); // true + +console.log(headers.toJSON()); // [Object: null prototype] { foo: '1' } +``` + +Returns `true` if at least one header has been cleared. + +### AxiosHeaders#normalize(format); + +If the headers object was changed directly, it can have duplicates with the same name but in different cases. +This method normalizes the headers object by combining duplicate keys into one. +Axios uses this method internally after calling each interceptor. +Set `format` to true for converting headers name to lowercase and capitalize the initial letters (`cOntEnt-type` => `Content-Type`) + +```js +const headers = new AxiosHeaders({ + 'foo': '1', +}); + +headers.Foo = '2'; +headers.FOO = '3'; + +console.log(headers.toJSON()); // [Object: null prototype] { foo: '1', Foo: '2', FOO: '3' } +console.log(headers.normalize().toJSON()); // [Object: null prototype] { foo: '3' } +console.log(headers.normalize(true).toJSON()); // [Object: null prototype] { Foo: '3' } +``` + +Returns `this`. + +### AxiosHeaders#concat(...targets) + +``` +concat(...targets: Array): AxiosHeaders; +``` + +Merges the instance with targets into a new `AxiosHeaders` instance. If the target is a string, it will be parsed as RAW HTTP headers. + +Returns a new `AxiosHeaders` instance. + +### AxiosHeaders#toJSON(asStrings?) + +```` +toJSON(asStrings?: boolean): RawAxiosHeaders; +```` + +Resolve all internal headers values into a new null prototype object. +Set `asStrings` to true to resolve arrays as a string containing all elements, separated by commas. + +### AxiosHeaders.from(thing?) + +```` +from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; +```` + +Returns a new `AxiosHeaders` instance created from the raw headers passed in, +or simply returns the given headers object if it's an `AxiosHeaders` instance. + +### AxiosHeaders.concat(...targets) + +```` +concat(...targets: Array): AxiosHeaders; +```` + +Returns a new `AxiosHeaders` instance created by merging the target objects. + +### Shortcuts + +The following shortcuts are available: + +- `setContentType`, `getContentType`, `hasContentType` + +- `setContentLength`, `getContentLength`, `hasContentLength` + +- `setAccept`, `getAccept`, `hasAccept` + +- `setUserAgent`, `getUserAgent`, `hasUserAgent` + +- `setContentEncoding`, `getContentEncoding`, `hasContentEncoding` + + +## Semver + +Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](https://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](https://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +Because axios dual publishes with an ESM default export and a CJS `module.exports`, there are some caveats. +The recommended setting is to use `"moduleResolution": "node16"` (this is implied by `"module": "node16"`). Note that this requires TypeScript 4.7 or greater. +If use ESM, your settings should be fine. +If you compile TypeScript to CJS and you can’t use `"moduleResolution": "node 16"`, you have to enable `esModuleInterop`. +If you use TypeScript to type check CJS JavaScript code, your only option is to use `"moduleResolution": "node16"`. + +## Online one-click setup + +You can use Gitpod, an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/main/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) +* [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [AngularJS](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of AngularJS. + +## License + +[MIT](LICENSE) diff --git a/node_modules/axios/SECURITY.md b/node_modules/axios/SECURITY.md new file mode 100644 index 00000000..a5a2b7d2 --- /dev/null +++ b/node_modules/axios/SECURITY.md @@ -0,0 +1,6 @@ +# Reporting a Vulnerability + +If you discover a security vulnerability in axios please disclose it via [our huntr page](https://huntr.dev/repos/axios/axios/). Bounty eligibility, CVE assignment, response times and past reports are all there. + + +Thank you for improving the security of axios. diff --git a/node_modules/axios/dist/axios.js b/node_modules/axios/dist/axios.js new file mode 100644 index 00000000..24a83e53 --- /dev/null +++ b/node_modules/axios/dist/axios.js @@ -0,0 +1,3422 @@ +// Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory()); +})(this, (function () { 'use strict'; + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = null != arguments[i] ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _regeneratorRuntime() { + _regeneratorRuntime = function () { + return exports; + }; + var exports = {}, + Op = Object.prototype, + hasOwn = Op.hasOwnProperty, + $Symbol = "function" == typeof Symbol ? Symbol : {}, + iteratorSymbol = $Symbol.iterator || "@@iterator", + asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", + toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + function define(obj, key, value) { + return Object.defineProperty(obj, key, { + value: value, + enumerable: !0, + configurable: !0, + writable: !0 + }), obj[key]; + } + try { + define({}, ""); + } catch (err) { + define = function (obj, key, value) { + return obj[key] = value; + }; + } + function wrap(innerFn, outerFn, self, tryLocsList) { + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, + generator = Object.create(protoGenerator.prototype), + context = new Context(tryLocsList || []); + return generator._invoke = function (innerFn, self, context) { + var state = "suspendedStart"; + return function (method, arg) { + if ("executing" === state) throw new Error("Generator is already running"); + if ("completed" === state) { + if ("throw" === method) throw arg; + return doneResult(); + } + for (context.method = method, context.arg = arg;;) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { + if ("suspendedStart" === state) throw state = "completed", context.arg; + context.dispatchException(context.arg); + } else "return" === context.method && context.abrupt("return", context.arg); + state = "executing"; + var record = tryCatch(innerFn, self, context); + if ("normal" === record.type) { + if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; + return { + value: record.arg, + done: context.done + }; + } + "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); + } + }; + }(innerFn, self, context), generator; + } + function tryCatch(fn, obj, arg) { + try { + return { + type: "normal", + arg: fn.call(obj, arg) + }; + } catch (err) { + return { + type: "throw", + arg: err + }; + } + } + exports.wrap = wrap; + var ContinueSentinel = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var IteratorPrototype = {}; + define(IteratorPrototype, iteratorSymbol, function () { + return this; + }); + var getProto = Object.getPrototypeOf, + NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function (method) { + define(prototype, method, function (arg) { + return this._invoke(method, arg); + }); + }); + } + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if ("throw" !== record.type) { + var result = record.arg, + value = result.value; + return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { + invoke("next", value, resolve, reject); + }, function (err) { + invoke("throw", err, resolve, reject); + }) : PromiseImpl.resolve(value).then(function (unwrapped) { + result.value = unwrapped, resolve(result); + }, function (error) { + return invoke("throw", error, resolve, reject); + }); + } + reject(record.arg); + } + var previousPromise; + this._invoke = function (method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function (resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + }; + } + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (undefined === method) { + if (context.delegate = null, "throw" === context.method) { + if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; + context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); + } + return ContinueSentinel; + } + var record = tryCatch(method, delegate.iterator, context.arg); + if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; + var info = record.arg; + return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); + } + function pushTryEntry(locs) { + var entry = { + tryLoc: locs[0] + }; + 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); + } + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal", delete record.arg, entry.completion = record; + } + function Context(tryLocsList) { + this.tryEntries = [{ + tryLoc: "root" + }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); + } + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) return iteratorMethod.call(iterable); + if ("function" == typeof iterable.next) return iterable; + if (!isNaN(iterable.length)) { + var i = -1, + next = function next() { + for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; + return next.value = undefined, next.done = !0, next; + }; + return next.next = next; + } + } + return { + next: doneResult + }; + } + function doneResult() { + return { + value: undefined, + done: !0 + }; + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { + var ctor = "function" == typeof genFun && genFun.constructor; + return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); + }, exports.mark = function (genFun) { + return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; + }, exports.awrap = function (arg) { + return { + __await: arg + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { + return this; + }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { + void 0 === PromiseImpl && (PromiseImpl = Promise); + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); + }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { + return this; + }), define(Gp, "toString", function () { + return "[object Generator]"; + }), exports.keys = function (object) { + var keys = []; + for (var key in object) keys.push(key); + return keys.reverse(), function next() { + for (; keys.length;) { + var key = keys.pop(); + if (key in object) return next.value = key, next.done = !1, next; + } + return next.done = !0, next; + }; + }, exports.values = values, Context.prototype = { + constructor: Context, + reset: function (skipTempReset) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); + }, + stop: function () { + this.done = !0; + var rootRecord = this.tryEntries[0].completion; + if ("throw" === rootRecord.type) throw rootRecord.arg; + return this.rval; + }, + dispatchException: function (exception) { + if (this.done) throw exception; + var context = this; + function handle(loc, caught) { + return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; + } + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i], + record = entry.completion; + if ("root" === entry.tryLoc) return handle("end"); + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"), + hasFinally = hasOwn.call(entry, "finallyLoc"); + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); + } else if (hasCatch) { + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); + } else { + if (!hasFinally) throw new Error("try statement without catch or finally"); + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); + } + } + } + }, + abrupt: function (type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); + var record = finallyEntry ? finallyEntry.completion : {}; + return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); + }, + complete: function (record, afterLoc) { + if ("throw" === record.type) throw record.arg; + return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; + }, + finish: function (finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; + } + }, + catch: function (tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if ("throw" === record.type) { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function (iterable, resultName, nextLoc) { + return this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }, "next" === this.method && (this.arg = undefined), ContinueSentinel; + } + }, exports; + } + function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); + } + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + function _toArray(arr) { + return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + function _iterableToArrayLimit(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; + } + + // utils is a library of generic helper functions non-specific to axios + + var toString = Object.prototype.toString; + var getPrototypeOf = Object.getPrototypeOf; + var kindOf = function (cache) { + return function (thing) { + var str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); + }; + }(Object.create(null)); + var kindOfTest = function kindOfTest(type) { + type = type.toLowerCase(); + return function (thing) { + return kindOf(thing) === type; + }; + }; + var typeOfTest = function typeOfTest(type) { + return function (thing) { + return _typeof(thing) === type; + }; + }; + + /** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ + var isArray = Array.isArray; + + /** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ + var isUndefined = typeOfTest('undefined'); + + /** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ + function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); + } + + /** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ + var isArrayBuffer = kindOfTest('ArrayBuffer'); + + /** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ + function isArrayBufferView(val) { + var result; + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && isArrayBuffer(val.buffer); + } + return result; + } + + /** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ + var isString = typeOfTest('string'); + + /** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ + var isFunction = typeOfTest('function'); + + /** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ + var isNumber = typeOfTest('number'); + + /** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ + var isObject = function isObject(thing) { + return thing !== null && _typeof(thing) === 'object'; + }; + + /** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ + var isBoolean = function isBoolean(thing) { + return thing === true || thing === false; + }; + + /** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ + var isPlainObject = function isPlainObject(val) { + if (kindOf(val) !== 'object') { + return false; + } + var prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); + }; + + /** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ + var isDate = kindOfTest('Date'); + + /** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ + var isFile = kindOfTest('File'); + + /** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ + var isBlob = kindOfTest('Blob'); + + /** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ + var isFileList = kindOfTest('FileList'); + + /** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ + var isStream = function isStream(val) { + return isObject(val) && isFunction(val.pipe); + }; + + /** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ + var isFormData = function isFormData(thing) { + var kind; + return thing && (typeof FormData === 'function' && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')); + }; + + /** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ + var isURLSearchParams = kindOfTest('URLSearchParams'); + + /** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ + var trim = function trim(str) { + return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + }; + + /** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ + function forEach(obj, fn) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + _ref$allOwnKeys = _ref.allOwnKeys, + allOwnKeys = _ref$allOwnKeys === void 0 ? false : _ref$allOwnKeys; + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + var i; + var l; + + // Force an array if not already something iterable + if (_typeof(obj) !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + var len = keys.length; + var key; + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } + } + function findKey(obj, key) { + key = key.toLowerCase(); + var keys = Object.keys(obj); + var i = keys.length; + var _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; + } + var _global = function () { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : typeof window !== 'undefined' ? window : global; + }(); + var isContextDefined = function isContextDefined(context) { + return !isUndefined(context) && context !== _global; + }; + + /** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ + function /* obj1, obj2, obj3, ... */ + merge() { + var _ref2 = isContextDefined(this) && this || {}, + caseless = _ref2.caseless; + var result = {}; + var assignValue = function assignValue(val, key) { + var targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + }; + for (var i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; + } + + /** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ + var extend = function extend(a, b, thisArg) { + var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, + allOwnKeys = _ref3.allOwnKeys; + forEach(b, function (val, key) { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, { + allOwnKeys: allOwnKeys + }); + return a; + }; + + /** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ + var stripBOM = function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; + }; + + /** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ + var inherits = function inherits(constructor, superConstructor, props, descriptors) { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); + }; + + /** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ + var toFlatObject = function toFlatObject(sourceObj, destObj, filter, propFilter) { + var props; + var i; + var prop; + var merged = {}; + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + return destObj; + }; + + /** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ + var endsWith = function endsWith(str, searchString, position) { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + var lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; + + /** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ + var toArray = function toArray(thing) { + if (!thing) return null; + if (isArray(thing)) return thing; + var i = thing.length; + if (!isNumber(i)) return null; + var arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; + }; + + /** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ + // eslint-disable-next-line func-names + var isTypedArray = function (TypedArray) { + // eslint-disable-next-line func-names + return function (thing) { + return TypedArray && thing instanceof TypedArray; + }; + }(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + + /** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ + var forEachEntry = function forEachEntry(obj, fn) { + var generator = obj && obj[Symbol.iterator]; + var iterator = generator.call(obj); + var result; + while ((result = iterator.next()) && !result.done) { + var pair = result.value; + fn.call(obj, pair[0], pair[1]); + } + }; + + /** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ + var matchAll = function matchAll(regExp, str) { + var matches; + var arr = []; + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + return arr; + }; + + /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ + var isHTMLForm = kindOfTest('HTMLFormElement'); + var toCamelCase = function toCamelCase(str) { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + }); + }; + + /* Creating a function that will check if an object has a property. */ + var hasOwnProperty = function (_ref4) { + var hasOwnProperty = _ref4.hasOwnProperty; + return function (obj, prop) { + return hasOwnProperty.call(obj, prop); + }; + }(Object.prototype); + + /** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ + var isRegExp = kindOfTest('RegExp'); + var reduceDescriptors = function reduceDescriptors(obj, reducer) { + var descriptors = Object.getOwnPropertyDescriptors(obj); + var reducedDescriptors = {}; + forEach(descriptors, function (descriptor, name) { + var ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + Object.defineProperties(obj, reducedDescriptors); + }; + + /** + * Makes all methods read-only + * @param {Object} obj + */ + + var freezeMethods = function freezeMethods(obj) { + reduceDescriptors(obj, function (descriptor, name) { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + var value = obj[name]; + if (!isFunction(value)) return; + descriptor.enumerable = false; + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + if (!descriptor.set) { + descriptor.set = function () { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); + }; + var toObjectSet = function toObjectSet(arrayOrString, delimiter) { + var obj = {}; + var define = function define(arr) { + arr.forEach(function (value) { + obj[value] = true; + }); + }; + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + return obj; + }; + var noop = function noop() {}; + var toFiniteNumber = function toFiniteNumber(value, defaultValue) { + value = +value; + return Number.isFinite(value) ? value : defaultValue; + }; + var ALPHA = 'abcdefghijklmnopqrstuvwxyz'; + var DIGIT = '0123456789'; + var ALPHABET = { + DIGIT: DIGIT, + ALPHA: ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT + }; + var generateString = function generateString() { + var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16; + var alphabet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ALPHABET.ALPHA_DIGIT; + var str = ''; + var length = alphabet.length; + while (size--) { + str += alphabet[Math.random() * length | 0]; + } + return str; + }; + + /** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ + function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); + } + var toJSONObject = function toJSONObject(obj) { + var stack = new Array(10); + var visit = function visit(source, i) { + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + if (!('toJSON' in source)) { + stack[i] = source; + var target = isArray(source) ? [] : {}; + forEach(source, function (value, key) { + var reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + stack[i] = undefined; + return target; + } + } + return source; + }; + return visit(obj, 0); + }; + var isAsyncFn = kindOfTest('AsyncFunction'); + var isThenable = function isThenable(thing) { + return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing["catch"]); + }; + var utils$1 = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isBoolean: isBoolean, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isRegExp: isRegExp, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isTypedArray: isTypedArray, + isFileList: isFileList, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM, + inherits: inherits, + toFlatObject: toFlatObject, + kindOf: kindOf, + kindOfTest: kindOfTest, + endsWith: endsWith, + toArray: toArray, + forEachEntry: forEachEntry, + matchAll: matchAll, + isHTMLForm: isHTMLForm, + hasOwnProperty: hasOwnProperty, + hasOwnProp: hasOwnProperty, + // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors: reduceDescriptors, + freezeMethods: freezeMethods, + toObjectSet: toObjectSet, + toCamelCase: toCamelCase, + noop: noop, + toFiniteNumber: toFiniteNumber, + findKey: findKey, + global: _global, + isContextDefined: isContextDefined, + ALPHABET: ALPHABET, + generateString: generateString, + isSpecCompliantForm: isSpecCompliantForm, + toJSONObject: toJSONObject, + isAsyncFn: isAsyncFn, + isThenable: isThenable + }; + + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ + function AxiosError(message, code, config, request, response) { + Error.call(this); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack; + } + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); + } + utils$1.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } + }); + var prototype$1 = AxiosError.prototype; + var descriptors = {}; + ['ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED', 'ERR_NOT_SUPPORT', 'ERR_INVALID_URL' + // eslint-disable-next-line func-names + ].forEach(function (code) { + descriptors[code] = { + value: code + }; + }); + Object.defineProperties(AxiosError, descriptors); + Object.defineProperty(prototype$1, 'isAxiosError', { + value: true + }); + + // eslint-disable-next-line func-names + AxiosError.from = function (error, code, config, request, response, customProps) { + var axiosError = Object.create(prototype$1); + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, function (prop) { + return prop !== 'isAxiosError'; + }); + AxiosError.call(axiosError, error.message, code, config, request, response); + axiosError.cause = error; + axiosError.name = error.name; + customProps && Object.assign(axiosError, customProps); + return axiosError; + }; + + // eslint-disable-next-line strict + var httpAdapter = null; + + /** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ + function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); + } + + /** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ + function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; + } + + /** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ + function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); + } + + /** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ + function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); + } + var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); + }); + + /** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + + /** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ + function toFormData(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + var metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + var visitor = options.visitor || defaultVisitor; + var dots = options.dots; + var indexes = options.indexes; + var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + var useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + function convertValue(value) { + if (value === null) return ''; + if (utils$1.isDate(value)) { + return value.toISOString(); + } + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + var arr = value; + if (value && !path && _typeof(value) === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el)); + }); + return false; + } + } + if (isVisitable(value)) { + return true; + } + formData.append(renderKey(path, key, dots), convertValue(value)); + return false; + } + var stack = []; + var exposedHelpers = Object.assign(predicates, { + defaultVisitor: defaultVisitor, + convertValue: convertValue, + isVisitable: isVisitable + }); + function build(value, path) { + if (utils$1.isUndefined(value)) return; + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + stack.push(value); + utils$1.forEach(value, function each(el, key) { + var result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers); + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + stack.pop(); + } + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + build(obj); + return formData; + } + + /** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ + function encode$1(str) { + var charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); + } + + /** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ + function AxiosURLSearchParams(params, options) { + this._pairs = []; + params && toFormData(params, this, options); + } + var prototype = AxiosURLSearchParams.prototype; + prototype.append = function append(name, value) { + this._pairs.push([name, value]); + }; + prototype.toString = function toString(encoder) { + var _encode = encoder ? function (value) { + return encoder.call(this, value, encode$1); + } : encode$1; + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); + }; + + /** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ + function encode(val) { + return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + } + + /** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ + function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + var _encode = options && options.encode || encode; + var serializeFn = options && options.serialize; + var serializedParams; + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode); + } + if (serializedParams) { + var hashmarkIndex = url.indexOf("#"); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + return url; + } + + var InterceptorManager = /*#__PURE__*/function () { + function InterceptorManager() { + _classCallCheck(this, InterceptorManager); + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + _createClass(InterceptorManager, [{ + key: "use", + value: function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + }, { + key: "eject", + value: function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + }, { + key: "clear", + value: function clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + }, { + key: "forEach", + value: function forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } + }]); + return InterceptorManager; + }(); + var InterceptorManager$1 = InterceptorManager; + + var transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }; + + var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; + + var FormData$1 = typeof FormData !== 'undefined' ? FormData : null; + + var Blob$1 = typeof Blob !== 'undefined' ? Blob : null; + + var platform$1 = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams$1, + FormData: FormData$1, + Blob: Blob$1 + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] + }; + + var hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + + /** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ + var hasStandardBrowserEnv = function (product) { + return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0; + }(typeof navigator !== 'undefined' && navigator.product); + + /** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ + var hasStandardBrowserWebWorkerEnv = function () { + return typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && typeof self.importScripts === 'function'; + }(); + + var utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv + }); + + var platform = _objectSpread2(_objectSpread2({}, utils), platform$1); + + function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function visitor(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); + } + + /** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ + function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(function (match) { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); + } + + /** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ + function arrayToObject(arr) { + var obj = {}; + var keys = Object.keys(arr); + var i; + var len = keys.length; + var key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; + } + + /** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ + function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + var name = path[index++]; + if (name === '__proto__') return true; + var isNumericKey = Number.isFinite(+name); + var isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + return !isNumericKey; + } + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + var result = buildPath(path, value, target[name], index); + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + return !isNumericKey; + } + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + var obj = {}; + utils$1.forEachEntry(formData, function (name, value) { + buildPath(parsePropPath(name), value, obj, 0); + }); + return obj; + } + return null; + } + + /** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ + function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + return (encoder || JSON.stringify)(rawValue); + } + var defaults = { + transitional: transitionalDefaults, + adapter: ['xhr', 'http'], + transformRequest: [function transformRequest(data, headers) { + var contentType = headers.getContentType() || ''; + var hasJSONContentType = contentType.indexOf('application/json') > -1; + var isObjectPayload = utils$1.isObject(data); + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + var isFormData = utils$1.isFormData(data); + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data)) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + var isFileList; + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + var _FormData = this.env && this.env.FormData; + return toFormData(isFileList ? { + 'files[]': data + } : data, _FormData && new _FormData(), this.formSerializer); + } + } + if (isObjectPayload || hasJSONContentType) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + return data; + }], + transformResponse: [function transformResponse(data) { + var transitional = this.transitional || defaults.transitional; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var JSONRequested = this.responseType === 'json'; + if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var strictJSONParsing = !silentJSONParsing && JSONRequested; + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + return data; + }], + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + maxContentLength: -1, + maxBodyLength: -1, + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } + }; + utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], function (method) { + defaults.headers[method] = {}; + }); + var defaults$1 = defaults; + + // RawAxiosHeaders whose duplicates are ignored by node + // c.f. https://nodejs.org/api/http.html#http_message_headers + var ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']); + + /** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ + var parseHeaders = (function (rawHeaders) { + var parsed = {}; + var key; + var val; + var i; + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + if (!key || parsed[key] && ignoreDuplicateOf[key]) { + return; + } + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + return parsed; + }); + + var $internals = Symbol('internals'); + function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); + } + function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); + } + function parseTokens(str) { + var tokens = Object.create(null); + var tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + var match; + while (match = tokensRE.exec(str)) { + tokens[match[1]] = match[2]; + } + return tokens; + } + var isValidHeaderName = function isValidHeaderName(str) { + return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + }; + function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + if (isHeaderNameFilter) { + value = header; + } + if (!utils$1.isString(value)) return; + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } + } + function formatHeader(header) { + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, function (w, _char, str) { + return _char.toUpperCase() + str; + }); + } + function buildAccessors(obj, header) { + var accessorName = utils$1.toCamelCase(' ' + header); + ['get', 'set', 'has'].forEach(function (methodName) { + Object.defineProperty(obj, methodName + accessorName, { + value: function value(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); + } + var AxiosHeaders = /*#__PURE__*/function (_Symbol$iterator, _Symbol$toStringTag) { + function AxiosHeaders(headers) { + _classCallCheck(this, AxiosHeaders); + headers && this.set(headers); + } + _createClass(AxiosHeaders, [{ + key: "set", + value: function set(header, valueOrRewrite, rewrite) { + var self = this; + function setHeader(_value, _header, _rewrite) { + var lHeader = normalizeHeader(_header); + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + var key = utils$1.findKey(self, lHeader); + if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) { + self[key || _header] = normalizeValue(_value); + } + } + var setHeaders = function setHeaders(headers, _rewrite) { + return utils$1.forEach(headers, function (_value, _header) { + return setHeader(_value, _header, _rewrite); + }); + }; + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + return this; + } + }, { + key: "get", + value: function get(header, parser) { + header = normalizeHeader(header); + if (header) { + var key = utils$1.findKey(this, header); + if (key) { + var value = this[key]; + if (!parser) { + return value; + } + if (parser === true) { + return parseTokens(value); + } + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + }, { + key: "has", + value: function has(header, matcher) { + header = normalizeHeader(header); + if (header) { + var key = utils$1.findKey(this, header); + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + return false; + } + }, { + key: "delete", + value: function _delete(header, matcher) { + var self = this; + var deleted = false; + function deleteHeader(_header) { + _header = normalizeHeader(_header); + if (_header) { + var key = utils$1.findKey(self, _header); + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + deleted = true; + } + } + } + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + return deleted; + } + }, { + key: "clear", + value: function clear(matcher) { + var keys = Object.keys(this); + var i = keys.length; + var deleted = false; + while (i--) { + var key = keys[i]; + if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + return deleted; + } + }, { + key: "normalize", + value: function normalize(format) { + var self = this; + var headers = {}; + utils$1.forEach(this, function (value, header) { + var key = utils$1.findKey(headers, header); + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + var normalized = format ? formatHeader(header) : String(header).trim(); + if (normalized !== header) { + delete self[header]; + } + self[normalized] = normalizeValue(value); + headers[normalized] = true; + }); + return this; + } + }, { + key: "concat", + value: function concat() { + var _this$constructor; + for (var _len = arguments.length, targets = new Array(_len), _key = 0; _key < _len; _key++) { + targets[_key] = arguments[_key]; + } + return (_this$constructor = this.constructor).concat.apply(_this$constructor, [this].concat(targets)); + } + }, { + key: "toJSON", + value: function toJSON(asStrings) { + var obj = Object.create(null); + utils$1.forEach(this, function (value, header) { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + return obj; + } + }, { + key: _Symbol$iterator, + value: function value() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + }, { + key: "toString", + value: function toString() { + return Object.entries(this.toJSON()).map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + header = _ref2[0], + value = _ref2[1]; + return header + ': ' + value; + }).join('\n'); + } + }, { + key: _Symbol$toStringTag, + get: function get() { + return 'AxiosHeaders'; + } + }], [{ + key: "from", + value: function from(thing) { + return thing instanceof this ? thing : new this(thing); + } + }, { + key: "concat", + value: function concat(first) { + var computed = new this(first); + for (var _len2 = arguments.length, targets = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + targets[_key2 - 1] = arguments[_key2]; + } + targets.forEach(function (target) { + return computed.set(target); + }); + return computed; + } + }, { + key: "accessor", + value: function accessor(header) { + var internals = this[$internals] = this[$internals] = { + accessors: {} + }; + var accessors = internals.accessors; + var prototype = this.prototype; + function defineAccessor(_header) { + var lHeader = normalizeHeader(_header); + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + return this; + } + }]); + return AxiosHeaders; + }(Symbol.iterator, Symbol.toStringTag); + AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + + // reserved names hotfix + utils$1.reduceDescriptors(AxiosHeaders.prototype, function (_ref3, key) { + var value = _ref3.value; + var mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: function get() { + return value; + }, + set: function set(headerValue) { + this[mapped] = headerValue; + } + }; + }); + utils$1.freezeMethods(AxiosHeaders); + var AxiosHeaders$1 = AxiosHeaders; + + /** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ + function transformData(fns, response) { + var config = this || defaults$1; + var context = response || config; + var headers = AxiosHeaders$1.from(context.headers); + var data = context.data; + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + headers.normalize(); + return data; + } + + function isCancel(value) { + return !!(value && value.__CANCEL__); + } + + /** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ + function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; + } + utils$1.inherits(CanceledError, AxiosError, { + __CANCEL__: true + }); + + /** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ + function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError('Request failed with status code ' + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response)); + } + } + + var cookies = platform.hasStandardBrowserEnv ? + // Standard browser envs support document.cookie + { + write: function write(name, value, expires, path, domain, secure) { + var cookie = [name + '=' + encodeURIComponent(value)]; + utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); + utils$1.isString(path) && cookie.push('path=' + path); + utils$1.isString(domain) && cookie.push('domain=' + domain); + secure === true && cookie.push('secure'); + document.cookie = cookie.join('; '); + }, + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return match ? decodeURIComponent(match[3]) : null; + }, + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + } : + // Non-standard browser env (web workers, react-native) lack needed support. + { + write: function write() {}, + read: function read() { + return null; + }, + remove: function remove() {} + }; + + /** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ + function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); + } + + /** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ + function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; + } + + /** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ + function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; + } + + var isURLSameOrigin = platform.hasStandardBrowserEnv ? + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover its components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname + }; + } + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL; + return parsed.protocol === originURL.protocol && parsed.host === originURL.host; + }; + }() : + // Non standard browser envs (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + }(); + + function parseProtocol(url) { + var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; + } + + /** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ + function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + var bytes = new Array(samplesCount); + var timestamps = new Array(samplesCount); + var head = 0; + var tail = 0; + var firstSampleTS; + min = min !== undefined ? min : 1000; + return function push(chunkLength) { + var now = Date.now(); + var startedAt = timestamps[tail]; + if (!firstSampleTS) { + firstSampleTS = now; + } + bytes[head] = chunkLength; + timestamps[head] = now; + var i = tail; + var bytesCount = 0; + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + head = (head + 1) % samplesCount; + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + if (now - firstSampleTS < min) { + return; + } + var passed = startedAt && now - startedAt; + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; + } + + function progressEventReducer(listener, isDownloadStream) { + var bytesNotified = 0; + var _speedometer = speedometer(50, 250); + return function (e) { + var loaded = e.loaded; + var total = e.lengthComputable ? e.total : undefined; + var progressBytes = loaded - bytesNotified; + var rate = _speedometer(progressBytes); + var inRange = loaded <= total; + bytesNotified = loaded; + var data = { + loaded: loaded, + total: total, + progress: total ? loaded / total : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + data[isDownloadStream ? 'download' : 'upload'] = true; + listener(data); + }; + } + var isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + var xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = AxiosHeaders$1.from(config.headers).normalize(); + var responseType = config.responseType, + withXSRFToken = config.withXSRFToken; + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + var contentType; + if (utils$1.isFormData(requestData)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + requestHeaders.setContentType(false); // Let the browser set it + } else if ((contentType = requestHeaders.getContentType()) !== false) { + // fix semicolon duplication issue for ReactNative FormData implementation + var _ref = contentType ? contentType.split(';').map(function (token) { + return token.trim(); + }).filter(Boolean) : [], + _ref2 = _toArray(_ref), + type = _ref2[0], + tokens = _ref2.slice(1); + requestHeaders.setContentType([type || 'multipart/form-data'].concat(_toConsumableArray(tokens)).join('; ')); + } + } + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = AxiosHeaders$1.from('getAllResponseHeaders' in request && request.getAllResponseHeaders()); + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + var transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); + if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(fullPath)) { + // Add xsrf header + var xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function onCanceled(cancel) { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + var protocol = parseProtocol(fullPath); + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + // Send the request + request.send(requestData || null); + }); + }; + + var knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter + }; + utils$1.forEach(knownAdapters, function (fn, value) { + if (fn) { + try { + Object.defineProperty(fn, 'name', { + value: value + }); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', { + value: value + }); + } + }); + var renderReason = function renderReason(reason) { + return "- ".concat(reason); + }; + var isResolvedHandle = function isResolvedHandle(adapter) { + return utils$1.isFunction(adapter) || adapter === null || adapter === false; + }; + var adapters = { + getAdapter: function getAdapter(adapters) { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; + var _adapters = adapters, + length = _adapters.length; + var nameOrAdapter; + var adapter; + var rejectedReasons = {}; + for (var i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + var id = void 0; + adapter = nameOrAdapter; + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + if (adapter === undefined) { + throw new AxiosError("Unknown adapter '".concat(id, "'")); + } + } + if (adapter) { + break; + } + rejectedReasons[id || '#' + i] = adapter; + } + if (!adapter) { + var reasons = Object.entries(rejectedReasons).map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + id = _ref2[0], + state = _ref2[1]; + return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build'); + }); + var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified'; + throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT'); + } + return adapter; + }, + adapters: knownAdapters + }; + + /** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } + } + + /** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ + function dispatchRequest(config) { + throwIfCancellationRequested(config); + config.headers = AxiosHeaders$1.from(config.headers); + + // Transform request data + config.data = transformData.call(config, config.transformRequest); + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + var adapter = adapters.getAdapter(config.adapter || defaults$1.adapter); + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call(config, config.transformResponse, response); + response.headers = AxiosHeaders$1.from(response.headers); + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call(config, config.transformResponse, reason.response); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + return Promise.reject(reason); + }); + } + + var headersToObject = function headersToObject(thing) { + return thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing; + }; + + /** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ + function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + function getMergedValue(target, source, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({ + caseless: caseless + }, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + var mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: function headers(a, b) { + return mergeDeepProperties(headersToObject(a), headersToObject(b), true); + } + }; + utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + var merge = mergeMap[prop] || mergeDeepProperties; + var configValue = merge(config1[prop], config2[prop], prop); + utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); + }); + return config; + } + + var VERSION = "1.6.7"; + + var validators$1 = {}; + + // eslint-disable-next-line func-names + ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function (type, i) { + validators$1[type] = function validator(thing) { + return _typeof(thing) === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; + }); + var deprecatedWarnings = {}; + + /** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ + validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function (value, opt, opts) { + if (validator === false) { + throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED); + } + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future')); + } + return validator ? validator(value, opt, opts) : true; + }; + }; + + /** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + + function assertOptions(options, schema, allowUnknown) { + if (_typeof(options) !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } + } + var validator = { + assertOptions: assertOptions, + validators: validators$1 + }; + + var validators = validator.validators; + + /** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ + var Axios = /*#__PURE__*/function () { + function Axios(instanceConfig) { + _classCallCheck(this, Axios); + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + _createClass(Axios, [{ + key: "request", + value: function () { + var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(configOrUrl, config) { + var dummy, stack; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return this._request(configOrUrl, config); + case 3: + return _context.abrupt("return", _context.sent); + case 6: + _context.prev = 6; + _context.t0 = _context["catch"](0); + if (_context.t0 instanceof Error) { + Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error(); + + // slice off the Error: ... line + stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + if (!_context.t0.stack) { + _context.t0.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(_context.t0.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + _context.t0.stack += '\n' + stack; + } + } + throw _context.t0; + case 10: + case "end": + return _context.stop(); + } + } + }, _callee, this, [[0, 6]]); + })); + function request(_x, _x2) { + return _request2.apply(this, arguments); + } + return request; + }() + }, { + key: "_request", + value: function _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + config = mergeConfig(this.defaults, config); + var _config = config, + transitional = _config.transitional, + paramsSerializer = _config.paramsSerializer, + headers = _config.headers; + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators["boolean"]), + forcedJSONParsing: validators.transitional(validators["boolean"]), + clarifyTimeoutError: validators.transitional(validators["boolean"]) + }, false); + } + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators["function"], + serialize: validators["function"] + }, true); + } + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + var contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]); + headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) { + delete headers[method]; + }); + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + var promise; + var i = 0; + var len; + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + promise = Promise.resolve(config); + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + return promise; + } + len = requestInterceptorChain.length; + var newConfig = config; + i = 0; + while (i < len) { + var onFulfilled = requestInterceptorChain[i++]; + var onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + i = 0; + len = responseInterceptorChain.length; + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + return promise; + } + }, { + key: "getUri", + value: function getUri(config) { + config = mergeConfig(this.defaults, config); + var fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); + } + }]); + return Axios; + }(); // Provide aliases for supported request methods + utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function (url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; + }); + utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url: url, + data: data + })); + }; + } + Axios.prototype[method] = generateHTTPMethod(); + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); + }); + var Axios$1 = Axios; + + /** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ + var CancelToken = /*#__PURE__*/function () { + function CancelToken(executor) { + _classCallCheck(this, CancelToken); + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + var token = this; + + // eslint-disable-next-line func-names + this.promise.then(function (cancel) { + if (!token._listeners) return; + var i = token._listeners.length; + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = function (onfulfilled) { + var _resolve; + // eslint-disable-next-line func-names + var promise = new Promise(function (resolve) { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + return promise; + }; + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + _createClass(CancelToken, [{ + key: "throwIfRequested", + value: function throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + }, { + key: "subscribe", + value: function subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + }, { + key: "unsubscribe", + value: function unsubscribe(listener) { + if (!this._listeners) { + return; + } + var index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + }], [{ + key: "source", + value: function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; + } + }]); + return CancelToken; + }(); + var CancelToken$1 = CancelToken; + + /** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ + function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + } + + /** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ + function isAxiosError(payload) { + return utils$1.isObject(payload) && payload.isAxiosError === true; + } + + var HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511 + }; + Object.entries(HttpStatusCode).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + HttpStatusCode[value] = key; + }); + var HttpStatusCode$1 = HttpStatusCode; + + /** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ + function createInstance(defaultConfig) { + var context = new Axios$1(defaultConfig); + var instance = bind(Axios$1.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$1.prototype, context, { + allOwnKeys: true + }); + + // Copy context to instance + utils$1.extend(instance, context, null, { + allOwnKeys: true + }); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + return instance; + } + + // Create the default instance to be exported + var axios = createInstance(defaults$1); + + // Expose Axios class to allow class inheritance + axios.Axios = Axios$1; + + // Expose Cancel & CancelToken + axios.CanceledError = CanceledError; + axios.CancelToken = CancelToken$1; + axios.isCancel = isCancel; + axios.VERSION = VERSION; + axios.toFormData = toFormData; + + // Expose AxiosError class + axios.AxiosError = AxiosError; + + // alias for CanceledError for backward compatibility + axios.Cancel = axios.CanceledError; + + // Expose all/spread + axios.all = function all(promises) { + return Promise.all(promises); + }; + axios.spread = spread; + + // Expose isAxiosError + axios.isAxiosError = isAxiosError; + + // Expose mergeConfig + axios.mergeConfig = mergeConfig; + axios.AxiosHeaders = AxiosHeaders$1; + axios.formToJSON = function (thing) { + return formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + }; + axios.getAdapter = adapters.getAdapter; + axios.HttpStatusCode = HttpStatusCode$1; + axios["default"] = axios; + + return axios; + +})); +//# sourceMappingURL=axios.js.map diff --git a/node_modules/axios/dist/axios.js.map b/node_modules/axios/dist/axios.js.map new file mode 100644 index 00000000..daef6455 --- /dev/null +++ b/node_modules/axios/dist/axios.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/core/AxiosError.js","../lib/helpers/null.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/defaults/transitional.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/browser/index.js","../lib/platform/common/utils.js","../lib/platform/index.js","../lib/helpers/toURLEncodedForm.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/parseHeaders.js","../lib/core/AxiosHeaders.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/core/settle.js","../lib/helpers/cookies.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/core/buildFullPath.js","../lib/helpers/isURLSameOrigin.js","../lib/helpers/parseProtocol.js","../lib/helpers/speedometer.js","../lib/adapters/xhr.js","../lib/adapters/adapters.js","../lib/core/dispatchRequest.js","../lib/core/mergeConfig.js","../lib/env/data.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["bind","fn","thisArg","wrap","apply","arguments","toString","Object","prototype","getPrototypeOf","kindOf","cache","thing","str","call","slice","toLowerCase","create","kindOfTest","type","typeOfTest","isArray","Array","isUndefined","isBuffer","val","constructor","isFunction","isArrayBuffer","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isObject","isBoolean","isPlainObject","Symbol","toStringTag","iterator","isDate","isFile","isBlob","isFileList","isStream","pipe","isFormData","kind","FormData","append","isURLSearchParams","trim","replace","forEach","obj","allOwnKeys","i","l","length","keys","getOwnPropertyNames","len","key","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","merge","caseless","assignValue","targetKey","extend","a","b","stripBOM","content","charCodeAt","inherits","superConstructor","props","descriptors","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","prop","merged","endsWith","searchString","position","String","undefined","lastIndex","indexOf","toArray","arr","isTypedArray","TypedArray","Uint8Array","forEachEntry","generator","next","done","pair","matchAll","regExp","matches","exec","push","isHTMLForm","toCamelCase","replacer","m","p1","p2","toUpperCase","hasOwnProperty","isRegExp","reduceDescriptors","reducer","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","noop","toFiniteNumber","defaultValue","Number","isFinite","ALPHA","DIGIT","ALPHABET","ALPHA_DIGIT","generateString","size","alphabet","Math","random","isSpecCompliantForm","toJSONObject","stack","visit","source","target","reducedValue","isAsyncFn","isThenable","then","hasOwnProp","AxiosError","message","code","config","request","response","captureStackTrace","utils","toJSON","description","number","fileName","lineNumber","columnNumber","status","from","error","customProps","axiosError","cause","isVisitable","removeBrackets","renderKey","path","dots","concat","map","each","token","join","isFlatArray","some","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","defined","option","visitor","defaultVisitor","_Blob","Blob","useBlob","convertValue","toISOString","Buffer","JSON","stringify","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","encoder","_encode","buildURL","url","serializeFn","serialize","serializedParams","hashmarkIndex","InterceptorManager","handlers","fulfilled","rejected","synchronous","runWhen","id","forEachHandler","h","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","URLSearchParams","isBrowser","classes","protocols","hasBrowserEnv","document","hasStandardBrowserEnv","product","navigator","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","platform","toURLEncodedForm","data","helpers","isNode","parsePropPath","arrayToObject","formDataToJSON","buildPath","isNumericKey","isLast","entries","stringifySafely","rawValue","parser","parse","e","defaults","transitional","transitionalDefaults","adapter","transformRequest","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","formSerializer","_FormData","env","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","method","ignoreDuplicateOf","rawHeaders","parsed","line","substring","$internals","normalizeHeader","header","normalizeValue","parseTokens","tokens","tokensRE","isValidHeaderName","matchHeaderValue","isHeaderNameFilter","formatHeader","w","char","buildAccessors","accessorName","methodName","arg1","arg2","arg3","configurable","AxiosHeaders","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","parseHeaders","matcher","deleted","deleteHeader","format","normalized","targets","asStrings","first","computed","internals","accessors","defineAccessor","accessor","mapped","get","headerValue","transformData","fns","transform","normalize","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","settle","resolve","reject","ERR_BAD_REQUEST","floor","write","expires","domain","secure","cookie","Date","toGMTString","read","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","baseURL","relativeURL","buildFullPath","requestedURL","standardBrowserEnv","msie","userAgent","urlParsingNode","createElement","originURL","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","isURLSameOrigin","requestURL","nonStandardBrowserEnv","parseProtocol","speedometer","samplesCount","min","bytes","timestamps","head","tail","firstSampleTS","chunkLength","startedAt","bytesCount","passed","round","progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","loaded","total","lengthComputable","progressBytes","rate","inRange","progress","estimated","event","isXHRAdapterSupported","XMLHttpRequest","Promise","dispatchXhrRequest","requestData","requestHeaders","withXSRFToken","onCanceled","cancelToken","unsubscribe","signal","removeEventListener","Boolean","auth","username","password","unescape","btoa","fullPath","open","paramsSerializer","onloadend","responseHeaders","getAllResponseHeaders","responseData","responseText","statusText","_resolve","_reject","err","onreadystatechange","handleLoad","readyState","responseURL","setTimeout","onabort","handleAbort","ECONNABORTED","onerror","handleError","ERR_NETWORK","ontimeout","handleTimeout","timeoutErrorMessage","ETIMEDOUT","xsrfValue","cookies","setRequestHeader","withCredentials","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","subscribe","aborted","send","knownAdapters","http","httpAdapter","xhr","xhrAdapter","renderReason","reason","isResolvedHandle","getAdapter","adapters","nameOrAdapter","rejectedReasons","reasons","state","s","throwIfCancellationRequested","throwIfRequested","dispatchRequest","onAdapterResolution","onAdapterRejection","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","timeoutMessage","decompress","beforeRedirect","transport","httpAgent","httpsAgent","socketPath","responseEncoding","computeConfigValue","configValue","VERSION","validators","validator","deprecatedWarnings","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","configOrUrl","_request","dummy","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","unshiftRequestInterceptors","interceptor","unshift","responseInterceptorChain","pushResponseInterceptors","promise","chain","newConfig","onFulfilled","onRejected","forEachMethodNoData","forEachMethodWithData","generateHTTPMethod","isForm","httpMethod","CancelToken","executor","resolvePromise","promiseExecutor","_listeners","onfulfilled","splice","c","spread","callback","isAxiosError","payload","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","createInstance","defaultConfig","instance","axios","Cancel","all","promises","formToJSON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEe,SAASA,IAAI,CAACC,EAAE,EAAEC,OAAO,EAAE;IACxC,OAAO,SAASC,IAAI,GAAG;EACrB,IAAA,OAAOF,EAAE,CAACG,KAAK,CAACF,OAAO,EAAEG,SAAS,CAAC,CAAA;KACpC,CAAA;EACH;;ECFA;;EAEA,IAAOC,QAAQ,GAAIC,MAAM,CAACC,SAAS,CAA5BF,QAAQ,CAAA;EACf,IAAOG,cAAc,GAAIF,MAAM,CAAxBE,cAAc,CAAA;EAErB,IAAMC,MAAM,GAAI,UAAAC,KAAK,EAAA;IAAA,OAAI,UAAAC,KAAK,EAAI;EAC9B,IAAA,IAAMC,GAAG,GAAGP,QAAQ,CAACQ,IAAI,CAACF,KAAK,CAAC,CAAA;MAChC,OAAOD,KAAK,CAACE,GAAG,CAAC,KAAKF,KAAK,CAACE,GAAG,CAAC,GAAGA,GAAG,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,CAAC,CAAA;KACrE,CAAA;EAAA,CAAA,CAAET,MAAM,CAACU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;EAEvB,IAAMC,UAAU,GAAG,SAAbA,UAAU,CAAIC,IAAI,EAAK;EAC3BA,EAAAA,IAAI,GAAGA,IAAI,CAACH,WAAW,EAAE,CAAA;EACzB,EAAA,OAAO,UAACJ,KAAK,EAAA;EAAA,IAAA,OAAKF,MAAM,CAACE,KAAK,CAAC,KAAKO,IAAI,CAAA;EAAA,GAAA,CAAA;EAC1C,CAAC,CAAA;EAED,IAAMC,UAAU,GAAG,SAAbA,UAAU,CAAGD,IAAI,EAAA;EAAA,EAAA,OAAI,UAAAP,KAAK,EAAA;MAAA,OAAI,OAAA,CAAOA,KAAK,CAAA,KAAKO,IAAI,CAAA;EAAA,GAAA,CAAA;EAAA,CAAA,CAAA;;EAEzD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAOE,OAAO,GAAIC,KAAK,CAAhBD,OAAO,CAAA;;EAEd;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAME,WAAW,GAAGH,UAAU,CAAC,WAAW,CAAC,CAAA;;EAE3C;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASI,QAAQ,CAACC,GAAG,EAAE;EACrB,EAAA,OAAOA,GAAG,KAAK,IAAI,IAAI,CAACF,WAAW,CAACE,GAAG,CAAC,IAAIA,GAAG,CAACC,WAAW,KAAK,IAAI,IAAI,CAACH,WAAW,CAACE,GAAG,CAACC,WAAW,CAAC,IAChGC,UAAU,CAACF,GAAG,CAACC,WAAW,CAACF,QAAQ,CAAC,IAAIC,GAAG,CAACC,WAAW,CAACF,QAAQ,CAACC,GAAG,CAAC,CAAA;EAC5E,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMG,aAAa,GAAGV,UAAU,CAAC,aAAa,CAAC,CAAA;;EAG/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASW,iBAAiB,CAACJ,GAAG,EAAE;EAC9B,EAAA,IAAIK,MAAM,CAAA;IACV,IAAK,OAAOC,WAAW,KAAK,WAAW,IAAMA,WAAW,CAACC,MAAO,EAAE;EAChEF,IAAAA,MAAM,GAAGC,WAAW,CAACC,MAAM,CAACP,GAAG,CAAC,CAAA;EAClC,GAAC,MAAM;EACLK,IAAAA,MAAM,GAAIL,GAAG,IAAMA,GAAG,CAACQ,MAAO,IAAKL,aAAa,CAACH,GAAG,CAACQ,MAAM,CAAE,CAAA;EAC/D,GAAA;EACA,EAAA,OAAOH,MAAM,CAAA;EACf,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMI,QAAQ,GAAGd,UAAU,CAAC,QAAQ,CAAC,CAAA;;EAErC;EACA;EACA;EACA;EACA;EACA;EACA,IAAMO,UAAU,GAAGP,UAAU,CAAC,UAAU,CAAC,CAAA;;EAEzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMe,QAAQ,GAAGf,UAAU,CAAC,QAAQ,CAAC,CAAA;;EAErC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMgB,QAAQ,GAAG,SAAXA,QAAQ,CAAIxB,KAAK,EAAA;EAAA,EAAA,OAAKA,KAAK,KAAK,IAAI,IAAI,OAAOA,CAAAA,KAAK,MAAK,QAAQ,CAAA;EAAA,CAAA,CAAA;;EAEvE;EACA;EACA;EACA;EACA;EACA;EACA,IAAMyB,SAAS,GAAG,SAAZA,SAAS,CAAGzB,KAAK,EAAA;EAAA,EAAA,OAAIA,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,CAAA;EAAA,CAAA,CAAA;;EAE5D;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAM0B,aAAa,GAAG,SAAhBA,aAAa,CAAIb,GAAG,EAAK;EAC7B,EAAA,IAAIf,MAAM,CAACe,GAAG,CAAC,KAAK,QAAQ,EAAE;EAC5B,IAAA,OAAO,KAAK,CAAA;EACd,GAAA;EAEA,EAAA,IAAMjB,SAAS,GAAGC,cAAc,CAACgB,GAAG,CAAC,CAAA;EACrC,EAAA,OAAO,CAACjB,SAAS,KAAK,IAAI,IAAIA,SAAS,KAAKD,MAAM,CAACC,SAAS,IAAID,MAAM,CAACE,cAAc,CAACD,SAAS,CAAC,KAAK,IAAI,KAAK,EAAE+B,MAAM,CAACC,WAAW,IAAIf,GAAG,CAAC,IAAI,EAAEc,MAAM,CAACE,QAAQ,IAAIhB,GAAG,CAAC,CAAA;EACzK,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMiB,MAAM,GAAGxB,UAAU,CAAC,MAAM,CAAC,CAAA;;EAEjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMyB,MAAM,GAAGzB,UAAU,CAAC,MAAM,CAAC,CAAA;;EAEjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAM0B,MAAM,GAAG1B,UAAU,CAAC,MAAM,CAAC,CAAA;;EAEjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAM2B,UAAU,GAAG3B,UAAU,CAAC,UAAU,CAAC,CAAA;;EAEzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAM4B,QAAQ,GAAG,SAAXA,QAAQ,CAAIrB,GAAG,EAAA;IAAA,OAAKW,QAAQ,CAACX,GAAG,CAAC,IAAIE,UAAU,CAACF,GAAG,CAACsB,IAAI,CAAC,CAAA;EAAA,CAAA,CAAA;;EAE/D;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMC,UAAU,GAAG,SAAbA,UAAU,CAAIpC,KAAK,EAAK;EAC5B,EAAA,IAAIqC,IAAI,CAAA;IACR,OAAOrC,KAAK,KACT,OAAOsC,QAAQ,KAAK,UAAU,IAAItC,KAAK,YAAYsC,QAAQ,IAC1DvB,UAAU,CAACf,KAAK,CAACuC,MAAM,CAAC,KACtB,CAACF,IAAI,GAAGvC,MAAM,CAACE,KAAK,CAAC,MAAM,UAAU;EACrC;EACCqC,EAAAA,IAAI,KAAK,QAAQ,IAAItB,UAAU,CAACf,KAAK,CAACN,QAAQ,CAAC,IAAIM,KAAK,CAACN,QAAQ,EAAE,KAAK,mBAAoB,CAEhG,CACF,CAAA;EACH,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAM8C,iBAAiB,GAAGlC,UAAU,CAAC,iBAAiB,CAAC,CAAA;;EAEvD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMmC,IAAI,GAAG,SAAPA,IAAI,CAAIxC,GAAG,EAAA;EAAA,EAAA,OAAKA,GAAG,CAACwC,IAAI,GAC5BxC,GAAG,CAACwC,IAAI,EAAE,GAAGxC,GAAG,CAACyC,OAAO,CAAC,oCAAoC,EAAE,EAAE,CAAC,CAAA;EAAA,CAAA,CAAA;;EAEpE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASC,OAAO,CAACC,GAAG,EAAEvD,EAAE,EAA6B;EAAA,EAAA,IAAA,IAAA,GAAA,SAAA,CAAA,MAAA,GAAA,CAAA,IAAA,SAAA,CAAA,CAAA,CAAA,KAAA,SAAA,GAAA,SAAA,CAAA,CAAA,CAAA,GAAJ,EAAE;EAAA,IAAA,eAAA,GAAA,IAAA,CAAxBwD,UAAU;EAAVA,IAAAA,UAAU,gCAAG,KAAK,GAAA,eAAA,CAAA;EAC3C;IACA,IAAID,GAAG,KAAK,IAAI,IAAI,OAAOA,GAAG,KAAK,WAAW,EAAE;EAC9C,IAAA,OAAA;EACF,GAAA;EAEA,EAAA,IAAIE,CAAC,CAAA;EACL,EAAA,IAAIC,CAAC,CAAA;;EAEL;EACA,EAAA,IAAI,OAAOH,CAAAA,GAAG,CAAK,KAAA,QAAQ,EAAE;EAC3B;MACAA,GAAG,GAAG,CAACA,GAAG,CAAC,CAAA;EACb,GAAA;EAEA,EAAA,IAAInC,OAAO,CAACmC,GAAG,CAAC,EAAE;EAChB;EACA,IAAA,KAAKE,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAGH,GAAG,CAACI,MAAM,EAAEF,CAAC,GAAGC,CAAC,EAAED,CAAC,EAAE,EAAE;EACtCzD,MAAAA,EAAE,CAACa,IAAI,CAAC,IAAI,EAAE0C,GAAG,CAACE,CAAC,CAAC,EAAEA,CAAC,EAAEF,GAAG,CAAC,CAAA;EAC/B,KAAA;EACF,GAAC,MAAM;EACL;EACA,IAAA,IAAMK,IAAI,GAAGJ,UAAU,GAAGlD,MAAM,CAACuD,mBAAmB,CAACN,GAAG,CAAC,GAAGjD,MAAM,CAACsD,IAAI,CAACL,GAAG,CAAC,CAAA;EAC5E,IAAA,IAAMO,GAAG,GAAGF,IAAI,CAACD,MAAM,CAAA;EACvB,IAAA,IAAII,GAAG,CAAA;MAEP,KAAKN,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGK,GAAG,EAAEL,CAAC,EAAE,EAAE;EACxBM,MAAAA,GAAG,GAAGH,IAAI,CAACH,CAAC,CAAC,CAAA;EACbzD,MAAAA,EAAE,CAACa,IAAI,CAAC,IAAI,EAAE0C,GAAG,CAACQ,GAAG,CAAC,EAAEA,GAAG,EAAER,GAAG,CAAC,CAAA;EACnC,KAAA;EACF,GAAA;EACF,CAAA;EAEA,SAASS,OAAO,CAACT,GAAG,EAAEQ,GAAG,EAAE;EACzBA,EAAAA,GAAG,GAAGA,GAAG,CAAChD,WAAW,EAAE,CAAA;EACvB,EAAA,IAAM6C,IAAI,GAAGtD,MAAM,CAACsD,IAAI,CAACL,GAAG,CAAC,CAAA;EAC7B,EAAA,IAAIE,CAAC,GAAGG,IAAI,CAACD,MAAM,CAAA;EACnB,EAAA,IAAIM,IAAI,CAAA;EACR,EAAA,OAAOR,CAAC,EAAE,GAAG,CAAC,EAAE;EACdQ,IAAAA,IAAI,GAAGL,IAAI,CAACH,CAAC,CAAC,CAAA;EACd,IAAA,IAAIM,GAAG,KAAKE,IAAI,CAAClD,WAAW,EAAE,EAAE;EAC9B,MAAA,OAAOkD,IAAI,CAAA;EACb,KAAA;EACF,GAAA;EACA,EAAA,OAAO,IAAI,CAAA;EACb,CAAA;EAEA,IAAMC,OAAO,GAAI,YAAM;EACrB;EACA,EAAA,IAAI,OAAOC,UAAU,KAAK,WAAW,EAAE,OAAOA,UAAU,CAAA;EACxD,EAAA,OAAO,OAAOC,IAAI,KAAK,WAAW,GAAGA,IAAI,GAAI,OAAOC,MAAM,KAAK,WAAW,GAAGA,MAAM,GAAGC,MAAO,CAAA;EAC/F,CAAC,EAAG,CAAA;EAEJ,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgB,CAAIC,OAAO,EAAA;IAAA,OAAK,CAAClD,WAAW,CAACkD,OAAO,CAAC,IAAIA,OAAO,KAAKN,OAAO,CAAA;EAAA,CAAA,CAAA;;EAElF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAASO,KAAK,GAA8B;IAC1C,IAAmBF,KAAAA,GAAAA,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;EAAhDG,IAAAA,QAAQ,SAARA,QAAQ,CAAA;IACf,IAAM7C,MAAM,GAAG,EAAE,CAAA;IACjB,IAAM8C,WAAW,GAAG,SAAdA,WAAW,CAAInD,GAAG,EAAEuC,GAAG,EAAK;MAChC,IAAMa,SAAS,GAAGF,QAAQ,IAAIV,OAAO,CAACnC,MAAM,EAAEkC,GAAG,CAAC,IAAIA,GAAG,CAAA;EACzD,IAAA,IAAI1B,aAAa,CAACR,MAAM,CAAC+C,SAAS,CAAC,CAAC,IAAIvC,aAAa,CAACb,GAAG,CAAC,EAAE;EAC1DK,MAAAA,MAAM,CAAC+C,SAAS,CAAC,GAAGH,KAAK,CAAC5C,MAAM,CAAC+C,SAAS,CAAC,EAAEpD,GAAG,CAAC,CAAA;EACnD,KAAC,MAAM,IAAIa,aAAa,CAACb,GAAG,CAAC,EAAE;QAC7BK,MAAM,CAAC+C,SAAS,CAAC,GAAGH,KAAK,CAAC,EAAE,EAAEjD,GAAG,CAAC,CAAA;EACpC,KAAC,MAAM,IAAIJ,OAAO,CAACI,GAAG,CAAC,EAAE;EACvBK,MAAAA,MAAM,CAAC+C,SAAS,CAAC,GAAGpD,GAAG,CAACV,KAAK,EAAE,CAAA;EACjC,KAAC,MAAM;EACLe,MAAAA,MAAM,CAAC+C,SAAS,CAAC,GAAGpD,GAAG,CAAA;EACzB,KAAA;KACD,CAAA;EAED,EAAA,KAAK,IAAIiC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAGtD,SAAS,CAACuD,MAAM,EAAEF,CAAC,GAAGC,CAAC,EAAED,CAAC,EAAE,EAAE;EAChDrD,IAAAA,SAAS,CAACqD,CAAC,CAAC,IAAIH,OAAO,CAAClD,SAAS,CAACqD,CAAC,CAAC,EAAEkB,WAAW,CAAC,CAAA;EACpD,GAAA;EACA,EAAA,OAAO9C,MAAM,CAAA;EACf,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMgD,MAAM,GAAG,SAATA,MAAM,CAAIC,CAAC,EAAEC,CAAC,EAAE9E,OAAO,EAAuB;EAAA,EAAA,IAAA,KAAA,GAAA,SAAA,CAAA,MAAA,GAAA,CAAA,IAAA,SAAA,CAAA,CAAA,CAAA,KAAA,SAAA,GAAA,SAAA,CAAA,CAAA,CAAA,GAAP,EAAE;EAAfuD,IAAAA,UAAU,SAAVA,UAAU,CAAA;EACxCF,EAAAA,OAAO,CAACyB,CAAC,EAAE,UAACvD,GAAG,EAAEuC,GAAG,EAAK;EACvB,IAAA,IAAI9D,OAAO,IAAIyB,UAAU,CAACF,GAAG,CAAC,EAAE;QAC9BsD,CAAC,CAACf,GAAG,CAAC,GAAGhE,IAAI,CAACyB,GAAG,EAAEvB,OAAO,CAAC,CAAA;EAC7B,KAAC,MAAM;EACL6E,MAAAA,CAAC,CAACf,GAAG,CAAC,GAAGvC,GAAG,CAAA;EACd,KAAA;EACF,GAAC,EAAE;EAACgC,IAAAA,UAAU,EAAVA,UAAAA;EAAU,GAAC,CAAC,CAAA;EAChB,EAAA,OAAOsB,CAAC,CAAA;EACV,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAME,QAAQ,GAAG,SAAXA,QAAQ,CAAIC,OAAO,EAAK;IAC5B,IAAIA,OAAO,CAACC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE;EACpCD,IAAAA,OAAO,GAAGA,OAAO,CAACnE,KAAK,CAAC,CAAC,CAAC,CAAA;EAC5B,GAAA;EACA,EAAA,OAAOmE,OAAO,CAAA;EAChB,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAME,QAAQ,GAAG,SAAXA,QAAQ,CAAI1D,WAAW,EAAE2D,gBAAgB,EAAEC,KAAK,EAAEC,WAAW,EAAK;EACtE7D,EAAAA,WAAW,CAAClB,SAAS,GAAGD,MAAM,CAACU,MAAM,CAACoE,gBAAgB,CAAC7E,SAAS,EAAE+E,WAAW,CAAC,CAAA;EAC9E7D,EAAAA,WAAW,CAAClB,SAAS,CAACkB,WAAW,GAAGA,WAAW,CAAA;EAC/CnB,EAAAA,MAAM,CAACiF,cAAc,CAAC9D,WAAW,EAAE,OAAO,EAAE;MAC1C+D,KAAK,EAAEJ,gBAAgB,CAAC7E,SAAAA;EAC1B,GAAC,CAAC,CAAA;IACF8E,KAAK,IAAI/E,MAAM,CAACmF,MAAM,CAAChE,WAAW,CAAClB,SAAS,EAAE8E,KAAK,CAAC,CAAA;EACtD,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMK,YAAY,GAAG,SAAfA,YAAY,CAAIC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,UAAU,EAAK;EAC/D,EAAA,IAAIT,KAAK,CAAA;EACT,EAAA,IAAI5B,CAAC,CAAA;EACL,EAAA,IAAIsC,IAAI,CAAA;IACR,IAAMC,MAAM,GAAG,EAAE,CAAA;EAEjBJ,EAAAA,OAAO,GAAGA,OAAO,IAAI,EAAE,CAAA;EACvB;EACA,EAAA,IAAID,SAAS,IAAI,IAAI,EAAE,OAAOC,OAAO,CAAA;IAErC,GAAG;EACDP,IAAAA,KAAK,GAAG/E,MAAM,CAACuD,mBAAmB,CAAC8B,SAAS,CAAC,CAAA;MAC7ClC,CAAC,GAAG4B,KAAK,CAAC1B,MAAM,CAAA;EAChB,IAAA,OAAOF,CAAC,EAAE,GAAG,CAAC,EAAE;EACdsC,MAAAA,IAAI,GAAGV,KAAK,CAAC5B,CAAC,CAAC,CAAA;EACf,MAAA,IAAI,CAAC,CAACqC,UAAU,IAAIA,UAAU,CAACC,IAAI,EAAEJ,SAAS,EAAEC,OAAO,CAAC,KAAK,CAACI,MAAM,CAACD,IAAI,CAAC,EAAE;EAC1EH,QAAAA,OAAO,CAACG,IAAI,CAAC,GAAGJ,SAAS,CAACI,IAAI,CAAC,CAAA;EAC/BC,QAAAA,MAAM,CAACD,IAAI,CAAC,GAAG,IAAI,CAAA;EACrB,OAAA;EACF,KAAA;MACAJ,SAAS,GAAGE,MAAM,KAAK,KAAK,IAAIrF,cAAc,CAACmF,SAAS,CAAC,CAAA;EAC3D,GAAC,QAAQA,SAAS,KAAK,CAACE,MAAM,IAAIA,MAAM,CAACF,SAAS,EAAEC,OAAO,CAAC,CAAC,IAAID,SAAS,KAAKrF,MAAM,CAACC,SAAS,EAAA;EAE/F,EAAA,OAAOqF,OAAO,CAAA;EAChB,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMK,QAAQ,GAAG,SAAXA,QAAQ,CAAIrF,GAAG,EAAEsF,YAAY,EAAEC,QAAQ,EAAK;EAChDvF,EAAAA,GAAG,GAAGwF,MAAM,CAACxF,GAAG,CAAC,CAAA;IACjB,IAAIuF,QAAQ,KAAKE,SAAS,IAAIF,QAAQ,GAAGvF,GAAG,CAAC+C,MAAM,EAAE;MACnDwC,QAAQ,GAAGvF,GAAG,CAAC+C,MAAM,CAAA;EACvB,GAAA;IACAwC,QAAQ,IAAID,YAAY,CAACvC,MAAM,CAAA;IAC/B,IAAM2C,SAAS,GAAG1F,GAAG,CAAC2F,OAAO,CAACL,YAAY,EAAEC,QAAQ,CAAC,CAAA;EACrD,EAAA,OAAOG,SAAS,KAAK,CAAC,CAAC,IAAIA,SAAS,KAAKH,QAAQ,CAAA;EACnD,CAAC,CAAA;;EAGD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMK,OAAO,GAAG,SAAVA,OAAO,CAAI7F,KAAK,EAAK;EACzB,EAAA,IAAI,CAACA,KAAK,EAAE,OAAO,IAAI,CAAA;EACvB,EAAA,IAAIS,OAAO,CAACT,KAAK,CAAC,EAAE,OAAOA,KAAK,CAAA;EAChC,EAAA,IAAI8C,CAAC,GAAG9C,KAAK,CAACgD,MAAM,CAAA;EACpB,EAAA,IAAI,CAACzB,QAAQ,CAACuB,CAAC,CAAC,EAAE,OAAO,IAAI,CAAA;EAC7B,EAAA,IAAMgD,GAAG,GAAG,IAAIpF,KAAK,CAACoC,CAAC,CAAC,CAAA;EACxB,EAAA,OAAOA,CAAC,EAAE,GAAG,CAAC,EAAE;EACdgD,IAAAA,GAAG,CAAChD,CAAC,CAAC,GAAG9C,KAAK,CAAC8C,CAAC,CAAC,CAAA;EACnB,GAAA;EACA,EAAA,OAAOgD,GAAG,CAAA;EACZ,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMC,YAAY,GAAI,UAAAC,UAAU,EAAI;EAClC;IACA,OAAO,UAAAhG,KAAK,EAAI;EACd,IAAA,OAAOgG,UAAU,IAAIhG,KAAK,YAAYgG,UAAU,CAAA;KACjD,CAAA;EACH,CAAC,CAAE,OAAOC,UAAU,KAAK,WAAW,IAAIpG,cAAc,CAACoG,UAAU,CAAC,CAAC,CAAA;;EAEnE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMC,YAAY,GAAG,SAAfA,YAAY,CAAItD,GAAG,EAAEvD,EAAE,EAAK;IAChC,IAAM8G,SAAS,GAAGvD,GAAG,IAAIA,GAAG,CAACjB,MAAM,CAACE,QAAQ,CAAC,CAAA;EAE7C,EAAA,IAAMA,QAAQ,GAAGsE,SAAS,CAACjG,IAAI,CAAC0C,GAAG,CAAC,CAAA;EAEpC,EAAA,IAAI1B,MAAM,CAAA;EAEV,EAAA,OAAO,CAACA,MAAM,GAAGW,QAAQ,CAACuE,IAAI,EAAE,KAAK,CAAClF,MAAM,CAACmF,IAAI,EAAE;EACjD,IAAA,IAAMC,IAAI,GAAGpF,MAAM,CAAC2D,KAAK,CAAA;EACzBxF,IAAAA,EAAE,CAACa,IAAI,CAAC0C,GAAG,EAAE0D,IAAI,CAAC,CAAC,CAAC,EAAEA,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;EAChC,GAAA;EACF,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMC,QAAQ,GAAG,SAAXA,QAAQ,CAAIC,MAAM,EAAEvG,GAAG,EAAK;EAChC,EAAA,IAAIwG,OAAO,CAAA;IACX,IAAMX,GAAG,GAAG,EAAE,CAAA;IAEd,OAAO,CAACW,OAAO,GAAGD,MAAM,CAACE,IAAI,CAACzG,GAAG,CAAC,MAAM,IAAI,EAAE;EAC5C6F,IAAAA,GAAG,CAACa,IAAI,CAACF,OAAO,CAAC,CAAA;EACnB,GAAA;EAEA,EAAA,OAAOX,GAAG,CAAA;EACZ,CAAC,CAAA;;EAED;EACA,IAAMc,UAAU,GAAGtG,UAAU,CAAC,iBAAiB,CAAC,CAAA;EAEhD,IAAMuG,WAAW,GAAG,SAAdA,WAAW,CAAG5G,GAAG,EAAI;EACzB,EAAA,OAAOA,GAAG,CAACG,WAAW,EAAE,CAACsC,OAAO,CAAC,uBAAuB,EACtD,SAASoE,QAAQ,CAACC,CAAC,EAAEC,EAAE,EAAEC,EAAE,EAAE;EAC3B,IAAA,OAAOD,EAAE,CAACE,WAAW,EAAE,GAAGD,EAAE,CAAA;EAC9B,GAAC,CACF,CAAA;EACH,CAAC,CAAA;;EAED;EACA,IAAME,cAAc,GAAI,UAAA,KAAA,EAAA;IAAA,IAAEA,cAAc,SAAdA,cAAc,CAAA;IAAA,OAAM,UAACvE,GAAG,EAAEwC,IAAI,EAAA;EAAA,IAAA,OAAK+B,cAAc,CAACjH,IAAI,CAAC0C,GAAG,EAAEwC,IAAI,CAAC,CAAA;EAAA,GAAA,CAAA;EAAA,CAAEzF,CAAAA,MAAM,CAACC,SAAS,CAAC,CAAA;;EAE9G;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMwH,QAAQ,GAAG9G,UAAU,CAAC,QAAQ,CAAC,CAAA;EAErC,IAAM+G,iBAAiB,GAAG,SAApBA,iBAAiB,CAAIzE,GAAG,EAAE0E,OAAO,EAAK;EAC1C,EAAA,IAAM3C,WAAW,GAAGhF,MAAM,CAAC4H,yBAAyB,CAAC3E,GAAG,CAAC,CAAA;IACzD,IAAM4E,kBAAkB,GAAG,EAAE,CAAA;EAE7B7E,EAAAA,OAAO,CAACgC,WAAW,EAAE,UAAC8C,UAAU,EAAEC,IAAI,EAAK;EACzC,IAAA,IAAIC,GAAG,CAAA;EACP,IAAA,IAAI,CAACA,GAAG,GAAGL,OAAO,CAACG,UAAU,EAAEC,IAAI,EAAE9E,GAAG,CAAC,MAAM,KAAK,EAAE;EACpD4E,MAAAA,kBAAkB,CAACE,IAAI,CAAC,GAAGC,GAAG,IAAIF,UAAU,CAAA;EAC9C,KAAA;EACF,GAAC,CAAC,CAAA;EAEF9H,EAAAA,MAAM,CAACiI,gBAAgB,CAAChF,GAAG,EAAE4E,kBAAkB,CAAC,CAAA;EAClD,CAAC,CAAA;;EAED;EACA;EACA;EACA;;EAEA,IAAMK,aAAa,GAAG,SAAhBA,aAAa,CAAIjF,GAAG,EAAK;EAC7ByE,EAAAA,iBAAiB,CAACzE,GAAG,EAAE,UAAC6E,UAAU,EAAEC,IAAI,EAAK;EAC3C;MACA,IAAI3G,UAAU,CAAC6B,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAACgD,OAAO,CAAC8B,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;EAC7E,MAAA,OAAO,KAAK,CAAA;EACd,KAAA;EAEA,IAAA,IAAM7C,KAAK,GAAGjC,GAAG,CAAC8E,IAAI,CAAC,CAAA;EAEvB,IAAA,IAAI,CAAC3G,UAAU,CAAC8D,KAAK,CAAC,EAAE,OAAA;MAExB4C,UAAU,CAACK,UAAU,GAAG,KAAK,CAAA;MAE7B,IAAI,UAAU,IAAIL,UAAU,EAAE;QAC5BA,UAAU,CAACM,QAAQ,GAAG,KAAK,CAAA;EAC3B,MAAA,OAAA;EACF,KAAA;EAEA,IAAA,IAAI,CAACN,UAAU,CAACO,GAAG,EAAE;QACnBP,UAAU,CAACO,GAAG,GAAG,YAAM;EACrB,QAAA,MAAMC,KAAK,CAAC,qCAAqC,GAAGP,IAAI,GAAG,IAAI,CAAC,CAAA;SACjE,CAAA;EACH,KAAA;EACF,GAAC,CAAC,CAAA;EACJ,CAAC,CAAA;EAED,IAAMQ,WAAW,GAAG,SAAdA,WAAW,CAAIC,aAAa,EAAEC,SAAS,EAAK;IAChD,IAAMxF,GAAG,GAAG,EAAE,CAAA;EAEd,EAAA,IAAMyF,MAAM,GAAG,SAATA,MAAM,CAAIvC,GAAG,EAAK;EACtBA,IAAAA,GAAG,CAACnD,OAAO,CAAC,UAAAkC,KAAK,EAAI;EACnBjC,MAAAA,GAAG,CAACiC,KAAK,CAAC,GAAG,IAAI,CAAA;EACnB,KAAC,CAAC,CAAA;KACH,CAAA;IAEDpE,OAAO,CAAC0H,aAAa,CAAC,GAAGE,MAAM,CAACF,aAAa,CAAC,GAAGE,MAAM,CAAC5C,MAAM,CAAC0C,aAAa,CAAC,CAACG,KAAK,CAACF,SAAS,CAAC,CAAC,CAAA;EAE/F,EAAA,OAAOxF,GAAG,CAAA;EACZ,CAAC,CAAA;EAED,IAAM2F,IAAI,GAAG,SAAPA,IAAI,GAAS,EAAE,CAAA;EAErB,IAAMC,cAAc,GAAG,SAAjBA,cAAc,CAAI3D,KAAK,EAAE4D,YAAY,EAAK;IAC9C5D,KAAK,GAAG,CAACA,KAAK,CAAA;IACd,OAAO6D,MAAM,CAACC,QAAQ,CAAC9D,KAAK,CAAC,GAAGA,KAAK,GAAG4D,YAAY,CAAA;EACtD,CAAC,CAAA;EAED,IAAMG,KAAK,GAAG,4BAA4B,CAAA;EAE1C,IAAMC,KAAK,GAAG,YAAY,CAAA;EAE1B,IAAMC,QAAQ,GAAG;EACfD,EAAAA,KAAK,EAALA,KAAK;EACLD,EAAAA,KAAK,EAALA,KAAK;EACLG,EAAAA,WAAW,EAAEH,KAAK,GAAGA,KAAK,CAAC1B,WAAW,EAAE,GAAG2B,KAAAA;EAC7C,CAAC,CAAA;EAED,IAAMG,cAAc,GAAG,SAAjBA,cAAc,GAAmD;IAAA,IAA/CC,IAAI,uEAAG,EAAE,CAAA;EAAA,EAAA,IAAEC,QAAQ,GAAA,SAAA,CAAA,MAAA,GAAA,CAAA,IAAA,SAAA,CAAA,CAAA,CAAA,KAAA,SAAA,GAAA,SAAA,CAAA,CAAA,CAAA,GAAGJ,QAAQ,CAACC,WAAW,CAAA;IAChE,IAAI9I,GAAG,GAAG,EAAE,CAAA;EACZ,EAAA,IAAO+C,MAAM,GAAIkG,QAAQ,CAAlBlG,MAAM,CAAA;IACb,OAAOiG,IAAI,EAAE,EAAE;MACbhJ,GAAG,IAAIiJ,QAAQ,CAACC,IAAI,CAACC,MAAM,EAAE,GAAGpG,MAAM,GAAC,CAAC,CAAC,CAAA;EAC3C,GAAA;EAEA,EAAA,OAAO/C,GAAG,CAAA;EACZ,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASoJ,mBAAmB,CAACrJ,KAAK,EAAE;IAClC,OAAO,CAAC,EAAEA,KAAK,IAAIe,UAAU,CAACf,KAAK,CAACuC,MAAM,CAAC,IAAIvC,KAAK,CAAC2B,MAAM,CAACC,WAAW,CAAC,KAAK,UAAU,IAAI5B,KAAK,CAAC2B,MAAM,CAACE,QAAQ,CAAC,CAAC,CAAA;EACpH,CAAA;EAEA,IAAMyH,YAAY,GAAG,SAAfA,YAAY,CAAI1G,GAAG,EAAK;EAC5B,EAAA,IAAM2G,KAAK,GAAG,IAAI7I,KAAK,CAAC,EAAE,CAAC,CAAA;IAE3B,IAAM8I,KAAK,GAAG,SAARA,KAAK,CAAIC,MAAM,EAAE3G,CAAC,EAAK;EAE3B,IAAA,IAAItB,QAAQ,CAACiI,MAAM,CAAC,EAAE;QACpB,IAAIF,KAAK,CAAC3D,OAAO,CAAC6D,MAAM,CAAC,IAAI,CAAC,EAAE;EAC9B,QAAA,OAAA;EACF,OAAA;EAEA,MAAA,IAAG,EAAE,QAAQ,IAAIA,MAAM,CAAC,EAAE;EACxBF,QAAAA,KAAK,CAACzG,CAAC,CAAC,GAAG2G,MAAM,CAAA;UACjB,IAAMC,MAAM,GAAGjJ,OAAO,CAACgJ,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAA;EAExC9G,QAAAA,OAAO,CAAC8G,MAAM,EAAE,UAAC5E,KAAK,EAAEzB,GAAG,EAAK;YAC9B,IAAMuG,YAAY,GAAGH,KAAK,CAAC3E,KAAK,EAAE/B,CAAC,GAAG,CAAC,CAAC,CAAA;YACxC,CAACnC,WAAW,CAACgJ,YAAY,CAAC,KAAKD,MAAM,CAACtG,GAAG,CAAC,GAAGuG,YAAY,CAAC,CAAA;EAC5D,SAAC,CAAC,CAAA;EAEFJ,QAAAA,KAAK,CAACzG,CAAC,CAAC,GAAG4C,SAAS,CAAA;EAEpB,QAAA,OAAOgE,MAAM,CAAA;EACf,OAAA;EACF,KAAA;EAEA,IAAA,OAAOD,MAAM,CAAA;KACd,CAAA;EAED,EAAA,OAAOD,KAAK,CAAC5G,GAAG,EAAE,CAAC,CAAC,CAAA;EACtB,CAAC,CAAA;EAED,IAAMgH,SAAS,GAAGtJ,UAAU,CAAC,eAAe,CAAC,CAAA;EAE7C,IAAMuJ,UAAU,GAAG,SAAbA,UAAU,CAAI7J,KAAK,EAAA;IAAA,OACvBA,KAAK,KAAKwB,QAAQ,CAACxB,KAAK,CAAC,IAAIe,UAAU,CAACf,KAAK,CAAC,CAAC,IAAIe,UAAU,CAACf,KAAK,CAAC8J,IAAI,CAAC,IAAI/I,UAAU,CAACf,KAAK,CAAA,OAAA,CAAM,CAAC,CAAA;EAAA,CAAA,CAAA;AAEtG,gBAAe;EACbS,EAAAA,OAAO,EAAPA,OAAO;EACPO,EAAAA,aAAa,EAAbA,aAAa;EACbJ,EAAAA,QAAQ,EAARA,QAAQ;EACRwB,EAAAA,UAAU,EAAVA,UAAU;EACVnB,EAAAA,iBAAiB,EAAjBA,iBAAiB;EACjBK,EAAAA,QAAQ,EAARA,QAAQ;EACRC,EAAAA,QAAQ,EAARA,QAAQ;EACRE,EAAAA,SAAS,EAATA,SAAS;EACTD,EAAAA,QAAQ,EAARA,QAAQ;EACRE,EAAAA,aAAa,EAAbA,aAAa;EACbf,EAAAA,WAAW,EAAXA,WAAW;EACXmB,EAAAA,MAAM,EAANA,MAAM;EACNC,EAAAA,MAAM,EAANA,MAAM;EACNC,EAAAA,MAAM,EAANA,MAAM;EACNoF,EAAAA,QAAQ,EAARA,QAAQ;EACRrG,EAAAA,UAAU,EAAVA,UAAU;EACVmB,EAAAA,QAAQ,EAARA,QAAQ;EACRM,EAAAA,iBAAiB,EAAjBA,iBAAiB;EACjBuD,EAAAA,YAAY,EAAZA,YAAY;EACZ9D,EAAAA,UAAU,EAAVA,UAAU;EACVU,EAAAA,OAAO,EAAPA,OAAO;EACPmB,EAAAA,KAAK,EAALA,KAAK;EACLI,EAAAA,MAAM,EAANA,MAAM;EACNzB,EAAAA,IAAI,EAAJA,IAAI;EACJ4B,EAAAA,QAAQ,EAARA,QAAQ;EACRG,EAAAA,QAAQ,EAARA,QAAQ;EACRO,EAAAA,YAAY,EAAZA,YAAY;EACZjF,EAAAA,MAAM,EAANA,MAAM;EACNQ,EAAAA,UAAU,EAAVA,UAAU;EACVgF,EAAAA,QAAQ,EAARA,QAAQ;EACRO,EAAAA,OAAO,EAAPA,OAAO;EACPK,EAAAA,YAAY,EAAZA,YAAY;EACZK,EAAAA,QAAQ,EAARA,QAAQ;EACRK,EAAAA,UAAU,EAAVA,UAAU;EACVO,EAAAA,cAAc,EAAdA,cAAc;EACd4C,EAAAA,UAAU,EAAE5C,cAAc;EAAE;EAC5BE,EAAAA,iBAAiB,EAAjBA,iBAAiB;EACjBQ,EAAAA,aAAa,EAAbA,aAAa;EACbK,EAAAA,WAAW,EAAXA,WAAW;EACXrB,EAAAA,WAAW,EAAXA,WAAW;EACX0B,EAAAA,IAAI,EAAJA,IAAI;EACJC,EAAAA,cAAc,EAAdA,cAAc;EACdnF,EAAAA,OAAO,EAAPA,OAAO;EACPM,EAAAA,MAAM,EAAEJ,OAAO;EACfK,EAAAA,gBAAgB,EAAhBA,gBAAgB;EAChBkF,EAAAA,QAAQ,EAARA,QAAQ;EACRE,EAAAA,cAAc,EAAdA,cAAc;EACdK,EAAAA,mBAAmB,EAAnBA,mBAAmB;EACnBC,EAAAA,YAAY,EAAZA,YAAY;EACZM,EAAAA,SAAS,EAATA,SAAS;EACTC,EAAAA,UAAU,EAAVA,UAAAA;EACF,CAAC;;EC9sBD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASG,UAAU,CAACC,OAAO,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE;EAC5DpC,EAAAA,KAAK,CAAC/H,IAAI,CAAC,IAAI,CAAC,CAAA;IAEhB,IAAI+H,KAAK,CAACqC,iBAAiB,EAAE;MAC3BrC,KAAK,CAACqC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAACxJ,WAAW,CAAC,CAAA;EACjD,GAAC,MAAM;EACL,IAAA,IAAI,CAACyI,KAAK,GAAI,IAAItB,KAAK,EAAE,CAAEsB,KAAK,CAAA;EAClC,GAAA;IAEA,IAAI,CAACU,OAAO,GAAGA,OAAO,CAAA;IACtB,IAAI,CAACvC,IAAI,GAAG,YAAY,CAAA;EACxBwC,EAAAA,IAAI,KAAK,IAAI,CAACA,IAAI,GAAGA,IAAI,CAAC,CAAA;EAC1BC,EAAAA,MAAM,KAAK,IAAI,CAACA,MAAM,GAAGA,MAAM,CAAC,CAAA;EAChCC,EAAAA,OAAO,KAAK,IAAI,CAACA,OAAO,GAAGA,OAAO,CAAC,CAAA;EACnCC,EAAAA,QAAQ,KAAK,IAAI,CAACA,QAAQ,GAAGA,QAAQ,CAAC,CAAA;EACxC,CAAA;AAEAE,SAAK,CAAC/F,QAAQ,CAACwF,UAAU,EAAE/B,KAAK,EAAE;IAChCuC,MAAM,EAAE,SAASA,MAAM,GAAG;MACxB,OAAO;EACL;QACAP,OAAO,EAAE,IAAI,CAACA,OAAO;QACrBvC,IAAI,EAAE,IAAI,CAACA,IAAI;EACf;QACA+C,WAAW,EAAE,IAAI,CAACA,WAAW;QAC7BC,MAAM,EAAE,IAAI,CAACA,MAAM;EACnB;QACAC,QAAQ,EAAE,IAAI,CAACA,QAAQ;QACvBC,UAAU,EAAE,IAAI,CAACA,UAAU;QAC3BC,YAAY,EAAE,IAAI,CAACA,YAAY;QAC/BtB,KAAK,EAAE,IAAI,CAACA,KAAK;EACjB;QACAY,MAAM,EAAEI,OAAK,CAACjB,YAAY,CAAC,IAAI,CAACa,MAAM,CAAC;QACvCD,IAAI,EAAE,IAAI,CAACA,IAAI;EACfY,MAAAA,MAAM,EAAE,IAAI,CAACT,QAAQ,IAAI,IAAI,CAACA,QAAQ,CAACS,MAAM,GAAG,IAAI,CAACT,QAAQ,CAACS,MAAM,GAAG,IAAA;OACxE,CAAA;EACH,GAAA;EACF,CAAC,CAAC,CAAA;EAEF,IAAMlL,WAAS,GAAGoK,UAAU,CAACpK,SAAS,CAAA;EACtC,IAAM+E,WAAW,GAAG,EAAE,CAAA;EAEtB,CACE,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,aAAa,EACb,2BAA2B,EAC3B,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,iBAAA;EACF;EAAA,CACC,CAAChC,OAAO,CAAC,UAAAuH,IAAI,EAAI;IAChBvF,WAAW,CAACuF,IAAI,CAAC,GAAG;EAACrF,IAAAA,KAAK,EAAEqF,IAAAA;KAAK,CAAA;EACnC,CAAC,CAAC,CAAA;EAEFvK,MAAM,CAACiI,gBAAgB,CAACoC,UAAU,EAAErF,WAAW,CAAC,CAAA;EAChDhF,MAAM,CAACiF,cAAc,CAAChF,WAAS,EAAE,cAAc,EAAE;EAACiF,EAAAA,KAAK,EAAE,IAAA;EAAI,CAAC,CAAC,CAAA;;EAE/D;EACAmF,UAAU,CAACe,IAAI,GAAG,UAACC,KAAK,EAAEd,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEY,WAAW,EAAK;EACzE,EAAA,IAAMC,UAAU,GAAGvL,MAAM,CAACU,MAAM,CAACT,WAAS,CAAC,CAAA;IAE3C2K,OAAK,CAACxF,YAAY,CAACiG,KAAK,EAAEE,UAAU,EAAE,SAAShG,MAAM,CAACtC,GAAG,EAAE;EACzD,IAAA,OAAOA,GAAG,KAAKqF,KAAK,CAACrI,SAAS,CAAA;KAC/B,EAAE,UAAAwF,IAAI,EAAI;MACT,OAAOA,IAAI,KAAK,cAAc,CAAA;EAChC,GAAC,CAAC,CAAA;EAEF4E,EAAAA,UAAU,CAAC9J,IAAI,CAACgL,UAAU,EAAEF,KAAK,CAACf,OAAO,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAC,CAAA;IAE3Ea,UAAU,CAACC,KAAK,GAAGH,KAAK,CAAA;EAExBE,EAAAA,UAAU,CAACxD,IAAI,GAAGsD,KAAK,CAACtD,IAAI,CAAA;IAE5BuD,WAAW,IAAItL,MAAM,CAACmF,MAAM,CAACoG,UAAU,EAAED,WAAW,CAAC,CAAA;EAErD,EAAA,OAAOC,UAAU,CAAA;EACnB,CAAC;;ECjGD;AACA,oBAAe,IAAI;;ECMnB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASE,WAAW,CAACpL,KAAK,EAAE;EAC1B,EAAA,OAAOuK,OAAK,CAAC7I,aAAa,CAAC1B,KAAK,CAAC,IAAIuK,OAAK,CAAC9J,OAAO,CAACT,KAAK,CAAC,CAAA;EAC3D,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASqL,cAAc,CAACjI,GAAG,EAAE;EAC3B,EAAA,OAAOmH,OAAK,CAACjF,QAAQ,CAAClC,GAAG,EAAE,IAAI,CAAC,GAAGA,GAAG,CAACjD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAGiD,GAAG,CAAA;EAC3D,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASkI,SAAS,CAACC,IAAI,EAAEnI,GAAG,EAAEoI,IAAI,EAAE;EAClC,EAAA,IAAI,CAACD,IAAI,EAAE,OAAOnI,GAAG,CAAA;EACrB,EAAA,OAAOmI,IAAI,CAACE,MAAM,CAACrI,GAAG,CAAC,CAACsI,GAAG,CAAC,SAASC,IAAI,CAACC,KAAK,EAAE9I,CAAC,EAAE;EAClD;EACA8I,IAAAA,KAAK,GAAGP,cAAc,CAACO,KAAK,CAAC,CAAA;MAC7B,OAAO,CAACJ,IAAI,IAAI1I,CAAC,GAAG,GAAG,GAAG8I,KAAK,GAAG,GAAG,GAAGA,KAAK,CAAA;KAC9C,CAAC,CAACC,IAAI,CAACL,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC,CAAA;EAC1B,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASM,WAAW,CAAChG,GAAG,EAAE;EACxB,EAAA,OAAOyE,OAAK,CAAC9J,OAAO,CAACqF,GAAG,CAAC,IAAI,CAACA,GAAG,CAACiG,IAAI,CAACX,WAAW,CAAC,CAAA;EACrD,CAAA;EAEA,IAAMY,UAAU,GAAGzB,OAAK,CAACxF,YAAY,CAACwF,OAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAASrF,MAAM,CAACE,IAAI,EAAE;EAC3E,EAAA,OAAO,UAAU,CAAC6G,IAAI,CAAC7G,IAAI,CAAC,CAAA;EAC9B,CAAC,CAAC,CAAA;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS8G,UAAU,CAACtJ,GAAG,EAAEuJ,QAAQ,EAAEC,OAAO,EAAE;EAC1C,EAAA,IAAI,CAAC7B,OAAK,CAAC/I,QAAQ,CAACoB,GAAG,CAAC,EAAE;EACxB,IAAA,MAAM,IAAIyJ,SAAS,CAAC,0BAA0B,CAAC,CAAA;EACjD,GAAA;;EAEA;EACAF,EAAAA,QAAQ,GAAGA,QAAQ,IAAI,KAAyB7J,QAAQ,GAAG,CAAA;;EAE3D;EACA8J,EAAAA,OAAO,GAAG7B,OAAK,CAACxF,YAAY,CAACqH,OAAO,EAAE;EACpCE,IAAAA,UAAU,EAAE,IAAI;EAChBd,IAAAA,IAAI,EAAE,KAAK;EACXe,IAAAA,OAAO,EAAE,KAAA;KACV,EAAE,KAAK,EAAE,SAASC,OAAO,CAACC,MAAM,EAAEhD,MAAM,EAAE;EACzC;MACA,OAAO,CAACc,OAAK,CAAC5J,WAAW,CAAC8I,MAAM,CAACgD,MAAM,CAAC,CAAC,CAAA;EAC3C,GAAC,CAAC,CAAA;EAEF,EAAA,IAAMH,UAAU,GAAGF,OAAO,CAACE,UAAU,CAAA;EACrC;EACA,EAAA,IAAMI,OAAO,GAAGN,OAAO,CAACM,OAAO,IAAIC,cAAc,CAAA;EACjD,EAAA,IAAMnB,IAAI,GAAGY,OAAO,CAACZ,IAAI,CAAA;EACzB,EAAA,IAAMe,OAAO,GAAGH,OAAO,CAACG,OAAO,CAAA;IAC/B,IAAMK,KAAK,GAAGR,OAAO,CAACS,IAAI,IAAI,OAAOA,IAAI,KAAK,WAAW,IAAIA,IAAI,CAAA;IACjE,IAAMC,OAAO,GAAGF,KAAK,IAAIrC,OAAK,CAAClB,mBAAmB,CAAC8C,QAAQ,CAAC,CAAA;EAE5D,EAAA,IAAI,CAAC5B,OAAK,CAACxJ,UAAU,CAAC2L,OAAO,CAAC,EAAE;EAC9B,IAAA,MAAM,IAAIL,SAAS,CAAC,4BAA4B,CAAC,CAAA;EACnD,GAAA;IAEA,SAASU,YAAY,CAAClI,KAAK,EAAE;EAC3B,IAAA,IAAIA,KAAK,KAAK,IAAI,EAAE,OAAO,EAAE,CAAA;EAE7B,IAAA,IAAI0F,OAAK,CAACzI,MAAM,CAAC+C,KAAK,CAAC,EAAE;QACvB,OAAOA,KAAK,CAACmI,WAAW,EAAE,CAAA;EAC5B,KAAA;MAEA,IAAI,CAACF,OAAO,IAAIvC,OAAK,CAACvI,MAAM,CAAC6C,KAAK,CAAC,EAAE;EACnC,MAAA,MAAM,IAAImF,UAAU,CAAC,8CAA8C,CAAC,CAAA;EACtE,KAAA;EAEA,IAAA,IAAIO,OAAK,CAACvJ,aAAa,CAAC6D,KAAK,CAAC,IAAI0F,OAAK,CAACxE,YAAY,CAAClB,KAAK,CAAC,EAAE;QAC3D,OAAOiI,OAAO,IAAI,OAAOD,IAAI,KAAK,UAAU,GAAG,IAAIA,IAAI,CAAC,CAAChI,KAAK,CAAC,CAAC,GAAGoI,MAAM,CAAClC,IAAI,CAAClG,KAAK,CAAC,CAAA;EACvF,KAAA;EAEA,IAAA,OAAOA,KAAK,CAAA;EACd,GAAA;;EAEA;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACE,EAAA,SAAS8H,cAAc,CAAC9H,KAAK,EAAEzB,GAAG,EAAEmI,IAAI,EAAE;MACxC,IAAIzF,GAAG,GAAGjB,KAAK,CAAA;MAEf,IAAIA,KAAK,IAAI,CAAC0G,IAAI,IAAI,OAAO1G,CAAAA,KAAK,CAAK,KAAA,QAAQ,EAAE;QAC/C,IAAI0F,OAAK,CAACjF,QAAQ,CAAClC,GAAG,EAAE,IAAI,CAAC,EAAE;EAC7B;EACAA,QAAAA,GAAG,GAAGkJ,UAAU,GAAGlJ,GAAG,GAAGA,GAAG,CAACjD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;EACzC;EACA0E,QAAAA,KAAK,GAAGqI,IAAI,CAACC,SAAS,CAACtI,KAAK,CAAC,CAAA;EAC/B,OAAC,MAAM,IACJ0F,OAAK,CAAC9J,OAAO,CAACoE,KAAK,CAAC,IAAIiH,WAAW,CAACjH,KAAK,CAAC,IAC1C,CAAC0F,OAAK,CAACtI,UAAU,CAAC4C,KAAK,CAAC,IAAI0F,OAAK,CAACjF,QAAQ,CAAClC,GAAG,EAAE,IAAI,CAAC,MAAM0C,GAAG,GAAGyE,OAAK,CAAC1E,OAAO,CAAChB,KAAK,CAAC,CACrF,EAAE;EACH;EACAzB,QAAAA,GAAG,GAAGiI,cAAc,CAACjI,GAAG,CAAC,CAAA;UAEzB0C,GAAG,CAACnD,OAAO,CAAC,SAASgJ,IAAI,CAACyB,EAAE,EAAEC,KAAK,EAAE;EACnC,UAAA,EAAE9C,OAAK,CAAC5J,WAAW,CAACyM,EAAE,CAAC,IAAIA,EAAE,KAAK,IAAI,CAAC,IAAIjB,QAAQ,CAAC5J,MAAM;EACxD;EACAgK,UAAAA,OAAO,KAAK,IAAI,GAAGjB,SAAS,CAAC,CAAClI,GAAG,CAAC,EAAEiK,KAAK,EAAE7B,IAAI,CAAC,GAAIe,OAAO,KAAK,IAAI,GAAGnJ,GAAG,GAAGA,GAAG,GAAG,IAAK,EACxF2J,YAAY,CAACK,EAAE,CAAC,CACjB,CAAA;EACH,SAAC,CAAC,CAAA;EACF,QAAA,OAAO,KAAK,CAAA;EACd,OAAA;EACF,KAAA;EAEA,IAAA,IAAIhC,WAAW,CAACvG,KAAK,CAAC,EAAE;EACtB,MAAA,OAAO,IAAI,CAAA;EACb,KAAA;EAEAsH,IAAAA,QAAQ,CAAC5J,MAAM,CAAC+I,SAAS,CAACC,IAAI,EAAEnI,GAAG,EAAEoI,IAAI,CAAC,EAAEuB,YAAY,CAAClI,KAAK,CAAC,CAAC,CAAA;EAEhE,IAAA,OAAO,KAAK,CAAA;EACd,GAAA;IAEA,IAAM0E,KAAK,GAAG,EAAE,CAAA;EAEhB,EAAA,IAAM+D,cAAc,GAAG3N,MAAM,CAACmF,MAAM,CAACkH,UAAU,EAAE;EAC/CW,IAAAA,cAAc,EAAdA,cAAc;EACdI,IAAAA,YAAY,EAAZA,YAAY;EACZ3B,IAAAA,WAAW,EAAXA,WAAAA;EACF,GAAC,CAAC,CAAA;EAEF,EAAA,SAASmC,KAAK,CAAC1I,KAAK,EAAE0G,IAAI,EAAE;EAC1B,IAAA,IAAIhB,OAAK,CAAC5J,WAAW,CAACkE,KAAK,CAAC,EAAE,OAAA;MAE9B,IAAI0E,KAAK,CAAC3D,OAAO,CAACf,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/B,MAAMoD,KAAK,CAAC,iCAAiC,GAAGsD,IAAI,CAACM,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;EACjE,KAAA;EAEAtC,IAAAA,KAAK,CAAC5C,IAAI,CAAC9B,KAAK,CAAC,CAAA;MAEjB0F,OAAK,CAAC5H,OAAO,CAACkC,KAAK,EAAE,SAAS8G,IAAI,CAACyB,EAAE,EAAEhK,GAAG,EAAE;EAC1C,MAAA,IAAMlC,MAAM,GAAG,EAAEqJ,OAAK,CAAC5J,WAAW,CAACyM,EAAE,CAAC,IAAIA,EAAE,KAAK,IAAI,CAAC,IAAIV,OAAO,CAACxM,IAAI,CACpEiM,QAAQ,EAAEiB,EAAE,EAAE7C,OAAK,CAACjJ,QAAQ,CAAC8B,GAAG,CAAC,GAAGA,GAAG,CAACX,IAAI,EAAE,GAAGW,GAAG,EAAEmI,IAAI,EAAE+B,cAAc,CAC3E,CAAA;QAED,IAAIpM,MAAM,KAAK,IAAI,EAAE;EACnBqM,QAAAA,KAAK,CAACH,EAAE,EAAE7B,IAAI,GAAGA,IAAI,CAACE,MAAM,CAACrI,GAAG,CAAC,GAAG,CAACA,GAAG,CAAC,CAAC,CAAA;EAC5C,OAAA;EACF,KAAC,CAAC,CAAA;MAEFmG,KAAK,CAACiE,GAAG,EAAE,CAAA;EACb,GAAA;EAEA,EAAA,IAAI,CAACjD,OAAK,CAAC/I,QAAQ,CAACoB,GAAG,CAAC,EAAE;EACxB,IAAA,MAAM,IAAIyJ,SAAS,CAAC,wBAAwB,CAAC,CAAA;EAC/C,GAAA;IAEAkB,KAAK,CAAC3K,GAAG,CAAC,CAAA;EAEV,EAAA,OAAOuJ,QAAQ,CAAA;EACjB;;ECpNA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASsB,QAAM,CAACxN,GAAG,EAAE;EACnB,EAAA,IAAMyN,OAAO,GAAG;EACd,IAAA,GAAG,EAAE,KAAK;EACV,IAAA,GAAG,EAAE,KAAK;EACV,IAAA,GAAG,EAAE,KAAK;EACV,IAAA,GAAG,EAAE,KAAK;EACV,IAAA,GAAG,EAAE,KAAK;EACV,IAAA,KAAK,EAAE,GAAG;EACV,IAAA,KAAK,EAAE,MAAA;KACR,CAAA;EACD,EAAA,OAAOC,kBAAkB,CAAC1N,GAAG,CAAC,CAACyC,OAAO,CAAC,kBAAkB,EAAE,SAASoE,QAAQ,CAAC8G,KAAK,EAAE;MAClF,OAAOF,OAAO,CAACE,KAAK,CAAC,CAAA;EACvB,GAAC,CAAC,CAAA;EACJ,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASC,oBAAoB,CAACC,MAAM,EAAE1B,OAAO,EAAE;IAC7C,IAAI,CAAC2B,MAAM,GAAG,EAAE,CAAA;IAEhBD,MAAM,IAAI5B,UAAU,CAAC4B,MAAM,EAAE,IAAI,EAAE1B,OAAO,CAAC,CAAA;EAC7C,CAAA;EAEA,IAAMxM,SAAS,GAAGiO,oBAAoB,CAACjO,SAAS,CAAA;EAEhDA,SAAS,CAAC2C,MAAM,GAAG,SAASA,MAAM,CAACmF,IAAI,EAAE7C,KAAK,EAAE;IAC9C,IAAI,CAACkJ,MAAM,CAACpH,IAAI,CAAC,CAACe,IAAI,EAAE7C,KAAK,CAAC,CAAC,CAAA;EACjC,CAAC,CAAA;EAEDjF,SAAS,CAACF,QAAQ,GAAG,SAASA,QAAQ,CAACsO,OAAO,EAAE;EAC9C,EAAA,IAAMC,OAAO,GAAGD,OAAO,GAAG,UAASnJ,KAAK,EAAE;MACxC,OAAOmJ,OAAO,CAAC9N,IAAI,CAAC,IAAI,EAAE2E,KAAK,EAAE4I,QAAM,CAAC,CAAA;EAC1C,GAAC,GAAGA,QAAM,CAAA;IAEV,OAAO,IAAI,CAACM,MAAM,CAACrC,GAAG,CAAC,SAASC,IAAI,CAACrF,IAAI,EAAE;EACzC,IAAA,OAAO2H,OAAO,CAAC3H,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG2H,OAAO,CAAC3H,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;EAClD,GAAC,EAAE,EAAE,CAAC,CAACuF,IAAI,CAAC,GAAG,CAAC,CAAA;EAClB,CAAC;;EClDD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS4B,MAAM,CAAC5M,GAAG,EAAE;IACnB,OAAO8M,kBAAkB,CAAC9M,GAAG,CAAC,CAC5B6B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CACrBA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CACpBA,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CACrBA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CACpBA,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CACrBA,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;EACzB,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAASwL,QAAQ,CAACC,GAAG,EAAEL,MAAM,EAAE1B,OAAO,EAAE;EACrD;IACA,IAAI,CAAC0B,MAAM,EAAE;EACX,IAAA,OAAOK,GAAG,CAAA;EACZ,GAAA;IAEA,IAAMF,OAAO,GAAG7B,OAAO,IAAIA,OAAO,CAACqB,MAAM,IAAIA,MAAM,CAAA;EAEnD,EAAA,IAAMW,WAAW,GAAGhC,OAAO,IAAIA,OAAO,CAACiC,SAAS,CAAA;EAEhD,EAAA,IAAIC,gBAAgB,CAAA;EAEpB,EAAA,IAAIF,WAAW,EAAE;EACfE,IAAAA,gBAAgB,GAAGF,WAAW,CAACN,MAAM,EAAE1B,OAAO,CAAC,CAAA;EACjD,GAAC,MAAM;MACLkC,gBAAgB,GAAG/D,OAAK,CAAC/H,iBAAiB,CAACsL,MAAM,CAAC,GAChDA,MAAM,CAACpO,QAAQ,EAAE,GACjB,IAAImO,oBAAoB,CAACC,MAAM,EAAE1B,OAAO,CAAC,CAAC1M,QAAQ,CAACuO,OAAO,CAAC,CAAA;EAC/D,GAAA;EAEA,EAAA,IAAIK,gBAAgB,EAAE;EACpB,IAAA,IAAMC,aAAa,GAAGJ,GAAG,CAACvI,OAAO,CAAC,GAAG,CAAC,CAAA;EAEtC,IAAA,IAAI2I,aAAa,KAAK,CAAC,CAAC,EAAE;QACxBJ,GAAG,GAAGA,GAAG,CAAChO,KAAK,CAAC,CAAC,EAAEoO,aAAa,CAAC,CAAA;EACnC,KAAA;EACAJ,IAAAA,GAAG,IAAI,CAACA,GAAG,CAACvI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI0I,gBAAgB,CAAA;EACjE,GAAA;EAEA,EAAA,OAAOH,GAAG,CAAA;EACZ;;EC5DkC,IAE5BK,kBAAkB,gBAAA,YAAA;IACtB,SAAc,kBAAA,GAAA;EAAA,IAAA,eAAA,CAAA,IAAA,EAAA,kBAAA,CAAA,CAAA;MACZ,IAAI,CAACC,QAAQ,GAAG,EAAE,CAAA;EACpB,GAAA;;EAEA;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EAPE,EAAA,YAAA,CAAA,kBAAA,EAAA,CAAA;EAAA,IAAA,GAAA,EAAA,KAAA;EAAA,IAAA,KAAA,EAQA,aAAIC,SAAS,EAAEC,QAAQ,EAAEvC,OAAO,EAAE;EAChC,MAAA,IAAI,CAACqC,QAAQ,CAAC9H,IAAI,CAAC;EACjB+H,QAAAA,SAAS,EAATA,SAAS;EACTC,QAAAA,QAAQ,EAARA,QAAQ;EACRC,QAAAA,WAAW,EAAExC,OAAO,GAAGA,OAAO,CAACwC,WAAW,GAAG,KAAK;EAClDC,QAAAA,OAAO,EAAEzC,OAAO,GAAGA,OAAO,CAACyC,OAAO,GAAG,IAAA;EACvC,OAAC,CAAC,CAAA;EACF,MAAA,OAAO,IAAI,CAACJ,QAAQ,CAACzL,MAAM,GAAG,CAAC,CAAA;EACjC,KAAA;;EAEA;EACF;EACA;EACA;EACA;EACA;EACA;EANE,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,OAAA;MAAA,KAOA,EAAA,SAAA,KAAA,CAAM8L,EAAE,EAAE;EACR,MAAA,IAAI,IAAI,CAACL,QAAQ,CAACK,EAAE,CAAC,EAAE;EACrB,QAAA,IAAI,CAACL,QAAQ,CAACK,EAAE,CAAC,GAAG,IAAI,CAAA;EAC1B,OAAA;EACF,KAAA;;EAEA;EACF;EACA;EACA;EACA;EAJE,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,OAAA;EAAA,IAAA,KAAA,EAKA,SAAQ,KAAA,GAAA;QACN,IAAI,IAAI,CAACL,QAAQ,EAAE;UACjB,IAAI,CAACA,QAAQ,GAAG,EAAE,CAAA;EACpB,OAAA;EACF,KAAA;;EAEA;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EATE,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,SAAA;MAAA,KAUA,EAAA,SAAA,OAAA,CAAQpP,EAAE,EAAE;QACVkL,OAAK,CAAC5H,OAAO,CAAC,IAAI,CAAC8L,QAAQ,EAAE,SAASM,cAAc,CAACC,CAAC,EAAE;UACtD,IAAIA,CAAC,KAAK,IAAI,EAAE;YACd3P,EAAE,CAAC2P,CAAC,CAAC,CAAA;EACP,SAAA;EACF,OAAC,CAAC,CAAA;EACJ,KAAA;EAAC,GAAA,CAAA,CAAA,CAAA;EAAA,EAAA,OAAA,kBAAA,CAAA;EAAA,CAAA,EAAA,CAAA;AAGH,6BAAeR,kBAAkB;;ACpEjC,6BAAe;EACbS,EAAAA,iBAAiB,EAAE,IAAI;EACvBC,EAAAA,iBAAiB,EAAE,IAAI;EACvBC,EAAAA,mBAAmB,EAAE,KAAA;EACvB,CAAC;;ACHD,0BAAe,OAAOC,eAAe,KAAK,WAAW,GAAGA,eAAe,GAAGvB,oBAAoB;;ACD9F,mBAAe,OAAOvL,QAAQ,KAAK,WAAW,GAAGA,QAAQ,GAAG,IAAI;;ACAhE,eAAe,OAAOuK,IAAI,KAAK,WAAW,GAAGA,IAAI,GAAG,IAAI;;ACExD,mBAAe;EACbwC,EAAAA,SAAS,EAAE,IAAI;EACfC,EAAAA,OAAO,EAAE;EACPF,IAAAA,eAAe,EAAfA,iBAAe;EACf9M,IAAAA,QAAQ,EAARA,UAAQ;EACRuK,IAAAA,IAAI,EAAJA,MAAAA;KACD;EACD0C,EAAAA,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAA;EAC5D,CAAC;;ECZD,IAAMC,aAAa,GAAG,OAAO9L,MAAM,KAAK,WAAW,IAAI,OAAO+L,QAAQ,KAAK,WAAW,CAAA;;EAEtF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAMC,qBAAqB,GACzB,UAACC,OAAO,EAAK;EACX,EAAA,OAAOH,aAAa,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC5J,OAAO,CAAC+J,OAAO,CAAC,GAAG,CAAC,CAAA;EACpF,CAAC,CAAE,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACD,OAAO,CAAC,CAAA;;EAE3D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAME,8BAA8B,GAAI,YAAM;IAC5C,OACE,OAAOC,iBAAiB,KAAK,WAAW;EACxC;IACArM,IAAI,YAAYqM,iBAAiB,IACjC,OAAOrM,IAAI,CAACsM,aAAa,KAAK,UAAU,CAAA;EAE5C,CAAC,EAAG;;;;;;;;;ACrCJ,iBACKxF,cAAAA,CAAAA,cAAAA,CAAAA,EAAAA,EAAAA,KAAK,GACLyF,UAAQ,CAAA;;ECCE,SAASC,gBAAgB,CAACC,IAAI,EAAE9D,OAAO,EAAE;EACtD,EAAA,OAAOF,UAAU,CAACgE,IAAI,EAAE,IAAIF,QAAQ,CAACV,OAAO,CAACF,eAAe,EAAE,EAAEzP,MAAM,CAACmF,MAAM,CAAC;MAC5E4H,OAAO,EAAE,iBAAS7H,KAAK,EAAEzB,GAAG,EAAEmI,IAAI,EAAE4E,OAAO,EAAE;QAC3C,IAAIH,QAAQ,CAACI,MAAM,IAAI7F,OAAK,CAAC3J,QAAQ,CAACiE,KAAK,CAAC,EAAE;UAC5C,IAAI,CAACtC,MAAM,CAACa,GAAG,EAAEyB,KAAK,CAACnF,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAA;EAC1C,QAAA,OAAO,KAAK,CAAA;EACd,OAAA;QAEA,OAAOyQ,OAAO,CAACxD,cAAc,CAACnN,KAAK,CAAC,IAAI,EAAEC,SAAS,CAAC,CAAA;EACtD,KAAA;KACD,EAAE2M,OAAO,CAAC,CAAC,CAAA;EACd;;ECbA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASiE,aAAa,CAAC3I,IAAI,EAAE;EAC3B;EACA;EACA;EACA;EACA,EAAA,OAAO6C,OAAK,CAAChE,QAAQ,CAAC,eAAe,EAAEmB,IAAI,CAAC,CAACgE,GAAG,CAAC,UAAAkC,KAAK,EAAI;EACxD,IAAA,OAAOA,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAGA,KAAK,CAAC,CAAC,CAAC,IAAIA,KAAK,CAAC,CAAC,CAAC,CAAA;EACtD,GAAC,CAAC,CAAA;EACJ,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS0C,aAAa,CAACxK,GAAG,EAAE;IAC1B,IAAMlD,GAAG,GAAG,EAAE,CAAA;EACd,EAAA,IAAMK,IAAI,GAAGtD,MAAM,CAACsD,IAAI,CAAC6C,GAAG,CAAC,CAAA;EAC7B,EAAA,IAAIhD,CAAC,CAAA;EACL,EAAA,IAAMK,GAAG,GAAGF,IAAI,CAACD,MAAM,CAAA;EACvB,EAAA,IAAII,GAAG,CAAA;IACP,KAAKN,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGK,GAAG,EAAEL,CAAC,EAAE,EAAE;EACxBM,IAAAA,GAAG,GAAGH,IAAI,CAACH,CAAC,CAAC,CAAA;EACbF,IAAAA,GAAG,CAACQ,GAAG,CAAC,GAAG0C,GAAG,CAAC1C,GAAG,CAAC,CAAA;EACrB,GAAA;EACA,EAAA,OAAOR,GAAG,CAAA;EACZ,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS2N,cAAc,CAACpE,QAAQ,EAAE;IAChC,SAASqE,SAAS,CAACjF,IAAI,EAAE1G,KAAK,EAAE6E,MAAM,EAAE2D,KAAK,EAAE;EAC7C,IAAA,IAAI3F,IAAI,GAAG6D,IAAI,CAAC8B,KAAK,EAAE,CAAC,CAAA;EAExB,IAAA,IAAI3F,IAAI,KAAK,WAAW,EAAE,OAAO,IAAI,CAAA;MAErC,IAAM+I,YAAY,GAAG/H,MAAM,CAACC,QAAQ,CAAC,CAACjB,IAAI,CAAC,CAAA;EAC3C,IAAA,IAAMgJ,MAAM,GAAGrD,KAAK,IAAI9B,IAAI,CAACvI,MAAM,CAAA;EACnC0E,IAAAA,IAAI,GAAG,CAACA,IAAI,IAAI6C,OAAK,CAAC9J,OAAO,CAACiJ,MAAM,CAAC,GAAGA,MAAM,CAAC1G,MAAM,GAAG0E,IAAI,CAAA;EAE5D,IAAA,IAAIgJ,MAAM,EAAE;QACV,IAAInG,OAAK,CAACR,UAAU,CAACL,MAAM,EAAEhC,IAAI,CAAC,EAAE;UAClCgC,MAAM,CAAChC,IAAI,CAAC,GAAG,CAACgC,MAAM,CAAChC,IAAI,CAAC,EAAE7C,KAAK,CAAC,CAAA;EACtC,OAAC,MAAM;EACL6E,QAAAA,MAAM,CAAChC,IAAI,CAAC,GAAG7C,KAAK,CAAA;EACtB,OAAA;EAEA,MAAA,OAAO,CAAC4L,YAAY,CAAA;EACtB,KAAA;EAEA,IAAA,IAAI,CAAC/G,MAAM,CAAChC,IAAI,CAAC,IAAI,CAAC6C,OAAK,CAAC/I,QAAQ,CAACkI,MAAM,CAAChC,IAAI,CAAC,CAAC,EAAE;EAClDgC,MAAAA,MAAM,CAAChC,IAAI,CAAC,GAAG,EAAE,CAAA;EACnB,KAAA;EAEA,IAAA,IAAMxG,MAAM,GAAGsP,SAAS,CAACjF,IAAI,EAAE1G,KAAK,EAAE6E,MAAM,CAAChC,IAAI,CAAC,EAAE2F,KAAK,CAAC,CAAA;MAE1D,IAAInM,MAAM,IAAIqJ,OAAK,CAAC9J,OAAO,CAACiJ,MAAM,CAAChC,IAAI,CAAC,CAAC,EAAE;QACzCgC,MAAM,CAAChC,IAAI,CAAC,GAAG4I,aAAa,CAAC5G,MAAM,CAAChC,IAAI,CAAC,CAAC,CAAA;EAC5C,KAAA;EAEA,IAAA,OAAO,CAAC+I,YAAY,CAAA;EACtB,GAAA;EAEA,EAAA,IAAIlG,OAAK,CAACnI,UAAU,CAAC+J,QAAQ,CAAC,IAAI5B,OAAK,CAACxJ,UAAU,CAACoL,QAAQ,CAACwE,OAAO,CAAC,EAAE;MACpE,IAAM/N,GAAG,GAAG,EAAE,CAAA;MAEd2H,OAAK,CAACrE,YAAY,CAACiG,QAAQ,EAAE,UAACzE,IAAI,EAAE7C,KAAK,EAAK;QAC5C2L,SAAS,CAACH,aAAa,CAAC3I,IAAI,CAAC,EAAE7C,KAAK,EAAEjC,GAAG,EAAE,CAAC,CAAC,CAAA;EAC/C,KAAC,CAAC,CAAA;EAEF,IAAA,OAAOA,GAAG,CAAA;EACZ,GAAA;EAEA,EAAA,OAAO,IAAI,CAAA;EACb;;EClFA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASgO,eAAe,CAACC,QAAQ,EAAEC,MAAM,EAAE9C,OAAO,EAAE;EAClD,EAAA,IAAIzD,OAAK,CAACjJ,QAAQ,CAACuP,QAAQ,CAAC,EAAE;MAC5B,IAAI;EACF,MAAA,CAACC,MAAM,IAAI5D,IAAI,CAAC6D,KAAK,EAAEF,QAAQ,CAAC,CAAA;EAChC,MAAA,OAAOtG,OAAK,CAAC9H,IAAI,CAACoO,QAAQ,CAAC,CAAA;OAC5B,CAAC,OAAOG,CAAC,EAAE;EACV,MAAA,IAAIA,CAAC,CAACtJ,IAAI,KAAK,aAAa,EAAE;EAC5B,QAAA,MAAMsJ,CAAC,CAAA;EACT,OAAA;EACF,KAAA;EACF,GAAA;IAEA,OAAO,CAAChD,OAAO,IAAId,IAAI,CAACC,SAAS,EAAE0D,QAAQ,CAAC,CAAA;EAC9C,CAAA;EAEA,IAAMI,QAAQ,GAAG;EAEfC,EAAAA,YAAY,EAAEC,oBAAoB;EAElCC,EAAAA,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;IAExBC,gBAAgB,EAAE,CAAC,SAASA,gBAAgB,CAACnB,IAAI,EAAEoB,OAAO,EAAE;EAC1D,IAAA,IAAMC,WAAW,GAAGD,OAAO,CAACE,cAAc,EAAE,IAAI,EAAE,CAAA;MAClD,IAAMC,kBAAkB,GAAGF,WAAW,CAAC3L,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAA;EACvE,IAAA,IAAM8L,eAAe,GAAGnH,OAAK,CAAC/I,QAAQ,CAAC0O,IAAI,CAAC,CAAA;MAE5C,IAAIwB,eAAe,IAAInH,OAAK,CAAC3D,UAAU,CAACsJ,IAAI,CAAC,EAAE;EAC7CA,MAAAA,IAAI,GAAG,IAAI5N,QAAQ,CAAC4N,IAAI,CAAC,CAAA;EAC3B,KAAA;EAEA,IAAA,IAAM9N,UAAU,GAAGmI,OAAK,CAACnI,UAAU,CAAC8N,IAAI,CAAC,CAAA;EAEzC,IAAA,IAAI9N,UAAU,EAAE;EACd,MAAA,OAAOqP,kBAAkB,GAAGvE,IAAI,CAACC,SAAS,CAACoD,cAAc,CAACL,IAAI,CAAC,CAAC,GAAGA,IAAI,CAAA;EACzE,KAAA;EAEA,IAAA,IAAI3F,OAAK,CAACvJ,aAAa,CAACkP,IAAI,CAAC,IAC3B3F,OAAK,CAAC3J,QAAQ,CAACsP,IAAI,CAAC,IACpB3F,OAAK,CAACrI,QAAQ,CAACgO,IAAI,CAAC,IACpB3F,OAAK,CAACxI,MAAM,CAACmO,IAAI,CAAC,IAClB3F,OAAK,CAACvI,MAAM,CAACkO,IAAI,CAAC,EAClB;EACA,MAAA,OAAOA,IAAI,CAAA;EACb,KAAA;EACA,IAAA,IAAI3F,OAAK,CAACtJ,iBAAiB,CAACiP,IAAI,CAAC,EAAE;QACjC,OAAOA,IAAI,CAAC7O,MAAM,CAAA;EACpB,KAAA;EACA,IAAA,IAAIkJ,OAAK,CAAC/H,iBAAiB,CAAC0N,IAAI,CAAC,EAAE;EACjCoB,MAAAA,OAAO,CAACK,cAAc,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAA;QAChF,OAAOzB,IAAI,CAACxQ,QAAQ,EAAE,CAAA;EACxB,KAAA;EAEA,IAAA,IAAIuC,UAAU,CAAA;EAEd,IAAA,IAAIyP,eAAe,EAAE;QACnB,IAAIH,WAAW,CAAC3L,OAAO,CAAC,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE;UACjE,OAAOqK,gBAAgB,CAACC,IAAI,EAAE,IAAI,CAAC0B,cAAc,CAAC,CAAClS,QAAQ,EAAE,CAAA;EAC/D,OAAA;EAEA,MAAA,IAAI,CAACuC,UAAU,GAAGsI,OAAK,CAACtI,UAAU,CAACiO,IAAI,CAAC,KAAKqB,WAAW,CAAC3L,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAAE;UAC5F,IAAMiM,SAAS,GAAG,IAAI,CAACC,GAAG,IAAI,IAAI,CAACA,GAAG,CAACxP,QAAQ,CAAA;UAE/C,OAAO4J,UAAU,CACfjK,UAAU,GAAG;EAAC,UAAA,SAAS,EAAEiO,IAAAA;EAAI,SAAC,GAAGA,IAAI,EACrC2B,SAAS,IAAI,IAAIA,SAAS,EAAE,EAC5B,IAAI,CAACD,cAAc,CACpB,CAAA;EACH,OAAA;EACF,KAAA;MAEA,IAAIF,eAAe,IAAID,kBAAkB,EAAG;EAC1CH,MAAAA,OAAO,CAACK,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAA;QACjD,OAAOf,eAAe,CAACV,IAAI,CAAC,CAAA;EAC9B,KAAA;EAEA,IAAA,OAAOA,IAAI,CAAA;EACb,GAAC,CAAC;EAEF6B,EAAAA,iBAAiB,EAAE,CAAC,SAASA,iBAAiB,CAAC7B,IAAI,EAAE;MACnD,IAAMgB,YAAY,GAAG,IAAI,CAACA,YAAY,IAAID,QAAQ,CAACC,YAAY,CAAA;EAC/D,IAAA,IAAMhC,iBAAiB,GAAGgC,YAAY,IAAIA,YAAY,CAAChC,iBAAiB,CAAA;EACxE,IAAA,IAAM8C,aAAa,GAAG,IAAI,CAACC,YAAY,KAAK,MAAM,CAAA;EAElD,IAAA,IAAI/B,IAAI,IAAI3F,OAAK,CAACjJ,QAAQ,CAAC4O,IAAI,CAAC,KAAMhB,iBAAiB,IAAI,CAAC,IAAI,CAAC+C,YAAY,IAAKD,aAAa,CAAC,EAAE;EAChG,MAAA,IAAM/C,iBAAiB,GAAGiC,YAAY,IAAIA,YAAY,CAACjC,iBAAiB,CAAA;EACxE,MAAA,IAAMiD,iBAAiB,GAAG,CAACjD,iBAAiB,IAAI+C,aAAa,CAAA;QAE7D,IAAI;EACF,QAAA,OAAO9E,IAAI,CAAC6D,KAAK,CAACb,IAAI,CAAC,CAAA;SACxB,CAAC,OAAOc,CAAC,EAAE;EACV,QAAA,IAAIkB,iBAAiB,EAAE;EACrB,UAAA,IAAIlB,CAAC,CAACtJ,IAAI,KAAK,aAAa,EAAE;EAC5B,YAAA,MAAMsC,UAAU,CAACe,IAAI,CAACiG,CAAC,EAAEhH,UAAU,CAACmI,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC9H,QAAQ,CAAC,CAAA;EAClF,WAAA;EACA,UAAA,MAAM2G,CAAC,CAAA;EACT,SAAA;EACF,OAAA;EACF,KAAA;EAEA,IAAA,OAAOd,IAAI,CAAA;EACb,GAAC,CAAC;EAEF;EACF;EACA;EACA;EACEkC,EAAAA,OAAO,EAAE,CAAC;EAEVC,EAAAA,cAAc,EAAE,YAAY;EAC5BC,EAAAA,cAAc,EAAE,cAAc;IAE9BC,gBAAgB,EAAE,CAAC,CAAC;IACpBC,aAAa,EAAE,CAAC,CAAC;EAEjBV,EAAAA,GAAG,EAAE;EACHxP,IAAAA,QAAQ,EAAE0N,QAAQ,CAACV,OAAO,CAAChN,QAAQ;EACnCuK,IAAAA,IAAI,EAAEmD,QAAQ,CAACV,OAAO,CAACzC,IAAAA;KACxB;EAED4F,EAAAA,cAAc,EAAE,SAASA,cAAc,CAAC3H,MAAM,EAAE;EAC9C,IAAA,OAAOA,MAAM,IAAI,GAAG,IAAIA,MAAM,GAAG,GAAG,CAAA;KACrC;EAEDwG,EAAAA,OAAO,EAAE;EACPoB,IAAAA,MAAM,EAAE;EACN,MAAA,QAAQ,EAAE,mCAAmC;EAC7C,MAAA,cAAc,EAAEhN,SAAAA;EAClB,KAAA;EACF,GAAA;EACF,CAAC,CAAA;AAED6E,SAAK,CAAC5H,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,UAACgQ,MAAM,EAAK;EAC3E1B,EAAAA,QAAQ,CAACK,OAAO,CAACqB,MAAM,CAAC,GAAG,EAAE,CAAA;EAC/B,CAAC,CAAC,CAAA;AAEF,mBAAe1B,QAAQ;;ECvJvB;EACA;EACA,IAAM2B,iBAAiB,GAAGrI,OAAK,CAACrC,WAAW,CAAC,CAC1C,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAChE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,qBAAqB,EACrE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB,EAClE,SAAS,EAAE,aAAa,EAAE,YAAY,CACvC,CAAC,CAAA;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACA,qBAAe,CAAA,UAAA2K,UAAU,EAAI;IAC3B,IAAMC,MAAM,GAAG,EAAE,CAAA;EACjB,EAAA,IAAI1P,GAAG,CAAA;EACP,EAAA,IAAIvC,GAAG,CAAA;EACP,EAAA,IAAIiC,CAAC,CAAA;EAEL+P,EAAAA,UAAU,IAAIA,UAAU,CAACvK,KAAK,CAAC,IAAI,CAAC,CAAC3F,OAAO,CAAC,SAASmO,MAAM,CAACiC,IAAI,EAAE;EACjEjQ,IAAAA,CAAC,GAAGiQ,IAAI,CAACnN,OAAO,CAAC,GAAG,CAAC,CAAA;EACrBxC,IAAAA,GAAG,GAAG2P,IAAI,CAACC,SAAS,CAAC,CAAC,EAAElQ,CAAC,CAAC,CAACL,IAAI,EAAE,CAACrC,WAAW,EAAE,CAAA;MAC/CS,GAAG,GAAGkS,IAAI,CAACC,SAAS,CAAClQ,CAAC,GAAG,CAAC,CAAC,CAACL,IAAI,EAAE,CAAA;EAElC,IAAA,IAAI,CAACW,GAAG,IAAK0P,MAAM,CAAC1P,GAAG,CAAC,IAAIwP,iBAAiB,CAACxP,GAAG,CAAE,EAAE;EACnD,MAAA,OAAA;EACF,KAAA;MAEA,IAAIA,GAAG,KAAK,YAAY,EAAE;EACxB,MAAA,IAAI0P,MAAM,CAAC1P,GAAG,CAAC,EAAE;EACf0P,QAAAA,MAAM,CAAC1P,GAAG,CAAC,CAACuD,IAAI,CAAC9F,GAAG,CAAC,CAAA;EACvB,OAAC,MAAM;EACLiS,QAAAA,MAAM,CAAC1P,GAAG,CAAC,GAAG,CAACvC,GAAG,CAAC,CAAA;EACrB,OAAA;EACF,KAAC,MAAM;EACLiS,MAAAA,MAAM,CAAC1P,GAAG,CAAC,GAAG0P,MAAM,CAAC1P,GAAG,CAAC,GAAG0P,MAAM,CAAC1P,GAAG,CAAC,GAAG,IAAI,GAAGvC,GAAG,GAAGA,GAAG,CAAA;EAC5D,KAAA;EACF,GAAC,CAAC,CAAA;EAEF,EAAA,OAAOiS,MAAM,CAAA;EACf,CAAC;;ECjDD,IAAMG,UAAU,GAAGtR,MAAM,CAAC,WAAW,CAAC,CAAA;EAEtC,SAASuR,eAAe,CAACC,MAAM,EAAE;IAC/B,OAAOA,MAAM,IAAI1N,MAAM,CAAC0N,MAAM,CAAC,CAAC1Q,IAAI,EAAE,CAACrC,WAAW,EAAE,CAAA;EACtD,CAAA;EAEA,SAASgT,cAAc,CAACvO,KAAK,EAAE;EAC7B,EAAA,IAAIA,KAAK,KAAK,KAAK,IAAIA,KAAK,IAAI,IAAI,EAAE;EACpC,IAAA,OAAOA,KAAK,CAAA;EACd,GAAA;EAEA,EAAA,OAAO0F,OAAK,CAAC9J,OAAO,CAACoE,KAAK,CAAC,GAAGA,KAAK,CAAC6G,GAAG,CAAC0H,cAAc,CAAC,GAAG3N,MAAM,CAACZ,KAAK,CAAC,CAAA;EACzE,CAAA;EAEA,SAASwO,WAAW,CAACpT,GAAG,EAAE;EACxB,EAAA,IAAMqT,MAAM,GAAG3T,MAAM,CAACU,MAAM,CAAC,IAAI,CAAC,CAAA;IAClC,IAAMkT,QAAQ,GAAG,kCAAkC,CAAA;EACnD,EAAA,IAAI3F,KAAK,CAAA;IAET,OAAQA,KAAK,GAAG2F,QAAQ,CAAC7M,IAAI,CAACzG,GAAG,CAAC,EAAG;MACnCqT,MAAM,CAAC1F,KAAK,CAAC,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,CAAA;EAC7B,GAAA;EAEA,EAAA,OAAO0F,MAAM,CAAA;EACf,CAAA;EAEA,IAAME,iBAAiB,GAAG,SAApBA,iBAAiB,CAAIvT,GAAG,EAAA;IAAA,OAAK,gCAAgC,CAACgM,IAAI,CAAChM,GAAG,CAACwC,IAAI,EAAE,CAAC,CAAA;EAAA,CAAA,CAAA;EAEpF,SAASgR,gBAAgB,CAAC5P,OAAO,EAAEgB,KAAK,EAAEsO,MAAM,EAAEjO,MAAM,EAAEwO,kBAAkB,EAAE;EAC5E,EAAA,IAAInJ,OAAK,CAACxJ,UAAU,CAACmE,MAAM,CAAC,EAAE;MAC5B,OAAOA,MAAM,CAAChF,IAAI,CAAC,IAAI,EAAE2E,KAAK,EAAEsO,MAAM,CAAC,CAAA;EACzC,GAAA;EAEA,EAAA,IAAIO,kBAAkB,EAAE;EACtB7O,IAAAA,KAAK,GAAGsO,MAAM,CAAA;EAChB,GAAA;EAEA,EAAA,IAAI,CAAC5I,OAAK,CAACjJ,QAAQ,CAACuD,KAAK,CAAC,EAAE,OAAA;EAE5B,EAAA,IAAI0F,OAAK,CAACjJ,QAAQ,CAAC4D,MAAM,CAAC,EAAE;MAC1B,OAAOL,KAAK,CAACe,OAAO,CAACV,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;EACrC,GAAA;EAEA,EAAA,IAAIqF,OAAK,CAACnD,QAAQ,CAAClC,MAAM,CAAC,EAAE;EAC1B,IAAA,OAAOA,MAAM,CAAC+G,IAAI,CAACpH,KAAK,CAAC,CAAA;EAC3B,GAAA;EACF,CAAA;EAEA,SAAS8O,YAAY,CAACR,MAAM,EAAE;EAC5B,EAAA,OAAOA,MAAM,CAAC1Q,IAAI,EAAE,CACjBrC,WAAW,EAAE,CAACsC,OAAO,CAAC,iBAAiB,EAAE,UAACkR,CAAC,EAAEC,KAAI,EAAE5T,GAAG,EAAK;EAC1D,IAAA,OAAO4T,KAAI,CAAC3M,WAAW,EAAE,GAAGjH,GAAG,CAAA;EACjC,GAAC,CAAC,CAAA;EACN,CAAA;EAEA,SAAS6T,cAAc,CAAClR,GAAG,EAAEuQ,MAAM,EAAE;IACnC,IAAMY,YAAY,GAAGxJ,OAAK,CAAC1D,WAAW,CAAC,GAAG,GAAGsM,MAAM,CAAC,CAAA;IAEpD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAACxQ,OAAO,CAAC,UAAAqR,UAAU,EAAI;MAC1CrU,MAAM,CAACiF,cAAc,CAAChC,GAAG,EAAEoR,UAAU,GAAGD,YAAY,EAAE;EACpDlP,MAAAA,KAAK,EAAE,SAASoP,KAAAA,CAAAA,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAE;EAChC,QAAA,OAAO,IAAI,CAACH,UAAU,CAAC,CAAC9T,IAAI,CAAC,IAAI,EAAEiT,MAAM,EAAEc,IAAI,EAAEC,IAAI,EAAEC,IAAI,CAAC,CAAA;SAC7D;EACDC,MAAAA,YAAY,EAAE,IAAA;EAChB,KAAC,CAAC,CAAA;EACJ,GAAC,CAAC,CAAA;EACJ,CAAA;EAAC,IAEKC,YAAY,gBAAA,UAAA,gBAAA,EAAA,mBAAA,EAAA;EAChB,EAAA,SAAA,YAAA,CAAY/C,OAAO,EAAE;EAAA,IAAA,eAAA,CAAA,IAAA,EAAA,YAAA,CAAA,CAAA;EACnBA,IAAAA,OAAO,IAAI,IAAI,CAACtJ,GAAG,CAACsJ,OAAO,CAAC,CAAA;EAC9B,GAAA;EAAC,EAAA,YAAA,CAAA,YAAA,EAAA,CAAA;EAAA,IAAA,GAAA,EAAA,KAAA;EAAA,IAAA,KAAA,EAED,aAAI6B,MAAM,EAAEmB,cAAc,EAAEC,OAAO,EAAE;QACnC,IAAM9Q,IAAI,GAAG,IAAI,CAAA;EAEjB,MAAA,SAAS+Q,SAAS,CAACC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE;EAC5C,QAAA,IAAMC,OAAO,GAAG1B,eAAe,CAACwB,OAAO,CAAC,CAAA;UAExC,IAAI,CAACE,OAAO,EAAE;EACZ,UAAA,MAAM,IAAI3M,KAAK,CAAC,wCAAwC,CAAC,CAAA;EAC3D,SAAA;UAEA,IAAM7E,GAAG,GAAGmH,OAAK,CAAClH,OAAO,CAACI,IAAI,EAAEmR,OAAO,CAAC,CAAA;UAExC,IAAG,CAACxR,GAAG,IAAIK,IAAI,CAACL,GAAG,CAAC,KAAKsC,SAAS,IAAIiP,QAAQ,KAAK,IAAI,IAAKA,QAAQ,KAAKjP,SAAS,IAAIjC,IAAI,CAACL,GAAG,CAAC,KAAK,KAAM,EAAE;YAC1GK,IAAI,CAACL,GAAG,IAAIsR,OAAO,CAAC,GAAGtB,cAAc,CAACqB,MAAM,CAAC,CAAA;EAC/C,SAAA;EACF,OAAA;EAEA,MAAA,IAAMI,UAAU,GAAG,SAAbA,UAAU,CAAIvD,OAAO,EAAEqD,QAAQ,EAAA;UAAA,OACnCpK,OAAK,CAAC5H,OAAO,CAAC2O,OAAO,EAAE,UAACmD,MAAM,EAAEC,OAAO,EAAA;EAAA,UAAA,OAAKF,SAAS,CAACC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAC,CAAA;WAAC,CAAA,CAAA;EAAA,OAAA,CAAA;EAEnF,MAAA,IAAIpK,OAAK,CAAC7I,aAAa,CAACyR,MAAM,CAAC,IAAIA,MAAM,YAAY,IAAI,CAACrS,WAAW,EAAE;EACrE+T,QAAAA,UAAU,CAAC1B,MAAM,EAAEmB,cAAc,CAAC,CAAA;SACnC,MAAM,IAAG/J,OAAK,CAACjJ,QAAQ,CAAC6R,MAAM,CAAC,KAAKA,MAAM,GAAGA,MAAM,CAAC1Q,IAAI,EAAE,CAAC,IAAI,CAAC+Q,iBAAiB,CAACL,MAAM,CAAC,EAAE;EAC1F0B,QAAAA,UAAU,CAACC,YAAY,CAAC3B,MAAM,CAAC,EAAEmB,cAAc,CAAC,CAAA;EAClD,OAAC,MAAM;UACLnB,MAAM,IAAI,IAAI,IAAIqB,SAAS,CAACF,cAAc,EAAEnB,MAAM,EAAEoB,OAAO,CAAC,CAAA;EAC9D,OAAA;EAEA,MAAA,OAAO,IAAI,CAAA;EACb,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,KAAA;EAAA,IAAA,KAAA,EAED,SAAIpB,GAAAA,CAAAA,MAAM,EAAErC,MAAM,EAAE;EAClBqC,MAAAA,MAAM,GAAGD,eAAe,CAACC,MAAM,CAAC,CAAA;EAEhC,MAAA,IAAIA,MAAM,EAAE;UACV,IAAM/P,GAAG,GAAGmH,OAAK,CAAClH,OAAO,CAAC,IAAI,EAAE8P,MAAM,CAAC,CAAA;EAEvC,QAAA,IAAI/P,GAAG,EAAE;EACP,UAAA,IAAMyB,KAAK,GAAG,IAAI,CAACzB,GAAG,CAAC,CAAA;YAEvB,IAAI,CAAC0N,MAAM,EAAE;EACX,YAAA,OAAOjM,KAAK,CAAA;EACd,WAAA;YAEA,IAAIiM,MAAM,KAAK,IAAI,EAAE;cACnB,OAAOuC,WAAW,CAACxO,KAAK,CAAC,CAAA;EAC3B,WAAA;EAEA,UAAA,IAAI0F,OAAK,CAACxJ,UAAU,CAAC+P,MAAM,CAAC,EAAE;cAC5B,OAAOA,MAAM,CAAC5Q,IAAI,CAAC,IAAI,EAAE2E,KAAK,EAAEzB,GAAG,CAAC,CAAA;EACtC,WAAA;EAEA,UAAA,IAAImH,OAAK,CAACnD,QAAQ,CAAC0J,MAAM,CAAC,EAAE;EAC1B,YAAA,OAAOA,MAAM,CAACpK,IAAI,CAAC7B,KAAK,CAAC,CAAA;EAC3B,WAAA;EAEA,UAAA,MAAM,IAAIwH,SAAS,CAAC,wCAAwC,CAAC,CAAA;EAC/D,SAAA;EACF,OAAA;EACF,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,KAAA;EAAA,IAAA,KAAA,EAED,SAAI8G,GAAAA,CAAAA,MAAM,EAAE4B,OAAO,EAAE;EACnB5B,MAAAA,MAAM,GAAGD,eAAe,CAACC,MAAM,CAAC,CAAA;EAEhC,MAAA,IAAIA,MAAM,EAAE;UACV,IAAM/P,GAAG,GAAGmH,OAAK,CAAClH,OAAO,CAAC,IAAI,EAAE8P,MAAM,CAAC,CAAA;EAEvC,QAAA,OAAO,CAAC,EAAE/P,GAAG,IAAI,IAAI,CAACA,GAAG,CAAC,KAAKsC,SAAS,KAAK,CAACqP,OAAO,IAAItB,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAACrQ,GAAG,CAAC,EAAEA,GAAG,EAAE2R,OAAO,CAAC,CAAC,CAAC,CAAA;EAC5G,OAAA;EAEA,MAAA,OAAO,KAAK,CAAA;EACd,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,QAAA;EAAA,IAAA,KAAA,EAED,SAAO5B,OAAAA,CAAAA,MAAM,EAAE4B,OAAO,EAAE;QACtB,IAAMtR,IAAI,GAAG,IAAI,CAAA;QACjB,IAAIuR,OAAO,GAAG,KAAK,CAAA;QAEnB,SAASC,YAAY,CAACP,OAAO,EAAE;EAC7BA,QAAAA,OAAO,GAAGxB,eAAe,CAACwB,OAAO,CAAC,CAAA;EAElC,QAAA,IAAIA,OAAO,EAAE;YACX,IAAMtR,GAAG,GAAGmH,OAAK,CAAClH,OAAO,CAACI,IAAI,EAAEiR,OAAO,CAAC,CAAA;EAExC,UAAA,IAAItR,GAAG,KAAK,CAAC2R,OAAO,IAAItB,gBAAgB,CAAChQ,IAAI,EAAEA,IAAI,CAACL,GAAG,CAAC,EAAEA,GAAG,EAAE2R,OAAO,CAAC,CAAC,EAAE;cACxE,OAAOtR,IAAI,CAACL,GAAG,CAAC,CAAA;EAEhB4R,YAAAA,OAAO,GAAG,IAAI,CAAA;EAChB,WAAA;EACF,SAAA;EACF,OAAA;EAEA,MAAA,IAAIzK,OAAK,CAAC9J,OAAO,CAAC0S,MAAM,CAAC,EAAE;EACzBA,QAAAA,MAAM,CAACxQ,OAAO,CAACsS,YAAY,CAAC,CAAA;EAC9B,OAAC,MAAM;UACLA,YAAY,CAAC9B,MAAM,CAAC,CAAA;EACtB,OAAA;EAEA,MAAA,OAAO6B,OAAO,CAAA;EAChB,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,OAAA;MAAA,KAED,EAAA,SAAA,KAAA,CAAMD,OAAO,EAAE;EACb,MAAA,IAAM9R,IAAI,GAAGtD,MAAM,CAACsD,IAAI,CAAC,IAAI,CAAC,CAAA;EAC9B,MAAA,IAAIH,CAAC,GAAGG,IAAI,CAACD,MAAM,CAAA;QACnB,IAAIgS,OAAO,GAAG,KAAK,CAAA;QAEnB,OAAOlS,CAAC,EAAE,EAAE;EACV,QAAA,IAAMM,GAAG,GAAGH,IAAI,CAACH,CAAC,CAAC,CAAA;EACnB,QAAA,IAAG,CAACiS,OAAO,IAAItB,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAACrQ,GAAG,CAAC,EAAEA,GAAG,EAAE2R,OAAO,EAAE,IAAI,CAAC,EAAE;YACpE,OAAO,IAAI,CAAC3R,GAAG,CAAC,CAAA;EAChB4R,UAAAA,OAAO,GAAG,IAAI,CAAA;EAChB,SAAA;EACF,OAAA;EAEA,MAAA,OAAOA,OAAO,CAAA;EAChB,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,WAAA;MAAA,KAED,EAAA,SAAA,SAAA,CAAUE,MAAM,EAAE;QAChB,IAAMzR,IAAI,GAAG,IAAI,CAAA;QACjB,IAAM6N,OAAO,GAAG,EAAE,CAAA;QAElB/G,OAAK,CAAC5H,OAAO,CAAC,IAAI,EAAE,UAACkC,KAAK,EAAEsO,MAAM,EAAK;UACrC,IAAM/P,GAAG,GAAGmH,OAAK,CAAClH,OAAO,CAACiO,OAAO,EAAE6B,MAAM,CAAC,CAAA;EAE1C,QAAA,IAAI/P,GAAG,EAAE;EACPK,UAAAA,IAAI,CAACL,GAAG,CAAC,GAAGgQ,cAAc,CAACvO,KAAK,CAAC,CAAA;YACjC,OAAOpB,IAAI,CAAC0P,MAAM,CAAC,CAAA;EACnB,UAAA,OAAA;EACF,SAAA;EAEA,QAAA,IAAMgC,UAAU,GAAGD,MAAM,GAAGvB,YAAY,CAACR,MAAM,CAAC,GAAG1N,MAAM,CAAC0N,MAAM,CAAC,CAAC1Q,IAAI,EAAE,CAAA;UAExE,IAAI0S,UAAU,KAAKhC,MAAM,EAAE;YACzB,OAAO1P,IAAI,CAAC0P,MAAM,CAAC,CAAA;EACrB,SAAA;EAEA1P,QAAAA,IAAI,CAAC0R,UAAU,CAAC,GAAG/B,cAAc,CAACvO,KAAK,CAAC,CAAA;EAExCyM,QAAAA,OAAO,CAAC6D,UAAU,CAAC,GAAG,IAAI,CAAA;EAC5B,OAAC,CAAC,CAAA;EAEF,MAAA,OAAO,IAAI,CAAA;EACb,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,QAAA;EAAA,IAAA,KAAA,EAED,SAAmB,MAAA,GAAA;EAAA,MAAA,IAAA,iBAAA,CAAA;EAAA,MAAA,KAAA,IAAA,IAAA,GAAA,SAAA,CAAA,MAAA,EAATC,OAAO,GAAA,IAAA,KAAA,CAAA,IAAA,CAAA,EAAA,IAAA,GAAA,CAAA,EAAA,IAAA,GAAA,IAAA,EAAA,IAAA,EAAA,EAAA;UAAPA,OAAO,CAAA,IAAA,CAAA,GAAA,SAAA,CAAA,IAAA,CAAA,CAAA;EAAA,OAAA;QACf,OAAO,CAAA,iBAAA,GAAA,IAAI,CAACtU,WAAW,EAAC2K,MAAM,CAAC,KAAA,CAAA,iBAAA,EAAA,CAAA,IAAI,CAAK2J,CAAAA,MAAAA,CAAAA,OAAO,CAAC,CAAA,CAAA;EAClD,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,QAAA;MAAA,KAED,EAAA,SAAA,MAAA,CAAOC,SAAS,EAAE;EAChB,MAAA,IAAMzS,GAAG,GAAGjD,MAAM,CAACU,MAAM,CAAC,IAAI,CAAC,CAAA;QAE/BkK,OAAK,CAAC5H,OAAO,CAAC,IAAI,EAAE,UAACkC,KAAK,EAAEsO,MAAM,EAAK;EACrCtO,QAAAA,KAAK,IAAI,IAAI,IAAIA,KAAK,KAAK,KAAK,KAAKjC,GAAG,CAACuQ,MAAM,CAAC,GAAGkC,SAAS,IAAI9K,OAAK,CAAC9J,OAAO,CAACoE,KAAK,CAAC,GAAGA,KAAK,CAACgH,IAAI,CAAC,IAAI,CAAC,GAAGhH,KAAK,CAAC,CAAA;EAClH,OAAC,CAAC,CAAA;EAEF,MAAA,OAAOjC,GAAG,CAAA;EACZ,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,gBAAA;EAAA,IAAA,KAAA,EAED,SAAoB,KAAA,GAAA;EAClB,MAAA,OAAOjD,MAAM,CAACgR,OAAO,CAAC,IAAI,CAACnG,MAAM,EAAE,CAAC,CAAC7I,MAAM,CAACE,QAAQ,CAAC,EAAE,CAAA;EACzD,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,UAAA;EAAA,IAAA,KAAA,EAED,SAAW,QAAA,GAAA;QACT,OAAOlC,MAAM,CAACgR,OAAO,CAAC,IAAI,CAACnG,MAAM,EAAE,CAAC,CAACkB,GAAG,CAAC,UAAA,IAAA,EAAA;EAAA,QAAA,IAAA,KAAA,GAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAAA;YAAEyH,MAAM,GAAA,KAAA,CAAA,CAAA,CAAA;YAAEtO,KAAK,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA;EAAA,QAAA,OAAMsO,MAAM,GAAG,IAAI,GAAGtO,KAAK,CAAA;EAAA,OAAA,CAAC,CAACgH,IAAI,CAAC,IAAI,CAAC,CAAA;EACjG,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,mBAAA;EAAA,IAAA,GAAA,EAED,SAA2B,GAAA,GAAA;EACzB,MAAA,OAAO,cAAc,CAAA;EACvB,KAAA;EAAC,GAAA,CAAA,EAAA,CAAA;EAAA,IAAA,GAAA,EAAA,MAAA;MAAA,KAED,EAAA,SAAA,IAAA,CAAY7L,KAAK,EAAE;QACjB,OAAOA,KAAK,YAAY,IAAI,GAAGA,KAAK,GAAG,IAAI,IAAI,CAACA,KAAK,CAAC,CAAA;EACxD,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,QAAA;MAAA,KAED,EAAA,SAAA,MAAA,CAAcsV,KAAK,EAAc;EAC/B,MAAA,IAAMC,QAAQ,GAAG,IAAI,IAAI,CAACD,KAAK,CAAC,CAAA;EAAC,MAAA,KAAA,IAAA,KAAA,GAAA,SAAA,CAAA,MAAA,EADXF,OAAO,GAAA,IAAA,KAAA,CAAA,KAAA,GAAA,CAAA,GAAA,KAAA,GAAA,CAAA,GAAA,CAAA,CAAA,EAAA,KAAA,GAAA,CAAA,EAAA,KAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA;UAAPA,OAAO,CAAA,KAAA,GAAA,CAAA,CAAA,GAAA,SAAA,CAAA,KAAA,CAAA,CAAA;EAAA,OAAA;EAG7BA,MAAAA,OAAO,CAACzS,OAAO,CAAC,UAAC+G,MAAM,EAAA;EAAA,QAAA,OAAK6L,QAAQ,CAACvN,GAAG,CAAC0B,MAAM,CAAC,CAAA;SAAC,CAAA,CAAA;EAEjD,MAAA,OAAO6L,QAAQ,CAAA;EACjB,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,UAAA;MAAA,KAED,EAAA,SAAA,QAAA,CAAgBpC,MAAM,EAAE;QACtB,IAAMqC,SAAS,GAAG,IAAI,CAACvC,UAAU,CAAC,GAAI,IAAI,CAACA,UAAU,CAAC,GAAG;EACvDwC,QAAAA,SAAS,EAAE,EAAC;SACZ,CAAA;EAEF,MAAA,IAAMA,SAAS,GAAGD,SAAS,CAACC,SAAS,CAAA;EACrC,MAAA,IAAM7V,SAAS,GAAG,IAAI,CAACA,SAAS,CAAA;QAEhC,SAAS8V,cAAc,CAAChB,OAAO,EAAE;EAC/B,QAAA,IAAME,OAAO,GAAG1B,eAAe,CAACwB,OAAO,CAAC,CAAA;EAExC,QAAA,IAAI,CAACe,SAAS,CAACb,OAAO,CAAC,EAAE;EACvBd,UAAAA,cAAc,CAAClU,SAAS,EAAE8U,OAAO,CAAC,CAAA;EAClCe,UAAAA,SAAS,CAACb,OAAO,CAAC,GAAG,IAAI,CAAA;EAC3B,SAAA;EACF,OAAA;EAEArK,MAAAA,OAAK,CAAC9J,OAAO,CAAC0S,MAAM,CAAC,GAAGA,MAAM,CAACxQ,OAAO,CAAC+S,cAAc,CAAC,GAAGA,cAAc,CAACvC,MAAM,CAAC,CAAA;EAE/E,MAAA,OAAO,IAAI,CAAA;EACb,KAAA;EAAC,GAAA,CAAA,CAAA,CAAA;EAAA,EAAA,OAAA,YAAA,CAAA;EAAA,CAAA,CA5CAxR,MAAM,CAACE,QAAQ,EAQXF,MAAM,CAACC,WAAW,CAAA,CAAA;EAuCzByS,YAAY,CAACsB,QAAQ,CAAC,CAAC,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAA;;EAErH;AACApL,SAAK,CAAClD,iBAAiB,CAACgN,YAAY,CAACzU,SAAS,EAAE,UAAUwD,KAAAA,EAAAA,GAAG,EAAK;IAAA,IAAhByB,KAAK,SAALA,KAAK,CAAA;EACrD,EAAA,IAAI+Q,MAAM,GAAGxS,GAAG,CAAC,CAAC,CAAC,CAAC8D,WAAW,EAAE,GAAG9D,GAAG,CAACjD,KAAK,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO;EACL0V,IAAAA,GAAG,EAAE,SAAA,GAAA,GAAA;EAAA,MAAA,OAAMhR,KAAK,CAAA;EAAA,KAAA;MAChBmD,GAAG,EAAA,SAAA,GAAA,CAAC8N,WAAW,EAAE;EACf,MAAA,IAAI,CAACF,MAAM,CAAC,GAAGE,WAAW,CAAA;EAC5B,KAAA;KACD,CAAA;EACH,CAAC,CAAC,CAAA;AAEFvL,SAAK,CAAC1C,aAAa,CAACwM,YAAY,CAAC,CAAA;AAEjC,uBAAeA,YAAY;;ECnS3B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAAS0B,aAAa,CAACC,GAAG,EAAE3L,QAAQ,EAAE;EACnD,EAAA,IAAMF,MAAM,GAAG,IAAI,IAAI8G,UAAQ,CAAA;EAC/B,EAAA,IAAMpN,OAAO,GAAGwG,QAAQ,IAAIF,MAAM,CAAA;IAClC,IAAMmH,OAAO,GAAG+C,cAAY,CAACtJ,IAAI,CAAClH,OAAO,CAACyN,OAAO,CAAC,CAAA;EAClD,EAAA,IAAIpB,IAAI,GAAGrM,OAAO,CAACqM,IAAI,CAAA;IAEvB3F,OAAK,CAAC5H,OAAO,CAACqT,GAAG,EAAE,SAASC,SAAS,CAAC5W,EAAE,EAAE;MACxC6Q,IAAI,GAAG7Q,EAAE,CAACa,IAAI,CAACiK,MAAM,EAAE+F,IAAI,EAAEoB,OAAO,CAAC4E,SAAS,EAAE,EAAE7L,QAAQ,GAAGA,QAAQ,CAACS,MAAM,GAAGpF,SAAS,CAAC,CAAA;EAC3F,GAAC,CAAC,CAAA;IAEF4L,OAAO,CAAC4E,SAAS,EAAE,CAAA;EAEnB,EAAA,OAAOhG,IAAI,CAAA;EACb;;ECzBe,SAASiG,QAAQ,CAACtR,KAAK,EAAE;EACtC,EAAA,OAAO,CAAC,EAAEA,KAAK,IAAIA,KAAK,CAACuR,UAAU,CAAC,CAAA;EACtC;;ECCA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASC,aAAa,CAACpM,OAAO,EAAEE,MAAM,EAAEC,OAAO,EAAE;EAC/C;IACAJ,UAAU,CAAC9J,IAAI,CAAC,IAAI,EAAE+J,OAAO,IAAI,IAAI,GAAG,UAAU,GAAGA,OAAO,EAAED,UAAU,CAACsM,YAAY,EAAEnM,MAAM,EAAEC,OAAO,CAAC,CAAA;IACvG,IAAI,CAAC1C,IAAI,GAAG,eAAe,CAAA;EAC7B,CAAA;AAEA6C,SAAK,CAAC/F,QAAQ,CAAC6R,aAAa,EAAErM,UAAU,EAAE;EACxCoM,EAAAA,UAAU,EAAE,IAAA;EACd,CAAC,CAAC;;EClBF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAASG,MAAM,CAACC,OAAO,EAAEC,MAAM,EAAEpM,QAAQ,EAAE;EACxD,EAAA,IAAMoI,cAAc,GAAGpI,QAAQ,CAACF,MAAM,CAACsI,cAAc,CAAA;EACrD,EAAA,IAAI,CAACpI,QAAQ,CAACS,MAAM,IAAI,CAAC2H,cAAc,IAAIA,cAAc,CAACpI,QAAQ,CAACS,MAAM,CAAC,EAAE;MAC1E0L,OAAO,CAACnM,QAAQ,CAAC,CAAA;EACnB,GAAC,MAAM;MACLoM,MAAM,CAAC,IAAIzM,UAAU,CACnB,kCAAkC,GAAGK,QAAQ,CAACS,MAAM,EACpD,CAACd,UAAU,CAAC0M,eAAe,EAAE1M,UAAU,CAACmI,gBAAgB,CAAC,CAAChJ,IAAI,CAACwN,KAAK,CAACtM,QAAQ,CAACS,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAChGT,QAAQ,CAACF,MAAM,EACfE,QAAQ,CAACD,OAAO,EAChBC,QAAQ,CACT,CAAC,CAAA;EACJ,GAAA;EACF;;ACvBA,gBAAe2F,QAAQ,CAACN,qBAAqB;EAE3C;EACA;EACEkH,EAAAA,KAAK,EAAClP,SAAAA,KAAAA,CAAAA,IAAI,EAAE7C,KAAK,EAAEgS,OAAO,EAAEtL,IAAI,EAAEuL,MAAM,EAAEC,MAAM,EAAE;MAChD,IAAMC,MAAM,GAAG,CAACtP,IAAI,GAAG,GAAG,GAAGiG,kBAAkB,CAAC9I,KAAK,CAAC,CAAC,CAAA;MAEvD0F,OAAK,CAAChJ,QAAQ,CAACsV,OAAO,CAAC,IAAIG,MAAM,CAACrQ,IAAI,CAAC,UAAU,GAAG,IAAIsQ,IAAI,CAACJ,OAAO,CAAC,CAACK,WAAW,EAAE,CAAC,CAAA;EAEpF3M,IAAAA,OAAK,CAACjJ,QAAQ,CAACiK,IAAI,CAAC,IAAIyL,MAAM,CAACrQ,IAAI,CAAC,OAAO,GAAG4E,IAAI,CAAC,CAAA;EAEnDhB,IAAAA,OAAK,CAACjJ,QAAQ,CAACwV,MAAM,CAAC,IAAIE,MAAM,CAACrQ,IAAI,CAAC,SAAS,GAAGmQ,MAAM,CAAC,CAAA;MAEzDC,MAAM,KAAK,IAAI,IAAIC,MAAM,CAACrQ,IAAI,CAAC,QAAQ,CAAC,CAAA;MAExC8I,QAAQ,CAACuH,MAAM,GAAGA,MAAM,CAACnL,IAAI,CAAC,IAAI,CAAC,CAAA;KACpC;IAEDsL,IAAI,EAAA,SAAA,IAAA,CAACzP,IAAI,EAAE;EACT,IAAA,IAAMkG,KAAK,GAAG6B,QAAQ,CAACuH,MAAM,CAACpJ,KAAK,CAAC,IAAIwJ,MAAM,CAAC,YAAY,GAAG1P,IAAI,GAAG,WAAW,CAAC,CAAC,CAAA;MAClF,OAAQkG,KAAK,GAAGyJ,kBAAkB,CAACzJ,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;KACpD;IAED0J,MAAM,EAAA,SAAA,MAAA,CAAC5P,IAAI,EAAE;EACX,IAAA,IAAI,CAACkP,KAAK,CAAClP,IAAI,EAAE,EAAE,EAAEuP,IAAI,CAACM,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAA;EAC7C,GAAA;EACF,CAAC;EAID;EACA;IACEX,KAAK,EAAA,SAAA,KAAA,GAAG,EAAE;EACVO,EAAAA,IAAI,EAAG,SAAA,IAAA,GAAA;EACL,IAAA,OAAO,IAAI,CAAA;KACZ;EACDG,EAAAA,MAAM,oBAAG,EAAC;EACZ,CAAC;;ECtCH;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAASE,aAAa,CAACrJ,GAAG,EAAE;EACzC;EACA;EACA;EACA,EAAA,OAAO,6BAA6B,CAAClC,IAAI,CAACkC,GAAG,CAAC,CAAA;EAChD;;ECZA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAASsJ,WAAW,CAACC,OAAO,EAAEC,WAAW,EAAE;IACxD,OAAOA,WAAW,GACdD,OAAO,CAAChV,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,GAAGiV,WAAW,CAACjV,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GACrEgV,OAAO,CAAA;EACb;;ECTA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAASE,aAAa,CAACF,OAAO,EAAEG,YAAY,EAAE;EAC3D,EAAA,IAAIH,OAAO,IAAI,CAACF,aAAa,CAACK,YAAY,CAAC,EAAE;EAC3C,IAAA,OAAOJ,WAAW,CAACC,OAAO,EAAEG,YAAY,CAAC,CAAA;EAC3C,GAAA;EACA,EAAA,OAAOA,YAAY,CAAA;EACrB;;ACfA,wBAAe7H,QAAQ,CAACN,qBAAqB;EAE7C;EACA;EACG,SAASoI,kBAAkB,GAAG;IAC7B,IAAMC,IAAI,GAAG,iBAAiB,CAAC9L,IAAI,CAAC2D,SAAS,CAACoI,SAAS,CAAC,CAAA;EACxD,EAAA,IAAMC,cAAc,GAAGxI,QAAQ,CAACyI,aAAa,CAAC,GAAG,CAAC,CAAA;EAClD,EAAA,IAAIC,SAAS,CAAA;;EAEb;EACJ;EACA;EACA;EACA;EACA;IACI,SAASC,UAAU,CAACjK,GAAG,EAAE;MACvB,IAAIkK,IAAI,GAAGlK,GAAG,CAAA;EAEd,IAAA,IAAI4J,IAAI,EAAE;EACR;EACAE,MAAAA,cAAc,CAACK,YAAY,CAAC,MAAM,EAAED,IAAI,CAAC,CAAA;QACzCA,IAAI,GAAGJ,cAAc,CAACI,IAAI,CAAA;EAC5B,KAAA;EAEAJ,IAAAA,cAAc,CAACK,YAAY,CAAC,MAAM,EAAED,IAAI,CAAC,CAAA;;EAEzC;MACA,OAAO;QACLA,IAAI,EAAEJ,cAAc,CAACI,IAAI;EACzBE,MAAAA,QAAQ,EAAEN,cAAc,CAACM,QAAQ,GAAGN,cAAc,CAACM,QAAQ,CAAC7V,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE;QAClF8V,IAAI,EAAEP,cAAc,CAACO,IAAI;EACzBC,MAAAA,MAAM,EAAER,cAAc,CAACQ,MAAM,GAAGR,cAAc,CAACQ,MAAM,CAAC/V,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE;EAC7EgW,MAAAA,IAAI,EAAET,cAAc,CAACS,IAAI,GAAGT,cAAc,CAACS,IAAI,CAAChW,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE;QACtEiW,QAAQ,EAAEV,cAAc,CAACU,QAAQ;QACjCC,IAAI,EAAEX,cAAc,CAACW,IAAI;EACzBC,MAAAA,QAAQ,EAAGZ,cAAc,CAACY,QAAQ,CAACC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,GAClDb,cAAc,CAACY,QAAQ,GACvB,GAAG,GAAGZ,cAAc,CAACY,QAAAA;OACxB,CAAA;EACH,GAAA;IAEAV,SAAS,GAAGC,UAAU,CAAC1U,MAAM,CAACqV,QAAQ,CAACV,IAAI,CAAC,CAAA;;EAE5C;EACJ;EACA;EACA;EACA;EACA;EACI,EAAA,OAAO,SAASW,eAAe,CAACC,UAAU,EAAE;EAC1C,IAAA,IAAMnG,MAAM,GAAIvI,OAAK,CAACjJ,QAAQ,CAAC2X,UAAU,CAAC,GAAIb,UAAU,CAACa,UAAU,CAAC,GAAGA,UAAU,CAAA;EACjF,IAAA,OAAQnG,MAAM,CAACyF,QAAQ,KAAKJ,SAAS,CAACI,QAAQ,IAC1CzF,MAAM,CAAC0F,IAAI,KAAKL,SAAS,CAACK,IAAI,CAAA;KACnC,CAAA;EACH,CAAC,EAAG;EAEJ;EACC,SAASU,qBAAqB,GAAG;IAChC,OAAO,SAASF,eAAe,GAAG;EAChC,IAAA,OAAO,IAAI,CAAA;KACZ,CAAA;EACH,CAAC,EAAG;;EChES,SAASG,aAAa,CAAChL,GAAG,EAAE;EACzC,EAAA,IAAMP,KAAK,GAAG,2BAA2B,CAAClH,IAAI,CAACyH,GAAG,CAAC,CAAA;EACnD,EAAA,OAAOP,KAAK,IAAIA,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;EAChC;;ECHA;EACA;EACA;EACA;EACA;EACA;EACA,SAASwL,WAAW,CAACC,YAAY,EAAEC,GAAG,EAAE;IACtCD,YAAY,GAAGA,YAAY,IAAI,EAAE,CAAA;EACjC,EAAA,IAAME,KAAK,GAAG,IAAI7Y,KAAK,CAAC2Y,YAAY,CAAC,CAAA;EACrC,EAAA,IAAMG,UAAU,GAAG,IAAI9Y,KAAK,CAAC2Y,YAAY,CAAC,CAAA;IAC1C,IAAII,IAAI,GAAG,CAAC,CAAA;IACZ,IAAIC,IAAI,GAAG,CAAC,CAAA;EACZ,EAAA,IAAIC,aAAa,CAAA;EAEjBL,EAAAA,GAAG,GAAGA,GAAG,KAAK5T,SAAS,GAAG4T,GAAG,GAAG,IAAI,CAAA;EAEpC,EAAA,OAAO,SAAS3S,IAAI,CAACiT,WAAW,EAAE;EAChC,IAAA,IAAMrC,GAAG,GAAGN,IAAI,CAACM,GAAG,EAAE,CAAA;EAEtB,IAAA,IAAMsC,SAAS,GAAGL,UAAU,CAACE,IAAI,CAAC,CAAA;MAElC,IAAI,CAACC,aAAa,EAAE;EAClBA,MAAAA,aAAa,GAAGpC,GAAG,CAAA;EACrB,KAAA;EAEAgC,IAAAA,KAAK,CAACE,IAAI,CAAC,GAAGG,WAAW,CAAA;EACzBJ,IAAAA,UAAU,CAACC,IAAI,CAAC,GAAGlC,GAAG,CAAA;MAEtB,IAAIzU,CAAC,GAAG4W,IAAI,CAAA;MACZ,IAAII,UAAU,GAAG,CAAC,CAAA;MAElB,OAAOhX,CAAC,KAAK2W,IAAI,EAAE;EACjBK,MAAAA,UAAU,IAAIP,KAAK,CAACzW,CAAC,EAAE,CAAC,CAAA;QACxBA,CAAC,GAAGA,CAAC,GAAGuW,YAAY,CAAA;EACtB,KAAA;EAEAI,IAAAA,IAAI,GAAG,CAACA,IAAI,GAAG,CAAC,IAAIJ,YAAY,CAAA;MAEhC,IAAII,IAAI,KAAKC,IAAI,EAAE;EACjBA,MAAAA,IAAI,GAAG,CAACA,IAAI,GAAG,CAAC,IAAIL,YAAY,CAAA;EAClC,KAAA;EAEA,IAAA,IAAI9B,GAAG,GAAGoC,aAAa,GAAGL,GAAG,EAAE;EAC7B,MAAA,OAAA;EACF,KAAA;EAEA,IAAA,IAAMS,MAAM,GAAGF,SAAS,IAAItC,GAAG,GAAGsC,SAAS,CAAA;EAE3C,IAAA,OAAOE,MAAM,GAAG5Q,IAAI,CAAC6Q,KAAK,CAACF,UAAU,GAAG,IAAI,GAAGC,MAAM,CAAC,GAAGrU,SAAS,CAAA;KACnE,CAAA;EACH;;ECpCA,SAASuU,oBAAoB,CAACC,QAAQ,EAAEC,gBAAgB,EAAE;IACxD,IAAIC,aAAa,GAAG,CAAC,CAAA;EACrB,EAAA,IAAMC,YAAY,GAAGjB,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzC,OAAO,UAAApI,CAAC,EAAI;EACV,IAAA,IAAMsJ,MAAM,GAAGtJ,CAAC,CAACsJ,MAAM,CAAA;MACvB,IAAMC,KAAK,GAAGvJ,CAAC,CAACwJ,gBAAgB,GAAGxJ,CAAC,CAACuJ,KAAK,GAAG7U,SAAS,CAAA;EACtD,IAAA,IAAM+U,aAAa,GAAGH,MAAM,GAAGF,aAAa,CAAA;EAC5C,IAAA,IAAMM,IAAI,GAAGL,YAAY,CAACI,aAAa,CAAC,CAAA;EACxC,IAAA,IAAME,OAAO,GAAGL,MAAM,IAAIC,KAAK,CAAA;EAE/BH,IAAAA,aAAa,GAAGE,MAAM,CAAA;EAEtB,IAAA,IAAMpK,IAAI,GAAG;EACXoK,MAAAA,MAAM,EAANA,MAAM;EACNC,MAAAA,KAAK,EAALA,KAAK;EACLK,MAAAA,QAAQ,EAAEL,KAAK,GAAID,MAAM,GAAGC,KAAK,GAAI7U,SAAS;EAC9C6T,MAAAA,KAAK,EAAEkB,aAAa;EACpBC,MAAAA,IAAI,EAAEA,IAAI,GAAGA,IAAI,GAAGhV,SAAS;EAC7BmV,MAAAA,SAAS,EAAEH,IAAI,IAAIH,KAAK,IAAII,OAAO,GAAG,CAACJ,KAAK,GAAGD,MAAM,IAAII,IAAI,GAAGhV,SAAS;EACzEoV,MAAAA,KAAK,EAAE9J,CAAAA;OACR,CAAA;MAEDd,IAAI,CAACiK,gBAAgB,GAAG,UAAU,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAA;MAErDD,QAAQ,CAAChK,IAAI,CAAC,CAAA;KACf,CAAA;EACH,CAAA;EAEA,IAAM6K,qBAAqB,GAAG,OAAOC,cAAc,KAAK,WAAW,CAAA;AAEnE,mBAAeD,qBAAqB,IAAI,UAAU5Q,MAAM,EAAE;IACxD,OAAO,IAAI8Q,OAAO,CAAC,SAASC,kBAAkB,CAAC1E,OAAO,EAAEC,MAAM,EAAE;EAC9D,IAAA,IAAI0E,WAAW,GAAGhR,MAAM,CAAC+F,IAAI,CAAA;EAC7B,IAAA,IAAMkL,cAAc,GAAG/G,cAAY,CAACtJ,IAAI,CAACZ,MAAM,CAACmH,OAAO,CAAC,CAAC4E,SAAS,EAAE,CAAA;EACpE,IAAA,IAAKjE,YAAY,GAAmB9H,MAAM,CAArC8H,YAAY;QAAEoJ,aAAa,GAAIlR,MAAM,CAAvBkR,aAAa,CAAA;EAChC,IAAA,IAAIC,UAAU,CAAA;EACd,IAAA,SAASjV,IAAI,GAAG;QACd,IAAI8D,MAAM,CAACoR,WAAW,EAAE;EACtBpR,QAAAA,MAAM,CAACoR,WAAW,CAACC,WAAW,CAACF,UAAU,CAAC,CAAA;EAC5C,OAAA;QAEA,IAAInR,MAAM,CAACsR,MAAM,EAAE;UACjBtR,MAAM,CAACsR,MAAM,CAACC,mBAAmB,CAAC,OAAO,EAAEJ,UAAU,CAAC,CAAA;EACxD,OAAA;EACF,KAAA;EAEA,IAAA,IAAI/J,WAAW,CAAA;EAEf,IAAA,IAAIhH,OAAK,CAACnI,UAAU,CAAC+Y,WAAW,CAAC,EAAE;EACjC,MAAA,IAAInL,QAAQ,CAACN,qBAAqB,IAAIM,QAAQ,CAACH,8BAA8B,EAAE;EAC7EuL,QAAAA,cAAc,CAACzJ,cAAc,CAAC,KAAK,CAAC,CAAC;SACtC,MAAM,IAAI,CAACJ,WAAW,GAAG6J,cAAc,CAAC5J,cAAc,EAAE,MAAM,KAAK,EAAE;EACpE;EACA,QAAA,IAAA,IAAA,GAA0BD,WAAW,GAAGA,WAAW,CAACjJ,KAAK,CAAC,GAAG,CAAC,CAACoD,GAAG,CAAC,UAAAE,KAAK,EAAA;cAAA,OAAIA,KAAK,CAACnJ,IAAI,EAAE,CAAA;EAAA,WAAA,CAAC,CAACyC,MAAM,CAACyW,OAAO,CAAC,GAAG,EAAE;EAAA,UAAA,KAAA,GAAA,QAAA,CAAA,IAAA,CAAA;YAAvGpb,IAAI,GAAA,KAAA,CAAA,CAAA,CAAA;YAAK+S,MAAM,GAAA,KAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA;EACtB8H,QAAAA,cAAc,CAACzJ,cAAc,CAAC,CAACpR,IAAI,IAAI,qBAAqB,CAAK+S,CAAAA,MAAAA,CAAAA,kBAAAA,CAAAA,MAAM,CAAEzH,CAAAA,CAAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;EACtF,OAAA;EACF,KAAA;EAEA,IAAA,IAAIzB,OAAO,GAAG,IAAI4Q,cAAc,EAAE,CAAA;;EAElC;MACA,IAAI7Q,MAAM,CAACyR,IAAI,EAAE;QACf,IAAMC,QAAQ,GAAG1R,MAAM,CAACyR,IAAI,CAACC,QAAQ,IAAI,EAAE,CAAA;QAC3C,IAAMC,QAAQ,GAAG3R,MAAM,CAACyR,IAAI,CAACE,QAAQ,GAAGC,QAAQ,CAACpO,kBAAkB,CAACxD,MAAM,CAACyR,IAAI,CAACE,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAA;EAC/FV,MAAAA,cAAc,CAACpT,GAAG,CAAC,eAAe,EAAE,QAAQ,GAAGgU,IAAI,CAACH,QAAQ,GAAG,GAAG,GAAGC,QAAQ,CAAC,CAAC,CAAA;EACjF,KAAA;MAEA,IAAMG,QAAQ,GAAGrE,aAAa,CAACzN,MAAM,CAACuN,OAAO,EAAEvN,MAAM,CAACgE,GAAG,CAAC,CAAA;MAE1D/D,OAAO,CAAC8R,IAAI,CAAC/R,MAAM,CAACwI,MAAM,CAACzL,WAAW,EAAE,EAAEgH,QAAQ,CAAC+N,QAAQ,EAAE9R,MAAM,CAAC2D,MAAM,EAAE3D,MAAM,CAACgS,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAA;;EAE3G;EACA/R,IAAAA,OAAO,CAACgI,OAAO,GAAGjI,MAAM,CAACiI,OAAO,CAAA;EAEhC,IAAA,SAASgK,SAAS,GAAG;QACnB,IAAI,CAAChS,OAAO,EAAE;EACZ,QAAA,OAAA;EACF,OAAA;EACA;EACA,MAAA,IAAMiS,eAAe,GAAGhI,cAAY,CAACtJ,IAAI,CACvC,uBAAuB,IAAIX,OAAO,IAAIA,OAAO,CAACkS,qBAAqB,EAAE,CACtE,CAAA;EACD,MAAA,IAAMC,YAAY,GAAG,CAACtK,YAAY,IAAIA,YAAY,KAAK,MAAM,IAAIA,YAAY,KAAK,MAAM,GACtF7H,OAAO,CAACoS,YAAY,GAAGpS,OAAO,CAACC,QAAQ,CAAA;EACzC,MAAA,IAAMA,QAAQ,GAAG;EACf6F,QAAAA,IAAI,EAAEqM,YAAY;UAClBzR,MAAM,EAAEV,OAAO,CAACU,MAAM;UACtB2R,UAAU,EAAErS,OAAO,CAACqS,UAAU;EAC9BnL,QAAAA,OAAO,EAAE+K,eAAe;EACxBlS,QAAAA,MAAM,EAANA,MAAM;EACNC,QAAAA,OAAO,EAAPA,OAAAA;SACD,CAAA;EAEDmM,MAAAA,MAAM,CAAC,SAASmG,QAAQ,CAAC7X,KAAK,EAAE;UAC9B2R,OAAO,CAAC3R,KAAK,CAAC,CAAA;EACdwB,QAAAA,IAAI,EAAE,CAAA;EACR,OAAC,EAAE,SAASsW,OAAO,CAACC,GAAG,EAAE;UACvBnG,MAAM,CAACmG,GAAG,CAAC,CAAA;EACXvW,QAAAA,IAAI,EAAE,CAAA;SACP,EAAEgE,QAAQ,CAAC,CAAA;;EAEZ;EACAD,MAAAA,OAAO,GAAG,IAAI,CAAA;EAChB,KAAA;MAEA,IAAI,WAAW,IAAIA,OAAO,EAAE;EAC1B;QACAA,OAAO,CAACgS,SAAS,GAAGA,SAAS,CAAA;EAC/B,KAAC,MAAM;EACL;EACAhS,MAAAA,OAAO,CAACyS,kBAAkB,GAAG,SAASC,UAAU,GAAG;UACjD,IAAI,CAAC1S,OAAO,IAAIA,OAAO,CAAC2S,UAAU,KAAK,CAAC,EAAE;EACxC,UAAA,OAAA;EACF,SAAA;;EAEA;EACA;EACA;EACA;UACA,IAAI3S,OAAO,CAACU,MAAM,KAAK,CAAC,IAAI,EAAEV,OAAO,CAAC4S,WAAW,IAAI5S,OAAO,CAAC4S,WAAW,CAACpX,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;EAChG,UAAA,OAAA;EACF,SAAA;EACA;EACA;UACAqX,UAAU,CAACb,SAAS,CAAC,CAAA;SACtB,CAAA;EACH,KAAA;;EAEA;EACAhS,IAAAA,OAAO,CAAC8S,OAAO,GAAG,SAASC,WAAW,GAAG;QACvC,IAAI,CAAC/S,OAAO,EAAE;EACZ,QAAA,OAAA;EACF,OAAA;EAEAqM,MAAAA,MAAM,CAAC,IAAIzM,UAAU,CAAC,iBAAiB,EAAEA,UAAU,CAACoT,YAAY,EAAEjT,MAAM,EAAEC,OAAO,CAAC,CAAC,CAAA;;EAEnF;EACAA,MAAAA,OAAO,GAAG,IAAI,CAAA;OACf,CAAA;;EAED;EACAA,IAAAA,OAAO,CAACiT,OAAO,GAAG,SAASC,WAAW,GAAG;EACvC;EACA;EACA7G,MAAAA,MAAM,CAAC,IAAIzM,UAAU,CAAC,eAAe,EAAEA,UAAU,CAACuT,WAAW,EAAEpT,MAAM,EAAEC,OAAO,CAAC,CAAC,CAAA;;EAEhF;EACAA,MAAAA,OAAO,GAAG,IAAI,CAAA;OACf,CAAA;;EAED;EACAA,IAAAA,OAAO,CAACoT,SAAS,GAAG,SAASC,aAAa,GAAG;EAC3C,MAAA,IAAIC,mBAAmB,GAAGvT,MAAM,CAACiI,OAAO,GAAG,aAAa,GAAGjI,MAAM,CAACiI,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAA;EAC9G,MAAA,IAAMlB,YAAY,GAAG/G,MAAM,CAAC+G,YAAY,IAAIC,oBAAoB,CAAA;QAChE,IAAIhH,MAAM,CAACuT,mBAAmB,EAAE;UAC9BA,mBAAmB,GAAGvT,MAAM,CAACuT,mBAAmB,CAAA;EAClD,OAAA;QACAjH,MAAM,CAAC,IAAIzM,UAAU,CACnB0T,mBAAmB,EACnBxM,YAAY,CAAC/B,mBAAmB,GAAGnF,UAAU,CAAC2T,SAAS,GAAG3T,UAAU,CAACoT,YAAY,EACjFjT,MAAM,EACNC,OAAO,CAAC,CAAC,CAAA;;EAEX;EACAA,MAAAA,OAAO,GAAG,IAAI,CAAA;OACf,CAAA;;EAED;EACA;EACA;MACA,IAAG4F,QAAQ,CAACN,qBAAqB,EAAE;EACjC2L,MAAAA,aAAa,IAAI9Q,OAAK,CAACxJ,UAAU,CAACsa,aAAa,CAAC,KAAKA,aAAa,GAAGA,aAAa,CAAClR,MAAM,CAAC,CAAC,CAAA;QAE3F,IAAIkR,aAAa,IAAKA,aAAa,KAAK,KAAK,IAAIrC,eAAe,CAACiD,QAAQ,CAAE,EAAE;EAC3E;EACA,QAAA,IAAM2B,SAAS,GAAGzT,MAAM,CAACmI,cAAc,IAAInI,MAAM,CAACkI,cAAc,IAAIwL,OAAO,CAAC1G,IAAI,CAAChN,MAAM,CAACkI,cAAc,CAAC,CAAA;EAEvG,QAAA,IAAIuL,SAAS,EAAE;YACbxC,cAAc,CAACpT,GAAG,CAACmC,MAAM,CAACmI,cAAc,EAAEsL,SAAS,CAAC,CAAA;EACtD,SAAA;EACF,OAAA;EACF,KAAA;;EAEA;MACAzC,WAAW,KAAKzV,SAAS,IAAI0V,cAAc,CAACzJ,cAAc,CAAC,IAAI,CAAC,CAAA;;EAEhE;MACA,IAAI,kBAAkB,IAAIvH,OAAO,EAAE;EACjCG,MAAAA,OAAK,CAAC5H,OAAO,CAACyY,cAAc,CAAC5Q,MAAM,EAAE,EAAE,SAASsT,gBAAgB,CAACjd,GAAG,EAAEuC,GAAG,EAAE;EACzEgH,QAAAA,OAAO,CAAC0T,gBAAgB,CAAC1a,GAAG,EAAEvC,GAAG,CAAC,CAAA;EACpC,OAAC,CAAC,CAAA;EACJ,KAAA;;EAEA;MACA,IAAI,CAAC0J,OAAK,CAAC5J,WAAW,CAACwJ,MAAM,CAAC4T,eAAe,CAAC,EAAE;EAC9C3T,MAAAA,OAAO,CAAC2T,eAAe,GAAG,CAAC,CAAC5T,MAAM,CAAC4T,eAAe,CAAA;EACpD,KAAA;;EAEA;EACA,IAAA,IAAI9L,YAAY,IAAIA,YAAY,KAAK,MAAM,EAAE;EAC3C7H,MAAAA,OAAO,CAAC6H,YAAY,GAAG9H,MAAM,CAAC8H,YAAY,CAAA;EAC5C,KAAA;;EAEA;EACA,IAAA,IAAI,OAAO9H,MAAM,CAAC6T,kBAAkB,KAAK,UAAU,EAAE;EACnD5T,MAAAA,OAAO,CAAC6T,gBAAgB,CAAC,UAAU,EAAEhE,oBAAoB,CAAC9P,MAAM,CAAC6T,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAA;EAC7F,KAAA;;EAEA;MACA,IAAI,OAAO7T,MAAM,CAAC+T,gBAAgB,KAAK,UAAU,IAAI9T,OAAO,CAAC+T,MAAM,EAAE;EACnE/T,MAAAA,OAAO,CAAC+T,MAAM,CAACF,gBAAgB,CAAC,UAAU,EAAEhE,oBAAoB,CAAC9P,MAAM,CAAC+T,gBAAgB,CAAC,CAAC,CAAA;EAC5F,KAAA;EAEA,IAAA,IAAI/T,MAAM,CAACoR,WAAW,IAAIpR,MAAM,CAACsR,MAAM,EAAE;EACvC;EACA;QACAH,UAAU,GAAG,SAAA8C,UAAAA,CAAAA,MAAM,EAAI;UACrB,IAAI,CAAChU,OAAO,EAAE;EACZ,UAAA,OAAA;EACF,SAAA;EACAqM,QAAAA,MAAM,CAAC,CAAC2H,MAAM,IAAIA,MAAM,CAAC7d,IAAI,GAAG,IAAI8V,aAAa,CAAC,IAAI,EAAElM,MAAM,EAAEC,OAAO,CAAC,GAAGgU,MAAM,CAAC,CAAA;UAClFhU,OAAO,CAACiU,KAAK,EAAE,CAAA;EACfjU,QAAAA,OAAO,GAAG,IAAI,CAAA;SACf,CAAA;QAEDD,MAAM,CAACoR,WAAW,IAAIpR,MAAM,CAACoR,WAAW,CAAC+C,SAAS,CAAChD,UAAU,CAAC,CAAA;QAC9D,IAAInR,MAAM,CAACsR,MAAM,EAAE;EACjBtR,QAAAA,MAAM,CAACsR,MAAM,CAAC8C,OAAO,GAAGjD,UAAU,EAAE,GAAGnR,MAAM,CAACsR,MAAM,CAACwC,gBAAgB,CAAC,OAAO,EAAE3C,UAAU,CAAC,CAAA;EAC5F,OAAA;EACF,KAAA;EAEA,IAAA,IAAM/C,QAAQ,GAAGY,aAAa,CAAC8C,QAAQ,CAAC,CAAA;EAExC,IAAA,IAAI1D,QAAQ,IAAIvI,QAAQ,CAACT,SAAS,CAAC3J,OAAO,CAAC2S,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;EAC3D9B,MAAAA,MAAM,CAAC,IAAIzM,UAAU,CAAC,uBAAuB,GAAGuO,QAAQ,GAAG,GAAG,EAAEvO,UAAU,CAAC0M,eAAe,EAAEvM,MAAM,CAAC,CAAC,CAAA;EACpG,MAAA,OAAA;EACF,KAAA;;EAGA;EACAC,IAAAA,OAAO,CAACoU,IAAI,CAACrD,WAAW,IAAI,IAAI,CAAC,CAAA;EACnC,GAAC,CAAC,CAAA;EACJ,CAAC;;EC9PD,IAAMsD,aAAa,GAAG;EACpBC,EAAAA,IAAI,EAAEC,WAAW;EACjBC,EAAAA,GAAG,EAAEC,UAAAA;EACP,CAAC,CAAA;AAEDtU,SAAK,CAAC5H,OAAO,CAAC8b,aAAa,EAAE,UAACpf,EAAE,EAAEwF,KAAK,EAAK;EAC1C,EAAA,IAAIxF,EAAE,EAAE;MACN,IAAI;EACFM,MAAAA,MAAM,CAACiF,cAAc,CAACvF,EAAE,EAAE,MAAM,EAAE;EAACwF,QAAAA,KAAK,EAALA,KAAAA;EAAK,OAAC,CAAC,CAAA;OAC3C,CAAC,OAAOmM,CAAC,EAAE;EACV;EACF,KAAA;EACArR,IAAAA,MAAM,CAACiF,cAAc,CAACvF,EAAE,EAAE,aAAa,EAAE;EAACwF,MAAAA,KAAK,EAALA,KAAAA;EAAK,KAAC,CAAC,CAAA;EACnD,GAAA;EACF,CAAC,CAAC,CAAA;EAEF,IAAMia,YAAY,GAAG,SAAfA,YAAY,CAAIC,MAAM,EAAA;EAAA,EAAA,OAAA,IAAA,CAAA,MAAA,CAAUA,MAAM,CAAA,CAAA;EAAA,CAAE,CAAA;EAE9C,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgB,CAAI5N,OAAO,EAAA;EAAA,EAAA,OAAK7G,OAAK,CAACxJ,UAAU,CAACqQ,OAAO,CAAC,IAAIA,OAAO,KAAK,IAAI,IAAIA,OAAO,KAAK,KAAK,CAAA;EAAA,CAAA,CAAA;AAExG,iBAAe;IACb6N,UAAU,EAAE,SAACC,UAAAA,CAAAA,QAAQ,EAAK;EACxBA,IAAAA,QAAQ,GAAG3U,OAAK,CAAC9J,OAAO,CAACye,QAAQ,CAAC,GAAGA,QAAQ,GAAG,CAACA,QAAQ,CAAC,CAAA;EAE1D,IAAA,IAAA,SAAA,GAAiBA,QAAQ;EAAlBlc,MAAAA,MAAM,aAANA,MAAM,CAAA;EACb,IAAA,IAAImc,aAAa,CAAA;EACjB,IAAA,IAAI/N,OAAO,CAAA;MAEX,IAAMgO,eAAe,GAAG,EAAE,CAAA;MAE1B,KAAK,IAAItc,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGE,MAAM,EAAEF,CAAC,EAAE,EAAE;EAC/Bqc,MAAAA,aAAa,GAAGD,QAAQ,CAACpc,CAAC,CAAC,CAAA;EAC3B,MAAA,IAAIgM,EAAE,GAAA,KAAA,CAAA,CAAA;EAENsC,MAAAA,OAAO,GAAG+N,aAAa,CAAA;EAEvB,MAAA,IAAI,CAACH,gBAAgB,CAACG,aAAa,CAAC,EAAE;EACpC/N,QAAAA,OAAO,GAAGqN,aAAa,CAAC,CAAC3P,EAAE,GAAGrJ,MAAM,CAAC0Z,aAAa,CAAC,EAAE/e,WAAW,EAAE,CAAC,CAAA;UAEnE,IAAIgR,OAAO,KAAK1L,SAAS,EAAE;EACzB,UAAA,MAAM,IAAIsE,UAAU,CAAqB8E,mBAAAA,CAAAA,MAAAA,CAAAA,EAAE,EAAI,GAAA,CAAA,CAAA,CAAA;EACjD,SAAA;EACF,OAAA;EAEA,MAAA,IAAIsC,OAAO,EAAE;EACX,QAAA,MAAA;EACF,OAAA;QAEAgO,eAAe,CAACtQ,EAAE,IAAI,GAAG,GAAGhM,CAAC,CAAC,GAAGsO,OAAO,CAAA;EAC1C,KAAA;MAEA,IAAI,CAACA,OAAO,EAAE;QAEZ,IAAMiO,OAAO,GAAG1f,MAAM,CAACgR,OAAO,CAACyO,eAAe,CAAC,CAC5C1T,GAAG,CAAC,UAAA,IAAA,EAAA;EAAA,QAAA,IAAA,KAAA,GAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAAA;YAAEoD,EAAE,GAAA,KAAA,CAAA,CAAA,CAAA;YAAEwQ,KAAK,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA;UAAA,OAAM,UAAA,CAAA,MAAA,CAAWxQ,EAAE,EAAA,GAAA,CAAA,IAChCwQ,KAAK,KAAK,KAAK,GAAG,qCAAqC,GAAG,+BAA+B,CAAC,CAAA;SAC5F,CAAA,CAAA;EAEH,MAAA,IAAIC,CAAC,GAAGvc,MAAM,GACXqc,OAAO,CAACrc,MAAM,GAAG,CAAC,GAAG,WAAW,GAAGqc,OAAO,CAAC3T,GAAG,CAACoT,YAAY,CAAC,CAACjT,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAGiT,YAAY,CAACO,OAAO,CAAC,CAAC,CAAC,CAAC,GACzG,yBAAyB,CAAA;EAE3B,MAAA,MAAM,IAAIrV,UAAU,CAClB,0DAA0DuV,CAAC,EAC3D,iBAAiB,CAClB,CAAA;EACH,KAAA;EAEA,IAAA,OAAOnO,OAAO,CAAA;KACf;EACD8N,EAAAA,QAAQ,EAAET,aAAAA;EACZ,CAAC;;ECnED;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASe,4BAA4B,CAACrV,MAAM,EAAE;IAC5C,IAAIA,MAAM,CAACoR,WAAW,EAAE;EACtBpR,IAAAA,MAAM,CAACoR,WAAW,CAACkE,gBAAgB,EAAE,CAAA;EACvC,GAAA;IAEA,IAAItV,MAAM,CAACsR,MAAM,IAAItR,MAAM,CAACsR,MAAM,CAAC8C,OAAO,EAAE;EAC1C,IAAA,MAAM,IAAIlI,aAAa,CAAC,IAAI,EAAElM,MAAM,CAAC,CAAA;EACvC,GAAA;EACF,CAAA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAASuV,eAAe,CAACvV,MAAM,EAAE;IAC9CqV,4BAA4B,CAACrV,MAAM,CAAC,CAAA;IAEpCA,MAAM,CAACmH,OAAO,GAAG+C,cAAY,CAACtJ,IAAI,CAACZ,MAAM,CAACmH,OAAO,CAAC,CAAA;;EAElD;EACAnH,EAAAA,MAAM,CAAC+F,IAAI,GAAG6F,aAAa,CAAC7V,IAAI,CAC9BiK,MAAM,EACNA,MAAM,CAACkH,gBAAgB,CACxB,CAAA;EAED,EAAA,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAACzL,OAAO,CAACuE,MAAM,CAACwI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;MAC1DxI,MAAM,CAACmH,OAAO,CAACK,cAAc,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAA;EAC3E,GAAA;EAEA,EAAA,IAAMP,OAAO,GAAG8N,QAAQ,CAACD,UAAU,CAAC9U,MAAM,CAACiH,OAAO,IAAIH,UAAQ,CAACG,OAAO,CAAC,CAAA;IAEvE,OAAOA,OAAO,CAACjH,MAAM,CAAC,CAACL,IAAI,CAAC,SAAS6V,mBAAmB,CAACtV,QAAQ,EAAE;MACjEmV,4BAA4B,CAACrV,MAAM,CAAC,CAAA;;EAEpC;EACAE,IAAAA,QAAQ,CAAC6F,IAAI,GAAG6F,aAAa,CAAC7V,IAAI,CAChCiK,MAAM,EACNA,MAAM,CAAC4H,iBAAiB,EACxB1H,QAAQ,CACT,CAAA;MAEDA,QAAQ,CAACiH,OAAO,GAAG+C,cAAY,CAACtJ,IAAI,CAACV,QAAQ,CAACiH,OAAO,CAAC,CAAA;EAEtD,IAAA,OAAOjH,QAAQ,CAAA;EACjB,GAAC,EAAE,SAASuV,kBAAkB,CAACb,MAAM,EAAE;EACrC,IAAA,IAAI,CAAC5I,QAAQ,CAAC4I,MAAM,CAAC,EAAE;QACrBS,4BAA4B,CAACrV,MAAM,CAAC,CAAA;;EAEpC;EACA,MAAA,IAAI4U,MAAM,IAAIA,MAAM,CAAC1U,QAAQ,EAAE;EAC7B0U,QAAAA,MAAM,CAAC1U,QAAQ,CAAC6F,IAAI,GAAG6F,aAAa,CAAC7V,IAAI,CACvCiK,MAAM,EACNA,MAAM,CAAC4H,iBAAiB,EACxBgN,MAAM,CAAC1U,QAAQ,CAChB,CAAA;EACD0U,QAAAA,MAAM,CAAC1U,QAAQ,CAACiH,OAAO,GAAG+C,cAAY,CAACtJ,IAAI,CAACgU,MAAM,CAAC1U,QAAQ,CAACiH,OAAO,CAAC,CAAA;EACtE,OAAA;EACF,KAAA;EAEA,IAAA,OAAO2J,OAAO,CAACxE,MAAM,CAACsI,MAAM,CAAC,CAAA;EAC/B,GAAC,CAAC,CAAA;EACJ;;EC3EA,IAAMc,eAAe,GAAG,SAAlBA,eAAe,CAAI7f,KAAK,EAAA;IAAA,OAAKA,KAAK,YAAYqU,cAAY,GAAGrU,KAAK,CAACwK,MAAM,EAAE,GAAGxK,KAAK,CAAA;EAAA,CAAA,CAAA;;EAEzF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAAS8f,WAAW,CAACC,OAAO,EAAEC,OAAO,EAAE;EACpD;EACAA,EAAAA,OAAO,GAAGA,OAAO,IAAI,EAAE,CAAA;IACvB,IAAM7V,MAAM,GAAG,EAAE,CAAA;EAEjB,EAAA,SAAS8V,cAAc,CAACvW,MAAM,EAAED,MAAM,EAAE1F,QAAQ,EAAE;EAChD,IAAA,IAAIwG,OAAK,CAAC7I,aAAa,CAACgI,MAAM,CAAC,IAAIa,OAAK,CAAC7I,aAAa,CAAC+H,MAAM,CAAC,EAAE;EAC9D,MAAA,OAAOc,OAAK,CAACzG,KAAK,CAAC5D,IAAI,CAAC;EAAC6D,QAAAA,QAAQ,EAARA,QAAAA;EAAQ,OAAC,EAAE2F,MAAM,EAAED,MAAM,CAAC,CAAA;OACpD,MAAM,IAAIc,OAAK,CAAC7I,aAAa,CAAC+H,MAAM,CAAC,EAAE;QACtC,OAAOc,OAAK,CAACzG,KAAK,CAAC,EAAE,EAAE2F,MAAM,CAAC,CAAA;OAC/B,MAAM,IAAIc,OAAK,CAAC9J,OAAO,CAACgJ,MAAM,CAAC,EAAE;QAChC,OAAOA,MAAM,CAACtJ,KAAK,EAAE,CAAA;EACvB,KAAA;EACA,IAAA,OAAOsJ,MAAM,CAAA;EACf,GAAA;;EAEA;EACA,EAAA,SAASyW,mBAAmB,CAAC/b,CAAC,EAAEC,CAAC,EAAEL,QAAQ,EAAE;EAC3C,IAAA,IAAI,CAACwG,OAAK,CAAC5J,WAAW,CAACyD,CAAC,CAAC,EAAE;EACzB,MAAA,OAAO6b,cAAc,CAAC9b,CAAC,EAAEC,CAAC,EAAEL,QAAQ,CAAC,CAAA;OACtC,MAAM,IAAI,CAACwG,OAAK,CAAC5J,WAAW,CAACwD,CAAC,CAAC,EAAE;EAChC,MAAA,OAAO8b,cAAc,CAACva,SAAS,EAAEvB,CAAC,EAAEJ,QAAQ,CAAC,CAAA;EAC/C,KAAA;EACF,GAAA;;EAEA;EACA,EAAA,SAASoc,gBAAgB,CAAChc,CAAC,EAAEC,CAAC,EAAE;EAC9B,IAAA,IAAI,CAACmG,OAAK,CAAC5J,WAAW,CAACyD,CAAC,CAAC,EAAE;EACzB,MAAA,OAAO6b,cAAc,CAACva,SAAS,EAAEtB,CAAC,CAAC,CAAA;EACrC,KAAA;EACF,GAAA;;EAEA;EACA,EAAA,SAASgc,gBAAgB,CAACjc,CAAC,EAAEC,CAAC,EAAE;EAC9B,IAAA,IAAI,CAACmG,OAAK,CAAC5J,WAAW,CAACyD,CAAC,CAAC,EAAE;EACzB,MAAA,OAAO6b,cAAc,CAACva,SAAS,EAAEtB,CAAC,CAAC,CAAA;OACpC,MAAM,IAAI,CAACmG,OAAK,CAAC5J,WAAW,CAACwD,CAAC,CAAC,EAAE;EAChC,MAAA,OAAO8b,cAAc,CAACva,SAAS,EAAEvB,CAAC,CAAC,CAAA;EACrC,KAAA;EACF,GAAA;;EAEA;EACA,EAAA,SAASkc,eAAe,CAAClc,CAAC,EAAEC,CAAC,EAAEgB,IAAI,EAAE;MACnC,IAAIA,IAAI,IAAI4a,OAAO,EAAE;EACnB,MAAA,OAAOC,cAAc,CAAC9b,CAAC,EAAEC,CAAC,CAAC,CAAA;EAC7B,KAAC,MAAM,IAAIgB,IAAI,IAAI2a,OAAO,EAAE;EAC1B,MAAA,OAAOE,cAAc,CAACva,SAAS,EAAEvB,CAAC,CAAC,CAAA;EACrC,KAAA;EACF,GAAA;EAEA,EAAA,IAAMmc,QAAQ,GAAG;EACfnS,IAAAA,GAAG,EAAEgS,gBAAgB;EACrBxN,IAAAA,MAAM,EAAEwN,gBAAgB;EACxBjQ,IAAAA,IAAI,EAAEiQ,gBAAgB;EACtBzI,IAAAA,OAAO,EAAE0I,gBAAgB;EACzB/O,IAAAA,gBAAgB,EAAE+O,gBAAgB;EAClCrO,IAAAA,iBAAiB,EAAEqO,gBAAgB;EACnCjE,IAAAA,gBAAgB,EAAEiE,gBAAgB;EAClChO,IAAAA,OAAO,EAAEgO,gBAAgB;EACzBG,IAAAA,cAAc,EAAEH,gBAAgB;EAChCrC,IAAAA,eAAe,EAAEqC,gBAAgB;EACjC/E,IAAAA,aAAa,EAAE+E,gBAAgB;EAC/BhP,IAAAA,OAAO,EAAEgP,gBAAgB;EACzBnO,IAAAA,YAAY,EAAEmO,gBAAgB;EAC9B/N,IAAAA,cAAc,EAAE+N,gBAAgB;EAChC9N,IAAAA,cAAc,EAAE8N,gBAAgB;EAChClC,IAAAA,gBAAgB,EAAEkC,gBAAgB;EAClCpC,IAAAA,kBAAkB,EAAEoC,gBAAgB;EACpCI,IAAAA,UAAU,EAAEJ,gBAAgB;EAC5B7N,IAAAA,gBAAgB,EAAE6N,gBAAgB;EAClC5N,IAAAA,aAAa,EAAE4N,gBAAgB;EAC/BK,IAAAA,cAAc,EAAEL,gBAAgB;EAChCM,IAAAA,SAAS,EAAEN,gBAAgB;EAC3BO,IAAAA,SAAS,EAAEP,gBAAgB;EAC3BQ,IAAAA,UAAU,EAAER,gBAAgB;EAC5B7E,IAAAA,WAAW,EAAE6E,gBAAgB;EAC7BS,IAAAA,UAAU,EAAET,gBAAgB;EAC5BU,IAAAA,gBAAgB,EAAEV,gBAAgB;EAClC3N,IAAAA,cAAc,EAAE4N,eAAe;EAC/B/O,IAAAA,OAAO,EAAE,SAAA,OAAA,CAACnN,CAAC,EAAEC,CAAC,EAAA;EAAA,MAAA,OAAK8b,mBAAmB,CAACL,eAAe,CAAC1b,CAAC,CAAC,EAAE0b,eAAe,CAACzb,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;EAAA,KAAA;KACrF,CAAA;IAEDmG,OAAK,CAAC5H,OAAO,CAAChD,MAAM,CAACsD,IAAI,CAACtD,MAAM,CAACmF,MAAM,CAAC,EAAE,EAAEib,OAAO,EAAEC,OAAO,CAAC,CAAC,EAAE,SAASe,kBAAkB,CAAC3b,IAAI,EAAE;EAChG,IAAA,IAAMtB,KAAK,GAAGwc,QAAQ,CAAClb,IAAI,CAAC,IAAI8a,mBAAmB,CAAA;EACnD,IAAA,IAAMc,WAAW,GAAGld,KAAK,CAACic,OAAO,CAAC3a,IAAI,CAAC,EAAE4a,OAAO,CAAC5a,IAAI,CAAC,EAAEA,IAAI,CAAC,CAAA;EAC5DmF,IAAAA,OAAK,CAAC5J,WAAW,CAACqgB,WAAW,CAAC,IAAIld,KAAK,KAAKuc,eAAe,KAAMlW,MAAM,CAAC/E,IAAI,CAAC,GAAG4b,WAAW,CAAC,CAAA;EAC/F,GAAC,CAAC,CAAA;EAEF,EAAA,OAAO7W,MAAM,CAAA;EACf;;ECzGO,IAAM8W,OAAO,GAAG,OAAO;;ECK9B,IAAMC,YAAU,GAAG,EAAE,CAAA;;EAErB;EACA,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAACve,OAAO,CAAC,UAACpC,IAAI,EAAEuC,CAAC,EAAK;IACnFoe,YAAU,CAAC3gB,IAAI,CAAC,GAAG,SAAS4gB,SAAS,CAACnhB,KAAK,EAAE;EAC3C,IAAA,OAAO,QAAOA,KAAK,CAAA,KAAKO,IAAI,IAAI,GAAG,IAAIuC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,GAAGvC,IAAI,CAAA;KAClE,CAAA;EACH,CAAC,CAAC,CAAA;EAEF,IAAM6gB,kBAAkB,GAAG,EAAE,CAAA;;EAE7B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACAF,cAAU,CAAChQ,YAAY,GAAG,SAASA,YAAY,CAACiQ,SAAS,EAAEE,OAAO,EAAEpX,OAAO,EAAE;EAC3E,EAAA,SAASqX,aAAa,CAACC,GAAG,EAAEC,IAAI,EAAE;EAChC,IAAA,OAAO,UAAU,GAAGP,OAAO,GAAG,0BAA0B,GAAGM,GAAG,GAAG,IAAI,GAAGC,IAAI,IAAIvX,OAAO,GAAG,IAAI,GAAGA,OAAO,GAAG,EAAE,CAAC,CAAA;EAChH,GAAA;;EAEA;EACA,EAAA,OAAO,UAACpF,KAAK,EAAE0c,GAAG,EAAEE,IAAI,EAAK;MAC3B,IAAIN,SAAS,KAAK,KAAK,EAAE;QACvB,MAAM,IAAInX,UAAU,CAClBsX,aAAa,CAACC,GAAG,EAAE,mBAAmB,IAAIF,OAAO,GAAG,MAAM,GAAGA,OAAO,GAAG,EAAE,CAAC,CAAC,EAC3ErX,UAAU,CAAC0X,cAAc,CAC1B,CAAA;EACH,KAAA;EAEA,IAAA,IAAIL,OAAO,IAAI,CAACD,kBAAkB,CAACG,GAAG,CAAC,EAAE;EACvCH,MAAAA,kBAAkB,CAACG,GAAG,CAAC,GAAG,IAAI,CAAA;EAC9B;EACAI,MAAAA,OAAO,CAACC,IAAI,CACVN,aAAa,CACXC,GAAG,EACH,8BAA8B,GAAGF,OAAO,GAAG,yCAAyC,CACrF,CACF,CAAA;EACH,KAAA;MAEA,OAAOF,SAAS,GAAGA,SAAS,CAACtc,KAAK,EAAE0c,GAAG,EAAEE,IAAI,CAAC,GAAG,IAAI,CAAA;KACtD,CAAA;EACH,CAAC,CAAA;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA,SAASI,aAAa,CAACzV,OAAO,EAAE0V,MAAM,EAAEC,YAAY,EAAE;EACpD,EAAA,IAAI,OAAO3V,CAAAA,OAAO,CAAK,KAAA,QAAQ,EAAE;MAC/B,MAAM,IAAIpC,UAAU,CAAC,2BAA2B,EAAEA,UAAU,CAACgY,oBAAoB,CAAC,CAAA;EACpF,GAAA;EACA,EAAA,IAAM/e,IAAI,GAAGtD,MAAM,CAACsD,IAAI,CAACmJ,OAAO,CAAC,CAAA;EACjC,EAAA,IAAItJ,CAAC,GAAGG,IAAI,CAACD,MAAM,CAAA;EACnB,EAAA,OAAOF,CAAC,EAAE,GAAG,CAAC,EAAE;EACd,IAAA,IAAMye,GAAG,GAAGte,IAAI,CAACH,CAAC,CAAC,CAAA;EACnB,IAAA,IAAMqe,SAAS,GAAGW,MAAM,CAACP,GAAG,CAAC,CAAA;EAC7B,IAAA,IAAIJ,SAAS,EAAE;EACb,MAAA,IAAMtc,KAAK,GAAGuH,OAAO,CAACmV,GAAG,CAAC,CAAA;EAC1B,MAAA,IAAMrgB,MAAM,GAAG2D,KAAK,KAAKa,SAAS,IAAIyb,SAAS,CAACtc,KAAK,EAAE0c,GAAG,EAAEnV,OAAO,CAAC,CAAA;QACpE,IAAIlL,MAAM,KAAK,IAAI,EAAE;EACnB,QAAA,MAAM,IAAI8I,UAAU,CAAC,SAAS,GAAGuX,GAAG,GAAG,WAAW,GAAGrgB,MAAM,EAAE8I,UAAU,CAACgY,oBAAoB,CAAC,CAAA;EAC/F,OAAA;EACA,MAAA,SAAA;EACF,KAAA;MACA,IAAID,YAAY,KAAK,IAAI,EAAE;QACzB,MAAM,IAAI/X,UAAU,CAAC,iBAAiB,GAAGuX,GAAG,EAAEvX,UAAU,CAACiY,cAAc,CAAC,CAAA;EAC1E,KAAA;EACF,GAAA;EACF,CAAA;AAEA,kBAAe;EACbJ,EAAAA,aAAa,EAAbA,aAAa;EACbX,EAAAA,UAAU,EAAVA,YAAAA;EACF,CAAC;;EC/ED,IAAMA,UAAU,GAAGC,SAAS,CAACD,UAAU,CAAA;;EAEvC;EACA;EACA;EACA;EACA;EACA;EACA;EANA,IAOMgB,KAAK,gBAAA,YAAA;EACT,EAAA,SAAA,KAAA,CAAYC,cAAc,EAAE;EAAA,IAAA,eAAA,CAAA,IAAA,EAAA,KAAA,CAAA,CAAA;MAC1B,IAAI,CAAClR,QAAQ,GAAGkR,cAAc,CAAA;MAC9B,IAAI,CAACC,YAAY,GAAG;QAClBhY,OAAO,EAAE,IAAIoE,oBAAkB,EAAE;QACjCnE,QAAQ,EAAE,IAAImE,oBAAkB,EAAA;OACjC,CAAA;EACH,GAAA;;EAEA;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EAPE,EAAA,YAAA,CAAA,KAAA,EAAA,CAAA;EAAA,IAAA,GAAA,EAAA,SAAA;EAAA,IAAA,KAAA,EAAA,YAAA;QAAA,IAQA,SAAA,GAAA,iBAAA,eAAA,mBAAA,EAAA,CAAA,IAAA,CAAA,SAAA,OAAA,CAAc6T,WAAW,EAAElY,MAAM,EAAA;EAAA,QAAA,IAAA,KAAA,EAAA,KAAA,CAAA;EAAA,QAAA,OAAA,mBAAA,EAAA,CAAA,IAAA,CAAA,SAAA,QAAA,CAAA,QAAA,EAAA;EAAA,UAAA,OAAA,CAAA,EAAA;EAAA,YAAA,QAAA,QAAA,CAAA,IAAA,GAAA,QAAA,CAAA,IAAA;EAAA,cAAA,KAAA,CAAA;EAAA,gBAAA,QAAA,CAAA,IAAA,GAAA,CAAA,CAAA;EAAA,gBAAA,QAAA,CAAA,IAAA,GAAA,CAAA,CAAA;EAAA,gBAAA,OAEhB,IAAI,CAACmY,QAAQ,CAACD,WAAW,EAAElY,MAAM,CAAC,CAAA;EAAA,cAAA,KAAA,CAAA;EAAA,gBAAA,OAAA,QAAA,CAAA,MAAA,CAAA,QAAA,EAAA,QAAA,CAAA,IAAA,CAAA,CAAA;EAAA,cAAA,KAAA,CAAA;EAAA,gBAAA,QAAA,CAAA,IAAA,GAAA,CAAA,CAAA;EAAA,gBAAA,QAAA,CAAA,EAAA,GAAA,QAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA;kBAE/C,IAAI,QAAA,CAAA,EAAA,YAAelC,KAAK,EAAE;EAGxBA,kBAAAA,KAAK,CAACqC,iBAAiB,GAAGrC,KAAK,CAACqC,iBAAiB,CAACiY,KAAK,GAAG,EAAE,CAAC,GAAIA,KAAK,GAAG,IAAIta,KAAK,EAAG,CAAA;;EAErF;EACMsB,kBAAAA,KAAK,GAAGgZ,KAAK,CAAChZ,KAAK,GAAGgZ,KAAK,CAAChZ,KAAK,CAAC7G,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,CAAA;oBAEjE,IAAI,CAAC,QAAI6G,CAAAA,EAAAA,CAAAA,KAAK,EAAE;sBACd,QAAIA,CAAAA,EAAAA,CAAAA,KAAK,GAAGA,KAAK,CAAA;EACjB;qBACD,MAAM,IAAIA,KAAK,IAAI,CAAC9D,MAAM,CAAC,QAAI8D,CAAAA,EAAAA,CAAAA,KAAK,CAAC,CAACjE,QAAQ,CAACiE,KAAK,CAAC7G,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE;EAC/E,oBAAA,QAAA,CAAA,EAAA,CAAI6G,KAAK,IAAI,IAAI,GAAGA,KAAK,CAAA;EAC3B,mBAAA;EACF,iBAAA;EAAC,gBAAA,MAAA,QAAA,CAAA,EAAA,CAAA;EAAA,cAAA,KAAA,EAAA,CAAA;EAAA,cAAA,KAAA,KAAA;EAAA,gBAAA,OAAA,QAAA,CAAA,IAAA,EAAA,CAAA;EAAA,aAAA;EAAA,WAAA;EAAA,SAAA,EAAA,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;SAIJ,CAAA,CAAA,CAAA;EAAA,MAAA,SAAA,OAAA,CAAA,EAAA,EAAA,GAAA,EAAA;EAAA,QAAA,OAAA,SAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;EAAA,OAAA;EAAA,MAAA,OAAA,OAAA,CAAA;EAAA,KAAA,EAAA;EAAA,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,UAAA;EAAA,IAAA,KAAA,EAED,SAAS8Y,QAAAA,CAAAA,WAAW,EAAElY,MAAM,EAAE;EAC5B;EACA;EACA,MAAA,IAAI,OAAOkY,WAAW,KAAK,QAAQ,EAAE;EACnClY,QAAAA,MAAM,GAAGA,MAAM,IAAI,EAAE,CAAA;UACrBA,MAAM,CAACgE,GAAG,GAAGkU,WAAW,CAAA;EAC1B,OAAC,MAAM;EACLlY,QAAAA,MAAM,GAAGkY,WAAW,IAAI,EAAE,CAAA;EAC5B,OAAA;QAEAlY,MAAM,GAAG2V,WAAW,CAAC,IAAI,CAAC7O,QAAQ,EAAE9G,MAAM,CAAC,CAAA;EAE3C,MAAA,IAAA,OAAA,GAAkDA,MAAM;EAAjD+G,QAAAA,YAAY,WAAZA,YAAY;EAAEiL,QAAAA,gBAAgB,WAAhBA,gBAAgB;EAAE7K,QAAAA,OAAO,WAAPA,OAAO,CAAA;QAE9C,IAAIJ,YAAY,KAAKxL,SAAS,EAAE;EAC9Byb,QAAAA,SAAS,CAACU,aAAa,CAAC3Q,YAAY,EAAE;EACpCjC,UAAAA,iBAAiB,EAAEiS,UAAU,CAAChQ,YAAY,CAACgQ,UAAU,WAAQ,CAAC;EAC9DhS,UAAAA,iBAAiB,EAAEgS,UAAU,CAAChQ,YAAY,CAACgQ,UAAU,WAAQ,CAAC;EAC9D/R,UAAAA,mBAAmB,EAAE+R,UAAU,CAAChQ,YAAY,CAACgQ,UAAU,CAAQ,SAAA,CAAA,CAAA;WAChE,EAAE,KAAK,CAAC,CAAA;EACX,OAAA;QAEA,IAAI/E,gBAAgB,IAAI,IAAI,EAAE;EAC5B,QAAA,IAAI5R,OAAK,CAACxJ,UAAU,CAACob,gBAAgB,CAAC,EAAE;YACtChS,MAAM,CAACgS,gBAAgB,GAAG;EACxB9N,YAAAA,SAAS,EAAE8N,gBAAAA;aACZ,CAAA;EACH,SAAC,MAAM;EACLgF,UAAAA,SAAS,CAACU,aAAa,CAAC1F,gBAAgB,EAAE;cACxC1O,MAAM,EAAEyT,UAAU,CAAS,UAAA,CAAA;EAC3B7S,YAAAA,SAAS,EAAE6S,UAAU,CAAA,UAAA,CAAA;aACtB,EAAE,IAAI,CAAC,CAAA;EACV,SAAA;EACF,OAAA;;EAEA;EACA/W,MAAAA,MAAM,CAACwI,MAAM,GAAG,CAACxI,MAAM,CAACwI,MAAM,IAAI,IAAI,CAAC1B,QAAQ,CAAC0B,MAAM,IAAI,KAAK,EAAEvS,WAAW,EAAE,CAAA;;EAE9E;EACA,MAAA,IAAIoiB,cAAc,GAAGlR,OAAO,IAAI/G,OAAK,CAACzG,KAAK,CACzCwN,OAAO,CAACoB,MAAM,EACdpB,OAAO,CAACnH,MAAM,CAACwI,MAAM,CAAC,CACvB,CAAA;QAEDrB,OAAO,IAAI/G,OAAK,CAAC5H,OAAO,CACtB,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAC3D,UAACgQ,MAAM,EAAK;UACV,OAAOrB,OAAO,CAACqB,MAAM,CAAC,CAAA;EACxB,OAAC,CACF,CAAA;QAEDxI,MAAM,CAACmH,OAAO,GAAG+C,cAAY,CAAC5I,MAAM,CAAC+W,cAAc,EAAElR,OAAO,CAAC,CAAA;;EAE7D;QACA,IAAMmR,uBAAuB,GAAG,EAAE,CAAA;QAClC,IAAIC,8BAA8B,GAAG,IAAI,CAAA;QACzC,IAAI,CAACN,YAAY,CAAChY,OAAO,CAACzH,OAAO,CAAC,SAASggB,0BAA0B,CAACC,WAAW,EAAE;EACjF,QAAA,IAAI,OAAOA,WAAW,CAAC/T,OAAO,KAAK,UAAU,IAAI+T,WAAW,CAAC/T,OAAO,CAAC1E,MAAM,CAAC,KAAK,KAAK,EAAE;EACtF,UAAA,OAAA;EACF,SAAA;EAEAuY,QAAAA,8BAA8B,GAAGA,8BAA8B,IAAIE,WAAW,CAAChU,WAAW,CAAA;UAE1F6T,uBAAuB,CAACI,OAAO,CAACD,WAAW,CAAClU,SAAS,EAAEkU,WAAW,CAACjU,QAAQ,CAAC,CAAA;EAC9E,OAAC,CAAC,CAAA;QAEF,IAAMmU,wBAAwB,GAAG,EAAE,CAAA;QACnC,IAAI,CAACV,YAAY,CAAC/X,QAAQ,CAAC1H,OAAO,CAAC,SAASogB,wBAAwB,CAACH,WAAW,EAAE;UAChFE,wBAAwB,CAACnc,IAAI,CAACic,WAAW,CAAClU,SAAS,EAAEkU,WAAW,CAACjU,QAAQ,CAAC,CAAA;EAC5E,OAAC,CAAC,CAAA;EAEF,MAAA,IAAIqU,OAAO,CAAA;QACX,IAAIlgB,CAAC,GAAG,CAAC,CAAA;EACT,MAAA,IAAIK,GAAG,CAAA;QAEP,IAAI,CAACuf,8BAA8B,EAAE;UACnC,IAAMO,KAAK,GAAG,CAACvD,eAAe,CAACtgB,IAAI,CAAC,IAAI,CAAC,EAAEsG,SAAS,CAAC,CAAA;UACrDud,KAAK,CAACJ,OAAO,CAACrjB,KAAK,CAACyjB,KAAK,EAAER,uBAAuB,CAAC,CAAA;UACnDQ,KAAK,CAACtc,IAAI,CAACnH,KAAK,CAACyjB,KAAK,EAAEH,wBAAwB,CAAC,CAAA;UACjD3f,GAAG,GAAG8f,KAAK,CAACjgB,MAAM,CAAA;EAElBggB,QAAAA,OAAO,GAAG/H,OAAO,CAACzE,OAAO,CAACrM,MAAM,CAAC,CAAA;UAEjC,OAAOrH,CAAC,GAAGK,GAAG,EAAE;EACd6f,UAAAA,OAAO,GAAGA,OAAO,CAAClZ,IAAI,CAACmZ,KAAK,CAACngB,CAAC,EAAE,CAAC,EAAEmgB,KAAK,CAACngB,CAAC,EAAE,CAAC,CAAC,CAAA;EAChD,SAAA;EAEA,QAAA,OAAOkgB,OAAO,CAAA;EAChB,OAAA;QAEA7f,GAAG,GAAGsf,uBAAuB,CAACzf,MAAM,CAAA;QAEpC,IAAIkgB,SAAS,GAAG/Y,MAAM,CAAA;EAEtBrH,MAAAA,CAAC,GAAG,CAAC,CAAA;QAEL,OAAOA,CAAC,GAAGK,GAAG,EAAE;EACd,QAAA,IAAMggB,WAAW,GAAGV,uBAAuB,CAAC3f,CAAC,EAAE,CAAC,CAAA;EAChD,QAAA,IAAMsgB,UAAU,GAAGX,uBAAuB,CAAC3f,CAAC,EAAE,CAAC,CAAA;UAC/C,IAAI;EACFogB,UAAAA,SAAS,GAAGC,WAAW,CAACD,SAAS,CAAC,CAAA;WACnC,CAAC,OAAOlY,KAAK,EAAE;EACdoY,UAAAA,UAAU,CAACljB,IAAI,CAAC,IAAI,EAAE8K,KAAK,CAAC,CAAA;EAC5B,UAAA,MAAA;EACF,SAAA;EACF,OAAA;QAEA,IAAI;UACFgY,OAAO,GAAGtD,eAAe,CAACxf,IAAI,CAAC,IAAI,EAAEgjB,SAAS,CAAC,CAAA;SAChD,CAAC,OAAOlY,KAAK,EAAE;EACd,QAAA,OAAOiQ,OAAO,CAACxE,MAAM,CAACzL,KAAK,CAAC,CAAA;EAC9B,OAAA;EAEAlI,MAAAA,CAAC,GAAG,CAAC,CAAA;QACLK,GAAG,GAAG2f,wBAAwB,CAAC9f,MAAM,CAAA;QAErC,OAAOF,CAAC,GAAGK,GAAG,EAAE;EACd6f,QAAAA,OAAO,GAAGA,OAAO,CAAClZ,IAAI,CAACgZ,wBAAwB,CAAChgB,CAAC,EAAE,CAAC,EAAEggB,wBAAwB,CAAChgB,CAAC,EAAE,CAAC,CAAC,CAAA;EACtF,OAAA;EAEA,MAAA,OAAOkgB,OAAO,CAAA;EAChB,KAAA;EAAC,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,QAAA;MAAA,KAED,EAAA,SAAA,MAAA,CAAO7Y,MAAM,EAAE;QACbA,MAAM,GAAG2V,WAAW,CAAC,IAAI,CAAC7O,QAAQ,EAAE9G,MAAM,CAAC,CAAA;QAC3C,IAAM8R,QAAQ,GAAGrE,aAAa,CAACzN,MAAM,CAACuN,OAAO,EAAEvN,MAAM,CAACgE,GAAG,CAAC,CAAA;QAC1D,OAAOD,QAAQ,CAAC+N,QAAQ,EAAE9R,MAAM,CAAC2D,MAAM,EAAE3D,MAAM,CAACgS,gBAAgB,CAAC,CAAA;EACnE,KAAA;EAAC,GAAA,CAAA,CAAA,CAAA;EAAA,EAAA,OAAA,KAAA,CAAA;EAAA,CAGH,EAAA,CAAA;AACA5R,SAAK,CAAC5H,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS0gB,mBAAmB,CAAC1Q,MAAM,EAAE;EACvF;IACAuP,KAAK,CAACtiB,SAAS,CAAC+S,MAAM,CAAC,GAAG,UAASxE,GAAG,EAAEhE,MAAM,EAAE;MAC9C,OAAO,IAAI,CAACC,OAAO,CAAC0V,WAAW,CAAC3V,MAAM,IAAI,EAAE,EAAE;EAC5CwI,MAAAA,MAAM,EAANA,MAAM;EACNxE,MAAAA,GAAG,EAAHA,GAAG;EACH+B,MAAAA,IAAI,EAAE,CAAC/F,MAAM,IAAI,EAAE,EAAE+F,IAAAA;EACvB,KAAC,CAAC,CAAC,CAAA;KACJ,CAAA;EACH,CAAC,CAAC,CAAA;AAEF3F,SAAK,CAAC5H,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,SAAS2gB,qBAAqB,CAAC3Q,MAAM,EAAE;EAC7E;;IAEA,SAAS4Q,kBAAkB,CAACC,MAAM,EAAE;MAClC,OAAO,SAASC,UAAU,CAACtV,GAAG,EAAE+B,IAAI,EAAE/F,MAAM,EAAE;QAC5C,OAAO,IAAI,CAACC,OAAO,CAAC0V,WAAW,CAAC3V,MAAM,IAAI,EAAE,EAAE;EAC5CwI,QAAAA,MAAM,EAANA,MAAM;UACNrB,OAAO,EAAEkS,MAAM,GAAG;EAChB,UAAA,cAAc,EAAE,qBAAA;WACjB,GAAG,EAAE;EACNrV,QAAAA,GAAG,EAAHA,GAAG;EACH+B,QAAAA,IAAI,EAAJA,IAAAA;EACF,OAAC,CAAC,CAAC,CAAA;OACJ,CAAA;EACH,GAAA;EAEAgS,EAAAA,KAAK,CAACtiB,SAAS,CAAC+S,MAAM,CAAC,GAAG4Q,kBAAkB,EAAE,CAAA;IAE9CrB,KAAK,CAACtiB,SAAS,CAAC+S,MAAM,GAAG,MAAM,CAAC,GAAG4Q,kBAAkB,CAAC,IAAI,CAAC,CAAA;EAC7D,CAAC,CAAC,CAAA;AAEF,gBAAerB,KAAK;;EC5NpB;EACA;EACA;EACA;EACA;EACA;EACA;EANA,IAOMwB,WAAW,gBAAA,YAAA;EACf,EAAA,SAAA,WAAA,CAAYC,QAAQ,EAAE;EAAA,IAAA,eAAA,CAAA,IAAA,EAAA,WAAA,CAAA,CAAA;EACpB,IAAA,IAAI,OAAOA,QAAQ,KAAK,UAAU,EAAE;EAClC,MAAA,MAAM,IAAItX,SAAS,CAAC,8BAA8B,CAAC,CAAA;EACrD,KAAA;EAEA,IAAA,IAAIuX,cAAc,CAAA;MAElB,IAAI,CAACZ,OAAO,GAAG,IAAI/H,OAAO,CAAC,SAAS4I,eAAe,CAACrN,OAAO,EAAE;EAC3DoN,MAAAA,cAAc,GAAGpN,OAAO,CAAA;EAC1B,KAAC,CAAC,CAAA;MAEF,IAAM5K,KAAK,GAAG,IAAI,CAAA;;EAElB;EACA,IAAA,IAAI,CAACoX,OAAO,CAAClZ,IAAI,CAAC,UAAAsU,MAAM,EAAI;EAC1B,MAAA,IAAI,CAACxS,KAAK,CAACkY,UAAU,EAAE,OAAA;EAEvB,MAAA,IAAIhhB,CAAC,GAAG8I,KAAK,CAACkY,UAAU,CAAC9gB,MAAM,CAAA;EAE/B,MAAA,OAAOF,CAAC,EAAE,GAAG,CAAC,EAAE;EACd8I,QAAAA,KAAK,CAACkY,UAAU,CAAChhB,CAAC,CAAC,CAACsb,MAAM,CAAC,CAAA;EAC7B,OAAA;QACAxS,KAAK,CAACkY,UAAU,GAAG,IAAI,CAAA;EACzB,KAAC,CAAC,CAAA;;EAEF;EACA,IAAA,IAAI,CAACd,OAAO,CAAClZ,IAAI,GAAG,UAAAia,WAAW,EAAI;EACjC,MAAA,IAAIrH,QAAQ,CAAA;EACZ;EACA,MAAA,IAAMsG,OAAO,GAAG,IAAI/H,OAAO,CAAC,UAAAzE,OAAO,EAAI;EACrC5K,QAAAA,KAAK,CAAC0S,SAAS,CAAC9H,OAAO,CAAC,CAAA;EACxBkG,QAAAA,QAAQ,GAAGlG,OAAO,CAAA;EACpB,OAAC,CAAC,CAAC1M,IAAI,CAACia,WAAW,CAAC,CAAA;EAEpBf,MAAAA,OAAO,CAAC5E,MAAM,GAAG,SAAS3H,MAAM,GAAG;EACjC7K,QAAAA,KAAK,CAAC4P,WAAW,CAACkB,QAAQ,CAAC,CAAA;SAC5B,CAAA;EAED,MAAA,OAAOsG,OAAO,CAAA;OACf,CAAA;MAEDW,QAAQ,CAAC,SAASvF,MAAM,CAACnU,OAAO,EAAEE,MAAM,EAAEC,OAAO,EAAE;QACjD,IAAIwB,KAAK,CAACmT,MAAM,EAAE;EAChB;EACA,QAAA,OAAA;EACF,OAAA;QAEAnT,KAAK,CAACmT,MAAM,GAAG,IAAI1I,aAAa,CAACpM,OAAO,EAAEE,MAAM,EAAEC,OAAO,CAAC,CAAA;EAC1DwZ,MAAAA,cAAc,CAAChY,KAAK,CAACmT,MAAM,CAAC,CAAA;EAC9B,KAAC,CAAC,CAAA;EACJ,GAAA;;EAEA;EACF;EACA;EAFE,EAAA,YAAA,CAAA,WAAA,EAAA,CAAA;EAAA,IAAA,GAAA,EAAA,kBAAA;EAAA,IAAA,KAAA,EAGA,SAAmB,gBAAA,GAAA;QACjB,IAAI,IAAI,CAACA,MAAM,EAAE;UACf,MAAM,IAAI,CAACA,MAAM,CAAA;EACnB,OAAA;EACF,KAAA;;EAEA;EACF;EACA;EAFE,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,WAAA;MAAA,KAIA,EAAA,SAAA,SAAA,CAAU7E,QAAQ,EAAE;QAClB,IAAI,IAAI,CAAC6E,MAAM,EAAE;EACf7E,QAAAA,QAAQ,CAAC,IAAI,CAAC6E,MAAM,CAAC,CAAA;EACrB,QAAA,OAAA;EACF,OAAA;QAEA,IAAI,IAAI,CAAC+E,UAAU,EAAE;EACnB,QAAA,IAAI,CAACA,UAAU,CAACnd,IAAI,CAACuT,QAAQ,CAAC,CAAA;EAChC,OAAC,MAAM;EACL,QAAA,IAAI,CAAC4J,UAAU,GAAG,CAAC5J,QAAQ,CAAC,CAAA;EAC9B,OAAA;EACF,KAAA;;EAEA;EACF;EACA;EAFE,GAAA,EAAA;EAAA,IAAA,GAAA,EAAA,aAAA;MAAA,KAIA,EAAA,SAAA,WAAA,CAAYA,QAAQ,EAAE;EACpB,MAAA,IAAI,CAAC,IAAI,CAAC4J,UAAU,EAAE;EACpB,QAAA,OAAA;EACF,OAAA;QACA,IAAMzW,KAAK,GAAG,IAAI,CAACyW,UAAU,CAACle,OAAO,CAACsU,QAAQ,CAAC,CAAA;EAC/C,MAAA,IAAI7M,KAAK,KAAK,CAAC,CAAC,EAAE;UAChB,IAAI,CAACyW,UAAU,CAACE,MAAM,CAAC3W,KAAK,EAAE,CAAC,CAAC,CAAA;EAClC,OAAA;EACF,KAAA;;EAEA;EACF;EACA;EACA;EAHE,GAAA,CAAA,EAAA,CAAA;EAAA,IAAA,GAAA,EAAA,QAAA;EAAA,IAAA,KAAA,EAIA,SAAgB,MAAA,GAAA;EACd,MAAA,IAAI+Q,MAAM,CAAA;QACV,IAAMxS,KAAK,GAAG,IAAI8X,WAAW,CAAC,SAASC,QAAQ,CAACM,CAAC,EAAE;EACjD7F,QAAAA,MAAM,GAAG6F,CAAC,CAAA;EACZ,OAAC,CAAC,CAAA;QACF,OAAO;EACLrY,QAAAA,KAAK,EAALA,KAAK;EACLwS,QAAAA,MAAM,EAANA,MAAAA;SACD,CAAA;EACH,KAAA;EAAC,GAAA,CAAA,CAAA,CAAA;EAAA,EAAA,OAAA,WAAA,CAAA;EAAA,CAAA,EAAA,CAAA;AAGH,sBAAesF,WAAW;;ECtH1B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAASQ,MAAM,CAACC,QAAQ,EAAE;EACvC,EAAA,OAAO,SAAS5kB,IAAI,CAACuG,GAAG,EAAE;EACxB,IAAA,OAAOqe,QAAQ,CAAC3kB,KAAK,CAAC,IAAI,EAAEsG,GAAG,CAAC,CAAA;KACjC,CAAA;EACH;;ECvBA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAASse,YAAY,CAACC,OAAO,EAAE;IAC5C,OAAO9Z,OAAK,CAAC/I,QAAQ,CAAC6iB,OAAO,CAAC,IAAKA,OAAO,CAACD,YAAY,KAAK,IAAK,CAAA;EACnE;;ECbA,IAAME,cAAc,GAAG;EACrBC,EAAAA,QAAQ,EAAE,GAAG;EACbC,EAAAA,kBAAkB,EAAE,GAAG;EACvBC,EAAAA,UAAU,EAAE,GAAG;EACfC,EAAAA,UAAU,EAAE,GAAG;EACfC,EAAAA,EAAE,EAAE,GAAG;EACPC,EAAAA,OAAO,EAAE,GAAG;EACZC,EAAAA,QAAQ,EAAE,GAAG;EACbC,EAAAA,2BAA2B,EAAE,GAAG;EAChCC,EAAAA,SAAS,EAAE,GAAG;EACdC,EAAAA,YAAY,EAAE,GAAG;EACjBC,EAAAA,cAAc,EAAE,GAAG;EACnBC,EAAAA,WAAW,EAAE,GAAG;EAChBC,EAAAA,eAAe,EAAE,GAAG;EACpBC,EAAAA,MAAM,EAAE,GAAG;EACXC,EAAAA,eAAe,EAAE,GAAG;EACpBC,EAAAA,gBAAgB,EAAE,GAAG;EACrBC,EAAAA,KAAK,EAAE,GAAG;EACVC,EAAAA,QAAQ,EAAE,GAAG;EACbC,EAAAA,WAAW,EAAE,GAAG;EAChBC,EAAAA,QAAQ,EAAE,GAAG;EACbC,EAAAA,MAAM,EAAE,GAAG;EACXC,EAAAA,iBAAiB,EAAE,GAAG;EACtBC,EAAAA,iBAAiB,EAAE,GAAG;EACtBC,EAAAA,UAAU,EAAE,GAAG;EACfC,EAAAA,YAAY,EAAE,GAAG;EACjBC,EAAAA,eAAe,EAAE,GAAG;EACpBC,EAAAA,SAAS,EAAE,GAAG;EACdC,EAAAA,QAAQ,EAAE,GAAG;EACbC,EAAAA,gBAAgB,EAAE,GAAG;EACrBC,EAAAA,aAAa,EAAE,GAAG;EAClBC,EAAAA,2BAA2B,EAAE,GAAG;EAChCC,EAAAA,cAAc,EAAE,GAAG;EACnBC,EAAAA,QAAQ,EAAE,GAAG;EACbC,EAAAA,IAAI,EAAE,GAAG;EACTC,EAAAA,cAAc,EAAE,GAAG;EACnBC,EAAAA,kBAAkB,EAAE,GAAG;EACvBC,EAAAA,eAAe,EAAE,GAAG;EACpBC,EAAAA,UAAU,EAAE,GAAG;EACfC,EAAAA,oBAAoB,EAAE,GAAG;EACzBC,EAAAA,mBAAmB,EAAE,GAAG;EACxBC,EAAAA,iBAAiB,EAAE,GAAG;EACtBC,EAAAA,SAAS,EAAE,GAAG;EACdC,EAAAA,kBAAkB,EAAE,GAAG;EACvBC,EAAAA,mBAAmB,EAAE,GAAG;EACxBC,EAAAA,MAAM,EAAE,GAAG;EACXC,EAAAA,gBAAgB,EAAE,GAAG;EACrBC,EAAAA,QAAQ,EAAE,GAAG;EACbC,EAAAA,eAAe,EAAE,GAAG;EACpBC,EAAAA,oBAAoB,EAAE,GAAG;EACzBC,EAAAA,eAAe,EAAE,GAAG;EACpBC,EAAAA,2BAA2B,EAAE,GAAG;EAChCC,EAAAA,0BAA0B,EAAE,GAAG;EAC/BC,EAAAA,mBAAmB,EAAE,GAAG;EACxBC,EAAAA,cAAc,EAAE,GAAG;EACnBC,EAAAA,UAAU,EAAE,GAAG;EACfC,EAAAA,kBAAkB,EAAE,GAAG;EACvBC,EAAAA,cAAc,EAAE,GAAG;EACnBC,EAAAA,uBAAuB,EAAE,GAAG;EAC5BC,EAAAA,qBAAqB,EAAE,GAAG;EAC1BC,EAAAA,mBAAmB,EAAE,GAAG;EACxBC,EAAAA,YAAY,EAAE,GAAG;EACjBC,EAAAA,WAAW,EAAE,GAAG;EAChBC,EAAAA,6BAA6B,EAAE,GAAA;EACjC,CAAC,CAAA;EAED1oB,MAAM,CAACgR,OAAO,CAAC2T,cAAc,CAAC,CAAC3hB,OAAO,CAAC,UAAkB,IAAA,EAAA;EAAA,EAAA,IAAA,KAAA,GAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAAA;MAAhBS,GAAG,GAAA,KAAA,CAAA,CAAA,CAAA;MAAEyB,KAAK,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA;EACjDyf,EAAAA,cAAc,CAACzf,KAAK,CAAC,GAAGzB,GAAG,CAAA;EAC7B,CAAC,CAAC,CAAA;AAEF,yBAAekhB,cAAc;;EClD7B;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASgE,cAAc,CAACC,aAAa,EAAE;EACrC,EAAA,IAAM1kB,OAAO,GAAG,IAAIqe,OAAK,CAACqG,aAAa,CAAC,CAAA;IACxC,IAAMC,QAAQ,GAAGppB,IAAI,CAAC8iB,OAAK,CAACtiB,SAAS,CAACwK,OAAO,EAAEvG,OAAO,CAAC,CAAA;;EAEvD;IACA0G,OAAK,CAACrG,MAAM,CAACskB,QAAQ,EAAEtG,OAAK,CAACtiB,SAAS,EAAEiE,OAAO,EAAE;EAAChB,IAAAA,UAAU,EAAE,IAAA;EAAI,GAAC,CAAC,CAAA;;EAEpE;IACA0H,OAAK,CAACrG,MAAM,CAACskB,QAAQ,EAAE3kB,OAAO,EAAE,IAAI,EAAE;EAAChB,IAAAA,UAAU,EAAE,IAAA;EAAI,GAAC,CAAC,CAAA;;EAEzD;EACA2lB,EAAAA,QAAQ,CAACnoB,MAAM,GAAG,SAASA,MAAM,CAAC8hB,cAAc,EAAE;MAChD,OAAOmG,cAAc,CAACxI,WAAW,CAACyI,aAAa,EAAEpG,cAAc,CAAC,CAAC,CAAA;KAClE,CAAA;EAED,EAAA,OAAOqG,QAAQ,CAAA;EACjB,CAAA;;EAEA;AACA,MAAMC,KAAK,GAAGH,cAAc,CAACrX,UAAQ,EAAC;;EAEtC;EACAwX,KAAK,CAACvG,KAAK,GAAGA,OAAK,CAAA;;EAEnB;EACAuG,KAAK,CAACpS,aAAa,GAAGA,aAAa,CAAA;EACnCoS,KAAK,CAAC/E,WAAW,GAAGA,aAAW,CAAA;EAC/B+E,KAAK,CAACtS,QAAQ,GAAGA,QAAQ,CAAA;EACzBsS,KAAK,CAACxH,OAAO,GAAGA,OAAO,CAAA;EACvBwH,KAAK,CAACvc,UAAU,GAAGA,UAAU,CAAA;;EAE7B;EACAuc,KAAK,CAACze,UAAU,GAAGA,UAAU,CAAA;;EAE7B;EACAye,KAAK,CAACC,MAAM,GAAGD,KAAK,CAACpS,aAAa,CAAA;;EAElC;EACAoS,KAAK,CAACE,GAAG,GAAG,SAASA,GAAG,CAACC,QAAQ,EAAE;EACjC,EAAA,OAAO3N,OAAO,CAAC0N,GAAG,CAACC,QAAQ,CAAC,CAAA;EAC9B,CAAC,CAAA;EAEDH,KAAK,CAACvE,MAAM,GAAGA,MAAM,CAAA;;EAErB;EACAuE,KAAK,CAACrE,YAAY,GAAGA,YAAY,CAAA;;EAEjC;EACAqE,KAAK,CAAC3I,WAAW,GAAGA,WAAW,CAAA;EAE/B2I,KAAK,CAACpU,YAAY,GAAGA,cAAY,CAAA;EAEjCoU,KAAK,CAACI,UAAU,GAAG,UAAA7oB,KAAK,EAAA;EAAA,EAAA,OAAIuQ,cAAc,CAAChG,OAAK,CAAC3D,UAAU,CAAC5G,KAAK,CAAC,GAAG,IAAIsC,QAAQ,CAACtC,KAAK,CAAC,GAAGA,KAAK,CAAC,CAAA;EAAA,CAAA,CAAA;EAEjGyoB,KAAK,CAACxJ,UAAU,GAAGC,QAAQ,CAACD,UAAU,CAAA;EAEtCwJ,KAAK,CAACnE,cAAc,GAAGA,gBAAc,CAAA;EAErCmE,KAAK,CAAA,SAAA,CAAQ,GAAGA,KAAK;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/axios/dist/axios.min.js b/node_modules/axios/dist/axios.min.js new file mode 100644 index 00000000..b58abf2e --- /dev/null +++ b/node_modules/axios/dist/axios.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).axios=t()}(this,(function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:{},a=i.allOwnKeys,s=void 0!==a&&a;if(null!=e)if("object"!==n(e)&&(e=[e]),S(e))for(r=0,o=e.length;r0;)if(t===(r=n[o]).toLowerCase())return r;return null}var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,I=function(e){return!R(e)&&e!==B};var q,z=(q="undefined"!=typeof Uint8Array&&b(Uint8Array),function(e){return q&&e instanceof q}),M=E("HTMLFormElement"),H=function(e){var t=Object.prototype.hasOwnProperty;return function(e,r){return t.call(e,r)}}(),J=E("RegExp"),G=function(e,t){var r=Object.getOwnPropertyDescriptors(e),n={};U(r,(function(r,o){var i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)},W="abcdefghijklmnopqrstuvwxyz",K="0123456789",V={DIGIT:K,ALPHA:W,ALPHA_DIGIT:W+W.toUpperCase()+K};var X=E("AsyncFunction"),$={isArray:S,isArrayBuffer:A,isBuffer:function(e){return null!==e&&!R(e)&&null!==e.constructor&&!R(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:function(e){var t;return e&&("function"==typeof FormData&&e instanceof FormData||x(e.append)&&("formdata"===(t=w(e))||"object"===t&&x(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&A(e.buffer)},isString:j,isNumber:T,isBoolean:function(e){return!0===e||!1===e},isObject:P,isPlainObject:N,isUndefined:R,isDate:k,isFile:_,isBlob:L,isRegExp:J,isFunction:x,isStream:function(e){return P(e)&&x(e.pipe)},isURLSearchParams:F,isTypedArray:z,isFileList:C,forEach:U,merge:function e(){for(var t=I(this)&&this||{},r=t.caseless,n={},o=function(t,o){var i=r&&D(n,o)||o;N(n[i])&&N(t)?n[i]=e(n[i],t):N(t)?n[i]=e({},t):S(t)?n[i]=t.slice():n[i]=t},i=0,a=arguments.length;i3&&void 0!==arguments[3]?arguments[3]:{},o=n.allOwnKeys;return U(t,(function(t,n){r&&x(t)?e[n]=y(t,r):e[n]=t}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r,n){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&b(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:w,kindOfTest:E,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;if(S(e))return e;var t=e.length;if(!T(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},forEachEntry:function(e,t){for(var r,n=(e&&e[Symbol.iterator]).call(e);(r=n.next())&&!r.done;){var o=r.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var r,n=[];null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:M,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:G,freezeMethods:function(e){G(e,(function(t,r){if(x(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;var n=e[r];x(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:function(e,t){var r={},n=function(e){e.forEach((function(e){r[e]=!0}))};return S(e)?n(e):n(String(e).split(t)),r},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))},noop:function(){},toFiniteNumber:function(e,t){return e=+e,Number.isFinite(e)?e:t},findKey:D,global:B,isContextDefined:I,ALPHABET:V,generateString:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V.ALPHA_DIGIT,r="",n=t.length;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&x(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:function(e){var t=new Array(10);return function e(r,n){if(P(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[n]=r;var o=S(r)?[]:{};return U(r,(function(t,r){var i=e(t,n+1);!R(i)&&(o[r]=i)})),t[n]=void 0,o}}return r}(e,0)},isAsyncFn:X,isThenable:function(e){return e&&(P(e)||x(e))&&x(e.then)&&x(e.catch)}};function Q(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}$.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Y=Q.prototype,Z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){Z[e]={value:e}})),Object.defineProperties(Q,Z),Object.defineProperty(Y,"isAxiosError",{value:!0}),Q.from=function(e,t,r,n,o,i){var a=Object.create(Y);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e})),Q.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function ee(e){return $.isPlainObject(e)||$.isArray(e)}function te(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function re(e,t,r){return e?e.concat(t).map((function(e,t){return e=te(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}var ne=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)}));function oe(e,t,r){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var o=(r=$.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,s=r.indexes,u=(r.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!u&&$.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){var u=e;if(e&&!i&&"object"===n(e))if($.endsWith(r,"{}"))r=o?r:r.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(ee)}(e)||($.isFileList(e)||$.endsWith(r,"[]"))&&(u=$.toArray(e)))return r=te(r),u.forEach((function(e,n){!$.isUndefined(e)&&null!==e&&t.append(!0===s?re([r],n,a):null===s?r:r+"[]",c(e))})),!1;return!!ee(e)||(t.append(re(i,r,a),c(e)),!1)}var l=[],h=Object.assign(ne,{defaultVisitor:f,convertValue:c,isVisitable:ee});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!$.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),$.forEach(r,(function(r,o){!0===(!($.isUndefined(r)||null===r)&&i.call(t,r,$.isString(o)?o.trim():o,n,h))&&e(r,n?n.concat(o):[o])})),l.pop()}}(e),t}function ie(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ae(e,t){this._pairs=[],e&&oe(e,this,t)}var se=ae.prototype;function ue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ce(e,t,r){if(!t)return e;var n,o=r&&r.encode||ue,i=r&&r.serialize;if(n=i?i(t,r):$.isURLSearchParams(t)?t.toString():new ae(t,r).toString(o)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}se.append=function(e,t){this._pairs.push([e,t])},se.toString=function(e){var t=e?function(t){return e.call(this,t,ie)}:ie;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var fe,le=function(){function e(){i(this,e),this.handlers=[]}return s(e,[{key:"use",value:function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),he={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},de={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ae,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},pe="undefined"!=typeof window&&"undefined"!=typeof document,ve=(fe="undefined"!=typeof navigator&&navigator.product,pe&&["ReactNative","NativeScript","NS"].indexOf(fe)<0),ye="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,me=t(t({},Object.freeze({__proto__:null,hasBrowserEnv:pe,hasStandardBrowserWebWorkerEnv:ye,hasStandardBrowserEnv:ve})),de);function ge(e){function t(e,r,n,o){var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&$.isArray(n)?n.length:i,s?($.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&$.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&$.isArray(n[i])&&(n[i]=function(e){var t,r,n={},o=Object.keys(e),i=o.length;for(t=0;t-1,i=$.isObject(e);if(i&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return o?JSON.stringify(ge(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return oe(e,new me.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return me.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=$.isFileList(e))||n.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return oe(r?{"files[]":e}:e,a&&new a,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,r){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||be.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&$.isString(e)&&(r&&!this.responseType||n)){var o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],(function(e){be.headers[e]={}}));var we=be,Ee=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oe=Symbol("internals");function Se(e){return e&&String(e).trim().toLowerCase()}function Re(e){return!1===e||null==e?e:$.isArray(e)?e.map(Re):String(e)}function Ae(e,t,r,n,o){return $.isFunction(n)?n.call(this,t,r):(o&&(t=r),$.isString(t)?$.isString(n)?-1!==t.indexOf(n):$.isRegExp(n)?n.test(t):void 0:void 0)}var je=function(e,t){function r(e){i(this,r),e&&this.set(e)}return s(r,[{key:"set",value:function(e,t,r){var n=this;function o(e,t,r){var o=Se(t);if(!o)throw new Error("header name must be a non-empty string");var i=$.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=Re(e))}var i,a,s,u,c,f=function(e,t){return $.forEach(e,(function(e,r){return o(e,r,t)}))};return $.isPlainObject(e)||e instanceof this.constructor?f(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?f((c={},(i=e)&&i.split("\n").forEach((function(e){u=e.indexOf(":"),a=e.substring(0,u).trim().toLowerCase(),s=e.substring(u+1).trim(),!a||c[a]&&Ee[a]||("set-cookie"===a?c[a]?c[a].push(s):c[a]=[s]:c[a]=c[a]?c[a]+", "+s:s)})),c),t):null!=e&&o(t,e,r),this}},{key:"get",value:function(e,t){if(e=Se(e)){var r=$.findKey(this,e);if(r){var n=this[r];if(!t)return n;if(!0===t)return function(e){for(var t,r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=n.exec(e);)r[t[1]]=t[2];return r}(n);if($.isFunction(t))return t.call(this,n,r);if($.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Se(e)){var r=$.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ae(0,this[r],r,t))}return!1}},{key:"delete",value:function(e,t){var r=this,n=!1;function o(e){if(e=Se(e)){var o=$.findKey(r,e);!o||t&&!Ae(0,r[o],o,t)||(delete r[o],n=!0)}}return $.isArray(e)?e.forEach(o):o(e),n}},{key:"clear",value:function(e){for(var t=Object.keys(this),r=t.length,n=!1;r--;){var o=t[r];e&&!Ae(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}},{key:"normalize",value:function(e){var t=this,r={};return $.forEach(this,(function(n,o){var i=$.findKey(r,o);if(i)return t[i]=Re(n),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Re(n),r[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n1?r-1:0),o=1;o1?"since :\n"+s.map(Ue).join("\n"):" "+Ue(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Ie(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ne(null,e)}function qe(e){return Ie(e),e.headers=xe.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Be(e.adapter||we.adapter)(e).then((function(t){return Ie(e),t.data=Te.call(e,e.transformResponse,t),t.headers=xe.from(t.headers),t}),(function(t){return Pe(t)||(Ie(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=xe.from(t.response.headers))),Promise.reject(t)}))}var ze=function(e){return e instanceof xe?e.toJSON():e};function Me(e,t){t=t||{};var r={};function n(e,t,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function o(e,t,r){return $.isUndefined(t)?$.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function i(e,t){if(!$.isUndefined(t))return n(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return o(ze(e),ze(t),!0)}};return $.forEach(Object.keys(Object.assign({},e,t)),(function(n){var i=u[n]||o,a=i(e[n],t[n],n);$.isUndefined(a)&&i!==s||(r[n]=a)})),r}var He="1.6.7",Je={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Je[e]=function(r){return n(r)===e||"a"+(t<1?"n ":" ")+e}}));var Ge={};Je.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.7] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new Q(n(o," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!Ge[o]&&(Ge[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var We={assertOptions:function(e,t,r){if("object"!==n(e))throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);for(var o=Object.keys(e),i=o.length;i-- >0;){var a=o[i],s=t[a];if(s){var u=e[a],c=void 0===u||s(u,a,e);if(!0!==c)throw new Q("option "+a+" must be "+c,Q.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Q("Unknown option "+a,Q.ERR_BAD_OPTION)}},validators:Je},Ke=We.validators,Ve=function(){function e(t){i(this,e),this.defaults=t,this.interceptors={request:new le,response:new le}}var t,n;return s(e,[{key:"request",value:(t=r().mark((function e(t,n){var o,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error&&(Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error,i=o.stack?o.stack.replace(/^.+\n/,""):"",e.t0.stack?i&&!String(e.t0.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(e.t0.stack+="\n"+i):e.t0.stack=i),e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])})),n=function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)}))},function(e,t){return n.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=Me(this.defaults,t),n=r.transitional,o=r.paramsSerializer,i=r.headers;void 0!==n&&We.assertOptions(n,{silentJSONParsing:Ke.transitional(Ke.boolean),forcedJSONParsing:Ke.transitional(Ke.boolean),clarifyTimeoutError:Ke.transitional(Ke.boolean)},!1),null!=o&&($.isFunction(o)?t.paramsSerializer={serialize:o}:We.assertOptions(o,{encode:Ke.function,serialize:Ke.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&$.merge(i.common,i[t.method]);i&&$.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]})),t.headers=xe.concat(a,i);var s=[],u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var c,f=[];this.interceptors.response.forEach((function(e){f.push(e.fulfilled,e.rejected)}));var l,h=0;if(!u){var d=[qe.bind(this),void 0];for(d.unshift.apply(d,s),d.push.apply(d,f),l=d.length,c=Promise.resolve(t);h0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},t((function(e,t,o){n.reason||(n.reason=new Ne(e,t,o),r(n.reason))}))}return s(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}}],[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}]),e}();var Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qe).forEach((function(e){var t=c(e,2),r=t[0],n=t[1];Qe[n]=r}));var Ye=Qe;var Ze=function e(t){var r=new Xe(t),n=y(Xe.prototype.request,r);return $.extend(n,Xe.prototype,r,{allOwnKeys:!0}),$.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Me(t,r))},n}(we);return Ze.Axios=Xe,Ze.CanceledError=Ne,Ze.CancelToken=$e,Ze.isCancel=Pe,Ze.VERSION=He,Ze.toFormData=oe,Ze.AxiosError=Q,Ze.Cancel=Ze.CanceledError,Ze.all=function(e){return Promise.all(e)},Ze.spread=function(e){return function(t){return e.apply(null,t)}},Ze.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},Ze.mergeConfig=Me,Ze.AxiosHeaders=xe,Ze.formToJSON=function(e){return ge($.isHTMLForm(e)?new FormData(e):e)},Ze.getAdapter=Be,Ze.HttpStatusCode=Ye,Ze.default=Ze,Ze})); +//# sourceMappingURL=axios.min.js.map diff --git a/node_modules/axios/dist/axios.min.js.map b/node_modules/axios/dist/axios.min.js.map new file mode 100644 index 00000000..26ffe031 --- /dev/null +++ b/node_modules/axios/dist/axios.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.min.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/core/AxiosError.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/platform/common/utils.js","../lib/defaults/transitional.js","../lib/platform/browser/index.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/index.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/toURLEncodedForm.js","../lib/helpers/parseHeaders.js","../lib/core/AxiosHeaders.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/helpers/cookies.js","../lib/core/buildFullPath.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/helpers/isURLSameOrigin.js","../lib/adapters/xhr.js","../lib/helpers/speedometer.js","../lib/adapters/adapters.js","../lib/helpers/null.js","../lib/core/settle.js","../lib/helpers/parseProtocol.js","../lib/core/dispatchRequest.js","../lib/core/mergeConfig.js","../lib/env/data.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n"],"names":["bind","fn","thisArg","apply","arguments","cache","toString","Object","prototype","getPrototypeOf","kindOf","create","thing","str","call","slice","toLowerCase","kindOfTest","type","typeOfTest","_typeof","isArray","Array","isUndefined","isArrayBuffer","isString","isFunction","isNumber","isObject","isPlainObject","val","Symbol","toStringTag","iterator","isDate","isFile","isBlob","isFileList","isURLSearchParams","forEach","obj","i","l","_ref","length","undefined","_ref$allOwnKeys","allOwnKeys","key","keys","getOwnPropertyNames","len","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","TypedArray","isTypedArray","Uint8Array","isHTMLForm","hasOwnProperty","_ref4","prop","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","ALPHA","DIGIT","ALPHABET","ALPHA_DIGIT","toUpperCase","isAsyncFn","utils$1","isBuffer","constructor","isFormData","kind","FormData","append","isArrayBufferView","ArrayBuffer","isView","buffer","isBoolean","isStream","pipe","merge","this","caseless","result","assignValue","targetKey","extend","a","b","_ref3","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","String","lastIndex","indexOf","toArray","arr","forEachEntry","next","done","pair","matchAll","regExp","matches","exec","push","hasOwnProp","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","toCamelCase","m","p1","p2","noop","toFiniteNumber","defaultValue","Number","isFinite","generateString","size","alphabet","Math","random","isSpecCompliantForm","toJSONObject","stack","visit","source","target","reducedValue","isThenable","then","AxiosError","message","code","config","request","response","captureStackTrace","utils","toJSON","description","number","fileName","lineNumber","columnNumber","status","from","error","customProps","axiosError","cause","isVisitable","removeBrackets","renderKey","path","dots","concat","map","token","join","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Blob","convertValue","toISOString","Buffer","JSON","stringify","some","isFlatArray","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","buildURL","url","serializedParams","_encode","serializeFn","serialize","hashmarkIndex","encoder","product","InterceptorManager$1","InterceptorManager","_classCallCheck","handlers","_createClass","fulfilled","rejected","synchronous","runWhen","id","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","isBrowser","classes","URLSearchParams","protocols","hasBrowserEnv","document","hasStandardBrowserEnv","navigator","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","platform","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","entries","parsePropPath","defaults","transitional","adapter","transformRequest","data","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","isNode","toURLEncodedForm","formSerializer","_FormData","env","rawValue","parser","parse","e","stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","method","defaults$1","ignoreDuplicateOf","$internals","normalizeHeader","header","normalizeValue","matchHeaderValue","isHeaderNameFilter","AxiosHeaders","_Symbol$iterator","_Symbol$toStringTag","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","rawHeaders","parsed","setHeaders","line","substring","tokens","tokensRE","parseTokens","matcher","deleted","deleteHeader","format","normalized","w","char","formatHeader","_this$constructor","_len","targets","asStrings","_ref2","_slicedToArray","get","first","computed","_len2","_key2","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","configurable","buildAccessors","accessor","mapped","headerValue","AxiosHeaders$1","transformData","fns","normalize","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","write","expires","domain","secure","cookie","Date","toGMTString","read","RegExp","decodeURIComponent","remove","now","buildFullPath","baseURL","requestedURL","relativeURL","combineURLs","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","samplesCount","min","firstSampleTS","bytes","timestamps","head","tail","chunkLength","startedAt","bytesCount","passed","round","speedometer","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","event","knownAdapters","http","xhr","XMLHttpRequest","Promise","resolve","reject","onCanceled","requestData","requestHeaders","withXSRFToken","cancelToken","unsubscribe","signal","removeEventListener","Boolean","auth","username","password","unescape","btoa","fullPath","onloadend","responseHeaders","getAllResponseHeaders","ERR_BAD_REQUEST","floor","settle","err","responseText","statusText","open","paramsSerializer","onreadystatechange","readyState","responseURL","setTimeout","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","isURLSameOrigin","xsrfValue","cookies","setRequestHeader","withCredentials","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","subscribe","aborted","send","renderReason","reason","isResolvedHandle","adapters","nameOrAdapter","rejectedReasons","reasons","state","throwIfCancellationRequested","throwIfRequested","dispatchRequest","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","timeoutMessage","decompress","beforeRedirect","transport","httpAgent","httpsAgent","socketPath","responseEncoding","configValue","VERSION","validators","deprecatedWarnings","validators$1","validator","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","_request2","_regeneratorRuntime","mark","_callee","configOrUrl","dummy","wrap","_context","prev","_request","abrupt","sent","t0","stop","_x","_x2","_config","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","promise","responseInterceptorChain","chain","newConfig","onFulfilled","onRejected","generateHTTPMethod","isForm","Axios$1","CancelToken$1","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","splice","c","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","HttpStatusCode$1","axios","createInstance","defaultConfig","instance","Cancel","all","promises","spread","callback","isAxiosError","payload","formToJSON","getAdapter"],"mappings":"+sSAEe,SAASA,EAAKC,EAAIC,GAC/B,OAAO,WACL,OAAOD,EAAGE,MAAMD,EAASE,WAE7B,CCAA,IAGgBC,EAHTC,EAAYC,OAAOC,UAAnBF,SACAG,EAAkBF,OAAlBE,eAEDC,GAAUL,EAGbE,OAAOI,OAAO,MAHQ,SAAAC,GACrB,IAAMC,EAAMP,EAASQ,KAAKF,GAC1B,OAAOP,EAAMQ,KAASR,EAAMQ,GAAOA,EAAIE,MAAM,GAAI,GAAGC,iBAGlDC,EAAa,SAACC,GAElB,OADAA,EAAOA,EAAKF,cACL,SAACJ,GAAK,OAAKF,EAAOE,KAAWM,CAAI,CAC1C,EAEMC,EAAa,SAAAD,GAAI,OAAI,SAAAN,GAAK,OAAIQ,EAAOR,KAAUM,CAAI,CAAA,EASlDG,EAAWC,MAAXD,QASDE,EAAcJ,EAAW,aAqB/B,IAAMK,EAAgBP,EAAW,eA2BjC,IAAMQ,EAAWN,EAAW,UAQtBO,EAAaP,EAAW,YASxBQ,EAAWR,EAAW,UAStBS,EAAW,SAAChB,GAAK,OAAe,OAAVA,GAAmC,WAAjBQ,EAAOR,EAAkB,EAiBjEiB,EAAgB,SAACC,GACrB,GAAoB,WAAhBpB,EAAOoB,GACT,OAAO,EAGT,IAAMtB,EAAYC,EAAeqB,GACjC,QAAsB,OAAdtB,GAAsBA,IAAcD,OAAOC,WAAkD,OAArCD,OAAOE,eAAeD,IAA0BuB,OAAOC,eAAeF,GAAUC,OAAOE,YAAYH,EACrK,EASMI,EAASjB,EAAW,QASpBkB,EAASlB,EAAW,QASpBmB,EAASnB,EAAW,QASpBoB,EAAapB,EAAW,YAsCxBqB,EAAoBrB,EAAW,mBA2BrC,SAASsB,EAAQC,EAAKvC,GAA+B,IAM/CwC,EACAC,EAP+CC,EAAAvC,UAAAwC,OAAA,QAAAC,IAAAzC,UAAA,GAAAA,UAAA,GAAJ,CAAE,EAAA0C,EAAAH,EAAxBI,WAAAA,cAAkBD,EAE3C,GAAIN,QAaJ,GALmB,WAAfpB,EAAOoB,KAETA,EAAM,CAACA,IAGLnB,EAAQmB,GAEV,IAAKC,EAAI,EAAGC,EAAIF,EAAII,OAAQH,EAAIC,EAAGD,IACjCxC,EAAGa,KAAK,KAAM0B,EAAIC,GAAIA,EAAGD,OAEtB,CAEL,IAEIQ,EAFEC,EAAOF,EAAaxC,OAAO2C,oBAAoBV,GAAOjC,OAAO0C,KAAKT,GAClEW,EAAMF,EAAKL,OAGjB,IAAKH,EAAI,EAAGA,EAAIU,EAAKV,IACnBO,EAAMC,EAAKR,GACXxC,EAAGa,KAAK,KAAM0B,EAAIQ,GAAMA,EAAKR,EAEjC,CACF,CAEA,SAASY,EAAQZ,EAAKQ,GACpBA,EAAMA,EAAIhC,cAIV,IAHA,IAEIqC,EAFEJ,EAAO1C,OAAO0C,KAAKT,GACrBC,EAAIQ,EAAKL,OAENH,KAAM,GAEX,GAAIO,KADJK,EAAOJ,EAAKR,IACKzB,cACf,OAAOqC,EAGX,OAAO,IACT,CAEA,IAAMC,EAEsB,oBAAfC,WAAmCA,WACvB,oBAATC,KAAuBA,KAA0B,oBAAXC,OAAyBA,OAASC,OAGlFC,EAAmB,SAACC,GAAO,OAAMrC,EAAYqC,IAAYA,IAAYN,CAAO,EAoDlF,IA8HsBO,EAAhBC,GAAgBD,EAKG,oBAAfE,YAA8BtD,EAAesD,YAH9C,SAAAnD,GACL,OAAOiD,GAAcjD,aAAiBiD,IA6CpCG,EAAa/C,EAAW,mBAWxBgD,EAAkB,SAAAC,GAAA,IAAED,EAAmE1D,OAAOC,UAA1EyD,eAAc,OAAM,SAACzB,EAAK2B,GAAI,OAAKF,EAAenD,KAAK0B,EAAK2B,EAAK,CAAA,CAAnE,GASlBC,EAAWnD,EAAW,UAEtBoD,EAAoB,SAAC7B,EAAK8B,GAC9B,IAAMC,EAAchE,OAAOiE,0BAA0BhC,GAC/CiC,EAAqB,CAAA,EAE3BlC,EAAQgC,GAAa,SAACG,EAAYC,GAChC,IAAIC,GAC2C,KAA1CA,EAAMN,EAAQI,EAAYC,EAAMnC,MACnCiC,EAAmBE,GAAQC,GAAOF,EAEtC,IAEAnE,OAAOsE,iBAAiBrC,EAAKiC,EAC/B,EAsDMK,EAAQ,6BAERC,EAAQ,aAERC,EAAW,CACfD,MAAAA,EACAD,MAAAA,EACAG,YAAaH,EAAQA,EAAMI,cAAgBH,GAwB7C,IA+BMI,EAAYlE,EAAW,iBAKdmE,EAAA,CACb/D,QAAAA,EACAG,cAAAA,EACA6D,SAnnBF,SAAkBvD,GAChB,OAAe,OAARA,IAAiBP,EAAYO,IAA4B,OAApBA,EAAIwD,cAAyB/D,EAAYO,EAAIwD,cACpF5D,EAAWI,EAAIwD,YAAYD,WAAavD,EAAIwD,YAAYD,SAASvD,EACxE,EAinBEyD,WAreiB,SAAC3E,GAClB,IAAI4E,EACJ,OAAO5E,IACgB,mBAAb6E,UAA2B7E,aAAiB6E,UAClD/D,EAAWd,EAAM8E,UACY,cAA1BF,EAAO9E,EAAOE,KAEL,WAAT4E,GAAqB9D,EAAWd,EAAMN,WAAkC,sBAArBM,EAAMN,YAIlE,EA2dEqF,kBA/lBF,SAA2B7D,GAOzB,MAL4B,oBAAhB8D,aAAiCA,YAAYC,OAC9CD,YAAYC,OAAO/D,GAElBA,GAASA,EAAIgE,QAAYtE,EAAcM,EAAIgE,OAGzD,EAwlBErE,SAAAA,EACAE,SAAAA,EACAoE,UA/iBgB,SAAAnF,GAAK,OAAc,IAAVA,IAA4B,IAAVA,CAAe,EAgjB1DgB,SAAAA,EACAC,cAAAA,EACAN,YAAAA,EACAW,OAAAA,EACAC,OAAAA,EACAC,OAAAA,EACAgC,SAAAA,EACA1C,WAAAA,EACAsE,SA3fe,SAAClE,GAAG,OAAKF,EAASE,IAAQJ,EAAWI,EAAImE,KAAK,EA4f7D3D,kBAAAA,EACAwB,aAAAA,EACAzB,WAAAA,EACAE,QAAAA,EACA2D,MA/XF,SAASA,IAgBP,IAfA,IAAmBvC,EAAAA,EAAiBwC,OAASA,MAAQ,CAAE,EAAhDC,IAAAA,SACDC,EAAS,CAAA,EACTC,EAAc,SAACxE,EAAKkB,GACxB,IAAMuD,EAAYH,GAAYhD,EAAQiD,EAAQrD,IAAQA,EAClDnB,EAAcwE,EAAOE,KAAe1E,EAAcC,GACpDuE,EAAOE,GAAaL,EAAMG,EAAOE,GAAYzE,GACpCD,EAAcC,GACvBuE,EAAOE,GAAaL,EAAM,CAAE,EAAEpE,GACrBT,EAAQS,GACjBuE,EAAOE,GAAazE,EAAIf,QAExBsF,EAAOE,GAAazE,GAIfW,EAAI,EAAGC,EAAItC,UAAUwC,OAAQH,EAAIC,EAAGD,IAC3CrC,UAAUqC,IAAMF,EAAQnC,UAAUqC,GAAI6D,GAExC,OAAOD,CACT,EA4WEG,OAhWa,SAACC,EAAGC,EAAGxG,GAA8B,IAAAyG,EAAAvG,UAAAwC,OAAA,QAAAC,IAAAzC,UAAA,GAAAA,UAAA,GAAP,CAAE,EAAf2C,IAAAA,WAQ9B,OAPAR,EAAQmE,GAAG,SAAC5E,EAAKkB,GACX9C,GAAWwB,EAAWI,GACxB2E,EAAEzD,GAAOhD,EAAK8B,EAAK5B,GAEnBuG,EAAEzD,GAAOlB,CAEb,GAAG,CAACiB,WAAAA,IACG0D,CACT,EAwVEG,KA5dW,SAAC/F,GAAG,OAAKA,EAAI+F,KACxB/F,EAAI+F,OAAS/F,EAAIgG,QAAQ,qCAAsC,GAAG,EA4dlEC,SAhVe,SAACC,GAIhB,OAH8B,QAA1BA,EAAQC,WAAW,KACrBD,EAAUA,EAAQhG,MAAM,IAEnBgG,CACT,EA4UEE,SAjUe,SAAC3B,EAAa4B,EAAkBC,EAAO5C,GACtDe,EAAY9E,UAAYD,OAAOI,OAAOuG,EAAiB1G,UAAW+D,GAClEe,EAAY9E,UAAU8E,YAAcA,EACpC/E,OAAO6G,eAAe9B,EAAa,QAAS,CAC1C+B,MAAOH,EAAiB1G,YAE1B2G,GAAS5G,OAAO+G,OAAOhC,EAAY9E,UAAW2G,EAChD,EA2TEI,aAhTmB,SAACC,EAAWC,EAASC,EAAQC,GAChD,IAAIR,EACA1E,EACA0B,EACEyD,EAAS,CAAA,EAIf,GAFAH,EAAUA,GAAW,GAEJ,MAAbD,EAAmB,OAAOC,EAE9B,EAAG,CAGD,IADAhF,GADA0E,EAAQ5G,OAAO2C,oBAAoBsE,IACzB5E,OACHH,KAAM,GACX0B,EAAOgD,EAAM1E,GACPkF,IAAcA,EAAWxD,EAAMqD,EAAWC,IAAcG,EAAOzD,KACnEsD,EAAQtD,GAAQqD,EAAUrD,GAC1ByD,EAAOzD,IAAQ,GAGnBqD,GAAuB,IAAXE,GAAoBjH,EAAe+G,EACjD,OAASA,KAAeE,GAAUA,EAAOF,EAAWC,KAAaD,IAAcjH,OAAOC,WAEtF,OAAOiH,CACT,EAyRE/G,OAAAA,EACAO,WAAAA,EACA4G,SAhRe,SAAChH,EAAKiH,EAAcC,GACnClH,EAAMmH,OAAOnH,SACIgC,IAAbkF,GAA0BA,EAAWlH,EAAI+B,UAC3CmF,EAAWlH,EAAI+B,QAEjBmF,GAAYD,EAAalF,OACzB,IAAMqF,EAAYpH,EAAIqH,QAAQJ,EAAcC,GAC5C,OAAsB,IAAfE,GAAoBA,IAAcF,CAC3C,EAyQEI,QA/Pc,SAACvH,GACf,IAAKA,EAAO,OAAO,KACnB,GAAIS,EAAQT,GAAQ,OAAOA,EAC3B,IAAI6B,EAAI7B,EAAMgC,OACd,IAAKjB,EAASc,GAAI,OAAO,KAEzB,IADA,IAAM2F,EAAM,IAAI9G,MAAMmB,GACfA,KAAM,GACX2F,EAAI3F,GAAK7B,EAAM6B,GAEjB,OAAO2F,CACT,EAsPEC,aA5NmB,SAAC7F,EAAKvC,GAOzB,IANA,IAIIoG,EAFEpE,GAFYO,GAAOA,EAAIT,OAAOE,WAETnB,KAAK0B,IAIxB6D,EAASpE,EAASqG,UAAYjC,EAAOkC,MAAM,CACjD,IAAMC,EAAOnC,EAAOgB,MACpBpH,EAAGa,KAAK0B,EAAKgG,EAAK,GAAIA,EAAK,GAC7B,CACF,EAkNEC,SAxMe,SAACC,EAAQ7H,GAIxB,IAHA,IAAI8H,EACEP,EAAM,GAE4B,QAAhCO,EAAUD,EAAOE,KAAK/H,KAC5BuH,EAAIS,KAAKF,GAGX,OAAOP,CACT,EAgMEpE,WAAAA,EACAC,eAAAA,EACA6E,WAAY7E,EACZI,kBAAAA,EACA0E,cAxJoB,SAACvG,GACrB6B,EAAkB7B,GAAK,SAACkC,EAAYC,GAElC,GAAIjD,EAAWc,KAA6D,IAArD,CAAC,YAAa,SAAU,UAAU0F,QAAQvD,GAC/D,OAAO,EAGT,IAAM0C,EAAQ7E,EAAImC,GAEbjD,EAAW2F,KAEhB3C,EAAWsE,YAAa,EAEpB,aAActE,EAChBA,EAAWuE,UAAW,EAInBvE,EAAWwE,MACdxE,EAAWwE,IAAM,WACf,MAAMC,MAAM,qCAAwCxE,EAAO,OAGjE,GACF,EAiIEyE,YA/HkB,SAACC,EAAeC,GAClC,IAAM9G,EAAM,CAAA,EAEN+G,EAAS,SAACnB,GACdA,EAAI7F,SAAQ,SAAA8E,GACV7E,EAAI6E,IAAS,CACf,KAKF,OAFAhG,EAAQgI,GAAiBE,EAAOF,GAAiBE,EAAOvB,OAAOqB,GAAeG,MAAMF,IAE7E9G,CACT,EAoHEiH,YAjMkB,SAAA5I,GAClB,OAAOA,EAAIG,cAAc6F,QAAQ,yBAC/B,SAAkB6C,EAAGC,EAAIC,GACvB,OAAOD,EAAGzE,cAAgB0E,CAC5B,GAEJ,EA4LEC,KAnHW,aAoHXC,eAlHqB,SAACzC,EAAO0C,GAE7B,OADA1C,GAASA,EACF2C,OAAOC,SAAS5C,GAASA,EAAQ0C,CAC1C,EAgHE3G,QAAAA,EACAM,OAAQJ,EACRK,iBAAAA,EACAqB,SAAAA,EACAkF,eAxGqB,WAGrB,IAHqE,IAA/CC,yDAAO,GAAIC,EAAQhK,UAAAwC,OAAA,QAAAC,IAAAzC,UAAA,GAAAA,UAAA,GAAG4E,EAASC,YACjDpE,EAAM,GACH+B,EAAUwH,EAAVxH,OACAuH,KACLtJ,GAAOuJ,EAASC,KAAKC,SAAW1H,EAAO,GAGzC,OAAO/B,CACT,EAiGE0J,oBAxFF,SAA6B3J,GAC3B,SAAUA,GAASc,EAAWd,EAAM8E,SAAyC,aAA9B9E,EAAMmB,OAAOC,cAA+BpB,EAAMmB,OAAOE,UAC1G,EAuFEuI,aArFmB,SAAChI,GACpB,IAAMiI,EAAQ,IAAInJ,MAAM,IA2BxB,OAzBc,SAARoJ,EAASC,EAAQlI,GAErB,GAAIb,EAAS+I,GAAS,CACpB,GAAIF,EAAMvC,QAAQyC,IAAW,EAC3B,OAGF,KAAK,WAAYA,GAAS,CACxBF,EAAMhI,GAAKkI,EACX,IAAMC,EAASvJ,EAAQsJ,GAAU,GAAK,CAAA,EAStC,OAPApI,EAAQoI,GAAQ,SAACtD,EAAOrE,GACtB,IAAM6H,EAAeH,EAAMrD,EAAO5E,EAAI,IACrClB,EAAYsJ,KAAkBD,EAAO5H,GAAO6H,EAC/C,IAEAJ,EAAMhI,QAAKI,EAEJ+H,CACT,CACF,CAEA,OAAOD,EAGFD,CAAMlI,EAAK,EACpB,EAyDE2C,UAAAA,EACA2F,WAtDiB,SAAClK,GAAK,OACvBA,IAAUgB,EAAShB,IAAUc,EAAWd,KAAWc,EAAWd,EAAMmK,OAASrJ,EAAWd,EAAK,MAAO,GC7oBtG,SAASoK,EAAWC,EAASC,EAAMC,EAAQC,EAASC,GAClDlC,MAAMrI,KAAKqF,MAEPgD,MAAMmC,kBACRnC,MAAMmC,kBAAkBnF,KAAMA,KAAKb,aAEnCa,KAAKsE,OAAS,IAAItB,OAASsB,MAG7BtE,KAAK8E,QAAUA,EACf9E,KAAKxB,KAAO,aACZuG,IAAS/E,KAAK+E,KAAOA,GACrBC,IAAWhF,KAAKgF,OAASA,GACzBC,IAAYjF,KAAKiF,QAAUA,GAC3BC,IAAalF,KAAKkF,SAAWA,EAC/B,CAEAE,EAAMtE,SAAS+D,EAAY7B,MAAO,CAChCqC,OAAQ,WACN,MAAO,CAELP,QAAS9E,KAAK8E,QACdtG,KAAMwB,KAAKxB,KAEX8G,YAAatF,KAAKsF,YAClBC,OAAQvF,KAAKuF,OAEbC,SAAUxF,KAAKwF,SACfC,WAAYzF,KAAKyF,WACjBC,aAAc1F,KAAK0F,aACnBpB,MAAOtE,KAAKsE,MAEZU,OAAQI,EAAMf,aAAarE,KAAKgF,QAChCD,KAAM/E,KAAK+E,KACXY,OAAQ3F,KAAKkF,UAAYlF,KAAKkF,SAASS,OAAS3F,KAAKkF,SAASS,OAAS,KAE3E,IAGF,IAAMtL,EAAYwK,EAAWxK,UACvB+D,EAAc,CAAA,EAEpB,CACE,uBACA,iBACA,eACA,YACA,cACA,4BACA,iBACA,mBACA,kBACA,eACA,kBACA,mBAEAhC,SAAQ,SAAA2I,GACR3G,EAAY2G,GAAQ,CAAC7D,MAAO6D,EAC9B,IAEA3K,OAAOsE,iBAAiBmG,EAAYzG,GACpChE,OAAO6G,eAAe5G,EAAW,eAAgB,CAAC6G,OAAO,IAGzD2D,EAAWe,KAAO,SAACC,EAAOd,EAAMC,EAAQC,EAASC,EAAUY,GACzD,IAAMC,EAAa3L,OAAOI,OAAOH,GAgBjC,OAdA+K,EAAMhE,aAAayE,EAAOE,GAAY,SAAgB1J,GACpD,OAAOA,IAAQ2G,MAAM3I,SACtB,IAAE,SAAA2D,GACD,MAAgB,iBAATA,CACT,IAEA6G,EAAWlK,KAAKoL,EAAYF,EAAMf,QAASC,EAAMC,EAAQC,EAASC,GAElEa,EAAWC,MAAQH,EAEnBE,EAAWvH,KAAOqH,EAAMrH,KAExBsH,GAAe1L,OAAO+G,OAAO4E,EAAYD,GAElCC,CACT,ECnFA,SAASE,GAAYxL,GACnB,OAAO2K,EAAM1J,cAAcjB,IAAU2K,EAAMlK,QAAQT,EACrD,CASA,SAASyL,GAAerJ,GACtB,OAAOuI,EAAM1D,SAAS7E,EAAK,MAAQA,EAAIjC,MAAM,GAAI,GAAKiC,CACxD,CAWA,SAASsJ,GAAUC,EAAMvJ,EAAKwJ,GAC5B,OAAKD,EACEA,EAAKE,OAAOzJ,GAAK0J,KAAI,SAAcC,EAAOlK,GAG/C,OADAkK,EAAQN,GAAeM,IACfH,GAAQ/J,EAAI,IAAMkK,EAAQ,IAAMA,CACzC,IAAEC,KAAKJ,EAAO,IAAM,IALHxJ,CAMpB,CAaA,IAAM6J,GAAatB,EAAMhE,aAAagE,EAAO,CAAE,EAAE,MAAM,SAAgBpH,GACrE,MAAO,WAAW2I,KAAK3I,EACzB,IAyBA,SAAS4I,GAAWvK,EAAKwK,EAAUC,GACjC,IAAK1B,EAAM3J,SAASY,GAClB,MAAM,IAAI0K,UAAU,4BAItBF,EAAWA,GAAY,IAAyBvH,SAYhD,IAAM0H,GATNF,EAAU1B,EAAMhE,aAAa0F,EAAS,CACpCE,YAAY,EACZX,MAAM,EACNY,SAAS,IACR,GAAO,SAAiBC,EAAQ1C,GAEjC,OAAQY,EAAMhK,YAAYoJ,EAAO0C,GACnC,KAE2BF,WAErBG,EAAUL,EAAQK,SAAWC,EAC7Bf,EAAOS,EAAQT,KACfY,EAAUH,EAAQG,QAElBI,GADQP,EAAQQ,MAAwB,oBAATA,MAAwBA,OACpClC,EAAMhB,oBAAoByC,GAEnD,IAAKzB,EAAM7J,WAAW4L,GACpB,MAAM,IAAIJ,UAAU,8BAGtB,SAASQ,EAAarG,GACpB,GAAc,OAAVA,EAAgB,MAAO,GAE3B,GAAIkE,EAAMrJ,OAAOmF,GACf,OAAOA,EAAMsG,cAGf,IAAKH,GAAWjC,EAAMnJ,OAAOiF,GAC3B,MAAM,IAAI2D,EAAW,gDAGvB,OAAIO,EAAM/J,cAAc6F,IAAUkE,EAAMzH,aAAauD,GAC5CmG,GAA2B,mBAATC,KAAsB,IAAIA,KAAK,CAACpG,IAAUuG,OAAO7B,KAAK1E,GAG1EA,CACT,CAYA,SAASkG,EAAelG,EAAOrE,EAAKuJ,GAClC,IAAInE,EAAMf,EAEV,GAAIA,IAAUkF,GAAyB,WAAjBnL,EAAOiG,GAC3B,GAAIkE,EAAM1D,SAAS7E,EAAK,MAEtBA,EAAMmK,EAAanK,EAAMA,EAAIjC,MAAM,GAAI,GAEvCsG,EAAQwG,KAAKC,UAAUzG,QAClB,GACJkE,EAAMlK,QAAQgG,IAnGvB,SAAqBe,GACnB,OAAOmD,EAAMlK,QAAQ+G,KAASA,EAAI2F,KAAK3B,GACzC,CAiGiC4B,CAAY3G,KACnCkE,EAAMlJ,WAAWgF,IAAUkE,EAAM1D,SAAS7E,EAAK,SAAWoF,EAAMmD,EAAMpD,QAAQd,IAYhF,OATArE,EAAMqJ,GAAerJ,GAErBoF,EAAI7F,SAAQ,SAAc0L,EAAIC,IAC1B3C,EAAMhK,YAAY0M,IAAc,OAAPA,GAAgBjB,EAAStH,QAEtC,IAAZ0H,EAAmBd,GAAU,CAACtJ,GAAMkL,EAAO1B,GAAqB,OAAZY,EAAmBpK,EAAMA,EAAM,KACnF0K,EAAaO,GAEjB,KACO,EAIX,QAAI7B,GAAY/E,KAIhB2F,EAAStH,OAAO4G,GAAUC,EAAMvJ,EAAKwJ,GAAOkB,EAAarG,KAElD,EACT,CAEA,IAAMoD,EAAQ,GAER0D,EAAiB5N,OAAO+G,OAAOuF,GAAY,CAC/CU,eAAAA,EACAG,aAAAA,EACAtB,YAAAA,KAyBF,IAAKb,EAAM3J,SAASY,GAClB,MAAM,IAAI0K,UAAU,0BAKtB,OA5BA,SAASkB,EAAM/G,EAAOkF,GACpB,IAAIhB,EAAMhK,YAAY8F,GAAtB,CAEA,IAA8B,IAA1BoD,EAAMvC,QAAQb,GAChB,MAAM8B,MAAM,kCAAoCoD,EAAKK,KAAK,MAG5DnC,EAAM5B,KAAKxB,GAEXkE,EAAMhJ,QAAQ8E,GAAO,SAAc4G,EAAIjL,IAKtB,OAJEuI,EAAMhK,YAAY0M,IAAc,OAAPA,IAAgBX,EAAQxM,KAChEkM,EAAUiB,EAAI1C,EAAM9J,SAASuB,GAAOA,EAAI4D,OAAS5D,EAAKuJ,EAAM4B,KAI5DC,EAAMH,EAAI1B,EAAOA,EAAKE,OAAOzJ,GAAO,CAACA,GAEzC,IAEAyH,EAAM4D,KAlBwB,CAmBhC,CAMAD,CAAM5L,GAECwK,CACT,CC5MA,SAASsB,GAAOzN,GACd,IAAM0N,EAAU,CACd,IAAK,MACL,IAAK,MACL,IAAK,MACL,IAAK,MACL,IAAK,MACL,MAAO,IACP,MAAO,MAET,OAAOC,mBAAmB3N,GAAKgG,QAAQ,oBAAoB,SAAkB4H,GAC3E,OAAOF,EAAQE,EACjB,GACF,CAUA,SAASC,GAAqBC,EAAQ1B,GACpC9G,KAAKyI,OAAS,GAEdD,GAAU5B,GAAW4B,EAAQxI,KAAM8G,EACrC,CAEA,IAAMzM,GAAYkO,GAAqBlO,UC5BvC,SAAS8N,GAAOxM,GACd,OAAO0M,mBAAmB1M,GACxB+E,QAAQ,QAAS,KACjBA,QAAQ,OAAQ,KAChBA,QAAQ,QAAS,KACjBA,QAAQ,OAAQ,KAChBA,QAAQ,QAAS,KACjBA,QAAQ,QAAS,IACrB,CAWe,SAASgI,GAASC,EAAKH,EAAQ1B,GAE5C,IAAK0B,EACH,OAAOG,EAGT,IAIIC,EAJEC,EAAU/B,GAAWA,EAAQqB,QAAUA,GAEvCW,EAAchC,GAAWA,EAAQiC,UAYvC,GAPEH,EADEE,EACiBA,EAAYN,EAAQ1B,GAEpB1B,EAAMjJ,kBAAkBqM,GACzCA,EAAOrO,WACP,IAAIoO,GAAqBC,EAAQ1B,GAAS3M,SAAS0O,GAGjC,CACpB,IAAMG,EAAgBL,EAAI5G,QAAQ,MAEX,IAAnBiH,IACFL,EAAMA,EAAI/N,MAAM,EAAGoO,IAErBL,KAA8B,IAAtBA,EAAI5G,QAAQ,KAAc,IAAM,KAAO6G,CACjD,CAEA,OAAOD,CACT,CDnBAtO,GAAUkF,OAAS,SAAgBf,EAAM0C,GACvClB,KAAKyI,OAAO/F,KAAK,CAAClE,EAAM0C,GAC1B,EAEA7G,GAAUF,SAAW,SAAkB8O,GACrC,IAAMJ,EAAUI,EAAU,SAAS/H,GACjC,OAAO+H,EAAQtO,KAAKqF,KAAMkB,EAAOiH,GAClC,EAAGA,GAEJ,OAAOnI,KAAKyI,OAAOlC,KAAI,SAAclE,GACnC,OAAOwG,EAAQxG,EAAK,IAAM,IAAMwG,EAAQxG,EAAK,GAC9C,GAAE,IAAIoE,KAAK,IACd,EErDkC,ICkB/ByC,GDkDHC,GAlEwB,WACtB,SAAcC,IAAAC,EAAArJ,KAAAoJ,GACZpJ,KAAKsJ,SAAW,EAClB,CA4DC,OA1DDC,EAAAH,EAAA,CAAA,CAAAvM,IAAA,MAAAqE,MAQA,SAAIsI,EAAWC,EAAU3C,GAOvB,OANA9G,KAAKsJ,SAAS5G,KAAK,CACjB8G,UAAAA,EACAC,SAAAA,EACAC,cAAa5C,GAAUA,EAAQ4C,YAC/BC,QAAS7C,EAAUA,EAAQ6C,QAAU,OAEhC3J,KAAKsJ,SAAS7M,OAAS,CAChC,GAEA,CAAAI,IAAA,QAAAqE,MAOA,SAAM0I,GACA5J,KAAKsJ,SAASM,KAChB5J,KAAKsJ,SAASM,GAAM,KAExB,GAEA,CAAA/M,IAAA,QAAAqE,MAKA,WACMlB,KAAKsJ,WACPtJ,KAAKsJ,SAAW,GAEpB,GAEA,CAAAzM,IAAA,UAAAqE,MAUA,SAAQpH,GACNsL,EAAMhJ,QAAQ4D,KAAKsJ,UAAU,SAAwBO,GACzC,OAANA,GACF/P,EAAG+P,EAEP,GACF,KAACT,CAAA,CA/DqB,GEFTU,GAAA,CACbC,mBAAmB,EACnBC,mBAAmB,EACnBC,qBAAqB,GCDRC,GAAA,CACbC,WAAW,EACXC,QAAS,CACPC,gBCJsC,oBAApBA,gBAAkCA,gBAAkB9B,GDKtEjJ,SEN+B,oBAAbA,SAA2BA,SAAW,KFOxDgI,KGP2B,oBAATA,KAAuBA,KAAO,MHSlDgD,UAAW,CAAC,OAAQ,QAAS,OAAQ,OAAQ,MAAO,SFXhDC,GAAkC,oBAAXjN,QAA8C,oBAAbkN,SAmBxDC,IACHvB,GAEuB,oBAAdwB,WAA6BA,UAAUxB,QADxCqB,IAAiB,CAAC,cAAe,eAAgB,MAAMxI,QAAQmH,IAAW,GAY/EyB,GAE2B,oBAAtBC,mBAEPvN,gBAAgBuN,mBACc,mBAAvBvN,KAAKwN,cMlCXzF,GAAAA,EAAAA,EAAAA,CAAAA,+GACA0F,IC2CL,SAASC,GAAelE,GACtB,SAASmE,EAAU5E,EAAMlF,EAAOuD,EAAQsD,GACtC,IAAIvJ,EAAO4H,EAAK2B,KAEhB,GAAa,cAATvJ,EAAsB,OAAO,EAEjC,IAAMyM,EAAepH,OAAOC,UAAUtF,GAChC0M,EAASnD,GAAS3B,EAAK3J,OAG7B,OAFA+B,GAAQA,GAAQ4G,EAAMlK,QAAQuJ,GAAUA,EAAOhI,OAAS+B,EAEpD0M,GACE9F,EAAMzC,WAAW8B,EAAQjG,GAC3BiG,EAAOjG,GAAQ,CAACiG,EAAOjG,GAAO0C,GAE9BuD,EAAOjG,GAAQ0C,GAGT+J,IAGLxG,EAAOjG,IAAU4G,EAAM3J,SAASgJ,EAAOjG,MAC1CiG,EAAOjG,GAAQ,IAGFwM,EAAU5E,EAAMlF,EAAOuD,EAAOjG,GAAOuJ,IAEtC3C,EAAMlK,QAAQuJ,EAAOjG,MACjCiG,EAAOjG,GA/Cb,SAAuByD,GACrB,IAEI3F,EAEAO,EAJER,EAAM,CAAA,EACNS,EAAO1C,OAAO0C,KAAKmF,GAEnBjF,EAAMF,EAAKL,OAEjB,IAAKH,EAAI,EAAGA,EAAIU,EAAKV,IAEnBD,EADAQ,EAAMC,EAAKR,IACA2F,EAAIpF,GAEjB,OAAOR,CACT,CAoCqB8O,CAAc1G,EAAOjG,MAG9ByM,EACV,CAEA,GAAI7F,EAAMhG,WAAWyH,IAAazB,EAAM7J,WAAWsL,EAASuE,SAAU,CACpE,IAAM/O,EAAM,CAAA,EAMZ,OAJA+I,EAAMlD,aAAa2E,GAAU,SAACrI,EAAM0C,GAClC8J,EA1EN,SAAuBxM,GAKrB,OAAO4G,EAAM9C,SAAS,gBAAiB9D,GAAM+H,KAAI,SAAA+B,GAC/C,MAAoB,OAAbA,EAAM,GAAc,GAAKA,EAAM,IAAMA,EAAM,EACpD,GACF,CAkEgB+C,CAAc7M,GAAO0C,EAAO7E,EAAK,EAC7C,IAEOA,CACT,CAEA,OAAO,IACT,CCzDA,IAAMiP,GAAW,CAEfC,aAAczB,GAEd0B,QAAS,CAAC,MAAO,QAEjBC,iBAAkB,CAAC,SAA0BC,EAAMC,GACjD,IA8BIzP,EA9BE0P,EAAcD,EAAQE,kBAAoB,GAC1CC,EAAqBF,EAAY7J,QAAQ,qBAAuB,EAChEgK,EAAkB3G,EAAM3J,SAASiQ,GAQvC,GANIK,GAAmB3G,EAAMvH,WAAW6N,KACtCA,EAAO,IAAIpM,SAASoM,IAGHtG,EAAMhG,WAAWsM,GAGlC,OAAOI,EAAqBpE,KAAKC,UAAUoD,GAAeW,IAASA,EAGrE,GAAItG,EAAM/J,cAAcqQ,IACtBtG,EAAMlG,SAASwM,IACftG,EAAMvF,SAAS6L,IACftG,EAAMpJ,OAAO0P,IACbtG,EAAMnJ,OAAOyP,GAEb,OAAOA,EAET,GAAItG,EAAM5F,kBAAkBkM,GAC1B,OAAOA,EAAK/L,OAEd,GAAIyF,EAAMjJ,kBAAkBuP,GAE1B,OADAC,EAAQK,eAAe,mDAAmD,GACnEN,EAAKvR,WAKd,GAAI4R,EAAiB,CACnB,GAAIH,EAAY7J,QAAQ,sCAAwC,EAC9D,OCtEO,SAA0B2J,EAAM5E,GAC7C,OAAOF,GAAW8E,EAAM,IAAIZ,GAASV,QAAQC,gBAAmBjQ,OAAO+G,OAAO,CAC5EgG,QAAS,SAASjG,EAAOrE,EAAKuJ,EAAM6F,GAClC,OAAInB,GAASoB,QAAU9G,EAAMlG,SAASgC,IACpClB,KAAKT,OAAO1C,EAAKqE,EAAM/G,SAAS,YACzB,GAGF8R,EAAQ7E,eAAepN,MAAMgG,KAAM/F,UAC5C,GACC6M,GACL,CD2DeqF,CAAiBT,EAAM1L,KAAKoM,gBAAgBjS,WAGrD,IAAK+B,EAAakJ,EAAMlJ,WAAWwP,KAAUE,EAAY7J,QAAQ,wBAA0B,EAAG,CAC5F,IAAMsK,EAAYrM,KAAKsM,KAAOtM,KAAKsM,IAAIhN,SAEvC,OAAOsH,GACL1K,EAAa,CAAC,UAAWwP,GAAQA,EACjCW,GAAa,IAAIA,EACjBrM,KAAKoM,eAET,CACF,CAEA,OAAIL,GAAmBD,GACrBH,EAAQK,eAAe,oBAAoB,GAvEjD,SAAyBO,EAAUC,EAAQvD,GACzC,GAAI7D,EAAM9J,SAASiR,GACjB,IAEE,OADCC,GAAU9E,KAAK+E,OAAOF,GAChBnH,EAAM3E,KAAK8L,EAKpB,CAJE,MAAOG,GACP,GAAe,gBAAXA,EAAElO,KACJ,MAAMkO,CAEV,CAGF,OAAQzD,GAAWvB,KAAKC,WAAW4E,EACrC,CA2DaI,CAAgBjB,IAGlBA,CACT,GAEAkB,kBAAmB,CAAC,SAA2BlB,GAC7C,IAAMH,EAAevL,KAAKuL,cAAgBD,GAASC,aAC7CvB,EAAoBuB,GAAgBA,EAAavB,kBACjD6C,EAAsC,SAAtB7M,KAAK8M,aAE3B,GAAIpB,GAAQtG,EAAM9J,SAASoQ,KAAW1B,IAAsBhK,KAAK8M,cAAiBD,GAAgB,CAChG,IACME,IADoBxB,GAAgBA,EAAaxB,oBACP8C,EAEhD,IACE,OAAOnF,KAAK+E,MAAMf,EAQpB,CAPE,MAAOgB,GACP,GAAIK,EAAmB,CACrB,GAAe,gBAAXL,EAAElO,KACJ,MAAMqG,EAAWe,KAAK8G,EAAG7H,EAAWmI,iBAAkBhN,KAAM,KAAMA,KAAKkF,UAEzE,MAAMwH,CACR,CACF,CACF,CAEA,OAAOhB,CACT,GAMAuB,QAAS,EAETC,eAAgB,aAChBC,eAAgB,eAEhBC,kBAAmB,EACnBC,eAAgB,EAEhBf,IAAK,CACHhN,SAAUwL,GAASV,QAAQ9K,SAC3BgI,KAAMwD,GAASV,QAAQ9C,MAGzBgG,eAAgB,SAAwB3H,GACtC,OAAOA,GAAU,KAAOA,EAAS,GAClC,EAEDgG,QAAS,CACP4B,OAAQ,CACNC,OAAU,oCACV,oBAAgB9Q,KAKtB0I,EAAMhJ,QAAQ,CAAC,SAAU,MAAO,OAAQ,OAAQ,MAAO,UAAU,SAACqR,GAChEnC,GAASK,QAAQ8B,GAAU,EAC7B,IAEA,IAAAC,GAAepC,GErJTqC,GAAoBvI,EAAMnC,YAAY,CAC1C,MAAO,gBAAiB,iBAAkB,eAAgB,OAC1D,UAAW,OAAQ,OAAQ,oBAAqB,sBAChD,gBAAiB,WAAY,eAAgB,sBAC7C,UAAW,cAAe,eCLtB2K,GAAahS,OAAO,aAE1B,SAASiS,GAAgBC,GACvB,OAAOA,GAAUjM,OAAOiM,GAAQrN,OAAO5F,aACzC,CAEA,SAASkT,GAAe7M,GACtB,OAAc,IAAVA,GAA4B,MAATA,EACdA,EAGFkE,EAAMlK,QAAQgG,GAASA,EAAMqF,IAAIwH,IAAkBlM,OAAOX,EACnE,CAgBA,SAAS8M,GAAiBvQ,EAASyD,EAAO4M,EAAQvM,EAAQ0M,GACxD,OAAI7I,EAAM7J,WAAWgG,GACZA,EAAO5G,KAAKqF,KAAMkB,EAAO4M,IAG9BG,IACF/M,EAAQ4M,GAGL1I,EAAM9J,SAAS4F,GAEhBkE,EAAM9J,SAASiG,IACiB,IAA3BL,EAAMa,QAAQR,GAGnB6D,EAAMnH,SAASsD,GACVA,EAAOoF,KAAKzF,QADrB,OANA,EASF,CAoBC,IAEKgN,GAAY,SAAAC,EAAAC,GAChB,SAAAF,EAAYvC,GAAStC,EAAArJ,KAAAkO,GACnBvC,GAAW3L,KAAK+C,IAAI4I,EACtB,CA2MC,OA3MApC,EAAA2E,EAAA,CAAA,CAAArR,IAAA,MAAAqE,MAED,SAAI4M,EAAQO,EAAgBC,GAC1B,IAAMjR,EAAO2C,KAEb,SAASuO,EAAUC,EAAQC,EAASC,GAClC,IAAMC,EAAUd,GAAgBY,GAEhC,IAAKE,EACH,MAAM,IAAI3L,MAAM,0CAGlB,IAAMnG,EAAMuI,EAAMnI,QAAQI,EAAMsR,KAE5B9R,QAAqBH,IAAdW,EAAKR,KAAmC,IAAb6R,QAAmChS,IAAbgS,IAAwC,IAAdrR,EAAKR,MACzFQ,EAAKR,GAAO4R,GAAWV,GAAeS,GAE1C,CAEA,IDpEWI,EAET/R,EACAlB,EACAW,EAHEuS,ECmEEC,EAAa,SAACnD,EAAS+C,GAAQ,OACnCtJ,EAAMhJ,QAAQuP,GAAS,SAAC6C,EAAQC,GAAO,OAAKF,EAAUC,EAAQC,EAASC,KAAU,EAUnF,OARItJ,EAAM1J,cAAcoS,IAAWA,aAAkB9N,KAAKb,YACxD2P,EAAWhB,EAAQO,GACXjJ,EAAM9J,SAASwS,KAAYA,EAASA,EAAOrN,UArEtB,iCAAiCkG,KAqEmBmH,EArEVrN,QAsEvEqO,GDzEED,EAAS,CAAA,GADFD,EC0Eed,IDpEdc,EAAWvL,MAAM,MAAMjH,SAAQ,SAAgB2S,GAC3DzS,EAAIyS,EAAKhN,QAAQ,KACjBlF,EAAMkS,EAAKC,UAAU,EAAG1S,GAAGmE,OAAO5F,cAClCc,EAAMoT,EAAKC,UAAU1S,EAAI,GAAGmE,QAEvB5D,GAAQgS,EAAOhS,IAAQ8Q,GAAkB9Q,KAIlC,eAARA,EACEgS,EAAOhS,GACTgS,EAAOhS,GAAK6F,KAAK/G,GAEjBkT,EAAOhS,GAAO,CAAClB,GAGjBkT,EAAOhS,GAAOgS,EAAOhS,GAAOgS,EAAOhS,GAAO,KAAOlB,EAAMA,EAE3D,IAEOkT,GCgD8BR,GAEvB,MAAVP,GAAkBS,EAAUF,EAAgBP,EAAQQ,GAG/CtO,IACT,GAAC,CAAAnD,IAAA,MAAAqE,MAED,SAAI4M,EAAQtB,GAGV,GAFAsB,EAASD,GAAgBC,GAEb,CACV,IAAMjR,EAAMuI,EAAMnI,QAAQ+C,KAAM8N,GAEhC,GAAIjR,EAAK,CACP,IAAMqE,EAAQlB,KAAKnD,GAEnB,IAAK2P,EACH,OAAOtL,EAGT,IAAe,IAAXsL,EACF,OAxGV,SAAqB9R,GAKnB,IAJA,IAEI4N,EAFE2G,EAAS7U,OAAOI,OAAO,MACvB0U,EAAW,mCAGT5G,EAAQ4G,EAASzM,KAAK/H,IAC5BuU,EAAO3G,EAAM,IAAMA,EAAM,GAG3B,OAAO2G,CACT,CA8FiBE,CAAYjO,GAGrB,GAAIkE,EAAM7J,WAAWiR,GACnB,OAAOA,EAAO7R,KAAKqF,KAAMkB,EAAOrE,GAGlC,GAAIuI,EAAMnH,SAASuO,GACjB,OAAOA,EAAO/J,KAAKvB,GAGrB,MAAM,IAAI6F,UAAU,yCACtB,CACF,CACF,GAAC,CAAAlK,IAAA,MAAAqE,MAED,SAAI4M,EAAQsB,GAGV,GAFAtB,EAASD,GAAgBC,GAEb,CACV,IAAMjR,EAAMuI,EAAMnI,QAAQ+C,KAAM8N,GAEhC,SAAUjR,QAAqBH,IAAdsD,KAAKnD,IAAwBuS,IAAWpB,GAAiBhO,EAAMA,KAAKnD,GAAMA,EAAKuS,GAClG,CAEA,OAAO,CACT,GAAC,CAAAvS,IAAA,SAAAqE,MAED,SAAO4M,EAAQsB,GACb,IAAM/R,EAAO2C,KACTqP,GAAU,EAEd,SAASC,EAAab,GAGpB,GAFAA,EAAUZ,GAAgBY,GAEb,CACX,IAAM5R,EAAMuI,EAAMnI,QAAQI,EAAMoR,IAE5B5R,GAASuS,IAAWpB,GAAiB3Q,EAAMA,EAAKR,GAAMA,EAAKuS,YACtD/R,EAAKR,GAEZwS,GAAU,EAEd,CACF,CAQA,OANIjK,EAAMlK,QAAQ4S,GAChBA,EAAO1R,QAAQkT,GAEfA,EAAaxB,GAGRuB,CACT,GAAC,CAAAxS,IAAA,QAAAqE,MAED,SAAMkO,GAKJ,IAJA,IAAMtS,EAAO1C,OAAO0C,KAAKkD,MACrB1D,EAAIQ,EAAKL,OACT4S,GAAU,EAEP/S,KAAK,CACV,IAAMO,EAAMC,EAAKR,GACb8S,IAAWpB,GAAiBhO,EAAMA,KAAKnD,GAAMA,EAAKuS,GAAS,YACtDpP,KAAKnD,GACZwS,GAAU,EAEd,CAEA,OAAOA,CACT,GAAC,CAAAxS,IAAA,YAAAqE,MAED,SAAUqO,GACR,IAAMlS,EAAO2C,KACP2L,EAAU,CAAA,EAsBhB,OApBAvG,EAAMhJ,QAAQ4D,MAAM,SAACkB,EAAO4M,GAC1B,IAAMjR,EAAMuI,EAAMnI,QAAQ0O,EAASmC,GAEnC,GAAIjR,EAGF,OAFAQ,EAAKR,GAAOkR,GAAe7M,eACpB7D,EAAKyQ,GAId,IAAM0B,EAAaD,EA1JzB,SAAsBzB,GACpB,OAAOA,EAAOrN,OACX5F,cAAc6F,QAAQ,mBAAmB,SAAC+O,EAAGC,EAAMhV,GAClD,OAAOgV,EAAK3Q,cAAgBrE,CAC9B,GACJ,CAqJkCiV,CAAa7B,GAAUjM,OAAOiM,GAAQrN,OAE9D+O,IAAe1B,UACVzQ,EAAKyQ,GAGdzQ,EAAKmS,GAAczB,GAAe7M,GAElCyK,EAAQ6D,IAAc,CACxB,IAEOxP,IACT,GAAC,CAAAnD,IAAA,SAAAqE,MAED,WAAmB,IAAA,IAAA0O,EAAAC,EAAA5V,UAAAwC,OAATqT,EAAO,IAAA3U,MAAA0U,GAAA3S,EAAA,EAAAA,EAAA2S,EAAA3S,IAAP4S,EAAO5S,GAAAjD,UAAAiD,GACf,OAAO0S,EAAA5P,KAAKb,aAAYmH,OAAOtM,MAAA4V,EAAA,CAAA5P,MAAS8P,OAAAA,GAC1C,GAAC,CAAAjT,IAAA,SAAAqE,MAED,SAAO6O,GACL,IAAM1T,EAAMjC,OAAOI,OAAO,MAM1B,OAJA4K,EAAMhJ,QAAQ4D,MAAM,SAACkB,EAAO4M,GACjB,MAAT5M,IAA2B,IAAVA,IAAoB7E,EAAIyR,GAAUiC,GAAa3K,EAAMlK,QAAQgG,GAASA,EAAMuF,KAAK,MAAQvF,EAC5G,IAEO7E,CACT,GAAC,CAAAQ,IAEAjB,OAAOE,SAFPoF,MAED,WACE,OAAO9G,OAAOgR,QAAQpL,KAAKqF,UAAUzJ,OAAOE,WAC9C,GAAC,CAAAe,IAAA,WAAAqE,MAED,WACE,OAAO9G,OAAOgR,QAAQpL,KAAKqF,UAAUkB,KAAI,SAAA/J,GAAA,IAAAwT,EAAAC,EAAAzT,EAAA,GAAe,OAAPwT,EAAA,GAAsB,KAAfA,EAAA,EAA2B,IAAEvJ,KAAK,KAC5F,GAAC,CAAA5J,IAEIjB,OAAOC,YAFXqU,IAED,WACE,MAAO,cACT,IAAC,CAAA,CAAArT,IAAA,OAAAqE,MAED,SAAYzG,GACV,OAAOA,aAAiBuF,KAAOvF,EAAQ,IAAIuF,KAAKvF,EAClD,GAAC,CAAAoC,IAAA,SAAAqE,MAED,SAAciP,GACqB,IAAjC,IAAMC,EAAW,IAAIpQ,KAAKmQ,GAAOE,EAAApW,UAAAwC,OADXqT,EAAO,IAAA3U,MAAAkV,EAAA,EAAAA,EAAA,EAAA,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,IAAPR,EAAOQ,EAAA,GAAArW,UAAAqW,GAK7B,OAFAR,EAAQ1T,SAAQ,SAACqI,GAAM,OAAK2L,EAASrN,IAAI0B,MAElC2L,CACT,GAAC,CAAAvT,IAAA,WAAAqE,MAED,SAAgB4M,GACd,IAIMyC,GAJYvQ,KAAK4N,IAAe5N,KAAK4N,IAAc,CACvD2C,UAAW,CAAC,IAGcA,UACtBlW,EAAY2F,KAAK3F,UAEvB,SAASmW,EAAe/B,GACtB,IAAME,EAAUd,GAAgBY,GAE3B8B,EAAU5B,MAlNrB,SAAwBtS,EAAKyR,GAC3B,IAAM2C,EAAerL,EAAM9B,YAAY,IAAMwK,GAE7C,CAAC,MAAO,MAAO,OAAO1R,SAAQ,SAAAsU,GAC5BtW,OAAO6G,eAAe5E,EAAKqU,EAAaD,EAAc,CACpDvP,MAAO,SAASyP,EAAMC,EAAMC,GAC1B,OAAO7Q,KAAK0Q,GAAY/V,KAAKqF,KAAM8N,EAAQ6C,EAAMC,EAAMC,EACxD,EACDC,cAAc,GAElB,GACF,CAwMQC,CAAe1W,EAAWoU,GAC1B8B,EAAU5B,IAAW,EAEzB,CAIA,OAFAvJ,EAAMlK,QAAQ4S,GAAUA,EAAO1R,QAAQoU,GAAkBA,EAAe1C,GAEjE9N,IACT,KAACkO,CAAA,CA9Me,GAiNlBA,GAAa8C,SAAS,CAAC,eAAgB,iBAAkB,SAAU,kBAAmB,aAAc,kBAG/F/R,EAACf,kBAAkBgQ,GAAa7T,WAAW,SAAUwC,EAAAA,GAAQ,IAAhBqE,IAAAA,MAC5C+P,EAASpU,EAAI,GAAGkC,cAAgBlC,EAAIjC,MAAM,GAC9C,MAAO,CACLsV,IAAK,WAAA,OAAMhP,CAAK,EAChB6B,IAAG,SAACmO,GACFlR,KAAKiR,GAAUC,CACjB,EAEJ,IAEA9L,EAAMxC,cAAcsL,IAEpB,IAAAiD,GAAejD,GC3RA,SAASkD,GAAcC,EAAKnM,GACzC,IAAMF,EAAShF,MAAQsL,GACjB7N,EAAUyH,GAAYF,EACtB2G,EAAUuC,GAAatI,KAAKnI,EAAQkO,SACtCD,EAAOjO,EAAQiO,KAQnB,OANAtG,EAAMhJ,QAAQiV,GAAK,SAAmBvX,GACpC4R,EAAO5R,EAAGa,KAAKqK,EAAQ0G,EAAMC,EAAQ2F,YAAapM,EAAWA,EAASS,YAASjJ,EACjF,IAEAiP,EAAQ2F,YAED5F,CACT,CCzBe,SAAS6F,GAASrQ,GAC/B,SAAUA,IAASA,EAAMsQ,WAC3B,CCUA,SAASC,GAAc3M,EAASE,EAAQC,GAEtCJ,EAAWlK,KAAKqF,KAAiB,MAAX8E,EAAkB,WAAaA,EAASD,EAAW6M,aAAc1M,EAAQC,GAC/FjF,KAAKxB,KAAO,eACd,CAEA4G,EAAMtE,SAAS2Q,GAAe5M,EAAY,CACxC2M,YAAY,IClBC1G,IAAAA,GAAAA,GAASL,sBAGtB,CACEkH,MAAMnT,SAAAA,EAAM0C,EAAO0Q,EAASxL,EAAMyL,EAAQC,GACxC,IAAMC,EAAS,CAACvT,EAAO,IAAM6J,mBAAmBnH,IAEhDkE,EAAM5J,SAASoW,IAAYG,EAAOrP,KAAK,WAAa,IAAIsP,KAAKJ,GAASK,eAEtE7M,EAAM9J,SAAS8K,IAAS2L,EAAOrP,KAAK,QAAU0D,GAE9ChB,EAAM9J,SAASuW,IAAWE,EAAOrP,KAAK,UAAYmP,IAEvC,IAAXC,GAAmBC,EAAOrP,KAAK,UAE/B8H,SAASuH,OAASA,EAAOtL,KAAK,KAC/B,EAEDyL,KAAI,SAAC1T,GACH,IAAM8J,EAAQkC,SAASuH,OAAOzJ,MAAM,IAAI6J,OAAO,aAAe3T,EAAO,cACrE,OAAQ8J,EAAQ8J,mBAAmB9J,EAAM,IAAM,IAChD,EAED+J,OAAM,SAAC7T,GACLwB,KAAK2R,MAAMnT,EAAM,GAAIwT,KAAKM,MAAQ,MACpC,GAMF,CACEX,MAAK,WAAK,EACVO,KAAO,WACL,OAAO,IACR,EACDG,kBAAU,GCxBC,SAASE,GAAcC,EAASC,GAC7C,OAAID,ICHG,8BAA8B7L,KDGP8L,GENjB,SAAqBD,EAASE,GAC3C,OAAOA,EACHF,EAAQ9R,QAAQ,SAAU,IAAM,IAAMgS,EAAYhS,QAAQ,OAAQ,IAClE8R,CACN,CFGWG,CAAYH,EAASC,GAEvBA,CACT,CGfe3H,IAAAA,GAAAA,GAASL,sBAIrB,WACC,IAEImI,EAFEC,EAAO,kBAAkBlM,KAAK+D,UAAUoI,WACxCC,EAAiBvI,SAASwI,cAAc,KAS9C,SAASC,EAAWtK,GAClB,IAAIuK,EAAOvK,EAWX,OATIkK,IAEFE,EAAeI,aAAa,OAAQD,GACpCA,EAAOH,EAAeG,MAGxBH,EAAeI,aAAa,OAAQD,GAG7B,CACLA,KAAMH,EAAeG,KACrBE,SAAUL,EAAeK,SAAWL,EAAeK,SAAS1S,QAAQ,KAAM,IAAM,GAChF2S,KAAMN,EAAeM,KACrBC,OAAQP,EAAeO,OAASP,EAAeO,OAAO5S,QAAQ,MAAO,IAAM,GAC3E6S,KAAMR,EAAeQ,KAAOR,EAAeQ,KAAK7S,QAAQ,KAAM,IAAM,GACpE8S,SAAUT,EAAeS,SACzBC,KAAMV,EAAeU,KACrBC,SAAiD,MAAtCX,EAAeW,SAASC,OAAO,GACxCZ,EAAeW,SACf,IAAMX,EAAeW,SAE3B,CAUA,OARAd,EAAYK,EAAW3V,OAAOsW,SAASV,MAQhC,SAAyBW,GAC9B,IAAMhF,EAAUzJ,EAAM9J,SAASuY,GAAeZ,EAAWY,GAAcA,EACvE,OAAQhF,EAAOuE,WAAaR,EAAUQ,UAClCvE,EAAOwE,OAAST,EAAUS,KAElC,CAlDC,GAsDQ,WACL,OAAO,GChDb,SAASS,GAAqBC,EAAUC,GACtC,IAAIC,EAAgB,EACdC,ECVR,SAAqBC,EAAcC,GACjCD,EAAeA,GAAgB,GAC/B,IAIIE,EAJEC,EAAQ,IAAInZ,MAAMgZ,GAClBI,EAAa,IAAIpZ,MAAMgZ,GACzBK,EAAO,EACPC,EAAO,EAKX,OAFAL,OAAc1X,IAAR0X,EAAoBA,EAAM,IAEzB,SAAcM,GACnB,IAAMpC,EAAMN,KAAKM,MAEXqC,EAAYJ,EAAWE,GAExBJ,IACHA,EAAgB/B,GAGlBgC,EAAME,GAAQE,EACdH,EAAWC,GAAQlC,EAKnB,IAHA,IAAIhW,EAAImY,EACJG,EAAa,EAEVtY,IAAMkY,GACXI,GAAcN,EAAMhY,KACpBA,GAAQ6X,EASV,IANAK,GAAQA,EAAO,GAAKL,KAEPM,IACXA,GAAQA,EAAO,GAAKN,KAGlB7B,EAAM+B,EAAgBD,GAA1B,CAIA,IAAMS,EAASF,GAAarC,EAAMqC,EAElC,OAAOE,EAAS3Q,KAAK4Q,MAAmB,IAAbF,EAAoBC,QAAUnY,CAJzD,EAMJ,CDlCuBqY,CAAY,GAAI,KAErC,OAAO,SAAArI,GACL,IAAMsI,EAAStI,EAAEsI,OACXC,EAAQvI,EAAEwI,iBAAmBxI,EAAEuI,WAAQvY,EACvCyY,EAAgBH,EAASf,EACzBmB,EAAOlB,EAAaiB,GAG1BlB,EAAgBe,EAEhB,IAAMtJ,EAAO,CACXsJ,OAAAA,EACAC,MAAAA,EACAI,SAAUJ,EAASD,EAASC,OAASvY,EACrC4X,MAAOa,EACPC,KAAMA,QAAc1Y,EACpB4Y,UAAWF,GAAQH,GAVLD,GAAUC,GAUeA,EAAQD,GAAUI,OAAO1Y,EAChE6Y,MAAO7I,GAGThB,EAAKsI,EAAmB,WAAa,WAAY,EAEjDD,EAASrI,GAEb,CAEA,IExCM8J,GAAgB,CACpBC,KCLa,KDMbC,IFsCsD,oBAAnBC,gBAEG,SAAU3Q,GAChD,OAAO,IAAI4Q,SAAQ,SAA4BC,EAASC,GACtD,IAGIC,EAWAnK,IAdAoK,EAAchR,EAAO0G,KACnBuK,EAAiB/H,GAAatI,KAAKZ,EAAO2G,SAAS2F,YACpDxE,EAA+B9H,EAA/B8H,aAAcoJ,EAAiBlR,EAAjBkR,cAEnB,SAAS9T,IACH4C,EAAOmR,aACTnR,EAAOmR,YAAYC,YAAYL,GAG7B/Q,EAAOqR,QACTrR,EAAOqR,OAAOC,oBAAoB,QAASP,EAE/C,CAIA,GAAI3Q,EAAMhG,WAAW4W,GACnB,GAAIlL,GAASL,uBAAyBK,GAASH,+BAC7CsL,EAAejK,gBAAe,QACzB,IAAwD,KAAnDJ,EAAcqK,EAAepK,kBAA6B,CAEpE,IAAArP,EAA0BoP,EAAcA,EAAYvI,MAAM,KAAKkD,KAAI,SAAAC,GAAK,OAAIA,EAAM/F,MAAM,IAAEc,OAAOgV,SAAW,GAAEvG,MAAAxT,oBAAvGzB,EAAIiV,EAAA,GAAKf,EAAMe,EAAApV,MAAA,GACtBqb,EAAejK,eAAe,CAACjR,GAAQ,uBAA0BkU,OAAAA,EAAAA,IAAQxI,KAAK,MAChF,CAGF,IAAIxB,EAAU,IAAI0Q,eAGlB,GAAI3Q,EAAOwR,KAAM,CACf,IAAMC,EAAWzR,EAAOwR,KAAKC,UAAY,GACnCC,EAAW1R,EAAOwR,KAAKE,SAAWC,SAAStO,mBAAmBrD,EAAOwR,KAAKE,WAAa,GAC7FT,EAAelT,IAAI,gBAAiB,SAAW6T,KAAKH,EAAW,IAAMC,GACvE,CAEA,IAAMG,EAAWtE,GAAcvN,EAAOwN,QAASxN,EAAO2D,KAOtD,SAASmO,IACP,GAAK7R,EAAL,CAIA,IAAM8R,EAAkB7I,GAAatI,KACnC,0BAA2BX,GAAWA,EAAQ+R,0BIpFvC,SAAgBnB,EAASC,EAAQ5Q,GAC9C,IAAMoI,EAAiBpI,EAASF,OAAOsI,eAClCpI,EAASS,QAAW2H,IAAkBA,EAAepI,EAASS,QAGjEmQ,EAAO,IAAIjR,EACT,mCAAqCK,EAASS,OAC9C,CAACd,EAAWoS,gBAAiBpS,EAAWmI,kBAAkB9I,KAAKgT,MAAMhS,EAASS,OAAS,KAAO,GAC9FT,EAASF,OACTE,EAASD,QACTC,IAPF2Q,EAAQ3Q,EAUZ,CJoFMiS,EAAO,SAAkBjW,GACvB2U,EAAQ3U,GACRkB,GACF,IAAG,SAAiBgV,GAClBtB,EAAOsB,GACPhV,GACD,GAfgB,CACfsJ,KAHoBoB,GAAiC,SAAjBA,GAA4C,SAAjBA,EACxC7H,EAAQC,SAA/BD,EAAQoS,aAGR1R,OAAQV,EAAQU,OAChB2R,WAAYrS,EAAQqS,WACpB3L,QAASoL,EACT/R,OAAAA,EACAC,QAAAA,IAYFA,EAAU,IAzBV,CA0BF,CAmEA,GArGAA,EAAQsS,KAAKvS,EAAOyI,OAAO1O,cAAe2J,GAASmO,EAAU7R,EAAOwD,OAAQxD,EAAOwS,mBAAmB,GAGtGvS,EAAQgI,QAAUjI,EAAOiI,QAiCrB,cAAehI,EAEjBA,EAAQ6R,UAAYA,EAGpB7R,EAAQwS,mBAAqB,WACtBxS,GAAkC,IAAvBA,EAAQyS,aAQD,IAAnBzS,EAAQU,QAAkBV,EAAQ0S,aAAwD,IAAzC1S,EAAQ0S,YAAY5V,QAAQ,WAKjF6V,WAAWd,IAKf7R,EAAQ4S,QAAU,WACX5S,IAIL6Q,EAAO,IAAIjR,EAAW,kBAAmBA,EAAWiT,aAAc9S,EAAQC,IAG1EA,EAAU,OAIZA,EAAQ8S,QAAU,WAGhBjC,EAAO,IAAIjR,EAAW,gBAAiBA,EAAWmT,YAAahT,EAAQC,IAGvEA,EAAU,MAIZA,EAAQgT,UAAY,WAClB,IAAIC,EAAsBlT,EAAOiI,QAAU,cAAgBjI,EAAOiI,QAAU,cAAgB,mBACtF1B,EAAevG,EAAOuG,cAAgBzB,GACxC9E,EAAOkT,sBACTA,EAAsBlT,EAAOkT,qBAE/BpC,EAAO,IAAIjR,EACTqT,EACA3M,EAAatB,oBAAsBpF,EAAWsT,UAAYtT,EAAWiT,aACrE9S,EACAC,IAGFA,EAAU,MAMT6F,GAASL,wBACVyL,GAAiB9Q,EAAM7J,WAAW2a,KAAmBA,EAAgBA,EAAclR,IAE/EkR,IAAoC,IAAlBA,GAA2BkC,GAAgBvB,IAAY,CAE3E,IAAMwB,EAAYrT,EAAOmI,gBAAkBnI,EAAOkI,gBAAkBoL,GAAQpG,KAAKlN,EAAOkI,gBAEpFmL,GACFpC,EAAelT,IAAIiC,EAAOmI,eAAgBkL,EAE9C,MAIc3b,IAAhBsZ,GAA6BC,EAAejK,eAAe,MAGvD,qBAAsB/G,GACxBG,EAAMhJ,QAAQ6Z,EAAe5Q,UAAU,SAA0B1J,EAAKkB,GACpEoI,EAAQsT,iBAAiB1b,EAAKlB,EAChC,IAIGyJ,EAAMhK,YAAY4J,EAAOwT,mBAC5BvT,EAAQuT,kBAAoBxT,EAAOwT,iBAIjC1L,GAAiC,SAAjBA,IAClB7H,EAAQ6H,aAAe9H,EAAO8H,cAIS,mBAA9B9H,EAAOyT,oBAChBxT,EAAQyT,iBAAiB,WAAY5E,GAAqB9O,EAAOyT,oBAAoB,IAIhD,mBAA5BzT,EAAO2T,kBAAmC1T,EAAQ2T,QAC3D3T,EAAQ2T,OAAOF,iBAAiB,WAAY5E,GAAqB9O,EAAO2T,oBAGtE3T,EAAOmR,aAAenR,EAAOqR,UAG/BN,EAAa,SAAA8C,GACN5T,IAGL6Q,GAAQ+C,GAAUA,EAAO9d,KAAO,IAAI0W,GAAc,KAAMzM,EAAQC,GAAW4T,GAC3E5T,EAAQ6T,QACR7T,EAAU,OAGZD,EAAOmR,aAAenR,EAAOmR,YAAY4C,UAAUhD,GAC/C/Q,EAAOqR,SACTrR,EAAOqR,OAAO2C,QAAUjD,IAAe/Q,EAAOqR,OAAOqC,iBAAiB,QAAS3C,KAInF,IKrPIzN,ELqPE8K,GKrPF9K,EAAQ,4BAA4B7F,KLqPToU,KKpPjBvO,EAAM,IAAM,GLsPtB8K,IAAsD,IAA1CtI,GAASR,UAAUvI,QAAQqR,GACzC0C,EAAO,IAAIjR,EAAW,wBAA0BuO,EAAW,IAAKvO,EAAWoS,gBAAiBjS,IAM9FC,EAAQgU,KAAKjD,GAAe,KAC9B,GACF,GEzPK/W,EAAC7C,QAAQoZ,IAAe,SAAC1b,EAAIoH,GAChC,GAAIpH,EAAI,CACN,IACEM,OAAO6G,eAAenH,EAAI,OAAQ,CAACoH,MAAAA,GAGrC,CAFE,MAAOwL,GAET,CACAtS,OAAO6G,eAAenH,EAAI,cAAe,CAACoH,MAAAA,GAC5C,CACF,IAEA,IAAMgY,GAAe,SAACC,GAAM,MAAA,KAAA7S,OAAU6S,EAAM,EAEtCC,GAAmB,SAAC5N,GAAO,OAAKpG,EAAM7J,WAAWiQ,IAAwB,OAAZA,IAAgC,IAAZA,CAAiB,EAEzF6N,GACD,SAACA,GASX,IANA,IACIC,EACA9N,EAFG/O,GAFP4c,EAAWjU,EAAMlK,QAAQme,GAAYA,EAAW,CAACA,IAE1C5c,OAID8c,EAAkB,CAAA,EAEfjd,EAAI,EAAGA,EAAIG,EAAQH,IAAK,CAE/B,IAAIsN,OAAE,EAIN,GAFA4B,EAHA8N,EAAgBD,EAAS/c,IAKpB8c,GAAiBE,SAGJ5c,KAFhB8O,EAAUgK,IAAe5L,EAAK/H,OAAOyX,IAAgBze,gBAGnD,MAAM,IAAIgK,EAA+B+E,oBAAAA,OAAAA,EAAM,MAInD,GAAI4B,EACF,MAGF+N,EAAgB3P,GAAM,IAAMtN,GAAKkP,CACnC,CAEA,IAAKA,EAAS,CAEZ,IAAMgO,EAAUpf,OAAOgR,QAAQmO,GAC5BhT,KAAI,SAAA/J,GAAA,IAAAwT,EAAAC,EAAAzT,EAAA,GAAEoN,EAAEoG,EAAA,GAAEyJ,EAAKzJ,EAAA,GAAA,MAAM,WAAA1J,OAAWsD,EAAE,OACtB,IAAV6P,EAAkB,sCAAwC,oCAO/D,MAAM,IAAI5U,EACR,yDALMpI,EACL+c,EAAQ/c,OAAS,EAAI,YAAc+c,EAAQjT,IAAI2S,IAAczS,KAAK,MAAQ,IAAMyS,GAAaM,EAAQ,IACtG,2BAIA,kBAEJ,CAEA,OAAOhO,CACR,EI1DH,SAASkO,GAA6B1U,GAKpC,GAJIA,EAAOmR,aACTnR,EAAOmR,YAAYwD,mBAGjB3U,EAAOqR,QAAUrR,EAAOqR,OAAO2C,QACjC,MAAM,IAAIvH,GAAc,KAAMzM,EAElC,CASe,SAAS4U,GAAgB5U,GAiBtC,OAhBA0U,GAA6B1U,GAE7BA,EAAO2G,QAAUuC,GAAatI,KAAKZ,EAAO2G,SAG1C3G,EAAO0G,KAAO0F,GAAczW,KAC1BqK,EACAA,EAAOyG,mBAGgD,IAArD,CAAC,OAAQ,MAAO,SAAS1J,QAAQiD,EAAOyI,SAC1CzI,EAAO2G,QAAQK,eAAe,qCAAqC,GAGrDqN,GAAoBrU,EAAOwG,SAAWF,GAASE,QAExDA,CAAQxG,GAAQJ,MAAK,SAA6BM,GAYvD,OAXAwU,GAA6B1U,GAG7BE,EAASwG,KAAO0F,GAAczW,KAC5BqK,EACAA,EAAO4H,kBACP1H,GAGFA,EAASyG,QAAUuC,GAAatI,KAAKV,EAASyG,SAEvCzG,CACT,IAAG,SAA4BiU,GAe7B,OAdK5H,GAAS4H,KACZO,GAA6B1U,GAGzBmU,GAAUA,EAAOjU,WACnBiU,EAAOjU,SAASwG,KAAO0F,GAAczW,KACnCqK,EACAA,EAAO4H,kBACPuM,EAAOjU,UAETiU,EAAOjU,SAASyG,QAAUuC,GAAatI,KAAKuT,EAAOjU,SAASyG,WAIzDiK,QAAQE,OAAOqD,EACxB,GACF,CC3EA,IAAMU,GAAkB,SAACpf,GAAK,OAAKA,aAAiByT,GAAezT,EAAM4K,SAAW5K,CAAK,EAW1E,SAASqf,GAAYC,EAASC,GAE3CA,EAAUA,GAAW,GACrB,IAAMhV,EAAS,CAAA,EAEf,SAASiV,EAAexV,EAAQD,EAAQvE,GACtC,OAAImF,EAAM1J,cAAc+I,IAAWW,EAAM1J,cAAc8I,GAC9CY,EAAMrF,MAAMpF,KAAK,CAACsF,SAAAA,GAAWwE,EAAQD,GACnCY,EAAM1J,cAAc8I,GACtBY,EAAMrF,MAAM,CAAE,EAAEyE,GACdY,EAAMlK,QAAQsJ,GAChBA,EAAO5J,QAET4J,CACT,CAGA,SAAS0V,EAAoB5Z,EAAGC,EAAGN,GACjC,OAAKmF,EAAMhK,YAAYmF,GAEX6E,EAAMhK,YAAYkF,QAAvB,EACE2Z,OAAevd,EAAW4D,EAAGL,GAF7Bga,EAAe3Z,EAAGC,EAAGN,EAIhC,CAGA,SAASka,EAAiB7Z,EAAGC,GAC3B,IAAK6E,EAAMhK,YAAYmF,GACrB,OAAO0Z,OAAevd,EAAW6D,EAErC,CAGA,SAAS6Z,EAAiB9Z,EAAGC,GAC3B,OAAK6E,EAAMhK,YAAYmF,GAEX6E,EAAMhK,YAAYkF,QAAvB,EACE2Z,OAAevd,EAAW4D,GAF1B2Z,OAAevd,EAAW6D,EAIrC,CAGA,SAAS8Z,EAAgB/Z,EAAGC,EAAGvC,GAC7B,OAAIA,KAAQgc,EACHC,EAAe3Z,EAAGC,GAChBvC,KAAQ+b,EACVE,OAAevd,EAAW4D,QAD5B,CAGT,CAEA,IAAMga,EAAW,CACf3R,IAAKwR,EACL1M,OAAQ0M,EACRzO,KAAMyO,EACN3H,QAAS4H,EACT3O,iBAAkB2O,EAClBxN,kBAAmBwN,EACnB5C,iBAAkB4C,EAClBnN,QAASmN,EACTG,eAAgBH,EAChB5B,gBAAiB4B,EACjBlE,cAAekE,EACf5O,QAAS4O,EACTtN,aAAcsN,EACdlN,eAAgBkN,EAChBjN,eAAgBiN,EAChBzB,iBAAkByB,EAClB3B,mBAAoB2B,EACpBI,WAAYJ,EACZhN,iBAAkBgN,EAClB/M,cAAe+M,EACfK,eAAgBL,EAChBM,UAAWN,EACXO,UAAWP,EACXQ,WAAYR,EACZjE,YAAaiE,EACbS,WAAYT,EACZU,iBAAkBV,EAClB9M,eAAgB+M,EAChB1O,QAAS,SAACrL,EAAGC,GAAC,OAAK2Z,EAAoBL,GAAgBvZ,GAAIuZ,GAAgBtZ,IAAI,EAAK,GAStF,OANA6E,EAAMhJ,QAAQhC,OAAO0C,KAAK1C,OAAO+G,OAAO,GAAI4Y,EAASC,KAAW,SAA4Bhc,GAC1F,IAAM+B,EAAQua,EAAStc,IAASkc,EAC1Ba,EAAchb,EAAMga,EAAQ/b,GAAOgc,EAAQhc,GAAOA,GACvDoH,EAAMhK,YAAY2f,IAAgBhb,IAAUsa,IAAqBrV,EAAOhH,GAAQ+c,EACnF,IAEO/V,CACT,CCzGO,IAAMgW,GAAU,QCKjBC,GAAa,CAAA,EAGnB,CAAC,SAAU,UAAW,SAAU,WAAY,SAAU,UAAU7e,SAAQ,SAACrB,EAAMuB,GAC7E2e,GAAWlgB,GAAQ,SAAmBN,GACpC,OAAOQ,EAAOR,KAAUM,GAAQ,KAAOuB,EAAI,EAAI,KAAO,KAAOvB,EAEjE,IAEA,IAAMmgB,GAAqB,CAAA,EAWjBC,GAAC5P,aAAe,SAAsB6P,EAAWC,EAASvW,GAClE,SAASwW,EAAcC,EAAKC,GAC1B,MAAO,uCAAoDD,EAAM,IAAOC,GAAQ1W,EAAU,KAAOA,EAAU,GAC7G,CAGA,OAAO,SAAC5D,EAAOqa,EAAKE,GAClB,IAAkB,IAAdL,EACF,MAAM,IAAIvW,EACRyW,EAAcC,EAAK,qBAAuBF,EAAU,OAASA,EAAU,KACvExW,EAAW6W,gBAef,OAXIL,IAAYH,GAAmBK,KACjCL,GAAmBK,IAAO,EAE1BI,QAAQC,KACNN,EACEC,EACA,+BAAiCF,EAAU,8CAK1CD,GAAYA,EAAUla,EAAOqa,EAAKE,GAE7C,EAmCe,IAAAL,GAAA,CACbS,cAxBF,SAAuB/U,EAASgV,EAAQC,GACtC,GAAuB,WAAnB9gB,EAAO6L,GACT,MAAM,IAAIjC,EAAW,4BAA6BA,EAAWmX,sBAI/D,IAFA,IAAMlf,EAAO1C,OAAO0C,KAAKgK,GACrBxK,EAAIQ,EAAKL,OACNH,KAAM,GAAG,CACd,IAAMif,EAAMze,EAAKR,GACX8e,EAAYU,EAAOP,GACzB,GAAIH,EAAJ,CACE,IAAMla,EAAQ4F,EAAQyU,GAChBrb,OAAmBxD,IAAVwE,GAAuBka,EAAUla,EAAOqa,EAAKzU,GAC5D,IAAe,IAAX5G,EACF,MAAM,IAAI2E,EAAW,UAAY0W,EAAM,YAAcrb,EAAQ2E,EAAWmX,qBAG5E,MACA,IAAqB,IAAjBD,EACF,MAAM,IAAIlX,EAAW,kBAAoB0W,EAAK1W,EAAWoX,eAE7D,CACF,EAIEhB,WAAAA,IC9EIA,GAAaG,GAAUH,WASvBiB,GAAK,WACT,SAAAA,EAAYC,GAAgB9S,EAAArJ,KAAAkc,GAC1Blc,KAAKsL,SAAW6Q,EAChBnc,KAAKoc,aAAe,CAClBnX,QAAS,IAAImE,GACblE,SAAU,IAAIkE,GAElB,CAEA,MAQAiT,EAuJC,OA/JD9S,EAAA2S,EAAA,CAAA,CAAArf,IAAA,UAAAqE,SAQAob,IAAAC,MAAA,SAAAC,EAAcC,EAAazX,GAAM,IAAA0X,EAAApY,EAAA,OAAAgY,IAAAK,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAza,MAAA,KAAA,EAAA,OAAAya,EAAAC,KAAA,EAAAD,EAAAza,KAAA,EAEhBnC,KAAK8c,SAASL,EAAazX,GAAO,KAAA,EAAA,OAAA4X,EAAAG,OAAA,SAAAH,EAAAI,MAAA,KAAA,EAgB9C,MAhB8CJ,EAAAC,KAAA,EAAAD,EAAAK,GAAAL,EAAA,MAAA,GAE3CA,EAAAK,cAAeja,QAGjBA,MAAMmC,kBAAoBnC,MAAMmC,kBAAkBuX,EAAQ,CAAA,GAAOA,EAAQ,IAAI1Z,MAGvEsB,EAAQoY,EAAMpY,MAAQoY,EAAMpY,MAAM5D,QAAQ,QAAS,IAAM,GAE1Dkc,EAAItY,GAAAA,MAGEA,IAAUzC,OAAO+a,EAAItY,GAAAA,OAAO5C,SAAS4C,EAAM5D,QAAQ,YAAa,OACzEkc,EAAAK,GAAI3Y,OAAS,KAAOA,GAHpBsY,EAAItY,GAAAA,MAAQA,GAKfsY,EAAAK,GAAA,KAAA,GAAA,IAAA,MAAA,OAAAL,EAAAM,OAAA,GAAAV,EAAAxc,KAAA,CAAA,CAAA,EAAA,IAIJ,IAtBDqc,gLAsBC,SAAAc,EAAAC,GAAA,OAAAf,EAAAriB,MAAAgG,KAAA/F,UAAA,IAAA,CAAA4C,IAAA,WAAAqE,MAED,SAASub,EAAazX,GAGO,iBAAhByX,GACTzX,EAASA,GAAU,IACZ2D,IAAM8T,EAEbzX,EAASyX,GAAe,GAK1B,IAAAY,EAFArY,EAAS8U,GAAY9Z,KAAKsL,SAAUtG,GAE7BuG,IAAAA,aAAciM,IAAAA,iBAAkB7L,IAAAA,aAElBjP,IAAjB6O,GACF6P,GAAUS,cAActQ,EAAc,CACpCxB,kBAAmBkR,GAAW1P,aAAa0P,YAC3CjR,kBAAmBiR,GAAW1P,aAAa0P,YAC3ChR,oBAAqBgR,GAAW1P,aAAa0P,GAAkB,WAC9D,GAGmB,MAApBzD,IACEpS,EAAM7J,WAAWic,GACnBxS,EAAOwS,iBAAmB,CACxBzO,UAAWyO,GAGb4D,GAAUS,cAAcrE,EAAkB,CACxCrP,OAAQ8S,GAAmB,SAC3BlS,UAAWkS,GAAU,WACpB,IAKPjW,EAAOyI,QAAUzI,EAAOyI,QAAUzN,KAAKsL,SAASmC,QAAU,OAAO5S,cAGjE,IAAIyiB,EAAiB3R,GAAWvG,EAAMrF,MACpC4L,EAAQ4B,OACR5B,EAAQ3G,EAAOyI,SAGjB9B,GAAWvG,EAAMhJ,QACf,CAAC,SAAU,MAAO,OAAQ,OAAQ,MAAO,QAAS,WAClD,SAACqR,UACQ9B,EAAQ8B,EACjB,IAGFzI,EAAO2G,QAAUuC,GAAa5H,OAAOgX,EAAgB3R,GAGrD,IAAM4R,EAA0B,GAC5BC,GAAiC,EACrCxd,KAAKoc,aAAanX,QAAQ7I,SAAQ,SAAoCqhB,GACjC,mBAAxBA,EAAY9T,UAA0D,IAAhC8T,EAAY9T,QAAQ3E,KAIrEwY,EAAiCA,GAAkCC,EAAY/T,YAE/E6T,EAAwBG,QAAQD,EAAYjU,UAAWiU,EAAYhU,UACrE,IAEA,IAKIkU,EALEC,EAA2B,GACjC5d,KAAKoc,aAAalX,SAAS9I,SAAQ,SAAkCqhB,GACnEG,EAAyBlb,KAAK+a,EAAYjU,UAAWiU,EAAYhU,SACnE,IAGA,IACIzM,EADAV,EAAI,EAGR,IAAKkhB,EAAgC,CACnC,IAAMK,EAAQ,CAACjE,GAAgB/f,KAAKmG,WAAOtD,GAO3C,IANAmhB,EAAMH,QAAQ1jB,MAAM6jB,EAAON,GAC3BM,EAAMnb,KAAK1I,MAAM6jB,EAAOD,GACxB5gB,EAAM6gB,EAAMphB,OAEZkhB,EAAU/H,QAAQC,QAAQ7Q,GAEnB1I,EAAIU,GACT2gB,EAAUA,EAAQ/Y,KAAKiZ,EAAMvhB,KAAMuhB,EAAMvhB,MAG3C,OAAOqhB,CACT,CAEA3gB,EAAMugB,EAAwB9gB,OAE9B,IAAIqhB,EAAY9Y,EAIhB,IAFA1I,EAAI,EAEGA,EAAIU,GAAK,CACd,IAAM+gB,EAAcR,EAAwBjhB,KACtC0hB,EAAaT,EAAwBjhB,KAC3C,IACEwhB,EAAYC,EAAYD,EAI1B,CAHE,MAAOjY,GACPmY,EAAWrjB,KAAKqF,KAAM6F,GACtB,KACF,CACF,CAEA,IACE8X,EAAU/D,GAAgBjf,KAAKqF,KAAM8d,EAGvC,CAFE,MAAOjY,GACP,OAAO+P,QAAQE,OAAOjQ,EACxB,CAKA,IAHAvJ,EAAI,EACJU,EAAM4gB,EAAyBnhB,OAExBH,EAAIU,GACT2gB,EAAUA,EAAQ/Y,KAAKgZ,EAAyBthB,KAAMshB,EAAyBthB,MAGjF,OAAOqhB,CACT,GAAC,CAAA9gB,IAAA,SAAAqE,MAED,SAAO8D,GAGL,OAAO0D,GADU6J,IADjBvN,EAAS8U,GAAY9Z,KAAKsL,SAAUtG,IACEwN,QAASxN,EAAO2D,KAC5B3D,EAAOwD,OAAQxD,EAAOwS,iBAClD,KAAC0E,CAAA,CAxKQ,GA4KX9W,EAAMhJ,QAAQ,CAAC,SAAU,MAAO,OAAQ,YAAY,SAA6BqR,GAE/EyO,GAAM7hB,UAAUoT,GAAU,SAAS9E,EAAK3D,GACtC,OAAOhF,KAAKiF,QAAQ6U,GAAY9U,GAAU,CAAA,EAAI,CAC5CyI,OAAAA,EACA9E,IAAAA,EACA+C,MAAO1G,GAAU,CAAA,GAAI0G,QAG3B,IAEAtG,EAAMhJ,QAAQ,CAAC,OAAQ,MAAO,UAAU,SAA+BqR,GAGrE,SAASwQ,EAAmBC,GAC1B,OAAO,SAAoBvV,EAAK+C,EAAM1G,GACpC,OAAOhF,KAAKiF,QAAQ6U,GAAY9U,GAAU,CAAA,EAAI,CAC5CyI,OAAAA,EACA9B,QAASuS,EAAS,CAChB,eAAgB,uBACd,CAAE,EACNvV,IAAAA,EACA+C,KAAAA,KAGN,CAEAwQ,GAAM7hB,UAAUoT,GAAUwQ,IAE1B/B,GAAM7hB,UAAUoT,EAAS,QAAUwQ,GAAmB,EACxD,IAEA,IAAAE,GAAejC,GCxGfkC,GA7GiB,WACf,SAAAC,EAAYC,GACV,GADoBjV,EAAArJ,KAAAqe,GACI,mBAAbC,EACT,MAAM,IAAIvX,UAAU,gCAGtB,IAAIwX,EAEJve,KAAK2d,QAAU,IAAI/H,SAAQ,SAAyBC,GAClD0I,EAAiB1I,CACnB,IAEA,IAAMrP,EAAQxG,KAGdA,KAAK2d,QAAQ/Y,MAAK,SAAAiU,GAChB,GAAKrS,EAAMgY,WAAX,CAIA,IAFA,IAAIliB,EAAIkK,EAAMgY,WAAW/hB,OAElBH,KAAM,GACXkK,EAAMgY,WAAWliB,GAAGuc,GAEtBrS,EAAMgY,WAAa,IAPI,CAQzB,IAGAxe,KAAK2d,QAAQ/Y,KAAO,SAAA6Z,GAClB,IAAIC,EAEEf,EAAU,IAAI/H,SAAQ,SAAAC,GAC1BrP,EAAMuS,UAAUlD,GAChB6I,EAAW7I,CACb,IAAGjR,KAAK6Z,GAMR,OAJAd,EAAQ9E,OAAS,WACfrS,EAAM4P,YAAYsI,IAGbf,GAGTW,GAAS,SAAgBxZ,EAASE,EAAQC,GACpCuB,EAAM2S,SAKV3S,EAAM2S,OAAS,IAAI1H,GAAc3M,EAASE,EAAQC,GAClDsZ,EAAe/X,EAAM2S,QACvB,GACF,CAuDC,OArDD5P,EAAA8U,EAAA,CAAA,CAAAxhB,IAAA,mBAAAqE,MAGA,WACE,GAAIlB,KAAKmZ,OACP,MAAMnZ,KAAKmZ,MAEf,GAEA,CAAAtc,IAAA,YAAAqE,MAIA,SAAU6S,GACJ/T,KAAKmZ,OACPpF,EAAS/T,KAAKmZ,QAIZnZ,KAAKwe,WACPxe,KAAKwe,WAAW9b,KAAKqR,GAErB/T,KAAKwe,WAAa,CAACzK,EAEvB,GAEA,CAAAlX,IAAA,cAAAqE,MAIA,SAAY6S,GACV,GAAK/T,KAAKwe,WAAV,CAGA,IAAMzW,EAAQ/H,KAAKwe,WAAWzc,QAAQgS,IACvB,IAAXhM,GACF/H,KAAKwe,WAAWG,OAAO5W,EAAO,EAHhC,CAKF,IAEA,CAAA,CAAAlL,IAAA,SAAAqE,MAIA,WACE,IAAI2X,EAIJ,MAAO,CACLrS,MAJY,IAAI6X,GAAY,SAAkBO,GAC9C/F,EAAS+F,CACX,IAGE/F,OAAAA,EAEJ,KAACwF,CAAA,CA1Gc,GCXjB,IAAMQ,GAAiB,CACrBC,SAAU,IACVC,mBAAoB,IACpBC,WAAY,IACZC,WAAY,IACZC,GAAI,IACJC,QAAS,IACTC,SAAU,IACVC,4BAA6B,IAC7BC,UAAW,IACXC,aAAc,IACdC,eAAgB,IAChBC,YAAa,IACbC,gBAAiB,IACjBC,OAAQ,IACRC,gBAAiB,IACjBC,iBAAkB,IAClBC,MAAO,IACPC,SAAU,IACVC,YAAa,IACbC,SAAU,IACVC,OAAQ,IACRC,kBAAmB,IACnBC,kBAAmB,IACnBC,WAAY,IACZC,aAAc,IACdC,gBAAiB,IACjBC,UAAW,IACXC,SAAU,IACVC,iBAAkB,IAClBC,cAAe,IACfC,4BAA6B,IAC7BC,eAAgB,IAChBC,SAAU,IACVC,KAAM,IACNC,eAAgB,IAChBC,mBAAoB,IACpBC,gBAAiB,IACjBC,WAAY,IACZC,qBAAsB,IACtBC,oBAAqB,IACrBC,kBAAmB,IACnBC,UAAW,IACXC,mBAAoB,IACpBC,oBAAqB,IACrBC,OAAQ,IACRC,iBAAkB,IAClBC,SAAU,IACVC,gBAAiB,IACjBC,qBAAsB,IACtBC,gBAAiB,IACjBC,4BAA6B,IAC7BC,2BAA4B,IAC5BC,oBAAqB,IACrBC,eAAgB,IAChBC,WAAY,IACZC,mBAAoB,IACpBC,eAAgB,IAChBC,wBAAyB,IACzBC,sBAAuB,IACvBC,oBAAqB,IACrBC,aAAc,IACdC,YAAa,IACbC,8BAA+B,KAGjCxoB,OAAOgR,QAAQyT,IAAgBziB,SAAQ,SAAkBI,GAAA,IAAAwT,EAAAC,EAAAzT,EAAA,GAAhBK,EAAGmT,EAAA,GAAE9O,EAAK8O,EAAA,GACjD6O,GAAe3d,GAASrE,CAC1B,IAEA,IAAAgmB,GAAehE,GCxBf,IAAMiE,GAnBN,SAASC,EAAeC,GACtB,IAAMvlB,EAAU,IAAIye,GAAM8G,GACpBC,EAAWppB,EAAKqiB,GAAM7hB,UAAU4K,QAASxH,GAa/C,OAVA2H,EAAM/E,OAAO4iB,EAAU/G,GAAM7hB,UAAWoD,EAAS,CAACb,YAAY,IAG9DwI,EAAM/E,OAAO4iB,EAAUxlB,EAAS,KAAM,CAACb,YAAY,IAGnDqmB,EAASzoB,OAAS,SAAgB2hB,GAChC,OAAO4G,EAAejJ,GAAYkJ,EAAe7G,KAG5C8G,CACT,CAGcF,CAAezX,WAG7BwX,GAAM5G,MAAQA,GAGd4G,GAAMrR,cAAgBA,GACtBqR,GAAMzE,YAAcA,GACpByE,GAAMvR,SAAWA,GACjBuR,GAAM9H,QAAUA,GAChB8H,GAAMlc,WAAaA,GAGnBkc,GAAMje,WAAaA,EAGnBie,GAAMI,OAASJ,GAAMrR,cAGrBqR,GAAMK,IAAM,SAAaC,GACvB,OAAOxN,QAAQuN,IAAIC,EACrB,EAEAN,GAAMO,OC9CS,SAAgBC,GAC7B,OAAO,SAAcrhB,GACnB,OAAOqhB,EAAStpB,MAAM,KAAMiI,GAEhC,ED6CA6gB,GAAMS,aE7DS,SAAsBC,GACnC,OAAOpe,EAAM3J,SAAS+nB,KAAsC,IAAzBA,EAAQD,YAC7C,EF8DAT,GAAMhJ,YAAcA,GAEpBgJ,GAAM5U,aAAeA,GAErB4U,GAAMW,WAAa,SAAAhpB,GAAK,OAAIsQ,GAAe3F,EAAMvH,WAAWpD,GAAS,IAAI6E,SAAS7E,GAASA,EAAM,EAEjGqoB,GAAMY,WAAarK,GAEnByJ,GAAMjE,eAAiBA,GAEvBiE,GAAK,QAAWA"} \ No newline at end of file diff --git a/node_modules/axios/dist/browser/axios.cjs b/node_modules/axios/dist/browser/axios.cjs new file mode 100644 index 00000000..7043a0b5 --- /dev/null +++ b/node_modules/axios/dist/browser/axios.cjs @@ -0,0 +1,3258 @@ +// Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors +'use strict'; + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +}; + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +}; + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +}; + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + }; + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +}; + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +}; + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +}; + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +}; + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +}; + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +}; + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +}; + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + }; + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +}; + +const noop = () => {}; + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +}; + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +}; + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0]; + } + + return str; +}; + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + }; + + return visit(obj, 0); +}; + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); + +var utils$1 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable +}; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +utils$1.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype$1 = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype$1, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +// eslint-disable-next-line strict +var httpAdapter = null; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils$1.isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils$1.isArray(value) && isFlatArray(value)) || + ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils$1.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils$1.forEach(value, function each(el, key) { + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( + formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode$1(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +var InterceptorManager$1 = InterceptorManager; + +var transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; + +var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; + +var FormData$1 = typeof FormData !== 'undefined' ? FormData : null; + +var Blob$1 = typeof Blob !== 'undefined' ? Blob : null; + +var platform$1 = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams$1, + FormData: FormData$1, + Blob: Blob$1 + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}; + +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = ( + (product) => { + return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 + })(typeof navigator !== 'undefined' && navigator.product); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +var utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv +}); + +var platform = { + ...utils, + ...platform$1 +}; + +function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + const obj = {}; + + utils$1.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils$1.isObject(data); + + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils$1.isFormData(data); + + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (utils$1.isArrayBuffer(data) || + utils$1.isBuffer(data) || + utils$1.isStream(data) || + utils$1.isFile(data) || + utils$1.isBlob(data) + ) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } +}; + +utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +var defaults$1 = defaults; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils$1.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +var parseHeaders = rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils$1.isString(value)) return; + + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils$1.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils$1.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + } +}); + +utils$1.freezeMethods(AxiosHeaders); + +var AxiosHeaders$1 = AxiosHeaders; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || defaults$1; + const context = response || config; + const headers = AxiosHeaders$1.from(context.headers); + let data = context.data; + + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils$1.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + +var cookies = platform.hasStandardBrowserEnv ? + + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure) { + const cookie = [name + '=' + encodeURIComponent(value)]; + + utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); + + utils$1.isString(path) && cookie.push('path=' + path); + + utils$1.isString(domain) && cookie.push('domain=' + domain); + + secure === true && cookie.push('secure'); + + document.cookie = cookie.join('; '); + }, + + read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000); + } + } + + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +var isURLSameOrigin = platform.hasStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover its components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })(); + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +var xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = AxiosHeaders$1.from(config.headers).normalize(); + let {responseType, withXSRFToken} = config; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + let contentType; + + if (utils$1.isFormData(requestData)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + requestHeaders.setContentType(false); // Let the browser set it + } else if ((contentType = requestHeaders.getContentType()) !== false) { + // fix semicolon duplication issue for ReactNative FormData implementation + const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; + requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); + } + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = buildFullPath(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders$1.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if(platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) { + // Add xsrf header + const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(fullPath); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}; + +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter +}; + +utils$1.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +const renderReason = (reason) => `- ${reason}`; + +const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; + +var adapters = { + getAdapter: (adapters) => { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; + } + + if (!adapter) { + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; + }, + adapters: knownAdapters +}; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders$1.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders$1.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + +const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({caseless}, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + +const VERSION = "1.6.7"; + +const validators$1 = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators$1[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} + +var validator = { + assertOptions, + validators: validators$1 +}; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy; + + Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack; + } + } + + throw err; + } + } + + _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils$1.merge( + headers.common, + headers[config.method] + ); + + headers && utils$1.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +var Axios$1 = Axios; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +var CancelToken$1 = CancelToken; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return utils$1.isObject(payload) && (payload.isAxiosError === true); +} + +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +var HttpStatusCode$1 = HttpStatusCode; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios$1(defaultConfig); + const instance = bind(Axios$1.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils$1.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults$1); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios$1; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken$1; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; + +// Expose AxiosError class +axios.AxiosError = AxiosError; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig; + +axios.AxiosHeaders = AxiosHeaders$1; + +axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode$1; + +axios.default = axios; + +module.exports = axios; +//# sourceMappingURL=axios.cjs.map diff --git a/node_modules/axios/dist/browser/axios.cjs.map b/node_modules/axios/dist/browser/axios.cjs.map new file mode 100644 index 00000000..b4b8baac --- /dev/null +++ b/node_modules/axios/dist/browser/axios.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.cjs","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/null.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/browser/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/cookies.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/speedometer.js","../../lib/adapters/xhr.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/core/mergeConfig.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["utils","prototype","encode","URLSearchParams","FormData","Blob","platform","defaults","AxiosHeaders","validators","InterceptorManager","Axios","CancelToken","HttpStatusCode"],"mappings":";;;AAEe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACFA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,KAAK,IAAI;AAClC,IAAI,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB;AACA,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK;AAC7B,EAAE,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,EAAE,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI;AAC1C,EAAC;AACD;AACA,MAAM,UAAU,GAAG,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,GAAG,EAAE;AACvB,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;AACvG,OAAO,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB,CAAC,GAAG,EAAE;AAChC,EAAE,IAAI,MAAM,CAAC;AACb,EAAE,IAAI,CAAC,OAAO,WAAW,KAAK,WAAW,MAAM,WAAW,CAAC,MAAM,CAAC,EAAE;AACpE,IAAI,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACrC,GAAG,MAAM;AACT,IAAI,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,KAAK,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAClE,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;AAChC,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AACxC,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,IAAI,KAAK,EAAE,MAAM,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;AAC1K,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,CAAC,KAAK,KAAK;AAC9B,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,OAAO,KAAK;AACd,IAAI,CAAC,OAAO,QAAQ,KAAK,UAAU,IAAI,KAAK,YAAY,QAAQ;AAChE,MAAM,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;AAC9B,QAAQ,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,UAAU;AAC7C;AACA,SAAS,IAAI,KAAK,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,KAAK,mBAAmB,CAAC;AACrG,OAAO;AACP,KAAK;AACL,GAAG;AACH,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI;AAC9B,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,oCAAoC,EAAE,EAAE,CAAC,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,UAAU,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE;AACrD;AACA,EAAE,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;AAClD,IAAI,OAAO;AACX,GAAG;AACH;AACA,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,IAAI,CAAC,CAAC;AACR;AACA;AACA,EAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC/B;AACA,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAChB,GAAG;AACH;AACA,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;AACpB;AACA,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC5C,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AACpC,KAAK;AACL,GAAG,MAAM;AACT;AACA,IAAI,MAAM,IAAI,GAAG,UAAU,GAAG,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjF,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;AAC5B,IAAI,IAAI,GAAG,CAAC;AACZ;AACA,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACxC,KAAK;AACL,GAAG;AACH,CAAC;AACD;AACA,SAAS,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE;AAC3B,EAAE,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;AAC1B,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACtB,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACnB,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE;AACpC,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA,MAAM,OAAO,GAAG,CAAC,MAAM;AACvB;AACA,EAAE,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,OAAO,UAAU,CAAC;AAC3D,EAAE,OAAO,OAAO,IAAI,KAAK,WAAW,GAAG,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAC/F,CAAC,GAAG,CAAC;AACL;AACA,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,OAAO,CAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,KAAK,8BAA8B;AAC5C,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;AAC1D,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK;AACpC,IAAI,MAAM,SAAS,GAAG,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC;AAC9D,IAAI,IAAI,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;AAChE,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,KAAK,MAAM,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;AACnC,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AACzC,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;AAC7B,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC;AACtC,KAAK,MAAM;AACX,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC;AAC9B,KAAK;AACL,IAAG;AACH;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AACpD,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AACvD,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK;AACpD,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK;AAC3B,IAAI,IAAI,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE;AACpC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAClC,KAAK,MAAM;AACX,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AACnB,KAAK;AACL,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACnB,EAAE,OAAO,CAAC,CAAC;AACX,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,OAAO,KAAK;AAC9B,EAAE,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE;AACxC,IAAI,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC/B,GAAG;AACH,EAAE,OAAO,OAAO,CAAC;AACjB,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,KAAK;AACxE,EAAE,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACjF,EAAE,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAClD,EAAE,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,OAAO,EAAE;AAC9C,IAAI,KAAK,EAAE,gBAAgB,CAAC,SAAS;AACrC,GAAG,CAAC,CAAC;AACL,EAAE,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACvD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,KAAK;AACjE,EAAE,IAAI,KAAK,CAAC;AACZ,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB;AACA,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B;AACA,EAAE,IAAI,SAAS,IAAI,IAAI,EAAE,OAAO,OAAO,CAAC;AACxC;AACA,EAAE,GAAG;AACL,IAAI,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AAClD,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AACrB,IAAI,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AACpB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AAClF,QAAQ,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AACxC,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAC5B,OAAO;AACP,KAAK;AACL,IAAI,SAAS,GAAG,MAAM,KAAK,KAAK,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AAC9D,GAAG,QAAQ,SAAS,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE;AACnG;AACA,EAAE,OAAO,OAAO,CAAC;AACjB,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,KAAK;AAClD,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,EAAE,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE;AACvD,IAAI,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC;AAC1B,GAAG;AACH,EAAE,QAAQ,IAAI,YAAY,CAAC,MAAM,CAAC;AAClC,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AACxD,EAAE,OAAO,SAAS,KAAK,CAAC,CAAC,IAAI,SAAS,KAAK,QAAQ,CAAC;AACpD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO,GAAG,CAAC,KAAK,KAAK;AAC3B,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC;AAC1B,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;AACnC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AACvB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC;AAChC,EAAE,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3B,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACtB,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,UAAU,IAAI;AACpC;AACA,EAAE,OAAO,KAAK,IAAI;AAClB,IAAI,OAAO,UAAU,IAAI,KAAK,YAAY,UAAU,CAAC;AACrD,GAAG,CAAC;AACJ,CAAC,EAAE,OAAO,UAAU,KAAK,WAAW,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK;AAClC,EAAE,MAAM,SAAS,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChD;AACA,EAAE,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC;AACA,EAAE,IAAI,MAAM,CAAC;AACb;AACA,EAAE,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;AACrD,IAAI,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AAC9B,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,GAAG;AACH,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK;AAClC,EAAE,IAAI,OAAO,CAAC;AACd,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB;AACA,EAAE,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE;AAChD,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACtB,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACjD;AACA,MAAM,WAAW,GAAG,GAAG,IAAI;AAC3B,EAAE,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,uBAAuB;AAC1D,IAAI,SAAS,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;AACjC,MAAM,OAAO,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC;AACnC,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,CAAC;AACF;AACA;AACA,MAAM,cAAc,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,KAAK,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK;AAC5C,EAAE,MAAM,WAAW,GAAG,MAAM,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;AAC5D,EAAE,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAChC;AACA,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,IAAI,KAAK;AAC7C,IAAI,IAAI,GAAG,CAAC;AACZ,IAAI,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,KAAK,EAAE;AAC1D,MAAM,kBAAkB,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC;AACnD,KAAK;AACL,GAAG,CAAC,CAAC;AACL;AACA,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;AACnD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,iBAAiB,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,IAAI,KAAK;AAC/C;AACA,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;AACnF,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL;AACA,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B;AACA,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO;AACnC;AACA,IAAI,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;AAClC;AACA,IAAI,IAAI,UAAU,IAAI,UAAU,EAAE;AAClC,MAAM,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;AAClC,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;AACzB,MAAM,UAAU,CAAC,GAAG,GAAG,MAAM;AAC7B,QAAQ,MAAM,KAAK,CAAC,qCAAqC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACzE,OAAO,CAAC;AACR,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAC;AACD;AACA,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,SAAS,KAAK;AAClD,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB;AACA,EAAE,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK;AAC1B,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI;AACzB,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AACxB,KAAK,CAAC,CAAC;AACP,IAAG;AACH;AACA,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AAClG;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA,MAAM,IAAI,GAAG,MAAM,GAAE;AACrB;AACA,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK;AAChD,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC;AACjB,EAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,YAAY,CAAC;AACvD,EAAC;AACD;AACA,MAAM,KAAK,GAAG,6BAA4B;AAC1C;AACA,MAAM,KAAK,GAAG,YAAY,CAAC;AAC3B;AACA,MAAM,QAAQ,GAAG;AACjB,EAAE,KAAK;AACP,EAAE,KAAK;AACP,EAAE,WAAW,EAAE,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,KAAK;AAClD,EAAC;AACD;AACA,MAAM,cAAc,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAAC,WAAW,KAAK;AACvE,EAAE,IAAI,GAAG,GAAG,EAAE,CAAC;AACf,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;AAC5B,EAAE,OAAO,IAAI,EAAE,EAAE;AACjB,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,EAAC;AAC7C,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB,CAAC,KAAK,EAAE;AACpC,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,UAAU,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrH,CAAC;AACD;AACA,MAAM,YAAY,GAAG,CAAC,GAAG,KAAK;AAC9B,EAAE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;AAC9B;AACA,EAAE,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK;AAC/B;AACA,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC1B,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AACtC,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,GAAG,EAAE,QAAQ,IAAI,MAAM,CAAC,EAAE;AAChC,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAC1B,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;AACjD;AACA,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK;AACxC,UAAU,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;AACrE,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAC7B;AACA,QAAQ,OAAO,MAAM,CAAC;AACtB,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC;AAClB,IAAG;AACH;AACA,EAAE,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACvB,EAAC;AACD;AACA,MAAM,SAAS,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;AAC9C;AACA,MAAM,UAAU,GAAG,CAAC,KAAK;AACzB,EAAE,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvG;AACA,cAAe;AACf,EAAE,OAAO;AACT,EAAE,aAAa;AACf,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,iBAAiB;AACnB,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,SAAS;AACX,EAAE,QAAQ;AACV,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,QAAQ;AACV,EAAE,iBAAiB;AACnB,EAAE,YAAY;AACd,EAAE,UAAU;AACZ,EAAE,OAAO;AACT,EAAE,KAAK;AACP,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,YAAY;AACd,EAAE,MAAM;AACR,EAAE,UAAU;AACZ,EAAE,QAAQ;AACV,EAAE,OAAO;AACT,EAAE,YAAY;AACd,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,cAAc;AAChB,EAAE,UAAU,EAAE,cAAc;AAC5B,EAAE,iBAAiB;AACnB,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,WAAW;AACb,EAAE,IAAI;AACN,EAAE,cAAc;AAChB,EAAE,OAAO;AACT,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,gBAAgB;AAClB,EAAE,QAAQ;AACV,EAAE,cAAc;AAChB,EAAE,mBAAmB;AACrB,EAAE,YAAY;AACd,EAAE,SAAS;AACX,EAAE,UAAU;AACZ,CAAC;;AC9sBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;AAC9D,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnB;AACA,EAAE,IAAI,KAAK,CAAC,iBAAiB,EAAE;AAC/B,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACpD,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,EAAE,EAAE,KAAK,CAAC;AACrC,GAAG;AACH;AACA,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;AAC3B,EAAE,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAC7B,EAAE,MAAM,KAAK,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AACnC,EAAE,OAAO,KAAK,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;AACtC,EAAE,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;AACzC,CAAC;AACD;AACAA,OAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAE;AAClC,EAAE,MAAM,EAAE,SAAS,MAAM,GAAG;AAC5B,IAAI,OAAO;AACX;AACA,MAAM,OAAO,EAAE,IAAI,CAAC,OAAO;AAC3B,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI;AACrB;AACA,MAAM,WAAW,EAAE,IAAI,CAAC,WAAW;AACnC,MAAM,MAAM,EAAE,IAAI,CAAC,MAAM;AACzB;AACA,MAAM,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC7B,MAAM,UAAU,EAAE,IAAI,CAAC,UAAU;AACjC,MAAM,YAAY,EAAE,IAAI,CAAC,YAAY;AACrC,MAAM,KAAK,EAAE,IAAI,CAAC,KAAK;AACvB;AACA,MAAM,MAAM,EAAEA,OAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;AAC7C,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI;AACrB,MAAM,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI;AACjF,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACA,MAAMC,WAAS,GAAG,UAAU,CAAC,SAAS,CAAC;AACvC,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB;AACA;AACA,EAAE,sBAAsB;AACxB,EAAE,gBAAgB;AAClB,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,aAAa;AACf,EAAE,2BAA2B;AAC7B,EAAE,gBAAgB;AAClB,EAAE,kBAAkB;AACpB,EAAE,iBAAiB;AACnB,EAAE,cAAc;AAChB,EAAE,iBAAiB;AACnB,EAAE,iBAAiB;AACnB;AACA,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI;AAClB,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC;AACH;AACA,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACjD,MAAM,CAAC,cAAc,CAACA,WAAS,EAAE,cAAc,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAChE;AACA;AACA,UAAU,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,KAAK;AAC3E,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAACA,WAAS,CAAC,CAAC;AAC9C;AACA,EAAED,OAAK,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,MAAM,CAAC,GAAG,EAAE;AAC7D,IAAI,OAAO,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC;AACnC,GAAG,EAAE,IAAI,IAAI;AACb,IAAI,OAAO,IAAI,KAAK,cAAc,CAAC;AACnC,GAAG,CAAC,CAAC;AACL;AACA,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC9E;AACA,EAAE,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B;AACA,EAAE,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC/B;AACA,EAAE,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACxD;AACA,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;;ACjGD;AACA,kBAAe,IAAI;;ACMnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,EAAE,OAAOA,OAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,GAAG,EAAE;AAC7B,EAAE,OAAOA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC5D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;AACpC,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,CAAC;AACxB,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE;AACtD;AACA,IAAI,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAClC,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;AAClD,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC;AAC3B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,GAAG,EAAE;AAC1B,EAAE,OAAOA,OAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACtD,CAAC;AACD;AACA,MAAM,UAAU,GAAGA,OAAK,CAAC,YAAY,CAACA,OAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE;AAC7E,EAAE,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC5C,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;AACpD,GAAG;AACH;AACA;AACA,EAAE,QAAQ,GAAG,QAAQ,IAAI,KAAyB,QAAQ,GAAG,CAAC;AAC9D;AACA;AACA,EAAE,OAAO,GAAGA,OAAK,CAAC,YAAY,CAAC,OAAO,EAAE;AACxC,IAAI,UAAU,EAAE,IAAI;AACpB,IAAI,IAAI,EAAE,KAAK;AACf,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG,EAAE,KAAK,EAAE,SAAS,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE;AAC7C;AACA,IAAI,OAAO,CAACA,OAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9C,GAAG,CAAC,CAAC;AACL;AACA,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;AACxC;AACA,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC;AACpD,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAC5B,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC;AACpE,EAAE,MAAM,OAAO,GAAG,KAAK,IAAIA,OAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC/D;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AAClC,IAAI,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;AACtD,GAAG;AACH;AACA,EAAE,SAAS,YAAY,CAAC,KAAK,EAAE;AAC/B,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE,OAAO,EAAE,CAAC;AAClC;AACA,IAAI,IAAIA,OAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AAC7B,MAAM,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AACjC,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,IAAIA,OAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AACzC,MAAM,MAAM,IAAI,UAAU,CAAC,8CAA8C,CAAC,CAAC;AAC3E,KAAK;AACL;AACA,IAAI,IAAIA,OAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;AACjE,MAAM,OAAO,OAAO,IAAI,OAAO,IAAI,KAAK,UAAU,GAAG,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5F,KAAK;AACL;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;AAC5C,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC;AACpB;AACA,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACrD,MAAM,IAAIA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE;AACrC;AACA,QAAQ,GAAG,GAAG,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAClD;AACA,QAAQ,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACtC,OAAO,MAAM;AACb,QAAQ,CAACA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC;AACnD,SAAS,CAACA,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC/F,SAAS,EAAE;AACX;AACA,QAAQ,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAClC;AACA,QAAQ,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE;AAC7C,UAAU,EAAEA,OAAK,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,QAAQ,CAAC,MAAM;AACpE;AACA,YAAY,OAAO,KAAK,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,OAAO,KAAK,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AACpG,YAAY,YAAY,CAAC,EAAE,CAAC;AAC5B,WAAW,CAAC;AACZ,SAAS,CAAC,CAAC;AACX,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE;AAC5B,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL;AACA,IAAI,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;AACnD,IAAI,cAAc;AAClB,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,GAAG,CAAC,CAAC;AACL;AACA,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;AAC9B,IAAI,IAAIA,OAAK,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,OAAO;AACzC;AACA,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;AACrC,MAAM,MAAM,KAAK,CAAC,iCAAiC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACtE,KAAK;AACL;AACA,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtB;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE;AAChD,MAAM,MAAM,MAAM,GAAG,EAAEA,OAAK,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI;AAC5E,QAAQ,QAAQ,EAAE,EAAE,EAAEA,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,cAAc;AAClF,OAAO,CAAC;AACR;AACA,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC3B,QAAQ,KAAK,CAAC,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,OAAO;AACP,KAAK,CAAC,CAAC;AACP;AACA,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AAChB,GAAG;AACH;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAC;AAClD,GAAG;AACH;AACA,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AACb;AACA,EAAE,OAAO,QAAQ,CAAC;AAClB;;ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,QAAM,CAAC,GAAG,EAAE;AACrB,EAAE,MAAM,OAAO,GAAG;AAClB,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,KAAK,EAAE,GAAG;AACd,IAAI,KAAK,EAAE,MAAM;AACjB,GAAG,CAAC;AACJ,EAAE,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,SAAS,QAAQ,CAAC,KAAK,EAAE;AACtF,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1B,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE;AAC/C,EAAE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,MAAM,IAAI,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AACD;AACA,MAAM,SAAS,GAAG,oBAAoB,CAAC,SAAS,CAAC;AACjD;AACA,SAAS,CAAC,MAAM,GAAG,SAAS,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;AAChD,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC,CAAC;AACF;AACA,SAAS,CAAC,QAAQ,GAAG,SAAS,QAAQ,CAAC,OAAO,EAAE;AAChD,EAAE,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,KAAK,EAAE;AAC5C,IAAI,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAEA,QAAM,CAAC,CAAC;AAC7C,GAAG,GAAGA,QAAM,CAAC;AACb;AACA,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE;AAC7C,IAAI,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;;AClDD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE;AACrB,EAAE,OAAO,kBAAkB,CAAC,GAAG,CAAC;AAChC,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;AACxB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;AACxB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;AACvD;AACA,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,MAAM,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC;AACtD;AACA,EAAE,MAAM,WAAW,GAAG,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;AACnD;AACA,EAAE,IAAI,gBAAgB,CAAC;AACvB;AACA,EAAE,IAAI,WAAW,EAAE;AACnB,IAAI,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,GAAG,MAAM;AACT,IAAI,gBAAgB,GAAGF,OAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC;AACtD,MAAM,MAAM,CAAC,QAAQ,EAAE;AACvB,MAAM,IAAI,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClE,GAAG;AACH;AACA,EAAE,IAAI,gBAAgB,EAAE;AACxB,IAAI,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC3C;AACA,IAAI,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;AAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AACxC,KAAK;AACL,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,gBAAgB,CAAC;AACpE,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb;;AC1DA,MAAM,kBAAkB,CAAC;AACzB,EAAE,WAAW,GAAG;AAChB,IAAI,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;AACvB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE;AACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;AACvB,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,GAAG,KAAK;AACxD,MAAM,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI;AAC/C,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;AACpC,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,KAAK,CAAC,EAAE,EAAE;AACZ,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;AAC3B,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;AAC/B,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,KAAK,GAAG;AACV,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;AACvB,MAAM,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;AACzB,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,CAAC,EAAE,EAAE;AACd,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,cAAc,CAAC,CAAC,EAAE;AAC5D,MAAM,IAAI,CAAC,KAAK,IAAI,EAAE;AACtB,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACd,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH,CAAC;AACD;AACA,2BAAe,kBAAkB;;ACpEjC,2BAAe;AACf,EAAE,iBAAiB,EAAE,IAAI;AACzB,EAAE,iBAAiB,EAAE,IAAI;AACzB,EAAE,mBAAmB,EAAE,KAAK;AAC5B,CAAC;;ACHD,wBAAe,OAAO,eAAe,KAAK,WAAW,GAAG,eAAe,GAAG,oBAAoB;;ACD9F,iBAAe,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,GAAG,IAAI;;ACAhE,aAAe,OAAO,IAAI,KAAK,WAAW,GAAG,IAAI,GAAG;;ACEpD,iBAAe;AACf,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,OAAO,EAAE;AACX,qBAAIG,iBAAe;AACnB,cAAIC,UAAQ;AACZ,UAAIC,MAAI;AACR,GAAG;AACH,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;AAC7D,CAAC;;ACZD,MAAM,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,qBAAqB,GAAG;AAC9B,EAAE,CAAC,OAAO,KAAK;AACf,IAAI,OAAO,aAAa,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;AACtF,GAAG,EAAE,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8BAA8B,GAAG,CAAC,MAAM;AAC9C,EAAE;AACF,IAAI,OAAO,iBAAiB,KAAK,WAAW;AAC5C;AACA,IAAI,IAAI,YAAY,iBAAiB;AACrC,IAAI,OAAO,IAAI,CAAC,aAAa,KAAK,UAAU;AAC5C,IAAI;AACJ,CAAC,GAAG;;;;;;;;;ACrCJ,eAAe;AACf,EAAE,GAAG,KAAK;AACV,EAAE,GAAGC,UAAQ;AACb;;ACAe,SAAS,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;AACxD,EAAE,OAAO,UAAU,CAAC,IAAI,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC;AAChF,IAAI,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;AACjD,MAAM,IAAI,QAAQ,CAAC,MAAM,IAAIN,OAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpD,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnD,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO;AACP;AACA,MAAM,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC3D,KAAK;AACL,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACf;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B;AACA;AACA;AACA;AACA,EAAE,OAAOA,OAAK,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI;AAC5D,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AACzD,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;AAC1B,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC5B,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,QAAQ,EAAE;AAClC,EAAE,SAAS,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AACjD,IAAI,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;AAC7B;AACA,IAAI,IAAI,IAAI,KAAK,WAAW,EAAE,OAAO,IAAI,CAAC;AAC1C;AACA,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;AAChD,IAAI,MAAM,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC;AACxC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;AACjE;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;AAC1C,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AAC7C,OAAO,MAAM;AACb,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;AAC7B,OAAO;AACP;AACA,MAAM,OAAO,CAAC,YAAY,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE;AACxD,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AACxB,KAAK;AACL;AACA,IAAI,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/D;AACA,IAAI,IAAI,MAAM,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE;AAC/C,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,KAAK;AACL;AACA,IAAI,OAAO,CAAC,YAAY,CAAC;AACzB,GAAG;AACH;AACA,EAAE,IAAIA,OAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAIA,OAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AACxE,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;AACnB;AACA,IAAIA,OAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK;AAClD,MAAM,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AACpD,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,OAAO,IAAI,CAAC;AACd;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;AACpD,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AAChC,IAAI,IAAI;AACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACvC,MAAM,OAAOA,OAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAClC,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;AACpC,QAAQ,MAAM,CAAC,CAAC;AAChB,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC/C,CAAC;AACD;AACA,MAAM,QAAQ,GAAG;AACjB;AACA,EAAE,YAAY,EAAE,oBAAoB;AACpC;AACA,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AAC1B;AACA,EAAE,gBAAgB,EAAE,CAAC,SAAS,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;AAC9D,IAAI,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;AACvD,IAAI,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5E,IAAI,MAAM,eAAe,GAAGA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjD;AACA,IAAI,IAAI,eAAe,IAAIA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AACnD,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChC,KAAK;AACL;AACA,IAAI,MAAM,UAAU,GAAGA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9C;AACA,IAAI,IAAI,UAAU,EAAE;AACpB,MAAM,OAAO,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;AAC9E,KAAK;AACL;AACA,IAAI,IAAIA,OAAK,CAAC,aAAa,CAAC,IAAI,CAAC;AACjC,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC1B,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC1B,MAAMA,OAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACxB,MAAMA,OAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACxB,MAAM;AACN,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,IAAI,IAAIA,OAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;AACvC,MAAM,OAAO,IAAI,CAAC,MAAM,CAAC;AACzB,KAAK;AACL,IAAI,IAAIA,OAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;AACvC,MAAM,OAAO,CAAC,cAAc,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;AACvF,MAAM,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC7B,KAAK;AACL;AACA,IAAI,IAAI,UAAU,CAAC;AACnB;AACA,IAAI,IAAI,eAAe,EAAE;AACzB,MAAM,IAAI,WAAW,CAAC,OAAO,CAAC,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE;AACzE,QAAQ,OAAO,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtE,OAAO;AACP;AACA,MAAM,IAAI,CAAC,UAAU,GAAGA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAAE;AACpG,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;AACxD;AACA,QAAQ,OAAO,UAAU;AACzB,UAAU,UAAU,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,IAAI;AAC/C,UAAU,SAAS,IAAI,IAAI,SAAS,EAAE;AACtC,UAAU,IAAI,CAAC,cAAc;AAC7B,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,eAAe,IAAI,kBAAkB,GAAG;AAChD,MAAM,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AACxD,MAAM,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AACnC,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ;AACA,EAAE,iBAAiB,EAAE,CAAC,SAAS,iBAAiB,CAAC,IAAI,EAAE;AACvD,IAAI,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpE,IAAI,MAAM,iBAAiB,GAAG,YAAY,IAAI,YAAY,CAAC,iBAAiB,CAAC;AAC7E,IAAI,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC;AACvD;AACA,IAAI,IAAI,IAAI,IAAIA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,aAAa,CAAC,EAAE;AACtG,MAAM,MAAM,iBAAiB,GAAG,YAAY,IAAI,YAAY,CAAC,iBAAiB,CAAC;AAC/E,MAAM,MAAM,iBAAiB,GAAG,CAAC,iBAAiB,IAAI,aAAa,CAAC;AACpE;AACA,MAAM,IAAI;AACV,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAChC,OAAO,CAAC,OAAO,CAAC,EAAE;AAClB,QAAQ,IAAI,iBAAiB,EAAE;AAC/B,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;AACxC,YAAY,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC7F,WAAW;AACX,UAAU,MAAM,CAAC,CAAC;AAClB,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,EAAE,CAAC;AACZ;AACA,EAAE,cAAc,EAAE,YAAY;AAC9B,EAAE,cAAc,EAAE,cAAc;AAChC;AACA,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACtB,EAAE,aAAa,EAAE,CAAC,CAAC;AACnB;AACA,EAAE,GAAG,EAAE;AACP,IAAI,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ;AACvC,IAAI,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;AAC/B,GAAG;AACH;AACA,EAAE,cAAc,EAAE,SAAS,cAAc,CAAC,MAAM,EAAE;AAClD,IAAI,OAAO,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC;AACzC,GAAG;AACH;AACA,EAAE,OAAO,EAAE;AACX,IAAI,MAAM,EAAE;AACZ,MAAM,QAAQ,EAAE,mCAAmC;AACnD,MAAM,cAAc,EAAE,SAAS;AAC/B,KAAK;AACL,GAAG;AACH,CAAC,CAAC;AACF;AACAA,OAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,KAAK;AAC7E,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAChC,CAAC,CAAC,CAAC;AACH;AACA,iBAAe,QAAQ;;ACvJvB;AACA;AACA,MAAM,iBAAiB,GAAGA,OAAK,CAAC,WAAW,CAAC;AAC5C,EAAE,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM;AAClE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,qBAAqB;AACvE,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB;AACpE,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY;AACxC,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAe,UAAU,IAAI;AAC7B,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,IAAI,CAAC,CAAC;AACR;AACA,EAAE,UAAU,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,IAAI,EAAE;AACrE,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1B,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACvC;AACA,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE;AACzD,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,GAAG,KAAK,YAAY,EAAE;AAC9B,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;AACvB,QAAQ,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9B,OAAO,MAAM;AACb,QAAQ,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC5B,OAAO;AACP,KAAK,MAAM;AACX,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AACjE,KAAK;AACL,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;;ACjDD,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC;AACA,SAAS,eAAe,CAAC,MAAM,EAAE;AACjC,EAAE,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACvD,CAAC;AACD;AACA,SAAS,cAAc,CAAC,KAAK,EAAE;AAC/B,EAAE,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,IAAI,IAAI,EAAE;AACxC,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,OAAOA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1E,CAAC;AACD;AACA,SAAS,WAAW,CAAC,GAAG,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACrC,EAAE,MAAM,QAAQ,GAAG,kCAAkC,CAAC;AACtD,EAAE,IAAI,KAAK,CAAC;AACZ;AACA,EAAE,QAAQ,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;AACvC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAChC,GAAG;AACH;AACA,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA,MAAM,iBAAiB,GAAG,CAAC,GAAG,KAAK,gCAAgC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;AACrF;AACA,SAAS,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE;AAC9E,EAAE,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAChC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5C,GAAG;AACH;AACA,EAAE,IAAI,kBAAkB,EAAE;AAC1B,IAAI,KAAK,GAAG,MAAM,CAAC;AACnB,GAAG;AACH;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;AACrC;AACA,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9B,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,GAAG;AACH;AACA,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9B,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9B,GAAG;AACH,CAAC;AACD;AACA,SAAS,YAAY,CAAC,MAAM,EAAE;AAC9B,EAAE,OAAO,MAAM,CAAC,IAAI,EAAE;AACtB,KAAK,WAAW,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK;AAChE,MAAM,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC;AACtC,KAAK,CAAC,CAAC;AACP,CAAC;AACD;AACA,SAAS,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE;AACrC,EAAE,MAAM,YAAY,GAAGA,OAAK,CAAC,WAAW,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;AACvD;AACA,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI;AAC9C,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,YAAY,EAAE;AAC1D,MAAM,KAAK,EAAE,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;AACxC,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrE,OAAO;AACP,MAAM,YAAY,EAAE,IAAI;AACxB,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA,MAAM,YAAY,CAAC;AACnB,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACjC,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE;AACvC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB;AACA,IAAI,SAAS,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;AAClD,MAAM,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAClE,OAAO;AACP;AACA,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,KAAK,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,EAAE;AAClH,QAAQ,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AACtD,OAAO;AACP,KAAK;AACL;AACA,IAAI,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,QAAQ;AACzC,MAAMA,OAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AACxF;AACA,IAAI,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,YAAY,IAAI,CAAC,WAAW,EAAE;AAC3E,MAAM,UAAU,CAAC,MAAM,EAAE,cAAc,EAAC;AACxC,KAAK,MAAM,GAAGA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE;AAChG,MAAM,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC;AACvD,KAAK,MAAM;AACX,MAAM,MAAM,IAAI,IAAI,IAAI,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACnE,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE;AACtB,IAAI,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C;AACA,MAAM,IAAI,GAAG,EAAE;AACf,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC;AACA,QAAQ,IAAI,CAAC,MAAM,EAAE;AACrB,UAAU,OAAO,KAAK,CAAC;AACvB,SAAS;AACT;AACA,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;AAC7B,UAAU,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AACpC,SAAS;AACT;AACA,QAAQ,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AACtC,UAAU,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/C,SAAS;AACT;AACA,QAAQ,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACpC,UAAU,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpC,SAAS;AACT;AACA,QAAQ,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;AACtE,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE;AACvB,IAAI,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C;AACA,MAAM,OAAO,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,KAAK,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AACjH,KAAK;AACL;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE;AAC1B,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB,IAAI,IAAI,OAAO,GAAG,KAAK,CAAC;AACxB;AACA,IAAI,SAAS,YAAY,CAAC,OAAO,EAAE;AACnC,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AACzC;AACA,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACjD;AACA,QAAQ,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE;AAClF,UAAU,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B;AACA,UAAU,OAAO,GAAG,IAAI,CAAC;AACzB,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC/B,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACnC,KAAK,MAAM;AACX,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,KAAK,CAAC,OAAO,EAAE;AACjB,IAAI,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACxB,IAAI,IAAI,OAAO,GAAG,KAAK,CAAC;AACxB;AACA,IAAI,OAAO,CAAC,EAAE,EAAE;AAChB,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1B,MAAM,GAAG,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;AAC5E,QAAQ,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,QAAQ,OAAO,GAAG,IAAI,CAAC;AACvB,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,SAAS,CAAC,MAAM,EAAE;AACpB,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB,IAAI,MAAM,OAAO,GAAG,EAAE,CAAC;AACvB;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK;AAC3C,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACjD;AACA,MAAM,IAAI,GAAG,EAAE;AACf,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/E;AACA,MAAM,IAAI,UAAU,KAAK,MAAM,EAAE;AACjC,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,OAAO;AACP;AACA,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/C;AACA,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;AACjC,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,GAAG,OAAO,EAAE;AACrB,IAAI,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;AACrD,GAAG;AACH;AACA,EAAE,MAAM,CAAC,SAAS,EAAE;AACpB,IAAI,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACpC;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK;AAC3C,MAAM,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,KAAK,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;AACvH,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG;AACtB,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC5D,GAAG;AACH;AACA,EAAE,QAAQ,GAAG;AACb,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpG,GAAG;AACH;AACA,EAAE,KAAK,MAAM,CAAC,WAAW,CAAC,GAAG;AAC7B,IAAI,OAAO,cAAc,CAAC;AAC1B,GAAG;AACH;AACA,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE;AACrB,IAAI,OAAO,KAAK,YAAY,IAAI,GAAG,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3D,GAAG;AACH;AACA,EAAE,OAAO,MAAM,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE;AACnC,IAAI,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC;AACA,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACtD;AACA,IAAI,OAAO,QAAQ,CAAC;AACpB,GAAG;AACH;AACA,EAAE,OAAO,QAAQ,CAAC,MAAM,EAAE;AAC1B,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG;AAC7D,MAAM,SAAS,EAAE,EAAE;AACnB,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;AAC1C,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AACrC;AACA,IAAI,SAAS,cAAc,CAAC,OAAO,EAAE;AACrC,MAAM,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAQ,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC3C,QAAQ,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAClC,OAAO;AACP,KAAK;AACL;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AACpF;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,CAAC;AACD;AACA,YAAY,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;AACtH;AACA;AACAA,OAAK,CAAC,iBAAiB,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK;AAClE,EAAE,IAAI,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnD,EAAE,OAAO;AACT,IAAI,GAAG,EAAE,MAAM,KAAK;AACpB,IAAI,GAAG,CAAC,WAAW,EAAE;AACrB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AACjC,KAAK;AACL,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACAA,OAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;AAClC;AACA,qBAAe,YAAY;;ACnS3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE;AACrD,EAAE,MAAM,MAAM,GAAG,IAAI,IAAIO,UAAQ,CAAC;AAClC,EAAE,MAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC;AACrC,EAAE,MAAM,OAAO,GAAGC,cAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACrD,EAAE,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAC1B;AACA,EAAER,OAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,SAAS,CAAC,EAAE,EAAE;AAC5C,IAAI,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAC9F,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;AACtB;AACA,EAAE,OAAO,IAAI,CAAC;AACd;;ACzBe,SAAS,QAAQ,CAAC,KAAK,EAAE;AACxC,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AACvC;;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;AACjD;AACA,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,IAAI,IAAI,GAAG,UAAU,GAAG,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1G,EAAE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;AAC9B,CAAC;AACD;AACAA,OAAK,CAAC,QAAQ,CAAC,aAAa,EAAE,UAAU,EAAE;AAC1C,EAAE,UAAU,EAAE,IAAI;AAClB,CAAC,CAAC;;AClBF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;AAC1D,EAAE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC;AACxD,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9E,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;AACtB,GAAG,MAAM;AACT,IAAI,MAAM,CAAC,IAAI,UAAU;AACzB,MAAM,kCAAkC,GAAG,QAAQ,CAAC,MAAM;AAC1D,MAAM,CAAC,UAAU,CAAC,eAAe,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACtG,MAAM,QAAQ,CAAC,MAAM;AACrB,MAAM,QAAQ,CAAC,OAAO;AACtB,MAAM,QAAQ;AACd,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;ACvBA,cAAe,QAAQ,CAAC,qBAAqB;AAC7C;AACA;AACA,EAAE;AACF,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACtD,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,GAAG,GAAG,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D;AACA,MAAMA,OAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC3F;AACA,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAC1D;AACA,MAAMA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;AAChE;AACA,MAAM,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/C;AACA,MAAM,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1C,KAAK;AACL;AACA,IAAI,IAAI,CAAC,IAAI,EAAE;AACf,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,YAAY,GAAG,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC;AACzF,MAAM,QAAQ,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE;AAC3D,KAAK;AACL;AACA,IAAI,MAAM,CAAC,IAAI,EAAE;AACjB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC;AAClD,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA,EAAE;AACF,IAAI,KAAK,GAAG,EAAE;AACd,IAAI,IAAI,GAAG;AACX,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,GAAG,EAAE;AACf,GAAG;;ACtCH;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,GAAG,EAAE;AAC3C;AACA;AACA;AACA,EAAE,OAAO,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjD;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE;AAC1D,EAAE,OAAO,WAAW;AACpB,MAAM,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;AAC3E,MAAM,OAAO,CAAC;AACd;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE;AAC7D,EAAE,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE;AAC/C,IAAI,OAAO,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAC9C,GAAG;AACH,EAAE,OAAO,YAAY,CAAC;AACtB;;ACfA,sBAAe,QAAQ,CAAC,qBAAqB;AAC7C;AACA;AACA;AACA,EAAE,CAAC,SAAS,kBAAkB,GAAG;AACjC,IAAI,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAC7D,IAAI,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AACvD,IAAI,IAAI,SAAS,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,CAAC,GAAG,EAAE;AAC7B,MAAM,IAAI,IAAI,GAAG,GAAG,CAAC;AACrB;AACA,MAAM,IAAI,IAAI,EAAE;AAChB;AACA,QAAQ,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAClD,QAAQ,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;AACnC,OAAO;AACP;AACA,MAAM,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAChD;AACA;AACA,MAAM,OAAO;AACb,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,QAAQ,EAAE,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE;AAC1F,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE;AACrF,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE;AAC9E,QAAQ,QAAQ,EAAE,cAAc,CAAC,QAAQ;AACzC,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,QAAQ,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;AAC5D,UAAU,cAAc,CAAC,QAAQ;AACjC,UAAU,GAAG,GAAG,cAAc,CAAC,QAAQ;AACvC,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,SAAS,eAAe,CAAC,UAAU,EAAE;AAChD,MAAM,MAAM,MAAM,GAAG,CAACA,OAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;AACxF,MAAM,QAAQ,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;AACpD,UAAU,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE;AAC1C,KAAK,CAAC;AACN,GAAG,GAAG;AACN;AACA;AACA,EAAE,CAAC,SAAS,qBAAqB,GAAG;AACpC,IAAI,OAAO,SAAS,eAAe,GAAG;AACtC,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK,CAAC;AACN,GAAG,GAAG;;AChES,SAAS,aAAa,CAAC,GAAG,EAAE;AAC3C,EAAE,MAAM,KAAK,GAAG,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtD,EAAE,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,YAAY,EAAE,GAAG,EAAE;AACxC,EAAE,YAAY,GAAG,YAAY,IAAI,EAAE,CAAC;AACpC,EAAE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACxC,EAAE,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AAC7C,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AACf,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AACf,EAAE,IAAI,aAAa,CAAC;AACpB;AACA,EAAE,GAAG,GAAG,GAAG,KAAK,SAAS,GAAG,GAAG,GAAG,IAAI,CAAC;AACvC;AACA,EAAE,OAAO,SAAS,IAAI,CAAC,WAAW,EAAE;AACpC,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3B;AACA,IAAI,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AACvC;AACA,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,KAAK;AACL;AACA,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC;AAC9B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;AAC3B;AACA,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC;AACjB,IAAI,IAAI,UAAU,GAAG,CAAC,CAAC;AACvB;AACA,IAAI,OAAO,CAAC,KAAK,IAAI,EAAE;AACvB,MAAM,UAAU,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,YAAY,CAAC;AACrC;AACA,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE;AACvB,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,YAAY,CAAC;AACvC,KAAK;AACL;AACA,IAAI,IAAI,GAAG,GAAG,aAAa,GAAG,GAAG,EAAE;AACnC,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,MAAM,MAAM,GAAG,SAAS,IAAI,GAAG,GAAG,SAAS,CAAC;AAChD;AACA,IAAI,OAAO,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;AACvE,GAAG,CAAC;AACJ;;ACpCA,SAAS,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE;AAC1D,EAAE,IAAI,aAAa,GAAG,CAAC,CAAC;AACxB,EAAE,MAAM,YAAY,GAAG,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC5C;AACA,EAAE,OAAO,CAAC,IAAI;AACd,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AAC5B,IAAI,MAAM,KAAK,GAAG,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;AAC3D,IAAI,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC;AACjD,IAAI,MAAM,IAAI,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC7C,IAAI,MAAM,OAAO,GAAG,MAAM,IAAI,KAAK,CAAC;AACpC;AACA,IAAI,aAAa,GAAG,MAAM,CAAC;AAC3B;AACA,IAAI,MAAM,IAAI,GAAG;AACjB,MAAM,MAAM;AACZ,MAAM,KAAK;AACX,MAAM,QAAQ,EAAE,KAAK,IAAI,MAAM,GAAG,KAAK,IAAI,SAAS;AACpD,MAAM,KAAK,EAAE,aAAa;AAC1B,MAAM,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS;AACnC,MAAM,SAAS,EAAE,IAAI,IAAI,KAAK,IAAI,OAAO,GAAG,CAAC,KAAK,GAAG,MAAM,IAAI,IAAI,GAAG,SAAS;AAC/E,MAAM,KAAK,EAAE,CAAC;AACd,KAAK,CAAC;AACN;AACA,IAAI,IAAI,CAAC,gBAAgB,GAAG,UAAU,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC;AAC1D;AACA,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,GAAG,CAAC;AACJ,CAAC;AACD;AACA,MAAM,qBAAqB,GAAG,OAAO,cAAc,KAAK,WAAW,CAAC;AACpE;AACA,iBAAe,qBAAqB,IAAI,UAAU,MAAM,EAAE;AAC1D,EAAE,OAAO,IAAI,OAAO,CAAC,SAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE;AAClE,IAAI,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC;AAClC,IAAI,MAAM,cAAc,GAAGQ,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;AACzE,IAAI,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,MAAM,CAAC;AAC/C,IAAI,IAAI,UAAU,CAAC;AACnB,IAAI,SAAS,IAAI,GAAG;AACpB,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE;AAC9B,QAAQ,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACnD,OAAO;AACP;AACA,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACzB,QAAQ,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC/D,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,WAAW,CAAC;AACpB;AACA,IAAI,IAAIR,OAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;AACvC,MAAM,IAAI,QAAQ,CAAC,qBAAqB,IAAI,QAAQ,CAAC,8BAA8B,EAAE;AACrF,QAAQ,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAC7C,OAAO,MAAM,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC,cAAc,EAAE,MAAM,KAAK,EAAE;AAC5E;AACA,QAAQ,MAAM,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;AACvH,QAAQ,cAAc,CAAC,cAAc,CAAC,CAAC,IAAI,IAAI,qBAAqB,EAAE,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7F,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;AACvC;AACA;AACA,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE;AACrB,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;AAClD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;AACtG,MAAM,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC;AACtF,KAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/D;AACA,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;AAChH;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACrC;AACA,IAAI,SAAS,SAAS,GAAG;AACzB,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,eAAe,GAAGQ,cAAY,CAAC,IAAI;AAC/C,QAAQ,uBAAuB,IAAI,OAAO,IAAI,OAAO,CAAC,qBAAqB,EAAE;AAC7E,OAAO,CAAC;AACR,MAAM,MAAM,YAAY,GAAG,CAAC,YAAY,IAAI,YAAY,KAAK,MAAM,IAAI,YAAY,KAAK,MAAM;AAC9F,QAAQ,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChD,MAAM,MAAM,QAAQ,GAAG;AACvB,QAAQ,IAAI,EAAE,YAAY;AAC1B,QAAQ,MAAM,EAAE,OAAO,CAAC,MAAM;AAC9B,QAAQ,UAAU,EAAE,OAAO,CAAC,UAAU;AACtC,QAAQ,OAAO,EAAE,eAAe;AAChC,QAAQ,MAAM;AACd,QAAQ,OAAO;AACf,OAAO,CAAC;AACR;AACA,MAAM,MAAM,CAAC,SAAS,QAAQ,CAAC,KAAK,EAAE;AACtC,QAAQ,OAAO,CAAC,KAAK,CAAC,CAAC;AACvB,QAAQ,IAAI,EAAE,CAAC;AACf,OAAO,EAAE,SAAS,OAAO,CAAC,GAAG,EAAE;AAC/B,QAAQ,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,QAAQ,IAAI,EAAE,CAAC;AACf,OAAO,EAAE,QAAQ,CAAC,CAAC;AACnB;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK;AACL;AACA,IAAI,IAAI,WAAW,IAAI,OAAO,EAAE;AAChC;AACA,MAAM,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;AACpC,KAAK,MAAM;AACX;AACA,MAAM,OAAO,CAAC,kBAAkB,GAAG,SAAS,UAAU,GAAG;AACzD,QAAQ,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,CAAC,EAAE;AAClD,UAAU,OAAO;AACjB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;AAC1G,UAAU,OAAO;AACjB,SAAS;AACT;AACA;AACA,QAAQ,UAAU,CAAC,SAAS,CAAC,CAAC;AAC9B,OAAO,CAAC;AACR,KAAK;AACL;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,WAAW,GAAG;AAC7C,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,CAAC,IAAI,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1F;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,WAAW,GAAG;AAC7C;AACA;AACA,MAAM,MAAM,CAAC,IAAI,UAAU,CAAC,eAAe,EAAE,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACvF;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,aAAa,GAAG;AACjD,MAAM,IAAI,mBAAmB,GAAG,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAC;AACrH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,oBAAoB,CAAC;AACvE,MAAM,IAAI,MAAM,CAAC,mBAAmB,EAAE;AACtC,QAAQ,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACzD,OAAO;AACP,MAAM,MAAM,CAAC,IAAI,UAAU;AAC3B,QAAQ,mBAAmB;AAC3B,QAAQ,YAAY,CAAC,mBAAmB,GAAG,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC,YAAY;AACzF,QAAQ,MAAM;AACd,QAAQ,OAAO,CAAC,CAAC,CAAC;AAClB;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA;AACA;AACA,IAAI,GAAG,QAAQ,CAAC,qBAAqB,EAAE;AACvC,MAAM,aAAa,IAAIR,OAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAClG;AACA,MAAM,IAAI,aAAa,KAAK,aAAa,KAAK,KAAK,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAE;AACnF;AACA,QAAQ,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAChH;AACA,QAAQ,IAAI,SAAS,EAAE;AACvB,UAAU,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;AAC/D,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA,IAAI,WAAW,KAAK,SAAS,IAAI,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACrE;AACA;AACA,IAAI,IAAI,kBAAkB,IAAI,OAAO,EAAE;AACvC,MAAMA,OAAK,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE;AACjF,QAAQ,OAAO,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC3C,OAAO,CAAC,CAAC;AACT,KAAK;AACL;AACA;AACA,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;AACpD,MAAM,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC;AACzD,KAAK;AACL;AACA;AACA,IAAI,IAAI,YAAY,IAAI,YAAY,KAAK,MAAM,EAAE;AACjD,MAAM,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACjD,KAAK;AACL;AACA;AACA,IAAI,IAAI,OAAO,MAAM,CAAC,kBAAkB,KAAK,UAAU,EAAE;AACzD,MAAM,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,oBAAoB,CAAC,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC;AAClG,KAAK;AACL;AACA;AACA,IAAI,IAAI,OAAO,MAAM,CAAC,gBAAgB,KAAK,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE;AACzE,MAAM,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACjG,KAAK;AACL;AACA,IAAI,IAAI,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE;AAC7C;AACA;AACA,MAAM,UAAU,GAAG,MAAM,IAAI;AAC7B,QAAQ,IAAI,CAAC,OAAO,EAAE;AACtB,UAAU,OAAO;AACjB,SAAS;AACT,QAAQ,MAAM,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;AAC3F,QAAQ,OAAO,CAAC,KAAK,EAAE,CAAC;AACxB,QAAQ,OAAO,GAAG,IAAI,CAAC;AACvB,OAAO,CAAC;AACR;AACA,MAAM,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACrE,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACzB,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,GAAG,UAAU,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACnG,OAAO;AACP,KAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC7C;AACA,IAAI,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;AACjE,MAAM,MAAM,CAAC,IAAI,UAAU,CAAC,uBAAuB,GAAG,QAAQ,GAAG,GAAG,EAAE,UAAU,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAC3G,MAAM,OAAO;AACb,KAAK;AACL;AACA;AACA;AACA,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;AACtC,GAAG,CAAC,CAAC;AACL;;AC9PA,MAAM,aAAa,GAAG;AACtB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,GAAG,EAAE,UAAU;AACjB,EAAC;AACD;AACAA,OAAK,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,KAAK,KAAK;AAC5C,EAAE,IAAI,EAAE,EAAE;AACV,IAAI,IAAI;AACR,MAAM,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB;AACA,KAAK;AACL,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACtD,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACA,MAAM,YAAY,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C;AACA,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAKA,OAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC;AACzG;AACA,eAAe;AACf,EAAE,UAAU,EAAE,CAAC,QAAQ,KAAK;AAC5B,IAAI,QAAQ,GAAGA,OAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/D;AACA,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;AAC9B,IAAI,IAAI,aAAa,CAAC;AACtB,IAAI,IAAI,OAAO,CAAC;AAChB;AACA,IAAI,MAAM,eAAe,GAAG,EAAE,CAAC;AAC/B;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAClC,MAAM,IAAI,EAAE,CAAC;AACb;AACA,MAAM,OAAO,GAAG,aAAa,CAAC;AAC9B;AACA,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE;AAC5C,QAAQ,OAAO,GAAG,aAAa,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;AAC5E;AACA,QAAQ,IAAI,OAAO,KAAK,SAAS,EAAE;AACnC,UAAU,MAAM,IAAI,UAAU,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,SAAS;AACT,OAAO;AACP;AACA,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,MAAM;AACd,OAAO;AACP;AACA,MAAM,eAAe,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/C,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB;AACA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;AACrD,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC9C,WAAW,KAAK,KAAK,KAAK,GAAG,qCAAqC,GAAG,+BAA+B,CAAC;AACrG,SAAS,CAAC;AACV;AACA,MAAM,IAAI,CAAC,GAAG,MAAM;AACpB,SAAS,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACjH,QAAQ,yBAAyB,CAAC;AAClC;AACA,MAAM,MAAM,IAAI,UAAU;AAC1B,QAAQ,CAAC,qDAAqD,CAAC,GAAG,CAAC;AACnE,QAAQ,iBAAiB;AACzB,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE,aAAa;AACzB;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B,CAAC,MAAM,EAAE;AAC9C,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE;AAC1B,IAAI,MAAM,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC;AAC1C,GAAG;AACH;AACA,EAAE,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;AAC9C,IAAI,MAAM,IAAI,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,eAAe,CAAC,MAAM,EAAE;AAChD,EAAE,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACvC;AACA,EAAE,MAAM,CAAC,OAAO,GAAGQ,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrD;AACA;AACA,EAAE,MAAM,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AAClC,IAAI,MAAM;AACV,IAAI,MAAM,CAAC,gBAAgB;AAC3B,GAAG,CAAC;AACJ;AACA,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;AAC9D,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;AAC9E,GAAG;AACH;AACA,EAAE,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,IAAID,UAAQ,CAAC,OAAO,CAAC,CAAC;AAC1E;AACA,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,mBAAmB,CAAC,QAAQ,EAAE;AACrE,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACzC;AACA;AACA,IAAI,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AACtC,MAAM,MAAM;AACZ,MAAM,MAAM,CAAC,iBAAiB;AAC9B,MAAM,QAAQ;AACd,KAAK,CAAC;AACN;AACA,IAAI,QAAQ,CAAC,OAAO,GAAGC,cAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3D;AACA,IAAI,OAAO,QAAQ,CAAC;AACpB,GAAG,EAAE,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACzC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC3B,MAAM,4BAA4B,CAAC,MAAM,CAAC,CAAC;AAC3C;AACA;AACA,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;AACrC,QAAQ,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AACjD,UAAU,MAAM;AAChB,UAAU,MAAM,CAAC,iBAAiB;AAClC,UAAU,MAAM,CAAC,QAAQ;AACzB,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAGA,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7E,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClC,GAAG,CAAC,CAAC;AACL;;AC3EA,MAAM,eAAe,GAAG,CAAC,KAAK,KAAK,KAAK,YAAYA,cAAY,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE;AACtD;AACA,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB;AACA,EAAE,SAAS,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE;AACpD,IAAI,IAAIR,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;AACpE,MAAM,OAAOA,OAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1D,KAAK,MAAM,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;AAC5C,MAAM,OAAOA,OAAK,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;AACrC,KAAK,MAAM,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACtC,MAAM,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AAC5B,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH;AACA;AACA,EAAE,SAAS,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE;AAC/C,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5C,KAAK,MAAM,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AACtC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AACpD,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE;AAClC,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE;AAClC,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK,MAAM,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AACtC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE;AACvC,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE;AACzB,MAAM,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClC,KAAK,MAAM,IAAI,IAAI,IAAI,OAAO,EAAE;AAChC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA,EAAE,MAAM,QAAQ,GAAG;AACnB,IAAI,GAAG,EAAE,gBAAgB;AACzB,IAAI,MAAM,EAAE,gBAAgB;AAC5B,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,iBAAiB,EAAE,gBAAgB;AACvC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,eAAe,EAAE,gBAAgB;AACrC,IAAI,aAAa,EAAE,gBAAgB;AACnC,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,YAAY,EAAE,gBAAgB;AAClC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,kBAAkB,EAAE,gBAAgB;AACxC,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,aAAa,EAAE,gBAAgB;AACnC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,SAAS,EAAE,gBAAgB;AAC/B,IAAI,SAAS,EAAE,gBAAgB;AAC/B,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,WAAW,EAAE,gBAAgB;AACjC,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,cAAc,EAAE,eAAe;AACnC,IAAI,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACxF,GAAG,CAAC;AACJ;AACA,EAAEA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS,kBAAkB,CAAC,IAAI,EAAE;AACpG,IAAI,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC;AACxD,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAClE,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,KAAK,KAAK,eAAe,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;AAClG,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,MAAM,CAAC;AAChB;;ACzGO,MAAM,OAAO,GAAG,OAAO;;ACK9B,MAAMS,YAAU,GAAG,EAAE,CAAC;AACtB;AACA;AACA,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK;AACrF,EAAEA,YAAU,CAAC,IAAI,CAAC,GAAG,SAAS,SAAS,CAAC,KAAK,EAAE;AAC/C,IAAI,OAAO,OAAO,KAAK,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;AACtE,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;AACA,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAA,YAAU,CAAC,YAAY,GAAG,SAAS,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE;AAC7E,EAAE,SAAS,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE;AACpC,IAAI,OAAO,UAAU,GAAG,OAAO,GAAG,0BAA0B,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,IAAI,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AACnH,GAAG;AACH;AACA;AACA,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,KAAK;AAC/B,IAAI,IAAI,SAAS,KAAK,KAAK,EAAE;AAC7B,MAAM,MAAM,IAAI,UAAU;AAC1B,QAAQ,aAAa,CAAC,GAAG,EAAE,mBAAmB,IAAI,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AACnF,QAAQ,UAAU,CAAC,cAAc;AACjC,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE;AAC7C,MAAM,kBAAkB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACrC;AACA,MAAM,OAAO,CAAC,IAAI;AAClB,QAAQ,aAAa;AACrB,UAAU,GAAG;AACb,UAAU,8BAA8B,GAAG,OAAO,GAAG,yCAAyC;AAC9F,SAAS;AACT,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,OAAO,SAAS,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;AAC1D,GAAG,CAAC;AACJ,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE;AACtD,EAAE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACnC,IAAI,MAAM,IAAI,UAAU,CAAC,2BAA2B,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;AACvF,GAAG;AACH,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACtB,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,IAAI,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAClC,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AACjC,MAAM,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AAC3E,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC3B,QAAQ,MAAM,IAAI,UAAU,CAAC,SAAS,GAAG,GAAG,GAAG,WAAW,GAAG,MAAM,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;AACtG,OAAO;AACP,MAAM,SAAS;AACf,KAAK;AACL,IAAI,IAAI,YAAY,KAAK,IAAI,EAAE;AAC/B,MAAM,MAAM,IAAI,UAAU,CAAC,iBAAiB,GAAG,GAAG,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;AAC/E,KAAK;AACL,GAAG;AACH,CAAC;AACD;AACA,gBAAe;AACf,EAAE,aAAa;AACf,cAAEA,YAAU;AACZ,CAAC;;AC/ED,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,CAAC;AACZ,EAAE,WAAW,CAAC,cAAc,EAAE;AAC9B,IAAI,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;AACnC,IAAI,IAAI,CAAC,YAAY,GAAG;AACxB,MAAM,OAAO,EAAE,IAAIC,oBAAkB,EAAE;AACvC,MAAM,QAAQ,EAAE,IAAIA,oBAAkB,EAAE;AACxC,KAAK,CAAC;AACN,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE;AACrC,IAAI,IAAI;AACR,MAAM,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACtD,KAAK,CAAC,OAAO,GAAG,EAAE;AAClB,MAAM,IAAI,GAAG,YAAY,KAAK,EAAE;AAChC,QAAQ,IAAI,KAAK,CAAC;AAClB;AACA,QAAQ,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;AAC9F;AACA;AACA,QAAQ,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;AAC1E;AACA,QAAQ,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE;AACxB,UAAU,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B;AACA,SAAS,MAAM,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE;AACzF,UAAU,GAAG,CAAC,KAAK,IAAI,IAAI,GAAG,MAAK;AACnC,SAAS;AACT,OAAO;AACP;AACA,MAAM,MAAM,GAAG,CAAC;AAChB,KAAK;AACL,GAAG;AACH;AACA,EAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;AAChC;AACA;AACA,IAAI,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;AACzC,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;AAC5B,MAAM,MAAM,CAAC,GAAG,GAAG,WAAW,CAAC;AAC/B,KAAK,MAAM;AACX,MAAM,MAAM,GAAG,WAAW,IAAI,EAAE,CAAC;AACjC,KAAK;AACL;AACA,IAAI,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChD;AACA,IAAI,MAAM,CAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;AAC7D;AACA,IAAI,IAAI,YAAY,KAAK,SAAS,EAAE;AACpC,MAAM,SAAS,CAAC,aAAa,CAAC,YAAY,EAAE;AAC5C,QAAQ,iBAAiB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACtE,QAAQ,iBAAiB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACtE,QAAQ,mBAAmB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACxE,OAAO,EAAE,KAAK,CAAC,CAAC;AAChB,KAAK;AACL;AACA,IAAI,IAAI,gBAAgB,IAAI,IAAI,EAAE;AAClC,MAAM,IAAIV,OAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;AAC9C,QAAQ,MAAM,CAAC,gBAAgB,GAAG;AAClC,UAAU,SAAS,EAAE,gBAAgB;AACrC,UAAS;AACT,OAAO,MAAM;AACb,QAAQ,SAAS,CAAC,aAAa,CAAC,gBAAgB,EAAE;AAClD,UAAU,MAAM,EAAE,UAAU,CAAC,QAAQ;AACrC,UAAU,SAAS,EAAE,UAAU,CAAC,QAAQ;AACxC,SAAS,EAAE,IAAI,CAAC,CAAC;AACjB,OAAO;AACP,KAAK;AACL;AACA;AACA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,KAAK,EAAE,WAAW,EAAE,CAAC;AACnF;AACA;AACA,IAAI,IAAI,cAAc,GAAG,OAAO,IAAIA,OAAK,CAAC,KAAK;AAC/C,MAAM,OAAO,CAAC,MAAM;AACpB,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AAC5B,KAAK,CAAC;AACN;AACA,IAAI,OAAO,IAAIA,OAAK,CAAC,OAAO;AAC5B,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;AACjE,MAAM,CAAC,MAAM,KAAK;AAClB,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,OAAO;AACP,KAAK,CAAC;AACN;AACA,IAAI,MAAM,CAAC,OAAO,GAAGQ,cAAY,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAClE;AACA;AACA,IAAI,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACvC,IAAI,IAAI,8BAA8B,GAAG,IAAI,CAAC;AAC9C,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,0BAA0B,CAAC,WAAW,EAAE;AACvF,MAAM,IAAI,OAAO,WAAW,CAAC,OAAO,KAAK,UAAU,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE;AAC9F,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,8BAA8B,GAAG,8BAA8B,IAAI,WAAW,CAAC,WAAW,CAAC;AACjG;AACA,MAAM,uBAAuB,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;AACnF,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACxC,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,wBAAwB,CAAC,WAAW,EAAE;AACtF,MAAM,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;AACjF,KAAK,CAAC,CAAC;AACP;AACA,IAAI,IAAI,OAAO,CAAC;AAChB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,IAAI,IAAI,GAAG,CAAC;AACZ;AACA,IAAI,IAAI,CAAC,8BAA8B,EAAE;AACzC,MAAM,MAAM,KAAK,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;AAC5D,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;AAC1D,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;AACxD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;AACzB;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACxC;AACA,MAAM,OAAO,CAAC,GAAG,GAAG,EAAE;AACtB,QAAQ,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvD,OAAO;AACP;AACA,MAAM,OAAO,OAAO,CAAC;AACrB,KAAK;AACL;AACA,IAAI,GAAG,GAAG,uBAAuB,CAAC,MAAM,CAAC;AACzC;AACA,IAAI,IAAI,SAAS,GAAG,MAAM,CAAC;AAC3B;AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,MAAM,MAAM,WAAW,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC;AACtD,MAAM,IAAI;AACV,QAAQ,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAC3C,OAAO,CAAC,OAAO,KAAK,EAAE;AACtB,QAAQ,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACrC,QAAQ,MAAM;AACd,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI;AACR,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACtD,KAAK,CAAC,OAAO,KAAK,EAAE;AACpB,MAAM,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnC,KAAK;AACL;AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,IAAI,GAAG,GAAG,wBAAwB,CAAC,MAAM,CAAC;AAC1C;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3F,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,MAAM,EAAE;AACjB,IAAI,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChD,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/D,IAAI,OAAO,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACtE,GAAG;AACH,CAAC;AACD;AACA;AACAR,OAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,mBAAmB,CAAC,MAAM,EAAE;AACzF;AACA,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,EAAE,MAAM,EAAE;AAClD,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE;AAClD,MAAM,MAAM;AACZ,MAAM,GAAG;AACT,MAAM,IAAI,EAAE,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI;AAC/B,KAAK,CAAC,CAAC,CAAC;AACR,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;AACAA,OAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,SAAS,qBAAqB,CAAC,MAAM,EAAE;AAC/E;AACA;AACA,EAAE,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACtC,IAAI,OAAO,SAAS,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE;AAClD,MAAM,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE;AACpD,QAAQ,MAAM;AACd,QAAQ,OAAO,EAAE,MAAM,GAAG;AAC1B,UAAU,cAAc,EAAE,qBAAqB;AAC/C,SAAS,GAAG,EAAE;AACd,QAAQ,GAAG;AACX,QAAQ,IAAI;AACZ,OAAO,CAAC,CAAC,CAAC;AACV,KAAK,CAAC;AACN,GAAG;AACH;AACA,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,kBAAkB,EAAE,CAAC;AACjD;AACA,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC,CAAC,CAAC;AACH;AACA,cAAe,KAAK;;AC5NpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,CAAC;AAClB,EAAE,WAAW,CAAC,QAAQ,EAAE;AACxB,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;AACxC,MAAM,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;AAC1D,KAAK;AACL;AACA,IAAI,IAAI,cAAc,CAAC;AACvB;AACA,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,SAAS,eAAe,CAAC,OAAO,EAAE;AACjE,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC;AACvB;AACA;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI;AAChC,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO;AACpC;AACA,MAAM,IAAI,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;AACtC;AACA,MAAM,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AACtB,QAAQ,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACpC,OAAO;AACP,MAAM,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;AAC9B,KAAK,CAAC,CAAC;AACP;AACA;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,WAAW,IAAI;AACvC,MAAM,IAAI,QAAQ,CAAC;AACnB;AACA,MAAM,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,IAAI;AAC7C,QAAQ,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,QAAQ,QAAQ,GAAG,OAAO,CAAC;AAC3B,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC3B;AACA,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,MAAM,GAAG;AACzC,QAAQ,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AACpC,OAAO,CAAC;AACR;AACA,MAAM,OAAO,OAAO,CAAC;AACrB,KAAK,CAAC;AACN;AACA,IAAI,QAAQ,CAAC,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;AACvD,MAAM,IAAI,KAAK,CAAC,MAAM,EAAE;AACxB;AACA,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,KAAK,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACjE,MAAM,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP,GAAG;AACH;AACA;AACA;AACA;AACA,EAAE,gBAAgB,GAAG;AACrB,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;AACrB,MAAM,MAAM,IAAI,CAAC,MAAM,CAAC;AACxB,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,CAAC,QAAQ,EAAE;AACtB,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;AACrB,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrC,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,UAAU,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnC,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,QAAQ,EAAE;AACxB,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AAC1B,MAAM,OAAO;AACb,KAAK;AACL,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACpD,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;AACtB,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AACvC,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,MAAM,GAAG;AAClB,IAAI,IAAI,MAAM,CAAC;AACf,IAAI,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,SAAS,QAAQ,CAAC,CAAC,EAAE;AACvD,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,MAAM,KAAK;AACX,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,GAAG;AACH,CAAC;AACD;AACA,oBAAe,WAAW;;ACtH1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,MAAM,CAAC,QAAQ,EAAE;AACzC,EAAE,OAAO,SAAS,IAAI,CAAC,GAAG,EAAE;AAC5B,IAAI,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACrC,GAAG,CAAC;AACJ;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,YAAY,CAAC,OAAO,EAAE;AAC9C,EAAE,OAAOA,OAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC;AACpE;;ACbA,MAAM,cAAc,GAAG;AACvB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,EAAE,EAAE,GAAG;AACT,EAAE,OAAO,EAAE,GAAG;AACd,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,KAAK,EAAE,GAAG;AACZ,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,aAAa,EAAE,GAAG;AACpB,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,IAAI,EAAE,GAAG;AACX,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,oBAAoB,EAAE,GAAG;AAC3B,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,oBAAoB,EAAE,GAAG;AAC3B,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,0BAA0B,EAAE,GAAG;AACjC,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,uBAAuB,EAAE,GAAG;AAC9B,EAAE,qBAAqB,EAAE,GAAG;AAC5B,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,6BAA6B,EAAE,GAAG;AACpC,CAAC,CAAC;AACF;AACA,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACzD,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;AAC9B,CAAC,CAAC,CAAC;AACH;AACA,uBAAe,cAAc;;AClD7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,aAAa,EAAE;AACvC,EAAE,MAAM,OAAO,GAAG,IAAIW,OAAK,CAAC,aAAa,CAAC,CAAC;AAC3C,EAAE,MAAM,QAAQ,GAAG,IAAI,CAACA,OAAK,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1D;AACA;AACA,EAAEX,OAAK,CAAC,MAAM,CAAC,QAAQ,EAAEW,OAAK,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AACvE;AACA;AACA,EAAEX,OAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AAC5D;AACA;AACA,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,MAAM,CAAC,cAAc,EAAE;AACpD,IAAI,OAAO,cAAc,CAAC,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AACtE,GAAG,CAAC;AACJ;AACA,EAAE,OAAO,QAAQ,CAAC;AAClB,CAAC;AACD;AACA;AACK,MAAC,KAAK,GAAG,cAAc,CAACO,UAAQ,EAAE;AACvC;AACA;AACA,KAAK,CAAC,KAAK,GAAGI,OAAK,CAAC;AACpB;AACA;AACA,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;AACpC,KAAK,CAAC,WAAW,GAAGC,aAAW,CAAC;AAChC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC1B,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;AACxB,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;AACnC;AACA;AACA,KAAK,CAAC,GAAG,GAAG,SAAS,GAAG,CAAC,QAAQ,EAAE;AACnC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AACtB;AACA;AACA,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;AAClC;AACA;AACA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;AAChC;AACA,KAAK,CAAC,YAAY,GAAGJ,cAAY,CAAC;AAClC;AACA,KAAK,CAAC,UAAU,GAAG,KAAK,IAAI,cAAc,CAACR,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAClG;AACA,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;AACvC;AACA,KAAK,CAAC,cAAc,GAAGa,gBAAc,CAAC;AACtC;AACA,KAAK,CAAC,OAAO,GAAG,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/axios/dist/esm/axios.js b/node_modules/axios/dist/esm/axios.js new file mode 100644 index 00000000..18f9a302 --- /dev/null +++ b/node_modules/axios/dist/esm/axios.js @@ -0,0 +1,3281 @@ +// Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +}; + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +}; + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +}; + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + }; + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +}; + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +}; + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +}; + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +}; + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +}; + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +}; + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +}; + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + }; + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +}; + +const noop = () => {}; + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +}; + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +}; + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0]; + } + + return str; +}; + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + }; + + return visit(obj, 0); +}; + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); + +const utils$1 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable +}; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError$1(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +utils$1.inherits(AxiosError$1, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype$1 = AxiosError$1.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError$1, descriptors); +Object.defineProperty(prototype$1, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError$1.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError$1.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +// eslint-disable-next-line strict +const httpAdapter = null; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData$1(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils$1.isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError$1('Blob is not supported. Use a Buffer instead.'); + } + + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils$1.isArray(value) && isFlatArray(value)) || + ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils$1.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils$1.forEach(value, function each(el, key) { + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( + formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode$1(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData$1(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +const InterceptorManager$1 = InterceptorManager; + +const transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; + +const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; + +const FormData$1 = typeof FormData !== 'undefined' ? FormData : null; + +const Blob$1 = typeof Blob !== 'undefined' ? Blob : null; + +const platform$1 = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams$1, + FormData: FormData$1, + Blob: Blob$1 + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}; + +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = ( + (product) => { + return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 + })(typeof navigator !== 'undefined' && navigator.product); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +const utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv +}); + +const platform = { + ...utils, + ...platform$1 +}; + +function toURLEncodedForm(data, options) { + return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + const obj = {}; + + utils$1.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils$1.isObject(data); + + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils$1.isFormData(data); + + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (utils$1.isArrayBuffer(data) || + utils$1.isBuffer(data) || + utils$1.isStream(data) || + utils$1.isFile(data) || + utils$1.isBlob(data) + ) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData$1( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } +}; + +utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +const defaults$1 = defaults; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils$1.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +const parseHeaders = rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils$1.isString(value)) return; + + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders$1 { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils$1.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils$1.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + } +}); + +utils$1.freezeMethods(AxiosHeaders$1); + +const AxiosHeaders$2 = AxiosHeaders$1; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || defaults$1; + const context = response || config; + const headers = AxiosHeaders$2.from(context.headers); + let data = context.data; + + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + +function isCancel$1(value) { + return !!(value && value.__CANCEL__); +} + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError$1(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError$1.call(this, message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils$1.inherits(CanceledError$1, AxiosError$1, { + __CANCEL__: true +}); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError$1( + 'Request failed with status code ' + response.status, + [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + +const cookies = platform.hasStandardBrowserEnv ? + + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure) { + const cookie = [name + '=' + encodeURIComponent(value)]; + + utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); + + utils$1.isString(path) && cookie.push('path=' + path); + + utils$1.isString(domain) && cookie.push('domain=' + domain); + + secure === true && cookie.push('secure'); + + document.cookie = cookie.join('; '); + }, + + read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000); + } + } + + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +const isURLSameOrigin = platform.hasStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover its components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })(); + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +const xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = AxiosHeaders$2.from(config.headers).normalize(); + let {responseType, withXSRFToken} = config; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + let contentType; + + if (utils$1.isFormData(requestData)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + requestHeaders.setContentType(false); // Let the browser set it + } else if ((contentType = requestHeaders.getContentType()) !== false) { + // fix semicolon duplication issue for ReactNative FormData implementation + const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; + requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); + } + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = buildFullPath(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders$2.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError$1( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if(platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) { + // Add xsrf header + const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(fullPath); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}; + +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter +}; + +utils$1.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +const renderReason = (reason) => `- ${reason}`; + +const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; + +const adapters = { + getAdapter: (adapters) => { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError$1(`Unknown adapter '${id}'`); + } + } + + if (adapter) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; + } + + if (!adapter) { + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError$1( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; + }, + adapters: knownAdapters +}; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError$1(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders$2.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders$2.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel$1(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$2.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + +const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig$1(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({caseless}, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + +const VERSION$1 = "1.6.7"; + +const validators$1 = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators$1[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError$1( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError$1.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION); + } + } +} + +const validator = { + assertOptions, + validators: validators$1 +}; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios$1 { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy; + + Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack; + } + } + + throw err; + } + } + + _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig$1(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils$1.merge( + headers.common, + headers[config.method] + ); + + headers && utils$1.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders$2.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig$1(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios$1.prototype[method] = function(url, config) { + return this.request(mergeConfig$1(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig$1(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios$1.prototype[method] = generateHTTPMethod(); + + Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +const Axios$2 = Axios$1; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken$1 { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError$1(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken$1(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +const CancelToken$2 = CancelToken$1; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread$1(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError$1(payload) { + return utils$1.isObject(payload) && (payload.isAxiosError === true); +} + +const HttpStatusCode$1 = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode$1).forEach(([key, value]) => { + HttpStatusCode$1[value] = key; +}); + +const HttpStatusCode$2 = HttpStatusCode$1; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios$2(defaultConfig); + const instance = bind(Axios$2.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$2.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils$1.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig$1(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults$1); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios$2; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError$1; +axios.CancelToken = CancelToken$2; +axios.isCancel = isCancel$1; +axios.VERSION = VERSION$1; +axios.toFormData = toFormData$1; + +// Expose AxiosError class +axios.AxiosError = AxiosError$1; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread$1; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError$1; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig$1; + +axios.AxiosHeaders = AxiosHeaders$2; + +axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode$2; + +axios.default = axios; + +// this module should only have a default export +const axios$1 = axios; + +// This module is intended to unwrap Axios default export as named. +// Keep top-level export same with static properties +// so that it can keep same with es module or cjs +const { + Axios, + AxiosError, + CanceledError, + isCancel, + CancelToken, + VERSION, + all, + Cancel, + isAxiosError, + spread, + toFormData, + AxiosHeaders, + HttpStatusCode, + formToJSON, + getAdapter, + mergeConfig +} = axios$1; + +export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios$1 as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData }; +//# sourceMappingURL=axios.js.map diff --git a/node_modules/axios/dist/esm/axios.js.map b/node_modules/axios/dist/esm/axios.js.map new file mode 100644 index 00000000..7031b7d2 --- /dev/null +++ b/node_modules/axios/dist/esm/axios.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.js","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/null.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/browser/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/cookies.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/speedometer.js","../../lib/adapters/xhr.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/core/mergeConfig.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js","../../index.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n"],"names":["AxiosError","utils","prototype","toFormData","encode","URLSearchParams","FormData","Blob","platform","AxiosHeaders","defaults","isCancel","CanceledError","mergeConfig","VERSION","validators","Axios","InterceptorManager","CancelToken","spread","isAxiosError","HttpStatusCode","axios"],"mappings":";AAEe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACFA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,KAAK,IAAI;AAClC,IAAI,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB;AACA,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK;AAC7B,EAAE,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,EAAE,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI;AAC1C,EAAC;AACD;AACA,MAAM,UAAU,GAAG,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,GAAG,EAAE;AACvB,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;AACvG,OAAO,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB,CAAC,GAAG,EAAE;AAChC,EAAE,IAAI,MAAM,CAAC;AACb,EAAE,IAAI,CAAC,OAAO,WAAW,KAAK,WAAW,MAAM,WAAW,CAAC,MAAM,CAAC,EAAE;AACpE,IAAI,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACrC,GAAG,MAAM;AACT,IAAI,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,KAAK,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAClE,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;AAChC,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AACxC,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,IAAI,KAAK,EAAE,MAAM,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;AAC1K,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,CAAC,KAAK,KAAK;AAC9B,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,OAAO,KAAK;AACd,IAAI,CAAC,OAAO,QAAQ,KAAK,UAAU,IAAI,KAAK,YAAY,QAAQ;AAChE,MAAM,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;AAC9B,QAAQ,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,UAAU;AAC7C;AACA,SAAS,IAAI,KAAK,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,KAAK,mBAAmB,CAAC;AACrG,OAAO;AACP,KAAK;AACL,GAAG;AACH,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI;AAC9B,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,oCAAoC,EAAE,EAAE,CAAC,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,UAAU,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE;AACrD;AACA,EAAE,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;AAClD,IAAI,OAAO;AACX,GAAG;AACH;AACA,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,IAAI,CAAC,CAAC;AACR;AACA;AACA,EAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC/B;AACA,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAChB,GAAG;AACH;AACA,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;AACpB;AACA,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC5C,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AACpC,KAAK;AACL,GAAG,MAAM;AACT;AACA,IAAI,MAAM,IAAI,GAAG,UAAU,GAAG,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjF,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;AAC5B,IAAI,IAAI,GAAG,CAAC;AACZ;AACA,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACxC,KAAK;AACL,GAAG;AACH,CAAC;AACD;AACA,SAAS,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE;AAC3B,EAAE,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;AAC1B,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACtB,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACnB,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE;AACpC,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA,MAAM,OAAO,GAAG,CAAC,MAAM;AACvB;AACA,EAAE,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,OAAO,UAAU,CAAC;AAC3D,EAAE,OAAO,OAAO,IAAI,KAAK,WAAW,GAAG,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAC/F,CAAC,GAAG,CAAC;AACL;AACA,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,OAAO,CAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,KAAK,8BAA8B;AAC5C,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;AAC1D,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK;AACpC,IAAI,MAAM,SAAS,GAAG,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC;AAC9D,IAAI,IAAI,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;AAChE,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,KAAK,MAAM,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;AACnC,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AACzC,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;AAC7B,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC;AACtC,KAAK,MAAM;AACX,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC;AAC9B,KAAK;AACL,IAAG;AACH;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AACpD,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AACvD,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK;AACpD,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK;AAC3B,IAAI,IAAI,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE;AACpC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAClC,KAAK,MAAM;AACX,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AACnB,KAAK;AACL,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACnB,EAAE,OAAO,CAAC,CAAC;AACX,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,OAAO,KAAK;AAC9B,EAAE,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE;AACxC,IAAI,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC/B,GAAG;AACH,EAAE,OAAO,OAAO,CAAC;AACjB,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,KAAK;AACxE,EAAE,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACjF,EAAE,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAClD,EAAE,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,OAAO,EAAE;AAC9C,IAAI,KAAK,EAAE,gBAAgB,CAAC,SAAS;AACrC,GAAG,CAAC,CAAC;AACL,EAAE,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACvD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,KAAK;AACjE,EAAE,IAAI,KAAK,CAAC;AACZ,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB;AACA,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B;AACA,EAAE,IAAI,SAAS,IAAI,IAAI,EAAE,OAAO,OAAO,CAAC;AACxC;AACA,EAAE,GAAG;AACL,IAAI,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AAClD,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AACrB,IAAI,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AACpB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AAClF,QAAQ,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AACxC,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAC5B,OAAO;AACP,KAAK;AACL,IAAI,SAAS,GAAG,MAAM,KAAK,KAAK,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AAC9D,GAAG,QAAQ,SAAS,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE;AACnG;AACA,EAAE,OAAO,OAAO,CAAC;AACjB,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,KAAK;AAClD,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,EAAE,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE;AACvD,IAAI,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC;AAC1B,GAAG;AACH,EAAE,QAAQ,IAAI,YAAY,CAAC,MAAM,CAAC;AAClC,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AACxD,EAAE,OAAO,SAAS,KAAK,CAAC,CAAC,IAAI,SAAS,KAAK,QAAQ,CAAC;AACpD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO,GAAG,CAAC,KAAK,KAAK;AAC3B,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC;AAC1B,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;AACnC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AACvB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC;AAChC,EAAE,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3B,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACtB,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,UAAU,IAAI;AACpC;AACA,EAAE,OAAO,KAAK,IAAI;AAClB,IAAI,OAAO,UAAU,IAAI,KAAK,YAAY,UAAU,CAAC;AACrD,GAAG,CAAC;AACJ,CAAC,EAAE,OAAO,UAAU,KAAK,WAAW,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK;AAClC,EAAE,MAAM,SAAS,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChD;AACA,EAAE,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC;AACA,EAAE,IAAI,MAAM,CAAC;AACb;AACA,EAAE,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;AACrD,IAAI,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AAC9B,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,GAAG;AACH,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK;AAClC,EAAE,IAAI,OAAO,CAAC;AACd,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB;AACA,EAAE,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE;AAChD,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACtB,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACjD;AACA,MAAM,WAAW,GAAG,GAAG,IAAI;AAC3B,EAAE,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,uBAAuB;AAC1D,IAAI,SAAS,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;AACjC,MAAM,OAAO,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC;AACnC,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,CAAC;AACF;AACA;AACA,MAAM,cAAc,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,KAAK,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK;AAC5C,EAAE,MAAM,WAAW,GAAG,MAAM,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;AAC5D,EAAE,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAChC;AACA,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,IAAI,KAAK;AAC7C,IAAI,IAAI,GAAG,CAAC;AACZ,IAAI,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,KAAK,EAAE;AAC1D,MAAM,kBAAkB,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC;AACnD,KAAK;AACL,GAAG,CAAC,CAAC;AACL;AACA,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;AACnD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,iBAAiB,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,IAAI,KAAK;AAC/C;AACA,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;AACnF,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL;AACA,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B;AACA,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO;AACnC;AACA,IAAI,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;AAClC;AACA,IAAI,IAAI,UAAU,IAAI,UAAU,EAAE;AAClC,MAAM,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;AAClC,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;AACzB,MAAM,UAAU,CAAC,GAAG,GAAG,MAAM;AAC7B,QAAQ,MAAM,KAAK,CAAC,qCAAqC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACzE,OAAO,CAAC;AACR,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAC;AACD;AACA,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,SAAS,KAAK;AAClD,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB;AACA,EAAE,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK;AAC1B,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI;AACzB,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AACxB,KAAK,CAAC,CAAC;AACP,IAAG;AACH;AACA,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AAClG;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA,MAAM,IAAI,GAAG,MAAM,GAAE;AACrB;AACA,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK;AAChD,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC;AACjB,EAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,YAAY,CAAC;AACvD,EAAC;AACD;AACA,MAAM,KAAK,GAAG,6BAA4B;AAC1C;AACA,MAAM,KAAK,GAAG,YAAY,CAAC;AAC3B;AACA,MAAM,QAAQ,GAAG;AACjB,EAAE,KAAK;AACP,EAAE,KAAK;AACP,EAAE,WAAW,EAAE,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,KAAK;AAClD,EAAC;AACD;AACA,MAAM,cAAc,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAAC,WAAW,KAAK;AACvE,EAAE,IAAI,GAAG,GAAG,EAAE,CAAC;AACf,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;AAC5B,EAAE,OAAO,IAAI,EAAE,EAAE;AACjB,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,EAAC;AAC7C,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB,CAAC,KAAK,EAAE;AACpC,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,UAAU,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrH,CAAC;AACD;AACA,MAAM,YAAY,GAAG,CAAC,GAAG,KAAK;AAC9B,EAAE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;AAC9B;AACA,EAAE,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK;AAC/B;AACA,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC1B,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AACtC,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,GAAG,EAAE,QAAQ,IAAI,MAAM,CAAC,EAAE;AAChC,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAC1B,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;AACjD;AACA,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK;AACxC,UAAU,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;AACrE,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAC7B;AACA,QAAQ,OAAO,MAAM,CAAC;AACtB,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC;AAClB,IAAG;AACH;AACA,EAAE,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACvB,EAAC;AACD;AACA,MAAM,SAAS,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;AAC9C;AACA,MAAM,UAAU,GAAG,CAAC,KAAK;AACzB,EAAE,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvG;AACA,gBAAe;AACf,EAAE,OAAO;AACT,EAAE,aAAa;AACf,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,iBAAiB;AACnB,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,SAAS;AACX,EAAE,QAAQ;AACV,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,QAAQ;AACV,EAAE,iBAAiB;AACnB,EAAE,YAAY;AACd,EAAE,UAAU;AACZ,EAAE,OAAO;AACT,EAAE,KAAK;AACP,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,YAAY;AACd,EAAE,MAAM;AACR,EAAE,UAAU;AACZ,EAAE,QAAQ;AACV,EAAE,OAAO;AACT,EAAE,YAAY;AACd,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,cAAc;AAChB,EAAE,UAAU,EAAE,cAAc;AAC5B,EAAE,iBAAiB;AACnB,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,WAAW;AACb,EAAE,IAAI;AACN,EAAE,cAAc;AAChB,EAAE,OAAO;AACT,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,gBAAgB;AAClB,EAAE,QAAQ;AACV,EAAE,cAAc;AAChB,EAAE,mBAAmB;AACrB,EAAE,YAAY;AACd,EAAE,SAAS;AACX,EAAE,UAAU;AACZ,CAAC;;AC9sBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAU,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;AAC9D,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnB;AACA,EAAE,IAAI,KAAK,CAAC,iBAAiB,EAAE;AAC/B,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACpD,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,EAAE,EAAE,KAAK,CAAC;AACrC,GAAG;AACH;AACA,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;AAC3B,EAAE,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAC7B,EAAE,MAAM,KAAK,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AACnC,EAAE,OAAO,KAAK,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;AACtC,EAAE,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;AACzC,CAAC;AACD;AACAC,OAAK,CAAC,QAAQ,CAACD,YAAU,EAAE,KAAK,EAAE;AAClC,EAAE,MAAM,EAAE,SAAS,MAAM,GAAG;AAC5B,IAAI,OAAO;AACX;AACA,MAAM,OAAO,EAAE,IAAI,CAAC,OAAO;AAC3B,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI;AACrB;AACA,MAAM,WAAW,EAAE,IAAI,CAAC,WAAW;AACnC,MAAM,MAAM,EAAE,IAAI,CAAC,MAAM;AACzB;AACA,MAAM,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC7B,MAAM,UAAU,EAAE,IAAI,CAAC,UAAU;AACjC,MAAM,YAAY,EAAE,IAAI,CAAC,YAAY;AACrC,MAAM,KAAK,EAAE,IAAI,CAAC,KAAK;AACvB;AACA,MAAM,MAAM,EAAEC,OAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;AAC7C,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI;AACrB,MAAM,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI;AACjF,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACA,MAAMC,WAAS,GAAGF,YAAU,CAAC,SAAS,CAAC;AACvC,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB;AACA;AACA,EAAE,sBAAsB;AACxB,EAAE,gBAAgB;AAClB,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,aAAa;AACf,EAAE,2BAA2B;AAC7B,EAAE,gBAAgB;AAClB,EAAE,kBAAkB;AACpB,EAAE,iBAAiB;AACnB,EAAE,cAAc;AAChB,EAAE,iBAAiB;AACnB,EAAE,iBAAiB;AACnB;AACA,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI;AAClB,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC;AACH;AACA,MAAM,CAAC,gBAAgB,CAACA,YAAU,EAAE,WAAW,CAAC,CAAC;AACjD,MAAM,CAAC,cAAc,CAACE,WAAS,EAAE,cAAc,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAChE;AACA;AACAF,YAAU,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,KAAK;AAC3E,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAACE,WAAS,CAAC,CAAC;AAC9C;AACA,EAAED,OAAK,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,MAAM,CAAC,GAAG,EAAE;AAC7D,IAAI,OAAO,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC;AACnC,GAAG,EAAE,IAAI,IAAI;AACb,IAAI,OAAO,IAAI,KAAK,cAAc,CAAC;AACnC,GAAG,CAAC,CAAC;AACL;AACA,EAAED,YAAU,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC9E;AACA,EAAE,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B;AACA,EAAE,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC/B;AACA,EAAE,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACxD;AACA,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;;ACjGD;AACA,oBAAe,IAAI;;ACMnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,EAAE,OAAOC,OAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,GAAG,EAAE;AAC7B,EAAE,OAAOA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC5D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;AACpC,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,CAAC;AACxB,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE;AACtD;AACA,IAAI,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAClC,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;AAClD,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC;AAC3B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,GAAG,EAAE;AAC1B,EAAE,OAAOA,OAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACtD,CAAC;AACD;AACA,MAAM,UAAU,GAAGA,OAAK,CAAC,YAAY,CAACA,OAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE;AAC7E,EAAE,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,YAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC5C,EAAE,IAAI,CAACF,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;AACpD,GAAG;AACH;AACA;AACA,EAAE,QAAQ,GAAG,QAAQ,IAAI,KAAyB,QAAQ,GAAG,CAAC;AAC9D;AACA;AACA,EAAE,OAAO,GAAGA,OAAK,CAAC,YAAY,CAAC,OAAO,EAAE;AACxC,IAAI,UAAU,EAAE,IAAI;AACpB,IAAI,IAAI,EAAE,KAAK;AACf,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG,EAAE,KAAK,EAAE,SAAS,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE;AAC7C;AACA,IAAI,OAAO,CAACA,OAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9C,GAAG,CAAC,CAAC;AACL;AACA,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;AACxC;AACA,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC;AACpD,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAC5B,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC;AACpE,EAAE,MAAM,OAAO,GAAG,KAAK,IAAIA,OAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC/D;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AAClC,IAAI,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;AACtD,GAAG;AACH;AACA,EAAE,SAAS,YAAY,CAAC,KAAK,EAAE;AAC/B,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE,OAAO,EAAE,CAAC;AAClC;AACA,IAAI,IAAIA,OAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AAC7B,MAAM,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AACjC,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,IAAIA,OAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AACzC,MAAM,MAAM,IAAID,YAAU,CAAC,8CAA8C,CAAC,CAAC;AAC3E,KAAK;AACL;AACA,IAAI,IAAIC,OAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;AACjE,MAAM,OAAO,OAAO,IAAI,OAAO,IAAI,KAAK,UAAU,GAAG,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5F,KAAK;AACL;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;AAC5C,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC;AACpB;AACA,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACrD,MAAM,IAAIA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE;AACrC;AACA,QAAQ,GAAG,GAAG,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAClD;AACA,QAAQ,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACtC,OAAO,MAAM;AACb,QAAQ,CAACA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC;AACnD,SAAS,CAACA,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC/F,SAAS,EAAE;AACX;AACA,QAAQ,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAClC;AACA,QAAQ,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE;AAC7C,UAAU,EAAEA,OAAK,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,QAAQ,CAAC,MAAM;AACpE;AACA,YAAY,OAAO,KAAK,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,OAAO,KAAK,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AACpG,YAAY,YAAY,CAAC,EAAE,CAAC;AAC5B,WAAW,CAAC;AACZ,SAAS,CAAC,CAAC;AACX,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE;AAC5B,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL;AACA,IAAI,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;AACnD,IAAI,cAAc;AAClB,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,GAAG,CAAC,CAAC;AACL;AACA,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;AAC9B,IAAI,IAAIA,OAAK,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,OAAO;AACzC;AACA,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;AACrC,MAAM,MAAM,KAAK,CAAC,iCAAiC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACtE,KAAK;AACL;AACA,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtB;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE;AAChD,MAAM,MAAM,MAAM,GAAG,EAAEA,OAAK,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI;AAC5E,QAAQ,QAAQ,EAAE,EAAE,EAAEA,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,cAAc;AAClF,OAAO,CAAC;AACR;AACA,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC3B,QAAQ,KAAK,CAAC,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,OAAO;AACP,KAAK,CAAC,CAAC;AACP;AACA,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AAChB,GAAG;AACH;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAC;AAClD,GAAG;AACH;AACA,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AACb;AACA,EAAE,OAAO,QAAQ,CAAC;AAClB;;ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,QAAM,CAAC,GAAG,EAAE;AACrB,EAAE,MAAM,OAAO,GAAG;AAClB,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,KAAK,EAAE,GAAG;AACd,IAAI,KAAK,EAAE,MAAM;AACjB,GAAG,CAAC;AACJ,EAAE,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,SAAS,QAAQ,CAAC,KAAK,EAAE;AACtF,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1B,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE;AAC/C,EAAE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,MAAM,IAAID,YAAU,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AACD;AACA,MAAM,SAAS,GAAG,oBAAoB,CAAC,SAAS,CAAC;AACjD;AACA,SAAS,CAAC,MAAM,GAAG,SAAS,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;AAChD,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC,CAAC;AACF;AACA,SAAS,CAAC,QAAQ,GAAG,SAAS,QAAQ,CAAC,OAAO,EAAE;AAChD,EAAE,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,KAAK,EAAE;AAC5C,IAAI,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAEC,QAAM,CAAC,CAAC;AAC7C,GAAG,GAAGA,QAAM,CAAC;AACb;AACA,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE;AAC7C,IAAI,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;;AClDD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE;AACrB,EAAE,OAAO,kBAAkB,CAAC,GAAG,CAAC;AAChC,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;AACxB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;AACxB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;AACvD;AACA,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,MAAM,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC;AACtD;AACA,EAAE,MAAM,WAAW,GAAG,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;AACnD;AACA,EAAE,IAAI,gBAAgB,CAAC;AACvB;AACA,EAAE,IAAI,WAAW,EAAE;AACnB,IAAI,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,GAAG,MAAM;AACT,IAAI,gBAAgB,GAAGH,OAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC;AACtD,MAAM,MAAM,CAAC,QAAQ,EAAE;AACvB,MAAM,IAAI,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClE,GAAG;AACH;AACA,EAAE,IAAI,gBAAgB,EAAE;AACxB,IAAI,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC3C;AACA,IAAI,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;AAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AACxC,KAAK;AACL,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,gBAAgB,CAAC;AACpE,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb;;AC1DA,MAAM,kBAAkB,CAAC;AACzB,EAAE,WAAW,GAAG;AAChB,IAAI,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;AACvB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE;AACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;AACvB,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,GAAG,KAAK;AACxD,MAAM,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI;AAC/C,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;AACpC,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,KAAK,CAAC,EAAE,EAAE;AACZ,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;AAC3B,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;AAC/B,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,KAAK,GAAG;AACV,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;AACvB,MAAM,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;AACzB,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,CAAC,EAAE,EAAE;AACd,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,cAAc,CAAC,CAAC,EAAE;AAC5D,MAAM,IAAI,CAAC,KAAK,IAAI,EAAE;AACtB,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACd,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH,CAAC;AACD;AACA,6BAAe,kBAAkB;;ACpEjC,6BAAe;AACf,EAAE,iBAAiB,EAAE,IAAI;AACzB,EAAE,iBAAiB,EAAE,IAAI;AACzB,EAAE,mBAAmB,EAAE,KAAK;AAC5B,CAAC;;ACHD,0BAAe,OAAO,eAAe,KAAK,WAAW,GAAG,eAAe,GAAG,oBAAoB;;ACD9F,mBAAe,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,GAAG,IAAI;;ACAhE,eAAe,OAAO,IAAI,KAAK,WAAW,GAAG,IAAI,GAAG;;ACEpD,mBAAe;AACf,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,OAAO,EAAE;AACX,qBAAII,iBAAe;AACnB,cAAIC,UAAQ;AACZ,UAAIC,MAAI;AACR,GAAG;AACH,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;AAC7D,CAAC;;ACZD,MAAM,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,qBAAqB,GAAG;AAC9B,EAAE,CAAC,OAAO,KAAK;AACf,IAAI,OAAO,aAAa,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;AACtF,GAAG,EAAE,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8BAA8B,GAAG,CAAC,MAAM;AAC9C,EAAE;AACF,IAAI,OAAO,iBAAiB,KAAK,WAAW;AAC5C;AACA,IAAI,IAAI,YAAY,iBAAiB;AACrC,IAAI,OAAO,IAAI,CAAC,aAAa,KAAK,UAAU;AAC5C,IAAI;AACJ,CAAC,GAAG;;;;;;;;;ACrCJ,iBAAe;AACf,EAAE,GAAG,KAAK;AACV,EAAE,GAAGC,UAAQ;AACb;;ACAe,SAAS,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;AACxD,EAAE,OAAOL,YAAU,CAAC,IAAI,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC;AAChF,IAAI,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;AACjD,MAAM,IAAI,QAAQ,CAAC,MAAM,IAAIF,OAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpD,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnD,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO;AACP;AACA,MAAM,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC3D,KAAK;AACL,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACf;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B;AACA;AACA;AACA;AACA,EAAE,OAAOA,OAAK,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI;AAC5D,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AACzD,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;AAC1B,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC5B,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,QAAQ,EAAE;AAClC,EAAE,SAAS,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AACjD,IAAI,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;AAC7B;AACA,IAAI,IAAI,IAAI,KAAK,WAAW,EAAE,OAAO,IAAI,CAAC;AAC1C;AACA,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;AAChD,IAAI,MAAM,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC;AACxC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;AACjE;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;AAC1C,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AAC7C,OAAO,MAAM;AACb,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;AAC7B,OAAO;AACP;AACA,MAAM,OAAO,CAAC,YAAY,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE;AACxD,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AACxB,KAAK;AACL;AACA,IAAI,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/D;AACA,IAAI,IAAI,MAAM,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE;AAC/C,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,KAAK;AACL;AACA,IAAI,OAAO,CAAC,YAAY,CAAC;AACzB,GAAG;AACH;AACA,EAAE,IAAIA,OAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAIA,OAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AACxE,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;AACnB;AACA,IAAIA,OAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK;AAClD,MAAM,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AACpD,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,OAAO,IAAI,CAAC;AACd;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;AACpD,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AAChC,IAAI,IAAI;AACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACvC,MAAM,OAAOA,OAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAClC,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;AACpC,QAAQ,MAAM,CAAC,CAAC;AAChB,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC/C,CAAC;AACD;AACA,MAAM,QAAQ,GAAG;AACjB;AACA,EAAE,YAAY,EAAE,oBAAoB;AACpC;AACA,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AAC1B;AACA,EAAE,gBAAgB,EAAE,CAAC,SAAS,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;AAC9D,IAAI,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;AACvD,IAAI,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5E,IAAI,MAAM,eAAe,GAAGA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjD;AACA,IAAI,IAAI,eAAe,IAAIA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AACnD,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChC,KAAK;AACL;AACA,IAAI,MAAM,UAAU,GAAGA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9C;AACA,IAAI,IAAI,UAAU,EAAE;AACpB,MAAM,OAAO,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;AAC9E,KAAK;AACL;AACA,IAAI,IAAIA,OAAK,CAAC,aAAa,CAAC,IAAI,CAAC;AACjC,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC1B,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC1B,MAAMA,OAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACxB,MAAMA,OAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACxB,MAAM;AACN,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,IAAI,IAAIA,OAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;AACvC,MAAM,OAAO,IAAI,CAAC,MAAM,CAAC;AACzB,KAAK;AACL,IAAI,IAAIA,OAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;AACvC,MAAM,OAAO,CAAC,cAAc,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;AACvF,MAAM,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC7B,KAAK;AACL;AACA,IAAI,IAAI,UAAU,CAAC;AACnB;AACA,IAAI,IAAI,eAAe,EAAE;AACzB,MAAM,IAAI,WAAW,CAAC,OAAO,CAAC,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE;AACzE,QAAQ,OAAO,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtE,OAAO;AACP;AACA,MAAM,IAAI,CAAC,UAAU,GAAGA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAAE;AACpG,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;AACxD;AACA,QAAQ,OAAOE,YAAU;AACzB,UAAU,UAAU,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,IAAI;AAC/C,UAAU,SAAS,IAAI,IAAI,SAAS,EAAE;AACtC,UAAU,IAAI,CAAC,cAAc;AAC7B,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,eAAe,IAAI,kBAAkB,GAAG;AAChD,MAAM,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AACxD,MAAM,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AACnC,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ;AACA,EAAE,iBAAiB,EAAE,CAAC,SAAS,iBAAiB,CAAC,IAAI,EAAE;AACvD,IAAI,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpE,IAAI,MAAM,iBAAiB,GAAG,YAAY,IAAI,YAAY,CAAC,iBAAiB,CAAC;AAC7E,IAAI,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC;AACvD;AACA,IAAI,IAAI,IAAI,IAAIF,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,aAAa,CAAC,EAAE;AACtG,MAAM,MAAM,iBAAiB,GAAG,YAAY,IAAI,YAAY,CAAC,iBAAiB,CAAC;AAC/E,MAAM,MAAM,iBAAiB,GAAG,CAAC,iBAAiB,IAAI,aAAa,CAAC;AACpE;AACA,MAAM,IAAI;AACV,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAChC,OAAO,CAAC,OAAO,CAAC,EAAE;AAClB,QAAQ,IAAI,iBAAiB,EAAE;AAC/B,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;AACxC,YAAY,MAAMD,YAAU,CAAC,IAAI,CAAC,CAAC,EAAEA,YAAU,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC7F,WAAW;AACX,UAAU,MAAM,CAAC,CAAC;AAClB,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,EAAE,CAAC;AACZ;AACA,EAAE,cAAc,EAAE,YAAY;AAC9B,EAAE,cAAc,EAAE,cAAc;AAChC;AACA,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACtB,EAAE,aAAa,EAAE,CAAC,CAAC;AACnB;AACA,EAAE,GAAG,EAAE;AACP,IAAI,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ;AACvC,IAAI,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;AAC/B,GAAG;AACH;AACA,EAAE,cAAc,EAAE,SAAS,cAAc,CAAC,MAAM,EAAE;AAClD,IAAI,OAAO,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC;AACzC,GAAG;AACH;AACA,EAAE,OAAO,EAAE;AACX,IAAI,MAAM,EAAE;AACZ,MAAM,QAAQ,EAAE,mCAAmC;AACnD,MAAM,cAAc,EAAE,SAAS;AAC/B,KAAK;AACL,GAAG;AACH,CAAC,CAAC;AACF;AACAC,OAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,KAAK;AAC7E,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAChC,CAAC,CAAC,CAAC;AACH;AACA,mBAAe,QAAQ;;ACvJvB;AACA;AACA,MAAM,iBAAiB,GAAGA,OAAK,CAAC,WAAW,CAAC;AAC5C,EAAE,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM;AAClE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,qBAAqB;AACvE,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB;AACpE,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY;AACxC,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAe,UAAU,IAAI;AAC7B,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,IAAI,CAAC,CAAC;AACR;AACA,EAAE,UAAU,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,IAAI,EAAE;AACrE,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1B,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACvC;AACA,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE;AACzD,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,GAAG,KAAK,YAAY,EAAE;AAC9B,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;AACvB,QAAQ,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9B,OAAO,MAAM;AACb,QAAQ,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC5B,OAAO;AACP,KAAK,MAAM;AACX,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AACjE,KAAK;AACL,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;;ACjDD,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC;AACA,SAAS,eAAe,CAAC,MAAM,EAAE;AACjC,EAAE,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACvD,CAAC;AACD;AACA,SAAS,cAAc,CAAC,KAAK,EAAE;AAC/B,EAAE,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,IAAI,IAAI,EAAE;AACxC,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,OAAOA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1E,CAAC;AACD;AACA,SAAS,WAAW,CAAC,GAAG,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACrC,EAAE,MAAM,QAAQ,GAAG,kCAAkC,CAAC;AACtD,EAAE,IAAI,KAAK,CAAC;AACZ;AACA,EAAE,QAAQ,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;AACvC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAChC,GAAG;AACH;AACA,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA,MAAM,iBAAiB,GAAG,CAAC,GAAG,KAAK,gCAAgC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;AACrF;AACA,SAAS,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE;AAC9E,EAAE,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAChC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5C,GAAG;AACH;AACA,EAAE,IAAI,kBAAkB,EAAE;AAC1B,IAAI,KAAK,GAAG,MAAM,CAAC;AACnB,GAAG;AACH;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;AACrC;AACA,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9B,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,GAAG;AACH;AACA,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9B,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9B,GAAG;AACH,CAAC;AACD;AACA,SAAS,YAAY,CAAC,MAAM,EAAE;AAC9B,EAAE,OAAO,MAAM,CAAC,IAAI,EAAE;AACtB,KAAK,WAAW,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK;AAChE,MAAM,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC;AACtC,KAAK,CAAC,CAAC;AACP,CAAC;AACD;AACA,SAAS,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE;AACrC,EAAE,MAAM,YAAY,GAAGA,OAAK,CAAC,WAAW,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;AACvD;AACA,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI;AAC9C,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,YAAY,EAAE;AAC1D,MAAM,KAAK,EAAE,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;AACxC,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrE,OAAO;AACP,MAAM,YAAY,EAAE,IAAI;AACxB,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA,MAAMQ,cAAY,CAAC;AACnB,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACjC,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE;AACvC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB;AACA,IAAI,SAAS,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;AAClD,MAAM,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAClE,OAAO;AACP;AACA,MAAM,MAAM,GAAG,GAAGR,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,KAAK,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,EAAE;AAClH,QAAQ,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AACtD,OAAO;AACP,KAAK;AACL;AACA,IAAI,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,QAAQ;AACzC,MAAMA,OAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AACxF;AACA,IAAI,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,YAAY,IAAI,CAAC,WAAW,EAAE;AAC3E,MAAM,UAAU,CAAC,MAAM,EAAE,cAAc,EAAC;AACxC,KAAK,MAAM,GAAGA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE;AAChG,MAAM,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC;AACvD,KAAK,MAAM;AACX,MAAM,MAAM,IAAI,IAAI,IAAI,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACnE,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE;AACtB,IAAI,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C;AACA,MAAM,IAAI,GAAG,EAAE;AACf,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC;AACA,QAAQ,IAAI,CAAC,MAAM,EAAE;AACrB,UAAU,OAAO,KAAK,CAAC;AACvB,SAAS;AACT;AACA,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;AAC7B,UAAU,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AACpC,SAAS;AACT;AACA,QAAQ,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AACtC,UAAU,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/C,SAAS;AACT;AACA,QAAQ,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACpC,UAAU,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpC,SAAS;AACT;AACA,QAAQ,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;AACtE,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE;AACvB,IAAI,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C;AACA,MAAM,OAAO,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,KAAK,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AACjH,KAAK;AACL;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE;AAC1B,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB,IAAI,IAAI,OAAO,GAAG,KAAK,CAAC;AACxB;AACA,IAAI,SAAS,YAAY,CAAC,OAAO,EAAE;AACnC,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AACzC;AACA,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACjD;AACA,QAAQ,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE;AAClF,UAAU,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B;AACA,UAAU,OAAO,GAAG,IAAI,CAAC;AACzB,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC/B,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACnC,KAAK,MAAM;AACX,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,KAAK,CAAC,OAAO,EAAE;AACjB,IAAI,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACxB,IAAI,IAAI,OAAO,GAAG,KAAK,CAAC;AACxB;AACA,IAAI,OAAO,CAAC,EAAE,EAAE;AAChB,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1B,MAAM,GAAG,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;AAC5E,QAAQ,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,QAAQ,OAAO,GAAG,IAAI,CAAC;AACvB,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,SAAS,CAAC,MAAM,EAAE;AACpB,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB,IAAI,MAAM,OAAO,GAAG,EAAE,CAAC;AACvB;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK;AAC3C,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACjD;AACA,MAAM,IAAI,GAAG,EAAE;AACf,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/E;AACA,MAAM,IAAI,UAAU,KAAK,MAAM,EAAE;AACjC,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,OAAO;AACP;AACA,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/C;AACA,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;AACjC,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,GAAG,OAAO,EAAE;AACrB,IAAI,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;AACrD,GAAG;AACH;AACA,EAAE,MAAM,CAAC,SAAS,EAAE;AACpB,IAAI,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACpC;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK;AAC3C,MAAM,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,KAAK,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;AACvH,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG;AACtB,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC5D,GAAG;AACH;AACA,EAAE,QAAQ,GAAG;AACb,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpG,GAAG;AACH;AACA,EAAE,KAAK,MAAM,CAAC,WAAW,CAAC,GAAG;AAC7B,IAAI,OAAO,cAAc,CAAC;AAC1B,GAAG;AACH;AACA,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE;AACrB,IAAI,OAAO,KAAK,YAAY,IAAI,GAAG,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3D,GAAG;AACH;AACA,EAAE,OAAO,MAAM,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE;AACnC,IAAI,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC;AACA,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACtD;AACA,IAAI,OAAO,QAAQ,CAAC;AACpB,GAAG;AACH;AACA,EAAE,OAAO,QAAQ,CAAC,MAAM,EAAE;AAC1B,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG;AAC7D,MAAM,SAAS,EAAE,EAAE;AACnB,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;AAC1C,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AACrC;AACA,IAAI,SAAS,cAAc,CAAC,OAAO,EAAE;AACrC,MAAM,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAQ,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC3C,QAAQ,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAClC,OAAO;AACP,KAAK;AACL;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AACpF;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,CAAC;AACD;AACAQ,cAAY,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;AACtH;AACA;AACAR,OAAK,CAAC,iBAAiB,CAACQ,cAAY,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK;AAClE,EAAE,IAAI,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnD,EAAE,OAAO;AACT,IAAI,GAAG,EAAE,MAAM,KAAK;AACpB,IAAI,GAAG,CAAC,WAAW,EAAE;AACrB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AACjC,KAAK;AACL,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACAR,OAAK,CAAC,aAAa,CAACQ,cAAY,CAAC,CAAC;AAClC;AACA,uBAAeA,cAAY;;ACnS3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE;AACrD,EAAE,MAAM,MAAM,GAAG,IAAI,IAAIC,UAAQ,CAAC;AAClC,EAAE,MAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC;AACrC,EAAE,MAAM,OAAO,GAAGD,cAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACrD,EAAE,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAC1B;AACA,EAAER,OAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,SAAS,CAAC,EAAE,EAAE;AAC5C,IAAI,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAC9F,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;AACtB;AACA,EAAE,OAAO,IAAI,CAAC;AACd;;ACzBe,SAASU,UAAQ,CAAC,KAAK,EAAE;AACxC,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AACvC;;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;AACjD;AACA,EAAEZ,YAAU,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,IAAI,IAAI,GAAG,UAAU,GAAG,OAAO,EAAEA,YAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1G,EAAE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;AAC9B,CAAC;AACD;AACAC,OAAK,CAAC,QAAQ,CAACW,eAAa,EAAEZ,YAAU,EAAE;AAC1C,EAAE,UAAU,EAAE,IAAI;AAClB,CAAC,CAAC;;AClBF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;AAC1D,EAAE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC;AACxD,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9E,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;AACtB,GAAG,MAAM;AACT,IAAI,MAAM,CAAC,IAAIA,YAAU;AACzB,MAAM,kCAAkC,GAAG,QAAQ,CAAC,MAAM;AAC1D,MAAM,CAACA,YAAU,CAAC,eAAe,EAAEA,YAAU,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACtG,MAAM,QAAQ,CAAC,MAAM;AACrB,MAAM,QAAQ,CAAC,OAAO;AACtB,MAAM,QAAQ;AACd,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;ACvBA,gBAAe,QAAQ,CAAC,qBAAqB;AAC7C;AACA;AACA,EAAE;AACF,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACtD,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,GAAG,GAAG,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D;AACA,MAAMC,OAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC3F;AACA,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAC1D;AACA,MAAMA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;AAChE;AACA,MAAM,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/C;AACA,MAAM,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1C,KAAK;AACL;AACA,IAAI,IAAI,CAAC,IAAI,EAAE;AACf,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,YAAY,GAAG,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC;AACzF,MAAM,QAAQ,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE;AAC3D,KAAK;AACL;AACA,IAAI,MAAM,CAAC,IAAI,EAAE;AACjB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC;AAClD,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA,EAAE;AACF,IAAI,KAAK,GAAG,EAAE;AACd,IAAI,IAAI,GAAG;AACX,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,GAAG,EAAE;AACf,GAAG;;ACtCH;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,GAAG,EAAE;AAC3C;AACA;AACA;AACA,EAAE,OAAO,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjD;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE;AAC1D,EAAE,OAAO,WAAW;AACpB,MAAM,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;AAC3E,MAAM,OAAO,CAAC;AACd;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE;AAC7D,EAAE,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE;AAC/C,IAAI,OAAO,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAC9C,GAAG;AACH,EAAE,OAAO,YAAY,CAAC;AACtB;;ACfA,wBAAe,QAAQ,CAAC,qBAAqB;AAC7C;AACA;AACA;AACA,EAAE,CAAC,SAAS,kBAAkB,GAAG;AACjC,IAAI,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAC7D,IAAI,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AACvD,IAAI,IAAI,SAAS,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,CAAC,GAAG,EAAE;AAC7B,MAAM,IAAI,IAAI,GAAG,GAAG,CAAC;AACrB;AACA,MAAM,IAAI,IAAI,EAAE;AAChB;AACA,QAAQ,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAClD,QAAQ,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;AACnC,OAAO;AACP;AACA,MAAM,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAChD;AACA;AACA,MAAM,OAAO;AACb,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,QAAQ,EAAE,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE;AAC1F,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE;AACrF,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE;AAC9E,QAAQ,QAAQ,EAAE,cAAc,CAAC,QAAQ;AACzC,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,QAAQ,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;AAC5D,UAAU,cAAc,CAAC,QAAQ;AACjC,UAAU,GAAG,GAAG,cAAc,CAAC,QAAQ;AACvC,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,SAAS,eAAe,CAAC,UAAU,EAAE;AAChD,MAAM,MAAM,MAAM,GAAG,CAACA,OAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;AACxF,MAAM,QAAQ,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;AACpD,UAAU,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE;AAC1C,KAAK,CAAC;AACN,GAAG,GAAG;AACN;AACA;AACA,EAAE,CAAC,SAAS,qBAAqB,GAAG;AACpC,IAAI,OAAO,SAAS,eAAe,GAAG;AACtC,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK,CAAC;AACN,GAAG,GAAG;;AChES,SAAS,aAAa,CAAC,GAAG,EAAE;AAC3C,EAAE,MAAM,KAAK,GAAG,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtD,EAAE,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,YAAY,EAAE,GAAG,EAAE;AACxC,EAAE,YAAY,GAAG,YAAY,IAAI,EAAE,CAAC;AACpC,EAAE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACxC,EAAE,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AAC7C,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AACf,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AACf,EAAE,IAAI,aAAa,CAAC;AACpB;AACA,EAAE,GAAG,GAAG,GAAG,KAAK,SAAS,GAAG,GAAG,GAAG,IAAI,CAAC;AACvC;AACA,EAAE,OAAO,SAAS,IAAI,CAAC,WAAW,EAAE;AACpC,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3B;AACA,IAAI,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AACvC;AACA,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,KAAK;AACL;AACA,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC;AAC9B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;AAC3B;AACA,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC;AACjB,IAAI,IAAI,UAAU,GAAG,CAAC,CAAC;AACvB;AACA,IAAI,OAAO,CAAC,KAAK,IAAI,EAAE;AACvB,MAAM,UAAU,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,YAAY,CAAC;AACrC;AACA,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE;AACvB,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,YAAY,CAAC;AACvC,KAAK;AACL;AACA,IAAI,IAAI,GAAG,GAAG,aAAa,GAAG,GAAG,EAAE;AACnC,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,MAAM,MAAM,GAAG,SAAS,IAAI,GAAG,GAAG,SAAS,CAAC;AAChD;AACA,IAAI,OAAO,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;AACvE,GAAG,CAAC;AACJ;;ACpCA,SAAS,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE;AAC1D,EAAE,IAAI,aAAa,GAAG,CAAC,CAAC;AACxB,EAAE,MAAM,YAAY,GAAG,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC5C;AACA,EAAE,OAAO,CAAC,IAAI;AACd,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AAC5B,IAAI,MAAM,KAAK,GAAG,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;AAC3D,IAAI,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC;AACjD,IAAI,MAAM,IAAI,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC7C,IAAI,MAAM,OAAO,GAAG,MAAM,IAAI,KAAK,CAAC;AACpC;AACA,IAAI,aAAa,GAAG,MAAM,CAAC;AAC3B;AACA,IAAI,MAAM,IAAI,GAAG;AACjB,MAAM,MAAM;AACZ,MAAM,KAAK;AACX,MAAM,QAAQ,EAAE,KAAK,IAAI,MAAM,GAAG,KAAK,IAAI,SAAS;AACpD,MAAM,KAAK,EAAE,aAAa;AAC1B,MAAM,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS;AACnC,MAAM,SAAS,EAAE,IAAI,IAAI,KAAK,IAAI,OAAO,GAAG,CAAC,KAAK,GAAG,MAAM,IAAI,IAAI,GAAG,SAAS;AAC/E,MAAM,KAAK,EAAE,CAAC;AACd,KAAK,CAAC;AACN;AACA,IAAI,IAAI,CAAC,gBAAgB,GAAG,UAAU,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC;AAC1D;AACA,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,GAAG,CAAC;AACJ,CAAC;AACD;AACA,MAAM,qBAAqB,GAAG,OAAO,cAAc,KAAK,WAAW,CAAC;AACpE;AACA,mBAAe,qBAAqB,IAAI,UAAU,MAAM,EAAE;AAC1D,EAAE,OAAO,IAAI,OAAO,CAAC,SAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE;AAClE,IAAI,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC;AAClC,IAAI,MAAM,cAAc,GAAGQ,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;AACzE,IAAI,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,MAAM,CAAC;AAC/C,IAAI,IAAI,UAAU,CAAC;AACnB,IAAI,SAAS,IAAI,GAAG;AACpB,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE;AAC9B,QAAQ,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACnD,OAAO;AACP;AACA,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACzB,QAAQ,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC/D,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,WAAW,CAAC;AACpB;AACA,IAAI,IAAIR,OAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;AACvC,MAAM,IAAI,QAAQ,CAAC,qBAAqB,IAAI,QAAQ,CAAC,8BAA8B,EAAE;AACrF,QAAQ,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAC7C,OAAO,MAAM,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC,cAAc,EAAE,MAAM,KAAK,EAAE;AAC5E;AACA,QAAQ,MAAM,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;AACvH,QAAQ,cAAc,CAAC,cAAc,CAAC,CAAC,IAAI,IAAI,qBAAqB,EAAE,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7F,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;AACvC;AACA;AACA,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE;AACrB,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;AAClD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;AACtG,MAAM,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC;AACtF,KAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/D;AACA,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;AAChH;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACrC;AACA,IAAI,SAAS,SAAS,GAAG;AACzB,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,eAAe,GAAGQ,cAAY,CAAC,IAAI;AAC/C,QAAQ,uBAAuB,IAAI,OAAO,IAAI,OAAO,CAAC,qBAAqB,EAAE;AAC7E,OAAO,CAAC;AACR,MAAM,MAAM,YAAY,GAAG,CAAC,YAAY,IAAI,YAAY,KAAK,MAAM,IAAI,YAAY,KAAK,MAAM;AAC9F,QAAQ,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChD,MAAM,MAAM,QAAQ,GAAG;AACvB,QAAQ,IAAI,EAAE,YAAY;AAC1B,QAAQ,MAAM,EAAE,OAAO,CAAC,MAAM;AAC9B,QAAQ,UAAU,EAAE,OAAO,CAAC,UAAU;AACtC,QAAQ,OAAO,EAAE,eAAe;AAChC,QAAQ,MAAM;AACd,QAAQ,OAAO;AACf,OAAO,CAAC;AACR;AACA,MAAM,MAAM,CAAC,SAAS,QAAQ,CAAC,KAAK,EAAE;AACtC,QAAQ,OAAO,CAAC,KAAK,CAAC,CAAC;AACvB,QAAQ,IAAI,EAAE,CAAC;AACf,OAAO,EAAE,SAAS,OAAO,CAAC,GAAG,EAAE;AAC/B,QAAQ,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,QAAQ,IAAI,EAAE,CAAC;AACf,OAAO,EAAE,QAAQ,CAAC,CAAC;AACnB;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK;AACL;AACA,IAAI,IAAI,WAAW,IAAI,OAAO,EAAE;AAChC;AACA,MAAM,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;AACpC,KAAK,MAAM;AACX;AACA,MAAM,OAAO,CAAC,kBAAkB,GAAG,SAAS,UAAU,GAAG;AACzD,QAAQ,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,CAAC,EAAE;AAClD,UAAU,OAAO;AACjB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;AAC1G,UAAU,OAAO;AACjB,SAAS;AACT;AACA;AACA,QAAQ,UAAU,CAAC,SAAS,CAAC,CAAC;AAC9B,OAAO,CAAC;AACR,KAAK;AACL;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,WAAW,GAAG;AAC7C,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,CAAC,IAAIT,YAAU,CAAC,iBAAiB,EAAEA,YAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1F;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,WAAW,GAAG;AAC7C;AACA;AACA,MAAM,MAAM,CAAC,IAAIA,YAAU,CAAC,eAAe,EAAEA,YAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACvF;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,aAAa,GAAG;AACjD,MAAM,IAAI,mBAAmB,GAAG,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAC;AACrH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,oBAAoB,CAAC;AACvE,MAAM,IAAI,MAAM,CAAC,mBAAmB,EAAE;AACtC,QAAQ,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACzD,OAAO;AACP,MAAM,MAAM,CAAC,IAAIA,YAAU;AAC3B,QAAQ,mBAAmB;AAC3B,QAAQ,YAAY,CAAC,mBAAmB,GAAGA,YAAU,CAAC,SAAS,GAAGA,YAAU,CAAC,YAAY;AACzF,QAAQ,MAAM;AACd,QAAQ,OAAO,CAAC,CAAC,CAAC;AAClB;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA;AACA;AACA,IAAI,GAAG,QAAQ,CAAC,qBAAqB,EAAE;AACvC,MAAM,aAAa,IAAIC,OAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAClG;AACA,MAAM,IAAI,aAAa,KAAK,aAAa,KAAK,KAAK,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAE;AACnF;AACA,QAAQ,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAChH;AACA,QAAQ,IAAI,SAAS,EAAE;AACvB,UAAU,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;AAC/D,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA,IAAI,WAAW,KAAK,SAAS,IAAI,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACrE;AACA;AACA,IAAI,IAAI,kBAAkB,IAAI,OAAO,EAAE;AACvC,MAAMA,OAAK,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE;AACjF,QAAQ,OAAO,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC3C,OAAO,CAAC,CAAC;AACT,KAAK;AACL;AACA;AACA,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;AACpD,MAAM,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC;AACzD,KAAK;AACL;AACA;AACA,IAAI,IAAI,YAAY,IAAI,YAAY,KAAK,MAAM,EAAE;AACjD,MAAM,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACjD,KAAK;AACL;AACA;AACA,IAAI,IAAI,OAAO,MAAM,CAAC,kBAAkB,KAAK,UAAU,EAAE;AACzD,MAAM,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,oBAAoB,CAAC,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC;AAClG,KAAK;AACL;AACA;AACA,IAAI,IAAI,OAAO,MAAM,CAAC,gBAAgB,KAAK,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE;AACzE,MAAM,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACjG,KAAK;AACL;AACA,IAAI,IAAI,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE;AAC7C;AACA;AACA,MAAM,UAAU,GAAG,MAAM,IAAI;AAC7B,QAAQ,IAAI,CAAC,OAAO,EAAE;AACtB,UAAU,OAAO;AACjB,SAAS;AACT,QAAQ,MAAM,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,IAAIW,eAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;AAC3F,QAAQ,OAAO,CAAC,KAAK,EAAE,CAAC;AACxB,QAAQ,OAAO,GAAG,IAAI,CAAC;AACvB,OAAO,CAAC;AACR;AACA,MAAM,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACrE,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACzB,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,GAAG,UAAU,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACnG,OAAO;AACP,KAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC7C;AACA,IAAI,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;AACjE,MAAM,MAAM,CAAC,IAAIZ,YAAU,CAAC,uBAAuB,GAAG,QAAQ,GAAG,GAAG,EAAEA,YAAU,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAC3G,MAAM,OAAO;AACb,KAAK;AACL;AACA;AACA;AACA,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;AACtC,GAAG,CAAC,CAAC;AACL;;AC9PA,MAAM,aAAa,GAAG;AACtB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,GAAG,EAAE,UAAU;AACjB,EAAC;AACD;AACAC,OAAK,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,KAAK,KAAK;AAC5C,EAAE,IAAI,EAAE,EAAE;AACV,IAAI,IAAI;AACR,MAAM,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB;AACA,KAAK;AACL,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACtD,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACA,MAAM,YAAY,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C;AACA,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAKA,OAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC;AACzG;AACA,iBAAe;AACf,EAAE,UAAU,EAAE,CAAC,QAAQ,KAAK;AAC5B,IAAI,QAAQ,GAAGA,OAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/D;AACA,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;AAC9B,IAAI,IAAI,aAAa,CAAC;AACtB,IAAI,IAAI,OAAO,CAAC;AAChB;AACA,IAAI,MAAM,eAAe,GAAG,EAAE,CAAC;AAC/B;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAClC,MAAM,IAAI,EAAE,CAAC;AACb;AACA,MAAM,OAAO,GAAG,aAAa,CAAC;AAC9B;AACA,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE;AAC5C,QAAQ,OAAO,GAAG,aAAa,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;AAC5E;AACA,QAAQ,IAAI,OAAO,KAAK,SAAS,EAAE;AACnC,UAAU,MAAM,IAAID,YAAU,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,SAAS;AACT,OAAO;AACP;AACA,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,MAAM;AACd,OAAO;AACP;AACA,MAAM,eAAe,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/C,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB;AACA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;AACrD,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC9C,WAAW,KAAK,KAAK,KAAK,GAAG,qCAAqC,GAAG,+BAA+B,CAAC;AACrG,SAAS,CAAC;AACV;AACA,MAAM,IAAI,CAAC,GAAG,MAAM;AACpB,SAAS,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACjH,QAAQ,yBAAyB,CAAC;AAClC;AACA,MAAM,MAAM,IAAIA,YAAU;AAC1B,QAAQ,CAAC,qDAAqD,CAAC,GAAG,CAAC;AACnE,QAAQ,iBAAiB;AACzB,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE,aAAa;AACzB;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B,CAAC,MAAM,EAAE;AAC9C,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE;AAC1B,IAAI,MAAM,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC;AAC1C,GAAG;AACH;AACA,EAAE,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;AAC9C,IAAI,MAAM,IAAIY,eAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,eAAe,CAAC,MAAM,EAAE;AAChD,EAAE,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACvC;AACA,EAAE,MAAM,CAAC,OAAO,GAAGH,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrD;AACA;AACA,EAAE,MAAM,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AAClC,IAAI,MAAM;AACV,IAAI,MAAM,CAAC,gBAAgB;AAC3B,GAAG,CAAC;AACJ;AACA,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;AAC9D,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;AAC9E,GAAG;AACH;AACA,EAAE,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,IAAIC,UAAQ,CAAC,OAAO,CAAC,CAAC;AAC1E;AACA,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,mBAAmB,CAAC,QAAQ,EAAE;AACrE,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACzC;AACA;AACA,IAAI,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AACtC,MAAM,MAAM;AACZ,MAAM,MAAM,CAAC,iBAAiB;AAC9B,MAAM,QAAQ;AACd,KAAK,CAAC;AACN;AACA,IAAI,QAAQ,CAAC,OAAO,GAAGD,cAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3D;AACA,IAAI,OAAO,QAAQ,CAAC;AACpB,GAAG,EAAE,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACzC,IAAI,IAAI,CAACE,UAAQ,CAAC,MAAM,CAAC,EAAE;AAC3B,MAAM,4BAA4B,CAAC,MAAM,CAAC,CAAC;AAC3C;AACA;AACA,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;AACrC,QAAQ,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AACjD,UAAU,MAAM;AAChB,UAAU,MAAM,CAAC,iBAAiB;AAClC,UAAU,MAAM,CAAC,QAAQ;AACzB,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAGF,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7E,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClC,GAAG,CAAC,CAAC;AACL;;AC3EA,MAAM,eAAe,GAAG,CAAC,KAAK,KAAK,KAAK,YAAYA,cAAY,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASI,aAAW,CAAC,OAAO,EAAE,OAAO,EAAE;AACtD;AACA,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB;AACA,EAAE,SAAS,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE;AACpD,IAAI,IAAIZ,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;AACpE,MAAM,OAAOA,OAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1D,KAAK,MAAM,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;AAC5C,MAAM,OAAOA,OAAK,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;AACrC,KAAK,MAAM,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACtC,MAAM,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AAC5B,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH;AACA;AACA,EAAE,SAAS,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE;AAC/C,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5C,KAAK,MAAM,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AACtC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AACpD,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE;AAClC,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE;AAClC,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK,MAAM,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AACtC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE;AACvC,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE;AACzB,MAAM,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClC,KAAK,MAAM,IAAI,IAAI,IAAI,OAAO,EAAE;AAChC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA,EAAE,MAAM,QAAQ,GAAG;AACnB,IAAI,GAAG,EAAE,gBAAgB;AACzB,IAAI,MAAM,EAAE,gBAAgB;AAC5B,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,iBAAiB,EAAE,gBAAgB;AACvC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,eAAe,EAAE,gBAAgB;AACrC,IAAI,aAAa,EAAE,gBAAgB;AACnC,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,YAAY,EAAE,gBAAgB;AAClC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,kBAAkB,EAAE,gBAAgB;AACxC,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,aAAa,EAAE,gBAAgB;AACnC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,SAAS,EAAE,gBAAgB;AAC/B,IAAI,SAAS,EAAE,gBAAgB;AAC/B,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,WAAW,EAAE,gBAAgB;AACjC,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,cAAc,EAAE,eAAe;AACnC,IAAI,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACxF,GAAG,CAAC;AACJ;AACA,EAAEA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS,kBAAkB,CAAC,IAAI,EAAE;AACpG,IAAI,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC;AACxD,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAClE,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,KAAK,KAAK,eAAe,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;AAClG,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,MAAM,CAAC;AAChB;;ACzGO,MAAMa,SAAO,GAAG,OAAO;;ACK9B,MAAMC,YAAU,GAAG,EAAE,CAAC;AACtB;AACA;AACA,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK;AACrF,EAAEA,YAAU,CAAC,IAAI,CAAC,GAAG,SAAS,SAAS,CAAC,KAAK,EAAE;AAC/C,IAAI,OAAO,OAAO,KAAK,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;AACtE,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;AACA,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAA,YAAU,CAAC,YAAY,GAAG,SAAS,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE;AAC7E,EAAE,SAAS,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE;AACpC,IAAI,OAAO,UAAU,GAAGD,SAAO,GAAG,0BAA0B,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,IAAI,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AACnH,GAAG;AACH;AACA;AACA,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,KAAK;AAC/B,IAAI,IAAI,SAAS,KAAK,KAAK,EAAE;AAC7B,MAAM,MAAM,IAAId,YAAU;AAC1B,QAAQ,aAAa,CAAC,GAAG,EAAE,mBAAmB,IAAI,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AACnF,QAAQA,YAAU,CAAC,cAAc;AACjC,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE;AAC7C,MAAM,kBAAkB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACrC;AACA,MAAM,OAAO,CAAC,IAAI;AAClB,QAAQ,aAAa;AACrB,UAAU,GAAG;AACb,UAAU,8BAA8B,GAAG,OAAO,GAAG,yCAAyC;AAC9F,SAAS;AACT,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,OAAO,SAAS,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;AAC1D,GAAG,CAAC;AACJ,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE;AACtD,EAAE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACnC,IAAI,MAAM,IAAIA,YAAU,CAAC,2BAA2B,EAAEA,YAAU,CAAC,oBAAoB,CAAC,CAAC;AACvF,GAAG;AACH,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACtB,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,IAAI,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAClC,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AACjC,MAAM,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AAC3E,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC3B,QAAQ,MAAM,IAAIA,YAAU,CAAC,SAAS,GAAG,GAAG,GAAG,WAAW,GAAG,MAAM,EAAEA,YAAU,CAAC,oBAAoB,CAAC,CAAC;AACtG,OAAO;AACP,MAAM,SAAS;AACf,KAAK;AACL,IAAI,IAAI,YAAY,KAAK,IAAI,EAAE;AAC/B,MAAM,MAAM,IAAIA,YAAU,CAAC,iBAAiB,GAAG,GAAG,EAAEA,YAAU,CAAC,cAAc,CAAC,CAAC;AAC/E,KAAK;AACL,GAAG;AACH,CAAC;AACD;AACA,kBAAe;AACf,EAAE,aAAa;AACf,cAAEe,YAAU;AACZ,CAAC;;AC/ED,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,OAAK,CAAC;AACZ,EAAE,WAAW,CAAC,cAAc,EAAE;AAC9B,IAAI,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;AACnC,IAAI,IAAI,CAAC,YAAY,GAAG;AACxB,MAAM,OAAO,EAAE,IAAIC,oBAAkB,EAAE;AACvC,MAAM,QAAQ,EAAE,IAAIA,oBAAkB,EAAE;AACxC,KAAK,CAAC;AACN,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE;AACrC,IAAI,IAAI;AACR,MAAM,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACtD,KAAK,CAAC,OAAO,GAAG,EAAE;AAClB,MAAM,IAAI,GAAG,YAAY,KAAK,EAAE;AAChC,QAAQ,IAAI,KAAK,CAAC;AAClB;AACA,QAAQ,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;AAC9F;AACA;AACA,QAAQ,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;AAC1E;AACA,QAAQ,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE;AACxB,UAAU,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B;AACA,SAAS,MAAM,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE;AACzF,UAAU,GAAG,CAAC,KAAK,IAAI,IAAI,GAAG,MAAK;AACnC,SAAS;AACT,OAAO;AACP;AACA,MAAM,MAAM,GAAG,CAAC;AAChB,KAAK;AACL,GAAG;AACH;AACA,EAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;AAChC;AACA;AACA,IAAI,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;AACzC,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;AAC5B,MAAM,MAAM,CAAC,GAAG,GAAG,WAAW,CAAC;AAC/B,KAAK,MAAM;AACX,MAAM,MAAM,GAAG,WAAW,IAAI,EAAE,CAAC;AACjC,KAAK;AACL;AACA,IAAI,MAAM,GAAGJ,aAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChD;AACA,IAAI,MAAM,CAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;AAC7D;AACA,IAAI,IAAI,YAAY,KAAK,SAAS,EAAE;AACpC,MAAM,SAAS,CAAC,aAAa,CAAC,YAAY,EAAE;AAC5C,QAAQ,iBAAiB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACtE,QAAQ,iBAAiB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACtE,QAAQ,mBAAmB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACxE,OAAO,EAAE,KAAK,CAAC,CAAC;AAChB,KAAK;AACL;AACA,IAAI,IAAI,gBAAgB,IAAI,IAAI,EAAE;AAClC,MAAM,IAAIZ,OAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;AAC9C,QAAQ,MAAM,CAAC,gBAAgB,GAAG;AAClC,UAAU,SAAS,EAAE,gBAAgB;AACrC,UAAS;AACT,OAAO,MAAM;AACb,QAAQ,SAAS,CAAC,aAAa,CAAC,gBAAgB,EAAE;AAClD,UAAU,MAAM,EAAE,UAAU,CAAC,QAAQ;AACrC,UAAU,SAAS,EAAE,UAAU,CAAC,QAAQ;AACxC,SAAS,EAAE,IAAI,CAAC,CAAC;AACjB,OAAO;AACP,KAAK;AACL;AACA;AACA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,KAAK,EAAE,WAAW,EAAE,CAAC;AACnF;AACA;AACA,IAAI,IAAI,cAAc,GAAG,OAAO,IAAIA,OAAK,CAAC,KAAK;AAC/C,MAAM,OAAO,CAAC,MAAM;AACpB,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AAC5B,KAAK,CAAC;AACN;AACA,IAAI,OAAO,IAAIA,OAAK,CAAC,OAAO;AAC5B,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;AACjE,MAAM,CAAC,MAAM,KAAK;AAClB,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,OAAO;AACP,KAAK,CAAC;AACN;AACA,IAAI,MAAM,CAAC,OAAO,GAAGQ,cAAY,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAClE;AACA;AACA,IAAI,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACvC,IAAI,IAAI,8BAA8B,GAAG,IAAI,CAAC;AAC9C,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,0BAA0B,CAAC,WAAW,EAAE;AACvF,MAAM,IAAI,OAAO,WAAW,CAAC,OAAO,KAAK,UAAU,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE;AAC9F,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,8BAA8B,GAAG,8BAA8B,IAAI,WAAW,CAAC,WAAW,CAAC;AACjG;AACA,MAAM,uBAAuB,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;AACnF,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACxC,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,wBAAwB,CAAC,WAAW,EAAE;AACtF,MAAM,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;AACjF,KAAK,CAAC,CAAC;AACP;AACA,IAAI,IAAI,OAAO,CAAC;AAChB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,IAAI,IAAI,GAAG,CAAC;AACZ;AACA,IAAI,IAAI,CAAC,8BAA8B,EAAE;AACzC,MAAM,MAAM,KAAK,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;AAC5D,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;AAC1D,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;AACxD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;AACzB;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACxC;AACA,MAAM,OAAO,CAAC,GAAG,GAAG,EAAE;AACtB,QAAQ,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvD,OAAO;AACP;AACA,MAAM,OAAO,OAAO,CAAC;AACrB,KAAK;AACL;AACA,IAAI,GAAG,GAAG,uBAAuB,CAAC,MAAM,CAAC;AACzC;AACA,IAAI,IAAI,SAAS,GAAG,MAAM,CAAC;AAC3B;AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,MAAM,MAAM,WAAW,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC;AACtD,MAAM,IAAI;AACV,QAAQ,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAC3C,OAAO,CAAC,OAAO,KAAK,EAAE;AACtB,QAAQ,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACrC,QAAQ,MAAM;AACd,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI;AACR,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACtD,KAAK,CAAC,OAAO,KAAK,EAAE;AACpB,MAAM,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnC,KAAK;AACL;AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,IAAI,GAAG,GAAG,wBAAwB,CAAC,MAAM,CAAC;AAC1C;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3F,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,MAAM,EAAE;AACjB,IAAI,MAAM,GAAGI,aAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChD,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/D,IAAI,OAAO,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACtE,GAAG;AACH,CAAC;AACD;AACA;AACAZ,OAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,mBAAmB,CAAC,MAAM,EAAE;AACzF;AACA,EAAEe,OAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,EAAE,MAAM,EAAE;AAClD,IAAI,OAAO,IAAI,CAAC,OAAO,CAACH,aAAW,CAAC,MAAM,IAAI,EAAE,EAAE;AAClD,MAAM,MAAM;AACZ,MAAM,GAAG;AACT,MAAM,IAAI,EAAE,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI;AAC/B,KAAK,CAAC,CAAC,CAAC;AACR,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;AACAZ,OAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,SAAS,qBAAqB,CAAC,MAAM,EAAE;AAC/E;AACA;AACA,EAAE,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACtC,IAAI,OAAO,SAAS,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE;AAClD,MAAM,OAAO,IAAI,CAAC,OAAO,CAACY,aAAW,CAAC,MAAM,IAAI,EAAE,EAAE;AACpD,QAAQ,MAAM;AACd,QAAQ,OAAO,EAAE,MAAM,GAAG;AAC1B,UAAU,cAAc,EAAE,qBAAqB;AAC/C,SAAS,GAAG,EAAE;AACd,QAAQ,GAAG;AACX,QAAQ,IAAI;AACZ,OAAO,CAAC,CAAC,CAAC;AACV,KAAK,CAAC;AACN,GAAG;AACH;AACA,EAAEG,OAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,kBAAkB,EAAE,CAAC;AACjD;AACA,EAAEA,OAAK,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC,CAAC,CAAC;AACH;AACA,gBAAeA,OAAK;;AC5NpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,aAAW,CAAC;AAClB,EAAE,WAAW,CAAC,QAAQ,EAAE;AACxB,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;AACxC,MAAM,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;AAC1D,KAAK;AACL;AACA,IAAI,IAAI,cAAc,CAAC;AACvB;AACA,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,SAAS,eAAe,CAAC,OAAO,EAAE;AACjE,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC;AACvB;AACA;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI;AAChC,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO;AACpC;AACA,MAAM,IAAI,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;AACtC;AACA,MAAM,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AACtB,QAAQ,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACpC,OAAO;AACP,MAAM,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;AAC9B,KAAK,CAAC,CAAC;AACP;AACA;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,WAAW,IAAI;AACvC,MAAM,IAAI,QAAQ,CAAC;AACnB;AACA,MAAM,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,IAAI;AAC7C,QAAQ,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,QAAQ,QAAQ,GAAG,OAAO,CAAC;AAC3B,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC3B;AACA,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,MAAM,GAAG;AACzC,QAAQ,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AACpC,OAAO,CAAC;AACR;AACA,MAAM,OAAO,OAAO,CAAC;AACrB,KAAK,CAAC;AACN;AACA,IAAI,QAAQ,CAAC,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;AACvD,MAAM,IAAI,KAAK,CAAC,MAAM,EAAE;AACxB;AACA,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,KAAK,CAAC,MAAM,GAAG,IAAIN,eAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACjE,MAAM,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP,GAAG;AACH;AACA;AACA;AACA;AACA,EAAE,gBAAgB,GAAG;AACrB,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;AACrB,MAAM,MAAM,IAAI,CAAC,MAAM,CAAC;AACxB,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,CAAC,QAAQ,EAAE;AACtB,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;AACrB,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrC,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,UAAU,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnC,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,QAAQ,EAAE;AACxB,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AAC1B,MAAM,OAAO;AACb,KAAK;AACL,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACpD,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;AACtB,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AACvC,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,MAAM,GAAG;AAClB,IAAI,IAAI,MAAM,CAAC;AACf,IAAI,MAAM,KAAK,GAAG,IAAIM,aAAW,CAAC,SAAS,QAAQ,CAAC,CAAC,EAAE;AACvD,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,MAAM,KAAK;AACX,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,GAAG;AACH,CAAC;AACD;AACA,sBAAeA,aAAW;;ACtH1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,QAAM,CAAC,QAAQ,EAAE;AACzC,EAAE,OAAO,SAAS,IAAI,CAAC,GAAG,EAAE;AAC5B,IAAI,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACrC,GAAG,CAAC;AACJ;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,cAAY,CAAC,OAAO,EAAE;AAC9C,EAAE,OAAOnB,OAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC;AACpE;;ACbA,MAAMoB,gBAAc,GAAG;AACvB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,EAAE,EAAE,GAAG;AACT,EAAE,OAAO,EAAE,GAAG;AACd,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,KAAK,EAAE,GAAG;AACZ,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,aAAa,EAAE,GAAG;AACpB,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,IAAI,EAAE,GAAG;AACX,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,oBAAoB,EAAE,GAAG;AAC3B,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,oBAAoB,EAAE,GAAG;AAC3B,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,0BAA0B,EAAE,GAAG;AACjC,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,uBAAuB,EAAE,GAAG;AAC9B,EAAE,qBAAqB,EAAE,GAAG;AAC5B,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,6BAA6B,EAAE,GAAG;AACpC,CAAC,CAAC;AACF;AACA,MAAM,CAAC,OAAO,CAACA,gBAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACzD,EAAEA,gBAAc,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;AAC9B,CAAC,CAAC,CAAC;AACH;AACA,yBAAeA,gBAAc;;AClD7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,aAAa,EAAE;AACvC,EAAE,MAAM,OAAO,GAAG,IAAIL,OAAK,CAAC,aAAa,CAAC,CAAC;AAC3C,EAAE,MAAM,QAAQ,GAAG,IAAI,CAACA,OAAK,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1D;AACA;AACA,EAAEf,OAAK,CAAC,MAAM,CAAC,QAAQ,EAAEe,OAAK,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AACvE;AACA;AACA,EAAEf,OAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AAC5D;AACA;AACA,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,MAAM,CAAC,cAAc,EAAE;AACpD,IAAI,OAAO,cAAc,CAACY,aAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AACtE,GAAG,CAAC;AACJ;AACA,EAAE,OAAO,QAAQ,CAAC;AAClB,CAAC;AACD;AACA;AACA,MAAM,KAAK,GAAG,cAAc,CAACH,UAAQ,CAAC,CAAC;AACvC;AACA;AACA,KAAK,CAAC,KAAK,GAAGM,OAAK,CAAC;AACpB;AACA;AACA,KAAK,CAAC,aAAa,GAAGJ,eAAa,CAAC;AACpC,KAAK,CAAC,WAAW,GAAGM,aAAW,CAAC;AAChC,KAAK,CAAC,QAAQ,GAAGP,UAAQ,CAAC;AAC1B,KAAK,CAAC,OAAO,GAAGG,SAAO,CAAC;AACxB,KAAK,CAAC,UAAU,GAAGX,YAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,UAAU,GAAGH,YAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;AACnC;AACA;AACA,KAAK,CAAC,GAAG,GAAG,SAAS,GAAG,CAAC,QAAQ,EAAE;AACnC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACA,KAAK,CAAC,MAAM,GAAGmB,QAAM,CAAC;AACtB;AACA;AACA,KAAK,CAAC,YAAY,GAAGC,cAAY,CAAC;AAClC;AACA;AACA,KAAK,CAAC,WAAW,GAAGP,aAAW,CAAC;AAChC;AACA,KAAK,CAAC,YAAY,GAAGJ,cAAY,CAAC;AAClC;AACA,KAAK,CAAC,UAAU,GAAG,KAAK,IAAI,cAAc,CAACR,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAClG;AACA,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;AACvC;AACA,KAAK,CAAC,cAAc,GAAGoB,gBAAc,CAAC;AACtC;AACA,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;AACtB;AACA;AACA,gBAAe;;ACtFf;AACA;AACA;AACK,MAAC;AACN,EAAE,KAAK;AACP,EAAE,UAAU;AACZ,EAAE,aAAa;AACf,EAAE,QAAQ;AACV,EAAE,WAAW;AACb,EAAE,OAAO;AACT,EAAE,GAAG;AACL,EAAE,MAAM;AACR,EAAE,YAAY;AACd,EAAE,MAAM;AACR,EAAE,UAAU;AACZ,EAAE,YAAY;AACd,EAAE,cAAc;AAChB,EAAE,UAAU;AACZ,EAAE,UAAU;AACZ,EAAE,WAAW;AACb,CAAC,GAAGC;;;;"} \ No newline at end of file diff --git a/node_modules/axios/dist/esm/axios.min.js b/node_modules/axios/dist/esm/axios.min.js new file mode 100644 index 00000000..a4caede8 --- /dev/null +++ b/node_modules/axios/dist/esm/axios.min.js @@ -0,0 +1,2 @@ +function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,r=(o=Object.create(null),e=>{const n=t.call(e);return o[n]||(o[n]=n.slice(8,-1).toLowerCase())});var o;const s=e=>(e=e.toLowerCase(),t=>r(t)===e),i=e=>t=>typeof t===e,{isArray:a}=Array,c=i("undefined");const u=s("ArrayBuffer");const l=i("string"),f=i("function"),d=i("number"),p=e=>null!==e&&"object"==typeof e,h=e=>{if("object"!==r(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},m=s("Date"),y=s("File"),g=s("Blob"),b=s("FileList"),E=s("URLSearchParams");function w(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),a(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,R=e=>!c(e)&&e!==S;const A=(T="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>T&&e instanceof T);var T;const j=s("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),N=s("RegExp"),v=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};w(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},x="abcdefghijklmnopqrstuvwxyz",P={DIGIT:"0123456789",ALPHA:x,ALPHA_DIGIT:x+x.toUpperCase()+"0123456789"};const _=s("AsyncFunction"),F={isArray:a,isArrayBuffer:u,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||f(e.append)&&("formdata"===(t=r(e))||"object"===t&&f(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&u(e.buffer),t},isString:l,isNumber:d,isBoolean:e=>!0===e||!1===e,isObject:p,isPlainObject:h,isUndefined:c,isDate:m,isFile:y,isBlob:g,isRegExp:N,isFunction:f,isStream:e=>p(e)&&f(e.pipe),isURLSearchParams:E,isTypedArray:A,isFileList:b,forEach:w,merge:function e(){const{caseless:t}=R(this)&&this||{},n={},r=(r,o)=>{const s=t&&O(n,o)||o;h(n[s])&&h(r)?n[s]=e(n[s],r):h(r)?n[s]=e({},r):a(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e(w(n,((n,o)=>{r&&f(n)?t[o]=e(n,r):t[o]=n}),{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:r,kindOfTest:s,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(a(e))return e;let t=e.length;if(!d(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:v,freezeMethods:e=>{v(e,((t,n)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];f(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return a(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:O,global:S,isContextDefined:R,ALPHABET:P,generateString:(e=16,t=P.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(p(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=a(e)?[]:{};return w(e,((e,t)=>{const s=n(e,r+1);!c(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:_,isThenable:e=>e&&(p(e)||f(e))&&f(e.then)&&f(e.catch)};function U(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}F.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const B=U.prototype,D={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{D[e]={value:e}})),Object.defineProperties(U,D),Object.defineProperty(B,"isAxiosError",{value:!0}),U.from=(e,t,n,r,o,s)=>{const i=Object.create(B);return F.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};function L(e){return F.isPlainObject(e)||F.isArray(e)}function k(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,n){return e?e.concat(t).map((function(e,t){return e=k(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const I=F.toFlatObject(F,{},null,(function(e){return/^is[A-Z]/.test(e)}));function z(e,t,n){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=F.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!F.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(F.isDate(e))return e.toISOString();if(!a&&F.isBlob(e))throw new U("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(e)||F.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(F.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(F.isArray(e)&&function(e){return F.isArray(e)&&!e.some(L)}(e)||(F.isFileList(e)||F.endsWith(n,"[]"))&&(a=F.toArray(e)))return n=k(n),a.forEach((function(e,r){!F.isUndefined(e)&&null!==e&&t.append(!0===i?q([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!L(e)||(t.append(q(o,n,s),c(e)),!1)}const l=[],f=Object.assign(I,{defaultVisitor:u,convertValue:c,isVisitable:L});if(!F.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!F.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),F.forEach(n,(function(n,s){!0===(!(F.isUndefined(n)||null===n)&&o.call(t,n,F.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t}function M(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function H(e,t){this._pairs=[],e&&z(e,this,t)}const J=H.prototype;function W(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function V(e,t,n){if(!t)return e;const r=n&&n.encode||W,o=n&&n.serialize;let s;if(s=o?o(t,n):F.isURLSearchParams(t)?t.toString():new H(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}J.append=function(e,t){this._pairs.push([e,t])},J.toString=function(e){const t=e?function(t){return e.call(this,t,M)}:M;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const K=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},G={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:H,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},X="undefined"!=typeof window&&"undefined"!=typeof document,Q=(Z="undefined"!=typeof navigator&&navigator.product,X&&["ReactNative","NativeScript","NS"].indexOf(Z)<0);var Z;const Y="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ee={...Object.freeze({__proto__:null,hasBrowserEnv:X,hasStandardBrowserWebWorkerEnv:Y,hasStandardBrowserEnv:Q}),...$};function te(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&F.isArray(r)?r.length:s,a)return F.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&F.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&F.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r{t(function(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ne={transitional:G,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=F.isObject(e);o&&F.isHTMLForm(e)&&(e=new FormData(e));if(F.isFormData(e))return r?JSON.stringify(te(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return z(e,new ee.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ee.isNode&&F.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=F.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return z(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(F.isString(e))try{return(t||JSON.parse)(e),F.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ne.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&F.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],(e=>{ne.headers[e]={}}));const re=ne,oe=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),se=Symbol("internals");function ie(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:F.isArray(e)?e.map(ae):String(e)}function ce(e,t,n,r,o){return F.isFunction(r)?r.call(this,t,n):(o&&(t=n),F.isString(t)?F.isString(r)?-1!==t.indexOf(r):F.isRegExp(r)?r.test(t):void 0:void 0)}class ue{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ie(t);if(!o)throw new Error("header name must be a non-empty string");const s=F.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ae(e))}const s=(e,t)=>F.forEach(e,((e,n)=>o(e,n,t)));return F.isPlainObject(e)||e instanceof this.constructor?s(e,t):F.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&oe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=ie(e)){const n=F.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(F.isFunction(t))return t.call(this,e,n);if(F.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ie(e)){const n=F.findKey(this,e);return!(!n||void 0===this[n]||t&&!ce(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ie(e)){const o=F.findKey(n,e);!o||t&&!ce(0,n[o],o,t)||(delete n[o],r=!0)}}return F.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ce(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return F.forEach(this,((r,o)=>{const s=F.findKey(n,o);if(s)return t[s]=ae(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ae(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return F.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&F.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[se]=this[se]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ie(e);t[r]||(!function(e,t){const n=F.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return F.isArray(e)?e.forEach(r):r(e),this}}ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.reduceDescriptors(ue.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),F.freezeMethods(ue);const le=ue;function fe(e,t){const n=this||re,r=t||n,o=le.from(r.headers);let s=r.data;return F.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function de(e){return!(!e||!e.__CANCEL__)}function pe(e,t,n){U.call(this,null==e?"canceled":e,U.ERR_CANCELED,t,n),this.name="CanceledError"}F.inherits(pe,U,{__CANCEL__:!0});const he=ee.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];F.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),F.isString(r)&&i.push("path="+r),F.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ye=ee.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=F.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ge(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const be={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=le.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(F.isFormData(r))if(ee.hasStandardBrowserEnv||ee.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const f=me(e.baseURL,e.url);function d(){if(!l)return;const r=le.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new U("Request failed with status code "+n.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),u()}),(function(e){n(e),u()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),V(f,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)},l.onabort=function(){l&&(n(new U("Request aborted",U.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new U("Network Error",U.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||G;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new U(t,r.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,l)),l=null},ee.hasStandardBrowserEnv&&(c&&F.isFunction(c)&&(c=c(e)),c||!1!==c&&ye(f))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&he.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&F.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),F.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ge(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ge(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{l&&(n(!t||t.type?new pe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);p&&-1===ee.protocols.indexOf(p)?n(new U("Unsupported protocol "+p+":",U.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};F.forEach(be,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ee=e=>`- ${e}`,we=e=>F.isFunction(e)||null===e||!1===e,Oe=e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new U("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Ee).join("\n"):" "+Ee(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pe(null,e)}function Re(e){Se(e),e.headers=le.from(e.headers),e.data=fe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Oe(e.adapter||re.adapter)(e).then((function(t){return Se(e),t.data=fe.call(e,e.transformResponse,t),t.headers=le.from(t.headers),t}),(function(t){return de(t)||(Se(e),t&&t.response&&(t.response.data=fe.call(e,e.transformResponse,t.response),t.response.headers=le.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof le?e.toJSON():e;function Te(e,t){t=t||{};const n={};function r(e,t,n){return F.isPlainObject(e)&&F.isPlainObject(t)?F.merge.call({caseless:n},e,t):F.isPlainObject(t)?F.merge({},t):F.isArray(t)?t.slice():t}function o(e,t,n){return F.isUndefined(t)?F.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!F.isUndefined(t))return r(void 0,t)}function i(e,t){return F.isUndefined(t)?F.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(Ae(e),Ae(t),!0)};return F.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);F.isUndefined(i)&&s!==a||(n[r]=i)})),n}const je={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{je[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ce={};je.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new U(r(o," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Ce[o]&&(Ce[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};const Ne={assertOptions:function(e,t,n){if("object"!=typeof e)throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new U("option "+s+" must be "+n,U.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new U("Unknown option "+s,U.ERR_BAD_OPTION)}},validators:je},ve=Ne.validators;class xe{constructor(e){this.defaults=e,this.interceptors={request:new K,response:new K}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Te(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Ne.assertOptions(n,{silentJSONParsing:ve.transitional(ve.boolean),forcedJSONParsing:ve.transitional(ve.boolean),clarifyTimeoutError:ve.transitional(ve.boolean)},!1),null!=r&&(F.isFunction(r)?t.paramsSerializer={serialize:r}:Ne.assertOptions(r,{encode:ve.function,serialize:ve.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&F.merge(o.common,o[t.method]);o&&F.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=le.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[Re.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new pe(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new _e((function(t){e=t})),cancel:e}}}const Fe=_e;const Ue={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ue).forEach((([e,t])=>{Ue[t]=e}));const Be=Ue;const De=function t(n){const r=new Pe(n),o=e(Pe.prototype.request,r);return F.extend(o,Pe.prototype,r,{allOwnKeys:!0}),F.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(Te(n,e))},o}(re);De.Axios=Pe,De.CanceledError=pe,De.CancelToken=Fe,De.isCancel=de,De.VERSION="1.6.7",De.toFormData=z,De.AxiosError=U,De.Cancel=De.CanceledError,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return F.isObject(e)&&!0===e.isAxiosError},De.mergeConfig=Te,De.AxiosHeaders=le,De.formToJSON=e=>te(F.isHTMLForm(e)?new FormData(e):e),De.getAdapter=Oe,De.HttpStatusCode=Be,De.default=De;const Le=De,{Axios:ke,AxiosError:qe,CanceledError:Ie,isCancel:ze,CancelToken:Me,VERSION:He,all:Je,Cancel:We,isAxiosError:Ve,spread:Ke,toFormData:Ge,AxiosHeaders:$e,HttpStatusCode:Xe,formToJSON:Qe,getAdapter:Ze,mergeConfig:Ye}=Le;export{ke as Axios,qe as AxiosError,$e as AxiosHeaders,We as Cancel,Me as CancelToken,Ie as CanceledError,Xe as HttpStatusCode,He as VERSION,Je as all,Le as default,Qe as formToJSON,Ze as getAdapter,Ve as isAxiosError,ze as isCancel,Ye as mergeConfig,Ke as spread,Ge as toFormData}; +//# sourceMappingURL=axios.min.js.map diff --git a/node_modules/axios/dist/esm/axios.min.js.map b/node_modules/axios/dist/esm/axios.min.js.map new file mode 100644 index 00000000..6a87c762 --- /dev/null +++ b/node_modules/axios/dist/esm/axios.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.min.js","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/index.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/helpers/cookies.js","../../lib/core/buildFullPath.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/helpers/isURLSameOrigin.js","../../lib/adapters/xhr.js","../../lib/helpers/speedometer.js","../../lib/adapters/adapters.js","../../lib/helpers/null.js","../../lib/core/settle.js","../../lib/helpers/parseProtocol.js","../../lib/core/dispatchRequest.js","../../lib/core/mergeConfig.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../index.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n"],"names":["bind","fn","thisArg","apply","arguments","toString","Object","prototype","getPrototypeOf","kindOf","cache","create","thing","str","call","slice","toLowerCase","kindOfTest","type","typeOfTest","isArray","Array","isUndefined","isArrayBuffer","isString","isFunction","isNumber","isObject","isPlainObject","val","Symbol","toStringTag","iterator","isDate","isFile","isBlob","isFileList","isURLSearchParams","forEach","obj","allOwnKeys","i","l","length","keys","getOwnPropertyNames","len","key","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","isTypedArray","TypedArray","Uint8Array","isHTMLForm","hasOwnProperty","prop","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","ALPHA","ALPHABET","DIGIT","ALPHA_DIGIT","toUpperCase","isAsyncFn","utils$1","isBuffer","constructor","isFormData","kind","FormData","append","isArrayBufferView","result","ArrayBuffer","isView","buffer","isBoolean","isStream","pipe","merge","caseless","this","assignValue","targetKey","extend","a","b","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","String","undefined","lastIndex","indexOf","toArray","arr","forEachEntry","next","done","pair","matchAll","regExp","matches","exec","push","hasOwnProp","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","toCamelCase","m","p1","p2","noop","toFiniteNumber","defaultValue","Number","isFinite","generateString","size","alphabet","Math","random","isSpecCompliantForm","toJSONObject","stack","visit","source","target","reducedValue","isThenable","then","catch","AxiosError","message","code","config","request","response","captureStackTrace","utils","toJSON","description","number","fileName","lineNumber","columnNumber","status","from","error","customProps","axiosError","cause","isVisitable","removeBrackets","renderKey","path","dots","concat","map","token","join","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Blob","convertValue","toISOString","Buffer","JSON","stringify","some","isFlatArray","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","buildURL","url","_encode","serializeFn","serialize","serializedParams","hashmarkIndex","encoder","InterceptorManager$1","handlers","use","fulfilled","rejected","synchronous","runWhen","eject","id","clear","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","isBrowser","classes","URLSearchParams","protocols","hasBrowserEnv","document","hasStandardBrowserEnv","product","navigator","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","platform","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","entries","parsePropPath","defaults","transitional","adapter","transformRequest","data","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","isNode","toURLEncodedForm","formSerializer","_FormData","env","rawValue","parser","parse","e","stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","method","defaults$1","ignoreDuplicateOf","$internals","normalizeHeader","header","normalizeValue","matchHeaderValue","isHeaderNameFilter","AxiosHeaders","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","rawHeaders","parsed","line","substring","parseHeaders","get","tokens","tokensRE","parseTokens","has","matcher","delete","deleted","deleteHeader","normalize","format","normalized","w","char","formatHeader","targets","asStrings","static","first","computed","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","configurable","buildAccessors","accessor","mapped","headerValue","AxiosHeaders$2","transformData","fns","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","cookies","write","expires","domain","secure","cookie","Date","toGMTString","read","RegExp","decodeURIComponent","remove","now","buildFullPath","baseURL","requestedURL","relativeURL","combineURLs","isURLSameOrigin","msie","userAgent","urlParsingNode","createElement","originURL","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","samplesCount","min","bytes","timestamps","firstSampleTS","head","tail","chunkLength","startedAt","bytesCount","passed","round","speedometer","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","event","knownAdapters","http","xhr","XMLHttpRequest","Promise","resolve","reject","requestData","requestHeaders","onCanceled","withXSRFToken","cancelToken","unsubscribe","signal","removeEventListener","Boolean","auth","username","password","unescape","btoa","fullPath","onloadend","responseHeaders","getAllResponseHeaders","ERR_BAD_REQUEST","floor","settle","err","responseText","statusText","open","paramsSerializer","onreadystatechange","readyState","responseURL","setTimeout","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","xsrfValue","setRequestHeader","withCredentials","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","subscribe","aborted","parseProtocol","send","renderReason","reason","isResolvedHandle","adapters","nameOrAdapter","rejectedReasons","reasons","state","throwIfCancellationRequested","throwIfRequested","dispatchRequest","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","timeoutMessage","decompress","beforeRedirect","transport","httpAgent","httpsAgent","socketPath","responseEncoding","configValue","validators","deprecatedWarnings","validator","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","InterceptorManager","async","configOrUrl","_request","dummy","boolean","function","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","responseInterceptorChain","promise","chain","newConfig","onFulfilled","onRejected","getUri","generateHTTPMethod","isForm","Axios$2","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","splice","c","CancelToken$2","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","HttpStatusCode$2","axios","createInstance","defaultConfig","instance","VERSION","Cancel","all","promises","spread","callback","isAxiosError","payload","formToJSON","getAdapter","default","axios$1"],"mappings":"AAEe,SAASA,EAAKC,EAAIC,GAC/B,OAAO,WACL,OAAOD,EAAGE,MAAMD,EAASE,UAC7B,CACA,CCAA,MAAMC,SAACA,GAAYC,OAAOC,WACpBC,eAACA,GAAkBF,OAEnBG,GAAUC,EAGbJ,OAAOK,OAAO,MAHQC,IACrB,MAAMC,EAAMR,EAASS,KAAKF,GAC1B,OAAOF,EAAMG,KAASH,EAAMG,GAAOA,EAAIE,MAAM,GAAI,GAAGC,cAAc,GAFvD,IAACN,EAKhB,MAAMO,EAAcC,IAClBA,EAAOA,EAAKF,cACJJ,GAAUH,EAAOG,KAAWM,GAGhCC,EAAaD,GAAQN,UAAgBA,IAAUM,GAS/CE,QAACA,GAAWC,MASZC,EAAcH,EAAW,aAqB/B,MAAMI,EAAgBN,EAAW,eA2BjC,MAAMO,EAAWL,EAAW,UAQtBM,EAAaN,EAAW,YASxBO,EAAWP,EAAW,UAStBQ,EAAYf,GAAoB,OAAVA,GAAmC,iBAAVA,EAiB/CgB,EAAiBC,IACrB,GAAoB,WAAhBpB,EAAOoB,GACT,OAAO,EAGT,MAAMtB,EAAYC,EAAeqB,GACjC,QAAsB,OAAdtB,GAAsBA,IAAcD,OAAOC,WAAkD,OAArCD,OAAOE,eAAeD,IAA0BuB,OAAOC,eAAeF,GAAUC,OAAOE,YAAYH,EAAI,EAUnKI,EAAShB,EAAW,QASpBiB,EAASjB,EAAW,QASpBkB,EAASlB,EAAW,QASpBmB,EAAanB,EAAW,YAsCxBoB,EAAoBpB,EAAW,mBA2BrC,SAASqB,EAAQC,EAAKtC,GAAIuC,WAACA,GAAa,GAAS,IAE/C,GAAID,QACF,OAGF,IAAIE,EACAC,EAQJ,GALmB,iBAARH,IAETA,EAAM,CAACA,IAGLnB,EAAQmB,GAEV,IAAKE,EAAI,EAAGC,EAAIH,EAAII,OAAQF,EAAIC,EAAGD,IACjCxC,EAAGa,KAAK,KAAMyB,EAAIE,GAAIA,EAAGF,OAEtB,CAEL,MAAMK,EAAOJ,EAAalC,OAAOuC,oBAAoBN,GAAOjC,OAAOsC,KAAKL,GAClEO,EAAMF,EAAKD,OACjB,IAAII,EAEJ,IAAKN,EAAI,EAAGA,EAAIK,EAAKL,IACnBM,EAAMH,EAAKH,GACXxC,EAAGa,KAAK,KAAMyB,EAAIQ,GAAMA,EAAKR,EAEhC,CACH,CAEA,SAASS,EAAQT,EAAKQ,GACpBA,EAAMA,EAAI/B,cACV,MAAM4B,EAAOtC,OAAOsC,KAAKL,GACzB,IACIU,EADAR,EAAIG,EAAKD,OAEb,KAAOF,KAAM,GAEX,GADAQ,EAAOL,EAAKH,GACRM,IAAQE,EAAKjC,cACf,OAAOiC,EAGX,OAAO,IACT,CAEA,MAAMC,EAEsB,oBAAfC,WAAmCA,WACvB,oBAATC,KAAuBA,KAA0B,oBAAXC,OAAyBA,OAASC,OAGlFC,EAAoBC,IAAalC,EAAYkC,IAAYA,IAAYN,EAoD3E,MA8HMO,GAAgBC,EAKG,oBAAfC,YAA8BnD,EAAemD,YAH9C/C,GACE8C,GAAc9C,aAAiB8C,GAHrB,IAACA,EAetB,MAiCME,EAAa3C,EAAW,mBAWxB4C,EAAiB,GAAGA,oBAAoB,CAACtB,EAAKuB,IAASD,EAAe/C,KAAKyB,EAAKuB,GAA/D,CAAsExD,OAAOC,WAS9FwD,EAAW9C,EAAW,UAEtB+C,EAAoB,CAACzB,EAAK0B,KAC9B,MAAMC,EAAc5D,OAAO6D,0BAA0B5B,GAC/C6B,EAAqB,CAAA,EAE3B9B,EAAQ4B,GAAa,CAACG,EAAYC,KAChC,IAAIC,GAC2C,KAA1CA,EAAMN,EAAQI,EAAYC,EAAM/B,MACnC6B,EAAmBE,GAAQC,GAAOF,EACnC,IAGH/D,OAAOkE,iBAAiBjC,EAAK6B,EAAmB,EAuD5CK,EAAQ,6BAIRC,EAAW,CACfC,MAHY,aAIZF,QACAG,YAAaH,EAAQA,EAAMI,cALf,cA6Bd,MA+BMC,EAAY7D,EAAW,iBAKd8D,EAAA,CACb3D,UACAG,gBACAyD,SAnnBF,SAAkBnD,GAChB,OAAe,OAARA,IAAiBP,EAAYO,IAA4B,OAApBA,EAAIoD,cAAyB3D,EAAYO,EAAIoD,cACpFxD,EAAWI,EAAIoD,YAAYD,WAAanD,EAAIoD,YAAYD,SAASnD,EACxE,EAinBEqD,WArekBtE,IAClB,IAAIuE,EACJ,OAAOvE,IACgB,mBAAbwE,UAA2BxE,aAAiBwE,UAClD3D,EAAWb,EAAMyE,UACY,cAA1BF,EAAO1E,EAAOG,KAEL,WAATuE,GAAqB1D,EAAWb,EAAMP,WAAkC,sBAArBO,EAAMP,YAG/D,EA4dDiF,kBA/lBF,SAA2BzD,GACzB,IAAI0D,EAMJ,OAJEA,EAD0B,oBAAhBC,aAAiCA,YAAkB,OACpDA,YAAYC,OAAO5D,GAEnB,GAAUA,EAAU,QAAMN,EAAcM,EAAI6D,QAEhDH,CACT,EAwlBE/D,WACAE,WACAiE,UA/iBgB/E,IAAmB,IAAVA,IAA4B,IAAVA,EAgjB3Ce,WACAC,gBACAN,cACAW,SACAC,SACAC,SACA4B,WACAtC,aACAmE,SA3fgB/D,GAAQF,EAASE,IAAQJ,EAAWI,EAAIgE,MA4fxDxD,oBACAoB,eACArB,aACAE,UACAwD,MA/XF,SAASA,IACP,MAAMC,SAACA,GAAYxC,EAAiByC,OAASA,MAAQ,GAC/CT,EAAS,CAAA,EACTU,EAAc,CAACpE,EAAKkB,KACxB,MAAMmD,EAAYH,GAAY/C,EAAQuC,EAAQxC,IAAQA,EAClDnB,EAAc2D,EAAOW,KAAetE,EAAcC,GACpD0D,EAAOW,GAAaJ,EAAMP,EAAOW,GAAYrE,GACpCD,EAAcC,GACvB0D,EAAOW,GAAaJ,EAAM,CAAE,EAAEjE,GACrBT,EAAQS,GACjB0D,EAAOW,GAAarE,EAAId,QAExBwE,EAAOW,GAAarE,CACrB,EAGH,IAAK,IAAIY,EAAI,EAAGC,EAAItC,UAAUuC,OAAQF,EAAIC,EAAGD,IAC3CrC,UAAUqC,IAAMH,EAAQlC,UAAUqC,GAAIwD,GAExC,OAAOV,CACT,EA4WEY,OAhWa,CAACC,EAAGC,EAAGnG,GAAUsC,cAAa,MAC3CF,EAAQ+D,GAAG,CAACxE,EAAKkB,KACX7C,GAAWuB,EAAWI,GACxBuE,EAAErD,GAAO/C,EAAK6B,EAAK3B,GAEnBkG,EAAErD,GAAOlB,CACV,GACA,CAACW,eACG4D,GAyVPE,KA5dYzF,GAAQA,EAAIyF,KACxBzF,EAAIyF,OAASzF,EAAI0F,QAAQ,qCAAsC,IA4d/DC,SAhVgBC,IACc,QAA1BA,EAAQC,WAAW,KACrBD,EAAUA,EAAQ1F,MAAM,IAEnB0F,GA6UPE,SAjUe,CAAC1B,EAAa2B,EAAkBC,EAAO3C,KACtDe,EAAY1E,UAAYD,OAAOK,OAAOiG,EAAiBrG,UAAW2D,GAClEe,EAAY1E,UAAU0E,YAAcA,EACpC3E,OAAOwG,eAAe7B,EAAa,QAAS,CAC1C8B,MAAOH,EAAiBrG,YAE1BsG,GAASvG,OAAO0G,OAAO/B,EAAY1E,UAAWsG,EAAM,EA4TpDI,aAhTmB,CAACC,EAAWC,EAASC,EAAQC,KAChD,IAAIR,EACApE,EACAqB,EACJ,MAAMwD,EAAS,CAAA,EAIf,GAFAH,EAAUA,GAAW,GAEJ,MAAbD,EAAmB,OAAOC,EAE9B,EAAG,CAGD,IAFAN,EAAQvG,OAAOuC,oBAAoBqE,GACnCzE,EAAIoE,EAAMlE,OACHF,KAAM,GACXqB,EAAO+C,EAAMpE,GACP4E,IAAcA,EAAWvD,EAAMoD,EAAWC,IAAcG,EAAOxD,KACnEqD,EAAQrD,GAAQoD,EAAUpD,GAC1BwD,EAAOxD,IAAQ,GAGnBoD,GAAuB,IAAXE,GAAoB5G,EAAe0G,EACnD,OAAWA,KAAeE,GAAUA,EAAOF,EAAWC,KAAaD,IAAc5G,OAAOC,WAEtF,OAAO4G,CAAO,EA0Rd1G,SACAQ,aACAsG,SAhRe,CAAC1G,EAAK2G,EAAcC,KACnC5G,EAAM6G,OAAO7G,SACI8G,IAAbF,GAA0BA,EAAW5G,EAAI8B,UAC3C8E,EAAW5G,EAAI8B,QAEjB8E,GAAYD,EAAa7E,OACzB,MAAMiF,EAAY/G,EAAIgH,QAAQL,EAAcC,GAC5C,OAAsB,IAAfG,GAAoBA,IAAcH,CAAQ,EA0QjDK,QA/PelH,IACf,IAAKA,EAAO,OAAO,KACnB,GAAIQ,EAAQR,GAAQ,OAAOA,EAC3B,IAAI6B,EAAI7B,EAAM+B,OACd,IAAKjB,EAASe,GAAI,OAAO,KACzB,MAAMsF,EAAM,IAAI1G,MAAMoB,GACtB,KAAOA,KAAM,GACXsF,EAAItF,GAAK7B,EAAM6B,GAEjB,OAAOsF,CAAG,EAuPVC,aA5NmB,CAACzF,EAAKtC,KACzB,MAEM+B,GAFYO,GAAOA,EAAIT,OAAOE,WAETlB,KAAKyB,GAEhC,IAAIgD,EAEJ,MAAQA,EAASvD,EAASiG,UAAY1C,EAAO2C,MAAM,CACjD,MAAMC,EAAO5C,EAAOwB,MACpB9G,EAAGa,KAAKyB,EAAK4F,EAAK,GAAIA,EAAK,GAC5B,GAmNDC,SAxMe,CAACC,EAAQxH,KACxB,IAAIyH,EACJ,MAAMP,EAAM,GAEZ,KAAwC,QAAhCO,EAAUD,EAAOE,KAAK1H,KAC5BkH,EAAIS,KAAKF,GAGX,OAAOP,CAAG,EAiMVnE,aACAC,iBACA4E,WAAY5E,EACZG,oBACA0E,cAxJqBnG,IACrByB,EAAkBzB,GAAK,CAAC8B,EAAYC,KAElC,GAAI7C,EAAWc,KAA6D,IAArD,CAAC,YAAa,SAAU,UAAUsF,QAAQvD,GAC/D,OAAO,EAGT,MAAMyC,EAAQxE,EAAI+B,GAEb7C,EAAWsF,KAEhB1C,EAAWsE,YAAa,EAEpB,aAActE,EAChBA,EAAWuE,UAAW,EAInBvE,EAAWwE,MACdxE,EAAWwE,IAAM,KACf,MAAMC,MAAM,qCAAwCxE,EAAO,IAAK,GAEnE,GACD,EAkIFyE,YA/HkB,CAACC,EAAeC,KAClC,MAAM1G,EAAM,CAAA,EAEN2G,EAAUnB,IACdA,EAAIzF,SAAQyE,IACVxE,EAAIwE,IAAS,CAAI,GACjB,EAKJ,OAFA3F,EAAQ4H,GAAiBE,EAAOF,GAAiBE,EAAOxB,OAAOsB,GAAeG,MAAMF,IAE7E1G,CAAG,EAqHV6G,YAjMkBvI,GACXA,EAAIG,cAAcuF,QAAQ,yBAC/B,SAAkB8C,EAAGC,EAAIC,GACvB,OAAOD,EAAGzE,cAAgB0E,CAC3B,IA8LHC,KAnHW,OAoHXC,eAlHqB,CAAC1C,EAAO2C,KAC7B3C,GAASA,EACF4C,OAAOC,SAAS7C,GAASA,EAAQ2C,GAiHxC1G,UACAM,OAAQJ,EACRK,mBACAmB,WACAmF,eAxGqB,CAACC,EAAO,GAAIC,EAAWrF,EAASE,eACrD,IAAI/D,EAAM,GACV,MAAM8B,OAACA,GAAUoH,EACjB,KAAOD,KACLjJ,GAAOkJ,EAASC,KAAKC,SAAWtH,EAAO,GAGzC,OAAO9B,CAAG,EAkGVqJ,oBAxFF,SAA6BtJ,GAC3B,SAAUA,GAASa,EAAWb,EAAMyE,SAAyC,aAA9BzE,EAAMkB,OAAOC,cAA+BnB,EAAMkB,OAAOE,UAC1G,EAuFEmI,aArFoB5H,IACpB,MAAM6H,EAAQ,IAAI/I,MAAM,IAElBgJ,EAAQ,CAACC,EAAQ7H,KAErB,GAAId,EAAS2I,GAAS,CACpB,GAAIF,EAAMvC,QAAQyC,IAAW,EAC3B,OAGF,KAAK,WAAYA,GAAS,CACxBF,EAAM3H,GAAK6H,EACX,MAAMC,EAASnJ,EAAQkJ,GAAU,GAAK,CAAA,EAStC,OAPAhI,EAAQgI,GAAQ,CAACvD,EAAOhE,KACtB,MAAMyH,EAAeH,EAAMtD,EAAOtE,EAAI,IACrCnB,EAAYkJ,KAAkBD,EAAOxH,GAAOyH,EAAa,IAG5DJ,EAAM3H,QAAKkF,EAEJ4C,CACR,CACF,CAED,OAAOD,CAAM,EAGf,OAAOD,EAAM9H,EAAK,EAAE,EA0DpBuC,YACA2F,WAtDkB7J,GAClBA,IAAUe,EAASf,IAAUa,EAAWb,KAAWa,EAAWb,EAAM8J,OAASjJ,EAAWb,EAAM+J,QC7oBhG,SAASC,EAAWC,EAASC,EAAMC,EAAQC,EAASC,GAClDnC,MAAMhI,KAAKkF,MAEP8C,MAAMoC,kBACRpC,MAAMoC,kBAAkBlF,KAAMA,KAAKf,aAEnCe,KAAKoE,OAAQ,IAAKtB,OAASsB,MAG7BpE,KAAK6E,QAAUA,EACf7E,KAAK1B,KAAO,aACZwG,IAAS9E,KAAK8E,KAAOA,GACrBC,IAAW/E,KAAK+E,OAASA,GACzBC,IAAYhF,KAAKgF,QAAUA,GAC3BC,IAAajF,KAAKiF,SAAWA,EAC/B,CAEAE,EAAMxE,SAASiE,EAAY9B,MAAO,CAChCsC,OAAQ,WACN,MAAO,CAELP,QAAS7E,KAAK6E,QACdvG,KAAM0B,KAAK1B,KAEX+G,YAAarF,KAAKqF,YAClBC,OAAQtF,KAAKsF,OAEbC,SAAUvF,KAAKuF,SACfC,WAAYxF,KAAKwF,WACjBC,aAAczF,KAAKyF,aACnBrB,MAAOpE,KAAKoE,MAEZW,OAAQI,EAAMhB,aAAanE,KAAK+E,QAChCD,KAAM9E,KAAK8E,KACXY,OAAQ1F,KAAKiF,UAAYjF,KAAKiF,SAASS,OAAS1F,KAAKiF,SAASS,OAAS,KAE1E,IAGH,MAAMnL,EAAYqK,EAAWrK,UACvB2D,EAAc,CAAA,EAEpB,CACE,uBACA,iBACA,eACA,YACA,cACA,4BACA,iBACA,mBACA,kBACA,eACA,kBACA,mBAEA5B,SAAQwI,IACR5G,EAAY4G,GAAQ,CAAC/D,MAAO+D,EAAK,IAGnCxK,OAAOkE,iBAAiBoG,EAAY1G,GACpC5D,OAAOwG,eAAevG,EAAW,eAAgB,CAACwG,OAAO,IAGzD6D,EAAWe,KAAO,CAACC,EAAOd,EAAMC,EAAQC,EAASC,EAAUY,KACzD,MAAMC,EAAaxL,OAAOK,OAAOJ,GAgBjC,OAdA4K,EAAMlE,aAAa2E,EAAOE,GAAY,SAAgBvJ,GACpD,OAAOA,IAAQuG,MAAMvI,SACtB,IAAEuD,GACe,iBAATA,IAGT8G,EAAW9J,KAAKgL,EAAYF,EAAMf,QAASC,EAAMC,EAAQC,EAASC,GAElEa,EAAWC,MAAQH,EAEnBE,EAAWxH,KAAOsH,EAAMtH,KAExBuH,GAAevL,OAAO0G,OAAO8E,EAAYD,GAElCC,CAAU,EClFnB,SAASE,EAAYpL,GACnB,OAAOuK,EAAMvJ,cAAchB,IAAUuK,EAAM/J,QAAQR,EACrD,CASA,SAASqL,EAAelJ,GACtB,OAAOoI,EAAM5D,SAASxE,EAAK,MAAQA,EAAIhC,MAAM,GAAI,GAAKgC,CACxD,CAWA,SAASmJ,EAAUC,EAAMpJ,EAAKqJ,GAC5B,OAAKD,EACEA,EAAKE,OAAOtJ,GAAKuJ,KAAI,SAAcC,EAAO9J,GAG/C,OADA8J,EAAQN,EAAeM,IACfH,GAAQ3J,EAAI,IAAM8J,EAAQ,IAAMA,CACzC,IAAEC,KAAKJ,EAAO,IAAM,IALHrJ,CAMpB,CAaA,MAAM0J,EAAatB,EAAMlE,aAAakE,EAAO,CAAE,EAAE,MAAM,SAAgBrH,GACrE,MAAO,WAAW4I,KAAK5I,EACzB,IAyBA,SAAS6I,EAAWpK,EAAKqK,EAAUC,GACjC,IAAK1B,EAAMxJ,SAASY,GAClB,MAAM,IAAIuK,UAAU,4BAItBF,EAAWA,GAAY,IAAyB,SAYhD,MAAMG,GATNF,EAAU1B,EAAMlE,aAAa4F,EAAS,CACpCE,YAAY,EACZX,MAAM,EACNY,SAAS,IACR,GAAO,SAAiBC,EAAQ3C,GAEjC,OAAQa,EAAM7J,YAAYgJ,EAAO2C,GACrC,KAE6BF,WAErBG,EAAUL,EAAQK,SAAWC,EAC7Bf,EAAOS,EAAQT,KACfY,EAAUH,EAAQG,QAElBI,GADQP,EAAQQ,MAAwB,oBAATA,MAAwBA,OACpClC,EAAMjB,oBAAoB0C,GAEnD,IAAKzB,EAAM1J,WAAWyL,GACpB,MAAM,IAAIJ,UAAU,8BAGtB,SAASQ,EAAavG,GACpB,GAAc,OAAVA,EAAgB,MAAO,GAE3B,GAAIoE,EAAMlJ,OAAO8E,GACf,OAAOA,EAAMwG,cAGf,IAAKH,GAAWjC,EAAMhJ,OAAO4E,GAC3B,MAAM,IAAI6D,EAAW,gDAGvB,OAAIO,EAAM5J,cAAcwF,IAAUoE,EAAM1H,aAAasD,GAC5CqG,GAA2B,mBAATC,KAAsB,IAAIA,KAAK,CAACtG,IAAUyG,OAAO7B,KAAK5E,GAG1EA,CACR,CAYD,SAASoG,EAAepG,EAAOhE,EAAKoJ,GAClC,IAAIpE,EAAMhB,EAEV,GAAIA,IAAUoF,GAAyB,iBAAVpF,EAC3B,GAAIoE,EAAM5D,SAASxE,EAAK,MAEtBA,EAAMgK,EAAahK,EAAMA,EAAIhC,MAAM,GAAI,GAEvCgG,EAAQ0G,KAAKC,UAAU3G,QAClB,GACJoE,EAAM/J,QAAQ2F,IAnGvB,SAAqBgB,GACnB,OAAOoD,EAAM/J,QAAQ2G,KAASA,EAAI4F,KAAK3B,EACzC,CAiGiC4B,CAAY7G,KACnCoE,EAAM/I,WAAW2E,IAAUoE,EAAM5D,SAASxE,EAAK,SAAWgF,EAAMoD,EAAMrD,QAAQf,IAYhF,OATAhE,EAAMkJ,EAAelJ,GAErBgF,EAAIzF,SAAQ,SAAcuL,EAAIC,IAC1B3C,EAAM7J,YAAYuM,IAAc,OAAPA,GAAgBjB,EAASvH,QAEtC,IAAZ2H,EAAmBd,EAAU,CAACnJ,GAAM+K,EAAO1B,GAAqB,OAAZY,EAAmBjK,EAAMA,EAAM,KACnFuK,EAAaO,GAEzB,KACe,EAIX,QAAI7B,EAAYjF,KAIhB6F,EAASvH,OAAO6G,EAAUC,EAAMpJ,EAAKqJ,GAAOkB,EAAavG,KAElD,EACR,CAED,MAAMqD,EAAQ,GAER2D,EAAiBzN,OAAO0G,OAAOyF,EAAY,CAC/CU,iBACAG,eACAtB,gBAyBF,IAAKb,EAAMxJ,SAASY,GAClB,MAAM,IAAIuK,UAAU,0BAKtB,OA5BA,SAASkB,EAAMjH,EAAOoF,GACpB,IAAIhB,EAAM7J,YAAYyF,GAAtB,CAEA,IAA8B,IAA1BqD,EAAMvC,QAAQd,GAChB,MAAM+B,MAAM,kCAAoCqD,EAAKK,KAAK,MAG5DpC,EAAM5B,KAAKzB,GAEXoE,EAAM7I,QAAQyE,GAAO,SAAc8G,EAAI9K,IAKtB,OAJEoI,EAAM7J,YAAYuM,IAAc,OAAPA,IAAgBX,EAAQpM,KAChE8L,EAAUiB,EAAI1C,EAAM3J,SAASuB,GAAOA,EAAIuD,OAASvD,EAAKoJ,EAAM4B,KAI5DC,EAAMH,EAAI1B,EAAOA,EAAKE,OAAOtJ,GAAO,CAACA,GAE7C,IAEIqH,EAAM6D,KAlB+B,CAmBtC,CAMDD,CAAMzL,GAECqK,CACT,CC5MA,SAASsB,EAAOrN,GACd,MAAMsN,EAAU,CACd,IAAK,MACL,IAAK,MACL,IAAK,MACL,IAAK,MACL,IAAK,MACL,MAAO,IACP,MAAO,MAET,OAAOC,mBAAmBvN,GAAK0F,QAAQ,oBAAoB,SAAkB8H,GAC3E,OAAOF,EAAQE,EACnB,GACA,CAUA,SAASC,EAAqBC,EAAQ1B,GACpC7G,KAAKwI,OAAS,GAEdD,GAAU5B,EAAW4B,EAAQvI,KAAM6G,EACrC,CAEA,MAAMtM,EAAY+N,EAAqB/N,UC5BvC,SAAS2N,EAAOrM,GACd,OAAOuM,mBAAmBvM,GACxB0E,QAAQ,QAAS,KACjBA,QAAQ,OAAQ,KAChBA,QAAQ,QAAS,KACjBA,QAAQ,OAAQ,KAChBA,QAAQ,QAAS,KACjBA,QAAQ,QAAS,IACrB,CAWe,SAASkI,EAASC,EAAKH,EAAQ1B,GAE5C,IAAK0B,EACH,OAAOG,EAGT,MAAMC,EAAU9B,GAAWA,EAAQqB,QAAUA,EAEvCU,EAAc/B,GAAWA,EAAQgC,UAEvC,IAAIC,EAUJ,GAPEA,EADEF,EACiBA,EAAYL,EAAQ1B,GAEpB1B,EAAM9I,kBAAkBkM,GACzCA,EAAOlO,WACP,IAAIiO,EAAqBC,EAAQ1B,GAASxM,SAASsO,GAGnDG,EAAkB,CACpB,MAAMC,EAAgBL,EAAI7G,QAAQ,MAEX,IAAnBkH,IACFL,EAAMA,EAAI3N,MAAM,EAAGgO,IAErBL,KAA8B,IAAtBA,EAAI7G,QAAQ,KAAc,IAAM,KAAOiH,CAChD,CAED,OAAOJ,CACT,CDnBAnO,EAAU8E,OAAS,SAAgBf,EAAMyC,GACvCf,KAAKwI,OAAOhG,KAAK,CAAClE,EAAMyC,GAC1B,EAEAxG,EAAUF,SAAW,SAAkB2O,GACrC,MAAML,EAAUK,EAAU,SAASjI,GACjC,OAAOiI,EAAQlO,KAAKkF,KAAMe,EAAOmH,EAClC,EAAGA,EAEJ,OAAOlI,KAAKwI,OAAOlC,KAAI,SAAcnE,GACnC,OAAOwG,EAAQxG,EAAK,IAAM,IAAMwG,EAAQxG,EAAK,GAC9C,GAAE,IAAIqE,KAAK,IACd,EEeA,MAAAyC,EAlEA,MACEhK,cACEe,KAAKkJ,SAAW,EACjB,CAUDC,IAAIC,EAAWC,EAAUxC,GAOvB,OANA7G,KAAKkJ,SAAS1G,KAAK,CACjB4G,YACAC,WACAC,cAAazC,GAAUA,EAAQyC,YAC/BC,QAAS1C,EAAUA,EAAQ0C,QAAU,OAEhCvJ,KAAKkJ,SAASvM,OAAS,CAC/B,CASD6M,MAAMC,GACAzJ,KAAKkJ,SAASO,KAChBzJ,KAAKkJ,SAASO,GAAM,KAEvB,CAODC,QACM1J,KAAKkJ,WACPlJ,KAAKkJ,SAAW,GAEnB,CAYD5M,QAAQrC,GACNkL,EAAM7I,QAAQ0D,KAAKkJ,UAAU,SAAwBS,GACzC,OAANA,GACF1P,EAAG0P,EAEX,GACG,GCjEYC,EAAA,CACbC,mBAAmB,EACnBC,mBAAmB,EACnBC,qBAAqB,GCDRC,EAAA,CACbC,WAAW,EACXC,QAAS,CACXC,gBCJ0C,oBAApBA,gBAAkCA,gBAAkB7B,EDK1ElJ,SENmC,oBAAbA,SAA2BA,SAAW,KFO5DiI,KGP+B,oBAATA,KAAuBA,KAAO,MHSlD+C,UAAW,CAAC,OAAQ,QAAS,OAAQ,OAAQ,MAAO,SIXhDC,EAAkC,oBAAXhN,QAA8C,oBAAbiN,SAmBxDC,GACHC,EAEuB,oBAAdC,WAA6BA,UAAUD,QADxCH,GAAiB,CAAC,cAAe,eAAgB,MAAMxI,QAAQ2I,GAAW,GAFvD,IAC3BA,EAaH,MAAME,EAE2B,oBAAtBC,mBAEPvN,gBAAgBuN,mBACc,mBAAvBvN,KAAKwN,cCnCDC,GAAA,gHAEVA,GC2CL,SAASC,GAAelE,GACtB,SAASmE,EAAU5E,EAAMpF,EAAOwD,EAAQuD,GACtC,IAAIxJ,EAAO6H,EAAK2B,KAEhB,GAAa,cAATxJ,EAAsB,OAAO,EAEjC,MAAM0M,EAAerH,OAAOC,UAAUtF,GAChC2M,EAASnD,GAAS3B,EAAKxJ,OAG7B,GAFA2B,GAAQA,GAAQ6G,EAAM/J,QAAQmJ,GAAUA,EAAO5H,OAAS2B,EAEpD2M,EAOF,OANI9F,EAAM1C,WAAW8B,EAAQjG,GAC3BiG,EAAOjG,GAAQ,CAACiG,EAAOjG,GAAOyC,GAE9BwD,EAAOjG,GAAQyC,GAGTiK,EAGLzG,EAAOjG,IAAU6G,EAAMxJ,SAAS4I,EAAOjG,MAC1CiG,EAAOjG,GAAQ,IASjB,OANeyM,EAAU5E,EAAMpF,EAAOwD,EAAOjG,GAAOwJ,IAEtC3C,EAAM/J,QAAQmJ,EAAOjG,MACjCiG,EAAOjG,GA/Cb,SAAuByD,GACrB,MAAMxF,EAAM,CAAA,EACNK,EAAOtC,OAAOsC,KAAKmF,GACzB,IAAItF,EACJ,MAAMK,EAAMF,EAAKD,OACjB,IAAII,EACJ,IAAKN,EAAI,EAAGA,EAAIK,EAAKL,IACnBM,EAAMH,EAAKH,GACXF,EAAIQ,GAAOgF,EAAIhF,GAEjB,OAAOR,CACT,CAoCqB2O,CAAc3G,EAAOjG,MAG9B0M,CACT,CAED,GAAI7F,EAAMjG,WAAW0H,IAAazB,EAAM1J,WAAWmL,EAASuE,SAAU,CACpE,MAAM5O,EAAM,CAAA,EAMZ,OAJA4I,EAAMnD,aAAa4E,GAAU,CAACtI,EAAMyC,KAClCgK,EA1EN,SAAuBzM,GAKrB,OAAO6G,EAAM/C,SAAS,gBAAiB9D,GAAMgI,KAAI+B,GAC3B,OAAbA,EAAM,GAAc,GAAKA,EAAM,IAAMA,EAAM,IAEtD,CAkEgB+C,CAAc9M,GAAOyC,EAAOxE,EAAK,EAAE,IAGxCA,CACR,CAED,OAAO,IACT,CCzDA,MAAM8O,GAAW,CAEfC,aAAc1B,EAEd2B,QAAS,CAAC,MAAO,QAEjBC,iBAAkB,CAAC,SAA0BC,EAAMC,GACjD,MAAMC,EAAcD,EAAQE,kBAAoB,GAC1CC,EAAqBF,EAAY9J,QAAQ,qBAAuB,EAChEiK,EAAkB3G,EAAMxJ,SAAS8P,GAEnCK,GAAmB3G,EAAMvH,WAAW6N,KACtCA,EAAO,IAAIrM,SAASqM,IAKtB,GAFmBtG,EAAMjG,WAAWuM,GAGlC,OAAOI,EAAqBpE,KAAKC,UAAUoD,GAAeW,IAASA,EAGrE,GAAItG,EAAM5J,cAAckQ,IACtBtG,EAAMnG,SAASyM,IACftG,EAAMvF,SAAS6L,IACftG,EAAMjJ,OAAOuP,IACbtG,EAAMhJ,OAAOsP,GAEb,OAAOA,EAET,GAAItG,EAAM7F,kBAAkBmM,GAC1B,OAAOA,EAAK/L,OAEd,GAAIyF,EAAM9I,kBAAkBoP,GAE1B,OADAC,EAAQK,eAAe,mDAAmD,GACnEN,EAAKpR,WAGd,IAAI+B,EAEJ,GAAI0P,EAAiB,CACnB,GAAIH,EAAY9J,QAAQ,sCAAwC,EAC9D,OCtEO,SAA0B4J,EAAM5E,GAC7C,OAAOF,EAAW8E,EAAM,IAAIZ,GAASX,QAAQC,gBAAmB7P,OAAO0G,OAAO,CAC5EkG,QAAS,SAASnG,EAAOhE,EAAKoJ,EAAM6F,GAClC,OAAInB,GAASoB,QAAU9G,EAAMnG,SAAS+B,IACpCf,KAAKX,OAAOtC,EAAKgE,EAAM1G,SAAS,YACzB,GAGF2R,EAAQ7E,eAAehN,MAAM6F,KAAM5F,UAC3C,GACAyM,GACL,CD2DeqF,CAAiBT,EAAMzL,KAAKmM,gBAAgB9R,WAGrD,IAAK+B,EAAa+I,EAAM/I,WAAWqP,KAAUE,EAAY9J,QAAQ,wBAA0B,EAAG,CAC5F,MAAMuK,EAAYpM,KAAKqM,KAAOrM,KAAKqM,IAAIjN,SAEvC,OAAOuH,EACLvK,EAAa,CAAC,UAAWqP,GAAQA,EACjCW,GAAa,IAAIA,EACjBpM,KAAKmM,eAER,CACF,CAED,OAAIL,GAAmBD,GACrBH,EAAQK,eAAe,oBAAoB,GAvEjD,SAAyBO,EAAUC,EAAQvD,GACzC,GAAI7D,EAAM3J,SAAS8Q,GACjB,IAEE,OADCC,GAAU9E,KAAK+E,OAAOF,GAChBnH,EAAM7E,KAAKgM,EAKnB,CAJC,MAAOG,GACP,GAAe,gBAAXA,EAAEnO,KACJ,MAAMmO,CAET,CAGH,OAAQzD,GAAWvB,KAAKC,WAAW4E,EACrC,CA2DaI,CAAgBjB,IAGlBA,CACX,GAEEkB,kBAAmB,CAAC,SAA2BlB,GAC7C,MAAMH,EAAetL,KAAKsL,cAAgBD,GAASC,aAC7CxB,EAAoBwB,GAAgBA,EAAaxB,kBACjD8C,EAAsC,SAAtB5M,KAAK6M,aAE3B,GAAIpB,GAAQtG,EAAM3J,SAASiQ,KAAW3B,IAAsB9J,KAAK6M,cAAiBD,GAAgB,CAChG,MACME,IADoBxB,GAAgBA,EAAazB,oBACP+C,EAEhD,IACE,OAAOnF,KAAK+E,MAAMf,EAQnB,CAPC,MAAOgB,GACP,GAAIK,EAAmB,CACrB,GAAe,gBAAXL,EAAEnO,KACJ,MAAMsG,EAAWe,KAAK8G,EAAG7H,EAAWmI,iBAAkB/M,KAAM,KAAMA,KAAKiF,UAEzE,MAAMwH,CACP,CACF,CACF,CAED,OAAOhB,CACX,GAMEuB,QAAS,EAETC,eAAgB,aAChBC,eAAgB,eAEhBC,kBAAmB,EACnBC,eAAgB,EAEhBf,IAAK,CACHjN,SAAUyL,GAASX,QAAQ9K,SAC3BiI,KAAMwD,GAASX,QAAQ7C,MAGzBgG,eAAgB,SAAwB3H,GACtC,OAAOA,GAAU,KAAOA,EAAS,GAClC,EAEDgG,QAAS,CACP4B,OAAQ,CACNC,OAAU,oCACV,oBAAgB5L,KAKtBwD,EAAM7I,QAAQ,CAAC,SAAU,MAAO,OAAQ,OAAQ,MAAO,UAAWkR,IAChEnC,GAASK,QAAQ8B,GAAU,EAAE,IAG/B,MAAAC,GAAepC,GErJTqC,GAAoBvI,EAAMpC,YAAY,CAC1C,MAAO,gBAAiB,iBAAkB,eAAgB,OAC1D,UAAW,OAAQ,OAAQ,oBAAqB,sBAChD,gBAAiB,WAAY,eAAgB,sBAC7C,UAAW,cAAe,eCLtB4K,GAAa7R,OAAO,aAE1B,SAAS8R,GAAgBC,GACvB,OAAOA,GAAUnM,OAAOmM,GAAQvN,OAAOtF,aACzC,CAEA,SAAS8S,GAAe/M,GACtB,OAAc,IAAVA,GAA4B,MAATA,EACdA,EAGFoE,EAAM/J,QAAQ2F,GAASA,EAAMuF,IAAIwH,IAAkBpM,OAAOX,EACnE,CAgBA,SAASgN,GAAiBvQ,EAASuD,EAAO8M,EAAQzM,EAAQ4M,GACxD,OAAI7I,EAAM1J,WAAW2F,GACZA,EAAOtG,KAAKkF,KAAMe,EAAO8M,IAG9BG,IACFjN,EAAQ8M,GAGL1I,EAAM3J,SAASuF,GAEhBoE,EAAM3J,SAAS4F,IACiB,IAA3BL,EAAMc,QAAQT,GAGnB+D,EAAMpH,SAASqD,GACVA,EAAOsF,KAAK3F,QADrB,OANA,EASF,CAsBA,MAAMkN,GACJhP,YAAYyM,GACVA,GAAW1L,KAAK6C,IAAI6I,EACrB,CAED7I,IAAIgL,EAAQK,EAAgBC,GAC1B,MAAM/Q,EAAO4C,KAEb,SAASoO,EAAUC,EAAQC,EAASC,GAClC,MAAMC,EAAUZ,GAAgBU,GAEhC,IAAKE,EACH,MAAM,IAAI1L,MAAM,0CAGlB,MAAM/F,EAAMoI,EAAMnI,QAAQI,EAAMoR,KAE5BzR,QAAqB4E,IAAdvE,EAAKL,KAAmC,IAAbwR,QAAmC5M,IAAb4M,IAAwC,IAAdnR,EAAKL,MACzFK,EAAKL,GAAOuR,GAAWR,GAAeO,GAEzC,CAED,MAAMI,EAAa,CAAC/C,EAAS6C,IAC3BpJ,EAAM7I,QAAQoP,GAAS,CAAC2C,EAAQC,IAAYF,EAAUC,EAAQC,EAASC,KAUzE,OARIpJ,EAAMvJ,cAAciS,IAAWA,aAAkB7N,KAAKf,YACxDwP,EAAWZ,EAAQK,GACX/I,EAAM3J,SAASqS,KAAYA,EAASA,EAAOvN,UArEtB,iCAAiCoG,KAqEmBmH,EArEVvN,QAsEvEmO,ED1ESC,KACb,MAAMC,EAAS,CAAA,EACf,IAAI5R,EACAlB,EACAY,EAsBJ,OApBAiS,GAAcA,EAAWvL,MAAM,MAAM7G,SAAQ,SAAgBsS,GAC3DnS,EAAImS,EAAK/M,QAAQ,KACjB9E,EAAM6R,EAAKC,UAAU,EAAGpS,GAAG6D,OAAOtF,cAClCa,EAAM+S,EAAKC,UAAUpS,EAAI,GAAG6D,QAEvBvD,GAAQ4R,EAAO5R,IAAQ2Q,GAAkB3Q,KAIlC,eAARA,EACE4R,EAAO5R,GACT4R,EAAO5R,GAAKyF,KAAK3G,GAEjB8S,EAAO5R,GAAO,CAAClB,GAGjB8S,EAAO5R,GAAO4R,EAAO5R,GAAO4R,EAAO5R,GAAO,KAAOlB,EAAMA,EAE7D,IAES8S,CAAM,ECgDEG,CAAajB,GAASK,GAEvB,MAAVL,GAAkBO,EAAUF,EAAgBL,EAAQM,GAG/CnO,IACR,CAED+O,IAAIlB,EAAQtB,GAGV,GAFAsB,EAASD,GAAgBC,GAEb,CACV,MAAM9Q,EAAMoI,EAAMnI,QAAQgD,KAAM6N,GAEhC,GAAI9Q,EAAK,CACP,MAAMgE,EAAQf,KAAKjD,GAEnB,IAAKwP,EACH,OAAOxL,EAGT,IAAe,IAAXwL,EACF,OAxGV,SAAqB1R,GACnB,MAAMmU,EAAS1U,OAAOK,OAAO,MACvBsU,EAAW,mCACjB,IAAI5G,EAEJ,KAAQA,EAAQ4G,EAAS1M,KAAK1H,IAC5BmU,EAAO3G,EAAM,IAAMA,EAAM,GAG3B,OAAO2G,CACT,CA8FiBE,CAAYnO,GAGrB,GAAIoE,EAAM1J,WAAW8Q,GACnB,OAAOA,EAAOzR,KAAKkF,KAAMe,EAAOhE,GAGlC,GAAIoI,EAAMpH,SAASwO,GACjB,OAAOA,EAAOhK,KAAKxB,GAGrB,MAAM,IAAI+F,UAAU,yCACrB,CACF,CACF,CAEDqI,IAAItB,EAAQuB,GAGV,GAFAvB,EAASD,GAAgBC,GAEb,CACV,MAAM9Q,EAAMoI,EAAMnI,QAAQgD,KAAM6N,GAEhC,SAAU9Q,QAAqB4E,IAAd3B,KAAKjD,IAAwBqS,IAAWrB,GAAiB/N,EAAMA,KAAKjD,GAAMA,EAAKqS,GACjG,CAED,OAAO,CACR,CAEDC,OAAOxB,EAAQuB,GACb,MAAMhS,EAAO4C,KACb,IAAIsP,GAAU,EAEd,SAASC,EAAajB,GAGpB,GAFAA,EAAUV,GAAgBU,GAEb,CACX,MAAMvR,EAAMoI,EAAMnI,QAAQI,EAAMkR,IAE5BvR,GAASqS,IAAWrB,GAAiB3Q,EAAMA,EAAKL,GAAMA,EAAKqS,YACtDhS,EAAKL,GAEZuS,GAAU,EAEb,CACF,CAQD,OANInK,EAAM/J,QAAQyS,GAChBA,EAAOvR,QAAQiT,GAEfA,EAAa1B,GAGRyB,CACR,CAED5F,MAAM0F,GACJ,MAAMxS,EAAOtC,OAAOsC,KAAKoD,MACzB,IAAIvD,EAAIG,EAAKD,OACT2S,GAAU,EAEd,KAAO7S,KAAK,CACV,MAAMM,EAAMH,EAAKH,GACb2S,IAAWrB,GAAiB/N,EAAMA,KAAKjD,GAAMA,EAAKqS,GAAS,YACtDpP,KAAKjD,GACZuS,GAAU,EAEb,CAED,OAAOA,CACR,CAEDE,UAAUC,GACR,MAAMrS,EAAO4C,KACP0L,EAAU,CAAA,EAsBhB,OApBAvG,EAAM7I,QAAQ0D,MAAM,CAACe,EAAO8M,KAC1B,MAAM9Q,EAAMoI,EAAMnI,QAAQ0O,EAASmC,GAEnC,GAAI9Q,EAGF,OAFAK,EAAKL,GAAO+Q,GAAe/M,eACpB3D,EAAKyQ,GAId,MAAM6B,EAAaD,EA1JzB,SAAsB5B,GACpB,OAAOA,EAAOvN,OACXtF,cAAcuF,QAAQ,mBAAmB,CAACoP,EAAGC,EAAM/U,IAC3C+U,EAAK/Q,cAAgBhE,GAElC,CAqJkCgV,CAAahC,GAAUnM,OAAOmM,GAAQvN,OAE9DoP,IAAe7B,UACVzQ,EAAKyQ,GAGdzQ,EAAKsS,GAAc5B,GAAe/M,GAElC2K,EAAQgE,IAAc,CAAI,IAGrB1P,IACR,CAEDqG,UAAUyJ,GACR,OAAO9P,KAAKf,YAAYoH,OAAOrG,QAAS8P,EACzC,CAED1K,OAAO2K,GACL,MAAMxT,EAAMjC,OAAOK,OAAO,MAM1B,OAJAwK,EAAM7I,QAAQ0D,MAAM,CAACe,EAAO8M,KACjB,MAAT9M,IAA2B,IAAVA,IAAoBxE,EAAIsR,GAAUkC,GAAa5K,EAAM/J,QAAQ2F,GAASA,EAAMyF,KAAK,MAAQzF,EAAM,IAG3GxE,CACR,CAED,CAACT,OAAOE,YACN,OAAO1B,OAAO6Q,QAAQnL,KAAKoF,UAAUtJ,OAAOE,WAC7C,CAED3B,WACE,OAAOC,OAAO6Q,QAAQnL,KAAKoF,UAAUkB,KAAI,EAAEuH,EAAQ9M,KAAW8M,EAAS,KAAO9M,IAAOyF,KAAK,KAC3F,CAEWzK,IAAPD,OAAOC,eACV,MAAO,cACR,CAEDiU,YAAYpV,GACV,OAAOA,aAAiBoF,KAAOpF,EAAQ,IAAIoF,KAAKpF,EACjD,CAEDoV,cAAcC,KAAUH,GACtB,MAAMI,EAAW,IAAIlQ,KAAKiQ,GAI1B,OAFAH,EAAQxT,SAASiI,GAAW2L,EAASrN,IAAI0B,KAElC2L,CACR,CAEDF,gBAAgBnC,GACd,MAIMsC,GAJYnQ,KAAK2N,IAAe3N,KAAK2N,IAAc,CACvDwC,UAAW,CAAE,IAGaA,UACtB5V,EAAYyF,KAAKzF,UAEvB,SAAS6V,EAAe9B,GACtB,MAAME,EAAUZ,GAAgBU,GAE3B6B,EAAU3B,MAlNrB,SAAwBjS,EAAKsR,GAC3B,MAAMwC,EAAelL,EAAM/B,YAAY,IAAMyK,GAE7C,CAAC,MAAO,MAAO,OAAOvR,SAAQgU,IAC5BhW,OAAOwG,eAAevE,EAAK+T,EAAaD,EAAc,CACpDtP,MAAO,SAASwP,EAAMC,EAAMC,GAC1B,OAAOzQ,KAAKsQ,GAAYxV,KAAKkF,KAAM6N,EAAQ0C,EAAMC,EAAMC,EACxD,EACDC,cAAc,GACd,GAEN,CAwMQC,CAAepW,EAAW+T,GAC1B6B,EAAU3B,IAAW,EAExB,CAID,OAFArJ,EAAM/J,QAAQyS,GAAUA,EAAOvR,QAAQ8T,GAAkBA,EAAevC,GAEjE7N,IACR,EAGHiO,GAAa2C,SAAS,CAAC,eAAgB,iBAAkB,SAAU,kBAAmB,aAAc,kBAGpGzL,EAAMnH,kBAAkBiQ,GAAa1T,WAAW,EAAEwG,SAAQhE,KACxD,IAAI8T,EAAS9T,EAAI,GAAG8B,cAAgB9B,EAAIhC,MAAM,GAC9C,MAAO,CACLgU,IAAK,IAAMhO,EACX8B,IAAIiO,GACF9Q,KAAK6Q,GAAUC,CAChB,EACF,IAGH3L,EAAMzC,cAAcuL,IAEpB,MAAA8C,GAAe9C,GC3RA,SAAS+C,GAAcC,EAAKhM,GACzC,MAAMF,EAAS/E,MAAQqL,GACjB7N,EAAUyH,GAAYF,EACtB2G,EAAUuC,GAAatI,KAAKnI,EAAQkO,SAC1C,IAAID,EAAOjO,EAAQiO,KAQnB,OANAtG,EAAM7I,QAAQ2U,GAAK,SAAmBhX,GACpCwR,EAAOxR,EAAGa,KAAKiK,EAAQ0G,EAAMC,EAAQ8D,YAAavK,EAAWA,EAASS,YAAS/D,EACnF,IAEE+J,EAAQ8D,YAED/D,CACT,CCzBe,SAASyF,GAASnQ,GAC/B,SAAUA,IAASA,EAAMoQ,WAC3B,CCUA,SAASC,GAAcvM,EAASE,EAAQC,GAEtCJ,EAAW9J,KAAKkF,KAAiB,MAAX6E,EAAkB,WAAaA,EAASD,EAAWyM,aAActM,EAAQC,GAC/FhF,KAAK1B,KAAO,eACd,CAEA6G,EAAMxE,SAASyQ,GAAexM,EAAY,CACxCuM,YAAY,IClBd,MAAeG,GAAAzG,GAASN,sBAGtB,CACEgH,MAAMjT,EAAMyC,EAAOyQ,EAASrL,EAAMsL,EAAQC,GACxC,MAAMC,EAAS,CAACrT,EAAO,IAAM8J,mBAAmBrH,IAEhDoE,EAAMzJ,SAAS8V,IAAYG,EAAOnP,KAAK,WAAa,IAAIoP,KAAKJ,GAASK,eAEtE1M,EAAM3J,SAAS2K,IAASwL,EAAOnP,KAAK,QAAU2D,GAE9ChB,EAAM3J,SAASiW,IAAWE,EAAOnP,KAAK,UAAYiP,IAEvC,IAAXC,GAAmBC,EAAOnP,KAAK,UAE/B8H,SAASqH,OAASA,EAAOnL,KAAK,KAC/B,EAEDsL,KAAKxT,GACH,MAAM+J,EAAQiC,SAASqH,OAAOtJ,MAAM,IAAI0J,OAAO,aAAezT,EAAO,cACrE,OAAQ+J,EAAQ2J,mBAAmB3J,EAAM,IAAM,IAChD,EAED4J,OAAO3T,GACL0B,KAAKuR,MAAMjT,EAAM,GAAIsT,KAAKM,MAAQ,MACnC,GAMH,CACEX,QAAU,EACVO,KAAI,IACK,KAETG,SAAW,GCxBA,SAASE,GAAcC,EAASC,GAC7C,OAAID,ICHG,8BAA8B1L,KDGP2L,GENjB,SAAqBD,EAASE,GAC3C,OAAOA,EACHF,EAAQ7R,QAAQ,SAAU,IAAM,IAAM+R,EAAY/R,QAAQ,OAAQ,IAClE6R,CACN,CFGWG,CAAYH,EAASC,GAEvBA,CACT,CGfA,MAAeG,GAAA3H,GAASN,sBAItB,WACE,MAAMkI,EAAO,kBAAkB/L,KAAK+D,UAAUiI,WACxCC,EAAiBrI,SAASsI,cAAc,KAC9C,IAAIC,EAQJ,SAASC,EAAWpK,GAClB,IAAIqK,EAAOrK,EAWX,OATI+J,IAEFE,EAAeK,aAAa,OAAQD,GACpCA,EAAOJ,EAAeI,MAGxBJ,EAAeK,aAAa,OAAQD,GAG7B,CACLA,KAAMJ,EAAeI,KACrBE,SAAUN,EAAeM,SAAWN,EAAeM,SAAS1S,QAAQ,KAAM,IAAM,GAChF2S,KAAMP,EAAeO,KACrBC,OAAQR,EAAeQ,OAASR,EAAeQ,OAAO5S,QAAQ,MAAO,IAAM,GAC3E6S,KAAMT,EAAeS,KAAOT,EAAeS,KAAK7S,QAAQ,KAAM,IAAM,GACpE8S,SAAUV,EAAeU,SACzBC,KAAMX,EAAeW,KACrBC,SAAiD,MAAtCZ,EAAeY,SAASC,OAAO,GACxCb,EAAeY,SACf,IAAMZ,EAAeY,SAE1B,CAUD,OARAV,EAAYC,EAAWzV,OAAOoW,SAASV,MAQhC,SAAyBW,GAC9B,MAAM/E,EAAUxJ,EAAM3J,SAASkY,GAAeZ,EAAWY,GAAcA,EACvE,OAAQ/E,EAAOsE,WAAaJ,EAAUI,UAClCtE,EAAOuE,OAASL,EAAUK,IACpC,CACG,CAlDD,GAsDS,WACL,OAAO,CACb,ECjDA,SAASS,GAAqBC,EAAUC,GACtC,IAAIC,EAAgB,EACpB,MAAMC,ECVR,SAAqBC,EAAcC,GACjCD,EAAeA,GAAgB,GAC/B,MAAME,EAAQ,IAAI7Y,MAAM2Y,GAClBG,EAAa,IAAI9Y,MAAM2Y,GAC7B,IAEII,EAFAC,EAAO,EACPC,EAAO,EAKX,OAFAL,OAActS,IAARsS,EAAoBA,EAAM,IAEzB,SAAcM,GACnB,MAAMrC,EAAMN,KAAKM,MAEXsC,EAAYL,EAAWG,GAExBF,IACHA,EAAgBlC,GAGlBgC,EAAMG,GAAQE,EACdJ,EAAWE,GAAQnC,EAEnB,IAAIzV,EAAI6X,EACJG,EAAa,EAEjB,KAAOhY,IAAM4X,GACXI,GAAcP,EAAMzX,KACpBA,GAAQuX,EASV,GANAK,GAAQA,EAAO,GAAKL,EAEhBK,IAASC,IACXA,GAAQA,EAAO,GAAKN,GAGlB9B,EAAMkC,EAAgBH,EACxB,OAGF,MAAMS,EAASF,GAAatC,EAAMsC,EAElC,OAAOE,EAAS1Q,KAAK2Q,MAAmB,IAAbF,EAAoBC,QAAU/S,CAC7D,CACA,CDlCuBiT,CAAY,GAAI,KAErC,OAAOnI,IACL,MAAMoI,EAASpI,EAAEoI,OACXC,EAAQrI,EAAEsI,iBAAmBtI,EAAEqI,WAAQnT,EACvCqT,EAAgBH,EAASf,EACzBmB,EAAOlB,EAAaiB,GAG1BlB,EAAgBe,EAEhB,MAAMpJ,EAAO,CACXoJ,SACAC,QACAI,SAAUJ,EAASD,EAASC,OAASnT,EACrCuS,MAAOc,EACPC,KAAMA,QAActT,EACpBwT,UAAWF,GAAQH,GAVLD,GAAUC,GAUeA,EAAQD,GAAUI,OAAOtT,EAChEyT,MAAO3I,GAGThB,EAAKoI,EAAmB,WAAa,WAAY,EAEjDD,EAASnI,EAAK,CAElB,CAEA,MExCM4J,GAAgB,CACpBC,KCLa,KDMbC,IFsCsD,oBAAnBC,gBAEG,SAAUzQ,GAChD,OAAO,IAAI0Q,SAAQ,SAA4BC,EAASC,GACtD,IAAIC,EAAc7Q,EAAO0G,KACzB,MAAMoK,EAAiB5H,GAAatI,KAAKZ,EAAO2G,SAAS8D,YACzD,IACIsG,EAWAnK,GAZAkB,aAACA,EAAYkJ,cAAEA,GAAiBhR,EAEpC,SAAS7C,IACH6C,EAAOiR,aACTjR,EAAOiR,YAAYC,YAAYH,GAG7B/Q,EAAOmR,QACTnR,EAAOmR,OAAOC,oBAAoB,QAASL,EAE9C,CAID,GAAI3Q,EAAMjG,WAAW0W,GACnB,GAAI/K,GAASN,uBAAyBM,GAASH,+BAC7CmL,EAAe9J,gBAAe,QACzB,IAAwD,KAAnDJ,EAAckK,EAAejK,kBAA6B,CAEpE,MAAO1Q,KAAS8T,GAAUrD,EAAcA,EAAYxI,MAAM,KAAKmD,KAAIC,GAASA,EAAMjG,SAAQc,OAAOgV,SAAW,GAC5GP,EAAe9J,eAAe,CAAC7Q,GAAQ,yBAA0B8T,GAAQxI,KAAK,MAC/E,CAGH,IAAIxB,EAAU,IAAIwQ,eAGlB,GAAIzQ,EAAOsR,KAAM,CACf,MAAMC,EAAWvR,EAAOsR,KAAKC,UAAY,GACnCC,EAAWxR,EAAOsR,KAAKE,SAAWC,SAASpO,mBAAmBrD,EAAOsR,KAAKE,WAAa,GAC7FV,EAAehT,IAAI,gBAAiB,SAAW4T,KAAKH,EAAW,IAAMC,GACtE,CAED,MAAMG,EAAWvE,GAAcpN,EAAOqN,QAASrN,EAAO2D,KAOtD,SAASiO,IACP,IAAK3R,EACH,OAGF,MAAM4R,EAAkB3I,GAAatI,KACnC,0BAA2BX,GAAWA,EAAQ6R,0BIpFvC,SAAgBnB,EAASC,EAAQ1Q,GAC9C,MAAMoI,EAAiBpI,EAASF,OAAOsI,eAClCpI,EAASS,QAAW2H,IAAkBA,EAAepI,EAASS,QAGjEiQ,EAAO,IAAI/Q,EACT,mCAAqCK,EAASS,OAC9C,CAACd,EAAWkS,gBAAiBlS,EAAWmI,kBAAkB/I,KAAK+S,MAAM9R,EAASS,OAAS,KAAO,GAC9FT,EAASF,OACTE,EAASD,QACTC,IAPFyQ,EAAQzQ,EAUZ,CJoFM+R,EAAO,SAAkBjW,GACvB2U,EAAQ3U,GACRmB,GACR,IAAS,SAAiB+U,GAClBtB,EAAOsB,GACP/U,GACD,GAfgB,CACfuJ,KAHoBoB,GAAiC,SAAjBA,GAA4C,SAAjBA,EACxC7H,EAAQC,SAA/BD,EAAQkS,aAGRxR,OAAQV,EAAQU,OAChByR,WAAYnS,EAAQmS,WACpBzL,QAASkL,EACT7R,SACAC,YAYFA,EAAU,IACX,CAmED,GArGAA,EAAQoS,KAAKrS,EAAOyI,OAAO3O,cAAe4J,EAASiO,EAAU3R,EAAOwD,OAAQxD,EAAOsS,mBAAmB,GAGtGrS,EAAQgI,QAAUjI,EAAOiI,QAiCrB,cAAehI,EAEjBA,EAAQ2R,UAAYA,EAGpB3R,EAAQsS,mBAAqB,WACtBtS,GAAkC,IAAvBA,EAAQuS,aAQD,IAAnBvS,EAAQU,QAAkBV,EAAQwS,aAAwD,IAAzCxS,EAAQwS,YAAY3V,QAAQ,WAKjF4V,WAAWd,EACnB,EAII3R,EAAQ0S,QAAU,WACX1S,IAIL2Q,EAAO,IAAI/Q,EAAW,kBAAmBA,EAAW+S,aAAc5S,EAAQC,IAG1EA,EAAU,KAChB,EAGIA,EAAQ4S,QAAU,WAGhBjC,EAAO,IAAI/Q,EAAW,gBAAiBA,EAAWiT,YAAa9S,EAAQC,IAGvEA,EAAU,IAChB,EAGIA,EAAQ8S,UAAY,WAClB,IAAIC,EAAsBhT,EAAOiI,QAAU,cAAgBjI,EAAOiI,QAAU,cAAgB,mBAC5F,MAAM1B,EAAevG,EAAOuG,cAAgB1B,EACxC7E,EAAOgT,sBACTA,EAAsBhT,EAAOgT,qBAE/BpC,EAAO,IAAI/Q,EACTmT,EACAzM,EAAavB,oBAAsBnF,EAAWoT,UAAYpT,EAAW+S,aACrE5S,EACAC,IAGFA,EAAU,IAChB,EAKO6F,GAASN,wBACVwL,GAAiB5Q,EAAM1J,WAAWsa,KAAmBA,EAAgBA,EAAchR,IAE/EgR,IAAoC,IAAlBA,GAA2BvD,GAAgBkE,IAAY,CAE3E,MAAMuB,EAAYlT,EAAOmI,gBAAkBnI,EAAOkI,gBAAkBqE,GAAQQ,KAAK/M,EAAOkI,gBAEpFgL,GACFpC,EAAehT,IAAIkC,EAAOmI,eAAgB+K,EAE7C,MAIatW,IAAhBiU,GAA6BC,EAAe9J,eAAe,MAGvD,qBAAsB/G,GACxBG,EAAM7I,QAAQuZ,EAAezQ,UAAU,SAA0BvJ,EAAKkB,GACpEiI,EAAQkT,iBAAiBnb,EAAKlB,EACtC,IAISsJ,EAAM7J,YAAYyJ,EAAOoT,mBAC5BnT,EAAQmT,kBAAoBpT,EAAOoT,iBAIjCtL,GAAiC,SAAjBA,IAClB7H,EAAQ6H,aAAe9H,EAAO8H,cAIS,mBAA9B9H,EAAOqT,oBAChBpT,EAAQqT,iBAAiB,WAAY1E,GAAqB5O,EAAOqT,oBAAoB,IAIhD,mBAA5BrT,EAAOuT,kBAAmCtT,EAAQuT,QAC3DvT,EAAQuT,OAAOF,iBAAiB,WAAY1E,GAAqB5O,EAAOuT,oBAGtEvT,EAAOiR,aAAejR,EAAOmR,UAG/BJ,EAAa0C,IACNxT,IAGL2Q,GAAQ6C,GAAUA,EAAOtd,KAAO,IAAIkW,GAAc,KAAMrM,EAAQC,GAAWwT,GAC3ExT,EAAQyT,QACRzT,EAAU,KAAI,EAGhBD,EAAOiR,aAAejR,EAAOiR,YAAY0C,UAAU5C,GAC/C/Q,EAAOmR,SACTnR,EAAOmR,OAAOyC,QAAU7C,IAAe/Q,EAAOmR,OAAOmC,iBAAiB,QAASvC,KAInF,MAAM7C,EKtPK,SAAuBvK,GACpC,MAAML,EAAQ,4BAA4B9F,KAAKmG,GAC/C,OAAOL,GAASA,EAAM,IAAM,EAC9B,CLmPqBuQ,CAAclC,GAE3BzD,IAAsD,IAA1CpI,GAAST,UAAUvI,QAAQoR,GACzC0C,EAAO,IAAI/Q,EAAW,wBAA0BqO,EAAW,IAAKrO,EAAWkS,gBAAiB/R,IAM9FC,EAAQ6T,KAAKjD,GAAe,KAChC,GACA,GEzPAzQ,EAAM7I,QAAQ+Y,IAAe,CAACpb,EAAI8G,KAChC,GAAI9G,EAAI,CACN,IACEK,OAAOwG,eAAe7G,EAAI,OAAQ,CAAC8G,SAGpC,CAFC,MAAO0L,GAER,CACDnS,OAAOwG,eAAe7G,EAAI,cAAe,CAAC8G,SAC3C,KAGH,MAAM+X,GAAgBC,GAAW,KAAKA,IAEhCC,GAAoBzN,GAAYpG,EAAM1J,WAAW8P,IAAwB,OAAZA,IAAgC,IAAZA,EAExE0N,GACAA,IACXA,EAAW9T,EAAM/J,QAAQ6d,GAAYA,EAAW,CAACA,GAEjD,MAAMtc,OAACA,GAAUsc,EACjB,IAAIC,EACA3N,EAEJ,MAAM4N,EAAkB,CAAA,EAExB,IAAK,IAAI1c,EAAI,EAAGA,EAAIE,EAAQF,IAAK,CAE/B,IAAIgN,EAIJ,GALAyP,EAAgBD,EAASxc,GAGzB8O,EAAU2N,GAELF,GAAiBE,KACpB3N,EAAU8J,IAAe5L,EAAK/H,OAAOwX,IAAgBle,oBAErC2G,IAAZ4J,GACF,MAAM,IAAI3G,EAAW,oBAAoB6E,MAI7C,GAAI8B,EACF,MAGF4N,EAAgB1P,GAAM,IAAMhN,GAAK8O,CAClC,CAED,IAAKA,EAAS,CAEZ,MAAM6N,EAAU9e,OAAO6Q,QAAQgO,GAC5B7S,KAAI,EAAEmD,EAAI4P,KAAW,WAAW5P,OACpB,IAAV4P,EAAkB,sCAAwC,mCAO/D,MAAM,IAAIzU,EACR,yDALMjI,EACLyc,EAAQzc,OAAS,EAAI,YAAcyc,EAAQ9S,IAAIwS,IAActS,KAAK,MAAQ,IAAMsS,GAAaM,EAAQ,IACtG,2BAIA,kBAEH,CAED,OAAO7N,CAAO,EIzDlB,SAAS+N,GAA6BvU,GAKpC,GAJIA,EAAOiR,aACTjR,EAAOiR,YAAYuD,mBAGjBxU,EAAOmR,QAAUnR,EAAOmR,OAAOyC,QACjC,MAAM,IAAIvH,GAAc,KAAMrM,EAElC,CASe,SAASyU,GAAgBzU,GACtCuU,GAA6BvU,GAE7BA,EAAO2G,QAAUuC,GAAatI,KAAKZ,EAAO2G,SAG1C3G,EAAO0G,KAAOuF,GAAclW,KAC1BiK,EACAA,EAAOyG,mBAGgD,IAArD,CAAC,OAAQ,MAAO,SAAS3J,QAAQkD,EAAOyI,SAC1CzI,EAAO2G,QAAQK,eAAe,qCAAqC,GAKrE,OAFgBkN,GAAoBlU,EAAOwG,SAAWF,GAASE,QAExDA,CAAQxG,GAAQL,MAAK,SAA6BO,GAYvD,OAXAqU,GAA6BvU,GAG7BE,EAASwG,KAAOuF,GAAclW,KAC5BiK,EACAA,EAAO4H,kBACP1H,GAGFA,EAASyG,QAAUuC,GAAatI,KAAKV,EAASyG,SAEvCzG,CACX,IAAK,SAA4B8T,GAe7B,OAdK7H,GAAS6H,KACZO,GAA6BvU,GAGzBgU,GAAUA,EAAO9T,WACnB8T,EAAO9T,SAASwG,KAAOuF,GAAclW,KACnCiK,EACAA,EAAO4H,kBACPoM,EAAO9T,UAET8T,EAAO9T,SAASyG,QAAUuC,GAAatI,KAAKoT,EAAO9T,SAASyG,WAIzD+J,QAAQE,OAAOoD,EAC1B,GACA,CC3EA,MAAMU,GAAmB7e,GAAUA,aAAiBqT,GAAerT,EAAMwK,SAAWxK,EAWrE,SAAS8e,GAAYC,EAASC,GAE3CA,EAAUA,GAAW,GACrB,MAAM7U,EAAS,CAAA,EAEf,SAAS8U,EAAetV,EAAQD,EAAQvE,GACtC,OAAIoF,EAAMvJ,cAAc2I,IAAWY,EAAMvJ,cAAc0I,GAC9Ca,EAAMrF,MAAMhF,KAAK,CAACiF,YAAWwE,EAAQD,GACnCa,EAAMvJ,cAAc0I,GACtBa,EAAMrF,MAAM,CAAE,EAAEwE,GACda,EAAM/J,QAAQkJ,GAChBA,EAAOvJ,QAETuJ,CACR,CAGD,SAASwV,EAAoB1Z,EAAGC,EAAGN,GACjC,OAAKoF,EAAM7J,YAAY+E,GAEX8E,EAAM7J,YAAY8E,QAAvB,EACEyZ,OAAelY,EAAWvB,EAAGL,GAF7B8Z,EAAezZ,EAAGC,EAAGN,EAI/B,CAGD,SAASga,EAAiB3Z,EAAGC,GAC3B,IAAK8E,EAAM7J,YAAY+E,GACrB,OAAOwZ,OAAelY,EAAWtB,EAEpC,CAGD,SAAS2Z,EAAiB5Z,EAAGC,GAC3B,OAAK8E,EAAM7J,YAAY+E,GAEX8E,EAAM7J,YAAY8E,QAAvB,EACEyZ,OAAelY,EAAWvB,GAF1ByZ,OAAelY,EAAWtB,EAIpC,CAGD,SAAS4Z,EAAgB7Z,EAAGC,EAAGvC,GAC7B,OAAIA,KAAQ8b,EACHC,EAAezZ,EAAGC,GAChBvC,KAAQ6b,EACVE,OAAelY,EAAWvB,QAD5B,CAGR,CAED,MAAM8Z,EAAW,CACfxR,IAAKqR,EACLvM,OAAQuM,EACRtO,KAAMsO,EACN3H,QAAS4H,EACTxO,iBAAkBwO,EAClBrN,kBAAmBqN,EACnB3C,iBAAkB2C,EAClBhN,QAASgN,EACTG,eAAgBH,EAChB7B,gBAAiB6B,EACjBjE,cAAeiE,EACfzO,QAASyO,EACTnN,aAAcmN,EACd/M,eAAgB+M,EAChB9M,eAAgB8M,EAChB1B,iBAAkB0B,EAClB5B,mBAAoB4B,EACpBI,WAAYJ,EACZ7M,iBAAkB6M,EAClB5M,cAAe4M,EACfK,eAAgBL,EAChBM,UAAWN,EACXO,UAAWP,EACXQ,WAAYR,EACZhE,YAAagE,EACbS,WAAYT,EACZU,iBAAkBV,EAClB3M,eAAgB4M,EAChBvO,QAAS,CAACtL,EAAGC,IAAMyZ,EAAoBL,GAAgBrZ,GAAIqZ,GAAgBpZ,IAAI,IASjF,OANA8E,EAAM7I,QAAQhC,OAAOsC,KAAKtC,OAAO0G,OAAO,GAAI2Y,EAASC,KAAW,SAA4B9b,GAC1F,MAAMgC,EAAQoa,EAASpc,IAASgc,EAC1Ba,EAAc7a,EAAM6Z,EAAQ7b,GAAO8b,EAAQ9b,GAAOA,GACvDqH,EAAM7J,YAAYqf,IAAgB7a,IAAUma,IAAqBlV,EAAOjH,GAAQ6c,EACrF,IAES5V,CACT,CCzGO,MCKD6V,GAAa,CAAA,EAGnB,CAAC,SAAU,UAAW,SAAU,WAAY,SAAU,UAAUte,SAAQ,CAACpB,EAAMuB,KAC7Eme,GAAW1f,GAAQ,SAAmBN,GACpC,cAAcA,IAAUM,GAAQ,KAAOuB,EAAI,EAAI,KAAO,KAAOvB,CACjE,CAAG,IAGH,MAAM2f,GAAqB,CAAA,EAW3BD,GAAWtP,aAAe,SAAsBwP,EAAWC,EAASlW,GAClE,SAASmW,EAAcC,EAAKC,GAC1B,MAAO,uCAAoDD,EAAM,IAAOC,GAAQrW,EAAU,KAAOA,EAAU,GAC5G,CAGD,MAAO,CAAC9D,EAAOka,EAAKE,KAClB,IAAkB,IAAdL,EACF,MAAM,IAAIlW,EACRoW,EAAcC,EAAK,qBAAuBF,EAAU,OAASA,EAAU,KACvEnW,EAAWwW,gBAef,OAXIL,IAAYF,GAAmBI,KACjCJ,GAAmBI,IAAO,EAE1BI,QAAQC,KACNN,EACEC,EACA,+BAAiCF,EAAU,8CAK1CD,GAAYA,EAAU/Z,EAAOka,EAAKE,EAAY,CAEzD,EAmCA,MAAeL,GAAA,CACbS,cAxBF,SAAuB1U,EAAS2U,EAAQC,GACtC,GAAuB,iBAAZ5U,EACT,MAAM,IAAIjC,EAAW,4BAA6BA,EAAW8W,sBAE/D,MAAM9e,EAAOtC,OAAOsC,KAAKiK,GACzB,IAAIpK,EAAIG,EAAKD,OACb,KAAOF,KAAM,GAAG,CACd,MAAMwe,EAAMre,EAAKH,GACXqe,EAAYU,EAAOP,GACzB,GAAIH,EAAJ,CACE,MAAM/Z,EAAQ8F,EAAQoU,GAChB1b,OAAmBoC,IAAVZ,GAAuB+Z,EAAU/Z,EAAOka,EAAKpU,GAC5D,IAAe,IAAXtH,EACF,MAAM,IAAIqF,EAAW,UAAYqW,EAAM,YAAc1b,EAAQqF,EAAW8W,qBAG3E,MACD,IAAqB,IAAjBD,EACF,MAAM,IAAI7W,EAAW,kBAAoBqW,EAAKrW,EAAW+W,eAE5D,CACH,EAIAf,WAAEA,IC9EIA,GAAaE,GAAUF,WAS7B,MAAMgB,GACJ3c,YAAY4c,GACV7b,KAAKqL,SAAWwQ,EAChB7b,KAAK8b,aAAe,CAClB9W,QAAS,IAAI+W,EACb9W,SAAU,IAAI8W,EAEjB,CAUDC,cAAcC,EAAalX,GACzB,IACE,aAAa/E,KAAKkc,SAASD,EAAalX,EAmBzC,CAlBC,MAAOkS,GACP,GAAIA,aAAenU,MAAO,CACxB,IAAIqZ,EAEJrZ,MAAMoC,kBAAoBpC,MAAMoC,kBAAkBiX,EAAQ,CAAE,GAAKA,EAAQ,IAAIrZ,MAG7E,MAAMsB,EAAQ+X,EAAM/X,MAAQ+X,EAAM/X,MAAM7D,QAAQ,QAAS,IAAM,GAE1D0W,EAAI7S,MAGEA,IAAU1C,OAAOuV,EAAI7S,OAAO7C,SAAS6C,EAAM7D,QAAQ,YAAa,OACzE0W,EAAI7S,OAAS,KAAOA,GAHpB6S,EAAI7S,MAAQA,CAKf,CAED,MAAM6S,CACP,CACF,CAEDiF,SAASD,EAAalX,GAGO,iBAAhBkX,GACTlX,EAASA,GAAU,IACZ2D,IAAMuT,EAEblX,EAASkX,GAAe,GAG1BlX,EAAS2U,GAAY1Z,KAAKqL,SAAUtG,GAEpC,MAAMuG,aAACA,EAAY+L,iBAAEA,EAAgB3L,QAAEA,GAAW3G,OAE7BpD,IAAjB2J,GACFwP,GAAUS,cAAcjQ,EAAc,CACpCzB,kBAAmB+Q,GAAWtP,aAAasP,GAAWwB,SACtDtS,kBAAmB8Q,GAAWtP,aAAasP,GAAWwB,SACtDrS,oBAAqB6Q,GAAWtP,aAAasP,GAAWwB,WACvD,GAGmB,MAApB/E,IACElS,EAAM1J,WAAW4b,GACnBtS,EAAOsS,iBAAmB,CACxBxO,UAAWwO,GAGbyD,GAAUS,cAAclE,EAAkB,CACxCnP,OAAQ0S,GAAWyB,SACnBxT,UAAW+R,GAAWyB,WACrB,IAKPtX,EAAOyI,QAAUzI,EAAOyI,QAAUxN,KAAKqL,SAASmC,QAAU,OAAOxS,cAGjE,IAAIshB,EAAiB5Q,GAAWvG,EAAMrF,MACpC4L,EAAQ4B,OACR5B,EAAQ3G,EAAOyI,SAGjB9B,GAAWvG,EAAM7I,QACf,CAAC,SAAU,MAAO,OAAQ,OAAQ,MAAO,QAAS,WACjDkR,WACQ9B,EAAQ8B,EAAO,IAI1BzI,EAAO2G,QAAUuC,GAAa5H,OAAOiW,EAAgB5Q,GAGrD,MAAM6Q,EAA0B,GAChC,IAAIC,GAAiC,EACrCxc,KAAK8b,aAAa9W,QAAQ1I,SAAQ,SAAoCmgB,GACjC,mBAAxBA,EAAYlT,UAA0D,IAAhCkT,EAAYlT,QAAQxE,KAIrEyX,EAAiCA,GAAkCC,EAAYnT,YAE/EiT,EAAwBG,QAAQD,EAAYrT,UAAWqT,EAAYpT,UACzE,IAEI,MAAMsT,EAA2B,GAKjC,IAAIC,EAJJ5c,KAAK8b,aAAa7W,SAAS3I,SAAQ,SAAkCmgB,GACnEE,EAAyBna,KAAKia,EAAYrT,UAAWqT,EAAYpT,SACvE,IAGI,IACIvM,EADAL,EAAI,EAGR,IAAK+f,EAAgC,CACnC,MAAMK,EAAQ,CAACrD,GAAgBxf,KAAKgG,WAAO2B,GAO3C,IANAkb,EAAMH,QAAQviB,MAAM0iB,EAAON,GAC3BM,EAAMra,KAAKrI,MAAM0iB,EAAOF,GACxB7f,EAAM+f,EAAMlgB,OAEZigB,EAAUnH,QAAQC,QAAQ3Q,GAEnBtI,EAAIK,GACT8f,EAAUA,EAAQlY,KAAKmY,EAAMpgB,KAAMogB,EAAMpgB,MAG3C,OAAOmgB,CACR,CAED9f,EAAMyf,EAAwB5f,OAE9B,IAAImgB,EAAY/X,EAIhB,IAFAtI,EAAI,EAEGA,EAAIK,GAAK,CACd,MAAMigB,EAAcR,EAAwB9f,KACtCugB,EAAaT,EAAwB9f,KAC3C,IACEqgB,EAAYC,EAAYD,EAIzB,CAHC,MAAOlX,GACPoX,EAAWliB,KAAKkF,KAAM4F,GACtB,KACD,CACF,CAED,IACEgX,EAAUpD,GAAgB1e,KAAKkF,KAAM8c,EAGtC,CAFC,MAAOlX,GACP,OAAO6P,QAAQE,OAAO/P,EACvB,CAKD,IAHAnJ,EAAI,EACJK,EAAM6f,EAAyBhgB,OAExBF,EAAIK,GACT8f,EAAUA,EAAQlY,KAAKiY,EAAyBlgB,KAAMkgB,EAAyBlgB,MAGjF,OAAOmgB,CACR,CAEDK,OAAOlY,GAGL,OAAO0D,EADU0J,IADjBpN,EAAS2U,GAAY1Z,KAAKqL,SAAUtG,IACEqN,QAASrN,EAAO2D,KAC5B3D,EAAOwD,OAAQxD,EAAOsS,iBACjD,EAIHlS,EAAM7I,QAAQ,CAAC,SAAU,MAAO,OAAQ,YAAY,SAA6BkR,GAE/EoO,GAAMrhB,UAAUiT,GAAU,SAAS9E,EAAK3D,GACtC,OAAO/E,KAAKgF,QAAQ0U,GAAY3U,GAAU,CAAA,EAAI,CAC5CyI,SACA9E,MACA+C,MAAO1G,GAAU,CAAA,GAAI0G,OAE3B,CACA,IAEAtG,EAAM7I,QAAQ,CAAC,OAAQ,MAAO,UAAU,SAA+BkR,GAGrE,SAAS0P,EAAmBC,GAC1B,OAAO,SAAoBzU,EAAK+C,EAAM1G,GACpC,OAAO/E,KAAKgF,QAAQ0U,GAAY3U,GAAU,CAAA,EAAI,CAC5CyI,SACA9B,QAASyR,EAAS,CAChB,eAAgB,uBACd,CAAE,EACNzU,MACA+C,SAER,CACG,CAEDmQ,GAAMrhB,UAAUiT,GAAU0P,IAE1BtB,GAAMrhB,UAAUiT,EAAS,QAAU0P,GAAmB,EACxD,IAEA,MAAAE,GAAexB,GCrNf,MAAMyB,GACJpe,YAAYqe,GACV,GAAwB,mBAAbA,EACT,MAAM,IAAIxW,UAAU,gCAGtB,IAAIyW,EAEJvd,KAAK4c,QAAU,IAAInH,SAAQ,SAAyBC,GAClD6H,EAAiB7H,CACvB,IAEI,MAAMnP,EAAQvG,KAGdA,KAAK4c,QAAQlY,MAAK8T,IAChB,IAAKjS,EAAMiX,WAAY,OAEvB,IAAI/gB,EAAI8J,EAAMiX,WAAW7gB,OAEzB,KAAOF,KAAM,GACX8J,EAAMiX,WAAW/gB,GAAG+b,GAEtBjS,EAAMiX,WAAa,IAAI,IAIzBxd,KAAK4c,QAAQlY,KAAO+Y,IAClB,IAAIC,EAEJ,MAAMd,EAAU,IAAInH,SAAQC,IAC1BnP,EAAMmS,UAAUhD,GAChBgI,EAAWhI,CAAO,IACjBhR,KAAK+Y,GAMR,OAJAb,EAAQpE,OAAS,WACfjS,EAAM0P,YAAYyH,EAC1B,EAEad,CAAO,EAGhBU,GAAS,SAAgBzY,EAASE,EAAQC,GACpCuB,EAAMwS,SAKVxS,EAAMwS,OAAS,IAAI3H,GAAcvM,EAASE,EAAQC,GAClDuY,EAAehX,EAAMwS,QAC3B,GACG,CAKDQ,mBACE,GAAIvZ,KAAK+Y,OACP,MAAM/Y,KAAK+Y,MAEd,CAMDL,UAAU9E,GACJ5T,KAAK+Y,OACPnF,EAAS5T,KAAK+Y,QAIZ/Y,KAAKwd,WACPxd,KAAKwd,WAAWhb,KAAKoR,GAErB5T,KAAKwd,WAAa,CAAC5J,EAEtB,CAMDqC,YAAYrC,GACV,IAAK5T,KAAKwd,WACR,OAEF,MAAM1V,EAAQ9H,KAAKwd,WAAW3b,QAAQ+R,IACvB,IAAX9L,GACF9H,KAAKwd,WAAWG,OAAO7V,EAAO,EAEjC,CAMDkI,gBACE,IAAIwI,EAIJ,MAAO,CACLjS,MAJY,IAAI8W,IAAY,SAAkBO,GAC9CpF,EAASoF,CACf,IAGMpF,SAEH,EAGH,MAAAqF,GAAeR,GCxHf,MAAMS,GAAiB,CACrBC,SAAU,IACVC,mBAAoB,IACpBC,WAAY,IACZC,WAAY,IACZC,GAAI,IACJC,QAAS,IACTC,SAAU,IACVC,4BAA6B,IAC7BC,UAAW,IACXC,aAAc,IACdC,eAAgB,IAChBC,YAAa,IACbC,gBAAiB,IACjBC,OAAQ,IACRC,gBAAiB,IACjBC,iBAAkB,IAClBC,MAAO,IACPC,SAAU,IACVC,YAAa,IACbC,SAAU,IACVC,OAAQ,IACRC,kBAAmB,IACnBC,kBAAmB,IACnBC,WAAY,IACZC,aAAc,IACdC,gBAAiB,IACjBC,UAAW,IACXC,SAAU,IACVC,iBAAkB,IAClBC,cAAe,IACfC,4BAA6B,IAC7BC,eAAgB,IAChBC,SAAU,IACVC,KAAM,IACNC,eAAgB,IAChBC,mBAAoB,IACpBC,gBAAiB,IACjBC,WAAY,IACZC,qBAAsB,IACtBC,oBAAqB,IACrBC,kBAAmB,IACnBC,UAAW,IACXC,mBAAoB,IACpBC,oBAAqB,IACrBC,OAAQ,IACRC,iBAAkB,IAClBC,SAAU,IACVC,gBAAiB,IACjBC,qBAAsB,IACtBC,gBAAiB,IACjBC,4BAA6B,IAC7BC,2BAA4B,IAC5BC,oBAAqB,IACrBC,eAAgB,IAChBC,WAAY,IACZC,mBAAoB,IACpBC,eAAgB,IAChBC,wBAAyB,IACzBC,sBAAuB,IACvBC,oBAAqB,IACrBC,aAAc,IACdC,YAAa,IACbC,8BAA+B,KAGjCvnB,OAAO6Q,QAAQ2S,IAAgBxhB,SAAQ,EAAES,EAAKgE,MAC5C+c,GAAe/c,GAAShE,CAAG,IAG7B,MAAA+kB,GAAehE,GCxBf,MAAMiE,GAnBN,SAASC,EAAeC,GACtB,MAAMzkB,EAAU,IAAIoe,GAAMqG,GACpBC,EAAWloB,EAAK4hB,GAAMrhB,UAAUyK,QAASxH,GAa/C,OAVA2H,EAAMhF,OAAO+hB,EAAUtG,GAAMrhB,UAAWiD,EAAS,CAAChB,YAAY,IAG9D2I,EAAMhF,OAAO+hB,EAAU1kB,EAAS,KAAM,CAAChB,YAAY,IAGnD0lB,EAASvnB,OAAS,SAAgBkhB,GAChC,OAAOmG,EAAetI,GAAYuI,EAAepG,GACrD,EAESqG,CACT,CAGcF,CAAe3W,IAG7B0W,GAAMnG,MAAQA,GAGdmG,GAAM3Q,cAAgBA,GACtB2Q,GAAM1E,YAAcA,GACpB0E,GAAM7Q,SAAWA,GACjB6Q,GAAMI,QLvDiB,QKwDvBJ,GAAMpb,WAAaA,EAGnBob,GAAMnd,WAAaA,EAGnBmd,GAAMK,OAASL,GAAM3Q,cAGrB2Q,GAAMM,IAAM,SAAaC,GACvB,OAAO7M,QAAQ4M,IAAIC,EACrB,EAEAP,GAAMQ,OC9CS,SAAgBC,GAC7B,OAAO,SAAczgB,GACnB,OAAOygB,EAASroB,MAAM,KAAM4H,EAChC,CACA,ED6CAggB,GAAMU,aE7DS,SAAsBC,GACnC,OAAOvd,EAAMxJ,SAAS+mB,KAAsC,IAAzBA,EAAQD,YAC7C,EF8DAV,GAAMrI,YAAcA,GAEpBqI,GAAM9T,aAAeA,GAErB8T,GAAMY,WAAa/nB,GAASkQ,GAAe3F,EAAMvH,WAAWhD,GAAS,IAAIwE,SAASxE,GAASA,GAE3FmnB,GAAMa,WAAa3J,GAEnB8I,GAAMjE,eAAiBA,GAEvBiE,GAAMc,QAAUd,GAGhB,MAAee,GAAAf,IGnFTnG,MACJA,GAAKhX,WACLA,GAAUwM,cACVA,GAAaF,SACbA,GAAQmM,YACRA,GAAW8E,QACXA,GAAOE,IACPA,GAAGD,OACHA,GAAMK,aACNA,GAAYF,OACZA,GAAM5b,WACNA,GAAUsH,aACVA,GAAY6P,eACZA,GAAc6E,WACdA,GAAUC,WACVA,GAAUlJ,YACVA,IACEqI"} \ No newline at end of file diff --git a/node_modules/axios/dist/node/axios.cjs b/node_modules/axios/dist/node/axios.cjs new file mode 100644 index 00000000..9099d870 --- /dev/null +++ b/node_modules/axios/dist/node/axios.cjs @@ -0,0 +1,4355 @@ +// Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors +'use strict'; + +const FormData$1 = require('form-data'); +const url = require('url'); +const proxyFromEnv = require('proxy-from-env'); +const http = require('http'); +const https = require('https'); +const util = require('util'); +const followRedirects = require('follow-redirects'); +const zlib = require('zlib'); +const stream = require('stream'); +const EventEmitter = require('events'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1); +const url__default = /*#__PURE__*/_interopDefaultLegacy(url); +const http__default = /*#__PURE__*/_interopDefaultLegacy(http); +const https__default = /*#__PURE__*/_interopDefaultLegacy(https); +const util__default = /*#__PURE__*/_interopDefaultLegacy(util); +const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects); +const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); +const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream); +const EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter); + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +}; + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +}; + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +}; + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + }; + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +}; + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +}; + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +}; + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +}; + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +}; + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +}; + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +}; + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + }; + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +}; + +const noop = () => {}; + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +}; + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +}; + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0]; + } + + return str; +}; + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + }; + + return visit(obj, 0); +}; + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); + +const utils$1 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable +}; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +utils$1.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype$1 = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype$1, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData__default["default"] || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils$1.isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils$1.isArray(value) && isFlatArray(value)) || + ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils$1.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils$1.forEach(value, function each(el, key) { + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( + formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode$1(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +const InterceptorManager$1 = InterceptorManager; + +const transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; + +const URLSearchParams = url__default["default"].URLSearchParams; + +const platform$1 = { + isNode: true, + classes: { + URLSearchParams, + FormData: FormData__default["default"], + Blob: typeof Blob !== 'undefined' && Blob || null + }, + protocols: [ 'http', 'https', 'file', 'data' ] +}; + +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = ( + (product) => { + return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 + })(typeof navigator !== 'undefined' && navigator.product); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +const utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv +}); + +const platform = { + ...utils, + ...platform$1 +}; + +function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + const obj = {}; + + utils$1.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils$1.isObject(data); + + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils$1.isFormData(data); + + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (utils$1.isArrayBuffer(data) || + utils$1.isBuffer(data) || + utils$1.isStream(data) || + utils$1.isFile(data) || + utils$1.isBlob(data) + ) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } +}; + +utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +const defaults$1 = defaults; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils$1.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +const parseHeaders = rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils$1.isString(value)) return; + + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils$1.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils$1.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + } +}); + +utils$1.freezeMethods(AxiosHeaders); + +const AxiosHeaders$1 = AxiosHeaders; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || defaults$1; + const context = response || config; + const headers = AxiosHeaders$1.from(context.headers); + let data = context.data; + + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils$1.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +const VERSION = "1.6.7"; + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + +const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; + +/** + * Parse data uri to a Buffer or Blob + * + * @param {String} uri + * @param {?Boolean} asBlob + * @param {?Object} options + * @param {?Function} options.Blob + * + * @returns {Buffer|Blob} + */ +function fromDataURI(uri, asBlob, options) { + const _Blob = options && options.Blob || platform.classes.Blob; + const protocol = parseProtocol(uri); + + if (asBlob === undefined && _Blob) { + asBlob = true; + } + + if (protocol === 'data') { + uri = protocol.length ? uri.slice(protocol.length + 1) : uri; + + const match = DATA_URL_PATTERN.exec(uri); + + if (!match) { + throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL); + } + + const mime = match[1]; + const isBase64 = match[2]; + const body = match[3]; + const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8'); + + if (asBlob) { + if (!_Blob) { + throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT); + } + + return new _Blob([buffer], {type: mime}); + } + + return buffer; + } + + throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT); +} + +/** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ +function throttle(fn, freq) { + let timestamp = 0; + const threshold = 1000 / freq; + let timer = null; + return function throttled(force, args) { + const now = Date.now(); + if (force || now - timestamp > threshold) { + if (timer) { + clearTimeout(timer); + timer = null; + } + timestamp = now; + return fn.apply(null, args); + } + if (!timer) { + timer = setTimeout(() => { + timer = null; + timestamp = Date.now(); + return fn.apply(null, args); + }, threshold - (now - timestamp)); + } + }; +} + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +const kInternals = Symbol('internals'); + +class AxiosTransformStream extends stream__default["default"].Transform{ + constructor(options) { + options = utils$1.toFlatObject(options, { + maxRate: 0, + chunkSize: 64 * 1024, + minChunkSize: 100, + timeWindow: 500, + ticksRate: 2, + samplesCount: 15 + }, null, (prop, source) => { + return !utils$1.isUndefined(source[prop]); + }); + + super({ + readableHighWaterMark: options.chunkSize + }); + + const self = this; + + const internals = this[kInternals] = { + length: options.length, + timeWindow: options.timeWindow, + ticksRate: options.ticksRate, + chunkSize: options.chunkSize, + maxRate: options.maxRate, + minChunkSize: options.minChunkSize, + bytesSeen: 0, + isCaptured: false, + notifiedBytesLoaded: 0, + ts: Date.now(), + bytes: 0, + onReadCallback: null + }; + + const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow); + + this.on('newListener', event => { + if (event === 'progress') { + if (!internals.isCaptured) { + internals.isCaptured = true; + } + } + }); + + let bytesNotified = 0; + + internals.updateProgress = throttle(function throttledHandler() { + const totalBytes = internals.length; + const bytesTransferred = internals.bytesSeen; + const progressBytes = bytesTransferred - bytesNotified; + if (!progressBytes || self.destroyed) return; + + const rate = _speedometer(progressBytes); + + bytesNotified = bytesTransferred; + + process.nextTick(() => { + self.emit('progress', { + 'loaded': bytesTransferred, + 'total': totalBytes, + 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined, + 'bytes': progressBytes, + 'rate': rate ? rate : undefined, + 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ? + (totalBytes - bytesTransferred) / rate : undefined + }); + }); + }, internals.ticksRate); + + const onFinish = () => { + internals.updateProgress(true); + }; + + this.once('end', onFinish); + this.once('error', onFinish); + } + + _read(size) { + const internals = this[kInternals]; + + if (internals.onReadCallback) { + internals.onReadCallback(); + } + + return super._read(size); + } + + _transform(chunk, encoding, callback) { + const self = this; + const internals = this[kInternals]; + const maxRate = internals.maxRate; + + const readableHighWaterMark = this.readableHighWaterMark; + + const timeWindow = internals.timeWindow; + + const divider = 1000 / timeWindow; + const bytesThreshold = (maxRate / divider); + const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; + + function pushChunk(_chunk, _callback) { + const bytes = Buffer.byteLength(_chunk); + internals.bytesSeen += bytes; + internals.bytes += bytes; + + if (internals.isCaptured) { + internals.updateProgress(); + } + + if (self.push(_chunk)) { + process.nextTick(_callback); + } else { + internals.onReadCallback = () => { + internals.onReadCallback = null; + process.nextTick(_callback); + }; + } + } + + const transformChunk = (_chunk, _callback) => { + const chunkSize = Buffer.byteLength(_chunk); + let chunkRemainder = null; + let maxChunkSize = readableHighWaterMark; + let bytesLeft; + let passed = 0; + + if (maxRate) { + const now = Date.now(); + + if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) { + internals.ts = now; + bytesLeft = bytesThreshold - internals.bytes; + internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; + passed = 0; + } + + bytesLeft = bytesThreshold - internals.bytes; + } + + if (maxRate) { + if (bytesLeft <= 0) { + // next time window + return setTimeout(() => { + _callback(null, _chunk); + }, timeWindow - passed); + } + + if (bytesLeft < maxChunkSize) { + maxChunkSize = bytesLeft; + } + } + + if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) { + chunkRemainder = _chunk.subarray(maxChunkSize); + _chunk = _chunk.subarray(0, maxChunkSize); + } + + pushChunk(_chunk, chunkRemainder ? () => { + process.nextTick(_callback, null, chunkRemainder); + } : _callback); + }; + + transformChunk(chunk, function transformNextChunk(err, _chunk) { + if (err) { + return callback(err); + } + + if (_chunk) { + transformChunk(_chunk, transformNextChunk); + } else { + callback(null); + } + }); + } + + setLength(length) { + this[kInternals].length = +length; + return this; + } +} + +const AxiosTransformStream$1 = AxiosTransformStream; + +const {asyncIterator} = Symbol; + +const readBlob = async function* (blob) { + if (blob.stream) { + yield* blob.stream(); + } else if (blob.arrayBuffer) { + yield await blob.arrayBuffer(); + } else if (blob[asyncIterator]) { + yield* blob[asyncIterator](); + } else { + yield blob; + } +}; + +const readBlob$1 = readBlob; + +const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_'; + +const textEncoder = new util.TextEncoder(); + +const CRLF = '\r\n'; +const CRLF_BYTES = textEncoder.encode(CRLF); +const CRLF_BYTES_COUNT = 2; + +class FormDataPart { + constructor(name, value) { + const {escapeName} = this.constructor; + const isStringValue = utils$1.isString(value); + + let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${ + !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : '' + }${CRLF}`; + + if (isStringValue) { + value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); + } else { + headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; + } + + this.headers = textEncoder.encode(headers + CRLF); + + this.contentLength = isStringValue ? value.byteLength : value.size; + + this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; + + this.name = name; + this.value = value; + } + + async *encode(){ + yield this.headers; + + const {value} = this; + + if(utils$1.isTypedArray(value)) { + yield value; + } else { + yield* readBlob$1(value); + } + + yield CRLF_BYTES; + } + + static escapeName(name) { + return String(name).replace(/[\r\n"]/g, (match) => ({ + '\r' : '%0D', + '\n' : '%0A', + '"' : '%22', + }[match])); + } +} + +const formDataToStream = (form, headersHandler, options) => { + const { + tag = 'form-data-boundary', + size = 25, + boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET) + } = options || {}; + + if(!utils$1.isFormData(form)) { + throw TypeError('FormData instance required'); + } + + if (boundary.length < 1 || boundary.length > 70) { + throw Error('boundary must be 10-70 characters long') + } + + const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); + const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF); + let contentLength = footerBytes.byteLength; + + const parts = Array.from(form.entries()).map(([name, value]) => { + const part = new FormDataPart(name, value); + contentLength += part.size; + return part; + }); + + contentLength += boundaryBytes.byteLength * parts.length; + + contentLength = utils$1.toFiniteNumber(contentLength); + + const computedHeaders = { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }; + + if (Number.isFinite(contentLength)) { + computedHeaders['Content-Length'] = contentLength; + } + + headersHandler && headersHandler(computedHeaders); + + return stream.Readable.from((async function *() { + for(const part of parts) { + yield boundaryBytes; + yield* part.encode(); + } + + yield footerBytes; + })()); +}; + +const formDataToStream$1 = formDataToStream; + +class ZlibHeaderTransformStream extends stream__default["default"].Transform { + __transform(chunk, encoding, callback) { + this.push(chunk); + callback(); + } + + _transform(chunk, encoding, callback) { + if (chunk.length !== 0) { + this._transform = this.__transform; + + // Add Default Compression headers if no zlib headers are present + if (chunk[0] !== 120) { // Hex: 78 + const header = Buffer.alloc(2); + header[0] = 120; // Hex: 78 + header[1] = 156; // Hex: 9C + this.push(header, encoding); + } + } + + this.__transform(chunk, encoding, callback); + } +} + +const ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream; + +const callbackify = (fn, reducer) => { + return utils$1.isAsyncFn(fn) ? function (...args) { + const cb = args.pop(); + fn.apply(this, args).then((value) => { + try { + reducer ? cb(null, ...reducer(value)) : cb(null, value); + } catch (err) { + cb(err); + } + }, cb); + } : fn; +}; + +const callbackify$1 = callbackify; + +const zlibOptions = { + flush: zlib__default["default"].constants.Z_SYNC_FLUSH, + finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH +}; + +const brotliOptions = { + flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH, + finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH +}; + +const isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress); + +const {http: httpFollow, https: httpsFollow} = followRedirects__default["default"]; + +const isHttps = /https:?/; + +const supportedProtocols = platform.protocols.map(protocol => { + return protocol + ':'; +}); + +/** + * If the proxy or config beforeRedirects functions are defined, call them with the options + * object. + * + * @param {Object} options - The options object that was passed to the request. + * + * @returns {Object} + */ +function dispatchBeforeRedirect(options, responseDetails) { + if (options.beforeRedirects.proxy) { + options.beforeRedirects.proxy(options); + } + if (options.beforeRedirects.config) { + options.beforeRedirects.config(options, responseDetails); + } +} + +/** + * If the proxy or config afterRedirects functions are defined, call them with the options + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} configProxy configuration from Axios options object + * @param {string} location + * + * @returns {http.ClientRequestArgs} + */ +function setProxy(options, configProxy, location) { + let proxy = configProxy; + if (!proxy && proxy !== false) { + const proxyUrl = proxyFromEnv.getProxyForUrl(location); + if (proxyUrl) { + proxy = new URL(proxyUrl); + } + } + if (proxy) { + // Basic proxy authorization + if (proxy.username) { + proxy.auth = (proxy.username || '') + ':' + (proxy.password || ''); + } + + if (proxy.auth) { + // Support proxy auth object form + if (proxy.auth.username || proxy.auth.password) { + proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || ''); + } + const base64 = Buffer + .from(proxy.auth, 'utf8') + .toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); + const proxyHost = proxy.hostname || proxy.host; + options.hostname = proxyHost; + // Replace 'host' since options is not a URL object + options.host = proxyHost; + options.port = proxy.port; + options.path = location; + if (proxy.protocol) { + options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`; + } + } + + options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { + // Configure proxy for redirected request, passing the original config proxy to apply + // the exact same logic as if the redirected request was performed by axios directly. + setProxy(redirectOptions, configProxy, redirectOptions.href); + }; +} + +const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process'; + +// temporary hotfix + +const wrapAsync = (asyncExecutor) => { + return new Promise((resolve, reject) => { + let onDone; + let isDone; + + const done = (value, isRejected) => { + if (isDone) return; + isDone = true; + onDone && onDone(value, isRejected); + }; + + const _resolve = (value) => { + done(value); + resolve(value); + }; + + const _reject = (reason) => { + done(reason, true); + reject(reason); + }; + + asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject); + }) +}; + +const resolveFamily = ({address, family}) => { + if (!utils$1.isString(address)) { + throw TypeError('address must be a string'); + } + return ({ + address, + family: family || (address.indexOf('.') < 0 ? 6 : 4) + }); +}; + +const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family}); + +/*eslint consistent-return:0*/ +const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { + return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { + let {data, lookup, family} = config; + const {responseType, responseEncoding} = config; + const method = config.method.toUpperCase(); + let isDone; + let rejected = false; + let req; + + if (lookup) { + const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]); + // hotfix to support opt.all option which is required for node 20.x + lookup = (hostname, opt, cb) => { + _lookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + + const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; + + opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); + }); + }; + } + + // temporary internal emitter until the AxiosRequest class will be implemented + const emitter = new EventEmitter__default["default"](); + + const onFinished = () => { + if (config.cancelToken) { + config.cancelToken.unsubscribe(abort); + } + + if (config.signal) { + config.signal.removeEventListener('abort', abort); + } + + emitter.removeAllListeners(); + }; + + onDone((value, isRejected) => { + isDone = true; + if (isRejected) { + rejected = true; + onFinished(); + } + }); + + function abort(reason) { + emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason); + } + + emitter.once('abort', reject); + + if (config.cancelToken || config.signal) { + config.cancelToken && config.cancelToken.subscribe(abort); + if (config.signal) { + config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); + } + } + + // Parse url + const fullPath = buildFullPath(config.baseURL, config.url); + const parsed = new URL(fullPath, 'http://localhost'); + const protocol = parsed.protocol || supportedProtocols[0]; + + if (protocol === 'data:') { + let convertedData; + + if (method !== 'GET') { + return settle(resolve, reject, { + status: 405, + statusText: 'method not allowed', + headers: {}, + config + }); + } + + try { + convertedData = fromDataURI(config.url, responseType === 'blob', { + Blob: config.env && config.env.Blob + }); + } catch (err) { + throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); + } + + if (responseType === 'text') { + convertedData = convertedData.toString(responseEncoding); + + if (!responseEncoding || responseEncoding === 'utf8') { + convertedData = utils$1.stripBOM(convertedData); + } + } else if (responseType === 'stream') { + convertedData = stream__default["default"].Readable.from(convertedData); + } + + return settle(resolve, reject, { + data: convertedData, + status: 200, + statusText: 'OK', + headers: new AxiosHeaders$1(), + config + }); + } + + if (supportedProtocols.indexOf(protocol) === -1) { + return reject(new AxiosError( + 'Unsupported protocol ' + protocol, + AxiosError.ERR_BAD_REQUEST, + config + )); + } + + const headers = AxiosHeaders$1.from(config.headers).normalize(); + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + // User-Agent is specified; handle case where no UA header is desired + // Only set header if it hasn't been set in config + headers.set('User-Agent', 'axios/' + VERSION, false); + + const onDownloadProgress = config.onDownloadProgress; + const onUploadProgress = config.onUploadProgress; + const maxRate = config.maxRate; + let maxUploadRate = undefined; + let maxDownloadRate = undefined; + + // support for spec compliant FormData objects + if (utils$1.isSpecCompliantForm(data)) { + const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); + + data = formDataToStream$1(data, (formHeaders) => { + headers.set(formHeaders); + }, { + tag: `axios-${VERSION}-boundary`, + boundary: userBoundary && userBoundary[1] || undefined + }); + // support for https://www.npmjs.com/package/form-data api + } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) { + headers.set(data.getHeaders()); + + if (!headers.hasContentLength()) { + try { + const knownLength = await util__default["default"].promisify(data.getLength).call(data); + Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); + /*eslint no-empty:0*/ + } catch (e) { + } + } + } else if (utils$1.isBlob(data)) { + data.size && headers.setContentType(data.type || 'application/octet-stream'); + headers.setContentLength(data.size || 0); + data = stream__default["default"].Readable.from(readBlob$1(data)); + } else if (data && !utils$1.isStream(data)) { + if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils$1.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(new AxiosError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + AxiosError.ERR_BAD_REQUEST, + config + )); + } + + // Add Content-Length header if data exists + headers.setContentLength(data.length, false); + + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(new AxiosError( + 'Request body larger than maxBodyLength limit', + AxiosError.ERR_BAD_REQUEST, + config + )); + } + } + + const contentLength = utils$1.toFiniteNumber(headers.getContentLength()); + + if (utils$1.isArray(maxRate)) { + maxUploadRate = maxRate[0]; + maxDownloadRate = maxRate[1]; + } else { + maxUploadRate = maxDownloadRate = maxRate; + } + + if (data && (onUploadProgress || maxUploadRate)) { + if (!utils$1.isStream(data)) { + data = stream__default["default"].Readable.from(data, {objectMode: false}); + } + + data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({ + length: contentLength, + maxRate: utils$1.toFiniteNumber(maxUploadRate) + })], utils$1.noop); + + onUploadProgress && data.on('progress', progress => { + onUploadProgress(Object.assign(progress, { + upload: true + })); + }); + } + + // HTTP basic authentication + let auth = undefined; + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password || ''; + auth = username + ':' + password; + } + + if (!auth && parsed.username) { + const urlUsername = parsed.username; + const urlPassword = parsed.password; + auth = urlUsername + ':' + urlPassword; + } + + auth && headers.delete('authorization'); + + let path; + + try { + path = buildURL( + parsed.pathname + parsed.search, + config.params, + config.paramsSerializer + ).replace(/^\?/, ''); + } catch (err) { + const customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + return reject(customErr); + } + + headers.set( + 'Accept-Encoding', + 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false + ); + + const options = { + path, + method: method, + headers: headers.toJSON(), + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth, + protocol, + family, + beforeRedirect: dispatchBeforeRedirect, + beforeRedirects: {} + }; + + // cacheable-lookup integration hotfix + !utils$1.isUndefined(lookup) && (options.lookup = lookup); + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + let transport; + const isHttpsRequest = isHttps.test(options.protocol); + options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsRequest ? https__default["default"] : http__default["default"]; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + if (config.beforeRedirect) { + options.beforeRedirects.config = config.beforeRedirect; + } + transport = isHttpsRequest ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } else { + // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited + options.maxBodyLength = Infinity; + } + + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } + + // Create the request + req = transport.request(options, function handleResponse(res) { + if (req.destroyed) return; + + const streams = [res]; + + const responseLength = +res.headers['content-length']; + + if (onDownloadProgress) { + const transformStream = new AxiosTransformStream$1({ + length: utils$1.toFiniteNumber(responseLength), + maxRate: utils$1.toFiniteNumber(maxDownloadRate) + }); + + onDownloadProgress && transformStream.on('progress', progress => { + onDownloadProgress(Object.assign(progress, { + download: true + })); + }); + + streams.push(transformStream); + } + + // decompress the response body transparently if required + let responseStream = res; + + // return the last request in case of redirects + const lastRequest = res.req || req; + + // if decompress disabled we should not decompress + if (config.decompress !== false && res.headers['content-encoding']) { + // if no content, but headers still say that it is encoded, + // remove the header not confuse downstream operations + if (method === 'HEAD' || res.statusCode === 204) { + delete res.headers['content-encoding']; + } + + switch ((res.headers['content-encoding'] || '').toLowerCase()) { + /*eslint default-case:0*/ + case 'gzip': + case 'x-gzip': + case 'compress': + case 'x-compress': + // add the unzipper to the body stream processing pipeline + streams.push(zlib__default["default"].createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'deflate': + streams.push(new ZlibHeaderTransformStream$1()); + + // add the unzipper to the body stream processing pipeline + streams.push(zlib__default["default"].createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'br': + if (isBrotliSupported) { + streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions)); + delete res.headers['content-encoding']; + } + } + } + + responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0]; + + const offListeners = stream__default["default"].finished(responseStream, () => { + offListeners(); + onFinished(); + }); + + const response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: new AxiosHeaders$1(res.headers), + config, + request: lastRequest + }; + + if (responseType === 'stream') { + response.data = responseStream; + settle(resolve, reject, response); + } else { + const responseBuffer = []; + let totalResponseBytes = 0; + + responseStream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + // stream.destroy() emit aborted event before calling reject() on Node.js v16 + rejected = true; + responseStream.destroy(); + reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + } + }); + + responseStream.on('aborted', function handlerStreamAborted() { + if (rejected) { + return; + } + + const err = new AxiosError( + 'maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + ); + responseStream.destroy(err); + reject(err); + }); + + responseStream.on('error', function handleStreamError(err) { + if (req.destroyed) return; + reject(AxiosError.from(err, null, config, lastRequest)); + }); + + responseStream.on('end', function handleStreamEnd() { + try { + let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (responseType !== 'arraybuffer') { + responseData = responseData.toString(responseEncoding); + if (!responseEncoding || responseEncoding === 'utf8') { + responseData = utils$1.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + return reject(AxiosError.from(err, null, config, response.request, response)); + } + settle(resolve, reject, response); + }); + } + + emitter.once('abort', err => { + if (!responseStream.destroyed) { + responseStream.emit('error', err); + responseStream.destroy(); + } + }); + }); + + emitter.once('abort', err => { + reject(err); + req.destroy(err); + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + // @todo remove + // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; + reject(AxiosError.from(err, null, config, req)); + }); + + // set tcp keep alive to prevent drop connection by peer + req.on('socket', function handleRequestSocket(socket) { + // default interval of sending ack packet is 1 minute + socket.setKeepAlive(true, 1000 * 60); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + const timeout = parseInt(config.timeout, 10); + + if (Number.isNaN(timeout)) { + reject(new AxiosError( + 'error trying to parse `config.timeout` to int', + AxiosError.ERR_BAD_OPTION_VALUE, + config, + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devouring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + if (isDone) return; + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + req + )); + abort(); + }); + } + + + // Send the request + if (utils$1.isStream(data)) { + let ended = false; + let errored = false; + + data.on('end', () => { + ended = true; + }); + + data.once('error', err => { + errored = true; + req.destroy(err); + }); + + data.on('close', () => { + if (!ended && !errored) { + abort(new CanceledError('Request stream has been aborted', config, req)); + } + }); + + data.pipe(req); + } else { + req.end(data); + } + }); +}; + +const cookies = platform.hasStandardBrowserEnv ? + + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure) { + const cookie = [name + '=' + encodeURIComponent(value)]; + + utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); + + utils$1.isString(path) && cookie.push('path=' + path); + + utils$1.isString(domain) && cookie.push('domain=' + domain); + + secure === true && cookie.push('secure'); + + document.cookie = cookie.join('; '); + }, + + read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000); + } + } + + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + +const isURLSameOrigin = platform.hasStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover its components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })(); + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +const xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = AxiosHeaders$1.from(config.headers).normalize(); + let {responseType, withXSRFToken} = config; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + let contentType; + + if (utils$1.isFormData(requestData)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + requestHeaders.setContentType(false); // Let the browser set it + } else if ((contentType = requestHeaders.getContentType()) !== false) { + // fix semicolon duplication issue for ReactNative FormData implementation + const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; + requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); + } + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = buildFullPath(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders$1.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if(platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) { + // Add xsrf header + const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(fullPath); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}; + +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter +}; + +utils$1.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +const renderReason = (reason) => `- ${reason}`; + +const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; + +const adapters = { + getAdapter: (adapters) => { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; + } + + if (!adapter) { + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; + }, + adapters: knownAdapters +}; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders$1.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders$1.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + +const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({caseless}, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + +const validators$1 = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators$1[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} + +const validator = { + assertOptions, + validators: validators$1 +}; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy; + + Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack; + } + } + + throw err; + } + } + + _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils$1.merge( + headers.common, + headers[config.method] + ); + + headers && utils$1.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +const Axios$1 = Axios; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +const CancelToken$1 = CancelToken; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return utils$1.isObject(payload) && (payload.isAxiosError === true); +} + +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +const HttpStatusCode$1 = HttpStatusCode; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios$1(defaultConfig); + const instance = bind(Axios$1.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils$1.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults$1); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios$1; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken$1; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; + +// Expose AxiosError class +axios.AxiosError = AxiosError; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig; + +axios.AxiosHeaders = AxiosHeaders$1; + +axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode$1; + +axios.default = axios; + +module.exports = axios; +//# sourceMappingURL=axios.cjs.map diff --git a/node_modules/axios/dist/node/axios.cjs.map b/node_modules/axios/dist/node/axios.cjs.map new file mode 100644 index 00000000..ab531c83 --- /dev/null +++ b/node_modules/axios/dist/node/axios.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.cjs","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/node/classes/URLSearchParams.js","../../lib/platform/node/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/env/data.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/fromDataURI.js","../../lib/helpers/throttle.js","../../lib/helpers/speedometer.js","../../lib/helpers/AxiosTransformStream.js","../../lib/helpers/readBlob.js","../../lib/helpers/formDataToStream.js","../../lib/helpers/ZlibHeaderTransformStream.js","../../lib/helpers/callbackify.js","../../lib/adapters/http.js","../../lib/helpers/cookies.js","../../lib/helpers/isURLSameOrigin.js","../../lib/adapters/xhr.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/core/mergeConfig.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js"],"sourcesContent":["'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport url from 'url';\nexport default url.URLSearchParams;\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\n\nexport default {\n isNode: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob: typeof Blob !== 'undefined' && Blob || null\n },\n protocols: [ 'http', 'https', 'file', 'data' ]\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","export const VERSION = \"1.6.7\";","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport parseProtocol from './parseProtocol.js';\nimport platform from '../platform/index.js';\n\nconst DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\\s\\S]*)$/;\n\n/**\n * Parse data uri to a Buffer or Blob\n *\n * @param {String} uri\n * @param {?Boolean} asBlob\n * @param {?Object} options\n * @param {?Function} options.Blob\n *\n * @returns {Buffer|Blob}\n */\nexport default function fromDataURI(uri, asBlob, options) {\n const _Blob = options && options.Blob || platform.classes.Blob;\n const protocol = parseProtocol(uri);\n\n if (asBlob === undefined && _Blob) {\n asBlob = true;\n }\n\n if (protocol === 'data') {\n uri = protocol.length ? uri.slice(protocol.length + 1) : uri;\n\n const match = DATA_URL_PATTERN.exec(uri);\n\n if (!match) {\n throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);\n }\n\n const mime = match[1];\n const isBase64 = match[2];\n const body = match[3];\n const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');\n\n if (asBlob) {\n if (!_Blob) {\n throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);\n }\n\n return new _Blob([buffer], {type: mime});\n }\n\n return buffer;\n }\n\n throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);\n}\n","'use strict';\n\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n const threshold = 1000 / freq;\n let timer = null;\n return function throttled(force, args) {\n const now = Date.now();\n if (force || now - timestamp > threshold) {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n timestamp = now;\n return fn.apply(null, args);\n }\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n timestamp = Date.now();\n return fn.apply(null, args);\n }, threshold - (now - timestamp));\n }\n };\n}\n\nexport default throttle;\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport stream from 'stream';\nimport utils from '../utils.js';\nimport throttle from './throttle.js';\nimport speedometer from './speedometer.js';\n\nconst kInternals = Symbol('internals');\n\nclass AxiosTransformStream extends stream.Transform{\n constructor(options) {\n options = utils.toFlatObject(options, {\n maxRate: 0,\n chunkSize: 64 * 1024,\n minChunkSize: 100,\n timeWindow: 500,\n ticksRate: 2,\n samplesCount: 15\n }, null, (prop, source) => {\n return !utils.isUndefined(source[prop]);\n });\n\n super({\n readableHighWaterMark: options.chunkSize\n });\n\n const self = this;\n\n const internals = this[kInternals] = {\n length: options.length,\n timeWindow: options.timeWindow,\n ticksRate: options.ticksRate,\n chunkSize: options.chunkSize,\n maxRate: options.maxRate,\n minChunkSize: options.minChunkSize,\n bytesSeen: 0,\n isCaptured: false,\n notifiedBytesLoaded: 0,\n ts: Date.now(),\n bytes: 0,\n onReadCallback: null\n };\n\n const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);\n\n this.on('newListener', event => {\n if (event === 'progress') {\n if (!internals.isCaptured) {\n internals.isCaptured = true;\n }\n }\n });\n\n let bytesNotified = 0;\n\n internals.updateProgress = throttle(function throttledHandler() {\n const totalBytes = internals.length;\n const bytesTransferred = internals.bytesSeen;\n const progressBytes = bytesTransferred - bytesNotified;\n if (!progressBytes || self.destroyed) return;\n\n const rate = _speedometer(progressBytes);\n\n bytesNotified = bytesTransferred;\n\n process.nextTick(() => {\n self.emit('progress', {\n 'loaded': bytesTransferred,\n 'total': totalBytes,\n 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,\n 'bytes': progressBytes,\n 'rate': rate ? rate : undefined,\n 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?\n (totalBytes - bytesTransferred) / rate : undefined\n });\n });\n }, internals.ticksRate);\n\n const onFinish = () => {\n internals.updateProgress(true);\n };\n\n this.once('end', onFinish);\n this.once('error', onFinish);\n }\n\n _read(size) {\n const internals = this[kInternals];\n\n if (internals.onReadCallback) {\n internals.onReadCallback();\n }\n\n return super._read(size);\n }\n\n _transform(chunk, encoding, callback) {\n const self = this;\n const internals = this[kInternals];\n const maxRate = internals.maxRate;\n\n const readableHighWaterMark = this.readableHighWaterMark;\n\n const timeWindow = internals.timeWindow;\n\n const divider = 1000 / timeWindow;\n const bytesThreshold = (maxRate / divider);\n const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;\n\n function pushChunk(_chunk, _callback) {\n const bytes = Buffer.byteLength(_chunk);\n internals.bytesSeen += bytes;\n internals.bytes += bytes;\n\n if (internals.isCaptured) {\n internals.updateProgress();\n }\n\n if (self.push(_chunk)) {\n process.nextTick(_callback);\n } else {\n internals.onReadCallback = () => {\n internals.onReadCallback = null;\n process.nextTick(_callback);\n };\n }\n }\n\n const transformChunk = (_chunk, _callback) => {\n const chunkSize = Buffer.byteLength(_chunk);\n let chunkRemainder = null;\n let maxChunkSize = readableHighWaterMark;\n let bytesLeft;\n let passed = 0;\n\n if (maxRate) {\n const now = Date.now();\n\n if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {\n internals.ts = now;\n bytesLeft = bytesThreshold - internals.bytes;\n internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;\n passed = 0;\n }\n\n bytesLeft = bytesThreshold - internals.bytes;\n }\n\n if (maxRate) {\n if (bytesLeft <= 0) {\n // next time window\n return setTimeout(() => {\n _callback(null, _chunk);\n }, timeWindow - passed);\n }\n\n if (bytesLeft < maxChunkSize) {\n maxChunkSize = bytesLeft;\n }\n }\n\n if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {\n chunkRemainder = _chunk.subarray(maxChunkSize);\n _chunk = _chunk.subarray(0, maxChunkSize);\n }\n\n pushChunk(_chunk, chunkRemainder ? () => {\n process.nextTick(_callback, null, chunkRemainder);\n } : _callback);\n };\n\n transformChunk(chunk, function transformNextChunk(err, _chunk) {\n if (err) {\n return callback(err);\n }\n\n if (_chunk) {\n transformChunk(_chunk, transformNextChunk);\n } else {\n callback(null);\n }\n });\n }\n\n setLength(length) {\n this[kInternals].length = +length;\n return this;\n }\n}\n\nexport default AxiosTransformStream;\n","const {asyncIterator} = Symbol;\n\nconst readBlob = async function* (blob) {\n if (blob.stream) {\n yield* blob.stream()\n } else if (blob.arrayBuffer) {\n yield await blob.arrayBuffer()\n } else if (blob[asyncIterator]) {\n yield* blob[asyncIterator]();\n } else {\n yield blob;\n }\n}\n\nexport default readBlob;\n","import {TextEncoder} from 'util';\nimport {Readable} from 'stream';\nimport utils from \"../utils.js\";\nimport readBlob from \"./readBlob.js\";\n\nconst BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';\n\nconst textEncoder = new TextEncoder();\n\nconst CRLF = '\\r\\n';\nconst CRLF_BYTES = textEncoder.encode(CRLF);\nconst CRLF_BYTES_COUNT = 2;\n\nclass FormDataPart {\n constructor(name, value) {\n const {escapeName} = this.constructor;\n const isStringValue = utils.isString(value);\n\n let headers = `Content-Disposition: form-data; name=\"${escapeName(name)}\"${\n !isStringValue && value.name ? `; filename=\"${escapeName(value.name)}\"` : ''\n }${CRLF}`;\n\n if (isStringValue) {\n value = textEncoder.encode(String(value).replace(/\\r?\\n|\\r\\n?/g, CRLF));\n } else {\n headers += `Content-Type: ${value.type || \"application/octet-stream\"}${CRLF}`\n }\n\n this.headers = textEncoder.encode(headers + CRLF);\n\n this.contentLength = isStringValue ? value.byteLength : value.size;\n\n this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;\n\n this.name = name;\n this.value = value;\n }\n\n async *encode(){\n yield this.headers;\n\n const {value} = this;\n\n if(utils.isTypedArray(value)) {\n yield value;\n } else {\n yield* readBlob(value);\n }\n\n yield CRLF_BYTES;\n }\n\n static escapeName(name) {\n return String(name).replace(/[\\r\\n\"]/g, (match) => ({\n '\\r' : '%0D',\n '\\n' : '%0A',\n '\"' : '%22',\n }[match]));\n }\n}\n\nconst formDataToStream = (form, headersHandler, options) => {\n const {\n tag = 'form-data-boundary',\n size = 25,\n boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET)\n } = options || {};\n\n if(!utils.isFormData(form)) {\n throw TypeError('FormData instance required');\n }\n\n if (boundary.length < 1 || boundary.length > 70) {\n throw Error('boundary must be 10-70 characters long')\n }\n\n const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);\n const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);\n let contentLength = footerBytes.byteLength;\n\n const parts = Array.from(form.entries()).map(([name, value]) => {\n const part = new FormDataPart(name, value);\n contentLength += part.size;\n return part;\n });\n\n contentLength += boundaryBytes.byteLength * parts.length;\n\n contentLength = utils.toFiniteNumber(contentLength);\n\n const computedHeaders = {\n 'Content-Type': `multipart/form-data; boundary=${boundary}`\n }\n\n if (Number.isFinite(contentLength)) {\n computedHeaders['Content-Length'] = contentLength;\n }\n\n headersHandler && headersHandler(computedHeaders);\n\n return Readable.from((async function *() {\n for(const part of parts) {\n yield boundaryBytes;\n yield* part.encode();\n }\n\n yield footerBytes;\n })());\n};\n\nexport default formDataToStream;\n","\"use strict\";\n\nimport stream from \"stream\";\n\nclass ZlibHeaderTransformStream extends stream.Transform {\n __transform(chunk, encoding, callback) {\n this.push(chunk);\n callback();\n }\n\n _transform(chunk, encoding, callback) {\n if (chunk.length !== 0) {\n this._transform = this.__transform;\n\n // Add Default Compression headers if no zlib headers are present\n if (chunk[0] !== 120) { // Hex: 78\n const header = Buffer.alloc(2);\n header[0] = 120; // Hex: 78\n header[1] = 156; // Hex: 9C \n this.push(header, encoding);\n }\n }\n\n this.__transform(chunk, encoding, callback);\n }\n}\n\nexport default ZlibHeaderTransformStream;\n","import utils from \"../utils.js\";\n\nconst callbackify = (fn, reducer) => {\n return utils.isAsyncFn(fn) ? function (...args) {\n const cb = args.pop();\n fn.apply(this, args).then((value) => {\n try {\n reducer ? cb(null, ...reducer(value)) : cb(null, value);\n } catch (err) {\n cb(err);\n }\n }, cb);\n } : fn;\n}\n\nexport default callbackify;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport buildURL from './../helpers/buildURL.js';\nimport {getProxyForUrl} from 'proxy-from-env';\nimport http from 'http';\nimport https from 'https';\nimport util from 'util';\nimport followRedirects from 'follow-redirects';\nimport zlib from 'zlib';\nimport {VERSION} from '../env/data.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport platform from '../platform/index.js';\nimport fromDataURI from '../helpers/fromDataURI.js';\nimport stream from 'stream';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport AxiosTransformStream from '../helpers/AxiosTransformStream.js';\nimport EventEmitter from 'events';\nimport formDataToStream from \"../helpers/formDataToStream.js\";\nimport readBlob from \"../helpers/readBlob.js\";\nimport ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';\nimport callbackify from \"../helpers/callbackify.js\";\n\nconst zlibOptions = {\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n};\n\nconst brotliOptions = {\n flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n}\n\nconst isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);\n\nconst {http: httpFollow, https: httpsFollow} = followRedirects;\n\nconst isHttps = /https:?/;\n\nconst supportedProtocols = platform.protocols.map(protocol => {\n return protocol + ':';\n});\n\n/**\n * If the proxy or config beforeRedirects functions are defined, call them with the options\n * object.\n *\n * @param {Object} options - The options object that was passed to the request.\n *\n * @returns {Object}\n */\nfunction dispatchBeforeRedirect(options, responseDetails) {\n if (options.beforeRedirects.proxy) {\n options.beforeRedirects.proxy(options);\n }\n if (options.beforeRedirects.config) {\n options.beforeRedirects.config(options, responseDetails);\n }\n}\n\n/**\n * If the proxy or config afterRedirects functions are defined, call them with the options\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} configProxy configuration from Axios options object\n * @param {string} location\n *\n * @returns {http.ClientRequestArgs}\n */\nfunction setProxy(options, configProxy, location) {\n let proxy = configProxy;\n if (!proxy && proxy !== false) {\n const proxyUrl = getProxyForUrl(location);\n if (proxyUrl) {\n proxy = new URL(proxyUrl);\n }\n }\n if (proxy) {\n // Basic proxy authorization\n if (proxy.username) {\n proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');\n }\n\n if (proxy.auth) {\n // Support proxy auth object form\n if (proxy.auth.username || proxy.auth.password) {\n proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');\n }\n const base64 = Buffer\n .from(proxy.auth, 'utf8')\n .toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n options.headers.host = options.hostname + (options.port ? ':' + options.port : '');\n const proxyHost = proxy.hostname || proxy.host;\n options.hostname = proxyHost;\n // Replace 'host' since options is not a URL object\n options.host = proxyHost;\n options.port = proxy.port;\n options.path = location;\n if (proxy.protocol) {\n options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;\n }\n }\n\n options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {\n // Configure proxy for redirected request, passing the original config proxy to apply\n // the exact same logic as if the redirected request was performed by axios directly.\n setProxy(redirectOptions, configProxy, redirectOptions.href);\n };\n}\n\nconst isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';\n\n// temporary hotfix\n\nconst wrapAsync = (asyncExecutor) => {\n return new Promise((resolve, reject) => {\n let onDone;\n let isDone;\n\n const done = (value, isRejected) => {\n if (isDone) return;\n isDone = true;\n onDone && onDone(value, isRejected);\n }\n\n const _resolve = (value) => {\n done(value);\n resolve(value);\n };\n\n const _reject = (reason) => {\n done(reason, true);\n reject(reason);\n }\n\n asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);\n })\n};\n\nconst resolveFamily = ({address, family}) => {\n if (!utils.isString(address)) {\n throw TypeError('address must be a string');\n }\n return ({\n address,\n family: family || (address.indexOf('.') < 0 ? 6 : 4)\n });\n}\n\nconst buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});\n\n/*eslint consistent-return:0*/\nexport default isHttpAdapterSupported && function httpAdapter(config) {\n return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {\n let {data, lookup, family} = config;\n const {responseType, responseEncoding} = config;\n const method = config.method.toUpperCase();\n let isDone;\n let rejected = false;\n let req;\n\n if (lookup) {\n const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);\n // hotfix to support opt.all option which is required for node 20.x\n lookup = (hostname, opt, cb) => {\n _lookup(hostname, opt, (err, arg0, arg1) => {\n if (err) {\n return cb(err);\n }\n\n const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];\n\n opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);\n });\n }\n }\n\n // temporary internal emitter until the AxiosRequest class will be implemented\n const emitter = new EventEmitter();\n\n const onFinished = () => {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(abort);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', abort);\n }\n\n emitter.removeAllListeners();\n }\n\n onDone((value, isRejected) => {\n isDone = true;\n if (isRejected) {\n rejected = true;\n onFinished();\n }\n });\n\n function abort(reason) {\n emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);\n }\n\n emitter.once('abort', reject);\n\n if (config.cancelToken || config.signal) {\n config.cancelToken && config.cancelToken.subscribe(abort);\n if (config.signal) {\n config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);\n }\n }\n\n // Parse url\n const fullPath = buildFullPath(config.baseURL, config.url);\n const parsed = new URL(fullPath, 'http://localhost');\n const protocol = parsed.protocol || supportedProtocols[0];\n\n if (protocol === 'data:') {\n let convertedData;\n\n if (method !== 'GET') {\n return settle(resolve, reject, {\n status: 405,\n statusText: 'method not allowed',\n headers: {},\n config\n });\n }\n\n try {\n convertedData = fromDataURI(config.url, responseType === 'blob', {\n Blob: config.env && config.env.Blob\n });\n } catch (err) {\n throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);\n }\n\n if (responseType === 'text') {\n convertedData = convertedData.toString(responseEncoding);\n\n if (!responseEncoding || responseEncoding === 'utf8') {\n convertedData = utils.stripBOM(convertedData);\n }\n } else if (responseType === 'stream') {\n convertedData = stream.Readable.from(convertedData);\n }\n\n return settle(resolve, reject, {\n data: convertedData,\n status: 200,\n statusText: 'OK',\n headers: new AxiosHeaders(),\n config\n });\n }\n\n if (supportedProtocols.indexOf(protocol) === -1) {\n return reject(new AxiosError(\n 'Unsupported protocol ' + protocol,\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n const headers = AxiosHeaders.from(config.headers).normalize();\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n // User-Agent is specified; handle case where no UA header is desired\n // Only set header if it hasn't been set in config\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const onDownloadProgress = config.onDownloadProgress;\n const onUploadProgress = config.onUploadProgress;\n const maxRate = config.maxRate;\n let maxUploadRate = undefined;\n let maxDownloadRate = undefined;\n\n // support for spec compliant FormData objects\n if (utils.isSpecCompliantForm(data)) {\n const userBoundary = headers.getContentType(/boundary=([-_\\w\\d]{10,70})/i);\n\n data = formDataToStream(data, (formHeaders) => {\n headers.set(formHeaders);\n }, {\n tag: `axios-${VERSION}-boundary`,\n boundary: userBoundary && userBoundary[1] || undefined\n });\n // support for https://www.npmjs.com/package/form-data api\n } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {\n headers.set(data.getHeaders());\n\n if (!headers.hasContentLength()) {\n try {\n const knownLength = await util.promisify(data.getLength).call(data);\n Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);\n /*eslint no-empty:0*/\n } catch (e) {\n }\n }\n } else if (utils.isBlob(data)) {\n data.size && headers.setContentType(data.type || 'application/octet-stream');\n headers.setContentLength(data.size || 0);\n data = stream.Readable.from(readBlob(data));\n } else if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(new AxiosError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers.setContentLength(data.length, false);\n\n if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {\n return reject(new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n }\n\n const contentLength = utils.toFiniteNumber(headers.getContentLength());\n\n if (utils.isArray(maxRate)) {\n maxUploadRate = maxRate[0];\n maxDownloadRate = maxRate[1];\n } else {\n maxUploadRate = maxDownloadRate = maxRate;\n }\n\n if (data && (onUploadProgress || maxUploadRate)) {\n if (!utils.isStream(data)) {\n data = stream.Readable.from(data, {objectMode: false});\n }\n\n data = stream.pipeline([data, new AxiosTransformStream({\n length: contentLength,\n maxRate: utils.toFiniteNumber(maxUploadRate)\n })], utils.noop);\n\n onUploadProgress && data.on('progress', progress => {\n onUploadProgress(Object.assign(progress, {\n upload: true\n }));\n });\n }\n\n // HTTP basic authentication\n let auth = undefined;\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n if (!auth && parsed.username) {\n const urlUsername = parsed.username;\n const urlPassword = parsed.password;\n auth = urlUsername + ':' + urlPassword;\n }\n\n auth && headers.delete('authorization');\n\n let path;\n\n try {\n path = buildURL(\n parsed.pathname + parsed.search,\n config.params,\n config.paramsSerializer\n ).replace(/^\\?/, '');\n } catch (err) {\n const customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n return reject(customErr);\n }\n\n headers.set(\n 'Accept-Encoding',\n 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false\n );\n\n const options = {\n path,\n method: method,\n headers: headers.toJSON(),\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth,\n protocol,\n family,\n beforeRedirect: dispatchBeforeRedirect,\n beforeRedirects: {}\n };\n\n // cacheable-lookup integration hotfix\n !utils.isUndefined(lookup) && (options.lookup = lookup);\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n let transport;\n const isHttpsRequest = isHttps.test(options.protocol);\n options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsRequest ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n if (config.beforeRedirect) {\n options.beforeRedirects.config = config.beforeRedirect;\n }\n transport = isHttpsRequest ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n } else {\n // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited\n options.maxBodyLength = Infinity;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n req = transport.request(options, function handleResponse(res) {\n if (req.destroyed) return;\n\n const streams = [res];\n\n const responseLength = +res.headers['content-length'];\n\n if (onDownloadProgress) {\n const transformStream = new AxiosTransformStream({\n length: utils.toFiniteNumber(responseLength),\n maxRate: utils.toFiniteNumber(maxDownloadRate)\n });\n\n onDownloadProgress && transformStream.on('progress', progress => {\n onDownloadProgress(Object.assign(progress, {\n download: true\n }));\n });\n\n streams.push(transformStream);\n }\n\n // decompress the response body transparently if required\n let responseStream = res;\n\n // return the last request in case of redirects\n const lastRequest = res.req || req;\n\n // if decompress disabled we should not decompress\n if (config.decompress !== false && res.headers['content-encoding']) {\n // if no content, but headers still say that it is encoded,\n // remove the header not confuse downstream operations\n if (method === 'HEAD' || res.statusCode === 204) {\n delete res.headers['content-encoding'];\n }\n\n switch ((res.headers['content-encoding'] || '').toLowerCase()) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'x-gzip':\n case 'compress':\n case 'x-compress':\n // add the unzipper to the body stream processing pipeline\n streams.push(zlib.createUnzip(zlibOptions));\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n case 'deflate':\n streams.push(new ZlibHeaderTransformStream());\n\n // add the unzipper to the body stream processing pipeline\n streams.push(zlib.createUnzip(zlibOptions));\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n case 'br':\n if (isBrotliSupported) {\n streams.push(zlib.createBrotliDecompress(brotliOptions));\n delete res.headers['content-encoding'];\n }\n }\n }\n\n responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0];\n\n const offListeners = stream.finished(responseStream, () => {\n offListeners();\n onFinished();\n });\n\n const response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: new AxiosHeaders(res.headers),\n config,\n request: lastRequest\n };\n\n if (responseType === 'stream') {\n response.data = responseStream;\n settle(resolve, reject, response);\n } else {\n const responseBuffer = [];\n let totalResponseBytes = 0;\n\n responseStream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n // stream.destroy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n responseStream.destroy();\n reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE, config, lastRequest));\n }\n });\n\n responseStream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n\n const err = new AxiosError(\n 'maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n lastRequest\n );\n responseStream.destroy(err);\n reject(err);\n });\n\n responseStream.on('error', function handleStreamError(err) {\n if (req.destroyed) return;\n reject(AxiosError.from(err, null, config, lastRequest));\n });\n\n responseStream.on('end', function handleStreamEnd() {\n try {\n let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (responseType !== 'arraybuffer') {\n responseData = responseData.toString(responseEncoding);\n if (!responseEncoding || responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n response.data = responseData;\n } catch (err) {\n return reject(AxiosError.from(err, null, config, response.request, response));\n }\n settle(resolve, reject, response);\n });\n }\n\n emitter.once('abort', err => {\n if (!responseStream.destroyed) {\n responseStream.emit('error', err);\n responseStream.destroy();\n }\n });\n });\n\n emitter.once('abort', err => {\n reject(err);\n req.destroy(err);\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n // @todo remove\n // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;\n reject(AxiosError.from(err, null, config, req));\n });\n\n // set tcp keep alive to prevent drop connection by peer\n req.on('socket', function handleRequestSocket(socket) {\n // default interval of sending ack packet is 1 minute\n socket.setKeepAlive(true, 1000 * 60);\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n const timeout = parseInt(config.timeout, 10);\n\n if (Number.isNaN(timeout)) {\n reject(new AxiosError(\n 'error trying to parse `config.timeout` to int',\n AxiosError.ERR_BAD_OPTION_VALUE,\n config,\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devouring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n if (isDone) return;\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n req\n ));\n abort();\n });\n }\n\n\n // Send the request\n if (utils.isStream(data)) {\n let ended = false;\n let errored = false;\n\n data.on('end', () => {\n ended = true;\n });\n\n data.once('error', err => {\n errored = true;\n req.destroy(err);\n });\n\n data.on('close', () => {\n if (!ended && !errored) {\n abort(new CanceledError('Request stream has been aborted', config, req));\n }\n });\n\n data.pipe(req);\n } else {\n req.end(data);\n }\n });\n}\n\nexport const __setProxy = setProxy;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy;\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["utils","prototype","PlatformFormData","encode","url","FormData","platform","defaults","AxiosHeaders","stream","TextEncoder","readBlob","Readable","zlib","followRedirects","getProxyForUrl","callbackify","EventEmitter","formDataToStream","util","AxiosTransformStream","https","http","ZlibHeaderTransformStream","validators","InterceptorManager","Axios","CancelToken","HttpStatusCode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACFA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,KAAK,IAAI;AAClC,IAAI,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB;AACA,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK;AAC7B,EAAE,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,EAAE,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI;AAC1C,EAAC;AACD;AACA,MAAM,UAAU,GAAG,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,GAAG,EAAE;AACvB,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;AACvG,OAAO,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB,CAAC,GAAG,EAAE;AAChC,EAAE,IAAI,MAAM,CAAC;AACb,EAAE,IAAI,CAAC,OAAO,WAAW,KAAK,WAAW,MAAM,WAAW,CAAC,MAAM,CAAC,EAAE;AACpE,IAAI,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACrC,GAAG,MAAM;AACT,IAAI,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,KAAK,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAClE,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;AAChC,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AACxC,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,IAAI,KAAK,EAAE,MAAM,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;AAC1K,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,CAAC,KAAK,KAAK;AAC9B,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,OAAO,KAAK;AACd,IAAI,CAAC,OAAO,QAAQ,KAAK,UAAU,IAAI,KAAK,YAAY,QAAQ;AAChE,MAAM,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;AAC9B,QAAQ,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,UAAU;AAC7C;AACA,SAAS,IAAI,KAAK,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,KAAK,mBAAmB,CAAC;AACrG,OAAO;AACP,KAAK;AACL,GAAG;AACH,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI;AAC9B,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,oCAAoC,EAAE,EAAE,CAAC,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,UAAU,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE;AACrD;AACA,EAAE,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;AAClD,IAAI,OAAO;AACX,GAAG;AACH;AACA,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,IAAI,CAAC,CAAC;AACR;AACA;AACA,EAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC/B;AACA,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAChB,GAAG;AACH;AACA,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;AACpB;AACA,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC5C,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AACpC,KAAK;AACL,GAAG,MAAM;AACT;AACA,IAAI,MAAM,IAAI,GAAG,UAAU,GAAG,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjF,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;AAC5B,IAAI,IAAI,GAAG,CAAC;AACZ;AACA,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACxC,KAAK;AACL,GAAG;AACH,CAAC;AACD;AACA,SAAS,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE;AAC3B,EAAE,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;AAC1B,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACtB,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACnB,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE;AACpC,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,CAAC;AACD;AACA,MAAM,OAAO,GAAG,CAAC,MAAM;AACvB;AACA,EAAE,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,OAAO,UAAU,CAAC;AAC3D,EAAE,OAAO,OAAO,IAAI,KAAK,WAAW,GAAG,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAC/F,CAAC,GAAG,CAAC;AACL;AACA,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,OAAO,CAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,KAAK,8BAA8B;AAC5C,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;AAC1D,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK;AACpC,IAAI,MAAM,SAAS,GAAG,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC;AAC9D,IAAI,IAAI,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;AAChE,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,KAAK,MAAM,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE;AACnC,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AACzC,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;AAC7B,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC;AACtC,KAAK,MAAM;AACX,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC;AAC9B,KAAK;AACL,IAAG;AACH;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AACpD,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AACvD,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK;AACpD,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK;AAC3B,IAAI,IAAI,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE;AACpC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAClC,KAAK,MAAM;AACX,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AACnB,KAAK;AACL,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACnB,EAAE,OAAO,CAAC,CAAC;AACX,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,OAAO,KAAK;AAC9B,EAAE,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE;AACxC,IAAI,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC/B,GAAG;AACH,EAAE,OAAO,OAAO,CAAC;AACjB,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,KAAK;AACxE,EAAE,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACjF,EAAE,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAClD,EAAE,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,OAAO,EAAE;AAC9C,IAAI,KAAK,EAAE,gBAAgB,CAAC,SAAS;AACrC,GAAG,CAAC,CAAC;AACL,EAAE,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACvD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,KAAK;AACjE,EAAE,IAAI,KAAK,CAAC;AACZ,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB;AACA,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B;AACA,EAAE,IAAI,SAAS,IAAI,IAAI,EAAE,OAAO,OAAO,CAAC;AACxC;AACA,EAAE,GAAG;AACL,IAAI,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AAClD,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AACrB,IAAI,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AACpB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AAClF,QAAQ,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AACxC,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAC5B,OAAO;AACP,KAAK;AACL,IAAI,SAAS,GAAG,MAAM,KAAK,KAAK,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AAC9D,GAAG,QAAQ,SAAS,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE;AACnG;AACA,EAAE,OAAO,OAAO,CAAC;AACjB,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,KAAK;AAClD,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,EAAE,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE;AACvD,IAAI,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC;AAC1B,GAAG;AACH,EAAE,QAAQ,IAAI,YAAY,CAAC,MAAM,CAAC;AAClC,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AACxD,EAAE,OAAO,SAAS,KAAK,CAAC,CAAC,IAAI,SAAS,KAAK,QAAQ,CAAC;AACpD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO,GAAG,CAAC,KAAK,KAAK;AAC3B,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC;AAC1B,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;AACnC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AACvB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC;AAChC,EAAE,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3B,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACtB,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,UAAU,IAAI;AACpC;AACA,EAAE,OAAO,KAAK,IAAI;AAClB,IAAI,OAAO,UAAU,IAAI,KAAK,YAAY,UAAU,CAAC;AACrD,GAAG,CAAC;AACJ,CAAC,EAAE,OAAO,UAAU,KAAK,WAAW,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK;AAClC,EAAE,MAAM,SAAS,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChD;AACA,EAAE,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC;AACA,EAAE,IAAI,MAAM,CAAC;AACb;AACA,EAAE,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;AACrD,IAAI,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AAC9B,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,GAAG;AACH,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK;AAClC,EAAE,IAAI,OAAO,CAAC;AACd,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB;AACA,EAAE,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE;AAChD,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACtB,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACjD;AACA,MAAM,WAAW,GAAG,GAAG,IAAI;AAC3B,EAAE,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,uBAAuB;AAC1D,IAAI,SAAS,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;AACjC,MAAM,OAAO,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC;AACnC,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,CAAC;AACF;AACA;AACA,MAAM,cAAc,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,KAAK,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC;AACA,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK;AAC5C,EAAE,MAAM,WAAW,GAAG,MAAM,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;AAC5D,EAAE,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAChC;AACA,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,IAAI,KAAK;AAC7C,IAAI,IAAI,GAAG,CAAC;AACZ,IAAI,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,KAAK,EAAE;AAC1D,MAAM,kBAAkB,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC;AACnD,KAAK;AACL,GAAG,CAAC,CAAC;AACL;AACA,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;AACnD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,iBAAiB,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,IAAI,KAAK;AAC/C;AACA,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;AACnF,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL;AACA,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B;AACA,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO;AACnC;AACA,IAAI,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;AAClC;AACA,IAAI,IAAI,UAAU,IAAI,UAAU,EAAE;AAClC,MAAM,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;AAClC,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;AACzB,MAAM,UAAU,CAAC,GAAG,GAAG,MAAM;AAC7B,QAAQ,MAAM,KAAK,CAAC,qCAAqC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACzE,OAAO,CAAC;AACR,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAC;AACD;AACA,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,SAAS,KAAK;AAClD,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB;AACA,EAAE,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK;AAC1B,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI;AACzB,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AACxB,KAAK,CAAC,CAAC;AACP,IAAG;AACH;AACA,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AAClG;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA,MAAM,IAAI,GAAG,MAAM,GAAE;AACrB;AACA,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK;AAChD,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC;AACjB,EAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,YAAY,CAAC;AACvD,EAAC;AACD;AACA,MAAM,KAAK,GAAG,6BAA4B;AAC1C;AACA,MAAM,KAAK,GAAG,YAAY,CAAC;AAC3B;AACA,MAAM,QAAQ,GAAG;AACjB,EAAE,KAAK;AACP,EAAE,KAAK;AACP,EAAE,WAAW,EAAE,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,KAAK;AAClD,EAAC;AACD;AACA,MAAM,cAAc,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAAC,WAAW,KAAK;AACvE,EAAE,IAAI,GAAG,GAAG,EAAE,CAAC;AACf,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;AAC5B,EAAE,OAAO,IAAI,EAAE,EAAE;AACjB,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,EAAC;AAC7C,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB,CAAC,KAAK,EAAE;AACpC,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,UAAU,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrH,CAAC;AACD;AACA,MAAM,YAAY,GAAG,CAAC,GAAG,KAAK;AAC9B,EAAE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;AAC9B;AACA,EAAE,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK;AAC/B;AACA,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC1B,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AACtC,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,GAAG,EAAE,QAAQ,IAAI,MAAM,CAAC,EAAE;AAChC,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAC1B,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;AACjD;AACA,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK;AACxC,UAAU,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;AACrE,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAC7B;AACA,QAAQ,OAAO,MAAM,CAAC;AACtB,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC;AAClB,IAAG;AACH;AACA,EAAE,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACvB,EAAC;AACD;AACA,MAAM,SAAS,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;AAC9C;AACA,MAAM,UAAU,GAAG,CAAC,KAAK;AACzB,EAAE,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvG;AACA,gBAAe;AACf,EAAE,OAAO;AACT,EAAE,aAAa;AACf,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,iBAAiB;AACnB,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,SAAS;AACX,EAAE,QAAQ;AACV,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,QAAQ;AACV,EAAE,iBAAiB;AACnB,EAAE,YAAY;AACd,EAAE,UAAU;AACZ,EAAE,OAAO;AACT,EAAE,KAAK;AACP,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,YAAY;AACd,EAAE,MAAM;AACR,EAAE,UAAU;AACZ,EAAE,QAAQ;AACV,EAAE,OAAO;AACT,EAAE,YAAY;AACd,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,cAAc;AAChB,EAAE,UAAU,EAAE,cAAc;AAC5B,EAAE,iBAAiB;AACnB,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,WAAW;AACb,EAAE,IAAI;AACN,EAAE,cAAc;AAChB,EAAE,OAAO;AACT,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,gBAAgB;AAClB,EAAE,QAAQ;AACV,EAAE,cAAc;AAChB,EAAE,mBAAmB;AACrB,EAAE,YAAY;AACd,EAAE,SAAS;AACX,EAAE,UAAU;AACZ,CAAC;;AC9sBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;AAC9D,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnB;AACA,EAAE,IAAI,KAAK,CAAC,iBAAiB,EAAE;AAC/B,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACpD,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,EAAE,EAAE,KAAK,CAAC;AACrC,GAAG;AACH;AACA,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;AAC3B,EAAE,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAC7B,EAAE,MAAM,KAAK,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AACnC,EAAE,OAAO,KAAK,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;AACtC,EAAE,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;AACzC,CAAC;AACD;AACAA,OAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAE;AAClC,EAAE,MAAM,EAAE,SAAS,MAAM,GAAG;AAC5B,IAAI,OAAO;AACX;AACA,MAAM,OAAO,EAAE,IAAI,CAAC,OAAO;AAC3B,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI;AACrB;AACA,MAAM,WAAW,EAAE,IAAI,CAAC,WAAW;AACnC,MAAM,MAAM,EAAE,IAAI,CAAC,MAAM;AACzB;AACA,MAAM,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC7B,MAAM,UAAU,EAAE,IAAI,CAAC,UAAU;AACjC,MAAM,YAAY,EAAE,IAAI,CAAC,YAAY;AACrC,MAAM,KAAK,EAAE,IAAI,CAAC,KAAK;AACvB;AACA,MAAM,MAAM,EAAEA,OAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;AAC7C,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI;AACrB,MAAM,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI;AACjF,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACA,MAAMC,WAAS,GAAG,UAAU,CAAC,SAAS,CAAC;AACvC,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB;AACA;AACA,EAAE,sBAAsB;AACxB,EAAE,gBAAgB;AAClB,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,aAAa;AACf,EAAE,2BAA2B;AAC7B,EAAE,gBAAgB;AAClB,EAAE,kBAAkB;AACpB,EAAE,iBAAiB;AACnB,EAAE,cAAc;AAChB,EAAE,iBAAiB;AACnB,EAAE,iBAAiB;AACnB;AACA,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI;AAClB,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC;AACH;AACA,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACjD,MAAM,CAAC,cAAc,CAACA,WAAS,EAAE,cAAc,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAChE;AACA;AACA,UAAU,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,KAAK;AAC3E,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAACA,WAAS,CAAC,CAAC;AAC9C;AACA,EAAED,OAAK,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,MAAM,CAAC,GAAG,EAAE;AAC7D,IAAI,OAAO,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC;AACnC,GAAG,EAAE,IAAI,IAAI;AACb,IAAI,OAAO,IAAI,KAAK,cAAc,CAAC;AACnC,GAAG,CAAC,CAAC;AACL;AACA,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC9E;AACA,EAAE,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B;AACA,EAAE,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC/B;AACA,EAAE,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACxD;AACA,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;;AC1FD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,EAAE,OAAOA,OAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,GAAG,EAAE;AAC7B,EAAE,OAAOA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC5D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;AACpC,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,CAAC;AACxB,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE;AACtD;AACA,IAAI,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAClC,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;AAClD,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC;AAC3B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,GAAG,EAAE;AAC1B,EAAE,OAAOA,OAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACtD,CAAC;AACD;AACA,MAAM,UAAU,GAAGA,OAAK,CAAC,YAAY,CAACA,OAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE;AAC7E,EAAE,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC5C,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;AACpD,GAAG;AACH;AACA;AACA,EAAE,QAAQ,GAAG,QAAQ,IAAI,KAAKE,4BAAgB,IAAI,QAAQ,GAAG,CAAC;AAC9D;AACA;AACA,EAAE,OAAO,GAAGF,OAAK,CAAC,YAAY,CAAC,OAAO,EAAE;AACxC,IAAI,UAAU,EAAE,IAAI;AACpB,IAAI,IAAI,EAAE,KAAK;AACf,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG,EAAE,KAAK,EAAE,SAAS,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE;AAC7C;AACA,IAAI,OAAO,CAACA,OAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9C,GAAG,CAAC,CAAC;AACL;AACA,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;AACxC;AACA,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC;AACpD,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAC5B,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC;AACpE,EAAE,MAAM,OAAO,GAAG,KAAK,IAAIA,OAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC/D;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AAClC,IAAI,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;AACtD,GAAG;AACH;AACA,EAAE,SAAS,YAAY,CAAC,KAAK,EAAE;AAC/B,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE,OAAO,EAAE,CAAC;AAClC;AACA,IAAI,IAAIA,OAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AAC7B,MAAM,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AACjC,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,IAAIA,OAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AACzC,MAAM,MAAM,IAAI,UAAU,CAAC,8CAA8C,CAAC,CAAC;AAC3E,KAAK;AACL;AACA,IAAI,IAAIA,OAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;AACjE,MAAM,OAAO,OAAO,IAAI,OAAO,IAAI,KAAK,UAAU,GAAG,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5F,KAAK;AACL;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;AAC5C,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC;AACpB;AACA,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACrD,MAAM,IAAIA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE;AACrC;AACA,QAAQ,GAAG,GAAG,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAClD;AACA,QAAQ,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACtC,OAAO,MAAM;AACb,QAAQ,CAACA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC;AACnD,SAAS,CAACA,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAIA,OAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC/F,SAAS,EAAE;AACX;AACA,QAAQ,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAClC;AACA,QAAQ,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE;AAC7C,UAAU,EAAEA,OAAK,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,QAAQ,CAAC,MAAM;AACpE;AACA,YAAY,OAAO,KAAK,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,OAAO,KAAK,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AACpG,YAAY,YAAY,CAAC,EAAE,CAAC;AAC5B,WAAW,CAAC;AACZ,SAAS,CAAC,CAAC;AACX,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE;AAC5B,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL;AACA,IAAI,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;AACnD,IAAI,cAAc;AAClB,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,GAAG,CAAC,CAAC;AACL;AACA,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;AAC9B,IAAI,IAAIA,OAAK,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,OAAO;AACzC;AACA,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;AACrC,MAAM,MAAM,KAAK,CAAC,iCAAiC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACtE,KAAK;AACL;AACA,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtB;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE;AAChD,MAAM,MAAM,MAAM,GAAG,EAAEA,OAAK,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI;AAC5E,QAAQ,QAAQ,EAAE,EAAE,EAAEA,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,cAAc;AAClF,OAAO,CAAC;AACR;AACA,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC3B,QAAQ,KAAK,CAAC,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,OAAO;AACP,KAAK,CAAC,CAAC;AACP;AACA,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AAChB,GAAG;AACH;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,IAAI,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAC;AAClD,GAAG;AACH;AACA,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AACb;AACA,EAAE,OAAO,QAAQ,CAAC;AAClB;;ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,QAAM,CAAC,GAAG,EAAE;AACrB,EAAE,MAAM,OAAO,GAAG;AAClB,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,KAAK,EAAE,GAAG;AACd,IAAI,KAAK,EAAE,MAAM;AACjB,GAAG,CAAC;AACJ,EAAE,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,SAAS,QAAQ,CAAC,KAAK,EAAE;AACtF,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1B,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE;AAC/C,EAAE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,MAAM,IAAI,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AACD;AACA,MAAM,SAAS,GAAG,oBAAoB,CAAC,SAAS,CAAC;AACjD;AACA,SAAS,CAAC,MAAM,GAAG,SAAS,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;AAChD,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC,CAAC;AACF;AACA,SAAS,CAAC,QAAQ,GAAG,SAAS,QAAQ,CAAC,OAAO,EAAE;AAChD,EAAE,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,KAAK,EAAE;AAC5C,IAAI,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAEA,QAAM,CAAC,CAAC;AAC7C,GAAG,GAAGA,QAAM,CAAC;AACb;AACA,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE;AAC7C,IAAI,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;;AClDD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,GAAG,EAAE;AACrB,EAAE,OAAO,kBAAkB,CAAC,GAAG,CAAC;AAChC,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;AACxB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;AACxB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AACzB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;AACvD;AACA,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,MAAM,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC;AACtD;AACA,EAAE,MAAM,WAAW,GAAG,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;AACnD;AACA,EAAE,IAAI,gBAAgB,CAAC;AACvB;AACA,EAAE,IAAI,WAAW,EAAE;AACnB,IAAI,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,GAAG,MAAM;AACT,IAAI,gBAAgB,GAAGH,OAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC;AACtD,MAAM,MAAM,CAAC,QAAQ,EAAE;AACvB,MAAM,IAAI,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClE,GAAG;AACH;AACA,EAAE,IAAI,gBAAgB,EAAE;AACxB,IAAI,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC3C;AACA,IAAI,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;AAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AACxC,KAAK;AACL,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,gBAAgB,CAAC;AACpE,GAAG;AACH;AACA,EAAE,OAAO,GAAG,CAAC;AACb;;AC1DA,MAAM,kBAAkB,CAAC;AACzB,EAAE,WAAW,GAAG;AAChB,IAAI,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;AACvB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE;AACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;AACvB,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,GAAG,KAAK;AACxD,MAAM,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI;AAC/C,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;AACpC,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,KAAK,CAAC,EAAE,EAAE;AACZ,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;AAC3B,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;AAC/B,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,KAAK,GAAG;AACV,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;AACvB,MAAM,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;AACzB,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,CAAC,EAAE,EAAE;AACd,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,cAAc,CAAC,CAAC,EAAE;AAC5D,MAAM,IAAI,CAAC,KAAK,IAAI,EAAE;AACtB,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACd,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH,CAAC;AACD;AACA,6BAAe,kBAAkB;;ACpEjC,6BAAe;AACf,EAAE,iBAAiB,EAAE,IAAI;AACzB,EAAE,iBAAiB,EAAE,IAAI;AACzB,EAAE,mBAAmB,EAAE,KAAK;AAC5B,CAAC;;ACHD,wBAAeI,uBAAG,CAAC,eAAe;;ACAlC,mBAAe;AACf,EAAE,MAAM,EAAE,IAAI;AACd,EAAE,OAAO,EAAE;AACX,IAAI,eAAe;AACnB,cAAIC,4BAAQ;AACZ,IAAI,IAAI,EAAE,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,IAAI,IAAI;AACrD,GAAG;AACH,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE;AAChD,CAAC;;ACXD,MAAM,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,qBAAqB,GAAG;AAC9B,EAAE,CAAC,OAAO,KAAK;AACf,IAAI,OAAO,aAAa,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;AACtF,GAAG,EAAE,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8BAA8B,GAAG,CAAC,MAAM;AAC9C,EAAE;AACF,IAAI,OAAO,iBAAiB,KAAK,WAAW;AAC5C;AACA,IAAI,IAAI,YAAY,iBAAiB;AACrC,IAAI,OAAO,IAAI,CAAC,aAAa,KAAK,UAAU;AAC5C,IAAI;AACJ,CAAC,GAAG;;;;;;;;;ACrCJ,iBAAe;AACf,EAAE,GAAG,KAAK;AACV,EAAE,GAAGC,UAAQ;AACb;;ACAe,SAAS,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;AACxD,EAAE,OAAO,UAAU,CAAC,IAAI,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC;AAChF,IAAI,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;AACjD,MAAM,IAAI,QAAQ,CAAC,MAAM,IAAIN,OAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpD,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnD,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO;AACP;AACA,MAAM,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC3D,KAAK;AACL,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACf;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B;AACA;AACA;AACA;AACA,EAAE,OAAOA,OAAK,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI;AAC5D,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AACzD,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;AACjB,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,EAAE,IAAI,CAAC,CAAC;AACR,EAAE,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;AAC1B,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC5B,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,QAAQ,EAAE;AAClC,EAAE,SAAS,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AACjD,IAAI,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;AAC7B;AACA,IAAI,IAAI,IAAI,KAAK,WAAW,EAAE,OAAO,IAAI,CAAC;AAC1C;AACA,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;AAChD,IAAI,MAAM,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC;AACxC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;AACjE;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;AAC1C,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AAC7C,OAAO,MAAM;AACb,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;AAC7B,OAAO;AACP;AACA,MAAM,OAAO,CAAC,YAAY,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE;AACxD,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AACxB,KAAK;AACL;AACA,IAAI,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/D;AACA,IAAI,IAAI,MAAM,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE;AAC/C,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,KAAK;AACL;AACA,IAAI,OAAO,CAAC,YAAY,CAAC;AACzB,GAAG;AACH;AACA,EAAE,IAAIA,OAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAIA,OAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AACxE,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;AACnB;AACA,IAAIA,OAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK;AAClD,MAAM,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AACpD,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,OAAO,IAAI,CAAC;AACd;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;AACpD,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AAChC,IAAI,IAAI;AACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACvC,MAAM,OAAOA,OAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAClC,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;AACpC,QAAQ,MAAM,CAAC,CAAC;AAChB,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC/C,CAAC;AACD;AACA,MAAM,QAAQ,GAAG;AACjB;AACA,EAAE,YAAY,EAAE,oBAAoB;AACpC;AACA,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AAC1B;AACA,EAAE,gBAAgB,EAAE,CAAC,SAAS,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;AAC9D,IAAI,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;AACvD,IAAI,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5E,IAAI,MAAM,eAAe,GAAGA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjD;AACA,IAAI,IAAI,eAAe,IAAIA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AACnD,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChC,KAAK;AACL;AACA,IAAI,MAAM,UAAU,GAAGA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9C;AACA,IAAI,IAAI,UAAU,EAAE;AACpB,MAAM,OAAO,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;AAC9E,KAAK;AACL;AACA,IAAI,IAAIA,OAAK,CAAC,aAAa,CAAC,IAAI,CAAC;AACjC,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC1B,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC1B,MAAMA,OAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACxB,MAAMA,OAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACxB,MAAM;AACN,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,IAAI,IAAIA,OAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;AACvC,MAAM,OAAO,IAAI,CAAC,MAAM,CAAC;AACzB,KAAK;AACL,IAAI,IAAIA,OAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;AACvC,MAAM,OAAO,CAAC,cAAc,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;AACvF,MAAM,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC7B,KAAK;AACL;AACA,IAAI,IAAI,UAAU,CAAC;AACnB;AACA,IAAI,IAAI,eAAe,EAAE;AACzB,MAAM,IAAI,WAAW,CAAC,OAAO,CAAC,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE;AACzE,QAAQ,OAAO,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtE,OAAO;AACP;AACA,MAAM,IAAI,CAAC,UAAU,GAAGA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAAE;AACpG,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;AACxD;AACA,QAAQ,OAAO,UAAU;AACzB,UAAU,UAAU,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,IAAI;AAC/C,UAAU,SAAS,IAAI,IAAI,SAAS,EAAE;AACtC,UAAU,IAAI,CAAC,cAAc;AAC7B,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,eAAe,IAAI,kBAAkB,GAAG;AAChD,MAAM,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AACxD,MAAM,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AACnC,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ;AACA,EAAE,iBAAiB,EAAE,CAAC,SAAS,iBAAiB,CAAC,IAAI,EAAE;AACvD,IAAI,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpE,IAAI,MAAM,iBAAiB,GAAG,YAAY,IAAI,YAAY,CAAC,iBAAiB,CAAC;AAC7E,IAAI,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC;AACvD;AACA,IAAI,IAAI,IAAI,IAAIA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,aAAa,CAAC,EAAE;AACtG,MAAM,MAAM,iBAAiB,GAAG,YAAY,IAAI,YAAY,CAAC,iBAAiB,CAAC;AAC/E,MAAM,MAAM,iBAAiB,GAAG,CAAC,iBAAiB,IAAI,aAAa,CAAC;AACpE;AACA,MAAM,IAAI;AACV,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAChC,OAAO,CAAC,OAAO,CAAC,EAAE;AAClB,QAAQ,IAAI,iBAAiB,EAAE;AAC/B,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;AACxC,YAAY,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC7F,WAAW;AACX,UAAU,MAAM,CAAC,CAAC;AAClB,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,EAAE,CAAC;AACZ;AACA,EAAE,cAAc,EAAE,YAAY;AAC9B,EAAE,cAAc,EAAE,cAAc;AAChC;AACA,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACtB,EAAE,aAAa,EAAE,CAAC,CAAC;AACnB;AACA,EAAE,GAAG,EAAE;AACP,IAAI,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ;AACvC,IAAI,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;AAC/B,GAAG;AACH;AACA,EAAE,cAAc,EAAE,SAAS,cAAc,CAAC,MAAM,EAAE;AAClD,IAAI,OAAO,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC;AACzC,GAAG;AACH;AACA,EAAE,OAAO,EAAE;AACX,IAAI,MAAM,EAAE;AACZ,MAAM,QAAQ,EAAE,mCAAmC;AACnD,MAAM,cAAc,EAAE,SAAS;AAC/B,KAAK;AACL,GAAG;AACH,CAAC,CAAC;AACF;AACAA,OAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,KAAK;AAC7E,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAChC,CAAC,CAAC,CAAC;AACH;AACA,mBAAe,QAAQ;;ACvJvB;AACA;AACA,MAAM,iBAAiB,GAAGA,OAAK,CAAC,WAAW,CAAC;AAC5C,EAAE,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM;AAClE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,qBAAqB;AACvE,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB;AACpE,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY;AACxC,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAe,UAAU,IAAI;AAC7B,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,IAAI,GAAG,CAAC;AACV,EAAE,IAAI,CAAC,CAAC;AACR;AACA,EAAE,UAAU,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,IAAI,EAAE;AACrE,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1B,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACvC;AACA,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE;AACzD,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,GAAG,KAAK,YAAY,EAAE;AAC9B,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;AACvB,QAAQ,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9B,OAAO,MAAM;AACb,QAAQ,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC5B,OAAO;AACP,KAAK,MAAM;AACX,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AACjE,KAAK;AACL,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;;ACjDD,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC;AACA,SAAS,eAAe,CAAC,MAAM,EAAE;AACjC,EAAE,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACvD,CAAC;AACD;AACA,SAAS,cAAc,CAAC,KAAK,EAAE;AAC/B,EAAE,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,IAAI,IAAI,EAAE;AACxC,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,OAAOA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1E,CAAC;AACD;AACA,SAAS,WAAW,CAAC,GAAG,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACrC,EAAE,MAAM,QAAQ,GAAG,kCAAkC,CAAC;AACtD,EAAE,IAAI,KAAK,CAAC;AACZ;AACA,EAAE,QAAQ,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;AACvC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAChC,GAAG;AACH;AACA,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;AACA,MAAM,iBAAiB,GAAG,CAAC,GAAG,KAAK,gCAAgC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;AACrF;AACA,SAAS,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE;AAC9E,EAAE,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAChC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5C,GAAG;AACH;AACA,EAAE,IAAI,kBAAkB,EAAE;AAC1B,IAAI,KAAK,GAAG,MAAM,CAAC;AACnB,GAAG;AACH;AACA,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;AACrC;AACA,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9B,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,GAAG;AACH;AACA,EAAE,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9B,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9B,GAAG;AACH,CAAC;AACD;AACA,SAAS,YAAY,CAAC,MAAM,EAAE;AAC9B,EAAE,OAAO,MAAM,CAAC,IAAI,EAAE;AACtB,KAAK,WAAW,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK;AAChE,MAAM,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC;AACtC,KAAK,CAAC,CAAC;AACP,CAAC;AACD;AACA,SAAS,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE;AACrC,EAAE,MAAM,YAAY,GAAGA,OAAK,CAAC,WAAW,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;AACvD;AACA,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI;AAC9C,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,YAAY,EAAE;AAC1D,MAAM,KAAK,EAAE,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;AACxC,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrE,OAAO;AACP,MAAM,YAAY,EAAE,IAAI;AACxB,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL,CAAC;AACD;AACA,MAAM,YAAY,CAAC;AACnB,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACjC,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE;AACvC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB;AACA,IAAI,SAAS,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;AAClD,MAAM,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAClE,OAAO;AACP;AACA,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,KAAK,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,EAAE;AAClH,QAAQ,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AACtD,OAAO;AACP,KAAK;AACL;AACA,IAAI,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,QAAQ;AACzC,MAAMA,OAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AACxF;AACA,IAAI,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,YAAY,IAAI,CAAC,WAAW,EAAE;AAC3E,MAAM,UAAU,CAAC,MAAM,EAAE,cAAc,EAAC;AACxC,KAAK,MAAM,GAAGA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE;AAChG,MAAM,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC;AACvD,KAAK,MAAM;AACX,MAAM,MAAM,IAAI,IAAI,IAAI,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACnE,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE;AACtB,IAAI,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C;AACA,MAAM,IAAI,GAAG,EAAE;AACf,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC;AACA,QAAQ,IAAI,CAAC,MAAM,EAAE;AACrB,UAAU,OAAO,KAAK,CAAC;AACvB,SAAS;AACT;AACA,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;AAC7B,UAAU,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AACpC,SAAS;AACT;AACA,QAAQ,IAAIA,OAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AACtC,UAAU,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/C,SAAS;AACT;AACA,QAAQ,IAAIA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACpC,UAAU,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpC,SAAS;AACT;AACA,QAAQ,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;AACtE,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE;AACvB,IAAI,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C;AACA,MAAM,OAAO,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,KAAK,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AACjH,KAAK;AACL;AACA,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE;AAC1B,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB,IAAI,IAAI,OAAO,GAAG,KAAK,CAAC;AACxB;AACA,IAAI,SAAS,YAAY,CAAC,OAAO,EAAE;AACnC,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AACzC;AACA,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACjD;AACA,QAAQ,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE;AAClF,UAAU,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B;AACA,UAAU,OAAO,GAAG,IAAI,CAAC;AACzB,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC/B,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACnC,KAAK,MAAM;AACX,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,KAAK,CAAC,OAAO,EAAE;AACjB,IAAI,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACxB,IAAI,IAAI,OAAO,GAAG,KAAK,CAAC;AACxB;AACA,IAAI,OAAO,CAAC,EAAE,EAAE;AAChB,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1B,MAAM,GAAG,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;AAC5E,QAAQ,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,QAAQ,OAAO,GAAG,IAAI,CAAC;AACvB,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,SAAS,CAAC,MAAM,EAAE;AACpB,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB,IAAI,MAAM,OAAO,GAAG,EAAE,CAAC;AACvB;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK;AAC3C,MAAM,MAAM,GAAG,GAAGA,OAAK,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACjD;AACA,MAAM,IAAI,GAAG,EAAE;AACf,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/E;AACA,MAAM,IAAI,UAAU,KAAK,MAAM,EAAE;AACjC,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,OAAO;AACP;AACA,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/C;AACA,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;AACjC,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,GAAG,OAAO,EAAE;AACrB,IAAI,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;AACrD,GAAG;AACH;AACA,EAAE,MAAM,CAAC,SAAS,EAAE;AACpB,IAAI,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACpC;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK;AAC3C,MAAM,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,KAAK,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,IAAIA,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;AACvH,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG;AACtB,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC5D,GAAG;AACH;AACA,EAAE,QAAQ,GAAG;AACb,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpG,GAAG;AACH;AACA,EAAE,KAAK,MAAM,CAAC,WAAW,CAAC,GAAG;AAC7B,IAAI,OAAO,cAAc,CAAC;AAC1B,GAAG;AACH;AACA,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE;AACrB,IAAI,OAAO,KAAK,YAAY,IAAI,GAAG,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3D,GAAG;AACH;AACA,EAAE,OAAO,MAAM,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE;AACnC,IAAI,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC;AACA,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACtD;AACA,IAAI,OAAO,QAAQ,CAAC;AACpB,GAAG;AACH;AACA,EAAE,OAAO,QAAQ,CAAC,MAAM,EAAE;AAC1B,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG;AAC7D,MAAM,SAAS,EAAE,EAAE;AACnB,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;AAC1C,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AACrC;AACA,IAAI,SAAS,cAAc,CAAC,OAAO,EAAE;AACrC,MAAM,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAC/C;AACA,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAQ,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC3C,QAAQ,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAClC,OAAO;AACP,KAAK;AACL;AACA,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AACpF;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,CAAC;AACD;AACA,YAAY,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;AACtH;AACA;AACAA,OAAK,CAAC,iBAAiB,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK;AAClE,EAAE,IAAI,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnD,EAAE,OAAO;AACT,IAAI,GAAG,EAAE,MAAM,KAAK;AACpB,IAAI,GAAG,CAAC,WAAW,EAAE;AACrB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AACjC,KAAK;AACL,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACAA,OAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;AAClC;AACA,uBAAe,YAAY;;ACnS3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE;AACrD,EAAE,MAAM,MAAM,GAAG,IAAI,IAAIO,UAAQ,CAAC;AAClC,EAAE,MAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC;AACrC,EAAE,MAAM,OAAO,GAAGC,cAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACrD,EAAE,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAC1B;AACA,EAAER,OAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,SAAS,CAAC,EAAE,EAAE;AAC5C,IAAI,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAC9F,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;AACtB;AACA,EAAE,OAAO,IAAI,CAAC;AACd;;ACzBe,SAAS,QAAQ,CAAC,KAAK,EAAE;AACxC,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AACvC;;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;AACjD;AACA,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,IAAI,IAAI,GAAG,UAAU,GAAG,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1G,EAAE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;AAC9B,CAAC;AACD;AACAA,OAAK,CAAC,QAAQ,CAAC,aAAa,EAAE,UAAU,EAAE;AAC1C,EAAE,UAAU,EAAE,IAAI;AAClB,CAAC,CAAC;;AClBF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;AAC1D,EAAE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC;AACxD,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC9E,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;AACtB,GAAG,MAAM;AACT,IAAI,MAAM,CAAC,IAAI,UAAU;AACzB,MAAM,kCAAkC,GAAG,QAAQ,CAAC,MAAM;AAC1D,MAAM,CAAC,UAAU,CAAC,eAAe,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACtG,MAAM,QAAQ,CAAC,MAAM;AACrB,MAAM,QAAQ,CAAC,OAAO;AACtB,MAAM,QAAQ;AACd,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,GAAG,EAAE;AAC3C;AACA;AACA;AACA,EAAE,OAAO,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjD;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE;AAC1D,EAAE,OAAO,WAAW;AACpB,MAAM,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;AAC3E,MAAM,OAAO,CAAC;AACd;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE;AAC7D,EAAE,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE;AAC/C,IAAI,OAAO,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAC9C,GAAG;AACH,EAAE,OAAO,YAAY,CAAC;AACtB;;ACpBO,MAAM,OAAO,GAAG,OAAO;;ACEf,SAAS,aAAa,CAAC,GAAG,EAAE;AAC3C,EAAE,MAAM,KAAK,GAAG,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtD,EAAE,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC;;ACCA,MAAM,gBAAgB,GAAG,+CAA+C,CAAC;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;AAC1D,EAAE,MAAM,KAAK,GAAG,OAAO,IAAI,OAAO,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;AACjE,EAAE,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACtC;AACA,EAAE,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,EAAE;AACrC,IAAI,MAAM,GAAG,IAAI,CAAC;AAClB,GAAG;AACH;AACA,EAAE,IAAI,QAAQ,KAAK,MAAM,EAAE;AAC3B,IAAI,GAAG,GAAG,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;AACjE;AACA,IAAI,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7C;AACA,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,MAAM,MAAM,IAAI,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;AACtE,KAAK;AACL;AACA,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1B,IAAI,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1B,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC;AACvF;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,IAAI,CAAC,KAAK,EAAE;AAClB,QAAQ,MAAM,IAAI,UAAU,CAAC,uBAAuB,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;AAClF,OAAO;AACP;AACA,MAAM,OAAO,IAAI,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/C,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH;AACA,EAAE,MAAM,IAAI,UAAU,CAAC,uBAAuB,GAAG,QAAQ,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;AACvF;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE;AAC5B,EAAE,IAAI,SAAS,GAAG,CAAC,CAAC;AACpB,EAAE,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAChC,EAAE,IAAI,KAAK,GAAG,IAAI,CAAC;AACnB,EAAE,OAAO,SAAS,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE;AACzC,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3B,IAAI,IAAI,KAAK,IAAI,GAAG,GAAG,SAAS,GAAG,SAAS,EAAE;AAC9C,MAAM,IAAI,KAAK,EAAE;AACjB,QAAQ,YAAY,CAAC,KAAK,CAAC,CAAC;AAC5B,QAAQ,KAAK,GAAG,IAAI,CAAC;AACrB,OAAO;AACP,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClC,KAAK;AACL,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM;AAC/B,QAAQ,KAAK,GAAG,IAAI,CAAC;AACrB,QAAQ,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC/B,QAAQ,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACpC,OAAO,EAAE,SAAS,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC;AACxC,KAAK;AACL,GAAG,CAAC;AACJ;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,YAAY,EAAE,GAAG,EAAE;AACxC,EAAE,YAAY,GAAG,YAAY,IAAI,EAAE,CAAC;AACpC,EAAE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACxC,EAAE,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AAC7C,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AACf,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;AACf,EAAE,IAAI,aAAa,CAAC;AACpB;AACA,EAAE,GAAG,GAAG,GAAG,KAAK,SAAS,GAAG,GAAG,GAAG,IAAI,CAAC;AACvC;AACA,EAAE,OAAO,SAAS,IAAI,CAAC,WAAW,EAAE;AACpC,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3B;AACA,IAAI,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AACvC;AACA,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,KAAK;AACL;AACA,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC;AAC9B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;AAC3B;AACA,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC;AACjB,IAAI,IAAI,UAAU,GAAG,CAAC,CAAC;AACvB;AACA,IAAI,OAAO,CAAC,KAAK,IAAI,EAAE;AACvB,MAAM,UAAU,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,YAAY,CAAC;AACrC;AACA,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE;AACvB,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,YAAY,CAAC;AACvC,KAAK;AACL;AACA,IAAI,IAAI,GAAG,GAAG,aAAa,GAAG,GAAG,EAAE;AACnC,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,MAAM,MAAM,GAAG,SAAS,IAAI,GAAG,GAAG,SAAS,CAAC;AAChD;AACA,IAAI,OAAO,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;AACvE,GAAG,CAAC;AACJ;;AC7CA,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC;AACA,MAAM,oBAAoB,SAASS,0BAAM,CAAC,SAAS;AACnD,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,OAAO,GAAGT,OAAK,CAAC,YAAY,CAAC,OAAO,EAAE;AAC1C,MAAM,OAAO,EAAE,CAAC;AAChB,MAAM,SAAS,EAAE,EAAE,GAAG,IAAI;AAC1B,MAAM,YAAY,EAAE,GAAG;AACvB,MAAM,UAAU,EAAE,GAAG;AACrB,MAAM,SAAS,EAAE,CAAC;AAClB,MAAM,YAAY,EAAE,EAAE;AACtB,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;AAC/B,MAAM,OAAO,CAACA,OAAK,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9C,KAAK,CAAC,CAAC;AACP;AACA,IAAI,KAAK,CAAC;AACV,MAAM,qBAAqB,EAAE,OAAO,CAAC,SAAS;AAC9C,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB;AACA,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG;AACzC,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM;AAC5B,MAAM,UAAU,EAAE,OAAO,CAAC,UAAU;AACpC,MAAM,SAAS,EAAE,OAAO,CAAC,SAAS;AAClC,MAAM,SAAS,EAAE,OAAO,CAAC,SAAS;AAClC,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO;AAC9B,MAAM,YAAY,EAAE,OAAO,CAAC,YAAY;AACxC,MAAM,SAAS,EAAE,CAAC;AAClB,MAAM,UAAU,EAAE,KAAK;AACvB,MAAM,mBAAmB,EAAE,CAAC;AAC5B,MAAM,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;AACpB,MAAM,KAAK,EAAE,CAAC;AACd,MAAM,cAAc,EAAE,IAAI;AAC1B,KAAK,CAAC;AACN;AACA,IAAI,MAAM,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;AACvG;AACA,IAAI,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,KAAK,IAAI;AACpC,MAAM,IAAI,KAAK,KAAK,UAAU,EAAE;AAChC,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;AACnC,UAAU,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC;AACtC,SAAS;AACT,OAAO;AACP,KAAK,CAAC,CAAC;AACP;AACA,IAAI,IAAI,aAAa,GAAG,CAAC,CAAC;AAC1B;AACA,IAAI,SAAS,CAAC,cAAc,GAAG,QAAQ,CAAC,SAAS,gBAAgB,GAAG;AACpE,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC;AAC1C,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,SAAS,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAC7D,MAAM,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,SAAS,EAAE,OAAO;AACnD;AACA,MAAM,MAAM,IAAI,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC/C;AACA,MAAM,aAAa,GAAG,gBAAgB,CAAC;AACvC;AACA,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM;AAC7B,QAAQ,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AAC9B,UAAU,QAAQ,EAAE,gBAAgB;AACpC,UAAU,OAAO,EAAE,UAAU;AAC7B,UAAU,UAAU,EAAE,UAAU,IAAI,gBAAgB,GAAG,UAAU,IAAI,SAAS;AAC9E,UAAU,OAAO,EAAE,aAAa;AAChC,UAAU,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS;AACzC,UAAU,WAAW,EAAE,IAAI,IAAI,UAAU,IAAI,gBAAgB,IAAI,UAAU;AAC3E,YAAY,CAAC,UAAU,GAAG,gBAAgB,IAAI,IAAI,GAAG,SAAS;AAC9D,SAAS,CAAC,CAAC;AACX,OAAO,CAAC,CAAC;AACT,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;AAC5B;AACA,IAAI,MAAM,QAAQ,GAAG,MAAM;AAC3B,MAAM,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACrC,KAAK,CAAC;AACN;AACA,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC/B,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACjC,GAAG;AACH;AACA,EAAE,KAAK,CAAC,IAAI,EAAE;AACd,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;AACvC;AACA,IAAI,IAAI,SAAS,CAAC,cAAc,EAAE;AAClC,MAAM,SAAS,CAAC,cAAc,EAAE,CAAC;AACjC,KAAK;AACL;AACA,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7B,GAAG;AACH;AACA,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACxC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC;AACtB,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;AACvC,IAAI,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;AACtC;AACA,IAAI,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC;AAC7D;AACA,IAAI,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;AAC5C;AACA,IAAI,MAAM,OAAO,GAAG,IAAI,GAAG,UAAU,CAAC;AACtC,IAAI,MAAM,cAAc,IAAI,OAAO,GAAG,OAAO,CAAC,CAAC;AAC/C,IAAI,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,KAAK,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AACxH;AACA,IAAI,SAAS,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE;AAC1C,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC9C,MAAM,SAAS,CAAC,SAAS,IAAI,KAAK,CAAC;AACnC,MAAM,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC;AAC/B;AACA,MAAM,IAAI,SAAS,CAAC,UAAU,EAAE;AAChC,QAAQ,SAAS,CAAC,cAAc,EAAE,CAAC;AACnC,OAAO;AACP;AACA,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AAC7B,QAAQ,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACpC,OAAO,MAAM;AACb,QAAQ,SAAS,CAAC,cAAc,GAAG,MAAM;AACzC,UAAU,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC;AAC1C,UAAU,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACtC,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL;AACA,IAAI,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK;AAClD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAClD,MAAM,IAAI,cAAc,GAAG,IAAI,CAAC;AAChC,MAAM,IAAI,YAAY,GAAG,qBAAqB,CAAC;AAC/C,MAAM,IAAI,SAAS,CAAC;AACpB,MAAM,IAAI,MAAM,GAAG,CAAC,CAAC;AACrB;AACA,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC/B;AACA,QAAQ,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,MAAM,IAAI,GAAG,GAAG,SAAS,CAAC,EAAE,CAAC,KAAK,UAAU,EAAE;AAC5E,UAAU,SAAS,CAAC,EAAE,GAAG,GAAG,CAAC;AAC7B,UAAU,SAAS,GAAG,cAAc,GAAG,SAAS,CAAC,KAAK,CAAC;AACvD,UAAU,SAAS,CAAC,KAAK,GAAG,SAAS,GAAG,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;AAC3D,UAAU,MAAM,GAAG,CAAC,CAAC;AACrB,SAAS;AACT;AACA,QAAQ,SAAS,GAAG,cAAc,GAAG,SAAS,CAAC,KAAK,CAAC;AACrD,OAAO;AACP;AACA,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,IAAI,SAAS,IAAI,CAAC,EAAE;AAC5B;AACA,UAAU,OAAO,UAAU,CAAC,MAAM;AAClC,YAAY,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpC,WAAW,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC;AAClC,SAAS;AACT;AACA,QAAQ,IAAI,SAAS,GAAG,YAAY,EAAE;AACtC,UAAU,YAAY,GAAG,SAAS,CAAC;AACnC,SAAS;AACT,OAAO;AACP;AACA,MAAM,IAAI,YAAY,IAAI,SAAS,GAAG,YAAY,IAAI,CAAC,SAAS,GAAG,YAAY,IAAI,YAAY,EAAE;AACjG,QAAQ,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACvD,QAAQ,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AAClD,OAAO;AACP;AACA,MAAM,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM;AAC/C,QAAQ,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAC1D,OAAO,GAAG,SAAS,CAAC,CAAC;AACrB,KAAK,CAAC;AACN;AACA,IAAI,cAAc,CAAC,KAAK,EAAE,SAAS,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE;AACnE,MAAM,IAAI,GAAG,EAAE;AACf,QAAQ,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC7B,OAAO;AACP;AACA,MAAM,IAAI,MAAM,EAAE;AAClB,QAAQ,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACnD,OAAO,MAAM;AACb,QAAQ,QAAQ,CAAC,IAAI,CAAC,CAAC;AACvB,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH;AACA,EAAE,SAAS,CAAC,MAAM,EAAE;AACpB,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC;AACtC,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,CAAC;AACD;AACA,+BAAe,oBAAoB;;AC9LnC,MAAM,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC;AAC/B;AACA,MAAM,QAAQ,GAAG,iBAAiB,IAAI,EAAE;AACxC,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE;AACnB,IAAI,OAAO,IAAI,CAAC,MAAM,GAAE;AACxB,GAAG,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE;AAC/B,IAAI,MAAM,MAAM,IAAI,CAAC,WAAW,GAAE;AAClC,GAAG,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE;AAClC,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;AACjC,GAAG,MAAM;AACT,IAAI,MAAM,IAAI,CAAC;AACf,GAAG;AACH,EAAC;AACD;AACA,mBAAe,QAAQ;;ACTvB,MAAM,iBAAiB,GAAGA,OAAK,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC;AAC5D;AACA,MAAM,WAAW,GAAG,IAAIU,gBAAW,EAAE,CAAC;AACtC;AACA,MAAM,IAAI,GAAG,MAAM,CAAC;AACpB,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B;AACA,MAAM,YAAY,CAAC;AACnB,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE;AAC3B,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;AAC1C,IAAI,MAAM,aAAa,GAAGV,OAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAChD;AACA,IAAI,IAAI,OAAO,GAAG,CAAC,sCAAsC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7E,MAAM,CAAC,aAAa,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;AAClF,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AACd;AACA,IAAI,IAAI,aAAa,EAAE;AACvB,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC;AAC9E,KAAK,MAAM;AACX,MAAM,OAAO,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,IAAI,IAAI,0BAA0B,CAAC,EAAE,IAAI,CAAC,EAAC;AACnF,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AACtD;AACA,IAAI,IAAI,CAAC,aAAa,GAAG,aAAa,GAAG,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;AACvE;AACA,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,GAAG,gBAAgB,CAAC;AAChF;AACA,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACvB,GAAG;AACH;AACA,EAAE,OAAO,MAAM,EAAE;AACjB,IAAI,MAAM,IAAI,CAAC,OAAO,CAAC;AACvB;AACA,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AACzB;AACA,IAAI,GAAGA,OAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;AAClC,MAAM,MAAM,KAAK,CAAC;AAClB,KAAK,MAAM;AACX,MAAM,OAAOW,UAAQ,CAAC,KAAK,CAAC,CAAC;AAC7B,KAAK;AACL;AACA,IAAI,MAAM,UAAU,CAAC;AACrB,GAAG;AACH;AACA,EAAE,OAAO,UAAU,CAAC,IAAI,EAAE;AAC1B,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,MAAM;AAC1D,QAAQ,IAAI,GAAG,KAAK;AACpB,QAAQ,IAAI,GAAG,KAAK;AACpB,QAAQ,GAAG,GAAG,KAAK;AACnB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACjB,GAAG;AACH,CAAC;AACD;AACA,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,KAAK;AAC5D,EAAE,MAAM;AACR,IAAI,GAAG,GAAG,oBAAoB;AAC9B,IAAI,IAAI,GAAG,EAAE;AACb,IAAI,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAGX,OAAK,CAAC,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC;AACxE,GAAG,GAAG,OAAO,IAAI,EAAE,CAAC;AACpB;AACA,EAAE,GAAG,CAACA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC9B,IAAI,MAAM,SAAS,CAAC,4BAA4B,CAAC,CAAC;AAClD,GAAG;AACH;AACA,EAAE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,EAAE,EAAE;AACnD,IAAI,MAAM,KAAK,CAAC,wCAAwC,CAAC;AACzD,GAAG;AACH;AACA,EAAE,MAAM,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC;AACnE,EAAE,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAC/E,EAAE,IAAI,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC;AAC7C;AACA,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK;AAClE,IAAI,MAAM,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/C,IAAI,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC;AAC/B,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC,CAAC;AACL;AACA,EAAE,aAAa,IAAI,aAAa,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;AAC3D;AACA,EAAE,aAAa,GAAGA,OAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AACtD;AACA,EAAE,MAAM,eAAe,GAAG;AAC1B,IAAI,cAAc,EAAE,CAAC,8BAA8B,EAAE,QAAQ,CAAC,CAAC;AAC/D,IAAG;AACH;AACA,EAAE,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;AACtC,IAAI,eAAe,CAAC,gBAAgB,CAAC,GAAG,aAAa,CAAC;AACtD,GAAG;AACH;AACA,EAAE,cAAc,IAAI,cAAc,CAAC,eAAe,CAAC,CAAC;AACpD;AACA,EAAE,OAAOY,eAAQ,CAAC,IAAI,CAAC,CAAC,mBAAmB;AAC3C,IAAI,IAAI,MAAM,IAAI,IAAI,KAAK,EAAE;AAC7B,MAAM,MAAM,aAAa,CAAC;AAC1B,MAAM,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,MAAM,WAAW,CAAC;AACtB,GAAG,GAAG,CAAC,CAAC;AACR,CAAC,CAAC;AACF;AACA,2BAAe,gBAAgB;;AC1G/B,MAAM,yBAAyB,SAASH,0BAAM,CAAC,SAAS,CAAC;AACzD,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACzC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB,IAAI,QAAQ,EAAE,CAAC;AACf,GAAG;AACH;AACA,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACxC,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC5B,MAAM,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;AACzC;AACA;AACA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AAC5B,QAAQ,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACvC,QAAQ,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AACxB,QAAQ,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AACxB,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACpC,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAChD,GAAG;AACH,CAAC;AACD;AACA,oCAAe,yBAAyB;;ACzBxC,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,OAAO,KAAK;AACrC,EAAE,OAAOT,OAAK,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,UAAU,GAAG,IAAI,EAAE;AAClD,IAAI,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC1B,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK;AACzC,MAAM,IAAI;AACV,QAAQ,OAAO,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAChE,OAAO,CAAC,OAAO,GAAG,EAAE;AACpB,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;AAChB,OAAO;AACP,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,GAAG,GAAG,EAAE,CAAC;AACT,EAAC;AACD;AACA,sBAAe,WAAW;;ACY1B,MAAM,WAAW,GAAG;AACpB,EAAE,KAAK,EAAEa,wBAAI,CAAC,SAAS,CAAC,YAAY;AACpC,EAAE,WAAW,EAAEA,wBAAI,CAAC,SAAS,CAAC,YAAY;AAC1C,CAAC,CAAC;AACF;AACA,MAAM,aAAa,GAAG;AACtB,EAAE,KAAK,EAAEA,wBAAI,CAAC,SAAS,CAAC,sBAAsB;AAC9C,EAAE,WAAW,EAAEA,wBAAI,CAAC,SAAS,CAAC,sBAAsB;AACpD,EAAC;AACD;AACA,MAAM,iBAAiB,GAAGb,OAAK,CAAC,UAAU,CAACa,wBAAI,CAAC,sBAAsB,CAAC,CAAC;AACxE;AACA,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,GAAGC,mCAAe,CAAC;AAC/D;AACA,MAAM,OAAO,GAAG,SAAS,CAAC;AAC1B;AACA,MAAM,kBAAkB,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,IAAI;AAC9D,EAAE,OAAO,QAAQ,GAAG,GAAG,CAAC;AACxB,CAAC,CAAC,CAAC;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB,CAAC,OAAO,EAAE,eAAe,EAAE;AAC1D,EAAE,IAAI,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE;AACrC,IAAI,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3C,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE;AACtC,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAC7D,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE;AAClD,EAAE,IAAI,KAAK,GAAG,WAAW,CAAC;AAC1B,EAAE,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK,EAAE;AACjC,IAAI,MAAM,QAAQ,GAAGC,2BAAc,CAAC,QAAQ,CAAC,CAAC;AAC9C,IAAI,IAAI,QAAQ,EAAE;AAClB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;AAChC,KAAK;AACL,GAAG;AACH,EAAE,IAAI,KAAK,EAAE;AACb;AACA,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE;AACxB,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;AACzE,KAAK;AACL;AACA,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;AACpB;AACA,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE;AACtD,QAAQ,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;AACrF,OAAO;AACP,MAAM,MAAM,MAAM,GAAG,MAAM;AAC3B,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;AACjC,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,QAAQ,GAAG,MAAM,CAAC;AACjE,KAAK;AACL;AACA,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;AACvF,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;AACnD,IAAI,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;AACjC;AACA,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;AAC7B,IAAI,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC9B,IAAI,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC;AAC5B,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE;AACxB,MAAM,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,GAAG,SAAS,cAAc,CAAC,eAAe,EAAE;AAC3E;AACA;AACA,IAAI,QAAQ,CAAC,eAAe,EAAE,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;AACjE,GAAG,CAAC;AACJ,CAAC;AACD;AACA,MAAM,sBAAsB,GAAG,OAAO,OAAO,KAAK,WAAW,IAAIf,OAAK,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC;AACrG;AACA;AACA;AACA,MAAM,SAAS,GAAG,CAAC,aAAa,KAAK;AACrC,EAAE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC1C,IAAI,IAAI,MAAM,CAAC;AACf,IAAI,IAAI,MAAM,CAAC;AACf;AACA,IAAI,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK;AACxC,MAAM,IAAI,MAAM,EAAE,OAAO;AACzB,MAAM,MAAM,GAAG,IAAI,CAAC;AACpB,MAAM,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAC1C,MAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK;AAChC,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;AAClB,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;AACrB,KAAK,CAAC;AACN;AACA,IAAI,MAAM,OAAO,GAAG,CAAC,MAAM,KAAK;AAChC,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACzB,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;AACrB,MAAK;AACL;AACA,IAAI,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,aAAa,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACjG,GAAG,CAAC;AACJ,CAAC,CAAC;AACF;AACA,MAAM,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK;AAC7C,EAAE,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AAChC,IAAI,MAAM,SAAS,CAAC,0BAA0B,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,QAAQ;AACV,IAAI,OAAO;AACX,IAAI,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxD,GAAG,EAAE;AACL,EAAC;AACD;AACA,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,CAACA,OAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACpH;AACA;AACA,oBAAe,sBAAsB,IAAI,SAAS,WAAW,CAAC,MAAM,EAAE;AACtE,EAAE,OAAO,SAAS,CAAC,eAAe,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE;AAC/E,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;AACxC,IAAI,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAAC,GAAG,MAAM,CAAC;AACpD,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;AAC/C,IAAI,IAAI,MAAM,CAAC;AACf,IAAI,IAAI,QAAQ,GAAG,KAAK,CAAC;AACzB,IAAI,IAAI,GAAG,CAAC;AACZ;AACA,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,OAAO,GAAGgB,aAAW,CAAC,MAAM,EAAE,CAAC,KAAK,KAAKhB,OAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7F;AACA,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,KAAK;AACtC,QAAQ,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,KAAK;AACpD,UAAU,IAAI,GAAG,EAAE;AACnB,YAAY,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;AAC3B,WAAW;AACX;AACA,UAAU,MAAM,SAAS,GAAGA,OAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAC9H;AACA,UAAU,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5F,SAAS,CAAC,CAAC;AACX,QAAO;AACP,KAAK;AACL;AACA;AACA,IAAI,MAAM,OAAO,GAAG,IAAIiB,gCAAY,EAAE,CAAC;AACvC;AACA,IAAI,MAAM,UAAU,GAAG,MAAM;AAC7B,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE;AAC9B,QAAQ,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9C,OAAO;AACP;AACA,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACzB,QAAQ,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC1D,OAAO;AACP;AACA,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;AACnC,MAAK;AACL;AACA,IAAI,MAAM,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK;AAClC,MAAM,MAAM,GAAG,IAAI,CAAC;AACpB,MAAM,IAAI,UAAU,EAAE;AACtB,QAAQ,QAAQ,GAAG,IAAI,CAAC;AACxB,QAAQ,UAAU,EAAE,CAAC;AACrB,OAAO;AACP,KAAK,CAAC,CAAC;AACP;AACA,IAAI,SAAS,KAAK,CAAC,MAAM,EAAE;AAC3B,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;AACpG,KAAK;AACL;AACA,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAClC;AACA,IAAI,IAAI,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE;AAC7C,MAAM,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAChE,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACzB,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACzF,OAAO;AACP,KAAK;AACL;AACA;AACA,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/D,IAAI,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AACzD,IAAI,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAC9D;AACA,IAAI,IAAI,QAAQ,KAAK,OAAO,EAAE;AAC9B,MAAM,IAAI,aAAa,CAAC;AACxB;AACA,MAAM,IAAI,MAAM,KAAK,KAAK,EAAE;AAC5B,QAAQ,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;AACvC,UAAU,MAAM,EAAE,GAAG;AACrB,UAAU,UAAU,EAAE,oBAAoB;AAC1C,UAAU,OAAO,EAAE,EAAE;AACrB,UAAU,MAAM;AAChB,SAAS,CAAC,CAAC;AACX,OAAO;AACP;AACA,MAAM,IAAI;AACV,QAAQ,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,YAAY,KAAK,MAAM,EAAE;AACzE,UAAU,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI;AAC7C,SAAS,CAAC,CAAC;AACX,OAAO,CAAC,OAAO,GAAG,EAAE;AACpB,QAAQ,MAAM,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AACvE,OAAO;AACP;AACA,MAAM,IAAI,YAAY,KAAK,MAAM,EAAE;AACnC,QAAQ,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACjE;AACA,QAAQ,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,KAAK,MAAM,EAAE;AAC9D,UAAU,aAAa,GAAGjB,OAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AACxD,SAAS;AACT,OAAO,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;AAC5C,QAAQ,aAAa,GAAGS,0BAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAC5D,OAAO;AACP;AACA,MAAM,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;AACrC,QAAQ,IAAI,EAAE,aAAa;AAC3B,QAAQ,MAAM,EAAE,GAAG;AACnB,QAAQ,UAAU,EAAE,IAAI;AACxB,QAAQ,OAAO,EAAE,IAAID,cAAY,EAAE;AACnC,QAAQ,MAAM;AACd,OAAO,CAAC,CAAC;AACT,KAAK;AACL;AACA,IAAI,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;AACrD,MAAM,OAAO,MAAM,CAAC,IAAI,UAAU;AAClC,QAAQ,uBAAuB,GAAG,QAAQ;AAC1C,QAAQ,UAAU,CAAC,eAAe;AAClC,QAAQ,MAAM;AACd,OAAO,CAAC,CAAC;AACT,KAAK;AACL;AACA,IAAI,MAAM,OAAO,GAAGA,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;AAClE;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,KAAK,CAAC,CAAC;AACzD;AACA,IAAI,MAAM,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACzD,IAAI,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACrD,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACnC,IAAI,IAAI,aAAa,GAAG,SAAS,CAAC;AAClC,IAAI,IAAI,eAAe,GAAG,SAAS,CAAC;AACpC;AACA;AACA,IAAI,IAAIR,OAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE;AACzC,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,6BAA6B,CAAC,CAAC;AACjF;AACA,MAAM,IAAI,GAAGkB,kBAAgB,CAAC,IAAI,EAAE,CAAC,WAAW,KAAK;AACrD,QAAQ,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,OAAO,EAAE;AACT,QAAQ,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC;AACxC,QAAQ,QAAQ,EAAE,YAAY,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,SAAS;AAC9D,OAAO,CAAC,CAAC;AACT;AACA,KAAK,MAAM,IAAIlB,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAIA,OAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;AAC5E,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;AACrC;AACA,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE;AACvC,QAAQ,IAAI;AACZ,UAAU,MAAM,WAAW,GAAG,MAAMmB,wBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9E,UAAU,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,IAAI,CAAC,IAAI,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACpG;AACA,SAAS,CAAC,OAAO,CAAC,EAAE;AACpB,SAAS;AACT,OAAO;AACP,KAAK,MAAM,IAAInB,OAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AACnC,MAAM,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,0BAA0B,CAAC,CAAC;AACnF,MAAM,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;AAC/C,MAAM,IAAI,GAAGS,0BAAM,CAAC,QAAQ,CAAC,IAAI,CAACE,UAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAClD,KAAK,MAAM,IAAI,IAAI,IAAI,CAACX,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC9C,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAE1B,MAAM,IAAIA,OAAK,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE;AAC5C,QAAQ,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,OAAO,MAAM,IAAIA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AACvC,QAAQ,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1C,OAAO,MAAM;AACb,QAAQ,OAAO,MAAM,CAAC,IAAI,UAAU;AACpC,UAAU,mFAAmF;AAC7F,UAAU,UAAU,CAAC,eAAe;AACpC,UAAU,MAAM;AAChB,SAAS,CAAC,CAAC;AACX,OAAO;AACP;AACA;AACA,MAAM,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACnD;AACA,MAAM,IAAI,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,aAAa,EAAE;AAC3E,QAAQ,OAAO,MAAM,CAAC,IAAI,UAAU;AACpC,UAAU,8CAA8C;AACxD,UAAU,UAAU,CAAC,eAAe;AACpC,UAAU,MAAM;AAChB,SAAS,CAAC,CAAC;AACX,OAAO;AACP,KAAK;AACL;AACA,IAAI,MAAM,aAAa,GAAGA,OAAK,CAAC,cAAc,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC3E;AACA,IAAI,IAAIA,OAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAChC,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AACjC,MAAM,eAAe,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AACnC,KAAK,MAAM;AACX,MAAM,aAAa,GAAG,eAAe,GAAG,OAAO,CAAC;AAChD,KAAK;AACL;AACA,IAAI,IAAI,IAAI,KAAK,gBAAgB,IAAI,aAAa,CAAC,EAAE;AACrD,MAAM,IAAI,CAACA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AACjC,QAAQ,IAAI,GAAGS,0BAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;AAC/D,OAAO;AACP;AACA,MAAM,IAAI,GAAGA,0BAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,IAAIW,sBAAoB,CAAC;AAC7D,QAAQ,MAAM,EAAE,aAAa;AAC7B,QAAQ,OAAO,EAAEpB,OAAK,CAAC,cAAc,CAAC,aAAa,CAAC;AACpD,OAAO,CAAC,CAAC,EAAEA,OAAK,CAAC,IAAI,CAAC,CAAC;AACvB;AACA,MAAM,gBAAgB,IAAI,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,IAAI;AAC1D,QAAQ,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;AACjD,UAAU,MAAM,EAAE,IAAI;AACtB,SAAS,CAAC,CAAC,CAAC;AACZ,OAAO,CAAC,CAAC;AACT,KAAK;AACL;AACA;AACA,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC;AACzB,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE;AACrB,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;AAClD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;AAClD,MAAM,IAAI,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;AACvC,KAAK;AACL;AACA,IAAI,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE;AAClC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC1C,MAAM,IAAI,GAAG,WAAW,GAAG,GAAG,GAAG,WAAW,CAAC;AAC7C,KAAK;AACL;AACA,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAC5C;AACA,IAAI,IAAI,IAAI,CAAC;AACb;AACA,IAAI,IAAI;AACR,MAAM,IAAI,GAAG,QAAQ;AACrB,QAAQ,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM;AACvC,QAAQ,MAAM,CAAC,MAAM;AACrB,QAAQ,MAAM,CAAC,gBAAgB;AAC/B,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC3B,KAAK,CAAC,OAAO,GAAG,EAAE;AAClB,MAAM,MAAM,SAAS,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC/C,MAAM,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;AAChC,MAAM,SAAS,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;AACjC,MAAM,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC;AAC9B,MAAM,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;AAC/B,KAAK;AACL;AACA,IAAI,OAAO,CAAC,GAAG;AACf,MAAM,iBAAiB;AACvB,MAAM,yBAAyB,IAAI,iBAAiB,GAAG,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK;AAC1E,OAAO,CAAC;AACR;AACA,IAAI,MAAM,OAAO,GAAG;AACpB,MAAM,IAAI;AACV,MAAM,MAAM,EAAE,MAAM;AACpB,MAAM,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE;AAC/B,MAAM,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,UAAU,EAAE;AAClE,MAAM,IAAI;AACV,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,cAAc,EAAE,sBAAsB;AAC5C,MAAM,eAAe,EAAE,EAAE;AACzB,KAAK,CAAC;AACN;AACA;AACA,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AAC5D;AACA,IAAI,IAAI,MAAM,CAAC,UAAU,EAAE;AAC3B,MAAM,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC7C,KAAK,MAAM;AACX,MAAM,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACzC,MAAM,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;AACjC,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACjI,KAAK;AACL;AACA,IAAI,IAAI,SAAS,CAAC;AAClB,IAAI,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC1D,IAAI,OAAO,CAAC,KAAK,GAAG,cAAc,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC;AAC1E,IAAI,IAAI,MAAM,CAAC,SAAS,EAAE;AAC1B,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AACnC,KAAK,MAAM,IAAI,MAAM,CAAC,YAAY,KAAK,CAAC,EAAE;AAC1C,MAAM,SAAS,GAAG,cAAc,GAAGqB,yBAAK,GAAGC,wBAAI,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,MAAM,CAAC,YAAY,EAAE;AAC/B,QAAQ,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACnD,OAAO;AACP,MAAM,IAAI,MAAM,CAAC,cAAc,EAAE;AACjC,QAAQ,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/D,OAAO;AACP,MAAM,SAAS,GAAG,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC;AAC5D,KAAK;AACL;AACA,IAAI,IAAI,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,EAAE;AACnC,MAAM,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AACnD,KAAK,MAAM;AACX;AACA,MAAM,OAAO,CAAC,aAAa,GAAG,QAAQ,CAAC;AACvC,KAAK;AACL;AACA,IAAI,IAAI,MAAM,CAAC,kBAAkB,EAAE;AACnC,MAAM,OAAO,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC7D,KAAK;AACL;AACA;AACA,IAAI,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,cAAc,CAAC,GAAG,EAAE;AAClE,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,OAAO;AAChC;AACA,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAC5B;AACA,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC5D;AACA,MAAM,IAAI,kBAAkB,EAAE;AAC9B,QAAQ,MAAM,eAAe,GAAG,IAAIF,sBAAoB,CAAC;AACzD,UAAU,MAAM,EAAEpB,OAAK,CAAC,cAAc,CAAC,cAAc,CAAC;AACtD,UAAU,OAAO,EAAEA,OAAK,CAAC,cAAc,CAAC,eAAe,CAAC;AACxD,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,kBAAkB,IAAI,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,IAAI;AACzE,UAAU,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;AACrD,YAAY,QAAQ,EAAE,IAAI;AAC1B,WAAW,CAAC,CAAC,CAAC;AACd,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACtC,OAAO;AACP;AACA;AACA,MAAM,IAAI,cAAc,GAAG,GAAG,CAAC;AAC/B;AACA;AACA,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC;AACzC;AACA;AACA,MAAM,IAAI,MAAM,CAAC,UAAU,KAAK,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;AAC1E;AACA;AACA,QAAQ,IAAI,MAAM,KAAK,MAAM,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE;AACzD,UAAU,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACjD,SAAS;AACT;AACA,QAAQ,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE;AACrE;AACA,QAAQ,KAAK,MAAM,CAAC;AACpB,QAAQ,KAAK,QAAQ,CAAC;AACtB,QAAQ,KAAK,UAAU,CAAC;AACxB,QAAQ,KAAK,YAAY;AACzB;AACA,UAAU,OAAO,CAAC,IAAI,CAACa,wBAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;AACtD;AACA;AACA,UAAU,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACjD,UAAU,MAAM;AAChB,QAAQ,KAAK,SAAS;AACtB,UAAU,OAAO,CAAC,IAAI,CAAC,IAAIU,2BAAyB,EAAE,CAAC,CAAC;AACxD;AACA;AACA,UAAU,OAAO,CAAC,IAAI,CAACV,wBAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;AACtD;AACA;AACA,UAAU,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACjD,UAAU,MAAM;AAChB,QAAQ,KAAK,IAAI;AACjB,UAAU,IAAI,iBAAiB,EAAE;AACjC,YAAY,OAAO,CAAC,IAAI,CAACA,wBAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,CAAC;AACrE,YAAY,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACnD,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,GAAGJ,0BAAM,CAAC,QAAQ,CAAC,OAAO,EAAET,OAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC9F;AACA,MAAM,MAAM,YAAY,GAAGS,0BAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM;AACjE,QAAQ,YAAY,EAAE,CAAC;AACvB,QAAQ,UAAU,EAAE,CAAC;AACrB,OAAO,CAAC,CAAC;AACT;AACA,MAAM,MAAM,QAAQ,GAAG;AACvB,QAAQ,MAAM,EAAE,GAAG,CAAC,UAAU;AAC9B,QAAQ,UAAU,EAAE,GAAG,CAAC,aAAa;AACrC,QAAQ,OAAO,EAAE,IAAID,cAAY,CAAC,GAAG,CAAC,OAAO,CAAC;AAC9C,QAAQ,MAAM;AACd,QAAQ,OAAO,EAAE,WAAW;AAC5B,OAAO,CAAC;AACR;AACA,MAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;AACrC,QAAQ,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC;AACvC,QAAQ,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC1C,OAAO,MAAM;AACb,QAAQ,MAAM,cAAc,GAAG,EAAE,CAAC;AAClC,QAAQ,IAAI,kBAAkB,GAAG,CAAC,CAAC;AACnC;AACA,QAAQ,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,gBAAgB,CAAC,KAAK,EAAE;AACnE,UAAU,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,UAAU,kBAAkB,IAAI,KAAK,CAAC,MAAM,CAAC;AAC7C;AACA;AACA,UAAU,IAAI,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAC,IAAI,kBAAkB,GAAG,MAAM,CAAC,gBAAgB,EAAE;AAC5F;AACA,YAAY,QAAQ,GAAG,IAAI,CAAC;AAC5B,YAAY,cAAc,CAAC,OAAO,EAAE,CAAC;AACrC,YAAY,MAAM,CAAC,IAAI,UAAU,CAAC,2BAA2B,GAAG,MAAM,CAAC,gBAAgB,GAAG,WAAW;AACrG,cAAc,UAAU,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AACjE,WAAW;AACX,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,oBAAoB,GAAG;AACrE,UAAU,IAAI,QAAQ,EAAE;AACxB,YAAY,OAAO;AACnB,WAAW;AACX;AACA,UAAU,MAAM,GAAG,GAAG,IAAI,UAAU;AACpC,YAAY,2BAA2B,GAAG,MAAM,CAAC,gBAAgB,GAAG,WAAW;AAC/E,YAAY,UAAU,CAAC,gBAAgB;AACvC,YAAY,MAAM;AAClB,YAAY,WAAW;AACvB,WAAW,CAAC;AACZ,UAAU,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACtC,UAAU,MAAM,CAAC,GAAG,CAAC,CAAC;AACtB,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,iBAAiB,CAAC,GAAG,EAAE;AACnE,UAAU,IAAI,GAAG,CAAC,SAAS,EAAE,OAAO;AACpC,UAAU,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAClE,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,eAAe,GAAG;AAC5D,UAAU,IAAI;AACd,YAAY,IAAI,YAAY,GAAG,cAAc,CAAC,MAAM,KAAK,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAC/G,YAAY,IAAI,YAAY,KAAK,aAAa,EAAE;AAChD,cAAc,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACrE,cAAc,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,KAAK,MAAM,EAAE;AACpE,gBAAgB,YAAY,GAAGR,OAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAC5D,eAAe;AACf,aAAa;AACb,YAAY,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC;AACzC,WAAW,CAAC,OAAO,GAAG,EAAE;AACxB,YAAY,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC1F,WAAW;AACX,UAAU,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC5C,SAAS,CAAC,CAAC;AACX,OAAO;AACP;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI;AACnC,QAAQ,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE;AACvC,UAAU,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAC5C,UAAU,cAAc,CAAC,OAAO,EAAE,CAAC;AACnC,SAAS;AACT,OAAO,CAAC,CAAC;AACT,KAAK,CAAC,CAAC;AACP;AACA,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI;AACjC,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;AAClB,MAAM,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACvB,KAAK,CAAC,CAAC;AACP;AACA;AACA,IAAI,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,kBAAkB,CAAC,GAAG,EAAE;AACrD;AACA;AACA,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;AACtD,KAAK,CAAC,CAAC;AACP;AACA;AACA,IAAI,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,mBAAmB,CAAC,MAAM,EAAE;AAC1D;AACA,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAC3C,KAAK,CAAC,CAAC;AACP;AACA;AACA,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE;AACxB;AACA,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACnD;AACA,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;AACjC,QAAQ,MAAM,CAAC,IAAI,UAAU;AAC7B,UAAU,+CAA+C;AACzD,UAAU,UAAU,CAAC,oBAAoB;AACzC,UAAU,MAAM;AAChB,UAAU,GAAG;AACb,SAAS,CAAC,CAAC;AACX;AACA,QAAQ,OAAO;AACf,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,oBAAoB,GAAG;AAC9D,QAAQ,IAAI,MAAM,EAAE,OAAO;AAC3B,QAAQ,IAAI,mBAAmB,GAAG,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAC;AACvH,QAAQ,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,oBAAoB,CAAC;AACzE,QAAQ,IAAI,MAAM,CAAC,mBAAmB,EAAE;AACxC,UAAU,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAC3D,SAAS;AACT,QAAQ,MAAM,CAAC,IAAI,UAAU;AAC7B,UAAU,mBAAmB;AAC7B,UAAU,YAAY,CAAC,mBAAmB,GAAG,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC,YAAY;AAC3F,UAAU,MAAM;AAChB,UAAU,GAAG;AACb,SAAS,CAAC,CAAC;AACX,QAAQ,KAAK,EAAE,CAAC;AAChB,OAAO,CAAC,CAAC;AACT,KAAK;AACL;AACA;AACA;AACA,IAAI,IAAIA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC9B,MAAM,IAAI,KAAK,GAAG,KAAK,CAAC;AACxB,MAAM,IAAI,OAAO,GAAG,KAAK,CAAC;AAC1B;AACA,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM;AAC3B,QAAQ,KAAK,GAAG,IAAI,CAAC;AACrB,OAAO,CAAC,CAAC;AACT;AACA,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI;AAChC,QAAQ,OAAO,GAAG,IAAI,CAAC;AACvB,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACzB,OAAO,CAAC,CAAC;AACT;AACA,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM;AAC7B,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE;AAChC,UAAU,KAAK,CAAC,IAAI,aAAa,CAAC,iCAAiC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;AACnF,SAAS;AACT,OAAO,CAAC,CAAC;AACT;AACA,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrB,KAAK,MAAM;AACX,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;ACvqBA,gBAAe,QAAQ,CAAC,qBAAqB;AAC7C;AACA;AACA,EAAE;AACF,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACtD,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,GAAG,GAAG,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D;AACA,MAAMA,OAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC3F;AACA,MAAMA,OAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAC1D;AACA,MAAMA,OAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;AAChE;AACA,MAAM,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/C;AACA,MAAM,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1C,KAAK;AACL;AACA,IAAI,IAAI,CAAC,IAAI,EAAE;AACf,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,YAAY,GAAG,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC;AACzF,MAAM,QAAQ,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE;AAC3D,KAAK;AACL;AACA,IAAI,MAAM,CAAC,IAAI,EAAE;AACjB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC;AAClD,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA,EAAE;AACF,IAAI,KAAK,GAAG,EAAE;AACd,IAAI,IAAI,GAAG;AACX,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,GAAG,EAAE;AACf,GAAG;;ACnCH,wBAAe,QAAQ,CAAC,qBAAqB;AAC7C;AACA;AACA;AACA,EAAE,CAAC,SAAS,kBAAkB,GAAG;AACjC,IAAI,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAC7D,IAAI,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AACvD,IAAI,IAAI,SAAS,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,CAAC,GAAG,EAAE;AAC7B,MAAM,IAAI,IAAI,GAAG,GAAG,CAAC;AACrB;AACA,MAAM,IAAI,IAAI,EAAE;AAChB;AACA,QAAQ,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAClD,QAAQ,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;AACnC,OAAO;AACP;AACA,MAAM,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAChD;AACA;AACA,MAAM,OAAO;AACb,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,QAAQ,EAAE,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE;AAC1F,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE;AACrF,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,EAAE;AAC9E,QAAQ,QAAQ,EAAE,cAAc,CAAC,QAAQ;AACzC,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,QAAQ,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;AAC5D,UAAU,cAAc,CAAC,QAAQ;AACjC,UAAU,GAAG,GAAG,cAAc,CAAC,QAAQ;AACvC,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,SAAS,eAAe,CAAC,UAAU,EAAE;AAChD,MAAM,MAAM,MAAM,GAAG,CAACA,OAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;AACxF,MAAM,QAAQ,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;AACpD,UAAU,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE;AAC1C,KAAK,CAAC;AACN,GAAG,GAAG;AACN;AACA;AACA,EAAE,CAAC,SAAS,qBAAqB,GAAG;AACpC,IAAI,OAAO,SAAS,eAAe,GAAG;AACtC,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK,CAAC;AACN,GAAG,GAAG;;AClDN,SAAS,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE;AAC1D,EAAE,IAAI,aAAa,GAAG,CAAC,CAAC;AACxB,EAAE,MAAM,YAAY,GAAG,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC5C;AACA,EAAE,OAAO,CAAC,IAAI;AACd,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AAC5B,IAAI,MAAM,KAAK,GAAG,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;AAC3D,IAAI,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC;AACjD,IAAI,MAAM,IAAI,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC7C,IAAI,MAAM,OAAO,GAAG,MAAM,IAAI,KAAK,CAAC;AACpC;AACA,IAAI,aAAa,GAAG,MAAM,CAAC;AAC3B;AACA,IAAI,MAAM,IAAI,GAAG;AACjB,MAAM,MAAM;AACZ,MAAM,KAAK;AACX,MAAM,QAAQ,EAAE,KAAK,IAAI,MAAM,GAAG,KAAK,IAAI,SAAS;AACpD,MAAM,KAAK,EAAE,aAAa;AAC1B,MAAM,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS;AACnC,MAAM,SAAS,EAAE,IAAI,IAAI,KAAK,IAAI,OAAO,GAAG,CAAC,KAAK,GAAG,MAAM,IAAI,IAAI,GAAG,SAAS;AAC/E,MAAM,KAAK,EAAE,CAAC;AACd,KAAK,CAAC;AACN;AACA,IAAI,IAAI,CAAC,gBAAgB,GAAG,UAAU,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC;AAC1D;AACA,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,GAAG,CAAC;AACJ,CAAC;AACD;AACA,MAAM,qBAAqB,GAAG,OAAO,cAAc,KAAK,WAAW,CAAC;AACpE;AACA,mBAAe,qBAAqB,IAAI,UAAU,MAAM,EAAE;AAC1D,EAAE,OAAO,IAAI,OAAO,CAAC,SAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE;AAClE,IAAI,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC;AAClC,IAAI,MAAM,cAAc,GAAGQ,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;AACzE,IAAI,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,MAAM,CAAC;AAC/C,IAAI,IAAI,UAAU,CAAC;AACnB,IAAI,SAAS,IAAI,GAAG;AACpB,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE;AAC9B,QAAQ,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACnD,OAAO;AACP;AACA,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACzB,QAAQ,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC/D,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,WAAW,CAAC;AACpB;AACA,IAAI,IAAIR,OAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;AACvC,MAAM,IAAI,QAAQ,CAAC,qBAAqB,IAAI,QAAQ,CAAC,8BAA8B,EAAE;AACrF,QAAQ,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAC7C,OAAO,MAAM,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC,cAAc,EAAE,MAAM,KAAK,EAAE;AAC5E;AACA,QAAQ,MAAM,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;AACvH,QAAQ,cAAc,CAAC,cAAc,CAAC,CAAC,IAAI,IAAI,qBAAqB,EAAE,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7F,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;AACvC;AACA;AACA,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE;AACrB,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;AAClD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;AACtG,MAAM,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC;AACtF,KAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/D;AACA,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;AAChH;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACrC;AACA,IAAI,SAAS,SAAS,GAAG;AACzB,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,eAAe,GAAGQ,cAAY,CAAC,IAAI;AAC/C,QAAQ,uBAAuB,IAAI,OAAO,IAAI,OAAO,CAAC,qBAAqB,EAAE;AAC7E,OAAO,CAAC;AACR,MAAM,MAAM,YAAY,GAAG,CAAC,YAAY,IAAI,YAAY,KAAK,MAAM,IAAI,YAAY,KAAK,MAAM;AAC9F,QAAQ,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChD,MAAM,MAAM,QAAQ,GAAG;AACvB,QAAQ,IAAI,EAAE,YAAY;AAC1B,QAAQ,MAAM,EAAE,OAAO,CAAC,MAAM;AAC9B,QAAQ,UAAU,EAAE,OAAO,CAAC,UAAU;AACtC,QAAQ,OAAO,EAAE,eAAe;AAChC,QAAQ,MAAM;AACd,QAAQ,OAAO;AACf,OAAO,CAAC;AACR;AACA,MAAM,MAAM,CAAC,SAAS,QAAQ,CAAC,KAAK,EAAE;AACtC,QAAQ,OAAO,CAAC,KAAK,CAAC,CAAC;AACvB,QAAQ,IAAI,EAAE,CAAC;AACf,OAAO,EAAE,SAAS,OAAO,CAAC,GAAG,EAAE;AAC/B,QAAQ,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,QAAQ,IAAI,EAAE,CAAC;AACf,OAAO,EAAE,QAAQ,CAAC,CAAC;AACnB;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK;AACL;AACA,IAAI,IAAI,WAAW,IAAI,OAAO,EAAE;AAChC;AACA,MAAM,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;AACpC,KAAK,MAAM;AACX;AACA,MAAM,OAAO,CAAC,kBAAkB,GAAG,SAAS,UAAU,GAAG;AACzD,QAAQ,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,CAAC,EAAE;AAClD,UAAU,OAAO;AACjB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;AAC1G,UAAU,OAAO;AACjB,SAAS;AACT;AACA;AACA,QAAQ,UAAU,CAAC,SAAS,CAAC,CAAC;AAC9B,OAAO,CAAC;AACR,KAAK;AACL;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,WAAW,GAAG;AAC7C,MAAM,IAAI,CAAC,OAAO,EAAE;AACpB,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,MAAM,CAAC,IAAI,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1F;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,WAAW,GAAG;AAC7C;AACA;AACA,MAAM,MAAM,CAAC,IAAI,UAAU,CAAC,eAAe,EAAE,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACvF;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,aAAa,GAAG;AACjD,MAAM,IAAI,mBAAmB,GAAG,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAC;AACrH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,oBAAoB,CAAC;AACvE,MAAM,IAAI,MAAM,CAAC,mBAAmB,EAAE;AACtC,QAAQ,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACzD,OAAO;AACP,MAAM,MAAM,CAAC,IAAI,UAAU;AAC3B,QAAQ,mBAAmB;AAC3B,QAAQ,YAAY,CAAC,mBAAmB,GAAG,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC,YAAY;AACzF,QAAQ,MAAM;AACd,QAAQ,OAAO,CAAC,CAAC,CAAC;AAClB;AACA;AACA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,KAAK,CAAC;AACN;AACA;AACA;AACA;AACA,IAAI,GAAG,QAAQ,CAAC,qBAAqB,EAAE;AACvC,MAAM,aAAa,IAAIR,OAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAClG;AACA,MAAM,IAAI,aAAa,KAAK,aAAa,KAAK,KAAK,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAE;AACnF;AACA,QAAQ,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAChH;AACA,QAAQ,IAAI,SAAS,EAAE;AACvB,UAAU,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;AAC/D,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA,IAAI,WAAW,KAAK,SAAS,IAAI,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACrE;AACA;AACA,IAAI,IAAI,kBAAkB,IAAI,OAAO,EAAE;AACvC,MAAMA,OAAK,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE;AACjF,QAAQ,OAAO,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC3C,OAAO,CAAC,CAAC;AACT,KAAK;AACL;AACA;AACA,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;AACpD,MAAM,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC;AACzD,KAAK;AACL;AACA;AACA,IAAI,IAAI,YAAY,IAAI,YAAY,KAAK,MAAM,EAAE;AACjD,MAAM,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACjD,KAAK;AACL;AACA;AACA,IAAI,IAAI,OAAO,MAAM,CAAC,kBAAkB,KAAK,UAAU,EAAE;AACzD,MAAM,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,oBAAoB,CAAC,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC;AAClG,KAAK;AACL;AACA;AACA,IAAI,IAAI,OAAO,MAAM,CAAC,gBAAgB,KAAK,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE;AACzE,MAAM,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACjG,KAAK;AACL;AACA,IAAI,IAAI,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE;AAC7C;AACA;AACA,MAAM,UAAU,GAAG,MAAM,IAAI;AAC7B,QAAQ,IAAI,CAAC,OAAO,EAAE;AACtB,UAAU,OAAO;AACjB,SAAS;AACT,QAAQ,MAAM,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;AAC3F,QAAQ,OAAO,CAAC,KAAK,EAAE,CAAC;AACxB,QAAQ,OAAO,GAAG,IAAI,CAAC;AACvB,OAAO,CAAC;AACR;AACA,MAAM,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACrE,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACzB,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,GAAG,UAAU,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACnG,OAAO;AACP,KAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC7C;AACA,IAAI,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;AACjE,MAAM,MAAM,CAAC,IAAI,UAAU,CAAC,uBAAuB,GAAG,QAAQ,GAAG,GAAG,EAAE,UAAU,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;AAC3G,MAAM,OAAO;AACb,KAAK;AACL;AACA;AACA;AACA,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;AACtC,GAAG,CAAC,CAAC;AACL;;AC9PA,MAAM,aAAa,GAAG;AACtB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,GAAG,EAAE,UAAU;AACjB,EAAC;AACD;AACAA,OAAK,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,KAAK,KAAK;AAC5C,EAAE,IAAI,EAAE,EAAE;AACV,IAAI,IAAI;AACR,MAAM,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB;AACA,KAAK;AACL,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACtD,GAAG;AACH,CAAC,CAAC,CAAC;AACH;AACA,MAAM,YAAY,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C;AACA,MAAM,gBAAgB,GAAG,CAAC,OAAO,KAAKA,OAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC;AACzG;AACA,iBAAe;AACf,EAAE,UAAU,EAAE,CAAC,QAAQ,KAAK;AAC5B,IAAI,QAAQ,GAAGA,OAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/D;AACA,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;AAC9B,IAAI,IAAI,aAAa,CAAC;AACtB,IAAI,IAAI,OAAO,CAAC;AAChB;AACA,IAAI,MAAM,eAAe,GAAG,EAAE,CAAC;AAC/B;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAClC,MAAM,IAAI,EAAE,CAAC;AACb;AACA,MAAM,OAAO,GAAG,aAAa,CAAC;AAC9B;AACA,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE;AAC5C,QAAQ,OAAO,GAAG,aAAa,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;AAC5E;AACA,QAAQ,IAAI,OAAO,KAAK,SAAS,EAAE;AACnC,UAAU,MAAM,IAAI,UAAU,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,SAAS;AACT,OAAO;AACP;AACA,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,MAAM;AACd,OAAO;AACP;AACA,MAAM,eAAe,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/C,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB;AACA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;AACrD,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC9C,WAAW,KAAK,KAAK,KAAK,GAAG,qCAAqC,GAAG,+BAA+B,CAAC;AACrG,SAAS,CAAC;AACV;AACA,MAAM,IAAI,CAAC,GAAG,MAAM;AACpB,SAAS,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACjH,QAAQ,yBAAyB,CAAC;AAClC;AACA,MAAM,MAAM,IAAI,UAAU;AAC1B,QAAQ,CAAC,qDAAqD,CAAC,GAAG,CAAC;AACnE,QAAQ,iBAAiB;AACzB,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE,aAAa;AACzB;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B,CAAC,MAAM,EAAE;AAC9C,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE;AAC1B,IAAI,MAAM,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC;AAC1C,GAAG;AACH;AACA,EAAE,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;AAC9C,IAAI,MAAM,IAAI,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,eAAe,CAAC,MAAM,EAAE;AAChD,EAAE,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACvC;AACA,EAAE,MAAM,CAAC,OAAO,GAAGQ,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrD;AACA;AACA,EAAE,MAAM,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AAClC,IAAI,MAAM;AACV,IAAI,MAAM,CAAC,gBAAgB;AAC3B,GAAG,CAAC;AACJ;AACA,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;AAC9D,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;AAC9E,GAAG;AACH;AACA,EAAE,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,IAAID,UAAQ,CAAC,OAAO,CAAC,CAAC;AAC1E;AACA,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,mBAAmB,CAAC,QAAQ,EAAE;AACrE,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACzC;AACA;AACA,IAAI,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AACtC,MAAM,MAAM;AACZ,MAAM,MAAM,CAAC,iBAAiB;AAC9B,MAAM,QAAQ;AACd,KAAK,CAAC;AACN;AACA,IAAI,QAAQ,CAAC,OAAO,GAAGC,cAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3D;AACA,IAAI,OAAO,QAAQ,CAAC;AACpB,GAAG,EAAE,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACzC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC3B,MAAM,4BAA4B,CAAC,MAAM,CAAC,CAAC;AAC3C;AACA;AACA,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;AACrC,QAAQ,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI;AACjD,UAAU,MAAM;AAChB,UAAU,MAAM,CAAC,iBAAiB;AAClC,UAAU,MAAM,CAAC,QAAQ;AACzB,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAGA,cAAY,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7E,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClC,GAAG,CAAC,CAAC;AACL;;AC3EA,MAAM,eAAe,GAAG,CAAC,KAAK,KAAK,KAAK,YAAYA,cAAY,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE;AACtD;AACA,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB;AACA,EAAE,SAAS,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE;AACpD,IAAI,IAAIR,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;AACpE,MAAM,OAAOA,OAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1D,KAAK,MAAM,IAAIA,OAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;AAC5C,MAAM,OAAOA,OAAK,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;AACrC,KAAK,MAAM,IAAIA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACtC,MAAM,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AAC5B,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH;AACA;AACA,EAAE,SAAS,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE;AAC/C,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5C,KAAK,MAAM,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AACtC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AACpD,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE;AAClC,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE;AAClC,IAAI,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AAC/B,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK,MAAM,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;AACtC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA;AACA,EAAE,SAAS,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE;AACvC,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE;AACzB,MAAM,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClC,KAAK,MAAM,IAAI,IAAI,IAAI,OAAO,EAAE;AAChC,MAAM,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,GAAG;AACH;AACA,EAAE,MAAM,QAAQ,GAAG;AACnB,IAAI,GAAG,EAAE,gBAAgB;AACzB,IAAI,MAAM,EAAE,gBAAgB;AAC5B,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,iBAAiB,EAAE,gBAAgB;AACvC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,eAAe,EAAE,gBAAgB;AACrC,IAAI,aAAa,EAAE,gBAAgB;AACnC,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,YAAY,EAAE,gBAAgB;AAClC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,kBAAkB,EAAE,gBAAgB;AACxC,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,aAAa,EAAE,gBAAgB;AACnC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,SAAS,EAAE,gBAAgB;AAC/B,IAAI,SAAS,EAAE,gBAAgB;AAC/B,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,WAAW,EAAE,gBAAgB;AACjC,IAAI,UAAU,EAAE,gBAAgB;AAChC,IAAI,gBAAgB,EAAE,gBAAgB;AACtC,IAAI,cAAc,EAAE,eAAe;AACnC,IAAI,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACxF,GAAG,CAAC;AACJ;AACA,EAAEA,OAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS,kBAAkB,CAAC,IAAI,EAAE;AACpG,IAAI,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC;AACxD,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAClE,IAAI,CAACA,OAAK,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,KAAK,KAAK,eAAe,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;AAClG,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,MAAM,CAAC;AAChB;;ACpGA,MAAMwB,YAAU,GAAG,EAAE,CAAC;AACtB;AACA;AACA,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK;AACrF,EAAEA,YAAU,CAAC,IAAI,CAAC,GAAG,SAAS,SAAS,CAAC,KAAK,EAAE;AAC/C,IAAI,OAAO,OAAO,KAAK,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;AACtE,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;AACA,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAA,YAAU,CAAC,YAAY,GAAG,SAAS,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE;AAC7E,EAAE,SAAS,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE;AACpC,IAAI,OAAO,UAAU,GAAG,OAAO,GAAG,0BAA0B,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,IAAI,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AACnH,GAAG;AACH;AACA;AACA,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,KAAK;AAC/B,IAAI,IAAI,SAAS,KAAK,KAAK,EAAE;AAC7B,MAAM,MAAM,IAAI,UAAU;AAC1B,QAAQ,aAAa,CAAC,GAAG,EAAE,mBAAmB,IAAI,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AACnF,QAAQ,UAAU,CAAC,cAAc;AACjC,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE;AAC7C,MAAM,kBAAkB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACrC;AACA,MAAM,OAAO,CAAC,IAAI;AAClB,QAAQ,aAAa;AACrB,UAAU,GAAG;AACb,UAAU,8BAA8B,GAAG,OAAO,GAAG,yCAAyC;AAC9F,SAAS;AACT,OAAO,CAAC;AACR,KAAK;AACL;AACA,IAAI,OAAO,SAAS,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;AAC1D,GAAG,CAAC;AACJ,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE;AACtD,EAAE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACnC,IAAI,MAAM,IAAI,UAAU,CAAC,2BAA2B,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;AACvF,GAAG;AACH,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AACtB,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AAClB,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,IAAI,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAClC,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AACjC,MAAM,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AAC3E,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC3B,QAAQ,MAAM,IAAI,UAAU,CAAC,SAAS,GAAG,GAAG,GAAG,WAAW,GAAG,MAAM,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;AACtG,OAAO;AACP,MAAM,SAAS;AACf,KAAK;AACL,IAAI,IAAI,YAAY,KAAK,IAAI,EAAE;AAC/B,MAAM,MAAM,IAAI,UAAU,CAAC,iBAAiB,GAAG,GAAG,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;AAC/E,KAAK;AACL,GAAG;AACH,CAAC;AACD;AACA,kBAAe;AACf,EAAE,aAAa;AACf,cAAEA,YAAU;AACZ,CAAC;;AC/ED,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,CAAC;AACZ,EAAE,WAAW,CAAC,cAAc,EAAE;AAC9B,IAAI,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;AACnC,IAAI,IAAI,CAAC,YAAY,GAAG;AACxB,MAAM,OAAO,EAAE,IAAIC,oBAAkB,EAAE;AACvC,MAAM,QAAQ,EAAE,IAAIA,oBAAkB,EAAE;AACxC,KAAK,CAAC;AACN,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE;AACrC,IAAI,IAAI;AACR,MAAM,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACtD,KAAK,CAAC,OAAO,GAAG,EAAE;AAClB,MAAM,IAAI,GAAG,YAAY,KAAK,EAAE;AAChC,QAAQ,IAAI,KAAK,CAAC;AAClB;AACA,QAAQ,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;AAC9F;AACA;AACA,QAAQ,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;AAC1E;AACA,QAAQ,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE;AACxB,UAAU,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B;AACA,SAAS,MAAM,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE;AACzF,UAAU,GAAG,CAAC,KAAK,IAAI,IAAI,GAAG,MAAK;AACnC,SAAS;AACT,OAAO;AACP;AACA,MAAM,MAAM,GAAG,CAAC;AAChB,KAAK;AACL,GAAG;AACH;AACA,EAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;AAChC;AACA;AACA,IAAI,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;AACzC,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;AAC5B,MAAM,MAAM,CAAC,GAAG,GAAG,WAAW,CAAC;AAC/B,KAAK,MAAM;AACX,MAAM,MAAM,GAAG,WAAW,IAAI,EAAE,CAAC;AACjC,KAAK;AACL;AACA,IAAI,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChD;AACA,IAAI,MAAM,CAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;AAC7D;AACA,IAAI,IAAI,YAAY,KAAK,SAAS,EAAE;AACpC,MAAM,SAAS,CAAC,aAAa,CAAC,YAAY,EAAE;AAC5C,QAAQ,iBAAiB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACtE,QAAQ,iBAAiB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACtE,QAAQ,mBAAmB,EAAE,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC;AACxE,OAAO,EAAE,KAAK,CAAC,CAAC;AAChB,KAAK;AACL;AACA,IAAI,IAAI,gBAAgB,IAAI,IAAI,EAAE;AAClC,MAAM,IAAIzB,OAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;AAC9C,QAAQ,MAAM,CAAC,gBAAgB,GAAG;AAClC,UAAU,SAAS,EAAE,gBAAgB;AACrC,UAAS;AACT,OAAO,MAAM;AACb,QAAQ,SAAS,CAAC,aAAa,CAAC,gBAAgB,EAAE;AAClD,UAAU,MAAM,EAAE,UAAU,CAAC,QAAQ;AACrC,UAAU,SAAS,EAAE,UAAU,CAAC,QAAQ;AACxC,SAAS,EAAE,IAAI,CAAC,CAAC;AACjB,OAAO;AACP,KAAK;AACL;AACA;AACA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,KAAK,EAAE,WAAW,EAAE,CAAC;AACnF;AACA;AACA,IAAI,IAAI,cAAc,GAAG,OAAO,IAAIA,OAAK,CAAC,KAAK;AAC/C,MAAM,OAAO,CAAC,MAAM;AACpB,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AAC5B,KAAK,CAAC;AACN;AACA,IAAI,OAAO,IAAIA,OAAK,CAAC,OAAO;AAC5B,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;AACjE,MAAM,CAAC,MAAM,KAAK;AAClB,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,OAAO;AACP,KAAK,CAAC;AACN;AACA,IAAI,MAAM,CAAC,OAAO,GAAGQ,cAAY,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAClE;AACA;AACA,IAAI,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACvC,IAAI,IAAI,8BAA8B,GAAG,IAAI,CAAC;AAC9C,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,0BAA0B,CAAC,WAAW,EAAE;AACvF,MAAM,IAAI,OAAO,WAAW,CAAC,OAAO,KAAK,UAAU,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE;AAC9F,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,8BAA8B,GAAG,8BAA8B,IAAI,WAAW,CAAC,WAAW,CAAC;AACjG;AACA,MAAM,uBAAuB,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;AACnF,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACxC,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,wBAAwB,CAAC,WAAW,EAAE;AACtF,MAAM,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;AACjF,KAAK,CAAC,CAAC;AACP;AACA,IAAI,IAAI,OAAO,CAAC;AAChB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,IAAI,IAAI,GAAG,CAAC;AACZ;AACA,IAAI,IAAI,CAAC,8BAA8B,EAAE;AACzC,MAAM,MAAM,KAAK,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;AAC5D,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;AAC1D,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;AACxD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;AACzB;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACxC;AACA,MAAM,OAAO,CAAC,GAAG,GAAG,EAAE;AACtB,QAAQ,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvD,OAAO;AACP;AACA,MAAM,OAAO,OAAO,CAAC;AACrB,KAAK;AACL;AACA,IAAI,GAAG,GAAG,uBAAuB,CAAC,MAAM,CAAC;AACzC;AACA,IAAI,IAAI,SAAS,GAAG,MAAM,CAAC;AAC3B;AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,MAAM,MAAM,WAAW,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC;AACtD,MAAM,IAAI;AACV,QAAQ,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAC3C,OAAO,CAAC,OAAO,KAAK,EAAE;AACtB,QAAQ,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACrC,QAAQ,MAAM;AACd,OAAO;AACP,KAAK;AACL;AACA,IAAI,IAAI;AACR,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACtD,KAAK,CAAC,OAAO,KAAK,EAAE;AACpB,MAAM,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnC,KAAK;AACL;AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,IAAI,GAAG,GAAG,wBAAwB,CAAC,MAAM,CAAC;AAC1C;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3F,KAAK;AACL;AACA,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA,EAAE,MAAM,CAAC,MAAM,EAAE;AACjB,IAAI,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChD,IAAI,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/D,IAAI,OAAO,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACtE,GAAG;AACH,CAAC;AACD;AACA;AACAR,OAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,mBAAmB,CAAC,MAAM,EAAE;AACzF;AACA,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,EAAE,MAAM,EAAE;AAClD,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE;AAClD,MAAM,MAAM;AACZ,MAAM,GAAG;AACT,MAAM,IAAI,EAAE,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI;AAC/B,KAAK,CAAC,CAAC,CAAC;AACR,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC;AACH;AACAA,OAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,SAAS,qBAAqB,CAAC,MAAM,EAAE;AAC/E;AACA;AACA,EAAE,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACtC,IAAI,OAAO,SAAS,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE;AAClD,MAAM,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE;AACpD,QAAQ,MAAM;AACd,QAAQ,OAAO,EAAE,MAAM,GAAG;AAC1B,UAAU,cAAc,EAAE,qBAAqB;AAC/C,SAAS,GAAG,EAAE;AACd,QAAQ,GAAG;AACX,QAAQ,IAAI;AACZ,OAAO,CAAC,CAAC,CAAC;AACV,KAAK,CAAC;AACN,GAAG;AACH;AACA,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,kBAAkB,EAAE,CAAC;AACjD;AACA,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC,CAAC,CAAC;AACH;AACA,gBAAe,KAAK;;AC5NpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,CAAC;AAClB,EAAE,WAAW,CAAC,QAAQ,EAAE;AACxB,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;AACxC,MAAM,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;AAC1D,KAAK;AACL;AACA,IAAI,IAAI,cAAc,CAAC;AACvB;AACA,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,SAAS,eAAe,CAAC,OAAO,EAAE;AACjE,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC;AACvB;AACA;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI;AAChC,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO;AACpC;AACA,MAAM,IAAI,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;AACtC;AACA,MAAM,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE;AACtB,QAAQ,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACpC,OAAO;AACP,MAAM,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;AAC9B,KAAK,CAAC,CAAC;AACP;AACA;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,WAAW,IAAI;AACvC,MAAM,IAAI,QAAQ,CAAC;AACnB;AACA,MAAM,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,IAAI;AAC7C,QAAQ,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,QAAQ,QAAQ,GAAG,OAAO,CAAC;AAC3B,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC3B;AACA,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,MAAM,GAAG;AACzC,QAAQ,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AACpC,OAAO,CAAC;AACR;AACA,MAAM,OAAO,OAAO,CAAC;AACrB,KAAK,CAAC;AACN;AACA,IAAI,QAAQ,CAAC,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;AACvD,MAAM,IAAI,KAAK,CAAC,MAAM,EAAE;AACxB;AACA,QAAQ,OAAO;AACf,OAAO;AACP;AACA,MAAM,KAAK,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACjE,MAAM,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP,GAAG;AACH;AACA;AACA;AACA;AACA,EAAE,gBAAgB,GAAG;AACrB,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;AACrB,MAAM,MAAM,IAAI,CAAC,MAAM,CAAC;AACxB,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,SAAS,CAAC,QAAQ,EAAE;AACtB,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;AACrB,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrC,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,UAAU,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnC,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,QAAQ,EAAE;AACxB,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AAC1B,MAAM,OAAO;AACb,KAAK;AACL,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACpD,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;AACtB,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AACvC,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,MAAM,GAAG;AAClB,IAAI,IAAI,MAAM,CAAC;AACf,IAAI,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,SAAS,QAAQ,CAAC,CAAC,EAAE;AACvD,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,MAAM,KAAK;AACX,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,GAAG;AACH,CAAC;AACD;AACA,sBAAe,WAAW;;ACtH1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,MAAM,CAAC,QAAQ,EAAE;AACzC,EAAE,OAAO,SAAS,IAAI,CAAC,GAAG,EAAE;AAC5B,IAAI,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACrC,GAAG,CAAC;AACJ;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,YAAY,CAAC,OAAO,EAAE;AAC9C,EAAE,OAAOA,OAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC;AACpE;;ACbA,MAAM,cAAc,GAAG;AACvB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,EAAE,EAAE,GAAG;AACT,EAAE,OAAO,EAAE,GAAG;AACd,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,KAAK,EAAE,GAAG;AACZ,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,aAAa,EAAE,GAAG;AACpB,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,IAAI,EAAE,GAAG;AACX,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,oBAAoB,EAAE,GAAG;AAC3B,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,iBAAiB,EAAE,GAAG;AACxB,EAAE,SAAS,EAAE,GAAG;AAChB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,MAAM,EAAE,GAAG;AACb,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,QAAQ,EAAE,GAAG;AACf,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,oBAAoB,EAAE,GAAG;AAC3B,EAAE,eAAe,EAAE,GAAG;AACtB,EAAE,2BAA2B,EAAE,GAAG;AAClC,EAAE,0BAA0B,EAAE,GAAG;AACjC,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,UAAU,EAAE,GAAG;AACjB,EAAE,kBAAkB,EAAE,GAAG;AACzB,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE,uBAAuB,EAAE,GAAG;AAC9B,EAAE,qBAAqB,EAAE,GAAG;AAC5B,EAAE,mBAAmB,EAAE,GAAG;AAC1B,EAAE,YAAY,EAAE,GAAG;AACnB,EAAE,WAAW,EAAE,GAAG;AAClB,EAAE,6BAA6B,EAAE,GAAG;AACpC,CAAC,CAAC;AACF;AACA,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACzD,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;AAC9B,CAAC,CAAC,CAAC;AACH;AACA,yBAAe,cAAc;;AClD7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,aAAa,EAAE;AACvC,EAAE,MAAM,OAAO,GAAG,IAAI0B,OAAK,CAAC,aAAa,CAAC,CAAC;AAC3C,EAAE,MAAM,QAAQ,GAAG,IAAI,CAACA,OAAK,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1D;AACA;AACA,EAAE1B,OAAK,CAAC,MAAM,CAAC,QAAQ,EAAE0B,OAAK,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AACvE;AACA;AACA,EAAE1B,OAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AAC5D;AACA;AACA,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,MAAM,CAAC,cAAc,EAAE;AACpD,IAAI,OAAO,cAAc,CAAC,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AACtE,GAAG,CAAC;AACJ;AACA,EAAE,OAAO,QAAQ,CAAC;AAClB,CAAC;AACD;AACA;AACK,MAAC,KAAK,GAAG,cAAc,CAACO,UAAQ,EAAE;AACvC;AACA;AACA,KAAK,CAAC,KAAK,GAAGmB,OAAK,CAAC;AACpB;AACA;AACA,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;AACpC,KAAK,CAAC,WAAW,GAAGC,aAAW,CAAC;AAChC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC1B,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;AACxB,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;AACnC;AACA;AACA,KAAK,CAAC,GAAG,GAAG,SAAS,GAAG,CAAC,QAAQ,EAAE;AACnC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AACtB;AACA;AACA,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;AAClC;AACA;AACA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;AAChC;AACA,KAAK,CAAC,YAAY,GAAGnB,cAAY,CAAC;AAClC;AACA,KAAK,CAAC,UAAU,GAAG,KAAK,IAAI,cAAc,CAACR,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAClG;AACA,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;AACvC;AACA,KAAK,CAAC,cAAc,GAAG4B,gBAAc,CAAC;AACtC;AACA,KAAK,CAAC,OAAO,GAAG,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/axios/index.d.cts b/node_modules/axios/index.d.cts new file mode 100644 index 00000000..d95e6ef6 --- /dev/null +++ b/node_modules/axios/index.d.cts @@ -0,0 +1,542 @@ +interface RawAxiosHeaders { + [key: string]: axios.AxiosHeaderValue; +} + +type MethodsHeaders = Partial<{ + [Key in axios.Method as Lowercase]: AxiosHeaders; +} & {common: AxiosHeaders}>; + +type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean; + +type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any; + +type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent'| 'Content-Encoding' | 'Authorization'; + +type ContentType = axios.AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream'; + +type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding'; + +declare class AxiosHeaders { + constructor( + headers?: RawAxiosHeaders | AxiosHeaders | string + ); + + [key: string]: any; + + set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; + + get(headerName: string, parser: RegExp): RegExpExecArray | null; + get(headerName: string, matcher?: true | AxiosHeaderParser): axios.AxiosHeaderValue; + + has(header: string, matcher?: AxiosHeaderMatcher): boolean; + + delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; + + clear(matcher?: AxiosHeaderMatcher): boolean; + + normalize(format: boolean): AxiosHeaders; + + concat(...targets: Array): AxiosHeaders; + + toJSON(asStrings?: boolean): RawAxiosHeaders; + + static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; + + static accessor(header: string | string[]): AxiosHeaders; + + static concat(...targets: Array): AxiosHeaders; + + setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentType(parser?: RegExp): RegExpExecArray | null; + getContentType(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasContentType(matcher?: AxiosHeaderMatcher): boolean; + + setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentLength(parser?: RegExp): RegExpExecArray | null; + getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasContentLength(matcher?: AxiosHeaderMatcher): boolean; + + setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getAccept(parser?: RegExp): RegExpExecArray | null; + getAccept(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasAccept(matcher?: AxiosHeaderMatcher): boolean; + + setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getUserAgent(parser?: RegExp): RegExpExecArray | null; + getUserAgent(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasUserAgent(matcher?: AxiosHeaderMatcher): boolean; + + setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentEncoding(parser?: RegExp): RegExpExecArray | null; + getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean; + + setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getAuthorization(parser?: RegExp): RegExpExecArray | null; + getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasAuthorization(matcher?: AxiosHeaderMatcher): boolean; + + [Symbol.iterator](): IterableIterator<[string, axios.AxiosHeaderValue]>; +} + +declare class AxiosError extends Error { + constructor( + message?: string, + code?: string, + config?: axios.InternalAxiosRequestConfig, + request?: any, + response?: axios.AxiosResponse + ); + + config?: axios.InternalAxiosRequestConfig; + code?: string; + request?: any; + response?: axios.AxiosResponse; + isAxiosError: boolean; + status?: number; + toJSON: () => object; + cause?: Error; + static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; + static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; + static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION"; + static readonly ERR_NETWORK = "ERR_NETWORK"; + static readonly ERR_DEPRECATED = "ERR_DEPRECATED"; + static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; + static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; + static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; + static readonly ERR_INVALID_URL = "ERR_INVALID_URL"; + static readonly ERR_CANCELED = "ERR_CANCELED"; + static readonly ECONNABORTED = "ECONNABORTED"; + static readonly ETIMEDOUT = "ETIMEDOUT"; +} + +declare class CanceledError extends AxiosError { +} + +declare class Axios { + constructor(config?: axios.AxiosRequestConfig); + defaults: axios.AxiosDefaults; + interceptors: { + request: axios.AxiosInterceptorManager; + response: axios.AxiosInterceptorManager; + }; + getUri(config?: axios.AxiosRequestConfig): string; + request, D = any>(config: axios.AxiosRequestConfig): Promise; + get, D = any>(url: string, config?: axios.AxiosRequestConfig): Promise; + delete, D = any>(url: string, config?: axios.AxiosRequestConfig): Promise; + head, D = any>(url: string, config?: axios.AxiosRequestConfig): Promise; + options, D = any>(url: string, config?: axios.AxiosRequestConfig): Promise; + post, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + put, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + patch, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + postForm, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + putForm, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + patchForm, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; +} + +declare enum HttpStatusCode { + Continue = 100, + SwitchingProtocols = 101, + Processing = 102, + EarlyHints = 103, + Ok = 200, + Created = 201, + Accepted = 202, + NonAuthoritativeInformation = 203, + NoContent = 204, + ResetContent = 205, + PartialContent = 206, + MultiStatus = 207, + AlreadyReported = 208, + ImUsed = 226, + MultipleChoices = 300, + MovedPermanently = 301, + Found = 302, + SeeOther = 303, + NotModified = 304, + UseProxy = 305, + Unused = 306, + TemporaryRedirect = 307, + PermanentRedirect = 308, + BadRequest = 400, + Unauthorized = 401, + PaymentRequired = 402, + Forbidden = 403, + NotFound = 404, + MethodNotAllowed = 405, + NotAcceptable = 406, + ProxyAuthenticationRequired = 407, + RequestTimeout = 408, + Conflict = 409, + Gone = 410, + LengthRequired = 411, + PreconditionFailed = 412, + PayloadTooLarge = 413, + UriTooLong = 414, + UnsupportedMediaType = 415, + RangeNotSatisfiable = 416, + ExpectationFailed = 417, + ImATeapot = 418, + MisdirectedRequest = 421, + UnprocessableEntity = 422, + Locked = 423, + FailedDependency = 424, + TooEarly = 425, + UpgradeRequired = 426, + PreconditionRequired = 428, + TooManyRequests = 429, + RequestHeaderFieldsTooLarge = 431, + UnavailableForLegalReasons = 451, + InternalServerError = 500, + NotImplemented = 501, + BadGateway = 502, + ServiceUnavailable = 503, + GatewayTimeout = 504, + HttpVersionNotSupported = 505, + VariantAlsoNegotiates = 506, + InsufficientStorage = 507, + LoopDetected = 508, + NotExtended = 510, + NetworkAuthenticationRequired = 511, +} + +type InternalAxiosError = AxiosError; + +declare namespace axios { + type AxiosError = InternalAxiosError; + + type RawAxiosRequestHeaders = Partial; + + type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders; + + type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null; + + type RawCommonResponseHeaders = { + [Key in CommonResponseHeadersList]: AxiosHeaderValue; + } & { + "set-cookie": string[]; + }; + + type RawAxiosResponseHeaders = Partial; + + type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders; + + interface AxiosRequestTransformer { + (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any; + } + + interface AxiosResponseTransformer { + (this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any; + } + + interface AxiosAdapter { + (config: InternalAxiosRequestConfig): AxiosPromise; + } + + interface AxiosBasicCredentials { + username: string; + password: string; + } + + interface AxiosProxyConfig { + host: string; + port: number; + auth?: AxiosBasicCredentials; + protocol?: string; + } + + type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK'; + + type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream'; + + type responseEncoding = + | 'ascii' | 'ASCII' + | 'ansi' | 'ANSI' + | 'binary' | 'BINARY' + | 'base64' | 'BASE64' + | 'base64url' | 'BASE64URL' + | 'hex' | 'HEX' + | 'latin1' | 'LATIN1' + | 'ucs-2' | 'UCS-2' + | 'ucs2' | 'UCS2' + | 'utf-8' | 'UTF-8' + | 'utf8' | 'UTF8' + | 'utf16le' | 'UTF16LE'; + + interface TransitionalOptions { + silentJSONParsing?: boolean; + forcedJSONParsing?: boolean; + clarifyTimeoutError?: boolean; + } + + interface GenericAbortSignal { + readonly aborted: boolean; + onabort?: ((...args: any) => any) | null; + addEventListener?: (...args: any) => any; + removeEventListener?: (...args: any) => any; + } + + interface FormDataVisitorHelpers { + defaultVisitor: SerializerVisitor; + convertValue: (value: any) => any; + isVisitable: (value: any) => boolean; + } + + interface SerializerVisitor { + ( + this: GenericFormData, + value: any, + key: string | number, + path: null | Array, + helpers: FormDataVisitorHelpers + ): boolean; + } + + interface SerializerOptions { + visitor?: SerializerVisitor; + dots?: boolean; + metaTokens?: boolean; + indexes?: boolean | null; + } + + // tslint:disable-next-line + interface FormSerializerOptions extends SerializerOptions { + } + + interface ParamEncoder { + (value: any, defaultEncoder: (value: any) => any): any; + } + + interface CustomParamsSerializer { + (params: Record, options?: ParamsSerializerOptions): string; + } + + interface ParamsSerializerOptions extends SerializerOptions { + encode?: ParamEncoder; + serialize?: CustomParamsSerializer; + } + + type MaxUploadRate = number; + + type MaxDownloadRate = number; + + type BrowserProgressEvent = any; + + interface AxiosProgressEvent { + loaded: number; + total?: number; + progress?: number; + bytes: number; + rate?: number; + estimated?: number; + upload?: boolean; + download?: boolean; + event?: BrowserProgressEvent; + } + + type Milliseconds = number; + + type AxiosAdapterName = 'xhr' | 'http' | string; + + type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; + + type AddressFamily = 4 | 6 | undefined; + + interface LookupAddressEntry { + address: string; + family?: AddressFamily; + } + + type LookupAddress = string | LookupAddressEntry; + + interface AxiosRequestConfig { + url?: string; + method?: Method | string; + baseURL?: string; + transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; + transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]; + headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders; + params?: any; + paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer; + data?: D; + timeout?: Milliseconds; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + responseEncoding?: responseEncoding | string; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: AxiosProgressEvent) => void; + onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + maxRate?: number | [MaxUploadRate, MaxDownloadRate]; + beforeRedirect?: (options: Record, responseDetails: {headers: Record, statusCode: HttpStatusCode}) => void; + socketPath?: string | null; + transport?: any; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions; + signal?: GenericAbortSignal; + insecureHTTPParser?: boolean; + env?: { + FormData?: new (...args: any[]) => object; + }; + formSerializer?: FormSerializerOptions; + family?: AddressFamily; + lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) | + ((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>); + withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined); + } + + // Alias + type RawAxiosRequestConfig = AxiosRequestConfig; + + interface InternalAxiosRequestConfig extends AxiosRequestConfig { + headers: AxiosRequestHeaders; + } + + interface HeadersDefaults { + common: RawAxiosRequestHeaders; + delete: RawAxiosRequestHeaders; + get: RawAxiosRequestHeaders; + head: RawAxiosRequestHeaders; + post: RawAxiosRequestHeaders; + put: RawAxiosRequestHeaders; + patch: RawAxiosRequestHeaders; + options?: RawAxiosRequestHeaders; + purge?: RawAxiosRequestHeaders; + link?: RawAxiosRequestHeaders; + unlink?: RawAxiosRequestHeaders; + } + + interface AxiosDefaults extends Omit, 'headers'> { + headers: HeadersDefaults; + } + + interface CreateAxiosDefaults extends Omit, 'headers'> { + headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial; + } + + interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: RawAxiosResponseHeaders | AxiosResponseHeaders; + config: InternalAxiosRequestConfig; + request?: any; + } + + type AxiosPromise = Promise>; + + interface CancelStatic { + new (message?: string): Cancel; + } + + interface Cancel { + message: string | undefined; + } + + interface Canceler { + (message?: string, config?: AxiosRequestConfig, request?: any): void; + } + + interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; + } + + interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; + } + + interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; + } + + interface AxiosInterceptorOptions { + synchronous?: boolean; + runWhen?: (config: InternalAxiosRequestConfig) => boolean; + } + + interface AxiosInterceptorManager { + use(onFulfilled?: (value: V) => V | Promise, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number; + eject(id: number): void; + clear(): void; + } + + interface AxiosInstance extends Axios { + , D = any>(config: AxiosRequestConfig): Promise; + , D = any>(url: string, config?: AxiosRequestConfig): Promise; + + defaults: Omit & { + headers: HeadersDefaults & { + [key: string]: AxiosHeaderValue + } + }; + } + + interface GenericFormData { + append(name: string, value: any, options?: any): any; + } + + interface GenericHTMLFormElement { + name: string; + method: string; + submit(): void; + } + + interface AxiosStatic extends AxiosInstance { + create(config?: CreateAxiosDefaults): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + Axios: typeof Axios; + AxiosError: typeof AxiosError; + CanceledError: typeof CanceledError; + HttpStatusCode: typeof HttpStatusCode; + readonly VERSION: string; + isCancel(value: any): value is Cancel; + all(values: Array>): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; + toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData; + formToJSON(form: GenericFormData|GenericHTMLFormElement): object; + getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter; + AxiosHeaders: typeof AxiosHeaders; + } +} + +declare const axios: axios.AxiosStatic; + +export = axios; diff --git a/node_modules/axios/index.d.ts b/node_modules/axios/index.d.ts new file mode 100644 index 00000000..02a8c098 --- /dev/null +++ b/node_modules/axios/index.d.ts @@ -0,0 +1,559 @@ +// TypeScript Version: 4.7 +export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null; + +interface RawAxiosHeaders { + [key: string]: AxiosHeaderValue; +} + +type MethodsHeaders = Partial<{ + [Key in Method as Lowercase]: AxiosHeaders; +} & {common: AxiosHeaders}>; + +type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean); + +type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any; + +export class AxiosHeaders { + constructor( + headers?: RawAxiosHeaders | AxiosHeaders | string + ); + + [key: string]: any; + + set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; + + get(headerName: string, parser: RegExp): RegExpExecArray | null; + get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue; + + has(header: string, matcher?: AxiosHeaderMatcher): boolean; + + delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; + + clear(matcher?: AxiosHeaderMatcher): boolean; + + normalize(format: boolean): AxiosHeaders; + + concat(...targets: Array): AxiosHeaders; + + toJSON(asStrings?: boolean): RawAxiosHeaders; + + static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; + + static accessor(header: string | string[]): AxiosHeaders; + + static concat(...targets: Array): AxiosHeaders; + + setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentType(parser?: RegExp): RegExpExecArray | null; + getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasContentType(matcher?: AxiosHeaderMatcher): boolean; + + setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentLength(parser?: RegExp): RegExpExecArray | null; + getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasContentLength(matcher?: AxiosHeaderMatcher): boolean; + + setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getAccept(parser?: RegExp): RegExpExecArray | null; + getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasAccept(matcher?: AxiosHeaderMatcher): boolean; + + setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getUserAgent(parser?: RegExp): RegExpExecArray | null; + getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasUserAgent(matcher?: AxiosHeaderMatcher): boolean; + + setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentEncoding(parser?: RegExp): RegExpExecArray | null; + getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean; + + setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getAuthorization(parser?: RegExp): RegExpExecArray | null; + getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasAuthorization(matcher?: AxiosHeaderMatcher): boolean; + + [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>; +} + +type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization'; + +type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream'; + +export type RawAxiosRequestHeaders = Partial; + +export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders; + +type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding'; + +type RawCommonResponseHeaders = { + [Key in CommonResponseHeadersList]: AxiosHeaderValue; +} & { + "set-cookie": string[]; +}; + +export type RawAxiosResponseHeaders = Partial; + +export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders; + +export interface AxiosRequestTransformer { + (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any; +} + +export interface AxiosResponseTransformer { + (this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any; +} + +export interface AxiosAdapter { + (config: InternalAxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: AxiosBasicCredentials; + protocol?: string; +} + +export enum HttpStatusCode { + Continue = 100, + SwitchingProtocols = 101, + Processing = 102, + EarlyHints = 103, + Ok = 200, + Created = 201, + Accepted = 202, + NonAuthoritativeInformation = 203, + NoContent = 204, + ResetContent = 205, + PartialContent = 206, + MultiStatus = 207, + AlreadyReported = 208, + ImUsed = 226, + MultipleChoices = 300, + MovedPermanently = 301, + Found = 302, + SeeOther = 303, + NotModified = 304, + UseProxy = 305, + Unused = 306, + TemporaryRedirect = 307, + PermanentRedirect = 308, + BadRequest = 400, + Unauthorized = 401, + PaymentRequired = 402, + Forbidden = 403, + NotFound = 404, + MethodNotAllowed = 405, + NotAcceptable = 406, + ProxyAuthenticationRequired = 407, + RequestTimeout = 408, + Conflict = 409, + Gone = 410, + LengthRequired = 411, + PreconditionFailed = 412, + PayloadTooLarge = 413, + UriTooLong = 414, + UnsupportedMediaType = 415, + RangeNotSatisfiable = 416, + ExpectationFailed = 417, + ImATeapot = 418, + MisdirectedRequest = 421, + UnprocessableEntity = 422, + Locked = 423, + FailedDependency = 424, + TooEarly = 425, + UpgradeRequired = 426, + PreconditionRequired = 428, + TooManyRequests = 429, + RequestHeaderFieldsTooLarge = 431, + UnavailableForLegalReasons = 451, + InternalServerError = 500, + NotImplemented = 501, + BadGateway = 502, + ServiceUnavailable = 503, + GatewayTimeout = 504, + HttpVersionNotSupported = 505, + VariantAlsoNegotiates = 506, + InsufficientStorage = 507, + LoopDetected = 508, + NotExtended = 510, + NetworkAuthenticationRequired = 511, +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK'; + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream'; + +export type responseEncoding = + | 'ascii' | 'ASCII' + | 'ansi' | 'ANSI' + | 'binary' | 'BINARY' + | 'base64' | 'BASE64' + | 'base64url' | 'BASE64URL' + | 'hex' | 'HEX' + | 'latin1' | 'LATIN1' + | 'ucs-2' | 'UCS-2' + | 'ucs2' | 'UCS2' + | 'utf-8' | 'UTF-8' + | 'utf8' | 'UTF8' + | 'utf16le' | 'UTF16LE'; + +export interface TransitionalOptions { + silentJSONParsing?: boolean; + forcedJSONParsing?: boolean; + clarifyTimeoutError?: boolean; +} + +export interface GenericAbortSignal { + readonly aborted: boolean; + onabort?: ((...args: any) => any) | null; + addEventListener?: (...args: any) => any; + removeEventListener?: (...args: any) => any; +} + +export interface FormDataVisitorHelpers { + defaultVisitor: SerializerVisitor; + convertValue: (value: any) => any; + isVisitable: (value: any) => boolean; +} + +export interface SerializerVisitor { + ( + this: GenericFormData, + value: any, + key: string | number, + path: null | Array, + helpers: FormDataVisitorHelpers + ): boolean; +} + +export interface SerializerOptions { + visitor?: SerializerVisitor; + dots?: boolean; + metaTokens?: boolean; + indexes?: boolean | null; +} + +// tslint:disable-next-line +export interface FormSerializerOptions extends SerializerOptions { +} + +export interface ParamEncoder { + (value: any, defaultEncoder: (value: any) => any): any; +} + +export interface CustomParamsSerializer { + (params: Record, options?: ParamsSerializerOptions): string; +} + +export interface ParamsSerializerOptions extends SerializerOptions { + encode?: ParamEncoder; + serialize?: CustomParamsSerializer; +} + +type MaxUploadRate = number; + +type MaxDownloadRate = number; + +type BrowserProgressEvent = any; + +export interface AxiosProgressEvent { + loaded: number; + total?: number; + progress?: number; + bytes: number; + rate?: number; + estimated?: number; + upload?: boolean; + download?: boolean; + event?: BrowserProgressEvent; +} + +type Milliseconds = number; + +type AxiosAdapterName = 'xhr' | 'http' | string; + +type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; + +export type AddressFamily = 4 | 6 | undefined; + +export interface LookupAddressEntry { + address: string; + family?: AddressFamily; +} + +export type LookupAddress = string | LookupAddressEntry; + +export interface AxiosRequestConfig { + url?: string; + method?: Method | string; + baseURL?: string; + transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; + transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]; + headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders; + params?: any; + paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer; + data?: D; + timeout?: Milliseconds; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + responseEncoding?: responseEncoding | string; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: AxiosProgressEvent) => void; + onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + maxRate?: number | [MaxUploadRate, MaxDownloadRate]; + beforeRedirect?: (options: Record, responseDetails: {headers: Record, statusCode: HttpStatusCode}) => void; + socketPath?: string | null; + transport?: any; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions; + signal?: GenericAbortSignal; + insecureHTTPParser?: boolean; + env?: { + FormData?: new (...args: any[]) => object; + }; + formSerializer?: FormSerializerOptions; + family?: AddressFamily; + lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) | + ((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>); + withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined); +} + +// Alias +export type RawAxiosRequestConfig = AxiosRequestConfig; + +export interface InternalAxiosRequestConfig extends AxiosRequestConfig { + headers: AxiosRequestHeaders; +} + +export interface HeadersDefaults { + common: RawAxiosRequestHeaders; + delete: RawAxiosRequestHeaders; + get: RawAxiosRequestHeaders; + head: RawAxiosRequestHeaders; + post: RawAxiosRequestHeaders; + put: RawAxiosRequestHeaders; + patch: RawAxiosRequestHeaders; + options?: RawAxiosRequestHeaders; + purge?: RawAxiosRequestHeaders; + link?: RawAxiosRequestHeaders; + unlink?: RawAxiosRequestHeaders; +} + +export interface AxiosDefaults extends Omit, 'headers'> { + headers: HeadersDefaults; +} + +export interface CreateAxiosDefaults extends Omit, 'headers'> { + headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial; +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: RawAxiosResponseHeaders | AxiosResponseHeaders; + config: InternalAxiosRequestConfig; + request?: any; +} + +export class AxiosError extends Error { + constructor( + message?: string, + code?: string, + config?: InternalAxiosRequestConfig, + request?: any, + response?: AxiosResponse + ); + + config?: InternalAxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + status?: number; + toJSON: () => object; + cause?: Error; + static from( + error: Error | unknown, + code?: string, + config?: InternalAxiosRequestConfig, + request?: any, + response?: AxiosResponse, + customProps?: object, +): AxiosError; + static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; + static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; + static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION"; + static readonly ERR_NETWORK = "ERR_NETWORK"; + static readonly ERR_DEPRECATED = "ERR_DEPRECATED"; + static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; + static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; + static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; + static readonly ERR_INVALID_URL = "ERR_INVALID_URL"; + static readonly ERR_CANCELED = "ERR_CANCELED"; + static readonly ECONNABORTED = "ECONNABORTED"; + static readonly ETIMEDOUT = "ETIMEDOUT"; +} + +export class CanceledError extends AxiosError { +} + +export type AxiosPromise = Promise>; + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string | undefined; +} + +export interface Canceler { + (message?: string, config?: AxiosRequestConfig, request?: any): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorOptions { + synchronous?: boolean; + runWhen?: (config: InternalAxiosRequestConfig) => boolean; +} + +export interface AxiosInterceptorManager { + use(onFulfilled?: ((value: V) => V | Promise) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions): number; + eject(id: number): void; + clear(): void; +} + +export class Axios { + constructor(config?: AxiosRequestConfig); + defaults: AxiosDefaults; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request, D = any>(config: AxiosRequestConfig): Promise; + get, D = any>(url: string, config?: AxiosRequestConfig): Promise; + delete, D = any>(url: string, config?: AxiosRequestConfig): Promise; + head, D = any>(url: string, config?: AxiosRequestConfig): Promise; + options, D = any>(url: string, config?: AxiosRequestConfig): Promise; + post, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + put, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + patch, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + postForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + putForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + patchForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosInstance extends Axios { + , D = any>(config: AxiosRequestConfig): Promise; + , D = any>(url: string, config?: AxiosRequestConfig): Promise; + + defaults: Omit & { + headers: HeadersDefaults & { + [key: string]: AxiosHeaderValue + } + }; +} + +export interface GenericFormData { + append(name: string, value: any, options?: any): any; +} + +export interface GenericHTMLFormElement { + name: string; + method: string; + submit(): void; +} + +export function getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter; + +export function toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData; + +export function formToJSON(form: GenericFormData|GenericHTMLFormElement): object; + +export function isAxiosError(payload: any): payload is AxiosError; + +export function spread(callback: (...args: T[]) => R): (array: T[]) => R; + +export function isCancel(value: any): value is Cancel; + +export function all(values: Array>): Promise; + +export interface AxiosStatic extends AxiosInstance { + create(config?: CreateAxiosDefaults): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + Axios: typeof Axios; + AxiosError: typeof AxiosError; + HttpStatusCode: typeof HttpStatusCode; + readonly VERSION: string; + isCancel: typeof isCancel; + all: typeof all; + spread: typeof spread; + isAxiosError: typeof isAxiosError; + toFormData: typeof toFormData; + formToJSON: typeof formToJSON; + getAdapter: typeof getAdapter; + CanceledError: typeof CanceledError; + AxiosHeaders: typeof AxiosHeaders; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/axios/index.js b/node_modules/axios/index.js new file mode 100644 index 00000000..fba3990d --- /dev/null +++ b/node_modules/axios/index.js @@ -0,0 +1,43 @@ +import axios from './lib/axios.js'; + +// This module is intended to unwrap Axios default export as named. +// Keep top-level export same with static properties +// so that it can keep same with es module or cjs +const { + Axios, + AxiosError, + CanceledError, + isCancel, + CancelToken, + VERSION, + all, + Cancel, + isAxiosError, + spread, + toFormData, + AxiosHeaders, + HttpStatusCode, + formToJSON, + getAdapter, + mergeConfig +} = axios; + +export { + axios as default, + Axios, + AxiosError, + CanceledError, + isCancel, + CancelToken, + VERSION, + all, + Cancel, + isAxiosError, + spread, + toFormData, + AxiosHeaders, + HttpStatusCode, + formToJSON, + getAdapter, + mergeConfig +} diff --git a/node_modules/axios/lib/adapters/README.md b/node_modules/axios/lib/adapters/README.md new file mode 100644 index 00000000..68f11189 --- /dev/null +++ b/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/axios/lib/adapters/adapters.js b/node_modules/axios/lib/adapters/adapters.js new file mode 100644 index 00000000..550997d8 --- /dev/null +++ b/node_modules/axios/lib/adapters/adapters.js @@ -0,0 +1,77 @@ +import utils from '../utils.js'; +import httpAdapter from './http.js'; +import xhrAdapter from './xhr.js'; +import AxiosError from "../core/AxiosError.js"; + +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter +} + +utils.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +const renderReason = (reason) => `- ${reason}`; + +const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; + +export default { + getAdapter: (adapters) => { + adapters = utils.isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; + } + + if (!adapter) { + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; + }, + adapters: knownAdapters +} diff --git a/node_modules/axios/lib/adapters/http.js b/node_modules/axios/lib/adapters/http.js new file mode 100644 index 00000000..21d64585 --- /dev/null +++ b/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,685 @@ +'use strict'; + +import utils from './../utils.js'; +import settle from './../core/settle.js'; +import buildFullPath from '../core/buildFullPath.js'; +import buildURL from './../helpers/buildURL.js'; +import {getProxyForUrl} from 'proxy-from-env'; +import http from 'http'; +import https from 'https'; +import util from 'util'; +import followRedirects from 'follow-redirects'; +import zlib from 'zlib'; +import {VERSION} from '../env/data.js'; +import transitionalDefaults from '../defaults/transitional.js'; +import AxiosError from '../core/AxiosError.js'; +import CanceledError from '../cancel/CanceledError.js'; +import platform from '../platform/index.js'; +import fromDataURI from '../helpers/fromDataURI.js'; +import stream from 'stream'; +import AxiosHeaders from '../core/AxiosHeaders.js'; +import AxiosTransformStream from '../helpers/AxiosTransformStream.js'; +import EventEmitter from 'events'; +import formDataToStream from "../helpers/formDataToStream.js"; +import readBlob from "../helpers/readBlob.js"; +import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js'; +import callbackify from "../helpers/callbackify.js"; + +const zlibOptions = { + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH +}; + +const brotliOptions = { + flush: zlib.constants.BROTLI_OPERATION_FLUSH, + finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH +} + +const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress); + +const {http: httpFollow, https: httpsFollow} = followRedirects; + +const isHttps = /https:?/; + +const supportedProtocols = platform.protocols.map(protocol => { + return protocol + ':'; +}); + +/** + * If the proxy or config beforeRedirects functions are defined, call them with the options + * object. + * + * @param {Object} options - The options object that was passed to the request. + * + * @returns {Object} + */ +function dispatchBeforeRedirect(options, responseDetails) { + if (options.beforeRedirects.proxy) { + options.beforeRedirects.proxy(options); + } + if (options.beforeRedirects.config) { + options.beforeRedirects.config(options, responseDetails); + } +} + +/** + * If the proxy or config afterRedirects functions are defined, call them with the options + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} configProxy configuration from Axios options object + * @param {string} location + * + * @returns {http.ClientRequestArgs} + */ +function setProxy(options, configProxy, location) { + let proxy = configProxy; + if (!proxy && proxy !== false) { + const proxyUrl = getProxyForUrl(location); + if (proxyUrl) { + proxy = new URL(proxyUrl); + } + } + if (proxy) { + // Basic proxy authorization + if (proxy.username) { + proxy.auth = (proxy.username || '') + ':' + (proxy.password || ''); + } + + if (proxy.auth) { + // Support proxy auth object form + if (proxy.auth.username || proxy.auth.password) { + proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || ''); + } + const base64 = Buffer + .from(proxy.auth, 'utf8') + .toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); + const proxyHost = proxy.hostname || proxy.host; + options.hostname = proxyHost; + // Replace 'host' since options is not a URL object + options.host = proxyHost; + options.port = proxy.port; + options.path = location; + if (proxy.protocol) { + options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`; + } + } + + options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { + // Configure proxy for redirected request, passing the original config proxy to apply + // the exact same logic as if the redirected request was performed by axios directly. + setProxy(redirectOptions, configProxy, redirectOptions.href); + }; +} + +const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process'; + +// temporary hotfix + +const wrapAsync = (asyncExecutor) => { + return new Promise((resolve, reject) => { + let onDone; + let isDone; + + const done = (value, isRejected) => { + if (isDone) return; + isDone = true; + onDone && onDone(value, isRejected); + } + + const _resolve = (value) => { + done(value); + resolve(value); + }; + + const _reject = (reason) => { + done(reason, true); + reject(reason); + } + + asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject); + }) +}; + +const resolveFamily = ({address, family}) => { + if (!utils.isString(address)) { + throw TypeError('address must be a string'); + } + return ({ + address, + family: family || (address.indexOf('.') < 0 ? 6 : 4) + }); +} + +const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family}); + +/*eslint consistent-return:0*/ +export default isHttpAdapterSupported && function httpAdapter(config) { + return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { + let {data, lookup, family} = config; + const {responseType, responseEncoding} = config; + const method = config.method.toUpperCase(); + let isDone; + let rejected = false; + let req; + + if (lookup) { + const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]); + // hotfix to support opt.all option which is required for node 20.x + lookup = (hostname, opt, cb) => { + _lookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + + const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; + + opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); + }); + } + } + + // temporary internal emitter until the AxiosRequest class will be implemented + const emitter = new EventEmitter(); + + const onFinished = () => { + if (config.cancelToken) { + config.cancelToken.unsubscribe(abort); + } + + if (config.signal) { + config.signal.removeEventListener('abort', abort); + } + + emitter.removeAllListeners(); + } + + onDone((value, isRejected) => { + isDone = true; + if (isRejected) { + rejected = true; + onFinished(); + } + }); + + function abort(reason) { + emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason); + } + + emitter.once('abort', reject); + + if (config.cancelToken || config.signal) { + config.cancelToken && config.cancelToken.subscribe(abort); + if (config.signal) { + config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); + } + } + + // Parse url + const fullPath = buildFullPath(config.baseURL, config.url); + const parsed = new URL(fullPath, 'http://localhost'); + const protocol = parsed.protocol || supportedProtocols[0]; + + if (protocol === 'data:') { + let convertedData; + + if (method !== 'GET') { + return settle(resolve, reject, { + status: 405, + statusText: 'method not allowed', + headers: {}, + config + }); + } + + try { + convertedData = fromDataURI(config.url, responseType === 'blob', { + Blob: config.env && config.env.Blob + }); + } catch (err) { + throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); + } + + if (responseType === 'text') { + convertedData = convertedData.toString(responseEncoding); + + if (!responseEncoding || responseEncoding === 'utf8') { + convertedData = utils.stripBOM(convertedData); + } + } else if (responseType === 'stream') { + convertedData = stream.Readable.from(convertedData); + } + + return settle(resolve, reject, { + data: convertedData, + status: 200, + statusText: 'OK', + headers: new AxiosHeaders(), + config + }); + } + + if (supportedProtocols.indexOf(protocol) === -1) { + return reject(new AxiosError( + 'Unsupported protocol ' + protocol, + AxiosError.ERR_BAD_REQUEST, + config + )); + } + + const headers = AxiosHeaders.from(config.headers).normalize(); + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + // User-Agent is specified; handle case where no UA header is desired + // Only set header if it hasn't been set in config + headers.set('User-Agent', 'axios/' + VERSION, false); + + const onDownloadProgress = config.onDownloadProgress; + const onUploadProgress = config.onUploadProgress; + const maxRate = config.maxRate; + let maxUploadRate = undefined; + let maxDownloadRate = undefined; + + // support for spec compliant FormData objects + if (utils.isSpecCompliantForm(data)) { + const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); + + data = formDataToStream(data, (formHeaders) => { + headers.set(formHeaders); + }, { + tag: `axios-${VERSION}-boundary`, + boundary: userBoundary && userBoundary[1] || undefined + }); + // support for https://www.npmjs.com/package/form-data api + } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { + headers.set(data.getHeaders()); + + if (!headers.hasContentLength()) { + try { + const knownLength = await util.promisify(data.getLength).call(data); + Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); + /*eslint no-empty:0*/ + } catch (e) { + } + } + } else if (utils.isBlob(data)) { + data.size && headers.setContentType(data.type || 'application/octet-stream'); + headers.setContentLength(data.size || 0); + data = stream.Readable.from(readBlob(data)); + } else if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(new AxiosError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + AxiosError.ERR_BAD_REQUEST, + config + )); + } + + // Add Content-Length header if data exists + headers.setContentLength(data.length, false); + + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(new AxiosError( + 'Request body larger than maxBodyLength limit', + AxiosError.ERR_BAD_REQUEST, + config + )); + } + } + + const contentLength = utils.toFiniteNumber(headers.getContentLength()); + + if (utils.isArray(maxRate)) { + maxUploadRate = maxRate[0]; + maxDownloadRate = maxRate[1]; + } else { + maxUploadRate = maxDownloadRate = maxRate; + } + + if (data && (onUploadProgress || maxUploadRate)) { + if (!utils.isStream(data)) { + data = stream.Readable.from(data, {objectMode: false}); + } + + data = stream.pipeline([data, new AxiosTransformStream({ + length: contentLength, + maxRate: utils.toFiniteNumber(maxUploadRate) + })], utils.noop); + + onUploadProgress && data.on('progress', progress => { + onUploadProgress(Object.assign(progress, { + upload: true + })); + }); + } + + // HTTP basic authentication + let auth = undefined; + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password || ''; + auth = username + ':' + password; + } + + if (!auth && parsed.username) { + const urlUsername = parsed.username; + const urlPassword = parsed.password; + auth = urlUsername + ':' + urlPassword; + } + + auth && headers.delete('authorization'); + + let path; + + try { + path = buildURL( + parsed.pathname + parsed.search, + config.params, + config.paramsSerializer + ).replace(/^\?/, ''); + } catch (err) { + const customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + return reject(customErr); + } + + headers.set( + 'Accept-Encoding', + 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false + ); + + const options = { + path, + method: method, + headers: headers.toJSON(), + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth, + protocol, + family, + beforeRedirect: dispatchBeforeRedirect, + beforeRedirects: {} + }; + + // cacheable-lookup integration hotfix + !utils.isUndefined(lookup) && (options.lookup = lookup); + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + let transport; + const isHttpsRequest = isHttps.test(options.protocol); + options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsRequest ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + if (config.beforeRedirect) { + options.beforeRedirects.config = config.beforeRedirect; + } + transport = isHttpsRequest ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } else { + // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited + options.maxBodyLength = Infinity; + } + + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } + + // Create the request + req = transport.request(options, function handleResponse(res) { + if (req.destroyed) return; + + const streams = [res]; + + const responseLength = +res.headers['content-length']; + + if (onDownloadProgress) { + const transformStream = new AxiosTransformStream({ + length: utils.toFiniteNumber(responseLength), + maxRate: utils.toFiniteNumber(maxDownloadRate) + }); + + onDownloadProgress && transformStream.on('progress', progress => { + onDownloadProgress(Object.assign(progress, { + download: true + })); + }); + + streams.push(transformStream); + } + + // decompress the response body transparently if required + let responseStream = res; + + // return the last request in case of redirects + const lastRequest = res.req || req; + + // if decompress disabled we should not decompress + if (config.decompress !== false && res.headers['content-encoding']) { + // if no content, but headers still say that it is encoded, + // remove the header not confuse downstream operations + if (method === 'HEAD' || res.statusCode === 204) { + delete res.headers['content-encoding']; + } + + switch ((res.headers['content-encoding'] || '').toLowerCase()) { + /*eslint default-case:0*/ + case 'gzip': + case 'x-gzip': + case 'compress': + case 'x-compress': + // add the unzipper to the body stream processing pipeline + streams.push(zlib.createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'deflate': + streams.push(new ZlibHeaderTransformStream()); + + // add the unzipper to the body stream processing pipeline + streams.push(zlib.createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'br': + if (isBrotliSupported) { + streams.push(zlib.createBrotliDecompress(brotliOptions)); + delete res.headers['content-encoding']; + } + } + } + + responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0]; + + const offListeners = stream.finished(responseStream, () => { + offListeners(); + onFinished(); + }); + + const response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: new AxiosHeaders(res.headers), + config, + request: lastRequest + }; + + if (responseType === 'stream') { + response.data = responseStream; + settle(resolve, reject, response); + } else { + const responseBuffer = []; + let totalResponseBytes = 0; + + responseStream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + // stream.destroy() emit aborted event before calling reject() on Node.js v16 + rejected = true; + responseStream.destroy(); + reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + } + }); + + responseStream.on('aborted', function handlerStreamAborted() { + if (rejected) { + return; + } + + const err = new AxiosError( + 'maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + ); + responseStream.destroy(err); + reject(err); + }); + + responseStream.on('error', function handleStreamError(err) { + if (req.destroyed) return; + reject(AxiosError.from(err, null, config, lastRequest)); + }); + + responseStream.on('end', function handleStreamEnd() { + try { + let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (responseType !== 'arraybuffer') { + responseData = responseData.toString(responseEncoding); + if (!responseEncoding || responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + return reject(AxiosError.from(err, null, config, response.request, response)); + } + settle(resolve, reject, response); + }); + } + + emitter.once('abort', err => { + if (!responseStream.destroyed) { + responseStream.emit('error', err); + responseStream.destroy(); + } + }); + }); + + emitter.once('abort', err => { + reject(err); + req.destroy(err); + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + // @todo remove + // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; + reject(AxiosError.from(err, null, config, req)); + }); + + // set tcp keep alive to prevent drop connection by peer + req.on('socket', function handleRequestSocket(socket) { + // default interval of sending ack packet is 1 minute + socket.setKeepAlive(true, 1000 * 60); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + const timeout = parseInt(config.timeout, 10); + + if (Number.isNaN(timeout)) { + reject(new AxiosError( + 'error trying to parse `config.timeout` to int', + AxiosError.ERR_BAD_OPTION_VALUE, + config, + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devouring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + if (isDone) return; + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + req + )); + abort(); + }); + } + + + // Send the request + if (utils.isStream(data)) { + let ended = false; + let errored = false; + + data.on('end', () => { + ended = true; + }); + + data.once('error', err => { + errored = true; + req.destroy(err); + }); + + data.on('close', () => { + if (!ended && !errored) { + abort(new CanceledError('Request stream has been aborted', config, req)); + } + }); + + data.pipe(req); + } else { + req.end(data); + } + }); +} + +export const __setProxy = setProxy; diff --git a/node_modules/axios/lib/adapters/xhr.js b/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 00000000..26126b2f --- /dev/null +++ b/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,260 @@ +'use strict'; + +import utils from './../utils.js'; +import settle from './../core/settle.js'; +import cookies from './../helpers/cookies.js'; +import buildURL from './../helpers/buildURL.js'; +import buildFullPath from '../core/buildFullPath.js'; +import isURLSameOrigin from './../helpers/isURLSameOrigin.js'; +import transitionalDefaults from '../defaults/transitional.js'; +import AxiosError from '../core/AxiosError.js'; +import CanceledError from '../cancel/CanceledError.js'; +import parseProtocol from '../helpers/parseProtocol.js'; +import platform from '../platform/index.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; +import speedometer from '../helpers/speedometer.js'; + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +export default isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = AxiosHeaders.from(config.headers).normalize(); + let {responseType, withXSRFToken} = config; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + let contentType; + + if (utils.isFormData(requestData)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + requestHeaders.setContentType(false); // Let the browser set it + } else if ((contentType = requestHeaders.getContentType()) !== false) { + // fix semicolon duplication issue for ReactNative FormData implementation + const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; + requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); + } + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = buildFullPath(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if(platform.hasStandardBrowserEnv) { + withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) { + // Add xsrf header + const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(fullPath); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +} diff --git a/node_modules/axios/lib/axios.js b/node_modules/axios/lib/axios.js new file mode 100644 index 00000000..873f246d --- /dev/null +++ b/node_modules/axios/lib/axios.js @@ -0,0 +1,89 @@ +'use strict'; + +import utils from './utils.js'; +import bind from './helpers/bind.js'; +import Axios from './core/Axios.js'; +import mergeConfig from './core/mergeConfig.js'; +import defaults from './defaults/index.js'; +import formDataToJSON from './helpers/formDataToJSON.js'; +import CanceledError from './cancel/CanceledError.js'; +import CancelToken from './cancel/CancelToken.js'; +import isCancel from './cancel/isCancel.js'; +import {VERSION} from './env/data.js'; +import toFormData from './helpers/toFormData.js'; +import AxiosError from './core/AxiosError.js'; +import spread from './helpers/spread.js'; +import isAxiosError from './helpers/isAxiosError.js'; +import AxiosHeaders from "./core/AxiosHeaders.js"; +import adapters from './adapters/adapters.js'; +import HttpStatusCode from './helpers/HttpStatusCode.js'; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios(defaultConfig); + const instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; + +// Expose AxiosError class +axios.AxiosError = AxiosError; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig; + +axios.AxiosHeaders = AxiosHeaders; + +axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode; + +axios.default = axios; + +// this module should only have a default export +export default axios diff --git a/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 00000000..20d8f68a --- /dev/null +++ b/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,121 @@ +'use strict'; + +import CanceledError from './CanceledError.js'; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +export default CancelToken; diff --git a/node_modules/axios/lib/cancel/CanceledError.js b/node_modules/axios/lib/cancel/CanceledError.js new file mode 100644 index 00000000..880066ed --- /dev/null +++ b/node_modules/axios/lib/cancel/CanceledError.js @@ -0,0 +1,25 @@ +'use strict'; + +import AxiosError from '../core/AxiosError.js'; +import utils from '../utils.js'; + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +export default CanceledError; diff --git a/node_modules/axios/lib/cancel/isCancel.js b/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 00000000..a444a129 --- /dev/null +++ b/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +export default function isCancel(value) { + return !!(value && value.__CANCEL__); +} diff --git a/node_modules/axios/lib/core/Axios.js b/node_modules/axios/lib/core/Axios.js new file mode 100644 index 00000000..2713364a --- /dev/null +++ b/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,225 @@ +'use strict'; + +import utils from './../utils.js'; +import buildURL from '../helpers/buildURL.js'; +import InterceptorManager from './InterceptorManager.js'; +import dispatchRequest from './dispatchRequest.js'; +import mergeConfig from './mergeConfig.js'; +import buildFullPath from './buildFullPath.js'; +import validator from '../helpers/validator.js'; +import AxiosHeaders from './AxiosHeaders.js'; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy; + + Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack + } + } + + throw err; + } + } + + _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + } + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils.merge( + headers.common, + headers[config.method] + ); + + headers && utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +export default Axios; diff --git a/node_modules/axios/lib/core/AxiosError.js b/node_modules/axios/lib/core/AxiosError.js new file mode 100644 index 00000000..7141a8cd --- /dev/null +++ b/node_modules/axios/lib/core/AxiosError.js @@ -0,0 +1,100 @@ +'use strict'; + +import utils from '../utils.js'; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +utils.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype); + + utils.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +export default AxiosError; diff --git a/node_modules/axios/lib/core/AxiosHeaders.js b/node_modules/axios/lib/core/AxiosHeaders.js new file mode 100644 index 00000000..558ad8fc --- /dev/null +++ b/node_modules/axios/lib/core/AxiosHeaders.js @@ -0,0 +1,298 @@ +'use strict'; + +import utils from '../utils.js'; +import parseHeaders from '../helpers/parseHeaders.js'; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils.isString(value)) return; + + if (utils.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils.forEach(this, (value, header) => { + const key = utils.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + } +}); + +utils.freezeMethods(AxiosHeaders); + +export default AxiosHeaders; diff --git a/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 00000000..6657a9d2 --- /dev/null +++ b/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,71 @@ +'use strict'; + +import utils from './../utils.js'; + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +export default InterceptorManager; diff --git a/node_modules/axios/lib/core/README.md b/node_modules/axios/lib/core/README.md new file mode 100644 index 00000000..84559ce7 --- /dev/null +++ b/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/axios/lib/core/buildFullPath.js b/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 00000000..b60927c0 --- /dev/null +++ b/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,21 @@ +'use strict'; + +import isAbsoluteURL from '../helpers/isAbsoluteURL.js'; +import combineURLs from '../helpers/combineURLs.js'; + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +export default function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} diff --git a/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 00000000..9e306aac --- /dev/null +++ b/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,81 @@ +'use strict'; + +import transformData from './transformData.js'; +import isCancel from '../cancel/isCancel.js'; +import defaults from '../defaults/index.js'; +import CanceledError from '../cancel/CanceledError.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; +import adapters from "../adapters/adapters.js"; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +export default function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults.adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} diff --git a/node_modules/axios/lib/core/mergeConfig.js b/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 00000000..bbbf96d4 --- /dev/null +++ b/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,106 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosHeaders from "./AxiosHeaders.js"; + +const headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +export default function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge.call({caseless}, target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} diff --git a/node_modules/axios/lib/core/settle.js b/node_modules/axios/lib/core/settle.js new file mode 100644 index 00000000..ac905c43 --- /dev/null +++ b/node_modules/axios/lib/core/settle.js @@ -0,0 +1,27 @@ +'use strict'; + +import AxiosError from './AxiosError.js'; + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +export default function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} diff --git a/node_modules/axios/lib/core/transformData.js b/node_modules/axios/lib/core/transformData.js new file mode 100644 index 00000000..eeb5a8a1 --- /dev/null +++ b/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,28 @@ +'use strict'; + +import utils from './../utils.js'; +import defaults from '../defaults/index.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +export default function transformData(fns, response) { + const config = this || defaults; + const context = response || config; + const headers = AxiosHeaders.from(context.headers); + let data = context.data; + + utils.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} diff --git a/node_modules/axios/lib/defaults/index.js b/node_modules/axios/lib/defaults/index.js new file mode 100644 index 00000000..774893ae --- /dev/null +++ b/node_modules/axios/lib/defaults/index.js @@ -0,0 +1,156 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosError from '../core/AxiosError.js'; +import transitionalDefaults from './transitional.js'; +import toFormData from '../helpers/toFormData.js'; +import toURLEncodedForm from '../helpers/toURLEncodedForm.js'; +import platform from '../platform/index.js'; +import formDataToJSON from '../helpers/formDataToJSON.js'; + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils.isObject(data); + + if (isObjectPayload && utils.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils.isFormData(data); + + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } +}; + +utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +export default defaults; diff --git a/node_modules/axios/lib/defaults/transitional.js b/node_modules/axios/lib/defaults/transitional.js new file mode 100644 index 00000000..f8913319 --- /dev/null +++ b/node_modules/axios/lib/defaults/transitional.js @@ -0,0 +1,7 @@ +'use strict'; + +export default { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; diff --git a/node_modules/axios/lib/env/README.md b/node_modules/axios/lib/env/README.md new file mode 100644 index 00000000..b41baff3 --- /dev/null +++ b/node_modules/axios/lib/env/README.md @@ -0,0 +1,3 @@ +# axios // env + +The `data.js` file is updated automatically when the package version is upgrading. Please do not edit it manually. diff --git a/node_modules/axios/lib/env/classes/FormData.js b/node_modules/axios/lib/env/classes/FormData.js new file mode 100644 index 00000000..862adb93 --- /dev/null +++ b/node_modules/axios/lib/env/classes/FormData.js @@ -0,0 +1,2 @@ +import _FormData from 'form-data'; +export default typeof FormData !== 'undefined' ? FormData : _FormData; diff --git a/node_modules/axios/lib/env/data.js b/node_modules/axios/lib/env/data.js new file mode 100644 index 00000000..7f15ca69 --- /dev/null +++ b/node_modules/axios/lib/env/data.js @@ -0,0 +1 @@ +export const VERSION = "1.6.7"; \ No newline at end of file diff --git a/node_modules/axios/lib/helpers/AxiosTransformStream.js b/node_modules/axios/lib/helpers/AxiosTransformStream.js new file mode 100644 index 00000000..8e8c6d42 --- /dev/null +++ b/node_modules/axios/lib/helpers/AxiosTransformStream.js @@ -0,0 +1,191 @@ +'use strict'; + +import stream from 'stream'; +import utils from '../utils.js'; +import throttle from './throttle.js'; +import speedometer from './speedometer.js'; + +const kInternals = Symbol('internals'); + +class AxiosTransformStream extends stream.Transform{ + constructor(options) { + options = utils.toFlatObject(options, { + maxRate: 0, + chunkSize: 64 * 1024, + minChunkSize: 100, + timeWindow: 500, + ticksRate: 2, + samplesCount: 15 + }, null, (prop, source) => { + return !utils.isUndefined(source[prop]); + }); + + super({ + readableHighWaterMark: options.chunkSize + }); + + const self = this; + + const internals = this[kInternals] = { + length: options.length, + timeWindow: options.timeWindow, + ticksRate: options.ticksRate, + chunkSize: options.chunkSize, + maxRate: options.maxRate, + minChunkSize: options.minChunkSize, + bytesSeen: 0, + isCaptured: false, + notifiedBytesLoaded: 0, + ts: Date.now(), + bytes: 0, + onReadCallback: null + }; + + const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow); + + this.on('newListener', event => { + if (event === 'progress') { + if (!internals.isCaptured) { + internals.isCaptured = true; + } + } + }); + + let bytesNotified = 0; + + internals.updateProgress = throttle(function throttledHandler() { + const totalBytes = internals.length; + const bytesTransferred = internals.bytesSeen; + const progressBytes = bytesTransferred - bytesNotified; + if (!progressBytes || self.destroyed) return; + + const rate = _speedometer(progressBytes); + + bytesNotified = bytesTransferred; + + process.nextTick(() => { + self.emit('progress', { + 'loaded': bytesTransferred, + 'total': totalBytes, + 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined, + 'bytes': progressBytes, + 'rate': rate ? rate : undefined, + 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ? + (totalBytes - bytesTransferred) / rate : undefined + }); + }); + }, internals.ticksRate); + + const onFinish = () => { + internals.updateProgress(true); + }; + + this.once('end', onFinish); + this.once('error', onFinish); + } + + _read(size) { + const internals = this[kInternals]; + + if (internals.onReadCallback) { + internals.onReadCallback(); + } + + return super._read(size); + } + + _transform(chunk, encoding, callback) { + const self = this; + const internals = this[kInternals]; + const maxRate = internals.maxRate; + + const readableHighWaterMark = this.readableHighWaterMark; + + const timeWindow = internals.timeWindow; + + const divider = 1000 / timeWindow; + const bytesThreshold = (maxRate / divider); + const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; + + function pushChunk(_chunk, _callback) { + const bytes = Buffer.byteLength(_chunk); + internals.bytesSeen += bytes; + internals.bytes += bytes; + + if (internals.isCaptured) { + internals.updateProgress(); + } + + if (self.push(_chunk)) { + process.nextTick(_callback); + } else { + internals.onReadCallback = () => { + internals.onReadCallback = null; + process.nextTick(_callback); + }; + } + } + + const transformChunk = (_chunk, _callback) => { + const chunkSize = Buffer.byteLength(_chunk); + let chunkRemainder = null; + let maxChunkSize = readableHighWaterMark; + let bytesLeft; + let passed = 0; + + if (maxRate) { + const now = Date.now(); + + if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) { + internals.ts = now; + bytesLeft = bytesThreshold - internals.bytes; + internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; + passed = 0; + } + + bytesLeft = bytesThreshold - internals.bytes; + } + + if (maxRate) { + if (bytesLeft <= 0) { + // next time window + return setTimeout(() => { + _callback(null, _chunk); + }, timeWindow - passed); + } + + if (bytesLeft < maxChunkSize) { + maxChunkSize = bytesLeft; + } + } + + if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) { + chunkRemainder = _chunk.subarray(maxChunkSize); + _chunk = _chunk.subarray(0, maxChunkSize); + } + + pushChunk(_chunk, chunkRemainder ? () => { + process.nextTick(_callback, null, chunkRemainder); + } : _callback); + }; + + transformChunk(chunk, function transformNextChunk(err, _chunk) { + if (err) { + return callback(err); + } + + if (_chunk) { + transformChunk(_chunk, transformNextChunk); + } else { + callback(null); + } + }); + } + + setLength(length) { + this[kInternals].length = +length; + return this; + } +} + +export default AxiosTransformStream; diff --git a/node_modules/axios/lib/helpers/AxiosURLSearchParams.js b/node_modules/axios/lib/helpers/AxiosURLSearchParams.js new file mode 100644 index 00000000..b9aa9f02 --- /dev/null +++ b/node_modules/axios/lib/helpers/AxiosURLSearchParams.js @@ -0,0 +1,58 @@ +'use strict'; + +import toFormData from './toFormData.js'; + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +export default AxiosURLSearchParams; diff --git a/node_modules/axios/lib/helpers/HttpStatusCode.js b/node_modules/axios/lib/helpers/HttpStatusCode.js new file mode 100644 index 00000000..b3e7adca --- /dev/null +++ b/node_modules/axios/lib/helpers/HttpStatusCode.js @@ -0,0 +1,71 @@ +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +export default HttpStatusCode; diff --git a/node_modules/axios/lib/helpers/README.md b/node_modules/axios/lib/helpers/README.md new file mode 100644 index 00000000..4ae34193 --- /dev/null +++ b/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js b/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js new file mode 100644 index 00000000..d1791f0b --- /dev/null +++ b/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js @@ -0,0 +1,28 @@ +"use strict"; + +import stream from "stream"; + +class ZlibHeaderTransformStream extends stream.Transform { + __transform(chunk, encoding, callback) { + this.push(chunk); + callback(); + } + + _transform(chunk, encoding, callback) { + if (chunk.length !== 0) { + this._transform = this.__transform; + + // Add Default Compression headers if no zlib headers are present + if (chunk[0] !== 120) { // Hex: 78 + const header = Buffer.alloc(2); + header[0] = 120; // Hex: 78 + header[1] = 156; // Hex: 9C + this.push(header, encoding); + } + } + + this.__transform(chunk, encoding, callback); + } +} + +export default ZlibHeaderTransformStream; diff --git a/node_modules/axios/lib/helpers/bind.js b/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 00000000..b3aa83b7 --- /dev/null +++ b/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,7 @@ +'use strict'; + +export default function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} diff --git a/node_modules/axios/lib/helpers/buildURL.js b/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 00000000..d769fdf4 --- /dev/null +++ b/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,63 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js'; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +export default function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} diff --git a/node_modules/axios/lib/helpers/callbackify.js b/node_modules/axios/lib/helpers/callbackify.js new file mode 100644 index 00000000..4603badc --- /dev/null +++ b/node_modules/axios/lib/helpers/callbackify.js @@ -0,0 +1,16 @@ +import utils from "../utils.js"; + +const callbackify = (fn, reducer) => { + return utils.isAsyncFn(fn) ? function (...args) { + const cb = args.pop(); + fn.apply(this, args).then((value) => { + try { + reducer ? cb(null, ...reducer(value)) : cb(null, value); + } catch (err) { + cb(err); + } + }, cb); + } : fn; +} + +export default callbackify; diff --git a/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 00000000..9f04f020 --- /dev/null +++ b/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +export default function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} diff --git a/node_modules/axios/lib/helpers/cookies.js b/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 00000000..d039ac4f --- /dev/null +++ b/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,42 @@ +import utils from './../utils.js'; +import platform from '../platform/index.js'; + +export default platform.hasStandardBrowserEnv ? + + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure) { + const cookie = [name + '=' + encodeURIComponent(value)]; + + utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); + + utils.isString(path) && cookie.push('path=' + path); + + utils.isString(domain) && cookie.push('domain=' + domain); + + secure === true && cookie.push('secure'); + + document.cookie = cookie.join('; '); + }, + + read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000); + } + } + + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + diff --git a/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 00000000..9e8fae6b --- /dev/null +++ b/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,26 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + * + * @returns {void} + */ +export default function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +} diff --git a/node_modules/axios/lib/helpers/formDataToJSON.js b/node_modules/axios/lib/helpers/formDataToJSON.js new file mode 100644 index 00000000..906ce602 --- /dev/null +++ b/node_modules/axios/lib/helpers/formDataToJSON.js @@ -0,0 +1,95 @@ +'use strict'; + +import utils from '../utils.js'; + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils.isArray(target) ? target.length : name; + + if (isLast) { + if (utils.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { + const obj = {}; + + utils.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +export default formDataToJSON; diff --git a/node_modules/axios/lib/helpers/formDataToStream.js b/node_modules/axios/lib/helpers/formDataToStream.js new file mode 100644 index 00000000..9187e73e --- /dev/null +++ b/node_modules/axios/lib/helpers/formDataToStream.js @@ -0,0 +1,111 @@ +import {TextEncoder} from 'util'; +import {Readable} from 'stream'; +import utils from "../utils.js"; +import readBlob from "./readBlob.js"; + +const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_'; + +const textEncoder = new TextEncoder(); + +const CRLF = '\r\n'; +const CRLF_BYTES = textEncoder.encode(CRLF); +const CRLF_BYTES_COUNT = 2; + +class FormDataPart { + constructor(name, value) { + const {escapeName} = this.constructor; + const isStringValue = utils.isString(value); + + let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${ + !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : '' + }${CRLF}`; + + if (isStringValue) { + value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); + } else { + headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}` + } + + this.headers = textEncoder.encode(headers + CRLF); + + this.contentLength = isStringValue ? value.byteLength : value.size; + + this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; + + this.name = name; + this.value = value; + } + + async *encode(){ + yield this.headers; + + const {value} = this; + + if(utils.isTypedArray(value)) { + yield value; + } else { + yield* readBlob(value); + } + + yield CRLF_BYTES; + } + + static escapeName(name) { + return String(name).replace(/[\r\n"]/g, (match) => ({ + '\r' : '%0D', + '\n' : '%0A', + '"' : '%22', + }[match])); + } +} + +const formDataToStream = (form, headersHandler, options) => { + const { + tag = 'form-data-boundary', + size = 25, + boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET) + } = options || {}; + + if(!utils.isFormData(form)) { + throw TypeError('FormData instance required'); + } + + if (boundary.length < 1 || boundary.length > 70) { + throw Error('boundary must be 10-70 characters long') + } + + const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); + const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF); + let contentLength = footerBytes.byteLength; + + const parts = Array.from(form.entries()).map(([name, value]) => { + const part = new FormDataPart(name, value); + contentLength += part.size; + return part; + }); + + contentLength += boundaryBytes.byteLength * parts.length; + + contentLength = utils.toFiniteNumber(contentLength); + + const computedHeaders = { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + } + + if (Number.isFinite(contentLength)) { + computedHeaders['Content-Length'] = contentLength; + } + + headersHandler && headersHandler(computedHeaders); + + return Readable.from((async function *() { + for(const part of parts) { + yield boundaryBytes; + yield* part.encode(); + } + + yield footerBytes; + })()); +}; + +export default formDataToStream; diff --git a/node_modules/axios/lib/helpers/fromDataURI.js b/node_modules/axios/lib/helpers/fromDataURI.js new file mode 100644 index 00000000..eb71d3f3 --- /dev/null +++ b/node_modules/axios/lib/helpers/fromDataURI.js @@ -0,0 +1,53 @@ +'use strict'; + +import AxiosError from '../core/AxiosError.js'; +import parseProtocol from './parseProtocol.js'; +import platform from '../platform/index.js'; + +const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; + +/** + * Parse data uri to a Buffer or Blob + * + * @param {String} uri + * @param {?Boolean} asBlob + * @param {?Object} options + * @param {?Function} options.Blob + * + * @returns {Buffer|Blob} + */ +export default function fromDataURI(uri, asBlob, options) { + const _Blob = options && options.Blob || platform.classes.Blob; + const protocol = parseProtocol(uri); + + if (asBlob === undefined && _Blob) { + asBlob = true; + } + + if (protocol === 'data') { + uri = protocol.length ? uri.slice(protocol.length + 1) : uri; + + const match = DATA_URL_PATTERN.exec(uri); + + if (!match) { + throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL); + } + + const mime = match[1]; + const isBase64 = match[2]; + const body = match[3]; + const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8'); + + if (asBlob) { + if (!_Blob) { + throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT); + } + + return new _Blob([buffer], {type: mime}); + } + + return buffer; + } + + throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT); +} diff --git a/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 00000000..4747a457 --- /dev/null +++ b/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +export default function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} diff --git a/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 00000000..da6cd63f --- /dev/null +++ b/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,14 @@ +'use strict'; + +import utils from './../utils.js'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +export default function isAxiosError(payload) { + return utils.isObject(payload) && (payload.isAxiosError === true); +} diff --git a/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 00000000..a8678a4e --- /dev/null +++ b/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,67 @@ +'use strict'; + +import utils from './../utils.js'; +import platform from '../platform/index.js'; + +export default platform.hasStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover its components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })(); diff --git a/node_modules/axios/lib/helpers/null.js b/node_modules/axios/lib/helpers/null.js new file mode 100644 index 00000000..b9f82c46 --- /dev/null +++ b/node_modules/axios/lib/helpers/null.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line strict +export default null; diff --git a/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 00000000..50af9480 --- /dev/null +++ b/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,55 @@ +'use strict'; + +import utils from './../utils.js'; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +export default rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; diff --git a/node_modules/axios/lib/helpers/parseProtocol.js b/node_modules/axios/lib/helpers/parseProtocol.js new file mode 100644 index 00000000..586ec964 --- /dev/null +++ b/node_modules/axios/lib/helpers/parseProtocol.js @@ -0,0 +1,6 @@ +'use strict'; + +export default function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} diff --git a/node_modules/axios/lib/helpers/readBlob.js b/node_modules/axios/lib/helpers/readBlob.js new file mode 100644 index 00000000..6de748e8 --- /dev/null +++ b/node_modules/axios/lib/helpers/readBlob.js @@ -0,0 +1,15 @@ +const {asyncIterator} = Symbol; + +const readBlob = async function* (blob) { + if (blob.stream) { + yield* blob.stream() + } else if (blob.arrayBuffer) { + yield await blob.arrayBuffer() + } else if (blob[asyncIterator]) { + yield* blob[asyncIterator](); + } else { + yield blob; + } +} + +export default readBlob; diff --git a/node_modules/axios/lib/helpers/speedometer.js b/node_modules/axios/lib/helpers/speedometer.js new file mode 100644 index 00000000..3b3c6662 --- /dev/null +++ b/node_modules/axios/lib/helpers/speedometer.js @@ -0,0 +1,55 @@ +'use strict'; + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +export default speedometer; diff --git a/node_modules/axios/lib/helpers/spread.js b/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 00000000..13479cb2 --- /dev/null +++ b/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,28 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +export default function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} diff --git a/node_modules/axios/lib/helpers/throttle.js b/node_modules/axios/lib/helpers/throttle.js new file mode 100644 index 00000000..6969df1a --- /dev/null +++ b/node_modules/axios/lib/helpers/throttle.js @@ -0,0 +1,33 @@ +'use strict'; + +/** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ +function throttle(fn, freq) { + let timestamp = 0; + const threshold = 1000 / freq; + let timer = null; + return function throttled(force, args) { + const now = Date.now(); + if (force || now - timestamp > threshold) { + if (timer) { + clearTimeout(timer); + timer = null; + } + timestamp = now; + return fn.apply(null, args); + } + if (!timer) { + timer = setTimeout(() => { + timer = null; + timestamp = Date.now(); + return fn.apply(null, args); + }, threshold - (now - timestamp)); + } + }; +} + +export default throttle; diff --git a/node_modules/axios/lib/helpers/toFormData.js b/node_modules/axios/lib/helpers/toFormData.js new file mode 100644 index 00000000..a41e966c --- /dev/null +++ b/node_modules/axios/lib/helpers/toFormData.js @@ -0,0 +1,219 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosError from '../core/AxiosError.js'; +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored +import PlatformFormData from '../platform/node/classes/FormData.js'; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils.isPlainObject(thing) || utils.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!utils.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (PlatformFormData || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils.isSpecCompliantForm(formData); + + if (!utils.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils.isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && utils.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + + if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils.isArray(value) && isFlatArray(value)) || + ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils.forEach(value, function each(el, key) { + const result = !(utils.isUndefined(el) || el === null) && visitor.call( + formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +export default toFormData; diff --git a/node_modules/axios/lib/helpers/toURLEncodedForm.js b/node_modules/axios/lib/helpers/toURLEncodedForm.js new file mode 100644 index 00000000..988a38a1 --- /dev/null +++ b/node_modules/axios/lib/helpers/toURLEncodedForm.js @@ -0,0 +1,18 @@ +'use strict'; + +import utils from '../utils.js'; +import toFormData from './toFormData.js'; +import platform from '../platform/index.js'; + +export default function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} diff --git a/node_modules/axios/lib/helpers/validator.js b/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 00000000..14b46960 --- /dev/null +++ b/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,91 @@ +'use strict'; + +import {VERSION} from '../env/data.js'; +import AxiosError from '../core/AxiosError.js'; + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} + +export default { + assertOptions, + validators +}; diff --git a/node_modules/axios/lib/platform/browser/classes/Blob.js b/node_modules/axios/lib/platform/browser/classes/Blob.js new file mode 100644 index 00000000..6c506c48 --- /dev/null +++ b/node_modules/axios/lib/platform/browser/classes/Blob.js @@ -0,0 +1,3 @@ +'use strict' + +export default typeof Blob !== 'undefined' ? Blob : null diff --git a/node_modules/axios/lib/platform/browser/classes/FormData.js b/node_modules/axios/lib/platform/browser/classes/FormData.js new file mode 100644 index 00000000..f36d31b2 --- /dev/null +++ b/node_modules/axios/lib/platform/browser/classes/FormData.js @@ -0,0 +1,3 @@ +'use strict'; + +export default typeof FormData !== 'undefined' ? FormData : null; diff --git a/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js b/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js new file mode 100644 index 00000000..b7dae953 --- /dev/null +++ b/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js @@ -0,0 +1,4 @@ +'use strict'; + +import AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js'; +export default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; diff --git a/node_modules/axios/lib/platform/browser/index.js b/node_modules/axios/lib/platform/browser/index.js new file mode 100644 index 00000000..08c206f3 --- /dev/null +++ b/node_modules/axios/lib/platform/browser/index.js @@ -0,0 +1,13 @@ +import URLSearchParams from './classes/URLSearchParams.js' +import FormData from './classes/FormData.js' +import Blob from './classes/Blob.js' + +export default { + isBrowser: true, + classes: { + URLSearchParams, + FormData, + Blob + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}; diff --git a/node_modules/axios/lib/platform/common/utils.js b/node_modules/axios/lib/platform/common/utils.js new file mode 100644 index 00000000..56fe79ab --- /dev/null +++ b/node_modules/axios/lib/platform/common/utils.js @@ -0,0 +1,47 @@ +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = ( + (product) => { + return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 + })(typeof navigator !== 'undefined' && navigator.product); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +export { + hasBrowserEnv, + hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv +} diff --git a/node_modules/axios/lib/platform/index.js b/node_modules/axios/lib/platform/index.js new file mode 100644 index 00000000..860ba21a --- /dev/null +++ b/node_modules/axios/lib/platform/index.js @@ -0,0 +1,7 @@ +import platform from './node/index.js'; +import * as utils from './common/utils.js'; + +export default { + ...utils, + ...platform +} diff --git a/node_modules/axios/lib/platform/node/classes/FormData.js b/node_modules/axios/lib/platform/node/classes/FormData.js new file mode 100644 index 00000000..b07f9476 --- /dev/null +++ b/node_modules/axios/lib/platform/node/classes/FormData.js @@ -0,0 +1,3 @@ +import FormData from 'form-data'; + +export default FormData; diff --git a/node_modules/axios/lib/platform/node/classes/URLSearchParams.js b/node_modules/axios/lib/platform/node/classes/URLSearchParams.js new file mode 100644 index 00000000..fba58428 --- /dev/null +++ b/node_modules/axios/lib/platform/node/classes/URLSearchParams.js @@ -0,0 +1,4 @@ +'use strict'; + +import url from 'url'; +export default url.URLSearchParams; diff --git a/node_modules/axios/lib/platform/node/index.js b/node_modules/axios/lib/platform/node/index.js new file mode 100644 index 00000000..aef514aa --- /dev/null +++ b/node_modules/axios/lib/platform/node/index.js @@ -0,0 +1,12 @@ +import URLSearchParams from './classes/URLSearchParams.js' +import FormData from './classes/FormData.js' + +export default { + isNode: true, + classes: { + URLSearchParams, + FormData, + Blob: typeof Blob !== 'undefined' && Blob || null + }, + protocols: [ 'http', 'https', 'file', 'data' ] +}; diff --git a/node_modules/axios/lib/utils.js b/node_modules/axios/lib/utils.js new file mode 100644 index 00000000..a386b77f --- /dev/null +++ b/node_modules/axios/lib/utils.js @@ -0,0 +1,723 @@ +'use strict'; + +import bind from './helpers/bind.js'; + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +} + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +} + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +} + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +} + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +} + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + } + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +} + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0] + } + + return str; +} + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + } + + return visit(obj, 0); +} + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); + +export default { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable +}; diff --git a/node_modules/axios/package.json b/node_modules/axios/package.json new file mode 100644 index 00000000..cf185bda --- /dev/null +++ b/node_modules/axios/package.json @@ -0,0 +1,218 @@ +{ + "name": "axios", + "version": "1.6.7", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "exports": { + ".": { + "types": { + "require": "./index.d.cts", + "default": "./index.d.ts" + }, + "browser": { + "require": "./dist/browser/axios.cjs", + "default": "./index.js" + }, + "default": { + "require": "./dist/node/axios.cjs", + "default": "./index.js" + } + }, + "./lib/adapters/http.js": "./lib/adapters/http.js", + "./lib/adapters/xhr.js": "./lib/adapters/xhr.js", + "./unsafe/*": "./lib/*", + "./unsafe/core/settle.js": "./lib/core/settle.js", + "./unsafe/core/buildFullPath.js": "./lib/core/buildFullPath.js", + "./unsafe/helpers/isAbsoluteURL.js": "./lib/helpers/isAbsoluteURL.js", + "./unsafe/helpers/buildURL.js": "./lib/helpers/buildURL.js", + "./unsafe/helpers/combineURLs.js": "./lib/helpers/combineURLs.js", + "./unsafe/adapters/http.js": "./lib/adapters/http.js", + "./unsafe/adapters/xhr.js": "./lib/adapters/xhr.js", + "./unsafe/utils.js": "./lib/utils.js", + "./package.json": "./package.json" + }, + "type": "module", + "types": "index.d.ts", + "scripts": { + "test": "npm run test:eslint && npm run test:mocha && npm run test:karma && npm run test:dtslint && npm run test:exports", + "test:eslint": "node bin/ssl_hotfix.js eslint lib/**/*.js", + "test:dtslint": "dtslint --localTs node_modules/typescript/lib", + "test:mocha": "node bin/ssl_hotfix.js mocha test/unit/**/*.js --timeout 30000 --exit", + "test:exports": "node bin/ssl_hotfix.js mocha test/module/test.js --timeout 30000 --exit", + "test:karma": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: karma start karma.conf.cjs --single-run", + "test:karma:firefox": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: Browsers=Firefox karma start karma.conf.cjs --single-run", + "test:karma:server": "node bin/ssl_hotfix.js cross-env karma start karma.conf.cjs", + "test:build:version": "node ./bin/check-build-version.js", + "start": "node ./sandbox/server.js", + "preversion": "gulp version", + "version": "npm run build && git add dist && git add package.json", + "prepublishOnly": "npm run test:build:version", + "postpublish": "git push && git push --tags", + "build": "gulp clear && cross-env NODE_ENV=production rollup -c -m", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js", + "prepare": "husky install && npm run prepare:hooks", + "prepare:hooks": "npx husky set .husky/commit-msg \"npx commitlint --edit $1\"", + "release:dry": "release-it --dry-run --no-npm", + "release:info": "release-it --release-version", + "release:beta:no-npm": "release-it --preRelease=beta --no-npm", + "release:beta": "release-it --preRelease=beta", + "release:no-npm": "release-it --no-npm", + "release:changelog:fix": "node ./bin/injectContributorsList.js && git add CHANGELOG.md", + "release": "release-it" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "@babel/core": "^7.18.2", + "@babel/preset-env": "^7.18.2", + "@commitlint/cli": "^17.3.0", + "@commitlint/config-conventional": "^17.3.0", + "@release-it/conventional-changelog": "^5.1.1", + "@rollup/plugin-babel": "^5.3.1", + "@rollup/plugin-commonjs": "^15.1.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.0.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "abortcontroller-polyfill": "^1.7.3", + "auto-changelog": "^2.4.0", + "body-parser": "^1.20.0", + "chalk": "^5.2.0", + "coveralls": "^3.1.1", + "cross-env": "^7.0.3", + "dev-null": "^0.1.1", + "dtslint": "^4.2.1", + "es6-promise": "^4.2.8", + "eslint": "^8.17.0", + "express": "^4.18.1", + "formdata-node": "^5.0.0", + "formidable": "^2.0.1", + "fs-extra": "^10.1.0", + "get-stream": "^3.0.0", + "gulp": "^4.0.2", + "gzip-size": "^7.0.0", + "handlebars": "^4.7.7", + "husky": "^8.0.2", + "istanbul-instrumenter-loader": "^3.0.1", + "jasmine-core": "^2.4.1", + "karma": "^6.3.17", + "karma-chrome-launcher": "^3.1.1", + "karma-firefox-launcher": "^2.1.2", + "karma-jasmine": "^1.1.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-rollup-preprocessor": "^7.0.8", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "memoizee": "^0.4.15", + "minimist": "^1.2.7", + "mocha": "^10.0.0", + "multer": "^1.4.4", + "pretty-bytes": "^6.0.0", + "release-it": "^15.5.1", + "rollup": "^2.67.0", + "rollup-plugin-auto-external": "^2.0.0", + "rollup-plugin-bundle-size": "^1.0.3", + "rollup-plugin-terser": "^7.0.2", + "sinon": "^4.5.0", + "stream-throttle": "^0.1.3", + "string-replace-async": "^3.0.2", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.8.4" + }, + "browser": { + "./lib/adapters/http.js": "./lib/helpers/null.js", + "./lib/platform/node/index.js": "./lib/platform/browser/index.js", + "./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ], + "contributors": [ + "Matt Zabriskie (https://github.com/mzabriskie)", + "Nick Uraltsev (https://github.com/nickuraltsev)", + "Jay (https://github.com/jasonsaayman)", + "Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)", + "Emily Morehouse (https://github.com/emilyemorehouse)", + "Rubén Norte (https://github.com/rubennorte)", + "Justin Beckwith (https://github.com/JustinBeckwith)", + "Martti Laine (https://github.com/codeclown)", + "Xianming Zhong (https://github.com/chinesedfan)", + "Rikki Gibson (https://github.com/RikkiGibson)", + "Remco Haszing (https://github.com/remcohaszing)", + "Yasu Flores (https://github.com/yasuf)", + "Ben Carp (https://github.com/carpben)" + ], + "sideEffects": false, + "release-it": { + "git": { + "commitMessage": "chore(release): v${version}", + "push": true, + "commit": true, + "tag": true, + "requireCommits": false, + "requireCleanWorkingDir": false + }, + "github": { + "release": true, + "draft": true + }, + "npm": { + "publish": false, + "ignoreVersion": false + }, + "plugins": { + "@release-it/conventional-changelog": { + "preset": "angular", + "infile": "CHANGELOG.md", + "header": "# Changelog" + } + }, + "hooks": { + "before:init": "npm test", + "after:bump": "gulp version --bump ${version} && npm run build && npm run test:build:version && git add ./dist && git add ./package-lock.json", + "before:release": "npm run release:changelog:fix", + "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}." + } + }, + "commitlint": { + "rules": { + "header-max-length": [ + 2, + "always", + 130 + ] + }, + "extends": [ + "@commitlint/config-conventional" + ] + } +} \ No newline at end of file diff --git a/node_modules/bcrypt/.editorconfig b/node_modules/bcrypt/.editorconfig new file mode 100644 index 00000000..4e12f93b --- /dev/null +++ b/node_modules/bcrypt/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[{package.json,*.yml}] +indent_style = space +indent_size = 2 + +[appveyor.yml] +end_of_line = crlf + +[*.md] +trim_trailing_whitespace = false diff --git a/node_modules/bcrypt/.github/workflows/ci.yaml b/node_modules/bcrypt/.github/workflows/ci.yaml new file mode 100644 index 00000000..dc3f12f4 --- /dev/null +++ b/node_modules/bcrypt/.github/workflows/ci.yaml @@ -0,0 +1,59 @@ +name: ci + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + strategy: + matrix: + os: [ubuntu-20.04, macos-11.0, windows-2019] + nodeVersion: [14, 16, 18, 20] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.nodeVersion }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.nodeVersion }} + - name: Test + run: npm test + - name: Package + if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master') + run: npx node-pre-gyp package + - name: Upload + uses: actions/upload-artifact@v3 + if: matrix.nodeVersion == '14' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master')) + with: + name: bcrypt-lib-${{ matrix.os }}-${{ matrix.nodeVersion }} + path: build/stage/**/bcrypt_lib*.tar.gz + + build-alpine: + runs-on: ubuntu-latest + strategy: + matrix: + nodeVersion: [14, 16, 18, 20] + container: + image: node:${{ matrix.nodeVersion }}-alpine + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: | + apk add make g++ python3 + - name: Test + run: | + npm test --unsafe-perm + - name: Package + if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master') + run: npx node-pre-gyp package --unsafe-perm + - name: Upload + if: matrix.nodeVersion == '14' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master')) + uses: actions/upload-artifact@v3 + with: + name: bcrypt-lib-alpine-${{ matrix.nodeVersion }} + path: build/stage/**/bcrypt_lib*.tar.gz diff --git a/node_modules/bcrypt/.travis.yml b/node_modules/bcrypt/.travis.yml new file mode 100644 index 00000000..ed78c271 --- /dev/null +++ b/node_modules/bcrypt/.travis.yml @@ -0,0 +1,62 @@ +language: node_js + +services: +- docker + +env: +- LINUX_CXX=g++-4.8 + +os: +- linux +- osx + +arch: +- amd64 +- arm64 + +node_js: +- '14' +- '16' +- '17' +- '18' + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 + - bc + +before_install: +- echo Building for Node $TRAVIS_NODE_VERSION +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX=$LINUX_CXX; $CXX --version; + fi; +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then c++ --version; fi; +- npm install -g npm@latest + +install: true + +script: +- npm test +- "./node_modules/.bin/node-pre-gyp configure" +- "./node_modules/.bin/node-pre-gyp build" +- "./node_modules/.bin/node-pre-gyp package" +- | + if [[ "$TRAVIS_OS_NAME" == "linux" ]] + then + docker image pull public.ecr.aws/docker/library/node:${TRAVIS_NODE_VERSION}-alpine + docker run -w /src --entrypoint /bin/sh -v`pwd`:/src "node:${TRAVIS_NODE_VERSION}-alpine" test_alpine.sh + fi + +deploy: + provider: releases + skip_cleanup: true + api_key: + secure: j4gQ+m02izaw56EOd0gEStHAjCRfSCkohDWvpABiPzh1YPM9MvfEMSIvzzjV/0oMqi3Sy7eGyFv47EgQHZvouW0I8BIUzxuTCE5wP8z2SjABXCa/rz4WTppTc9d9ABq8JSdz80JxEwjmuwnYeMwWgOd7sT/VDiMxLYaXj0JWO7w= + file_glob: true + file: build/stage/kelektiv/node.bcrypt.js/releases/download/*/* + on: + node_js: '14' + repo: kelektiv/node.bcrypt.js + tags: true diff --git a/node_modules/bcrypt/CHANGELOG.md b/node_modules/bcrypt/CHANGELOG.md new file mode 100644 index 00000000..f2fcb471 --- /dev/null +++ b/node_modules/bcrypt/CHANGELOG.md @@ -0,0 +1,178 @@ +# 5.1.0 (2022-10-06) + * Update `node-pre-gyp` to 1.0.11 + +# 5.1.0 (2022-10-06) + * Update `node-pre-gyp` to 1.0.10 + * Replace `nodeunit` with `jest` as the testing library + +# 5.0.1 (2021-02-22) + + * Update `node-pre-gyp` to 1.0.0 + +# 5.0.0 (2020-06-02) + + * Fix the bcrypt "wrap-around" bug. It affects passwords with lengths >= 255. + It is uncommon but it's a bug nevertheless. Previous attempts to fix the bug + was unsuccessful. + * Experimental support for z/OS + * Fix a bug related to NUL in password input + * Update `node-pre-gyp` to 0.15.0 + +# 4.0.1 (2020-02-27) + + * Fix compilation errors in Alpine linux + +# 4.0.0 (2020-02-17) + + * Switch to NAPI bcrypt + * Drop support for NodeJS 8 + +# 3.0.8 (2019-12-31) + + * Update `node-pre-gyp` to 0.14 + * Pre-built binaries for NodeJS 13 + +# 3.0.7 (2019-10-18) + + * Update `nan` to 2.14.0 + * Update `node-pre-gyp` to 0.13 + +# 3.0.6 (2019-04-11) + + * Update `nan` to 2.13.2 + +# 3.0.5 (2019-03-19) + + * Update `nan` to 2.13.1 + * NodeJS 12 compatibility + * Remove `node-pre-gyp` from bundled dependencies + +# 3.0.4-napi (2019-03-08) + + * Sync N-API bcrypt with NAN bcrypt + +# 3.0.4 (2019-02-07) + + * Fix GCC, NAN and V8 deprecation warnings + +# 3.0.3 (2018-12-19) + + * Update `nan` to 2.12.1 + +# 3.0.2 (2018-10-18) + + * Update `nan` to 2.11.1 + +# 3.0.1 (2018-09-20) + + * Update `nan` to 2.11.0 + +# 3.0.0 (2018-07-06) + + * Drop support for NodeJS <= 4 + +# 2.0.1 (2018-04-20) + + * Update `node-pre-gyp` to allow downloading prebuilt modules + +# 2.0.0 (2018-04-07) + + * Make `2b` the default bcrypt version + +# 1.1.0-napi (2018-01-21) + + * Initial support for [N-API](https://nodejs.org/api/n-api.html) + +# 1.0.3 (2016-08-23) + + * update to nan v2.6.2 for NodeJS 8 support + * Fix: use npm scripts instead of node-gyp directly. + +# 1.0.2 (2016-12-31) + + * Fix `compare` promise rejection with invalid arguments + +# 1.0.1 (2016-12-07) + + * Fix destructuring imports with promises + +# 1.0.0 (2016-12-04) + + * add Promise support (commit 2488473) + +# 0.8.7 (2016-06-09) + + * update nan to 2.3.5 for improved node v6 support + +# 0.8.6 (2016-04-20) + + * update nan for node v6 support + +# 0.8.5 (2015-08-12) + + * update to nan v2 (adds support for iojs 3) + +# 0.8.4 (2015-07-24) + + * fix deprecation warning for the Encode API + +# 0.8.3 (2015-05-06) + + * update nan to 1.8.4 for iojs 2.x support + +# 0.8.2 (2015-03-28) + + * always use callback for generating random bytes to avoid blocking + +# 0.8.1 (2015-01-18) + * update NaN to 1.5.0 for iojs support + +# 0.8.0 (2014-08-03) + * migrate to NAN for bindings + +# v0.5.0 + * Fix for issue around empty string params throwing Errors. + * Method deprecation. + * Upgrade from libeio/ev to libuv. (shtylman) + ** --- NOTE --- Breaks 0.4.x compatability + * EV_MULTIPLICITY compile flag. + +# v0.4.1 + * Thread safety fix around OpenSSL (GH-32). (bnoordhuis - through node) + * C++ code changes using delete and new instead of malloc and free. (shtylman) + * Compile options for speed, zoom. (shtylman) + * Move much of the type and variable checking to the JS. (shtylman) + +# v0.4.0 + * Added getRounds function that will tell you the number of rounds within a hash/salt + +# v0.3.2 + * Fix api issue with async salt gen first param + +# v0.3.1 + * Compile under node 0.5.x + +# v0.3.0 + * Internal Refactoring + * Remove pthread dependencies and locking + * Fix compiler warnings and a memory bug + +# v0.2.4 + * Use threadsafe functions instead of pthread mutexes + * salt validation to make sure the salt is of the correct size and format + +# v0.2.3 + * cygwin support + +# v0.2.2 + * Remove dependency on libbsd, use libssl instead + +# v0.2.0 + * Added async functionality + * API changes + * hashpw -> encrypt + * all old sync methods now end with _sync + * Removed libbsd(arc4random) dependency...now uses openssl which is more widely spread + +# v0.1.2 + * Security fix. Wasn't reading rounds in properly and was always only using 4 rounds diff --git a/node_modules/bcrypt/ISSUE_TEMPLATE.md b/node_modules/bcrypt/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..b4baa008 --- /dev/null +++ b/node_modules/bcrypt/ISSUE_TEMPLATE.md @@ -0,0 +1,18 @@ +Thanks for reporting a new issue with the node bcrypt module! + +To help you resolve your issue faster please make sure you have done the following: + +* Searched existing issues (even closed ones) for your same problem +* Make sure you have installed the required dependencies listed on the readme +* Read your npm error log for lines telling you what failed, usually it is a problem with not having the correct dependencies installed to build the native module + +Once you have done the above and are still confident that the issue is with the module, please describe it below. Some things that really help get your issue resolved faster are: + +* What went wrong? +* What did you expect to happen? +* Which version of nodejs and OS? +* If you find a bug, please write a failing test. + +Thanks! + +P.S. If it doesn't look like you read the above then your issue will likely be closed without further explanation. Sorry, but there are just too many issues opened with no useful information or questions which have been previously addressed. diff --git a/node_modules/bcrypt/LICENSE b/node_modules/bcrypt/LICENSE new file mode 100644 index 00000000..94e2ba5f --- /dev/null +++ b/node_modules/bcrypt/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Nicholas Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/bcrypt/Makefile b/node_modules/bcrypt/Makefile new file mode 100644 index 00000000..0b49b3db --- /dev/null +++ b/node_modules/bcrypt/Makefile @@ -0,0 +1,19 @@ +TESTS = test/*.js + +all: test + +build: clean compile + +compile: + npm install . + npm run install + +test: build + @./node_modules/nodeunit/bin/nodeunit \ + $(TESTS) + +clean: + rm -Rf lib/bindings/ + + +.PHONY: clean test build diff --git a/node_modules/bcrypt/README.md b/node_modules/bcrypt/README.md new file mode 100644 index 00000000..059aa3ac --- /dev/null +++ b/node_modules/bcrypt/README.md @@ -0,0 +1,388 @@ +# node.bcrypt.js + +[![ci](https://github.com/kelektiv/node.bcrypt.js/actions/workflows/ci.yaml/badge.svg)](https://github.com/kelektiv/node.bcrypt.js/actions/workflows/ci.yaml) + +[![Build Status](https://ci.appveyor.com/api/projects/status/github/kelektiv/node.bcrypt.js)](https://ci.appveyor.com/project/defunctzombie/node-bcrypt-js-pgo26/branch/master) + +A library to help you hash passwords. + +You can read about [bcrypt in Wikipedia][bcryptwiki] as well as in the following article: +[How To Safely Store A Password][codahale] + +## If You Are Submitting Bugs or Issues + +Please verify that the NodeJS version you are using is a _stable_ version; Unstable versions are currently not supported and issues created while using an unstable version will be closed. + +If you are on a stable version of NodeJS, please provide a sufficient code snippet or log files for installation issues. The code snippet does not require you to include confidential information. However, it must provide enough information so the problem can be replicable, or it may be closed without an explanation. + + +## Version Compatibility + +_Please upgrade to atleast v5.0.0 to avoid security issues mentioned below._ + +| Node Version | Bcrypt Version | +| -------------- | ------------------| +| 0.4 | <= 0.4 | +| 0.6, 0.8, 0.10 | >= 0.5 | +| 0.11 | >= 0.8 | +| 4 | <= 2.1.0 | +| 8 | >= 1.0.3 < 4.0.0 | +| 10, 11 | >= 3 | +| 12 onwards | >= 3.0.6 | + +`node-gyp` only works with stable/released versions of node. Since the `bcrypt` module uses `node-gyp` to build and install, you'll need a stable version of node to use bcrypt. If you do not, you'll likely see an error that starts with: + +``` +gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead +``` + +## Security Issues And Concerns + +> Per bcrypt implementation, only the first 72 bytes of a string are used. Any extra bytes are ignored when matching passwords. Note that this is not the first 72 *characters*. It is possible for a string to contain less than 72 characters, while taking up more than 72 bytes (e.g. a UTF-8 encoded string containing emojis). + +As should be the case with any security tool, anyone using this library should scrutinise it. If you find or suspect an issue with the code, please bring it to the maintainers' attention. We will spend some time ensuring that this library is as secure as possible. + +Here is a list of BCrypt-related security issues/concerns that have come up over the years. + +* An [issue with passwords][jtr] was found with a version of the Blowfish algorithm developed for John the Ripper. This is not present in the OpenBSD version and is thus not a problem for this module. HT [zooko][zooko]. +* Versions `< 5.0.0` suffer from bcrypt wrap-around bug and _will truncate passwords >= 255 characters leading to severely weakened passwords_. Please upgrade at earliest. See [this wiki page][wrap-around-bug] for more details. +* Versions `< 5.0.0` _do not handle NUL characters inside passwords properly leading to all subsequent characters being dropped and thus resulting in severely weakened passwords_. Please upgrade at earliest. See [this wiki page][improper-nuls] for more details. + +## Compatibility Note + +This library supports `$2a$` and `$2b$` prefix bcrypt hashes. `$2x$` and `$2y$` hashes are specific to bcrypt implementation developed for John the Ripper. In theory, they should be compatible with `$2b$` prefix. + +Compatibility with hashes generated by other languages is not 100% guaranteed due to difference in character encodings. However, it should not be an issue for most cases. + +### Migrating from v1.0.x + +Hashes generated in earlier version of `bcrypt` remain 100% supported in `v2.x.x` and later versions. In most cases, the migration should be a bump in the `package.json`. + +Hashes generated in `v2.x.x` using the defaults parameters will not work in earlier versions. + +## Dependencies + +* NodeJS +* `node-gyp` + * Please check the dependencies for this tool at: https://github.com/nodejs/node-gyp + * Windows users will need the options for c# and c++ installed with their visual studio instance. + * Python 2.x/3.x +* `OpenSSL` - This is only required to build the `bcrypt` project if you are using versions <= 0.7.7. Otherwise, we're using the builtin node crypto bindings for seed data (which use the same OpenSSL code paths we were, but don't have the external dependency). + +## Install via NPM + +``` +npm install bcrypt +``` +***Note:*** OS X users using Xcode 4.3.1 or above may need to run the following command in their terminal prior to installing if errors occur regarding xcodebuild: ```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer``` + +_Pre-built binaries for various NodeJS versions are made available on a best-effort basis._ + +Only the current stable and supported LTS releases are actively tested against. + +_There may be an interval between the release of the module and the availabilty of the compiled modules._ + +Currently, we have pre-built binaries that support the following platforms: + +1. Windows x32 and x64 +2. Linux x64 (GlibC and musl) +3. macOS + +If you face an error like this: + +``` +node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz +``` + +make sure you have the appropriate dependencies installed and configured for your platform. You can find installation instructions for the dependencies for some common platforms [in this page][depsinstall]. + +## Usage + +### async (recommended) + +```javascript +const bcrypt = require('bcrypt'); +const saltRounds = 10; +const myPlaintextPassword = 's0/\/\P4$$w0rD'; +const someOtherPlaintextPassword = 'not_bacon'; +``` + +#### To hash a password: + +Technique 1 (generate a salt and hash on separate function calls): + +```javascript +bcrypt.genSalt(saltRounds, function(err, salt) { + bcrypt.hash(myPlaintextPassword, salt, function(err, hash) { + // Store hash in your password DB. + }); +}); +``` + +Technique 2 (auto-gen a salt and hash): + +```javascript +bcrypt.hash(myPlaintextPassword, saltRounds, function(err, hash) { + // Store hash in your password DB. +}); +``` + +Note that both techniques achieve the same end-result. + +#### To check a password: + +```javascript +// Load hash from your password DB. +bcrypt.compare(myPlaintextPassword, hash, function(err, result) { + // result == true +}); +bcrypt.compare(someOtherPlaintextPassword, hash, function(err, result) { + // result == false +}); +``` + +[A Note on Timing Attacks](#a-note-on-timing-attacks) + +### with promises + +bcrypt uses whatever `Promise` implementation is available in `global.Promise`. NodeJS >= 0.12 has a native `Promise` implementation built in. However, this should work in any Promises/A+ compliant implementation. + +Async methods that accept a callback, return a `Promise` when callback is not specified if Promise support is available. + +```javascript +bcrypt.hash(myPlaintextPassword, saltRounds).then(function(hash) { + // Store hash in your password DB. +}); +``` +```javascript +// Load hash from your password DB. +bcrypt.compare(myPlaintextPassword, hash).then(function(result) { + // result == true +}); +bcrypt.compare(someOtherPlaintextPassword, hash).then(function(result) { + // result == false +}); +``` + +This is also compatible with `async/await` + +```javascript +async function checkUser(username, password) { + //... fetch user from a db etc. + + const match = await bcrypt.compare(password, user.passwordHash); + + if(match) { + //login + } + + //... +} +``` + +### ESM import +```javascript +import bcrypt from "bcrypt"; + +// later +await bcrypt.compare(password, hash); +``` + +### sync + +```javascript +const bcrypt = require('bcrypt'); +const saltRounds = 10; +const myPlaintextPassword = 's0/\/\P4$$w0rD'; +const someOtherPlaintextPassword = 'not_bacon'; +``` + +#### To hash a password: + +Technique 1 (generate a salt and hash on separate function calls): + +```javascript +const salt = bcrypt.genSaltSync(saltRounds); +const hash = bcrypt.hashSync(myPlaintextPassword, salt); +// Store hash in your password DB. +``` + +Technique 2 (auto-gen a salt and hash): + +```javascript +const hash = bcrypt.hashSync(myPlaintextPassword, saltRounds); +// Store hash in your password DB. +``` + +As with async, both techniques achieve the same end-result. + +#### To check a password: + +```javascript +// Load hash from your password DB. +bcrypt.compareSync(myPlaintextPassword, hash); // true +bcrypt.compareSync(someOtherPlaintextPassword, hash); // false +``` + +[A Note on Timing Attacks](#a-note-on-timing-attacks) + +### Why is async mode recommended over sync mode? +We recommend using async API if you use `bcrypt` on a server. Bcrypt hashing is CPU intensive which will cause the sync APIs to block the event loop and prevent your application from servicing any inbound requests or events. The async version uses a thread pool which does not block the main event loop. + +## API + +`BCrypt.` + + * `genSaltSync(rounds, minor)` + * `rounds` - [OPTIONAL] - the cost of processing the data. (default - 10) + * `minor` - [OPTIONAL] - minor version of bcrypt to use. (default - b) + * `genSalt(rounds, minor, cb)` + * `rounds` - [OPTIONAL] - the cost of processing the data. (default - 10) + * `minor` - [OPTIONAL] - minor version of bcrypt to use. (default - b) + * `cb` - [OPTIONAL] - a callback to be fired once the salt has been generated. uses eio making it asynchronous. If `cb` is not specified, a `Promise` is returned if Promise support is available. + * `err` - First parameter to the callback detailing any errors. + * `salt` - Second parameter to the callback providing the generated salt. + * `hashSync(data, salt)` + * `data` - [REQUIRED] - the data to be encrypted. + * `salt` - [REQUIRED] - the salt to be used to hash the password. if specified as a number then a salt will be generated with the specified number of rounds and used (see example under **Usage**). + * `hash(data, salt, cb)` + * `data` - [REQUIRED] - the data to be encrypted. + * `salt` - [REQUIRED] - the salt to be used to hash the password. if specified as a number then a salt will be generated with the specified number of rounds and used (see example under **Usage**). + * `cb` - [OPTIONAL] - a callback to be fired once the data has been encrypted. uses eio making it asynchronous. If `cb` is not specified, a `Promise` is returned if Promise support is available. + * `err` - First parameter to the callback detailing any errors. + * `encrypted` - Second parameter to the callback providing the encrypted form. + * `compareSync(data, encrypted)` + * `data` - [REQUIRED] - data to compare. + * `encrypted` - [REQUIRED] - data to be compared to. + * `compare(data, encrypted, cb)` + * `data` - [REQUIRED] - data to compare. + * `encrypted` - [REQUIRED] - data to be compared to. + * `cb` - [OPTIONAL] - a callback to be fired once the data has been compared. uses eio making it asynchronous. If `cb` is not specified, a `Promise` is returned if Promise support is available. + * `err` - First parameter to the callback detailing any errors. + * `same` - Second parameter to the callback providing whether the data and encrypted forms match [true | false]. + * `getRounds(encrypted)` - return the number of rounds used to encrypt a given hash + * `encrypted` - [REQUIRED] - hash from which the number of rounds used should be extracted. + +## A Note on Rounds + +A note about the cost: when you are hashing your data, the module will go through a series of rounds to give you a secure hash. The value you submit is not just the number of rounds the module will go through to hash your data. The module will use the value you enter and go through `2^rounds` hashing iterations. + +From @garthk, on a 2GHz core you can roughly expect: + + rounds=8 : ~40 hashes/sec + rounds=9 : ~20 hashes/sec + rounds=10: ~10 hashes/sec + rounds=11: ~5 hashes/sec + rounds=12: 2-3 hashes/sec + rounds=13: ~1 sec/hash + rounds=14: ~1.5 sec/hash + rounds=15: ~3 sec/hash + rounds=25: ~1 hour/hash + rounds=31: 2-3 days/hash + + +## A Note on Timing Attacks + +Because it's come up multiple times in this project and other bcrypt projects, it needs to be said. The `bcrypt` library is not susceptible to timing attacks. From codahale/bcrypt-ruby#42: + +> One of the desired properties of a cryptographic hash function is preimage attack resistance, which means there is no shortcut for generating a message which, when hashed, produces a specific digest. + +A great thread on this, in much more detail can be found @ codahale/bcrypt-ruby#43 + +If you're unfamiliar with timing attacks and want to learn more you can find a great writeup @ [A Lesson In Timing Attacks][timingatk] + +However, timing attacks are real. And the comparison function is _not_ time safe. That means that it may exit the function early in the comparison process. Timing attacks happen because of the above. We don't need to be careful that an attacker will learn anything, and our comparison function provides a comparison of hashes. It is a utility to the overall purpose of the library. If you end up using it for something else, we cannot guarantee the security of the comparator. Keep that in mind as you use the library. + +## Hash Info + +The characters that comprise the resultant hash are `./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$`. + +Resultant hashes will be 60 characters long and they will include the salt among other parameters, as follows: + +`$[algorithm]$[cost]$[salt][hash]` + +- 2 chars hash algorithm identifier prefix. `"$2a$" or "$2b$"` indicates BCrypt +- Cost-factor (n). Represents the exponent used to determine how many iterations 2^n +- 16-byte (128-bit) salt, base64 encoded to 22 characters +- 24-byte (192-bit) hash, base64 encoded to 31 characters + +Example: +``` +$2b$10$nOUIs5kJ7naTuTFkBy1veuK0kSxUFXfuaOKdOKf9xYT0KKIGSJwFa + | | | | + | | | hash-value = K0kSxUFXfuaOKdOKf9xYT0KKIGSJwFa + | | | + | | salt = nOUIs5kJ7naTuTFkBy1veu + | | + | cost-factor => 10 = 2^10 rounds + | + hash-algorithm identifier => 2b = BCrypt +``` + +## Testing + +If you create a pull request, tests better pass :) + +``` +npm install +npm test +``` + +## Credits + +The code for this comes from a few sources: + +* blowfish.cc - OpenBSD +* bcrypt.cc - OpenBSD +* bcrypt::gen_salt - [gen_salt inclusion to bcrypt][bcryptgs] +* bcrypt_node.cc - me + +## Contributors + +* [Antonio Salazar Cardozo][shadowfiend] - Early MacOS X support (when we used libbsd) +* [Ben Glow][pixelglow] - Fixes for thread safety with async calls +* [Van Nguyen][thegoleffect] - Found a timing attack in the comparator +* [NewITFarmer][newitfarmer] - Initial Cygwin support +* [David Trejo][dtrejo] - packaging fixes +* [Alfred Westerveld][alfredwesterveld] - packaging fixes +* [Vincent Côté-Roy][vincentr] - Testing around concurrency issues +* [Lloyd Hilaiel][lloyd] - Documentation fixes +* [Roman Shtylman][shtylman] - Code refactoring, general rot reduction, compile options, better memory management with delete and new, and an upgrade to libuv over eio/ev. +* [Vadim Graboys][vadimg] - Code changes to support 0.5.5+ +* [Ben Noordhuis][bnoordhuis] - Fixed a thread safety issue in nodejs that was perfectly mappable to this module. +* [Nate Rajlich][tootallnate] - Bindings and build process. +* [Sean McArthur][seanmonstar] - Windows Support +* [Fanie Oosthuysen][weareu] - Windows Support +* [Amitosh Swain Mahapatra][recrsn] - $2b$ hash support, ES6 Promise support +* [Nicola Del Gobbo][NickNaso] - Initial implementation with N-API + +## License +Unless stated elsewhere, file headers or otherwise, the license as stated in the LICENSE file. + +[bcryptwiki]: https://en.wikipedia.org/wiki/Bcrypt +[bcryptgs]: http://mail-index.netbsd.org/tech-crypto/2002/05/24/msg000204.html +[codahale]: http://codahale.com/how-to-safely-store-a-password/ +[gh13]: https://github.com/ncb000gt/node.bcrypt.js/issues/13 +[jtr]: http://www.openwall.com/lists/oss-security/2011/06/20/2 +[depsinstall]: https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions +[timingatk]: https://codahale.com/a-lesson-in-timing-attacks/ +[wrap-around-bug]: https://github.com/kelektiv/node.bcrypt.js/wiki/Security-Issues-and-Concerns#bcrypt-wrap-around-bug-medium-severity +[improper-nuls]: https://github.com/kelektiv/node.bcrypt.js/wiki/Security-Issues-and-Concerns#improper-nul-handling-medium-severity + +[shadowfiend]:https://github.com/Shadowfiend +[thegoleffect]:https://github.com/thegoleffect +[pixelglow]:https://github.com/pixelglow +[dtrejo]:https://github.com/dtrejo +[alfredwesterveld]:https://github.com/alfredwesterveld +[newitfarmer]:https://github.com/newitfarmer +[zooko]:https://twitter.com/zooko +[vincentr]:https://twitter.com/vincentcr +[lloyd]:https://github.com/lloyd +[shtylman]:https://github.com/shtylman +[vadimg]:https://github.com/vadimg +[bnoordhuis]:https://github.com/bnoordhuis +[tootallnate]:https://github.com/tootallnate +[seanmonstar]:https://github.com/seanmonstar +[weareu]:https://github.com/weareu +[recrsn]:https://github.com/recrsn +[NickNaso]: https://github.com/NickNaso diff --git a/node_modules/bcrypt/SECURITY.md b/node_modules/bcrypt/SECURITY.md new file mode 100644 index 00000000..c132dc86 --- /dev/null +++ b/node_modules/bcrypt/SECURITY.md @@ -0,0 +1,15 @@ +# Security Policy + +As with any software, `bcrypt` is likely to have bugs. Please report any security vulnerabilities responsibly + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 5.0.x | :white_check_mark: | +| < 5.0 | :x: | + +## Reporting a Vulnerability + +If you are reporting a security vulnerability, please refrain from opening a GitHub issue and instead mail it to +one of the maintainers listed in the README. diff --git a/node_modules/bcrypt/appveyor.yml b/node_modules/bcrypt/appveyor.yml new file mode 100644 index 00000000..795d3f68 --- /dev/null +++ b/node_modules/bcrypt/appveyor.yml @@ -0,0 +1,39 @@ +environment: + matrix: + - nodejs_version: "14" + platform: x64 + - nodejs_version: "14" + platform: x86 + - nodejs_version: "16" + platform: x64 + - nodejs_version: "16" + platform: x86 + - nodejs_version: "18" + platform: x64 + +install: + - where npm + - where node + - ps: Install-Product node $env:nodejs_version $env:platform + +build: off + +artifacts: + - path: 'build/stage/**/bcrypt*.tar.gz' + +test_script: + - node --version + - npm --version + - npm test + +after_test: + - .\node_modules\.bin\node-pre-gyp package + +on_success: + - ps: > + if ($env:NODE_PRE_GYP_GITHUB_TOKEN -ne $null -and $env:APPVEYOR_REPO_TAG_NAME -match '^v(0|[1-9]+)\.(0|[1-9]+)\.(0|[1-9]+)(-\w)?$') { + echo "Publishing $env:APPVEYOR_REPO_TAG_NAME" + npm install node-pre-gyp-github@1.4.3 + ./node_modules/.bin/node-pre-gyp-github publish --release + } + diff --git a/node_modules/bcrypt/bcrypt.js b/node_modules/bcrypt/bcrypt.js new file mode 100644 index 00000000..612f9dcb --- /dev/null +++ b/node_modules/bcrypt/bcrypt.js @@ -0,0 +1,236 @@ +'use strict'; + +var nodePreGyp = require('@mapbox/node-pre-gyp'); +var path = require('path'); +var binding_path = nodePreGyp.find(path.resolve(path.join(__dirname, './package.json'))); +var bindings = require(binding_path); + +var crypto = require('crypto'); + +var promises = require('./promises'); + +/// generate a salt (sync) +/// @param {Number} [rounds] number of rounds (default 10) +/// @return {String} salt +module.exports.genSaltSync = function genSaltSync(rounds, minor) { + // default 10 rounds + if (!rounds) { + rounds = 10; + } else if (typeof rounds !== 'number') { + throw new Error('rounds must be a number'); + } + + if(!minor) { + minor = 'b'; + } else if(minor !== 'b' && minor !== 'a') { + throw new Error('minor must be either "a" or "b"'); + } + + return bindings.gen_salt_sync(minor, rounds, crypto.randomBytes(16)); +}; + +/// generate a salt +/// @param {Number} [rounds] number of rounds (default 10) +/// @param {Function} cb callback(err, salt) +module.exports.genSalt = function genSalt(rounds, minor, cb) { + var error; + + // if callback is first argument, then use defaults for others + if (typeof arguments[0] === 'function') { + // have to set callback first otherwise arguments are overriden + cb = arguments[0]; + rounds = 10; + minor = 'b'; + // callback is second argument + } else if (typeof arguments[1] === 'function') { + // have to set callback first otherwise arguments are overriden + cb = arguments[1]; + minor = 'b'; + } + + if (!cb) { + return promises.promise(genSalt, this, [rounds, minor]); + } + + // default 10 rounds + if (!rounds) { + rounds = 10; + } else if (typeof rounds !== 'number') { + // callback error asynchronously + error = new Error('rounds must be a number'); + return process.nextTick(function() { + cb(error); + }); + } + + if(!minor) { + minor = 'b' + } else if(minor !== 'b' && minor !== 'a') { + error = new Error('minor must be either "a" or "b"'); + return process.nextTick(function() { + cb(error); + }); + } + + crypto.randomBytes(16, function(error, randomBytes) { + if (error) { + cb(error); + return; + } + + bindings.gen_salt(minor, rounds, randomBytes, cb); + }); +}; + +/// hash data using a salt +/// @param {String|Buffer} data the data to encrypt +/// @param {String} salt the salt to use when hashing +/// @return {String} hash +module.exports.hashSync = function hashSync(data, salt) { + if (data == null || salt == null) { + throw new Error('data and salt arguments required'); + } + + if (!(typeof data === 'string' || data instanceof Buffer) || (typeof salt !== 'string' && typeof salt !== 'number')) { + throw new Error('data must be a string or Buffer and salt must either be a salt string or a number of rounds'); + } + + if (typeof salt === 'number') { + salt = module.exports.genSaltSync(salt); + } + + return bindings.encrypt_sync(data, salt); +}; + +/// hash data using a salt +/// @param {String|Buffer} data the data to encrypt +/// @param {String} salt the salt to use when hashing +/// @param {Function} cb callback(err, hash) +module.exports.hash = function hash(data, salt, cb) { + var error; + + if (typeof data === 'function') { + error = new Error('data must be a string or Buffer and salt must either be a salt string or a number of rounds'); + return process.nextTick(function() { + data(error); + }); + } + + if (typeof salt === 'function') { + error = new Error('data must be a string or Buffer and salt must either be a salt string or a number of rounds'); + return process.nextTick(function() { + salt(error); + }); + } + + // cb exists but is not a function + // return a rejecting promise + if (cb && typeof cb !== 'function') { + return promises.reject(new Error('cb must be a function or null to return a Promise')); + } + + if (!cb) { + return promises.promise(hash, this, [data, salt]); + } + + if (data == null || salt == null) { + error = new Error('data and salt arguments required'); + return process.nextTick(function() { + cb(error); + }); + } + + if (!(typeof data === 'string' || data instanceof Buffer) || (typeof salt !== 'string' && typeof salt !== 'number')) { + error = new Error('data must be a string or Buffer and salt must either be a salt string or a number of rounds'); + return process.nextTick(function() { + cb(error); + }); + } + + + if (typeof salt === 'number') { + return module.exports.genSalt(salt, function(err, salt) { + return bindings.encrypt(data, salt, cb); + }); + } + + return bindings.encrypt(data, salt, cb); +}; + +/// compare raw data to hash +/// @param {String|Buffer} data the data to hash and compare +/// @param {String} hash expected hash +/// @return {bool} true if hashed data matches hash +module.exports.compareSync = function compareSync(data, hash) { + if (data == null || hash == null) { + throw new Error('data and hash arguments required'); + } + + if (!(typeof data === 'string' || data instanceof Buffer) || typeof hash !== 'string') { + throw new Error('data must be a string or Buffer and hash must be a string'); + } + + return bindings.compare_sync(data, hash); +}; + +/// compare raw data to hash +/// @param {String|Buffer} data the data to hash and compare +/// @param {String} hash expected hash +/// @param {Function} cb callback(err, matched) - matched is true if hashed data matches hash +module.exports.compare = function compare(data, hash, cb) { + var error; + + if (typeof data === 'function') { + error = new Error('data and hash arguments required'); + return process.nextTick(function() { + data(error); + }); + } + + if (typeof hash === 'function') { + error = new Error('data and hash arguments required'); + return process.nextTick(function() { + hash(error); + }); + } + + // cb exists but is not a function + // return a rejecting promise + if (cb && typeof cb !== 'function') { + return promises.reject(new Error('cb must be a function or null to return a Promise')); + } + + if (!cb) { + return promises.promise(compare, this, [data, hash]); + } + + if (data == null || hash == null) { + error = new Error('data and hash arguments required'); + return process.nextTick(function() { + cb(error); + }); + } + + if (!(typeof data === 'string' || data instanceof Buffer) || typeof hash !== 'string') { + error = new Error('data and hash must be strings'); + return process.nextTick(function() { + cb(error); + }); + } + + return bindings.compare(data, hash, cb); +}; + +/// @param {String} hash extract rounds from this hash +/// @return {Number} the number of rounds used to encrypt a given hash +module.exports.getRounds = function getRounds(hash) { + if (hash == null) { + throw new Error('hash argument required'); + } + + if (typeof hash !== 'string') { + throw new Error('hash must be a string'); + } + + return bindings.get_rounds(hash); +}; diff --git a/node_modules/bcrypt/binding.gyp b/node_modules/bcrypt/binding.gyp new file mode 100644 index 00000000..181dca0f --- /dev/null +++ b/node_modules/bcrypt/binding.gyp @@ -0,0 +1,61 @@ +{ + "variables": { + "NODE_VERSION%":" { + const start = Date.now(); + + // genSalt + const salt = await bcrypt.genSalt(10) + console.log('salt: ' + salt); + console.log('salt cb end: ' + (Date.now() - start) + 'ms'); + + // hash + const crypted = await bcrypt.hash('test', salt) + console.log('crypted: ' + crypted); + console.log('crypted cb end: ' + (Date.now() - start) + 'ms'); + console.log('rounds used from hash:', bcrypt.getRounds(crypted)); + + // compare + const res = await bcrypt.compare('test', crypted) + console.log('compared true: ' + res); + console.log('compared true cb end: ' + (Date.now() - start) + 'ms'); + + // compare + const res = await bcrypt.compare('bacon', crypted) + console.log('compared false: ' + res); + console.log('compared false cb end: ' + (Date.now() - start) + 'ms'); + + console.log('end: ' + (Date.now() - start) + 'ms'); +})(); diff --git a/node_modules/bcrypt/examples/forever_gen_salt.js b/node_modules/bcrypt/examples/forever_gen_salt.js new file mode 100644 index 00000000..761686a8 --- /dev/null +++ b/node_modules/bcrypt/examples/forever_gen_salt.js @@ -0,0 +1,8 @@ +var bcrypt = require('../bcrypt'); + +(function printSalt() { + bcrypt.genSalt(10, function(err, salt) { + console.log('salt: ' + salt); + printSalt(); + }); +})() diff --git a/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node b/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node new file mode 100644 index 0000000000000000000000000000000000000000..ba87d282512b984efb464d9a7403b11747317040 GIT binary patch literal 190464 zcmdqK33yaRx;NfQx}kx@(F@V@>vX4CMDHE{|L=Le zJkY1kskh#$dh4xst2%Ycu2|y8aX1`K{7)twjup7_FCf1M|8ZwI9ETkD>>-Y4`n+`f zimb>>$6q$}##z3~nKP!$y!K|_q-&>7pAq$4cY|+c)pXyD(|w^)V|+Kyxc-JS^78un zZPXQ=HAnjE{}E38Z|wfmJRbLr-CgD*a{a_S1J_&s`H6X&Tt78`D%UPEPx3!APr=n+ z|5=#uAN=!U(`v120D5){^Rd~#rW|^vPPaTo$YY+l1DvPM*vhMQSq1Ur~s%gl)CJHub&h?pY51{ zGWEC?u&^)3v5gh&$aehw2tKg?3UeIgy&aDAiEKw@>e&IVC|yCcg{iS}N# zEc<|Cd`9$!>L?(0Y_*%rzT5psq4zl)6=%%6{@UoZ4#%=r2@IImaD4~YjK2Wb=nM_! zXgCfT9jN#aT%W-;<1gTFG@enZ0i}=VtK&!jH17u&n0RR@cv;Zl_?G28pfN$-+8^$W znX_h2LYB}DG!(dZ4g`0@v>5;-Eghh#!_7kb!41XJ|0n;<_*H(l8K3L-gsh*FIV0BA zP|=~L^+wQY4qM$#$`dk{wd1Bqxq}Ov92nwKXstaUn&tzb(XGiqlPhS}{=2R5q+65G6x|ykleJd5hkj*tYQNSD_;Fg3 zpKi^+MVq64oYwgM7p>tqr+CL6aQ~0fnu7mDYtk+0VZYOVoYoZnIITH5-J1Q_uZgqN zT5}-w+iy-4|2VA~l5WipnBf@aCM_%=8$u|#??ev}TfASWXp?C{GKJzlF)awEmi6|Z zEw85eJ!U-W&mV8bwigy9BZ&toyG(0m$XLGddFrdg#6yka0*;XNx@o;Md9ra_t;p}m zr6uiF+vK1zv?g#0E3i&6*hka`%u5=^mix2BIW1nSJy=GeP z7{@tQ)u0)ZzpMQ8RQViT)M>_A+*15?Gxlj#RTGI4Fs*5R)3l=gax>OiI5ABdlBkD1 zlSA>4KY!eKsLOFdp_8%vAwR2+Bt+7e7JXP|Z8fd0Bi5c$V|i;Z5%nKhYOQ~kOh(J zW&X-wqTIRUVDQqAcS1$&dQdPTm7#dV?+aTS)qp)189uP^AU^KfQ2Y=xwi>kkG|Q-) zl1wJU)>olKmGgPFDr0>9Z?*UO?#%Wc9*SQA((ct>5Zb6KL(9n%737JjWQX9y;5EUk zCSGH6g_&^u_VsK>nnxmJiU_GPX6!g}MRC~LVJ4>etD*8uYmZt-jPYsyf{3*tVzroU z;9-yia|;s*^jedp9{becsB2saz@%X|q0-`s*Ia$2t|BmY3|Ni~mw3|e-jPhM=mrz0 zFPpO*=D=;H<+^8iw!XAKG`CS(~N*X7f*9c9)YW0`9TQo9UK-gsOi z)-I!e-3q{(Xmv4e679IDuj|0?e7~8<>rbeGdoaaA;M-+c!Fs1*Cc;^@ja554?}0rR zi9hBq><_tOyf7&%RDZp{Fj(`gKY9ViHr9D@K}+HV#_6dP%Iu`j+7;4_mg zUGCCB9}23PIZl7{Sd?CDm)@rVeOVweGFu(F%i)N1A7?Cj1EwbIf>kt@H-C&y1!76h ztkZyEL{9@!^AGh8t#=Mi_vbkjHrpD7_Uv!X+?-y(AIPfu(o8r5W^CKHW~@6fi~Z@I zcEJAZh3_Wdi^QMw@1XchB({L4k;KT}k%agCkCMsBOCTJB|N2XE$b#8@h8oN6^>`L# z)6NSfgG=S%aAR4mJgoUTY1IA#T?*E8BXt*3F!mbX&u&yse@@@#`YbcqWF}cyCDK1&Zi+Xy0JtHfN*C_8Y;zjr*25kCn678R?o?Vf47h_j}pMgMB-~u_kAI zf7VyhZro7}YGK5$ot4KVG0$zv#$h? zCL;cF^>7==0!dqJChim3SQ{W$uZPH&?EiqgE_yR$eU|1I3R1~4t=H5j2pwa2OC*sf z2VH~D9*PRB&HKo|ZjZGN;;$Xr$XMQFEW69aiY6x;`>nNJ77_Sn@T@-UQJ8{u6%6*X zgNf=sxS~}L6LW^VqUgip%lv2S79RbDXr!~_IkrM7rf#A_deux^FlmBM< zrT=F6XHdR0Q5gWokd&+7rD4ninCuurYqMsS&vrugr!0<-WIQ(-%Y^ocQQ7r%&!MCx zw=gs7>z>7}Bvz&p95@spvFqzr;n$M10KJd`dOnr-I}(5+9O^Ye`z5SEqnpOeI>805r)~U$+jwmZSxGZ3<{jDnX3`XcDQuZX7r4nkv2YN?X&Mz=v!a2_t}iy_Ijn#^Rg*`%^--pgrx&k2dO24b?- z(*W^Xk7BkI?J!~sIgrcx0^Dk#} zFO-PAcTu{AV7-Is{&sE2mW>xB}9&>loO8Iv=oIM*6OPSXS8DvN|U%Pt4@%V9k*8 z996r+IbWf>!XX**M*2Ja;Qggw=b)h3Mr_d!>+f*(mxaQKO6f23#t-XnFElx$Lh0}7 zUXHF%x|8TK9~7k@)DK6mcLY~E99^^oYHqOguC_-q^=-t`rif`J6nj*(UR`kmt_xdf zCee1Ac+Hhpr>!;E^Rex2=#-9#wI-6YDO|G2h^+wy%=pnTeU5ntHHo>B)<2+USt57< zdTyoB9<0v-idoV97^X!tj13gbDodCGdCuNcYXO&NJm5L!5k!}40>+v3rggMGxEe-Y ztkvBDT04)DC-sg4Jq%`%RsxzTlJ@Tsu9ZK7_Kjzm)=&hdf^O4l%A|)i+6|lb9CX~Q z+hiK0%^8_M5*R~|5O(Gt8vz0LrmiuXo$N5J9L&IExd&P(ZPJz&H5P3uTBF>sXH)ez z_axa*=%TGR)sbv4~ZJY0Dr^Rslnh>ybAr8V%i4TOcwoDkV6ywT*=1o=+;JUx+cvBi zJ%@SZ>d$tz4GVye9jk{Gpv|E1n0yRNG{0t!&r#Lav_^W8-s4vYT)q?&N~y_Rsg|bO zgK@@SZHoS+<~EO`s*h>)NqRq~uh2FO7PN2+X$<&<+n4a(a+!ZbHeHEYe~ml=YY37m zXHjF<;XomdVA6XgT2R+mbt0YWShv%-x6!oj(q%9Kw_Xcu3tNfw$`;c)jN~pFb*(90>WkCA0zy{v z`SdS+bQ95!r9^GH=KfcjmJRX*&gf1PZhxTYQ$QD*V%NfX^!h0=525Oi~vv_=#^%9ugh#r1xf5-!M$aoe)3CTuY$)4Fi zG2?Ua0F!!7zGo&_ItMBn;-6g`_;SP=mQNxNglo|;+fUet^?5kf4bX^H6wZOu++4It zJp*b$*PrL;>K8#c7$BF2q8>s9J+Ey(wi?`sT#=2t-Jg}2k__M ziS)@H@{>|w>&n8gbrYQS52z{tcR1-?uFhsB6W*7w9HbvCs*&Nav%Na|sdV;KW>Y?3 zJlu=}l+*tQxvBvPa_ylHQ9zmL9gO7~QusJh7*h!H27wf086JA+rpM?HD#I~{<&*Rd zv!PvpE)MxCqel@O(FI^yW#=`aicT)15gmrsdvXPuUDs&yE2Mfy%0JM&o87~^KvQg^ zSq2Q?-B7GEJ9;vrcG2TwojK8?>CXQo!nsa%uVy3>h35P<+tKCS@9}y(=G0^c8o3!W zL*+|HC8*K{(OyoL_dYj~l+E+wqV7k<>+x)ae&*pbNC$cL!8HQ+EiP(?{Vb`UDL%W> zel|vzeTC0P@R|M-d02=E9BylZoKHf(4yzgBM*lHMmj4B~IS162zPob@N?DEtH zc2O{5*m^nX{V$ZVb2G-#t@LMY(Ogj!9ZZq54~Vj5Ee>0Y`1crPyo>ir#>jGHM?| z&5=YnA1*T*P?{K?mGr)XMl>F?JYQ~t~M==4-t@jHbW}BSZC%(;4W8y=9q#7n1Yyw z_7qHbzhb8mKf*=Lf!j;ocvL@ohR>$h&z9?F4SY6+&-8d8ioI}qqx8oWeGI6yPScW+ zK{*IJ5GU+`eyqwho0UgZ!@j&9(X6$N^1~Pt0zZ23P#{02-rG8X8$Ot?@ddy5oJOUFdDE67T5(%HQg>$ z&O*hel`eDx3h5SA&Eq65MytDWO=|>r2O^b1Bt8sMPXwKG6oRh&3XbtZ{%!2S!q!Gy zF!ijLDbOm^rQg73N_e~KNozj%-5kz1^hMte()sJs`E@$qE`FHKelndsnb{)$7$m1E z+QE7)*Um@ML$FPrP@gjR=ra?y$g+dav@S;C5VLK#*e0uod%)=tEg3=cub$F0Z;|5T z#UwgkY!T7~{08c9Oj;%XG9ZTGb3`O@i93Wyp6G&Cp4K3UKcP*RaW(>f(%UM}t0rKo zU3&%ENh&5>(ut;itv{SVybt+(lywVR*>$Z@65iV+`jxjB z7xgDl4K(Jsg60AB5(XTDFd1&Be&D;^;aH*v;V%CYU{Qb2Aj1U2e)jckS~zZClM{I# za{_QYHT^x*Kb4^T?B61r%pXE5J4N%@ZN(0w?q#++*5ol`gB?b#5Eg2sSVf%dhY3~! z0fen!oKWMKY+r%8>nk>R4w@grqmu4u7&a=xq%eF>H!UO6?xoF3+c(qholCoS3pBUk zL3yKpZ^IMuPcZtA@^rya3PB)H^P|FY3|j;>z;U>^t82dVvD+HTUsxq1i09rHlvyiHo0o`lmW#kBs8aD$dcaa zPm+tOrqGsgM2{m~z)0)Votz9-IjBYhJ^xPvb)7wb!RSfvRr=WxrgfJ_jutK*m*y21 z$_a1zcS}K6dC0)p}Y5jI)d=QSF?pt#$dMEOtDad94R37vzGyt>Z)9+ z&(!PxL~~=++8m?bSde!5XupU(Y}4fI-|R&bnrfs+%CZopx3@hEf^>+5@E+U=5bHKd z!9tOOw(0N${S0d}@=C;hfLc&rFoKhCeaX2J?@d*iL8wJz^-zi-p(ht@2)mE*-7M-o zp_ZhvpKZOB6GX@10&0qea0mp6_bjvJud`&A=#3PSYX-B$V}ty{1_5zJ zY~^X%g4;#ngReyjU2~Z>Z8><*t5~U<1>O3A7+kx?kv@4j3*jA2P^DRe@)*n+ONAF?T0 z8ZfP0lucG25>!M@G5T#&PQvV6ys1J}8ubJRz)E27}rc9RUf33i{C+=uH>N?D9!HN$*qiqO5*Iu~SAs zBqAjr+8Uq?3mE--3DT}2){a#^JmbWN_Liz1m8y)o4k^zbLeFW1JshFgKM+0{Cm@(GjwotdK$}W~g$( zQtlFtsF1)*5UXfH>!3_xM4cbPTH9U0gjZrTI) z5hExLK^aFPRqBDqH5XmT`nAZ%=qJ5T$nz?4QQ`hvG(mF_hIcA!)m)@mRqQuxYhZol zW+XT4 za~gr@gAR)dGkM35AbIEFqWWV9g_%J2vPLzCix&y+y7`2_{hha@naQKPI`b)==}|W# zbG>?ZJBmR1C(0_+=UA&o@w+rcg&IK!o82nat2%eO$q{s+KmQ#ojsYuW?o205*?yv*A9U7Ys#@AOEYD}^#S ztxv=KytJYLFiRxU6SS`GFcBhg}K-d{<{R;2wCq?;?LluYvlR&bJDR= zvB;x;2q*l{Iq5LF2`?RllRkb_#3L42D38j?M$SuweMrr8R2{?nD%?Ks&u(1Q%NUb1 z|14Fz{vixt%@zJxs)oaRw}p{Iy{a>(>r96_6`3jSs8GvwZn@;rHR-FfZP()goqbk1 zyKB0Xwz;E1&DH>(G{9N{$R8}a3bSsFQ8%W{!Cf4t1>ZWJZCZBRoAyyU7WR8h2bWk# z=T@s1H69MYk9H)9`d))uiEaVY6X_MURMNXe&>MBXOAo!U5HJQz>sZ)a6kQMmOLa4@5)DK{9nu0;HW5Ln zY@|vqk03Zl&pu+URt!}L~hmLZXa&U=XCkjJ(zX>c76t~(j*_xfC)(B`smeKBcrmUETS<0XB`{tO zsfR(VK{e{kE*ZA=YCW*>Y{5;bX?&NzgFt;X(4#hxJi9^zy_UxG(IY9dA1wP0;Z+C;$$qx*hK#96a8p%VU;%K)RMovK>X(p#^_a z)=OZVg+a1=>Gw$BdJKG0y{t3R%ye%Lw5)SA-P=7FToj#v;gw+x)X#w$A5%;Nc0izb zPCyoNV1-WjwbTKfGDad6%q)=1{G_);XZmzkByOk{yu24JND;`gXg@4UJuCd2^ram+ zn`WdJcty5$rWXe${yaUy8iZrn9 z8}CLNA@Ams-5^P1(`EphvkFxe+_@ztY?lHyaFDj82EJ^@-tYcCm;N-h0`XhZ>IvA_ z<31x`kM)9C@ND4KsOjJ~RD(q_>RYuy376&HN`B>oO;h(JnE3mR(rMR(C22A&X0zD^Ki?gb}>i>dg#;iwFKEqsm%4f?*B;Bw}$k!wgzL}{i5e^hUrR$$GrK!5<*?hNXn4&WkkVyeM^SGEjl)K{CTJ@U>> z+*ZkU#TMwe4K@zM*=1wdJrCegv&T8hxzyQZ1Xu9YAiM^0K6YY{Xyn@_X2NSlzsFFyWG!q$s?|v2Rm22%VtoapZ@>L4UnPb5Nza`FgS}^2*ga@3L_nRC|r+ zhWf_`0=r0H?PnJPyl2W}j<4&KaJB=h%~}^(Kd&bxQdU;P zF#nJw9&KM#I@C9i%z@o)T%l@YHs+iug`oOVW89*=>+DAM=#R0fo$q@`at^cXL6=BQ z#M+5%@Z8Y}#c?|ZX)XpScDv7M-0?VV6l*BvwLHe~LOU1*7^um{0vRsMcQp+Zti?K& zK*#3$vTw~dt>GwSdT>QaLb7Dn8K!j&?%8HA5URtXn*c=Usql7{8$%|G_H= z)Vv0%XU68WdyKl#XiQ}AWZ$jW@4$Y$e?Yg}exbYlDLZoDZl`EGwt<}LQ?0_OV^;`& zod++k0fJ&Md8{Yme#8MH?#800QHk;fus6$vBJ&zZxvcak{gCG7+s(b{JDcmK3N7p* z9}RetZ=H;CBRnQbic48u#_gB`^N8r|uA&s96pN%06!+OEPPdx?_7TRSuY{_L4bOoG zj}qv%5*fXEjNTGfpOfx9S@nP{3WiIu=uvjfTeA;7R^=->J=HT80?gW?`CbIzABv^= z22{V)Y%ApkK*#FR28S)Ot+9|rV5wneLMmZhwirF6%#Q^rufzjfr*0LYm~btFBH%h# zVq~S67~7!EI0Lm!62~G&-4d#Qj=IIPY(_at7^JM>dzs_}^iJ&nn?rD8;?fDZ?jAjA zdF(hvzIb1`aQ0wAo)?DGMTH-ZU*Zn;gh3OWDT#;t<&ew>Xd}upE5Lxp~^a8h(>~|JxquL(|X|8oEKf ztBr?z4c(w-^+12PRhj_Y7pI{Atf4>onc!|vr77q_wM;|HK&^dS8aye5^w=J-yVGDh z)T0_~NUEh@U2XTPP)*GMo2$XRDXWCTZlRYCp~*G&>)?;F4g=y zQxz7gueS8iyPpPoEQMoY3e2ZEGQd83OL{pk1y(HWda9M}65WoWYSb{7r(gyUW}iQb zw|&-^e_jg$YqMjUFzf$#effSk0u(4MQhfjQ<=?|!Vm?|6h9>Lox4s;;LH1o=zFwZo z`f}C~w3F-0Z3kIZPPlfFf4Ha*h1|1NSW69Y;PvGrE+B*Dora4l!)S=H0*3=Z1a5i~RN~&czz!gQ*0upZyY0T-lk% znt*8uZ^DQHOoFQcDtojY;j7!-Fa~G<1dKb5rjDfU$E{Bc0D6XKkT1gkP?fK1-7nCT z>t-Cww^GG5?ptB7K_6=E24etH+NTYHGqp59PNB&5mGEsiS~*gwE!H9X?RZHci~v@R zJuHt&C`q)Pgiw`T@|k~L1aqlI z6dARDk1?Q%&f$CAA2J(~{0T~PwQ&&8#O6H#GvM!(lD2{46MF!G32hJT+lV!Av)JEj zzoQY6_}@i-O25a}2-&qcpk6?yA>1D@6Qwn<0cvOsn8vUsDE4A(WZlOa;MzOa;Ct5J zjYWr{Qq>zONz8zBi_NZf$oJ{m?-N|eaJ)! z?<3b!R^a~X@wT!Fs12LQUmfV*Lxb(yU(xVPcwd=h-=En7-H?VJr=e@q%^Lb~4PB$M zdZ1^fp|=zZt{QcbhOSOQZysm2q)>%4G^d-I@R~GXXA11e6qrvPlLqThXKAptsg~CD zfbAyjWudD>_0?dHrogTtn0n=TyK0|WlL7oTd~5Xn))eqrf>ShZjcU}Hm#5k_pr^vR z3>*(?ut6ytpJI1}$b7iNAph+;`><5@24<)K$cVB(s2p;8{5%kja+_u^x2QfyqYqOp zy;rxN>cUzI95UI%z+jUtPYb!{ub8%HJ)U5j)y3#m@;nX%-HR9f;uDWTlUSgnJ$kg3 z(%3RrOc4Vm%D7me`jtRpdKHT+a)t;UnP&&z`7=`eobxiZsTjLrM^z$%r(+}7D1P@+ zw2d#^TKCr=rT*H=A>+)1zkjYw>8t#F!x!68)yaQP(I_*XQ9RcsPp$tu;u+V}>uG(1{_uFlAMs+-lFWEUw$!tCJYyUc$->rjJY)CS9GJY`=Rl92 z2L8y5XI#8lSn`7kJ$9Aq;W6oW#vvPRKDT2R$7n z@dP{0c*fbLC7~;hwY|IR=mUh)jYW^31j8DSpM{cbu?F1o4@u$@&qw?e(DRp zX(C+^vqacnM1h12Mr0Iav}7XguhQYRfEY?k?$jK*i-rTTd{kNiZNk{rOOFel8Nt}5 zs<7@7iC4MtAEsE@HZ|ZhlJaVrJKI!m+{jj7{!FE$sN`6M>ajamrsP-@!iuE&wGX9G z)r99<$nUz99XR@c9S}J}S6=s`(Don^^I2P`dojlD1uQdLMroT5W{+4qQly&o7OK@G z9O|upt}p5ZgwY?4v~0aELsX^`uRH|gm50?_UCNG@$3FNc>?FAR;NC&Dh^qcxFZfef z1L_m_)F4wmeDx*5v8Yy-tS;azhRn)9IpKRzHW20gbkk!Cbl8QX&Hb7O9&Sv-l(G6- z_(?RJpcs0F+qPKsaBD)L2rWX2@n640VS}0^3@0^t4qB6Dtn=)ePR^`pFUHa}1y*uW zsg9qLcXW&crow|~Q4-n9FY86z!G0*h!*rx#g{nP9gp?%;3++|21S*3UHbN~qzRf6*j@efK5{jSO^`(2f*TU6!WAa?ADuu%=7 z@dH_T#Ts5|b9o9$NX*Amw24x2g?;~AnG|Hi`g9EqutF8UXhVx{)nJ9{-V|7&a;3l$ zHE5YSTthxBkowUS054H*Kf~YG@hdSGpIYB8tuYfC>h1MX#jP0y&tO5#Zof$ZqcMNg zkdahldP`$;sGv~Yr*qFp<#tBWHC~Z{WV#0HodRnH*b-ID=GlKDuTxtPAgvql8Uds= z6dXpvb#4?Cqk&XcE_}30;@im(3}o0(I=)>AW@jzj@?idtAlZDD^9oYWC@ybUjRs*LB4VGp`Rk^nS zJJTT$DW`3GH5pU+z(MlMiEl>%=mih;2Smqxw!j04zQ&$54)M|7BRr)@g`POO;T_5x zsxV<-gC@o>Myk)m@)K=?e}Q@Fvf8;3V;Ixe)Q926|Eeu!>|ZRi4kv4fQeaw4F4K^s1X4fh4d5ke-qZY@jbB^7PTRZSJYDec zjDj0R*z&bdU6gM6*wdt`h3YLz%Y^r%%k29GK*KwrXJ4q!)Y#fnnK7bLd!7PF>W}gh z{$zS0oRF#aqgy+#{YE#(-~t_EYykt>c`BYvd_p3}5!dGDM~eXFF~Z$53A` zLo+jcJz97Jx8VFQV;PP>%*`M8GPZ6f8|&6o{iALZ-bb!qgt5cG_G}^vDVFL+~K^c^*#}KI4%MJWSFjXCo zFrF~>7z%V)4(tsq2W*;|=ka00=zxhQBZAZ700{kO`)o70XEpu6i=?nP#~w>@o#7vTaTKXy`-dOn<_GzQ z^AANSF#W&dAO2ys?#1PHFMf!B_&5oNdjCK64?l;tQEPodsvpTee4Hp}1LgnRKU|1y za~y806+wU7;ednthx1qcul&QG*fpJ=SyLd>icR^4oK$Kl!sQwMVV0k=$@UMQ6gil1 z4LJ!9GyKErVIsgH>hTZ9;KAw`1ut-=)}%MUzGs)e!%Lh|rL%t|FL9fm6#uT5_#n{i z?Ilhj;_vbjFaA9RGw9{x?$}%jH@2&@pA%sYFY%M(MbvLoS=tmhKVskCcaapNm)J`~ zi&1bS#vG#kuNtgSO;3Rps&}6iq$y`_#|r`(7f5Zz1OdE6Eq|Q9f5xwE#XP=u!R5MO zc}77u3uLC=k}HvovonyG8tlE1((yv|5WtqG zL)pCa`)jH9mzMqueZp&Oj_+%6jX&n%wA;UimnAR28Z7HtdvJ8nW6N}4J`$hA1 zN|Ur}xQc9gP}guiOb)EAa$rr_Nzpu0GwU6!EM6Ukd*yN3QF`h|`8|YDgpNFWa(#|Dm9gMiTIQi^^~I}o_ETLmLlbP(!2t1PUcTJJ;bTnLo8Q$SPY0@xY{=N15z!9zVmpq4T(e4PV$w zp^$POrFZuG&H;E5?BAV~5t#o6?_X*KEVF+Hj2Dhqcgwt;3txWkzFA{2USE5RJIc8B zz*T$>WNJOlxZ^B7KET`b{W^bw9F_lDk$?D2>5UEQm9;2>=;F7}@XF}obqG+1d{{%j zAmPm(Zr@)$*p};9|JBd{^Qre&2-qAA=2PdUzzWsx(_oeAISqE12CGyCz?P`G2L3L< zudOkn8Aa-Kk>gWE-YN#LxFV?bCY|X_Rl5qA+D}2|B|7tC+3t(`N0_-_a$cl5gngEA$0Z!))IL|fo&#ZD$Y}x*2C=U$hAWGih}Bb0n{v-g zZ0z6-IHdM{R)VAAYKr|v-K)64k*+v(l{2(W-xM*=3pkxP(;kO+K~8)F`D`Z&n+;fKeg4-R8qmR~{_>X;Crv$)oI@wl z9*^;%)Pw%#rQz>L!~1&RwJow}SPK5Vb5lc4bTb$=NO;|8bj`@#Yk2v-s8;RM{Foox zSFp8~>%wd7Q7*++i#H;PvgLeZG~s>i2%L&z?F_ES6F5-xTW(h4Sq9jSD&p%Izd|17 z$EG(}dD$ux+i%D!Y9TaK*t#fe&Bijr#)wtA90&A7uy&L59&V2d{9zO=L&iERspq1` zC~8c4f6-IRi2~vZb!zNtAh6oF1S`?C0h}%BzaP4D1l@=pbp13s?^iauxBBdluG&Vo z2b|s0y1r=L?tHec8yLHX){$W)M*%nlbE6Hm5Kg`7j;cg{@>mY7!h>iH5$e9{(#_ z?7c|#@Z$b!>|cNoW0dZ771x<3q%z-@Oy_g7pgm+#lvp8LBtN*Qe$b9$68GcXWrIHs5^PmrpY`;tml0r z9Do6XAG@I8oZ4^79qa_jqqr~PKRgZxH|5~u0_-b|g> z_c+jsnWy0R%u~#grdum$iTn~}afRNDUJPUH6dcvQ&5WDfU42PMm%1JKkwj^h?4^C3 zC44ubgq%)@vl(ZBAZ!Y@aX`UMgC~W4K|>wIeyLYs+RDK9^bfBoOBYS+Mg&uLMC4e= zNXd({5pqRz`=8Rk!Djpxbatb9=4bE^a9m;MXQUp~l-;?KuTlo(21dY8>l$=*s6k5^YSO=z-F^V%{~>!&!0xjCGDm$6v}5rmU)4Y;T%{9AVa%x=hMKA?yfuqSNzqe zI}br+5Qep|1JL=(Q^K+T-WHAz@9y%FPI;ulb%2RjJGyeP?F4UsgAyJdPY|DjUTsj{ z-U!LF+IcR989l;Trv0!IhY>i)S*C-?EKXvL7xB=I0LfWyhd@n|H8>GRE2`iA0W?)} z^=a3 z5W&0~nq6Hhm}A=~;0yyCnu$j92+u=#f(`aI)1<_kyfFP>e4?Ht*fQYm%Ek*T|D+uBir&|4#A8CXO{6L&ODD^HozDR* zk_duDZ>#XkbYcgZ3FdpG0;RYLAF;w9Eodskv>AaP3=OXe5FT{U#m03 z$lMW0f$2IAlCOE6k<5ti@Mp5y;5f6L-6&nZ$Djq>26Ek}$?lH6XIv-Y!sivG9 z03b2I&?40vG7Xcn!QTE_uC6#OMf$)PZUcm7j95?%2&3A1fWl-?c;ITYq}jM5AI2e@ zi{9KQ!q8;At-LHTDOgb5Xa^Der(2BcNQMTCKh$cBc9FYuJ{=+5}We14XRS^*6?4s=%? zlZYWhJK#mHZvBS9Rx}1lybFyjds`tR)CaxM5Xh(3)q^aC(=edzpe-=v(D4Wl>kw6O z%|x*7FEC$me&u6S7(e50`j7nU8^>=j9gwJH)_Wu>UOXXPOZTQL-bMY<==$NlbnS=! z30+%-uGOIH$Dr$oOuBwd4!62NSIm?7o=Xx#a3;t#`EuCQMj>rP4szM7s;=X~C#^-B z_^qWCr=l3>JZ!b|6wGg16(5M$BW+^eii*093&qOo>h%^#%Jjleib9=}SQ)q%7 zgWy%r*ZuG2Agp_YgYXf5`3L(KMlOuok!}n?u{L^#DHy=`FGlYU1q%uyv9*{=M&z-U zzAkl1TE^4}$Zdrn$JQ!X8Kbc@F4{$o_=Y~8d!=ZUfp&m`=Q_%pHN!Az@A6A=Ox5WK zHQTy_$0i&`QC+C2AD8La|7=tz57wQWnvQzCpBk@*ykWU6>uFP^Ji&257C0T!1&8WF zvVoG|R-SeZ&I|C7i6;(Yd?R+1*7~JucvvoQ5M~vWMH9?KtzXE1n*z!>QzRQZSwT@) zuH{zJ>z97^91mA+mY@r_j$45#=rF%}&(y~jn?|6C#@l=JBXClXR4Wys?gBQ5E%PxE zu_WM=uA%vg9@8gc>1Kst3J{Gn5ef|^!d-GGc`)fg^w{WM>wkhcL29W<4C>=qHxMjE zPD=9#%`gxWut&7#0n%_`D~ZdaW+mulpA+*w<}rlioIxBF``MtAh|-4gp^*B!h8k-_ z$+KKQ3G=1+i7mj`J-~Gxt=}8u2~L&mAHi8bWmZR9&_hWZvEC?JW5#(V$4E%lkv^W| zj-dpN@mUb~CopBg)+Sy94On-Qde&{LuezOiX|v@qVJsu zp`g!fRGJCP)#r~&cken&Ghw+J?q@GdYpv*z&dn%={$LV;wVQdE1pEjy9~8Q+4~)AH z?_wmcDi5uXwc>LECp~&o7F|8uz(jJrIzHRci3-6C5q@v#dw9omokxqx0K1HVkOdqAwLzp&n zx|r!4oj#lCued0ea1}D$rPHS~{jN?IFiranFn*@nblS)Cb2@!A(@*PkKGTot^Z=&s z*J%&amQLp~y+EhkOwZD3C(}Hi8g)6CzEY>Zg-g>pN~gP-9;VY@Fnyj*?_heMPH$)W zIGt8ZAEwhEGTmFJw=wnEp(sw=n&IPQSvmocEe=buhh7KVQ%EDxF>etH1NF zI{kM(|2@*F2`AT{?<<-mdB=xwe7whOYVu6}3Zeh1tQNCrji>Vvh==v-J7+);>Uj#I z2hzO@Z%?jMpDrdlM-O9qv;{80&BtIRL=w!{H_2!(6@&gn{ENSxt1z}bIB=dPc%Par z^{tS6@S*xoG5}_xAdz_lGkGvR=@l*D&*8DJ@mY}-GG94q)RC~*x?HLYf)(FUlZh0@ zWI$dgO>dr@ejh)+SJ0`=v8y<*qJGE-tgvZw1MjsW`in1|ECwzH<=fei{=m3+3toc? z1eRyTE;t?%-C@+dh^#hOf84MM>M8&sa6d}j1iw-J8r@XS;|J6Imp?=25_z+5QFjQL zs!mmVkOy!d@-Nl-CCon-`E9PhL!zS&M_^EL@j5lVFH*J1s*BV!NO7M;tk?m&3fkg1 zX=W5Jz^s0j1z@m@Z7IyS&61N)KuVJ zf-#{Ml>J+UfyH|)*Y8liu5m#g{Sd0h7{8yHY>&I{LWcSZydaeE#V+W}MpvDu`hgJY zDP*XJ;rPW)+66J|KsSDmwiay)EZ(S^klMZFs5fIDWT`wrTPvh`t4VVr+S+tweSueTJJ}DJTW>uXF zq=S%0vu%U=GxE&3-QX&Il4b(Ttcjg>qv<_!(b`(HCg~k<1Lq@j#pD{Ey9;TnGj`x=9 z9bV$DQCMOjBvi6%3?8+)PQ?>e+vYkEDUM~E>!)@~n@~43a(11>l5Nf`*4*>l${Wk2 zp?JjUOFe|$msgy6h=SKo!L&->oa{~f2>AiUpNA9_9HU)Mc%z=$K)D7p$@;Sz4kQuw) zk5kZK3L*9Z09cb8#zJoOz{3jO6wsssTAb%3==6J(0r{|n#FJ9BC9h*`e`Re&_+DWn ztE>QzCB2_A2lWl^sc$OltLUi@9}S}ovR8dCpjfgkmdu{}XEHbAMc~cOd+PSqIXuKI zk=F!vgPCsPeC`BKk22jx|7_KpTP_l=SA;)v(h9_kUF+fV_3~W4xAA95f+6@ZsZ<;t zzASOya6sIDJVJ0cd_ct~a}hp{XJMiPMEx2d`lLjvPX^=4yD61qy0>xO%6@2B+<+^lJ|PPwyd(W!NsNR~ z)kz)c{FB81^ZqrRe}m4y%}qL9#_EmIpc}LkW*KW*+rfrDaQU_XP(C;4k#~Rk;6Svb zq@^lq#%{<*u`(Pgc*3=8cqy#)QkLRkmq3B5TSOVM&567q=VZTjtD!}W| z1Bx1Vn8u&;zQv5M`iC6)R?xCEtLrPuYT})!%l1}(fpG3RLeZXvN)N;Zr4t{->aCJ+ z66D-C%yX21VR8Y)1Pqh=w0)Dp^)W^qU+-n1L)ANQ>v7XteT1i7+cV0m*O8?*;IaLX z(rj`-XjDq84|PPGC`4tnYE*f&{K{Y9;r7NS&bN$*S z!4(2gEjt#1mh9^+K@#pvwfk9xmI_!oTC3+KzH_`B zh3nQlM^R~nTIyZD$Gw_~h^2ZS8px)=0M-5OgE_ z3OuvfKT|Jb5HOMjb#GSj6UpO<_*AqIU1zJW;r$VEA3Xz9E`mqp`ZEa-YfpY|EO4C! z0PxuvxbT)&+@6QaYF8G1vxMTXhF5|VICBm^!Ur(jnpTuufzP)NcK!Bd7~9q6q`X&< zz|8zPFF9)$4lXanx5y^0;8OnN!NL5h%OV4tjpe}sW&*2zIUPvii;uZAkworV=m>wf zggy>QJIHqCF* z^j^GGJ;z}1CeWo{?VH%$wa9x0wm@-gue4!mE;x~!q84wBI&1N%9d##21Y2*x;Wmo_ zkUW-fU40eiQ|zRl5?XYY8?R$L=?`Fy6|tH|5XIVRtJn9h67}k|*1dG9d?Hk}Vrrn> zIPEF8q5}h^76CtRliqm%Hm!#h=N`TdicHuoqVaBG4w^nBrGXOLBv*iXv=E%_gklEu z5OFf$qY*SnP}j9H6Y{a#jMuRmHbfot*Cw z*i*m>E0q=y@X^polX|CqV6U`UGl-_xT#aTWCsGOxKfkt58}@+F_iw{R zy72Xxg(aGR%^CU=SJ?ZfO_T=NsYny18HFHktky`}6#vn*9Y}uV6!EUDv5I!I#oPwp zQmMcIc9R+mD~16WAiudH%Yn%n0PP)J4v;zkT2^Wq_5*QlKWrbIBM*X8>t4hlWCB~4 z=W@@%&bl|FCnwjbM+8&uuh6s#GclmvoHX2H<}{a7JLkV$Qte)_WgnLwLxfS+zB4pB zwgAT~VPsV!wy_xB${L+je`L_w8A+TocnUVQSPG$2*pItgoKZi%KifCKl zeS*mE%E9T!G;U8qQ{B3$_wLiw=Ac#n?dDH{@i7B98$6MLSbxHI_qei+X@N;N*I$5m zN6H4^!WtL}0js0I2Z$6Q^)t#?28tTBmRrAmakgJR2y5F(sj*_9-^2M-mX=KM}WL3R_u{FsqXUHV`tKu>^%-MA41~4`HOyPsB*DYNq$F1g+}a2$ssM_Aoz&!Obk{Tr{lA z8sNvs#}7wHA{qumC2@Y#fK_JV=q2HtiSCk{obx{_xyij?TNt1EqW>tW)Q8WlL?#XM zU==q9iYsJ|%nex>GaN<|PL$`Gld{7l%~4Mh(Y59Q!ICvIKgG|ihr*T&a`=CcK&eO_E%V-qCph;|E~bz?E62pgwVa3?e=D=PX~uK!CVB zpngsPC|%`XSIS9v(j3wTU%8}=k=KpigK@hJgn?7M?ks3&E@qV)5o_#hsMlM@LGO9M ztyoOQ*y)#AFt7nA&oGwh%tE7o(1-f~?wO6R2n7SUufTn|;i<0yW<09EBj~o8CHl6~ z=pSc}8DGdJsOW(+85+h{FiYGeCIuY03<9*~MyPsP(;-yb>O|#I9k6jh!1|;hGw$hD0*F8sI9SzG&cmcuS)`}NCraj-f4fVn{ z-H!%sh5ORrB^bv4ztEtjkQCXQ0Maq5bOs60LjV)&^#NZv=VEtR4o+v9R5}IuA0LP? zX1r{<&{fC+Y_Hp7+KWC{l=sl**E}*dO&@GX@?gsR*F>yiB5Z_D*7s<)+P%0uGO!V< z;M+1lZB{{Sy8NMlM}H6CW)-{L?I2!Y^@S4wXVAhfSKfyGMlDxLLJ(nLEZ`q>YK7yY z?Uwy8u!B$3G&a}-&?!!|&Ch2C#l2Y(gv9w_UKye)DO@g_ z!cLKQPfEUy;>+-xP1uEpcYP{rQyLkq2dGfU_B-a=@q_|(laz<7uo2lw8Cam$r5xxBOD}-@X3w-xMEgHJ ziF)uVe+3i;w82fj^u|%xH?FrY%62RfTZiM)MgK+n=zhFbq@J70VU%yaOsU6`KlHM> zaPXvAH*c#NgQE|fRb^Jt_fv}9Sa~4oAdIZ1s+&+;>&c0(yjOU1RmU`O$^*95Si}X6%BjQ9v9$7QS>hdEiaF)rc`Y zM1SzddMW9B509|bfZwoO`XbsFwiftcy@dyU8!Xvr#QuawrB;*mS`h0&Ih(A|X5Gbl zJjV^YIBP-3y4o3xec+3RU`FF5&*<4fYpt2H#tN--;#0vhk3j-KrtVn-P{cDhw9Zr2 z7pYvNa-*>HnoCPMX08ufYf4LAuDXygz>$jrRsK>~)~9zJgN=xP&I-mym?4%!Kg)7j zgGqRb{ZI;X&}u?s?-++}NE|=IGN!fLb9B5|ys6l>y~dxf*Z6C&ei7mM)jOjR&IU9g zWX3k)HOjV{A;maY7pK%@sl?AX3AQj7Cs!i8Iv%b`yP64K4?;Y+dbk@t307liB7O;2 zY{3Msc=qa{SRLtc>)>(*$iZR~+H;Hzz+{L*X!cPnSx@Xld=?B30jOgQ;9*EwSlo;Y zl#8Rfa}}pOJ&R*@XM3Xg^bup7z=3v6z+?#^Vz>=MO}XSltCHSNM&M3NH7E{acaFQt zh3-_jRyhI>+Mko6B~DKkyn?vVO0p#9tVrcRC^0lA>3xz|&>-; zyD)X|U6AScLP$kpcwu)9?q_>CZ{p*g^1EH9B7B!!bwA#ciR8e8Zi3W*Z%1Tc6F$Qf zZtCnEy&zJO_Y_XQFcwvysBvnRaVlQCS=dw~cfkhSE)6Hw;L?cy9r(X(GJbYcy%LUX zTcEKxqlek&N240nfdW-uAm51g8jADLvv#0!Ej<6r7?@=Y?7=?}_y=nI1A%`a@DB`b z!~Y#suNqHvvxcsR(4EP~akXd<<;u(0MgH1l$>cDrcA>+Q@cnY!?~0H98u0%@o`?S@Lz~x^ z_f6%?J)cv{OALjYu0Q;q9p}N_z*?M3T{?x+i~*Ch?PKL#>qj7VPcm9WMm$9Q575vYWY61*r&hN*lJ&*bCX04sZ*z1CCk(!NzN71ED{na<)KKK(*(J}` zplsseg{riQ4gMAKY)OSZK^^KS4F%%icj6EZDmIkRHj|ElU2LBP>k zs}=)W=J-))1rUBy|J=_0!Al!>XMA_X?er8sOBO99So@Q1yx3859309you zdSRd9C3D@*`OY|gH8I5az@F&rPWFe_skmw$V)PG;c4=hN?2c z2af5sms*!2@Y)5P8@&mBEo@xRL7;;sI=B^y{ja0=PqDF>l1lgeDY&%i*F45S^PY3i0@g-kUnY;3^e>6C_ z+8H&~pg zU`FkkD8oHpwI?$XN1^tviO{W4yslZsZy_4B{Zk-r0Xd}WB4EslUL3Z@0s!s&lFXb6 zL6%J#jv(g-bv@=pFgAaH+o<~^^9NsO)IP$5bx1fd&aLi(4}$tSv9#?74xXPMHNumw z$ydj)r-|GgY&x(uTJNF(RcD6>&nqx$?@iTWApzI{M8ig^AW`9n2gaf|s4g6L-BrRe z(HqgK==I=={_4e@LP3OxvBIn=NM;`qT-?j=#OA#GjX!Vl=QaMkjGrZH9e;HU8(f~Y(^3K5{m0)eqgD0Wx?_ZdISbbDTy3<`V9lbNg7sa%~0}=FH@P-!NvUIiNORa{xCK z%IKZKgyw*X-NT&!J_}rn5Y@q0AkMMgp9PMT*VF%JEO4PrkQ583GY`Z9&7b{vEb#u# z81uLJvxPsK`Lh8(OH@05>GNv8EzJY+`VSm??#F#II5>YE7<^Y(@9?Bb4Cx@X1{((u ziHQ!uYI@ZanCD>aOA6Fv@CDv|9Xv5Vnya$dfk}9+DQ8O%3&r&HpyRj)QVl9VkMUB3 zUF^)vVr%(vXnHdT)!?0H_cHw*4Kf!5tAZS&B*9Iv!c7PtB1HZ#yraKVm zY017FxCQOW=)m;MVtsmw^>pCugLEJ?%^m}-Z@BN4Cnoo-tW-qsRpv&aAO__9NWz5t zhA)j^I5yC(SF`a6#fYWf`9SM=20}ZbAu+fWR^B3gNgV;>zy#D5WFatP4OSyRC8;mT zEweW8HH4+eKu}@vUH)#StXJ!??E?7uQkO~j5TJ8{8@&EHjZO<3Ty>8k)`$EJED~$2 z&{7909{7R@`Rae$rx`z}Pp1BU2%nwcCh>rYQ0g)>h063J9}p9tmGV9Tcv_vQy+v?IP%0n1{iy7B~ue0RXg zGw!<7>2Q>cprk}%VF~?1oWlW3IH}cX)bS8AYgjrUWh{CM4{(ZWA-2aqillm%nkH85 zLrkQBZrDcAJQI9swIoIsvsQeKxEf0hIJ8R5K|oAbQ*|t>sLIbkKf9ksUHf;Us@15m z6Ml%QMjA+p)eI!~LZyWdoKzG$)G6o-Tu3ipvg>yu(?;!;DBU>-KYS$-q!~FRfRnuVT=xK42D0%batsJo(Z|*xHauZ5m;={xQ04(P$JE3|Du8WM z4SZCLym}@e%S*eNfKvC=vW!{^EPL6$>0SM`9EQ-+0CjmFyP)W= zs%7eSn3F~Ti>wUe*oSrM;p2q+>Jsc~qO6|Vt*zH6J4@J|PaK$e3`A;5k*0tvF0AUbJsKPOCiniKIskcUDQW3O7IScdW#7R#8m9MDNs*I<}3Wg-#&8eNqlIF6>qN> zwst)@ASKGcW`Em3%JJoo-?=3lA`EY@;XMpS9O5@LKz4}?E3=du1M?;}--K5k{fW8) zEr?ZD|I4Ub2q|XGH)Ee=cO9pO*^i?GR56lPb+szQwJjh%a|{#rE`IqH1{vao370dJ zOh!))PZ|gFV_e2URF=JDot3#{O@p|k+el#Erp0C}+W&vpd-M3Hs=M)jCXt%rk zqs?EFkV2b;&$5|ogmAIY=FNiZzON`TCi8CfkU^XC%S=BC#m~o>?NZC7R;>zSUc$4& zn3H%Ij4?kvWdLLD8)IS2@q#fODU7)^AQ%%nNu2o2;Y9=E`&I^PE;t%%;*xI*uh?(X z?!ZtE*c6*OQ09KMU84@U9w^|}qQhGk9 zvA#s^jT4;MUem4JEinNF9WwoQD+=AfYAQOD4X3(I8&0!#1ikRNQWqItPenH)Ol<9E z?r9oJiUytPdJgb1>i|!tHnO4DeB@1mRaHT?w;7XZgh9Z~!!2}{g_Vvmn9@OatWxF}DHZe{vmsKCmbE^ug8saGX$|y0%_qo#`drCQ zso7FN<9{xVTv-avn_trq({3LH?uL(c2WP105!=ls!mr7BE_`mHR={iV`OQzs?0^Hm z$6sp(6l`5DIB+wQ0S??N=#v?<#vcVB%__M4JQ?9RmekBP$LT zH%|qUn6^8`Tt(g|gZ-Z~d*%uXd>vv&p}>7S1R`wKhgJHE@;617W^5D()7#Pc5~(g` zV{cWn>!1TL;p&GG3Vy?kQWqq{Erjj-DqSwJ1w&#s`~|pDgn;HZq|NGCMZr0qmWz~< z?Ft@5>*h7Sz9iVdak)|f&&=r@3hEkfFsM2}y_^)O!}G}(lS#PV(}b)R3jiiUdNVK) zvo}h0Dcb2FXs2Jv8Km8DKAEk0qBDOb?Z`3X6Kba6RdX^6#*TVbcJ||gcJ`q~--8f( z)oZMH27{A&y7+j84#Fqt*mTg|6dly}I(2 z-kKGMwA(edbo{>nZ8LV=G0()COM8HYDp>?0r@b(JAeN;e<1ib2ErUg!$r<^8ng=dr z1*r(7zf@}_!nMu3k|Wz|{NiCgdyS`r6|i9EYJr`%Cs?p^uAJ)vJKhxN)LM`eoT%`Z zQgc%!N;$b62g)lAH`fa}0{S+4pBK2%+AtxfLxNDyNODZPnJ4(4eR)SNUj*vPK*?m; zq00H7g@{CJewkSN0LW?qkmf-EvPKI(!~`(&t5Gd1tL3ovwJS!3ANEv{k=?8t!xkLV=XHkI^S$F_Jf!81bVP@xam#SjGISY=f*~ zj+u>`Tw+2ewHo=Jh+Yc*o}29SN8C=3_1v0?oo+$DLbzp0+>POLQD zct4ef)YvCdW8%{Vr&iC&Ci8>G$Si3Aa{9xuqJRS^x}=B`lB097_So^Z@@H|E;kuID zp?8siWMeT={cu*R&lb!%nCryeS_Hy8+JmEc%$CP&>|I-j;YO1i%ux8LFqT;Z0$|?EA=ggloC3SB4rqg`!<$?L@v*ttQ&uKozhok3DSp0+a2t`v9 z_>fg#q`6u$s|kc4PEDYdcGLtqnZTxFWR|r5WCABy6F7|CID==Z8I)&x@MJZG@{D#s z<}jzVo+%YLC@KU!eRF$%5 zsi@XMMd6htT4;pcvU09y?h{$nC*qamusF}Lq%6!oSXYWI+1)HMou8+*-bIaaJZY`V zNDDuy;&DLDeBH|73eK)RF?0cxtP9=|7&jLoqf&wz;wRW@>JZf6KMRWQ!H`PDp517c zz>3GmlS-FP^myoA2NoH!QFZ&~S*jEm=BU{w)b z>a+!CnwNw81ETw@N1mWVD(?!qwZ~Se2sTg>!v88^W-4F}!4xfacmo2(c3R*Ks&0oI zxaezMgm+C40?7)bqbL#1WGWy)@5mov+EBd9pM{hRTB; z3H#LSStrm_y}%tRxA?f=IB&HB=vfBzXnM;s1wFwL-s<7Oyo0$et?d9yhrR)LIZ2jv z348lh9`vRwkrqw578@VkF>}zNP@Osyss|qm!teZAid&Let?fRmR+rZL2YN?qp(YMo z01ffQ4s#)b2Eaoh3P?&57D$RP>v;tF3M3_JU9-w7 z@hER9!{iB$<_$SlF#=t2IY4RYrYmDORJ9YERV2M0RO6mf48;+fd)(fLU$35A5cHuP zFTi;L*+v<$d9bq>1T)8!YJhQ+Exv=lMdnI`M~SQmBB6{;Yxr9Q%sML2PWm`d{g!k8 zt?Di7UCgRxaN}3n9qE`I`K+DqzsfdDB+6GlYKMK5>HXAoPtS@k>En76D|iY~Erp+8Ul9jJ z5lH$1J+ex5(z9056{8*~)y-L>WSjO%VQ{pC{}M}av~#J_>nI(b>n4lUZw@}G8HZ01 zIBqxJg{=@&F2hIlgb2r7Vl-wO&O~7#I*r#$N{lPAjS

Bo%tW({voZD**0xr`r=# zgT?^z73>6`GjH3SOd@d!o!fGevco((d>h(^Qcl*4b?u3|fkN@GilqtWTRmyw&CHj< zVv1_og#?7J7s6gJ#3_CZ1&Kid@k@VYS1cGr@d8ND8EM6hoD*vp4-`g948?LksDjM~ zPKQ5|KW=aP+-C3Tb6fe>&c9XsTg|_F%{vu6<>tiVR5Ne2-hctM))oMWAY|~mGxnAA z)Pe{Ov-M4T#yiyJ!$#VA8w-3&CqQEx_u^ay?M& zvn8H1zoYWPc#7VpBC$LJKHs7N0Uz_5Jb;X4FcE#JK$A=Y&?J4q!q!^D`&oKfG55a) zrAJQ{P`W+^N^7N(zKryqVoX><9=w%>%GhX8wr> z`rb!J>AU$$UQ?22fuxpA0xJNM*tHT9#r*a((b!hT0?{!yO-Lre^vZ$OgRN?38rfs^ z?L@zW_msVxc>`J3|mQ4egS8+Q}EVq-0o%^w-0zsc^8 z&QR;3R^Do;Nnzt$y3n5_OquA>SyKKsk*0WZ~eve_V=?u;GDC_+zFr{*N z%41@@4|Y)0p77zUB`$xMIGUl+<~@4_DBO}+Q3F;v zWqboWh~=P+J% z%ZIeWXW&1&U#`c%LFK30GJ71nDrOX-Q?2g>YWvN82&JUELUbmr2^mVwC)!=F^B^gA z9Z!dAZiCYp&O@N-kU5jO(2zT)M6>rBwRWY7@(fA~FSjG2JH?zZC{1s=)}C#iEGdqS zYRGJ&qCB>@5vsR{FA($TX5r|UR*st(C0ju<2 zic@&Bw3(p@)FzCL_L=jP zNmObRZ=1pSPe@ZUuvc1|i8jo24>G!`s1Pvtj- zhs;qt%PKE}UvukCL|k%QnIajXA>S-ZCdGf;BC+7yhA717`NNDykKC&$lSEPYLFDrgO*{hGq|K#Xw4Q8faH8!zft1|gX}#`B65F@Hce4N-h~kq^7ECD=kFnXZhmlZRK} z>~4FnZ417=J+ho`F%`WndPx>u5mArCxLbUpziEr^nC{GguX)f3F@Av@Yjbs@2&@q* zWaz7CIbdWLC5C&`Z;lP=vg-u&&95Vx6`+rA0q9EvzUMPXUIp!n;$_|qjV0>~ zp(?uvaRhpe6A&V1-pzhmuj##QoEK~+Ie~Grh++gD8OSu8ghbK6`$h_hEh%!eG!kT_ zZVMB#|I+;e7b43ZZ2d(45U$6S?dFpV%Xcm|+STW3ciqj4`J*0Y!r19Id=-JFxds04 zrtE;@b+dIK8PX8F;KY2~&TqS1ZzAqlcC!#mv&=bU@*A@u(EI&O*`>Op->g#QfOe6_ zG&N+CdA00eM~}JdZ6PE=BRt9N(hAkBd@AAaJZ?{R)!>G_>YK7A0BxhEgP9xTJm<{+6VbWESkV3~q zUqcagB#E=pU%=8}=hKs$^>EkmHD6l(2!`P5)RD;-VM=P&F%*9bn`(%dUzW=H?g|*s zrnHZON{%|DW8wk3$3*fQ$qK*bz&67ZnR2{`zz~FR3Z4wm6BG2XBQ%AW0a%2KDN97M zlyKw?P2duR&!K_*k&#qs9AE3f&`E-5*wtIjUBXy&*VL@YRU19gCF~6Pm~5!6V5w6pa%dw_U{3{M ziG5ycX*2MNaXgf!^%39lseHhhM;y!r@-u*;jO9`=feohkD*%-k@-$Vke} ze5D+K6~x)2y570u&BO)V6yw2df-|lXDOrOtCcxLk7+gpURZ?q--mN!c1ie&Lh-opJ?h9-EU zb-CnX1|Q|PHP5V5lW+o)qe>@>pBgB4DpzOG-|x8S@13oxZ9Tj>+h6le{HqGXZRBfc z@K@$Dj}4M6{wlSgpH$CHQX^jqF$DMDxk?Q+k>7CVqw0xO5lks)a+ZM3+#$PxMbG#N zp=c|i&*}z?Tpk#MQ^ug;L{q?vt z=|z4_4;z9ysH-4d_=G_fb*PH0{uolvAEX|@2w_OhkF9!sBJ~_*e;ifMcA11!=gw92 z4Dbj-*+&bPQxY;VTD(YVg_Mz6=SX$GQQK_~t47bbbnbTQN)S!#fJU7Pol~*eZA0;f zizpvdTq70JLeAMdaIVlqnKS_bWHYBpSFyxabwizWC5y+Us$Z6=o@GIeo@&F|pXtAY z_A`4-_OwMb%AR)19XUp)IqDOjWv5xgkN5&$FT>e0%ClBx&iwFWQo|~Oj@0?@)F=0W zQD0(cN!jBA?H|?3-9z(=f8Egh!h9i-g@)lskxtK+65u#DEw!j;tLLe1Uo^DB^mGjB z|CLwBTpI_Vrrv)Lsj!u0(D)4E$rPVIMvy_jrrlWp6*$;`uijX7dm~KMyb)-c_Qnw#`OY^oJT@htZ}a%*ZP#(mdpv($#JO>` zkx$vl+46l@M9R6d`94g_rRyD3r4%FUAQ)mH9}srFM%tJlXSXRF$?Aq)rthy+u{@C!B%2hQg|?D z3M5gM)^XQu2ymrSX*>T1efB3c2{NcFEU%tg(zDpeF(;0qF zhE#RhofoB6YhXR8GoOE#y7+Uon?GNfyZO_VdHkE<;?GrX{(N~Z=^f2f#P7Esuzr6S zvwnZpC%>Prj5J%n_dH;>wA2%6?o3+hiL|+ywA9lrf&6Bv zERZKZyggvO$q#Qa>rMUKZ13BAWTkC$|B{XKRx<;iov*i;ueW5r-jexx>))BLw^H-< zR%*W9O3l|>|MU5J^qBLt;;qllm!!F@8Oh9-q#Zq9k~U<%R=hQMzT|CSzT|E2eBs`! zrcAKI0K5q(a?&pbvKM@!AiD#c#D2+={c>~Gelj!zG1?t>@z;WE4ahDU4B3)l@i&!! zui9zaEteMYaJ7p+UlA5NkAE|Y_;VG6gQ&=AQaoi41J0JxbPI^yYP`F&eX{Lc=Z?g!)DRJPA!O# z5RdTJ_G?9a%O0tXbRyqvDBqZN4ZlS@%bqxX$ok;Y_(*vLM;B`%Xd`U34N z|6KV%?5My2SV^V>yS=vG`4WEif$qtwaI<_po@Rr^{VoKR4#-c8|wy z!IrqT5{s0Hqx9-^PLORVPj5M5<6&{0Uh@ZeSdt9|jof3qS#crgNj!36!7;iKmF#9; zHEEF_%QH7O=#f835dsDDknR>9d8lEHA~n#_V6^ERVo#ItM+_JjdW408A&NJkJ{o1p zUD(|=!qM8ypPfO6&&87P5>M29B-}rC@uV(Kg&h%3w`aWMfZ7$MokUkh_~Q~!?4OiM zucu0E7Ok~aFsy-g)gHf;Jd}s>JRKGO zB-Lhl)Lm}0p698FYi$ywGvS!<&3Wn=3y0nKjM~`<_ZmHR+eY=zJb2aaIjRV^EV#9knU&{(_ zaSlJM=ERZszCVeyz~OE^7%cWwRRoL7-(QgF_knRh!NG24=mb>$&<-^MJB~o43itdw z=`t*h&DQLT>Pd3pio{=g@CyEB1#^8h`xnnhox;*ne=aXaAg3Bg7P%~+y*$a`nvWL2xfa|lO$e39vgmD$N)kLFWg%I8D5 zroC&Av9Dm<_qjXXHvALAhjX;MJLwUDtpP9*z=z{FwA?`w55cR|+XwP?7)zwbdBB?D z8SuMJw=XL(Iy=qmHRxdLN_1mEf9f?j0{7Qj^YlZngtxdOQ_GaUSM(*ybk~V7kuCn$ zR6Rmz>*2Z*=b(y$xw`hug8sxK+T;BFoirz92C}(Z*_d@DlJ9A9bZC$9w>2CernSmZ zrh0s(ddSjRr|}TKfIl*C;&U$yW#tyZBA^i2bZSDOvdgSJXO2HznCh;+i@IfvQBWc8_E9*3K*Vuz&!po4s!>&$sH&<6Mm&vJadFirOB+-DYh(#%{@*(Pvvv03aP_~k&UJ@BXPvKOdDS}q0(k#_>->LtKVLiM ze`%esIrKT}JQm@IT4%2B_+MCOqh%I=Bl`MqXQP)mS{%T+Yi+<#LW!)5=0?8jyG#`L zNZARC+X!AD$gy70wq<3GXoX7A2YEWSpkc3QehvAW+uht*;pvP!+MWKS?v{ka4o^Ad zk}*%DQAZo@w&aiw0QO&ocnh!+X$$$gj91j&DgZHPJ-yNJL%||>H zYqvq)c@Dka`L?5DL#!_=T2Pd=#e4QHPxA&2>v1Q3;Vbt@M|}|w9rZ{@15v;9&Tq5`33pT{C4|2*xRWr=V&6t5jTsef zyJd=Y2djwG>*?6t{JQ4pd^?*C(cg{@%^y`SrZ;<<57=X`=QMA~&Dx2zguA^+r#JGH zc+zY2#!GK7sBj}H7`$F6Dn2t||9ZW|7yg**MU1Eac)f&U_|Mj>fw{OmwO+bfFcA#- z552Dc^Hrmj&t0|qk6yK*Yj#veKYz`np95>=|NpyYS-Pn z8=j7Apk+gQ7TMlUN!esd-73_R9J3Y|++^_-${=$Wf}lzWhFnV)YJT@@(coFSC;a3HIUHG} z0>x4CYfiZum$0%}2XJMpQ&0AAlk0we^fI`X+2cI~*Hh%UXr$1r@?)C$?_(K~3sZuJ zWR+eK92Q<>B^WZ*Oy~;A)Zxg7hA;Ovt^W$W6Mt{iafHhYfT>kmn+AdtJ3pdh4|<_;n!Ef zhGk#TURPS{)WTn(sL>-8BBr+}YH_Ytr0EZ>hv0R*1!u^gvGV6QMPPFeBR$+|?v+UNnGn`?mrt+FnSr2w$(fxQDFjI7KF1 zS7>b~%4nvRIpZU&hwONc^J!Hk-=0T6#RK`?SMHbPqi97}3dnDOd z=9CwA)h%V%uwy862evid4pyO~N9MYwYdIc_JF!B9v2bdSXU{mp)(n?&wQd*!C$ju{ zwFfgXch%QQf;q`LS7IDco;Z~!Jt^QFw(=n*1~9Fcq*{IUd1l$Cvh46Z!tVS}YG%_7 ztvL-)3?mIwZ4aT!NQMVoa;D6K9@~Vz<$T^(&IXU z*M63fvDh57DTLQCuO_e2mAD5P3s>=Vc&ckJ37v4zP9UkTv3gyeQb8P5@g`nsr-eM~ z%XI4t@a4&{O+(sZ`?2o^*rpHhUx1t*E%0#bL|dq<)~~gSNl$G+YrS87FSq>V5t4|X{Urc=hbgfTg#?PunH=wV#7v1iX zX1H`_!=hYDiw0L|Vyje~Im@I%Ils=#MA1>Vqcx&R-mnKWr6RQKXR$zzo~NWT_v1_5 zkInKt=Bd4Y(%ahLZ0ijyM80Tmj$nJU)U8qv-axXDYakL zT7{*pZPMDl%P*p(BvTX@$T!auYy)C@!Mq<-p9s}{^|qU9zZSfv_8Y;*+FOF-YZnAd zY8M3yYeT`Q?hCs^vnqEdo;NRGNfQ2UPel=RFh-e%#Cn1Y3p1bNY26&m)z-&zVTVD~ zV68<&65txM04tmr750}E(T94x6%#pT86Du5%msi}g72D_RpHdMP>?8vWAh@uzRKP0 zzSotMKq@Ymr(yCmtjpIoAyMLK-KHMP31Zl}%T$f?#U;L|U=>eC%zbv(npZt-Wa$bl+7`Ja+kNbufogR<@he_3W4j7xZ9T(zeYsUEMw95@&o0I z^n;xRp*id{Om=1&Q(XZI5h#0yYIjixgt@fD7R*j|D$x`MAPI;&JJ$;|*l}dcV5crS zSU};BfW3@*B;2Ia=h%i%%<|vL2G^s@uoF|!RNyWDGn=Pqb7= zHhV$EPc$zJ*n&5UVB)rU0i(%{xY6p{%r|}7;{~NSzxIW1=(9CMuP@E=tff8N2?dhAU37>&YB2;~-AP~J< zxLd5L5~Ts-ZW|T(<-ViuNK{n?a)|@LY*`9mrT-;4UU`o7dDbxL>GiNf__1J!46U zzW#I?mVfG?afX}94t3R4FOnd!G}>G{QleEuUn~%@A<>y5m+3-th_|RQM40XYy z$xx;9nTxR@`Y3LuY=;K*7evSPP5rF5-Y-h8mBwWgy)r2*x8RXl!6Tyuk60@+e#pw4 zih3wC95XV_4(UJ8fRW9&a;D{Y?9~aMC!Ci| zT&$N1`48Nq1MJqd$#l5O{K8+vkan0Z2ONJFaNrHIPH1~gf(Y}6xPW_jGLdDkO!X{d zh>AJ|R?G6HPsgJY1N`XkO81L|zvZ1G&LqgT;m@YXwl=|Bgxy%c558LxQHLX>*V}%* zm}wr6-=$dQd)sel=3hI=GMK{^H;E!|^%;x%?6%M-tte;3b9MA~5H$le|u0B4A?IR|61a&_c+|*zklE@K$3~a71 zZIC`pm-7RwD5M8ciQ5zYTUIDvzUZR1$f0%Jx`@&nx#3|wLX0(na7Z62==P&}q-{Sd zD{e(b+fo^E#J7exTWiT3qm>&lPQQUc-|%M??`?f#B_O_XE?zy1^2d#Y{hD{i{xhfxwAqA zQm`@nfPnF*-l`j#gCl|6<(9SnmvFo#h#AT4!6IXJtCc!hrIw0$dQ`yz#Kh*?1XeZ) ztSFmWanrKmPp0k4Ev8_wU3o>o7>hdDr#%)|D&@lsxRZ@C^XXekr953|@Xu8#;~fgK zmR2cGh1}v;0dvFo{!xI$QYo+Dk&|s=sh=fA+Hw%FANjg{3H%7h`c_J@oDsu7g8!{?j`$l&8ISZkk6??oJnCliIMxcw0?#N+UE8~#qk2ALP`{M!`S?`7hA5v=aHD@d=kxT>(g8~c zO*e)gPJEjL9Q-T|v|DMQ%Ln?s0BAw;o6$gz6I_7?+VwxsK-Z@<(DnakG|*tSOdtdi zW@N6FJBI$*r8ga}eAze9;+kaf6>oA}gL&Om%j6=B$TDYFU6Ea+!^@yx_gVttrzWx=m4J9Z zAeAgWi$ZdoRjJth8Lx`W+@$RIiKK%x7`brO)kPuhUw``zs_D@qbDScDP8Pq;yR>vQ z2YWUK2t!Zqfqu`tk_%Kg7K^N7aldseey|~ZEcS6o;CE;o;FeX`+#Iv;4(r-xJk+ea zlFc3Wr7m*jE}NZXH=ia!j+_N@I?y5ef36z{H{^{#NZ~VzAI1JAL__OV>g3020 zNSB>*zTiB$lqn!$HZr7db(TOOB+eDPTqsd06;f4VU0o+djW(zBJjE z(Y6Mxk;&t0#?>##J<}Ad++y@6i_4`7@j6Ntm+%OH7hwrh5dJtB%tZ`R(k3UFb=NfK z!tb$-l&B3dTfjqEI%30hbJX3(6hyRg0 zxXdZ^U%*#@*B48jY(s(f%D0XIypvU8sRVs%mMOq}UG;Hjj1x<;AIDuo%#`Qjwg5E5cs?0zgjy&Mnvl-X&x3 zAj>%)g7>Z$Fhrj~{n|i77@H-&EhqZilrNaf zh~-6QUdo`@8^}nlv(h54ln8Yh6awR|61;M(@7JjBP-5b+2Mnr0S?T)9QWuw>)u%Y1 z+;yxq{vXzLP3uq0w#7VA-EKYtT1ggv@Tv^CMNz#fLPrT7=!RC3nW3r^%~wWdsv4KBDltRqc~iW$*rqP? zXR>&JL>c^yu>IO&x!m=n!gOhmIrQX49t&*72Kvk;YN0;p!YUiC7{IJ6h57|XMb*VE zbb6%FjsQ31^9=?!nSBNCrviqqJ*T{?y^D|l;J&)g0tY368RVs%_6dQO|1B7OwQh`g z2nn#UHT>GedgYj(?*`2GY~|}~e6`|8z`@0*GgRT3ir^3#+G&P7Brs7pKlMQgs|p9Tk^eSAS;Co@DX&r~?E?;O&ia zd3<7@_T$EiDU&JH*TPyK2xO2zBHBd%RocYec_F&s37gz(_xm9NNOgPJwnI>>@EFLU4tvUw8`9g?|N@MR46 zb3(Wx5Nsgo{v@%DcY7!Y&0%7LZrp@n=OSl#X*SxCO|*giLxmo_M>b6Y6F|R{gd(Om z^nOcK)Mkqr%Zh^EYN^7MITpOBrRr|^y|$%_{IOs|OVvH{dr?c(x8?UsEmhxdp&j866dd{9$Vr|>)Yg~Y<-9PoW8zQeok87B0tBize9cs)`#UM zXZ`K`5NwAvsoYaB{j~dxbwZS5;*c!<7>!C~SyAF787dhT?QQhm(b>f%)9Uk|`HXtb z8P8%XrTKm(vQY~Uj}7WJ^3Aey6$tK7cNncUhMPB$FbG_fECYnFuX&Pdr|h1#U(*8x z(|6`1cL++h8%{PO(YA8l;?g?ZDBds0H9Lc2jUENl8}vOr^ssE-Qr{QtKS<%vWO220 zF#?F+T>4lC<1P`nn{Ul7tXQvXAJ> zSxWQZvAUuzev}-^JRix=>gT+i1|`Z<(;^ugxx}^)>;Q$%eT~LGc+AigArtO@iJk#W zlh!p{jeAVBGgPTJ>9siFwp2Izz+|Oshl7^pReMT8qr>ZD1xG9{3a=AEp-qtiPw~*@ zD`R{<9EyD=zb=0F^NZxt*RS+b5#RF>A2$&-JRgWkmYKZ}D?7~@bZK>Xh0BJC0*GfW zV`!Yc5!wQZNw!$Vr_4N)1SEGOlf^&YC#%+DuxWqDBbjUXCTQp;#vSU9XD+iGitz)6Mcwt-jW zXyxWPdwe?0(r=)}6K%|jyLmNo?vgCe9ZQ6ix%ymO*XJrH$6j^K-(i3FOq;(O*_iZc zH+H3wllam{VMcx*_+(boOgShsfXW=@5~1^#5N$P;oqa@*x>(4M}4WVqmfuCV#2 zqrUS|tcy>fme9kPWV@7Mc3$W~sU)wfE@?|p%?|gu2Rm{_6aPHDsC5OiYx5*PWOqky z;ypJh;izcB+1W)@9?GNzwCB5@CM}ziI4<~|tXs5rXbMYyD#}+j!=BXUI>ew(p zLHEibIplm*$D?>-iy%)?)!bz6H3+JpwO+=orot$kVBSyR=$sQGCFWm01iU_upT}48 z50j}fI%e`#J2v3iq!8_d$DC8h~C_7sx60)1^>{f)h z&@Yh{x@bqYn|?*Zt{?!CtSZriMek+44^XGPWlPLabmj@siC1o+L#4dMZ)9etMYAEX z_o(V6phT*6^AJeS6Fy=OonZLftaxP1ub~_wIX~iW<(9ydO!qv7Ze& z8h*CQ?BNh0S-zT2@@yPItZI;5RB;>h>IYEmAz07qe|p z72Ib@b%H^=Wi!hvTbHj4kSXxG)sqe*K~=F(r<>C}%(LebDJLgCCQ)0=bE!s-Y2^7^ z>fI_>hCBGciJsJ%iHr;wJ2(&TaSk(dz2-dmWLKx$uKI>4crUqQbF-UrnV zp%*zBp%)J)H0i_BNY3==N~kWd9#}#emiu=H&!}~FD0zF~v@I-Qj`=G=0z$D5{&u$Y z%^32nN;G)t1mSG&?*Vci;`?e|-j|oB)r(PhP+n$8Nu%&}o~gVl?&1Bp_~YyxIlqMd zKL-6W|Ev`Kaw78uMKj#|4Jk*#gp?J783X|m>q6lLC4^xz-jhp75lTCOf;a~fW3LGq zIj1~AFSu;jU)k@k?B!Nmp=9>#fHK#k^$foMQ|-=QlbbIDhvj2{Tj-1g;h}|6UN{Hp z1;6^>Km6kKQ)v-E8QT0}jseB_`Bk#Y0S@CV z{8%Eix66oKcjOloX6c3xCi>o0kia zMGJo+&pOZPvWh;M3aq6PQaU_i%yBXXw#9U${_^{=Xv_G$(l4FgYH9)Nw+8!hRn}6s zRc?vj8Ub?C^%N%1_%J{FwN7rfMA^u|dr9J;i3q6GYz-EeUlP$tWK4|obXCw)``#io zTDbdfoCwi+;irU_d+Rh(QL6n{OzlLKcH*g-$&h#4wNBuI>Aua(5xe%aX#-!Q#bK+~ z<H6b&bG z<&)b-o3AjkC!`%t%&{yG_z|eS28iAgDDSN6$aZ?#?S5t4`=*YL6$}T9zmJj+O3AU5 zOl*2CzT*swu%<2RzXAV7JTrx@yzx+{bT&8!Gl2`U^Fy;a8E`HOUJCM`rduCFZ}^{R zPW|U!pFCpy7tPK;BdOVJllu9yBnG>r*HFRZaGFm1Je`ZR1{}(T!Wq};Z`&B$!7kBH zW>Mt^<>#K0k(Q98J#L>zKaQJMlZCBYxHC(vl_+ly{gqF+&6js>lz4!Jzx}H)h`YQT z;5GTd@??w{ui^d)3lBs+?}qzFE*Z8~EaEn{bb5jQwK8|%!y`P}C9#bj!`qoHZCdk< zXd^sEtz{^WI3!p89yTo-UcA)U%51NuG=Z7EEIFcu=krm3gK$Ns%=ViaYC~AqvtpeddyeBRdo1w(uESM^>qK>Z4UP>sRg_&>P++Y zCW_7VQx%jV7};u$0Jaz&6&M?whvS-h%$N_$~WL_+Xu0Na3pxj=J)=wW%GwYJlXelw#D$=X12ne zE~F@-H@ReXWTK$C+Ga&}7Q&9?f5ac8GLVtBs!bkV)0E;&FNfaVcXYqF$Tt69bSyL{ z0OhDUrCmuhgTDQ#evQUg+dfYVatrp}m|8+4EYhjBRHvMD3JH(Zq4yIfpn@0)_0RZ8 zR}?5&-)Hb}0UM2+@BT*Sb2rndrj(UMtsJulVLh{F$fajQg>L;RTbsCQ)%jZMcX^bJ zf;1xZ_jo&R#92@)z$isRCtFs|3XE74H1r$L+iQstJZ(d=0PrgQ{VV0fP@e!yS8 zQ{VNGzh;lt=A$BZEo%P_{&GOHua6rbxR2BwK$12_R$^0UC^UE}{450@LvK(yRy6ZG z)p@}@60;a=hzRq$;)(QHbPX94oun^Xs|+HepK3I!RA8dLd3 zR**66PmL*2{Jux6VJNePbi7DL^EWk`5i%OBRopPsBYHP}7H_gBR{w)Vs_&nfP1p?( zPI@2a%)u8_#Jkmm^0MU9Z8^W?{3U+ne0C#Ruk_YRmx<<-TV7{t(aWZy=8#$=QG+=um6@9;sa7`7r5ef3L=N zY}qNWoKI^fNCDgwoJ#QEH%4?=p&kR#W%h}7&r?apfIVKHXD#w7DC~E9tJ(|a&bEkj3 z>WNK5dHpPRevMa+Z;yE@UFUuOE zJjQb%qU}UcGylqx(FrIDWYW`;9V4TY*JDj6X1h2cCH~>B*%3Sr*R{|vck|{86OQPO zc6a+(3C9r+!VPPJ=*1Wnb#%M&>N7HV?vB0YRV&$wj`yiLk)slQRi_0s-w{vj%^Xkj zrbb`;nGMnD7&;CUXgNb5N6wpV;L}@&5gbx4N1n8MZ8_C77@Y{?G<}1ooyY|3)q2Ze zA^w(6)YtAfblDrf_|Ya;gD}>I;(F&tXrwk! z{qjnE?eM)nUoa_u@6V-_V;2QsUWODzs1(z0+Hl{Xg89qK^|fDBkuT=Wvzo)`>{z7^ zQp%mR!_)5cwa>B(iDa4lRuDixW%ipf`9-H;`BlOD+=Oq{B7Ccsxlns!ge$wDnJJKf zc)v@9hDG<1XGwJ6m39&bum={&jLx*1KW&i1{!s4nc7^$1No$NMDc)ViKioMGHoe~bDe3u?Rg14FXMWkN3V~2HNeRaLsd^ugYw#0c}HrZ;r zBpP(L3O?#JHe=Vty;GuVrBWC~TKYbDcypOp7V$|$%BWE0iwb3d3i1h7m1`}IHTF#G z3pmmyuC0&xI^tZzhy+2KzBwGr)4$Kzx&*_WRccNYNewgE$AJCerd|LVZRr4(`aM@* zSV9aY^k&i9OYF6yVj46*S=vlb=_*F8!Ltb)anS_r-VM5AFYVuk^cEpuGB&xnHp`ON z=+P;5bKIYB!?|dJZoC@G?aG~?bLB+aySJUwQOEtVkE*^YY~yLZP0WJjrik|lTkI!z zJX+KA9(T46mrF;abt0GD_hE$1TD*Q0sob(s_HSb=t2@#9L%oDv1 zK>@OS1Z@P{_{5d28Ec;_iA|sFfk?kK*K?@1tIj?FBhc%YpS78T+@DVd0d18bE0e)-(}sg&@Y?FKfuaRjq2mc4fO}PR22Oo!LgKYQ zig`sW{u3zOp|T*3hs&9G;cbpuV^IbT0`30PR4E;69>#wH*DRrcw(+6>x7c&L%?%hC zcv1U#S>{0?t$-186*h>#oPf5#F_M=GucJ!=B-5wh+#f9%4RG(Z!1^oR6j(bX=%JW* zt8@ax0nRP}fjY6RkZC>&e1Tjs2TJSDKO^Hon>&|6`}|G*>;~gK?CpXliytid#N$vc zgsXw97(qTTM* zUXBLo*+sVkDk4!7>Chk(3?-^p^Ew1xmJ#c8kqe>v5TG$dHfVfg+^crkP@owAnY$4L z$lVNpOe_U5JsB*>tuPj@1Y}|m+6q?+yl^w7gvWE~;ZNCir&LKG<96x1=6ykdh`>eZ zEky0$88c)B-~F_QYDQ}OkV^Ev^Rkdo6Hl6**+aMa$L;cwkbsH`6Cs<(SCxyq$4wd z2FGm<@Oh7!7&$ zbh4b=Qcj79)LMz7V`SFu3N>644+oB1wMo;|5kEPU7#ER1@dAW;9}9CUXHhx;*v zs`n|Zc5oxc14zx-Kqp!xheb2#lZ0~8+P2E40m77!4QoX#ppV181jWn*eI0N7=Y(k8 zeQUlBDU{$L2fZeg13JHo}6riSy)iu|`NF4;1*Ys-Njd`QlP<(p= zL>e@non~ZjG{5_fb(jfr%O1rMNL|qchtT|ni+*H>U$=*!%{ut<$uEz)Pca7JxJPT< z&QQYfY^~K$5BA_p@sl_%96w2GeZ=|}T!eN%I4QjnY#dn!d6feL;k+Bl2U={myB!iq zwv)ugbTt^HjB2E;Ix()v9C`C)*88SkS3~f87t@gOOUA`Vi@`9Gb@lV;9 z=fS@05>@_u<*0|tkkCV0W?HppMTUj@v$eY(qQ0s*6+wqFXFM9#3-s#mS5bTDnzc#3 z%;N^G#pjFOca%=pvBH3{Sz`HaH{V`}T=8sjMC!+PVV0aZu@^8cZsi6orLb#zH+ZYB zU7|?^>$`_hvkf(*bP9-=uNGOlxKw7V!n01k3t>=+N1a?YdKqdS=4WIznL~F=CG;De z-0EbplN}cB$LTo4%p9YKIz4=Ptkkz;JOqroP~D8`xPTAPl&;E}HQMO1Mte64hf zSkWs(8cx6i7M{{tiE%5q#JZi$TXimq5Lv`MvI*QDOT5OV z1)i3V)asmx6nD&jBb|_bFs(w&vzXg2XH;8+-qbteA|wh_Kcd#-c)g8_H$;}FJvI#g zrT7ojBM^`^&s#lFU-4zHF~!NffA-tT2@bdX3ldeV4f>*MeV*h5ksHs-uCs21|H+x^ zAURI4zubGK*TffU-m1lR2|__Q0=F|URV28eq3*izve1bdYP43!s+anxRjTwvXQ297 z&V1IZYJ;1Vh&7QHh@4lA(D<`jsg$vRrO&=PyW$D_?#_$YT!2RD7KrE{P3v>rFjMw;Rb>OD1z`p$OQ}8$BX#zo0?A zddx3*4t>eWHt8N-WFdZ<&e<+GmsvTNOHO5G77{gJ^t`Fa9tlb@o*#d7S_SZB1pvPV zJ{r|nfc&r+D^#5?2-6#gOvH|0GnTD-v>--U_njEl^psh$e(r%8);$cuUbM_8i)Sg5 zJoWnzd*~0E*D07=>FAO=AT#+#Ds_-pF~vdPl<6 zS&=M$_fI5>)nEAIk`VTch4=B@|#y+|x&C5CjKd0ncWEB@_zdh-X3BO>Df zf`g|5v1!fUD3loA1uBqL2Zx!pSY1m`KcL*;ak^7(4UKxF0kbe17O*12`opCtH?bF6 zn?vOhpDThzne|<)%lgRIzcyQa+KGV~jpZRUC$%p!gN%iV9%)GGbMjUw9pNpqTC9Ps zbY(dloibUyMQ4`Hi?oZ8n7s0c-7&mw16(t8gdcc7wwCz?Ad}8Xkxs;hEh=%V`E^-4s`;^8c5ChQ43C|*QO8d54=@phGoh(R$ojTjiDNd;@Te9I) zKn{r@QB7u~7bnn-1RU&Mv&-zx4)ZHwK5f^p6uM z$XO;B#K2N0W7Td>QxcK%ysV-&8NkWr(`RJn1@zaS3@%N4-6*`7@2dO1;xkj$G^ppR zq5F-(DU!o7XOf<;Bp+S5maZhuhln=6p$dlRxy$PLY}L?K>G@W(!0Pz~vS)0*&ENJZ zf>8(oPSJsRKl5Q}aNp{|^Pa0}`|P~`kzA_de=j}uyzd?+m93I&1M}WVW_tgV*VFU< zuvMDge?^+zZQf4;Q*O=sG{|(a-$Hho_q!n-k1^#(jl(EBQL1A22dtU*sw&kGteL-6 zX8yq4sR2w-T?k%3Xy#8)ecvfL2Kt^uK05O{>npPUz2*nw)X3@kFUd*Y-yk8=_iw|l zll_lm*T43Pz@zSX)dCbtQkgz_EZdc6;W-S}Y^RDy&K1-Lh=j6nD=#)LmrVoU=24xn ze2MtOqURPfDOJ`e{DR~M$_mUz%7+V!c~4uM4BlUv0}3hiVI$wXJzGwd=$MNzTY$EB z>n?tTIs_S1N)r6vXuZ0U7*awjV#8IzC`1#r(V2MB(9G{rUKYeH;}W_+1r=4K*qu4A z{T!oOb{Nw502n&mJ+=j788U%gXTG`@DPB4~j2s z({?>N>EWMA!<}L&*4d9(@RTjOQ47xTzFLOe1Qr|I-Id=Qc(tlIZqQbj_tmNvV>_J7 z3BoexL!htw017Wruns9BnEPPpF@8ZXbz#2G3HE4)|BfKG5r&TjPMg7k+&Vh-zemq;?YDGU(9M;uz) zIVzVzm&YO|Eqtjgcg%Mn1u9<#*dK3H8?34;H4+~qC7d~+Oi=;6{D{y=uNd~5?`7w%J7MC~FRP6R;BC2;rR4hT9=IXfwr z$R6`C*}#bY_&^=9>jvsA;hn75|GqBxH>^q7mDO(qeTR=%uc zSW5sf-%f~9{8MjDti(!or_tTn@AN1#Onaef5cWQb2TT@EqGz&sc46}KWh9M9oBW7> z)*@vG$s}X1^F2%+k16j>%MUz8Tv2_>p{>+gwXjTXESgeej-z&O`yxbPi;DPH!atV^ z%;&8-Cp0rqy|5(Y8bJjQl6%ZvWLf4M z8Z~T*6(YgVYYr^-c&iqv{$m^3l$6~=zV)I_-Vw$aUEu*~{BtVdJ_n*iH++gj0I`_X~aG#lb7vRNVc24N> z&rJT3RDO$){RMBI8SF78e^+Yqz3t4sQYpyD<$=f$-D)8!cN^O*ao6=o_pCJ-oh&}{ zmud|z?_~{M=8s{Ex2nplWpEE#hClOJh9cUYf@5{;7^_f|UIo>u6fjg6+hkGLMzSL2 z^TnCfxcTVSXcRfbEFm@Krd7Mh{ZjaN@GW^(OgxktTt_Bm=?FbfH1p}PCpufaGNx~0 zY#ZZynR(PofyjmMdg8s`N34=XLw^voGdg^tP{Rtid>( zxa{EeAyrtk&2aOUp;d%c%`5u+;paG+LM9i@1`OhE%xnylAA%e4cOF4%-=#y*j13sj z9?xM2=c}r9iVML8NCv0aL)3JIUY9Z{Lj%_FNhLJwmEoNWiav})OpWG0k?S?r;!AfB z3lLuX<PV2yYtdaG?Z!+{2`(f2jO_g04M)k&)3*ErHdWB++t836t~`iEJ`g3NOKx^o zO*|`fNFCQ)ET=o(#?)4?F&E>xoN})NSmz6{ihO!dWQ&IAQhUJhsi$ofRM$W6+jTbaj8FAVDgKV zp7~osxuY@);Z6LuJUn~MxJyMkjovc`X@cEXZ;Zh0V>+|M^IEE1p?2JJ6_VQacWuXqWt z*4%$#=u{jou$kT&EN(Ew9Z)2EJIoJgF#dCD_cWVd5?oFk+a(1mkT118Y+vZ`bad(E zdj*9NSZ#y+>IZw}r%@<}1@bftD>3<<8yNSt7v0l*Q7%CBn%{`Y%%OZ(CldK;y&!a= zw<^>wLMDP$q@x8HTM|`f4TzBWKIyaHEs1!d__JSp;>e{a)g3Cbh56DUX)jRPC>RHW zK>EbN&!qb`A4=aXVr~5T12Q+r+~7CQ9y}FsLxy=wZmu)%>pIA4oOS!@r&0_E4|6%q*cxA4PGef zq>~v+qN4VTp`5B2SwWM5v;BmtKL8um}yyzfyfYD2wX7MF5*_6MY@p#M5GQQzi6=JP7?^>DpKr9$e;M z3+aE;P9_@?a1F={67Yo`kRR7lH6&nwkW-L=yA~I?t8OX_Mx~L&ooPBkRZg9%?#kUr z|I4Iep(9pF#X{8ue>H@n8%#qWE6v#WFkHpTfpg}HxTWQt2V`oEoST-XaSlQyj7IyJ zFwfc?o`HqtWbq<8P4|ya7RT>X-9LfuV=eU{(;}zMeDcvR5fZWl;;C_7@@$0zCODod3Ti8!5CAUi( z>EV(vy@K}&-rc-&jhNoZdn502d7rC0o+U{x8&8Ded0u^%9npaoMEVq5aJnE#s%hEK=dU-?MsLAw9lMdK~!Q=_DRCk0r)P2gQcP zJViRVgd43>9ei?~06-m+$p0fPwN4g-ozThY)M(CH0mW*&2;%e1YbdM6!2y>lc6+

4OeU z6o)_lG<1A-&PuXa$(r6a?%c3UR^+m5m}Nck9T#gDoic3R`@cmN@C=`fj{@Z}NDd9t zv<^>+r`_wU&|8uM1ud7;X- zP&_X2p-OO%2c(grDnn+;>TZ9Z4? zxSAdy+P&j#@)h%UI7G|d-{(OE(Mv-yZ;54y?5RZ-_?I5|mtk}aB^t!2Ob_42Msp2F z5fwZ^g*=^Sag==?%=-=o=Jyf0s)B^(f%TG1U8OW|+duQko=(0eoi&;yw=4_qYKW0c zB^pl3B&t7t>0*I43LXL$1sn=k6mTeDQNW>qMFEEb76lv%Sk&hQoe6=Ah;$27RQh`_ z*d?K0Nin>h&eQBMAKML0V~&phFX~aMkN>6~W6N0BW82L084fOgMmMcw-xV;eqjAAVRGcTPd`Di_UM^WIMu6-#!5!?r}7!Ng2t4 znHXIqtOE6l+kZ*(Q#UD-U*_NTsx$U+3%tw5^_&#GP^@K~Y#kI%IVg@}NFG|ikbtR^ zLdNBM+9aCVu_abkddzX4pq*9nTa+y2FjIgCW%4g;{>W^CO0ryNS5OU^3LjkI|$yJwwyDuH6) zIGWYN6cT&9xK#2R?Gm2cB)bq;11bTYh$LG^kktzuetSL%1r95Ly?y3ca>?Cc^a{|G zw^%~)aet$oe&e&Cu_pfg99Te&m(v5k^9!&OEGGB4=cgLdCU-EcaXb;)i(A0o9{mj$LV-2y3U3%;>0iLlNO6JCH7^TPW;$&)F#R=e$V~D#%8}%o5lT8*)sX9ZR)LfGjK2>|c$AK^$C5RD~ zE%6`c#79)rht4l?Ils~?-;8|Dftg!#LIjD3i$|{NBY%A!RGqbY<>ts2#^tVtGbVizw>z2fYg@_ULP5#>f_Ok6+`kpiU_2}E=&^gHzo}d!75iac zGM|~7INE?Ws5SLalK`^bBl{J)Os*vBYS~alq4?xlR)p_Wfo`GrC~q*a+g0n_2qg8@ zoDjaS=GvU_L{7Y1IrRLV=7r?}UI#@?O%Cn4<9*8p`<-ijdH!=s{LVM+Gz+@qkf<3M zK{+*%2mK^e`9(yD_62!9bLX=8>t5~+B8t(;JN6dNHTzj9mQAU>u+7`JIQN7| z36vn339zwPL*Hmxhj1^pdR8(ratAyTqq1;1uHp!8soM<2uaaR`_5_nZX6k4MdpKQu z`cGwM-KqOTjd`5)v4@X-UUI{Mb6KwoOXCf1cvz*qLlzeJRzJx~@bMtYe0TJ~>5;Q| z!=tj{z|Y@eag{b4c=~-F%{{T?(0pl_hqS$Jtd5v#Jaa(pK*q%(_Lb z13}c^tmx?SCasgQm!=K0B0i5ujodad!lMCNCe>Ji1&Jx zFm1XxhZORXg*x5k*p~}3!g+IfcXPCD^kweEa6ky1@mm96H*4YLMI4dcB5P5jSEj^; zs<<{+@BE53_#uHqm;vpoS#z?**06cs@tM(zGTKp0snJtnaT(qnBO#Mw2 zOChRQDbFfR@IjG~Y@jr5sE}~BnByeFP;!n^1wk!_79sZMl&x2}A3)_e3W+_lmIu-g zIN(f0JrJqlFjt#?Mp&I@J_4yL!^KMZM2>c-nVKRM^B@ttShV@nB!Fnp?n3f&#E z5}reK!}ZD!pqtdt6J#nryI6Xxo~x~r#?=T()oUT^{d+9iuI#%w2m$(y14v5#>KA=! zWw*`JVdYbCCvNy1=6IN^f*PQBp_Y9 zn-c6bI2+;u9bNTEUply?(P~+AtxHcH!tKE1RV8FW*rFXj{a=e?D)39OrI>wd?ws)M@y)NW zZuGXqK{_WZ;X3y1RK|GaxLilG3Q#G$WH;+sd2{(ERlDqaRVNqti_9$K1RPpG|{}= zu6ZOizq|FEX%{|m54vddMR0}&%1-6mADfm*Zo&0f?lsaU>uySY*|iQ_pN7F)F}S#o zn!l?mOj7mL;)@s0#8J<8n{R=4h13EJ-$>QFuAcVoF~8*6yQ2IFn#EmGH||qPC_+p# z8q4bmm4{HghO({8p0hPVftFSH1)UUXn~1{zNK3Jgn=Vcue3Ci`FkoypCzAlCnX!?= zB(V_wIMpaFTRPd&#s9Fo$r2vGEkX58a6e0?g9|=(b&&lPPF}qD5qztTks{;nCHT#Q z&}(HjkEdhjY@c2>=)Jv4tq(gI(jYeQM)UNGGNY*mQo)VI%w2r)ihF?q$V)H5;oS$r zea9{MP?Xu<8Qpo(XZjz6)0k)3`>}ZcyvTAEB2zClkxqDl>p8JS_G(bN_@WrqM9cWW zC5yYOq-@Xj$aYK6#G-qsv$#hR^4d+z?V{p-TRY=ECyTN!r25~#wroWJ%s|{C!vKMY z9*a%YU(K4e=CKtYq>HCAl4uPIC$UI4bUXMH_5hs1=MdDZNAKu$gh$#r#ekycnhPVp z`>%(^+TviDg(wIT!db#2*^1a%E{#6g`m<$9715aHpl&m@R~mCfkg-&2>I(TC>t+pJB?7;oDM{c8OCatf$B3J0fb2Iep$TLz|! z*^GZ9TXw$%Ba}_CSmC2mVyy5n%X!>#p1{fAYt~gmxK9wsG2L1Hk$>#1<%@hTIoNt*-n)x?1J?Bdh#6I`*o0%rd3~RT(?R9j@dH-GAW8__q z<5|VNmy3qb%|rPMCxbu!t?vAw5deB+fD34EFnV(y3GyOWng_OVd-fIqBNhofF_V0^ zd5eIED#1C__{~S8=UuL#6O_s*yi9$nflzcThCr~d*{HuUAgL5Np1nyXdvI!y)f8#^ zP^&lZiyVs>ITZBmC*ViYiZZi~TG<)4Oym|m2+Us{nDzuakFOB<}#%=-glD=^6@{%Q`x zx}%Ykd}ebq`CGbZ?RlYc(oqlCW&jh!{wwl|Pz3bI;(V+o4>E z`d@lnIn7is<*5Nti%_V)U=fI%Go?<=!(b`buBj!_JXW`6 zo<@xpc(FHgf7@)Wwb_cr&`s;!d&hzdKN8Zz9QU_zLh%Xegs2I6-q#w{R-p;9a&+T3 zfktBuJ=^@^fz2PLnxB_OY7!aNmvrN*BHg&0CJs{k5xEw4r666{7O-ii3pOm}5>_F9 z6wL@Va!JQ+zegs%c9@<$1R1g*SS01!qp6B6@Qv zJ*n-|EfGGb)d5I!O49*}er4Df>HgXh^-75-S_J-XzCkVZcNRH}K&ci8Apbc~-v4mi zfU)4D*sCT|&EMtBALe*Gm3Q#wR}q`2j{R7TZI5&1jNF54TFAhFKBwSY5Io=Y2?ZoP zv^#p)h$4VeYPd0VM8eGFH8gj3bk2ycETr)$NV$D>EzZ87F z(8kxiRPd*JkMdH%&s88NntEmgpFMb;5YbL0U zJ+V?sOR^XKogH-Rc{!1OY7XBHk#56xs01MS176|FH2Yg(+Ikjm*jf$8t{)FfM~0hy ze~~3@^wNHF?-*Kb7*=1hDgHJf#T%t6g%oP884$iw`JOR&z_SXwp`blAl+ z`Tlc?u0mGGf$pxK(+~)*Me6DRy}Dr*ZAv${u4KX9t!!9^t1KNQTA`8zJser0$dy`4)DE-PC_?ILjhg3XFfaud z6#i%q5mB@FN+>A~i#l((M}ko_waaNShI@773`NE=yEr>Jnu>o>M+1y4W`#_&vE7P1 zUSx{Y9sDrV(A@YZb)fdwClA%Ihc1>8^djLNzJPw$xC6 zQC0Z#Xy5qoxYTi$rG`-wbUZvC|G=WT9!{R%Qg#d5#1gBUC3}UFy68$v2vp2-H~g~- z!lmCBZt1-TK%yFJA&eR$xqOs1?a&%8;>(xb5T7cl&rKgOB7WoBE@Wb&U*<$kF|JX} z*6GmMU9mHnEUw+tR&QcL%X>05% zmsfjmZS2e>bKvm3#+LIC_C;CVZYfZryJ^JrrlX^F!z#qdAmf{2vZQyOr-9n4>+ zCq69I_kRj06SV?oFIgfx>}ClvGCg*tY8}i5m-$k$q8j;Q3tZ@Qm$J~C*2gZ-liJf# z|HV>2rrVZy@C1yO;GC`gO3^BihY~$+FAhpC^tkI4X-Tc|eyDQ0(8}WlKQ(fE6J7a{ z;lA{GJ-tEaena{@ld0o*pT$?%j3`fVPQnP?>+($uJ>;r$`qIs;I<0Xllfg(=e-x0& z_|(3DF^fdnD+zxLOo`a=Nw0CxaBC>#Z)LB)@}gGN^iqX616_&WO>Qzr z9b&`tQy9ZMJr(q{EjU3}M~kc&IK3h@t34yAs1vIjZ3`zr$B`jaM-{WFJ(E~2h<{>d zX)u2yXa0g=LFTKnCFE=+{es;fIHedV(Hh@kOhY_&ZM+BUyDfyZw?&lW#{`68Vn)}v zGV9T2xXR_7W|x#6a&}COyQ*0^G%vBYR62kG4Y3;Hfz&>AD@(zbZjJeW;_`cT%!eRt z6=;pG7?qRa0faJ!K~GCvt>1W)7EBF+HcJaaNWw;2T?6(5^_}BOx5!|lb#<@L;4Q)H zTns?S$r764!n#bUAMXF#^fVBk0VWGK)0f^1>#3BrB76XbYr8M{F>e48rNt_N@*ylr z$yEE|-^?*Kc#f+Zk?F6INGD>q-s|!VoBw(2IAHLw^oEJIKIDoFlCQ`&+teh&gHVm}cBBHs7 zH!qj^S$<*jp9plYE@t~MNeSHU8Z&7Ow#fX5mZdb6-aOC4tSuFoD3lhpRgAV;O5rZI zBYs68rX3XJ*cWrb?nWxaoIsfnRD6~}N9^ z#3f|6GyVu&Z8r0!H9bW*#bBFIo_KCcolbqXA2+}h4TOooO8JkbvJ(`XtGOxN+JU&dK4+m3iV%b<=0r_$og$Ue|#_l^LVE<^DH#b{?`{b#rC!6pZ*pd+W3% z4Kx5DXuszJpZ4%NzjI%}*$wx+ZsGTR@kL0qUX}K9bm=~f5mh$F^)y>~u-^zZtw=dJ zn^0LAWK55*pwO+pvNw#^x9#HL8vT{uH zruYhn&$$Kpr^shgQjb3tSspMr5ncfgb+k1>*l{pcj^r4|B-`7~|3B`nti|Nn`~^KZ zPiyou0AII8%8CEiH8M;>2d)wAmDbFxGs=~{o<5)Uvvt1c#x!#+6Rq7VOfBMGJ&*C0 zY4BBkuE*oDB8|T4t%*l2g?8gOc0)OT^p`R_}~n3|QWC@+r9(1A6|RGF;*Jj#7ggcMYQz z_Ns_A$po8|Xb?n)aa5uw_T*|WHm)iq6OW=5p}T9Rl}AgQh@*|T$9(x)(%=UrFR1Op z>kI|fxEkm27Isod0h|q%uuh=q?=+MU7I?_OjO6+$#(iq(2rE~6W&^ZwXrohNR-j-8 z0q2&0XH(?uyt97? zGNW|}pBr49)d_j-M2(N7Y1Q@M5p@}jDun7d3t6nO`_#8xtlZfA z#yb!U{s&}kl2xEQQzq95g``w5Cw|XHt!Xcz{ebmr*RC|dy!wXzwfo38)^5*Z*|qC2 zvTIkaEdYq`@_cD!sN8SC1JF}1_6a#+K}D4aRNPhXY_4qA8pWt3woi@5dsec=1&sWZ z5Vc=_hDYt!n0U}w|G(R>vI9=HcYqf4P{zO81J3jcm23f#Z@abJ4>PMXeD z%7S%OMh5_Gk~H!GV9hE4b)HV6MZ1Jo9*99%#OUQM();QK*5P@+UVz=#fx2&$D^Pa< zb^S-6u5;F5pl-%MP}h_ET$ZJPItNQ$ZP5LM3;=bZ_=+Ro93fdC_j=^L!>FS6_7#F(@?vRnWgx(f=h z&8B_f>jnU}|Fvy0p{EG+s4LDw4hju8_X}>3(l}fNhT#Q|1lh2lS1UuIU{>_z<#^st z#sr*s-hwN@SU{Li_{hINnc8{_$gr4atmua@(||B>env}f^UO$BS z5fDbDO?JuXem#U)cQgnCD&n*tOa`u4P)6X5vqNGBLKs!oVGw58VG!mcw!VTes;+;5 zFcw5n5QftGA&e^aa0uhIAPiDcK$zNkbqmS>m=u8l0|WDdxkdiX(ovx0%WL|Vj(03e z=MhMlHZsx$UqxmUFp1ij<5bjn0y~GZ)tAwO*~PBuX5p3rLd7<@QykQ+X~p zmp9}r#U_4WDMLRqw#e0#UNpRc@l4;na0s;Dup^S|+=8sTT*Cz}9uNr`ZA!21?8A7i z$h|f0lP~S|H*VerG#INFxd8rg~*7&#eWuD?n7Y zD@nf*jF0pc8m<^icFTjATv5{q=PCtFq2HL-p2o0{+lUL1M`VS+Jjm(LuttbL8Di0O zM^Q(2H^Nx5`KKAVGG)uK8x{s6J0%T#m2eY^&4~}E)0s!A?u@eTT2s6=B;pyKL-Vnl z3f=K7^QNoVmm3kk0$qJ-G+UemYemYkz&!8}`Q^5ddR4vGWOKT*;$}*2*!;s;oFVPd z+AESP@CwS^DfJHt#w<~}R>)y4lPl$t% z{gg){O?er}@27MnSHao6&6(s_Q)Av@s(})v46{kZAOrT?b zd-Q7kTqq4iT2jO(?tsb&{qa^d>1^4ZNLqU^Tb{EZ*pQGRMaXnJQkq{Sf4xev{r{qOGLX_cIQny{)EuP4CBm5giA)FYoTfRY zdijg2`%_Y(U7wPs1`CF+dFzpO6olu)90@@RBK%VGWEAD{#>N(tR7mCajRA zi_iF$j85S{tiS{28xP2_>3&nbqvgF=IZ7?D8uDWr!V;ti)P7l2$~0QWo{kN8uOBQ<~@|y-7sgwYn;7IeGHMjm=l{j6aiOQWci~9`rsH}K)N=EfZo)U zruB=?^b{_=HpfwSiauvO$opc|K+9&BiOsMA*s-n_?FD~(O|;9KI>tQovrKl=d$+2I zEv|Ug7V4R?sY#nqz%KmFCF+IFe~=56>{3Gh+X~rcg;Wr-+zLrpA?P3#-fM+CV};ZZ zve*iF)C%zuGT#a@tPq`$Tda`Vt&m#?Szv{H#|oK8$gNh$3@c<2A>Xz_rm7G_tx-?m z3@h+VD{!eSTu-5H1)g99$|+5t#|m^wpc-k5|30^W9EOmp>0&hu@BdT{1HzJpcUU2t ztPmve3V&pUthPdC67r-K@{|=an~+DXkcTA1npakg zl%H5InjA`wQeclrQP>9tg2Bo>@hcoMEYf$3H%;XKAj4c%gBN@(9gnyX!Hr)w&%94X z7#*bKl(@_KssdESXB;wxzJ{EJmrwJv<;t&%|3k|^P5e8=A2$T^q43F80YA6C&aw-a zueVIFK}jim626YLzLxVPRk`HTFrMJkTxu2nl=v50{%6HM&+-fGG;dOVB^NCs8H~gY zt=<^}K=f>ME(G3RKU}2l9+X1^XYBWf3s8)EaAyEhlaTz#y}wzzkX~=@zpC0R~G&V=zLT?~*u(2_9z; z`dF-iZjm4^<7)gQ5j-Mjit7Nz$=gJn5b_I%-=pGrgh zAYVqSAX=kBM!a6yB)rqj>Eb)DXHt5J#3)-cS{Wq40Gi(2Fi|RtxXsUhBJyS>>dp9o z!?r>om`!b|UcK2Iw-2<&V5|+s+F-2XH)l=V^xL65LN0B!P7C6f_L|T91;Ar#(uA+m z<4-vd?3Pz)(KK8HetLzx5o6hsTi(G)M6bZ^Yy65~_1`J%g>)D@zwMGdhhyl_b(a)i z7w>GPUCjf2^FKp^M@Mj>gR&wkc|@CYr;?7?7!G2aqC%pSN$jnpWNj|B_fZD%(&Nvm z2C*3h_kCRiUy;*4?K+tTD)970K9=F{fb4f9^3-3HGAyCqHmNc`WhsjiwaUB40o6e(PnSV{e8*F>6BO{(82s0CBm;;rq97( zzx#5EK~6Nf%eF9C00-LD%&8%k_)fc4WXx2$Q@$?U5S32gn37w!`mF$xJ_mBvqWPZD zd#>b!`X0*-b&_|lpk){(=ZW*g$DB};nyIs=$KP9nyonxN+*^?jUu3qQA*XRpW+|Vor&RK_~xfcRgv{bYg2h0^C?G+%RjB#ep z)?)KjE3Nq!u6@Q{P7luU6qZX5PUnne)Jo_<#xAFvu_M;YsP*_e=mCJl-%*hoW!Bk6 z8QG%Dj)k(8X@@#-q0IBof?%+TrvWN}Sf8Iy*}^7nEH5Gilv5d>N($;SQt(0We^nw9 zCJys1N=!Zt(j&q^duky!@6@9QbG3UOBuqynLYGpJYw#-f`SKd&zFb~~8-hDuA#VJ~ z>00fXzL4{PsE&ooO9$}ZMJ54@U2B8;0dX_Y-Q|gxC5T}2M#xtSBA3M{oEbDw=;{l4 z_AfkL8{%Ehyq**ZCTNEM}Rm_#o&cWqQFowGbDKw}TML%Y&64 z45&|OhZYN^nhbDY9U=Z>eke zfF7BL6^25bYS==nuz>aRR0f^zqXkk|)?W!% zLLio^ zF#hmKA!8#pA^u%^bq_j-5ZnVK?oM7Tv*!7tu3~wx@?+ie@q#f&w8xsbt5rSW9jS37 z3wl2Km*!Z>s_bNlk?B}Vs@%x><@{BPXK`i7^HE(f*RD+<3x8CLhWn&iPYi?>eGKYQ z$VerfxCGP{19n+oF>8Hgl2V8kty4+AN^XaWCC{hGrqX$MN^LUkOKQ_0*&>^e1*$fi zZrrCfw$KK;pyNXukezR7d$d}28w-vqfysdEzwHnRg$8i800I7N4UaG0ZU%al8ojUa*uEDY*BcNPHMI| zxv6W!ai+d0jw^MUIPR2RoI$C{;tWomCr)1KEOCaUD#RI@8Y@nIYNR*?sbj?{OcjVT zEaetQ!=R;al?KG=e;iqBtOgU;Uhb%cR5K_Lzh+-*1QcweMJWdcE75p`)B7_X>P}Q5 z!IjXKY$3mK-@T@4`|IhQlzbpZiqAEy)H z;qsCjliz1k%XoG8YpzBB3Xv!FbboY+XzgWK#e8^m#{ZXR@{rpcE(6%=PsYKl06Qyy{hQWL}(k{U10(9|j7 zXE-@N7lDhlr3iut%ZzR95{3`gJ z#qT_Rlll4iJ;v`({9fj_k>9)g_VC-suaDo*$8#LV@jIE{nfxx`cQLUy-}5vZnHFa48T!-3fr#x!5KUm(j}-2x1VSug+d$C#xGSucPYRaN8F;b%ESF zyTOjldum8oxl@nJr3SIsliLQX+wF0PotT}Fj3GA4y)%2kZDR{^hvDt14S+2_VuBS` zYn3?z3z#F{cR8&THtugpBsX)fT-U`@!y(%y9-iIgO-18okr1n(8yqq>K_@hyZ=q5# zub?%e?CV%9ZTC0r4S&-J%#*;=3G{Sp_h0t)CBrSoz7Nv>0muw~*2OH!6?48?lgS7t zMNUsl9PrF;+{f6pXNUsrvi>|97M}a>2m)7}FGHpX0t^`pR{^V8qQIkf%b0CHY|J1E zuukWH%{U;{s9GzRNAoWUrAc+RHCzx8#zGHgkQo5@2CNEB@iPdkkcd+AqL;0XMNWlw z)K44O4%tYq?;oTpWh}A-k>b&UY_cx%Ig+K`!JvPSv=Q<`HqLE6NSxq_wRu8KczdU! zCa@)0@dhhCesfXA3IWuF0cSAi!aQ`MVT~w*DyYdJ8)0hSr?kfMW*J`sX3{Dz=qEud z3Gyo)^cvA_v)%S&=|kG^%K+gbS*6g87p>vv6hGcbUD+p)#=${EV8G9Ra?)EGuGGT6LY{KL76buAcgp04UBp#2v7uA)H5gyyB|)m(od zl#0g~AhsGPVxd8mf|?6wC|w+>`lmAW)by$mTh9BHkbSf`a zDmvHUdgS29D2!HoqI8Cw`kXvg2QWyU&EUR%%SBKeAaTS;(5}oyz07n2#ehZW;^mhz zb~{-5qtnHsf?z<~&A;A(o?wajI*vsLKr|8+&yPQ5p{bM69_3BkL-QD;8t5d^gF>Ev zB%395E2M*&p5o*bNC(rHLz?p5g_h1PSh{-BqrfH|v_m=oin4BDj8Ef-G_*+lplLc& z0U4#GDvMh;zv^T5k2TN9R%9;x4kQjmSE%6%A$myzt)ju%FE6Kw#m< za4$VoP8EhTa6GS&hhl*jLv!|VqJ)ee+#QPj;2GvskJWxCX0D~NvA~ls7%scIFD+Wf zvD!~U@kwwO8e2N{2b!r2vy-F$z#_!0&)7I?fm?W?(y2MW0}o13oV zYGBmzK%uX|9}E1Nl^|S>ywJp(U(}+%f^5-W-3P|o%Z4olJ&)ZP^}P&Kg;X(m<5l3_ z4ZUKg3;6*8h4qVYb7QMCEZ(y za?1*O-ojL6?9SIv`ejZ6ZAKeXzAm1%OE>$CE~vMPJBX?>yH z$4*`5KXBpFz+fK63FOu9JT!GFF%|=qVh5*!SO6P@O@I7PjWBZ(n@s@eeVZdv&8 zfTlVZfa4kuMA6NvecYV=SGhMUd_bN#RcHo-y+lSMK0^b8fXuTgUA*XGfni$Xmy~3@ zRXO8D=aqRFCiPE@EYa@ygh0*<@6d>MWg-5#a`^NY755@GjX@Pv&{=jt|3kVcrbo1U zp2L?$OMa@$xDu5r8G^?MVlqDP8-ZUZzZB9!)7HD7lJ#U(5KC;zGS_)imNL#*)2F|4 z+H_CL;tz7JbfxCVN~~tRF*zRwc?OcA*r)}~nYE5V)b?erbC&vtlbJ`O&k$LIjzNu_zkUT(O?eTJH9{sK??qBf4HH}8hfwpH3 z?i(??Kj2I$5&iy^(?&qGyyZ+1gXS3SL1i`sYAp8>6Pm-Jh=Ji2pOLiSW8ohsV!#OC z9dw$&DBW-+E(45*jBrPVfR4ejOL!(=ZQX6cMDYpecb3n5hS78N(3Do7B5%xa#nv9!dm4y|Kg<5uNd;=*t%*zFhdACVzA zG=(7mr*6}Y`&6T47>;|VPd%3--2+J|4I1CC0!dI70FFKeH;vDXLGH=_+Za4m^Ph}? z7QIJSPG%g=)?S24vo3coB1w^==p}i%tE}aT;gHr`xco{KfI+#?9uyGwo4}IQpkO#x zjf#i{$f!7ZNmz_krHgN61#q4pIW$XUXu5ny8Ja_Hf8Eeza69BJGPWL9&Z9x5ANs$w zMs~5bY>N17V$>SJ_EAd!Aq;hf7A}QmE^DOL*CzPj<+i_mM@7@`A1BL%Ci;VI%)&+u@l^TJmAzVcoXA9=Hz@xF2y8d-_=y=4uz3?eI$ zRrq~iPrrFWa05<%5WGbtq1f!wn4agu=#9ejNcT>_=#sZn<{XHo`y!)!>wGmizUa3m zIPi%yi0=$xT_s=Rk7yO#i|d&@UVCgkFy7~K&oj*5So z(dDxSM?EZaOEt{a-q0L`fIyM6e zd65UE^!SrCrSb+9TBMjt&NTzW0lZ|7-PvV!zQ>ti%%BYS4=Grhc|715)VE_w&0@1g zi|6s_t+}Hj0%dojIq{p>^cRv|$6AX%aV0PZ3on^W6Sc-|bcDz6poPrnzSIaME7HZc zT_kH1L2#mwhtnDx#MAe>w;roNOFWctMZEk%8r4y2z`*%ji;gDDh`hmj;e)jo+j+aJ z+w3a>Z+Wq{doC)2=K-){kvG(aJW;_b^8=zS$VL2d>2*YN=&@^SJzr|k%~Y6rE?s={ zWcEU!Bl!y7LJpAIt}r5a7|mzAVeb7rokr!)VJyl^K28#Qc&>mxDqUh&k~MdJ!+2eU z`p$#d6CRD3CatN_E{#$sObR+1v9Z)&rH1~niH8XL<>6s&1h!IfHB4X>P}Tw*7-P9# z$_rXFG#1#NE-nRA<<>DIUHrRAs`1HHrm$D^9UKL};q;1hKg5?_xOuy6+K z?#S^+?3CEl3CUl71*EAZ^EPucIs}71a&jgH8Og>zGKwc(6 zHXb8GI#I@DE^{$p!UD$vnXAl|Kt_hCSdQ+A&PXBdgo#sK1FWf9m04w3ARYTOHL5mjDYGWZZw$8-bFmdQ#9T5=T5VfrwaR1bD{WHlRq`6hDw4{-yTuAq zSt6qt>z&HOGd{8V#))!#Cbau*J{JH%Hzc1smhP-#O8D1(5y5qpay|bxSRL<*2sK0g z)eA10r*v5JQWxX8|M6?~!6YhMRZTo=Wy0z0E7@z9QR|X-FnFV=tYtth%Hyp|lvpTb zru#{9%f*p@++}CZ)$Ya~X>{^40t2+BByei3REolyf7bXraJ9xJD^JH~+MdtmYFB?WS37I1cJEm#bVsq&w@;fj?yTQP{u^xyR|_x+>`l@%WnfexC0ekjLB%Hil14y z(TXQbrD>PAw^i6oN&h##H&V{{saCqeL%&kxeN6w7R9@ubjl<#>U?Y%dL<@h$4Y5-0 zA?F%?Z}Owo+Zb||(#%$v;RE>LWGL=cMb2_NtZF-GBF(sg>WjvGsltlJkD$4PchjU# zDR4dhPWw3O>KOR|1&2yIzXrng9&wiVk1To&ChqQQ-0FMxHKXs6??W@!@MCCZ zwhm~ijOsHIotjnrq_~}RTPLhd?kFBA9|tO0)^;8of2Q={Ad6A-@YMQ5_5fJEx!1r&4Ohi zj_!b7oH~KKp;vuzn5OdQqST0XgkSTcpP2BicFZR0OAb~!dBdkpc9hb*6DB*nIEAEL zCAIU+R%#gPjHw~3966Mdi$NAKb)HD<%^l~U+_JaxIrkG~Z3GCiU6kK}Pbw&D^)>9Q zCzFIYF$|#ocI2a#HxBvsbiCj}2mkUDiLT@FTj-?fmK?9#^=K$^Yh6XyHpulwyYh?; z{`}_X&RqGHh`hv3Cn4f>`8v(~_UNu0=laAhmp?z@&xgR!oaib+Ufvoz;d%R92NwvjM?C{E z%(sexa-d$aN+!iTn!?P6Xp8d$9!JsFfZflT~ZaKHBSx+z>3rzk}Q@YH@=P*`$>#`LQqn|`3U zKF^mw!AOMS#jRKtKo|nkr@YLJ{2Y{QtnTcp)dHx5Z1wSagsue+`i-v$>BR_0?TJ01 zvQKM~6)w=*nuUsLmH=TvMDZ~ag1--wS&-M?wgdWEqR$_-V5H-?)e|dd%<=s`g=Uu3#p*z6O6;xYE!qQ zPO_RuEzOhawWb&en30_qCAtO~o%tQy-Gh~Dg5acYhdi6>MoIO))8Cov!@!RALaVrg ze6eGaPT7?M^mzO{q~sXxsGB4iAcK_FQ!sA1Yz`rdU_-{?nci43f20}|U+lR3?_w}W zF+?|;6NHhGuXxuR%(M7VQ~;r3ti%2z$dGj(=T!yEzD|~Qp(_qPJUrxYkY`#SIn!PO za@p2n)4KJsx|zA~o3YyLb>G&@=GY#a#~7RPMvz7fLpIqj?9R z2+OV&yjamq^7Pm|OY@|^?r~C~-0)SM%>!Bj;iu55Tj`uY@vt;MCYu-kQ98TP=r;ep zS^3P_+&jQ|d57?O+-RDbZ+DYC#r>SemAPFFHRpVbgwZ)jqtnE9htfpYr&-D2sHmCP zd{SVnZE)--5`L+-M6vt zfK7006kSE}{|egcZ|bc1${xF0`}vQSo=)-#);RNx$Q=rAa!nG$x&XeRwLA-gdo1>+ za^t?&c#Fy(5Aqb%YkuvL^?b!IE#*|xF4<6-h~%Rp80PU?WLMX;ZZh0AREq7;>ShRF zyc^JhweECt{iHlcWS_v$xi%BA!aPaMeRzy?xJF4lShv~*RyZ^hfEf2q(FS8|(c7`^ zvF12g5Zlcf9F}5F>qX(qSYEA2q3p_$LytRqv>k2?XNI4{uRXfnRh|dOU-P#cozV@s zu#sZOS%fk~1;Gr?$>aB$#bJvESHbyyI*5 z`xs}Q(|mv?ia`Z{c9Iyr}-K&Cb7@gYcy~mcVvy;6hXDC*t!Y3bzth7b6h7EF_rw04- z-%91?zvXM#CFim)y4M>X?Q7WEd^c!KfiHT{8##tTOHu`7a5$WxU90z=5I|;Te}^9& zs_bw6{8sGEXpK(@P-iH27J+MkP=NO2zs1ogO>Q@G)>otvCx8r2kfI&N!J+MnGb- zQ^F9L76% z?<-%5ceP+ZF&)Tay?y{;$IJbHxNh=i=62qU>oD(Qr^((dHRt|D5sU^iV5bsDDSo9} zFiqKnvteIGwM67r_CsaH{Px(U0L%*@PhG7{oO&A%ATgt@-ZP|b zsQC*ObtpB-+tZfATPXw&ttF> z!W$IEr)tPn)sK-K0RwNlc`MuBsJ&50PP&YN*B%$pcU=+6ye2|FLX?dx1ju@$cix>F z8Eyn#i+1fMKJrYo-5CqK1{3r~iz7ur6~c=`zb9}TXMzm=G%3E+T;!%RFa9c>7Qsg( z%|HyO6^gA@r?Cb1`rC{d-;v~&(YFfffZ$?&0g)j!3QoeU03AU;bk!5{Pkd%tT>FWj zB-O9$TksT`td|=eG;LBTr>j__2b|MZ$T&td0BHaUh*>Jx30T zU&UOAClxtLBtuy{W8^~aqW}f;Gpg5XImkHgD%HWw2rN}68<)Y6i)+q}(V$=~Kx2FX+7!R)*M3I`&`#B);lls-3p){mfl zCrfH(2B6NMW;c--H)LiOnL?!2D%NQgmgLVZ9D-_}9BHE-nV#tzvobxRfUa!S+j2dH z%TKiUepkd@BG{9FEg~oE5Hm%+yihvK#>H5Q4oiOLOiDYd{LakK94sXw#M|2!DOoqA z2CE;JP8g6q8K(@yd1m`P?i0qq@47l@z+fpZqzT~BA|~4}&(mVDx+ciNoh|d{^)m^J zWc5~wPnnWmq|SJm9YtlHXJRNIojOD6X0=H5)$64JlD~r6jdVhu+ZK@X;uH&`6>_2A zrmP(>(+rFOwF1bnrpxKALaJQVJ5txOYi}Hx<4{u-P3J_0cpF!?Q)r~nb0AXMQ(uoi zCw#p5F(%a&NJ7@o+{uT|P4!iZdsF;^fz@+hv1fmuF8;Vo2Aa695H_=Lu0tmr4d+_t z@2tUyVOSF>yp85LSSJwVPAq8(&`}^L19mn=gC$A>n!fw;Vu(=2e53ePEb)!7_z+(D z@@vE_xxUGSohbuQ<&RHw;sPWJZ+lXqK{D2*tLc_EUHnG5Yz6lZ$R$Ia8`}jeVe2I?@WVHVZXM zfG<)%y>#(rwnDUbP~=8pKh2lAt@0&4{UF_V6F#x3O(f}NS}S{+4CZX@nZ~;+^WI0!e zZ=MBq2GJd=(UIX)_a`-m@SaO`7|-@41>nX5d7oBqeXY>pXpViu1-GjxHZ9L`3Vc1y zMPh0^Q1sgU#7A{k4netg&;wRbEnyg@_JhG_?8_T;-TeNo5IM2DPx> zQ*gbYcic1*5w;dZ{4jqOsFvi(?Fn z>C;lWjD&CHZt@tuQX#Ch=f-?0Gtyv^j)gHG`-~!E%4|E?6jhGA^AVdi&HN`T3vd{( zEi$&i0nbSne-q?GiZ^_DPswO$tE&f#UxpF?5b?|S;vXvhT+5#?exA0F@B$+z+T{#a z$$2e_-w;_-IXYAM<_z^Ar!G0T=4I}AlfPu- zwnukgWY&sLK$yCgsWSlbB{ zp2p?30;Z&8$wvuL@YRe;6l%X#ckKS`cW?g{eU!UEBb(G=vUwdZQN8G}ARy?TJPMc@ zFT5BhT|A8$PMz@Ca>CD*a6s(7Ze4qB^r?JBl7?GcXKTzo2G`RXLFBx+1h4gIz#ul9 zdA3zFPei!)a&%L4N*rk`GT5J-#CW&4-ylf-Wd>KBulBIIe@*0T5|2@&aGkW_yOc8S zm&oxIzX&tklF*k|20ln}vKLnp1IZ>`eDY{KuyOYgc%}r#+&4+d$wq39N2b z{W>2nC7~rdRBCg3m%*Grr`b9(X)^%cZW~XPOOuR)zLizt0o5pFLej-wS|y_wuAi{^ zv>t4F`orH;xO2L=gE-+5Ot0RG-9&8CgdoYsgK4Ps8_U|92^h!lTro&4vg++ZB;5Zg z#+-}<#EoIt1I}~Ql1PXgNDcp@9FQuQaXn6!76ncsH1(3u9QWlI-bQ~eA1CBw4ZVw~ zpD((yk>rI7^nkIv8y{yM_8Y?!A+&f$1mk*1KzniKASw+Q)6XdoON%Fo;IOA-{!rr^ zdCnH`o#aD*Gn%Lfcs9=8Wg!%R5~-OTSJE0g-td*joMb~CFSS$fC3O~oFyJ|mJ0X0RX@DQw8(EbIW zCpAiKfC&;V8-Uw{td+tt0wQ~&?vo{Dq{t{dNm2;PX%^5U^L(pJv~S$qC92F%agb-^ zk^m95&HX-~^3U3#vaXoA3{Rxr(uNX+LSkx{ZhUH3YkXN-c_5fbI|D`< znX&_%xEDpcbC9+PkC-Cg@xtX5tU=Z+;y0+h*D17@;NwW=++WRSewHv}pt?NE{K zpFBhP$bv~DkC8?ytUp~mEYm4;A|Ig>6K@z1K4anyqhLSIxnxqqq?%~~R`f`twrXOi zCJzAWSzJ>U8G4y9>nl3EBl10jk{B;4nyxBRyM&(YIX=^~TYoXIXP3Fs#sAGL+54%# zXG8jXc6YXC%PGa&jpP)TMa*Dq6r^PLnm=3RohU0t^+a7|rEjt8&2;f3N;h9(87kuv zmX1yhIy&B6M9=F)%n03VJA}6)_}?BGuf4JXC2oldIyW?J4QYY( zLE0hdhGr5I{dNa9$u=Xge|uRX-Cou~w*K_6ihbIv4o^!h><(W&Z>j$ijb|={TI54o ztMsFN+68kQ-nzojob|QNc1o7d@R}eh-l<(jtS&ek?ZirUx|4-|B6T-0n>AGIN=Iht>;X~X%zUi*RV~*V4>2Vhvs~A#t zGCjVmltq}F;J1LTcLvy1sXT`mr~=?I1%=U@tGET%dd(tuow7yLg{(h+h2$^4*2*vB zH`u9G85u$^M^YwRroPWnihMd;hU)_N!HUwJ^NjioOjr_ zo}Bj(@$qGMqxSQQA(SHxLzes)Q#q-1$^A87ikY*8vs#=8C58gdCgH)>KR=9 z4q9>H^F)gXltD)t0BAa&f?7@u8NS|NWjmVAz0ljnEObLJO${N5hCWMb^$VJ4j=f7hfj5Nxmu}@nt_3|6lND z8??GgA#1cYKik?&BmV0;GFc5`3g#tmx2sm|$(E3vTYX>%=S*rC|O_(kI zvj&!=ire(B<*^^^{x}8}ruy^o1O5Hkg+H5nwM47Y_xvV12=<_^XQ>bD&(mbID(7#u z1Qt_vJiRiW^UQjwO>Hd3aJh8ghgSX5#Q$wo3^6tGHQg@s@ck*v;o8vA7FVVLZOQmx0ls=RTq;V{+Ur3 z5L{}$Nyu`m|NRkG;`9ELNo+MWhsPM9;8Xw%N|F9N>(|_=(cw2{+(I{In+w4>r6jv% z=^WZ94K<+7mY%w_=t_ZVy7W9&JB^=i*0;&Tsf7g@ZXV<~qVseR8}nv~ip`YbbzY#V z$+3vOifXMJO;0c+isBnG;NUy zO3Vqw1Odf?iiR46ghAU5R74k*xFVOS&_$)C?gvhgr%6e&sC2A+2vJ);PUa(0Zsw}a zQc6tcyplp^=9wRfAXIE-g}LSe_+V{;Qu>M3FCcbJg&MT%(G;siWt<4(K^Y5kC5Ga& zi%CtjYPwNdV|KoT2KSw%j>rYN@u(!W5y#5t9kh3xF|~BOG&b6syRby$kIbr9`^0)c z{$C*IZZ!W4BXqerT^eS@o5?N>HvQ_G#U0Ztj?y?ahfr%v{f07&m+S-!a**An z<_%g}g zoyDbM#vUG{7F>>z7ppC=Zf-ar%MRW>mQJnZaahACW@e_CcW)S2fs!(`%1;~?L6%!G zS)M#BW|g{ut0w*Au!#CQ=V32&mGH34Ffso!ezH9Q23B<^p>{T~qfI|2U#7-$4=Y#^ zaIIXU4v)wqj}_rOEMnleP5e`)BAE){BN?i$Po8{OFijJ{O!&Q!-UqfT$AX*Tf`%IC zrOjc~kp^h~9C17xmhmuW|)L?cPM2?j(E6hVv( zVaQ=52q-ET@iC!dRsER z`PHt})z#JAwR?t%paGz`8uW#@DCFBM@Gg3`jf3 z{Nw}D#tU`*Td^_Y100uJ^1dRP&IEaC{@{@qMF_{8PW=Aww zJMf|o>C-#dS9IWv4!jAN+aJ3-*mHro_8jV9&+ot|I;1b?z=a*S2pC_~;Bd8ry|@G4 z?!YC$T>m`kU@z@pf6>8S-oakc!Cu*czjk0rhy1l2xS<0#cVMcOj7P5hvK?5l1FHga z{l)LV-8!V#>cBc3SOCn8f6ET+0L+a~7hrC@_yVJ^!(fBBgB^WS0Xx52_PF26N!KgcfxMvgc(qyh_obAi#L4s0j}HUO4%$j_(9{3bmg z0CWA{9~fV=<6zk#y#p}Uz93+3{t*Ln{htclg%n3+0CU@u56o?U39vq-ZvgHOEZ~v$ zb9NVC6R;-%bLDRW7J$77xG!)euo1A93@LvAunRDLG!}&Q#!XX2gn?F0w zm)RZC7XWkRmjZL+O9IUG55E&>A9oV(SboR(t>gUE@%ZjIA9S3bI*xx!s9%$8F6HMJ z;2$Rn;<^uUV2~&<5~*`k|BXi%D=&m5s&3Xe~GOq$UHC<~-`{Gy_$;iwFhoT8DMA~iCmsCh_dpjQfd8K6ul z=#K%&Zh~HB=w*Rk`shWYOv6zD2I%h;^qPTQ!db!b{sEC9LzEW>;jDlTjC<6O62>Qs zMKQr#GD?UqVIu``@#s1>P!N*f9~;Elgt*h9L)y~K!uuQb3W`s_I|wX7vb#ukp$r{U z2!lky{t1!sg20$)E~_9gGA1q|mTjvLj|KnOf1e-9Z=XFZp7c3xLRa?A`U5G zOjLB30FR-#Fgz-RZJk7pl=eFnx38mp>hwQS2&4R?{X;}S|EW_uru)ZE#r3uI>%a6| zTkrpoj_dyp{oFn^N*|OQ?H`2>jj-sj_%Jkc%ofE8f@5L@+_>QE{_&!uu=sYvzkMoH zj&$(+m(@wr{kIy2xBFlE@jsOR$MGH?8Y@CKIBkbL#m#4ezI_F#_%;rV@$*mg4})n` z8b90~&thoqoQUQX!3a@YU~HJUZF-;tPI%gIj`WXvt+;erqJ;j@G119UF$r-3wEskLVsuF3 zj6yh%WrLQ3`cq;m49(b4R2+IwM1Myk4WweISW1Nc3Pv#j=&xAT9!U*Eapc8rKJ}mS z$5F|s#6T((}d2JNe!mBvl!K(T#^=FV~>iAbHvLJkewBX9~CPS zwdc{Icpv}B1QLf0kj|@pJiaf&@nfXJ+&LBvcyz#fq25L7AtRG;*0w+{{O~(_OU1r* zqA<%-GKgel9tNv=v3%wIGh@jhMSv#*DtP`ww1;7zpK~ffDA=u95P_Db;W3aNUvUh0BRTF9CXq(Mt!tV$ln?H5I*ZThl-nAjRQe2)%HAbR4lqbQW+9 zQrxcH=!NUqhh8|{Y4pPFx{F@e{uI5ieKP7md=H?7ItBL+7aWwy{TrtvfH`#m=F|Hz8q>I)hQ8V{NTnhKf$nhVN< z4lV#L0xbqD0WAeB2dxB^fKqB?d-$LNP-{?6P$6g%XewwrXa?ve&}`6L(0tGW&?3-c z&=Sy6&`MB>5A6fx$`=4zf;xbDf`)=7fo6d220a8?09pdt0LoV<^?D^lQ|`#?GZ9@U zO+sq}6GIcIQL$l^mw!BkY(f6X=<(keqIj2}ba6NmrHv+kksXEd#j*y3C_kGITTnR( zu|Tfq_!}h(pxpgqDMxWE(qzgN)$f`RNjWBjP+lT2<$)F~#>LE{Mu-C0f>9oHZ=Q_v z#j<~(Sd>376e%hr49|b43=vL@%0aC~@d+Ubad5$o%8VC91&Hu`hyyA=1{12IeKf95 z%8u?7<%wQ6xVu{f1z9AsqNx3k(1DS5X+$`2K5!1sl$+Zp(|e8WRfok5h<7CZ(~wU94dpPAm!of=e9Uh45|;8 zkFVOflsJ~FuPu($i&M76;dHL3eBAC)sN?{o?uc<8I-)ZSR?N7CuCSe0@xE|G8iLdd z<-_M94|J7-w`&~ghgnERpm@AzN%;wEskj_cPb|uf>ml2YqM=@V|3Ct%Ka8yl$B_Ej z-OnZiF|#`ZRQH#r@!qy#056+Ly3^YWui^FZ*lxij}KYXRKMfE_3~cjhi-a*}83e){g9)ox67L*}E@y|AB*t z4j;+OKYHx=iIb;J7o0hJuJHVYi$#|%U%7hi`i;RY1y;q zFJ8WSUH<0nyNdT8K30DE{N?Mn?>{6})it$s^*F9?wEm`eGM!}QWAOwemhJ{B&Mn%VnXU4|GC(KGrN}fG++VmNI!hdg{lQMVS{Qv3g|DUe^f4To1 zot#IE95vcyjO$o8_i-Mc<0p7cL|>8UJ9!G}|9@})-=hB=dXVclPf#JK7&IK6PtDL- z65mhaFq>V8b4KT55+cxf*^C;?-e)Uy}l2bF+w>ywH)#4Z301%>9Jt^2RnFY#3kKHJBmtE?!b+$touhWVfJ@BDO-9d=B5^>*geej>k!)4$r+-P)F*gikkqW_#f8P$yQ2cvdz zCA9V0f67l*v|~{#xV*UaT*H4U%uw6o(RFPc>c?1A zH)&B2+M2|FXwyHJhw}!aGH_4Eqbo!+R2uFVavd9tEO?C_k8ymr@#mgu+g3cxL{t(= z*Kxi7&lU!ua`1?aLHjHKy(j%cJGmkI-zl&C7UMSK-u&|@Xxk@vq|HJp@KN2~AAnoP zt&wtdWBup;!m(m>yvLwC*t1}UdJgx|Kg|MUBy;%;2i?Cvl2VtvT0=K!yfvGLg5EEZX1&6tWj_6N_WimR5>*`cBI@v$SRO9p(%m4#oq@NscK^_ybN`O`$Lk1P`tx?b zPS{3OM7LhK6RuhqJV@8ZypznxDf$f$X8O2ZzVZyM2l7{&=PEiMJCLHSx60w}Uo|Rs zuP!oF`I2%aQ~&Uot|+&I_RD7zcig_{Kl#PMgVS!Pj*zPh>0Wq$Lf+{n0sMy_P-*$lj|xYbHyGp(POlud*a@97-ZmZSk^PPPvhhJna1btOby;(ZnyLK++U(Y zUau0j?iA#EHD0`aP(O35`#V`G&Fo53ZAsq=o@aXF?YJnlg&LRH|SWe zrJi&9w=-pLU&pG6+{PLu zb}z4wy1d4D{Jop&4ZRP(ePZ|_ciY~h=z$5eF|H+FYbELZ=3k3a_KlIf=zL|mS%ZtB z`gfhl*}se=wRf03<~_4#J}F!}B5W=%x{<%#M>{!T_iBoIbL`CUg!BdLx-)koY)>qE zwKPj{)JXSG)xFPK)~xIQTH|Y|rQwJZo4-4zow{;M#xVtPs&t3nMwtpG#1=@aP8^bC}xk2`{_Hc#M__QJ9a-k?pDdnO&S$XGi)6^-ZBRp zV-npBKIAFmQN|zWeNgFvuj<~v4g7tUF4PIXRJ$}`7Wz+E_eN(sX2~huq~*_MR~Fy< z=w0;d&9M=@ANlhH{p0jw@252uR2-4hRB#Beo9!`u_uavcZ#|--)by$c`@HwjxTL@F z=@+9#Up72Uv>Vgsh?(waf%V}H_wWAt>-n8m#n_ zNA#p40bdU+>-*zn)6P>BKi>4HJ|8?dHT{GYZCY?~&8tH_6@zLYjSK%hv`e^8NVhZ3 z9d6kTNDAFLD5C6IUR_~WkOA7Bidw(aro8*!-*N@6TN@^AJgD4ygg0lescYE!i+zlB zuHHEC;Bo1!8^i9adOus2vHixD+`q@_Yt52$R!YzP8PC_XZB}=Ae|S~kWd6s$H&%u{ zHK1cFPAoZ)F}1JF;B5&Cv&XLaG}#7x1O<9t3SR*(9J68{%fcE zmtOUyH7C8!`^)crUE=avA9qciVA09mcxh}&@q>`^hTJ0|b~g_n_bHB4*}i=}b;)I_{a+VcYloFhaIbtm^O~Mcqf**P z*YMHo(7-!!K@_9=5l(a=#u|5)$=UK6mT*hU!jNcfOgBZQGCk zbbs995ogP~-s_~bRJ_&p#e~WU$KH=?>Y-q<*Zsnqrw5fiz6Gq9^YzSKJ%`{&)I!ai z4+-yXR~uU_O2f^s=#d!IRQGVE{jBUy7Tx9syVVXhuPUfn)mcp=EYmG6SIt1^puroi zoIdlmp4lF&A2*-C*Rzbf*D5n(YVPgblenwjh20CL?!0Xg%O5&_#P$mX8kcj& z4RX7AcyLzX+15j|2I;w(54xj4pIFl>9#%H(+~SShoLaPRk7{^n{o%n(^Xzva}D14CMdJr17b`Q}Ujb|(7ghiEJF9u&QiE3u2~`kXP}vFq*jWBzYn1P&;a zHOSohSnR(+|J~&?2`b(6Ond7J!!-(a+C5knH@8ao`suCfCa=Tft(F$_|0cgK_)GMd zo-xl?u1i=DKV#UI=xYN{XAHaMWK_H=`AGj)UGPo{a=f%9{qbf~=Q8b&sXNW>>m%%w z$1HH(|1sJ1LrdQ+;wR-l?%k4mx_jmMNGj;v@fYLvL@VazWQ|-MUp#SD^Q7zXw;x?8 zaEcBrn{<2X$)TTGH6s1TU)6qocKylip_}n*3aGXHyW>O{HPOdUEz0V+wvNPUtiN7AG$P!zI!`wv6#`_{xHg{ zQdMhikC@D`8E;Hi1-aPdtXD5r8{#{>$BE2(7sK+ISC95)>l2r|(v-&| z5r=YM4T4l9a5rEHF!vm912Fc1vtbzNPy7r34vN4%2~vDu?m25MVD33)0WkKx<6s0# zuD{W9<-mQ2nX(4vo?~|a7J%IaSP$3}m>g~>(vY;bAJ~1t-XB;9tPdOtj4wQJ5Cfy3 z$%Z6g&hecJJOJ$Jz$U;Mz^1^PfX#rjfh~Y@frkO-1LJcR4h6v01gRom8{lGK^3)wg zl>jqfF9mi0E(dl5t^{@lmH^{p42K3_d@QoTiuCVjKt&`bf?XB361X#P18^5$MQgG@)PS{s`M^fN>cHH( zXjfovT~q_u8q#+Ib^+D|_66<^915%joCMqxI2~9UcoT3h;9OuG-~!;@z{S9QfJ=dO zfh&Opzzx89z=}4cfBFJz0rvwo0`3oN4Xh9B0&D>63v37+3TzCV1UvvZ9oPhT6R;_8 zF0dJJ5wHbt3Gg7`a^NAr65yf0lr7obVZeM~D_{YzHLxYH4X^{SEwCrB9k39X1{MP| zz^T9vz!|`fz}djg!1=%lYo7I(}5=eZvvhIoC_=hE&z@IE(VSSE(J~lt_0@61xN$1EHLNq zPykjOPWnR$SPNJg*a%n^*czA*>;kL->6Ic~k2&@e(2DSrE2aW*V1k8gA zv|M0W-~wO;;9_7U;8I{^;7VXs;09oAU`3j2za6j^Fb^*9jDTf(}C@Pvw?YV!I%%M1Y88H3|s=N3S17X4J-k+16E{Uf5Qc(7O)bq5wJ3_ zHLy0Y3$Puq5SS+*7YJftCE!$GW#9}hKX5jezdy;J&*cX$;_?HRaQT7Dx%@^Xzl6&V zj250#@x6^QFdvv_O418}m4Gd|^uP{WdP|btlS>aQ`B-GST=>QC$KiK z5STp0MIpaV2%8Z5CUM~W!Y=S+Q6Tan;eh?8M9GyV_NL%~pF<)_(qTU-4#CLNfmbMjN0qG;4yg1|y#32F7jfeWhP)-QcgS}@sV9y^85wIVk zr2RqcQ4k*j+lTu(0;R`(L);VC$47b!mx8wk`zF2E=g=|Z@nJ?eQQZ9x9w%nhNa=HD zczl>q&J=e)g2#y&db*Fh|G|DY%p-AOC=f5)Xz6nXc)XaQr~bJ6DLig4Paw(J@neRp zFx(L*AiE2C@{I&Mp0M3Z%Gj$p20iyk0v=Ch=qU#-e>B=6%-sDK9$#kYsR+)F#~I#U zu6{h;%n)(u@wmgx)sM#?ZV#6pk3-yl-1g(~Xoh-|D?bkPHnwy9fybvAYAqbzsCHc5 zL}__=yyEt8<>7IQw-2TV)EZo$cf0+C``d~ATmbF?Jg#wlT>s){0`UIh>c`{U47HBC z-^Ak`GuMB3+~fMV?Ze~W45jAoXYp}>w+|kZMX6`AJO#bGA&QsI54hjj#tlAB%up_F zyKp))G>RNyza_E#(#Esdes5!Ze6>%Hk25ngO1bSKPYH~Y?l*kg;qBns9mQ^^yL3CT zXTANnAfJPCm-Zt*PVw_G+&IU_D`xJvz{f3Su6}&{;{DRGAMo+qe*6Tm+uhbKe4Mv$ zCqCZWGd}MBWZdqy{CFN{&r$6DZ?oh1p}jq>LwR_VgG1PddpUfxD(&L3Z z2iw*@{JaXT%@@*>`NT=OU+{Sc&sW^>M&^e$do;WK?dJ!a-m~2}!TsljV*VW8MX}d{3 zIZEd((ob#2Bk3n+>G2oGjuWz-?b|`x-?p7xyF8(XNxR&n#|>$hm$aRvU2g5#fyY~0 zy`){ErS0b0#qBRL-#WExXB4`IXghLA{UfB~ht%&bod>x3+vY=Df7^H?^*c-FJ5qmJ zd-1bXc=S4=_xAH!9D2$Gw}acWq#f?kc9Q-dBOQmN9#5&A)Z-3&7th;xoc(h>cn07` zD5+Q106{ukaAtyG42N+>Gt65$1&WKe+jq>pyP3CH1*Vx0BR2Q96!DdPnJgCF$MT zwFlQeMf$uWNzWZ^-0?QHogJt5l+GjE_HgHUQodum?Z>_2Ej=!X-Kj%<&kpwS((ysc z=VndZAGka(>3N&5OS^G^?c>^=_c41)x4-Q=pPcFOxM&}^bz^Sc=ho>>AyK{uxlbWi z+vqb7;78%gC<1#aM3ewO11<+X3M>K62Btho`Ky8X!1sU!z>k3~fgb=n0PhF(1U>^S z1ilI^27UpY3e5QlGJtP`JsbEUa6WJ`Fy{v`1}*|S{%;~UlmbT(qHMcOTo_hX*Pjf z5$u&<-v!(Nd15Vf&PT3&4IKxES~)a4GOp;7Z_Izzx7Bffc<-e_R6A0)7N+1iTyA8u&1< z3-D`TU*L7Xp}^(9NxMT3~kr=KP-Kz(!z?1I~y2s{(8d_Do; zz(;^Xfw}X067VUorvn!PbACw9@45->>0nocqe&1K2%)GoU;pU`21Tf5L%1!LAFe1$KX6?zx06 zz(!z)WjLw?>Q@81HQ3h!y8w>|E`{`bU|+Cv_uU219y73qf}J~Smx6sD*ptAX1T294 zV+))P_65M@L&^551G_+a26z*sUk02D?8W7W`Ue3QfSs(8QB)Gx^}${Y_7Gq(*!u&Q zf}O0Qq336SSAjhj(whJ`fISLW(T8l$LSSpy9`?ys6sHCDC15uKyB)`1Uj$qN^;rU2 zgMB-&3ou!|L(ky=CxAT^*c+I8E~P7Q64*BYrvpy}-UPf6STdAsp9XL)*jEBmusy?o z3&1`PxB>Ea11<);50`%!DPI$~6zr3LD}grwHvq2yR-8og?*P^U&gJY-es^Fau=@h@ z!QKPd8ti0M0X;`!Mamxzb{DWO2KEKs2OJ7K3pfdQ8?XTC>j|6=_Nl-^u=fSt1oj}{ zT;L191;AH;i-GfjOMwf3D}nz8ZUDXkYy|ad11tKH?VkqBt?R!7)&l!wU`ychz%Iah zx%|MJx%5z9FW@AwZvjpRo(^0I=?4RE0{d)W?l~0);9Ri(11Atv1e;;5Y zunU1DU>^c(4fZTxPvAMg>5$$KI27z*z)8R{TzcS6z?*>I0_Or}02ct~02c!v11<$V z09*+?3b+AS3{2K%@h9C#Aosie=)Sc*2cT8n_8bIW5AJ?j1l}o*!@#@4aX5HYIF11C z3CEFWwZDD&k!U5ZJ>xZx_8fy&A=>lI4tBg++TM;=JKHn2+RfFU+-`gEswY_$3~aX^ zNMgu)B(ifQV84_ZYCTsz@xyT5I_#Ih>ks(za3qj*sQ^?0{&ZSfImBOsR|iNS{+d8( zKjXHTv7hfEcH+MYLaW^z<96Wk+H>3YFp%{${NCPo)#qm6!y=0n+vo=Dd~Mx=^5WKNCCtyjuJGVbb;yd$@Ez6OQgszF0agiJkMparNO( ziM21kZJd+zv!&yZtjplh&!xxfF!0`{m=aPQ-kf(lkd{NF{Hk>{Y^MT zy8j4=O2-Z1DD>IB_T@!O_aCuy-bb!{al8J++e5w!q^*9jblj5scy+ve`3W8Dv)Yx1 z*V{$y82dkPDI^eoRG73siT{xEI%B^x_SbRVR^o@o{mqR}vd-EzemLglA;S2bs}HZk zMoPycu}7g#S&~5fA#Lp={+hPq68pdLamwvq;)iN)$K~VWmISiC&3U!4zZh>n`HmQz zg819~rQ?_Q137Ot@vr0hxc(ykj<(~KFz03#J|+m ze$M~H#b7o=vj^9I#7`C>oyUoPk@Ko!|2p3+~1OA>iJl+GO{Y992+JQpnJK_=IW((b_fPxy_S;MR`?F9hNFaXrw)POe0iI9D4AaKs2;!K_ zPdHTC9>Vw&*(4B-lg|KEN8W<$OV#obHELD>`~;g&BTM)F%~V*ilL z|C1X!*cGMb-`s^X#PFmR@(20fHfn#yN;+^`aa5Q02AXsJe*Q=MlG^dm^)rpE_UF>= z3iQ+%@lcvxpALA%{OHu)j*~jHOOO8Sxc%kQ{OIe6{vin4?5wpdy*C>kcd(a8dCO)T zZc3S?zb0k2xQ5k5T%|1v++XcA|IhT)_YPduf%($R@V|xTa}ggV;uf5grhjz(ENb5} zDeo9xrOdbetl0~d*I+F_d2%gQPY=ILtdy6+2COAl z4sXON**#%1RzYLk7Odhc8@FN2mbcErnt$!d4wiXmv#|=^EX~1MB;&o4)eya1SToeW zv6{*&*p0c|dchv7{4-wF*@Kuf zR?a(wmH*iBFxKpuvPZCrgRZlhe`IMM<|3p1?EaP*EMhg|!8=whO`VToyTg#3tO~zS z$1w9J__10ZdY)BJ%U;KEe0gpXtCkNRvznbZ=md^0p;xmiNc+O7W#VXdJP7r6vFec8 zN;GrwDV$z1{RFG|FT0$^Omz!mRmi)-s^wmt0ye(WELJVG?y>6d!SD=@&xlH8HTy^@ ztEhj@;`nU8bXLVBuUXA+9(E4LmsG4|)pA({s}7%S3vs+yaSf~diVv)2&mDdq$EQAC z!z%Ul1FPAW>@MK=e4h+fvkz9VT2y3xkxjp01*?{3<*a63?pef^@8Qg<@O&hzsj3@T zrR*=V%J-;bRpO+638&B2vSl^3B!Jb7@a3%XKOSe*a?}gL>9Ut``tn1jtd^XZ$f{&V z3ahEnyIIW_+-5c7R1K?WKVHH41go5gmV~jITA#tHkXOKJx#ShAme=I2vfDAwl+_X) zFT&Z$M3u5xrF^fmYPsSos}6g+vh$JUUTao8SIl5F!*>y@4k`y&74N=BxPKk1C4XsO z$Mt!ZGOU)UidaoG`irPZ9;@Y=kBI$a1FPbk-Z$9(aB^bR;dU^q+4jp>wcMD;D!=R@ ztDc=2SQT{FDaQFS)E!tYstaVb{PI#(spNyKqVdOSc6K$Z;;!A<`8PkxhSk(#(^#e6 z%xBfJaVM+drfaO`f2?Fxa$e;Yt}k_-IjchB@vLTFh+|buZ(voDTfnNI^%<*{bPLfi z-M?{uhxv}IicbTn%(^@t0mi?u_{q-V%0LP*Ik?+ z9Y?HswoGMJXpq8c`S5K-9ST`Z9rS|L67^;h|EkwLoWEqV9jn<+Q&~+do6V|t#uipH z?w?^*GN_Ez>;(<1dX}q{u=UUC#j2&O39I~NwyZkHxw2ZGG?`V&yHHleqmo!n&0fkX zzj_0!mUeqtmCQNGs^^KTtO_e061(a-$P?&JC$Ch&<))@9Yw*PK<#!=BX= zdpB0I`%h(6+$o$@&u2-jI_zJ{s!+Uv)ohDBtfKjW)uIiTSKvnqM@npJV)cUFap zEv#m*QF(yd7XmtO_+&vMQLcmDTKJ z`&lhNbDHSeYpmwWK4R5V_bsbMgCwj9m{wNBBUIVzt$ZhKR?BUSSmh5G#_Au}W2oJ1 zSS>i#w@~?*{iDw2gTvI0+E02gud?&{yY^vG0d^y59@}q^u_n}4qOyi+j@_&&*8BdaX+f<(2nc zG*qNXJG#?TXN2?Xt>o#k0V!1);azFlfYiIkXeIhprsk*nmfh%q*{k{dh~Bhg^;wl| zOS{u1g?nf46o1=ChFrg6f6ACPJ$SXyRK|oJA$mEtq(`HDmQ|-oLI+J+*lTv?^82dv zy!|PLqQgDt{eC;Hxu>hs3rggLSJiva4T=MYn=4t+wr@<{UF+6^-r^D0vhSP$y>L(YVahxN=*)uV?Q zPHs(7Yp}niQ>>ppflr6WN6qzGUv5wOM~fc5Zsgb8e0h5R^SWLQQ~0#zV{e0BZ+p-e zD~??JI=M5wiwS*ZvAj2JWo6s)vYc!4l^sv9DsGJKD(7Snti&Tdw z(@&CDpY&d(O>fygW1F7YC;RZ0`JF!mGIY1V@nv1Mn$xO71A1okGp5sKBw44&45IV) z9&`(zYDeqLTJ<8luf+bFw(Y>DuEXgbE8|isgEVQa;J>QAt{zMW&q}PzT5C@iWUrLi zx!BMKz6ZW{d1*(VwUU|q@~RDe3J74Km~Ph66|-f)Nl zEgAbxg_@!Y`_YhYSn=(IKBZ4*Kd8RD{65;g1Z7ooBR%@ozR81Y#GPq58HGG##J0xNq?+Tl(FSR}-#xv8VHVmz3Y$Z9!)#7d_ay z$d0~0^>TIo9s#|%erjLg6MNc9vURcAQAPUA-x(+SrPFl%hCVgw8pG%r2mGFK0~;>9pgsL6rrq|;~wEELQYDwk> z^t}eYb{YN6e({~L^IS#!XuZR!W0I!I(LvEiADLO`(W-SeWrwd?(aotd0~Yl#qW#Cb zxe+k_vppGq1L^cxIVSGIt>`rSPvv_m2he$X-6hxa2hhP&U&b%*V@YRDJohz5fc{h0 zZI9UHCnWa9Z~awt7cz8Sp~BUT+70#xPXDbFX++cOl>3fR2{fXoneM!#sq))?l#X^Cu0a z>v{f1lJDEmZ|kr4@OP=wO^VwB#75`~PeUH0TA#J0_s%u`d+;z*TITbQ&DM+b=nsm5 z?Kf}R(Vh>_kC3CR={Mm*gUf47=+`Ev3|`M3K;MjBQ0y^Fice@#&Gs>`!+X{bwxS~z(lz|k7PJOG=xlVl4XwQ*uO!r~$$qBs%3fhBhN5;v z^%Z5d+Ha&7`FXyBX{{YyWj<;RgX3rz?J87Uv{!+l^(JOkTpTi-RPztoAU-dlWv&3l#y|?TbZ|$vNw9dK#whOEcY0I@ex}>WQr&}jPt$blW zknZuR@3P0=(Kvk>v1sjNV|uxvxu5&<&h*ux@&l^&RM`(1ZkjG}8b!|-UB7SZ_W^W; z&~@Sbu?Dnxvh!P~&c-y)Lqkzu=tfVy_oTadk}K^J{49Bz=LlNwj{E0F``zfm$0-5! zbB$?@1BH##jtc0Pv+e~7rVgZC3=h>bw5+fQF0b!3miF2I>-B{1G<{xFK`BLy zg!#dp7QVGwvNPI+mh4om$`g&E@#d6E$nMFv~->o{oss)Wnqv0boGzqIX_l8(4Qu~u!*_hPEV>; z-M3EGjaJ>e=kAk*uJqYS*E)-zSklVpE4xPC96@XLd$+EqsXgtqz)wT(Mqhev{4;lY ziy>{Y&oOLAL$m!r#VVP7WAy0f327-~509gjKL)m1hK-{wzL#B)f8$86)u~!w5^6@L z?0%kJrC>|f$6hiU(&#|{yY(1Bxi0$o%}5lQdGm{YGhKi24(R0kW&{msx(#W+nUl}6 z5Ag$kGc%oBvqU2hEB6~wum77-)J>6GQuxittQy&H<5MeB^p$s9;dU$Yg?Dy#>XB9^ zXWK1%=L>SrbSmbGb&p;Q&*q`uUrgCx{`ys48yU0Eh#othHZn3f731z-Ze*VEy+8Lq(#VkYutw&0(W=fC ziyN8P0@a2JaU*ji@tw-KX^l+zrzg$%E{)6w)2;Kb4{2nK-k|%Xsxgn;RI{{DYGB zOB$FnYl{jE;~N;QCI0BQf$1inbeZyKU|wE0Hhbgn1}1y=0-oytWM@MIBd;Y)<;gcN z4)b{}a%aZU)XL3u^eg$vr0~qw9>4IDx$?DKvG3uZ%yOGk5eK&ZWQunu zrMdm}lj(eYi@IX+Pv+?UAr&t|elk%Byvw(IelnwaOpm`m@+Y&h)$y8S$WNy5)u{PK z{eLn_DchowG=4JTG?i)PGC!Ff!s_nA>U!pem2l z+Pjp;9Iam@!?zQ4yc8fhG z)H6YPDwB(y>X}zXe--!)u4fzqc!|II)iaq#28JH*R?ozI$4 zB?VJI)-ikDe!UV>TE|S{uQN%%S;wsTHTrtt**d0Z3NJ$LP#tsNcE2kB?RCsI-!#hy ztLhk`oG;HOwT`ik@ErbaW*zf(Ldw~VfprX7|EyzL7o7W`Ke~?jqE_poWK+kCmCN<{ zJ)n-!Y5O zwBS}P^Jewlm-P8sX6nTW*-!Fn8CTw{!}E96G9e|$-r20LWl~*uedW??nK|8#jD9n_ zmI)S49&$ITmf3Qz?#AE3TISZQ8*j_JYMG|808zuJTE_kRK}$p1T4t&4WBp*WT4wy@ z83rc>wM;iQp!}jP_ZKLj^cwjLuc?Mn$lK$z`g;u{v%jLy^lc4uJ>kHbvd1;d$Afcr zufJKtcpLXC6P~YOy4fAousd4A^evuk-G5IF6F6VXRA+Myvq~}eVc(U=Zk?uKomRtq zA9?fs)Px$wMd4M=%CH)yVZaW*yVGl!OGze8IumM`Q5xlkl1J4r#|kG+t+1_Oe)SIj zHqD}jxyUzheb=vsIrZg}Z=zNWlX2gY*RyjCBb2#1pqN*~gj(dBUsPYsjJ@BQGww?@ zvoUpSk$!nKlkI87Q+|xpG|j!~W;LU3HDy)fg=)sZgm+l>L^UIKsb;Ot{%R(xYlX36 zRyDInwqR=Px@txvKfP;ydNt#IH^=(d+-hd1VOoJ_Ts33Jdy;ZIw3?|}n=0-*qnbIE zxMtpVuWDv(|1s#dnwcu>vGFur&Acw$lH@a_nit32G`?HF1E0{mL_G=XrU%=S?cw5DscQp^GE3IOBr|mo} zf3J#}T&~mH_gWQW{B4wj>$xiC-P!7pl%rM5hB?~)XZBSwS?c9Id0AD=ww)_dy)vtq z=O!5o^Z%-1x@x7VYo%2&i=OoA`B!2UlN{%?Og_4b;SFl`Tp3iwbT&-z>oc{Ax%s$d z*O~EEjNKjOE`BamO#jhCR(4^k81>?z=(mbFRP=4xa?>hiu;uiRzWu5g1DAb0Ewz!I z4OL7kpLd~20kNc&FKLx9JN1wM`c@}lGPZq)sQW5m)P)PYAV<}-i87DRe z8A%vLS(!8kfrPP|J$_h!EtH-O5+)UW5xuOU1g~SDz$x-`$Ak>DL^00j6H55ATi)oC zN!+upI3@94FwUS?@Fz(ppp+xgr_Ato5u2k={JNnZE;t6xObCk=c}sW%gn*2YvRM3ug>i?(q{7XF$ z(Y)rL+nEIIO9#yWO?vld`n@Ux?;kq(deigR7K_ubwM)L`y(!o*&meqcM#|aE^G&Np zZ_ereGjh%Gx7Fy&0-IMYE)|3YhK-vvb62bH?s@j>YFEdv@9cYORjluw)kVuzxV%eNB>h*P{7Z?N zPYuToJparhFG)B}=v|}l{UP(9_kn;-E|VO(RR)IJ-10ufKR95>wA&}{RywNZEt#0J z?o(`vdbjV#2NcExPQSL_q<)}Qe0O@<-9GDi@LF%B8Dv$-~cT z&$kv;jky`?r7)-0=G4;UNBTcsRn}{Jw!X7-OFnhJJaXe%`6Ag<9{Vp{74C4joHcDm zVE^!*c`;3)C%q!+FUM>&V!lqW(;eR&WxC#S>xhwQx0TM%$dfI3ccH~~@GAu)wcz7p z&3jJD{kuplzIddKpUQ*hO%KnUFG}`S9wgMhPUSpFjx}{?)!z|vdzWrg!>2u~8u|`; z{Y!+@C#P zziCazk(sLwf6jiqE~4cAs*-a38+jH}hp#%FnXszqZT;#XldjcW3)0hdB%L#|XB_s> zxw1NRP1U{ohcD$G*XnCwk=Uclg;ukK&pEm>%hhgYzpspsIr*gKkk;n6%kGwYzpRuxHoirlWN|bFWJlJ zIS+d|J{dC)eI0WbeQL(>nSygvXy3f@f=OG41@-T9MoH3pO`!LIy{{)PbH0=`-)l$SI+7k`!|n1 zs~E1ZIQo-#_Sg}|$4{CoB|PtE(DQ2k-sr<~U+)`JApE{9_}I7AGgln=`n$)Lu*eBP zK5w#)Ufv@!tf#S?Qi6lVH3l-f|qUvU&M>9e_9YY<8~hzCL&bn=8v;M4=c)sg%@PRVH3sUA5Ne{#6*?1lR0^^{&T zYOJ|mZ?QimZuFo`-srl%Y46|LzIb-oYRIgU#rs~?Y#HT0VtnzX;1&j-#)Ca{?$~q(e&cktmxsIeZ(W*Ejb$V z>9g{TE=!INpr`13)J^;)Z$IwL3z4x}?~j|GETdEPi-RX5-E=b#KhEEFwu|QVq|a|N zy@ogMsWnsXvv1tbYI~F3!_*9HdJ2;-_f*{1Z^Egr8b7034}S^Pz4Cee$ijCEi|6dU zZ#Dm@(eD+!A1?=8*)t{b!eTvNk<6xpp=x{Xez#k1@%-@I9|IOyL{Bw3rKc(OS1?W( z{qiecbBDiW?rn_?=l#F*X&ut(USOvK8PnoU+Uyj&sbpn6?)K`y--SzVf8S>sAUrtj z;I`;RHOKP$EDyRRIp6b4Sifw~b5lfvri3~iKQUnV<4;)we-`K!^;DU-b#u1g(s`SI zuFsuoAFw6esv*(r-A2E4-_+B(hIThjAKK-K?uQ#WuU~E0eAYK<&!W0Xfw6si{l2nr z>xNO6wZAAIzcbO&+^fQ+Y_-wA!l)nBUwl9RzCOhNn^9}r@RaXm-CU=?I~`QnZ93nn zT!R*zdi#Ck=Yt1!X?jFHFY);Mms73Njg#lXfAqHV5XtG?am-5YQ+mUF@sjY-V=FuZ z((J2q0`846SUEL&VS4kfQ#USM>909|ZT#P1Dt|2+z4+K#AL`;%rR^>~562%3=tgx} z&~Ly>C*RL?-l}x%;okmYrr%mg>|n=v>sD5M^?UN%u5aXIt5+$)`0s!3t6uC7Jt*<+ zqEv;wS)L6&y-R;o4&7Mhe_&tO{>$>J*P0K?PI+-lCDnZPh^$3JMqZH%dE9a{t527Q z&*ProN%!U_Kl2N5a1MDV8glhosWm+_tHH=#@H?vNqaLm4YM;N_WXHP?KMyZ_9y-PT z(@%%AOdSKa`XR<)nLh=Zjz1sC%rcLtEexf0KAPEI@lklKVDRZjr=9csDNplyn?9pP z_TL!qq1VkJefh=S&FkIs)|}k%@MW!dq(ye{SEa&>i#ML{R1$S)zU<<^2Oc;4vcb`& z#rwl({byU0ZynT6@-(V7mi2nJ#8kN{>eQ!zZZFWIq%Kc)7j+5!zB0#fXDj2e;_%W+ z`SKMfPd%xfozmy-fv#{hy6ZF`!eMAutKiJynzDmWZN4ub*VXRlubaJnw4%li z4BlmMY~#Dn@xP*N2RToD`SYV=XpnFe&);nJaUHO?QGXz#Gp}|=%0S}`naYM1v4x@RG|h9V z?@W#4Tr@AO?;CZ!g3-9-@?weFjqf)b71VTP9d{>>cIXkEKK;vhzd`qlwmx2csjxa| zsJi2jq&fP+Z3Be6DjQz+iVW1fe4=ZYtU+&N?t291X{O!3RldGo#GAGB-~g5Wc74xW z_}*pbvBjG^pZ%~xHTIR!&z)u?le(6)WS(9hpg1>3Qg{1f%&svLf4R(EYS^;&iV4hZq{*g z8>{5W>bEz(HApoZXkNSTuv4g=N%-~KZV6p=s?3wDoVtd89KZJThjTgdo`FqcwfGU* zzrNj4FFmhsfAh+lx0Aa&jaZ`5RXO^rYT1C#2Op0M$qVw!UGgmb)5Qy|S1N)gr50{q zQuI^OFegdqF6<;6wXo%WzOHq>?2(a)x0{DO9US4baOS~2lBJHR`F=B~;TI-lC-y&5 zd499gC~tpr-;1kjeaG!=d0B1!Bfj?X`DIJ5GzNRcuR31rU7c{^Oj+|Ne}gZx7rpMi zJh@BwqPOe))~uQwJxV<3gkX*L;}veNWNyAWq;jT2ZoxU1fL!&g{qYH>dd@$s^kRQ` zj*?mM;8BCF%IHq1Tya67q@TUnmERiOySM!r?bo~asHjyh$qB0pHCp)W^ov$`n@L;m zzRj61|BeT5hPvmkh4TBZo|MTpEcwvca7Duw$0banyqoaKN%>rVquD(q{4)_YG zfVnR$pJshf5BzN1FZ1PPuOZzpU-tR__qkW63Nv!%Hh-Dbd-7eS3b~kcUdmW|wV&5$}v)w)R#MDdL%>`Kxle{N>JGrM>@nMR6=~cDE?lXRP_G$Rwf3&RI;+?}a z#z%g<@i^w{xHmp`FAf-HReb&BkU?9Xc3lv-cGa&gA?1|N!RoG!?Y+8R53Ld}AM9mz zZAw;1{xm16T^6ks4bCtRg(QC!&kr_F97mh|BI}trB z+~T0iq~z$#!UwZ$fm7{tq$34F8UgGxroQ<*PsI&Vk4b~r$eK+HR z&!(*!TOAEd`gC71f*fcRtXm&z{{S)!WYc7cF!T|FqRp^Zn{4Q-jVn z?ldrZV{5x_$@=|cKLvRIc=*HO#igd_xiAS3h8Q5>Iv_|?E+GaR5j9*5kBAW>q!vpqGnm+rjFSX{MU4K@rdBlK zE#4nX}Ki_`<8dsrmSUe@}bt?Pr2BuKdZl)_E;&-hboH8!c~L{Mzfu zGjH7T+O)?fJ-qMJR?ptIu3r8{_0`w6oE`YEDJk$xOUI=Te|66vw;y_==kS^flh0oN z=E>w)XKcRPvaa%~+=@Rgj=TS_cYObi_m6If8ujdk&#R~9)kW+NI-^EC_J@P@Yij0y zGIsg{=M0(G{P2cL#(golVB+7_Kk`M=XUESx{A z*B8E*u{~$pO_n2vpL>7r54K)c|IU(czdLVn?A(jrd}Z(RzE^+md2XBYtG4*{+b=Dh z|6;)h4Sgn701?R|V-bf&lD)mtvSr1X|Oj=7gj7;8B>-821(+);VQFS+NVb2ra> zZvV6;Y42T7?Y(UCt5-hrtJK-QdUld`Yv=gDUta&^^9M&-Ui;c=4UiUp4|NS8^Jw5EYsP|o2N9+q5BVLXx z`6O`RZ)!)s;H_Qm{J1hT^}b1uzq{j&z`1GOHzt01{f`%v$Bw%rt>H4q^)LLqJ9Xp1 z?T^oWch>9&AHKA7=!X;j{QijSW6OVcclWW0uWinMwRG#nudII}adgy#8Q=W;$X(kW zobtE7toiKBFV5VUx^vE4-#yk>4zJF?IoR^lA1bbX;QY}ghs%ys@5sOZMAx#P-8`-) zYk9)zUtGWcm%sQhHsOZU=&tvcJoLj)4}P<1_pj6lU;b}joc7#bj_jWsRTO{y6l>&@ zTV8wl>2n|1_=^AHk*nT#KVx+6{ypiz)=Q^7;z)mXO}V)hjun4@`PT03 zJ-2s!x%-B#yT4q%_CRLR9k>6@`oVPvEnmL(hqsDO9*Q_^D^yXHK8cI{WQY(Fku@yUmi zlb38dqbvQj_1P~J5BoUnnX_B`?__QH)l+Y7yJSqvrBA*6=I9;c{u|G7$2 z;q)J^G>&)Q*8hIUtl6jkK;r2?UD@{)%uvBnwy7$)6;x63gObusB@S0*0bgz|;>*9@%Xv+iq zH0(NxN*wY5uZ=DTU;Qf1&npNmt26y7@VN5IUF%Gr*Hx6SPwyu;ybaG+>zC$V=i>9& z#-{x@Km>;Wd`PsY#I?@tDRsL%liy~nlQ<#Cl1$eM)>uClVcYh5ZW-pQNQX&1~nZ)Tb^zhLGCbDgf4=@-l?$X|c{`ExHwcg-{$TAe2=EKGaFrDd*lg@mG* zQWTJz$~1OX2|sV%*04Qsjx8*mtE?c;otID2eilrs9TaPj+FE=Radc`@f{bC`Z2{7+EYU*_c;c zGE1ZaAkVuc+9tvXrm4mz_OT5@LeS zyBk~TY5diGEGpgL&hxlV^2TVeAabk19!_j1#8WN>kP#L z@k0xWi}XU#m7zW{Kl|c&^LqDG?nUN!I2NjeaO=DsrHN9afc4C3~v(*f5bp#T+XhaBMj8EiA^U z;#k#yV{sh&S8w4zPdJWSmG4gSg-*ALzCY}ER~Rp8#71b76RPkTkk}31!t-?>vnt13 zR&{cK&OrTibV6HZ7%wuh5!%A@6}#bEc)ppWspYtPfKIr+r0xhi-U&Z2Z_yW9A=}~k zi~aB|q$9Fg(j?YcRd9e#xIRrmrJxhqvfxkWgXoCOkaoBql27;+?nftSyd19_pcAey zsrQ8)?}8sJ4q_{0J3N1}AHIcjL>45C<8JDIfKIr+#33D>(3S&#Iv+$wY=*SM{g8aZ zw{Slae?$A{c+~)%aD7Sb4?ErsKUf^ZR>*dE{$fA0B??o;-+*o9s>Q1wTh~>7eMZye zRmYA^DY-A{b+PrII49&+6cszy>K{u(X9rFOv)s;nBNurOOXyuJ@(z|u7iBM3EH|^i zW>K@sU6tiiHyBe=`@4M4i{l~L)RYvJh0GfplCiQrXi;v8Gpop%SDrW3c%=xxhpJ>r zmy%Mjp2=k``?5T6)}oc!Q*#zAfK}f9va3Yq>o2=nWF7rv%Z#-9kV)K3d&?GyURQrT zBW-s-S(cGDfJ|1_nQ60RcvivwdO4zavcJr*r#=fWN48I;qgP}8ZV`*{u203ZSx#E*P-5YMW!I^K&&+oUIG4zxdOkK9X%)6iL zYBTR}S+=Q{*iUBaIglw{5HqXN^wIHCtC}zQ8v9eJSf$oJO`im3Ii+%^riyF}vZ;Nt z^F-!FmSySHOA}e}8LRPKIGy%TA-jTe*0F(J~wnDwq9P9;RqhQ;b)aEKGu@pj8zHQF)ASqex==Q86T_0XAf87(}t<>D-(mG z0}1|k_sCpJe3XjMk8=;t9hNne2Q-pq+tftMBx_7?NFd4`nH!N}%_@G|qI&2MlWnxG zLuXmD=vW^>g|rVtc66du_9MqCwM}GrJ8(ZdjV02eB57Ka`4>s8cuDXKbl6DCfm3At zbu7_V6}{4$VqhvL_VW3Tw8kwBn0Uadk}u-lV#pd>b0$@0oyu4%ItwZ1xCj+viC0$2 zEaj`h=cGwdYIxchH5_@gJ4`-3Mvcmzphl&QSEDSWRa{`0duXmw)h8I|FkesF}gY#-7-O}CWR3M-z#5{+cOujyR?_idu2}5H9*K5~ zzgeirMR?^kFuBn6P^8U{sJSz0Jd=1#QSlrb zN*##3$Ops9IGmlxFRbb@>=2WLv=o(KIY-&tLvo|DO#L)e7Se~3FM?SNS!095BscP% zNJSGaooF!ci3&sY*)4EZAQqpdQsp?Hz6={i z;)2x4EEV9Noqw@^j8fM{|C{+jxewY6McU$PFqDe{>!a*j$HZqa zkI72Gw~Hgsw=x!lw;4YwXaAaiM<92kE!IdJS#Mn%*{>f;*@LLuB0fvo`I4Q;tyX#J z%k*<PIBD zH^TU!xHvDdI7bY;XT8pZc>;OXi%;|h?EE3WwWzV(YG#D>xT=ecK5R>mO&K;N?z<7{ zC2QpR=oPm6qjlfQrtd93rSE-0Rx2r5@)s~89+f(AVA9Cf5@Fi|e!guzp*6?PB*vD}y<>}4+RwBhYE1cAYE0TRHO4YUh1x+b*;qsEsED2D zcdXWhiiY=(V^oW(5u-Yo!%$qDJLKyrF>2$8*{II{ci2H;Z~V&t_SRnsI!k48pc6{VV^BCn2~XEWn7uJ`;RZN-V1C#9`y zfGLN}w&J$ctKpH>T%(^SO^#M)SjMO!!KgrJP9Sle%!eJvm5)|7=LFSpJ@@6IDojk~ zSpR+6HhOA+o@Izd4Y`HkaIQ_wbw;ZZ**3;Y#>~{A`urHnxE7=0Q{#ei)}0*19Ona@ z>f(O&xs`M!omc;T0yIG9bmx}b$HUH5MeIbrXP#SRo>0$RmUCVe;&eG*ZilIdFmJt2 za7_Hk-&j>f#`_kPZ3@Xz3pC72 z8??m+nXpu4kVWL*`!dSiLPq-|Y+2Ug$cfhNz4@(-&PqDX97V=-ulN-csbW&8JGV7u z@)^|S=dmiz8Ka_zw|%Qp7eEBAImY#0n64!*TE(ReRdK1DL;caYy>`n@ zySX+~>omjQ zS3qMvFm0@X&ks8;`vqagW5!0Sv1udJSP!#y_ZhijS5iKR&P}(|53nPs=fzo;5%eQ` zAA#>iKeBO6x=`AHMa2+Ta}LV6!owVt57pW{W-B%3#(3iEHB z=c*l)7s?|~L5r2iF6RyNnuBYNY?+fqtAtdpIYvbhzh{{*?Nc&0GyTG+v?w(qUS@a5 zx|%9Cr*v`7}q*o@qYZ7HcU+`j8aMEBUKVQN$4b@ll0`Mfa(8m{2zw@LsfzY z{RFv=8i~w~Y=la9((aB)B-HFls+y%(lCD+}O?h$*^Tb zciL;{LzjGLF;MmoKu-2$OFDO`N-B(_9Zgi61p={Mj5hA5+(=^VKSujQ=f-Z@CG<=3 z7ku>JmHJ9#+MhSXj>N(;O3tah7D9dW;@6e>F?5_f1!X_#h*Cp!`di_D0)>u;_Cv?b zcE|NK?Pq)%*V?IJ?Jg;nHb+}?($=^JPvTlIX$Ng?T&x=B9IeJ>kK%eHL5=$~As8Q^ z-5L5Z=-bdAfOf`*b>3*#^ zE0pK-L2V|BO?>MmV@#o5vxlBqw=zC1ME5jkwMME4`lB`1BCgVwW7Jqny&4+iD!#X* z=KMfKVaL2@;5Ozt%!3?%QEE2Sv&)=Qh3{LY#HuNrr>4+OrqE8N&`zeLvfS0UuP}^x z(@+(^(!8%=j%AE%+1wXmY?pgNNi&D3N#$p#NzQmRiF*W-cJ#Jc8T+#1 zNXPiNgZ3GAjm}~Vyul%v#a&3C5oTP8C-?Ct zWOJ>?m^>lXh^v1j=MA~vC4Q+P+-EYz1;zw)lh92nX=MmtfO6*`g94;RR)r|9UQ*V%FVo;y%nc zPnqo?o^~*j{=~Vuuifc$E^UoAl7PO^-lTjVFn*Tz8$W}VMEs^*CZd<=dCZ3~+X98noyfJS|O17!7 z<&2BYGZ-J^)!0w%M!$AT-HeG=NZqafH`gz zs{SLiIc}veAxJuR2zlj@&l<+JY~%V``YyM?^cX^2VlRR5LFQIT(_~IJk~y7SjrR1- z=_F0M_$U3!V@*jK(C?edykE(9zd|woxD#ZYH~jh>zdpmS zV6R{9A=H7A+<1D)SU8G~i~)%TY}<#cSYs7~nHke)H7oA;$dIup3inhlNr zSoi7EkM(}DeSAIWd990BTSmvI(UzrZM35NyW8AjfAz9HW`ZtB6OH@XMMg3%xMfuyz z^IZ78(N^i_V>theS$RfqWMD+saQ{%Zd94-Gd#xp2uDHvh4nuQ8KF4uuCN(z2k{Hcc zF@&)KOijp5nmK&#B>KiU`iAs_GtP^9GB#)nM0Z8{<$6ZiAwb)ee%g0UV_qA^G7slk zg>iG#%8|iPyw1Fzu^$TcP2*mR<#rVvi0rcZO`G;e%A6dll0UyyIm&Ni4E~X_XIFFY zkc+umi~1h4x800E_`YQ*_Y<7V;c0s^(>LzX)|)mn#80E0j-;L1)rcd^-DeKJs$cn5 zom##eNoV8QFhA56%cGHR8foRXr9)hAF+Pu{jzZU5Av<4p zSk#42a30onlFpNP*;M9ya_KhfJjB?SD%@P}-Vhg#=L+s4{%lT7cSI%`i z@r@$Ba^1t2&^JTlYEJS=k@WUxWvA}#)V+P>F!x9*)SkvZe5ky4ykt=iLN|rt7Q=P- zLgvH?`gb|>xjvS0*B?rA%P(mE&;z6qw8(F5J0eq(&f@%B$hnYMnZNr)r9=`Z@y9Rz z$T%6#Z(u`d8(iBCIe<*+l=2NWwoH53qJ9AN)~TG!t)v-eQ{&2sF>}dr%sa=WCS=7J zZAxDcruL1Iw{zq3Zb*C;G~-8HxxO@he>CQ1@oM;|++Q%_CBIz}x71;7%Osg|j$zI@ zT1`qDr6wKen{yiX5(sk4AY;+xT<29mUF0cf%(vt5n;3+)!aGeagWstKZX(G+UNzvD z9eL(4Q$O_lMIy2-+Xq@uz0VGX>!s;D!?i;hk z@(j&Dy~W&D7`TP}$=Pe_haVSzDv{fvfw2kc$ulyth5O^bKXkMYL;3gz$ww@7pC%7^ z21d4U`=7sJi2D8Om}Bm`pE|W146CXKdHU0o1-#@vhEL+Gw(c`7(r)+-o#P^V%wA+-;r>LpI zLG=7OmZB|vNS;TL=NII;26X#&^EGB^yiQ}K#@jSLrtyHr zZjFD^7^~wjQDdsc`@t2OS^7>fD5Yr~&dUtdvDU@ijq*p%~ldC7ps#-A{c$OFXr zrKLQX&+}P7>yw@G{C`cq9L#6!H)|OW>#ys}^Oz}RRY1Oe=KJ@iTW1;l{n>XZ_7W4d;DU}i$ zPjdHLIH0!bG{!Uer+K!1x2ad8KtS!lg#!mD#JS1y!qcDq95 zxx3#Ho{)2SO7igf;eK+x)}feH5hZifkNO=83#59q-;wYY5^tGDc+fnwz+tm`-;`}A zbyl#Pz~j2MsEq8Dde)Rn#7gouxSV|{8qFhvtd#iHJR(IaU9Y~E?&_Dq$)crVmr^g8Qsc4y&?EL{ z>kakv|BL@$MIdxu%-_!(pG-oO!~R+*7m{a8Js@}V%!L{95Uf0`uX?-Dy1paplsr=y z+S2^+!SESq=m>KFImXuba}yWp{nZ-X8new7z888Lu%_W2VM@jg=bj z(D<0fCpG#t9@Y4v#=mQfJ7DHBQR6I)OErF9<3^2-Y22-GpT=Kk?9zBbV^E{@pqYQ>LZaYFD?B+g?p)!&yDnISv$>QCj z3J%1EZZ7kOoc%dZC|lZRYg2A-iY;3%n?ROE^^-v8<%1 zyogn1H@H?U=LDKb5_KmYEq3KsTzjp{6Y}I;!$x@?!ErBRE#(?@i%7zwzecG)N(9Z& zEvZx=%U)JNcB$kimhsyYxiYV)%+(u9S<$mhN>t1%&0Nl@Q~pr(WlH zxkNi`f3Agva|~KprJRtld;$C5A`b;({}Np+X;yI{of(mba=zNC_P7Fw267WKBCn+HbR(AnB2l{l|p&O^%YM-Xtg zk*&Jg;7wQG6YW*yPP4-(^YAb(3W&t$vZ5=+&(TZ>*V=<3?Wh8?qI2BN44p z57Sa8Ws!4{RD`T4ecpn-1&gwjY7om;EV*3xmqofLOBxOjbP8X(f#ytEOI!=odjlkE z)VC3rR}_~QEo9AQcIg_H6)q~w^QcMDAvU|T_c%|6VQ)#v#v)H?iLCitWvm7+BL;ho zcn@}{(XzC+?sf`~3A46#$zE^WHOZb4#FrwLFSZ5qe+LCIBjTZuHkO! z2T&i1mYF7-_)3k6R#^NCjJjDx|Ks@*gJ0<~YpR*N=?r4gTy{zeIWKw*&D$k16)UzG z)XKQ-xuT-nT|s~qKf3lw>6}>ou`=pYSNN-Hkui-o>o3)`r>(3}pBnxeBZW~{e~i+@ zAtf!RLn-wiA&D_C@hnjPHp>Y7uiIX^#&Kl*(Qm&^t$%msgXi{L^ULf*&S0}0IeLJDJIpWRr{UJX?D3-(d zf0k4Ck^b)q7^wf>eSDxlDcytn>rF7_j?pH1V+Yq8Xm8-Y`*ky2K*wd#K!tz#zWHX- z!Ty_BIZnI%%U$_zF?jm7PnhnU{=F6dE$;r8Wja`kFlD9-r)?IF|1uZM2Z-c01J z!{Om-jNsn-Et_wdtc5$@HJQ356K{SzAWQL7#?~qWedxc`aIC>$9zNy&&3`vV85*DZ zPwFqw`cI?(TKxz0W7Y5Kd+NV;diz`Jj1*T!DRt$s?;mrhb;qtd#x1r1+s$uup9p-Z z)SRuRXMg9!6|T~$$MLlPFvr{fQ@lxUhqc{wZTEi_XW^vK|MboBPd4j-EkbXhau1wC zNd3tce!QYKwAVN1NW4RzKP$}lQDo`;KFxp3C4XkVhdQJ+>yibld8g1i?)aA$WR#UV zGct@rgX#6&r~fB9J)8RT!iawa$6~_C9df$nXv4VFh=`andFPAsQg?gCgV0JH=+GlgMnTbx(mvFFj z18qx%4W=iz&W)SlIP2VIwwEVvGx1}+|Aj`&t)_gq#w3l?G|tg@k;Y{juhN*Oaf8Oq z8gJEjx5h^`HfwxJ<4YP}(fGE;-)a1_#&0yn=yHtGI9cONjTdNKqVY=XUdE5WIq>1@t;5%1 z%Np&f@jPmTj^HLvkS*|n_e0Oad%hT+yIS-_k#PNsqlXAbtn^Fen0==R8zkSY}b4TIC~oF3D8LacWb@_ zEIEsH0?6IqH`BR;1}`s`xczL(0$&3jg2bOLum>{o0;is%R44Kja4Xl;N8zjF+Ij|h z@ba7cO>(lTMGiL1X5A5d2Y7D^>p9`Q;66xf`oTT?u6`J~{JtJ_9?Q_+?O@zo%Jm>T zc;k0?9v{96e3*4h)$p=t`%jSJ8#r;E$veOq7m^1$Dd1|BrXGdoy-ey}Nc@-Os`(e2 zJnv&t_gq4pA3_c~GiVROgReuy@M?ilPea}CesI}BT}R-Dkk|}@(-%|rhshT_42ir8 zypm@YQjp8D3-2yRhcbq*PnGqrq4lnUf5_tg6Z(R-E3pGFcs}$2yxP1J8S^cuv+#>i}OXV!0ynF7RNfQlAJ9He64=u;ws)ZKJGtypsDtwa5j3 z0Cm6%9;x7tD0~2PY$WFJDd0~a=@+t!_D`A*f`>P;))$@d^^CI4F>*7pVj_yb=B-o1q~!h6A?Te0P(O@g8Ie}YSHqJ1J4yb>ye z7hD5vgAZS;C+quuUB&NQ$OYem{P2Ruh2R6=@SBMtyd8W9lD_N(ul|2{jvaX}IB6TP zt)na;=PRQxxWSL0wa5dvv4##Rgtz^O_uN1d!{y*6%~yh*P$qK06V?fv8!4uG8P_z2?z zHvQmPkI@F;lfiQz#}51q@G`H-53A>0ijdgP1RsW^ypMowkl6144`}`ncpMUaL0Q8g zyx1Ka^gzW0KUL833umhRbQmZb%} zz(?C^9whlX!N_KKc(3LKcWT}TzNGm>;8D#7LA9HFv1tdr zdz4Cp7km*Cn|^S3i*6P@R|dZ7yVrDik~yq!DoTnf58~oM0*2|{LteU5pEqWj=Vv5&TC#;V5knlJY(R9)=_if~()6Euo(S zUi>zG!e@YQK{5_>gFin8kDX31>o=x+*m35T&~o&TgAMP{2jTr-H{_;V0q{Mj96kvC z8LEVzaf097AgR+_@Bv7Cs|7!Nmva(2J>blMDNg}6YQ7SDLGyla*78JO|#1 zKPjMns6`z@E_fRx<*f$Ohq2xOxnMn{ni*rkAS5;gFN;}Fo4g%d14$dm0Y8JpX39v5+6alf5|kIYjK`)8TmVVA7K4>gGV&_$B`6dA z5IFP<%7soE_*8;fmVICl+9$q&&$0Hd7XEqg=FzMbg5L%{4T=4IU=Jid2(B4pQQ4vc zE=s}{{9>>U68%Q-oN*R)9Qh3JaY%gdg6-q+e>dX;_-9D`{2Yv9&79b`gXd^|23QIW zL%$OIDO3o*7d$$VH7D?bV_2t`2A=^w42hk+;J<6W8|=}%;53KnXA0=n{5G%_lC*+8 z%?rMx`2ZNyyx`c$v@!A>4|*U;TMoVfNgRUUhAF%!2%QhWbI&y8Gr$#^&jQ_$q!p~u zyx?JIFKGqOnQErZo^DaMLSnxf+^=~*_-D<34xXK?^8(*J7hBi~fX8Q8jPX-&|18Q( zTlItY%_c_Z)PjFZF=HD97p7X&*T@%xSD$Cr^;&Sj`PdOT`1yCpYY+7Z7GGf2uiy?y z%5^XJ(|HzSJl_kBxX|=11H1`JCv6qDA8Lg6gHiKYTLy0fuZ61M3&FV;(az!1!5m29 zBY646tT{oR1wI3HlJ7q7OGsk%HTc>kW}oT;JsGCF9Gt(vlnZ{P`LDsb3r+vi!K*dD z7W_5TMPA)t^dj`S& zS5c4fTfj%N86V)iV99Fwcq?rZ{38@Z9t5k`nEnfvewVrv9q`@nS(F1l0M@RhyyzPU zFJ(LlCR}6kg0HV5hUgpxFU@8ABJEo6W=Qk{;PyQ7LtXye&H5FzUu(8=!3|I+I&QEIx|h5f!QVj=^Byp=(6nO*8zC8! z1%D4o+E2haMHbaf+B7g9lJ>9-v=&>`BgmcL-=PH7>nYX|2B36!!HY^5-{3RAUqf=P zISf8pN;@F!e78kCdA%t=4#s=THa{Qy0Fp8at}L^tTUqPS19|nirL0<5J_drtKdqE#0c`e^=QFlSo9%{hUyYLhJH1Ky&0_*X5 zz~mY;hJrtWByBag<8I21&b^@8VU|TO6%wD*!1?!BR0cYNZ{AD2!gqr=-e<<43haU^ zksEkF?F7CPyyXGxGVj_3ehEpw;cEkB&0z3h#zXW4;~rrj-VS~XNqN#zy$1|#du^RM8UO^i9nr-IKy4*2K6Hz3LPC^&ql$=ku(At~b>VA?Koj1_zl$|bEI zywbU{Xu(hT0QlQhe0YMo2ES=DdDYIjql0{r3*Pqx?G61}(6^U*hZh|Blvx+U zz!{nstkk?|{{_Zm_^cN>zr4g)4?hEJf@3G+ z1bu)!gY|&hp-oi7p0`1JNh>ePd;!|R{ZD!I;n4S(7jaKjUL+_l4-_52jhdI2 z=>0Lbky%KN6orl7oQN_ateUzG5I@*bzDluJOlDDN}!ai2j@-bW<7puD5!b9g~{ zKabcEl=tF@Tu|PLBXU7`Kaj`;<=sFc7nJw(2yeWv2VQ(I-qq7%^76h8S^q9Ng7Q8M z;RWU02*L}>T5I72WzD|ug7RJf;RR*wz3_svE?#&+S^F-$psaBhUQpJK3oj_^WQ7-$ z^~=Hw%GzG>Sy0x&3NLsN5*=Bm8q~b{7i=rIUve3=3Az-@hMZ72v>4g~(mwq=exHHrpnITO zq3fY*pk>fp=)({BeE@nLItV=l)j`{#&5#RP*u%XpXeKlX8VN-}Uwp)UU+8V<|84^# zKz~OBRrNo@7>Xce5IL{^Q<)r-_eXM`c>IWXQoegl$GG6 zTpqX8)~5UuYv)Zd(vh;vRZzk6z?=0x5|4}Zi9G1<%<>d%2sMsyPr?< zXZIG4OOv${1`v$QVeyx$7(ItLm%kYwErA`|ADmo%I2pCkoa(8j>5*8!{R) z8?qX58Y&yA8mb$-4ZenshOUP0hCoA4L$KjwLrzm}Q(=?4siw)>)Y0T`>S_u!1)J1P z`%cHsl${wnvv%h0bnmR%S+mo-vty@!XV=ca&fre9%f8F8D`i*4uB=_TyWG2~cGc|i z?&{d(-_^A%uq(Jr`RqQ2FU6PP%kt&=+`cMbjnC`r@cDgRzJM?2Q_c2fM{`PZMsrqk zZnL|&s=21w+uYIYZ|-UiG;_Cjw|%!`cgpUJ-C4VHce{62?XKDF-QBUUHkCAlM-}Oh8{{`^CkL{DMdQv$n^P}JMpd?|9bH7BtF{k zG7&$M@iZO(e0aDIA3O1~8$WyS^d!F8@HP>DlkqqmpEL0~2fqvPyb|B5@xB)SeUxAy zW$2_7-ISxpD2a`-BvP7W%9BosGAUCIr7EOcm6WWyrKY8}#oOX*>1f&4;&16}>1ye2 z3AFUI1Y1tFs8(C6y*07b(VE>?+(8tkD`h329zD{4a zug7=NXKPMuPHs+b&TP(UE^MxBu5PYv_BHP##@)pCWV4OPCKJ`n-8s7pcUSJN-d#(4 z_YvD};(Btojff@_%}gR$NEEAyppWQv61ko|C->NhSu*j;BvysQshSx1h)*Z6=^-vQ zVv&aGITVh*sTY6h&TTWYHTV-2yTWy=KZC_hw zTX$Pe+sQUtdt!TXdwP3jdro^{du4lddu_X~eP4TLdv|+J`$>LNP$^uO12%7>H`$x+ z&GhDY3%!-zYHzLA=iTS+^mcoDyeGZ3y2QHVy7aotx}3Vgy2`rhy4pHl-M+fcy6(E3 zx|4Ob`o#L=`tP)jf0*U(8X z@1cj=8WS6n8`B#z8*>^98!H>D8*3YVjr$rq8@n5O8c#Obni89mo6?&yn{YORd5VlF zbyamWb>6y;I)7bPU7#*lr|RwXj{21PjQXtl+y^S4>{>HAxKx42`HQAdS zO({(oO<9ac?xw2$-;YQ&^w|#jYZrYrNI$jHM^osZS*^LP?$)Z-npSUXN2|ZJt2NLX zY*lUcHb+}ZTSi+}TW*`Xt*Wi2&D++|=5On23$z8>RJ*<1(Vo(t(Vo?w+wN|!YOiVc zw#&yZWM1H7WbbUs+F8h0Udd>#s^oVC=7#ju|NSu}m!9LM?^MxyYUn>+dQb;_2*X`w z+jrBByJ^FTwBJH~mg=O%gvQh?Mu%L+2e&ao)G$VP86`RxC;UEhbj@V+ucg-qcPBD( W7ShZ8^lrz$Y#i(>1781++Wucx6{ofU literal 0 HcmV?d00001 diff --git a/node_modules/bcrypt/package.json b/node_modules/bcrypt/package.json new file mode 100644 index 00000000..621fc1be --- /dev/null +++ b/node_modules/bcrypt/package.json @@ -0,0 +1,67 @@ +{ + "name": "bcrypt", + "description": "A bcrypt library for NodeJS.", + "keywords": [ + "bcrypt", + "password", + "auth", + "authentication", + "encryption", + "crypt", + "crypto" + ], + "main": "./bcrypt", + "version": "5.1.1", + "author": "Nick Campbell (https://github.com/ncb000gt)", + "engines": { + "node": ">= 10.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/kelektiv/node.bcrypt.js.git" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/kelektiv/node.bcrypt.js/issues" + }, + "scripts": { + "test": "npm ci --build-from-source && jest", + "install": "node-pre-gyp install --fallback-to-build" + }, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.11", + "node-addon-api": "^5.0.0" + }, + "devDependencies": { + "jest": "^29.6.2" + }, + "contributors": [ + "Antonio Salazar Cardozo (https://github.com/Shadowfiend)", + "Van Nguyen (https://github.com/thegoleffect)", + "David Trejo (https://github.com/dtrejo)", + "Ben Glow (https://github.com/pixelglow)", + "NewITFarmer.com <> (https://github.com/newitfarmer)", + "Alfred Westerveld (https://github.com/alfredwesterveld)", + "Vincent Côté-Roy (https://github.com/vincentcr)", + "Lloyd Hilaiel (https://github.com/lloyd)", + "Roman Shtylman (https://github.com/shtylman)", + "Vadim Graboys (https://github.com/vadimg)", + "Ben Noorduis <> (https://github.com/bnoordhuis)", + "Nate Rajlich (https://github.com/tootallnate)", + "Sean McArthur (https://github.com/seanmonstar)", + "Fanie Oosthuysen (https://github.com/weareu)", + "Amitosh Swain Mahapatra (https://github.com/Agathver)", + "Corbin Crutchley (https://github.com/crutchcorn)", + "Nicola Del Gobbo (https://github.com/NickNaso)" + ], + "binary": { + "module_name": "bcrypt_lib", + "module_path": "./lib/binding/napi-v{napi_build_version}", + "package_name": "{module_name}-v{version}-napi-v{napi_build_version}-{platform}-{arch}-{libc}.tar.gz", + "host": "https://github.com", + "remote_path": "kelektiv/node.bcrypt.js/releases/download/v{version}", + "napi_versions": [ + 3 + ] + } +} diff --git a/node_modules/bcrypt/promises.js b/node_modules/bcrypt/promises.js new file mode 100644 index 00000000..cd820142 --- /dev/null +++ b/node_modules/bcrypt/promises.js @@ -0,0 +1,42 @@ +'use strict'; + +var Promise = global.Promise; + +/// encapsulate a method with a node-style callback in a Promise +/// @param {object} 'this' of the encapsulated function +/// @param {function} function to be encapsulated +/// @param {Array-like} args to be passed to the called function +/// @return {Promise} a Promise encapsulating the function +module.exports.promise = function (fn, context, args) { + + if (!Array.isArray(args)) { + args = Array.prototype.slice.call(args); + } + + if (typeof fn !== 'function') { + return Promise.reject(new Error('fn must be a function')); + } + + return new Promise(function(resolve, reject) { + args.push(function(err, data) { + if (err) { + reject(err); + } else { + resolve(data); + } + }); + + fn.apply(context, args); + }); +}; + +/// @param {err} the error to be thrown +module.exports.reject = function (err) { + return Promise.reject(err); +}; + +/// changes the promise implementation that bcrypt uses +/// @param {Promise} the implementation to use +module.exports.use = function(promise) { + Promise = promise; +}; diff --git a/node_modules/bcrypt/src/bcrypt.cc b/node_modules/bcrypt/src/bcrypt.cc new file mode 100644 index 00000000..bd8c5735 --- /dev/null +++ b/node_modules/bcrypt/src/bcrypt.cc @@ -0,0 +1,315 @@ +/* $OpenBSD: bcrypt.c,v 1.31 2014/03/22 23:02:03 tedu Exp $ */ + +/* + * Copyright (c) 1997 Niels Provos + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* This password hashing algorithm was designed by David Mazieres + * and works as follows: + * + * 1. state := InitState () + * 2. state := ExpandKey (state, salt, password) + * 3. REPEAT rounds: + * state := ExpandKey (state, 0, password) + * state := ExpandKey (state, 0, salt) + * 4. ctext := "OrpheanBeholderScryDoubt" + * 5. REPEAT 64: + * ctext := Encrypt_ECB (state, ctext); + * 6. RETURN Concatenate (salt, ctext); + * + */ + +#include +#include +#include +#include + +#include "node_blf.h" + +#ifdef _WIN32 +#define snprintf _snprintf +#endif + +//#if !defined(__APPLE__) && !defined(__MACH__) +//#include "bsd/stdlib.h" +//#endif + +/* This implementation is adaptable to current computing power. + * You can have up to 2^31 rounds which should be enough for some + * time to come. + */ + +static void encode_base64(u_int8_t *, u_int8_t *, u_int16_t); +static void decode_base64(u_int8_t *, u_int16_t, u_int8_t *); + +const static char* error = ":"; + +const static u_int8_t Base64Code[] = +"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + +const static u_int8_t index_64[128] = { + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 0, 1, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 255, 255, + 255, 255, 255, 255, 255, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 255, 255, 255, 255, 255, 255, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 255, 255, 255, 255, 255 +}; +#define CHAR64(c) ( (c) > 127 ? 255 : index_64[(c)]) + +static void +decode_base64(u_int8_t *buffer, u_int16_t len, u_int8_t *data) +{ + u_int8_t *bp = buffer; + u_int8_t *p = data; + u_int8_t c1, c2, c3, c4; + while (bp < buffer + len) { + c1 = CHAR64(*p); + c2 = CHAR64(*(p + 1)); + + /* Invalid data */ + if (c1 == 255 || c2 == 255) + break; + + *bp++ = (c1 << 2) | ((c2 & 0x30) >> 4); + if (bp >= buffer + len) + break; + + c3 = CHAR64(*(p + 2)); + if (c3 == 255) + break; + + *bp++ = ((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2); + if (bp >= buffer + len) + break; + + c4 = CHAR64(*(p + 3)); + if (c4 == 255) + break; + *bp++ = ((c3 & 0x03) << 6) | c4; + + p += 4; + } +} + +void +encode_salt(char *salt, u_int8_t *csalt, char minor, u_int16_t clen, u_int8_t logr) +{ + salt[0] = '$'; + salt[1] = BCRYPT_VERSION; + salt[2] = minor; + salt[3] = '$'; + + // Max rounds are 31 + snprintf(salt + 4, 4, "%2.2u$", logr & 0x001F); + + encode_base64((u_int8_t *) salt + 7, csalt, clen); +} + + +/* Generates a salt for this version of crypt. + Since versions may change. Keeping this here + seems sensible. + from: http://mail-index.netbsd.org/tech-crypto/2002/05/24/msg000204.html +*/ +void +bcrypt_gensalt(char minor, u_int8_t log_rounds, u_int8_t *seed, char *gsalt) +{ + if (log_rounds < 4) + log_rounds = 4; + else if (log_rounds > 31) + log_rounds = 31; + + encode_salt(gsalt, seed, minor, BCRYPT_MAXSALT, log_rounds); +} + +/* We handle $Vers$log2(NumRounds)$salt+passwd$ + i.e. $2$04$iwouldntknowwhattosayetKdJ6iFtacBqJdKe6aW7ou */ + +void +bcrypt(const char *key, size_t key_len, const char *salt, char *encrypted) +{ + blf_ctx state; + u_int32_t rounds, i, k; + u_int16_t j; + u_int8_t salt_len, logr, minor; + u_int8_t ciphertext[4 * BCRYPT_BLOCKS+1] = "OrpheanBeholderScryDoubt"; + u_int8_t csalt[BCRYPT_MAXSALT]; + u_int32_t cdata[BCRYPT_BLOCKS]; + int n; + + /* Discard "$" identifier */ + salt++; + + if (*salt > BCRYPT_VERSION) { + /* How do I handle errors ? Return ':' */ + strcpy(encrypted, error); + return; + } + + /* Check for minor versions */ + if (salt[1] != '$') { + switch (salt[1]) { + case 'a': /* 'ab' should not yield the same as 'abab' */ + case 'b': /* cap input length at 72 bytes */ + minor = salt[1]; + salt++; + break; + default: + strcpy(encrypted, error); + return; + } + } else + minor = 0; + + /* Discard version + "$" identifier */ + salt += 2; + + if (salt[2] != '$') { + /* Out of sync with passwd entry */ + strcpy(encrypted, error); + return; + } + + /* Computer power doesn't increase linear, 2^x should be fine */ + n = atoi(salt); + if (n > 31 || n < 0) { + strcpy(encrypted, error); + return; + } + logr = (u_int8_t)n; + if ((rounds = (u_int32_t) 1 << logr) < BCRYPT_MINROUNDS) { + strcpy(encrypted, error); + return; + } + + /* Discard num rounds + "$" identifier */ + salt += 3; + + if (strlen(salt) * 3 / 4 < BCRYPT_MAXSALT) { + strcpy(encrypted, error); + return; + } + + /* We dont want the base64 salt but the raw data */ + decode_base64(csalt, BCRYPT_MAXSALT, (u_int8_t *) salt); + salt_len = BCRYPT_MAXSALT; + if (minor <= 'a') + key_len = (u_int8_t)(key_len + (minor >= 'a' ? 1 : 0)); + else + { + /* cap key_len at the actual maximum supported + * length here to avoid integer wraparound */ + if (key_len > 72) + key_len = 72; + key_len++; /* include the NUL */ + } + + + /* Setting up S-Boxes and Subkeys */ + Blowfish_initstate(&state); + Blowfish_expandstate(&state, csalt, salt_len, + (u_int8_t *) key, key_len); + for (k = 0; k < rounds; k++) { + Blowfish_expand0state(&state, (u_int8_t *) key, key_len); + Blowfish_expand0state(&state, csalt, salt_len); + } + + /* This can be precomputed later */ + j = 0; + for (i = 0; i < BCRYPT_BLOCKS; i++) + cdata[i] = Blowfish_stream2word(ciphertext, 4 * BCRYPT_BLOCKS, &j); + + /* Now do the encryption */ + for (k = 0; k < 64; k++) + blf_enc(&state, cdata, BCRYPT_BLOCKS / 2); + + for (i = 0; i < BCRYPT_BLOCKS; i++) { + ciphertext[4 * i + 3] = cdata[i] & 0xff; + cdata[i] = cdata[i] >> 8; + ciphertext[4 * i + 2] = cdata[i] & 0xff; + cdata[i] = cdata[i] >> 8; + ciphertext[4 * i + 1] = cdata[i] & 0xff; + cdata[i] = cdata[i] >> 8; + ciphertext[4 * i + 0] = cdata[i] & 0xff; + } + + i = 0; + encrypted[i++] = '$'; + encrypted[i++] = BCRYPT_VERSION; + if (minor) + encrypted[i++] = minor; + encrypted[i++] = '$'; + + snprintf(encrypted + i, 4, "%2.2u$", logr & 0x001F); + + encode_base64((u_int8_t *) encrypted + i + 3, csalt, BCRYPT_MAXSALT); + encode_base64((u_int8_t *) encrypted + strlen(encrypted), ciphertext, + 4 * BCRYPT_BLOCKS - 1); + memset(&state, 0, sizeof(state)); + memset(ciphertext, 0, sizeof(ciphertext)); + memset(csalt, 0, sizeof(csalt)); + memset(cdata, 0, sizeof(cdata)); +} + +u_int32_t bcrypt_get_rounds(const char * hash) +{ + /* skip past the leading "$" */ + if (!hash || *(hash++) != '$') return 0; + + /* skip past version */ + if (0 == (*hash++)) return 0; + if (*hash && *hash != '$') hash++; + if (*hash++ != '$') return 0; + + return atoi(hash); +} + +static void +encode_base64(u_int8_t *buffer, u_int8_t *data, u_int16_t len) +{ + u_int8_t *bp = buffer; + u_int8_t *p = data; + u_int8_t c1, c2; + while (p < data + len) { + c1 = *p++; + *bp++ = Base64Code[(c1 >> 2)]; + c1 = (c1 & 0x03) << 4; + if (p >= data + len) { + *bp++ = Base64Code[c1]; + break; + } + c2 = *p++; + c1 |= (c2 >> 4) & 0x0f; + *bp++ = Base64Code[c1]; + c1 = (c2 & 0x0f) << 2; + if (p >= data + len) { + *bp++ = Base64Code[c1]; + break; + } + c2 = *p++; + c1 |= (c2 >> 6) & 0x03; + *bp++ = Base64Code[c1]; + *bp++ = Base64Code[c2 & 0x3f]; + } + *bp = '\0'; +} diff --git a/node_modules/bcrypt/src/bcrypt_node.cc b/node_modules/bcrypt/src/bcrypt_node.cc new file mode 100644 index 00000000..2f072a4f --- /dev/null +++ b/node_modules/bcrypt/src/bcrypt_node.cc @@ -0,0 +1,288 @@ +#define NAPI_VERSION 3 + +#include + +#include +#include +#include +#include // atoi + +#include "node_blf.h" + +#define NODE_LESS_THAN (!(NODE_VERSION_AT_LEAST(0, 5, 4))) + +namespace { + + bool ValidateSalt(const char* salt) { + + if (!salt || *salt != '$') { + return false; + } + + // discard $ + salt++; + + if (*salt > BCRYPT_VERSION) { + return false; + } + + if (salt[1] != '$') { + switch (salt[1]) { + case 'a': + case 'b': + salt++; + break; + default: + return false; + } + } + + // discard version + $ + salt += 2; + + if (salt[2] != '$') { + return false; + } + + int n = atoi(salt); + if (n > 31 || n < 0) { + return false; + } + + if (((uint8_t)1 << (uint8_t)n) < BCRYPT_MINROUNDS) { + return false; + } + + salt += 3; + if (strlen(salt) * 3 / 4 < BCRYPT_MAXSALT) { + return false; + } + + return true; + } + + inline char ToCharVersion(const std::string& str) { + return str[0]; + } + + /* SALT GENERATION */ + + class SaltAsyncWorker : public Napi::AsyncWorker { + public: + SaltAsyncWorker(const Napi::Function& callback, const std::string& seed, ssize_t rounds, char minor_ver) + : Napi::AsyncWorker(callback, "bcrypt:SaltAsyncWorker"), seed(seed), rounds(rounds), minor_ver(minor_ver) { + } + + ~SaltAsyncWorker() {} + + void Execute() { + bcrypt_gensalt(minor_ver, rounds, (u_int8_t *)&seed[0], salt); + } + + void OnOK() { + Napi::HandleScope scope(Env()); + Callback().Call({Env().Undefined(), Napi::String::New(Env(), salt)}); + } + + private: + std::string seed; + ssize_t rounds; + char minor_ver; + char salt[_SALT_LEN]; + }; + + Napi::Value GenerateSalt(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + if (info.Length() < 4) { + throw Napi::TypeError::New(env, "4 arguments expected"); + } + if (!info[0].IsString()) { + throw Napi::TypeError::New(env, "First argument must be a string"); + } + if (!info[2].IsBuffer() || (info[2].As>()).Length() != 16) { + throw Napi::TypeError::New(env, "Second argument must be a 16 byte Buffer"); + } + + const char minor_ver = ToCharVersion(info[0].As()); + const int32_t rounds = info[1].As(); + Napi::Buffer seed = info[2].As>(); + Napi::Function callback = info[3].As(); + SaltAsyncWorker* saltWorker = new SaltAsyncWorker(callback, std::string(seed.Data(), 16), rounds, minor_ver); + saltWorker->Queue(); + return env.Undefined(); + } + + Napi::Value GenerateSaltSync(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + if (info.Length() < 3) { + throw Napi::TypeError::New(env, "3 arguments expected"); + } + if (!info[0].IsString()) { + throw Napi::TypeError::New(env, "First argument must be a string"); + } + if (!info[2].IsBuffer() || (info[2].As>()).Length() != 16) { + throw Napi::TypeError::New(env, "Third argument must be a 16 byte Buffer"); + } + const char minor_ver = ToCharVersion(info[0].As()); + const int32_t rounds = info[1].As(); + Napi::Buffer buffer = info[2].As>(); + u_int8_t* seed = (u_int8_t*) buffer.Data(); + char salt[_SALT_LEN]; + bcrypt_gensalt(minor_ver, rounds, seed, salt); + return Napi::String::New(env, salt, strlen(salt)); + } + + inline std::string BufferToString(const Napi::Buffer &buf) { + return std::string(buf.Data(), buf.Length()); + } + + /* ENCRYPT DATA - USED TO BE HASHPW */ + + class EncryptAsyncWorker : public Napi::AsyncWorker { + public: + EncryptAsyncWorker(const Napi::Function& callback, const std::string& input, const std::string& salt) + : Napi::AsyncWorker(callback, "bcrypt:EncryptAsyncWorker"), input(input), salt(salt) { + } + + ~EncryptAsyncWorker() {} + + void Execute() { + if (!(ValidateSalt(salt.c_str()))) { + SetError("Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue"); + } + bcrypt(input.c_str(), input.length(), salt.c_str(), bcrypted); + } + + void OnOK() { + Napi::HandleScope scope(Env()); + Callback().Call({Env().Undefined(),Napi::String::New(Env(), bcrypted)}); + } + private: + std::string input; + std::string salt; + char bcrypted[_PASSWORD_LEN]; + }; + + Napi::Value Encrypt(const Napi::CallbackInfo& info) { + if (info.Length() < 3) { + throw Napi::TypeError::New(info.Env(), "3 arguments expected"); + } + std::string data = info[0].IsBuffer() + ? BufferToString(info[0].As>()) + : info[0].As(); + std::string salt = info[1].As(); + Napi::Function callback = info[2].As(); + EncryptAsyncWorker* encryptWorker = new EncryptAsyncWorker(callback, data, salt); + encryptWorker->Queue(); + return info.Env().Undefined(); + } + + Napi::Value EncryptSync(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + if (info.Length() < 2) { + throw Napi::TypeError::New(info.Env(), "2 arguments expected"); + } + std::string data = info[0].IsBuffer() + ? BufferToString(info[0].As>()) + : info[0].As(); + std::string salt = info[1].As(); + if (!(ValidateSalt(salt.c_str()))) { + throw Napi::Error::New(env, "Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue"); + } + char bcrypted[_PASSWORD_LEN]; + bcrypt(data.c_str(), data.length(), salt.c_str(), bcrypted); + return Napi::String::New(env, bcrypted, strlen(bcrypted)); + } + + /* COMPARATOR */ + inline bool CompareStrings(const char* s1, const char* s2) { + return strcmp(s1, s2) == 0; + } + + class CompareAsyncWorker : public Napi::AsyncWorker { + public: + CompareAsyncWorker(const Napi::Function& callback, const std::string& input, const std::string& encrypted) + : Napi::AsyncWorker(callback, "bcrypt:CompareAsyncWorker"), input(input), encrypted(encrypted) { + result = false; + } + + ~CompareAsyncWorker() {} + + void Execute() { + char bcrypted[_PASSWORD_LEN]; + if (ValidateSalt(encrypted.c_str())) { + bcrypt(input.c_str(), input.length(), encrypted.c_str(), bcrypted); + result = CompareStrings(bcrypted, encrypted.c_str()); + } + } + + void OnOK() { + Napi::HandleScope scope(Env()); + Callback().Call({Env().Undefined(), Napi::Boolean::New(Env(), result)}); + } + + private: + std::string input; + std::string encrypted; + bool result; + }; + + Napi::Value Compare(const Napi::CallbackInfo& info) { + if (info.Length() < 3) { + throw Napi::TypeError::New(info.Env(), "3 arguments expected"); + } + std::string input = info[0].IsBuffer() + ? BufferToString(info[0].As>()) + : info[0].As(); + std::string encrypted = info[1].As(); + Napi::Function callback = info[2].As(); + CompareAsyncWorker* compareWorker = new CompareAsyncWorker(callback, input, encrypted); + compareWorker->Queue(); + return info.Env().Undefined(); + } + + Napi::Value CompareSync(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + if (info.Length() < 2) { + throw Napi::TypeError::New(info.Env(), "2 arguments expected"); + } + std::string pw = info[0].IsBuffer() + ? BufferToString(info[0].As>()) + : info[0].As(); + std::string hash = info[1].As(); + char bcrypted[_PASSWORD_LEN]; + if (ValidateSalt(hash.c_str())) { + bcrypt(pw.c_str(), pw.length(), hash.c_str(), bcrypted); + return Napi::Boolean::New(env, CompareStrings(bcrypted, hash.c_str())); + } else { + return Napi::Boolean::New(env, false); + } + } + + Napi::Value GetRounds(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + if (info.Length() < 1) { + throw Napi::TypeError::New(env, "1 argument expected"); + } + std::string hash = info[0].As(); + u_int32_t rounds; + if (!(rounds = bcrypt_get_rounds(hash.c_str()))) { + throw Napi::Error::New(env, "invalid hash provided"); + } + return Napi::Number::New(env, rounds); + } + +} // anonymous namespace + +Napi::Object init(Napi::Env env, Napi::Object exports) { + exports.Set(Napi::String::New(env, "gen_salt_sync"), Napi::Function::New(env, GenerateSaltSync)); + exports.Set(Napi::String::New(env, "encrypt_sync"), Napi::Function::New(env, EncryptSync)); + exports.Set(Napi::String::New(env, "compare_sync"), Napi::Function::New(env, CompareSync)); + exports.Set(Napi::String::New(env, "get_rounds"), Napi::Function::New(env, GetRounds)); + exports.Set(Napi::String::New(env, "gen_salt"), Napi::Function::New(env, GenerateSalt)); + exports.Set(Napi::String::New(env, "encrypt"), Napi::Function::New(env, Encrypt)); + exports.Set(Napi::String::New(env, "compare"), Napi::Function::New(env, Compare)); + return exports; +} + +NODE_API_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/node_modules/bcrypt/src/blowfish.cc b/node_modules/bcrypt/src/blowfish.cc new file mode 100644 index 00000000..1fc6cf19 --- /dev/null +++ b/node_modules/bcrypt/src/blowfish.cc @@ -0,0 +1,679 @@ +/* $OpenBSD: blowfish.c,v 1.18 2004/11/02 17:23:26 hshoexer Exp $ */ +/* + * Blowfish block cipher for OpenBSD + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Implementation advice by David Mazieres . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Niels Provos. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This code is derived from section 14.3 and the given source + * in section V of Applied Cryptography, second edition. + * Blowfish is an unpatented fast block cipher designed by + * Bruce Schneier. + */ + +#include "node_blf.h" + +#undef inline +#ifdef __GNUC__ +#define inline __inline +#else /* !__GNUC__ */ +#define inline +#endif /* !__GNUC__ */ + +/* Function for Feistel Networks */ + +#define F(s, x) ((((s)[ (((x)>>24)&0xFF)] \ + + (s)[0x100 + (((x)>>16)&0xFF)]) \ + ^ (s)[0x200 + (((x)>> 8)&0xFF)]) \ + + (s)[0x300 + ( (x) &0xFF)]) + +#define BLFRND(s,p,i,j,n) (i ^= F(s,j) ^ (p)[n]) + +void +Blowfish_encipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) +{ + u_int32_t Xl; + u_int32_t Xr; + u_int32_t *s = c->S[0]; + u_int32_t *p = c->P; + + Xl = *xl; + Xr = *xr; + + Xl ^= p[0]; + BLFRND(s, p, Xr, Xl, 1); BLFRND(s, p, Xl, Xr, 2); + BLFRND(s, p, Xr, Xl, 3); BLFRND(s, p, Xl, Xr, 4); + BLFRND(s, p, Xr, Xl, 5); BLFRND(s, p, Xl, Xr, 6); + BLFRND(s, p, Xr, Xl, 7); BLFRND(s, p, Xl, Xr, 8); + BLFRND(s, p, Xr, Xl, 9); BLFRND(s, p, Xl, Xr, 10); + BLFRND(s, p, Xr, Xl, 11); BLFRND(s, p, Xl, Xr, 12); + BLFRND(s, p, Xr, Xl, 13); BLFRND(s, p, Xl, Xr, 14); + BLFRND(s, p, Xr, Xl, 15); BLFRND(s, p, Xl, Xr, 16); + + *xl = Xr ^ p[17]; + *xr = Xl; +} + +void +Blowfish_decipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) +{ + u_int32_t Xl; + u_int32_t Xr; + u_int32_t *s = c->S[0]; + u_int32_t *p = c->P; + + Xl = *xl; + Xr = *xr; + + Xl ^= p[17]; + BLFRND(s, p, Xr, Xl, 16); BLFRND(s, p, Xl, Xr, 15); + BLFRND(s, p, Xr, Xl, 14); BLFRND(s, p, Xl, Xr, 13); + BLFRND(s, p, Xr, Xl, 12); BLFRND(s, p, Xl, Xr, 11); + BLFRND(s, p, Xr, Xl, 10); BLFRND(s, p, Xl, Xr, 9); + BLFRND(s, p, Xr, Xl, 8); BLFRND(s, p, Xl, Xr, 7); + BLFRND(s, p, Xr, Xl, 6); BLFRND(s, p, Xl, Xr, 5); + BLFRND(s, p, Xr, Xl, 4); BLFRND(s, p, Xl, Xr, 3); + BLFRND(s, p, Xr, Xl, 2); BLFRND(s, p, Xl, Xr, 1); + + *xl = Xr ^ p[0]; + *xr = Xl; +} + +void +Blowfish_initstate(blf_ctx *c) +{ + /* P-box and S-box tables initialized with digits of Pi */ + + static const blf_ctx initstate = + { { + { + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a}, + { + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7}, + { + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0}, + { + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6} + }, + { + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b + } }; + + *c = initstate; +} + +u_int32_t +Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, + u_int16_t *current) +{ + u_int8_t i; + u_int16_t j; + u_int32_t temp; + + temp = 0x00000000; + j = *current; + + for (i = 0; i < 4; i++, j++) { + if (j >= databytes) + j = 0; + temp = (temp << 8) | data[j]; + } + + *current = j; + return temp; +} + +void +Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) +{ + u_int16_t i; + u_int16_t j; + u_int16_t k; + u_int32_t temp; + u_int32_t datal; + u_int32_t datar; + + j = 0; + for (i = 0; i < BLF_N + 2; i++) { + /* Extract 4 int8 to 1 int32 from keystream */ + temp = Blowfish_stream2word(key, keybytes, &j); + c->P[i] = c->P[i] ^ temp; + } + + j = 0; + datal = 0x00000000; + datar = 0x00000000; + for (i = 0; i < BLF_N + 2; i += 2) { + Blowfish_encipher(c, &datal, &datar); + + c->P[i] = datal; + c->P[i + 1] = datar; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + Blowfish_encipher(c, &datal, &datar); + + c->S[i][k] = datal; + c->S[i][k + 1] = datar; + } + } +} + + +void +Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, + const u_int8_t *key, u_int16_t keybytes) +{ + u_int16_t i; + u_int16_t j; + u_int16_t k; + u_int32_t temp; + u_int32_t datal; + u_int32_t datar; + + j = 0; + for (i = 0; i < BLF_N + 2; i++) { + /* Extract 4 int8 to 1 int32 from keystream */ + temp = Blowfish_stream2word(key, keybytes, &j); + c->P[i] = c->P[i] ^ temp; + } + + j = 0; + datal = 0x00000000; + datar = 0x00000000; + for (i = 0; i < BLF_N + 2; i += 2) { + datal ^= Blowfish_stream2word(data, databytes, &j); + datar ^= Blowfish_stream2word(data, databytes, &j); + Blowfish_encipher(c, &datal, &datar); + + c->P[i] = datal; + c->P[i + 1] = datar; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + datal ^= Blowfish_stream2word(data, databytes, &j); + datar ^= Blowfish_stream2word(data, databytes, &j); + Blowfish_encipher(c, &datal, &datar); + + c->S[i][k] = datal; + c->S[i][k + 1] = datar; + } + } + +} + +void +blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) +{ + /* Initialize S-boxes and subkeys with Pi */ + Blowfish_initstate(c); + + /* Transform S-boxes and subkeys with key */ + Blowfish_expand0state(c, k, len); +} + +void +blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) +{ + u_int32_t *d; + u_int16_t i; + + d = data; + for (i = 0; i < blocks; i++) { + Blowfish_encipher(c, d, d + 1); + d += 2; + } +} + +void +blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) +{ + u_int32_t *d; + u_int16_t i; + + d = data; + for (i = 0; i < blocks; i++) { + Blowfish_decipher(c, d, d + 1); + d += 2; + } +} + +void +blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) +{ + u_int32_t l, r; + u_int32_t i; + + for (i = 0; i < len; i += 8) { + l = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]; + r = data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]; + Blowfish_encipher(c, &l, &r); + data[0] = l >> 24 & 0xff; + data[1] = l >> 16 & 0xff; + data[2] = l >> 8 & 0xff; + data[3] = l & 0xff; + data[4] = r >> 24 & 0xff; + data[5] = r >> 16 & 0xff; + data[6] = r >> 8 & 0xff; + data[7] = r & 0xff; + data += 8; + } +} + +void +blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) +{ + u_int32_t l, r; + u_int32_t i; + + for (i = 0; i < len; i += 8) { + l = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]; + r = data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]; + Blowfish_decipher(c, &l, &r); + data[0] = l >> 24 & 0xff; + data[1] = l >> 16 & 0xff; + data[2] = l >> 8 & 0xff; + data[3] = l & 0xff; + data[4] = r >> 24 & 0xff; + data[5] = r >> 16 & 0xff; + data[6] = r >> 8 & 0xff; + data[7] = r & 0xff; + data += 8; + } +} + +void +blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) +{ + u_int32_t l, r; + u_int32_t i, j; + + for (i = 0; i < len; i += 8) { + for (j = 0; j < 8; j++) + data[j] ^= iv[j]; + l = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]; + r = data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]; + Blowfish_encipher(c, &l, &r); + data[0] = l >> 24 & 0xff; + data[1] = l >> 16 & 0xff; + data[2] = l >> 8 & 0xff; + data[3] = l & 0xff; + data[4] = r >> 24 & 0xff; + data[5] = r >> 16 & 0xff; + data[6] = r >> 8 & 0xff; + data[7] = r & 0xff; + iv = data; + data += 8; + } +} + +void +blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) +{ + u_int32_t l, r; + u_int8_t *iv; + u_int32_t i, j; + + iv = data + len - 16; + data = data + len - 8; + for (i = len - 8; i >= 8; i -= 8) { + l = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]; + r = data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]; + Blowfish_decipher(c, &l, &r); + data[0] = l >> 24 & 0xff; + data[1] = l >> 16 & 0xff; + data[2] = l >> 8 & 0xff; + data[3] = l & 0xff; + data[4] = r >> 24 & 0xff; + data[5] = r >> 16 & 0xff; + data[6] = r >> 8 & 0xff; + data[7] = r & 0xff; + for (j = 0; j < 8; j++) + data[j] ^= iv[j]; + iv -= 8; + data -= 8; + } + l = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]; + r = data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]; + Blowfish_decipher(c, &l, &r); + data[0] = l >> 24 & 0xff; + data[1] = l >> 16 & 0xff; + data[2] = l >> 8 & 0xff; + data[3] = l & 0xff; + data[4] = r >> 24 & 0xff; + data[5] = r >> 16 & 0xff; + data[6] = r >> 8 & 0xff; + data[7] = r & 0xff; + for (j = 0; j < 8; j++) + data[j] ^= iva[j]; +} + +#if 0 +void +report(u_int32_t data[], u_int16_t len) +{ + u_int16_t i; + for (i = 0; i < len; i += 2) + printf("Block %0hd: %08lx %08lx.\n", + i / 2, data[i], data[i + 1]); +} +void +main(void) +{ + + blf_ctx c; + char key[] = "AAAAA"; + char key2[] = "abcdefghijklmnopqrstuvwxyz"; + + u_int32_t data[10]; + u_int32_t data2[] = + {0x424c4f57l, 0x46495348l}; + + u_int16_t i; + + /* First test */ + for (i = 0; i < 10; i++) + data[i] = i; + + blf_key(&c, (u_int8_t *) key, 5); + blf_enc(&c, data, 5); + blf_dec(&c, data, 1); + blf_dec(&c, data + 2, 4); + printf("Should read as 0 - 9.\n"); + report(data, 10); + + /* Second test */ + blf_key(&c, (u_int8_t *) key2, strlen(key2)); + blf_enc(&c, data2, 1); + printf("\nShould read as: 0x324ed0fe 0xf413a203.\n"); + report(data2, 2); + blf_dec(&c, data2, 1); + report(data2, 2); +} +#endif diff --git a/node_modules/bcrypt/src/node_blf.h b/node_modules/bcrypt/src/node_blf.h new file mode 100644 index 00000000..2d50a39b --- /dev/null +++ b/node_modules/bcrypt/src/node_blf.h @@ -0,0 +1,132 @@ +/* $OpenBSD: blf.h,v 1.7 2007/03/14 17:59:41 grunk Exp $ */ +/* + * Blowfish - a fast block cipher designed by Bruce Schneier + * + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Niels Provos. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NODE_BLF_H_ +#define _NODE_BLF_H_ + +#include + +/* Solaris compatibility */ +#ifdef __sun +#define u_int8_t uint8_t +#define u_int16_t uint16_t +#define u_int32_t uint32_t +#define u_int64_t uint64_t +#endif + +#ifdef _WIN32 +#define u_int8_t unsigned __int8 +#define u_int16_t unsigned __int16 +#define u_int32_t unsigned __int32 +#define u_int64_t unsigned __int64 +#endif + +/* Windows ssize_t compatibility */ +#if defined(_WIN32) || defined(_WIN64) +# if defined(_WIN64) + typedef __int64 LONG_PTR; +# else + typedef long LONG_PTR; +# endif + typedef LONG_PTR SSIZE_T; + typedef SSIZE_T ssize_t; +#endif + +/* z/OS compatibility */ +#ifdef __MVS__ +typedef unsigned char u_int8_t; +typedef unsigned short u_int16_t; +typedef unsigned int u_int32_t; +typedef unsigned long long u_int64_t; +#endif + +#define BCRYPT_VERSION '2' +#define BCRYPT_MAXSALT 16 /* Precomputation is just so nice */ +#define BCRYPT_BLOCKS 6 /* Ciphertext blocks */ +#define BCRYPT_MINROUNDS 16 /* we have log2(rounds) in salt */ + +/* Schneier specifies a maximum key length of 56 bytes. + * This ensures that every key bit affects every cipher + * bit. However, the subkeys can hold up to 72 bytes. + * Warning: For normal blowfish encryption only 56 bytes + * of the key affect all cipherbits. + */ + +#define BLF_N 16 /* Number of Subkeys */ +#define BLF_MAXKEYLEN ((BLF_N-2)*4) /* 448 bits */ +#define BLF_MAXUTILIZED ((BLF_N+2)*4) /* 576 bits */ + +#define _PASSWORD_LEN 128 /* max length, not counting NUL */ +#define _SALT_LEN 32 /* max length */ + +/* Blowfish context */ +typedef struct BlowfishContext { + u_int32_t S[4][256]; /* S-Boxes */ + u_int32_t P[BLF_N + 2]; /* Subkeys */ +} blf_ctx; + +/* Raw access to customized Blowfish + * blf_key is just: + * Blowfish_initstate( state ) + * Blowfish_expand0state( state, key, keylen ) + */ + +void Blowfish_encipher(blf_ctx *, u_int32_t *, u_int32_t *); +void Blowfish_decipher(blf_ctx *, u_int32_t *, u_int32_t *); +void Blowfish_initstate(blf_ctx *); +void Blowfish_expand0state(blf_ctx *, const u_int8_t *, u_int16_t); +void Blowfish_expandstate +(blf_ctx *, const u_int8_t *, u_int16_t, const u_int8_t *, u_int16_t); + +/* Standard Blowfish */ + +void blf_key(blf_ctx *, const u_int8_t *, u_int16_t); +void blf_enc(blf_ctx *, u_int32_t *, u_int16_t); +void blf_dec(blf_ctx *, u_int32_t *, u_int16_t); + +void blf_ecb_encrypt(blf_ctx *, u_int8_t *, u_int32_t); +void blf_ecb_decrypt(blf_ctx *, u_int8_t *, u_int32_t); + +void blf_cbc_encrypt(blf_ctx *, u_int8_t *, u_int8_t *, u_int32_t); +void blf_cbc_decrypt(blf_ctx *, u_int8_t *, u_int8_t *, u_int32_t); + +/* Converts u_int8_t to u_int32_t */ +u_int32_t Blowfish_stream2word(const u_int8_t *, u_int16_t , u_int16_t *); + +/* bcrypt functions*/ +void bcrypt_gensalt(char, u_int8_t, u_int8_t*, char *); +void bcrypt(const char *, size_t key_len, const char *, char *); +void encode_salt(char *, u_int8_t *, char, u_int16_t, u_int8_t); +u_int32_t bcrypt_get_rounds(const char *); + +#endif diff --git a/node_modules/bcrypt/test-docker.sh b/node_modules/bcrypt/test-docker.sh new file mode 100644 index 00000000..7936cf7d --- /dev/null +++ b/node_modules/bcrypt/test-docker.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -xe + +echo "Running on $(node -v)" + +# Cleanup +rm -rf node_modules build-tmp-* lib/binding + +# Install build dependencies +if [ -f /etc/alpine-release ]; then + apk add --no-cache --virtual .build-deps make gcc g++ python3 +fi + +su node -c "npm test; npx node-pre-gyp package" diff --git a/node_modules/bcrypt/test/async.test.js b/node_modules/bcrypt/test/async.test.js new file mode 100644 index 00000000..fb59367a --- /dev/null +++ b/node_modules/bcrypt/test/async.test.js @@ -0,0 +1,209 @@ +const bcrypt = require('../bcrypt'); + +test('salt_length', done => { + expect.assertions(1); + bcrypt.genSalt(10, function (err, salt) { + expect(salt).toHaveLength(29); + done(); + }); +}) + +test('salt_only_cb', () => { + expect.assertions(1); + expect(() => { + bcrypt.genSalt((err, salt) => { + }); + }).not.toThrow(); +}) + +test('salt_rounds_is_string_number', done => { + expect.assertions(2); + bcrypt.genSalt('10', void 0, function (err, salt) { + expect(err instanceof Error).toBe(true) + expect(err.message).toBe('rounds must be a number') + done(); + }); +}) + +test('salt_rounds_is_string_non_number', done => { + expect.assertions(2); + bcrypt.genSalt('z', function (err, salt) { + expect(err instanceof Error).toBe(true) + expect(err.message).toBe('rounds must be a number') + done(); + }); +}) + +test('salt_minor', done => { + expect.assertions(3); + bcrypt.genSalt(10, 'a', function (err, value) { + expect(value).toHaveLength(29); + const [_, minor, salt] = value.split('$'); + expect(minor).toEqual('2a'); + expect(salt).toEqual('10'); + done(); + }); +}) + +test('salt_minor_b', done => { + expect.assertions(3); + bcrypt.genSalt(10, 'b', function (err, value) { + expect(value).toHaveLength(29); + const [_, minor, salt] = value.split('$'); + expect(minor).toEqual('2b'); + expect(salt).toEqual('10'); + done(); + }); +}) + +test('hash', done => { + expect.assertions(2); + bcrypt.genSalt(10, function (err, salt) { + bcrypt.hash('password', salt, function (err, res) { + expect(res).toBeDefined(); + expect(err).toBeUndefined(); + done(); + }); + }); +}) + +test('hash_rounds', done => { + expect.assertions(1); + bcrypt.hash('bacon', 8, function (err, hash) { + expect(bcrypt.getRounds(hash)).toEqual(8); + done(); + }); +}) + +test('hash_empty_strings', done => { + expect.assertions(1); + bcrypt.genSalt(10, function (err, salt) { + bcrypt.hash('', salt, function (err, res) { + expect(res).toBeDefined(); + done(); + }); + }); +}) + +test('hash_fails_with_empty_salt', done => { + expect.assertions(1); + bcrypt.hash('', '', function (err, res) { + expect(err.message).toBe('Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue') + done(); + }); +}) + +test('hash_no_params', done => { + expect.assertions(1); + bcrypt.hash(function (err, hash) { + expect(err.message).toBe('data must be a string or Buffer and salt must either be a salt string or a number of rounds') + done(); + }); +}) + +test('hash_one_param', done => { + expect.assertions(1); + bcrypt.hash('password', function (err, hash) { + expect(err.message).toBe('data must be a string or Buffer and salt must either be a salt string or a number of rounds'); + done(); + }); +}) + +test('hash_salt_validity', done => { + expect.assertions(2); + bcrypt.hash('password', '$2a$10$somesaltyvaluertsetrse', function (err, enc) { + expect(err).toBeUndefined(); + bcrypt.hash('password', 'some$value', function (err, enc) { + expect(err.message).toBe("Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue"); + done(); + }); + }); +}) + +test('verify_salt', done => { + expect.assertions(2); + bcrypt.genSalt(10, function (err, value) { + const [_, version, rounds] = value.split('$'); + expect(version).toEqual('2b'); + expect(rounds).toEqual('10'); + done(); + }); +}) + +test('verify_salt_min_rounds', done => { + expect.assertions(2); + bcrypt.genSalt(1, function (err, value) { + const [_, version, rounds] = value.split('$'); + expect(version).toEqual('2b'); + expect(rounds).toEqual('04'); + done(); + }); +}) + +test('verify_salt_max_rounds', done => { + expect.assertions(2); + bcrypt.genSalt(100, function (err, value) { + const [_, version, rounds] = value.split('$'); + expect(version).toEqual('2b'); + expect(rounds).toEqual('31'); + done(); + }); +}) + +test('hash_compare', done => { + expect.assertions(2); + bcrypt.genSalt(10, function (err, salt) { + bcrypt.hash("test", salt, function (err, hash) { + bcrypt.compare("test", hash, function (err, res) { + expect(hash).toBeDefined(); + bcrypt.compare("blah", hash, function (err, res) { + expect(res).toBe(false); + done(); + }); + }); + }); + }); +}) + +test('hash_compare_empty_strings', done => { + expect.assertions(2); + const hash = bcrypt.hashSync("test", bcrypt.genSaltSync(10)); + + bcrypt.compare("", hash, function (err, res) { + expect(res).toEqual(false) + bcrypt.compare("", "", function (err, res) { + expect(res).toEqual(false); + done(); + }); + }); +}) + +test('hash_compare_invalid_strings', done => { + expect.assertions(2); + const fullString = 'envy1362987212538'; + const hash = '$2a$10$XOPbrlUPQdwdJUpSrIF6X.LbE14qsMmKGhM1A8W9iqaG3vv1BD7WC'; + const wut = ':'; + bcrypt.compare(fullString, hash, function (err, res) { + expect(res).toBe(true); + bcrypt.compare(fullString, wut, function (err, res) { + expect(res).toBe(false); + done(); + }); + }); +}) + +test('compare_no_params', done => { + expect.assertions(1); + bcrypt.compare(function (err, hash) { + expect(err.message).toBe('data and hash arguments required'); + done(); + }); +}) + +test('hash_compare_one_param', done => { + expect.assertions(1); + bcrypt.compare('password', function (err, hash) { + expect(err.message).toBe('data and hash arguments required'); + done(); + }); +}) diff --git a/node_modules/bcrypt/test/implementation.test.js b/node_modules/bcrypt/test/implementation.test.js new file mode 100644 index 00000000..647f32a9 --- /dev/null +++ b/node_modules/bcrypt/test/implementation.test.js @@ -0,0 +1,48 @@ +const bcrypt = require('../bcrypt'); + +// some tests were adapted from https://github.com/riverrun/bcrypt_elixir/blob/master/test/base_test.exs +// which are under the BSD LICENSE + +test('openwall', () => { + expect(bcrypt.hashSync("U*U", "$2a$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW"); + expect(bcrypt.hashSync("U*U*", "$2a$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwK"); + expect(bcrypt.hashSync("U*U*U", "$2a$05$XXXXXXXXXXXXXXXXXXXXXO")).toStrictEqual("$2a$05$XXXXXXXXXXXXXXXXXXXXXOAcXxm9kjPGEMsLznoKqmqw7tc8WCx4a"); + expect(bcrypt.hashSync("", "$2a$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCC.7uG0VCzI2bS7j6ymqJi9CdcdxiRTWNy"); + expect(bcrypt.hashSync("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "$2a$05$abcdefghijklmnopqrstuu")).toStrictEqual("$2a$05$abcdefghijklmnopqrstuu5s2v8.iXieOjg/.AySBTTZIIVFJeBui"); +}) + +test('openbsd', () => { + expect(bcrypt.hashSync("000000000000000000000000000000000000000000000000000000000000000000000000", "$2a$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCC.6.O1dLNbjod2uo0DVcW.jHucKbPDdHS") + expect(bcrypt.hashSync("000000000000000000000000000000000000000000000000000000000000000000000000", "$2b$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2b$05$CCCCCCCCCCCCCCCCCCCCC.6.O1dLNbjod2uo0DVcW.jHucKbPDdHS") +}) + +test('long_passwords', () => { + // bcrypt wrap-around bug in $2a$ + expect(bcrypt.hashSync("012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234", "$2a$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCC.6.O1dLNbjod2uo0DVcW.jHucKbPDdHS") + expect(bcrypt.hashSync("01XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "$2a$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCC.6.O1dLNbjod2uo0DVcW.jHucKbPDdHS") + + // tests for $2b$ which fixes wrap-around bugs + expect(bcrypt.hashSync("012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234", "$2b$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2b$05$CCCCCCCCCCCCCCCCCCCCC.XxrQqgBi/5Sxuq9soXzDtjIZ7w5pMfK") + expect(bcrypt.hashSync("0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345", "$2b$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2b$05$CCCCCCCCCCCCCCCCCCCCC.XxrQqgBi/5Sxuq9soXzDtjIZ7w5pMfK") +}) + +test('embedded_nulls', () => { + expect(bcrypt.hashSync("Passw\0rd123", "$2b$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2b$05$CCCCCCCCCCCCCCCCCCCCC.VHy/kzL4sCcX3Ib3wN5rNGiRt.TpfxS") + expect(bcrypt.hashSync("Passw\0 you can literally write anything after the NUL character", "$2b$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2b$05$CCCCCCCCCCCCCCCCCCCCC.4vJLJQ6nZ/70INTjjSZWQ0iyUek92tu") + expect(bcrypt.hashSync(Buffer.from("Passw\0 you can literally write anything after the NUL character"), "$2b$05$CCCCCCCCCCCCCCCCCCCCC.")).toStrictEqual("$2b$05$CCCCCCCCCCCCCCCCCCCCC.4vJLJQ6nZ/70INTjjSZWQ0iyUek92tu") +}) + +test('shorten_salt_to_128_bits', () => { + expect(bcrypt.hashSync("test", "$2a$10$1234567899123456789012")).toStrictEqual("$2a$10$123456789912345678901u.OtL1A1eGK5wmvBKUDYKvuVKI7h2XBu") + expect(bcrypt.hashSync("U*U*", "$2a$05$CCCCCCCCCCCCCCCCCCCCCh")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCCeUQ7VjYZ2hd4bLYZdhuPpZMUpEUJDw1S") + expect(bcrypt.hashSync("U*U*", "$2a$05$CCCCCCCCCCCCCCCCCCCCCM")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwK") + expect(bcrypt.hashSync("U*U*", "$2a$05$CCCCCCCCCCCCCCCCCCCCCA")).toStrictEqual("$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwK") +}) + +test('consistency', () => { + expect(bcrypt.hashSync("ππππππππ", "$2a$10$.TtQJ4Jr6isd4Hp.mVfZeu")).toStrictEqual("$2a$10$.TtQJ4Jr6isd4Hp.mVfZeuh6Gws4rOQ/vdBczhDx.19NFK0Y84Dle") + expect(bcrypt.hashSync("p@5sw0rd", "$2b$12$zQ4CooEXdGqcwi0PHsgc8e")).toStrictEqual("$2b$12$zQ4CooEXdGqcwi0PHsgc8eAf0DLXE/XHoBE8kCSGQ97rXwuClaPam") + expect(bcrypt.hashSync("C'est bon, la vie!", "$2b$12$cbo7LZ.wxgW4yxAA5Vqlv.")).toStrictEqual("$2b$12$cbo7LZ.wxgW4yxAA5Vqlv.KR6QFPt4qCdc9RYJNXxa/rbUOp.1sw.") + expect(bcrypt.hashSync("ἓν οἶδα ὅτι οὐδὲν οἶδα", "$2b$12$LeHKWR2bmrazi/6P22Jpau")).toStrictEqual("$2b$12$LeHKWR2bmrazi/6P22JpauX5my/eKwwKpWqL7L5iEByBnxNc76FRW") + expect(bcrypt.hashSync(Buffer.from("ἓν οἶδα ὅτι οὐδὲν οἶδα"), "$2b$12$LeHKWR2bmrazi/6P22Jpau")).toStrictEqual("$2b$12$LeHKWR2bmrazi/6P22JpauX5my/eKwwKpWqL7L5iEByBnxNc76FRW") +}) diff --git a/node_modules/bcrypt/test/promise.test.js b/node_modules/bcrypt/test/promise.test.js new file mode 100644 index 00000000..01034182 --- /dev/null +++ b/node_modules/bcrypt/test/promise.test.js @@ -0,0 +1,168 @@ +const bcrypt = require('../bcrypt'); +const promises = require('../promises'); + +test('salt_returns_promise_on_no_args', () => { + // make sure test passes with non-native implementations such as bluebird + // http://stackoverflow.com/questions/27746304/how-do-i-tell-if-an-object-is-a-promise + expect(typeof bcrypt.genSalt().then).toEqual('function') +}) + +test('salt_returns_promise_on_null_callback', () => { + expect(typeof bcrypt.genSalt(13, null, null).then).toEqual('function') +}) + +test('salt_length', () => { + return expect(bcrypt.genSalt(10)).resolves.toHaveLength(29); +}) + +test('salt_rounds_is_string_number', () => { + return expect(bcrypt.genSalt('10')).rejects.toThrow('rounds must be a number'); +}) + +test('salt_rounds_is_string_non_number', () => { + return expect(bcrypt.genSalt('b')).rejects.toThrow('rounds must be a number'); +}) + +test('hash_returns_promise_on_null_callback', () => { + expect(typeof bcrypt.hash('password', 10, null).then).toStrictEqual('function') +}) + +test('hash', () => { + return expect(bcrypt.genSalt(10) + .then(salt => bcrypt.hash('password', salt))).resolves.toBeDefined() +}) + +test('hash_rounds', () => { + return bcrypt.hash('bacon', 8).then(hash => { + expect(bcrypt.getRounds(hash)).toStrictEqual(8) + }); +}) + +test('hash_empty_strings', () => { + expect.assertions(2); + return Promise.all([ + expect(bcrypt.genSalt(10) + .then(salt => bcrypt.hash('', salt))) + .resolves.toBeDefined(), + expect(bcrypt.hash('', '')).rejects.toThrow(''), + ]); +}) + +test('hash_no_params', () => { + expect.assertions(1); + return expect(bcrypt.hash()).rejects.toThrow('data and salt arguments required'); +}) + +test('hash_one_param', () => { + return expect(bcrypt.hash('password')).rejects.toThrow('data and salt arguments required'); +}) + +test('hash_salt_validity', () => { + expect.assertions(2); + return Promise.all( + [ + expect(bcrypt.hash('password', '$2a$10$somesaltyvaluertsetrse')).resolves.toBeDefined(), + expect(bcrypt.hash('password', 'some$value')).rejects.toThrow("Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue") + ]); +}) + +test('verify_salt', () => { + expect.assertions(2); + return bcrypt.genSalt(10).then(result => { + const [_, version, salt] = result.split('$'); + expect(version).toEqual('2b') + expect(salt).toEqual('10') + }); +}) + +test('verify_salt_min_rounds', () => { + expect.assertions(2); + return bcrypt.genSalt(1).then(value => { + const [_, version, rounds] = value.split('$'); + expect(version).toEqual('2b'); + expect(rounds).toEqual('04'); + }); +}) + +test('verify_salt_max_rounds', () => { + expect.assertions(2); + return bcrypt.genSalt(100).then(value => { + const [_, version, rounds] = value.split('$'); + expect(version).toEqual('2b'); + expect(rounds).toEqual('31'); + }); +}) + +test('hash_compare_returns_promise_on_null_callback', () => { + expect(typeof bcrypt.compare('password', 'something', null).then).toStrictEqual('function') +}) + +test('hash_compare', () => { + expect.assertions(3); + return bcrypt.genSalt(10).then(function (salt) { + expect(salt).toHaveLength(29); + return bcrypt.hash("test", salt); + }).then(hash => Promise.all( + [ + expect(bcrypt.compare("test", hash)).resolves.toEqual(true), + expect(bcrypt.compare("blah", hash)).resolves.toEqual(false) + ])); +}) + +test('hash_compare_empty_strings', () => { + expect.assertions(2); + const hash = bcrypt.hashSync("test", bcrypt.genSaltSync(10)); + return Promise.all([ + expect(bcrypt.compare("", hash)).resolves.toEqual(false), + expect(bcrypt.compare("", "")).resolves.toEqual(false) + ]); +}) + +test('hash_compare_invalid_strings', () => { + const fullString = 'envy1362987212538'; + const hash = '$2a$10$XOPbrlUPQdwdJUpSrIF6X.LbE14qsMmKGhM1A8W9iqaG3vv1BD7WC'; + const wut = ':'; + return Promise.all([ + expect(bcrypt.compare(fullString, hash)).resolves.toEqual(true), + expect(bcrypt.compare(fullString, wut)).resolves.toEqual(false), + ]); +}) + +test('hash_compare_no_params', () => { + expect.assertions(1); + return expect(bcrypt.compare()).rejects.toThrow('data and hash arguments required') +}) + +test('hash_compare_one_param', () => { + expect.assertions(1); + return expect(bcrypt.compare('password')).rejects.toThrow('data and hash arguments required') +}) + +test('change_promise_impl_reject', () => { + + promises.use({ + reject: function () { + return 'mock'; + } + }); + + expect(promises.reject()).toEqual('mock'); + + // need to reset the promise implementation because of require cache + promises.use(global.Promise); +}) + +test('change_promise_impl_promise', () => { + + promises.use({ + reject: function (err) { + expect(err.message).toEqual('fn must be a function'); + return 'mock'; + } + }); + + expect(promises.promise('', '', '')).toEqual('mock'); + + // need to reset the promise implementation because of require cache + promises.use(global.Promise); +}) diff --git a/node_modules/bcrypt/test/repetitions.test.js b/node_modules/bcrypt/test/repetitions.test.js new file mode 100644 index 00000000..66807f3b --- /dev/null +++ b/node_modules/bcrypt/test/repetitions.test.js @@ -0,0 +1,46 @@ +const bcrypt = require('../bcrypt'); + +const EXPECTED = 2500; //number of times to iterate these tests.) + +test('salt_length', () => { + expect.assertions(EXPECTED); + + return Promise.all(Array.from({length: EXPECTED}, + () => bcrypt.genSalt(10) + .then(salt => expect(salt).toHaveLength(29)))); +}) + +test('test_hash_length', () => { + expect.assertions(EXPECTED); + const SALT = '$2a$04$TnjywYklQbbZjdjBgBoA4e'; + return Promise.all(Array.from({length: EXPECTED}, + () => bcrypt.hash('test', SALT) + .then(hash => expect(hash).toHaveLength(60)))); +}) + +test('test_compare', () => { + expect.assertions(EXPECTED); + const HASH = '$2a$04$TnjywYklQbbZjdjBgBoA4e9G7RJt9blgMgsCvUvus4Iv4TENB5nHy'; + return Promise.all(Array.from({length: EXPECTED}, + () => bcrypt.compare('test', HASH) + .then(match => expect(match).toEqual(true)))); +}) + +test('test_hash_and_compare', () => { + expect.assertions(EXPECTED * 3); + const salt = bcrypt.genSaltSync(4) + + return Promise.all(Array.from({length: EXPECTED}, + () => { + const password = 'secret' + Math.random(); + return bcrypt.hash(password, salt) + .then(hash => { + expect(hash).toHaveLength(60); + const goodCompare = bcrypt.compare(password, hash).then(res => expect(res).toEqual(true)); + const badCompare = bcrypt.compare('bad' + password, hash).then(res => expect(res).toEqual(false)); + + return Promise.all([goodCompare, badCompare]); + }); + })); +}, 10000); + diff --git a/node_modules/bcrypt/test/sync.test.js b/node_modules/bcrypt/test/sync.test.js new file mode 100644 index 00000000..2e6809af --- /dev/null +++ b/node_modules/bcrypt/test/sync.test.js @@ -0,0 +1,125 @@ +const bcrypt = require('../bcrypt') + +test('salt_length', () => { + const salt = bcrypt.genSaltSync(13); + expect(salt).toHaveLength(29); + const [_, version, rounds] = salt.split('$'); + expect(version).toStrictEqual('2b') + expect(rounds).toStrictEqual('13') +}) + +test('salt_no_params', () => { + const salt = bcrypt.genSaltSync(); + const [_, version, rounds] = salt.split('$'); + expect(version).toStrictEqual('2b') + expect(rounds).toStrictEqual('10') +}) + +test('salt_rounds_is_string_number', () => { + expect(() => bcrypt.genSaltSync('10')).toThrowError('rounds must be a number'); +}) + +test('salt_rounds_is_NaN', () => { + expect(() => bcrypt.genSaltSync('b')).toThrowError("rounds must be a number"); +}) + +test('salt_minor_a', () => { + const salt = bcrypt.genSaltSync(10, 'a'); + const [_, version, rounds] = salt.split('$'); + expect(version).toStrictEqual('2a') + expect(rounds).toStrictEqual('10') +}) + +test('salt_minor_b', () => { + const salt = bcrypt.genSaltSync(10, 'b'); + const [_, version, rounds] = salt.split('$'); + expect(version).toStrictEqual('2b') + expect(rounds).toStrictEqual('10') +}) + +test('hash', () => { + expect(() => bcrypt.hashSync('password', bcrypt.genSaltSync(10))).not.toThrow() +}) + +test('hash_rounds', () => { + const hash = bcrypt.hashSync('password', 8); + expect(bcrypt.getRounds(hash)).toStrictEqual(8) +}) + +test('hash_empty_string', () => { + expect(() => bcrypt.hashSync('', bcrypt.genSaltSync(10))).not.toThrow(); + expect(() => bcrypt.hashSync('password', '')).toThrowError('Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue'); + expect(() => bcrypt.hashSync('', '')).toThrowError('Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue'); +}) + +test('hash_pw_no_params', () => { + expect(() => bcrypt.hashSync()).toThrow('data and salt arguments required'); +}) + +test('hash_pw_one_param', () => { + expect(() => bcrypt.hashSync('password')).toThrow('data and salt arguments required'); +}) + +test('hash_pw_not_hash_str', () => { + expect(() => bcrypt.hashSync('password', {})).toThrow("data must be a string or Buffer and salt must either be a salt string or a number of rounds") +}) + +test('hash_salt_validity', () => { + expect(2); + expect(bcrypt.hashSync('password', '$2a$10$somesaltyvaluertsetrse')).toBeDefined() + expect(() => bcrypt.hashSync('password', 'some$value')).toThrow('Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue') +}) + +test('verify_salt', () => { + const salt = bcrypt.genSaltSync(10); + const split_salt = salt.split('$'); + expect(split_salt[1]).toStrictEqual('2b') + expect(split_salt[2]).toStrictEqual('10') +}) + +test('verify_salt_min_rounds', () => { + const salt = bcrypt.genSaltSync(1); + const split_salt = salt.split('$'); + expect(split_salt[1]).toStrictEqual('2b') + expect(split_salt[2]).toStrictEqual('04') +}) + +test('verify_salt_max_rounds', () => { + const salt = bcrypt.genSaltSync(100); + const split_salt = salt.split('$'); + expect(split_salt[1]).toStrictEqual('2b') + expect(split_salt[2]).toStrictEqual('31') +}) + +test('hash_compare', () => { + const salt = bcrypt.genSaltSync(10); + expect(29).toStrictEqual(salt.length) + const hash = bcrypt.hashSync("test", salt); + expect(bcrypt.compareSync("test", hash)).toBeDefined() + expect(!(bcrypt.compareSync("blah", hash))).toBeDefined() +}) + +test('hash_compare_empty_strings', () => { + expect(!(bcrypt.compareSync("", "password"))).toBeDefined() + expect(!(bcrypt.compareSync("", ""))).toBeDefined() + expect(!(bcrypt.compareSync("password", ""))).toBeDefined() +}) + +test('hash_compare_invalid_strings', () => { + const fullString = 'envy1362987212538'; + const hash = '$2a$10$XOPbrlUPQdwdJUpSrIF6X.LbE14qsMmKGhM1A8W9iqaG3vv1BD7WC'; + const wut = ':'; + expect(bcrypt.compareSync(fullString, hash)).toBe(true); + expect(bcrypt.compareSync(fullString, wut)).toBe(false); +}) + +test('getRounds', () => { + const hash = bcrypt.hashSync("test", bcrypt.genSaltSync(9)); + expect(9).toStrictEqual(bcrypt.getRounds(hash)) +}) + +test('getRounds', () => { + const hash = bcrypt.hashSync("test", bcrypt.genSaltSync(9)); + expect(9).toStrictEqual(bcrypt.getRounds(hash)) + expect(() => bcrypt.getRounds('')).toThrow("invalid hash provided"); +}); diff --git a/node_modules/buffer-equal-constant-time/.npmignore b/node_modules/buffer-equal-constant-time/.npmignore new file mode 100644 index 00000000..34e4f5c2 --- /dev/null +++ b/node_modules/buffer-equal-constant-time/.npmignore @@ -0,0 +1,2 @@ +.*.sw[mnop] +node_modules/ diff --git a/node_modules/buffer-equal-constant-time/.travis.yml b/node_modules/buffer-equal-constant-time/.travis.yml new file mode 100644 index 00000000..78e1c014 --- /dev/null +++ b/node_modules/buffer-equal-constant-time/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: +- "0.11" +- "0.10" diff --git a/node_modules/buffer-equal-constant-time/LICENSE.txt b/node_modules/buffer-equal-constant-time/LICENSE.txt new file mode 100644 index 00000000..9a064f3f --- /dev/null +++ b/node_modules/buffer-equal-constant-time/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) 2013, GoInstant Inc., a salesforce.com company +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of salesforce.com, nor GoInstant, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/buffer-equal-constant-time/README.md b/node_modules/buffer-equal-constant-time/README.md new file mode 100644 index 00000000..4f227f58 --- /dev/null +++ b/node_modules/buffer-equal-constant-time/README.md @@ -0,0 +1,50 @@ +# buffer-equal-constant-time + +Constant-time `Buffer` comparison for node.js. Should work with browserify too. + +[![Build Status](https://travis-ci.org/goinstant/buffer-equal-constant-time.png?branch=master)](https://travis-ci.org/goinstant/buffer-equal-constant-time) + +```sh + npm install buffer-equal-constant-time +``` + +# Usage + +```js + var bufferEq = require('buffer-equal-constant-time'); + + var a = new Buffer('asdf'); + var b = new Buffer('asdf'); + if (bufferEq(a,b)) { + // the same! + } else { + // different in at least one byte! + } +``` + +If you'd like to install an `.equal()` method onto the node.js `Buffer` and +`SlowBuffer` prototypes: + +```js + require('buffer-equal-constant-time').install(); + + var a = new Buffer('asdf'); + var b = new Buffer('asdf'); + if (a.equal(b)) { + // the same! + } else { + // different in at least one byte! + } +``` + +To get rid of the installed `.equal()` method, call `.restore()`: + +```js + require('buffer-equal-constant-time').restore(); +``` + +# Legal + +© 2013 GoInstant Inc., a salesforce.com company + +Licensed under the BSD 3-clause license. diff --git a/node_modules/buffer-equal-constant-time/index.js b/node_modules/buffer-equal-constant-time/index.js new file mode 100644 index 00000000..5462c1f8 --- /dev/null +++ b/node_modules/buffer-equal-constant-time/index.js @@ -0,0 +1,41 @@ +/*jshint node:true */ +'use strict'; +var Buffer = require('buffer').Buffer; // browserify +var SlowBuffer = require('buffer').SlowBuffer; + +module.exports = bufferEq; + +function bufferEq(a, b) { + + // shortcutting on type is necessary for correctness + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + return false; + } + + // buffer sizes should be well-known information, so despite this + // shortcutting, it doesn't leak any information about the *contents* of the + // buffers. + if (a.length !== b.length) { + return false; + } + + var c = 0; + for (var i = 0; i < a.length; i++) { + /*jshint bitwise:false */ + c |= a[i] ^ b[i]; // XOR + } + return c === 0; +} + +bufferEq.install = function() { + Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) { + return bufferEq(this, that); + }; +}; + +var origBufEqual = Buffer.prototype.equal; +var origSlowBufEqual = SlowBuffer.prototype.equal; +bufferEq.restore = function() { + Buffer.prototype.equal = origBufEqual; + SlowBuffer.prototype.equal = origSlowBufEqual; +}; diff --git a/node_modules/buffer-equal-constant-time/package.json b/node_modules/buffer-equal-constant-time/package.json new file mode 100644 index 00000000..17c7de22 --- /dev/null +++ b/node_modules/buffer-equal-constant-time/package.json @@ -0,0 +1,21 @@ +{ + "name": "buffer-equal-constant-time", + "version": "1.0.1", + "description": "Constant-time comparison of Buffers", + "main": "index.js", + "scripts": { + "test": "mocha test.js" + }, + "repository": "git@github.com:goinstant/buffer-equal-constant-time.git", + "keywords": [ + "buffer", + "equal", + "constant-time", + "crypto" + ], + "author": "GoInstant Inc., a salesforce.com company", + "license": "BSD-3-Clause", + "devDependencies": { + "mocha": "~1.15.1" + } +} diff --git a/node_modules/buffer-equal-constant-time/test.js b/node_modules/buffer-equal-constant-time/test.js new file mode 100644 index 00000000..0bc972d8 --- /dev/null +++ b/node_modules/buffer-equal-constant-time/test.js @@ -0,0 +1,42 @@ +/*jshint node:true */ +'use strict'; + +var bufferEq = require('./index'); +var assert = require('assert'); + +describe('buffer-equal-constant-time', function() { + var a = new Buffer('asdfasdf123456'); + var b = new Buffer('asdfasdf123456'); + var c = new Buffer('asdfasdf'); + + describe('bufferEq', function() { + it('says a == b', function() { + assert.strictEqual(bufferEq(a, b), true); + }); + + it('says a != c', function() { + assert.strictEqual(bufferEq(a, c), false); + }); + }); + + describe('install/restore', function() { + before(function() { + bufferEq.install(); + }); + after(function() { + bufferEq.restore(); + }); + + it('installed an .equal method', function() { + var SlowBuffer = require('buffer').SlowBuffer; + assert.ok(Buffer.prototype.equal); + assert.ok(SlowBuffer.prototype.equal); + }); + + it('infected existing Buffers', function() { + assert.strictEqual(a.equal(b), true); + assert.strictEqual(a.equal(c), false); + }); + }); + +}); diff --git a/node_modules/chownr/LICENSE b/node_modules/chownr/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/chownr/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/chownr/README.md b/node_modules/chownr/README.md new file mode 100644 index 00000000..70e9a54a --- /dev/null +++ b/node_modules/chownr/README.md @@ -0,0 +1,3 @@ +Like `chown -R`. + +Takes the same arguments as `fs.chown()` diff --git a/node_modules/chownr/chownr.js b/node_modules/chownr/chownr.js new file mode 100644 index 00000000..0d409321 --- /dev/null +++ b/node_modules/chownr/chownr.js @@ -0,0 +1,167 @@ +'use strict' +const fs = require('fs') +const path = require('path') + +/* istanbul ignore next */ +const LCHOWN = fs.lchown ? 'lchown' : 'chown' +/* istanbul ignore next */ +const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync' + +/* istanbul ignore next */ +const needEISDIRHandled = fs.lchown && + !process.version.match(/v1[1-9]+\./) && + !process.version.match(/v10\.[6-9]/) + +const lchownSync = (path, uid, gid) => { + try { + return fs[LCHOWNSYNC](path, uid, gid) + } catch (er) { + if (er.code !== 'ENOENT') + throw er + } +} + +/* istanbul ignore next */ +const chownSync = (path, uid, gid) => { + try { + return fs.chownSync(path, uid, gid) + } catch (er) { + if (er.code !== 'ENOENT') + throw er + } +} + +/* istanbul ignore next */ +const handleEISDIR = + needEISDIRHandled ? (path, uid, gid, cb) => er => { + // Node prior to v10 had a very questionable implementation of + // fs.lchown, which would always try to call fs.open on a directory + // Fall back to fs.chown in those cases. + if (!er || er.code !== 'EISDIR') + cb(er) + else + fs.chown(path, uid, gid, cb) + } + : (_, __, ___, cb) => cb + +/* istanbul ignore next */ +const handleEISDirSync = + needEISDIRHandled ? (path, uid, gid) => { + try { + return lchownSync(path, uid, gid) + } catch (er) { + if (er.code !== 'EISDIR') + throw er + chownSync(path, uid, gid) + } + } + : (path, uid, gid) => lchownSync(path, uid, gid) + +// fs.readdir could only accept an options object as of node v6 +const nodeVersion = process.version +let readdir = (path, options, cb) => fs.readdir(path, options, cb) +let readdirSync = (path, options) => fs.readdirSync(path, options) +/* istanbul ignore next */ +if (/^v4\./.test(nodeVersion)) + readdir = (path, options, cb) => fs.readdir(path, cb) + +const chown = (cpath, uid, gid, cb) => { + fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => { + // Skip ENOENT error + cb(er && er.code !== 'ENOENT' ? er : null) + })) +} + +const chownrKid = (p, child, uid, gid, cb) => { + if (typeof child === 'string') + return fs.lstat(path.resolve(p, child), (er, stats) => { + // Skip ENOENT error + if (er) + return cb(er.code !== 'ENOENT' ? er : null) + stats.name = child + chownrKid(p, stats, uid, gid, cb) + }) + + if (child.isDirectory()) { + chownr(path.resolve(p, child.name), uid, gid, er => { + if (er) + return cb(er) + const cpath = path.resolve(p, child.name) + chown(cpath, uid, gid, cb) + }) + } else { + const cpath = path.resolve(p, child.name) + chown(cpath, uid, gid, cb) + } +} + + +const chownr = (p, uid, gid, cb) => { + readdir(p, { withFileTypes: true }, (er, children) => { + // any error other than ENOTDIR or ENOTSUP means it's not readable, + // or doesn't exist. give up. + if (er) { + if (er.code === 'ENOENT') + return cb() + else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') + return cb(er) + } + if (er || !children.length) + return chown(p, uid, gid, cb) + + let len = children.length + let errState = null + const then = er => { + if (errState) + return + if (er) + return cb(errState = er) + if (-- len === 0) + return chown(p, uid, gid, cb) + } + + children.forEach(child => chownrKid(p, child, uid, gid, then)) + }) +} + +const chownrKidSync = (p, child, uid, gid) => { + if (typeof child === 'string') { + try { + const stats = fs.lstatSync(path.resolve(p, child)) + stats.name = child + child = stats + } catch (er) { + if (er.code === 'ENOENT') + return + else + throw er + } + } + + if (child.isDirectory()) + chownrSync(path.resolve(p, child.name), uid, gid) + + handleEISDirSync(path.resolve(p, child.name), uid, gid) +} + +const chownrSync = (p, uid, gid) => { + let children + try { + children = readdirSync(p, { withFileTypes: true }) + } catch (er) { + if (er.code === 'ENOENT') + return + else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP') + return handleEISDirSync(p, uid, gid) + else + throw er + } + + if (children && children.length) + children.forEach(child => chownrKidSync(p, child, uid, gid)) + + return handleEISDirSync(p, uid, gid) +} + +module.exports = chownr +chownr.sync = chownrSync diff --git a/node_modules/chownr/package.json b/node_modules/chownr/package.json new file mode 100644 index 00000000..5b0214ca --- /dev/null +++ b/node_modules/chownr/package.json @@ -0,0 +1,32 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "chownr", + "description": "like `chown -R`", + "version": "2.0.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/chownr.git" + }, + "main": "chownr.js", + "files": [ + "chownr.js" + ], + "devDependencies": { + "mkdirp": "0.3", + "rimraf": "^2.7.1", + "tap": "^14.10.6" + }, + "tap": { + "check-coverage": true + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "license": "ISC", + "engines": { + "node": ">=10" + } +} diff --git a/node_modules/color-support/LICENSE b/node_modules/color-support/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/color-support/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/color-support/README.md b/node_modules/color-support/README.md new file mode 100644 index 00000000..f89aa17d --- /dev/null +++ b/node_modules/color-support/README.md @@ -0,0 +1,129 @@ +# color-support + +A module which will endeavor to guess your terminal's level of color +support. + +[![Build Status](https://travis-ci.org/isaacs/color-support.svg?branch=master)](https://travis-ci.org/isaacs/color-support) [![Coverage Status](https://coveralls.io/repos/github/isaacs/color-support/badge.svg?branch=master)](https://coveralls.io/github/isaacs/color-support?branch=master) + +This is similar to `supports-color`, but it does not read +`process.argv`. + +1. If not in a node environment, not supported. + +2. If stdout is not a TTY, not supported, unless the `ignoreTTY` + option is set. + +3. If the `TERM` environ is `dumb`, not supported, unless the + `ignoreDumb` option is set. + +4. If on Windows, then support 16 colors. + +5. If using Tmux, then support 256 colors. + +7. Handle continuous-integration servers. If `CI` or + `TEAMCITY_VERSION` are set in the environment, and `TRAVIS` is not + set, then color is not supported, unless `ignoreCI` option is set. + +6. Guess based on the `TERM_PROGRAM` environ. These terminals support + 16m colors: + + - `iTerm.app` version 3.x supports 16m colors, below support 256 + - `MacTerm` supports 16m colors + - `Apple_Terminal` supports 256 colors + - Have more things that belong on this list? Send a PR! + +8. Make a guess based on the `TERM` environment variable. Any + `xterm-256color` will get 256 colors. Any screen, xterm, vt100, + color, ansi, cygwin, or linux `TERM` will get 16 colors. + +9. If `COLORTERM` environment variable is set, then support 16 colors. + +10. At this point, we assume that color is not supported. + +## USAGE + +```javascript +var testColorSupport = require('color-support') +var colorSupport = testColorSupport(/* options object */) + +if (!colorSupport) { + console.log('color is not supported') +} else if (colorSupport.has16m) { + console.log('\x1b[38;2;102;194;255m16m colors\x1b[0m') +} else if (colorSupport.has256) { + console.log('\x1b[38;5;119m256 colors\x1b[0m') +} else if (colorSupport.hasBasic) { + console.log('\x1b[31mbasic colors\x1b[0m') +} else { + console.log('this is impossible, but colors are not supported') +} +``` + +If you don't have any options to set, you can also just look at the +flags which will all be set on the test function itself. (Of course, +this doesn't return a falsey value when colors aren't supported, and +doesn't allow you to set options.) + +```javascript +var colorSupport = require('color-support') + +if (colorSupport.has16m) { + console.log('\x1b[38;2;102;194;255m16m colors\x1b[0m') +} else if (colorSupport.has256) { + console.log('\x1b[38;5;119m256 colors\x1b[0m') +} else if (colorSupport.hasBasic) { + console.log('\x1b[31mbasic colors\x1b[0m') +} else { + console.log('colors are not supported') +} +``` + +## Options + +You can pass in the following options. + +* ignoreTTY - default false. Ignore the `isTTY` check. +* ignoreDumb - default false. Ignore `TERM=dumb` environ check. +* ignoreCI - default false. Ignore `CI` environ check. +* env - Object for environment vars. Defaults to `process.env`. +* stream - Stream for `isTTY` check. Defaults to `process.stdout`. +* term - String for `TERM` checking. Defaults to `env.TERM`. +* alwaysReturn - default false. Return an object when colors aren't + supported (instead of returning `false`). +* level - A number from 0 to 3. This will return a result for the + specified level. This is useful if you want to be able to set the + color support level explicitly as a number in an environment + variable or config, but then use the object flags in your program. + Except for `alwaysReturn` to return an object for level 0, all other + options are ignored, since no checking is done if a level is + explicitly set. + +## Return Value + +If no color support is available, then `false` is returned by default, +unless the `alwaysReturn` flag is set to `true`. This is so that the +simple question of "can I use colors or not" can treat any truthy +return as "yes". + +Otherwise, the return object has the following fields: + +* `level` - A number from 0 to 3 + * `0` - No color support + * `1` - Basic (16) color support + * `2` - 256 color support + * `3` - 16 million (true) color support +* `hasBasic` - Boolean +* `has256` - Boolean +* `has16m` - Boolean + +## CLI + +You can run the `color-support` bin from the command line which will +just dump the values as this module calculates them in whatever env +it's run. It takes no command line arguments. + +## Credits + +This is a spiritual, if not actual, fork of +[supports-color](http://npm.im/supports-color) by the ever prolific +[Sindre Sorhus](http://npm.im/~sindresorhus). diff --git a/node_modules/color-support/bin.js b/node_modules/color-support/bin.js new file mode 100644 index 00000000..3c0a9672 --- /dev/null +++ b/node_modules/color-support/bin.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +var colorSupport = require('./')({alwaysReturn: true }) +console.log(JSON.stringify(colorSupport, null, 2)) diff --git a/node_modules/color-support/browser.js b/node_modules/color-support/browser.js new file mode 100644 index 00000000..ab5c6631 --- /dev/null +++ b/node_modules/color-support/browser.js @@ -0,0 +1,14 @@ +module.exports = colorSupport({ alwaysReturn: true }, colorSupport) + +function colorSupport(options, obj) { + obj = obj || {} + options = options || {} + obj.level = 0 + obj.hasBasic = false + obj.has256 = false + obj.has16m = false + if (!options.alwaysReturn) { + return false + } + return obj +} diff --git a/node_modules/color-support/index.js b/node_modules/color-support/index.js new file mode 100644 index 00000000..6b6f3b28 --- /dev/null +++ b/node_modules/color-support/index.js @@ -0,0 +1,134 @@ +// call it on itself so we can test the export val for basic stuff +module.exports = colorSupport({ alwaysReturn: true }, colorSupport) + +function hasNone (obj, options) { + obj.level = 0 + obj.hasBasic = false + obj.has256 = false + obj.has16m = false + if (!options.alwaysReturn) { + return false + } + return obj +} + +function hasBasic (obj) { + obj.hasBasic = true + obj.has256 = false + obj.has16m = false + obj.level = 1 + return obj +} + +function has256 (obj) { + obj.hasBasic = true + obj.has256 = true + obj.has16m = false + obj.level = 2 + return obj +} + +function has16m (obj) { + obj.hasBasic = true + obj.has256 = true + obj.has16m = true + obj.level = 3 + return obj +} + +function colorSupport (options, obj) { + options = options || {} + + obj = obj || {} + + // if just requesting a specific level, then return that. + if (typeof options.level === 'number') { + switch (options.level) { + case 0: + return hasNone(obj, options) + case 1: + return hasBasic(obj) + case 2: + return has256(obj) + case 3: + return has16m(obj) + } + } + + obj.level = 0 + obj.hasBasic = false + obj.has256 = false + obj.has16m = false + + if (typeof process === 'undefined' || + !process || + !process.stdout || + !process.env || + !process.platform) { + return hasNone(obj, options) + } + + var env = options.env || process.env + var stream = options.stream || process.stdout + var term = options.term || env.TERM || '' + var platform = options.platform || process.platform + + if (!options.ignoreTTY && !stream.isTTY) { + return hasNone(obj, options) + } + + if (!options.ignoreDumb && term === 'dumb' && !env.COLORTERM) { + return hasNone(obj, options) + } + + if (platform === 'win32') { + return hasBasic(obj) + } + + if (env.TMUX) { + return has256(obj) + } + + if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION)) { + if (env.TRAVIS) { + return has256(obj) + } else { + return hasNone(obj, options) + } + } + + // TODO: add more term programs + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + var ver = env.TERM_PROGRAM_VERSION || '0.' + if (/^[0-2]\./.test(ver)) { + return has256(obj) + } else { + return has16m(obj) + } + + case 'HyperTerm': + case 'Hyper': + return has16m(obj) + + case 'MacTerm': + return has16m(obj) + + case 'Apple_Terminal': + return has256(obj) + } + + if (/^xterm-256/.test(term)) { + return has256(obj) + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term)) { + return hasBasic(obj) + } + + if (env.COLORTERM) { + return hasBasic(obj) + } + + return hasNone(obj, options) +} diff --git a/node_modules/color-support/package.json b/node_modules/color-support/package.json new file mode 100644 index 00000000..f3e3b771 --- /dev/null +++ b/node_modules/color-support/package.json @@ -0,0 +1,36 @@ +{ + "name": "color-support", + "version": "1.1.3", + "description": "A module which will endeavor to guess your terminal's level of color support.", + "main": "index.js", + "browser": "browser.js", + "bin": "bin.js", + "devDependencies": { + "tap": "^10.3.3" + }, + "scripts": { + "test": "tap test/*.js --100 -J", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/color-support.git" + }, + "keywords": [ + "terminal", + "color", + "support", + "xterm", + "truecolor", + "256" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "browser.js", + "index.js", + "bin.js" + ] +} diff --git a/node_modules/combined-stream/License b/node_modules/combined-stream/License new file mode 100644 index 00000000..4804b7ab --- /dev/null +++ b/node_modules/combined-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/combined-stream/Readme.md b/node_modules/combined-stream/Readme.md new file mode 100644 index 00000000..9e367b5b --- /dev/null +++ b/node_modules/combined-stream/Readme.md @@ -0,0 +1,138 @@ +# combined-stream + +A stream that emits multiple other streams one after another. + +**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`. + +- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. + +- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. + +## Installation + +``` bash +npm install combined-stream +``` + +## Usage + +Here is a simple example that shows how you can use combined-stream to combine +two files into one: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +While the example above works great, it will pause all source streams until +they are needed. If you don't want that to happen, you can set `pauseStreams` +to `false`: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create({pauseStreams: false}); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +However, what if you don't have all the source streams yet, or you don't want +to allocate the resources (file descriptors, memory, etc.) for them right away? +Well, in that case you can simply provide a callback that supplies the stream +by calling a `next()` function: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(function(next) { + next(fs.createReadStream('file1.txt')); +}); +combinedStream.append(function(next) { + next(fs.createReadStream('file2.txt')); +}); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +## API + +### CombinedStream.create([options]) + +Returns a new combined stream object. Available options are: + +* `maxDataSize` +* `pauseStreams` + +The effect of those options is described below. + +### combinedStream.pauseStreams = `true` + +Whether to apply back pressure to the underlaying streams. If set to `false`, +the underlaying streams will never be paused. If set to `true`, the +underlaying streams will be paused right after being appended, as well as when +`delayedStream.pipe()` wants to throttle. + +### combinedStream.maxDataSize = `2 * 1024 * 1024` + +The maximum amount of bytes (or characters) to buffer for all source streams. +If this value is exceeded, `combinedStream` emits an `'error'` event. + +### combinedStream.dataSize = `0` + +The amount of bytes (or characters) currently buffered by `combinedStream`. + +### combinedStream.append(stream) + +Appends the given `stream` to the combinedStream object. If `pauseStreams` is +set to `true, this stream will also be paused right away. + +`streams` can also be a function that takes one parameter called `next`. `next` +is a function that must be invoked in order to provide the `next` stream, see +example above. + +Regardless of how the `stream` is appended, combined-stream always attaches an +`'error'` listener to it, so you don't have to do that manually. + +Special case: `stream` can also be a String or Buffer. + +### combinedStream.write(data) + +You should not call this, `combinedStream` takes care of piping the appended +streams into itself for you. + +### combinedStream.resume() + +Causes `combinedStream` to start drain the streams it manages. The function is +idempotent, and also emits a `'resume'` event each time which usually goes to +the stream that is currently being drained. + +### combinedStream.pause(); + +If `combinedStream.pauseStreams` is set to `false`, this does nothing. +Otherwise a `'pause'` event is emitted, this goes to the stream that is +currently being drained, so you can use it to apply back pressure. + +### combinedStream.end(); + +Sets `combinedStream.writable` to false, emits an `'end'` event, and removes +all streams from the queue. + +### combinedStream.destroy(); + +Same as `combinedStream.end()`, except it emits a `'close'` event instead of +`'end'`. + +## License + +combined-stream is licensed under the MIT license. diff --git a/node_modules/combined-stream/lib/combined_stream.js b/node_modules/combined-stream/lib/combined_stream.js new file mode 100644 index 00000000..125f097f --- /dev/null +++ b/node_modules/combined-stream/lib/combined_stream.js @@ -0,0 +1,208 @@ +var util = require('util'); +var Stream = require('stream').Stream; +var DelayedStream = require('delayed-stream'); + +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } + + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; + +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + this._pipeNext(stream); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; diff --git a/node_modules/combined-stream/package.json b/node_modules/combined-stream/package.json new file mode 100644 index 00000000..6982b6da --- /dev/null +++ b/node_modules/combined-stream/package.json @@ -0,0 +1,25 @@ +{ + "author": "Felix Geisendörfer (http://debuggable.com/)", + "name": "combined-stream", + "description": "A stream that emits multiple other streams one after another.", + "version": "1.0.8", + "homepage": "https://github.com/felixge/node-combined-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "main": "./lib/combined_stream", + "scripts": { + "test": "node test/run.js" + }, + "engines": { + "node": ">= 0.8" + }, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "devDependencies": { + "far": "~0.0.7" + }, + "license": "MIT" +} diff --git a/node_modules/combined-stream/yarn.lock b/node_modules/combined-stream/yarn.lock new file mode 100644 index 00000000..7edf4184 --- /dev/null +++ b/node_modules/combined-stream/yarn.lock @@ -0,0 +1,17 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +far@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7" + dependencies: + oop "0.0.3" + +oop@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401" diff --git a/node_modules/console-control-strings/LICENSE b/node_modules/console-control-strings/LICENSE new file mode 100644 index 00000000..e7560529 --- /dev/null +++ b/node_modules/console-control-strings/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/console-control-strings/README.md b/node_modules/console-control-strings/README.md new file mode 100644 index 00000000..f58cc8d8 --- /dev/null +++ b/node_modules/console-control-strings/README.md @@ -0,0 +1,145 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.beep() + +Returns the escape sequence to cause the termianl to beep. (That is, it +returns unicode character `\x0007`, a Control-G.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/node_modules/console-control-strings/README.md~ b/node_modules/console-control-strings/README.md~ new file mode 100644 index 00000000..6eb34e89 --- /dev/null +++ b/node_modules/console-control-strings/README.md~ @@ -0,0 +1,140 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/node_modules/console-control-strings/index.js b/node_modules/console-control-strings/index.js new file mode 100644 index 00000000..bf890348 --- /dev/null +++ b/node_modules/console-control-strings/index.js @@ -0,0 +1,125 @@ +'use strict' + +// These tables borrowed from `ansi` + +var prefix = '\x1b[' + +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} + +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} + +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} + +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} + +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' +} + +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} + +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} + +exports.eraseData = function eraseData () { + return prefix + 'J' +} + +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} + +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} + +exports.gotoSOL = function () { + return '\r' +} + +exports.beep = function () { + return '\x07' +} + +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} + +exports.showCursor = function showCursor () { + return prefix + '?25h' +} + +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, + + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, + + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} + +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} + +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} diff --git a/node_modules/console-control-strings/package.json b/node_modules/console-control-strings/package.json new file mode 100644 index 00000000..eb6c62ae --- /dev/null +++ b/node_modules/console-control-strings/package.json @@ -0,0 +1,27 @@ +{ + "name": "console-control-strings", + "version": "1.1.0", + "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", + "main": "index.js", + "directories": { + "test": "test" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/console-control-strings" + }, + "keywords": [], + "author": "Rebecca Turner (http://re-becca.org/)", + "license": "ISC", + "files": [ + "LICENSE", + "index.js" + ], + "devDependencies": { + "standard": "^7.1.2", + "tap": "^5.7.2" + } +} diff --git a/node_modules/dayjs/.editorconfig b/node_modules/dayjs/.editorconfig new file mode 100644 index 00000000..d4d73cf5 --- /dev/null +++ b/node_modules/dayjs/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_size = 2 diff --git a/node_modules/dayjs/CHANGELOG.md b/node_modules/dayjs/CHANGELOG.md new file mode 100644 index 00000000..14478049 --- /dev/null +++ b/node_modules/dayjs/CHANGELOG.md @@ -0,0 +1,919 @@ +## [1.11.10](https://github.com/iamkun/dayjs/compare/v1.11.9...v1.11.10) (2023-09-19) + + +### Bug Fixes + +* Add Korean Day of Month with ordinal ([#2395](https://github.com/iamkun/dayjs/issues/2395)) ([dd55ee2](https://github.com/iamkun/dayjs/commit/dd55ee2aadd1009242235e47d558bbf028827896)) +* change back fa locale to the Gregorian calendar equivalent ([#2411](https://github.com/iamkun/dayjs/issues/2411)) ([95e9458](https://github.com/iamkun/dayjs/commit/95e9458b221fe35e59ee4a160a5db247313a68fb)) +* duration plugin - MILLISECONDS_A_MONTH const calculation ([#2362](https://github.com/iamkun/dayjs/issues/2362)) ([f0a0b54](https://github.com/iamkun/dayjs/commit/f0a0b546b074b3b511c2319a1ce83d412894b91f)) +* duration plugin getter get result 0 instead of undefined ([#2369](https://github.com/iamkun/dayjs/issues/2369)) ([061aa7e](https://github.com/iamkun/dayjs/commit/061aa7ed6c31696974665fc9b11a74d30841ebed)) +* fix isDayjs check logic ([#2383](https://github.com/iamkun/dayjs/issues/2383)) ([5f3f878](https://github.com/iamkun/dayjs/commit/5f3f8786c796cd432fe6bcb6966a810daea89203)) +* fix timezone plugin to get correct locale setting ([#2420](https://github.com/iamkun/dayjs/issues/2420)) ([4f45012](https://github.com/iamkun/dayjs/commit/4f4501256fa1bc72128aae1d841bbd782df86aed)) +* **locale:** add meridiem in `ar` locale ([#2418](https://github.com/iamkun/dayjs/issues/2418)) ([361be5c](https://github.com/iamkun/dayjs/commit/361be5c7c628614ee833d710acbe154a598b904d)) +* round durations to millisecond precision for ISO string ([#2367](https://github.com/iamkun/dayjs/issues/2367)) ([890a17a](https://github.com/iamkun/dayjs/commit/890a17a8d8ddd43c7c8b806e3afc7b27f3288d27)) +* sub-second precisions need to be rounded at the seconds field to avoid adding floats ([#2377](https://github.com/iamkun/dayjs/issues/2377)) ([a9d7d03](https://github.com/iamkun/dayjs/commit/a9d7d0398d22ebd4bfc3812ca0134a97606d54d9)) +* update $x logic to avoid plugin error ([#2429](https://github.com/iamkun/dayjs/issues/2429)) ([2254635](https://github.com/iamkun/dayjs/commit/22546357f30924fcff3b3ffa14fd04be21f97a5e)) +* Update Slovenian locale for relative time ([#2396](https://github.com/iamkun/dayjs/issues/2396)) ([5470a15](https://github.com/iamkun/dayjs/commit/5470a15e437fac803797363063b24f3ba3bd5299)) +* update uzbek language translation ([#2327](https://github.com/iamkun/dayjs/issues/2327)) ([0a91056](https://github.com/iamkun/dayjs/commit/0a910564d76dc7c128da8e0d85d8e11ebdb5660b)) + +## [1.11.9](https://github.com/iamkun/dayjs/compare/v1.11.8...v1.11.9) (2023-07-01) + + +### Bug Fixes + +* Add null to min and max plugin return type ([#2355](https://github.com/iamkun/dayjs/issues/2355)) ([62d9042](https://github.com/iamkun/dayjs/commit/62d9042eb84b78d78324694ccbeaad1679d37e68)) +* check if null passed to objectSupport parser ([#2175](https://github.com/iamkun/dayjs/issues/2175)) ([013968f](https://github.com/iamkun/dayjs/commit/013968f609c32e2269df69b4dd1feb2e8e1e035a)) +* dayjs.diff improve performance ([#2244](https://github.com/iamkun/dayjs/issues/2244)) ([33c80e1](https://github.com/iamkun/dayjs/commit/33c80e14cf14f70ceb4f54639e266cd70a3c3996)) +* dayjs(null) throws error, not return dayjs object as invalid date ([#2334](https://github.com/iamkun/dayjs/issues/2334)) ([c79e2f5](https://github.com/iamkun/dayjs/commit/c79e2f5d03eef5660b1f13385b69c0c9668d2f98)) +* objectSupport plugin causes an error when null is passed to dayjs function (closes [#2277](https://github.com/iamkun/dayjs/issues/2277)) ([#2342](https://github.com/iamkun/dayjs/issues/2342)) ([89bf31c](https://github.com/iamkun/dayjs/commit/89bf31ce0a36dcfc892029dc019d85d3654cf5fb)) +* Optimize format method ([#2313](https://github.com/iamkun/dayjs/issues/2313)) ([1fe1b1d](https://github.com/iamkun/dayjs/commit/1fe1b1d9a214d3b8c9f267b432801424a493f1c4)) +* update Duration plugin add/subtract take into account days in month ([#2337](https://github.com/iamkun/dayjs/issues/2337)) ([3b1060f](https://github.com/iamkun/dayjs/commit/3b1060f92183ab3a3c49289c2d87fbdd34c1eacc)) +* update MinMax plugin 1. ignore the 'null' in args 2. return the only one arg ([#2330](https://github.com/iamkun/dayjs/issues/2330)) ([3c2c6ee](https://github.com/iamkun/dayjs/commit/3c2c6ee4db00bbb43a7a3bb0b56bc0d0f03daddc)) + +## [1.11.8](https://github.com/iamkun/dayjs/compare/v1.11.7...v1.11.8) (2023-06-02) + + +### Bug Fixes + +* .format add padding to 'YYYY' ([#2231](https://github.com/iamkun/dayjs/issues/2231)) ([00c223b](https://github.com/iamkun/dayjs/commit/00c223b7e92970d07557133994fcb225a6d4c960)) +* Added .valueOf method to Duration class ([#2226](https://github.com/iamkun/dayjs/issues/2226)) ([9b4fcfd](https://github.com/iamkun/dayjs/commit/9b4fcfde35b39693894be1821b6c7222fac98657)) +* timezone type mark `date` parameter as optional ([#2222](https://github.com/iamkun/dayjs/issues/2222)) ([b87aa0e](https://github.com/iamkun/dayjs/commit/b87aa0ed9a748c478a66ef48230cd1d6350d7b8a)) +* type file first parameter date is optional in isSame(), isBefore(), isAfter() ([#2272](https://github.com/iamkun/dayjs/issues/2272)) ([4d56f3e](https://github.com/iamkun/dayjs/commit/4d56f3eb2b3770879d60f824590bf1b32f237d47)) + +## [1.11.7](https://github.com/iamkun/dayjs/compare/v1.11.6...v1.11.7) (2022-12-06) + + +### Bug Fixes + +* Add locale (zh-tw) meridiem ([#2149](https://github.com/iamkun/dayjs/issues/2149)) ([1e9ba76](https://github.com/iamkun/dayjs/commit/1e9ba761ff4e3f2759106dfe1aa9054d5826451c)) +* update fa locale ([#2151](https://github.com/iamkun/dayjs/issues/2151)) ([1c26732](https://github.com/iamkun/dayjs/commit/1c267321a1a01b4947e1482bac67d67ebc7c3dfa)) + +## [1.11.6](https://github.com/iamkun/dayjs/compare/v1.11.5...v1.11.6) (2022-10-21) + + +### Bug Fixes + +* add BigIntSupport plugin ([#2087](https://github.com/iamkun/dayjs/issues/2087)) ([f6dce48](https://github.com/iamkun/dayjs/commit/f6dce48a9e39677718b087867d9fd901d5078155)) +* Fix objectSupport collides with Duration plugin - issue [#2027](https://github.com/iamkun/dayjs/issues/2027) ([#2038](https://github.com/iamkun/dayjs/issues/2038)) ([c9370ea](https://github.com/iamkun/dayjs/commit/c9370ea96bf420439ee7eaa4146e8ed643160312)) + +## [1.11.5](https://github.com/iamkun/dayjs/compare/v1.11.4...v1.11.5) (2022-08-12) + + +### Bug Fixes + +* ordinal for nl not working ([#2011](https://github.com/iamkun/dayjs/issues/2011)) ([c93c85e](https://github.com/iamkun/dayjs/commit/c93c85eaa11564a1aae2d823480a417812c01bf4)) +* wrong ordinal for french locale ([#2010](https://github.com/iamkun/dayjs/issues/2010)) ([dd192a7](https://github.com/iamkun/dayjs/commit/dd192a72fc5d26ce56481e89b0c1ccf5f939be0c)) + +## [1.11.4](https://github.com/iamkun/dayjs/compare/v1.11.3...v1.11.4) (2022-07-19) + + +### Bug Fixes + +* correct past property in ku (kurdish) locale ([#1916](https://github.com/iamkun/dayjs/issues/1916)) ([74e82b9](https://github.com/iamkun/dayjs/commit/74e82b9da5ec8b90361fc27ac7c8b63faf354502)) +* fix French [fr] local ordinal ([#1932](https://github.com/iamkun/dayjs/issues/1932)) ([8f09834](https://github.com/iamkun/dayjs/commit/8f09834a88b8e7f8353c6e7473d4711596890a8c)) +* fix objectSupport plugin ConfigTypeMap type ([#1441](https://github.com/iamkun/dayjs/issues/1441)) ([#1990](https://github.com/iamkun/dayjs/issues/1990)) ([fd51fe4](https://github.com/iamkun/dayjs/commit/fd51fe4f7fa799d8c598343e71fa59299ec4cf93)) +* fix type error to add ordianl property in InstanceLocaleDataReturn and GlobalLocaleDataReturn types ([#1931](https://github.com/iamkun/dayjs/issues/1931)) ([526f0ae](https://github.com/iamkun/dayjs/commit/526f0ae549ffbeeb9ef1099ca23964791fc59743)) +* update locale ar-* meridiem function ([#1954](https://github.com/iamkun/dayjs/issues/1954)) ([3d31611](https://github.com/iamkun/dayjs/commit/3d316117f04362d31f4e8bd349620b8414ce5d0c)) +* zh-tw / zh-hk locale ordinal error ([#1976](https://github.com/iamkun/dayjs/issues/1976)) ([0a1bd08](https://github.com/iamkun/dayjs/commit/0a1bd08e736be7d4e378aaca280caa6543f8066d)) + +## [1.11.3](https://github.com/iamkun/dayjs/compare/v1.11.2...v1.11.3) (2022-06-06) + + +### Bug Fixes + +* customParseFormat plugin to parse comma as a separator character ([#1913](https://github.com/iamkun/dayjs/issues/1913)) ([41b1405](https://github.com/iamkun/dayjs/commit/41b1405971e099431211ae6c2a100cd797da4427)) +* update Dutch [nl] locale ordinal ([#1908](https://github.com/iamkun/dayjs/issues/1908)) ([5da98f8](https://github.com/iamkun/dayjs/commit/5da98f8085d2d2847d79e38c795082703a14f24b)) + +## [1.11.2](https://github.com/iamkun/dayjs/compare/v1.11.1...v1.11.2) (2022-05-06) + + +### Bug Fixes + +* add OpUnitType (week) to quarterOfYear startOf/endOf types ([#1865](https://github.com/iamkun/dayjs/issues/1865)) ([400bc3e](https://github.com/iamkun/dayjs/commit/400bc3e8915e0c58e7abbfd3a1235364b1abaf3e)) +* Fix type issue with ManipulateType ([#1864](https://github.com/iamkun/dayjs/issues/1864)) ([d033dfc](https://github.com/iamkun/dayjs/commit/d033dfcfc1d2ced39b2733898e8d85ad5984c9e9)) +* fix UTC plugin .valueOf not taking DST into account ([#1448](https://github.com/iamkun/dayjs/issues/1448)) ([27d1c50](https://github.com/iamkun/dayjs/commit/27d1c506100ae6624f258c21cc06b24768ced733)) + +## [1.11.1](https://github.com/iamkun/dayjs/compare/v1.11.0...v1.11.1) (2022-04-15) + + +### Bug Fixes + +* add Bengali (Bangladesh) [bn-bd] locale ([#1806](https://github.com/iamkun/dayjs/issues/1806)) ([840ed76](https://github.com/iamkun/dayjs/commit/840ed76eedc085afefc4dedd05f31d44196b63b0)) +* refactor replace deprecated String.prototype.substr() ([#1836](https://github.com/iamkun/dayjs/issues/1836)) ([627fa39](https://github.com/iamkun/dayjs/commit/627fa393e4daf83c92431162dbe18534b23fcbae)) +* Update German [de] locale, adds the abbreviations for month including a . in the end, as in September -> Sept. ([#1831](https://github.com/iamkun/dayjs/issues/1831)) ([4e2802c](https://github.com/iamkun/dayjs/commit/4e2802cc3bec2941ffb737a15fb531c90951eafe)) +* update Italian (Switzerland) [it-ch] locale relativeTime ([#1829](https://github.com/iamkun/dayjs/issues/1829)) ([8e6d11d](https://github.com/iamkun/dayjs/commit/8e6d11d053393d97bee1ba411adb2d82de1a58c4)) +* update Kurdish [ku] locale strings and formatted output contains non-standard kurdish characters ([#1848](https://github.com/iamkun/dayjs/issues/1848)) ([a597d0b](https://github.com/iamkun/dayjs/commit/a597d0b1b8dd28e626f8c59d326622088f7b51e7)) +* update locale bo [Tibetan]: corrected the orders in formats ([#1823](https://github.com/iamkun/dayjs/issues/1823)) ([e790516](https://github.com/iamkun/dayjs/commit/e79051617af6787358f6c9b5443d987b8b53a9e1)) + +# [1.11.0](https://github.com/iamkun/dayjs/compare/v1.10.8...v1.11.0) (2022-03-14) + + +### Bug Fixes + +* Add Kirundi (rn) locale ([#1793](https://github.com/iamkun/dayjs/issues/1793)) ([74e5247](https://github.com/iamkun/dayjs/commit/74e5247227a779fffde39bdfcd1ee19911496709)) +* add missing date shorthand D type definition ([#1752](https://github.com/iamkun/dayjs/issues/1752)) ([b045baf](https://github.com/iamkun/dayjs/commit/b045baf1646a81f7e4f446f355d02d5fb0ef4aa7)) +* Add relative time to Galician (gl) and fix ordinals ([#1800](https://github.com/iamkun/dayjs/issues/1800)) ([dcbf170](https://github.com/iamkun/dayjs/commit/dcbf1708400624addfbddbc71e0f6a9ac15fa961)) +* update German locales (de-at, de-ch) ([#1775](https://github.com/iamkun/dayjs/issues/1775)) ([f9055a7](https://github.com/iamkun/dayjs/commit/f9055a77bf3d84c575e5fcf99e21611138ba64d7)) +* update Icelandic [is] locale relativeTime config ([#1796](https://github.com/iamkun/dayjs/issues/1796)) ([76f9e17](https://github.com/iamkun/dayjs/commit/76f9e1756de7e99c01e471dab30ea074b9ec9629)) +* Update index.d.ts note ([#1716](https://github.com/iamkun/dayjs/issues/1716)) ([5a108ff](https://github.com/iamkun/dayjs/commit/5a108ff3159c53fd270ea7638f33c35c934d6457)) +* Update locale German [de] monthsShort ([#1746](https://github.com/iamkun/dayjs/issues/1746)) ([4a7b7d0](https://github.com/iamkun/dayjs/commit/4a7b7d07c885bb9338514c234dbb708e24e9863e)) +* update meridiem function to Kurdish (ku) locale ([#1725](https://github.com/iamkun/dayjs/issues/1725)) ([efd3904](https://github.com/iamkun/dayjs/commit/efd3904ff8cbf0a4fc064911dda76fc86b669f7b)) +* update updateLocal plugin typescript types ([#1692](https://github.com/iamkun/dayjs/issues/1692)) ([c7a3f73](https://github.com/iamkun/dayjs/commit/c7a3f73064dbb63b4d365b2ad4c792f075f4d8d8)) + + +### Features + +* Fallback to language only locale + support uppercase locales ([#1524](https://github.com/iamkun/dayjs/issues/1524)) ([9138dc2](https://github.com/iamkun/dayjs/commit/9138dc28206875372da4fb74c64716437cd11b95)) + +## [1.10.8](https://github.com/iamkun/dayjs/compare/v1.10.7...v1.10.8) (2022-02-28) + + +### Bug Fixes + +* set locale pt, pt-br correct weekdays and months ([#1697](https://github.com/iamkun/dayjs/issues/1697)) ([e019301](https://github.com/iamkun/dayjs/commit/e01930171c8235f58a114236f146086428f99569)) + +## [1.10.7](https://github.com/iamkun/dayjs/compare/v1.10.6...v1.10.7) (2021-09-10) + + +### Bug Fixes + +* Add Spanish (Mexico) [es-mx] locale ([#1614](https://github.com/iamkun/dayjs/issues/1614)) ([3393f2a](https://github.com/iamkun/dayjs/commit/3393f2ad55346d55902683a2e31c6f253d96c8c2)) +* Add Arabic (Iraq) [ar-iq] locale ([#1627](https://github.com/iamkun/dayjs/issues/1627)) ([b5a1391](https://github.com/iamkun/dayjs/commit/b5a1391011b247d08863d291542db5937b23b427)) +* add format object type to type file ([#1572](https://github.com/iamkun/dayjs/issues/1572)) ([5a79cc6](https://github.com/iamkun/dayjs/commit/5a79cc6408e825d9e123629eb44fc19c996d7751)) +* duration plugin when parsing duration from ISO string, set missing components to 0 instead of NaN ([#1611](https://github.com/iamkun/dayjs/issues/1611)) ([252585b](https://github.com/iamkun/dayjs/commit/252585b4b2bd59508150e21bb994908a9d78f9b0)) +* narrow type for `add` and `subtract` ([#1576](https://github.com/iamkun/dayjs/issues/1576)) ([1686962](https://github.com/iamkun/dayjs/commit/16869621b1a42563064dbf87f80c1ebfd74c1188)) +* update customParseFormat plugin strict x X parsing ([#1571](https://github.com/iamkun/dayjs/issues/1571)) ([08adda5](https://github.com/iamkun/dayjs/commit/08adda54edbcca38601f57841921d0f87f84e49e)) +* update Lithuanian [lt] locale spelling for single month ([#1609](https://github.com/iamkun/dayjs/issues/1609)) ([255dc54](https://github.com/iamkun/dayjs/commit/255dc54d9295de135a9037ce6ca13cae4bfd2cfb)) +* Update Norwegian Bokmål [nb] local yearStart 4 ([#1608](https://github.com/iamkun/dayjs/issues/1608)) ([7a8467c](https://github.com/iamkun/dayjs/commit/7a8467c0b7d59821f7e19d4a6973bcda8e4c19b1)) +* update plugin advancedFormat `isValid` validation ([#1566](https://github.com/iamkun/dayjs/issues/1566)) ([755fc8b](https://github.com/iamkun/dayjs/commit/755fc8bb1c532eb991459f180eee81367d12016c)) +* update Sinhalese [si] locale month name ([#1475](https://github.com/iamkun/dayjs/issues/1475)) ([63de2a8](https://github.com/iamkun/dayjs/commit/63de2a8b7dcd7e68c132c85d88572d4c9d296907)) +* update utcOffset plugin type file ([#1604](https://github.com/iamkun/dayjs/issues/1604)) ([f68e4b1](https://github.com/iamkun/dayjs/commit/f68e4b1a29fc33542f74cde10ec6d9fb045ca37e)) + +## [1.10.6](https://github.com/iamkun/dayjs/compare/v1.10.5...v1.10.6) (2021-07-06) + + +### Bug Fixes + +* add invalid date string override ([#1465](https://github.com/iamkun/dayjs/issues/1465)) ([#1470](https://github.com/iamkun/dayjs/issues/1470)) ([06f88f4](https://github.com/iamkun/dayjs/commit/06f88f425828b1ce96b737332d25145a95a4ee9d)) +* add sv-fi Finland Swedish locale ([#1522](https://github.com/iamkun/dayjs/issues/1522)) ([8e32164](https://github.com/iamkun/dayjs/commit/8e32164855cff724642e24c37a631eb4c4d760c8)) +* customParseFormat support parsing X x timestamp ([#1567](https://github.com/iamkun/dayjs/issues/1567)) ([eb087f5](https://github.com/iamkun/dayjs/commit/eb087f52861313b8dd8a5c1b77858665ec72859e)) +* dayjs ConfigTypeMap add null & undefined ([#1560](https://github.com/iamkun/dayjs/issues/1560)) ([b5e40e6](https://github.com/iamkun/dayjs/commit/b5e40e6f16abeaea6a0facfa466d20aefaa8a444)) +* Fix DayOfYear plugin when using BadMutable plugin ([#1511](https://github.com/iamkun/dayjs/issues/1511)) ([0b0c6a3](https://github.com/iamkun/dayjs/commit/0b0c6a31ec9c0aff991b0e8dd6eed116201274cc)) +* Implement ordinal in Bulgarian translation (fixes [#1501](https://github.com/iamkun/dayjs/issues/1501)) ([#1502](https://github.com/iamkun/dayjs/issues/1502)) ([b728da5](https://github.com/iamkun/dayjs/commit/b728da5ed9ed08210004ed20ce5fcd52a92de7da)) +* more strict delimiter in REGEX_PARSE ([#1555](https://github.com/iamkun/dayjs/issues/1555)) ([bfdab5c](https://github.com/iamkun/dayjs/commit/bfdab5c0d45a5736b68e8e1b1354fc021e05f607)) +* parameter type ([#1549](https://github.com/iamkun/dayjs/issues/1549)) ([f369844](https://github.com/iamkun/dayjs/commit/f369844dd69d253c4c7cbf68150939db3db233be)) +* update customParseFormat plugin to custom two-digit year parse function ([#1421](https://github.com/iamkun/dayjs/issues/1421)) ([bb5df55](https://github.com/iamkun/dayjs/commit/bb5df55cd3975dc7638b8f4e762afa470b6620f7)) +* update names of weekdays and months in Bulgarian [bg] to lowercase ([#1438](https://github.com/iamkun/dayjs/issues/1438)) ([b246210](https://github.com/iamkun/dayjs/commit/b24621091fec9cf6704de21e4b323f6f0c4abbf1)) +* update type file `.diff` ([#1505](https://github.com/iamkun/dayjs/issues/1505)) ([6508494](https://github.com/iamkun/dayjs/commit/6508494a4e62977b4397baaeef293d1bcf3c7235)) +* update UTC plugin type file for strict parsing ([#1443](https://github.com/iamkun/dayjs/issues/1443)) ([b4f28df](https://github.com/iamkun/dayjs/commit/b4f28df219fe63202dffdbeeaec5677c4d2c9111)) + +## [1.10.5](https://github.com/iamkun/dayjs/compare/v1.10.4...v1.10.5) (2021-05-26) + + +### Bug Fixes + +* add meridiem in ar locales ([#1375](https://github.com/iamkun/dayjs/issues/1375)) ([319f616](https://github.com/iamkun/dayjs/commit/319f616e572a03b984013d04d1b3a18ffd5b1190)) +* Added Zulu support to customParseFormat ([#1359](https://github.com/iamkun/dayjs/issues/1359)) ([1138a3f](https://github.com/iamkun/dayjs/commit/1138a3f0a76592c6d72fb86c4399e133fa41e2ec)) +* fix Bengali [bn] locale monthsShort error ([a0e6c0c](https://github.com/iamkun/dayjs/commit/a0e6c0cf3e1828020dfa11432c6716990f6ed5e0)) +* fix missing types for ArraySupport plugin ([#1401](https://github.com/iamkun/dayjs/issues/1401)) ([b1abdc4](https://github.com/iamkun/dayjs/commit/b1abdc40ee6c9d18ff46c311a114e0755677ea6f)) +* fix Ukrainian [uk] locale ([#1463](https://github.com/iamkun/dayjs/issues/1463)) ([0fdac93](https://github.com/iamkun/dayjs/commit/0fdac93ff2531542301b76952be9b084b2e2dfa0)) +* hotfix for `Duration` types ([#1357](https://github.com/iamkun/dayjs/issues/1357)) ([855b7b3](https://github.com/iamkun/dayjs/commit/855b7b3d049a3903794f91db3419f167c00dabd2)), closes [#1354](https://github.com/iamkun/dayjs/issues/1354) +* timezone plugin DST error ([#1352](https://github.com/iamkun/dayjs/issues/1352)) ([71bed15](https://github.com/iamkun/dayjs/commit/71bed155edf32bff24379930ac684fc783538d8f)) +* Update duration plugin change string to number ([#1394](https://github.com/iamkun/dayjs/issues/1394)) ([e1546d1](https://github.com/iamkun/dayjs/commit/e1546d1a0cdb97ae92cf11efe61d94707af6a3a3)) +* update Duration plugin to support no-argument ([#1400](https://github.com/iamkun/dayjs/issues/1400)) ([8d9a5ae](https://github.com/iamkun/dayjs/commit/8d9a5ae0749e1b4e76babd4deeaa3b1d9776c29b)) +* Update Finnish [fi] locale to set yearStart ([#1378](https://github.com/iamkun/dayjs/issues/1378)) ([f3370bd](https://github.com/iamkun/dayjs/commit/f3370bda4e435118f714c8a7daf5c88cfc4b69ba)) +* update Russian [ru] locale meridiem and unit tests ([#1403](https://github.com/iamkun/dayjs/issues/1403)) ([f10f39d](https://github.com/iamkun/dayjs/commit/f10f39de7db70244a3c35e4a421090a12972457b)) +* update Russian [ru] locale yearStart config ([#1372](https://github.com/iamkun/dayjs/issues/1372)) ([5052515](https://github.com/iamkun/dayjs/commit/5052515fe35b2444201ef8ef87220b1876a94d0a)) +* update Slovenian [sl] locale to set correct ordinal ([#1386](https://github.com/iamkun/dayjs/issues/1386)) ([cb4f746](https://github.com/iamkun/dayjs/commit/cb4f74633b3020d6dbf19548c8cb13613dafca18)) +* update Spanish [es] locale to change month names to lowercase ([#1414](https://github.com/iamkun/dayjs/issues/1414)) ([9c20e77](https://github.com/iamkun/dayjs/commit/9c20e77caf7b1b5eccf418175203b198d4e29535)) +* update Swedish [sv] locale to set correct yearStart ([#1385](https://github.com/iamkun/dayjs/issues/1385)) ([66c5935](https://github.com/iamkun/dayjs/commit/66c59354964ef456bcd5f6152819618f44978082)) +* update UTC plugin to support string argument like +HH:mm ([#1395](https://github.com/iamkun/dayjs/issues/1395)) ([656127c](https://github.com/iamkun/dayjs/commit/656127cc44eda50923a1ac755602863fc32b9e69)) + +## [1.10.4](https://github.com/iamkun/dayjs/compare/v1.10.3...v1.10.4) (2021-01-22) + + +### Bug Fixes + +* Correct handling negative duration ([#1317](https://github.com/iamkun/dayjs/issues/1317)) ([3f5c085](https://github.com/iamkun/dayjs/commit/3f5c085608182472f20b84766b10949945663e44)) +* Improve `Duration` types ([#1338](https://github.com/iamkun/dayjs/issues/1338)) ([4aca4b1](https://github.com/iamkun/dayjs/commit/4aca4b1b584a15de1146d929f95c944594032f20)) +* parse a string for MMM month format with underscore delimiter ([#1349](https://github.com/iamkun/dayjs/issues/1349)) ([82ef9a3](https://github.com/iamkun/dayjs/commit/82ef9a304f06287ac0a14c4da9a7fe6152b5fec9)) +* Update Bengali [bn] locale ([#1329](https://github.com/iamkun/dayjs/issues/1329)) ([02d96ec](https://github.com/iamkun/dayjs/commit/02d96ec7189f62d6ef8987135919cbb5ceff20a6)) +* update locale Portuguese [pt] yearStart ([#1345](https://github.com/iamkun/dayjs/issues/1345)) ([5c785d5](https://github.com/iamkun/dayjs/commit/5c785d528cc08811638d7cbfc7fc158d67b32d75)) +* update Polish [pl] locale yearStart ([#1348](https://github.com/iamkun/dayjs/issues/1348)) ([e93e6b8](https://github.com/iamkun/dayjs/commit/e93e6b8ffa61036b26382f1763e3864d4a7d5df5)) +* Update Slovenian [sl] relativeTime locale ([#1333](https://github.com/iamkun/dayjs/issues/1333)) ([fe5f1d0](https://github.com/iamkun/dayjs/commit/fe5f1d0afbe57b70339e268047e6c3028ca3d59b)) + +## [1.10.3](https://github.com/iamkun/dayjs/compare/v1.10.2...v1.10.3) (2021-01-09) + + +### Bug Fixes + +* fix customParseFormat plugin strict mode parse meridiem bug ([#1321](https://github.com/iamkun/dayjs/issues/1321)) ([e49eeef](https://github.com/iamkun/dayjs/commit/e49eeefbe8acb36419d36ca2e7ed8bc152f73ac1)) +* fix weekYear plugin missing locale bug ([#1319](https://github.com/iamkun/dayjs/issues/1319)) ([344bdc0](https://github.com/iamkun/dayjs/commit/344bdc0eed6843edb05723dc7853a41833d88f08)), closes [#1304](https://github.com/iamkun/dayjs/issues/1304) +* update advancedFormat plugin to add format options for iso week and weekyear ([#1309](https://github.com/iamkun/dayjs/issues/1309)) ([2c54c64](https://github.com/iamkun/dayjs/commit/2c54c6441871a175ac9b95e41e4cd075dbac10cb)) +* update devHelper to add dev warning setting locale before loading ([c5cc893](https://github.com/iamkun/dayjs/commit/c5cc89355e1e206ca72433c19c40cb528690b04f)) +* update German [de] locale yearStart ([1858df8](https://github.com/iamkun/dayjs/commit/1858df8008de56570680723df89b36a8cbc970ef)), closes [#1264](https://github.com/iamkun/dayjs/issues/1264) + +## [1.10.2](https://github.com/iamkun/dayjs/compare/v1.10.1...v1.10.2) (2021-01-05) + + +### Bug Fixes + +* fix parse regex bug ([#1307](https://github.com/iamkun/dayjs/issues/1307)) ([db2b6a5](https://github.com/iamkun/dayjs/commit/db2b6a5ea8e70f9fda645d113ca33495aa96b616)), closes [#1305](https://github.com/iamkun/dayjs/issues/1305) +* remove module entry in package.json to revert 1.10.1 change ([#1314](https://github.com/iamkun/dayjs/issues/1314)) ([824dcb8](https://github.com/iamkun/dayjs/commit/824dcb8dfcccf14f64b6a2741a00fcdfe53dcd98)) +* update devHelper add warning "passing Year as a Number will be parsed as a Unix timestamp" ([#1315](https://github.com/iamkun/dayjs/issues/1315)) ([b0dda31](https://github.com/iamkun/dayjs/commit/b0dda3139e25441ab4e7c1f4f192dee0ecce6ef8)) + +## [1.10.1](https://github.com/iamkun/dayjs/compare/v1.10.0...v1.10.1) (2021-01-03) + + +### Bug Fixes + +* fix typescript type error UnitTypeLongPlural ([#1302](https://github.com/iamkun/dayjs/issues/1302)) ([bfaabe4](https://github.com/iamkun/dayjs/commit/bfaabe4f398c11564eca6cda7c8aded22e1b231a)), closes [#1300](https://github.com/iamkun/dayjs/issues/1300) + +# [1.10.0](https://github.com/iamkun/dayjs/compare/v1.9.8...v1.10.0) (2021-01-03) + + +### Bug Fixes + +* add ordinal to localeData plugin ([#1266](https://github.com/iamkun/dayjs/issues/1266)) ([fd229fa](https://github.com/iamkun/dayjs/commit/fd229fa5bd26bcba810e2535eb937ea8d99106c2)) +* add preParsePostFormat plugin & update Arabic [ar] locale ([#1255](https://github.com/iamkun/dayjs/issues/1255)) ([f2e4790](https://github.com/iamkun/dayjs/commit/f2e479006a9a49bc0917f8620101d40ac645f7f2)) +* add type support for plural forms of units ([#1289](https://github.com/iamkun/dayjs/issues/1289)) ([de49bb1](https://github.com/iamkun/dayjs/commit/de49bb100badfb92b9a5933cc568841f340a923f)) +* escape last period to match only milliseconds ([#1239](https://github.com/iamkun/dayjs/issues/1239)) ([#1295](https://github.com/iamkun/dayjs/issues/1295)) ([64037e6](https://github.com/iamkun/dayjs/commit/64037e6a8cf303dcfd2b954f309bd9691f87fffc)) + + +### Features + +* add ES6 Module Support, package.json module point to "esm/index.js" ([#1298](https://github.com/iamkun/dayjs/issues/1298)) ([f63375d](https://github.com/iamkun/dayjs/commit/f63375dea89becbd3bb2bb8ea7289c58c752bfed)), closes [#598](https://github.com/iamkun/dayjs/issues/598) [#313](https://github.com/iamkun/dayjs/issues/313) + +## [1.9.8](https://github.com/iamkun/dayjs/compare/v1.9.7...v1.9.8) (2020-12-27) + + +### Bug Fixes + +* fix Ukrainian [uk] locale typo ([1605cc0](https://github.com/iamkun/dayjs/commit/1605cc0f6fe0e9c46a92d529bc9cd6e130432337)) +* update Hebrew [he] locale for double units ([#1287](https://github.com/iamkun/dayjs/issues/1287)) ([1c4b0da](https://github.com/iamkun/dayjs/commit/1c4b0da1468522e59dc9ee646d10dd2b31477d99)) +* update zh locale meridiem "noon" ([0e7ff3d](https://github.com/iamkun/dayjs/commit/0e7ff3dd29ca3aed85cb76dfcb8298d326e26542)) +* update zh-cn locale definition of noon ([#1278](https://github.com/iamkun/dayjs/issues/1278)) ([d5930b9](https://github.com/iamkun/dayjs/commit/d5930b96ff884f4176ca3fcb1bc95e8f1ec75c71)) + +## [1.9.7](https://github.com/iamkun/dayjs/compare/v1.9.6...v1.9.7) (2020-12-05) + + +### Bug Fixes + +* add duration.format to format a Duration ([#1202](https://github.com/iamkun/dayjs/issues/1202)) ([9a859a1](https://github.com/iamkun/dayjs/commit/9a859a147ba223a1eeff0f2bb6f33d97e0ccc6c7)) +* Add function handling for relativeTime.future and relativeTime.past ([#1197](https://github.com/iamkun/dayjs/issues/1197)) ([ef1979c](https://github.com/iamkun/dayjs/commit/ef1979ce85c61fe2d759ef3c37cb6aaf2358094f)) +* avoid install installed plugin ([#1214](https://github.com/iamkun/dayjs/issues/1214)) ([a92eb6c](https://github.com/iamkun/dayjs/commit/a92eb6c4dc1437ec920e69484d52984f5921a8ea)) +* avoid memory leak after installing a plugin too many times ([b8d2e32](https://github.com/iamkun/dayjs/commit/b8d2e32a9eb59661a7ed6200daa070687becaebd)) +* fix diff bug when UTC plugin enabled ([#1201](https://github.com/iamkun/dayjs/issues/1201)) ([9544ed2](https://github.com/iamkun/dayjs/commit/9544ed2a6c466b8308d26b33a388a6737435a1f4)), closes [#1200](https://github.com/iamkun/dayjs/issues/1200) +* fix startOf/endOf bug in timezone plugin ([#1229](https://github.com/iamkun/dayjs/issues/1229)) ([eb5fbc4](https://github.com/iamkun/dayjs/commit/eb5fbc4c7d1b62a8615d2f263b404a9515d8e15c)) +* fix utc plugin diff edge case ([#1187](https://github.com/iamkun/dayjs/issues/1187)) ([971b3d4](https://github.com/iamkun/dayjs/commit/971b3d40b4c9403165138f1034e2223cd97c3abf)) +* update customParseFormat plugin to parse 2-digit offset ([#1209](https://github.com/iamkun/dayjs/issues/1209)) ([b56936a](https://github.com/iamkun/dayjs/commit/b56936ab77b8f6289a1b77d49307b495c4bf9f91)), closes [#1205](https://github.com/iamkun/dayjs/issues/1205) +* Update timezone plugin type definition ([#1221](https://github.com/iamkun/dayjs/issues/1221)) ([34cfb92](https://github.com/iamkun/dayjs/commit/34cfb920b9653ad44d4b31fe49e533692a3ce01b)) + +## [1.9.6](https://github.com/iamkun/dayjs/compare/v1.9.5...v1.9.6) (2020-11-10) + + +### Bug Fixes + +* fix customParseFormat plugin parsing date bug ([#1198](https://github.com/iamkun/dayjs/issues/1198)) ([50f05ad](https://github.com/iamkun/dayjs/commit/50f05ad3addf27827c5657ae7519514e40d9faec)), closes [#1194](https://github.com/iamkun/dayjs/issues/1194) +* Update lv (Latvian) locale relative time ([#1192](https://github.com/iamkun/dayjs/issues/1192)) ([6d6c684](https://github.com/iamkun/dayjs/commit/6d6c6841b13ba4f7e69de92caf132a3592c5253a)) + +## [1.9.5](https://github.com/iamkun/dayjs/compare/v1.9.4...v1.9.5) (2020-11-05) + + +### Bug Fixes + +* customParseFormat plugin supports parsing localizedFormats ([#1110](https://github.com/iamkun/dayjs/issues/1110)) ([402b603](https://github.com/iamkun/dayjs/commit/402b603aa3ee4199786950bc88b3fdc6b527aa35)) +* fix customParseFormat plugin parse meridiem bug ([#1169](https://github.com/iamkun/dayjs/issues/1169)) ([9e8f8d9](https://github.com/iamkun/dayjs/commit/9e8f8d96c69d557f4d267f42567c25ae9e7ab227)), closes [#1168](https://github.com/iamkun/dayjs/issues/1168) +* fix devHelper error in umd bundle in browser ([#1165](https://github.com/iamkun/dayjs/issues/1165)) ([d11b5ee](https://github.com/iamkun/dayjs/commit/d11b5ee7dc11af671355f65ccda00f6ba42cc725)) +* fix utc plugin diff bug in DST ([#1171](https://github.com/iamkun/dayjs/issues/1171)) ([f8da3fe](https://github.com/iamkun/dayjs/commit/f8da3fe7e50c84c0502bf5be0b364910922dbd79)), closes [#1097](https://github.com/iamkun/dayjs/issues/1097) [#1021](https://github.com/iamkun/dayjs/issues/1021) +* isoWeek plugin type ([#1177](https://github.com/iamkun/dayjs/issues/1177)) ([c3d0436](https://github.com/iamkun/dayjs/commit/c3d0436b06f74989e3a2c751a5d170f8072c4aad)) +* update localeData plugin to support meridiem ([#1174](https://github.com/iamkun/dayjs/issues/1174)) ([fdb09e4](https://github.com/iamkun/dayjs/commit/fdb09e4074cc7e8f6196846f18d3566c1f9e8fcd)), closes [#1172](https://github.com/iamkun/dayjs/issues/1172) +* update timezone plugin parse Date instance / timestamp logic & remove useless test ([#1183](https://github.com/iamkun/dayjs/issues/1183)) ([a7f858b](https://github.com/iamkun/dayjs/commit/a7f858bb70ad81f718ba35c479e84b54eace48b2)) + +## [1.9.4](https://github.com/iamkun/dayjs/compare/v1.9.3...v1.9.4) (2020-10-23) + + +### Bug Fixes + +* Add descriptions to types ([#1148](https://github.com/iamkun/dayjs/issues/1148)) ([9a407a1](https://github.com/iamkun/dayjs/commit/9a407a140b089345a387d1aceab4d0d1635229c7)) +* add devHelper plugin ([#1163](https://github.com/iamkun/dayjs/issues/1163)) ([de49dc8](https://github.com/iamkun/dayjs/commit/de49dc80c83b85de4170571b64412bd60ada221b)) +* Fix Hungarian (hu) locale ([#1112](https://github.com/iamkun/dayjs/issues/1112)) ([ab13754](https://github.com/iamkun/dayjs/commit/ab13754f43c5033dacaa0eb2042dc4ab1a7a2754)) +* fix minMax plugin parsing empty array bug ([#1062](https://github.com/iamkun/dayjs/issues/1062)) ([368108b](https://github.com/iamkun/dayjs/commit/368108bc6d5cb1542f711b8eba722bd4dfaab0cd)) +* update adding/subtracting Duration from Dayjs object ([#1156](https://github.com/iamkun/dayjs/issues/1156)) ([f861aca](https://github.com/iamkun/dayjs/commit/f861acac3e83e28d3a4a96312c71119fd6b544fc)) +* update en-NZ locale to use proper ordinal formatting function ([#1143](https://github.com/iamkun/dayjs/issues/1143)) ([fcdbc58](https://github.com/iamkun/dayjs/commit/fcdbc5880710456a29b2bacf250542230bf48b99)) +* update localeData plugin type ([#1116](https://github.com/iamkun/dayjs/issues/1116)) ([ee5a4ec](https://github.com/iamkun/dayjs/commit/ee5a4ec41edddfb57d103c35182dc635c9264a10)) +* update timezone plugin to support custom parse format ([#1160](https://github.com/iamkun/dayjs/issues/1160)) ([48cbf31](https://github.com/iamkun/dayjs/commit/48cbf3118ba5427de428777c2e025896db654f2e)), closes [#1159](https://github.com/iamkun/dayjs/issues/1159) +* update timezone plugin to support keepLocalTime ([#1161](https://github.com/iamkun/dayjs/issues/1161)) ([1d429e5](https://github.com/iamkun/dayjs/commit/1d429e5fe4467ebddcf81b43cf6f36e5e3be944c)), closes [#1149](https://github.com/iamkun/dayjs/issues/1149) + +## [1.9.3](https://github.com/iamkun/dayjs/compare/v1.9.2...v1.9.3) (2020-10-13) + + +### Bug Fixes + +* fix localizedFormat export error ([#1133](https://github.com/iamkun/dayjs/issues/1133)) ([deecd6a](https://github.com/iamkun/dayjs/commit/deecd6ab8a2f4173ee7046f6b568b41fd2677531)), closes [#1132](https://github.com/iamkun/dayjs/issues/1132) + +## [1.9.2](https://github.com/iamkun/dayjs/compare/v1.9.1...v1.9.2) (2020-10-13) + + +### Bug Fixes + +* add arraySupport plugin ([#1129](https://github.com/iamkun/dayjs/issues/1129)) ([be505c2](https://github.com/iamkun/dayjs/commit/be505c2c540261027342cecc55d8919a3d18d893)) +* export type of duration plugin ([#1094](https://github.com/iamkun/dayjs/issues/1094)) ([2c92e71](https://github.com/iamkun/dayjs/commit/2c92e71bf55d09601120cdf433da7a19cc8abff6)) +* Fix LocaleData plugin longDateFormat lowercase error ([#1101](https://github.com/iamkun/dayjs/issues/1101)) ([7937ccd](https://github.com/iamkun/dayjs/commit/7937ccdeac47d094a60e65ebb62a6020b81c46f4)) +* Fix objectSupport plugin bug in UTC ([#1107](https://github.com/iamkun/dayjs/issues/1107)) ([fe90bb6](https://github.com/iamkun/dayjs/commit/fe90bb6944f2ff1969ca975954d303b449dfa95b)), closes [#1105](https://github.com/iamkun/dayjs/issues/1105) +* fix Serbian locale grammar (sr, sr-cyrl) ([#1108](https://github.com/iamkun/dayjs/issues/1108)) ([cc87eff](https://github.com/iamkun/dayjs/commit/cc87eff8b75b0d86ce0956516319d402bccae6c0)) +* Fix typo for "monday" in arabic ([#1067](https://github.com/iamkun/dayjs/issues/1067)) ([2e1e426](https://github.com/iamkun/dayjs/commit/2e1e42650124f30282dc4d710798d576b928f1c7)) +* support dayjs.add(Duration), dayjs.subtract(Duration) ([#1099](https://github.com/iamkun/dayjs/issues/1099)) ([b1a0294](https://github.com/iamkun/dayjs/commit/b1a02942c5238203aaa04ce9a074c73742324ab7)) +* update Breton [br] locale relativeTime config ([#1103](https://github.com/iamkun/dayjs/issues/1103)) ([b038bfd](https://github.com/iamkun/dayjs/commit/b038bfdb128889d677c95534d2be29cc30c9e72f)) +* update Catalan [ca] locale ordinal ([73da380](https://github.com/iamkun/dayjs/commit/73da38024c8b550bdcfbe3ff7e578e742c7aecf2)) +* update German [de] locale relativeTime config ([#1109](https://github.com/iamkun/dayjs/issues/1109)) ([f6e771b](https://github.com/iamkun/dayjs/commit/f6e771b70f93d19ebb12e6b794aa4628a1796248)) +* update localeData plugin to add longDateFormat to global localeData ([#1106](https://github.com/iamkun/dayjs/issues/1106)) ([16937d1](https://github.com/iamkun/dayjs/commit/16937d16e053b8c1d4a607622fa2fdbfd9809832)) +* Update objectSupport plugin to return current date time while parsing empty object ([f56783e](https://github.com/iamkun/dayjs/commit/f56783e14d8cf50916b015e7188b23bb6fbca839)) + +## [1.9.1](https://github.com/iamkun/dayjs/compare/v1.9.0...v1.9.1) (2020-09-28) + + +### Bug Fixes + +* Fix objectSupport plugin to get the correct result (zero-based month) ([#1089](https://github.com/iamkun/dayjs/issues/1089)) ([f95ac15](https://github.com/iamkun/dayjs/commit/f95ac15a4577ae5a3d1ce353872a2cd9fc454bc2)) + +# [1.9.0](https://github.com/iamkun/dayjs/compare/v1.8.36...v1.9.0) (2020-09-28) + + +### Bug Fixes + +* Add `setDefault` typing to timezone.d.ts ([#1057](https://github.com/iamkun/dayjs/issues/1057)) ([c0f0886](https://github.com/iamkun/dayjs/commit/c0f088620f17260e6e3ebce7697d561b5623f5f3)) +* fix DST bug in utc plugin ([#1053](https://github.com/iamkun/dayjs/issues/1053)) ([3d73543](https://github.com/iamkun/dayjs/commit/3d7354361f042ced1176d91f9ae9edffe6173425)) +* Fix optional type for timezone plugin ([#1081](https://github.com/iamkun/dayjs/issues/1081)) ([a6ebcf2](https://github.com/iamkun/dayjs/commit/a6ebcf283a83273562dce5663155e3b3a12ea9a5)), closes [#1079](https://github.com/iamkun/dayjs/issues/1079) +* Fix timezone plugin conversion bug ([#1073](https://github.com/iamkun/dayjs/issues/1073)) ([16816a3](https://github.com/iamkun/dayjs/commit/16816a31ff43220aca9d1d179df6b729182abb55)) +* update duration plugin type file ([#1065](https://github.com/iamkun/dayjs/issues/1065)) ([94af9af](https://github.com/iamkun/dayjs/commit/94af9af27c5bc182cbb24f1845e561dd1d82d776)) +* update timezone plugin to support getting offset name e.g. EST ([#1069](https://github.com/iamkun/dayjs/issues/1069)) ([cbb755e](https://github.com/iamkun/dayjs/commit/cbb755e5c68d49c5678291f3ce832b32831a056e)) +* update utc plugin to support keepLocalTime `.utc(true)` ([#1080](https://github.com/iamkun/dayjs/issues/1080)) ([5ce4e0d](https://github.com/iamkun/dayjs/commit/5ce4e0d2f552f3645262537ff7afdc946f5a7e72)) + + +### Features + +* Correct casing for en-sg locale name ([#1048](https://github.com/iamkun/dayjs/issues/1048)) ([2edaddc](https://github.com/iamkun/dayjs/commit/2edaddc22a7eb914f915531f389766217acd7034)) + +## [1.8.36](https://github.com/iamkun/dayjs/compare/v1.8.35...v1.8.36) (2020-09-17) + + +### Bug Fixes + +* Add Amharic (am) locale ([#1046](https://github.com/iamkun/dayjs/issues/1046)) ([cdc49a1](https://github.com/iamkun/dayjs/commit/cdc49a1911c74b7ea96ed222f42796d53715cfed)) +* Export Duration type in duration plugin ([#1043](https://github.com/iamkun/dayjs/issues/1043)) ([0f20c3a](https://github.com/iamkun/dayjs/commit/0f20c3ac75d9ac1026a15a7bb343d3a150d9b30f)) +* Fix duration plugin parsing milliseconds bug ([#1042](https://github.com/iamkun/dayjs/issues/1042)) ([fe2301b](https://github.com/iamkun/dayjs/commit/fe2301b22318886aaa89ed1620e0a118e98c2b8a)) +* Timezone plugin set default timezone ([#1033](https://github.com/iamkun/dayjs/issues/1033)) ([0c2050a](https://github.com/iamkun/dayjs/commit/0c2050a152da708b01edd6150a5013f642b14576)) +* Timezone plugin should have the same behavior in latest ICU version ([#1032](https://github.com/iamkun/dayjs/issues/1032)) ([de31592](https://github.com/iamkun/dayjs/commit/de315921575cc50c38464b27d0338e30a54d8e2a)) +* Update Finnish (fi) locale ([#963](https://github.com/iamkun/dayjs/issues/963)) ([cf8b6a0](https://github.com/iamkun/dayjs/commit/cf8b6a096f24b54cbdb95675ac386d8ac85ea616)) +* Update Polish (pl) , Hungarian (hr) and Lithuanian (lt) localization ([#1045](https://github.com/iamkun/dayjs/issues/1045)) ([638fd39](https://github.com/iamkun/dayjs/commit/638fd394fc24f4188390faf387da6b156e7c6320)) + +## [1.8.35](https://github.com/iamkun/dayjs/compare/v1.8.34...v1.8.35) (2020-09-02) + + +### Bug Fixes + +* Fix BadMutable plugin bug in .diff ([#1023](https://github.com/iamkun/dayjs/issues/1023)) ([40ab6d9](https://github.com/iamkun/dayjs/commit/40ab6d9a53e8047cfca63c611c25dd045372d021)) +* fix LocaleData plugin to support instance.weekdays() API ([#1019](https://github.com/iamkun/dayjs/issues/1019)) ([a09d259](https://github.com/iamkun/dayjs/commit/a09d259a407b81d1cb6bb5623fad551c775d8674)), closes [#1017](https://github.com/iamkun/dayjs/issues/1017) +* Update Dutch (nl) locale to set correct yearStart ([1533a2c](https://github.com/iamkun/dayjs/commit/1533a2cc1475270032da2d87b19fc3d62327e6e3)) + +## [1.8.34](https://github.com/iamkun/dayjs/compare/v1.8.33...v1.8.34) (2020-08-20) + + +### Bug Fixes + +* Fix Timezone plugin to preserve milliseconds while changing timezone ([#1003](https://github.com/iamkun/dayjs/issues/1003)) ([5f446ed](https://github.com/iamkun/dayjs/commit/5f446eda770fa97e895c81a8195b3ba5d082cef0)), closes [#1002](https://github.com/iamkun/dayjs/issues/1002) +* support parsing unlimited decimals of millisecond ([#1010](https://github.com/iamkun/dayjs/issues/1010)) ([d1bdd36](https://github.com/iamkun/dayjs/commit/d1bdd36a56e3d1786523a180e3fc18068f609135)), closes [#544](https://github.com/iamkun/dayjs/issues/544) +* update Duration plugin to support global locale ([#1008](https://github.com/iamkun/dayjs/issues/1008)) ([1c49c83](https://github.com/iamkun/dayjs/commit/1c49c83e79811eede13db6372b5d65db598aee77)), closes [#1007](https://github.com/iamkun/dayjs/issues/1007) + +## [1.8.33](https://github.com/iamkun/dayjs/compare/v1.8.32...v1.8.33) (2020-08-10) + + +### Bug Fixes + +* Add PluralGetSet plugin for plural getters/setters ([#996](https://github.com/iamkun/dayjs/issues/996)) ([f76e3ce](https://github.com/iamkun/dayjs/commit/f76e3ce2fbe5d3e9ed9121086baf55eb0cc4d355)) +* Add typescript type defs in esm build ([#985](https://github.com/iamkun/dayjs/issues/985)) ([50e3b3c](https://github.com/iamkun/dayjs/commit/50e3b3c6719cb0b4ec6eff394dacd63d5db8f253)) +* Fix isoWeek Plugin cal bug in UTC mode ([#993](https://github.com/iamkun/dayjs/issues/993)) ([f2e5f32](https://github.com/iamkun/dayjs/commit/f2e5f327aaf12b4572296ec6e107ecc05fcf76e7)) +* Fix Timezone plugin parsing js date, Day.js object, timestamp bug && update type file ([#994](https://github.com/iamkun/dayjs/issues/994)) ([22f3d49](https://github.com/iamkun/dayjs/commit/22f3d49405da98db6da56d1673eebcd01b57554b)), closes [#992](https://github.com/iamkun/dayjs/issues/992) [#989](https://github.com/iamkun/dayjs/issues/989) +* Fix Timezone plugin UTCOffset rounding bug ([#987](https://github.com/iamkun/dayjs/issues/987)) ([b07182b](https://github.com/iamkun/dayjs/commit/b07182bbdf5aef7f6bf1e88fcd38432e2b8ee465)), closes [#986](https://github.com/iamkun/dayjs/issues/986) +* Fix UTC plugin bug while comparing an utc instance to a local one ([#995](https://github.com/iamkun/dayjs/issues/995)) ([747c0fb](https://github.com/iamkun/dayjs/commit/747c0fb4eba6353755b5dad3417fd8d5a408c378)) +* Update pt-br locale weekStart 0 ([#984](https://github.com/iamkun/dayjs/issues/984)) ([0f881c1](https://github.com/iamkun/dayjs/commit/0f881c18efb02b9d0ba7f76cba92bb504226fa95)) + +## [1.8.32](https://github.com/iamkun/dayjs/compare/v1.8.31...v1.8.32) (2020-08-04) + + +### Bug Fixes + +* Add Experimental Timezone Plugin ([#974](https://github.com/iamkun/dayjs/issues/974)) ([e69caba](https://github.com/iamkun/dayjs/commit/e69caba1b0957241a855aa0ae38db899fa2c3795)) +* fix parse date string error e.g. '2020/9/30' ([#980](https://github.com/iamkun/dayjs/issues/980)) ([231790d](https://github.com/iamkun/dayjs/commit/231790da62af0494732960c2c50d86ae9bf63ec6)), closes [#979](https://github.com/iamkun/dayjs/issues/979) +* update monthDiff function to get more accurate results ([19e8a7f](https://github.com/iamkun/dayjs/commit/19e8a7f2f7582b717f49d446822e39603694433c)) +* Update UTC plugin to support keepLocalTime ([#973](https://github.com/iamkun/dayjs/issues/973)) ([9f488e5](https://github.com/iamkun/dayjs/commit/9f488e5aca92f0b4c2951459436829d79f86d8d7)) + +## [1.8.31](https://github.com/iamkun/dayjs/compare/v1.8.30...v1.8.31) (2020-07-29) + + +### Bug Fixes + +* Rollback LocalePresetType to string ([#968](https://github.com/iamkun/dayjs/issues/968)) ([b342bd3](https://github.com/iamkun/dayjs/commit/b342bd3d84987d6c7587a0c4590d614fb0e670d7)) +* Update Regex to parse 'YYYY' correctly ([#969](https://github.com/iamkun/dayjs/issues/969)) ([70c1239](https://github.com/iamkun/dayjs/commit/70c123990dcc6bd479fa2b5d7f9985127872a826)) + +## [1.8.30](https://github.com/iamkun/dayjs/compare/v1.8.29...v1.8.30) (2020-07-22) + + +### Bug Fixes + +* Add Haitian Creole (ht) and Spanish Puerto Rico (es-pr) locale configs ([#958](https://github.com/iamkun/dayjs/issues/958)) ([b2642e2](https://github.com/iamkun/dayjs/commit/b2642e2d1f87734a34808c66e5176cb18bc0414d)) +* Fix UTC plugin wrong hour bug while adding month or year ([#957](https://github.com/iamkun/dayjs/issues/957)) ([28ae070](https://github.com/iamkun/dayjs/commit/28ae070024ff26685c88ce4cc8747307e86923c9)) +* Update French (fr) locale to set correct yearStart ([14ab808](https://github.com/iamkun/dayjs/commit/14ab808a7b7e226f2eb2cbe894916a18ed5d967d)), closes [#956](https://github.com/iamkun/dayjs/issues/956) + +## [1.8.29](https://github.com/iamkun/dayjs/compare/v1.8.28...v1.8.29) (2020-07-02) + + +### Bug Fixes + +* Duration plugin supports parse ISO string with week (W) ([#950](https://github.com/iamkun/dayjs/issues/950)) ([f0fc12a](https://github.com/iamkun/dayjs/commit/f0fc12adadcab53fb0577ad8f5e2f1cf784fd8f5)) +* LocaleData plugin supports locale order ([#938](https://github.com/iamkun/dayjs/issues/938)) ([62f429d](https://github.com/iamkun/dayjs/commit/62f429db73a0a069b1267231dea172b85f4b90e3)), closes [#936](https://github.com/iamkun/dayjs/issues/936) +* Update type definition to support array format ([#945](https://github.com/iamkun/dayjs/issues/945)) ([81d4740](https://github.com/iamkun/dayjs/commit/81d4740511d47e34f891b21afeb0449ef8a28688)), closes [#944](https://github.com/iamkun/dayjs/issues/944) +* Update type definition to support strict mode ([#951](https://github.com/iamkun/dayjs/issues/951)) ([8d54f3f](https://github.com/iamkun/dayjs/commit/8d54f3f7d4d161e72c767fa09699e70a2b3d681c)) + +## [1.8.28](https://github.com/iamkun/dayjs/compare/v1.8.27...v1.8.28) (2020-05-28) + + +### Bug Fixes + +* Fix CustomParseFormat plugin month index error ([#918](https://github.com/iamkun/dayjs/issues/918)) ([fa2ec7f](https://github.com/iamkun/dayjs/commit/fa2ec7fcb980dcd2c7498dafe2f9ca2e52d735cf)), closes [#915](https://github.com/iamkun/dayjs/issues/915) +* Update Ukrainian (uk) locale monthFormat and monthStandalone ([#899](https://github.com/iamkun/dayjs/issues/899)) ([a08756e](https://github.com/iamkun/dayjs/commit/a08756e80bd1d7126fca28c5ad9e382613fc86c4)) + +## [1.8.27](https://github.com/iamkun/dayjs/compare/v1.8.26...v1.8.27) (2020-05-14) + + +### Bug Fixes + +* Add Kinyarwanda (rw) locale ([#903](https://github.com/iamkun/dayjs/issues/903)) ([f355235](https://github.com/iamkun/dayjs/commit/f355235a836540d77880959fb1b614c87e9f7b3e)) +* Add plugin objectSupport ([#887](https://github.com/iamkun/dayjs/issues/887)) ([52dfb13](https://github.com/iamkun/dayjs/commit/52dfb13a6b84f0a753cc5761192b92416f440961)) +* Add Turkmen (tk) locale ([#893](https://github.com/iamkun/dayjs/issues/893)) ([a9ca8dc](https://github.com/iamkun/dayjs/commit/a9ca8dcbbd0964c5b9abb4e8a2d620c983cf091a)) +* Fix CustomParseFormat plugin set locale error ([#896](https://github.com/iamkun/dayjs/issues/896)) ([8035c8a](https://github.com/iamkun/dayjs/commit/8035c8a760549b631252252718db3cdc4ab2f68f)) +* Fix locale month function bug ([#908](https://github.com/iamkun/dayjs/issues/908)) ([bf347c3](https://github.com/iamkun/dayjs/commit/bf347c36e401f50727fb5afcc537497b54b90d6b)) +* Update CustomParseFormat plugin to support Array formats ([#906](https://github.com/iamkun/dayjs/issues/906)) ([97856c6](https://github.com/iamkun/dayjs/commit/97856c603ef5fbbeb1cf8a42387479e56a77dbe8)) + +## [1.8.26](https://github.com/iamkun/dayjs/compare/v1.8.25...v1.8.26) (2020-04-30) + + +### Bug Fixes + +* Fix Duration plugin `.toISOString` format bug ([#889](https://github.com/iamkun/dayjs/issues/889)) ([058d624](https://github.com/iamkun/dayjs/commit/058d624808fd2be024ae846bcb2e03885f39b556)), closes [#888](https://github.com/iamkun/dayjs/issues/888) +* Fix WeekOfYear plugin bug while using BadMutable plugin ([#884](https://github.com/iamkun/dayjs/issues/884)) ([2977438](https://github.com/iamkun/dayjs/commit/2977438458542573a4500e21f7ba5d1f8442960e)) +* Update CustomParseFormat plugin strict mode ([#882](https://github.com/iamkun/dayjs/issues/882)) ([db642ac](https://github.com/iamkun/dayjs/commit/db642ac73e52e00d8c41546b2935c9e691cf66e0)) +* Update RelativeTime plugin default config ([#883](https://github.com/iamkun/dayjs/issues/883)) ([0606f42](https://github.com/iamkun/dayjs/commit/0606f425aef8ccbfc3da3e43cba368130603b0cc)) + +## [1.8.25](https://github.com/iamkun/dayjs/compare/v1.8.24...v1.8.25) (2020-04-21) + + +### Bug Fixes + +* Fix CustomParseFormat plugin of parsing only YYYY / YYYY-MM bug ([#873](https://github.com/iamkun/dayjs/issues/873)) ([3cea04d](https://github.com/iamkun/dayjs/commit/3cea04d33d54d44bbdd3d026b5c7f67ebf176116)), closes [#849](https://github.com/iamkun/dayjs/issues/849) +* Fix Duration plugin get seconds ([#867](https://github.com/iamkun/dayjs/issues/867)) ([62b092d](https://github.com/iamkun/dayjs/commit/62b092d9f9a3db5506ef01f798bdf211f163f53f)) +* Fix type definition of locale ([9790b85](https://github.com/iamkun/dayjs/commit/9790b853e6113243a7f4a81dd12c6509e406a102)) +* Fix UTC plugin startOf, endOf bug ([#872](https://github.com/iamkun/dayjs/issues/872)) ([4141084](https://github.com/iamkun/dayjs/commit/4141084ba96d35cadcda3f1e661bf1d0f6c8e4de)), closes [#809](https://github.com/iamkun/dayjs/issues/809) [#808](https://github.com/iamkun/dayjs/issues/808) + +## [1.8.24](https://github.com/iamkun/dayjs/compare/v1.8.23...v1.8.24) (2020-04-10) + + +### Bug Fixes + +* Add config option to RelativeTime plugin ([#851](https://github.com/iamkun/dayjs/issues/851)) ([bd24034](https://github.com/iamkun/dayjs/commit/bd24034b95bfc656024b75ef3f3c986708845fed)) +* add Duration plugin ([#858](https://github.com/iamkun/dayjs/issues/858)) ([d568273](https://github.com/iamkun/dayjs/commit/d568273223199ca0497f238e2cc3a8d3dcf32d0f)) +* Add en-in, en-tt locales ([#855](https://github.com/iamkun/dayjs/issues/855)) ([c39fb96](https://github.com/iamkun/dayjs/commit/c39fb96e2a9102c14b004c14a6c073af9d266f2f)) +* add isToday, isTomorrow, isYesterday plugins ([#857](https://github.com/iamkun/dayjs/issues/857)) ([fc08ab6](https://github.com/iamkun/dayjs/commit/fc08ab68f8a28269802deeab9d6b0473b92cdc51)) +* Add option callback to Calendar plugin ([#839](https://github.com/iamkun/dayjs/issues/839)) ([b25be90](https://github.com/iamkun/dayjs/commit/b25be9094325295310c8fc5e617fb058be8a5f68)) +* Fix monthsShort for locale fr ([#862](https://github.com/iamkun/dayjs/issues/862)) ([d2de9a0](https://github.com/iamkun/dayjs/commit/d2de9a0b44b830038ed0094f79bfd40726311f2a)) +* Update Breton locale (br) meridiem config ([#856](https://github.com/iamkun/dayjs/issues/856)) ([a2a6672](https://github.com/iamkun/dayjs/commit/a2a66720abb788a8f1cffbfd0929b35579f29c72)) +* Update Ukrainian (uk) locale relative time ([#842](https://github.com/iamkun/dayjs/issues/842)) ([578bc1a](https://github.com/iamkun/dayjs/commit/578bc1a23c6e737783bbac3da12c0ed5d1edcf82)) + +## [1.8.23](https://github.com/iamkun/dayjs/compare/v1.8.22...v1.8.23) (2020-03-16) + + +### Bug Fixes + +* Add Chinese (zh) locale ([f9b8945](https://github.com/iamkun/dayjs/commit/f9b89453166d8b53d33b1d7eefd9942022552e6e)) +* Fix IsoWeek plugin typescript definition ([#828](https://github.com/iamkun/dayjs/issues/828)) ([30aab0c](https://github.com/iamkun/dayjs/commit/30aab0c7bce85dfac0ae208a891def30f88b5cb4)) +* Update Arabic (ar) locale relative time ([#836](https://github.com/iamkun/dayjs/issues/836)) ([14044c6](https://github.com/iamkun/dayjs/commit/14044c6fda1229e3f0e5473d3f886bd79589b15f)) +* Update Slovak (sk) locale, Czech (cs) locale ([#833](https://github.com/iamkun/dayjs/issues/833)) ([f0d451f](https://github.com/iamkun/dayjs/commit/f0d451f795e9ebf752cd854d51b25b11de2343a3)) +* Update Thai (th) locale relativeTime ([#826](https://github.com/iamkun/dayjs/issues/826)) ([63b7c03](https://github.com/iamkun/dayjs/commit/63b7c03a6dbb0507d60776e8bad6cccde3828b88)), closes [#816](https://github.com/iamkun/dayjs/issues/816) + +## [1.8.22](https://github.com/iamkun/dayjs/compare/v1.8.21...v1.8.22) (2020-03-08) + + +### Bug Fixes + +* Add IsoWeek plugin ([#811](https://github.com/iamkun/dayjs/issues/811)) ([28a2207](https://github.com/iamkun/dayjs/commit/28a2207ef9849afbac15dd29267b2e7a09cd3c16)) +* Fix unsupported locale fallback to previous one ([#819](https://github.com/iamkun/dayjs/issues/819)) ([4868715](https://github.com/iamkun/dayjs/commit/48687152cf5bee6a4c1b8ceea4bda8b9bab9be10)) + +## [1.8.21](https://github.com/iamkun/dayjs/compare/v1.8.20...v1.8.21) (2020-02-26) + + +### Bug Fixes + +* Set + Get accept 'D' as the short version of 'date' ([#795](https://github.com/iamkun/dayjs/issues/795)) ([523c038](https://github.com/iamkun/dayjs/commit/523c03880fa8bbad83214494ad02cd606cdb8b30)) +* Update DayOfYear plugin type ([#799](https://github.com/iamkun/dayjs/issues/799)) ([5809652](https://github.com/iamkun/dayjs/commit/5809652e40245b7759827d9bf317abdcfa75a330)) +* Update fi (Finnish) locale relativeTime ([#797](https://github.com/iamkun/dayjs/issues/797)) ([4a470fb](https://github.com/iamkun/dayjs/commit/4a470fbd6fef9e051727d0f26d53cc050b85935d)) + +## [1.8.20](https://github.com/iamkun/dayjs/compare/v1.8.19...v1.8.20) (2020-02-04) + + +### Bug Fixes + +* Add Bislama Locale (bi) ([#780](https://github.com/iamkun/dayjs/issues/780)) ([9ac6ab4](https://github.com/iamkun/dayjs/commit/9ac6ab481bc883dd4ecc02caab12c8b2fc218a42)) +* Fix weekOfYear plugin to support yearStart locale for better week number result ([#769](https://github.com/iamkun/dayjs/issues/769)) ([f00db36](https://github.com/iamkun/dayjs/commit/f00db36e70bc7beaca1abadeb30a9b1fbb3261ee)) +* Update et (Estonian) locale relativeTime ([#790](https://github.com/iamkun/dayjs/issues/790)) ([d8e0f45](https://github.com/iamkun/dayjs/commit/d8e0f45f6cd2d5e5704b9797929227454c92d1a5)) +* Update LocaleData plugin to support dayjs.localeData().weekdays() API ([287fed6](https://github.com/iamkun/dayjs/commit/287fed6db9eb4fd979b4861aca4dacbd32422533)), closes [#779](https://github.com/iamkun/dayjs/issues/779) +* Update LocaleData plugin to support dayjs.months dayjs.weekdays API ([144c2ae](https://github.com/iamkun/dayjs/commit/144c2ae6e15fbf89e3acd7c8cb9e237c5f6e1348)), closes [#779](https://github.com/iamkun/dayjs/issues/779) +* Update pl locale fusional config ([d372475](https://github.com/iamkun/dayjs/commit/d3724758bb27d5b17587b995ba14e7e80dcd1151)) + +## [1.8.19](https://github.com/iamkun/dayjs/compare/v1.8.18...v1.8.19) (2020-01-06) + + +### Bug Fixes + +* Add UpdateLocale plugin to update a locale's properties ([#766](https://github.com/iamkun/dayjs/issues/766)) ([82ce2ba](https://github.com/iamkun/dayjs/commit/82ce2ba8d7e402e40f6d005d400eb5356a0b0633)) +* Fix CustomParseFormat Plugin 'YYYY-MM' use first day of the month ([ba709ec](https://github.com/iamkun/dayjs/commit/ba709eca86a71ae648bc68bf67d9abdc229198d4)), closes [#761](https://github.com/iamkun/dayjs/issues/761) +* Fix CustomParseFormat Plugin to set correct locale ([66ce23f](https://github.com/iamkun/dayjs/commit/66ce23f2e18c5506e8f1a7ef20d3483a4df80087)) +* Fix WeekOfYear Plugin wrong calender week number bug ([79b86db](https://github.com/iamkun/dayjs/commit/79b86dbbf3cfd3f1e2165b3d479a7061ad1b6925)), closes [#760](https://github.com/iamkun/dayjs/issues/760) +* Update RelativeTime plugin to support function to make additional processing ([#767](https://github.com/iamkun/dayjs/issues/767)) ([4bd9250](https://github.com/iamkun/dayjs/commit/4bd9250fbe7131e2fddfb5fa1b3350e8c2262ca9)) +* Update ru, uk, cs locale to support relativeTime with plural ([3f080f7](https://github.com/iamkun/dayjs/commit/3f080f7d6bfdc4018cbb7c4d0112ff1ead4ef6b8)) + +## [1.8.18](https://github.com/iamkun/dayjs/compare/v1.8.17...v1.8.18) (2019-12-18) + + +### Bug Fixes + +* Add missing locale type definition ([#716](https://github.com/iamkun/dayjs/issues/716)) ([cde5d0b](https://github.com/iamkun/dayjs/commit/cde5d0b91be7b2f5f3098de4aa0b9a4f0f28ea5c)) +* Fix .locale() handel unsupported locale ([78ec173](https://github.com/iamkun/dayjs/commit/78ec173fcecc1299516ab7b44f4554d431b4b2fd)) +* Update Italian locale (it) ([#727](https://github.com/iamkun/dayjs/issues/727)) ([5b53e98](https://github.com/iamkun/dayjs/commit/5b53e98c0a3ba0eb9573a9c77caeb907439be9e7)) +* Update locale (fa) ([#733](https://github.com/iamkun/dayjs/issues/733)) ([9ad2e47](https://github.com/iamkun/dayjs/commit/9ad2e47e0569b23991bb0d5578f49c792c12df08)) +* Update locale (zh-cn) ([#706](https://github.com/iamkun/dayjs/issues/706)) ([e31e544](https://github.com/iamkun/dayjs/commit/e31e54414fb90e1f54da13a117748ba37f52645d)) +* Update locale (zh-cn) meridiem ([#735](https://github.com/iamkun/dayjs/issues/735)) ([15d1b81](https://github.com/iamkun/dayjs/commit/15d1b813e7faf5a1f9d1ea6fc673fd27ac49d8b1)) +* Update LocaleData plugin to support dayjs().longDateFormat() ([#734](https://github.com/iamkun/dayjs/issues/734)) ([aa0f210](https://github.com/iamkun/dayjs/commit/aa0f210a1e3c4f6aba61c3b96f9eb445b43a33f0)), closes [#680](https://github.com/iamkun/dayjs/issues/680) +* Update Mongolian (mn) locale relativeTime ([#753](https://github.com/iamkun/dayjs/issues/753)) ([6d51435](https://github.com/iamkun/dayjs/commit/6d51435092c0c94d8e50256d3f0f058cdd15febe)) +* Update Swedish locale (sv) fix ordinal error ([#745](https://github.com/iamkun/dayjs/issues/745)) ([49670d5](https://github.com/iamkun/dayjs/commit/49670d5ae31e4e21636cc5a8bfe35fef0f6d9e4a)), closes [#743](https://github.com/iamkun/dayjs/issues/743) + +## [1.8.17](https://github.com/iamkun/dayjs/compare/v1.8.16...v1.8.17) (2019-11-06) + + +### Bug Fixes + +* Fix set utcOffset in utc mode ([d148115](https://github.com/iamkun/dayjs/commit/d148115dad8f1a5afc0a64e9b8163dfeba4616b6)) +* Update advancedFormat plugin to support w ww wo week tokens … ([#678](https://github.com/iamkun/dayjs/issues/678)) ([26cfa63](https://github.com/iamkun/dayjs/commit/26cfa63a524b803f7966dac5464f9cbf8f63387e)), closes [#676](https://github.com/iamkun/dayjs/issues/676) +* Update ka locale weekdays ([f8ca3d4](https://github.com/iamkun/dayjs/commit/f8ca3d4ba1d3cbe41613d3909c0627935a51a0c4)) +* Update nb locale ([#679](https://github.com/iamkun/dayjs/issues/679)) ([1063b0e](https://github.com/iamkun/dayjs/commit/1063b0e1b5c19a1354d233cc0f21438e7073233a)) +* Update Polish locale (pl)([#713](https://github.com/iamkun/dayjs/issues/713)) ([30d2f02](https://github.com/iamkun/dayjs/commit/30d2f026b47188833a4f44fee4bab52467d4a718)) +* Update Ukrainian locale (uk) ([#710](https://github.com/iamkun/dayjs/issues/710)) ([360161c](https://github.com/iamkun/dayjs/commit/360161cac75f597fdd51d9d1ff138601282a1b4b)) +* UTC plugin set utcOffset value ([#668](https://github.com/iamkun/dayjs/issues/668)) ([8877883](https://github.com/iamkun/dayjs/commit/88778838e71dd309e79cd1a8094d5bea36ca3390)) + +## [1.8.16](https://github.com/iamkun/dayjs/compare/v1.8.15...v1.8.16) (2019-08-27) + + +### Bug Fixes + +* Fix relativeTime Plugin .FromNow() result error in UTC mode ([a385d5c](https://github.com/iamkun/dayjs/commit/a385d5c)) +* Handle locale in WeekOfYear plugin ([#658](https://github.com/iamkun/dayjs/issues/658)) ([0e45b0a](https://github.com/iamkun/dayjs/commit/0e45b0a)) +* LocaleData plugin returns all months and weekdays data when pas no argument ([#645](https://github.com/iamkun/dayjs/issues/645)) ([95e70b4](https://github.com/iamkun/dayjs/commit/95e70b4)) +* Return null in toJSON if not valid ([#633](https://github.com/iamkun/dayjs/issues/633)) ([19affc8](https://github.com/iamkun/dayjs/commit/19affc8)) +* Update Danish (da) locale ([#626](https://github.com/iamkun/dayjs/issues/626)) ([ac2ec77](https://github.com/iamkun/dayjs/commit/ac2ec77)) +* Update Korean locale meridiem ([#642](https://github.com/iamkun/dayjs/issues/642)) ([b457146](https://github.com/iamkun/dayjs/commit/b457146)) +* update Occitan locale Catalan locale ([#630](https://github.com/iamkun/dayjs/issues/630)) ([fef135e](https://github.com/iamkun/dayjs/commit/fef135e)) +* update pt-br locale ([#628](https://github.com/iamkun/dayjs/issues/628)) ([ccf596d](https://github.com/iamkun/dayjs/commit/ccf596d)) +* Update weekdaysShort to some locale files ([#643](https://github.com/iamkun/dayjs/issues/643)) ([cc1f15f](https://github.com/iamkun/dayjs/commit/cc1f15f)) + +## [1.8.15](https://github.com/iamkun/dayjs/compare/v1.8.14...v1.8.15) (2019-07-08) + + +### Bug Fixes + +* Fix dayjs.locale() returns current global locale ([#602](https://github.com/iamkun/dayjs/issues/602)) ([790cd1a](https://github.com/iamkun/dayjs/commit/790cd1a)) +* Fix incorrect Thai locale translation of July ([#607](https://github.com/iamkun/dayjs/issues/607)) ([43cbfd3](https://github.com/iamkun/dayjs/commit/43cbfd3)) +* Lowercase french locale months and weekdays ([#615](https://github.com/iamkun/dayjs/issues/615)) ([e5a257c](https://github.com/iamkun/dayjs/commit/e5a257c)) +* Type - Export Ls object to query all available locales ([#623](https://github.com/iamkun/dayjs/issues/623)) ([f6bfae0](https://github.com/iamkun/dayjs/commit/f6bfae0)) +* Update nb (Norsk Bokmål) locale ([#604](https://github.com/iamkun/dayjs/issues/604)) ([907f5c9](https://github.com/iamkun/dayjs/commit/907f5c9)) +* Update types of `.diff` API ([#617](https://github.com/iamkun/dayjs/issues/617)) ([f0f43d2](https://github.com/iamkun/dayjs/commit/f0f43d2)) + +## [1.8.14](https://github.com/iamkun/dayjs/compare/v1.8.13...v1.8.14) (2019-05-07) + + +### Bug Fixes + +* Fix `.format` API returns UTC offset when value is 0 bug ([b254964](https://github.com/iamkun/dayjs/commit/b254964)) +* Fix QuarterOfYear plugin bug ([#591](https://github.com/iamkun/dayjs/issues/591)) ([434f774](https://github.com/iamkun/dayjs/commit/434f774)) +* Fix UTC plugin add day DST bug ([#590](https://github.com/iamkun/dayjs/issues/590)) ([86cd839](https://github.com/iamkun/dayjs/commit/86cd839)) + +## [1.8.13](https://github.com/iamkun/dayjs/compare/v1.8.12...v1.8.13) (2019-04-26) + + +### Bug Fixes + +* Add missing relativeTime and formats for some locales ([#560](https://github.com/iamkun/dayjs/issues/560)) ([96b917e](https://github.com/iamkun/dayjs/commit/96b917e)) +* Add weekday (locale aware day of the week) plugin ([#569](https://github.com/iamkun/dayjs/issues/569)) ([9007cc5](https://github.com/iamkun/dayjs/commit/9007cc5)), closes [#559](https://github.com/iamkun/dayjs/issues/559) +* Allow customizing "am" / "pm" strings with locale meridiem function ([#580](https://github.com/iamkun/dayjs/issues/580)) ([576e93e](https://github.com/iamkun/dayjs/commit/576e93e)), closes [#578](https://github.com/iamkun/dayjs/issues/578) +* Fix `.add` day/week decimal rouding bug ([800f6c9](https://github.com/iamkun/dayjs/commit/800f6c9)) +* Fix `.diff` type definition error ([#565](https://github.com/iamkun/dayjs/issues/565)) ([c4921ae](https://github.com/iamkun/dayjs/commit/c4921ae)), closes [#561](https://github.com/iamkun/dayjs/issues/561) +* Fix CustomParseFormat plugin bug ([#568](https://github.com/iamkun/dayjs/issues/568)) ([1f5a9db](https://github.com/iamkun/dayjs/commit/1f5a9db)), closes [#555](https://github.com/iamkun/dayjs/issues/555) +* Fix relativeTime plugin Math.round bug ([40bea40](https://github.com/iamkun/dayjs/commit/40bea40)) +* skip square brackets in buddhistEra, advancedFormat plugins ([#556](https://github.com/iamkun/dayjs/issues/556)) ([9279718](https://github.com/iamkun/dayjs/commit/9279718)), closes [#554](https://github.com/iamkun/dayjs/issues/554) +* Update Indonesian locale([#574](https://github.com/iamkun/dayjs/issues/574)) ([0aa7143](https://github.com/iamkun/dayjs/commit/0aa7143)) +* Update locale month to support both array and function ([#581](https://github.com/iamkun/dayjs/issues/581)) ([b6599d3](https://github.com/iamkun/dayjs/commit/b6599d3)) +* Update LocalizedFormat plugin lowercase formats logic ([#557](https://github.com/iamkun/dayjs/issues/557)) ([d409304](https://github.com/iamkun/dayjs/commit/d409304)) + +## [1.8.12](https://github.com/iamkun/dayjs/compare/v1.8.11...v1.8.12) (2019-04-02) + + +### Bug Fixes + +* Add .get API ([7318797](https://github.com/iamkun/dayjs/commit/7318797)) +* Add 79 locales ([#541](https://github.com/iamkun/dayjs/issues/541)) ([f75a125](https://github.com/iamkun/dayjs/commit/f75a125)) +* Add Calendar plugin ([d1b9cf9](https://github.com/iamkun/dayjs/commit/d1b9cf9)) +* Add isoWeeksInYear plugin ([2db8631](https://github.com/iamkun/dayjs/commit/2db8631)) +* Add Occitan (oc-lnc) locale file ([#551](https://github.com/iamkun/dayjs/issues/551)) ([c30b715](https://github.com/iamkun/dayjs/commit/c30b715)) +* Add plugin minMax to sopport .max .min ([2870a23](https://github.com/iamkun/dayjs/commit/2870a23)) +* Fix set Month Year error in last day of the month ([d058f4a](https://github.com/iamkun/dayjs/commit/d058f4a)) +* Update ko locale weekdaysShort ([#543](https://github.com/iamkun/dayjs/issues/543)) ([317fd3e](https://github.com/iamkun/dayjs/commit/317fd3e)) +* Update localizedFormat plugin to support lowercase localizable formats (l, ll, lll, llll) ([#546](https://github.com/iamkun/dayjs/issues/546)) ([f2b5ebf](https://github.com/iamkun/dayjs/commit/f2b5ebf)) + +## [1.8.11](https://github.com/iamkun/dayjs/compare/v1.8.10...v1.8.11) (2019-03-21) + + +### Bug Fixes + +* Add .add('quarter') .startOf('quarter') through plugin quarterOfYear ([dde39e9](https://github.com/iamkun/dayjs/commit/dde39e9)), closes [#537](https://github.com/iamkun/dayjs/issues/537) [#531](https://github.com/iamkun/dayjs/issues/531) +* Add locale support for Azerbaijani language (az) ([#535](https://github.com/iamkun/dayjs/issues/535)) ([eeb20fa](https://github.com/iamkun/dayjs/commit/eeb20fa)) +* Correct typescript definition `add` ([22a249c](https://github.com/iamkun/dayjs/commit/22a249c)), closes [#531](https://github.com/iamkun/dayjs/issues/531) +* Fix CustomParseFormat plugin formatting bug ([#536](https://github.com/iamkun/dayjs/issues/536)) ([8578546](https://github.com/iamkun/dayjs/commit/8578546)), closes [#533](https://github.com/iamkun/dayjs/issues/533) +* Update pt locale ([#538](https://github.com/iamkun/dayjs/issues/538)) ([1ac9e1e](https://github.com/iamkun/dayjs/commit/1ac9e1e)) + +## [1.8.10](https://github.com/iamkun/dayjs/compare/v1.8.9...v1.8.10) (2019-03-10) + + +### Bug Fixes + +* **locale:** Add nepali (ne) locale ([#524](https://github.com/iamkun/dayjs/issues/524)) ([bdbec01](https://github.com/iamkun/dayjs/commit/bdbec01)) +* Add WeekYear plugin ([a892608](https://github.com/iamkun/dayjs/commit/a892608)) +* API .locale() with no argument should return current locale name string ([8d63d88](https://github.com/iamkun/dayjs/commit/8d63d88)) +* CustomParseFormat correct parse HH:mm:ss with only one digit like 0:12:10 ([600d547](https://github.com/iamkun/dayjs/commit/600d547)) +* CustomParseFormat plugin parse Do format string ([bf27fda](https://github.com/iamkun/dayjs/commit/bf27fda)), closes [#522](https://github.com/iamkun/dayjs/issues/522) +* Expand setters like .year(2000) .hour(12) ([ac532a0](https://github.com/iamkun/dayjs/commit/ac532a0)) +* Move toObject, toArray API to separate plugin from core ([40a3431](https://github.com/iamkun/dayjs/commit/40a3431)) + +## [1.8.9](https://github.com/iamkun/dayjs/compare/v1.8.8...v1.8.9) (2019-03-06) + + +### Features + +* Add UTC mode with UTC plugin ([#517](https://github.com/iamkun/dayjs/issues/517)) ([caf335c](https://github.com/iamkun/dayjs/commit/caf335c)) + +> For plugin developers: Please note, we have changed the name of some method in `Utils` in order to reduce the file size. ([#517](https://github.com/iamkun/dayjs/issues/517)) ([detail](https://github.com/iamkun/dayjs/pull/517/files#diff-2b4ca49d4bb0a774c4d4c1672d7aa781R46)) + +### Bug Fixes + +* Add locale de-AT ([#515](https://github.com/iamkun/dayjs/issues/515)) ([d93f7b6](https://github.com/iamkun/dayjs/commit/d93f7b6)) +* Add locale zh-hk ([#516](https://github.com/iamkun/dayjs/issues/516)) ([5fc05a6](https://github.com/iamkun/dayjs/commit/5fc05a6)) + +## [1.8.8](https://github.com/iamkun/dayjs/compare/v1.8.7...v1.8.8) (2019-02-25) + + +### Bug Fixes + +* Update relativeTime plugin type definition ([de56f2c](https://github.com/iamkun/dayjs/commit/de56f2c)) + +## [1.8.7](https://github.com/iamkun/dayjs/compare/v1.8.6...v1.8.7) (2019-02-24) + + +### Bug Fixes + +* Add plugin type definitions ([#418](https://github.com/iamkun/dayjs/issues/418)) ([361d437](https://github.com/iamkun/dayjs/commit/361d437)) +* Add Swahili locale ([#508](https://github.com/iamkun/dayjs/issues/508)) ([b9cee84](https://github.com/iamkun/dayjs/commit/b9cee84)) +* Parse month string 'MMMM MMM (February, Feb)' in customParseFormat ([#457](https://github.com/iamkun/dayjs/issues/457)) ([f343206](https://github.com/iamkun/dayjs/commit/f343206)) +* Update declaration file .diff .isBefore .isSame .isAfter ([#496](https://github.com/iamkun/dayjs/issues/496)) ([4523275](https://github.com/iamkun/dayjs/commit/4523275)) +* Word orders corrections for locale 'fa' ([#491](https://github.com/iamkun/dayjs/issues/491)) ([56050c2](https://github.com/iamkun/dayjs/commit/56050c2)) + +## [1.8.6](https://github.com/iamkun/dayjs/compare/v1.8.5...v1.8.6) (2019-02-14) + + +### Bug Fixes + +* Add Bahasa Melayu (Malaysia) locale ([#485](https://github.com/iamkun/dayjs/issues/485)) ([cb208b0](https://github.com/iamkun/dayjs/commit/cb208b0)) +* Copy & export built-in en locale to /locale folder as a separate file ([a7e05e0](https://github.com/iamkun/dayjs/commit/a7e05e0)) +* Fix bug in customParseFormat plugin while month(MM) is '01' ([9884ca5](https://github.com/iamkun/dayjs/commit/9884ca5)), closes [#494](https://github.com/iamkun/dayjs/issues/494) +* Fix startOf week bug while week start is not Sunday ([5eaf77b](https://github.com/iamkun/dayjs/commit/5eaf77b)) +* Implemented isBetween inclusivity ([#464](https://github.com/iamkun/dayjs/issues/464)) ([af2f4f1](https://github.com/iamkun/dayjs/commit/af2f4f1)) +* Update Swedish and Finnish locales ([#488](https://github.com/iamkun/dayjs/issues/488)) ([f142082](https://github.com/iamkun/dayjs/commit/f142082)) +* Fix commonJS require ES Module bug in webpack4 ([23f9f3d](https://github.com/iamkun/dayjs/commit/23f9f3d)), check [#492](https://github.com/iamkun/dayjs/issues/492) + +> Get access to ESM code with `import dayjs from 'dayjs/esm'` + +## [1.8.5](https://github.com/iamkun/dayjs/compare/v1.8.4...v1.8.5) (2019-02-07) + + +### Bug Fixes + +* Add en-gb locale ([#478](https://github.com/iamkun/dayjs/issues/478)) ([508c3a7](https://github.com/iamkun/dayjs/commit/508c3a7)) +* **module:** transpile everything except ES6 modules in the 'module' entrypoint ([#477](https://github.com/iamkun/dayjs/issues/477)) ([#480](https://github.com/iamkun/dayjs/issues/480)) ([#482](https://github.com/iamkun/dayjs/issues/482)) ([767017d](https://github.com/iamkun/dayjs/commit/767017d)) +* update customParseFormat plugin support hh:mm ([54947cc](https://github.com/iamkun/dayjs/commit/54947cc)), closes [#484](https://github.com/iamkun/dayjs/issues/484) +* Update module in package.json ([5c5a7a0](https://github.com/iamkun/dayjs/commit/5c5a7a0)) + +## [1.8.4](https://github.com/iamkun/dayjs/compare/v1.8.3...v1.8.4) (2019-02-05) + +* Allow set start day of week in locale && Allow set week in weekOfYear plugin ([1295591](https://github.com/iamkun/dayjs/commit/1295591)) +### Bug Fixes +* update all locale files with correct week start ([5b03412](https://github.com/iamkun/dayjs/commit/5b03412)) +* update es es-do locale adding weekStart && update weekStart test ([66e42ec](https://github.com/iamkun/dayjs/commit/66e42ec)) +* Revert default export ([b00da1b](https://github.com/iamkun/dayjs/commit/b00da1b)) + +## [1.8.3](https://github.com/iamkun/dayjs/compare/v1.8.2...v1.8.3) (2019-02-04) + + +### Bug Fixes + +* fix ios safari YYYY-MM-DD HH:mm parse BUG ([e02ae82](https://github.com/iamkun/dayjs/commit/e02ae82)), closes [#254](https://github.com/iamkun/dayjs/issues/254) + +## [1.8.2](https://github.com/iamkun/dayjs/compare/v1.8.1...v1.8.2) (2019-02-02) + + +### Bug Fixes + +* Add missing czech language locale ([#461](https://github.com/iamkun/dayjs/issues/461)) ([7e04004](https://github.com/iamkun/dayjs/commit/7e04004)) +* Add utcOffset api method and fix calculating diff error in DST ([#453](https://github.com/iamkun/dayjs/issues/453)) ([ce2e30e](https://github.com/iamkun/dayjs/commit/ce2e30e)) +* Fix it locale error ([#458](https://github.com/iamkun/dayjs/issues/458)) ([f6d9a64](https://github.com/iamkun/dayjs/commit/f6d9a64)) +* Add DayOfYear plugin (#454) +* Fix es locale monthsShort error + +## [1.8.1](https://github.com/iamkun/dayjs/compare/v1.8.0...v1.8.1) (2019-02-02) + +* Add LocalizedFormat plugin supplying format like LTS, LT, LLLL + +* update declaration File with default export (#278) +> From v1.8.1, in TypeScript Project, just `import from dayjs from 'dayjs'` +* add ES2015 module support (#451) + +### Performance Improvements + +* **format:** reuse matches instead of created when replacing ([#441](https://github.com/iamkun/dayjs/issues/441)) ([10b79d8](https://github.com/iamkun/dayjs/commit/10b79d8)) + +# [1.8.0](https://github.com/iamkun/dayjs/compare/v1.7.8...v1.8.0) (2019-01-14) + + +### Features + +* add CustomParseFormat plugin and QuarterOfYear plugin ([#450](https://github.com/iamkun/dayjs/issues/450)) ([8f6f63c](https://github.com/iamkun/dayjs/commit/8f6f63c)) + +## [1.7.8](https://github.com/iamkun/dayjs/compare/v1.7.7...v1.7.8) (2018-12-13) + + +### Feature + +* update isSame isBefore isAfter supports units ([fd65464](https://github.com/iamkun/dayjs/commit/fd65464)) + +* add greek lithuanian locales + +## [1.7.7](https://github.com/iamkun/dayjs/compare/v1.7.6...v1.7.7) (2018-09-26) + + +### Bug Fixes + +* **DST:** fix daylight saving time DST bug && add test ([#354](https://github.com/iamkun/dayjs/issues/354)) ([6fca6d5](https://github.com/iamkun/dayjs/commit/6fca6d5)) + +## [1.7.6](https://github.com/iamkun/dayjs/compare/v1.7.5...v1.7.6) (2018-09-25) + + +### Bug Fixes + +* **add dayjs.unix:** add dayjs.unix to parse timestamp in seconds && locale update ([5711c5e](https://github.com/iamkun/dayjs/commit/5711c5e)) + +## [1.7.5](https://github.com/iamkun/dayjs/compare/v1.7.4...v1.7.5) (2018-08-10) + + +### Bug Fixes + +* add isBetween API & update ([b5fc3d1](https://github.com/iamkun/dayjs/commit/b5fc3d1)) + +## [1.7.4](https://github.com/iamkun/dayjs/compare/v1.7.3...v1.7.4) (2018-07-11) + + +### Bug Fixes + +* update set week logic ([60b6325](https://github.com/iamkun/dayjs/commit/60b6325)), closes [#276](https://github.com/iamkun/dayjs/issues/276) + +## [1.7.3](https://github.com/iamkun/dayjs/compare/v1.7.2...v1.7.3) (2018-07-10) + + +### Bug Fixes + +* **locale-nl:** set correct weekdays and months ([6d089d7](https://github.com/iamkun/dayjs/commit/6d089d7)) + +## [1.7.2](https://github.com/iamkun/dayjs/compare/v1.7.1...v1.7.2) (2018-07-04) + + +### Bug Fixes + +* DEPRECATED isLeapYear, use IsLeapYear plugin instead ([e2e5116](https://github.com/iamkun/dayjs/commit/e2e5116)) + +## [1.7.1](https://github.com/iamkun/dayjs/compare/v1.7.0...v1.7.1) (2018-07-03) + + +### Bug Fixes + +* fix week() error near the end of the year ([fa03689](https://github.com/iamkun/dayjs/commit/fa03689)) + +# [1.7.0](https://github.com/iamkun/dayjs/compare/v1.6.10...v1.7.0) (2018-07-02) + + +### Features + +* Added method `.week()` to retrieve week of the year ([e1c1b1c](https://github.com/iamkun/dayjs/commit/e1c1b1c)) +* Updated Japanese locae + +## [1.6.10](https://github.com/iamkun/dayjs/compare/v1.6.9...v1.6.10) (2018-06-25) + + +### Bug Fixes + +* Add relative locales to russian language ([c7e9898](https://github.com/iamkun/dayjs/commit/c7e9898)), closes [#256](https://github.com/iamkun/dayjs/issues/256) + +## [1.6.9](https://github.com/iamkun/dayjs/compare/v1.6.8...v1.6.9) (2018-06-14) + + +### Bug Fixes + +* add isDayjs => boolean API ([6227c8b](https://github.com/iamkun/dayjs/commit/6227c8b)) + +## [1.6.8](https://github.com/iamkun/dayjs/compare/v1.6.7...v1.6.8) (2018-06-14) + + +### Bug Fixes + +* fix Advanced format bug in zh-cn ([0c07874](https://github.com/iamkun/dayjs/commit/0c07874)), closes [#242](https://github.com/iamkun/dayjs/issues/242) + +## [1.6.7](https://github.com/iamkun/dayjs/compare/v1.6.6...v1.6.7) (2018-06-11) + + +### Bug Fixes + +* fix id locale ([1ebbeb8](https://github.com/iamkun/dayjs/commit/1ebbeb8)), closes [#234](https://github.com/iamkun/dayjs/issues/234) + + +## [1.6.6](https://github.com/iamkun/dayjs/compare/v1.6.5...v1.6.6) (2018-06-06) + + +### Bug Fixes + +* format API update and locale file update ([5ca48f0](https://github.com/iamkun/dayjs/commit/5ca48f0)), closes [#228](https://github.com/iamkun/dayjs/issues/228) + + +## [1.6.5](https://github.com/iamkun/dayjs/compare/v1.6.4...v1.6.5) (2018-05-31) + + +### Bug Fixes + +* bugfix, utils update and locale file update ([ebcb6d5](https://github.com/iamkun/dayjs/commit/ebcb6d5)), closes [#214](https://github.com/iamkun/dayjs/issues/214) + + +## [1.6.4](https://github.com/iamkun/dayjs/compare/v1.6.3...v1.6.4) (2018-05-25) + + +### Bug Fixes + +* add RelativeTime plugin and locale file update ([c1fbbca](https://github.com/iamkun/dayjs/commit/c1fbbca)), closes [#198](https://github.com/iamkun/dayjs/issues/198) + + +## [1.6.3](https://github.com/iamkun/dayjs/compare/v1.6.2...v1.6.3) (2018-05-21) + + +### Bug Fixes + +* Changing locales locally is immutable from this release ([2cce729](https://github.com/iamkun/dayjs/commit/2cce729)), closes [#182](https://github.com/iamkun/dayjs/issues/182) +* instance locale change should be immutable ([84597c9](https://github.com/iamkun/dayjs/commit/84597c9)) +* Add more locales +* english ordinal fix + + +## [1.6.2](https://github.com/iamkun/dayjs/compare/v1.6.1...v1.6.2) (2018-05-18) + + +### Bug Fixes + +* change-log update && test new npm release ([aa49cba](https://github.com/iamkun/dayjs/commit/aa49cba)), closes [#163](https://github.com/iamkun/dayjs/issues/163) + + +## [1.6.1](https://github.com/iamkun/dayjs/compare/v1.6.0...v1.6.1) (2018-05-18) + + +### Bug Fixes + +* Add German, Brazilian Portuguese locales +* add() & parse() bug fix & add locale de, pt-br ([bf1331e](https://github.com/iamkun/dayjs/commit/bf1331e)) + + +# [1.6.0](https://github.com/iamkun/dayjs/compare/v1.5.24...v1.6.0) (2018-05-15) + + +### Features + +* Locale && Plugin ([2342c55](https://github.com/iamkun/dayjs/commit/2342c55)), closes [#141](https://github.com/iamkun/dayjs/issues/141) diff --git a/node_modules/dayjs/LICENSE b/node_modules/dayjs/LICENSE new file mode 100644 index 00000000..caf93154 --- /dev/null +++ b/node_modules/dayjs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018-present, iamkun + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/dayjs/README.md b/node_modules/dayjs/README.md new file mode 100644 index 00000000..3e514dc8 --- /dev/null +++ b/node_modules/dayjs/README.md @@ -0,0 +1,149 @@ +English | [简体中文](./docs/zh-cn/README.zh-CN.md) | [日本語](./docs/ja/README-ja.md) | [Português Brasileiro](./docs/pt-br/README-pt-br.md) | [한국어](./docs/ko/README-ko.md) | [Español (España)](./docs/es-es/README-es-es.md) | [Русский](./docs/ru/README-ru.md) | [Türkçe](./docs/tr/README-tr.md) | [සිංහල](./docs/si/README-si.md) | [עברית](./docs/he/README-he.md) + +

Day.js

+

Fast 2kB alternative to Moment.js with the same modern API

+

+ Gzip Size + NPM Version + Build Status + Codecov + License +
+ + Sauce Test Status + +

+ +> Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js. + +```js +dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss'); +``` + +* 🕒 Familiar Moment.js API & patterns +* 💪 Immutable +* 🔥 Chainable +* 🌐 I18n support +* 📦 2kb mini library +* 👫 All browsers supported + +--- + +## Getting Started + +### Documentation + +You can find more details, API, and other docs on [day.js.org](https://day.js.org/) website. + +### Installation + +```console +npm install dayjs --save +``` + +📚[Installation Guide](https://day.js.org/docs/en/installation/installation) + +### API + +It's easy to use Day.js APIs to parse, validate, manipulate, and display dates and times. + +```javascript +dayjs('2018-08-08') // parse + +dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display + +dayjs().set('month', 3).month() // get & set + +dayjs().add(1, 'year') // manipulate + +dayjs().isBefore(dayjs()) // query +``` + +📚[API Reference](https://day.js.org/docs/en/parse/parse) + +### I18n + +Day.js has great support for internationalization. + +But none of them will be included in your build unless you use it. + +```javascript +import 'dayjs/locale/es' // load on demand + +dayjs.locale('es') // use Spanish locale globally + +dayjs('2018-05-05').locale('zh-cn').format() // use Chinese Simplified locale in a specific instance +``` + +📚[Internationalization](https://day.js.org/docs/en/i18n/i18n) + +### Plugin + +A plugin is an independent module that can be added to Day.js to extend functionality or add new features. + +```javascript +import advancedFormat from 'dayjs/plugin/advancedFormat' // load on demand + +dayjs.extend(advancedFormat) // use plugin + +dayjs().format('Q Do k kk X x') // more available formats +``` + +📚[Plugin List](https://day.js.org/docs/en/plugin/plugin) + +## Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. + +[[Become a sponsor via Github](https://github.com/sponsors/iamkun/)] [[Become a sponsor via OpenCollective](https://opencollective.com/dayjs#sponsor)] + + + + +         + + + +         + + + +         + + + +         + +         + +         + +         + + +## Contributors + +This project exists thanks to all the people who contribute. + +Please give us a 💖 star 💖 to support us. Thank you. + +And thank you to all our backers! 🙏 + + + + + +
+ + +## License + +Day.js is licensed under a [MIT License](./LICENSE). diff --git a/node_modules/dayjs/dayjs.min.js b/node_modules/dayjs/dayjs.min.js new file mode 100644 index 00000000..61916d88 --- /dev/null +++ b/node_modules/dayjs/dayjs.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) + +export = dayjs; + +declare function dayjs (date?: dayjs.ConfigType): dayjs.Dayjs + +declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs + +declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs + +declare namespace dayjs { + interface ConfigTypeMap { + default: string | number | Date | Dayjs | null | undefined + } + + export type ConfigType = ConfigTypeMap[keyof ConfigTypeMap] + + export interface FormatObject { locale?: string, format?: string, utc?: boolean } + + export type OptionType = FormatObject | string | string[] + + export type UnitTypeShort = 'd' | 'D' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms' + + export type UnitTypeLong = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date' + + export type UnitTypeLongPlural = 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' | 'dates' + + export type UnitType = UnitTypeLong | UnitTypeLongPlural | UnitTypeShort; + + export type OpUnitType = UnitType | "week" | "weeks" | 'w'; + export type QUnitType = UnitType | "quarter" | "quarters" | 'Q'; + export type ManipulateType = Exclude; + class Dayjs { + constructor (config?: ConfigType) + /** + * All Day.js objects are immutable. Still, `dayjs#clone` can create a clone of the current object if you need one. + * ``` + * dayjs().clone()// => Dayjs + * dayjs(dayjs('2019-01-25')) // passing a Dayjs object to a constructor will also clone it + * ``` + * Docs: https://day.js.org/docs/en/parse/dayjs-clone + */ + clone(): Dayjs + /** + * This returns a `boolean` indicating whether the Day.js object contains a valid date or not. + * ``` + * dayjs().isValid()// => boolean + * ``` + * Docs: https://day.js.org/docs/en/parse/is-valid + */ + isValid(): boolean + /** + * Get the year. + * ``` + * dayjs().year()// => 2020 + * ``` + * Docs: https://day.js.org/docs/en/get-set/year + */ + year(): number + /** + * Set the year. + * ``` + * dayjs().year(2000)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/year + */ + year(value: number): Dayjs + /** + * Get the month. + * + * Months are zero indexed, so January is month 0. + * ``` + * dayjs().month()// => 0-11 + * ``` + * Docs: https://day.js.org/docs/en/get-set/month + */ + month(): number + /** + * Set the month. + * + * Months are zero indexed, so January is month 0. + * + * Accepts numbers from 0 to 11. If the range is exceeded, it will bubble up to the next year. + * ``` + * dayjs().month(0)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/month + */ + month(value: number): Dayjs + /** + * Get the date of the month. + * ``` + * dayjs().date()// => 1-31 + * ``` + * Docs: https://day.js.org/docs/en/get-set/date + */ + date(): number + /** + * Set the date of the month. + * + * Accepts numbers from 1 to 31. If the range is exceeded, it will bubble up to the next months. + * ``` + * dayjs().date(1)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/date + */ + date(value: number): Dayjs + /** + * Get the day of the week. + * + * Returns numbers from 0 (Sunday) to 6 (Saturday). + * ``` + * dayjs().day()// 0-6 + * ``` + * Docs: https://day.js.org/docs/en/get-set/day + */ + day(): number + /** + * Set the day of the week. + * + * Accepts numbers from 0 (Sunday) to 6 (Saturday). If the range is exceeded, it will bubble up to next weeks. + * ``` + * dayjs().day(0)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/day + */ + day(value: number): Dayjs + /** + * Get the hour. + * ``` + * dayjs().hour()// => 0-23 + * ``` + * Docs: https://day.js.org/docs/en/get-set/hour + */ + hour(): number + /** + * Set the hour. + * + * Accepts numbers from 0 to 23. If the range is exceeded, it will bubble up to the next day. + * ``` + * dayjs().hour(12)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/hour + */ + hour(value: number): Dayjs + /** + * Get the minutes. + * ``` + * dayjs().minute()// => 0-59 + * ``` + * Docs: https://day.js.org/docs/en/get-set/minute + */ + minute(): number + /** + * Set the minutes. + * + * Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next hour. + * ``` + * dayjs().minute(59)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/minute + */ + minute(value: number): Dayjs + /** + * Get the seconds. + * ``` + * dayjs().second()// => 0-59 + * ``` + * Docs: https://day.js.org/docs/en/get-set/second + */ + second(): number + /** + * Set the seconds. + * + * Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next minutes. + * ``` + * dayjs().second(1)// Dayjs + * ``` + */ + second(value: number): Dayjs + /** + * Get the milliseconds. + * ``` + * dayjs().millisecond()// => 0-999 + * ``` + * Docs: https://day.js.org/docs/en/get-set/millisecond + */ + millisecond(): number + /** + * Set the milliseconds. + * + * Accepts numbers from 0 to 999. If the range is exceeded, it will bubble up to the next seconds. + * ``` + * dayjs().millisecond(1)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/millisecond + */ + millisecond(value: number): Dayjs + /** + * Generic setter, accepting unit as first argument, and value as second, returns a new instance with the applied changes. + * + * In general: + * ``` + * dayjs().set(unit, value) === dayjs()[unit](value) + * ``` + * Units are case insensitive, and support plural and short forms. + * ``` + * dayjs().set('date', 1) + * dayjs().set('month', 3) // April + * dayjs().set('second', 30) + * ``` + * Docs: https://day.js.org/docs/en/get-set/set + */ + set(unit: UnitType, value: number): Dayjs + /** + * String getter, returns the corresponding information getting from Day.js object. + * + * In general: + * ``` + * dayjs().get(unit) === dayjs()[unit]() + * ``` + * Units are case insensitive, and support plural and short forms. + * ``` + * dayjs().get('year') + * dayjs().get('month') // start 0 + * dayjs().get('date') + * ``` + * Docs: https://day.js.org/docs/en/get-set/get + */ + get(unit: UnitType): number + /** + * Returns a cloned Day.js object with a specified amount of time added. + * ``` + * dayjs().add(7, 'day')// => Dayjs + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/manipulate/add + */ + add(value: number, unit?: ManipulateType): Dayjs + /** + * Returns a cloned Day.js object with a specified amount of time subtracted. + * ``` + * dayjs().subtract(7, 'year')// => Dayjs + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/manipulate/subtract + */ + subtract(value: number, unit?: ManipulateType): Dayjs + /** + * Returns a cloned Day.js object and set it to the start of a unit of time. + * ``` + * dayjs().startOf('year')// => Dayjs + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/manipulate/start-of + */ + startOf(unit: OpUnitType): Dayjs + /** + * Returns a cloned Day.js object and set it to the end of a unit of time. + * ``` + * dayjs().endOf('month')// => Dayjs + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/manipulate/end-of + */ + endOf(unit: OpUnitType): Dayjs + /** + * Get the formatted date according to the string of tokens passed in. + * + * To escape characters, wrap them in square brackets (e.g. [MM]). + * ``` + * dayjs().format()// => current date in ISO8601, without fraction seconds e.g. '2020-04-02T08:02:17-05:00' + * dayjs('2019-01-25').format('[YYYYescape] YYYY-MM-DDTHH:mm:ssZ[Z]')// 'YYYYescape 2019-01-25T00:00:00-02:00Z' + * dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019' + * ``` + * Docs: https://day.js.org/docs/en/display/format + */ + format(template?: string): string + /** + * This indicates the difference between two date-time in the specified unit. + * + * To get the difference in milliseconds, use `dayjs#diff` + * ``` + * const date1 = dayjs('2019-01-25') + * const date2 = dayjs('2018-06-05') + * date1.diff(date2) // 20214000000 default milliseconds + * date1.diff() // milliseconds to current time + * ``` + * + * To get the difference in another unit of measurement, pass that measurement as the second argument. + * ``` + * const date1 = dayjs('2019-01-25') + * date1.diff('2018-06-05', 'month') // 7 + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/display/difference + */ + diff(date?: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number + /** + * This returns the number of **milliseconds** since the Unix Epoch of the Day.js object. + * ``` + * dayjs('2019-01-25').valueOf() // 1548381600000 + * +dayjs(1548381600000) // 1548381600000 + * ``` + * To get a Unix timestamp (the number of seconds since the epoch) from a Day.js object, you should use Unix Timestamp `dayjs#unix()`. + * + * Docs: https://day.js.org/docs/en/display/unix-timestamp-milliseconds + */ + valueOf(): number + /** + * This returns the Unix timestamp (the number of **seconds** since the Unix Epoch) of the Day.js object. + * ``` + * dayjs('2019-01-25').unix() // 1548381600 + * ``` + * This value is floored to the nearest second, and does not include a milliseconds component. + * + * Docs: https://day.js.org/docs/en/display/unix-timestamp + */ + unix(): number + /** + * Get the number of days in the current month. + * ``` + * dayjs('2019-01-25').daysInMonth() // 31 + * ``` + * Docs: https://day.js.org/docs/en/display/days-in-month + */ + daysInMonth(): number + /** + * To get a copy of the native `Date` object parsed from the Day.js object use `dayjs#toDate`. + * ``` + * dayjs('2019-01-25').toDate()// => Date + * ``` + */ + toDate(): Date + /** + * To serialize as an ISO 8601 string. + * ``` + * dayjs('2019-01-25').toJSON() // '2019-01-25T02:00:00.000Z' + * ``` + * Docs: https://day.js.org/docs/en/display/as-json + */ + toJSON(): string + /** + * To format as an ISO 8601 string. + * ``` + * dayjs('2019-01-25').toISOString() // '2019-01-25T02:00:00.000Z' + * ``` + * Docs: https://day.js.org/docs/en/display/as-iso-string + */ + toISOString(): string + /** + * Returns a string representation of the date. + * ``` + * dayjs('2019-01-25').toString() // 'Fri, 25 Jan 2019 02:00:00 GMT' + * ``` + * Docs: https://day.js.org/docs/en/display/as-string + */ + toString(): string + /** + * Get the UTC offset in minutes. + * ``` + * dayjs().utcOffset() + * ``` + * Docs: https://day.js.org/docs/en/manipulate/utc-offset + */ + utcOffset(): number + /** + * This indicates whether the Day.js object is before the other supplied date-time. + * ``` + * dayjs().isBefore(dayjs('2011-01-01')) // default milliseconds + * ``` + * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter. + * ``` + * dayjs().isBefore('2011-01-01', 'year')// => boolean + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/query/is-before + */ + isBefore(date?: ConfigType, unit?: OpUnitType): boolean + /** + * This indicates whether the Day.js object is the same as the other supplied date-time. + * ``` + * dayjs().isSame(dayjs('2011-01-01')) // default milliseconds + * ``` + * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter. + * ``` + * dayjs().isSame('2011-01-01', 'year')// => boolean + * ``` + * Docs: https://day.js.org/docs/en/query/is-same + */ + isSame(date?: ConfigType, unit?: OpUnitType): boolean + /** + * This indicates whether the Day.js object is after the other supplied date-time. + * ``` + * dayjs().isAfter(dayjs('2011-01-01')) // default milliseconds + * ``` + * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter. + * ``` + * dayjs().isAfter('2011-01-01', 'year')// => boolean + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/query/is-after + */ + isAfter(date?: ConfigType, unit?: OpUnitType): boolean + + locale(): string + + locale(preset: string | ILocale, object?: Partial): Dayjs + } + + export type PluginFunc = (option: T, c: typeof Dayjs, d: typeof dayjs) => void + + export function extend(plugin: PluginFunc, option?: T): Dayjs + + export function locale(preset?: string | ILocale, object?: Partial, isLocal?: boolean): string + + export function isDayjs(d: any): d is Dayjs + + export function unix(t: number): Dayjs + + const Ls : { [key: string] : ILocale } +} diff --git a/node_modules/dayjs/esm/index.js b/node_modules/dayjs/esm/index.js new file mode 100644 index 00000000..a82986b8 --- /dev/null +++ b/node_modules/dayjs/esm/index.js @@ -0,0 +1,541 @@ +import * as C from './constant'; +import en from './locale/en'; +import U from './utils'; +var L = 'en'; // global locale + +var Ls = {}; // global loaded locale + +Ls[L] = en; +var IS_DAYJS = '$isDayjsObject'; // eslint-disable-next-line no-use-before-define + +var isDayjs = function isDayjs(d) { + return d instanceof Dayjs || !!(d && d[IS_DAYJS]); +}; + +var parseLocale = function parseLocale(preset, object, isLocal) { + var l; + if (!preset) return L; + + if (typeof preset === 'string') { + var presetLower = preset.toLowerCase(); + + if (Ls[presetLower]) { + l = presetLower; + } + + if (object) { + Ls[presetLower] = object; + l = presetLower; + } + + var presetSplit = preset.split('-'); + + if (!l && presetSplit.length > 1) { + return parseLocale(presetSplit[0]); + } + } else { + var name = preset.name; + Ls[name] = preset; + l = name; + } + + if (!isLocal && l) L = l; + return l || !isLocal && L; +}; + +var dayjs = function dayjs(date, c) { + if (isDayjs(date)) { + return date.clone(); + } // eslint-disable-next-line no-nested-ternary + + + var cfg = typeof c === 'object' ? c : {}; + cfg.date = date; + cfg.args = arguments; // eslint-disable-line prefer-rest-params + + return new Dayjs(cfg); // eslint-disable-line no-use-before-define +}; + +var wrapper = function wrapper(date, instance) { + return dayjs(date, { + locale: instance.$L, + utc: instance.$u, + x: instance.$x, + $offset: instance.$offset // todo: refactor; do not use this.$offset in you code + + }); +}; + +var Utils = U; // for plugin use + +Utils.l = parseLocale; +Utils.i = isDayjs; +Utils.w = wrapper; + +var parseDate = function parseDate(cfg) { + var date = cfg.date, + utc = cfg.utc; + if (date === null) return new Date(NaN); // null is invalid + + if (Utils.u(date)) return new Date(); // today + + if (date instanceof Date) return new Date(date); + + if (typeof date === 'string' && !/Z$/i.test(date)) { + var d = date.match(C.REGEX_PARSE); + + if (d) { + var m = d[2] - 1 || 0; + var ms = (d[7] || '0').substring(0, 3); + + if (utc) { + return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms)); + } + + return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms); + } + } + + return new Date(date); // everything else +}; + +var Dayjs = /*#__PURE__*/function () { + function Dayjs(cfg) { + this.$L = parseLocale(cfg.locale, null, true); + this.parse(cfg); // for plugin + + this.$x = this.$x || cfg.x || {}; + this[IS_DAYJS] = true; + } + + var _proto = Dayjs.prototype; + + _proto.parse = function parse(cfg) { + this.$d = parseDate(cfg); + this.init(); + }; + + _proto.init = function init() { + var $d = this.$d; + this.$y = $d.getFullYear(); + this.$M = $d.getMonth(); + this.$D = $d.getDate(); + this.$W = $d.getDay(); + this.$H = $d.getHours(); + this.$m = $d.getMinutes(); + this.$s = $d.getSeconds(); + this.$ms = $d.getMilliseconds(); + } // eslint-disable-next-line class-methods-use-this + ; + + _proto.$utils = function $utils() { + return Utils; + }; + + _proto.isValid = function isValid() { + return !(this.$d.toString() === C.INVALID_DATE_STRING); + }; + + _proto.isSame = function isSame(that, units) { + var other = dayjs(that); + return this.startOf(units) <= other && other <= this.endOf(units); + }; + + _proto.isAfter = function isAfter(that, units) { + return dayjs(that) < this.startOf(units); + }; + + _proto.isBefore = function isBefore(that, units) { + return this.endOf(units) < dayjs(that); + }; + + _proto.$g = function $g(input, get, set) { + if (Utils.u(input)) return this[get]; + return this.set(set, input); + }; + + _proto.unix = function unix() { + return Math.floor(this.valueOf() / 1000); + }; + + _proto.valueOf = function valueOf() { + // timezone(hour) * 60 * 60 * 1000 => ms + return this.$d.getTime(); + }; + + _proto.startOf = function startOf(units, _startOf) { + var _this = this; + + // startOf -> endOf + var isStartOf = !Utils.u(_startOf) ? _startOf : true; + var unit = Utils.p(units); + + var instanceFactory = function instanceFactory(d, m) { + var ins = Utils.w(_this.$u ? Date.UTC(_this.$y, m, d) : new Date(_this.$y, m, d), _this); + return isStartOf ? ins : ins.endOf(C.D); + }; + + var instanceFactorySet = function instanceFactorySet(method, slice) { + var argumentStart = [0, 0, 0, 0]; + var argumentEnd = [23, 59, 59, 999]; + return Utils.w(_this.toDate()[method].apply( // eslint-disable-line prefer-spread + _this.toDate('s'), (isStartOf ? argumentStart : argumentEnd).slice(slice)), _this); + }; + + var $W = this.$W, + $M = this.$M, + $D = this.$D; + var utcPad = "set" + (this.$u ? 'UTC' : ''); + + switch (unit) { + case C.Y: + return isStartOf ? instanceFactory(1, 0) : instanceFactory(31, 11); + + case C.M: + return isStartOf ? instanceFactory(1, $M) : instanceFactory(0, $M + 1); + + case C.W: + { + var weekStart = this.$locale().weekStart || 0; + var gap = ($W < weekStart ? $W + 7 : $W) - weekStart; + return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M); + } + + case C.D: + case C.DATE: + return instanceFactorySet(utcPad + "Hours", 0); + + case C.H: + return instanceFactorySet(utcPad + "Minutes", 1); + + case C.MIN: + return instanceFactorySet(utcPad + "Seconds", 2); + + case C.S: + return instanceFactorySet(utcPad + "Milliseconds", 3); + + default: + return this.clone(); + } + }; + + _proto.endOf = function endOf(arg) { + return this.startOf(arg, false); + }; + + _proto.$set = function $set(units, _int) { + var _C$D$C$DATE$C$M$C$Y$C; + + // private set + var unit = Utils.p(units); + var utcPad = "set" + (this.$u ? 'UTC' : ''); + var name = (_C$D$C$DATE$C$M$C$Y$C = {}, _C$D$C$DATE$C$M$C$Y$C[C.D] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[C.DATE] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[C.M] = utcPad + "Month", _C$D$C$DATE$C$M$C$Y$C[C.Y] = utcPad + "FullYear", _C$D$C$DATE$C$M$C$Y$C[C.H] = utcPad + "Hours", _C$D$C$DATE$C$M$C$Y$C[C.MIN] = utcPad + "Minutes", _C$D$C$DATE$C$M$C$Y$C[C.S] = utcPad + "Seconds", _C$D$C$DATE$C$M$C$Y$C[C.MS] = utcPad + "Milliseconds", _C$D$C$DATE$C$M$C$Y$C)[unit]; + var arg = unit === C.D ? this.$D + (_int - this.$W) : _int; + + if (unit === C.M || unit === C.Y) { + // clone is for badMutable plugin + var date = this.clone().set(C.DATE, 1); + date.$d[name](arg); + date.init(); + this.$d = date.set(C.DATE, Math.min(this.$D, date.daysInMonth())).$d; + } else if (name) this.$d[name](arg); + + this.init(); + return this; + }; + + _proto.set = function set(string, _int2) { + return this.clone().$set(string, _int2); + }; + + _proto.get = function get(unit) { + return this[Utils.p(unit)](); + }; + + _proto.add = function add(number, units) { + var _this2 = this, + _C$MIN$C$H$C$S$unit; + + number = Number(number); // eslint-disable-line no-param-reassign + + var unit = Utils.p(units); + + var instanceFactorySet = function instanceFactorySet(n) { + var d = dayjs(_this2); + return Utils.w(d.date(d.date() + Math.round(n * number)), _this2); + }; + + if (unit === C.M) { + return this.set(C.M, this.$M + number); + } + + if (unit === C.Y) { + return this.set(C.Y, this.$y + number); + } + + if (unit === C.D) { + return instanceFactorySet(1); + } + + if (unit === C.W) { + return instanceFactorySet(7); + } + + var step = (_C$MIN$C$H$C$S$unit = {}, _C$MIN$C$H$C$S$unit[C.MIN] = C.MILLISECONDS_A_MINUTE, _C$MIN$C$H$C$S$unit[C.H] = C.MILLISECONDS_A_HOUR, _C$MIN$C$H$C$S$unit[C.S] = C.MILLISECONDS_A_SECOND, _C$MIN$C$H$C$S$unit)[unit] || 1; // ms + + var nextTimeStamp = this.$d.getTime() + number * step; + return Utils.w(nextTimeStamp, this); + }; + + _proto.subtract = function subtract(number, string) { + return this.add(number * -1, string); + }; + + _proto.format = function format(formatStr) { + var _this3 = this; + + var locale = this.$locale(); + if (!this.isValid()) return locale.invalidDate || C.INVALID_DATE_STRING; + var str = formatStr || C.FORMAT_DEFAULT; + var zoneStr = Utils.z(this); + var $H = this.$H, + $m = this.$m, + $M = this.$M; + var weekdays = locale.weekdays, + months = locale.months, + meridiem = locale.meridiem; + + var getShort = function getShort(arr, index, full, length) { + return arr && (arr[index] || arr(_this3, str)) || full[index].slice(0, length); + }; + + var get$H = function get$H(num) { + return Utils.s($H % 12 || 12, num, '0'); + }; + + var meridiemFunc = meridiem || function (hour, minute, isLowercase) { + var m = hour < 12 ? 'AM' : 'PM'; + return isLowercase ? m.toLowerCase() : m; + }; + + var matches = function matches(match) { + switch (match) { + case 'YY': + return String(_this3.$y).slice(-2); + + case 'YYYY': + return Utils.s(_this3.$y, 4, '0'); + + case 'M': + return $M + 1; + + case 'MM': + return Utils.s($M + 1, 2, '0'); + + case 'MMM': + return getShort(locale.monthsShort, $M, months, 3); + + case 'MMMM': + return getShort(months, $M); + + case 'D': + return _this3.$D; + + case 'DD': + return Utils.s(_this3.$D, 2, '0'); + + case 'd': + return String(_this3.$W); + + case 'dd': + return getShort(locale.weekdaysMin, _this3.$W, weekdays, 2); + + case 'ddd': + return getShort(locale.weekdaysShort, _this3.$W, weekdays, 3); + + case 'dddd': + return weekdays[_this3.$W]; + + case 'H': + return String($H); + + case 'HH': + return Utils.s($H, 2, '0'); + + case 'h': + return get$H(1); + + case 'hh': + return get$H(2); + + case 'a': + return meridiemFunc($H, $m, true); + + case 'A': + return meridiemFunc($H, $m, false); + + case 'm': + return String($m); + + case 'mm': + return Utils.s($m, 2, '0'); + + case 's': + return String(_this3.$s); + + case 'ss': + return Utils.s(_this3.$s, 2, '0'); + + case 'SSS': + return Utils.s(_this3.$ms, 3, '0'); + + case 'Z': + return zoneStr; + // 'ZZ' logic below + + default: + break; + } + + return null; + }; + + return str.replace(C.REGEX_FORMAT, function (match, $1) { + return $1 || matches(match) || zoneStr.replace(':', ''); + }); // 'ZZ' + }; + + _proto.utcOffset = function utcOffset() { + // Because a bug at FF24, we're rounding the timezone offset around 15 minutes + // https://github.com/moment/moment/pull/1871 + return -Math.round(this.$d.getTimezoneOffset() / 15) * 15; + }; + + _proto.diff = function diff(input, units, _float) { + var _this4 = this; + + var unit = Utils.p(units); + var that = dayjs(input); + var zoneDelta = (that.utcOffset() - this.utcOffset()) * C.MILLISECONDS_A_MINUTE; + var diff = this - that; + + var getMonth = function getMonth() { + return Utils.m(_this4, that); + }; + + var result; + + switch (unit) { + case C.Y: + result = getMonth() / 12; + break; + + case C.M: + result = getMonth(); + break; + + case C.Q: + result = getMonth() / 3; + break; + + case C.W: + result = (diff - zoneDelta) / C.MILLISECONDS_A_WEEK; + break; + + case C.D: + result = (diff - zoneDelta) / C.MILLISECONDS_A_DAY; + break; + + case C.H: + result = diff / C.MILLISECONDS_A_HOUR; + break; + + case C.MIN: + result = diff / C.MILLISECONDS_A_MINUTE; + break; + + case C.S: + result = diff / C.MILLISECONDS_A_SECOND; + break; + + default: + result = diff; // milliseconds + + break; + } + + return _float ? result : Utils.a(result); + }; + + _proto.daysInMonth = function daysInMonth() { + return this.endOf(C.M).$D; + }; + + _proto.$locale = function $locale() { + // get locale object + return Ls[this.$L]; + }; + + _proto.locale = function locale(preset, object) { + if (!preset) return this.$L; + var that = this.clone(); + var nextLocaleName = parseLocale(preset, object, true); + if (nextLocaleName) that.$L = nextLocaleName; + return that; + }; + + _proto.clone = function clone() { + return Utils.w(this.$d, this); + }; + + _proto.toDate = function toDate() { + return new Date(this.valueOf()); + }; + + _proto.toJSON = function toJSON() { + return this.isValid() ? this.toISOString() : null; + }; + + _proto.toISOString = function toISOString() { + // ie 8 return + // new Dayjs(this.valueOf() + this.$d.getTimezoneOffset() * 60000) + // .format('YYYY-MM-DDTHH:mm:ss.SSS[Z]') + return this.$d.toISOString(); + }; + + _proto.toString = function toString() { + return this.$d.toUTCString(); + }; + + return Dayjs; +}(); + +var proto = Dayjs.prototype; +dayjs.prototype = proto; +[['$ms', C.MS], ['$s', C.S], ['$m', C.MIN], ['$H', C.H], ['$W', C.D], ['$M', C.M], ['$y', C.Y], ['$D', C.DATE]].forEach(function (g) { + proto[g[1]] = function (input) { + return this.$g(input, g[0], g[1]); + }; +}); + +dayjs.extend = function (plugin, option) { + if (!plugin.$i) { + // install plugin only once + plugin(option, Dayjs, dayjs); + plugin.$i = true; + } + + return dayjs; +}; + +dayjs.locale = parseLocale; +dayjs.isDayjs = isDayjs; + +dayjs.unix = function (timestamp) { + return dayjs(timestamp * 1e3); +}; + +dayjs.en = Ls[L]; +dayjs.Ls = Ls; +dayjs.p = {}; +export default dayjs; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/af.js b/node_modules/dayjs/esm/locale/af.js new file mode 100644 index 00000000..ce0c2855 --- /dev/null +++ b/node_modules/dayjs/esm/locale/af.js @@ -0,0 +1,39 @@ +// Afrikaans [af] +import dayjs from '../index'; +var locale = { + name: 'af', + weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'), + months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'), + weekStart: 1, + weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'), + monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'), + weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'oor %s', + past: '%s gelede', + s: "'n paar sekondes", + m: "'n minuut", + mm: '%d minute', + h: "'n uur", + hh: '%d ure', + d: "'n dag", + dd: '%d dae', + M: "'n maand", + MM: '%d maande', + y: "'n jaar", + yy: '%d jaar' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/am.js b/node_modules/dayjs/esm/locale/am.js new file mode 100644 index 00000000..cf25510c --- /dev/null +++ b/node_modules/dayjs/esm/locale/am.js @@ -0,0 +1,40 @@ +// Amharic [am] +import dayjs from '../index'; +var locale = { + name: 'am', + weekdays: 'እሑድ_ሰኞ_ማክሰኞ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ'.split('_'), + weekdaysShort: 'እሑድ_ሰኞ_ማክሰ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ'.split('_'), + weekdaysMin: 'እሑ_ሰኞ_ማክ_ረቡ_ሐሙ_አር_ቅዳ'.split('_'), + months: 'ጃንዋሪ_ፌብሯሪ_ማርች_ኤፕሪል_ሜይ_ጁን_ጁላይ_ኦገስት_ሴፕቴምበር_ኦክቶበር_ኖቬምበር_ዲሴምበር'.split('_'), + monthsShort: 'ጃንዋ_ፌብሯ_ማርች_ኤፕሪ_ሜይ_ጁን_ጁላይ_ኦገስ_ሴፕቴ_ኦክቶ_ኖቬም_ዲሴም'.split('_'), + weekStart: 1, + yearStart: 4, + relativeTime: { + future: 'በ%s', + past: '%s በፊት', + s: 'ጥቂት ሰከንዶች', + m: 'አንድ ደቂቃ', + mm: '%d ደቂቃዎች', + h: 'አንድ ሰዓት', + hh: '%d ሰዓታት', + d: 'አንድ ቀን', + dd: '%d ቀናት', + M: 'አንድ ወር', + MM: '%d ወራት', + y: 'አንድ ዓመት', + yy: '%d ዓመታት' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'MMMM D ፣ YYYY', + LLL: 'MMMM D ፣ YYYY HH:mm', + LLLL: 'dddd ፣ MMMM D ፣ YYYY HH:mm' + }, + ordinal: function ordinal(n) { + return n + "\u129B"; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ar-dz.js b/node_modules/dayjs/esm/locale/ar-dz.js new file mode 100644 index 00000000..3ecc04fc --- /dev/null +++ b/node_modules/dayjs/esm/locale/ar-dz.js @@ -0,0 +1,41 @@ +// Arabic (Algeria) [ar-dz] +import dayjs from '../index'; +var locale = { + name: 'ar-dz', + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), + weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), + monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), + weekdaysMin: 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + meridiem: function meridiem(hour) { + return hour > 12 ? 'م' : 'ص'; + }, + relativeTime: { + future: 'في %s', + past: 'منذ %s', + s: 'ثوان', + m: 'دقيقة', + mm: '%d دقائق', + h: 'ساعة', + hh: '%d ساعات', + d: 'يوم', + dd: '%d أيام', + M: 'شهر', + MM: '%d أشهر', + y: 'سنة', + yy: '%d سنوات' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ar-iq.js b/node_modules/dayjs/esm/locale/ar-iq.js new file mode 100644 index 00000000..dfe31bf2 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ar-iq.js @@ -0,0 +1,42 @@ +// Arabic (Iraq) [ar-iq] +import dayjs from '../index'; +var locale = { + name: 'ar-iq', + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + months: 'كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول'.split('_'), + weekStart: 1, + weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), + monthsShort: 'كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول'.split('_'), + weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + meridiem: function meridiem(hour) { + return hour > 12 ? 'م' : 'ص'; + }, + relativeTime: { + future: 'في %s', + past: 'منذ %s', + s: 'ثوان', + m: 'دقيقة', + mm: '%d دقائق', + h: 'ساعة', + hh: '%d ساعات', + d: 'يوم', + dd: '%d أيام', + M: 'شهر', + MM: '%d أشهر', + y: 'سنة', + yy: '%d سنوات' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ar-kw.js b/node_modules/dayjs/esm/locale/ar-kw.js new file mode 100644 index 00000000..73bf90a7 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ar-kw.js @@ -0,0 +1,41 @@ +// Arabic (Kuwait) [ar-kw] +import dayjs from '../index'; +var locale = { + name: 'ar-kw', + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), + weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), + monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), + weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + meridiem: function meridiem(hour) { + return hour > 12 ? 'م' : 'ص'; + }, + relativeTime: { + future: 'في %s', + past: 'منذ %s', + s: 'ثوان', + m: 'دقيقة', + mm: '%d دقائق', + h: 'ساعة', + hh: '%d ساعات', + d: 'يوم', + dd: '%d أيام', + M: 'شهر', + MM: '%d أشهر', + y: 'سنة', + yy: '%d سنوات' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ar-ly.js b/node_modules/dayjs/esm/locale/ar-ly.js new file mode 100644 index 00000000..5caa8698 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ar-ly.js @@ -0,0 +1,27 @@ +// Arabic (Lybia) [ar-ly] +import dayjs from '../index'; +var locale = { + name: 'ar-ly', + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), + weekStart: 6, + weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), + monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), + weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + meridiem: function meridiem(hour) { + return hour > 12 ? 'م' : 'ص'; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'D/‏M/‏YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ar-ma.js b/node_modules/dayjs/esm/locale/ar-ma.js new file mode 100644 index 00000000..ed6dfef0 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ar-ma.js @@ -0,0 +1,42 @@ +// Arabic (Morocco) [ar-ma] +import dayjs from '../index'; +var locale = { + name: 'ar-ma', + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), + weekStart: 6, + weekdaysShort: 'احد_إثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), + monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), + weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + meridiem: function meridiem(hour) { + return hour > 12 ? 'م' : 'ص'; + }, + relativeTime: { + future: 'في %s', + past: 'منذ %s', + s: 'ثوان', + m: 'دقيقة', + mm: '%d دقائق', + h: 'ساعة', + hh: '%d ساعات', + d: 'يوم', + dd: '%d أيام', + M: 'شهر', + MM: '%d أشهر', + y: 'سنة', + yy: '%d سنوات' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ar-sa.js b/node_modules/dayjs/esm/locale/ar-sa.js new file mode 100644 index 00000000..8eb9687e --- /dev/null +++ b/node_modules/dayjs/esm/locale/ar-sa.js @@ -0,0 +1,41 @@ +// Arabic (Saudi Arabia) [ar-sa] +import dayjs from '../index'; +var locale = { + name: 'ar-sa', + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), + weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), + monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), + weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + meridiem: function meridiem(hour) { + return hour > 12 ? 'م' : 'ص'; + }, + relativeTime: { + future: 'في %s', + past: 'منذ %s', + s: 'ثوان', + m: 'دقيقة', + mm: '%d دقائق', + h: 'ساعة', + hh: '%d ساعات', + d: 'يوم', + dd: '%d أيام', + M: 'شهر', + MM: '%d أشهر', + y: 'سنة', + yy: '%d سنوات' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ar-tn.js b/node_modules/dayjs/esm/locale/ar-tn.js new file mode 100644 index 00000000..3c1f2b01 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ar-tn.js @@ -0,0 +1,42 @@ +// Arabic (Tunisia) [ar-tn] +import dayjs from '../index'; +var locale = { + name: 'ar-tn', + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), + weekStart: 1, + weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), + monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), + weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + meridiem: function meridiem(hour) { + return hour > 12 ? 'م' : 'ص'; + }, + relativeTime: { + future: 'في %s', + past: 'منذ %s', + s: 'ثوان', + m: 'دقيقة', + mm: '%d دقائق', + h: 'ساعة', + hh: '%d ساعات', + d: 'يوم', + dd: '%d أيام', + M: 'شهر', + MM: '%d أشهر', + y: 'سنة', + yy: '%d سنوات' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ar.js b/node_modules/dayjs/esm/locale/ar.js new file mode 100644 index 00000000..78b99b8b --- /dev/null +++ b/node_modules/dayjs/esm/locale/ar.js @@ -0,0 +1,77 @@ +// Arabic [ar] +import dayjs from '../index'; +var months = 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'); +var symbolMap = { + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠' +}; +var numberMap = { + '١': '1', + '٢': '2', + '٣': '3', + '٤': '4', + '٥': '5', + '٦': '6', + '٧': '7', + '٨': '8', + '٩': '9', + '٠': '0' +}; +var locale = { + name: 'ar', + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), + weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), + months: months, + monthsShort: months, + weekStart: 6, + meridiem: function meridiem(hour) { + return hour > 12 ? 'م' : 'ص'; + }, + relativeTime: { + future: 'بعد %s', + past: 'منذ %s', + s: 'ثانية واحدة', + m: 'دقيقة واحدة', + mm: '%d دقائق', + h: 'ساعة واحدة', + hh: '%d ساعات', + d: 'يوم واحد', + dd: '%d أيام', + M: 'شهر واحد', + MM: '%d أشهر', + y: 'عام واحد', + yy: '%d أعوام' + }, + preparse: function preparse(string) { + return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { + return numberMap[match]; + }).replace(/،/g, ','); + }, + postformat: function postformat(string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }).replace(/,/g, '،'); + }, + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'D/‏M/‏YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/az.js b/node_modules/dayjs/esm/locale/az.js new file mode 100644 index 00000000..3505c8a7 --- /dev/null +++ b/node_modules/dayjs/esm/locale/az.js @@ -0,0 +1,39 @@ +// Azerbaijani [az] +import dayjs from '../index'; +var locale = { + name: 'az', + weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'), + weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'), + weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'), + months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'), + monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'), + weekStart: 1, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY г.', + LLL: 'D MMMM YYYY г., H:mm', + LLLL: 'dddd, D MMMM YYYY г., H:mm' + }, + relativeTime: { + future: '%s sonra', + past: '%s əvvəl', + s: 'bir neçə saniyə', + m: 'bir dəqiqə', + mm: '%d dəqiqə', + h: 'bir saat', + hh: '%d saat', + d: 'bir gün', + dd: '%d gün', + M: 'bir ay', + MM: '%d ay', + y: 'bir il', + yy: '%d il' + }, + ordinal: function ordinal(n) { + return n; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/be.js b/node_modules/dayjs/esm/locale/be.js new file mode 100644 index 00000000..5642e397 --- /dev/null +++ b/node_modules/dayjs/esm/locale/be.js @@ -0,0 +1,24 @@ +// Belarusian [be] +import dayjs from '../index'; +var locale = { + name: 'be', + weekdays: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'), + months: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'), + weekStart: 1, + weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'), + monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), + weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY г.', + LLL: 'D MMMM YYYY г., HH:mm', + LLLL: 'dddd, D MMMM YYYY г., HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/bg.js b/node_modules/dayjs/esm/locale/bg.js new file mode 100644 index 00000000..e60a2a33 --- /dev/null +++ b/node_modules/dayjs/esm/locale/bg.js @@ -0,0 +1,55 @@ +// Bulgarian [bg] +import dayjs from '../index'; +var locale = { + name: 'bg', + weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'), + weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'), + weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), + months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'), + monthsShort: 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'), + weekStart: 1, + ordinal: function ordinal(n) { + var last2Digits = n % 100; + + if (last2Digits > 10 && last2Digits < 20) { + return n + "-\u0442\u0438"; + } + + var lastDigit = n % 10; + + if (lastDigit === 1) { + return n + "-\u0432\u0438"; + } else if (lastDigit === 2) { + return n + "-\u0440\u0438"; + } else if (lastDigit === 7 || lastDigit === 8) { + return n + "-\u043C\u0438"; + } + + return n + "-\u0442\u0438"; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'D.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY H:mm', + LLLL: 'dddd, D MMMM YYYY H:mm' + }, + relativeTime: { + future: 'след %s', + past: 'преди %s', + s: 'няколко секунди', + m: 'минута', + mm: '%d минути', + h: 'час', + hh: '%d часа', + d: 'ден', + dd: '%d дена', + M: 'месец', + MM: '%d месеца', + y: 'година', + yy: '%d години' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/bi.js b/node_modules/dayjs/esm/locale/bi.js new file mode 100644 index 00000000..6230f251 --- /dev/null +++ b/node_modules/dayjs/esm/locale/bi.js @@ -0,0 +1,39 @@ +// Bislama [bi] +import dayjs from '../index'; +var locale = { + name: 'bi', + weekdays: 'Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade'.split('_'), + months: 'Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba'.split('_'), + weekStart: 1, + weekdaysShort: 'San_Man_Tus_Wen_Tos_Frae_Sar'.split('_'), + monthsShort: 'Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis'.split('_'), + weekdaysMin: 'San_Ma_Tu_We_To_Fr_Sar'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY h:mm A', + LLLL: 'dddd, D MMMM YYYY h:mm A' + }, + relativeTime: { + future: 'lo %s', + past: '%s bifo', + s: 'sam seken', + m: 'wan minit', + mm: '%d minit', + h: 'wan haoa', + hh: '%d haoa', + d: 'wan dei', + dd: '%d dei', + M: 'wan manis', + MM: '%d manis', + y: 'wan yia', + yy: '%d yia' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/bm.js b/node_modules/dayjs/esm/locale/bm.js new file mode 100644 index 00000000..0d610930 --- /dev/null +++ b/node_modules/dayjs/esm/locale/bm.js @@ -0,0 +1,39 @@ +// Bambara [bm] +import dayjs from '../index'; +var locale = { + name: 'bm', + weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'), + months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split('_'), + weekStart: 1, + weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'), + monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'), + weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'MMMM [tile] D [san] YYYY', + LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', + LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm' + }, + relativeTime: { + future: '%s kɔnɔ', + past: 'a bɛ %s bɔ', + s: 'sanga dama dama', + m: 'miniti kelen', + mm: 'miniti %d', + h: 'lɛrɛ kelen', + hh: 'lɛrɛ %d', + d: 'tile kelen', + dd: 'tile %d', + M: 'kalo kelen', + MM: 'kalo %d', + y: 'san kelen', + yy: 'san %d' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/bn-bd.js b/node_modules/dayjs/esm/locale/bn-bd.js new file mode 100644 index 00000000..f13b660b --- /dev/null +++ b/node_modules/dayjs/esm/locale/bn-bd.js @@ -0,0 +1,81 @@ +// Bengali (Bangladesh) [bn-bd] +import dayjs from '../index'; +var symbolMap = { + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০' +}; +var numberMap = { + '১': '1', + '২': '2', + '৩': '3', + '৪': '4', + '৫': '5', + '৬': '6', + '৭': '7', + '৮': '8', + '৯': '9', + '০': '0' +}; +var locale = { + name: 'bn-bd', + weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'), + months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), + weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), + monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'), + weekdaysMin: 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'), + weekStart: 0, + preparse: function preparse(string) { + return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { + return numberMap[match]; + }); + }, + postformat: function postformat(string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }); + }, + ordinal: function ordinal(n) { + var s = ['ই', 'লা', 'রা', 'ঠা', 'শে']; + var v = n % 100; + return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]"; + }, + formats: { + LT: 'A h:mm সময়', + LTS: 'A h:mm:ss সময়', + L: 'DD/MM/YYYY খ্রিস্টাব্দ', + LL: 'D MMMM YYYY খ্রিস্টাব্দ', + LLL: 'D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়', + LLLL: 'dddd, D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়' + }, + meridiem: function meridiem(hour) { + return ( + /* eslint-disable no-nested-ternary */ + hour < 4 ? 'রাত' : hour < 6 ? 'ভোর' : hour < 12 ? 'সকাল' : hour < 15 ? 'দুপুর' : hour < 18 ? 'বিকাল' : hour < 20 ? 'সন্ধ্যা' : 'রাত' + ); + }, + relativeTime: { + future: '%s পরে', + past: '%s আগে', + s: 'কয়েক সেকেন্ড', + m: 'এক মিনিট', + mm: '%d মিনিট', + h: 'এক ঘন্টা', + hh: '%d ঘন্টা', + d: 'এক দিন', + dd: '%d দিন', + M: 'এক মাস', + MM: '%d মাস', + y: 'এক বছর', + yy: '%d বছর' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/bn.js b/node_modules/dayjs/esm/locale/bn.js new file mode 100644 index 00000000..25fc1703 --- /dev/null +++ b/node_modules/dayjs/esm/locale/bn.js @@ -0,0 +1,72 @@ +// Bengali [bn] +import dayjs from '../index'; +var symbolMap = { + 1: '১', + 2: '২', + 3: '৩', + 4: '৪', + 5: '৫', + 6: '৬', + 7: '৭', + 8: '৮', + 9: '৯', + 0: '০' +}; +var numberMap = { + '১': '1', + '২': '2', + '৩': '3', + '৪': '4', + '৫': '5', + '৬': '6', + '৭': '7', + '৮': '8', + '৯': '9', + '০': '0' +}; +var locale = { + name: 'bn', + weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'), + months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), + weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), + monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'), + weekdaysMin: 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'), + preparse: function preparse(string) { + return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { + return numberMap[match]; + }); + }, + postformat: function postformat(string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }); + }, + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm সময়', + LTS: 'A h:mm:ss সময়', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm সময়', + LLLL: 'dddd, D MMMM YYYY, A h:mm সময়' + }, + relativeTime: { + future: '%s পরে', + past: '%s আগে', + s: 'কয়েক সেকেন্ড', + m: 'এক মিনিট', + mm: '%d মিনিট', + h: 'এক ঘন্টা', + hh: '%d ঘন্টা', + d: 'এক দিন', + dd: '%d দিন', + M: 'এক মাস', + MM: '%d মাস', + y: 'এক বছর', + yy: '%d বছর' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/bo.js b/node_modules/dayjs/esm/locale/bo.js new file mode 100644 index 00000000..fce33446 --- /dev/null +++ b/node_modules/dayjs/esm/locale/bo.js @@ -0,0 +1,38 @@ +// Tibetan [bo] +import dayjs from '../index'; +var locale = { + name: 'bo', + weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'), + weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'), + weekdaysMin: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'), + months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), + monthsShort: 'ཟླ་དང་པོ_ཟླ་གཉིས་པ_ཟླ་གསུམ་པ_ཟླ་བཞི་པ_ཟླ་ལྔ་པ_ཟླ་དྲུག་པ_ཟླ་བདུན་པ_ཟླ་བརྒྱད་པ_ཟླ་དགུ་པ_ཟླ་བཅུ་པ_ཟླ་བཅུ་གཅིག་པ_ཟླ་བཅུ་གཉིས་པ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm', + LTS: 'A h:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm', + LLLL: 'dddd, D MMMM YYYY, A h:mm' + }, + relativeTime: { + future: '%s ལ་', + past: '%s སྔོན་ལ་', + s: 'ཏོག་ཙམ་', + m: 'སྐར་མ་གཅིག་', + mm: 'སྐར་མ་ %d', + h: 'ཆུ་ཚོད་གཅིག་', + hh: 'ཆུ་ཚོད་ %d', + d: 'ཉིན་གཅིག་', + dd: 'ཉིན་ %d', + M: 'ཟླ་བ་གཅིག་', + MM: 'ཟླ་བ་ %d', + y: 'ལོ་གཅིག་', + yy: 'ལོ་ %d' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/br.js b/node_modules/dayjs/esm/locale/br.js new file mode 100644 index 00000000..d18b4fea --- /dev/null +++ b/node_modules/dayjs/esm/locale/br.js @@ -0,0 +1,93 @@ +// Breton [br] +import dayjs from '../index'; + +function lastNumber(number) { + if (number > 9) { + return lastNumber(number % 10); + } + + return number; +} + +function softMutation(text) { + var mutationTable = { + m: 'v', + b: 'v', + d: 'z' + }; + return mutationTable[text.charAt(0)] + text.substring(1); +} + +function mutation(text, number) { + if (number === 2) { + return softMutation(text); + } + + return text; +} + +function relativeTimeWithMutation(number, withoutSuffix, key) { + var format = { + mm: 'munutenn', + MM: 'miz', + dd: 'devezh' + }; + return number + " " + mutation(format[key], number); +} + +function specialMutationForYears(number) { + /* istanbul ignore next line */ + switch (lastNumber(number)) { + case 1: + case 3: + case 4: + case 5: + case 9: + return number + " bloaz"; + + default: + return number + " vloaz"; + } +} + +var locale = { + name: 'br', + weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'), + months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'), + weekStart: 1, + weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'), + monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'), + weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'h[e]mm A', + LTS: 'h[e]mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D [a viz] MMMM YYYY', + LLL: 'D [a viz] MMMM YYYY h[e]mm A', + LLLL: 'dddd, D [a viz] MMMM YYYY h[e]mm A' + }, + relativeTime: { + future: 'a-benn %s', + past: '%s ʼzo', + s: 'un nebeud segondennoù', + m: 'ur vunutenn', + mm: relativeTimeWithMutation, + h: 'un eur', + hh: '%d eur', + d: 'un devezh', + dd: relativeTimeWithMutation, + M: 'ur miz', + MM: relativeTimeWithMutation, + y: 'ur bloaz', + yy: specialMutationForYears + }, + meridiem: function meridiem(hour) { + return hour < 12 ? 'a.m.' : 'g.m.'; + } // a-raok merenn | goude merenn + +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/bs.js b/node_modules/dayjs/esm/locale/bs.js new file mode 100644 index 00000000..328a1fe3 --- /dev/null +++ b/node_modules/dayjs/esm/locale/bs.js @@ -0,0 +1,24 @@ +// Bosnian [bs] +import dayjs from '../index'; +var locale = { + name: 'bs', + weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), + months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'), + weekStart: 1, + weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), + monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'), + weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd, D. MMMM YYYY H:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ca.js b/node_modules/dayjs/esm/locale/ca.js new file mode 100644 index 00000000..94fc0b9c --- /dev/null +++ b/node_modules/dayjs/esm/locale/ca.js @@ -0,0 +1,44 @@ +// Catalan [ca] +import dayjs from '../index'; +var locale = { + name: 'ca', + weekdays: 'Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte'.split('_'), + weekdaysShort: 'Dg._Dl._Dt._Dc._Dj._Dv._Ds.'.split('_'), + weekdaysMin: 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'), + months: 'Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre'.split('_'), + monthsShort: 'Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.'.split('_'), + weekStart: 1, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM [de] YYYY', + LLL: 'D MMMM [de] YYYY [a les] H:mm', + LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm', + ll: 'D MMM YYYY', + lll: 'D MMM YYYY, H:mm', + llll: 'ddd D MMM YYYY, H:mm' + }, + relativeTime: { + future: 'd\'aquí %s', + past: 'fa %s', + s: 'uns segons', + m: 'un minut', + mm: '%d minuts', + h: 'una hora', + hh: '%d hores', + d: 'un dia', + dd: '%d dies', + M: 'un mes', + MM: '%d mesos', + y: 'un any', + yy: '%d anys' + }, + ordinal: function ordinal(n) { + var ord; + if (n === 1 || n === 3) ord = 'r';else if (n === 2) ord = 'n';else if (n === 4) ord = 't';else ord = 'è'; + return "" + n + ord; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/cs.js b/node_modules/dayjs/esm/locale/cs.js new file mode 100644 index 00000000..165b662c --- /dev/null +++ b/node_modules/dayjs/esm/locale/cs.js @@ -0,0 +1,120 @@ +// Czech [cs] +import dayjs from '../index'; + +function plural(n) { + return n > 1 && n < 5 && ~~(n / 10) !== 1; // eslint-disable-line +} +/* eslint-disable */ + + +function translate(number, withoutSuffix, key, isFuture) { + var result = number + " "; + + switch (key) { + case 's': + // a few seconds / in a few seconds / a few seconds ago + return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami'; + + case 'm': + // a minute / in a minute / a minute ago + return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou'; + + case 'mm': + // 9 minutes / in 9 minutes / 9 minutes ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'minuty' : 'minut'); + } + + return result + "minutami"; + + case 'h': + // an hour / in an hour / an hour ago + return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou'; + + case 'hh': + // 9 hours / in 9 hours / 9 hours ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'hodiny' : 'hodin'); + } + + return result + "hodinami"; + + case 'd': + // a day / in a day / a day ago + return withoutSuffix || isFuture ? 'den' : 'dnem'; + + case 'dd': + // 9 days / in 9 days / 9 days ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'dny' : 'dní'); + } + + return result + "dny"; + + case 'M': + // a month / in a month / a month ago + return withoutSuffix || isFuture ? 'měsíc' : 'měsícem'; + + case 'MM': + // 9 months / in 9 months / 9 months ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'měsíce' : 'měsíců'); + } + + return result + "m\u011Bs\xEDci"; + + case 'y': + // a year / in a year / a year ago + return withoutSuffix || isFuture ? 'rok' : 'rokem'; + + case 'yy': + // 9 years / in 9 years / 9 years ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'roky' : 'let'); + } + + return result + "lety"; + } +} +/* eslint-enable */ + + +var locale = { + name: 'cs', + weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), + weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'), + weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'), + months: 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'), + monthsShort: 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'), + weekStart: 1, + yearStart: 4, + ordinal: function ordinal(n) { + return n + "."; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd D. MMMM YYYY H:mm', + l: 'D. M. YYYY' + }, + relativeTime: { + future: 'za %s', + past: 'před %s', + s: translate, + m: translate, + mm: translate, + h: translate, + hh: translate, + d: translate, + dd: translate, + M: translate, + MM: translate, + y: translate, + yy: translate + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/cv.js b/node_modules/dayjs/esm/locale/cv.js new file mode 100644 index 00000000..7dc41f76 --- /dev/null +++ b/node_modules/dayjs/esm/locale/cv.js @@ -0,0 +1,24 @@ +// Chuvash [cv] +import dayjs from '../index'; +var locale = { + name: 'cv', + weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'), + months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'), + weekStart: 1, + weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'), + monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'), + weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD-MM-YYYY', + LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', + LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', + LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/cy.js b/node_modules/dayjs/esm/locale/cy.js new file mode 100644 index 00000000..63e6c33c --- /dev/null +++ b/node_modules/dayjs/esm/locale/cy.js @@ -0,0 +1,39 @@ +// Welsh [cy] +import dayjs from '../index'; +var locale = { + name: 'cy', + weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'), + months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'), + weekStart: 1, + weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'), + monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'), + weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'mewn %s', + past: '%s yn ôl', + s: 'ychydig eiliadau', + m: 'munud', + mm: '%d munud', + h: 'awr', + hh: '%d awr', + d: 'diwrnod', + dd: '%d diwrnod', + M: 'mis', + MM: '%d mis', + y: 'blwyddyn', + yy: '%d flynedd' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/da.js b/node_modules/dayjs/esm/locale/da.js new file mode 100644 index 00000000..38fd1347 --- /dev/null +++ b/node_modules/dayjs/esm/locale/da.js @@ -0,0 +1,39 @@ +// Danish [da] +import dayjs from '../index'; +var locale = { + name: 'da', + weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), + weekdaysShort: 'søn._man._tirs._ons._tors._fre._lør.'.split('_'), + weekdaysMin: 'sø._ma._ti._on._to._fr._lø.'.split('_'), + months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'), + monthsShort: 'jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.'.split('_'), + weekStart: 1, + ordinal: function ordinal(n) { + return n + "."; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY HH:mm', + LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm' + }, + relativeTime: { + future: 'om %s', + past: '%s siden', + s: 'få sekunder', + m: 'et minut', + mm: '%d minutter', + h: 'en time', + hh: '%d timer', + d: 'en dag', + dd: '%d dage', + M: 'en måned', + MM: '%d måneder', + y: 'et år', + yy: '%d år' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/de-at.js b/node_modules/dayjs/esm/locale/de-at.js new file mode 100644 index 00000000..e109d971 --- /dev/null +++ b/node_modules/dayjs/esm/locale/de-at.js @@ -0,0 +1,63 @@ +// German (Austria) [de-at] +import dayjs from '../index'; +var texts = { + s: 'ein paar Sekunden', + m: ['eine Minute', 'einer Minute'], + mm: '%d Minuten', + h: ['eine Stunde', 'einer Stunde'], + hh: '%d Stunden', + d: ['ein Tag', 'einem Tag'], + dd: ['%d Tage', '%d Tagen'], + M: ['ein Monat', 'einem Monat'], + MM: ['%d Monate', '%d Monaten'], + y: ['ein Jahr', 'einem Jahr'], + yy: ['%d Jahre', '%d Jahren'] +}; + +function relativeTimeFormatter(number, withoutSuffix, key) { + var l = texts[key]; + + if (Array.isArray(l)) { + l = l[withoutSuffix ? 0 : 1]; + } + + return l.replace('%d', number); +} + +var locale = { + name: 'de-at', + weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), + weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), + weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), + months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), + monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + formats: { + LTS: 'HH:mm:ss', + LT: 'HH:mm', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY HH:mm', + LLLL: 'dddd, D. MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'in %s', + past: 'vor %s', + s: relativeTimeFormatter, + m: relativeTimeFormatter, + mm: relativeTimeFormatter, + h: relativeTimeFormatter, + hh: relativeTimeFormatter, + d: relativeTimeFormatter, + dd: relativeTimeFormatter, + M: relativeTimeFormatter, + MM: relativeTimeFormatter, + y: relativeTimeFormatter, + yy: relativeTimeFormatter + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/de-ch.js b/node_modules/dayjs/esm/locale/de-ch.js new file mode 100644 index 00000000..1ffbbf73 --- /dev/null +++ b/node_modules/dayjs/esm/locale/de-ch.js @@ -0,0 +1,63 @@ +// German (Switzerland) [de-ch] +import dayjs from '../index'; +var texts = { + s: 'ein paar Sekunden', + m: ['eine Minute', 'einer Minute'], + mm: '%d Minuten', + h: ['eine Stunde', 'einer Stunde'], + hh: '%d Stunden', + d: ['ein Tag', 'einem Tag'], + dd: ['%d Tage', '%d Tagen'], + M: ['ein Monat', 'einem Monat'], + MM: ['%d Monate', '%d Monaten'], + y: ['ein Jahr', 'einem Jahr'], + yy: ['%d Jahre', '%d Jahren'] +}; + +function relativeTimeFormatter(number, withoutSuffix, key) { + var l = texts[key]; + + if (Array.isArray(l)) { + l = l[withoutSuffix ? 0 : 1]; + } + + return l.replace('%d', number); +} + +var locale = { + name: 'de-ch', + weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), + weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), + weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), + months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), + monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY HH:mm', + LLLL: 'dddd, D. MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'in %s', + past: 'vor %s', + s: relativeTimeFormatter, + m: relativeTimeFormatter, + mm: relativeTimeFormatter, + h: relativeTimeFormatter, + hh: relativeTimeFormatter, + d: relativeTimeFormatter, + dd: relativeTimeFormatter, + M: relativeTimeFormatter, + MM: relativeTimeFormatter, + y: relativeTimeFormatter, + yy: relativeTimeFormatter + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/de.js b/node_modules/dayjs/esm/locale/de.js new file mode 100644 index 00000000..8ccd4833 --- /dev/null +++ b/node_modules/dayjs/esm/locale/de.js @@ -0,0 +1,64 @@ +// German [de] +import dayjs from '../index'; +var texts = { + s: 'ein paar Sekunden', + m: ['eine Minute', 'einer Minute'], + mm: '%d Minuten', + h: ['eine Stunde', 'einer Stunde'], + hh: '%d Stunden', + d: ['ein Tag', 'einem Tag'], + dd: ['%d Tage', '%d Tagen'], + M: ['ein Monat', 'einem Monat'], + MM: ['%d Monate', '%d Monaten'], + y: ['ein Jahr', 'einem Jahr'], + yy: ['%d Jahre', '%d Jahren'] +}; + +function relativeTimeFormatter(number, withoutSuffix, key) { + var l = texts[key]; + + if (Array.isArray(l)) { + l = l[withoutSuffix ? 0 : 1]; + } + + return l.replace('%d', number); +} + +var locale = { + name: 'de', + weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), + weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), + weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), + months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), + monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + yearStart: 4, + formats: { + LTS: 'HH:mm:ss', + LT: 'HH:mm', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY HH:mm', + LLLL: 'dddd, D. MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'in %s', + past: 'vor %s', + s: relativeTimeFormatter, + m: relativeTimeFormatter, + mm: relativeTimeFormatter, + h: relativeTimeFormatter, + hh: relativeTimeFormatter, + d: relativeTimeFormatter, + dd: relativeTimeFormatter, + M: relativeTimeFormatter, + MM: relativeTimeFormatter, + y: relativeTimeFormatter, + yy: relativeTimeFormatter + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/dv.js b/node_modules/dayjs/esm/locale/dv.js new file mode 100644 index 00000000..8943fdd8 --- /dev/null +++ b/node_modules/dayjs/esm/locale/dv.js @@ -0,0 +1,39 @@ +// Maldivian [dv] +import dayjs from '../index'; +var locale = { + name: 'dv', + weekdays: 'އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު'.split('_'), + months: 'ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު'.split('_'), + weekStart: 7, + weekdaysShort: 'އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު'.split('_'), + monthsShort: 'ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު'.split('_'), + weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'D/M/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'ތެރޭގައި %s', + past: 'ކުރިން %s', + s: 'ސިކުންތުކޮޅެއް', + m: 'މިނިޓެއް', + mm: 'މިނިޓު %d', + h: 'ގަޑިއިރެއް', + hh: 'ގަޑިއިރު %d', + d: 'ދުވަހެއް', + dd: 'ދުވަސް %d', + M: 'މަހެއް', + MM: 'މަސް %d', + y: 'އަހަރެއް', + yy: 'އަހަރު %d' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/el.js b/node_modules/dayjs/esm/locale/el.js new file mode 100644 index 00000000..2aa9917d --- /dev/null +++ b/node_modules/dayjs/esm/locale/el.js @@ -0,0 +1,39 @@ +// Greek [el] +import dayjs from '../index'; +var locale = { + name: 'el', + weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'), + weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'), + weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'), + months: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'), + monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαι_Ιουν_Ιουλ_Αυγ_Σεπτ_Οκτ_Νοε_Δεκ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + weekStart: 1, + relativeTime: { + future: 'σε %s', + past: 'πριν %s', + s: 'μερικά δευτερόλεπτα', + m: 'ένα λεπτό', + mm: '%d λεπτά', + h: 'μία ώρα', + hh: '%d ώρες', + d: 'μία μέρα', + dd: '%d μέρες', + M: 'ένα μήνα', + MM: '%d μήνες', + y: 'ένα χρόνο', + yy: '%d χρόνια' + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY h:mm A', + LLLL: 'dddd, D MMMM YYYY h:mm A' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-au.js b/node_modules/dayjs/esm/locale/en-au.js new file mode 100644 index 00000000..f9dde034 --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-au.js @@ -0,0 +1,39 @@ +// English (Australia) [en-au] +import dayjs from '../index'; +var locale = { + name: 'en-au', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + weekStart: 1, + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY h:mm A', + LLLL: 'dddd, D MMMM YYYY h:mm A' + }, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-ca.js b/node_modules/dayjs/esm/locale/en-ca.js new file mode 100644 index 00000000..8e416c99 --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-ca.js @@ -0,0 +1,38 @@ +// English (Canada) [en-ca] +import dayjs from '../index'; +var locale = { + name: 'en-ca', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'YYYY-MM-DD', + LL: 'MMMM D, YYYY', + LLL: 'MMMM D, YYYY h:mm A', + LLLL: 'dddd, MMMM D, YYYY h:mm A' + }, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-gb.js b/node_modules/dayjs/esm/locale/en-gb.js new file mode 100644 index 00000000..f979b442 --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-gb.js @@ -0,0 +1,42 @@ +// English (United Kingdom) [en-gb] +import dayjs from '../index'; +var locale = { + name: 'en-gb', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekStart: 1, + yearStart: 4, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + ordinal: function ordinal(n) { + var s = ['th', 'st', 'nd', 'rd']; + var v = n % 100; + return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]"; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-ie.js b/node_modules/dayjs/esm/locale/en-ie.js new file mode 100644 index 00000000..8098d2f7 --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-ie.js @@ -0,0 +1,39 @@ +// English (Ireland) [en-ie] +import dayjs from '../index'; +var locale = { + name: 'en-ie', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + weekStart: 1, + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-il.js b/node_modules/dayjs/esm/locale/en-il.js new file mode 100644 index 00000000..56c241ac --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-il.js @@ -0,0 +1,38 @@ +// English (Israel) [en-il] +import dayjs from '../index'; +var locale = { + name: 'en-il', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-in.js b/node_modules/dayjs/esm/locale/en-in.js new file mode 100644 index 00000000..7ccb206c --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-in.js @@ -0,0 +1,42 @@ +// English (India) [en-in] +import dayjs from '../index'; +var locale = { + name: 'en-in', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekStart: 1, + yearStart: 4, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + ordinal: function ordinal(n) { + var s = ['th', 'st', 'nd', 'rd']; + var v = n % 100; + return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]"; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-nz.js b/node_modules/dayjs/esm/locale/en-nz.js new file mode 100644 index 00000000..08c562eb --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-nz.js @@ -0,0 +1,41 @@ +// English (New Zealand) [en-nz] +import dayjs from '../index'; +var locale = { + name: 'en-nz', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + weekStart: 1, + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + ordinal: function ordinal(n) { + var s = ['th', 'st', 'nd', 'rd']; + var v = n % 100; + return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]"; + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY h:mm A', + LLLL: 'dddd, D MMMM YYYY h:mm A' + }, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-sg.js b/node_modules/dayjs/esm/locale/en-sg.js new file mode 100644 index 00000000..3c5edcee --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-sg.js @@ -0,0 +1,39 @@ +// English (Singapore) [en-sg] +import dayjs from '../index'; +var locale = { + name: 'en-sg', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + weekStart: 1, + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en-tt.js b/node_modules/dayjs/esm/locale/en-tt.js new file mode 100644 index 00000000..ef47eeba --- /dev/null +++ b/node_modules/dayjs/esm/locale/en-tt.js @@ -0,0 +1,42 @@ +// English (Trinidad & Tobago) [en-tt] +import dayjs from '../index'; +var locale = { + name: 'en-tt', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + weekStart: 1, + yearStart: 4, + relativeTime: { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + ordinal: function ordinal(n) { + var s = ['th', 'st', 'nd', 'rd']; + var v = n % 100; + return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]"; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/en.js b/node_modules/dayjs/esm/locale/en.js new file mode 100644 index 00000000..8ba61072 --- /dev/null +++ b/node_modules/dayjs/esm/locale/en.js @@ -0,0 +1,12 @@ +// English [en] +// We don't need weekdaysShort, weekdaysMin, monthsShort in en.js locale +export default { + name: 'en', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + ordinal: function ordinal(n) { + var s = ['th', 'st', 'nd', 'rd']; + var v = n % 100; + return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]"; + } +}; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/eo.js b/node_modules/dayjs/esm/locale/eo.js new file mode 100644 index 00000000..e62599aa --- /dev/null +++ b/node_modules/dayjs/esm/locale/eo.js @@ -0,0 +1,39 @@ +// Esperanto [eo] +import dayjs from '../index'; +var locale = { + name: 'eo', + weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'), + months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'), + weekStart: 1, + weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'), + monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'), + weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'D[-a de] MMMM, YYYY', + LLL: 'D[-a de] MMMM, YYYY HH:mm', + LLLL: 'dddd, [la] D[-a de] MMMM, YYYY HH:mm' + }, + relativeTime: { + future: 'post %s', + past: 'antaŭ %s', + s: 'sekundoj', + m: 'minuto', + mm: '%d minutoj', + h: 'horo', + hh: '%d horoj', + d: 'tago', + dd: '%d tagoj', + M: 'monato', + MM: '%d monatoj', + y: 'jaro', + yy: '%d jaroj' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/es-do.js b/node_modules/dayjs/esm/locale/es-do.js new file mode 100644 index 00000000..09410cfa --- /dev/null +++ b/node_modules/dayjs/esm/locale/es-do.js @@ -0,0 +1,39 @@ +// Spanish (Dominican Republic) [es-do] +import dayjs from '../index'; +var locale = { + name: 'es-do', + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), + monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + weekStart: 1, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años' + }, + ordinal: function ordinal(n) { + return n + "\xBA"; + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY h:mm A', + LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/es-mx.js b/node_modules/dayjs/esm/locale/es-mx.js new file mode 100644 index 00000000..0207f83b --- /dev/null +++ b/node_modules/dayjs/esm/locale/es-mx.js @@ -0,0 +1,38 @@ +// Spanish (Mexico) [es-mx] +import dayjs from '../index'; +var locale = { + name: 'es-mx', + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), + monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años' + }, + ordinal: function ordinal(n) { + return n + "\xBA"; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/es-pr.js b/node_modules/dayjs/esm/locale/es-pr.js new file mode 100644 index 00000000..5edc359e --- /dev/null +++ b/node_modules/dayjs/esm/locale/es-pr.js @@ -0,0 +1,39 @@ +// Spanish (Puerto Rico) [es-PR] +import dayjs from '../index'; +var locale = { + name: 'es-pr', + monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), + weekStart: 1, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'MM/DD/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY h:mm A', + LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A' + }, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años' + }, + ordinal: function ordinal(n) { + return n + "\xBA"; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/es-us.js b/node_modules/dayjs/esm/locale/es-us.js new file mode 100644 index 00000000..f9b01a08 --- /dev/null +++ b/node_modules/dayjs/esm/locale/es-us.js @@ -0,0 +1,38 @@ +// Spanish (United States) [es-us] +import dayjs from '../index'; +var locale = { + name: 'es-us', + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), + monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años' + }, + ordinal: function ordinal(n) { + return n + "\xBA"; + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'MM/DD/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY h:mm A', + LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/es.js b/node_modules/dayjs/esm/locale/es.js new file mode 100644 index 00000000..84bdfbe9 --- /dev/null +++ b/node_modules/dayjs/esm/locale/es.js @@ -0,0 +1,39 @@ +// Spanish [es] +import dayjs from '../index'; +var locale = { + name: 'es', + monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), + weekStart: 1, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm' + }, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años' + }, + ordinal: function ordinal(n) { + return n + "\xBA"; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/et.js b/node_modules/dayjs/esm/locale/et.js new file mode 100644 index 00000000..7f7c5ff5 --- /dev/null +++ b/node_modules/dayjs/esm/locale/et.js @@ -0,0 +1,65 @@ +// Estonian [et] +import dayjs from '../index'; + +function relativeTimeWithTense(number, withoutSuffix, key, isFuture) { + var format = { + s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'], + m: ['ühe minuti', 'üks minut'], + mm: ['%d minuti', '%d minutit'], + h: ['ühe tunni', 'tund aega', 'üks tund'], + hh: ['%d tunni', '%d tundi'], + d: ['ühe päeva', 'üks päev'], + M: ['kuu aja', 'kuu aega', 'üks kuu'], + MM: ['%d kuu', '%d kuud'], + y: ['ühe aasta', 'aasta', 'üks aasta'], + yy: ['%d aasta', '%d aastat'] + }; + + if (withoutSuffix) { + return (format[key][2] ? format[key][2] : format[key][1]).replace('%d', number); + } + + return (isFuture ? format[key][0] : format[key][1]).replace('%d', number); +} + +var locale = { + name: 'et', + // Estonian + weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'), + // Note weekdays are not capitalized in Estonian + weekdaysShort: 'P_E_T_K_N_R_L'.split('_'), + // There is no short form of weekdays in Estonian except this 1 letter format so it is used for both 'weekdaysShort' and 'weekdaysMin' + weekdaysMin: 'P_E_T_K_N_R_L'.split('_'), + months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'), + // Note month names are not capitalized in Estonian + monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + relativeTime: { + future: '%s pärast', + past: '%s tagasi', + s: relativeTimeWithTense, + m: relativeTimeWithTense, + mm: relativeTimeWithTense, + h: relativeTimeWithTense, + hh: relativeTimeWithTense, + d: relativeTimeWithTense, + dd: '%d päeva', + M: relativeTimeWithTense, + MM: relativeTimeWithTense, + y: relativeTimeWithTense, + yy: relativeTimeWithTense + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd, D. MMMM YYYY H:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/eu.js b/node_modules/dayjs/esm/locale/eu.js new file mode 100644 index 00000000..5cb73d09 --- /dev/null +++ b/node_modules/dayjs/esm/locale/eu.js @@ -0,0 +1,43 @@ +// Basque [eu] +import dayjs from '../index'; +var locale = { + name: 'eu', + weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'), + months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'), + weekStart: 1, + weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'), + monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'), + weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'YYYY[ko] MMMM[ren] D[a]', + LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm', + LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', + l: 'YYYY-M-D', + ll: 'YYYY[ko] MMM D[a]', + lll: 'YYYY[ko] MMM D[a] HH:mm', + llll: 'ddd, YYYY[ko] MMM D[a] HH:mm' + }, + relativeTime: { + future: '%s barru', + past: 'duela %s', + s: 'segundo batzuk', + m: 'minutu bat', + mm: '%d minutu', + h: 'ordu bat', + hh: '%d ordu', + d: 'egun bat', + dd: '%d egun', + M: 'hilabete bat', + MM: '%d hilabete', + y: 'urte bat', + yy: '%d urte' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/fa.js b/node_modules/dayjs/esm/locale/fa.js new file mode 100644 index 00000000..089459e7 --- /dev/null +++ b/node_modules/dayjs/esm/locale/fa.js @@ -0,0 +1,39 @@ +// Persian [fa] +import dayjs from '../index'; +var locale = { + name: 'fa', + weekdays: 'یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه'.split('_'), + weekdaysShort: "\u06CC\u06A9\u200C\u0634\u0646\u0628\u0647_\u062F\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200C\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067E\u0646\u062C\u200C\u0634\u0646\u0628\u0647_\u062C\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split('_'), + weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'), + weekStart: 6, + months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), + monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'در %s', + past: '%s پیش', + s: 'چند ثانیه', + m: 'یک دقیقه', + mm: '%d دقیقه', + h: 'یک ساعت', + hh: '%d ساعت', + d: 'یک روز', + dd: '%d روز', + M: 'یک ماه', + MM: '%d ماه', + y: 'یک سال', + yy: '%d سال' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/fi.js b/node_modules/dayjs/esm/locale/fi.js new file mode 100644 index 00000000..1ded894d --- /dev/null +++ b/node_modules/dayjs/esm/locale/fi.js @@ -0,0 +1,88 @@ +// Finnish [fi] +import dayjs from '../index'; + +function relativeTimeFormatter(number, withoutSuffix, key, isFuture) { + var past = { + s: 'muutama sekunti', + m: 'minuutti', + mm: '%d minuuttia', + h: 'tunti', + hh: '%d tuntia', + d: 'päivä', + dd: '%d päivää', + M: 'kuukausi', + MM: '%d kuukautta', + y: 'vuosi', + yy: '%d vuotta', + numbers: 'nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän'.split('_') + }; + var future = { + s: 'muutaman sekunnin', + m: 'minuutin', + mm: '%d minuutin', + h: 'tunnin', + hh: '%d tunnin', + d: 'päivän', + dd: '%d päivän', + M: 'kuukauden', + MM: '%d kuukauden', + y: 'vuoden', + yy: '%d vuoden', + numbers: 'nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän'.split('_') + }; + var words = isFuture && !withoutSuffix ? future : past; + var result = words[key]; + + if (number < 10) { + return result.replace('%d', words.numbers[number]); + } + + return result.replace('%d', number); +} + +var locale = { + name: 'fi', + // Finnish + weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'), + // Note weekdays are not capitalized in Finnish + weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'), + // There is no short form of weekdays in Finnish except this 2 letter format so it is used for both 'weekdaysShort' and 'weekdaysMin' + weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'), + months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'), + // Note month names are not capitalized in Finnish + monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + yearStart: 4, + relativeTime: { + future: '%s päästä', + past: '%s sitten', + s: relativeTimeFormatter, + m: relativeTimeFormatter, + mm: relativeTimeFormatter, + h: relativeTimeFormatter, + hh: relativeTimeFormatter, + d: relativeTimeFormatter, + dd: relativeTimeFormatter, + M: relativeTimeFormatter, + MM: relativeTimeFormatter, + y: relativeTimeFormatter, + yy: relativeTimeFormatter + }, + formats: { + LT: 'HH.mm', + LTS: 'HH.mm.ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM[ta] YYYY', + LLL: 'D. MMMM[ta] YYYY, [klo] HH.mm', + LLLL: 'dddd, D. MMMM[ta] YYYY, [klo] HH.mm', + l: 'D.M.YYYY', + ll: 'D. MMM YYYY', + lll: 'D. MMM YYYY, [klo] HH.mm', + llll: 'ddd, D. MMM YYYY, [klo] HH.mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/fo.js b/node_modules/dayjs/esm/locale/fo.js new file mode 100644 index 00000000..07c37617 --- /dev/null +++ b/node_modules/dayjs/esm/locale/fo.js @@ -0,0 +1,39 @@ +// Faroese [fo] +import dayjs from '../index'; +var locale = { + name: 'fo', + weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'), + months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'), + weekStart: 1, + weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'), + monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), + weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D. MMMM, YYYY HH:mm' + }, + relativeTime: { + future: 'um %s', + past: '%s síðani', + s: 'fá sekund', + m: 'ein minuttur', + mm: '%d minuttir', + h: 'ein tími', + hh: '%d tímar', + d: 'ein dagur', + dd: '%d dagar', + M: 'ein mánaður', + MM: '%d mánaðir', + y: 'eitt ár', + yy: '%d ár' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/fr-ca.js b/node_modules/dayjs/esm/locale/fr-ca.js new file mode 100644 index 00000000..688d695c --- /dev/null +++ b/node_modules/dayjs/esm/locale/fr-ca.js @@ -0,0 +1,38 @@ +// French (Canada) [fr-ca] +import dayjs from '../index'; +var locale = { + name: 'fr-ca', + weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'dans %s', + past: 'il y a %s', + s: 'quelques secondes', + m: 'une minute', + mm: '%d minutes', + h: 'une heure', + hh: '%d heures', + d: 'un jour', + dd: '%d jours', + M: 'un mois', + MM: '%d mois', + y: 'un an', + yy: '%d ans' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/fr-ch.js b/node_modules/dayjs/esm/locale/fr-ch.js new file mode 100644 index 00000000..593dba80 --- /dev/null +++ b/node_modules/dayjs/esm/locale/fr-ch.js @@ -0,0 +1,39 @@ +// French (Switzerland) [fr-ch] +import dayjs from '../index'; +var locale = { + name: 'fr-ch', + weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + weekStart: 1, + weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'dans %s', + past: 'il y a %s', + s: 'quelques secondes', + m: 'une minute', + mm: '%d minutes', + h: 'une heure', + hh: '%d heures', + d: 'un jour', + dd: '%d jours', + M: 'un mois', + MM: '%d mois', + y: 'un an', + yy: '%d ans' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/fr.js b/node_modules/dayjs/esm/locale/fr.js new file mode 100644 index 00000000..b31c11d3 --- /dev/null +++ b/node_modules/dayjs/esm/locale/fr.js @@ -0,0 +1,41 @@ +// French [fr] +import dayjs from '../index'; +var locale = { + name: 'fr', + weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), + months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + weekStart: 1, + yearStart: 4, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'dans %s', + past: 'il y a %s', + s: 'quelques secondes', + m: 'une minute', + mm: '%d minutes', + h: 'une heure', + hh: '%d heures', + d: 'un jour', + dd: '%d jours', + M: 'un mois', + MM: '%d mois', + y: 'un an', + yy: '%d ans' + }, + ordinal: function ordinal(n) { + var o = n === 1 ? 'er' : ''; + return "" + n + o; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/fy.js b/node_modules/dayjs/esm/locale/fy.js new file mode 100644 index 00000000..4b9f9de4 --- /dev/null +++ b/node_modules/dayjs/esm/locale/fy.js @@ -0,0 +1,39 @@ +// Frisian [fy] +import dayjs from '../index'; +var locale = { + name: 'fy', + weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'), + months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'), + monthsShort: 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'), + weekStart: 1, + weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'), + weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD-MM-YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'oer %s', + past: '%s lyn', + s: 'in pear sekonden', + m: 'ien minút', + mm: '%d minuten', + h: 'ien oere', + hh: '%d oeren', + d: 'ien dei', + dd: '%d dagen', + M: 'ien moanne', + MM: '%d moannen', + y: 'ien jier', + yy: '%d jierren' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ga.js b/node_modules/dayjs/esm/locale/ga.js new file mode 100644 index 00000000..8cdfa9f1 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ga.js @@ -0,0 +1,39 @@ +// Irish or Irish Gaelic [ga] +import dayjs from '../index'; +var locale = { + name: 'ga', + weekdays: 'Dé Domhnaigh_Dé Luain_Dé Máirt_Dé Céadaoin_Déardaoin_Dé hAoine_Dé Satharn'.split('_'), + months: 'Eanáir_Feabhra_Márta_Aibreán_Bealtaine_Méitheamh_Iúil_Lúnasa_Meán Fómhair_Deaireadh Fómhair_Samhain_Nollaig'.split('_'), + weekStart: 1, + weekdaysShort: 'Dom_Lua_Mái_Céa_Déa_hAo_Sat'.split('_'), + monthsShort: 'Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll'.split('_'), + weekdaysMin: 'Do_Lu_Má_Ce_Dé_hA_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'i %s', + past: '%s ó shin', + s: 'cúpla soicind', + m: 'nóiméad', + mm: '%d nóiméad', + h: 'uair an chloig', + hh: '%d uair an chloig', + d: 'lá', + dd: '%d lá', + M: 'mí', + MM: '%d mí', + y: 'bliain', + yy: '%d bliain' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/gd.js b/node_modules/dayjs/esm/locale/gd.js new file mode 100644 index 00000000..fcf62cd5 --- /dev/null +++ b/node_modules/dayjs/esm/locale/gd.js @@ -0,0 +1,39 @@ +// Scottish Gaelic [gd] +import dayjs from '../index'; +var locale = { + name: 'gd', + weekdays: 'Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne'.split('_'), + months: 'Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd'.split('_'), + weekStart: 1, + weekdaysShort: 'Did_Dil_Dim_Dic_Dia_Dih_Dis'.split('_'), + monthsShort: 'Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh'.split('_'), + weekdaysMin: 'Dò_Lu_Mà_Ci_Ar_Ha_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'ann an %s', + past: 'bho chionn %s', + s: 'beagan diogan', + m: 'mionaid', + mm: '%d mionaidean', + h: 'uair', + hh: '%d uairean', + d: 'latha', + dd: '%d latha', + M: 'mìos', + MM: '%d mìosan', + y: 'bliadhna', + yy: '%d bliadhna' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/gl.js b/node_modules/dayjs/esm/locale/gl.js new file mode 100644 index 00000000..23d687f6 --- /dev/null +++ b/node_modules/dayjs/esm/locale/gl.js @@ -0,0 +1,39 @@ +// Galician [gl] +import dayjs from '../index'; +var locale = { + name: 'gl', + weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'), + months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'), + weekStart: 1, + weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'), + monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'), + weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'), + ordinal: function ordinal(n) { + return n + "\xBA"; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm' + }, + relativeTime: { + future: 'en %s', + past: 'fai %s', + s: 'uns segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'unha hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + M: 'un mes', + MM: '%d meses', + y: 'un ano', + yy: '%d anos' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/gom-latn.js b/node_modules/dayjs/esm/locale/gom-latn.js new file mode 100644 index 00000000..d621f5b7 --- /dev/null +++ b/node_modules/dayjs/esm/locale/gom-latn.js @@ -0,0 +1,25 @@ +// Konkani Latin script [gom-latn] +import dayjs from '../index'; +var locale = { + name: 'gom-latn', + weekdays: "Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split('_'), + months: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'), + weekStart: 1, + weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'), + monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'), + weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm [vazta]', + LTS: 'A h:mm:ss [vazta]', + L: 'DD-MM-YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY A h:mm [vazta]', + LLLL: 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]', + llll: 'ddd, D MMM YYYY, A h:mm [vazta]' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/gu.js b/node_modules/dayjs/esm/locale/gu.js new file mode 100644 index 00000000..e05f44ba --- /dev/null +++ b/node_modules/dayjs/esm/locale/gu.js @@ -0,0 +1,38 @@ +// Gujarati [gu] +import dayjs from '../index'; +var locale = { + name: 'gu', + weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split('_'), + months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split('_'), + weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'), + monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split('_'), + weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm વાગ્યે', + LTS: 'A h:mm:ss વાગ્યે', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm વાગ્યે', + LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે' + }, + relativeTime: { + future: '%s મા', + past: '%s પેહલા', + s: 'અમુક પળો', + m: 'એક મિનિટ', + mm: '%d મિનિટ', + h: 'એક કલાક', + hh: '%d કલાક', + d: 'એક દિવસ', + dd: '%d દિવસ', + M: 'એક મહિનો', + MM: '%d મહિનો', + y: 'એક વર્ષ', + yy: '%d વર્ષ' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/he.js b/node_modules/dayjs/esm/locale/he.js new file mode 100644 index 00000000..a8868ff6 --- /dev/null +++ b/node_modules/dayjs/esm/locale/he.js @@ -0,0 +1,78 @@ +// Hebrew [he] +import dayjs from '../index'; +var texts = { + s: 'מספר שניות', + ss: '%d שניות', + m: 'דקה', + mm: '%d דקות', + h: 'שעה', + hh: '%d שעות', + hh2: 'שעתיים', + d: 'יום', + dd: '%d ימים', + dd2: 'יומיים', + M: 'חודש', + MM: '%d חודשים', + MM2: 'חודשיים', + y: 'שנה', + yy: '%d שנים', + yy2: 'שנתיים' +}; + +function relativeTimeFormatter(number, withoutSuffix, key) { + var text = texts[key + (number === 2 ? '2' : '')] || texts[key]; + return text.replace('%d', number); +} + +var locale = { + name: 'he', + weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'), + weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'), + weekdaysMin: 'א׳_ב׳_ג׳_ד׳_ה׳_ו_ש׳'.split('_'), + months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'), + monthsShort: 'ינו_פבר_מרץ_אפר_מאי_יונ_יול_אוג_ספט_אוק_נוב_דצמ'.split('_'), + relativeTime: { + future: 'בעוד %s', + past: 'לפני %s', + s: relativeTimeFormatter, + m: relativeTimeFormatter, + mm: relativeTimeFormatter, + h: relativeTimeFormatter, + hh: relativeTimeFormatter, + d: relativeTimeFormatter, + dd: relativeTimeFormatter, + M: relativeTimeFormatter, + MM: relativeTimeFormatter, + y: relativeTimeFormatter, + yy: relativeTimeFormatter + }, + ordinal: function ordinal(n) { + return n; + }, + format: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [ב]MMMM YYYY', + LLL: 'D [ב]MMMM YYYY HH:mm', + LLLL: 'dddd, D [ב]MMMM YYYY HH:mm', + l: 'D/M/YYYY', + ll: 'D MMM YYYY', + lll: 'D MMM YYYY HH:mm', + llll: 'ddd, D MMM YYYY HH:mm' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [ב]MMMM YYYY', + LLL: 'D [ב]MMMM YYYY HH:mm', + LLLL: 'dddd, D [ב]MMMM YYYY HH:mm', + l: 'D/M/YYYY', + ll: 'D MMM YYYY', + lll: 'D MMM YYYY HH:mm', + llll: 'ddd, D MMM YYYY HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/hi.js b/node_modules/dayjs/esm/locale/hi.js new file mode 100644 index 00000000..e877ed6b --- /dev/null +++ b/node_modules/dayjs/esm/locale/hi.js @@ -0,0 +1,38 @@ +// Hindi [hi] +import dayjs from '../index'; +var locale = { + name: 'hi', + weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), + months: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'), + weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'), + monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'), + weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm बजे', + LTS: 'A h:mm:ss बजे', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm बजे', + LLLL: 'dddd, D MMMM YYYY, A h:mm बजे' + }, + relativeTime: { + future: '%s में', + past: '%s पहले', + s: 'कुछ ही क्षण', + m: 'एक मिनट', + mm: '%d मिनट', + h: 'एक घंटा', + hh: '%d घंटे', + d: 'एक दिन', + dd: '%d दिन', + M: 'एक महीने', + MM: '%d महीने', + y: 'एक वर्ष', + yy: '%d वर्ष' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/hr.js b/node_modules/dayjs/esm/locale/hr.js new file mode 100644 index 00000000..a760fe34 --- /dev/null +++ b/node_modules/dayjs/esm/locale/hr.js @@ -0,0 +1,53 @@ +// Croatian [hr] +import dayjs from '../index'; +var monthFormat = 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'); +var monthStandalone = 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'); +var MONTHS_IN_FORMAT = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/; + +var months = function months(dayjsInstance, format) { + if (MONTHS_IN_FORMAT.test(format)) { + return monthFormat[dayjsInstance.month()]; + } + + return monthStandalone[dayjsInstance.month()]; +}; + +months.s = monthStandalone; +months.f = monthFormat; +var locale = { + name: 'hr', + weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), + weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), + weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), + months: months, + monthsShort: 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'), + weekStart: 1, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd, D. MMMM YYYY H:mm' + }, + relativeTime: { + future: 'za %s', + past: 'prije %s', + s: 'sekunda', + m: 'minuta', + mm: '%d minuta', + h: 'sat', + hh: '%d sati', + d: 'dan', + dd: '%d dana', + M: 'mjesec', + MM: '%d mjeseci', + y: 'godina', + yy: '%d godine' + }, + ordinal: function ordinal(n) { + return n + "."; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ht.js b/node_modules/dayjs/esm/locale/ht.js new file mode 100644 index 00000000..896739e3 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ht.js @@ -0,0 +1,38 @@ +// Haitian Creole (Haiti) [ht] +import dayjs from '../index'; +var locale = { + name: 'ht', + weekdays: 'dimanch_lendi_madi_mèkredi_jedi_vandredi_samdi'.split('_'), + months: 'janvye_fevriye_mas_avril_me_jen_jiyè_out_septanm_oktòb_novanm_desanm'.split('_'), + weekdaysShort: 'dim._len._mad._mèk._jed._van._sam.'.split('_'), + monthsShort: 'jan._fev._mas_avr._me_jen_jiyè._out_sept._okt._nov._des.'.split('_'), + weekdaysMin: 'di_le_ma_mè_je_va_sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'nan %s', + past: 'sa gen %s', + s: 'kèk segond', + m: 'yon minit', + mm: '%d minit', + h: 'inèdtan', + hh: '%d zè', + d: 'yon jou', + dd: '%d jou', + M: 'yon mwa', + MM: '%d mwa', + y: 'yon ane', + yy: '%d ane' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/hu.js b/node_modules/dayjs/esm/locale/hu.js new file mode 100644 index 00000000..18df6e46 --- /dev/null +++ b/node_modules/dayjs/esm/locale/hu.js @@ -0,0 +1,61 @@ +// Hungarian [hu] +import dayjs from '../index'; +var locale = { + name: 'hu', + weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), + weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), + weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'), + months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'), + monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + relativeTime: { + future: '%s múlva', + past: '%s', + s: function s(_, _s, ___, isFuture) { + return "n\xE9h\xE1ny m\xE1sodperc" + (isFuture || _s ? '' : 'e'); + }, + m: function m(_, s, ___, isFuture) { + return "egy perc" + (isFuture || s ? '' : 'e'); + }, + mm: function mm(n, s, ___, isFuture) { + return n + " perc" + (isFuture || s ? '' : 'e'); + }, + h: function h(_, s, ___, isFuture) { + return "egy " + (isFuture || s ? 'óra' : 'órája'); + }, + hh: function hh(n, s, ___, isFuture) { + return n + " " + (isFuture || s ? 'óra' : 'órája'); + }, + d: function d(_, s, ___, isFuture) { + return "egy " + (isFuture || s ? 'nap' : 'napja'); + }, + dd: function dd(n, s, ___, isFuture) { + return n + " " + (isFuture || s ? 'nap' : 'napja'); + }, + M: function M(_, s, ___, isFuture) { + return "egy " + (isFuture || s ? 'hónap' : 'hónapja'); + }, + MM: function MM(n, s, ___, isFuture) { + return n + " " + (isFuture || s ? 'hónap' : 'hónapja'); + }, + y: function y(_, s, ___, isFuture) { + return "egy " + (isFuture || s ? 'év' : 'éve'); + }, + yy: function yy(n, s, ___, isFuture) { + return n + " " + (isFuture || s ? 'év' : 'éve'); + } + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'YYYY.MM.DD.', + LL: 'YYYY. MMMM D.', + LLL: 'YYYY. MMMM D. H:mm', + LLLL: 'YYYY. MMMM D., dddd H:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/hy-am.js b/node_modules/dayjs/esm/locale/hy-am.js new file mode 100644 index 00000000..937f2be5 --- /dev/null +++ b/node_modules/dayjs/esm/locale/hy-am.js @@ -0,0 +1,39 @@ +// Armenian [hy-am] +import dayjs from '../index'; +var locale = { + name: 'hy-am', + weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'), + months: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'), + weekStart: 1, + weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), + monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), + weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY թ.', + LLL: 'D MMMM YYYY թ., HH:mm', + LLLL: 'dddd, D MMMM YYYY թ., HH:mm' + }, + relativeTime: { + future: '%s հետո', + past: '%s առաջ', + s: 'մի քանի վայրկյան', + m: 'րոպե', + mm: '%d րոպե', + h: 'ժամ', + hh: '%d ժամ', + d: 'օր', + dd: '%d օր', + M: 'ամիս', + MM: '%d ամիս', + y: 'տարի', + yy: '%d տարի' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/id.js b/node_modules/dayjs/esm/locale/id.js new file mode 100644 index 00000000..f743a123 --- /dev/null +++ b/node_modules/dayjs/esm/locale/id.js @@ -0,0 +1,39 @@ +// Indonesian [id] +import dayjs from '../index'; +var locale = { + name: 'id', + weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'), + months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'), + weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'), + weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'), + weekStart: 1, + formats: { + LT: 'HH.mm', + LTS: 'HH.mm.ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY [pukul] HH.mm', + LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm' + }, + relativeTime: { + future: 'dalam %s', + past: '%s yang lalu', + s: 'beberapa detik', + m: 'semenit', + mm: '%d menit', + h: 'sejam', + hh: '%d jam', + d: 'sehari', + dd: '%d hari', + M: 'sebulan', + MM: '%d bulan', + y: 'setahun', + yy: '%d tahun' + }, + ordinal: function ordinal(n) { + return n + "."; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/index.d.ts b/node_modules/dayjs/esm/locale/index.d.ts new file mode 100644 index 00000000..beb0d36c --- /dev/null +++ b/node_modules/dayjs/esm/locale/index.d.ts @@ -0,0 +1,11 @@ +/// + +declare module 'dayjs/esm/locale/*' { + namespace locale { + interface Locale extends ILocale {} + } + + const locale: locale.Locale + + export = locale +} diff --git a/node_modules/dayjs/esm/locale/is.js b/node_modules/dayjs/esm/locale/is.js new file mode 100644 index 00000000..22d81212 --- /dev/null +++ b/node_modules/dayjs/esm/locale/is.js @@ -0,0 +1,68 @@ +// Icelandic [is] +import dayjs from '../index'; +var texts = { + s: ['nokkrar sekúndur', 'nokkrar sekúndur', 'nokkrum sekúndum'], + m: ['mínúta', 'mínútu', 'mínútu'], + mm: ['mínútur', 'mínútur', 'mínútum'], + h: ['klukkustund', 'klukkustund', 'klukkustund'], + hh: ['klukkustundir', 'klukkustundir', 'klukkustundum'], + d: ['dagur', 'dag', 'degi'], + dd: ['dagar', 'daga', 'dögum'], + M: ['mánuður', 'mánuð', 'mánuði'], + MM: ['mánuðir', 'mánuði', 'mánuðum'], + y: ['ár', 'ár', 'ári'], + yy: ['ár', 'ár', 'árum'] +}; + +function resolveTemplate(key, number, isFuture, withoutSuffix) { + var suffixIndex = isFuture ? 1 : 2; + var index = withoutSuffix ? 0 : suffixIndex; + var keyShouldBeSingular = key.length === 2 && number % 10 === 1; + var correctedKey = keyShouldBeSingular ? key[0] : key; + var unitText = texts[correctedKey]; + var text = unitText[index]; + return key.length === 1 ? text : "%d " + text; +} + +function relativeTimeFormatter(number, withoutSuffix, key, isFuture) { + var template = resolveTemplate(key, number, isFuture, withoutSuffix); + return template.replace('%d', number); +} + +var locale = { + name: 'is', + weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'), + months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'), + weekStart: 1, + weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'), + monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'), + weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY [kl.] H:mm', + LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm' + }, + relativeTime: { + future: 'eftir %s', + past: 'fyrir %s síðan', + s: relativeTimeFormatter, + m: relativeTimeFormatter, + mm: relativeTimeFormatter, + h: relativeTimeFormatter, + hh: relativeTimeFormatter, + d: relativeTimeFormatter, + dd: relativeTimeFormatter, + M: relativeTimeFormatter, + MM: relativeTimeFormatter, + y: relativeTimeFormatter, + yy: relativeTimeFormatter + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/it-ch.js b/node_modules/dayjs/esm/locale/it-ch.js new file mode 100644 index 00000000..cfbb94dd --- /dev/null +++ b/node_modules/dayjs/esm/locale/it-ch.js @@ -0,0 +1,39 @@ +// Italian (Switzerland) [it-ch] +import dayjs from '../index'; +var locale = { + name: 'it-ch', + weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'), + months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), + weekStart: 1, + weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'), + monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), + weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'tra %s', + past: '%s fa', + s: 'alcuni secondi', + m: 'un minuto', + mm: '%d minuti', + h: 'un\'ora', + hh: '%d ore', + d: 'un giorno', + dd: '%d giorni', + M: 'un mese', + MM: '%d mesi', + y: 'un anno', + yy: '%d anni' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/it.js b/node_modules/dayjs/esm/locale/it.js new file mode 100644 index 00000000..e8d24905 --- /dev/null +++ b/node_modules/dayjs/esm/locale/it.js @@ -0,0 +1,39 @@ +// Italian [it] +import dayjs from '../index'; +var locale = { + name: 'it', + weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'), + weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'), + weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'), + months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), + weekStart: 1, + monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'tra %s', + past: '%s fa', + s: 'qualche secondo', + m: 'un minuto', + mm: '%d minuti', + h: 'un\' ora', + hh: '%d ore', + d: 'un giorno', + dd: '%d giorni', + M: 'un mese', + MM: '%d mesi', + y: 'un anno', + yy: '%d anni' + }, + ordinal: function ordinal(n) { + return n + "\xBA"; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ja.js b/node_modules/dayjs/esm/locale/ja.js new file mode 100644 index 00000000..6568e139 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ja.js @@ -0,0 +1,45 @@ +// Japanese [ja] +import dayjs from '../index'; +var locale = { + name: 'ja', + weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), + weekdaysShort: '日_月_火_水_木_金_土'.split('_'), + weekdaysMin: '日_月_火_水_木_金_土'.split('_'), + months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + ordinal: function ordinal(n) { + return n + "\u65E5"; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY/MM/DD', + LL: 'YYYY年M月D日', + LLL: 'YYYY年M月D日 HH:mm', + LLLL: 'YYYY年M月D日 dddd HH:mm', + l: 'YYYY/MM/DD', + ll: 'YYYY年M月D日', + lll: 'YYYY年M月D日 HH:mm', + llll: 'YYYY年M月D日(ddd) HH:mm' + }, + meridiem: function meridiem(hour) { + return hour < 12 ? '午前' : '午後'; + }, + relativeTime: { + future: '%s後', + past: '%s前', + s: '数秒', + m: '1分', + mm: '%d分', + h: '1時間', + hh: '%d時間', + d: '1日', + dd: '%d日', + M: '1ヶ月', + MM: '%dヶ月', + y: '1年', + yy: '%d年' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/jv.js b/node_modules/dayjs/esm/locale/jv.js new file mode 100644 index 00000000..81a3f660 --- /dev/null +++ b/node_modules/dayjs/esm/locale/jv.js @@ -0,0 +1,39 @@ +// Javanese [jv] +import dayjs from '../index'; +var locale = { + name: 'jv', + weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'), + months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'), + weekStart: 1, + weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'), + monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'), + weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH.mm', + LTS: 'HH.mm.ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY [pukul] HH.mm', + LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm' + }, + relativeTime: { + future: 'wonten ing %s', + past: '%s ingkang kepengker', + s: 'sawetawis detik', + m: 'setunggal menit', + mm: '%d menit', + h: 'setunggal jam', + hh: '%d jam', + d: 'sedinten', + dd: '%d dinten', + M: 'sewulan', + MM: '%d wulan', + y: 'setaun', + yy: '%d taun' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ka.js b/node_modules/dayjs/esm/locale/ka.js new file mode 100644 index 00000000..381fffa4 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ka.js @@ -0,0 +1,39 @@ +// Georgian [ka] +import dayjs from '../index'; +var locale = { + name: 'ka', + weekdays: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), + weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), + weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), + months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), + monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), + weekStart: 1, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY h:mm A', + LLLL: 'dddd, D MMMM YYYY h:mm A' + }, + relativeTime: { + future: '%s შემდეგ', + past: '%s წინ', + s: 'წამი', + m: 'წუთი', + mm: '%d წუთი', + h: 'საათი', + hh: '%d საათის', + d: 'დღეს', + dd: '%d დღის განმავლობაში', + M: 'თვის', + MM: '%d თვის', + y: 'წელი', + yy: '%d წლის' + }, + ordinal: function ordinal(n) { + return n; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/kk.js b/node_modules/dayjs/esm/locale/kk.js new file mode 100644 index 00000000..f2ca045c --- /dev/null +++ b/node_modules/dayjs/esm/locale/kk.js @@ -0,0 +1,39 @@ +// Kazakh [kk] +import dayjs from '../index'; +var locale = { + name: 'kk', + weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'), + weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'), + weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'), + months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'), + monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'), + weekStart: 1, + relativeTime: { + future: '%s ішінде', + past: '%s бұрын', + s: 'бірнеше секунд', + m: 'бір минут', + mm: '%d минут', + h: 'бір сағат', + hh: '%d сағат', + d: 'бір күн', + dd: '%d күн', + M: 'бір ай', + MM: '%d ай', + y: 'бір жыл', + yy: '%d жыл' + }, + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/km.js b/node_modules/dayjs/esm/locale/km.js new file mode 100644 index 00000000..7fd185ba --- /dev/null +++ b/node_modules/dayjs/esm/locale/km.js @@ -0,0 +1,39 @@ +// Cambodian [km] +import dayjs from '../index'; +var locale = { + name: 'km', + weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), + months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), + weekStart: 1, + weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'), + monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), + weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: '%sទៀត', + past: '%sមុន', + s: 'ប៉ុន្មានវិនាទី', + m: 'មួយនាទី', + mm: '%d នាទី', + h: 'មួយម៉ោង', + hh: '%d ម៉ោង', + d: 'មួយថ្ងៃ', + dd: '%d ថ្ងៃ', + M: 'មួយខែ', + MM: '%d ខែ', + y: 'មួយឆ្នាំ', + yy: '%d ឆ្នាំ' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/kn.js b/node_modules/dayjs/esm/locale/kn.js new file mode 100644 index 00000000..b9ca9b90 --- /dev/null +++ b/node_modules/dayjs/esm/locale/kn.js @@ -0,0 +1,38 @@ +// Kannada [kn] +import dayjs from '../index'; +var locale = { + name: 'kn', + weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split('_'), + months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split('_'), + weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'), + monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split('_'), + weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm', + LTS: 'A h:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm', + LLLL: 'dddd, D MMMM YYYY, A h:mm' + }, + relativeTime: { + future: '%s ನಂತರ', + past: '%s ಹಿಂದೆ', + s: 'ಕೆಲವು ಕ್ಷಣಗಳು', + m: 'ಒಂದು ನಿಮಿಷ', + mm: '%d ನಿಮಿಷ', + h: 'ಒಂದು ಗಂಟೆ', + hh: '%d ಗಂಟೆ', + d: 'ಒಂದು ದಿನ', + dd: '%d ದಿನ', + M: 'ಒಂದು ತಿಂಗಳು', + MM: '%d ತಿಂಗಳು', + y: 'ಒಂದು ವರ್ಷ', + yy: '%d ವರ್ಷ' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ko.js b/node_modules/dayjs/esm/locale/ko.js new file mode 100644 index 00000000..cfad49de --- /dev/null +++ b/node_modules/dayjs/esm/locale/ko.js @@ -0,0 +1,45 @@ +// Korean [ko] +import dayjs from '../index'; +var locale = { + name: 'ko', + weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'), + weekdaysShort: '일_월_화_수_목_금_토'.split('_'), + weekdaysMin: '일_월_화_수_목_금_토'.split('_'), + months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), + monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), + ordinal: function ordinal(n) { + return n + "\uC77C"; + }, + formats: { + LT: 'A h:mm', + LTS: 'A h:mm:ss', + L: 'YYYY.MM.DD.', + LL: 'YYYY년 MMMM D일', + LLL: 'YYYY년 MMMM D일 A h:mm', + LLLL: 'YYYY년 MMMM D일 dddd A h:mm', + l: 'YYYY.MM.DD.', + ll: 'YYYY년 MMMM D일', + lll: 'YYYY년 MMMM D일 A h:mm', + llll: 'YYYY년 MMMM D일 dddd A h:mm' + }, + meridiem: function meridiem(hour) { + return hour < 12 ? '오전' : '오후'; + }, + relativeTime: { + future: '%s 후', + past: '%s 전', + s: '몇 초', + m: '1분', + mm: '%d분', + h: '한 시간', + hh: '%d시간', + d: '하루', + dd: '%d일', + M: '한 달', + MM: '%d달', + y: '일 년', + yy: '%d년' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ku.js b/node_modules/dayjs/esm/locale/ku.js new file mode 100644 index 00000000..e56664eb --- /dev/null +++ b/node_modules/dayjs/esm/locale/ku.js @@ -0,0 +1,77 @@ +// Kurdish [ku] +import dayjs from '../index'; +export var englishToArabicNumbersMap = { + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠' +}; +var arabicToEnglishNumbersMap = { + '١': '1', + '٢': '2', + '٣': '3', + '٤': '4', + '٥': '5', + '٦': '6', + '٧': '7', + '٨': '8', + '٩': '9', + '٠': '0' +}; +var months = ['کانوونی دووەم', 'شوبات', 'ئادار', 'نیسان', 'ئایار', 'حوزەیران', 'تەممووز', 'ئاب', 'ئەیلوول', 'تشرینی یەکەم', 'تشرینی دووەم', 'کانوونی یەکەم']; +var locale = { + name: 'ku', + months: months, + monthsShort: months, + weekdays: 'یەکشەممە_دووشەممە_سێشەممە_چوارشەممە_پێنجشەممە_هەینی_شەممە'.split('_'), + weekdaysShort: 'یەکشەم_دووشەم_سێشەم_چوارشەم_پێنجشەم_هەینی_شەممە'.split('_'), + weekStart: 6, + weekdaysMin: 'ی_د_س_چ_پ_هـ_ش'.split('_'), + preparse: function preparse(string) { + return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { + return arabicToEnglishNumbersMap[match]; + }).replace(/،/g, ','); + }, + postformat: function postformat(string) { + return string.replace(/\d/g, function (match) { + return englishToArabicNumbersMap[match]; + }).replace(/,/g, '،'); + }, + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + meridiem: function meridiem(hour) { + return hour < 12 ? 'پ.ن' : 'د.ن'; + }, + relativeTime: { + future: 'لە %s', + past: 'لەمەوپێش %s', + s: 'چەند چرکەیەک', + m: 'یەک خولەک', + mm: '%d خولەک', + h: 'یەک کاتژمێر', + hh: '%d کاتژمێر', + d: 'یەک ڕۆژ', + dd: '%d ڕۆژ', + M: 'یەک مانگ', + MM: '%d مانگ', + y: 'یەک ساڵ', + yy: '%d ساڵ' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ky.js b/node_modules/dayjs/esm/locale/ky.js new file mode 100644 index 00000000..fd044778 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ky.js @@ -0,0 +1,39 @@ +// Kyrgyz [ky] +import dayjs from '../index'; +var locale = { + name: 'ky', + weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'), + months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), + weekStart: 1, + weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'), + monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), + weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: '%s ичинде', + past: '%s мурун', + s: 'бирнече секунд', + m: 'бир мүнөт', + mm: '%d мүнөт', + h: 'бир саат', + hh: '%d саат', + d: 'бир күн', + dd: '%d күн', + M: 'бир ай', + MM: '%d ай', + y: 'бир жыл', + yy: '%d жыл' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/lb.js b/node_modules/dayjs/esm/locale/lb.js new file mode 100644 index 00000000..21ef4aab --- /dev/null +++ b/node_modules/dayjs/esm/locale/lb.js @@ -0,0 +1,24 @@ +// Luxembourgish [lb] +import dayjs from '../index'; +var locale = { + name: 'lb', + weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'), + months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), + weekStart: 1, + weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'), + monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), + weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'H:mm [Auer]', + LTS: 'H:mm:ss [Auer]', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm [Auer]', + LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/lo.js b/node_modules/dayjs/esm/locale/lo.js new file mode 100644 index 00000000..7732ec4b --- /dev/null +++ b/node_modules/dayjs/esm/locale/lo.js @@ -0,0 +1,38 @@ +// Lao [lo] +import dayjs from '../index'; +var locale = { + name: 'lo', + weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), + monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), + weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'ວັນdddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'ອີກ %s', + past: '%sຜ່ານມາ', + s: 'ບໍ່ເທົ່າໃດວິນາທີ', + m: '1 ນາທີ', + mm: '%d ນາທີ', + h: '1 ຊົ່ວໂມງ', + hh: '%d ຊົ່ວໂມງ', + d: '1 ມື້', + dd: '%d ມື້', + M: '1 ເດືອນ', + MM: '%d ເດືອນ', + y: '1 ປີ', + yy: '%d ປີ' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/lt.js b/node_modules/dayjs/esm/locale/lt.js new file mode 100644 index 00000000..cb46ca9b --- /dev/null +++ b/node_modules/dayjs/esm/locale/lt.js @@ -0,0 +1,70 @@ +// Lithuanian [lt] +import dayjs from '../index'; +var monthFormat = 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'); +var monthStandalone = 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'); // eslint-disable-next-line no-useless-escape + +var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/; + +var months = function months(dayjsInstance, format) { + if (MONTHS_IN_FORMAT.test(format)) { + return monthFormat[dayjsInstance.month()]; + } + + return monthStandalone[dayjsInstance.month()]; +}; + +months.s = monthStandalone; +months.f = monthFormat; +var locale = { + name: 'lt', + weekdays: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'), + weekdaysShort: 'sek_pir_ant_tre_ket_pen_šeš'.split('_'), + weekdaysMin: 's_p_a_t_k_pn_š'.split('_'), + months: months, + monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + relativeTime: { + future: 'už %s', + past: 'prieš %s', + s: 'kelias sekundes', + m: 'minutę', + mm: '%d minutes', + h: 'valandą', + hh: '%d valandas', + d: 'dieną', + dd: '%d dienas', + M: 'mėnesį', + MM: '%d mėnesius', + y: 'metus', + yy: '%d metus' + }, + format: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'YYYY [m.] MMMM D [d.]', + LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]', + LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]', + l: 'YYYY-MM-DD', + ll: 'YYYY [m.] MMMM D [d.]', + lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]', + llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'YYYY [m.] MMMM D [d.]', + LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]', + LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]', + l: 'YYYY-MM-DD', + ll: 'YYYY [m.] MMMM D [d.]', + lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]', + llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/lv.js b/node_modules/dayjs/esm/locale/lv.js new file mode 100644 index 00000000..4b18a614 --- /dev/null +++ b/node_modules/dayjs/esm/locale/lv.js @@ -0,0 +1,39 @@ +// Latvian [lv] +import dayjs from '../index'; +var locale = { + name: 'lv', + weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'), + months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'), + weekStart: 1, + weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'), + monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'), + weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY.', + LL: 'YYYY. [gada] D. MMMM', + LLL: 'YYYY. [gada] D. MMMM, HH:mm', + LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm' + }, + relativeTime: { + future: 'pēc %s', + past: 'pirms %s', + s: 'dažām sekundēm', + m: 'minūtes', + mm: '%d minūtēm', + h: 'stundas', + hh: '%d stundām', + d: 'dienas', + dd: '%d dienām', + M: 'mēneša', + MM: '%d mēnešiem', + y: 'gada', + yy: '%d gadiem' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/me.js b/node_modules/dayjs/esm/locale/me.js new file mode 100644 index 00000000..465c0ff0 --- /dev/null +++ b/node_modules/dayjs/esm/locale/me.js @@ -0,0 +1,24 @@ +// Montenegrin [me] +import dayjs from '../index'; +var locale = { + name: 'me', + weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), + months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'), + weekStart: 1, + weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), + monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'), + weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd, D. MMMM YYYY H:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/mi.js b/node_modules/dayjs/esm/locale/mi.js new file mode 100644 index 00000000..3b56f0ec --- /dev/null +++ b/node_modules/dayjs/esm/locale/mi.js @@ -0,0 +1,39 @@ +// Maori [mi] +import dayjs from '../index'; +var locale = { + name: 'mi', + weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'), + months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'), + weekStart: 1, + weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'), + monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'), + weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY [i] HH:mm', + LLLL: 'dddd, D MMMM YYYY [i] HH:mm' + }, + relativeTime: { + future: 'i roto i %s', + past: '%s i mua', + s: 'te hēkona ruarua', + m: 'he meneti', + mm: '%d meneti', + h: 'te haora', + hh: '%d haora', + d: 'he ra', + dd: '%d ra', + M: 'he marama', + MM: '%d marama', + y: 'he tau', + yy: '%d tau' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/mk.js b/node_modules/dayjs/esm/locale/mk.js new file mode 100644 index 00000000..8522c261 --- /dev/null +++ b/node_modules/dayjs/esm/locale/mk.js @@ -0,0 +1,39 @@ +// Macedonian [mk] +import dayjs from '../index'; +var locale = { + name: 'mk', + weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'), + months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'), + weekStart: 1, + weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'), + monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'), + weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'D.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY H:mm', + LLLL: 'dddd, D MMMM YYYY H:mm' + }, + relativeTime: { + future: 'после %s', + past: 'пред %s', + s: 'неколку секунди', + m: 'минута', + mm: '%d минути', + h: 'час', + hh: '%d часа', + d: 'ден', + dd: '%d дена', + M: 'месец', + MM: '%d месеци', + y: 'година', + yy: '%d години' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ml.js b/node_modules/dayjs/esm/locale/ml.js new file mode 100644 index 00000000..bfcc277e --- /dev/null +++ b/node_modules/dayjs/esm/locale/ml.js @@ -0,0 +1,38 @@ +// Malayalam [ml] +import dayjs from '../index'; +var locale = { + name: 'ml', + weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'), + months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'), + weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'), + monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'), + weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm -നു', + LTS: 'A h:mm:ss -നു', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm -നു', + LLLL: 'dddd, D MMMM YYYY, A h:mm -നു' + }, + relativeTime: { + future: '%s കഴിഞ്ഞ്', + past: '%s മുൻപ്', + s: 'അൽപ നിമിഷങ്ങൾ', + m: 'ഒരു മിനിറ്റ്', + mm: '%d മിനിറ്റ്', + h: 'ഒരു മണിക്കൂർ', + hh: '%d മണിക്കൂർ', + d: 'ഒരു ദിവസം', + dd: '%d ദിവസം', + M: 'ഒരു മാസം', + MM: '%d മാസം', + y: 'ഒരു വർഷം', + yy: '%d വർഷം' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/mn.js b/node_modules/dayjs/esm/locale/mn.js new file mode 100644 index 00000000..d93cae21 --- /dev/null +++ b/node_modules/dayjs/esm/locale/mn.js @@ -0,0 +1,38 @@ +// Mongolian [mn] +import dayjs from '../index'; +var locale = { + name: 'mn', + weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'), + months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split('_'), + weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'), + monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split('_'), + weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'YYYY оны MMMMын D', + LLL: 'YYYY оны MMMMын D HH:mm', + LLLL: 'dddd, YYYY оны MMMMын D HH:mm' + }, + relativeTime: { + future: '%s', + past: '%s', + s: 'саяхан', + m: 'м', + mm: '%dм', + h: '1ц', + hh: '%dц', + d: '1ө', + dd: '%dө', + M: '1с', + MM: '%dс', + y: '1ж', + yy: '%dж' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/mr.js b/node_modules/dayjs/esm/locale/mr.js new file mode 100644 index 00000000..9eac8a73 --- /dev/null +++ b/node_modules/dayjs/esm/locale/mr.js @@ -0,0 +1,23 @@ +// Marathi [mr] +import dayjs from '../index'; +var locale = { + name: 'mr', + weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), + months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'), + weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'), + monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'), + weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm वाजता', + LTS: 'A h:mm:ss वाजता', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm वाजता', + LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ms-my.js b/node_modules/dayjs/esm/locale/ms-my.js new file mode 100644 index 00000000..51382197 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ms-my.js @@ -0,0 +1,39 @@ +// Malay [ms-my] +import dayjs from '../index'; +var locale = { + name: 'ms-my', + weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), + months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), + weekStart: 1, + weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), + monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), + weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH.mm', + LTS: 'HH.mm.ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY [pukul] HH.mm', + LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm' + }, + relativeTime: { + future: 'dalam %s', + past: '%s yang lepas', + s: 'beberapa saat', + m: 'seminit', + mm: '%d minit', + h: 'sejam', + hh: '%d jam', + d: 'sehari', + dd: '%d hari', + M: 'sebulan', + MM: '%d bulan', + y: 'setahun', + yy: '%d tahun' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ms.js b/node_modules/dayjs/esm/locale/ms.js new file mode 100644 index 00000000..86349f3f --- /dev/null +++ b/node_modules/dayjs/esm/locale/ms.js @@ -0,0 +1,39 @@ +// Malay [ms] +import dayjs from '../index'; +var locale = { + name: 'ms', + weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), + weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), + weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), + months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), + monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), + weekStart: 1, + formats: { + LT: 'HH.mm', + LTS: 'HH.mm.ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH.mm', + LLLL: 'dddd, D MMMM YYYY HH.mm' + }, + relativeTime: { + future: 'dalam %s', + past: '%s yang lepas', + s: 'beberapa saat', + m: 'seminit', + mm: '%d minit', + h: 'sejam', + hh: '%d jam', + d: 'sehari', + dd: '%d hari', + M: 'sebulan', + MM: '%d bulan', + y: 'setahun', + yy: '%d tahun' + }, + ordinal: function ordinal(n) { + return n + "."; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/mt.js b/node_modules/dayjs/esm/locale/mt.js new file mode 100644 index 00000000..9c909538 --- /dev/null +++ b/node_modules/dayjs/esm/locale/mt.js @@ -0,0 +1,39 @@ +// Maltese (Malta) [mt] +import dayjs from '../index'; +var locale = { + name: 'mt', + weekdays: 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split('_'), + months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split('_'), + weekStart: 1, + weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'), + monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'), + weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'f’ %s', + past: '%s ilu', + s: 'ftit sekondi', + m: 'minuta', + mm: '%d minuti', + h: 'siegħa', + hh: '%d siegħat', + d: 'ġurnata', + dd: '%d ġranet', + M: 'xahar', + MM: '%d xhur', + y: 'sena', + yy: '%d sni' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/my.js b/node_modules/dayjs/esm/locale/my.js new file mode 100644 index 00000000..73b26333 --- /dev/null +++ b/node_modules/dayjs/esm/locale/my.js @@ -0,0 +1,39 @@ +// Burmese [my] +import dayjs from '../index'; +var locale = { + name: 'my', + weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'), + months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'), + weekStart: 1, + weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'), + monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'), + weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'လာမည့် %s မှာ', + past: 'လွန်ခဲ့သော %s က', + s: 'စက္ကန်.အနည်းငယ်', + m: 'တစ်မိနစ်', + mm: '%d မိနစ်', + h: 'တစ်နာရီ', + hh: '%d နာရီ', + d: 'တစ်ရက်', + dd: '%d ရက်', + M: 'တစ်လ', + MM: '%d လ', + y: 'တစ်နှစ်', + yy: '%d နှစ်' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/nb.js b/node_modules/dayjs/esm/locale/nb.js new file mode 100644 index 00000000..1d7b1eb5 --- /dev/null +++ b/node_modules/dayjs/esm/locale/nb.js @@ -0,0 +1,40 @@ +// Norwegian Bokmål [nb] +import dayjs from '../index'; +var locale = { + name: 'nb', + weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), + weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'), + weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'), + months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), + monthsShort: 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + yearStart: 4, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY [kl.] HH:mm', + LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm' + }, + relativeTime: { + future: 'om %s', + past: '%s siden', + s: 'noen sekunder', + m: 'ett minutt', + mm: '%d minutter', + h: 'en time', + hh: '%d timer', + d: 'en dag', + dd: '%d dager', + M: 'en måned', + MM: '%d måneder', + y: 'ett år', + yy: '%d år' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ne.js b/node_modules/dayjs/esm/locale/ne.js new file mode 100644 index 00000000..4f5a0044 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ne.js @@ -0,0 +1,40 @@ +// Nepalese [ne] +import dayjs from '../index'; +var locale = { + name: 'ne', + weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), + weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), + weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'), + months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'), + monthsShort: 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'), + relativeTime: { + future: '%s पछि', + past: '%s अघि', + s: 'सेकेन्ड', + m: 'एक मिनेट', + mm: '%d मिनेट', + h: 'घन्टा', + hh: '%d घन्टा', + d: 'एक दिन', + dd: '%d दिन', + M: 'एक महिना', + MM: '%d महिना', + y: 'एक वर्ष', + yy: '%d वर्ष' + }, + ordinal: function ordinal(n) { + return ("" + n).replace(/\d/g, function (i) { + return '०१२३४५६७८९'[i]; + }); + }, + formats: { + LT: 'Aको h:mm बजे', + LTS: 'Aको h:mm:ss बजे', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, Aको h:mm बजे', + LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/nl-be.js b/node_modules/dayjs/esm/locale/nl-be.js new file mode 100644 index 00000000..51465b71 --- /dev/null +++ b/node_modules/dayjs/esm/locale/nl-be.js @@ -0,0 +1,39 @@ +// Dutch (Belgium) [nl-be] +import dayjs from '../index'; +var locale = { + name: 'nl-be', + weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), + months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), + monthsShort: 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), + weekStart: 1, + weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'), + weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'over %s', + past: '%s geleden', + s: 'een paar seconden', + m: 'één minuut', + mm: '%d minuten', + h: 'één uur', + hh: '%d uur', + d: 'één dag', + dd: '%d dagen', + M: 'één maand', + MM: '%d maanden', + y: 'één jaar', + yy: '%d jaar' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/nl.js b/node_modules/dayjs/esm/locale/nl.js new file mode 100644 index 00000000..ee1ac747 --- /dev/null +++ b/node_modules/dayjs/esm/locale/nl.js @@ -0,0 +1,40 @@ +// Dutch [nl] +import dayjs from '../index'; +var locale = { + name: 'nl', + weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), + weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'), + weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), + months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), + monthsShort: 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'), + ordinal: function ordinal(n) { + return "[" + n + (n === 1 || n === 8 || n >= 20 ? 'ste' : 'de') + "]"; + }, + weekStart: 1, + yearStart: 4, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD-MM-YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'over %s', + past: '%s geleden', + s: 'een paar seconden', + m: 'een minuut', + mm: '%d minuten', + h: 'een uur', + hh: '%d uur', + d: 'een dag', + dd: '%d dagen', + M: 'een maand', + MM: '%d maanden', + y: 'een jaar', + yy: '%d jaar' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/nn.js b/node_modules/dayjs/esm/locale/nn.js new file mode 100644 index 00000000..43767a40 --- /dev/null +++ b/node_modules/dayjs/esm/locale/nn.js @@ -0,0 +1,39 @@ +// Nynorsk [nn] +import dayjs from '../index'; +var locale = { + name: 'nn', + weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'), + weekdaysShort: 'sun_mån_tys_ons_tor_fre_lau'.split('_'), + weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'), + months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), + monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + relativeTime: { + future: 'om %s', + past: 'for %s sidan', + s: 'nokre sekund', + m: 'eitt minutt', + mm: '%d minutt', + h: 'ein time', + hh: '%d timar', + d: 'ein dag', + dd: '%d dagar', + M: 'ein månad', + MM: '%d månadar', + y: 'eitt år', + yy: '%d år' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY [kl.] H:mm', + LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/oc-lnc.js b/node_modules/dayjs/esm/locale/oc-lnc.js new file mode 100644 index 00000000..91e2f0d3 --- /dev/null +++ b/node_modules/dayjs/esm/locale/oc-lnc.js @@ -0,0 +1,39 @@ +// Occitan, lengadocian dialecte [oc-lnc] +import dayjs from '../index'; +var locale = { + name: 'oc-lnc', + weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split('_'), + weekdaysShort: 'Dg_Dl_Dm_Dc_Dj_Dv_Ds'.split('_'), + weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'), + months: 'genièr_febrièr_març_abrial_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split('_'), + monthsShort: 'gen_feb_març_abr_mai_junh_julh_ago_set_oct_nov_dec'.split('_'), + weekStart: 1, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM [de] YYYY', + LLL: 'D MMMM [de] YYYY [a] H:mm', + LLLL: 'dddd D MMMM [de] YYYY [a] H:mm' + }, + relativeTime: { + future: 'd\'aquí %s', + past: 'fa %s', + s: 'unas segondas', + m: 'una minuta', + mm: '%d minutas', + h: 'una ora', + hh: '%d oras', + d: 'un jorn', + dd: '%d jorns', + M: 'un mes', + MM: '%d meses', + y: 'un an', + yy: '%d ans' + }, + ordinal: function ordinal(n) { + return n + "\xBA"; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/pa-in.js b/node_modules/dayjs/esm/locale/pa-in.js new file mode 100644 index 00000000..624a8522 --- /dev/null +++ b/node_modules/dayjs/esm/locale/pa-in.js @@ -0,0 +1,38 @@ +// Punjabi (India) [pa-in] +import dayjs from '../index'; +var locale = { + name: 'pa-in', + weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'), + months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm ਵਜੇ', + LTS: 'A h:mm:ss ਵਜੇ', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm ਵਜੇ', + LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ' + }, + relativeTime: { + future: '%s ਵਿੱਚ', + past: '%s ਪਿਛਲੇ', + s: 'ਕੁਝ ਸਕਿੰਟ', + m: 'ਇਕ ਮਿੰਟ', + mm: '%d ਮਿੰਟ', + h: 'ਇੱਕ ਘੰਟਾ', + hh: '%d ਘੰਟੇ', + d: 'ਇੱਕ ਦਿਨ', + dd: '%d ਦਿਨ', + M: 'ਇੱਕ ਮਹੀਨਾ', + MM: '%d ਮਹੀਨੇ', + y: 'ਇੱਕ ਸਾਲ', + yy: '%d ਸਾਲ' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/pl.js b/node_modules/dayjs/esm/locale/pl.js new file mode 100644 index 00000000..368b2a5e --- /dev/null +++ b/node_modules/dayjs/esm/locale/pl.js @@ -0,0 +1,87 @@ +// Polish [pl] +import dayjs from '../index'; + +function plural(n) { + return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1; // eslint-disable-line +} +/* eslint-disable */ + + +function translate(number, withoutSuffix, key) { + var result = number + " "; + + switch (key) { + case 'm': + return withoutSuffix ? 'minuta' : 'minutę'; + + case 'mm': + return result + (plural(number) ? 'minuty' : 'minut'); + + case 'h': + return withoutSuffix ? 'godzina' : 'godzinę'; + + case 'hh': + return result + (plural(number) ? 'godziny' : 'godzin'); + + case 'MM': + return result + (plural(number) ? 'miesiące' : 'miesięcy'); + + case 'yy': + return result + (plural(number) ? 'lata' : 'lat'); + } +} +/* eslint-enable */ + + +var monthFormat = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_'); +var monthStandalone = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'); +var MONTHS_IN_FORMAT = /D MMMM/; + +var months = function months(dayjsInstance, format) { + if (MONTHS_IN_FORMAT.test(format)) { + return monthFormat[dayjsInstance.month()]; + } + + return monthStandalone[dayjsInstance.month()]; +}; + +months.s = monthStandalone; +months.f = monthFormat; +var locale = { + name: 'pl', + weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), + weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'), + weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), + months: months, + monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + weekStart: 1, + yearStart: 4, + relativeTime: { + future: 'za %s', + past: '%s temu', + s: 'kilka sekund', + m: translate, + mm: translate, + h: translate, + hh: translate, + d: '1 dzień', + dd: '%d dni', + M: 'miesiąc', + MM: translate, + y: 'rok', + yy: translate + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/pt-br.js b/node_modules/dayjs/esm/locale/pt-br.js new file mode 100644 index 00000000..0635cd85 --- /dev/null +++ b/node_modules/dayjs/esm/locale/pt-br.js @@ -0,0 +1,38 @@ +// Portuguese (Brazil) [pt-br] +import dayjs from '../index'; +var locale = { + name: 'pt-br', + weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'), + weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'), + weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'), + months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'), + monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), + ordinal: function ordinal(n) { + return n + "\xBA"; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY [às] HH:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm' + }, + relativeTime: { + future: 'em %s', + past: 'há %s', + s: 'poucos segundos', + m: 'um minuto', + mm: '%d minutos', + h: 'uma hora', + hh: '%d horas', + d: 'um dia', + dd: '%d dias', + M: 'um mês', + MM: '%d meses', + y: 'um ano', + yy: '%d anos' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/pt.js b/node_modules/dayjs/esm/locale/pt.js new file mode 100644 index 00000000..cba23319 --- /dev/null +++ b/node_modules/dayjs/esm/locale/pt.js @@ -0,0 +1,40 @@ +// Portuguese [pt] +import dayjs from '../index'; +var locale = { + name: 'pt', + weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'), + weekdaysShort: 'dom_seg_ter_qua_qui_sex_sab'.split('_'), + weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sa'.split('_'), + months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'), + monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), + ordinal: function ordinal(n) { + return n + "\xBA"; + }, + weekStart: 1, + yearStart: 4, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY [às] HH:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm' + }, + relativeTime: { + future: 'em %s', + past: 'há %s', + s: 'alguns segundos', + m: 'um minuto', + mm: '%d minutos', + h: 'uma hora', + hh: '%d horas', + d: 'um dia', + dd: '%d dias', + M: 'um mês', + MM: '%d meses', + y: 'um ano', + yy: '%d anos' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/rn.js b/node_modules/dayjs/esm/locale/rn.js new file mode 100644 index 00000000..21b3cdb7 --- /dev/null +++ b/node_modules/dayjs/esm/locale/rn.js @@ -0,0 +1,39 @@ +// Kirundi [rn] +import dayjs from '../index'; +var locale = { + name: 'rn', + weekdays: 'Ku wa Mungu_Ku wa Mbere_Ku wa Kabiri_Ku wa Gatatu_Ku wa Kane_Ku wa Gatanu_Ku wa Gatandatu'.split('_'), + weekdaysShort: 'Kngu_Kmbr_Kbri_Ktat_Kkan_Ktan_Kdat'.split('_'), + weekdaysMin: 'K7_K1_K2_K3_K4_K5_K6'.split('_'), + months: 'Nzero_Ruhuhuma_Ntwarante_Ndamukiza_Rusama_Ruhenshi_Mukakaro_Myandagaro_Nyakanga_Gitugutu_Munyonyo_Kigarama'.split('_'), + monthsShort: 'Nzer_Ruhuh_Ntwar_Ndam_Rus_Ruhen_Muk_Myand_Nyak_Git_Muny_Kig'.split('_'), + weekStart: 1, + ordinal: function ordinal(n) { + return n; + }, + relativeTime: { + future: 'mu %s', + past: '%s', + s: 'amasegonda', + m: 'Umunota', + mm: '%d iminota', + h: 'isaha', + hh: '%d amasaha', + d: 'Umunsi', + dd: '%d iminsi', + M: 'ukwezi', + MM: '%d amezi', + y: 'umwaka', + yy: '%d imyaka' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ro.js b/node_modules/dayjs/esm/locale/ro.js new file mode 100644 index 00000000..93ef6bfc --- /dev/null +++ b/node_modules/dayjs/esm/locale/ro.js @@ -0,0 +1,39 @@ +// Romanian [ro] +import dayjs from '../index'; +var locale = { + name: 'ro', + weekdays: 'Duminică_Luni_Marți_Miercuri_Joi_Vineri_Sâmbătă'.split('_'), + weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'), + weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'), + months: 'Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie'.split('_'), + monthsShort: 'Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.'.split('_'), + weekStart: 1, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY H:mm', + LLLL: 'dddd, D MMMM YYYY H:mm' + }, + relativeTime: { + future: 'peste %s', + past: 'acum %s', + s: 'câteva secunde', + m: 'un minut', + mm: '%d minute', + h: 'o oră', + hh: '%d ore', + d: 'o zi', + dd: '%d zile', + M: 'o lună', + MM: '%d luni', + y: 'un an', + yy: '%d ani' + }, + ordinal: function ordinal(n) { + return n; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ru.js b/node_modules/dayjs/esm/locale/ru.js new file mode 100644 index 00000000..fbb1b358 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ru.js @@ -0,0 +1,99 @@ +// Russian [ru] +import dayjs from '../index'; +var monthFormat = 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'); +var monthStandalone = 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'); +var monthShortFormat = 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'); +var monthShortStandalone = 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_'); +var MONTHS_IN_FORMAT = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/; + +function plural(word, num) { + var forms = word.split('_'); + return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; // eslint-disable-line +} + +function relativeTimeWithPlural(number, withoutSuffix, key) { + var format = { + mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', + hh: 'час_часа_часов', + dd: 'день_дня_дней', + MM: 'месяц_месяца_месяцев', + yy: 'год_года_лет' + }; + + if (key === 'm') { + return withoutSuffix ? 'минута' : 'минуту'; + } + + return number + " " + plural(format[key], +number); +} + +var months = function months(dayjsInstance, format) { + if (MONTHS_IN_FORMAT.test(format)) { + return monthFormat[dayjsInstance.month()]; + } + + return monthStandalone[dayjsInstance.month()]; +}; + +months.s = monthStandalone; +months.f = monthFormat; + +var monthsShort = function monthsShort(dayjsInstance, format) { + if (MONTHS_IN_FORMAT.test(format)) { + return monthShortFormat[dayjsInstance.month()]; + } + + return monthShortStandalone[dayjsInstance.month()]; +}; + +monthsShort.s = monthShortStandalone; +monthsShort.f = monthShortFormat; +var locale = { + name: 'ru', + weekdays: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), + weekdaysShort: 'вск_пнд_втр_срд_чтв_птн_сбт'.split('_'), + weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + months: months, + monthsShort: monthsShort, + weekStart: 1, + yearStart: 4, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY г.', + LLL: 'D MMMM YYYY г., H:mm', + LLLL: 'dddd, D MMMM YYYY г., H:mm' + }, + relativeTime: { + future: 'через %s', + past: '%s назад', + s: 'несколько секунд', + m: relativeTimeWithPlural, + mm: relativeTimeWithPlural, + h: 'час', + hh: relativeTimeWithPlural, + d: 'день', + dd: relativeTimeWithPlural, + M: 'месяц', + MM: relativeTimeWithPlural, + y: 'год', + yy: relativeTimeWithPlural + }, + ordinal: function ordinal(n) { + return n; + }, + meridiem: function meridiem(hour) { + if (hour < 4) { + return 'ночи'; + } else if (hour < 12) { + return 'утра'; + } else if (hour < 17) { + return 'дня'; + } + + return 'вечера'; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/rw.js b/node_modules/dayjs/esm/locale/rw.js new file mode 100644 index 00000000..1e53ac76 --- /dev/null +++ b/node_modules/dayjs/esm/locale/rw.js @@ -0,0 +1,35 @@ +// Kinyarwanda (Rwanda) [rw] +import dayjs from '../index'; +var locale = { + name: 'rw', + weekdays: 'Ku Cyumweru_Kuwa Mbere_Kuwa Kabiri_Kuwa Gatatu_Kuwa Kane_Kuwa Gatanu_Kuwa Gatandatu'.split('_'), + months: 'Mutarama_Gashyantare_Werurwe_Mata_Gicurasi_Kamena_Nyakanga_Kanama_Nzeri_Ukwakira_Ugushyingo_Ukuboza'.split('_'), + relativeTime: { + future: 'mu %s', + past: '%s', + s: 'amasegonda', + m: 'Umunota', + mm: '%d iminota', + h: 'isaha', + hh: '%d amasaha', + d: 'Umunsi', + dd: '%d iminsi', + M: 'ukwezi', + MM: '%d amezi', + y: 'umwaka', + yy: '%d imyaka' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + ordinal: function ordinal(n) { + return n; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sd.js b/node_modules/dayjs/esm/locale/sd.js new file mode 100644 index 00000000..a429f8db --- /dev/null +++ b/node_modules/dayjs/esm/locale/sd.js @@ -0,0 +1,39 @@ +// Sindhi [sd] +import dayjs from '../index'; +var locale = { + name: 'sd', + weekdays: 'آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر'.split('_'), + months: 'جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر'.split('_'), + weekStart: 1, + weekdaysShort: 'آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر'.split('_'), + monthsShort: 'جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر'.split('_'), + weekdaysMin: 'آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd، D MMMM YYYY HH:mm' + }, + relativeTime: { + future: '%s پوء', + past: '%s اڳ', + s: 'چند سيڪنڊ', + m: 'هڪ منٽ', + mm: '%d منٽ', + h: 'هڪ ڪلاڪ', + hh: '%d ڪلاڪ', + d: 'هڪ ڏينهن', + dd: '%d ڏينهن', + M: 'هڪ مهينو', + MM: '%d مهينا', + y: 'هڪ سال', + yy: '%d سال' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/se.js b/node_modules/dayjs/esm/locale/se.js new file mode 100644 index 00000000..691099ce --- /dev/null +++ b/node_modules/dayjs/esm/locale/se.js @@ -0,0 +1,39 @@ +// Northern Sami [se] +import dayjs from '../index'; +var locale = { + name: 'se', + weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'), + months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'), + weekStart: 1, + weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'), + monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'), + weekdaysMin: 's_v_m_g_d_b_L'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'MMMM D. [b.] YYYY', + LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm', + LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm' + }, + relativeTime: { + future: '%s geažes', + past: 'maŋit %s', + s: 'moadde sekunddat', + m: 'okta minuhta', + mm: '%d minuhtat', + h: 'okta diimmu', + hh: '%d diimmut', + d: 'okta beaivi', + dd: '%d beaivvit', + M: 'okta mánnu', + MM: '%d mánut', + y: 'okta jahki', + yy: '%d jagit' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/si.js b/node_modules/dayjs/esm/locale/si.js new file mode 100644 index 00000000..89b67bfd --- /dev/null +++ b/node_modules/dayjs/esm/locale/si.js @@ -0,0 +1,38 @@ +// Sinhalese [si] +import dayjs from '../index'; +var locale = { + name: 'si', + weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'), + months: 'දුරුතු_නවම්_මැදින්_බක්_වෙසක්_පොසොන්_ඇසළ_නිකිණි_බිනර_වප්_ඉල්_උඳුවප්'.split('_'), + weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'), + monthsShort: 'දුරු_නව_මැදි_බක්_වෙස_පොසො_ඇස_නිකි_බින_වප්_ඉල්_උඳු'.split('_'), + weekdaysMin: 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'a h:mm', + LTS: 'a h:mm:ss', + L: 'YYYY/MM/DD', + LL: 'YYYY MMMM D', + LLL: 'YYYY MMMM D, a h:mm', + LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss' + }, + relativeTime: { + future: '%sකින්', + past: '%sකට පෙර', + s: 'තත්පර කිහිපය', + m: 'විනාඩිය', + mm: 'විනාඩි %d', + h: 'පැය', + hh: 'පැය %d', + d: 'දිනය', + dd: 'දින %d', + M: 'මාසය', + MM: 'මාස %d', + y: 'වසර', + yy: 'වසර %d' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sk.js b/node_modules/dayjs/esm/locale/sk.js new file mode 100644 index 00000000..222401fd --- /dev/null +++ b/node_modules/dayjs/esm/locale/sk.js @@ -0,0 +1,121 @@ +// Slovak [sk] +import dayjs from '../index'; + +function plural(n) { + return n > 1 && n < 5 && ~~(n / 10) !== 1; // eslint-disable-line +} +/* eslint-disable */ + + +function translate(number, withoutSuffix, key, isFuture) { + var result = number + " "; + + switch (key) { + case 's': + // a few seconds / in a few seconds / a few seconds ago + return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami'; + + case 'm': + // a minute / in a minute / a minute ago + return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou'; + + case 'mm': + // 9 minutes / in 9 minutes / 9 minutes ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'minúty' : 'minút'); + } + + return result + "min\xFAtami"; + + case 'h': + // an hour / in an hour / an hour ago + return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou'; + + case 'hh': + // 9 hours / in 9 hours / 9 hours ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'hodiny' : 'hodín'); + } + + return result + "hodinami"; + + case 'd': + // a day / in a day / a day ago + return withoutSuffix || isFuture ? 'deň' : 'dňom'; + + case 'dd': + // 9 days / in 9 days / 9 days ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'dni' : 'dní'); + } + + return result + "d\u0148ami"; + + case 'M': + // a month / in a month / a month ago + return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom'; + + case 'MM': + // 9 months / in 9 months / 9 months ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'mesiace' : 'mesiacov'); + } + + return result + "mesiacmi"; + + case 'y': + // a year / in a year / a year ago + return withoutSuffix || isFuture ? 'rok' : 'rokom'; + + case 'yy': + // 9 years / in 9 years / 9 years ago + if (withoutSuffix || isFuture) { + return result + (plural(number) ? 'roky' : 'rokov'); + } + + return result + "rokmi"; + } +} +/* eslint-enable */ + + +var locale = { + name: 'sk', + weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), + weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'), + weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'), + months: 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'), + monthsShort: 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'), + weekStart: 1, + yearStart: 4, + ordinal: function ordinal(n) { + return n + "."; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd D. MMMM YYYY H:mm', + l: 'D. M. YYYY' + }, + relativeTime: { + future: 'za %s', + // Should be `o %s` (change when moment/moment#5408 is fixed) + past: 'pred %s', + s: translate, + m: translate, + mm: translate, + h: translate, + hh: translate, + d: translate, + dd: translate, + M: translate, + MM: translate, + y: translate, + yy: translate + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sl.js b/node_modules/dayjs/esm/locale/sl.js new file mode 100644 index 00000000..e3c58393 --- /dev/null +++ b/node_modules/dayjs/esm/locale/sl.js @@ -0,0 +1,141 @@ +// Slovenian [sl] +import dayjs from '../index'; + +function dual(n) { + return n % 100 == 2; // eslint-disable-line +} + +function threeFour(n) { + return n % 100 == 3 || n % 100 == 4; // eslint-disable-line +} +/* eslint-disable */ + + +function translate(number, withoutSuffix, key, isFuture) { + var result = number + " "; + + switch (key) { + case 's': + // a few seconds / in a few seconds / a few seconds ago + return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami'; + + case 'm': + // a minute / in a minute / a minute ago + return withoutSuffix ? 'ena minuta' : 'eno minuto'; + + case 'mm': + // 9 minutes / in 9 minutes / 9 minutes ago + if (dual(number)) { + return result + (withoutSuffix || isFuture ? 'minuti' : 'minutama'); + } + + if (threeFour(number)) { + return result + (withoutSuffix || isFuture ? 'minute' : 'minutami'); + } + + return result + (withoutSuffix || isFuture ? 'minut' : 'minutami'); + + case 'h': + // an hour / in an hour / an hour ago + return withoutSuffix ? 'ena ura' : isFuture ? 'eno uro' : 'eno uro'; + + case 'hh': + // 9 hours / in 9 hours / 9 hours ago + if (dual(number)) { + return result + (withoutSuffix || isFuture ? 'uri' : 'urama'); + } + + if (threeFour(number)) { + return result + (withoutSuffix || isFuture ? 'ure' : 'urami'); + } + + return result + (withoutSuffix || isFuture ? 'ur' : 'urami'); + + case 'd': + // a day / in a day / a day ago + return withoutSuffix || isFuture ? 'en dan' : 'enim dnem'; + + case 'dd': + // 9 days / in 9 days / 9 days ago + if (dual(number)) { + return result + (withoutSuffix || isFuture ? 'dneva' : 'dnevoma'); + } + + return result + (withoutSuffix || isFuture ? 'dni' : 'dnevi'); + + case 'M': + // a month / in a month / a month ago + return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem'; + + case 'MM': + // 9 months / in 9 months / 9 months ago + if (dual(number)) { + // 2 minutes / in 2 minutes + return result + (withoutSuffix || isFuture ? 'meseca' : 'mesecema'); + } + + if (threeFour(number)) { + return result + (withoutSuffix || isFuture ? 'mesece' : 'meseci'); + } + + return result + (withoutSuffix || isFuture ? 'mesecev' : 'meseci'); + + case 'y': + // a year / in a year / a year ago + return withoutSuffix || isFuture ? 'eno leto' : 'enim letom'; + + case 'yy': + // 9 years / in 9 years / 9 years ago + if (dual(number)) { + // 2 minutes / in 2 minutes + return result + (withoutSuffix || isFuture ? 'leti' : 'letoma'); + } + + if (threeFour(number)) { + return result + (withoutSuffix || isFuture ? 'leta' : 'leti'); + } + + return result + (withoutSuffix || isFuture ? 'let' : 'leti'); + } +} +/* eslint-enable */ + + +var locale = { + name: 'sl', + weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), + months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'), + weekStart: 1, + weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'), + monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'), + weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'), + ordinal: function ordinal(n) { + return n + "."; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd, D. MMMM YYYY H:mm', + l: 'D. M. YYYY' + }, + relativeTime: { + future: 'čez %s', + past: 'pred %s', + s: translate, + m: translate, + mm: translate, + h: translate, + hh: translate, + d: translate, + dd: translate, + M: translate, + MM: translate, + y: translate, + yy: translate + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sq.js b/node_modules/dayjs/esm/locale/sq.js new file mode 100644 index 00000000..625b7013 --- /dev/null +++ b/node_modules/dayjs/esm/locale/sq.js @@ -0,0 +1,39 @@ +// Albanian [sq] +import dayjs from '../index'; +var locale = { + name: 'sq', + weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'), + months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'), + weekStart: 1, + weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'), + monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'), + weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'në %s', + past: '%s më parë', + s: 'disa sekonda', + m: 'një minutë', + mm: '%d minuta', + h: 'një orë', + hh: '%d orë', + d: 'një ditë', + dd: '%d ditë', + M: 'një muaj', + MM: '%d muaj', + y: 'një vit', + yy: '%d vite' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sr-cyrl.js b/node_modules/dayjs/esm/locale/sr-cyrl.js new file mode 100644 index 00000000..2e40d51a --- /dev/null +++ b/node_modules/dayjs/esm/locale/sr-cyrl.js @@ -0,0 +1,74 @@ +// Serbian Cyrillic [sr-cyrl] +import dayjs from '../index'; +var translator = { + words: { + m: ['један минут', 'једног минута'], + mm: ['%d минут', '%d минута', '%d минута'], + h: ['један сат', 'једног сата'], + hh: ['%d сат', '%d сата', '%d сати'], + d: ['један дан', 'једног дана'], + dd: ['%d дан', '%d дана', '%d дана'], + M: ['један месец', 'једног месеца'], + MM: ['%d месец', '%d месеца', '%d месеци'], + y: ['једну годину', 'једне године'], + yy: ['%d годину', '%d године', '%d година'] + }, + correctGrammarCase: function correctGrammarCase(number, wordKey) { + if (number % 10 >= 1 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20)) { + return number % 10 === 1 ? wordKey[0] : wordKey[1]; + } + + return wordKey[2]; + }, + relativeTimeFormatter: function relativeTimeFormatter(number, withoutSuffix, key, isFuture) { + var wordKey = translator.words[key]; + + if (key.length === 1) { + // Nominativ + if (key === 'y' && withoutSuffix) return 'једна година'; + return isFuture || withoutSuffix ? wordKey[0] : wordKey[1]; + } + + var word = translator.correctGrammarCase(number, wordKey); // Nominativ + + if (key === 'yy' && withoutSuffix && word === '%d годину') return number + " \u0433\u043E\u0434\u0438\u043D\u0430"; + return word.replace('%d', number); + } +}; +var locale = { + name: 'sr-cyrl', + weekdays: 'Недеља_Понедељак_Уторак_Среда_Четвртак_Петак_Субота'.split('_'), + weekdaysShort: 'Нед._Пон._Уто._Сре._Чет._Пет._Суб.'.split('_'), + weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'), + months: 'Јануар_Фебруар_Март_Април_Мај_Јун_Јул_Август_Септембар_Октобар_Новембар_Децембар'.split('_'), + monthsShort: 'Јан._Феб._Мар._Апр._Мај_Јун_Јул_Авг._Сеп._Окт._Нов._Дец.'.split('_'), + weekStart: 1, + relativeTime: { + future: 'за %s', + past: 'пре %s', + s: 'неколико секунди', + m: translator.relativeTimeFormatter, + mm: translator.relativeTimeFormatter, + h: translator.relativeTimeFormatter, + hh: translator.relativeTimeFormatter, + d: translator.relativeTimeFormatter, + dd: translator.relativeTimeFormatter, + M: translator.relativeTimeFormatter, + MM: translator.relativeTimeFormatter, + y: translator.relativeTimeFormatter, + yy: translator.relativeTimeFormatter + }, + ordinal: function ordinal(n) { + return n + "."; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sr.js b/node_modules/dayjs/esm/locale/sr.js new file mode 100644 index 00000000..f5174ced --- /dev/null +++ b/node_modules/dayjs/esm/locale/sr.js @@ -0,0 +1,74 @@ +// Serbian [sr] +import dayjs from '../index'; +var translator = { + words: { + m: ['jedan minut', 'jednog minuta'], + mm: ['%d minut', '%d minuta', '%d minuta'], + h: ['jedan sat', 'jednog sata'], + hh: ['%d sat', '%d sata', '%d sati'], + d: ['jedan dan', 'jednog dana'], + dd: ['%d dan', '%d dana', '%d dana'], + M: ['jedan mesec', 'jednog meseca'], + MM: ['%d mesec', '%d meseca', '%d meseci'], + y: ['jednu godinu', 'jedne godine'], + yy: ['%d godinu', '%d godine', '%d godina'] + }, + correctGrammarCase: function correctGrammarCase(number, wordKey) { + if (number % 10 >= 1 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20)) { + return number % 10 === 1 ? wordKey[0] : wordKey[1]; + } + + return wordKey[2]; + }, + relativeTimeFormatter: function relativeTimeFormatter(number, withoutSuffix, key, isFuture) { + var wordKey = translator.words[key]; + + if (key.length === 1) { + // Nominativ + if (key === 'y' && withoutSuffix) return 'jedna godina'; + return isFuture || withoutSuffix ? wordKey[0] : wordKey[1]; + } + + var word = translator.correctGrammarCase(number, wordKey); // Nominativ + + if (key === 'yy' && withoutSuffix && word === '%d godinu') return number + " godina"; + return word.replace('%d', number); + } +}; +var locale = { + name: 'sr', + weekdays: 'Nedelja_Ponedeljak_Utorak_Sreda_Četvrtak_Petak_Subota'.split('_'), + weekdaysShort: 'Ned._Pon._Uto._Sre._Čet._Pet._Sub.'.split('_'), + weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), + months: 'Januar_Februar_Mart_April_Maj_Jun_Jul_Avgust_Septembar_Oktobar_Novembar_Decembar'.split('_'), + monthsShort: 'Jan._Feb._Mar._Apr._Maj_Jun_Jul_Avg._Sep._Okt._Nov._Dec.'.split('_'), + weekStart: 1, + relativeTime: { + future: 'za %s', + past: 'pre %s', + s: 'nekoliko sekundi', + m: translator.relativeTimeFormatter, + mm: translator.relativeTimeFormatter, + h: translator.relativeTimeFormatter, + hh: translator.relativeTimeFormatter, + d: translator.relativeTimeFormatter, + dd: translator.relativeTimeFormatter, + M: translator.relativeTimeFormatter, + MM: translator.relativeTimeFormatter, + y: translator.relativeTimeFormatter, + yy: translator.relativeTimeFormatter + }, + ordinal: function ordinal(n) { + return n + "."; + }, + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'D. M. YYYY.', + LL: 'D. MMMM YYYY.', + LLL: 'D. MMMM YYYY. H:mm', + LLLL: 'dddd, D. MMMM YYYY. H:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ss.js b/node_modules/dayjs/esm/locale/ss.js new file mode 100644 index 00000000..4354a484 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ss.js @@ -0,0 +1,39 @@ +// siSwati [ss] +import dayjs from '../index'; +var locale = { + name: 'ss', + weekdays: 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'), + months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'), + weekStart: 1, + weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'), + monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'), + weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY h:mm A', + LLLL: 'dddd, D MMMM YYYY h:mm A' + }, + relativeTime: { + future: 'nga %s', + past: 'wenteka nga %s', + s: 'emizuzwana lomcane', + m: 'umzuzu', + mm: '%d emizuzu', + h: 'lihora', + hh: '%d emahora', + d: 'lilanga', + dd: '%d emalanga', + M: 'inyanga', + MM: '%d tinyanga', + y: 'umnyaka', + yy: '%d iminyaka' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sv-fi.js b/node_modules/dayjs/esm/locale/sv-fi.js new file mode 100644 index 00000000..a18977fa --- /dev/null +++ b/node_modules/dayjs/esm/locale/sv-fi.js @@ -0,0 +1,46 @@ +// Finland Swedish [sv-fi] +import dayjs from '../index'; +var locale = { + name: 'sv-fi', + weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), + weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'), + weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'), + months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), + monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), + weekStart: 1, + yearStart: 4, + ordinal: function ordinal(n) { + var b = n % 10; + var o = b === 1 || b === 2 ? 'a' : 'e'; + return "[" + n + o + "]"; + }, + formats: { + LT: 'HH.mm', + LTS: 'HH.mm.ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY, [kl.] HH.mm', + LLLL: 'dddd, D. MMMM YYYY, [kl.] HH.mm', + l: 'D.M.YYYY', + ll: 'D. MMM YYYY', + lll: 'D. MMM YYYY, [kl.] HH.mm', + llll: 'ddd, D. MMM YYYY, [kl.] HH.mm' + }, + relativeTime: { + future: 'om %s', + past: 'för %s sedan', + s: 'några sekunder', + m: 'en minut', + mm: '%d minuter', + h: 'en timme', + hh: '%d timmar', + d: 'en dag', + dd: '%d dagar', + M: 'en månad', + MM: '%d månader', + y: 'ett år', + yy: '%d år' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sv.js b/node_modules/dayjs/esm/locale/sv.js new file mode 100644 index 00000000..2563ee7c --- /dev/null +++ b/node_modules/dayjs/esm/locale/sv.js @@ -0,0 +1,44 @@ +// Swedish [sv] +import dayjs from '../index'; +var locale = { + name: 'sv', + weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), + weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'), + weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'), + months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), + monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), + weekStart: 1, + yearStart: 4, + ordinal: function ordinal(n) { + var b = n % 10; + var o = b === 1 || b === 2 ? 'a' : 'e'; + return "[" + n + o + "]"; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY [kl.] HH:mm', + LLLL: 'dddd D MMMM YYYY [kl.] HH:mm', + lll: 'D MMM YYYY HH:mm', + llll: 'ddd D MMM YYYY HH:mm' + }, + relativeTime: { + future: 'om %s', + past: 'för %s sedan', + s: 'några sekunder', + m: 'en minut', + mm: '%d minuter', + h: 'en timme', + hh: '%d timmar', + d: 'en dag', + dd: '%d dagar', + M: 'en månad', + MM: '%d månader', + y: 'ett år', + yy: '%d år' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/sw.js b/node_modules/dayjs/esm/locale/sw.js new file mode 100644 index 00000000..287bf336 --- /dev/null +++ b/node_modules/dayjs/esm/locale/sw.js @@ -0,0 +1,39 @@ +// Swahili [sw] +import dayjs from '../index'; +var locale = { + name: 'sw', + weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'), + weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'), + weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'), + months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'), + monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'), + weekStart: 1, + ordinal: function ordinal(n) { + return n; + }, + relativeTime: { + future: '%s baadaye', + past: 'tokea %s', + s: 'hivi punde', + m: 'dakika moja', + mm: 'dakika %d', + h: 'saa limoja', + hh: 'masaa %d', + d: 'siku moja', + dd: 'masiku %d', + M: 'mwezi mmoja', + MM: 'miezi %d', + y: 'mwaka mmoja', + yy: 'miaka %d' + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ta.js b/node_modules/dayjs/esm/locale/ta.js new file mode 100644 index 00000000..6df25f87 --- /dev/null +++ b/node_modules/dayjs/esm/locale/ta.js @@ -0,0 +1,38 @@ +// Tamil [ta] +import dayjs from '../index'; +var locale = { + name: 'ta', + weekdays: 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'), + months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), + weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'), + monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), + weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, HH:mm', + LLLL: 'dddd, D MMMM YYYY, HH:mm' + }, + relativeTime: { + future: '%s இல்', + past: '%s முன்', + s: 'ஒரு சில விநாடிகள்', + m: 'ஒரு நிமிடம்', + mm: '%d நிமிடங்கள்', + h: 'ஒரு மணி நேரம்', + hh: '%d மணி நேரம்', + d: 'ஒரு நாள்', + dd: '%d நாட்கள்', + M: 'ஒரு மாதம்', + MM: '%d மாதங்கள்', + y: 'ஒரு வருடம்', + yy: '%d ஆண்டுகள்' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/te.js b/node_modules/dayjs/esm/locale/te.js new file mode 100644 index 00000000..392a2478 --- /dev/null +++ b/node_modules/dayjs/esm/locale/te.js @@ -0,0 +1,38 @@ +// Telugu [te] +import dayjs from '../index'; +var locale = { + name: 'te', + weekdays: 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'), + months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'), + weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'), + monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'), + weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'A h:mm', + LTS: 'A h:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY, A h:mm', + LLLL: 'dddd, D MMMM YYYY, A h:mm' + }, + relativeTime: { + future: '%s లో', + past: '%s క్రితం', + s: 'కొన్ని క్షణాలు', + m: 'ఒక నిమిషం', + mm: '%d నిమిషాలు', + h: 'ఒక గంట', + hh: '%d గంటలు', + d: 'ఒక రోజు', + dd: '%d రోజులు', + M: 'ఒక నెల', + MM: '%d నెలలు', + y: 'ఒక సంవత్సరం', + yy: '%d సంవత్సరాలు' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/tet.js b/node_modules/dayjs/esm/locale/tet.js new file mode 100644 index 00000000..ff83eeab --- /dev/null +++ b/node_modules/dayjs/esm/locale/tet.js @@ -0,0 +1,39 @@ +// Tetun Dili (East Timor) [tet] +import dayjs from '../index'; +var locale = { + name: 'tet', + weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'), + months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split('_'), + weekStart: 1, + weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'), + monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), + weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'iha %s', + past: '%s liuba', + s: 'minutu balun', + m: 'minutu ida', + mm: 'minutu %d', + h: 'oras ida', + hh: 'oras %d', + d: 'loron ida', + dd: 'loron %d', + M: 'fulan ida', + MM: 'fulan %d', + y: 'tinan ida', + yy: 'tinan %d' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/tg.js b/node_modules/dayjs/esm/locale/tg.js new file mode 100644 index 00000000..536df0b9 --- /dev/null +++ b/node_modules/dayjs/esm/locale/tg.js @@ -0,0 +1,39 @@ +// Tajik [tg] +import dayjs from '../index'; +var locale = { + name: 'tg', + weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split('_'), + months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), + weekStart: 1, + weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'), + monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), + weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'баъди %s', + past: '%s пеш', + s: 'якчанд сония', + m: 'як дақиқа', + mm: '%d дақиқа', + h: 'як соат', + hh: '%d соат', + d: 'як рӯз', + dd: '%d рӯз', + M: 'як моҳ', + MM: '%d моҳ', + y: 'як сол', + yy: '%d сол' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/th.js b/node_modules/dayjs/esm/locale/th.js new file mode 100644 index 00000000..5cbcdf2a --- /dev/null +++ b/node_modules/dayjs/esm/locale/th.js @@ -0,0 +1,38 @@ +// Thai [th] +import dayjs from '../index'; +var locale = { + name: 'th', + weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'), + weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), + weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'), + months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'), + monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'), + formats: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY เวลา H:mm', + LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm' + }, + relativeTime: { + future: 'อีก %s', + past: '%sที่แล้ว', + s: 'ไม่กี่วินาที', + m: '1 นาที', + mm: '%d นาที', + h: '1 ชั่วโมง', + hh: '%d ชั่วโมง', + d: '1 วัน', + dd: '%d วัน', + M: '1 เดือน', + MM: '%d เดือน', + y: '1 ปี', + yy: '%d ปี' + }, + ordinal: function ordinal(n) { + return n + "."; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/tk.js b/node_modules/dayjs/esm/locale/tk.js new file mode 100644 index 00000000..93390f18 --- /dev/null +++ b/node_modules/dayjs/esm/locale/tk.js @@ -0,0 +1,39 @@ +// Turkmen [tk] +import dayjs from '../index'; +var locale = { + name: 'tk', + weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split('_'), + weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'), + weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'), + months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split('_'), + monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'), + weekStart: 1, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: '%s soň', + past: '%s öň', + s: 'birnäçe sekunt', + m: 'bir minut', + mm: '%d minut', + h: 'bir sagat', + hh: '%d sagat', + d: 'bir gün', + dd: '%d gün', + M: 'bir aý', + MM: '%d aý', + y: 'bir ýyl', + yy: '%d ýyl' + }, + ordinal: function ordinal(n) { + return n + "."; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/tl-ph.js b/node_modules/dayjs/esm/locale/tl-ph.js new file mode 100644 index 00000000..0fa84f3a --- /dev/null +++ b/node_modules/dayjs/esm/locale/tl-ph.js @@ -0,0 +1,39 @@ +// Tagalog (Philippines) [tl-ph] +import dayjs from '../index'; +var locale = { + name: 'tl-ph', + weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'), + months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'), + weekStart: 1, + weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'), + monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), + weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'MM/D/YYYY', + LL: 'MMMM D, YYYY', + LLL: 'MMMM D, YYYY HH:mm', + LLLL: 'dddd, MMMM DD, YYYY HH:mm' + }, + relativeTime: { + future: 'sa loob ng %s', + past: '%s ang nakalipas', + s: 'ilang segundo', + m: 'isang minuto', + mm: '%d minuto', + h: 'isang oras', + hh: '%d oras', + d: 'isang araw', + dd: '%d araw', + M: 'isang buwan', + MM: '%d buwan', + y: 'isang taon', + yy: '%d taon' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/tlh.js b/node_modules/dayjs/esm/locale/tlh.js new file mode 100644 index 00000000..30f52fe7 --- /dev/null +++ b/node_modules/dayjs/esm/locale/tlh.js @@ -0,0 +1,24 @@ +// Klingon [tlh] +import dayjs from '../index'; +var locale = { + name: 'tlh', + weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'), + weekStart: 1, + weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'), + weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/tr.js b/node_modules/dayjs/esm/locale/tr.js new file mode 100644 index 00000000..e7fe24fb --- /dev/null +++ b/node_modules/dayjs/esm/locale/tr.js @@ -0,0 +1,39 @@ +// Turkish [tr] +import dayjs from '../index'; +var locale = { + name: 'tr', + weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'), + weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'), + weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'), + months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'), + monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'), + weekStart: 1, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: '%s sonra', + past: '%s önce', + s: 'birkaç saniye', + m: 'bir dakika', + mm: '%d dakika', + h: 'bir saat', + hh: '%d saat', + d: 'bir gün', + dd: '%d gün', + M: 'bir ay', + MM: '%d ay', + y: 'bir yıl', + yy: '%d yıl' + }, + ordinal: function ordinal(n) { + return n + "."; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/types.d.ts b/node_modules/dayjs/esm/locale/types.d.ts new file mode 100644 index 00000000..2c24a645 --- /dev/null +++ b/node_modules/dayjs/esm/locale/types.d.ts @@ -0,0 +1,33 @@ +declare interface ILocale { + name: string + weekdays?: string[] + months?: string[] + weekStart?: number + weekdaysShort?: string[] + monthsShort?: string[] + weekdaysMin?: string[] + ordinal?: (n: number) => number | string + formats: Partial<{ + LT: string + LTS: string + L: string + LL: string + LLL: string + LLLL: string + }> + relativeTime: Partial<{ + future: string + past: string + s: string + m: string + mm: string + h: string + hh: string + d: string + dd: string + M: string + MM: string + y: string + yy: string + }> +} diff --git a/node_modules/dayjs/esm/locale/tzl.js b/node_modules/dayjs/esm/locale/tzl.js new file mode 100644 index 00000000..9fa0cd2b --- /dev/null +++ b/node_modules/dayjs/esm/locale/tzl.js @@ -0,0 +1,24 @@ +// Talossan [tzl] +import dayjs from '../index'; +var locale = { + name: 'tzl', + weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'), + months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'), + weekStart: 1, + weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'), + monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'), + weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH.mm', + LTS: 'HH.mm.ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM [dallas] YYYY', + LLL: 'D. MMMM [dallas] YYYY HH.mm', + LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/tzm-latn.js b/node_modules/dayjs/esm/locale/tzm-latn.js new file mode 100644 index 00000000..e5ac6aff --- /dev/null +++ b/node_modules/dayjs/esm/locale/tzm-latn.js @@ -0,0 +1,39 @@ +// Central Atlas Tamazight Latin [tzm-latn] +import dayjs from '../index'; +var locale = { + name: 'tzm-latn', + weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), + months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), + weekStart: 6, + weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), + monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), + weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'dadkh s yan %s', + past: 'yan %s', + s: 'imik', + m: 'minuḍ', + mm: '%d minuḍ', + h: 'saɛa', + hh: '%d tassaɛin', + d: 'ass', + dd: '%d ossan', + M: 'ayowr', + MM: '%d iyyirn', + y: 'asgas', + yy: '%d isgasn' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/tzm.js b/node_modules/dayjs/esm/locale/tzm.js new file mode 100644 index 00000000..d94a6c09 --- /dev/null +++ b/node_modules/dayjs/esm/locale/tzm.js @@ -0,0 +1,39 @@ +// Central Atlas Tamazight [tzm] +import dayjs from '../index'; +var locale = { + name: 'tzm', + weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), + months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), + weekStart: 6, + weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), + monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), + weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s', + past: 'ⵢⴰⵏ %s', + s: 'ⵉⵎⵉⴽ', + m: 'ⵎⵉⵏⵓⴺ', + mm: '%d ⵎⵉⵏⵓⴺ', + h: 'ⵙⴰⵄⴰ', + hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ', + d: 'ⴰⵙⵙ', + dd: '%d oⵙⵙⴰⵏ', + M: 'ⴰⵢoⵓⵔ', + MM: '%d ⵉⵢⵢⵉⵔⵏ', + y: 'ⴰⵙⴳⴰⵙ', + yy: '%d ⵉⵙⴳⴰⵙⵏ' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ug-cn.js b/node_modules/dayjs/esm/locale/ug-cn.js new file mode 100644 index 00000000..d3d6392a --- /dev/null +++ b/node_modules/dayjs/esm/locale/ug-cn.js @@ -0,0 +1,39 @@ +// Uyghur (China) [ug-cn] +import dayjs from '../index'; +var locale = { + name: 'ug-cn', + weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split('_'), + months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split('_'), + weekStart: 1, + weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'), + monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split('_'), + weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى', + LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', + LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm' + }, + relativeTime: { + future: '%s كېيىن', + past: '%s بۇرۇن', + s: 'نەچچە سېكونت', + m: 'بىر مىنۇت', + mm: '%d مىنۇت', + h: 'بىر سائەت', + hh: '%d سائەت', + d: 'بىر كۈن', + dd: '%d كۈن', + M: 'بىر ئاي', + MM: '%d ئاي', + y: 'بىر يىل', + yy: '%d يىل' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/uk.js b/node_modules/dayjs/esm/locale/uk.js new file mode 100644 index 00000000..3c70b132 --- /dev/null +++ b/node_modules/dayjs/esm/locale/uk.js @@ -0,0 +1,77 @@ +// Ukrainian [uk] +import dayjs from '../index'; +var monthFormat = 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'); +var monthStandalone = 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'); +var MONTHS_IN_FORMAT = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/; + +function plural(word, num) { + var forms = word.split('_'); + return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; // eslint-disable-line +} + +function relativeTimeWithPlural(number, withoutSuffix, key) { + var format = { + ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд', + mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', + hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин', + dd: 'день_дні_днів', + MM: 'місяць_місяці_місяців', + yy: 'рік_роки_років' + }; + + if (key === 'm') { + return withoutSuffix ? 'хвилина' : 'хвилину'; + } else if (key === 'h') { + return withoutSuffix ? 'година' : 'годину'; + } + + return number + " " + plural(format[key], +number); +} + +var months = function months(dayjsInstance, format) { + if (MONTHS_IN_FORMAT.test(format)) { + return monthFormat[dayjsInstance.month()]; + } + + return monthStandalone[dayjsInstance.month()]; +}; + +months.s = monthStandalone; +months.f = monthFormat; +var locale = { + name: 'uk', + weekdays: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), + weekdaysShort: 'ндл_пнд_втр_срд_чтв_птн_сбт'.split('_'), + weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), + months: months, + monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), + weekStart: 1, + relativeTime: { + future: 'за %s', + past: '%s тому', + s: 'декілька секунд', + m: relativeTimeWithPlural, + mm: relativeTimeWithPlural, + h: relativeTimeWithPlural, + hh: relativeTimeWithPlural, + d: 'день', + dd: relativeTimeWithPlural, + M: 'місяць', + MM: relativeTimeWithPlural, + y: 'рік', + yy: relativeTimeWithPlural + }, + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY р.', + LLL: 'D MMMM YYYY р., HH:mm', + LLLL: 'dddd, D MMMM YYYY р., HH:mm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/ur.js b/node_modules/dayjs/esm/locale/ur.js new file mode 100644 index 00000000..7464c1eb --- /dev/null +++ b/node_modules/dayjs/esm/locale/ur.js @@ -0,0 +1,39 @@ +// Urdu [ur] +import dayjs from '../index'; +var locale = { + name: 'ur', + weekdays: 'اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ'.split('_'), + months: 'جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر'.split('_'), + weekStart: 1, + weekdaysShort: 'اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ'.split('_'), + monthsShort: 'جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر'.split('_'), + weekdaysMin: 'اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd، D MMMM YYYY HH:mm' + }, + relativeTime: { + future: '%s بعد', + past: '%s قبل', + s: 'چند سیکنڈ', + m: 'ایک منٹ', + mm: '%d منٹ', + h: 'ایک گھنٹہ', + hh: '%d گھنٹے', + d: 'ایک دن', + dd: '%d دن', + M: 'ایک ماہ', + MM: '%d ماہ', + y: 'ایک سال', + yy: '%d سال' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/uz-latn.js b/node_modules/dayjs/esm/locale/uz-latn.js new file mode 100644 index 00000000..befdfee4 --- /dev/null +++ b/node_modules/dayjs/esm/locale/uz-latn.js @@ -0,0 +1,39 @@ +// Uzbek Latin [uz-latn] +import dayjs from '../index'; +var locale = { + name: 'uz-latn', + weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split('_'), + months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split('_'), + weekStart: 1, + weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'), + monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'), + weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'D MMMM YYYY, dddd HH:mm' + }, + relativeTime: { + future: 'Yaqin %s ichida', + past: '%s oldin', + s: 'soniya', + m: 'bir daqiqa', + mm: '%d daqiqa', + h: 'bir soat', + hh: '%d soat', + d: 'bir kun', + dd: '%d kun', + M: 'bir oy', + MM: '%d oy', + y: 'bir yil', + yy: '%d yil' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/uz.js b/node_modules/dayjs/esm/locale/uz.js new file mode 100644 index 00000000..44332637 --- /dev/null +++ b/node_modules/dayjs/esm/locale/uz.js @@ -0,0 +1,39 @@ +// Uzbek [uz] +import dayjs from '../index'; +var locale = { + name: 'uz', + weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), + months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), + weekStart: 1, + weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), + monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), + weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'D MMMM YYYY, dddd HH:mm' + }, + relativeTime: { + future: 'Якин %s ичида', + past: '%s олдин', + s: 'фурсат', + m: 'бир дакика', + mm: '%d дакика', + h: 'бир соат', + hh: '%d соат', + d: 'бир кун', + dd: '%d кун', + M: 'бир ой', + MM: '%d ой', + y: 'бир йил', + yy: '%d йил' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/vi.js b/node_modules/dayjs/esm/locale/vi.js new file mode 100644 index 00000000..f55cc732 --- /dev/null +++ b/node_modules/dayjs/esm/locale/vi.js @@ -0,0 +1,43 @@ +// Vietnamese [vi] +import dayjs from '../index'; +var locale = { + name: 'vi', + weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), + months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'), + weekStart: 1, + weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'), + monthsShort: 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'), + weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM [năm] YYYY', + LLL: 'D MMMM [năm] YYYY HH:mm', + LLLL: 'dddd, D MMMM [năm] YYYY HH:mm', + l: 'DD/M/YYYY', + ll: 'D MMM YYYY', + lll: 'D MMM YYYY HH:mm', + llll: 'ddd, D MMM YYYY HH:mm' + }, + relativeTime: { + future: '%s tới', + past: '%s trước', + s: 'vài giây', + m: 'một phút', + mm: '%d phút', + h: 'một giờ', + hh: '%d giờ', + d: 'một ngày', + dd: '%d ngày', + M: 'một tháng', + MM: '%d tháng', + y: 'một năm', + yy: '%d năm' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/x-pseudo.js b/node_modules/dayjs/esm/locale/x-pseudo.js new file mode 100644 index 00000000..ceb67827 --- /dev/null +++ b/node_modules/dayjs/esm/locale/x-pseudo.js @@ -0,0 +1,39 @@ +// Pseudo [x-pseudo] +import dayjs from '../index'; +var locale = { + name: 'x-pseudo', + weekdays: 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'), + months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'), + weekStart: 1, + weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'), + monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'), + weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd, D MMMM YYYY HH:mm' + }, + relativeTime: { + future: 'í~ñ %s', + past: '%s á~gó', + s: 'á ~féw ~sécó~ñds', + m: 'á ~míñ~úté', + mm: '%d m~íñú~tés', + h: 'á~ñ hó~úr', + hh: '%d h~óúrs', + d: 'á ~dáý', + dd: '%d d~áýs', + M: 'á ~móñ~th', + MM: '%d m~óñt~hs', + y: 'á ~ýéár', + yy: '%d ý~éárs' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/yo.js b/node_modules/dayjs/esm/locale/yo.js new file mode 100644 index 00000000..1f794684 --- /dev/null +++ b/node_modules/dayjs/esm/locale/yo.js @@ -0,0 +1,39 @@ +// Yoruba Nigeria [yo] +import dayjs from '../index'; +var locale = { + name: 'yo', + weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'), + months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split('_'), + weekStart: 1, + weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'), + monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'), + weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'), + ordinal: function ordinal(n) { + return n; + }, + formats: { + LT: 'h:mm A', + LTS: 'h:mm:ss A', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY h:mm A', + LLLL: 'dddd, D MMMM YYYY h:mm A' + }, + relativeTime: { + future: 'ní %s', + past: '%s kọjá', + s: 'ìsẹjú aayá die', + m: 'ìsẹjú kan', + mm: 'ìsẹjú %d', + h: 'wákati kan', + hh: 'wákati %d', + d: 'ọjọ́ kan', + dd: 'ọjọ́ %d', + M: 'osù kan', + MM: 'osù %d', + y: 'ọdún kan', + yy: 'ọdún %d' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/zh-cn.js b/node_modules/dayjs/esm/locale/zh-cn.js new file mode 100644 index 00000000..1a7ebf4b --- /dev/null +++ b/node_modules/dayjs/esm/locale/zh-cn.js @@ -0,0 +1,67 @@ +// Chinese (China) [zh-cn] +import dayjs from '../index'; +var locale = { + name: 'zh-cn', + weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), + weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'), + weekdaysMin: '日_一_二_三_四_五_六'.split('_'), + months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), + monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + ordinal: function ordinal(number, period) { + switch (period) { + case 'W': + return number + "\u5468"; + + default: + return number + "\u65E5"; + } + }, + weekStart: 1, + yearStart: 4, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY/MM/DD', + LL: 'YYYY年M月D日', + LLL: 'YYYY年M月D日Ah点mm分', + LLLL: 'YYYY年M月D日ddddAh点mm分', + l: 'YYYY/M/D', + ll: 'YYYY年M月D日', + lll: 'YYYY年M月D日 HH:mm', + llll: 'YYYY年M月D日dddd HH:mm' + }, + relativeTime: { + future: '%s内', + past: '%s前', + s: '几秒', + m: '1 分钟', + mm: '%d 分钟', + h: '1 小时', + hh: '%d 小时', + d: '1 天', + dd: '%d 天', + M: '1 个月', + MM: '%d 个月', + y: '1 年', + yy: '%d 年' + }, + meridiem: function meridiem(hour, minute) { + var hm = hour * 100 + minute; + + if (hm < 600) { + return '凌晨'; + } else if (hm < 900) { + return '早上'; + } else if (hm < 1100) { + return '上午'; + } else if (hm < 1300) { + return '中午'; + } else if (hm < 1800) { + return '下午'; + } + + return '晚上'; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/zh-hk.js b/node_modules/dayjs/esm/locale/zh-hk.js new file mode 100644 index 00000000..38967475 --- /dev/null +++ b/node_modules/dayjs/esm/locale/zh-hk.js @@ -0,0 +1,44 @@ +// Chinese (Hong Kong) [zh-hk] +import dayjs from '../index'; +var locale = { + name: 'zh-hk', + months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), + monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), + weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'), + weekdaysMin: '日_一_二_三_四_五_六'.split('_'), + ordinal: function ordinal(number, period) { + switch (period) { + case 'W': + return number + "\u9031"; + + default: + return number + "\u65E5"; + } + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY/MM/DD', + LL: 'YYYY年M月D日', + LLL: 'YYYY年M月D日 HH:mm', + LLLL: 'YYYY年M月D日dddd HH:mm' + }, + relativeTime: { + future: '%s內', + past: '%s前', + s: '幾秒', + m: '一分鐘', + mm: '%d 分鐘', + h: '一小時', + hh: '%d 小時', + d: '一天', + dd: '%d 天', + M: '一個月', + MM: '%d 個月', + y: '一年', + yy: '%d 年' + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/zh-tw.js b/node_modules/dayjs/esm/locale/zh-tw.js new file mode 100644 index 00000000..ada89ee4 --- /dev/null +++ b/node_modules/dayjs/esm/locale/zh-tw.js @@ -0,0 +1,65 @@ +// Chinese (Taiwan) [zh-tw] +import dayjs from '../index'; +var locale = { + name: 'zh-tw', + weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), + weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'), + weekdaysMin: '日_一_二_三_四_五_六'.split('_'), + months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), + monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + ordinal: function ordinal(number, period) { + switch (period) { + case 'W': + return number + "\u9031"; + + default: + return number + "\u65E5"; + } + }, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY/MM/DD', + LL: 'YYYY年M月D日', + LLL: 'YYYY年M月D日 HH:mm', + LLLL: 'YYYY年M月D日dddd HH:mm', + l: 'YYYY/M/D', + ll: 'YYYY年M月D日', + lll: 'YYYY年M月D日 HH:mm', + llll: 'YYYY年M月D日dddd HH:mm' + }, + relativeTime: { + future: '%s內', + past: '%s前', + s: '幾秒', + m: '1 分鐘', + mm: '%d 分鐘', + h: '1 小時', + hh: '%d 小時', + d: '1 天', + dd: '%d 天', + M: '1 個月', + MM: '%d 個月', + y: '1 年', + yy: '%d 年' + }, + meridiem: function meridiem(hour, minute) { + var hm = hour * 100 + minute; + + if (hm < 600) { + return '凌晨'; + } else if (hm < 900) { + return '早上'; + } else if (hm < 1100) { + return '上午'; + } else if (hm < 1300) { + return '中午'; + } else if (hm < 1800) { + return '下午'; + } + + return '晚上'; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/locale/zh.js b/node_modules/dayjs/esm/locale/zh.js new file mode 100644 index 00000000..b98ab70d --- /dev/null +++ b/node_modules/dayjs/esm/locale/zh.js @@ -0,0 +1,67 @@ +// Chinese [zh] +import dayjs from '../index'; +var locale = { + name: 'zh', + weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), + weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'), + weekdaysMin: '日_一_二_三_四_五_六'.split('_'), + months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), + monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + ordinal: function ordinal(number, period) { + switch (period) { + case 'W': + return number + "\u5468"; + + default: + return number + "\u65E5"; + } + }, + weekStart: 1, + yearStart: 4, + formats: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY/MM/DD', + LL: 'YYYY年M月D日', + LLL: 'YYYY年M月D日Ah点mm分', + LLLL: 'YYYY年M月D日ddddAh点mm分', + l: 'YYYY/M/D', + ll: 'YYYY年M月D日', + lll: 'YYYY年M月D日 HH:mm', + llll: 'YYYY年M月D日dddd HH:mm' + }, + relativeTime: { + future: '%s后', + past: '%s前', + s: '几秒', + m: '1 分钟', + mm: '%d 分钟', + h: '1 小时', + hh: '%d 小时', + d: '1 天', + dd: '%d 天', + M: '1 个月', + MM: '%d 个月', + y: '1 年', + yy: '%d 年' + }, + meridiem: function meridiem(hour, minute) { + var hm = hour * 100 + minute; + + if (hm < 600) { + return '凌晨'; + } else if (hm < 900) { + return '早上'; + } else if (hm < 1100) { + return '上午'; + } else if (hm < 1300) { + return '中午'; + } else if (hm < 1800) { + return '下午'; + } + + return '晚上'; + } +}; +dayjs.locale(locale, null, true); +export default locale; \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts b/node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts new file mode 100644 index 00000000..a17c8963 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/advancedFormat/index.js b/node_modules/dayjs/esm/plugin/advancedFormat/index.js new file mode 100644 index 00000000..f45e4e00 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/advancedFormat/index.js @@ -0,0 +1,66 @@ +import { FORMAT_DEFAULT } from '../../constant'; +export default (function (o, c) { + // locale needed later + var proto = c.prototype; + var oldFormat = proto.format; + + proto.format = function (formatStr) { + var _this = this; + + var locale = this.$locale(); + + if (!this.isValid()) { + return oldFormat.bind(this)(formatStr); + } + + var utils = this.$utils(); + var str = formatStr || FORMAT_DEFAULT; + var result = str.replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function (match) { + switch (match) { + case 'Q': + return Math.ceil((_this.$M + 1) / 3); + + case 'Do': + return locale.ordinal(_this.$D); + + case 'gggg': + return _this.weekYear(); + + case 'GGGG': + return _this.isoWeekYear(); + + case 'wo': + return locale.ordinal(_this.week(), 'W'); + // W for week + + case 'w': + case 'ww': + return utils.s(_this.week(), match === 'w' ? 1 : 2, '0'); + + case 'W': + case 'WW': + return utils.s(_this.isoWeek(), match === 'W' ? 1 : 2, '0'); + + case 'k': + case 'kk': + return utils.s(String(_this.$H === 0 ? 24 : _this.$H), match === 'k' ? 1 : 2, '0'); + + case 'X': + return Math.floor(_this.$d.getTime() / 1000); + + case 'x': + return _this.$d.getTime(); + + case 'z': + return "[" + _this.offsetName() + "]"; + + case 'zzz': + return "[" + _this.offsetName('long') + "]"; + + default: + return match; + } + }); + return oldFormat.bind(this)(result); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/arraySupport/index.d.ts b/node_modules/dayjs/esm/plugin/arraySupport/index.d.ts new file mode 100644 index 00000000..30f8d9c5 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/arraySupport/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare module 'dayjs/esm' { + interface ConfigTypeMap { + arraySupport: [number?, number?, number?, number?, number?, number?, number?] + } +} + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/arraySupport/index.js b/node_modules/dayjs/esm/plugin/arraySupport/index.js new file mode 100644 index 00000000..c7edc793 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/arraySupport/index.js @@ -0,0 +1,33 @@ +export default (function (o, c, dayjs) { + var proto = c.prototype; + + var parseDate = function parseDate(cfg) { + var date = cfg.date, + utc = cfg.utc; + + if (Array.isArray(date)) { + if (utc) { + if (!date.length) { + return new Date(); + } + + return new Date(Date.UTC.apply(null, date)); + } + + if (date.length === 1) { + return dayjs(String(date[0])).toDate(); + } + + return new (Function.prototype.bind.apply(Date, [null].concat(date)))(); + } + + return date; + }; + + var oldParse = proto.parse; + + proto.parse = function (cfg) { + cfg.date = parseDate.bind(this)(cfg); + oldParse.bind(this)(cfg); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/badMutable/index.d.ts b/node_modules/dayjs/esm/plugin/badMutable/index.d.ts new file mode 100644 index 00000000..a17c8963 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/badMutable/index.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/badMutable/index.js b/node_modules/dayjs/esm/plugin/badMutable/index.js new file mode 100644 index 00000000..679edee9 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/badMutable/index.js @@ -0,0 +1,61 @@ +export default (function (o, c) { + // locale needed later + var proto = c.prototype; + + proto.$g = function (input, get, set) { + if (this.$utils().u(input)) return this[get]; + return this.$set(set, input); + }; + + proto.set = function (string, _int) { + return this.$set(string, _int); + }; + + var oldStartOf = proto.startOf; + + proto.startOf = function (units, startOf) { + this.$d = oldStartOf.bind(this)(units, startOf).toDate(); + this.init(); + return this; + }; + + var oldAdd = proto.add; + + proto.add = function (number, units) { + this.$d = oldAdd.bind(this)(number, units).toDate(); + this.init(); + return this; + }; + + var oldLocale = proto.locale; + + proto.locale = function (preset, object) { + if (!preset) return this.$L; + this.$L = oldLocale.bind(this)(preset, object).$L; + return this; + }; + + var oldDaysInMonth = proto.daysInMonth; + + proto.daysInMonth = function () { + return oldDaysInMonth.bind(this.clone())(); + }; + + var oldIsSame = proto.isSame; + + proto.isSame = function (that, units) { + return oldIsSame.bind(this.clone())(that, units); + }; + + var oldIsBefore = proto.isBefore; + + proto.isBefore = function (that, units) { + return oldIsBefore.bind(this.clone())(that, units); + }; + + var oldIsAfter = proto.isAfter; + + proto.isAfter = function (that, units) { + return oldIsAfter.bind(this.clone())(that, units); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/bigIntSupport/index.d.ts b/node_modules/dayjs/esm/plugin/bigIntSupport/index.d.ts new file mode 100644 index 00000000..0829ead5 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/bigIntSupport/index.d.ts @@ -0,0 +1,11 @@ +import { PluginFunc } from 'dayjs/esm' + +declare module 'dayjs/esm' { + interface ConfigTypeMap { + bigIntSupport: BigInt + } + export function unix(t: BigInt): Dayjs +} + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/bigIntSupport/index.js b/node_modules/dayjs/esm/plugin/bigIntSupport/index.js new file mode 100644 index 00000000..fa939821 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/bigIntSupport/index.js @@ -0,0 +1,32 @@ +// eslint-disable-next-line valid-typeof +var isBigInt = function isBigInt(num) { + return typeof num === 'bigint'; +}; + +export default (function (o, c, dayjs) { + var proto = c.prototype; + + var parseDate = function parseDate(cfg) { + var date = cfg.date; + + if (isBigInt(date)) { + return Number(date); + } + + return date; + }; + + var oldParse = proto.parse; + + proto.parse = function (cfg) { + cfg.date = parseDate.bind(this)(cfg); + oldParse.bind(this)(cfg); + }; + + var oldUnix = dayjs.unix; + + dayjs.unix = function (timestamp) { + var ts = isBigInt(timestamp) ? Number(timestamp) : timestamp; + return oldUnix(ts); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts b/node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts new file mode 100644 index 00000000..a17c8963 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/buddhistEra/index.js b/node_modules/dayjs/esm/plugin/buddhistEra/index.js new file mode 100644 index 00000000..76ce44cc --- /dev/null +++ b/node_modules/dayjs/esm/plugin/buddhistEra/index.js @@ -0,0 +1,21 @@ +import { FORMAT_DEFAULT } from '../../constant'; +export default (function (o, c) { + // locale needed later + var proto = c.prototype; + var oldFormat = proto.format; // extend en locale here + + proto.format = function (formatStr) { + var _this = this; + + var yearBias = 543; + var str = formatStr || FORMAT_DEFAULT; + var result = str.replace(/(\[[^\]]+])|BBBB|BB/g, function (match, a) { + var _this$$utils; + + var year = String(_this.$y + yearBias); + var args = match === 'BB' ? [year.slice(-2), 2] : [year, 4]; + return a || (_this$$utils = _this.$utils()).s.apply(_this$$utils, args.concat(['0'])); + }); + return oldFormat.bind(this)(result); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/calendar/index.d.ts b/node_modules/dayjs/esm/plugin/calendar/index.d.ts new file mode 100644 index 00000000..42bff4bf --- /dev/null +++ b/node_modules/dayjs/esm/plugin/calendar/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc, ConfigType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + calendar(referenceTime?: ConfigType, formats?: object): string + } +} diff --git a/node_modules/dayjs/esm/plugin/calendar/index.js b/node_modules/dayjs/esm/plugin/calendar/index.js new file mode 100644 index 00000000..9abf1e90 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/calendar/index.js @@ -0,0 +1,32 @@ +export default (function (o, c, d) { + var LT = 'h:mm A'; + var L = 'MM/DD/YYYY'; + var calendarFormat = { + lastDay: "[Yesterday at] " + LT, + sameDay: "[Today at] " + LT, + nextDay: "[Tomorrow at] " + LT, + nextWeek: "dddd [at] " + LT, + lastWeek: "[Last] dddd [at] " + LT, + sameElse: L + }; + var proto = c.prototype; + + proto.calendar = function (referenceTime, formats) { + var format = formats || this.$locale().calendar || calendarFormat; + var referenceStartOfDay = d(referenceTime || undefined).startOf('d'); + var diff = this.diff(referenceStartOfDay, 'd', true); + var sameElse = 'sameElse'; + /* eslint-disable no-nested-ternary */ + + var retVal = diff < -6 ? sameElse : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : sameElse; + /* eslint-enable no-nested-ternary */ + + var currentFormat = format[retVal] || calendarFormat[retVal]; + + if (typeof currentFormat === 'function') { + return currentFormat.call(this, d()); + } + + return this.format(currentFormat); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/customParseFormat/index.d.ts b/node_modules/dayjs/esm/plugin/customParseFormat/index.d.ts new file mode 100644 index 00000000..7da585e6 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/customParseFormat/index.d.ts @@ -0,0 +1,8 @@ +import { PluginFunc } from 'dayjs/esm' + +declare interface PluginOptions { + parseTwoDigitYear?: (yearString: string) => number +} + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/customParseFormat/index.js b/node_modules/dayjs/esm/plugin/customParseFormat/index.js new file mode 100644 index 00000000..1fd59368 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/customParseFormat/index.js @@ -0,0 +1,320 @@ +import { u } from '../localizedFormat/utils'; +var formattingTokens = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g; +var match1 = /\d/; // 0 - 9 + +var match2 = /\d\d/; // 00 - 99 + +var match3 = /\d{3}/; // 000 - 999 + +var match4 = /\d{4}/; // 0000 - 9999 + +var match1to2 = /\d\d?/; // 0 - 99 + +var matchSigned = /[+-]?\d+/; // -inf - inf + +var matchOffset = /[+-]\d\d:?(\d\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z + +var matchWord = /\d*[^-_:/,()\s\d]+/; // Word + +var locale = {}; + +var parseTwoDigitYear = function parseTwoDigitYear(input) { + input = +input; + return input + (input > 68 ? 1900 : 2000); +}; + +function offsetFromString(string) { + if (!string) return 0; + if (string === 'Z') return 0; + var parts = string.match(/([+-]|\d\d)/g); + var minutes = +(parts[1] * 60) + (+parts[2] || 0); + return minutes === 0 ? 0 : parts[0] === '+' ? -minutes : minutes; // eslint-disable-line no-nested-ternary +} + +var addInput = function addInput(property) { + return function (input) { + this[property] = +input; + }; +}; + +var zoneExpressions = [matchOffset, function (input) { + var zone = this.zone || (this.zone = {}); + zone.offset = offsetFromString(input); +}]; + +var getLocalePart = function getLocalePart(name) { + var part = locale[name]; + return part && (part.indexOf ? part : part.s.concat(part.f)); +}; + +var meridiemMatch = function meridiemMatch(input, isLowerCase) { + var isAfternoon; + var _locale = locale, + meridiem = _locale.meridiem; + + if (!meridiem) { + isAfternoon = input === (isLowerCase ? 'pm' : 'PM'); + } else { + for (var i = 1; i <= 24; i += 1) { + // todo: fix input === meridiem(i, 0, isLowerCase) + if (input.indexOf(meridiem(i, 0, isLowerCase)) > -1) { + isAfternoon = i > 12; + break; + } + } + } + + return isAfternoon; +}; + +var expressions = { + A: [matchWord, function (input) { + this.afternoon = meridiemMatch(input, false); + }], + a: [matchWord, function (input) { + this.afternoon = meridiemMatch(input, true); + }], + S: [match1, function (input) { + this.milliseconds = +input * 100; + }], + SS: [match2, function (input) { + this.milliseconds = +input * 10; + }], + SSS: [match3, function (input) { + this.milliseconds = +input; + }], + s: [match1to2, addInput('seconds')], + ss: [match1to2, addInput('seconds')], + m: [match1to2, addInput('minutes')], + mm: [match1to2, addInput('minutes')], + H: [match1to2, addInput('hours')], + h: [match1to2, addInput('hours')], + HH: [match1to2, addInput('hours')], + hh: [match1to2, addInput('hours')], + D: [match1to2, addInput('day')], + DD: [match2, addInput('day')], + Do: [matchWord, function (input) { + var _locale2 = locale, + ordinal = _locale2.ordinal; + + var _input$match = input.match(/\d+/); + + this.day = _input$match[0]; + if (!ordinal) return; + + for (var i = 1; i <= 31; i += 1) { + if (ordinal(i).replace(/\[|\]/g, '') === input) { + this.day = i; + } + } + }], + M: [match1to2, addInput('month')], + MM: [match2, addInput('month')], + MMM: [matchWord, function (input) { + var months = getLocalePart('months'); + var monthsShort = getLocalePart('monthsShort'); + var matchIndex = (monthsShort || months.map(function (_) { + return _.slice(0, 3); + })).indexOf(input) + 1; + + if (matchIndex < 1) { + throw new Error(); + } + + this.month = matchIndex % 12 || matchIndex; + }], + MMMM: [matchWord, function (input) { + var months = getLocalePart('months'); + var matchIndex = months.indexOf(input) + 1; + + if (matchIndex < 1) { + throw new Error(); + } + + this.month = matchIndex % 12 || matchIndex; + }], + Y: [matchSigned, addInput('year')], + YY: [match2, function (input) { + this.year = parseTwoDigitYear(input); + }], + YYYY: [match4, addInput('year')], + Z: zoneExpressions, + ZZ: zoneExpressions +}; + +function correctHours(time) { + var afternoon = time.afternoon; + + if (afternoon !== undefined) { + var hours = time.hours; + + if (afternoon) { + if (hours < 12) { + time.hours += 12; + } + } else if (hours === 12) { + time.hours = 0; + } + + delete time.afternoon; + } +} + +function makeParser(format) { + format = u(format, locale && locale.formats); + var array = format.match(formattingTokens); + var length = array.length; + + for (var i = 0; i < length; i += 1) { + var token = array[i]; + var parseTo = expressions[token]; + var regex = parseTo && parseTo[0]; + var parser = parseTo && parseTo[1]; + + if (parser) { + array[i] = { + regex: regex, + parser: parser + }; + } else { + array[i] = token.replace(/^\[|\]$/g, ''); + } + } + + return function (input) { + var time = {}; + + for (var _i = 0, start = 0; _i < length; _i += 1) { + var _token = array[_i]; + + if (typeof _token === 'string') { + start += _token.length; + } else { + var _regex = _token.regex, + _parser = _token.parser; + var part = input.slice(start); + + var match = _regex.exec(part); + + var value = match[0]; + + _parser.call(time, value); + + input = input.replace(value, ''); + } + } + + correctHours(time); + return time; + }; +} + +var parseFormattedInput = function parseFormattedInput(input, format, utc) { + try { + if (['x', 'X'].indexOf(format) > -1) return new Date((format === 'X' ? 1000 : 1) * input); + var parser = makeParser(format); + + var _parser2 = parser(input), + year = _parser2.year, + month = _parser2.month, + day = _parser2.day, + hours = _parser2.hours, + minutes = _parser2.minutes, + seconds = _parser2.seconds, + milliseconds = _parser2.milliseconds, + zone = _parser2.zone; + + var now = new Date(); + var d = day || (!year && !month ? now.getDate() : 1); + var y = year || now.getFullYear(); + var M = 0; + + if (!(year && !month)) { + M = month > 0 ? month - 1 : now.getMonth(); + } + + var h = hours || 0; + var m = minutes || 0; + var s = seconds || 0; + var ms = milliseconds || 0; + + if (zone) { + return new Date(Date.UTC(y, M, d, h, m, s, ms + zone.offset * 60 * 1000)); + } + + if (utc) { + return new Date(Date.UTC(y, M, d, h, m, s, ms)); + } + + return new Date(y, M, d, h, m, s, ms); + } catch (e) { + return new Date(''); // Invalid Date + } +}; + +export default (function (o, C, d) { + d.p.customParseFormat = true; + + if (o && o.parseTwoDigitYear) { + parseTwoDigitYear = o.parseTwoDigitYear; + } + + var proto = C.prototype; + var oldParse = proto.parse; + + proto.parse = function (cfg) { + var date = cfg.date, + utc = cfg.utc, + args = cfg.args; + this.$u = utc; + var format = args[1]; + + if (typeof format === 'string') { + var isStrictWithoutLocale = args[2] === true; + var isStrictWithLocale = args[3] === true; + var isStrict = isStrictWithoutLocale || isStrictWithLocale; + var pl = args[2]; + + if (isStrictWithLocale) { + pl = args[2]; + } + + locale = this.$locale(); + + if (!isStrictWithoutLocale && pl) { + locale = d.Ls[pl]; + } + + this.$d = parseFormattedInput(date, format, utc); + this.init(); + if (pl && pl !== true) this.$L = this.locale(pl).$L; // use != to treat + // input number 1410715640579 and format string '1410715640579' equal + // eslint-disable-next-line eqeqeq + + if (isStrict && date != this.format(format)) { + this.$d = new Date(''); + } // reset global locale to make parallel unit test + + + locale = {}; + } else if (format instanceof Array) { + var len = format.length; + + for (var i = 1; i <= len; i += 1) { + args[1] = format[i - 1]; + var result = d.apply(this, args); + + if (result.isValid()) { + this.$d = result.$d; + this.$L = result.$L; + this.init(); + break; + } + + if (i === len) this.$d = new Date(''); + } + } else { + oldParse.call(this, cfg); + } + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/dayOfYear/index.d.ts b/node_modules/dayjs/esm/plugin/dayOfYear/index.d.ts new file mode 100644 index 00000000..4b9601e7 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/dayOfYear/index.d.ts @@ -0,0 +1,11 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + dayOfYear(): number + dayOfYear(value: number): Dayjs + } +} diff --git a/node_modules/dayjs/esm/plugin/dayOfYear/index.js b/node_modules/dayjs/esm/plugin/dayOfYear/index.js new file mode 100644 index 00000000..0cb11580 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/dayOfYear/index.js @@ -0,0 +1,9 @@ +export default (function (o, c, d) { + var proto = c.prototype; + + proto.dayOfYear = function (input) { + // d(this) is for badMutable + var dayOfYear = Math.round((d(this).startOf('day') - d(this).startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add(input - dayOfYear, 'day'); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/devHelper/index.d.ts b/node_modules/dayjs/esm/plugin/devHelper/index.d.ts new file mode 100644 index 00000000..a17c8963 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/devHelper/index.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/devHelper/index.js b/node_modules/dayjs/esm/plugin/devHelper/index.js new file mode 100644 index 00000000..9e2af827 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/devHelper/index.js @@ -0,0 +1,38 @@ +/* eslint-disable no-console */ +export default (function (o, c, d) { + /* istanbul ignore next line */ + if (!process || process.env.NODE_ENV !== 'production') { + var proto = c.prototype; + var oldParse = proto.parse; + + proto.parse = function (cfg) { + var date = cfg.date; + + if (typeof date === 'string' && date.length === 13) { + console.warn("To parse a Unix timestamp like " + date + ", you should pass it as a Number. https://day.js.org/docs/en/parse/unix-timestamp-milliseconds"); + } + + if (typeof date === 'number' && String(date).length === 4) { + console.warn("Guessing you may want to parse the Year " + date + ", you should pass it as a String " + date + ", not a Number. Otherwise, " + date + " will be treated as a Unix timestamp"); + } + + if (cfg.args.length >= 2 && !d.p.customParseFormat) { + console.warn("To parse a date-time string like " + date + " using the given format, you should enable customParseFormat plugin first. https://day.js.org/docs/en/parse/string-format"); + } + + return oldParse.bind(this)(cfg); + }; + + var oldLocale = d.locale; + + d.locale = function (preset, object, isLocal) { + if (typeof object === 'undefined' && typeof preset === 'string') { + if (!d.Ls[preset]) { + console.warn("Guessing you may want to use locale " + preset + ", you have to load it before using it. https://day.js.org/docs/en/i18n/loading-into-nodejs"); + } + } + + return oldLocale(preset, object, isLocal); + }; + } +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/duration/index.d.ts b/node_modules/dayjs/esm/plugin/duration/index.d.ts new file mode 100644 index 00000000..dc974a54 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/duration/index.d.ts @@ -0,0 +1,88 @@ +import { PluginFunc } from 'dayjs/esm' +import { OpUnitType, UnitTypeLongPlural } from 'dayjs/esm'; + +declare const plugin: PluginFunc +export as namespace plugin; +export = plugin + +declare namespace plugin { + /** + * @deprecated Please use more strict types + */ + type DurationInputType = string | number | object + /** + * @deprecated Please use more strict types + */ + type DurationAddType = number | object | Duration + + type DurationUnitsObjectType = Partial<{ + [unit in Exclude | "weeks"]: number + }>; + type DurationUnitType = Exclude + type CreateDurationType = + ((units: DurationUnitsObjectType) => Duration) + & ((time: number, unit?: DurationUnitType) => Duration) + & ((ISO_8601: string) => Duration) + type AddDurationType = CreateDurationType & ((duration: Duration) => Duration) + + interface Duration { + new (input: string | number | object, unit?: string, locale?: string): Duration + + clone(): Duration + + humanize(withSuffix?: boolean): string + + milliseconds(): number + asMilliseconds(): number + + seconds(): number + asSeconds(): number + + minutes(): number + asMinutes(): number + + hours(): number + asHours(): number + + days(): number + asDays(): number + + weeks(): number + asWeeks(): number + + months(): number + asMonths(): number + + years(): number + asYears(): number + + as(unit: DurationUnitType): number + + get(unit: DurationUnitType): number + + add: AddDurationType + + subtract: AddDurationType + + toJSON(): string + + toISOString(): string + + format(formatStr?: string): string + + locale(locale: string): Duration + } +} + +declare module 'dayjs/esm' { + interface Dayjs { + add(duration: plugin.Duration): Dayjs + subtract(duration: plugin.Duration): Dayjs + } + + /** + * @param time If unit is not present, time treated as number of milliseconds + */ + export const duration: plugin.CreateDurationType; + export function isDuration(d: any): d is plugin.Duration +} \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/duration/index.js b/node_modules/dayjs/esm/plugin/duration/index.js new file mode 100644 index 00000000..a241d4b2 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/duration/index.js @@ -0,0 +1,356 @@ +import { MILLISECONDS_A_DAY, MILLISECONDS_A_HOUR, MILLISECONDS_A_MINUTE, MILLISECONDS_A_SECOND, MILLISECONDS_A_WEEK, REGEX_FORMAT } from '../../constant'; +var MILLISECONDS_A_YEAR = MILLISECONDS_A_DAY * 365; +var MILLISECONDS_A_MONTH = MILLISECONDS_A_YEAR / 12; +var durationRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; +var unitToMS = { + years: MILLISECONDS_A_YEAR, + months: MILLISECONDS_A_MONTH, + days: MILLISECONDS_A_DAY, + hours: MILLISECONDS_A_HOUR, + minutes: MILLISECONDS_A_MINUTE, + seconds: MILLISECONDS_A_SECOND, + milliseconds: 1, + weeks: MILLISECONDS_A_WEEK +}; + +var isDuration = function isDuration(d) { + return d instanceof Duration; +}; // eslint-disable-line no-use-before-define + + +var $d; +var $u; + +var wrapper = function wrapper(input, instance, unit) { + return new Duration(input, unit, instance.$l); +}; // eslint-disable-line no-use-before-define + + +var prettyUnit = function prettyUnit(unit) { + return $u.p(unit) + "s"; +}; + +var isNegative = function isNegative(number) { + return number < 0; +}; + +var roundNumber = function roundNumber(number) { + return isNegative(number) ? Math.ceil(number) : Math.floor(number); +}; + +var absolute = function absolute(number) { + return Math.abs(number); +}; + +var getNumberUnitFormat = function getNumberUnitFormat(number, unit) { + if (!number) { + return { + negative: false, + format: '' + }; + } + + if (isNegative(number)) { + return { + negative: true, + format: "" + absolute(number) + unit + }; + } + + return { + negative: false, + format: "" + number + unit + }; +}; + +var Duration = /*#__PURE__*/function () { + function Duration(input, unit, locale) { + var _this = this; + + this.$d = {}; + this.$l = locale; + + if (input === undefined) { + this.$ms = 0; + this.parseFromMilliseconds(); + } + + if (unit) { + return wrapper(input * unitToMS[prettyUnit(unit)], this); + } + + if (typeof input === 'number') { + this.$ms = input; + this.parseFromMilliseconds(); + return this; + } + + if (typeof input === 'object') { + Object.keys(input).forEach(function (k) { + _this.$d[prettyUnit(k)] = input[k]; + }); + this.calMilliseconds(); + return this; + } + + if (typeof input === 'string') { + var d = input.match(durationRegex); + + if (d) { + var properties = d.slice(2); + var numberD = properties.map(function (value) { + return value != null ? Number(value) : 0; + }); + this.$d.years = numberD[0]; + this.$d.months = numberD[1]; + this.$d.weeks = numberD[2]; + this.$d.days = numberD[3]; + this.$d.hours = numberD[4]; + this.$d.minutes = numberD[5]; + this.$d.seconds = numberD[6]; + this.calMilliseconds(); + return this; + } + } + + return this; + } + + var _proto = Duration.prototype; + + _proto.calMilliseconds = function calMilliseconds() { + var _this2 = this; + + this.$ms = Object.keys(this.$d).reduce(function (total, unit) { + return total + (_this2.$d[unit] || 0) * unitToMS[unit]; + }, 0); + }; + + _proto.parseFromMilliseconds = function parseFromMilliseconds() { + var $ms = this.$ms; + this.$d.years = roundNumber($ms / MILLISECONDS_A_YEAR); + $ms %= MILLISECONDS_A_YEAR; + this.$d.months = roundNumber($ms / MILLISECONDS_A_MONTH); + $ms %= MILLISECONDS_A_MONTH; + this.$d.days = roundNumber($ms / MILLISECONDS_A_DAY); + $ms %= MILLISECONDS_A_DAY; + this.$d.hours = roundNumber($ms / MILLISECONDS_A_HOUR); + $ms %= MILLISECONDS_A_HOUR; + this.$d.minutes = roundNumber($ms / MILLISECONDS_A_MINUTE); + $ms %= MILLISECONDS_A_MINUTE; + this.$d.seconds = roundNumber($ms / MILLISECONDS_A_SECOND); + $ms %= MILLISECONDS_A_SECOND; + this.$d.milliseconds = $ms; + }; + + _proto.toISOString = function toISOString() { + var Y = getNumberUnitFormat(this.$d.years, 'Y'); + var M = getNumberUnitFormat(this.$d.months, 'M'); + var days = +this.$d.days || 0; + + if (this.$d.weeks) { + days += this.$d.weeks * 7; + } + + var D = getNumberUnitFormat(days, 'D'); + var H = getNumberUnitFormat(this.$d.hours, 'H'); + var m = getNumberUnitFormat(this.$d.minutes, 'M'); + var seconds = this.$d.seconds || 0; + + if (this.$d.milliseconds) { + seconds += this.$d.milliseconds / 1000; + seconds = Math.round(seconds * 1000) / 1000; + } + + var S = getNumberUnitFormat(seconds, 'S'); + var negativeMode = Y.negative || M.negative || D.negative || H.negative || m.negative || S.negative; + var T = H.format || m.format || S.format ? 'T' : ''; + var P = negativeMode ? '-' : ''; + var result = P + "P" + Y.format + M.format + D.format + T + H.format + m.format + S.format; + return result === 'P' || result === '-P' ? 'P0D' : result; + }; + + _proto.toJSON = function toJSON() { + return this.toISOString(); + }; + + _proto.format = function format(formatStr) { + var str = formatStr || 'YYYY-MM-DDTHH:mm:ss'; + var matches = { + Y: this.$d.years, + YY: $u.s(this.$d.years, 2, '0'), + YYYY: $u.s(this.$d.years, 4, '0'), + M: this.$d.months, + MM: $u.s(this.$d.months, 2, '0'), + D: this.$d.days, + DD: $u.s(this.$d.days, 2, '0'), + H: this.$d.hours, + HH: $u.s(this.$d.hours, 2, '0'), + m: this.$d.minutes, + mm: $u.s(this.$d.minutes, 2, '0'), + s: this.$d.seconds, + ss: $u.s(this.$d.seconds, 2, '0'), + SSS: $u.s(this.$d.milliseconds, 3, '0') + }; + return str.replace(REGEX_FORMAT, function (match, $1) { + return $1 || String(matches[match]); + }); + }; + + _proto.as = function as(unit) { + return this.$ms / unitToMS[prettyUnit(unit)]; + }; + + _proto.get = function get(unit) { + var base = this.$ms; + var pUnit = prettyUnit(unit); + + if (pUnit === 'milliseconds') { + base %= 1000; + } else if (pUnit === 'weeks') { + base = roundNumber(base / unitToMS[pUnit]); + } else { + base = this.$d[pUnit]; + } + + return base || 0; // a === 0 will be true on both 0 and -0 + }; + + _proto.add = function add(input, unit, isSubtract) { + var another; + + if (unit) { + another = input * unitToMS[prettyUnit(unit)]; + } else if (isDuration(input)) { + another = input.$ms; + } else { + another = wrapper(input, this).$ms; + } + + return wrapper(this.$ms + another * (isSubtract ? -1 : 1), this); + }; + + _proto.subtract = function subtract(input, unit) { + return this.add(input, unit, true); + }; + + _proto.locale = function locale(l) { + var that = this.clone(); + that.$l = l; + return that; + }; + + _proto.clone = function clone() { + return wrapper(this.$ms, this); + }; + + _proto.humanize = function humanize(withSuffix) { + return $d().add(this.$ms, 'ms').locale(this.$l).fromNow(!withSuffix); + }; + + _proto.valueOf = function valueOf() { + return this.asMilliseconds(); + }; + + _proto.milliseconds = function milliseconds() { + return this.get('milliseconds'); + }; + + _proto.asMilliseconds = function asMilliseconds() { + return this.as('milliseconds'); + }; + + _proto.seconds = function seconds() { + return this.get('seconds'); + }; + + _proto.asSeconds = function asSeconds() { + return this.as('seconds'); + }; + + _proto.minutes = function minutes() { + return this.get('minutes'); + }; + + _proto.asMinutes = function asMinutes() { + return this.as('minutes'); + }; + + _proto.hours = function hours() { + return this.get('hours'); + }; + + _proto.asHours = function asHours() { + return this.as('hours'); + }; + + _proto.days = function days() { + return this.get('days'); + }; + + _proto.asDays = function asDays() { + return this.as('days'); + }; + + _proto.weeks = function weeks() { + return this.get('weeks'); + }; + + _proto.asWeeks = function asWeeks() { + return this.as('weeks'); + }; + + _proto.months = function months() { + return this.get('months'); + }; + + _proto.asMonths = function asMonths() { + return this.as('months'); + }; + + _proto.years = function years() { + return this.get('years'); + }; + + _proto.asYears = function asYears() { + return this.as('years'); + }; + + return Duration; +}(); + +var manipulateDuration = function manipulateDuration(date, duration, k) { + return date.add(duration.years() * k, 'y').add(duration.months() * k, 'M').add(duration.days() * k, 'd').add(duration.hours() * k, 'h').add(duration.minutes() * k, 'm').add(duration.seconds() * k, 's').add(duration.milliseconds() * k, 'ms'); +}; + +export default (function (option, Dayjs, dayjs) { + $d = dayjs; + $u = dayjs().$utils(); + + dayjs.duration = function (input, unit) { + var $l = dayjs.locale(); + return wrapper(input, { + $l: $l + }, unit); + }; + + dayjs.isDuration = isDuration; + var oldAdd = Dayjs.prototype.add; + var oldSubtract = Dayjs.prototype.subtract; + + Dayjs.prototype.add = function (value, unit) { + if (isDuration(value)) { + return manipulateDuration(this, value, 1); + } + + return oldAdd.bind(this)(value, unit); + }; + + Dayjs.prototype.subtract = function (value, unit) { + if (isDuration(value)) { + return manipulateDuration(this, value, -1); + } + + return oldSubtract.bind(this)(value, unit); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isBetween/index.d.ts b/node_modules/dayjs/esm/plugin/isBetween/index.d.ts new file mode 100644 index 00000000..1c62711c --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isBetween/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + isBetween(a: ConfigType, b: ConfigType, c?: OpUnitType | null, d?: '()' | '[]' | '[)' | '(]'): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/isBetween/index.js b/node_modules/dayjs/esm/plugin/isBetween/index.js new file mode 100644 index 00000000..2182a895 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isBetween/index.js @@ -0,0 +1,10 @@ +export default (function (o, c, d) { + c.prototype.isBetween = function (a, b, u, i) { + var dA = d(a); + var dB = d(b); + i = i || '()'; + var dAi = i[0] === '('; + var dBi = i[1] === ')'; + return (dAi ? this.isAfter(dA, u) : !this.isBefore(dA, u)) && (dBi ? this.isBefore(dB, u) : !this.isAfter(dB, u)) || (dAi ? this.isBefore(dA, u) : !this.isAfter(dA, u)) && (dBi ? this.isAfter(dB, u) : !this.isBefore(dB, u)); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isLeapYear/index.d.ts b/node_modules/dayjs/esm/plugin/isLeapYear/index.d.ts new file mode 100644 index 00000000..627ec5a8 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isLeapYear/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + isLeapYear(): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/isLeapYear/index.js b/node_modules/dayjs/esm/plugin/isLeapYear/index.js new file mode 100644 index 00000000..bf1309d0 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isLeapYear/index.js @@ -0,0 +1,7 @@ +export default (function (o, c) { + var proto = c.prototype; + + proto.isLeapYear = function () { + return this.$y % 4 === 0 && this.$y % 100 !== 0 || this.$y % 400 === 0; + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isMoment/index.d.ts b/node_modules/dayjs/esm/plugin/isMoment/index.d.ts new file mode 100644 index 00000000..6e3a69f1 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isMoment/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + + export function isMoment(input: any): boolean + +} diff --git a/node_modules/dayjs/esm/plugin/isMoment/index.js b/node_modules/dayjs/esm/plugin/isMoment/index.js new file mode 100644 index 00000000..48c8a895 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isMoment/index.js @@ -0,0 +1,5 @@ +export default (function (o, c, f) { + f.isMoment = function (input) { + return f.isDayjs(input); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isSameOrAfter/index.d.ts b/node_modules/dayjs/esm/plugin/isSameOrAfter/index.d.ts new file mode 100644 index 00000000..7b6d2396 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isSameOrAfter/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + isSameOrAfter(date?: ConfigType, unit?: OpUnitType): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/isSameOrAfter/index.js b/node_modules/dayjs/esm/plugin/isSameOrAfter/index.js new file mode 100644 index 00000000..6a5c56f0 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isSameOrAfter/index.js @@ -0,0 +1,5 @@ +export default (function (o, c) { + c.prototype.isSameOrAfter = function (that, units) { + return this.isSame(that, units) || this.isAfter(that, units); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isSameOrBefore/index.d.ts b/node_modules/dayjs/esm/plugin/isSameOrBefore/index.d.ts new file mode 100644 index 00000000..7ec009f4 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isSameOrBefore/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + isSameOrBefore(date?: ConfigType, unit?: OpUnitType): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/isSameOrBefore/index.js b/node_modules/dayjs/esm/plugin/isSameOrBefore/index.js new file mode 100644 index 00000000..18d526a4 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isSameOrBefore/index.js @@ -0,0 +1,5 @@ +export default (function (o, c) { + c.prototype.isSameOrBefore = function (that, units) { + return this.isSame(that, units) || this.isBefore(that, units); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isToday/index.d.ts b/node_modules/dayjs/esm/plugin/isToday/index.d.ts new file mode 100644 index 00000000..8d55da8d --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isToday/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + isToday(): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/isToday/index.js b/node_modules/dayjs/esm/plugin/isToday/index.js new file mode 100644 index 00000000..93b36c80 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isToday/index.js @@ -0,0 +1,9 @@ +export default (function (o, c, d) { + var proto = c.prototype; + + proto.isToday = function () { + var comparisonTemplate = 'YYYY-MM-DD'; + var now = d(); + return this.format(comparisonTemplate) === now.format(comparisonTemplate); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isTomorrow/index.d.ts b/node_modules/dayjs/esm/plugin/isTomorrow/index.d.ts new file mode 100644 index 00000000..76522375 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isTomorrow/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + isTomorrow(): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/isTomorrow/index.js b/node_modules/dayjs/esm/plugin/isTomorrow/index.js new file mode 100644 index 00000000..8cc7238d --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isTomorrow/index.js @@ -0,0 +1,9 @@ +export default (function (o, c, d) { + var proto = c.prototype; + + proto.isTomorrow = function () { + var comparisonTemplate = 'YYYY-MM-DD'; + var tomorrow = d().add(1, 'day'); + return this.format(comparisonTemplate) === tomorrow.format(comparisonTemplate); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isYesterday/index.d.ts b/node_modules/dayjs/esm/plugin/isYesterday/index.d.ts new file mode 100644 index 00000000..f4370dc6 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isYesterday/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + isYesterday(): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/isYesterday/index.js b/node_modules/dayjs/esm/plugin/isYesterday/index.js new file mode 100644 index 00000000..fa55373c --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isYesterday/index.js @@ -0,0 +1,9 @@ +export default (function (o, c, d) { + var proto = c.prototype; + + proto.isYesterday = function () { + var comparisonTemplate = 'YYYY-MM-DD'; + var yesterday = d().subtract(1, 'day'); + return this.format(comparisonTemplate) === yesterday.format(comparisonTemplate); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isoWeek/index.d.ts b/node_modules/dayjs/esm/plugin/isoWeek/index.d.ts new file mode 100644 index 00000000..6e6a75a7 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isoWeek/index.d.ts @@ -0,0 +1,27 @@ +import { PluginFunc, OpUnitType, ConfigType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +type ISOUnitType = OpUnitType | 'isoWeek'; + +declare module 'dayjs/esm' { + interface Dayjs { + isoWeekYear(): number + isoWeek(): number + isoWeek(value: number): Dayjs + + isoWeekday(): number + isoWeekday(value: number): Dayjs + + startOf(unit: ISOUnitType): Dayjs + + endOf(unit: ISOUnitType): Dayjs + + isSame(date?: ConfigType, unit?: ISOUnitType): boolean + + isBefore(date?: ConfigType, unit?: ISOUnitType): boolean + + isAfter(date?: ConfigType, unit?: ISOUnitType): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/isoWeek/index.js b/node_modules/dayjs/esm/plugin/isoWeek/index.js new file mode 100644 index 00000000..289ea7ca --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isoWeek/index.js @@ -0,0 +1,57 @@ +import { D, W, Y } from '../../constant'; +var isoWeekPrettyUnit = 'isoweek'; +export default (function (o, c, d) { + var getYearFirstThursday = function getYearFirstThursday(year, isUtc) { + var yearFirstDay = (isUtc ? d.utc : d)().year(year).startOf(Y); + var addDiffDays = 4 - yearFirstDay.isoWeekday(); + + if (yearFirstDay.isoWeekday() > 4) { + addDiffDays += 7; + } + + return yearFirstDay.add(addDiffDays, D); + }; + + var getCurrentWeekThursday = function getCurrentWeekThursday(ins) { + return ins.add(4 - ins.isoWeekday(), D); + }; + + var proto = c.prototype; + + proto.isoWeekYear = function () { + var nowWeekThursday = getCurrentWeekThursday(this); + return nowWeekThursday.year(); + }; + + proto.isoWeek = function (week) { + if (!this.$utils().u(week)) { + return this.add((week - this.isoWeek()) * 7, D); + } + + var nowWeekThursday = getCurrentWeekThursday(this); + var diffWeekThursday = getYearFirstThursday(this.isoWeekYear(), this.$u); + return nowWeekThursday.diff(diffWeekThursday, W) + 1; + }; + + proto.isoWeekday = function (week) { + if (!this.$utils().u(week)) { + return this.day(this.day() % 7 ? week : week - 7); + } + + return this.day() || 7; + }; + + var oldStartOf = proto.startOf; + + proto.startOf = function (units, startOf) { + var utils = this.$utils(); + var isStartOf = !utils.u(startOf) ? startOf : true; + var unit = utils.p(units); + + if (unit === isoWeekPrettyUnit) { + return isStartOf ? this.date(this.date() - (this.isoWeekday() - 1)).startOf('day') : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf('day'); + } + + return oldStartOf.bind(this)(units, startOf); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.d.ts b/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.d.ts new file mode 100644 index 00000000..986360fa --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + isoWeeksInYear(): number + } +} diff --git a/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.js b/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.js new file mode 100644 index 00000000..71618942 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/isoWeeksInYear/index.js @@ -0,0 +1,15 @@ +export default (function (o, c) { + var proto = c.prototype; + + proto.isoWeeksInYear = function () { + var isLeapYear = this.isLeapYear(); + var last = this.endOf('y'); + var day = last.day(); + + if (day === 4 || isLeapYear && day === 5) { + return 53; + } + + return 52; + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/localeData/index.d.ts b/node_modules/dayjs/esm/plugin/localeData/index.d.ts new file mode 100644 index 00000000..9f8762ed --- /dev/null +++ b/node_modules/dayjs/esm/plugin/localeData/index.d.ts @@ -0,0 +1,44 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + type WeekdayNames = [string, string, string, string, string, string, string]; + type MonthNames = [string, string, string, string, string, string, string, string, string, string, string, string]; + + interface InstanceLocaleDataReturn { + firstDayOfWeek(): number; + weekdays(instance?: Dayjs): WeekdayNames; + weekdaysShort(instance?: Dayjs): WeekdayNames; + weekdaysMin(instance?: Dayjs): WeekdayNames; + months(instance?: Dayjs): MonthNames; + monthsShort(instance?: Dayjs): MonthNames; + longDateFormat(format: string): string; + meridiem(hour?: number, minute?: number, isLower?: boolean): string; + ordinal(n: number): string + } + + interface GlobalLocaleDataReturn { + firstDayOfWeek(): number; + weekdays(): WeekdayNames; + weekdaysShort(): WeekdayNames; + weekdaysMin(): WeekdayNames; + months(): MonthNames; + monthsShort(): MonthNames; + longDateFormat(format: string): string; + meridiem(hour?: number, minute?: number, isLower?: boolean): string; + ordinal(n: number): string + } + + interface Dayjs { + localeData(): InstanceLocaleDataReturn; + } + + export function weekdays(localOrder?: boolean): WeekdayNames; + export function weekdaysShort(localOrder?: boolean): WeekdayNames; + export function weekdaysMin(localOrder?: boolean): WeekdayNames; + export function monthsShort(): MonthNames; + export function months(): MonthNames; + export function localeData(): GlobalLocaleDataReturn; +} diff --git a/node_modules/dayjs/esm/plugin/localeData/index.js b/node_modules/dayjs/esm/plugin/localeData/index.js new file mode 100644 index 00000000..c48d92cb --- /dev/null +++ b/node_modules/dayjs/esm/plugin/localeData/index.js @@ -0,0 +1,114 @@ +import { t } from '../localizedFormat/utils'; +export default (function (o, c, dayjs) { + // locale needed later + var proto = c.prototype; + + var getLocalePart = function getLocalePart(part) { + return part && (part.indexOf ? part : part.s); + }; + + var getShort = function getShort(ins, target, full, num, localeOrder) { + var locale = ins.name ? ins : ins.$locale(); + var targetLocale = getLocalePart(locale[target]); + var fullLocale = getLocalePart(locale[full]); + var result = targetLocale || fullLocale.map(function (f) { + return f.slice(0, num); + }); + if (!localeOrder) return result; + var weekStart = locale.weekStart; + return result.map(function (_, index) { + return result[(index + (weekStart || 0)) % 7]; + }); + }; + + var getDayjsLocaleObject = function getDayjsLocaleObject() { + return dayjs.Ls[dayjs.locale()]; + }; + + var getLongDateFormat = function getLongDateFormat(l, format) { + return l.formats[format] || t(l.formats[format.toUpperCase()]); + }; + + var localeData = function localeData() { + var _this = this; + + return { + months: function months(instance) { + return instance ? instance.format('MMMM') : getShort(_this, 'months'); + }, + monthsShort: function monthsShort(instance) { + return instance ? instance.format('MMM') : getShort(_this, 'monthsShort', 'months', 3); + }, + firstDayOfWeek: function firstDayOfWeek() { + return _this.$locale().weekStart || 0; + }, + weekdays: function weekdays(instance) { + return instance ? instance.format('dddd') : getShort(_this, 'weekdays'); + }, + weekdaysMin: function weekdaysMin(instance) { + return instance ? instance.format('dd') : getShort(_this, 'weekdaysMin', 'weekdays', 2); + }, + weekdaysShort: function weekdaysShort(instance) { + return instance ? instance.format('ddd') : getShort(_this, 'weekdaysShort', 'weekdays', 3); + }, + longDateFormat: function longDateFormat(format) { + return getLongDateFormat(_this.$locale(), format); + }, + meridiem: this.$locale().meridiem, + ordinal: this.$locale().ordinal + }; + }; + + proto.localeData = function () { + return localeData.bind(this)(); + }; + + dayjs.localeData = function () { + var localeObject = getDayjsLocaleObject(); + return { + firstDayOfWeek: function firstDayOfWeek() { + return localeObject.weekStart || 0; + }, + weekdays: function weekdays() { + return dayjs.weekdays(); + }, + weekdaysShort: function weekdaysShort() { + return dayjs.weekdaysShort(); + }, + weekdaysMin: function weekdaysMin() { + return dayjs.weekdaysMin(); + }, + months: function months() { + return dayjs.months(); + }, + monthsShort: function monthsShort() { + return dayjs.monthsShort(); + }, + longDateFormat: function longDateFormat(format) { + return getLongDateFormat(localeObject, format); + }, + meridiem: localeObject.meridiem, + ordinal: localeObject.ordinal + }; + }; + + dayjs.months = function () { + return getShort(getDayjsLocaleObject(), 'months'); + }; + + dayjs.monthsShort = function () { + return getShort(getDayjsLocaleObject(), 'monthsShort', 'months', 3); + }; + + dayjs.weekdays = function (localeOrder) { + return getShort(getDayjsLocaleObject(), 'weekdays', null, null, localeOrder); + }; + + dayjs.weekdaysShort = function (localeOrder) { + return getShort(getDayjsLocaleObject(), 'weekdaysShort', 'weekdays', 3, localeOrder); + }; + + dayjs.weekdaysMin = function (localeOrder) { + return getShort(getDayjsLocaleObject(), 'weekdaysMin', 'weekdays', 2, localeOrder); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/localizedFormat/index.d.ts b/node_modules/dayjs/esm/plugin/localizedFormat/index.d.ts new file mode 100644 index 00000000..a17c8963 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/localizedFormat/index.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/localizedFormat/index.js b/node_modules/dayjs/esm/plugin/localizedFormat/index.js new file mode 100644 index 00000000..9defb1f4 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/localizedFormat/index.js @@ -0,0 +1,20 @@ +import { FORMAT_DEFAULT } from '../../constant'; +import { u, englishFormats } from './utils'; +export default (function (o, c, d) { + var proto = c.prototype; + var oldFormat = proto.format; + d.en.formats = englishFormats; + + proto.format = function (formatStr) { + if (formatStr === void 0) { + formatStr = FORMAT_DEFAULT; + } + + var _this$$locale = this.$locale(), + _this$$locale$formats = _this$$locale.formats, + formats = _this$$locale$formats === void 0 ? {} : _this$$locale$formats; + + var result = u(formatStr, formats); + return oldFormat.call(this, result); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/localizedFormat/utils.js b/node_modules/dayjs/esm/plugin/localizedFormat/utils.js new file mode 100644 index 00000000..1f48eff1 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/localizedFormat/utils.js @@ -0,0 +1,20 @@ +// eslint-disable-next-line import/prefer-default-export +export var t = function t(format) { + return format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (_, a, b) { + return a || b.slice(1); + }); +}; +export var englishFormats = { + LTS: 'h:mm:ss A', + LT: 'h:mm A', + L: 'MM/DD/YYYY', + LL: 'MMMM D, YYYY', + LLL: 'MMMM D, YYYY h:mm A', + LLLL: 'dddd, MMMM D, YYYY h:mm A' +}; +export var u = function u(formatStr, formats) { + return formatStr.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (_, a, b) { + var B = b && b.toUpperCase(); + return a || formats[b] || englishFormats[b] || t(formats[B]); + }); +}; \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/minMax/index.d.ts b/node_modules/dayjs/esm/plugin/minMax/index.d.ts new file mode 100644 index 00000000..143370c4 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/minMax/index.d.ts @@ -0,0 +1,11 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + export function max(dayjs: Dayjs[]): Dayjs | null + export function max(...dayjs: Dayjs[]): Dayjs | null + export function min(dayjs: Dayjs[]): Dayjs | null + export function min(...dayjs: Dayjs[]): Dayjs | null +} diff --git a/node_modules/dayjs/esm/plugin/minMax/index.js b/node_modules/dayjs/esm/plugin/minMax/index.js new file mode 100644 index 00000000..0fd68e9c --- /dev/null +++ b/node_modules/dayjs/esm/plugin/minMax/index.js @@ -0,0 +1,39 @@ +export default (function (o, c, d) { + var sortBy = function sortBy(method, dates) { + if (!dates || !dates.length || dates.length === 1 && !dates[0] || dates.length === 1 && Array.isArray(dates[0]) && !dates[0].length) { + return null; + } + + if (dates.length === 1 && dates[0].length > 0) { + var _dates = dates; + dates = _dates[0]; + } + + dates = dates.filter(function (date) { + return date; + }); + var result; + var _dates2 = dates; + result = _dates2[0]; + + for (var i = 1; i < dates.length; i += 1) { + if (!dates[i].isValid() || dates[i][method](result)) { + result = dates[i]; + } + } + + return result; + }; + + d.max = function () { + var args = [].slice.call(arguments, 0); // eslint-disable-line prefer-rest-params + + return sortBy('isAfter', args); + }; + + d.min = function () { + var args = [].slice.call(arguments, 0); // eslint-disable-line prefer-rest-params + + return sortBy('isBefore', args); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/objectSupport/index.d.ts b/node_modules/dayjs/esm/plugin/objectSupport/index.d.ts new file mode 100644 index 00000000..03b8b7c8 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/objectSupport/index.d.ts @@ -0,0 +1,48 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + set(argument: object): Dayjs + add(argument: object): Dayjs + subtract(argument: object): Dayjs + } + + interface ConfigTypeMap { + objectSupport: { + years?: number | string; + year?: number | string; + y?: number | string; + + months?: number | string; + month?: number | string; + M?: number | string; + + days?: number | string; + day?: number | string; + d?: number | string; + + dates?: number | string; + date?: number | string; + D?: number | string; + + hours?: number | string; + hour?: number | string; + h?: number | string; + + minutes?: number | string; + minute?: number | string; + m?: number | string; + + seconds?: number | string; + second?: number | string; + s?: number | string; + + milliseconds?: number | string; + millisecond?: number | string; + ms?: number | string; + } + } +} diff --git a/node_modules/dayjs/esm/plugin/objectSupport/index.js b/node_modules/dayjs/esm/plugin/objectSupport/index.js new file mode 100644 index 00000000..61636e76 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/objectSupport/index.js @@ -0,0 +1,97 @@ +export default (function (o, c, dayjs) { + var proto = c.prototype; + + var isObject = function isObject(obj) { + return obj !== null && !(obj instanceof Date) && !(obj instanceof Array) && !proto.$utils().u(obj) && obj.constructor.name === 'Object'; + }; + + var prettyUnit = function prettyUnit(u) { + var unit = proto.$utils().p(u); + return unit === 'date' ? 'day' : unit; + }; + + var parseDate = function parseDate(cfg) { + var date = cfg.date, + utc = cfg.utc; + var $d = {}; + + if (isObject(date)) { + if (!Object.keys(date).length) { + return new Date(); + } + + var now = utc ? dayjs.utc() : dayjs(); + Object.keys(date).forEach(function (k) { + $d[prettyUnit(k)] = date[k]; + }); + var d = $d.day || (!$d.year && !($d.month >= 0) ? now.date() : 1); + var y = $d.year || now.year(); + var M = $d.month >= 0 ? $d.month : !$d.year && !$d.day ? now.month() : 0; // eslint-disable-line no-nested-ternary,max-len + + var h = $d.hour || 0; + var m = $d.minute || 0; + var s = $d.second || 0; + var ms = $d.millisecond || 0; + + if (utc) { + return new Date(Date.UTC(y, M, d, h, m, s, ms)); + } + + return new Date(y, M, d, h, m, s, ms); + } + + return date; + }; + + var oldParse = proto.parse; + + proto.parse = function (cfg) { + cfg.date = parseDate.bind(this)(cfg); + oldParse.bind(this)(cfg); + }; + + var oldSet = proto.set; + var oldAdd = proto.add; + var oldSubtract = proto.subtract; + + var callObject = function callObject(call, argument, string, offset) { + if (offset === void 0) { + offset = 1; + } + + var keys = Object.keys(argument); + var chain = this; + keys.forEach(function (key) { + chain = call.bind(chain)(argument[key] * offset, key); + }); + return chain; + }; + + proto.set = function (unit, value) { + value = value === undefined ? unit : value; + + if (unit.constructor.name === 'Object') { + return callObject.bind(this)(function (i, s) { + return oldSet.bind(this)(s, i); + }, value, unit); + } + + return oldSet.bind(this)(unit, value); + }; + + proto.add = function (value, unit) { + if (value.constructor.name === 'Object') { + return callObject.bind(this)(oldAdd, value, unit); + } + + return oldAdd.bind(this)(value, unit); + }; + + proto.subtract = function (value, unit) { + if (value.constructor.name === 'Object') { + return callObject.bind(this)(oldAdd, value, unit, -1); + } + + return oldSubtract.bind(this)(value, unit); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/pluralGetSet/index.d.ts b/node_modules/dayjs/esm/plugin/pluralGetSet/index.d.ts new file mode 100644 index 00000000..7ef7167c --- /dev/null +++ b/node_modules/dayjs/esm/plugin/pluralGetSet/index.d.ts @@ -0,0 +1,44 @@ +import { PluginFunc, UnitType, ConfigType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + years(): number + + years(value: number): Dayjs + + months(): number + + months(value: number): Dayjs + + dates(): number + + dates(value: number): Dayjs + + weeks(): number + + weeks(value: number): Dayjs + + days(): number + + days(value: number): Dayjs + + hours(): number + + hours(value: number): Dayjs + + minutes(): number + + minutes(value: number): Dayjs + + seconds(): number + + seconds(value: number): Dayjs + + milliseconds(): number + + milliseconds(value: number): Dayjs + } +} diff --git a/node_modules/dayjs/esm/plugin/pluralGetSet/index.js b/node_modules/dayjs/esm/plugin/pluralGetSet/index.js new file mode 100644 index 00000000..d8214d64 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/pluralGetSet/index.js @@ -0,0 +1,7 @@ +export default (function (o, c) { + var proto = c.prototype; + var pluralAliases = ['milliseconds', 'seconds', 'minutes', 'hours', 'days', 'weeks', 'isoWeeks', 'months', 'quarters', 'years', 'dates']; + pluralAliases.forEach(function (alias) { + proto[alias] = proto[alias.replace(/s$/, '')]; + }); +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/preParsePostFormat/index.d.ts b/node_modules/dayjs/esm/plugin/preParsePostFormat/index.d.ts new file mode 100644 index 00000000..a17c8963 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/preParsePostFormat/index.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/esm/plugin/preParsePostFormat/index.js b/node_modules/dayjs/esm/plugin/preParsePostFormat/index.js new file mode 100644 index 00000000..7654ccbe --- /dev/null +++ b/node_modules/dayjs/esm/plugin/preParsePostFormat/index.js @@ -0,0 +1,40 @@ +// Plugin template from https://day.js.org/docs/en/plugin/plugin +export default (function (option, dayjsClass) { + var oldParse = dayjsClass.prototype.parse; + + dayjsClass.prototype.parse = function (cfg) { + if (typeof cfg.date === 'string') { + var locale = this.$locale(); + cfg.date = locale && locale.preparse ? locale.preparse(cfg.date) : cfg.date; + } // original parse result + + + return oldParse.bind(this)(cfg); + }; // // overriding existing API + // // e.g. extend dayjs().format() + + + var oldFormat = dayjsClass.prototype.format; + + dayjsClass.prototype.format = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + // original format result + var result = oldFormat.call.apply(oldFormat, [this].concat(args)); // return modified result + + var locale = this.$locale(); + return locale && locale.postformat ? locale.postformat(result) : result; + }; + + var oldFromTo = dayjsClass.prototype.fromToBase; + + if (oldFromTo) { + dayjsClass.prototype.fromToBase = function (input, withoutSuffix, instance, isFrom) { + var locale = this.$locale() || instance.$locale(); // original format result + + return oldFromTo.call(this, input, withoutSuffix, instance, isFrom, locale && locale.postformat); + }; + } +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/quarterOfYear/index.d.ts b/node_modules/dayjs/esm/plugin/quarterOfYear/index.d.ts new file mode 100644 index 00000000..37691c11 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/quarterOfYear/index.d.ts @@ -0,0 +1,26 @@ +import { PluginFunc, ConfigType, QUnitType, OpUnitType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + quarter(): number + + quarter(quarter: number): Dayjs + + add(value: number, unit: QUnitType): Dayjs + + subtract(value: number, unit: QUnitType): Dayjs + + startOf(unit: QUnitType | OpUnitType): Dayjs + + endOf(unit: QUnitType | OpUnitType): Dayjs + + isSame(date?: ConfigType, unit?: QUnitType): boolean + + isBefore(date?: ConfigType, unit?: QUnitType): boolean + + isAfter(date?: ConfigType, unit?: QUnitType): boolean + } +} diff --git a/node_modules/dayjs/esm/plugin/quarterOfYear/index.js b/node_modules/dayjs/esm/plugin/quarterOfYear/index.js new file mode 100644 index 00000000..e376889e --- /dev/null +++ b/node_modules/dayjs/esm/plugin/quarterOfYear/index.js @@ -0,0 +1,41 @@ +import { Q, M, D } from '../../constant'; +export default (function (o, c) { + var proto = c.prototype; + + proto.quarter = function (quarter) { + if (!this.$utils().u(quarter)) { + return this.month(this.month() % 3 + (quarter - 1) * 3); + } + + return Math.ceil((this.month() + 1) / 3); + }; + + var oldAdd = proto.add; + + proto.add = function (number, units) { + number = Number(number); // eslint-disable-line no-param-reassign + + var unit = this.$utils().p(units); + + if (unit === Q) { + return this.add(number * 3, M); + } + + return oldAdd.bind(this)(number, units); + }; + + var oldStartOf = proto.startOf; + + proto.startOf = function (units, startOf) { + var utils = this.$utils(); + var isStartOf = !utils.u(startOf) ? startOf : true; + var unit = utils.p(units); + + if (unit === Q) { + var quarter = this.quarter() - 1; + return isStartOf ? this.month(quarter * 3).startOf(M).startOf(D) : this.month(quarter * 3 + 2).endOf(M).endOf(D); + } + + return oldStartOf.bind(this)(units, startOf); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/relativeTime/index.d.ts b/node_modules/dayjs/esm/plugin/relativeTime/index.d.ts new file mode 100644 index 00000000..e1b17cf8 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/relativeTime/index.d.ts @@ -0,0 +1,24 @@ +import { PluginFunc, ConfigType } from 'dayjs/esm' + +declare interface RelativeTimeThreshold { + l: string + r?: number + d?: string +} + +declare interface RelativeTimeOptions { + rounding?: (num: number) => number + thresholds?: RelativeTimeThreshold[] +} + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + fromNow(withoutSuffix?: boolean): string + from(compared: ConfigType, withoutSuffix?: boolean): string + toNow(withoutSuffix?: boolean): string + to(compared: ConfigType, withoutSuffix?: boolean): string + } +} diff --git a/node_modules/dayjs/esm/plugin/relativeTime/index.js b/node_modules/dayjs/esm/plugin/relativeTime/index.js new file mode 100644 index 00000000..88fdbbe8 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/relativeTime/index.js @@ -0,0 +1,130 @@ +import * as C from '../../constant'; +export default (function (o, c, d) { + o = o || {}; + var proto = c.prototype; + var relObj = { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + }; + d.en.relativeTime = relObj; + + proto.fromToBase = function (input, withoutSuffix, instance, isFrom, postFormat) { + var loc = instance.$locale().relativeTime || relObj; + var T = o.thresholds || [{ + l: 's', + r: 44, + d: C.S + }, { + l: 'm', + r: 89 + }, { + l: 'mm', + r: 44, + d: C.MIN + }, { + l: 'h', + r: 89 + }, { + l: 'hh', + r: 21, + d: C.H + }, { + l: 'd', + r: 35 + }, { + l: 'dd', + r: 25, + d: C.D + }, { + l: 'M', + r: 45 + }, { + l: 'MM', + r: 10, + d: C.M + }, { + l: 'y', + r: 17 + }, { + l: 'yy', + d: C.Y + }]; + var Tl = T.length; + var result; + var out; + var isFuture; + + for (var i = 0; i < Tl; i += 1) { + var t = T[i]; + + if (t.d) { + result = isFrom ? d(input).diff(instance, t.d, true) : instance.diff(input, t.d, true); + } + + var abs = (o.rounding || Math.round)(Math.abs(result)); + isFuture = result > 0; + + if (abs <= t.r || !t.r) { + if (abs <= 1 && i > 0) t = T[i - 1]; // 1 minutes -> a minute, 0 seconds -> 0 second + + var format = loc[t.l]; + + if (postFormat) { + abs = postFormat("" + abs); + } + + if (typeof format === 'string') { + out = format.replace('%d', abs); + } else { + out = format(abs, withoutSuffix, t.l, isFuture); + } + + break; + } + } + + if (withoutSuffix) return out; + var pastOrFuture = isFuture ? loc.future : loc.past; + + if (typeof pastOrFuture === 'function') { + return pastOrFuture(out); + } + + return pastOrFuture.replace('%s', out); + }; + + function fromTo(input, withoutSuffix, instance, isFrom) { + return proto.fromToBase(input, withoutSuffix, instance, isFrom); + } + + proto.to = function (input, withoutSuffix) { + return fromTo(input, withoutSuffix, this, true); + }; + + proto.from = function (input, withoutSuffix) { + return fromTo(input, withoutSuffix, this); + }; + + var makeNow = function makeNow(thisDay) { + return thisDay.$u ? d.utc() : d(); + }; + + proto.toNow = function (withoutSuffix) { + return this.to(makeNow(this), withoutSuffix); + }; + + proto.fromNow = function (withoutSuffix) { + return this.from(makeNow(this), withoutSuffix); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/timezone/index.d.ts b/node_modules/dayjs/esm/plugin/timezone/index.d.ts new file mode 100644 index 00000000..5a2d9f2d --- /dev/null +++ b/node_modules/dayjs/esm/plugin/timezone/index.d.ts @@ -0,0 +1,20 @@ +import { PluginFunc, ConfigType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + tz(timezone?: string, keepLocalTime?: boolean): Dayjs + offsetName(type?: 'short' | 'long'): string | undefined + } + + interface DayjsTimezone { + (date?: ConfigType, timezone?: string): Dayjs + (date: ConfigType, format: string, timezone?: string): Dayjs + guess(): string + setDefault(timezone?: string): void + } + + const tz: DayjsTimezone +} diff --git a/node_modules/dayjs/esm/plugin/timezone/index.js b/node_modules/dayjs/esm/plugin/timezone/index.js new file mode 100644 index 00000000..490aff2e --- /dev/null +++ b/node_modules/dayjs/esm/plugin/timezone/index.js @@ -0,0 +1,189 @@ +import { MIN, MS } from '../../constant'; +var typeToPos = { + year: 0, + month: 1, + day: 2, + hour: 3, + minute: 4, + second: 5 +}; // Cache time-zone lookups from Intl.DateTimeFormat, +// as it is a *very* slow method. + +var dtfCache = {}; + +var getDateTimeFormat = function getDateTimeFormat(timezone, options) { + if (options === void 0) { + options = {}; + } + + var timeZoneName = options.timeZoneName || 'short'; + var key = timezone + "|" + timeZoneName; + var dtf = dtfCache[key]; + + if (!dtf) { + dtf = new Intl.DateTimeFormat('en-US', { + hour12: false, + timeZone: timezone, + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + timeZoneName: timeZoneName + }); + dtfCache[key] = dtf; + } + + return dtf; +}; + +export default (function (o, c, d) { + var defaultTimezone; + + var makeFormatParts = function makeFormatParts(timestamp, timezone, options) { + if (options === void 0) { + options = {}; + } + + var date = new Date(timestamp); + var dtf = getDateTimeFormat(timezone, options); + return dtf.formatToParts(date); + }; + + var tzOffset = function tzOffset(timestamp, timezone) { + var formatResult = makeFormatParts(timestamp, timezone); + var filled = []; + + for (var i = 0; i < formatResult.length; i += 1) { + var _formatResult$i = formatResult[i], + type = _formatResult$i.type, + value = _formatResult$i.value; + var pos = typeToPos[type]; + + if (pos >= 0) { + filled[pos] = parseInt(value, 10); + } + } + + var hour = filled[3]; // Workaround for the same behavior in different node version + // https://github.com/nodejs/node/issues/33027 + + /* istanbul ignore next */ + + var fixedHour = hour === 24 ? 0 : hour; + var utcString = filled[0] + "-" + filled[1] + "-" + filled[2] + " " + fixedHour + ":" + filled[4] + ":" + filled[5] + ":000"; + var utcTs = d.utc(utcString).valueOf(); + var asTS = +timestamp; + var over = asTS % 1000; + asTS -= over; + return (utcTs - asTS) / (60 * 1000); + }; // find the right offset a given local time. The o input is our guess, which determines which + // offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) + // https://github.com/moment/luxon/blob/master/src/datetime.js#L76 + + + var fixOffset = function fixOffset(localTS, o0, tz) { + // Our UTC time is just a guess because our offset is just a guess + var utcGuess = localTS - o0 * 60 * 1000; // Test whether the zone matches the offset for this ts + + var o2 = tzOffset(utcGuess, tz); // If so, offset didn't change and we're done + + if (o0 === o2) { + return [utcGuess, o0]; + } // If not, change the ts by the difference in the offset + + + utcGuess -= (o2 - o0) * 60 * 1000; // If that gives us the local time we want, we're done + + var o3 = tzOffset(utcGuess, tz); + + if (o2 === o3) { + return [utcGuess, o2]; + } // If it's different, we're in a hole time. + // The offset has changed, but the we don't adjust the time + + + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; + }; + + var proto = c.prototype; + + proto.tz = function (timezone, keepLocalTime) { + if (timezone === void 0) { + timezone = defaultTimezone; + } + + var oldOffset = this.utcOffset(); + var date = this.toDate(); + var target = date.toLocaleString('en-US', { + timeZone: timezone + }); + var diff = Math.round((date - new Date(target)) / 1000 / 60); + var ins = d(target, { + locale: this.$L + }).$set(MS, this.$ms).utcOffset(-Math.round(date.getTimezoneOffset() / 15) * 15 - diff, true); + + if (keepLocalTime) { + var newOffset = ins.utcOffset(); + ins = ins.add(oldOffset - newOffset, MIN); + } + + ins.$x.$timezone = timezone; + return ins; + }; + + proto.offsetName = function (type) { + // type: short(default) / long + var zone = this.$x.$timezone || d.tz.guess(); + var result = makeFormatParts(this.valueOf(), zone, { + timeZoneName: type + }).find(function (m) { + return m.type.toLowerCase() === 'timezonename'; + }); + return result && result.value; + }; + + var oldStartOf = proto.startOf; + + proto.startOf = function (units, startOf) { + if (!this.$x || !this.$x.$timezone) { + return oldStartOf.call(this, units, startOf); + } + + var withoutTz = d(this.format('YYYY-MM-DD HH:mm:ss:SSS'), { + locale: this.$L + }); + var startOfWithoutTz = oldStartOf.call(withoutTz, units, startOf); + return startOfWithoutTz.tz(this.$x.$timezone, true); + }; + + d.tz = function (input, arg1, arg2) { + var parseFormat = arg2 && arg1; + var timezone = arg2 || arg1 || defaultTimezone; + var previousOffset = tzOffset(+d(), timezone); + + if (typeof input !== 'string') { + // timestamp number || js Date || Day.js + return d(input).tz(timezone); + } + + var localTs = d.utc(input, parseFormat).valueOf(); + + var _fixOffset = fixOffset(localTs, previousOffset, timezone), + targetTs = _fixOffset[0], + targetOffset = _fixOffset[1]; + + var ins = d(targetTs).utcOffset(targetOffset); + ins.$x.$timezone = timezone; + return ins; + }; + + d.tz.guess = function () { + return Intl.DateTimeFormat().resolvedOptions().timeZone; + }; + + d.tz.setDefault = function (timezone) { + defaultTimezone = timezone; + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/toArray/index.d.ts b/node_modules/dayjs/esm/plugin/toArray/index.d.ts new file mode 100644 index 00000000..5033831d --- /dev/null +++ b/node_modules/dayjs/esm/plugin/toArray/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + toArray(): number[] + } +} diff --git a/node_modules/dayjs/esm/plugin/toArray/index.js b/node_modules/dayjs/esm/plugin/toArray/index.js new file mode 100644 index 00000000..2b795f49 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/toArray/index.js @@ -0,0 +1,7 @@ +export default (function (o, c) { + var proto = c.prototype; + + proto.toArray = function () { + return [this.$y, this.$M, this.$D, this.$H, this.$m, this.$s, this.$ms]; + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/toObject/index.d.ts b/node_modules/dayjs/esm/plugin/toObject/index.d.ts new file mode 100644 index 00000000..ad215200 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/toObject/index.d.ts @@ -0,0 +1,20 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +interface DayjsObject { + years: number + months: number + date: number + hours: number + minutes: number + seconds: number + milliseconds: number +} + +declare module 'dayjs/esm' { + interface Dayjs { + toObject(): DayjsObject + } +} diff --git a/node_modules/dayjs/esm/plugin/toObject/index.js b/node_modules/dayjs/esm/plugin/toObject/index.js new file mode 100644 index 00000000..e35d93f5 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/toObject/index.js @@ -0,0 +1,15 @@ +export default (function (o, c) { + var proto = c.prototype; + + proto.toObject = function () { + return { + years: this.$y, + months: this.$M, + date: this.$D, + hours: this.$H, + minutes: this.$m, + seconds: this.$s, + milliseconds: this.$ms + }; + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/updateLocale/index.d.ts b/node_modules/dayjs/esm/plugin/updateLocale/index.d.ts new file mode 100644 index 00000000..994a884d --- /dev/null +++ b/node_modules/dayjs/esm/plugin/updateLocale/index.d.ts @@ -0,0 +1,8 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + export function updateLocale(localeName: string, customConfig: Record): Record +} diff --git a/node_modules/dayjs/esm/plugin/updateLocale/index.js b/node_modules/dayjs/esm/plugin/updateLocale/index.js new file mode 100644 index 00000000..1b9965cd --- /dev/null +++ b/node_modules/dayjs/esm/plugin/updateLocale/index.js @@ -0,0 +1,12 @@ +export default (function (option, Dayjs, dayjs) { + dayjs.updateLocale = function (locale, customConfig) { + var localeList = dayjs.Ls; + var localeConfig = localeList[locale]; + if (!localeConfig) return; + var customConfigKeys = customConfig ? Object.keys(customConfig) : []; + customConfigKeys.forEach(function (c) { + localeConfig[c] = customConfig[c]; + }); + return localeConfig; // eslint-disable-line consistent-return + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/utc/index.d.ts b/node_modules/dayjs/esm/plugin/utc/index.d.ts new file mode 100644 index 00000000..15c61fec --- /dev/null +++ b/node_modules/dayjs/esm/plugin/utc/index.d.ts @@ -0,0 +1,19 @@ +import { PluginFunc, ConfigType } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + + utc(keepLocalTime?: boolean): Dayjs + + local(): Dayjs + + isUTC(): boolean + + utcOffset(offset: number | string, keepLocalTime?: boolean): Dayjs + } + + export function utc(config?: ConfigType, format?: string, strict?: boolean): Dayjs +} diff --git a/node_modules/dayjs/esm/plugin/utc/index.js b/node_modules/dayjs/esm/plugin/utc/index.js new file mode 100644 index 00000000..a8a05f56 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/utc/index.js @@ -0,0 +1,188 @@ +import { MILLISECONDS_A_MINUTE, MIN } from '../../constant'; +var REGEX_VALID_OFFSET_FORMAT = /[+-]\d\d(?::?\d\d)?/g; +var REGEX_OFFSET_HOURS_MINUTES_FORMAT = /([+-]|\d\d)/g; + +function offsetFromString(value) { + if (value === void 0) { + value = ''; + } + + var offset = value.match(REGEX_VALID_OFFSET_FORMAT); + + if (!offset) { + return null; + } + + var _ref = ("" + offset[0]).match(REGEX_OFFSET_HOURS_MINUTES_FORMAT) || ['-', 0, 0], + indicator = _ref[0], + hoursOffset = _ref[1], + minutesOffset = _ref[2]; + + var totalOffsetInMinutes = +hoursOffset * 60 + +minutesOffset; + + if (totalOffsetInMinutes === 0) { + return 0; + } + + return indicator === '+' ? totalOffsetInMinutes : -totalOffsetInMinutes; +} + +export default (function (option, Dayjs, dayjs) { + var proto = Dayjs.prototype; + + dayjs.utc = function (date) { + var cfg = { + date: date, + utc: true, + args: arguments + }; // eslint-disable-line prefer-rest-params + + return new Dayjs(cfg); // eslint-disable-line no-use-before-define + }; + + proto.utc = function (keepLocalTime) { + var ins = dayjs(this.toDate(), { + locale: this.$L, + utc: true + }); + + if (keepLocalTime) { + return ins.add(this.utcOffset(), MIN); + } + + return ins; + }; + + proto.local = function () { + return dayjs(this.toDate(), { + locale: this.$L, + utc: false + }); + }; + + var oldParse = proto.parse; + + proto.parse = function (cfg) { + if (cfg.utc) { + this.$u = true; + } + + if (!this.$utils().u(cfg.$offset)) { + this.$offset = cfg.$offset; + } + + oldParse.call(this, cfg); + }; + + var oldInit = proto.init; + + proto.init = function () { + if (this.$u) { + var $d = this.$d; + this.$y = $d.getUTCFullYear(); + this.$M = $d.getUTCMonth(); + this.$D = $d.getUTCDate(); + this.$W = $d.getUTCDay(); + this.$H = $d.getUTCHours(); + this.$m = $d.getUTCMinutes(); + this.$s = $d.getUTCSeconds(); + this.$ms = $d.getUTCMilliseconds(); + } else { + oldInit.call(this); + } + }; + + var oldUtcOffset = proto.utcOffset; + + proto.utcOffset = function (input, keepLocalTime) { + var _this$$utils = this.$utils(), + u = _this$$utils.u; + + if (u(input)) { + if (this.$u) { + return 0; + } + + if (!u(this.$offset)) { + return this.$offset; + } + + return oldUtcOffset.call(this); + } + + if (typeof input === 'string') { + input = offsetFromString(input); + + if (input === null) { + return this; + } + } + + var offset = Math.abs(input) <= 16 ? input * 60 : input; + var ins = this; + + if (keepLocalTime) { + ins.$offset = offset; + ins.$u = input === 0; + return ins; + } + + if (input !== 0) { + var localTimezoneOffset = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset(); + ins = this.local().add(offset + localTimezoneOffset, MIN); + ins.$offset = offset; + ins.$x.$localOffset = localTimezoneOffset; + } else { + ins = this.utc(); + } + + return ins; + }; + + var oldFormat = proto.format; + var UTC_FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ss[Z]'; + + proto.format = function (formatStr) { + var str = formatStr || (this.$u ? UTC_FORMAT_DEFAULT : ''); + return oldFormat.call(this, str); + }; + + proto.valueOf = function () { + var addedOffset = !this.$utils().u(this.$offset) ? this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset()) : 0; + return this.$d.valueOf() - addedOffset * MILLISECONDS_A_MINUTE; + }; + + proto.isUTC = function () { + return !!this.$u; + }; + + proto.toISOString = function () { + return this.toDate().toISOString(); + }; + + proto.toString = function () { + return this.toDate().toUTCString(); + }; + + var oldToDate = proto.toDate; + + proto.toDate = function (type) { + if (type === 's' && this.$offset) { + return dayjs(this.format('YYYY-MM-DD HH:mm:ss:SSS')).toDate(); + } + + return oldToDate.call(this); + }; + + var oldDiff = proto.diff; + + proto.diff = function (input, units, _float) { + if (input && this.$u === input.$u) { + return oldDiff.call(this, input, units, _float); + } + + var localThis = this.local(); + var localInput = dayjs(input).local(); + return oldDiff.call(localThis, localInput, units, _float); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/weekOfYear/index.d.ts b/node_modules/dayjs/esm/plugin/weekOfYear/index.d.ts new file mode 100644 index 00000000..340051bd --- /dev/null +++ b/node_modules/dayjs/esm/plugin/weekOfYear/index.d.ts @@ -0,0 +1,12 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + week(): number + + week(value : number): Dayjs + } +} diff --git a/node_modules/dayjs/esm/plugin/weekOfYear/index.js b/node_modules/dayjs/esm/plugin/weekOfYear/index.js new file mode 100644 index 00000000..c92406eb --- /dev/null +++ b/node_modules/dayjs/esm/plugin/weekOfYear/index.js @@ -0,0 +1,44 @@ +import { MS, Y, D, W } from '../../constant'; +export default (function (o, c, d) { + var proto = c.prototype; + + proto.week = function (week) { + if (week === void 0) { + week = null; + } + + if (week !== null) { + return this.add((week - this.week()) * 7, D); + } + + var yearStart = this.$locale().yearStart || 1; + + if (this.month() === 11 && this.date() > 25) { + // d(this) is for badMutable + var nextYearStartDay = d(this).startOf(Y).add(1, Y).date(yearStart); + var thisEndOfWeek = d(this).endOf(W); + + if (nextYearStartDay.isBefore(thisEndOfWeek)) { + return 1; + } + } + + var yearStartDay = d(this).startOf(Y).date(yearStart); + var yearStartWeek = yearStartDay.startOf(W).subtract(1, MS); + var diffInWeek = this.diff(yearStartWeek, W, true); + + if (diffInWeek < 0) { + return d(this).startOf('week').week(); + } + + return Math.ceil(diffInWeek); + }; + + proto.weeks = function (week) { + if (week === void 0) { + week = null; + } + + return this.week(week); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/weekYear/index.d.ts b/node_modules/dayjs/esm/plugin/weekYear/index.d.ts new file mode 100644 index 00000000..5b713e53 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/weekYear/index.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + weekYear(): number + } +} diff --git a/node_modules/dayjs/esm/plugin/weekYear/index.js b/node_modules/dayjs/esm/plugin/weekYear/index.js new file mode 100644 index 00000000..140dcd44 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/weekYear/index.js @@ -0,0 +1,19 @@ +export default (function (o, c) { + var proto = c.prototype; + + proto.weekYear = function () { + var month = this.month(); + var weekOfYear = this.week(); + var year = this.year(); + + if (weekOfYear === 1 && month === 11) { + return year + 1; + } + + if (month === 0 && weekOfYear >= 52) { + return year - 1; + } + + return year; + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/plugin/weekday/index.d.ts b/node_modules/dayjs/esm/plugin/weekday/index.d.ts new file mode 100644 index 00000000..41945e7e --- /dev/null +++ b/node_modules/dayjs/esm/plugin/weekday/index.d.ts @@ -0,0 +1,12 @@ +import { PluginFunc } from 'dayjs/esm' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs/esm' { + interface Dayjs { + weekday(): number + + weekday(value: number): Dayjs + } +} diff --git a/node_modules/dayjs/esm/plugin/weekday/index.js b/node_modules/dayjs/esm/plugin/weekday/index.js new file mode 100644 index 00000000..18032b36 --- /dev/null +++ b/node_modules/dayjs/esm/plugin/weekday/index.js @@ -0,0 +1,15 @@ +export default (function (o, c) { + var proto = c.prototype; + + proto.weekday = function (input) { + var weekStart = this.$locale().weekStart || 0; + var $W = this.$W; + var weekday = ($W < weekStart ? $W + 7 : $W) - weekStart; + + if (this.$utils().u(input)) { + return weekday; + } + + return this.subtract(weekday, 'day').add(input, 'day'); + }; +}); \ No newline at end of file diff --git a/node_modules/dayjs/esm/utils.js b/node_modules/dayjs/esm/utils.js new file mode 100644 index 00000000..b5a81312 --- /dev/null +++ b/node_modules/dayjs/esm/utils.js @@ -0,0 +1,58 @@ +import * as C from './constant'; + +var padStart = function padStart(string, length, pad) { + var s = String(string); + if (!s || s.length >= length) return string; + return "" + Array(length + 1 - s.length).join(pad) + string; +}; + +var padZoneStr = function padZoneStr(instance) { + var negMinutes = -instance.utcOffset(); + var minutes = Math.abs(negMinutes); + var hourOffset = Math.floor(minutes / 60); + var minuteOffset = minutes % 60; + return "" + (negMinutes <= 0 ? '+' : '-') + padStart(hourOffset, 2, '0') + ":" + padStart(minuteOffset, 2, '0'); +}; + +var monthDiff = function monthDiff(a, b) { + // function from moment.js in order to keep the same result + if (a.date() < b.date()) return -monthDiff(b, a); + var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()); + var anchor = a.clone().add(wholeMonthDiff, C.M); + var c = b - anchor < 0; + var anchor2 = a.clone().add(wholeMonthDiff + (c ? -1 : 1), C.M); + return +(-(wholeMonthDiff + (b - anchor) / (c ? anchor - anchor2 : anchor2 - anchor)) || 0); +}; + +var absFloor = function absFloor(n) { + return n < 0 ? Math.ceil(n) || 0 : Math.floor(n); +}; + +var prettyUnit = function prettyUnit(u) { + var special = { + M: C.M, + y: C.Y, + w: C.W, + d: C.D, + D: C.DATE, + h: C.H, + m: C.MIN, + s: C.S, + ms: C.MS, + Q: C.Q + }; + return special[u] || String(u || '').toLowerCase().replace(/s$/, ''); +}; + +var isUndefined = function isUndefined(s) { + return s === undefined; +}; + +export default { + s: padStart, + z: padZoneStr, + m: monthDiff, + a: absFloor, + p: prettyUnit, + u: isUndefined +}; \ No newline at end of file diff --git a/node_modules/dayjs/index.d.ts b/node_modules/dayjs/index.d.ts new file mode 100644 index 00000000..766bd794 --- /dev/null +++ b/node_modules/dayjs/index.d.ts @@ -0,0 +1,429 @@ +/// + +export = dayjs; + +declare function dayjs (date?: dayjs.ConfigType): dayjs.Dayjs + +declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs + +declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs + +declare namespace dayjs { + interface ConfigTypeMap { + default: string | number | Date | Dayjs | null | undefined + } + + export type ConfigType = ConfigTypeMap[keyof ConfigTypeMap] + + export interface FormatObject { locale?: string, format?: string, utc?: boolean } + + export type OptionType = FormatObject | string | string[] + + export type UnitTypeShort = 'd' | 'D' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms' + + export type UnitTypeLong = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date' + + export type UnitTypeLongPlural = 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' | 'dates' + + export type UnitType = UnitTypeLong | UnitTypeLongPlural | UnitTypeShort; + + export type OpUnitType = UnitType | "week" | "weeks" | 'w'; + export type QUnitType = UnitType | "quarter" | "quarters" | 'Q'; + export type ManipulateType = Exclude; + class Dayjs { + constructor (config?: ConfigType) + /** + * All Day.js objects are immutable. Still, `dayjs#clone` can create a clone of the current object if you need one. + * ``` + * dayjs().clone()// => Dayjs + * dayjs(dayjs('2019-01-25')) // passing a Dayjs object to a constructor will also clone it + * ``` + * Docs: https://day.js.org/docs/en/parse/dayjs-clone + */ + clone(): Dayjs + /** + * This returns a `boolean` indicating whether the Day.js object contains a valid date or not. + * ``` + * dayjs().isValid()// => boolean + * ``` + * Docs: https://day.js.org/docs/en/parse/is-valid + */ + isValid(): boolean + /** + * Get the year. + * ``` + * dayjs().year()// => 2020 + * ``` + * Docs: https://day.js.org/docs/en/get-set/year + */ + year(): number + /** + * Set the year. + * ``` + * dayjs().year(2000)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/year + */ + year(value: number): Dayjs + /** + * Get the month. + * + * Months are zero indexed, so January is month 0. + * ``` + * dayjs().month()// => 0-11 + * ``` + * Docs: https://day.js.org/docs/en/get-set/month + */ + month(): number + /** + * Set the month. + * + * Months are zero indexed, so January is month 0. + * + * Accepts numbers from 0 to 11. If the range is exceeded, it will bubble up to the next year. + * ``` + * dayjs().month(0)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/month + */ + month(value: number): Dayjs + /** + * Get the date of the month. + * ``` + * dayjs().date()// => 1-31 + * ``` + * Docs: https://day.js.org/docs/en/get-set/date + */ + date(): number + /** + * Set the date of the month. + * + * Accepts numbers from 1 to 31. If the range is exceeded, it will bubble up to the next months. + * ``` + * dayjs().date(1)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/date + */ + date(value: number): Dayjs + /** + * Get the day of the week. + * + * Returns numbers from 0 (Sunday) to 6 (Saturday). + * ``` + * dayjs().day()// 0-6 + * ``` + * Docs: https://day.js.org/docs/en/get-set/day + */ + day(): number + /** + * Set the day of the week. + * + * Accepts numbers from 0 (Sunday) to 6 (Saturday). If the range is exceeded, it will bubble up to next weeks. + * ``` + * dayjs().day(0)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/day + */ + day(value: number): Dayjs + /** + * Get the hour. + * ``` + * dayjs().hour()// => 0-23 + * ``` + * Docs: https://day.js.org/docs/en/get-set/hour + */ + hour(): number + /** + * Set the hour. + * + * Accepts numbers from 0 to 23. If the range is exceeded, it will bubble up to the next day. + * ``` + * dayjs().hour(12)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/hour + */ + hour(value: number): Dayjs + /** + * Get the minutes. + * ``` + * dayjs().minute()// => 0-59 + * ``` + * Docs: https://day.js.org/docs/en/get-set/minute + */ + minute(): number + /** + * Set the minutes. + * + * Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next hour. + * ``` + * dayjs().minute(59)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/minute + */ + minute(value: number): Dayjs + /** + * Get the seconds. + * ``` + * dayjs().second()// => 0-59 + * ``` + * Docs: https://day.js.org/docs/en/get-set/second + */ + second(): number + /** + * Set the seconds. + * + * Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next minutes. + * ``` + * dayjs().second(1)// Dayjs + * ``` + */ + second(value: number): Dayjs + /** + * Get the milliseconds. + * ``` + * dayjs().millisecond()// => 0-999 + * ``` + * Docs: https://day.js.org/docs/en/get-set/millisecond + */ + millisecond(): number + /** + * Set the milliseconds. + * + * Accepts numbers from 0 to 999. If the range is exceeded, it will bubble up to the next seconds. + * ``` + * dayjs().millisecond(1)// => Dayjs + * ``` + * Docs: https://day.js.org/docs/en/get-set/millisecond + */ + millisecond(value: number): Dayjs + /** + * Generic setter, accepting unit as first argument, and value as second, returns a new instance with the applied changes. + * + * In general: + * ``` + * dayjs().set(unit, value) === dayjs()[unit](value) + * ``` + * Units are case insensitive, and support plural and short forms. + * ``` + * dayjs().set('date', 1) + * dayjs().set('month', 3) // April + * dayjs().set('second', 30) + * ``` + * Docs: https://day.js.org/docs/en/get-set/set + */ + set(unit: UnitType, value: number): Dayjs + /** + * String getter, returns the corresponding information getting from Day.js object. + * + * In general: + * ``` + * dayjs().get(unit) === dayjs()[unit]() + * ``` + * Units are case insensitive, and support plural and short forms. + * ``` + * dayjs().get('year') + * dayjs().get('month') // start 0 + * dayjs().get('date') + * ``` + * Docs: https://day.js.org/docs/en/get-set/get + */ + get(unit: UnitType): number + /** + * Returns a cloned Day.js object with a specified amount of time added. + * ``` + * dayjs().add(7, 'day')// => Dayjs + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/manipulate/add + */ + add(value: number, unit?: ManipulateType): Dayjs + /** + * Returns a cloned Day.js object with a specified amount of time subtracted. + * ``` + * dayjs().subtract(7, 'year')// => Dayjs + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/manipulate/subtract + */ + subtract(value: number, unit?: ManipulateType): Dayjs + /** + * Returns a cloned Day.js object and set it to the start of a unit of time. + * ``` + * dayjs().startOf('year')// => Dayjs + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/manipulate/start-of + */ + startOf(unit: OpUnitType): Dayjs + /** + * Returns a cloned Day.js object and set it to the end of a unit of time. + * ``` + * dayjs().endOf('month')// => Dayjs + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/manipulate/end-of + */ + endOf(unit: OpUnitType): Dayjs + /** + * Get the formatted date according to the string of tokens passed in. + * + * To escape characters, wrap them in square brackets (e.g. [MM]). + * ``` + * dayjs().format()// => current date in ISO8601, without fraction seconds e.g. '2020-04-02T08:02:17-05:00' + * dayjs('2019-01-25').format('[YYYYescape] YYYY-MM-DDTHH:mm:ssZ[Z]')// 'YYYYescape 2019-01-25T00:00:00-02:00Z' + * dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019' + * ``` + * Docs: https://day.js.org/docs/en/display/format + */ + format(template?: string): string + /** + * This indicates the difference between two date-time in the specified unit. + * + * To get the difference in milliseconds, use `dayjs#diff` + * ``` + * const date1 = dayjs('2019-01-25') + * const date2 = dayjs('2018-06-05') + * date1.diff(date2) // 20214000000 default milliseconds + * date1.diff() // milliseconds to current time + * ``` + * + * To get the difference in another unit of measurement, pass that measurement as the second argument. + * ``` + * const date1 = dayjs('2019-01-25') + * date1.diff('2018-06-05', 'month') // 7 + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/display/difference + */ + diff(date?: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number + /** + * This returns the number of **milliseconds** since the Unix Epoch of the Day.js object. + * ``` + * dayjs('2019-01-25').valueOf() // 1548381600000 + * +dayjs(1548381600000) // 1548381600000 + * ``` + * To get a Unix timestamp (the number of seconds since the epoch) from a Day.js object, you should use Unix Timestamp `dayjs#unix()`. + * + * Docs: https://day.js.org/docs/en/display/unix-timestamp-milliseconds + */ + valueOf(): number + /** + * This returns the Unix timestamp (the number of **seconds** since the Unix Epoch) of the Day.js object. + * ``` + * dayjs('2019-01-25').unix() // 1548381600 + * ``` + * This value is floored to the nearest second, and does not include a milliseconds component. + * + * Docs: https://day.js.org/docs/en/display/unix-timestamp + */ + unix(): number + /** + * Get the number of days in the current month. + * ``` + * dayjs('2019-01-25').daysInMonth() // 31 + * ``` + * Docs: https://day.js.org/docs/en/display/days-in-month + */ + daysInMonth(): number + /** + * To get a copy of the native `Date` object parsed from the Day.js object use `dayjs#toDate`. + * ``` + * dayjs('2019-01-25').toDate()// => Date + * ``` + */ + toDate(): Date + /** + * To serialize as an ISO 8601 string. + * ``` + * dayjs('2019-01-25').toJSON() // '2019-01-25T02:00:00.000Z' + * ``` + * Docs: https://day.js.org/docs/en/display/as-json + */ + toJSON(): string + /** + * To format as an ISO 8601 string. + * ``` + * dayjs('2019-01-25').toISOString() // '2019-01-25T02:00:00.000Z' + * ``` + * Docs: https://day.js.org/docs/en/display/as-iso-string + */ + toISOString(): string + /** + * Returns a string representation of the date. + * ``` + * dayjs('2019-01-25').toString() // 'Fri, 25 Jan 2019 02:00:00 GMT' + * ``` + * Docs: https://day.js.org/docs/en/display/as-string + */ + toString(): string + /** + * Get the UTC offset in minutes. + * ``` + * dayjs().utcOffset() + * ``` + * Docs: https://day.js.org/docs/en/manipulate/utc-offset + */ + utcOffset(): number + /** + * This indicates whether the Day.js object is before the other supplied date-time. + * ``` + * dayjs().isBefore(dayjs('2011-01-01')) // default milliseconds + * ``` + * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter. + * ``` + * dayjs().isBefore('2011-01-01', 'year')// => boolean + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/query/is-before + */ + isBefore(date?: ConfigType, unit?: OpUnitType): boolean + /** + * This indicates whether the Day.js object is the same as the other supplied date-time. + * ``` + * dayjs().isSame(dayjs('2011-01-01')) // default milliseconds + * ``` + * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter. + * ``` + * dayjs().isSame('2011-01-01', 'year')// => boolean + * ``` + * Docs: https://day.js.org/docs/en/query/is-same + */ + isSame(date?: ConfigType, unit?: OpUnitType): boolean + /** + * This indicates whether the Day.js object is after the other supplied date-time. + * ``` + * dayjs().isAfter(dayjs('2011-01-01')) // default milliseconds + * ``` + * If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter. + * ``` + * dayjs().isAfter('2011-01-01', 'year')// => boolean + * ``` + * Units are case insensitive, and support plural and short forms. + * + * Docs: https://day.js.org/docs/en/query/is-after + */ + isAfter(date?: ConfigType, unit?: OpUnitType): boolean + + locale(): string + + locale(preset: string | ILocale, object?: Partial): Dayjs + } + + export type PluginFunc = (option: T, c: typeof Dayjs, d: typeof dayjs) => void + + export function extend(plugin: PluginFunc, option?: T): Dayjs + + export function locale(preset?: string | ILocale, object?: Partial, isLocal?: boolean): string + + export function isDayjs(d: any): d is Dayjs + + export function unix(t: number): Dayjs + + const Ls : { [key: string] : ILocale } +} diff --git a/node_modules/dayjs/locale.json b/node_modules/dayjs/locale.json new file mode 100644 index 00000000..45a01c4f --- /dev/null +++ b/node_modules/dayjs/locale.json @@ -0,0 +1 @@ +[{"key":"af","name":"Afrikaans"},{"key":"am","name":"Amharic"},{"key":"ar-dz","name":"Arabic (Algeria)"},{"key":"ar-iq","name":" Arabic (Iraq)"},{"key":"ar-kw","name":"Arabic (Kuwait)"},{"key":"ar-ly","name":"Arabic (Lybia)"},{"key":"ar-ma","name":"Arabic (Morocco)"},{"key":"ar-sa","name":"Arabic (Saudi Arabia)"},{"key":"ar-tn","name":" Arabic (Tunisia)"},{"key":"ar","name":"Arabic"},{"key":"az","name":"Azerbaijani"},{"key":"be","name":"Belarusian"},{"key":"bg","name":"Bulgarian"},{"key":"bi","name":"Bislama"},{"key":"bm","name":"Bambara"},{"key":"bn-bd","name":"Bengali (Bangladesh)"},{"key":"bn","name":"Bengali"},{"key":"bo","name":"Tibetan"},{"key":"br","name":"Breton"},{"key":"bs","name":"Bosnian"},{"key":"ca","name":"Catalan"},{"key":"cs","name":"Czech"},{"key":"cv","name":"Chuvash"},{"key":"cy","name":"Welsh"},{"key":"da","name":"Danish"},{"key":"de-at","name":"German (Austria)"},{"key":"de-ch","name":"German (Switzerland)"},{"key":"de","name":"German"},{"key":"dv","name":"Maldivian"},{"key":"el","name":"Greek"},{"key":"en-au","name":"English (Australia)"},{"key":"en-ca","name":"English (Canada)"},{"key":"en-gb","name":"English (United Kingdom)"},{"key":"en-ie","name":"English (Ireland)"},{"key":"en-il","name":"English (Israel)"},{"key":"en-in","name":"English (India)"},{"key":"en-nz","name":"English (New Zealand)"},{"key":"en-sg","name":"English (Singapore)"},{"key":"en-tt","name":"English (Trinidad & Tobago)"},{"key":"en","name":"English"},{"key":"eo","name":"Esperanto"},{"key":"es-do","name":"Spanish (Dominican Republic)"},{"key":"es-mx","name":"Spanish (Mexico)"},{"key":"es-pr","name":"Spanish (Puerto Rico)"},{"key":"es-us","name":"Spanish (United States)"},{"key":"es","name":"Spanish"},{"key":"et","name":"Estonian"},{"key":"eu","name":"Basque"},{"key":"fa","name":"Persian"},{"key":"fi","name":"Finnish"},{"key":"fo","name":"Faroese"},{"key":"fr-ca","name":"French (Canada)"},{"key":"fr-ch","name":"French (Switzerland)"},{"key":"fr","name":"French"},{"key":"fy","name":"Frisian"},{"key":"ga","name":"Irish or Irish Gaelic"},{"key":"gd","name":"Scottish Gaelic"},{"key":"gl","name":"Galician"},{"key":"gom-latn","name":"Konkani Latin script"},{"key":"gu","name":"Gujarati"},{"key":"hi","name":"Hindi"},{"key":"he","name":"Hebrew"},{"key":"hr","name":"Croatian"},{"key":"ht","name":"Haitian Creole (Haiti)"},{"key":"hu","name":"Hungarian"},{"key":"hy-am","name":"Armenian"},{"key":"id","name":"Indonesian"},{"key":"is","name":"Icelandic"},{"key":"it-ch","name":"Italian (Switzerland)"},{"key":"it","name":"Italian"},{"key":"ja","name":"Japanese"},{"key":"jv","name":"Javanese"},{"key":"ka","name":"Georgian"},{"key":"kk","name":"Kazakh"},{"key":"km","name":"Cambodian"},{"key":"kn","name":"Kannada"},{"key":"ko","name":"Korean"},{"key":"ku","name":"Kurdish"},{"key":"ky","name":"Kyrgyz"},{"key":"lb","name":"Luxembourgish"},{"key":"lo","name":"Lao"},{"key":"lt","name":"Lithuanian"},{"key":"lv","name":"Latvian"},{"key":"me","name":"Montenegrin"},{"key":"mi","name":"Maori"},{"key":"mk","name":"Macedonian"},{"key":"ml","name":"Malayalam"},{"key":"mn","name":"Mongolian"},{"key":"mr","name":"Marathi"},{"key":"ms-my","name":"Malay"},{"key":"ms","name":"Malay"},{"key":"mt","name":"Maltese (Malta)"},{"key":"my","name":"Burmese"},{"key":"nb","name":"Norwegian Bokmål"},{"key":"ne","name":"Nepalese"},{"key":"nl-be","name":"Dutch (Belgium)"},{"key":"nl","name":"Dutch"},{"key":"nn","name":"Nynorsk"},{"key":"oc-lnc","name":"Occitan, lengadocian dialecte"},{"key":"pa-in","name":"Punjabi (India)"},{"key":"pl","name":"Polish"},{"key":"pt-br","name":"Portuguese (Brazil)"},{"key":"pt","name":"Portuguese"},{"key":"rn","name":"Kirundi"},{"key":"ro","name":"Romanian"},{"key":"sd","name":"Sindhi"},{"key":"si","name":"Sinhalese"},{"key":"se","name":"Northern Sami"},{"key":"sk","name":"Slovak"},{"key":"sl","name":"Slovenian"},{"key":"sq","name":"Albanian"},{"key":"sr-cyrl","name":"Serbian Cyrillic"},{"key":"sr","name":"Serbian"},{"key":"ss","name":"siSwati"},{"key":"sv-fi","name":"Finland Swedish"},{"key":"sv","name":"Swedish"},{"key":"sw","name":"Swahili"},{"key":"ta","name":"Tamil"},{"key":"te","name":"Telugu"},{"key":"tg","name":"Tajik"},{"key":"tet","name":"Tetun Dili (East Timor)"},{"key":"th","name":"Thai"},{"key":"tk","name":"Turkmen"},{"key":"tl-ph","name":"Tagalog (Philippines)"},{"key":"tlh","name":"Klingon"},{"key":"tr","name":"Turkish"},{"key":"tzl","name":"Talossan"},{"key":"tzm-latn","name":"Central Atlas Tamazight Latin"},{"key":"ug-cn","name":"Uyghur (China)"},{"key":"tzm","name":"Central Atlas Tamazight"},{"key":"uk","name":"Ukrainian"},{"key":"ur","name":"Urdu"},{"key":"uz-latn","name":"Uzbek Latin"},{"key":"vi","name":"Vietnamese"},{"key":"uz","name":"Uzbek"},{"key":"yo","name":"Yoruba Nigeria"},{"key":"x-pseudo","name":"Pseudo"},{"key":"zh-cn","name":"Chinese (China)"},{"key":"zh-hk","name":"Chinese (Hong Kong)"},{"key":"zh-tw","name":"Chinese (Taiwan)"},{"key":"zh","name":"Chinese"},{"key":"rw","name":"Kinyarwanda (Rwanda)"},{"key":"ru","name":"Russian"}] \ No newline at end of file diff --git a/node_modules/dayjs/locale/af.js b/node_modules/dayjs/locale/af.js new file mode 100644 index 00000000..62c75e4e --- /dev/null +++ b/node_modules/dayjs/locale/af.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_af=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),t={name:"af",weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),weekStart:1,weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"}};return n.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/am.js b/node_modules/dayjs/locale/am.js new file mode 100644 index 00000000..7b588a88 --- /dev/null +++ b/node_modules/dayjs/locale/am.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_am=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"am",weekdays:"እሑድ_ሰኞ_ማክሰኞ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ".split("_"),weekdaysShort:"እሑድ_ሰኞ_ማክሰ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ".split("_"),weekdaysMin:"እሑ_ሰኞ_ማክ_ረቡ_ሐሙ_አር_ቅዳ".split("_"),months:"ጃንዋሪ_ፌብሯሪ_ማርች_ኤፕሪል_ሜይ_ጁን_ጁላይ_ኦገስት_ሴፕቴምበር_ኦክቶበር_ኖቬምበር_ዲሴምበር".split("_"),monthsShort:"ጃንዋ_ፌብሯ_ማርች_ኤፕሪ_ሜይ_ጁን_ጁላይ_ኦገስ_ሴፕቴ_ኦክቶ_ኖቬም_ዲሴም".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"በ%s",past:"%s በፊት",s:"ጥቂት ሰከንዶች",m:"አንድ ደቂቃ",mm:"%d ደቂቃዎች",h:"አንድ ሰዓት",hh:"%d ሰዓታት",d:"አንድ ቀን",dd:"%d ቀናት",M:"አንድ ወር",MM:"%d ወራት",y:"አንድ ዓመት",yy:"%d ዓመታት"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM D ፣ YYYY",LLL:"MMMM D ፣ YYYY HH:mm",LLLL:"dddd ፣ MMMM D ፣ YYYY HH:mm"},ordinal:function(e){return e+"ኛ"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ar-dz.js b/node_modules/dayjs/locale/ar-dz.js new file mode 100644 index 00000000..55227905 --- /dev/null +++ b/node_modules/dayjs/locale/ar-dz.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ar_dz=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ar-dz",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"أح_إث_ثلا_أر_خم_جم_سب".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(_){return _>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ar-iq.js b/node_modules/dayjs/locale/ar-iq.js new file mode 100644 index 00000000..07e8c71c --- /dev/null +++ b/node_modules/dayjs/locale/ar-iq.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ar_iq=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"ar-iq",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(e){return e>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ar-kw.js b/node_modules/dayjs/locale/ar-kw.js new file mode 100644 index 00000000..a876ca06 --- /dev/null +++ b/node_modules/dayjs/locale/ar-kw.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ar_kw=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ar-kw",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(_){return _>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ar-ly.js b/node_modules/dayjs/locale/ar-ly.js new file mode 100644 index 00000000..9dbe09bf --- /dev/null +++ b/node_modules/dayjs/locale/ar-ly.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ar_ly=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),n={name:"ar-ly",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:6,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(_){return _},meridiem:function(_){return _>12?"م":"ص"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return t.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ar-ma.js b/node_modules/dayjs/locale/ar-ma.js new file mode 100644 index 00000000..dbb77cc9 --- /dev/null +++ b/node_modules/dayjs/locale/ar-ma.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ar_ma=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"ar-ma",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekStart:6,weekdaysShort:"احد_إثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(e){return e>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ar-sa.js b/node_modules/dayjs/locale/ar-sa.js new file mode 100644 index 00000000..9c2c0d4e --- /dev/null +++ b/node_modules/dayjs/locale/ar-sa.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ar_sa=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ar-sa",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(_){return _>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ar-tn.js b/node_modules/dayjs/locale/ar-tn.js new file mode 100644 index 00000000..944b46d0 --- /dev/null +++ b/node_modules/dayjs/locale/ar-tn.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ar_tn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"ar-tn",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(e){return e>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ar.js b/node_modules/dayjs/locale/ar.js new file mode 100644 index 00000000..517c49e2 --- /dev/null +++ b/node_modules/dayjs/locale/ar.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ar=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),r="يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),d={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},_={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o={name:"ar",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),months:r,monthsShort:r,weekStart:6,meridiem:function(e){return e>12?"م":"ص"},relativeTime:{future:"بعد %s",past:"منذ %s",s:"ثانية واحدة",m:"دقيقة واحدة",mm:"%d دقائق",h:"ساعة واحدة",hh:"%d ساعات",d:"يوم واحد",dd:"%d أيام",M:"شهر واحد",MM:"%d أشهر",y:"عام واحد",yy:"%d أعوام"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return _[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return d[e]})).replace(/,/g,"،")},ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return n.default.locale(o,null,!0),o})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/az.js b/node_modules/dayjs/locale/az.js new file mode 100644 index 00000000..d63ed1f2 --- /dev/null +++ b/node_modules/dayjs/locale/az.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_az=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var _=e(a),t={name:"az",weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},ordinal:function(a){return a}};return _.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/be.js b/node_modules/dayjs/locale/be.js new file mode 100644 index 00000000..704a87de --- /dev/null +++ b/node_modules/dayjs/locale/be.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_be=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),n={name:"be",weekdays:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),months:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),weekStart:1,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"}};return t.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/bg.js b/node_modules/dayjs/locale/bg.js new file mode 100644 index 00000000..4a3d316a --- /dev/null +++ b/node_modules/dayjs/locale/bg.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_bg=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"bg",weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekStart:1,ordinal:function(e){var _=e%100;if(_>10&&_<20)return e+"-ти";var t=e%10;return 1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/bi.js b/node_modules/dayjs/locale/bi.js new file mode 100644 index 00000000..e457dff6 --- /dev/null +++ b/node_modules/dayjs/locale/bi.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_bi=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),_={name:"bi",weekdays:"Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade".split("_"),months:"Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba".split("_"),weekStart:1,weekdaysShort:"San_Man_Tus_Wen_Tos_Frae_Sar".split("_"),monthsShort:"Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"San_Ma_Tu_We_To_Fr_Sar".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"lo %s",past:"%s bifo",s:"sam seken",m:"wan minit",mm:"%d minit",h:"wan haoa",hh:"%d haoa",d:"wan dei",dd:"%d dei",M:"wan manis",MM:"%d manis",y:"wan yia",yy:"%d yia"}};return n.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/bm.js b/node_modules/dayjs/locale/bm.js new file mode 100644 index 00000000..3c4fbdd2 --- /dev/null +++ b/node_modules/dayjs/locale/bm.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_bm=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var l=e(a),t={name:"bm",weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),weekStart:1,weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"}};return l.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/bn-bd.js b/node_modules/dayjs/locale/bn-bd.js new file mode 100644 index 00000000..ae76f9f0 --- /dev/null +++ b/node_modules/dayjs/locale/bn-bd.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_bn_bd=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=t(e),n={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},d={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},r={name:"bn-bd",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),weekStart:0,preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return d[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return n[e]}))},ordinal:function(e){var t=["ই","লা","রা","ঠা","শে"],_=e%100;return"["+e+(t[(_-20)%10]||t[_]||t[0])+"]"},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY খ্রিস্টাব্দ",LL:"D MMMM YYYY খ্রিস্টাব্দ",LLL:"D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়",LLLL:"dddd, D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়"},meridiem:function(e){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return _.default.locale(r,null,!0),r})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/bn.js b/node_modules/dayjs/locale/bn.js new file mode 100644 index 00000000..30ffa028 --- /dev/null +++ b/node_modules/dayjs/locale/bn.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_bn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),n={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},d={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},o={name:"bn",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return d[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return n[e]}))},ordinal:function(e){return e},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return t.default.locale(o,null,!0),o})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/bo.js b/node_modules/dayjs/locale/bo.js new file mode 100644 index 00000000..92bb7cc0 --- /dev/null +++ b/node_modules/dayjs/locale/bo.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_bo=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"bo",weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་དང་པོ_ཟླ་གཉིས་པ_ཟླ་གསུམ་པ_ཟླ་བཞི་པ_ཟླ་ལྔ་པ_ཟླ་དྲུག་པ_ཟླ་བདུན་པ_ཟླ་བརྒྱད་པ_ཟླ་དགུ་པ_ཟླ་བཅུ་པ_ཟླ་བཅུ་གཅིག་པ_ཟླ་བཅུ་གཉིས་པ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ལ་",past:"%s སྔོན་ལ་",s:"ཏོག་ཙམ་",m:"སྐར་མ་གཅིག་",mm:"སྐར་མ་ %d",h:"ཆུ་ཚོད་གཅིག་",hh:"ཆུ་ཚོད་ %d",d:"ཉིན་གཅིག་",dd:"ཉིན་ %d",M:"ཟླ་བ་གཅིག་",MM:"ཟླ་བ་ %d",y:"ལོ་གཅིག་",yy:"ལོ་ %d"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/br.js b/node_modules/dayjs/locale/br.js new file mode 100644 index 00000000..0b2317fa --- /dev/null +++ b/node_modules/dayjs/locale/br.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_br=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e);function r(e){return e>9?r(e%10):e}function t(e,n,u){return e+" "+function(e,n){return 2===n?function(e){return{m:"v",b:"v",d:"z"}[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[u],e)}var o={name:"br",weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),weekStart:1,weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(r(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},meridiem:function(e){return e<12?"a.m.":"g.m."}};return u.default.locale(o,null,!0),o})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/bs.js b/node_modules/dayjs/locale/bs.js new file mode 100644 index 00000000..25dcd6d5 --- /dev/null +++ b/node_modules/dayjs/locale/bs.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_bs=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=t(e),a={name:"bs",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return _.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ca.js b/node_modules/dayjs/locale/ca.js new file mode 100644 index 00000000..1614cc20 --- /dev/null +++ b/node_modules/dayjs/locale/ca.js @@ -0,0 +1 @@ +!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ca=s(e.dayjs)}(this,(function(e){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=s(e),_={name:"ca",weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",ll:"D MMM YYYY",lll:"D MMM YYYY, H:mm",llll:"ddd D MMM YYYY, H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(e){return""+e+(1===e||3===e?"r":2===e?"n":4===e?"t":"è")}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/cs.js b/node_modules/dayjs/locale/cs.js new file mode 100644 index 00000000..43bddb9b --- /dev/null +++ b/node_modules/dayjs/locale/cs.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_cs=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e);function s(e){return e>1&&e<5&&1!=~~(e/10)}function r(e,n,t,r){var d=e+" ";switch(t){case"s":return n||r?"pár sekund":"pár sekundami";case"m":return n?"minuta":r?"minutu":"minutou";case"mm":return n||r?d+(s(e)?"minuty":"minut"):d+"minutami";case"h":return n?"hodina":r?"hodinu":"hodinou";case"hh":return n||r?d+(s(e)?"hodiny":"hodin"):d+"hodinami";case"d":return n||r?"den":"dnem";case"dd":return n||r?d+(s(e)?"dny":"dní"):d+"dny";case"M":return n||r?"měsíc":"měsícem";case"MM":return n||r?d+(s(e)?"měsíce":"měsíců"):d+"měsíci";case"y":return n||r?"rok":"rokem";case"yy":return n||r?d+(s(e)?"roky":"let"):d+"lety"}}var d={name:"cs",weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),months:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),monthsShort:"led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),weekStart:1,yearStart:4,ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"před %s",s:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/cv.js b/node_modules/dayjs/locale/cv.js new file mode 100644 index 00000000..a30efe0c --- /dev/null +++ b/node_modules/dayjs/locale/cv.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_cv=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),n={name:"cv",weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),weekStart:1,weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"}};return t.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/cy.js b/node_modules/dayjs/locale/cy.js new file mode 100644 index 00000000..ee1910f5 --- /dev/null +++ b/node_modules/dayjs/locale/cy.js @@ -0,0 +1 @@ +!function(d,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(d="undefined"!=typeof globalThis?globalThis:d||self).dayjs_locale_cy=e(d.dayjs)}(this,(function(d){"use strict";function e(d){return d&&"object"==typeof d&&"default"in d?d:{default:d}}var _=e(d),a={name:"cy",weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),weekStart:1,weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),ordinal:function(d){return d},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"}};return _.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/da.js b/node_modules/dayjs/locale/da.js new file mode 100644 index 00000000..fd45a45c --- /dev/null +++ b/node_modules/dayjs/locale/da.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_da=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=t(e),n={name:"da",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn._man._tirs._ons._tors._fre._lør.".split("_"),weekdaysMin:"sø._ma._ti._on._to._fr._lø.".split("_"),months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.".split("_"),weekStart:1,ordinal:function(e){return e+"."},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"}};return d.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/de-at.js b/node_modules/dayjs/locale/de-at.js new file mode 100644 index 00000000..ca51ef51 --- /dev/null +++ b/node_modules/dayjs/locale/de-at.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_de_at=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function a(e,n,t){var a=i[t];return Array.isArray(a)&&(a=a[n?0:1]),a.replace("%d",e)}var r={name:"de-at",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(e){return e+"."},weekStart:1,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a}};return t.default.locale(r,null,!0),r})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/de-ch.js b/node_modules/dayjs/locale/de-ch.js new file mode 100644 index 00000000..3fef2182 --- /dev/null +++ b/node_modules/dayjs/locale/de-ch.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_de_ch=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e),a={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function i(e,n,t){var i=a[t];return Array.isArray(i)&&(i=i[n?0:1]),i.replace("%d",e)}var r={name:"de-ch",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(e){return e+"."},weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i}};return t.default.locale(r,null,!0),r})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/de.js b/node_modules/dayjs/locale/de.js new file mode 100644 index 00000000..35f05ecb --- /dev/null +++ b/node_modules/dayjs/locale/de.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_de=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e),a={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function i(e,n,t){var i=a[t];return Array.isArray(i)&&(i=i[n?0:1]),i.replace("%d",e)}var r={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(e){return e+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i}};return t.default.locale(r,null,!0),r})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/dv.js b/node_modules/dayjs/locale/dv.js new file mode 100644 index 00000000..b0bd8f9b --- /dev/null +++ b/node_modules/dayjs/locale/dv.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_dv=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"dv",weekdays:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),months:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekStart:7,weekdaysShort:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),monthsShort:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/el.js b/node_modules/dayjs/locale/el.js new file mode 100644 index 00000000..14880342 --- /dev/null +++ b/node_modules/dayjs/locale/el.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_el=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"el",weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),months:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαι_Ιουν_Ιουλ_Αυγ_Σεπτ_Οκτ_Νοε_Δεκ".split("_"),ordinal:function(e){return e},weekStart:1,relativeTime:{future:"σε %s",past:"πριν %s",s:"μερικά δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένα μήνα",MM:"%d μήνες",y:"ένα χρόνο",yy:"%d χρόνια"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-au.js b/node_modules/dayjs/locale/en-au.js new file mode 100644 index 00000000..b952cdbf --- /dev/null +++ b/node_modules/dayjs/locale/en-au.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_au=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),_={name:"en-au",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-ca.js b/node_modules/dayjs/locale/en-ca.js new file mode 100644 index 00000000..bf766214 --- /dev/null +++ b/node_modules/dayjs/locale/en-ca.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_ca=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=a(e),t={name:"en-ca",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return _.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-gb.js b/node_modules/dayjs/locale/en-gb.js new file mode 100644 index 00000000..7fc7c3f5 --- /dev/null +++ b/node_modules/dayjs/locale/en-gb.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_gb=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),_={name:"en-gb",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(e){var a=["th","st","nd","rd"],t=e%100;return"["+e+(a[(t-20)%10]||a[t]||a[0])+"]"}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-ie.js b/node_modules/dayjs/locale/en-ie.js new file mode 100644 index 00000000..b0ad3f90 --- /dev/null +++ b/node_modules/dayjs/locale/en-ie.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_ie=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),_={name:"en-ie",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-il.js b/node_modules/dayjs/locale/en-il.js new file mode 100644 index 00000000..d8bea62d --- /dev/null +++ b/node_modules/dayjs/locale/en-il.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_il=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=a(e),t={name:"en-il",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return _.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-in.js b/node_modules/dayjs/locale/en-in.js new file mode 100644 index 00000000..af8cff3b --- /dev/null +++ b/node_modules/dayjs/locale/en-in.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_in=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),n={name:"en-in",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(e){var a=["th","st","nd","rd"],t=e%100;return"["+e+(a[(t-20)%10]||a[t]||a[0])+"]"}};return t.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-nz.js b/node_modules/dayjs/locale/en-nz.js new file mode 100644 index 00000000..058abbe7 --- /dev/null +++ b/node_modules/dayjs/locale/en-nz.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_nz=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),n={name:"en-nz",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){var a=["th","st","nd","rd"],t=e%100;return"["+e+(a[(t-20)%10]||a[t]||a[0])+"]"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return t.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-sg.js b/node_modules/dayjs/locale/en-sg.js new file mode 100644 index 00000000..787fa847 --- /dev/null +++ b/node_modules/dayjs/locale/en-sg.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_sg=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),_={name:"en-sg",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en-tt.js b/node_modules/dayjs/locale/en-tt.js new file mode 100644 index 00000000..afc4d361 --- /dev/null +++ b/node_modules/dayjs/locale/en-tt.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en_tt=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),_={name:"en-tt",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(e){var t=["th","st","nd","rd"],a=e%100;return"["+e+(t[(a-20)%10]||t[a]||t[0])+"]"}};return a.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/en.js b/node_modules/dayjs/locale/en.js new file mode 100644 index 00000000..847cbfda --- /dev/null +++ b/node_modules/dayjs/locale/en.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_en=n()}(this,(function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return"["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/eo.js b/node_modules/dayjs/locale/eo.js new file mode 100644 index 00000000..2dcbe014 --- /dev/null +++ b/node_modules/dayjs/locale/eo.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_eo=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(e),t={name:"eo",weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-a de] MMMM, YYYY",LLL:"D[-a de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-a de] MMMM, YYYY HH:mm"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"}};return a.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/es-do.js b/node_modules/dayjs/locale/es-do.js new file mode 100644 index 00000000..07907ad1 --- /dev/null +++ b/node_modules/dayjs/locale/es-do.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_es_do=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),d={name:"es-do",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekStart:1,relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return s.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/es-mx.js b/node_modules/dayjs/locale/es-mx.js new file mode 100644 index 00000000..f865a2d1 --- /dev/null +++ b/node_modules/dayjs/locale/es-mx.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_es_mx=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),d={name:"es-mx",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"}};return s.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/es-pr.js b/node_modules/dayjs/locale/es-pr.js new file mode 100644 index 00000000..56fdeb45 --- /dev/null +++ b/node_modules/dayjs/locale/es-pr.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_es_pr=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),d={name:"es-pr",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"}};return s.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/es-us.js b/node_modules/dayjs/locale/es-us.js new file mode 100644 index 00000000..35f55353 --- /dev/null +++ b/node_modules/dayjs/locale/es-us.js @@ -0,0 +1 @@ +!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_es_us=s(e.dayjs)}(this,(function(e){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=s(e),d={name:"es-us",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return o.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/es.js b/node_modules/dayjs/locale/es.js new file mode 100644 index 00000000..eb33b810 --- /dev/null +++ b/node_modules/dayjs/locale/es.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_es=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),d={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(e){return e+"º"}};return s.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/et.js b/node_modules/dayjs/locale/et.js new file mode 100644 index 00000000..4158d138 --- /dev/null +++ b/node_modules/dayjs/locale/et.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_et=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e);function u(e,a,t,u){var s={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:["%d minuti","%d minutit"],h:["ühe tunni","tund aega","üks tund"],hh:["%d tunni","%d tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:["%d kuu","%d kuud"],y:["ühe aasta","aasta","üks aasta"],yy:["%d aasta","%d aastat"]};return a?(s[t][2]?s[t][2]:s[t][1]).replace("%d",e):(u?s[t][0]:s[t][1]).replace("%d",e)}var s={name:"et",weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),ordinal:function(e){return e+"."},weekStart:1,relativeTime:{future:"%s pärast",past:"%s tagasi",s:u,m:u,mm:u,h:u,hh:u,d:u,dd:"%d päeva",M:u,MM:u,y:u,yy:u},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return t.default.locale(s,null,!0),s})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/eu.js b/node_modules/dayjs/locale/eu.js new file mode 100644 index 00000000..ed8e2284 --- /dev/null +++ b/node_modules/dayjs/locale/eu.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_eu=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var t=e(a),l={name:"eu",weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),weekStart:1,weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"}};return t.default.locale(l,null,!0),l})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/fa.js b/node_modules/dayjs/locale/fa.js new file mode 100644 index 00000000..648bb4eb --- /dev/null +++ b/node_modules/dayjs/locale/fa.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_fa=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"fa",weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/fi.js b/node_modules/dayjs/locale/fi.js new file mode 100644 index 00000000..2681ebd1 --- /dev/null +++ b/node_modules/dayjs/locale/fi.js @@ -0,0 +1 @@ +!function(u,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(u="undefined"!=typeof globalThis?globalThis:u||self).dayjs_locale_fi=e(u.dayjs)}(this,(function(u){"use strict";function e(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var t=e(u);function n(u,e,t,n){var i={s:"muutama sekunti",m:"minuutti",mm:"%d minuuttia",h:"tunti",hh:"%d tuntia",d:"päivä",dd:"%d päivää",M:"kuukausi",MM:"%d kuukautta",y:"vuosi",yy:"%d vuotta",numbers:"nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän".split("_")},a={s:"muutaman sekunnin",m:"minuutin",mm:"%d minuutin",h:"tunnin",hh:"%d tunnin",d:"päivän",dd:"%d päivän",M:"kuukauden",MM:"%d kuukauden",y:"vuoden",yy:"%d vuoden",numbers:"nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän".split("_")},s=n&&!e?a:i,_=s[t];return u<10?_.replace("%d",s.numbers[u]):_.replace("%d",u)}var i={name:"fi",weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),ordinal:function(u){return u+"."},weekStart:1,yearStart:4,relativeTime:{future:"%s päästä",past:"%s sitten",s:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM[ta] YYYY",LLL:"D. MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, D. MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [klo] HH.mm",llll:"ddd, D. MMM YYYY, [klo] HH.mm"}};return t.default.locale(i,null,!0),i})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/fo.js b/node_modules/dayjs/locale/fo.js new file mode 100644 index 00000000..ff6f8d8b --- /dev/null +++ b/node_modules/dayjs/locale/fo.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_fo=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),r={name:"fo",weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"}};return a.default.locale(r,null,!0),r})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/fr-ca.js b/node_modules/dayjs/locale/fr-ca.js new file mode 100644 index 00000000..9cc0d037 --- /dev/null +++ b/node_modules/dayjs/locale/fr-ca.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_fr_ca=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e),_={name:"fr-ca",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return i.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/fr-ch.js b/node_modules/dayjs/locale/fr-ch.js new file mode 100644 index 00000000..1308de99 --- /dev/null +++ b/node_modules/dayjs/locale/fr-ch.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_fr_ch=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e),_={name:"fr-ch",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekStart:1,weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return i.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/fr.js b/node_modules/dayjs/locale/fr.js new file mode 100644 index 00000000..8c42be4b --- /dev/null +++ b/node_modules/dayjs/locale/fr.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_fr=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e),i={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(e){return""+e+(1===e?"er":"")}};return t.default.locale(i,null,!0),i})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/fy.js b/node_modules/dayjs/locale/fy.js new file mode 100644 index 00000000..291dd5f5 --- /dev/null +++ b/node_modules/dayjs/locale/fy.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_fy=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e),t={name:"fy",weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),weekStart:1,weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"}};return i.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ga.js b/node_modules/dayjs/locale/ga.js new file mode 100644 index 00000000..0b2489f4 --- /dev/null +++ b/node_modules/dayjs/locale/ga.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_ga=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var i=e(a),n={name:"ga",weekdays:"Dé Domhnaigh_Dé Luain_Dé Máirt_Dé Céadaoin_Déardaoin_Dé hAoine_Dé Satharn".split("_"),months:"Eanáir_Feabhra_Márta_Aibreán_Bealtaine_Méitheamh_Iúil_Lúnasa_Meán Fómhair_Deaireadh Fómhair_Samhain_Nollaig".split("_"),weekStart:1,weekdaysShort:"Dom_Lua_Mái_Céa_Déa_hAo_Sat".split("_"),monthsShort:"Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll".split("_"),weekdaysMin:"Do_Lu_Má_Ce_Dé_hA_Sa".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d mí",y:"bliain",yy:"%d bliain"}};return i.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/gd.js b/node_modules/dayjs/locale/gd.js new file mode 100644 index 00000000..c7e47ab0 --- /dev/null +++ b/node_modules/dayjs/locale/gd.js @@ -0,0 +1 @@ +!function(a,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],i):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_gd=i(a.dayjs)}(this,(function(a){"use strict";function i(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var n=i(a),e={name:"gd",weekdays:"Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne".split("_"),months:"Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd".split("_"),weekStart:1,weekdaysShort:"Did_Dil_Dim_Dic_Dia_Dih_Dis".split("_"),monthsShort:"Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh".split("_"),weekdaysMin:"Dò_Lu_Mà_Ci_Ar_Ha_Sa".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"}};return n.default.locale(e,null,!0),e})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/gl.js b/node_modules/dayjs/locale/gl.js new file mode 100644 index 00000000..f5cf4832 --- /dev/null +++ b/node_modules/dayjs/locale/gl.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_gl=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),d={name:"gl",weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),ordinal:function(e){return e+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"}};return s.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/gom-latn.js b/node_modules/dayjs/locale/gom-latn.js new file mode 100644 index 00000000..15966184 --- /dev/null +++ b/node_modules/dayjs/locale/gom-latn.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_gom_latn=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),_={name:"gom-latn",weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),weekStart:1,weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),ordinal:function(e){return e},formats:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"}};return a.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/gu.js b/node_modules/dayjs/locale/gu.js new file mode 100644 index 00000000..f42a17c5 --- /dev/null +++ b/node_modules/dayjs/locale/gu.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_gu=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"gu",weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/he.js b/node_modules/dayjs/locale/he.js new file mode 100644 index 00000000..3e4062e2 --- /dev/null +++ b/node_modules/dayjs/locale/he.js @@ -0,0 +1 @@ +!function(Y,M){"object"==typeof exports&&"undefined"!=typeof module?module.exports=M(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],M):(Y="undefined"!=typeof globalThis?globalThis:Y||self).dayjs_locale_he=M(Y.dayjs)}(this,(function(Y){"use strict";function M(Y){return Y&&"object"==typeof Y&&"default"in Y?Y:{default:Y}}var d=M(Y),e={s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:"%d שעות",hh2:"שעתיים",d:"יום",dd:"%d ימים",dd2:"יומיים",M:"חודש",MM:"%d חודשים",MM2:"חודשיים",y:"שנה",yy:"%d שנים",yy2:"שנתיים"};function _(Y,M,d){return(e[d+(2===Y?"2":"")]||e[d]).replace("%d",Y)}var l={name:"he",weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א׳_ב׳_ג׳_ד׳_ה׳_ו_ש׳".split("_"),months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו_פבר_מרץ_אפר_מאי_יונ_יול_אוג_ספט_אוק_נוב_דצמ".split("_"),relativeTime:{future:"בעוד %s",past:"לפני %s",s:_,m:_,mm:_,h:_,hh:_,d:_,dd:_,M:_,MM:_,y:_,yy:_},ordinal:function(Y){return Y},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"}};return d.default.locale(l,null,!0),l})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/hi.js b/node_modules/dayjs/locale/hi.js new file mode 100644 index 00000000..9dca3cf5 --- /dev/null +++ b/node_modules/dayjs/locale/hi.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_hi=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"hi",weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/hr.js b/node_modules/dayjs/locale/hr.js new file mode 100644 index 00000000..12e83873 --- /dev/null +++ b/node_modules/dayjs/locale/hr.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_hr=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),s="siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),n="siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),_=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/,o=function(e,a){return _.test(a)?s[e.month()]:n[e.month()]};o.s=n,o.f=s;var i={name:"hr",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:o,monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},relativeTime:{future:"za %s",past:"prije %s",s:"sekunda",m:"minuta",mm:"%d minuta",h:"sat",hh:"%d sati",d:"dan",dd:"%d dana",M:"mjesec",MM:"%d mjeseci",y:"godina",yy:"%d godine"},ordinal:function(e){return e+"."}};return t.default.locale(i,null,!0),i})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ht.js b/node_modules/dayjs/locale/ht.js new file mode 100644 index 00000000..3b2d9a3b --- /dev/null +++ b/node_modules/dayjs/locale/ht.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ht=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=n(e),a={name:"ht",weekdays:"dimanch_lendi_madi_mèkredi_jedi_vandredi_samdi".split("_"),months:"janvye_fevriye_mas_avril_me_jen_jiyè_out_septanm_oktòb_novanm_desanm".split("_"),weekdaysShort:"dim._len._mad._mèk._jed._van._sam.".split("_"),monthsShort:"jan._fev._mas_avr._me_jen_jiyè._out_sept._okt._nov._des.".split("_"),weekdaysMin:"di_le_ma_mè_je_va_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"nan %s",past:"sa gen %s",s:"kèk segond",m:"yon minit",mm:"%d minit",h:"inèdtan",hh:"%d zè",d:"yon jou",dd:"%d jou",M:"yon mwa",MM:"%d mwa",y:"yon ane",yy:"%d ane"}};return d.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/hu.js b/node_modules/dayjs/locale/hu.js new file mode 100644 index 00000000..e2aff042 --- /dev/null +++ b/node_modules/dayjs/locale/hu.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_hu=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e),r={name:"hu",weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),ordinal:function(e){return e+"."},weekStart:1,relativeTime:{future:"%s múlva",past:"%s",s:function(e,n,t,r){return"néhány másodperc"+(r||n?"":"e")},m:function(e,n,t,r){return"egy perc"+(r||n?"":"e")},mm:function(e,n,t,r){return e+" perc"+(r||n?"":"e")},h:function(e,n,t,r){return"egy "+(r||n?"óra":"órája")},hh:function(e,n,t,r){return e+" "+(r||n?"óra":"órája")},d:function(e,n,t,r){return"egy "+(r||n?"nap":"napja")},dd:function(e,n,t,r){return e+" "+(r||n?"nap":"napja")},M:function(e,n,t,r){return"egy "+(r||n?"hónap":"hónapja")},MM:function(e,n,t,r){return e+" "+(r||n?"hónap":"hónapja")},y:function(e,n,t,r){return"egy "+(r||n?"év":"éve")},yy:function(e,n,t,r){return e+" "+(r||n?"év":"éve")}},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"}};return t.default.locale(r,null,!0),r})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/hy-am.js b/node_modules/dayjs/locale/hy-am.js new file mode 100644 index 00000000..44daa15b --- /dev/null +++ b/node_modules/dayjs/locale/hy-am.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_hy_am=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"hy-am",weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),months:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),weekStart:1,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/id.js b/node_modules/dayjs/locale/id.js new file mode 100644 index 00000000..0637a651 --- /dev/null +++ b/node_modules/dayjs/locale/id.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_id=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),_={name:"id",weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(e){return e+"."}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/index.d.ts b/node_modules/dayjs/locale/index.d.ts new file mode 100644 index 00000000..bd2dca2c --- /dev/null +++ b/node_modules/dayjs/locale/index.d.ts @@ -0,0 +1,11 @@ +/// + +declare module 'dayjs/locale/*' { + namespace locale { + interface Locale extends ILocale {} + } + + const locale: locale.Locale + + export = locale +} diff --git a/node_modules/dayjs/locale/is.js b/node_modules/dayjs/locale/is.js new file mode 100644 index 00000000..de6799ba --- /dev/null +++ b/node_modules/dayjs/locale/is.js @@ -0,0 +1 @@ +!function(u,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],r):(u="undefined"!=typeof globalThis?globalThis:u||self).dayjs_locale_is=r(u.dayjs)}(this,(function(u){"use strict";function r(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var n=r(u),e={s:["nokkrar sekúndur","nokkrar sekúndur","nokkrum sekúndum"],m:["mínúta","mínútu","mínútu"],mm:["mínútur","mínútur","mínútum"],h:["klukkustund","klukkustund","klukkustund"],hh:["klukkustundir","klukkustundir","klukkustundum"],d:["dagur","dag","degi"],dd:["dagar","daga","dögum"],M:["mánuður","mánuð","mánuði"],MM:["mánuðir","mánuði","mánuðum"],y:["ár","ár","ári"],yy:["ár","ár","árum"]};function t(u,r,n,t){var a=function(u,r,n,t){var a=t?0:n?1:2,d=2===u.length&&r%10==1?u[0]:u,m=e[d][a];return 1===u.length?m:"%d "+m}(n,u,t,r);return a.replace("%d",u)}var a={name:"is",weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),ordinal:function(u){return u},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t}};return n.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/it-ch.js b/node_modules/dayjs/locale/it-ch.js new file mode 100644 index 00000000..7e1c92f7 --- /dev/null +++ b/node_modules/dayjs/locale/it-ch.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_it_ch=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(e),t={name:"it-ch",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"}};return n.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/it.js b/node_modules/dayjs/locale/it.js new file mode 100644 index 00000000..2ddf44b7 --- /dev/null +++ b/node_modules/dayjs/locale/it.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_it=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=o(e),n={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(e){return e+"º"}};return t.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ja.js b/node_modules/dayjs/locale/ja.js new file mode 100644 index 00000000..cd52f361 --- /dev/null +++ b/node_modules/dayjs/locale/ja.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ja=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e){return e+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(e){return e<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/jv.js b/node_modules/dayjs/locale/jv.js new file mode 100644 index 00000000..75663085 --- /dev/null +++ b/node_modules/dayjs/locale/jv.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_jv=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e),_={name:"jv",weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),weekStart:1,weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),ordinal:function(e){return e},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ka.js b/node_modules/dayjs/locale/ka.js new file mode 100644 index 00000000..7b2ce532 --- /dev/null +++ b/node_modules/dayjs/locale/ka.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ka=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ka",weekdays:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"%s შემდეგ",past:"%s წინ",s:"წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათის",d:"დღეს",dd:"%d დღის განმავლობაში",M:"თვის",MM:"%d თვის",y:"წელი",yy:"%d წლის"},ordinal:function(_){return _}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/kk.js b/node_modules/dayjs/locale/kk.js new file mode 100644 index 00000000..a2f17a33 --- /dev/null +++ b/node_modules/dayjs/locale/kk.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_kk=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"kk",weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekStart:1,relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/km.js b/node_modules/dayjs/locale/km.js new file mode 100644 index 00000000..528923e7 --- /dev/null +++ b/node_modules/dayjs/locale/km.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_km=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"km",weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekStart:1,weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/kn.js b/node_modules/dayjs/locale/kn.js new file mode 100644 index 00000000..e040ebab --- /dev/null +++ b/node_modules/dayjs/locale/kn.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_kn=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"kn",weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ko.js b/node_modules/dayjs/locale/ko.js new file mode 100644 index 00000000..cfe8b379 --- /dev/null +++ b/node_modules/dayjs/locale/ko.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ko=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=_(e),t={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(e){return e+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(e){return e<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return d.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ku.js b/node_modules/dayjs/locale/ku.js new file mode 100644 index 00000000..cd98fc2c --- /dev/null +++ b/node_modules/dayjs/locale/ku.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("dayjs")):"function"==typeof define&&define.amd?define(["exports","dayjs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ku={},e.dayjs)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t),d={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},o={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},u=["کانوونی دووەم","شوبات","ئادار","نیسان","ئایار","حوزەیران","تەممووز","ئاب","ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانوونی یەکەم"],i={name:"ku",months:u,monthsShort:u,weekdays:"یەکشەممە_دووشەممە_سێشەممە_چوارشەممە_پێنجشەممە_هەینی_شەممە".split("_"),weekdaysShort:"یەکشەم_دووشەم_سێشەم_چوارشەم_پێنجشەم_هەینی_شەممە".split("_"),weekStart:6,weekdaysMin:"ی_د_س_چ_پ_هـ_ش".split("_"),preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return o[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return d[e]})).replace(/,/g,"،")},ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiem:function(e){return e<12?"پ.ن":"د.ن"},relativeTime:{future:"لە %s",past:"لەمەوپێش %s",s:"چەند چرکەیەک",m:"یەک خولەک",mm:"%d خولەک",h:"یەک کاتژمێر",hh:"%d کاتژمێر",d:"یەک ڕۆژ",dd:"%d ڕۆژ",M:"یەک مانگ",MM:"%d مانگ",y:"یەک ساڵ",yy:"%d ساڵ"}};r.default.locale(i,null,!0),e.default=i,e.englishToArabicNumbersMap=d,Object.defineProperty(e,"__esModule",{value:!0})})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ky.js b/node_modules/dayjs/locale/ky.js new file mode 100644 index 00000000..1fdc40e3 --- /dev/null +++ b/node_modules/dayjs/locale/ky.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ky=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ky",weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),weekStart:1,weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/lb.js b/node_modules/dayjs/locale/lb.js new file mode 100644 index 00000000..b6895f24 --- /dev/null +++ b/node_modules/dayjs/locale/lb.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_lb=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),n={name:"lb",weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),weekStart:1,weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"}};return t.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/lo.js b/node_modules/dayjs/locale/lo.js new file mode 100644 index 00000000..1bf09d1d --- /dev/null +++ b/node_modules/dayjs/locale/lo.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_lo=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"lo",weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/lt.js b/node_modules/dayjs/locale/lt.js new file mode 100644 index 00000000..52f22258 --- /dev/null +++ b/node_modules/dayjs/locale/lt.js @@ -0,0 +1 @@ +!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_lt=s(e.dayjs)}(this,(function(e){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=s(e),d="sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),a="sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),l=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,M=function(e,s){return l.test(s)?d[e.month()]:a[e.month()]};M.s=a,M.f=d;var t={name:"lt",weekdays:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),weekdaysShort:"sek_pir_ant_tre_ket_pen_šeš".split("_"),weekdaysMin:"s_p_a_t_k_pn_š".split("_"),months:M,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),ordinal:function(e){return e+"."},weekStart:1,relativeTime:{future:"už %s",past:"prieš %s",s:"kelias sekundes",m:"minutę",mm:"%d minutes",h:"valandą",hh:"%d valandas",d:"dieną",dd:"%d dienas",M:"mėnesį",MM:"%d mėnesius",y:"metus",yy:"%d metus"},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"}};return i.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/lv.js b/node_modules/dayjs/locale/lv.js new file mode 100644 index 00000000..98fc1265 --- /dev/null +++ b/node_modules/dayjs/locale/lv.js @@ -0,0 +1 @@ +!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_lv=s(e.dayjs)}(this,(function(e){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=s(e),d={name:"lv",weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),weekStart:1,weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},relativeTime:{future:"pēc %s",past:"pirms %s",s:"dažām sekundēm",m:"minūtes",mm:"%d minūtēm",h:"stundas",hh:"%d stundām",d:"dienas",dd:"%d dienām",M:"mēneša",MM:"%d mēnešiem",y:"gada",yy:"%d gadiem"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/me.js b/node_modules/dayjs/locale/me.js new file mode 100644 index 00000000..ecb22aef --- /dev/null +++ b/node_modules/dayjs/locale/me.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_me=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=t(e),a={name:"me",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return _.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/mi.js b/node_modules/dayjs/locale/mi.js new file mode 100644 index 00000000..1b328f07 --- /dev/null +++ b/node_modules/dayjs/locale/mi.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_mi=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(e),t={name:"mi",weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),weekStart:1,weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"}};return i.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/mk.js b/node_modules/dayjs/locale/mk.js new file mode 100644 index 00000000..0f2ece14 --- /dev/null +++ b/node_modules/dayjs/locale/mk.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_mk=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"mk",weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),weekStart:1,weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),ordinal:function(e){return e},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ml.js b/node_modules/dayjs/locale/ml.js new file mode 100644 index 00000000..8e7db4f7 --- /dev/null +++ b/node_modules/dayjs/locale/ml.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ml=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ml",weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/mn.js b/node_modules/dayjs/locale/mn.js new file mode 100644 index 00000000..4de299bf --- /dev/null +++ b/node_modules/dayjs/locale/mn.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_mn=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"mn",weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},relativeTime:{future:"%s",past:"%s",s:"саяхан",m:"м",mm:"%dм",h:"1ц",hh:"%dц",d:"1ө",dd:"%dө",M:"1с",MM:"%dс",y:"1ж",yy:"%dж"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/mr.js b/node_modules/dayjs/locale/mr.js new file mode 100644 index 00000000..af6bb3ae --- /dev/null +++ b/node_modules/dayjs/locale/mr.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_mr=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),n={name:"mr",weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"}};return t.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ms-my.js b/node_modules/dayjs/locale/ms-my.js new file mode 100644 index 00000000..1917d7ac --- /dev/null +++ b/node_modules/dayjs/locale/ms-my.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ms_my=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),_={name:"ms-my",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),weekStart:1,weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),ordinal:function(e){return e},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ms.js b/node_modules/dayjs/locale/ms.js new file mode 100644 index 00000000..be4f88ea --- /dev/null +++ b/node_modules/dayjs/locale/ms.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ms=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=a(e),s={name:"ms",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH.mm",LLLL:"dddd, D MMMM YYYY HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(e){return e+"."}};return t.default.locale(s,null,!0),s})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/mt.js b/node_modules/dayjs/locale/mt.js new file mode 100644 index 00000000..43d481a3 --- /dev/null +++ b/node_modules/dayjs/locale/mt.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_mt=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),i={name:"mt",weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),weekStart:1,weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"}};return a.default.locale(i,null,!0),i})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/my.js b/node_modules/dayjs/locale/my.js new file mode 100644 index 00000000..95adead3 --- /dev/null +++ b/node_modules/dayjs/locale/my.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_my=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"my",weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),weekStart:1,weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/nb.js b/node_modules/dayjs/locale/nb.js new file mode 100644 index 00000000..ece1f317 --- /dev/null +++ b/node_modules/dayjs/locale/nb.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_nb=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),a={name:"nb",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),ordinal:function(e){return e+"."},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"}};return n.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ne.js b/node_modules/dayjs/locale/ne.js new file mode 100644 index 00000000..3d166bcc --- /dev/null +++ b/node_modules/dayjs/locale/ne.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ne=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"ne",weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),relativeTime:{future:"%s पछि",past:"%s अघि",s:"सेकेन्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"घन्टा",hh:"%d घन्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक वर्ष",yy:"%d वर्ष"},ordinal:function(e){return(""+e).replace(/\d/g,(function(e){return"०१२३४५६७८९"[e]}))},formats:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/nl-be.js b/node_modules/dayjs/locale/nl-be.js new file mode 100644 index 00000000..7a2f60f5 --- /dev/null +++ b/node_modules/dayjs/locale/nl-be.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_nl_be=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),d={name:"nl-be",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),weekStart:1,weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"}};return n.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/nl.js b/node_modules/dayjs/locale/nl.js new file mode 100644 index 00000000..47e789f2 --- /dev/null +++ b/node_modules/dayjs/locale/nl.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_nl=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(e),n={name:"nl",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),ordinal:function(e){return"["+e+(1===e||8===e||e>=20?"ste":"de")+"]"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"een minuut",mm:"%d minuten",h:"een uur",hh:"%d uur",d:"een dag",dd:"%d dagen",M:"een maand",MM:"%d maanden",y:"een jaar",yy:"%d jaar"}};return d.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/nn.js b/node_modules/dayjs/locale/nn.js new file mode 100644 index 00000000..eba3c244 --- /dev/null +++ b/node_modules/dayjs/locale/nn.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_nn=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),a={name:"nn",weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ordinal:function(e){return e+"."},weekStart:1,relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eitt minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månadar",y:"eitt år",yy:"%d år"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"}};return n.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/oc-lnc.js b/node_modules/dayjs/locale/oc-lnc.js new file mode 100644 index 00000000..12e162c3 --- /dev/null +++ b/node_modules/dayjs/locale/oc-lnc.js @@ -0,0 +1 @@ +!function(e,d){"object"==typeof exports&&"undefined"!=typeof module?module.exports=d(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],d):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_oc_lnc=d(e.dayjs)}(this,(function(e){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=d(e),s={name:"oc-lnc",weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"Dg_Dl_Dm_Dc_Dj_Dv_Ds".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),months:"genièr_febrièr_març_abrial_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),monthsShort:"gen_feb_març_abr_mai_junh_julh_ago_set_oct_nov_dec".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},ordinal:function(e){return e+"º"}};return n.default.locale(s,null,!0),s})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/pa-in.js b/node_modules/dayjs/locale/pa-in.js new file mode 100644 index 00000000..4ee38844 --- /dev/null +++ b/node_modules/dayjs/locale/pa-in.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_pa_in=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"pa-in",weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/pl.js b/node_modules/dayjs/locale/pl.js new file mode 100644 index 00000000..3f5148c4 --- /dev/null +++ b/node_modules/dayjs/locale/pl.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_pl=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(e);function a(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function n(e,t,i){var n=e+" ";switch(i){case"m":return t?"minuta":"minutę";case"mm":return n+(a(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return n+(a(e)?"godziny":"godzin");case"MM":return n+(a(e)?"miesiące":"miesięcy");case"yy":return n+(a(e)?"lata":"lat")}}var r="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),_="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),s=/D MMMM/,d=function(e,t){return s.test(t)?r[e.month()]:_[e.month()]};d.s=_,d.f=r;var o={name:"pl",weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),months:d,monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),ordinal:function(e){return e+"."},weekStart:1,yearStart:4,relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:n,mm:n,h:n,hh:n,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:n,y:"rok",yy:n},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return i.default.locale(o,null,!0),o})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/pt-br.js b/node_modules/dayjs/locale/pt-br.js new file mode 100644 index 00000000..629c2f17 --- /dev/null +++ b/node_modules/dayjs/locale/pt-br.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_pt_br=o(e.dayjs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(e),s={name:"pt-br",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(e){return e+"º"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return a.default.locale(s,null,!0),s})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/pt.js b/node_modules/dayjs/locale/pt.js new file mode 100644 index 00000000..91652e81 --- /dev/null +++ b/node_modules/dayjs/locale/pt.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_pt=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=a(e),t={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(e){return e+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return o.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/rn.js b/node_modules/dayjs/locale/rn.js new file mode 100644 index 00000000..a0933643 --- /dev/null +++ b/node_modules/dayjs/locale/rn.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_rn=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var t=e(a),u={name:"rn",weekdays:"Ku wa Mungu_Ku wa Mbere_Ku wa Kabiri_Ku wa Gatatu_Ku wa Kane_Ku wa Gatanu_Ku wa Gatandatu".split("_"),weekdaysShort:"Kngu_Kmbr_Kbri_Ktat_Kkan_Ktan_Kdat".split("_"),weekdaysMin:"K7_K1_K2_K3_K4_K5_K6".split("_"),months:"Nzero_Ruhuhuma_Ntwarante_Ndamukiza_Rusama_Ruhenshi_Mukakaro_Myandagaro_Nyakanga_Gitugutu_Munyonyo_Kigarama".split("_"),monthsShort:"Nzer_Ruhuh_Ntwar_Ndam_Rus_Ruhen_Muk_Myand_Nyak_Git_Muny_Kig".split("_"),weekStart:1,ordinal:function(a){return a},relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return t.default.locale(u,null,!0),u})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ro.js b/node_modules/dayjs/locale/ro.js new file mode 100644 index 00000000..445af3dc --- /dev/null +++ b/node_modules/dayjs/locale/ro.js @@ -0,0 +1 @@ +!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],i):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ro=i(e.dayjs)}(this,(function(e){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=i(e),_={name:"ro",weekdays:"Duminică_Luni_Marți_Miercuri_Joi_Vineri_Sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),months:"Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie".split("_"),monthsShort:"Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"peste %s",past:"acum %s",s:"câteva secunde",m:"un minut",mm:"%d minute",h:"o oră",hh:"%d ore",d:"o zi",dd:"%d zile",M:"o lună",MM:"%d luni",y:"un an",yy:"%d ani"},ordinal:function(e){return e}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ru.js b/node_modules/dayjs/locale/ru.js new file mode 100644 index 00000000..f8967908 --- /dev/null +++ b/node_modules/dayjs/locale/ru.js @@ -0,0 +1 @@ +!function(_,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ru=t(_.dayjs)}(this,(function(_){"use strict";function t(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var e=t(_),n="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),s="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),r="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),o="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),i=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function d(_,t,e){var n,s;return"m"===e?t?"минута":"минуту":_+" "+(n=+_,s={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[e].split("_"),n%10==1&&n%100!=11?s[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}var u=function(_,t){return i.test(t)?n[_.month()]:s[_.month()]};u.s=s,u.f=n;var a=function(_,t){return i.test(t)?r[_.month()]:o[_.month()]};a.s=o,a.f=r;var m={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:u,monthsShort:a,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:d,mm:d,h:"час",hh:d,d:"день",dd:d,M:"месяц",MM:d,y:"год",yy:d},ordinal:function(_){return _},meridiem:function(_){return _<4?"ночи":_<12?"утра":_<17?"дня":"вечера"}};return e.default.locale(m,null,!0),m})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/rw.js b/node_modules/dayjs/locale/rw.js new file mode 100644 index 00000000..bf4c280c --- /dev/null +++ b/node_modules/dayjs/locale/rw.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_rw=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var u=e(a),t={name:"rw",weekdays:"Ku Cyumweru_Kuwa Mbere_Kuwa Kabiri_Kuwa Gatatu_Kuwa Kane_Kuwa Gatanu_Kuwa Gatandatu".split("_"),months:"Mutarama_Gashyantare_Werurwe_Mata_Gicurasi_Kamena_Nyakanga_Kanama_Nzeri_Ukwakira_Ugushyingo_Ukuboza".split("_"),relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(a){return a}};return u.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sd.js b/node_modules/dayjs/locale/sd.js new file mode 100644 index 00000000..b1e1ee48 --- /dev/null +++ b/node_modules/dayjs/locale/sd.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_sd=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"sd",weekdays:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),months:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekStart:1,weekdaysShort:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),monthsShort:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekdaysMin:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/se.js b/node_modules/dayjs/locale/se.js new file mode 100644 index 00000000..2cbb2246 --- /dev/null +++ b/node_modules/dayjs/locale/se.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_se=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),t={name:"se",weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),weekStart:1,weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"}};return n.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/si.js b/node_modules/dayjs/locale/si.js new file mode 100644 index 00000000..216ae8a8 --- /dev/null +++ b/node_modules/dayjs/locale/si.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_si=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"si",weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),months:"දුරුතු_නවම්_මැදින්_බක්_වෙසක්_පොසොන්_ඇසළ_නිකිණි_බිනර_වප්_ඉල්_උඳුවප්".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),monthsShort:"දුරු_නව_මැදි_බක්_වෙස_පොසො_ඇස_නිකි_බින_වප්_ඉල්_උඳු".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),ordinal:function(_){return _},formats:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"විනාඩිය",mm:"විනාඩි %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sk.js b/node_modules/dayjs/locale/sk.js new file mode 100644 index 00000000..b2707e32 --- /dev/null +++ b/node_modules/dayjs/locale/sk.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_sk=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function r(e){return e>1&&e<5&&1!=~~(e/10)}function o(e,t,n,o){var a=e+" ";switch(n){case"s":return t||o?"pár sekúnd":"pár sekundami";case"m":return t?"minúta":o?"minútu":"minútou";case"mm":return t||o?a+(r(e)?"minúty":"minút"):a+"minútami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?a+(r(e)?"hodiny":"hodín"):a+"hodinami";case"d":return t||o?"deň":"dňom";case"dd":return t||o?a+(r(e)?"dni":"dní"):a+"dňami";case"M":return t||o?"mesiac":"mesiacom";case"MM":return t||o?a+(r(e)?"mesiace":"mesiacov"):a+"mesiacmi";case"y":return t||o?"rok":"rokom";case"yy":return t||o?a+(r(e)?"roky":"rokov"):a+"rokmi"}}var a={name:"sk",weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),months:"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),monthsShort:"jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"pred %s",s:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o}};return n.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sl.js b/node_modules/dayjs/locale/sl.js new file mode 100644 index 00000000..162d2ecd --- /dev/null +++ b/node_modules/dayjs/locale/sl.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_sl=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e);function r(e){return e%100==2}function a(e){return e%100==3||e%100==4}function s(e,n,t,s){var m=e+" ";switch(t){case"s":return n||s?"nekaj sekund":"nekaj sekundami";case"m":return n?"ena minuta":"eno minuto";case"mm":return r(e)?m+(n||s?"minuti":"minutama"):a(e)?m+(n||s?"minute":"minutami"):m+(n||s?"minut":"minutami");case"h":return n?"ena ura":"eno uro";case"hh":return r(e)?m+(n||s?"uri":"urama"):a(e)?m+(n||s?"ure":"urami"):m+(n||s?"ur":"urami");case"d":return n||s?"en dan":"enim dnem";case"dd":return r(e)?m+(n||s?"dneva":"dnevoma"):m+(n||s?"dni":"dnevi");case"M":return n||s?"en mesec":"enim mesecem";case"MM":return r(e)?m+(n||s?"meseca":"mesecema"):a(e)?m+(n||s?"mesece":"meseci"):m+(n||s?"mesecev":"meseci");case"y":return n||s?"eno leto":"enim letom";case"yy":return r(e)?m+(n||s?"leti":"letoma"):a(e)?m+(n||s?"leta":"leti"):m+(n||s?"let":"leti")}}var m={name:"sl",weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),weekStart:1,weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"čez %s",past:"pred %s",s:s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return t.default.locale(m,null,!0),m})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sq.js b/node_modules/dayjs/locale/sq.js new file mode 100644 index 00000000..99bca9a2 --- /dev/null +++ b/node_modules/dayjs/locale/sq.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_sq=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=t(e),n={name:"sq",weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),weekStart:1,weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"}};return _.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sr-cyrl.js b/node_modules/dayjs/locale/sr-cyrl.js new file mode 100644 index 00000000..90daeebd --- /dev/null +++ b/node_modules/dayjs/locale/sr-cyrl.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_sr_cyrl=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e),a={words:{m:["један минут","једног минута"],mm:["%d минут","%d минута","%d минута"],h:["један сат","једног сата"],hh:["%d сат","%d сата","%d сати"],d:["један дан","једног дана"],dd:["%d дан","%d дана","%d дана"],M:["један месец","једног месеца"],MM:["%d месец","%d месеца","%d месеци"],y:["једну годину","једне године"],yy:["%d годину","%d године","%d година"]},correctGrammarCase:function(e,t){return e%10>=1&&e%10<=4&&(e%100<10||e%100>=20)?e%10==1?t[0]:t[1]:t[2]},relativeTimeFormatter:function(e,t,r,d){var i=a.words[r];if(1===r.length)return"y"===r&&t?"једна година":d||t?i[0]:i[1];var m=a.correctGrammarCase(e,i);return"yy"===r&&t&&"%d годину"===m?e+" година":m.replace("%d",e)}},d={name:"sr-cyrl",weekdays:"Недеља_Понедељак_Уторак_Среда_Четвртак_Петак_Субота".split("_"),weekdaysShort:"Нед._Пон._Уто._Сре._Чет._Пет._Суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),months:"Јануар_Фебруар_Март_Април_Мај_Јун_Јул_Август_Септембар_Октобар_Новембар_Децембар".split("_"),monthsShort:"Јан._Феб._Мар._Апр._Мај_Јун_Јул_Авг._Сеп._Окт._Нов._Дец.".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:a.relativeTimeFormatter,mm:a.relativeTimeFormatter,h:a.relativeTimeFormatter,hh:a.relativeTimeFormatter,d:a.relativeTimeFormatter,dd:a.relativeTimeFormatter,M:a.relativeTimeFormatter,MM:a.relativeTimeFormatter,y:a.relativeTimeFormatter,yy:a.relativeTimeFormatter},ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return r.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sr.js b/node_modules/dayjs/locale/sr.js new file mode 100644 index 00000000..35a5b55e --- /dev/null +++ b/node_modules/dayjs/locale/sr.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_sr=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),r={words:{m:["jedan minut","jednog minuta"],mm:["%d minut","%d minuta","%d minuta"],h:["jedan sat","jednog sata"],hh:["%d sat","%d sata","%d sati"],d:["jedan dan","jednog dana"],dd:["%d dan","%d dana","%d dana"],M:["jedan mesec","jednog meseca"],MM:["%d mesec","%d meseca","%d meseci"],y:["jednu godinu","jedne godine"],yy:["%d godinu","%d godine","%d godina"]},correctGrammarCase:function(e,t){return e%10>=1&&e%10<=4&&(e%100<10||e%100>=20)?e%10==1?t[0]:t[1]:t[2]},relativeTimeFormatter:function(e,t,a,d){var n=r.words[a];if(1===a.length)return"y"===a&&t?"jedna godina":d||t?n[0]:n[1];var i=r.correctGrammarCase(e,n);return"yy"===a&&t&&"%d godinu"===i?e+" godina":i.replace("%d",e)}},d={name:"sr",weekdays:"Nedelja_Ponedeljak_Utorak_Sreda_Četvrtak_Petak_Subota".split("_"),weekdaysShort:"Ned._Pon._Uto._Sre._Čet._Pet._Sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:"Januar_Februar_Mart_April_Maj_Jun_Jul_Avgust_Septembar_Oktobar_Novembar_Decembar".split("_"),monthsShort:"Jan._Feb._Mar._Apr._Maj_Jun_Jul_Avg._Sep._Okt._Nov._Dec.".split("_"),weekStart:1,relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:r.relativeTimeFormatter,mm:r.relativeTimeFormatter,h:r.relativeTimeFormatter,hh:r.relativeTimeFormatter,d:r.relativeTimeFormatter,dd:r.relativeTimeFormatter,M:r.relativeTimeFormatter,MM:r.relativeTimeFormatter,y:r.relativeTimeFormatter,yy:r.relativeTimeFormatter},ordinal:function(e){return e+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return a.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ss.js b/node_modules/dayjs/locale/ss.js new file mode 100644 index 00000000..4df16a5b --- /dev/null +++ b/node_modules/dayjs/locale/ss.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ss=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=n(e),i={name:"ss",weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),weekStart:1,weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"}};return a.default.locale(i,null,!0),i})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sv-fi.js b/node_modules/dayjs/locale/sv-fi.js new file mode 100644 index 00000000..5b2f8afb --- /dev/null +++ b/node_modules/dayjs/locale/sv-fi.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_sv_fi=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),d={name:"sv-fi",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(e){var t=e%10;return"["+e+(1===t||2===t?"a":"e")+"]"},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY, [kl.] HH.mm",LLLL:"dddd, D. MMMM YYYY, [kl.] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [kl.] HH.mm",llll:"ddd, D. MMM YYYY, [kl.] HH.mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return a.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sv.js b/node_modules/dayjs/locale/sv.js new file mode 100644 index 00000000..16e6d372 --- /dev/null +++ b/node_modules/dayjs/locale/sv.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_sv=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),d={name:"sv",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(e){var t=e%10;return"["+e+(1===t||2===t?"a":"e")+"]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return a.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/sw.js b/node_modules/dayjs/locale/sw.js new file mode 100644 index 00000000..a13bd44b --- /dev/null +++ b/node_modules/dayjs/locale/sw.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_sw=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var i=e(a),t={name:"sw",weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekStart:1,ordinal:function(a){return a},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return i.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ta.js b/node_modules/dayjs/locale/ta.js new file mode 100644 index 00000000..406cf134 --- /dev/null +++ b/node_modules/dayjs/locale/ta.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ta=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ta",weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/te.js b/node_modules/dayjs/locale/te.js new file mode 100644 index 00000000..c7593db9 --- /dev/null +++ b/node_modules/dayjs/locale/te.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_te=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"te",weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/tet.js b/node_modules/dayjs/locale/tet.js new file mode 100644 index 00000000..aec6f682 --- /dev/null +++ b/node_modules/dayjs/locale/tet.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_tet=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=t(e),a={name:"tet",weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),weekStart:1,weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"}};return u.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/tg.js b/node_modules/dayjs/locale/tg.js new file mode 100644 index 00000000..76431030 --- /dev/null +++ b/node_modules/dayjs/locale/tg.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_tg=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"tg",weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/th.js b/node_modules/dayjs/locale/th.js new file mode 100644 index 00000000..185d4ebc --- /dev/null +++ b/node_modules/dayjs/locale/th.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_th=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"th",weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"},ordinal:function(_){return _+"."}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/tk.js b/node_modules/dayjs/locale/tk.js new file mode 100644 index 00000000..1e737b5a --- /dev/null +++ b/node_modules/dayjs/locale/tk.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_tk=n(e.dayjs)}(this,(function(e){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(e),_={name:"tk",weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e){return e+"."}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/tl-ph.js b/node_modules/dayjs/locale/tl-ph.js new file mode 100644 index 00000000..885f8a9e --- /dev/null +++ b/node_modules/dayjs/locale/tl-ph.js @@ -0,0 +1 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_tl_ph=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),t={name:"tl-ph",weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),weekStart:1,weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"}};return n.default.locale(t,null,!0),t})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/tlh.js b/node_modules/dayjs/locale/tlh.js new file mode 100644 index 00000000..03d89962 --- /dev/null +++ b/node_modules/dayjs/locale/tlh.js @@ -0,0 +1 @@ +!function(a,j){"object"==typeof exports&&"undefined"!=typeof module?module.exports=j(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],j):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_tlh=j(a.dayjs)}(this,(function(a){"use strict";function j(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var t=j(a),e={name:"tlh",weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),weekStart:1,weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return t.default.locale(e,null,!0),e})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/tr.js b/node_modules/dayjs/locale/tr.js new file mode 100644 index 00000000..9c7844a4 --- /dev/null +++ b/node_modules/dayjs/locale/tr.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_tr=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var t=e(a),_={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){return a+"."}};return t.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/types.d.ts b/node_modules/dayjs/locale/types.d.ts new file mode 100644 index 00000000..2c24a645 --- /dev/null +++ b/node_modules/dayjs/locale/types.d.ts @@ -0,0 +1,33 @@ +declare interface ILocale { + name: string + weekdays?: string[] + months?: string[] + weekStart?: number + weekdaysShort?: string[] + monthsShort?: string[] + weekdaysMin?: string[] + ordinal?: (n: number) => number | string + formats: Partial<{ + LT: string + LTS: string + L: string + LL: string + LLL: string + LLLL: string + }> + relativeTime: Partial<{ + future: string + past: string + s: string + m: string + mm: string + h: string + hh: string + d: string + dd: string + M: string + MM: string + y: string + yy: string + }> +} diff --git a/node_modules/dayjs/locale/tzl.js b/node_modules/dayjs/locale/tzl.js new file mode 100644 index 00000000..2b1d5983 --- /dev/null +++ b/node_modules/dayjs/locale/tzl.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_tzl=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),a={name:"tzl",weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),weekStart:1,weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),ordinal:function(e){return e},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"}};return t.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/tzm-latn.js b/node_modules/dayjs/locale/tzm-latn.js new file mode 100644 index 00000000..3f7cdd44 --- /dev/null +++ b/node_modules/dayjs/locale/tzm-latn.js @@ -0,0 +1 @@ +!function(a,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],s):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_tzm_latn=s(a.dayjs)}(this,(function(a){"use strict";function s(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var n=s(a),i={name:"tzm-latn",weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekStart:6,weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"}};return n.default.locale(i,null,!0),i})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/tzm.js b/node_modules/dayjs/locale/tzm.js new file mode 100644 index 00000000..e4c40316 --- /dev/null +++ b/node_modules/dayjs/locale/tzm.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_tzm=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"tzm",weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekStart:6,weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ug-cn.js b/node_modules/dayjs/locale/ug-cn.js new file mode 100644 index 00000000..995c3b3b --- /dev/null +++ b/node_modules/dayjs/locale/ug-cn.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ug_cn=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ug-cn",weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekStart:1,weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/uk.js b/node_modules/dayjs/locale/uk.js new file mode 100644 index 00000000..537afb1b --- /dev/null +++ b/node_modules/dayjs/locale/uk.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_uk=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),s="січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),n="січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),o=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function d(_,e,t){var s,n;return"m"===t?e?"хвилина":"хвилину":"h"===t?e?"година":"годину":_+" "+(s=+_,n={ss:e?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:e?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:e?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[t].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var i=function(_,e){return o.test(e)?s[_.month()]:n[_.month()]};i.s=n,i.f=s;var r={name:"uk",weekdays:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),weekdaysShort:"ндл_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:i,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:d,mm:d,h:d,hh:d,d:"день",dd:d,M:"місяць",MM:d,y:"рік",yy:d},ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"}};return t.default.locale(r,null,!0),r})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/ur.js b/node_modules/dayjs/locale/ur.js new file mode 100644 index 00000000..4f83c8b8 --- /dev/null +++ b/node_modules/dayjs/locale/ur.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_ur=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"ur",weekdays:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),months:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekStart:1,weekdaysShort:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),monthsShort:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekdaysMin:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/uz-latn.js b/node_modules/dayjs/locale/uz-latn.js new file mode 100644 index 00000000..a8ebab49 --- /dev/null +++ b/node_modules/dayjs/locale/uz-latn.js @@ -0,0 +1 @@ +!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_uz_latn=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var _=e(a),n={name:"uz-latn",weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),weekStart:1,weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Yaqin %s ichida",past:"%s oldin",s:"soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"}};return _.default.locale(n,null,!0),n})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/uz.js b/node_modules/dayjs/locale/uz.js new file mode 100644 index 00000000..f6992b1a --- /dev/null +++ b/node_modules/dayjs/locale/uz.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_uz=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"uz",weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Якин %s ичида",past:"%s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/vi.js b/node_modules/dayjs/locale/vi.js new file mode 100644 index 00000000..ee339549 --- /dev/null +++ b/node_modules/dayjs/locale/vi.js @@ -0,0 +1 @@ +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_locale_vi=n(t.dayjs)}(this,(function(t){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var h=n(t),_={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return h.default.locale(_,null,!0),_})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/x-pseudo.js b/node_modules/dayjs/locale/x-pseudo.js new file mode 100644 index 00000000..c1215d66 --- /dev/null +++ b/node_modules/dayjs/locale/x-pseudo.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_x_pseudo=t(e.dayjs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=t(e),d={name:"x-pseudo",weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),weekStart:1,weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"}};return _.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/yo.js b/node_modules/dayjs/locale/yo.js new file mode 100644 index 00000000..b12b37b7 --- /dev/null +++ b/node_modules/dayjs/locale/yo.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_yo=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),a={name:"yo",weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),weekStart:1,weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"}};return t.default.locale(a,null,!0),a})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/zh-cn.js b/node_modules/dayjs/locale/zh-cn.js new file mode 100644 index 00000000..21cf2281 --- /dev/null +++ b/node_modules/dayjs/locale/zh-cn.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){return"W"===_?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/zh-hk.js b/node_modules/dayjs/locale/zh-hk.js new file mode 100644 index 00000000..f4b220d1 --- /dev/null +++ b/node_modules/dayjs/locale/zh-hk.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_zh_hk=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"zh-hk",months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),ordinal:function(_,e){return"W"===e?_+"週":_+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d 分鐘",h:"一小時",hh:"%d 小時",d:"一天",dd:"%d 天",M:"一個月",MM:"%d 個月",y:"一年",yy:"%d 年"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/zh-tw.js b/node_modules/dayjs/locale/zh-tw.js new file mode 100644 index 00000000..5970f17d --- /dev/null +++ b/node_modules/dayjs/locale/zh-tw.js @@ -0,0 +1 @@ +!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_zh_tw=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(_,e){return"W"===e?_+"週":_+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(_,e){var t=100*_+e;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/locale/zh.js b/node_modules/dayjs/locale/zh.js new file mode 100644 index 00000000..2e80015f --- /dev/null +++ b/node_modules/dayjs/locale/zh.js @@ -0,0 +1 @@ +!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){return"W"===_?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d})); \ No newline at end of file diff --git a/node_modules/dayjs/package.json b/node_modules/dayjs/package.json new file mode 100644 index 00000000..417c30b9 --- /dev/null +++ b/node_modules/dayjs/package.json @@ -0,0 +1,84 @@ +{ + "name": "dayjs", + "version": "1.11.10", + "description": "2KB immutable date time library alternative to Moment.js with the same modern API ", + "main": "dayjs.min.js", + "types": "index.d.ts", + "scripts": { + "test": "TZ=Pacific/Auckland npm run test-tz && TZ=Europe/London npm run test-tz && TZ=America/Whitehorse npm run test-tz && npm run test-tz && jest", + "test-tz": "date && jest test/timezone.test --coverage=false", + "lint": "./node_modules/.bin/eslint src/* test/* build/*", + "prettier": "prettier --write \"docs/**/*.md\"", + "babel": "cross-env BABEL_ENV=build babel src --out-dir esm --copy-files && node build/esm", + "build": "cross-env BABEL_ENV=build node build && npm run size", + "sauce": "npx karma start karma.sauce.conf.js", + "test:sauce": "npm run sauce -- 0 && npm run sauce -- 1 && npm run sauce -- 2 && npm run sauce -- 3", + "size": "size-limit && gzip-size dayjs.min.js" + }, + "pre-commit": [ + "lint" + ], + "size-limit": [ + { + "limit": "2.99 KB", + "path": "dayjs.min.js" + } + ], + "jest": { + "roots": [ + "test" + ], + "testRegex": "test/(.*?/)?.*test.js$", + "testURL": "http://localhost", + "coverageDirectory": "./coverage/", + "collectCoverage": true, + "collectCoverageFrom": [ + "src/**/*" + ] + }, + "keywords": [ + "dayjs", + "date", + "time", + "immutable", + "moment" + ], + "author": "iamkun", + "license": "MIT", + "homepage": "https://day.js.org", + "repository": { + "type": "git", + "url": "https://github.com/iamkun/dayjs.git" + }, + "devDependencies": { + "@babel/cli": "^7.0.0-beta.44", + "@babel/core": "^7.0.0-beta.44", + "@babel/node": "^7.0.0-beta.44", + "@babel/preset-env": "^7.0.0-beta.44", + "babel-core": "^7.0.0-bridge.0", + "babel-jest": "^22.4.3", + "babel-plugin-external-helpers": "^6.22.0", + "cross-env": "^5.1.6", + "eslint": "^4.19.1", + "eslint-config-airbnb-base": "^12.1.0", + "eslint-plugin-import": "^2.10.0", + "eslint-plugin-jest": "^21.15.0", + "gzip-size-cli": "^2.1.0", + "jasmine-core": "^2.99.1", + "jest": "^22.4.3", + "karma": "^2.0.2", + "karma-jasmine": "^1.1.2", + "karma-sauce-launcher": "^1.1.0", + "mockdate": "^2.0.2", + "moment": "2.29.2", + "moment-timezone": "0.5.31", + "ncp": "^2.0.0", + "pre-commit": "^1.2.2", + "prettier": "^1.16.1", + "rollup": "^2.45.1", + "rollup-plugin-babel": "^4.4.0", + "rollup-plugin-terser": "^7.0.2", + "size-limit": "^0.18.0", + "typescript": "^2.8.3" + } +} diff --git a/node_modules/dayjs/plugin/advancedFormat.d.ts b/node_modules/dayjs/plugin/advancedFormat.d.ts new file mode 100644 index 00000000..30ec75e5 --- /dev/null +++ b/node_modules/dayjs/plugin/advancedFormat.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/advancedFormat.js b/node_modules/dayjs/plugin/advancedFormat.js new file mode 100644 index 00000000..88d62e7c --- /dev/null +++ b/node_modules/dayjs/plugin/advancedFormat.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_advancedFormat=t()}(this,(function(){"use strict";return function(e,t){var r=t.prototype,n=r.format;r.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return n.bind(this)(e);var s=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return r.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return r.ordinal(t.week(),"W");case"w":case"ww":return s.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return s.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return s.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return n.bind(this)(a)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/arraySupport.d.ts b/node_modules/dayjs/plugin/arraySupport.d.ts new file mode 100644 index 00000000..e4e44b2e --- /dev/null +++ b/node_modules/dayjs/plugin/arraySupport.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare module 'dayjs' { + interface ConfigTypeMap { + arraySupport: [number?, number?, number?, number?, number?, number?, number?] + } +} + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/arraySupport.js b/node_modules/dayjs/plugin/arraySupport.js new file mode 100644 index 00000000..b16675fc --- /dev/null +++ b/node_modules/dayjs/plugin/arraySupport.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_arraySupport=t()}(this,(function(){"use strict";return function(e,t,n){var o=t.prototype,i=function(e){var t=e.date,o=e.utc;return Array.isArray(t)?o?t.length?new Date(Date.UTC.apply(null,t)):new Date:1===t.length?n(String(t[0])).toDate():new(Function.prototype.bind.apply(Date,[null].concat(t))):t},a=o.parse;o.parse=function(e){e.date=i.bind(this)(e),a.bind(this)(e)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/badMutable.d.ts b/node_modules/dayjs/plugin/badMutable.d.ts new file mode 100644 index 00000000..30ec75e5 --- /dev/null +++ b/node_modules/dayjs/plugin/badMutable.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/badMutable.js b/node_modules/dayjs/plugin/badMutable.js new file mode 100644 index 00000000..68270ccb --- /dev/null +++ b/node_modules/dayjs/plugin/badMutable.js @@ -0,0 +1 @@ +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_badMutable=i()}(this,(function(){"use strict";return function(t,i){var n=i.prototype;n.$g=function(t,i,n){return this.$utils().u(t)?this[i]:this.$set(n,t)},n.set=function(t,i){return this.$set(t,i)};var e=n.startOf;n.startOf=function(t,i){return this.$d=e.bind(this)(t,i).toDate(),this.init(),this};var s=n.add;n.add=function(t,i){return this.$d=s.bind(this)(t,i).toDate(),this.init(),this};var o=n.locale;n.locale=function(t,i){return t?(this.$L=o.bind(this)(t,i).$L,this):this.$L};var r=n.daysInMonth;n.daysInMonth=function(){return r.bind(this.clone())()};var u=n.isSame;n.isSame=function(t,i){return u.bind(this.clone())(t,i)};var f=n.isBefore;n.isBefore=function(t,i){return f.bind(this.clone())(t,i)};var d=n.isAfter;n.isAfter=function(t,i){return d.bind(this.clone())(t,i)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/bigIntSupport.d.ts b/node_modules/dayjs/plugin/bigIntSupport.d.ts new file mode 100644 index 00000000..d9f2f394 --- /dev/null +++ b/node_modules/dayjs/plugin/bigIntSupport.d.ts @@ -0,0 +1,11 @@ +import { PluginFunc } from 'dayjs' + +declare module 'dayjs' { + interface ConfigTypeMap { + bigIntSupport: BigInt + } + export function unix(t: BigInt): Dayjs +} + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/bigIntSupport.js b/node_modules/dayjs/plugin/bigIntSupport.js new file mode 100644 index 00000000..0c7efac6 --- /dev/null +++ b/node_modules/dayjs/plugin/bigIntSupport.js @@ -0,0 +1 @@ +!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_bigIntSupport=e()}(this,(function(){"use strict";var n=function(n){return"bigint"==typeof n};return function(e,t,i){var o=t.prototype,u=function(e){var t=e.date;return n(t)?Number(t):t},r=o.parse;o.parse=function(n){n.date=u.bind(this)(n),r.bind(this)(n)};var f=i.unix;i.unix=function(e){var t=n(e)?Number(e):e;return f(t)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/buddhistEra.d.ts b/node_modules/dayjs/plugin/buddhistEra.d.ts new file mode 100644 index 00000000..30ec75e5 --- /dev/null +++ b/node_modules/dayjs/plugin/buddhistEra.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/buddhistEra.js b/node_modules/dayjs/plugin/buddhistEra.js new file mode 100644 index 00000000..58b137c6 --- /dev/null +++ b/node_modules/dayjs/plugin/buddhistEra.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_buddhistEra=e()}(this,(function(){"use strict";return function(t,e){var n=e.prototype,i=n.format;n.format=function(t){var e=this,n=(t||"YYYY-MM-DDTHH:mm:ssZ").replace(/(\[[^\]]+])|BBBB|BB/g,(function(t,n){var i,o=String(e.$y+543),f="BB"===t?[o.slice(-2),2]:[o,4];return n||(i=e.$utils()).s.apply(i,f.concat(["0"]))}));return i.bind(this)(n)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/calendar.d.ts b/node_modules/dayjs/plugin/calendar.d.ts new file mode 100644 index 00000000..a8d064fd --- /dev/null +++ b/node_modules/dayjs/plugin/calendar.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc, ConfigType } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + calendar(referenceTime?: ConfigType, formats?: object): string + } +} diff --git a/node_modules/dayjs/plugin/calendar.js b/node_modules/dayjs/plugin/calendar.js new file mode 100644 index 00000000..c577098c --- /dev/null +++ b/node_modules/dayjs/plugin/calendar.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_calendar=t()}(this,(function(){"use strict";return function(e,t,a){var n="h:mm A",d={lastDay:"[Yesterday at] "+n,sameDay:"[Today at] "+n,nextDay:"[Tomorrow at] "+n,nextWeek:"dddd [at] "+n,lastWeek:"[Last] dddd [at] "+n,sameElse:"MM/DD/YYYY"};t.prototype.calendar=function(e,t){var n=t||this.$locale().calendar||d,o=a(e||void 0).startOf("d"),s=this.diff(o,"d",!0),i="sameElse",f=s<-6?i:s<-1?"lastWeek":s<0?"lastDay":s<1?"sameDay":s<2?"nextDay":s<7?"nextWeek":i,l=n[f]||d[f];return"function"==typeof l?l.call(this,a()):this.format(l)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/customParseFormat.d.ts b/node_modules/dayjs/plugin/customParseFormat.d.ts new file mode 100644 index 00000000..1b41c0d8 --- /dev/null +++ b/node_modules/dayjs/plugin/customParseFormat.d.ts @@ -0,0 +1,8 @@ +import { PluginFunc } from 'dayjs' + +declare interface PluginOptions { + parseTwoDigitYear?: (yearString: string) => number +} + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/customParseFormat.js b/node_modules/dayjs/plugin/customParseFormat.js new file mode 100644 index 00000000..66d60895 --- /dev/null +++ b/node_modules/dayjs/plugin/customParseFormat.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_customParseFormat=t()}(this,(function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)};var a=function(e){return function(t){this[e]=+t}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=h("months"),n=(h("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,f=0;f-1)return new Date(("X"===t?1e3:1)*e);var r=c(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,h=r.seconds,u=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=h||0,g=u||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(e){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""))}else i.call(this,e)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/dayOfYear.d.ts b/node_modules/dayjs/plugin/dayOfYear.d.ts new file mode 100644 index 00000000..4fd66011 --- /dev/null +++ b/node_modules/dayjs/plugin/dayOfYear.d.ts @@ -0,0 +1,11 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + dayOfYear(): number + dayOfYear(value: number): Dayjs + } +} diff --git a/node_modules/dayjs/plugin/dayOfYear.js b/node_modules/dayjs/plugin/dayOfYear.js new file mode 100644 index 00000000..4a570000 --- /dev/null +++ b/node_modules/dayjs/plugin/dayOfYear.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_dayOfYear=t()}(this,(function(){"use strict";return function(e,t,n){t.prototype.dayOfYear=function(e){var t=Math.round((n(this).startOf("day")-n(this).startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"day")}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/devHelper.d.ts b/node_modules/dayjs/plugin/devHelper.d.ts new file mode 100644 index 00000000..30ec75e5 --- /dev/null +++ b/node_modules/dayjs/plugin/devHelper.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/devHelper.js b/node_modules/dayjs/plugin/devHelper.js new file mode 100644 index 00000000..a3f6daff --- /dev/null +++ b/node_modules/dayjs/plugin/devHelper.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_devHelper=t()}(this,(function(){"use strict";return function(e,t,o){if(!process||"production"!==process.env.NODE_ENV){var s=t.prototype,n=s.parse;s.parse=function(e){var t=e.date;return"string"==typeof t&&13===t.length&&console.warn("To parse a Unix timestamp like "+t+", you should pass it as a Number. https://day.js.org/docs/en/parse/unix-timestamp-milliseconds"),"number"==typeof t&&4===String(t).length&&console.warn("Guessing you may want to parse the Year "+t+", you should pass it as a String "+t+", not a Number. Otherwise, "+t+" will be treated as a Unix timestamp"),e.args.length>=2&&!o.p.customParseFormat&&console.warn("To parse a date-time string like "+t+" using the given format, you should enable customParseFormat plugin first. https://day.js.org/docs/en/parse/string-format"),n.bind(this)(e)};var a=o.locale;o.locale=function(e,t,s){return void 0===t&&"string"==typeof e&&(o.Ls[e]||console.warn("Guessing you may want to use locale "+e+", you have to load it before using it. https://day.js.org/docs/en/i18n/loading-into-nodejs")),a(e,t,s)}}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/duration.d.ts b/node_modules/dayjs/plugin/duration.d.ts new file mode 100644 index 00000000..9675a80b --- /dev/null +++ b/node_modules/dayjs/plugin/duration.d.ts @@ -0,0 +1,88 @@ +import { PluginFunc } from 'dayjs' +import { OpUnitType, UnitTypeLongPlural } from 'dayjs'; + +declare const plugin: PluginFunc +export as namespace plugin; +export = plugin + +declare namespace plugin { + /** + * @deprecated Please use more strict types + */ + type DurationInputType = string | number | object + /** + * @deprecated Please use more strict types + */ + type DurationAddType = number | object | Duration + + type DurationUnitsObjectType = Partial<{ + [unit in Exclude | "weeks"]: number + }>; + type DurationUnitType = Exclude + type CreateDurationType = + ((units: DurationUnitsObjectType) => Duration) + & ((time: number, unit?: DurationUnitType) => Duration) + & ((ISO_8601: string) => Duration) + type AddDurationType = CreateDurationType & ((duration: Duration) => Duration) + + interface Duration { + new (input: string | number | object, unit?: string, locale?: string): Duration + + clone(): Duration + + humanize(withSuffix?: boolean): string + + milliseconds(): number + asMilliseconds(): number + + seconds(): number + asSeconds(): number + + minutes(): number + asMinutes(): number + + hours(): number + asHours(): number + + days(): number + asDays(): number + + weeks(): number + asWeeks(): number + + months(): number + asMonths(): number + + years(): number + asYears(): number + + as(unit: DurationUnitType): number + + get(unit: DurationUnitType): number + + add: AddDurationType + + subtract: AddDurationType + + toJSON(): string + + toISOString(): string + + format(formatStr?: string): string + + locale(locale: string): Duration + } +} + +declare module 'dayjs' { + interface Dayjs { + add(duration: plugin.Duration): Dayjs + subtract(duration: plugin.Duration): Dayjs + } + + /** + * @param time If unit is not present, time treated as number of milliseconds + */ + export const duration: plugin.CreateDurationType; + export function isDuration(d: any): d is plugin.Duration +} \ No newline at end of file diff --git a/node_modules/dayjs/plugin/duration.js b/node_modules/dayjs/plugin/duration.js new file mode 100644 index 00000000..4578f064 --- /dev/null +++ b/node_modules/dayjs/plugin/duration.js @@ -0,0 +1 @@ +!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){"use strict";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+"s"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:""+y(t)+s}:{negative:!1,format:""+t+s}:{negative:!1,format:""}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if("number"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if("object"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if("string"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,"Y"),s=v(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,"D"),e=v(this.$d.hours,"H"),r=v(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,"S"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?"T":"",h=(d?"-":"")+"P"+t.format+s.format+i.format+a+e.format+r.format+u.format;return"P"===h||"-P"===h?"P0D":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||"YYYY-MM-DDTHH:mm:ss",i={Y:this.$d.years,YY:s.s(this.$d.years,2,"0"),YYYY:s.s(this.$d.years,4,"0"),M:this.$d.months,MM:s.s(this.$d.months,2,"0"),D:this.$d.days,DD:s.s(this.$d.days,2,"0"),H:this.$d.hours,HH:s.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,"0"),SSS:s.s(this.$d.milliseconds,3,"0")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return"milliseconds"===n?s%=1e3:s="weeks"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get("milliseconds")},y.asMilliseconds=function(){return this.as("milliseconds")},y.seconds=function(){return this.get("seconds")},y.asSeconds=function(){return this.as("seconds")},y.minutes=function(){return this.get("minutes")},y.asMinutes=function(){return this.as("minutes")},y.hours=function(){return this.get("hours")},y.asHours=function(){return this.as("hours")},y.days=function(){return this.get("days")},y.asDays=function(){return this.as("days")},y.weeks=function(){return this.get("weeks")},y.asWeeks=function(){return this.as("weeks")},y.months=function(){return this.get("months")},y.asMonths=function(){return this.as("months")},y.years=function(){return this.get("years")},y.asYears=function(){return this.as("years")},l}(),p=function(t,s,n){return t.add(s.years()*n,"y").add(s.months()*n,"M").add(s.days()*n,"d").add(s.hours()*n,"h").add(s.minutes()*n,"m").add(s.seconds()*n,"s").add(s.milliseconds()*n,"ms")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isBetween.d.ts b/node_modules/dayjs/plugin/isBetween.d.ts new file mode 100644 index 00000000..431fff80 --- /dev/null +++ b/node_modules/dayjs/plugin/isBetween.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc, ConfigType, OpUnitType } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isBetween(a: ConfigType, b: ConfigType, c?: OpUnitType | null, d?: '()' | '[]' | '[)' | '(]'): boolean + } +} diff --git a/node_modules/dayjs/plugin/isBetween.js b/node_modules/dayjs/plugin/isBetween.js new file mode 100644 index 00000000..68046cb8 --- /dev/null +++ b/node_modules/dayjs/plugin/isBetween.js @@ -0,0 +1 @@ +!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isBetween=i()}(this,(function(){"use strict";return function(e,i,t){i.prototype.isBetween=function(e,i,s,f){var n=t(e),o=t(i),r="("===(f=f||"()")[0],u=")"===f[1];return(r?this.isAfter(n,s):!this.isBefore(n,s))&&(u?this.isBefore(o,s):!this.isAfter(o,s))||(r?this.isBefore(n,s):!this.isAfter(n,s))&&(u?this.isAfter(o,s):!this.isBefore(o,s))}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isLeapYear.d.ts b/node_modules/dayjs/plugin/isLeapYear.d.ts new file mode 100644 index 00000000..5be74092 --- /dev/null +++ b/node_modules/dayjs/plugin/isLeapYear.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isLeapYear(): boolean + } +} diff --git a/node_modules/dayjs/plugin/isLeapYear.js b/node_modules/dayjs/plugin/isLeapYear.js new file mode 100644 index 00000000..030bd46e --- /dev/null +++ b/node_modules/dayjs/plugin/isLeapYear.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isLeapYear=t()}(this,(function(){"use strict";return function(e,t){t.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isMoment.d.ts b/node_modules/dayjs/plugin/isMoment.d.ts new file mode 100644 index 00000000..dac24f6f --- /dev/null +++ b/node_modules/dayjs/plugin/isMoment.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + + export function isMoment(input: any): boolean + +} diff --git a/node_modules/dayjs/plugin/isMoment.js b/node_modules/dayjs/plugin/isMoment.js new file mode 100644 index 00000000..be264125 --- /dev/null +++ b/node_modules/dayjs/plugin/isMoment.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isMoment=n()}(this,(function(){"use strict";return function(e,n,t){t.isMoment=function(e){return t.isDayjs(e)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isSameOrAfter.d.ts b/node_modules/dayjs/plugin/isSameOrAfter.d.ts new file mode 100644 index 00000000..916bc801 --- /dev/null +++ b/node_modules/dayjs/plugin/isSameOrAfter.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc, ConfigType, OpUnitType } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isSameOrAfter(date?: ConfigType, unit?: OpUnitType): boolean + } +} diff --git a/node_modules/dayjs/plugin/isSameOrAfter.js b/node_modules/dayjs/plugin/isSameOrAfter.js new file mode 100644 index 00000000..76f8a335 --- /dev/null +++ b/node_modules/dayjs/plugin/isSameOrAfter.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isSameOrAfter=t()}(this,(function(){"use strict";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isSameOrBefore.d.ts b/node_modules/dayjs/plugin/isSameOrBefore.d.ts new file mode 100644 index 00000000..d52b0955 --- /dev/null +++ b/node_modules/dayjs/plugin/isSameOrBefore.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc, ConfigType, OpUnitType } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isSameOrBefore(date?: ConfigType, unit?: OpUnitType): boolean + } +} diff --git a/node_modules/dayjs/plugin/isSameOrBefore.js b/node_modules/dayjs/plugin/isSameOrBefore.js new file mode 100644 index 00000000..57a767e6 --- /dev/null +++ b/node_modules/dayjs/plugin/isSameOrBefore.js @@ -0,0 +1 @@ +!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isSameOrBefore=i()}(this,(function(){"use strict";return function(e,i){i.prototype.isSameOrBefore=function(e,i){return this.isSame(e,i)||this.isBefore(e,i)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isToday.d.ts b/node_modules/dayjs/plugin/isToday.d.ts new file mode 100644 index 00000000..04ac5818 --- /dev/null +++ b/node_modules/dayjs/plugin/isToday.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isToday(): boolean + } +} diff --git a/node_modules/dayjs/plugin/isToday.js b/node_modules/dayjs/plugin/isToday.js new file mode 100644 index 00000000..ee9f9cdb --- /dev/null +++ b/node_modules/dayjs/plugin/isToday.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isToday=o()}(this,(function(){"use strict";return function(e,o,t){o.prototype.isToday=function(){var e="YYYY-MM-DD",o=t();return this.format(e)===o.format(e)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isTomorrow.d.ts b/node_modules/dayjs/plugin/isTomorrow.d.ts new file mode 100644 index 00000000..08110b6e --- /dev/null +++ b/node_modules/dayjs/plugin/isTomorrow.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isTomorrow(): boolean + } +} diff --git a/node_modules/dayjs/plugin/isTomorrow.js b/node_modules/dayjs/plugin/isTomorrow.js new file mode 100644 index 00000000..ca850440 --- /dev/null +++ b/node_modules/dayjs/plugin/isTomorrow.js @@ -0,0 +1 @@ +!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(o="undefined"!=typeof globalThis?globalThis:o||self).dayjs_plugin_isTomorrow=e()}(this,(function(){"use strict";return function(o,e,t){e.prototype.isTomorrow=function(){var o="YYYY-MM-DD",e=t().add(1,"day");return this.format(o)===e.format(o)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isYesterday.d.ts b/node_modules/dayjs/plugin/isYesterday.d.ts new file mode 100644 index 00000000..2d8ae9e1 --- /dev/null +++ b/node_modules/dayjs/plugin/isYesterday.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isYesterday(): boolean + } +} diff --git a/node_modules/dayjs/plugin/isYesterday.js b/node_modules/dayjs/plugin/isYesterday.js new file mode 100644 index 00000000..b63b68ac --- /dev/null +++ b/node_modules/dayjs/plugin/isYesterday.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isYesterday=t()}(this,(function(){"use strict";return function(e,t,n){t.prototype.isYesterday=function(){var e="YYYY-MM-DD",t=n().subtract(1,"day");return this.format(e)===t.format(e)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isoWeek.d.ts b/node_modules/dayjs/plugin/isoWeek.d.ts new file mode 100644 index 00000000..3f4d88f6 --- /dev/null +++ b/node_modules/dayjs/plugin/isoWeek.d.ts @@ -0,0 +1,27 @@ +import { PluginFunc, OpUnitType, ConfigType } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +type ISOUnitType = OpUnitType | 'isoWeek'; + +declare module 'dayjs' { + interface Dayjs { + isoWeekYear(): number + isoWeek(): number + isoWeek(value: number): Dayjs + + isoWeekday(): number + isoWeekday(value: number): Dayjs + + startOf(unit: ISOUnitType): Dayjs + + endOf(unit: ISOUnitType): Dayjs + + isSame(date?: ConfigType, unit?: ISOUnitType): boolean + + isBefore(date?: ConfigType, unit?: ISOUnitType): boolean + + isAfter(date?: ConfigType, unit?: ISOUnitType): boolean + } +} diff --git a/node_modules/dayjs/plugin/isoWeek.js b/node_modules/dayjs/plugin/isoWeek.js new file mode 100644 index 00000000..202ade7d --- /dev/null +++ b/node_modules/dayjs/plugin/isoWeek.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isoWeek=t()}(this,(function(){"use strict";var e="day";return function(t,i,s){var a=function(t){return t.add(4-t.isoWeekday(),e)},d=i.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var i,d,n,o,r=a(this),u=(i=this.isoWeekYear(),d=this.$u,n=(d?s.utc:s)().year(i).startOf("year"),o=4-n.isoWeekday(),n.isoWeekday()>4&&(o+=7),n.add(o,e));return r.diff(u,"week")+1},d.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var n=d.startOf;d.startOf=function(e,t){var i=this.$utils(),s=!!i.u(t)||t;return"isoweek"===i.p(e)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(e,t)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/isoWeeksInYear.d.ts b/node_modules/dayjs/plugin/isoWeeksInYear.d.ts new file mode 100644 index 00000000..2bc02cdd --- /dev/null +++ b/node_modules/dayjs/plugin/isoWeeksInYear.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + isoWeeksInYear(): number + } +} diff --git a/node_modules/dayjs/plugin/isoWeeksInYear.js b/node_modules/dayjs/plugin/isoWeeksInYear.js new file mode 100644 index 00000000..2bd20cd5 --- /dev/null +++ b/node_modules/dayjs/plugin/isoWeeksInYear.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isoWeeksInYear=n()}(this,(function(){"use strict";return function(e,n){n.prototype.isoWeeksInYear=function(){var e=this.isLeapYear(),n=this.endOf("y").day();return 4===n||e&&5===n?53:52}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/localeData.d.ts b/node_modules/dayjs/plugin/localeData.d.ts new file mode 100644 index 00000000..ae9e5576 --- /dev/null +++ b/node_modules/dayjs/plugin/localeData.d.ts @@ -0,0 +1,44 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + type WeekdayNames = [string, string, string, string, string, string, string]; + type MonthNames = [string, string, string, string, string, string, string, string, string, string, string, string]; + + interface InstanceLocaleDataReturn { + firstDayOfWeek(): number; + weekdays(instance?: Dayjs): WeekdayNames; + weekdaysShort(instance?: Dayjs): WeekdayNames; + weekdaysMin(instance?: Dayjs): WeekdayNames; + months(instance?: Dayjs): MonthNames; + monthsShort(instance?: Dayjs): MonthNames; + longDateFormat(format: string): string; + meridiem(hour?: number, minute?: number, isLower?: boolean): string; + ordinal(n: number): string + } + + interface GlobalLocaleDataReturn { + firstDayOfWeek(): number; + weekdays(): WeekdayNames; + weekdaysShort(): WeekdayNames; + weekdaysMin(): WeekdayNames; + months(): MonthNames; + monthsShort(): MonthNames; + longDateFormat(format: string): string; + meridiem(hour?: number, minute?: number, isLower?: boolean): string; + ordinal(n: number): string + } + + interface Dayjs { + localeData(): InstanceLocaleDataReturn; + } + + export function weekdays(localOrder?: boolean): WeekdayNames; + export function weekdaysShort(localOrder?: boolean): WeekdayNames; + export function weekdaysMin(localOrder?: boolean): WeekdayNames; + export function monthsShort(): MonthNames; + export function months(): MonthNames; + export function localeData(): GlobalLocaleDataReturn; +} diff --git a/node_modules/dayjs/plugin/localeData.js b/node_modules/dayjs/plugin/localeData.js new file mode 100644 index 00000000..55e01ee7 --- /dev/null +++ b/node_modules/dayjs/plugin/localeData.js @@ -0,0 +1 @@ +!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_localeData=e()}(this,(function(){"use strict";return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.slice(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return{months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return{firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/localizedFormat.d.ts b/node_modules/dayjs/plugin/localizedFormat.d.ts new file mode 100644 index 00000000..30ec75e5 --- /dev/null +++ b/node_modules/dayjs/plugin/localizedFormat.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/localizedFormat.js b/node_modules/dayjs/plugin/localizedFormat.js new file mode 100644 index 00000000..2aa46652 --- /dev/null +++ b/node_modules/dayjs/plugin/localizedFormat.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_localizedFormat=t()}(this,(function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,o,n){var r=o.prototype,i=r.format;n.en.formats=e,r.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var o=this.$locale().formats,n=function(t,o){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,o){return t||o.slice(1)}))}))}(t,void 0===o?{}:o);return i.call(this,n)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/minMax.d.ts b/node_modules/dayjs/plugin/minMax.d.ts new file mode 100644 index 00000000..4c5f6dcd --- /dev/null +++ b/node_modules/dayjs/plugin/minMax.d.ts @@ -0,0 +1,11 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + export function max(dayjs: Dayjs[]): Dayjs | null + export function max(...dayjs: Dayjs[]): Dayjs | null + export function min(dayjs: Dayjs[]): Dayjs | null + export function min(...dayjs: Dayjs[]): Dayjs | null +} diff --git a/node_modules/dayjs/plugin/minMax.js b/node_modules/dayjs/plugin/minMax.js new file mode 100644 index 00000000..ce063146 --- /dev/null +++ b/node_modules/dayjs/plugin/minMax.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_minMax=n()}(this,(function(){"use strict";return function(e,n,t){var i=function(e,n){if(!n||!n.length||1===n.length&&!n[0]||1===n.length&&Array.isArray(n[0])&&!n[0].length)return null;var t;1===n.length&&n[0].length>0&&(n=n[0]);t=(n=n.filter((function(e){return e})))[0];for(var i=1;i=0?1:a.date()),s=u.year||a.year(),d=u.month>=0?u.month:u.year||u.day?0:a.month(),f=u.hour||0,b=u.minute||0,h=u.second||0,y=u.millisecond||0;return o?new Date(Date.UTC(s,d,c,f,b,h,y)):new Date(s,d,c,f,b,h,y)}return r},o=i.parse;i.parse=function(t){t.date=r.bind(this)(t),o.bind(this)(t)};var u=i.set,a=i.add,c=i.subtract,s=function(t,n,e,i){void 0===i&&(i=1);var r=Object.keys(n),o=this;return r.forEach((function(e){o=t.bind(o)(n[e]*i,e)})),o};i.set=function(t,n){return n=void 0===n?t:n,"Object"===t.constructor.name?s.bind(this)((function(t,n){return u.bind(this)(n,t)}),n,t):u.bind(this)(t,n)},i.add=function(t,n){return"Object"===t.constructor.name?s.bind(this)(a,t,n):a.bind(this)(t,n)},i.subtract=function(t,n){return"Object"===t.constructor.name?s.bind(this)(a,t,n,-1):c.bind(this)(t,n)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/pluralGetSet.d.ts b/node_modules/dayjs/plugin/pluralGetSet.d.ts new file mode 100644 index 00000000..ab2d89aa --- /dev/null +++ b/node_modules/dayjs/plugin/pluralGetSet.d.ts @@ -0,0 +1,44 @@ +import { PluginFunc, UnitType, ConfigType } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + years(): number + + years(value: number): Dayjs + + months(): number + + months(value: number): Dayjs + + dates(): number + + dates(value: number): Dayjs + + weeks(): number + + weeks(value: number): Dayjs + + days(): number + + days(value: number): Dayjs + + hours(): number + + hours(value: number): Dayjs + + minutes(): number + + minutes(value: number): Dayjs + + seconds(): number + + seconds(value: number): Dayjs + + milliseconds(): number + + milliseconds(value: number): Dayjs + } +} diff --git a/node_modules/dayjs/plugin/pluralGetSet.js b/node_modules/dayjs/plugin/pluralGetSet.js new file mode 100644 index 00000000..d7584940 --- /dev/null +++ b/node_modules/dayjs/plugin/pluralGetSet.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_pluralGetSet=o()}(this,(function(){"use strict";return function(e,o){var s=o.prototype;["milliseconds","seconds","minutes","hours","days","weeks","isoWeeks","months","quarters","years","dates"].forEach((function(e){s[e]=s[e.replace(/s$/,"")]}))}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/preParsePostFormat.d.ts b/node_modules/dayjs/plugin/preParsePostFormat.d.ts new file mode 100644 index 00000000..30ec75e5 --- /dev/null +++ b/node_modules/dayjs/plugin/preParsePostFormat.d.ts @@ -0,0 +1,4 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin diff --git a/node_modules/dayjs/plugin/preParsePostFormat.js b/node_modules/dayjs/plugin/preParsePostFormat.js new file mode 100644 index 00000000..5611d107 --- /dev/null +++ b/node_modules/dayjs/plugin/preParsePostFormat.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_preParsePostFormat=e()}(this,(function(){"use strict";return function(t,e){var o=e.prototype.parse;e.prototype.parse=function(t){if("string"==typeof t.date){var e=this.$locale();t.date=e&&e.preparse?e.preparse(t.date):t.date}return o.bind(this)(t)};var r=e.prototype.format;e.prototype.format=function(){for(var t=arguments.length,e=new Array(t),o=0;o number + thresholds?: RelativeTimeThreshold[] +} + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + fromNow(withoutSuffix?: boolean): string + from(compared: ConfigType, withoutSuffix?: boolean): string + toNow(withoutSuffix?: boolean): string + to(compared: ConfigType, withoutSuffix?: boolean): string + } +} diff --git a/node_modules/dayjs/plugin/relativeTime.js b/node_modules/dayjs/plugin/relativeTime.js new file mode 100644 index 00000000..898eee6d --- /dev/null +++ b/node_modules/dayjs/plugin/relativeTime.js @@ -0,0 +1 @@ +!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_relativeTime=e()}(this,(function(){"use strict";return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return"function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/timezone.d.ts b/node_modules/dayjs/plugin/timezone.d.ts new file mode 100644 index 00000000..049bb087 --- /dev/null +++ b/node_modules/dayjs/plugin/timezone.d.ts @@ -0,0 +1,20 @@ +import { PluginFunc, ConfigType } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + tz(timezone?: string, keepLocalTime?: boolean): Dayjs + offsetName(type?: 'short' | 'long'): string | undefined + } + + interface DayjsTimezone { + (date?: ConfigType, timezone?: string): Dayjs + (date: ConfigType, format: string, timezone?: string): Dayjs + guess(): string + setDefault(timezone?: string): void + } + + const tz: DayjsTimezone +} diff --git a/node_modules/dayjs/plugin/timezone.js b/node_modules/dayjs/plugin/timezone.js new file mode 100644 index 00000000..b778bef4 --- /dev/null +++ b/node_modules/dayjs/plugin/timezone.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_timezone=e()}(this,(function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,o){var r,a=function(t,n,i){void 0===i&&(i={});var o=new Date(t),r=function(t,n){void 0===n&&(n={});var i=n.timeZoneName||"short",o=t+"|"+i,r=e[o];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),e[o]=r),r}(n,i);return r.formatToParts(o)},u=function(e,n){for(var i=a(e,n),r=[],u=0;u=0&&(r[c]=parseInt(m,10))}var d=r[3],l=24===d?0:d,h=r[0]+"-"+r[1]+"-"+r[2]+" "+l+":"+r[4]+":"+r[5]+":000",v=+e;return(o.utc(h).valueOf()-(v-=v%1e3))/6e4},f=i.prototype;f.tz=function(t,e){void 0===t&&(t=r);var n=this.utcOffset(),i=this.toDate(),a=i.toLocaleString("en-US",{timeZone:t}),u=Math.round((i-new Date(a))/1e3/60),f=o(a,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(i.getTimezoneOffset()/15)-u,!0);if(e){var s=f.utcOffset();f=f.add(n-s,"minute")}return f.$x.$timezone=t,f},f.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return n&&n.value};var s=f.startOf;f.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return s.call(this,t,e);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return s.call(n,t,e).tz(this.$x.$timezone,!0)},o.tz=function(t,e,n){var i=n&&e,a=n||e||r,f=u(+o(),a);if("string"!=typeof t)return o(t).tz(a);var s=function(t,e,n){var i=t-60*e*1e3,o=u(i,n);if(e===o)return[i,e];var r=u(i-=60*(o-e)*1e3,n);return o===r?[i,o]:[t-60*Math.min(o,r)*1e3,Math.max(o,r)]}(o.utc(t,i).valueOf(),f,a),m=s[0],c=s[1],d=o(m).utcOffset(c);return d.$x.$timezone=a,d},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(t){r=t}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/toArray.d.ts b/node_modules/dayjs/plugin/toArray.d.ts new file mode 100644 index 00000000..45f1f0c3 --- /dev/null +++ b/node_modules/dayjs/plugin/toArray.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + toArray(): number[] + } +} diff --git a/node_modules/dayjs/plugin/toArray.js b/node_modules/dayjs/plugin/toArray.js new file mode 100644 index 00000000..ac06750e --- /dev/null +++ b/node_modules/dayjs/plugin/toArray.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_toArray=e()}(this,(function(){"use strict";return function(t,e){e.prototype.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/toObject.d.ts b/node_modules/dayjs/plugin/toObject.d.ts new file mode 100644 index 00000000..ca12aaf0 --- /dev/null +++ b/node_modules/dayjs/plugin/toObject.d.ts @@ -0,0 +1,20 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +interface DayjsObject { + years: number + months: number + date: number + hours: number + minutes: number + seconds: number + milliseconds: number +} + +declare module 'dayjs' { + interface Dayjs { + toObject(): DayjsObject + } +} diff --git a/node_modules/dayjs/plugin/toObject.js b/node_modules/dayjs/plugin/toObject.js new file mode 100644 index 00000000..573b49e6 --- /dev/null +++ b/node_modules/dayjs/plugin/toObject.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_toObject=e()}(this,(function(){"use strict";return function(t,e){e.prototype.toObject=function(){return{years:this.$y,months:this.$M,date:this.$D,hours:this.$H,minutes:this.$m,seconds:this.$s,milliseconds:this.$ms}}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/updateLocale.d.ts b/node_modules/dayjs/plugin/updateLocale.d.ts new file mode 100644 index 00000000..ef1c01df --- /dev/null +++ b/node_modules/dayjs/plugin/updateLocale.d.ts @@ -0,0 +1,8 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + export function updateLocale(localeName: string, customConfig: Record): Record +} diff --git a/node_modules/dayjs/plugin/updateLocale.js b/node_modules/dayjs/plugin/updateLocale.js new file mode 100644 index 00000000..811d9e91 --- /dev/null +++ b/node_modules/dayjs/plugin/updateLocale.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_updateLocale=n()}(this,(function(){"use strict";return function(e,n,t){t.updateLocale=function(e,n){var o=t.Ls[e];if(o)return(n?Object.keys(n):[]).forEach((function(e){o[e]=n[e]})),o}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/utc.d.ts b/node_modules/dayjs/plugin/utc.d.ts new file mode 100644 index 00000000..544ea4e7 --- /dev/null +++ b/node_modules/dayjs/plugin/utc.d.ts @@ -0,0 +1,19 @@ +import { PluginFunc, ConfigType } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + + utc(keepLocalTime?: boolean): Dayjs + + local(): Dayjs + + isUTC(): boolean + + utcOffset(offset: number | string, keepLocalTime?: boolean): Dayjs + } + + export function utc(config?: ConfigType, format?: string, strict?: boolean): Dayjs +} diff --git a/node_modules/dayjs/plugin/utc.js b/node_modules/dayjs/plugin/utc.js new file mode 100644 index 00000000..af07564f --- /dev/null +++ b/node_modules/dayjs/plugin/utc.js @@ -0,0 +1 @@ +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_utc=i()}(this,(function(){"use strict";var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t)};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else r.call(this)};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r}else o=this.utc();return o};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return"s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/weekOfYear.d.ts b/node_modules/dayjs/plugin/weekOfYear.d.ts new file mode 100644 index 00000000..d9880145 --- /dev/null +++ b/node_modules/dayjs/plugin/weekOfYear.d.ts @@ -0,0 +1,12 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + week(): number + + week(value : number): Dayjs + } +} diff --git a/node_modules/dayjs/plugin/weekOfYear.js b/node_modules/dayjs/plugin/weekOfYear.js new file mode 100644 index 00000000..7e234c42 --- /dev/null +++ b/node_modules/dayjs/plugin/weekOfYear.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekOfYear=t()}(this,(function(){"use strict";var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/weekYear.d.ts b/node_modules/dayjs/plugin/weekYear.d.ts new file mode 100644 index 00000000..df253312 --- /dev/null +++ b/node_modules/dayjs/plugin/weekYear.d.ts @@ -0,0 +1,10 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + weekYear(): number + } +} diff --git a/node_modules/dayjs/plugin/weekYear.js b/node_modules/dayjs/plugin/weekYear.js new file mode 100644 index 00000000..d90d137e --- /dev/null +++ b/node_modules/dayjs/plugin/weekYear.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekYear=t()}(this,(function(){"use strict";return function(e,t){t.prototype.weekYear=function(){var e=this.month(),t=this.week(),n=this.year();return 1===t&&11===e?n+1:0===e&&t>=52?n-1:n}}})); \ No newline at end of file diff --git a/node_modules/dayjs/plugin/weekday.d.ts b/node_modules/dayjs/plugin/weekday.d.ts new file mode 100644 index 00000000..87a8025a --- /dev/null +++ b/node_modules/dayjs/plugin/weekday.d.ts @@ -0,0 +1,12 @@ +import { PluginFunc } from 'dayjs' + +declare const plugin: PluginFunc +export = plugin + +declare module 'dayjs' { + interface Dayjs { + weekday(): number + + weekday(value: number): Dayjs + } +} diff --git a/node_modules/dayjs/plugin/weekday.js b/node_modules/dayjs/plugin/weekday.js new file mode 100644 index 00000000..ae2276b8 --- /dev/null +++ b/node_modules/dayjs/plugin/weekday.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekday=t()}(this,(function(){"use strict";return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(i + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/delayed-stream/Makefile b/node_modules/delayed-stream/Makefile new file mode 100644 index 00000000..b4ff85a3 --- /dev/null +++ b/node_modules/delayed-stream/Makefile @@ -0,0 +1,7 @@ +SHELL := /bin/bash + +test: + @./test/run.js + +.PHONY: test + diff --git a/node_modules/delayed-stream/Readme.md b/node_modules/delayed-stream/Readme.md new file mode 100644 index 00000000..aca36f9f --- /dev/null +++ b/node_modules/delayed-stream/Readme.md @@ -0,0 +1,141 @@ +# delayed-stream + +Buffers events from a stream until you are ready to handle them. + +## Installation + +``` bash +npm install delayed-stream +``` + +## Usage + +The following example shows how to write a http echo server that delays its +response by 1000 ms. + +``` javascript +var DelayedStream = require('delayed-stream'); +var http = require('http'); + +http.createServer(function(req, res) { + var delayed = DelayedStream.create(req); + + setTimeout(function() { + res.writeHead(200); + delayed.pipe(res); + }, 1000); +}); +``` + +If you are not using `Stream#pipe`, you can also manually release the buffered +events by calling `delayedStream.resume()`: + +``` javascript +var delayed = DelayedStream.create(req); + +setTimeout(function() { + // Emit all buffered events and resume underlaying source + delayed.resume(); +}, 1000); +``` + +## Implementation + +In order to use this meta stream properly, here are a few things you should +know about the implementation. + +### Event Buffering / Proxying + +All events of the `source` stream are hijacked by overwriting the `source.emit` +method. Until node implements a catch-all event listener, this is the only way. + +However, delayed-stream still continues to emit all events it captures on the +`source`, regardless of whether you have released the delayed stream yet or +not. + +Upon creation, delayed-stream captures all `source` events and stores them in +an internal event buffer. Once `delayedStream.release()` is called, all +buffered events are emitted on the `delayedStream`, and the event buffer is +cleared. After that, delayed-stream merely acts as a proxy for the underlaying +source. + +### Error handling + +Error events on `source` are buffered / proxied just like any other events. +However, `delayedStream.create` attaches a no-op `'error'` listener to the +`source`. This way you only have to handle errors on the `delayedStream` +object, rather than in two places. + +### Buffer limits + +delayed-stream provides a `maxDataSize` property that can be used to limit +the amount of data being buffered. In order to protect you from bad `source` +streams that don't react to `source.pause()`, this feature is enabled by +default. + +## API + +### DelayedStream.create(source, [options]) + +Returns a new `delayedStream`. Available options are: + +* `pauseStream` +* `maxDataSize` + +The description for those properties can be found below. + +### delayedStream.source + +The `source` stream managed by this object. This is useful if you are +passing your `delayedStream` around, and you still want to access properties +on the `source` object. + +### delayedStream.pauseStream = true + +Whether to pause the underlaying `source` when calling +`DelayedStream.create()`. Modifying this property afterwards has no effect. + +### delayedStream.maxDataSize = 1024 * 1024 + +The amount of data to buffer before emitting an `error`. + +If the underlaying source is emitting `Buffer` objects, the `maxDataSize` +refers to bytes. + +If the underlaying source is emitting JavaScript strings, the size refers to +characters. + +If you know what you are doing, you can set this property to `Infinity` to +disable this feature. You can also modify this property during runtime. + +### delayedStream.dataSize = 0 + +The amount of data buffered so far. + +### delayedStream.readable + +An ECMA5 getter that returns the value of `source.readable`. + +### delayedStream.resume() + +If the `delayedStream` has not been released so far, `delayedStream.release()` +is called. + +In either case, `source.resume()` is called. + +### delayedStream.pause() + +Calls `source.pause()`. + +### delayedStream.pipe(dest) + +Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. + +### delayedStream.release() + +Emits and clears all events that have been buffered up so far. This does not +resume the underlaying source, use `delayedStream.resume()` instead. + +## License + +delayed-stream is licensed under the MIT license. diff --git a/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/delayed-stream/lib/delayed_stream.js new file mode 100644 index 00000000..b38fc85f --- /dev/null +++ b/node_modules/delayed-stream/lib/delayed_stream.js @@ -0,0 +1,107 @@ +var Stream = require('stream').Stream; +var util = require('util'); + +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; +} +util.inherits(DelayedStream, Stream); + +DelayedStream.create = function(source, options) { + var delayedStream = new this(); + + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } + + delayedStream.source = source; + + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; + + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } + + return delayedStream; +}; + +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); + +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; + +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } + + this.source.resume(); +}; + +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; + +DelayedStream.prototype.release = function() { + this._released = true; + + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; + +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; + +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } + + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } + + this._bufferedEvents.push(args); +}; + +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } + + if (this.dataSize <= this.maxDataSize) { + return; + } + + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); +}; diff --git a/node_modules/delayed-stream/package.json b/node_modules/delayed-stream/package.json new file mode 100644 index 00000000..eea3291c --- /dev/null +++ b/node_modules/delayed-stream/package.json @@ -0,0 +1,27 @@ +{ + "author": "Felix Geisendörfer (http://debuggable.com/)", + "contributors": [ + "Mike Atkins " + ], + "name": "delayed-stream", + "description": "Buffers events from a stream until you are ready to handle them.", + "license": "MIT", + "version": "1.0.0", + "homepage": "https://github.com/felixge/node-delayed-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-delayed-stream.git" + }, + "main": "./lib/delayed_stream", + "engines": { + "node": ">=0.4.0" + }, + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + } +} diff --git a/node_modules/delegates/.npmignore b/node_modules/delegates/.npmignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/node_modules/delegates/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/node_modules/delegates/History.md b/node_modules/delegates/History.md new file mode 100644 index 00000000..25959eab --- /dev/null +++ b/node_modules/delegates/History.md @@ -0,0 +1,22 @@ + +1.0.0 / 2015-12-14 +================== + + * Merge pull request #12 from kasicka/master + * Add license text + +0.1.0 / 2014-10-17 +================== + + * adds `.fluent()` to api + +0.0.3 / 2014-01-13 +================== + + * fix receiver for .method() + +0.0.2 / 2014-01-13 +================== + + * Object.defineProperty() sucks + * Initial commit diff --git a/node_modules/delegates/License b/node_modules/delegates/License new file mode 100644 index 00000000..60de60ad --- /dev/null +++ b/node_modules/delegates/License @@ -0,0 +1,20 @@ +Copyright (c) 2015 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/delegates/Makefile b/node_modules/delegates/Makefile new file mode 100644 index 00000000..a9dcfd50 --- /dev/null +++ b/node_modules/delegates/Makefile @@ -0,0 +1,8 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec \ + --bail + +.PHONY: test \ No newline at end of file diff --git a/node_modules/delegates/Readme.md b/node_modules/delegates/Readme.md new file mode 100644 index 00000000..ab8cf4ac --- /dev/null +++ b/node_modules/delegates/Readme.md @@ -0,0 +1,94 @@ + +# delegates + + Node method and accessor delegation utilty. + +## Installation + +``` +$ npm install delegates +``` + +## Example + +```js +var delegate = require('delegates'); + +... + +delegate(proto, 'request') + .method('acceptsLanguages') + .method('acceptsEncodings') + .method('acceptsCharsets') + .method('accepts') + .method('is') + .access('querystring') + .access('idempotent') + .access('socket') + .access('length') + .access('query') + .access('search') + .access('status') + .access('method') + .access('path') + .access('body') + .access('host') + .access('url') + .getter('subdomains') + .getter('protocol') + .getter('header') + .getter('stale') + .getter('fresh') + .getter('secure') + .getter('ips') + .getter('ip') +``` + +# API + +## Delegate(proto, prop) + +Creates a delegator instance used to configure using the `prop` on the given +`proto` object. (which is usually a prototype) + +## Delegate#method(name) + +Allows the given method `name` to be accessed on the host. + +## Delegate#getter(name) + +Creates a "getter" for the property with the given `name` on the delegated +object. + +## Delegate#setter(name) + +Creates a "setter" for the property with the given `name` on the delegated +object. + +## Delegate#access(name) + +Creates an "accessor" (ie: both getter *and* setter) for the property with the +given `name` on the delegated object. + +## Delegate#fluent(name) + +A unique type of "accessor" that works for a "fluent" API. When called as a +getter, the method returns the expected value. However, if the method is called +with a value, it will return itself so it can be chained. For example: + +```js +delegate(proto, 'request') + .fluent('query') + +// getter +var q = request.query(); + +// setter (chainable) +request + .query({ a: 1 }) + .query({ b: 2 }); +``` + +# License + + MIT diff --git a/node_modules/delegates/index.js b/node_modules/delegates/index.js new file mode 100644 index 00000000..17c222d5 --- /dev/null +++ b/node_modules/delegates/index.js @@ -0,0 +1,121 @@ + +/** + * Expose `Delegator`. + */ + +module.exports = Delegator; + +/** + * Initialize a delegator. + * + * @param {Object} proto + * @param {String} target + * @api public + */ + +function Delegator(proto, target) { + if (!(this instanceof Delegator)) return new Delegator(proto, target); + this.proto = proto; + this.target = target; + this.methods = []; + this.getters = []; + this.setters = []; + this.fluents = []; +} + +/** + * Delegate method `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.method = function(name){ + var proto = this.proto; + var target = this.target; + this.methods.push(name); + + proto[name] = function(){ + return this[target][name].apply(this[target], arguments); + }; + + return this; +}; + +/** + * Delegator accessor `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.access = function(name){ + return this.getter(name).setter(name); +}; + +/** + * Delegator getter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.getter = function(name){ + var proto = this.proto; + var target = this.target; + this.getters.push(name); + + proto.__defineGetter__(name, function(){ + return this[target][name]; + }); + + return this; +}; + +/** + * Delegator setter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.setter = function(name){ + var proto = this.proto; + var target = this.target; + this.setters.push(name); + + proto.__defineSetter__(name, function(val){ + return this[target][name] = val; + }); + + return this; +}; + +/** + * Delegator fluent accessor + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.fluent = function (name) { + var proto = this.proto; + var target = this.target; + this.fluents.push(name); + + proto[name] = function(val){ + if ('undefined' != typeof val) { + this[target][name] = val; + return this; + } else { + return this[target][name]; + } + }; + + return this; +}; diff --git a/node_modules/delegates/package.json b/node_modules/delegates/package.json new file mode 100644 index 00000000..17240384 --- /dev/null +++ b/node_modules/delegates/package.json @@ -0,0 +1,13 @@ +{ + "name": "delegates", + "version": "1.0.0", + "repository": "visionmedia/node-delegates", + "description": "delegate methods and accessors to another property", + "keywords": ["delegate", "delegation"], + "dependencies": {}, + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "license": "MIT" +} diff --git a/node_modules/delegates/test/index.js b/node_modules/delegates/test/index.js new file mode 100644 index 00000000..7b6e3d4d --- /dev/null +++ b/node_modules/delegates/test/index.js @@ -0,0 +1,94 @@ + +var assert = require('assert'); +var delegate = require('..'); + +describe('.method(name)', function(){ + it('should delegate methods', function(){ + var obj = {}; + + obj.request = { + foo: function(bar){ + assert(this == obj.request); + return bar; + } + }; + + delegate(obj, 'request').method('foo'); + + obj.foo('something').should.equal('something'); + }) +}) + +describe('.getter(name)', function(){ + it('should delegate getters', function(){ + var obj = {}; + + obj.request = { + get type() { + return 'text/html'; + } + } + + delegate(obj, 'request').getter('type'); + + obj.type.should.equal('text/html'); + }) +}) + +describe('.setter(name)', function(){ + it('should delegate setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').setter('type'); + + obj.type = 'hey'; + obj.request.type.should.equal('HEY'); + }) +}) + +describe('.access(name)', function(){ + it('should delegate getters and setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').access('type'); + + obj.type = 'hey'; + obj.type.should.equal('HEY'); + }) +}) + +describe('.fluent(name)', function () { + it('should delegate in a fluent fashion', function () { + var obj = { + settings: { + env: 'development' + } + }; + + delegate(obj, 'settings').fluent('env'); + + obj.env().should.equal('development'); + obj.env('production').should.equal(obj); + obj.settings.env.should.equal('production'); + }) +}) diff --git a/node_modules/detect-libc/LICENSE b/node_modules/detect-libc/LICENSE new file mode 100644 index 00000000..8dada3ed --- /dev/null +++ b/node_modules/detect-libc/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/detect-libc/README.md b/node_modules/detect-libc/README.md new file mode 100644 index 00000000..23212fdd --- /dev/null +++ b/node_modules/detect-libc/README.md @@ -0,0 +1,163 @@ +# detect-libc + +Node.js module to detect details of the C standard library (libc) +implementation provided by a given Linux system. + +Currently supports detection of GNU glibc and MUSL libc. + +Provides asychronous and synchronous functions for the +family (e.g. `glibc`, `musl`) and version (e.g. `1.23`, `1.2.3`). + +The version numbers of libc implementations +are not guaranteed to be semver-compliant. + +For previous v1.x releases, please see the +[v1](https://github.com/lovell/detect-libc/tree/v1) branch. + +## Install + +```sh +npm install detect-libc +``` + +## API + +### GLIBC + +```ts +const GLIBC: string = 'glibc'; +``` + +A String constant containing the value `glibc`. + +### MUSL + +```ts +const MUSL: string = 'musl'; +``` + +A String constant containing the value `musl`. + +### family + +```ts +function family(): Promise; +``` + +Resolves asychronously with: + +* `glibc` or `musl` when the libc family can be determined +* `null` when the libc family cannot be determined +* `null` when run on a non-Linux platform + +```js +const { family, GLIBC, MUSL } = require('detect-libc'); + +switch (await family()) { + case GLIBC: ... + case MUSL: ... + case null: ... +} +``` + +### familySync + +```ts +function familySync(): string | null; +``` + +Synchronous version of `family()`. + +```js +const { familySync, GLIBC, MUSL } = require('detect-libc'); + +switch (familySync()) { + case GLIBC: ... + case MUSL: ... + case null: ... +} +``` + +### version + +```ts +function version(): Promise; +``` + +Resolves asychronously with: + +* The version when it can be determined +* `null` when the libc family cannot be determined +* `null` when run on a non-Linux platform + +```js +const { version } = require('detect-libc'); + +const v = await version(); +if (v) { + const [major, minor, patch] = v.split('.'); +} +``` + +### versionSync + +```ts +function versionSync(): string | null; +``` + +Synchronous version of `version()`. + +```js +const { versionSync } = require('detect-libc'); + +const v = versionSync(); +if (v) { + const [major, minor, patch] = v.split('.'); +} +``` + +### isNonGlibcLinux + +```ts +function isNonGlibcLinux(): Promise; +``` + +Resolves asychronously with: + +* `false` when the libc family is `glibc` +* `true` when the libc family is not `glibc` +* `false` when run on a non-Linux platform + +```js +const { isNonGlibcLinux } = require('detect-libc'); + +if (await isNonGlibcLinux()) { ... } +``` + +### isNonGlibcLinuxSync + +```ts +function isNonGlibcLinuxSync(): boolean; +``` + +Synchronous version of `isNonGlibcLinux()`. + +```js +const { isNonGlibcLinuxSync } = require('detect-libc'); + +if (isNonGlibcLinuxSync()) { ... } +``` + +## Licensing + +Copyright 2017 Lovell Fuller and others. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/detect-libc/index.d.ts b/node_modules/detect-libc/index.d.ts new file mode 100644 index 00000000..4c0fb2b0 --- /dev/null +++ b/node_modules/detect-libc/index.d.ts @@ -0,0 +1,14 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +export const GLIBC: 'glibc'; +export const MUSL: 'musl'; + +export function family(): Promise; +export function familySync(): string | null; + +export function isNonGlibcLinux(): Promise; +export function isNonGlibcLinuxSync(): boolean; + +export function version(): Promise; +export function versionSync(): string | null; diff --git a/node_modules/detect-libc/lib/detect-libc.js b/node_modules/detect-libc/lib/detect-libc.js new file mode 100644 index 00000000..d4ea6f04 --- /dev/null +++ b/node_modules/detect-libc/lib/detect-libc.js @@ -0,0 +1,279 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const childProcess = require('child_process'); +const { isLinux, getReport } = require('./process'); +const { LDD_PATH, readFile, readFileSync } = require('./filesystem'); + +let cachedFamilyFilesystem; +let cachedVersionFilesystem; + +const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true'; +let commandOut = ''; + +const safeCommand = () => { + if (!commandOut) { + return new Promise((resolve) => { + childProcess.exec(command, (err, out) => { + commandOut = err ? ' ' : out; + resolve(commandOut); + }); + }); + } + return commandOut; +}; + +const safeCommandSync = () => { + if (!commandOut) { + try { + commandOut = childProcess.execSync(command, { encoding: 'utf8' }); + } catch (_err) { + commandOut = ' '; + } + } + return commandOut; +}; + +/** + * A String constant containing the value `glibc`. + * @type {string} + * @public + */ +const GLIBC = 'glibc'; + +/** + * A Regexp constant to get the GLIBC Version. + * @type {string} + */ +const RE_GLIBC_VERSION = /GLIBC\s(\d+\.\d+)/; + +/** + * A String constant containing the value `musl`. + * @type {string} + * @public + */ +const MUSL = 'musl'; + +/** + * This string is used to find if the {@link LDD_PATH} is GLIBC + * @type {string} + */ +const GLIBC_ON_LDD = GLIBC.toUpperCase(); + +/** + * This string is used to find if the {@link LDD_PATH} is musl + * @type {string} + */ +const MUSL_ON_LDD = MUSL.toLowerCase(); + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-'); + +const familyFromReport = () => { + const report = getReport(); + if (report.header && report.header.glibcVersionRuntime) { + return GLIBC; + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return MUSL; + } + } + return null; +}; + +const familyFromCommand = (out) => { + const [getconf, ldd1] = out.split(/[\r\n]+/); + if (getconf && getconf.includes(GLIBC)) { + return GLIBC; + } + if (ldd1 && ldd1.includes(MUSL)) { + return MUSL; + } + return null; +}; + +const getFamilyFromLddContent = (content) => { + if (content.includes(MUSL_ON_LDD)) { + return MUSL; + } + if (content.includes(GLIBC_ON_LDD)) { + return GLIBC; + } + return null; +}; + +const familyFromFilesystem = async () => { + if (cachedFamilyFilesystem !== undefined) { + return cachedFamilyFilesystem; + } + cachedFamilyFilesystem = null; + try { + const lddContent = await readFile(LDD_PATH); + cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); + } catch (e) {} + return cachedFamilyFilesystem; +}; + +const familyFromFilesystemSync = () => { + if (cachedFamilyFilesystem !== undefined) { + return cachedFamilyFilesystem; + } + cachedFamilyFilesystem = null; + try { + const lddContent = readFileSync(LDD_PATH); + cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); + } catch (e) {} + return cachedFamilyFilesystem; +}; + +/** + * Resolves with the libc family when it can be determined, `null` otherwise. + * @returns {Promise} + */ +const family = async () => { + let family = null; + if (isLinux()) { + family = await familyFromFilesystem(); + if (!family) { + family = familyFromReport(); + } + if (!family) { + const out = await safeCommand(); + family = familyFromCommand(out); + } + } + return family; +}; + +/** + * Returns the libc family when it can be determined, `null` otherwise. + * @returns {?string} + */ +const familySync = () => { + let family = null; + if (isLinux()) { + family = familyFromFilesystemSync(); + if (!family) { + family = familyFromReport(); + } + if (!family) { + const out = safeCommandSync(); + family = familyFromCommand(out); + } + } + return family; +}; + +/** + * Resolves `true` only when the platform is Linux and the libc family is not `glibc`. + * @returns {Promise} + */ +const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC; + +/** + * Returns `true` only when the platform is Linux and the libc family is not `glibc`. + * @returns {boolean} + */ +const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC; + +const versionFromFilesystem = async () => { + if (cachedVersionFilesystem !== undefined) { + return cachedVersionFilesystem; + } + cachedVersionFilesystem = null; + try { + const lddContent = await readFile(LDD_PATH); + const versionMatch = lddContent.match(RE_GLIBC_VERSION); + if (versionMatch) { + cachedVersionFilesystem = versionMatch[1]; + } + } catch (e) {} + return cachedVersionFilesystem; +}; + +const versionFromFilesystemSync = () => { + if (cachedVersionFilesystem !== undefined) { + return cachedVersionFilesystem; + } + cachedVersionFilesystem = null; + try { + const lddContent = readFileSync(LDD_PATH); + const versionMatch = lddContent.match(RE_GLIBC_VERSION); + if (versionMatch) { + cachedVersionFilesystem = versionMatch[1]; + } + } catch (e) {} + return cachedVersionFilesystem; +}; + +const versionFromReport = () => { + const report = getReport(); + if (report.header && report.header.glibcVersionRuntime) { + return report.header.glibcVersionRuntime; + } + return null; +}; + +const versionSuffix = (s) => s.trim().split(/\s+/)[1]; + +const versionFromCommand = (out) => { + const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/); + if (getconf && getconf.includes(GLIBC)) { + return versionSuffix(getconf); + } + if (ldd1 && ldd2 && ldd1.includes(MUSL)) { + return versionSuffix(ldd2); + } + return null; +}; + +/** + * Resolves with the libc version when it can be determined, `null` otherwise. + * @returns {Promise} + */ +const version = async () => { + let version = null; + if (isLinux()) { + version = await versionFromFilesystem(); + if (!version) { + version = versionFromReport(); + } + if (!version) { + const out = await safeCommand(); + version = versionFromCommand(out); + } + } + return version; +}; + +/** + * Returns the libc version when it can be determined, `null` otherwise. + * @returns {?string} + */ +const versionSync = () => { + let version = null; + if (isLinux()) { + version = versionFromFilesystemSync(); + if (!version) { + version = versionFromReport(); + } + if (!version) { + const out = safeCommandSync(); + version = versionFromCommand(out); + } + } + return version; +}; + +module.exports = { + GLIBC, + MUSL, + family, + familySync, + isNonGlibcLinux, + isNonGlibcLinuxSync, + version, + versionSync +}; diff --git a/node_modules/detect-libc/lib/filesystem.js b/node_modules/detect-libc/lib/filesystem.js new file mode 100644 index 00000000..de7e007e --- /dev/null +++ b/node_modules/detect-libc/lib/filesystem.js @@ -0,0 +1,41 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const fs = require('fs'); + +/** + * The path where we can find the ldd + */ +const LDD_PATH = '/usr/bin/ldd'; + +/** + * Read the content of a file synchronous + * + * @param {string} path + * @returns {string} + */ +const readFileSync = (path) => fs.readFileSync(path, 'utf-8'); + +/** + * Read the content of a file + * + * @param {string} path + * @returns {Promise} + */ +const readFile = (path) => new Promise((resolve, reject) => { + fs.readFile(path, 'utf-8', (err, data) => { + if (err) { + reject(err); + } else { + resolve(data); + } + }); +}); + +module.exports = { + LDD_PATH, + readFileSync, + readFile +}; diff --git a/node_modules/detect-libc/lib/process.js b/node_modules/detect-libc/lib/process.js new file mode 100644 index 00000000..d27fcb73 --- /dev/null +++ b/node_modules/detect-libc/lib/process.js @@ -0,0 +1,19 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const isLinux = () => process.platform === 'linux'; + +let report = null; +const getReport = () => { + if (!report) { + /* istanbul ignore next */ + report = isLinux() && process.report + ? process.report.getReport() + : {}; + } + return report; +}; + +module.exports = { isLinux, getReport }; diff --git a/node_modules/detect-libc/package.json b/node_modules/detect-libc/package.json new file mode 100644 index 00000000..dd8e42c2 --- /dev/null +++ b/node_modules/detect-libc/package.json @@ -0,0 +1,40 @@ +{ + "name": "detect-libc", + "version": "2.0.2", + "description": "Node.js module to detect the C standard library (libc) implementation family and version", + "main": "lib/detect-libc.js", + "files": [ + "lib/", + "index.d.ts" + ], + "scripts": { + "test": "semistandard && nyc --reporter=lcov --check-coverage --branches=100 ava test/unit.js", + "bench": "node benchmark/detect-libc", + "bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/lovell/detect-libc" + }, + "keywords": [ + "libc", + "glibc", + "musl" + ], + "author": "Lovell Fuller ", + "contributors": [ + "Niklas Salmoukas ", + "Vinícius Lourenço " + ], + "license": "Apache-2.0", + "devDependencies": { + "ava": "^2.4.0", + "benchmark": "^2.1.4", + "nyc": "^15.1.0", + "proxyquire": "^2.1.3", + "semistandard": "^14.2.3" + }, + "engines": { + "node": ">=8" + } +} diff --git a/node_modules/ecdsa-sig-formatter/CODEOWNERS b/node_modules/ecdsa-sig-formatter/CODEOWNERS new file mode 100644 index 00000000..4451d3d8 --- /dev/null +++ b/node_modules/ecdsa-sig-formatter/CODEOWNERS @@ -0,0 +1 @@ +* @omsmith diff --git a/node_modules/ecdsa-sig-formatter/LICENSE b/node_modules/ecdsa-sig-formatter/LICENSE new file mode 100644 index 00000000..8754ed63 --- /dev/null +++ b/node_modules/ecdsa-sig-formatter/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2015 D2L Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/ecdsa-sig-formatter/README.md b/node_modules/ecdsa-sig-formatter/README.md new file mode 100644 index 00000000..daa95d6e --- /dev/null +++ b/node_modules/ecdsa-sig-formatter/README.md @@ -0,0 +1,65 @@ +# ecdsa-sig-formatter + +[![Build Status](https://travis-ci.org/Brightspace/node-ecdsa-sig-formatter.svg?branch=master)](https://travis-ci.org/Brightspace/node-ecdsa-sig-formatter) [![Coverage Status](https://coveralls.io/repos/Brightspace/node-ecdsa-sig-formatter/badge.svg)](https://coveralls.io/r/Brightspace/node-ecdsa-sig-formatter) + +Translate between JOSE and ASN.1/DER encodings for ECDSA signatures + +## Install +```sh +npm install ecdsa-sig-formatter --save +``` + +## Usage +```js +var format = require('ecdsa-sig-formatter'); + +var derSignature = '..'; // asn.1/DER encoded ecdsa signature + +var joseSignature = format.derToJose(derSignature); + +``` + +### API + +--- + +#### `.derToJose(Buffer|String signature, String alg)` -> `String` + +Convert the ASN.1/DER encoded signature to a JOSE-style concatenated signature. +Returns a _base64 url_ encoded `String`. + +* If _signature_ is a `String`, it should be _base64_ encoded +* _alg_ must be one of _ES256_, _ES384_ or _ES512_ + +--- + +#### `.joseToDer(Buffer|String signature, String alg)` -> `Buffer` + +Convert the JOSE-style concatenated signature to an ASN.1/DER encoded +signature. Returns a `Buffer` + +* If _signature_ is a `String`, it should be _base64 url_ encoded +* _alg_ must be one of _ES256_, _ES384_ or _ES512_ + +## Contributing + +1. **Fork** the repository. Committing directly against this repository is + highly discouraged. + +2. Make your modifications in a branch, updating and writing new unit tests + as necessary in the `spec` directory. + +3. Ensure that all tests pass with `npm test` + +4. `rebase` your changes against master. *Do not merge*. + +5. Submit a pull request to this repository. Wait for tests to run and someone + to chime in. + +### Code Style + +This repository is configured with [EditorConfig][EditorConfig] and +[ESLint][ESLint] rules. + +[EditorConfig]: http://editorconfig.org/ +[ESLint]: http://eslint.org diff --git a/node_modules/ecdsa-sig-formatter/package.json b/node_modules/ecdsa-sig-formatter/package.json new file mode 100644 index 00000000..6fb5ebfe --- /dev/null +++ b/node_modules/ecdsa-sig-formatter/package.json @@ -0,0 +1,46 @@ +{ + "name": "ecdsa-sig-formatter", + "version": "1.0.11", + "description": "Translate ECDSA signatures between ASN.1/DER and JOSE-style concatenation", + "main": "src/ecdsa-sig-formatter.js", + "scripts": { + "check-style": "eslint .", + "pretest": "npm run check-style", + "test": "istanbul cover --root src _mocha -- spec", + "report-cov": "cat ./coverage/lcov.info | coveralls" + }, + "typings": "./src/ecdsa-sig-formatter.d.ts", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/Brightspace/node-ecdsa-sig-formatter.git" + }, + "keywords": [ + "ecdsa", + "der", + "asn.1", + "jwt", + "jwa", + "jsonwebtoken", + "jose" + ], + "author": "D2L Corporation", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/Brightspace/node-ecdsa-sig-formatter/issues" + }, + "homepage": "https://github.com/Brightspace/node-ecdsa-sig-formatter#readme", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "devDependencies": { + "bench": "^0.3.6", + "chai": "^3.5.0", + "coveralls": "^2.11.9", + "eslint": "^2.12.0", + "eslint-config-brightspace": "^0.2.1", + "istanbul": "^0.4.3", + "jwk-to-pem": "^1.2.5", + "mocha": "^2.5.3", + "native-crypto": "^1.7.0" + } +} diff --git a/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts b/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts new file mode 100644 index 00000000..9693aa03 --- /dev/null +++ b/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts @@ -0,0 +1,17 @@ +/// + +declare module "ecdsa-sig-formatter" { + /** + * Convert the ASN.1/DER encoded signature to a JOSE-style concatenated signature. Returns a base64 url encoded String. + * If signature is a String, it should be base64 encoded + * alg must be one of ES256, ES384 or ES512 + */ + export function derToJose(signature: Buffer | string, alg: string): string; + + /** + * Convert the JOSE-style concatenated signature to an ASN.1/DER encoded signature. Returns a Buffer + * If signature is a String, it should be base64 url encoded + * alg must be one of ES256, ES384 or ES512 + */ + export function joseToDer(signature: Buffer | string, alg: string): Buffer +} diff --git a/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js b/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js new file mode 100644 index 00000000..38eeb9b9 --- /dev/null +++ b/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js @@ -0,0 +1,187 @@ +'use strict'; + +var Buffer = require('safe-buffer').Buffer; + +var getParamBytesForAlg = require('./param-bytes-for-alg'); + +var MAX_OCTET = 0x80, + CLASS_UNIVERSAL = 0, + PRIMITIVE_BIT = 0x20, + TAG_SEQ = 0x10, + TAG_INT = 0x02, + ENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6), + ENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6); + +function base64Url(base64) { + return base64 + .replace(/=/g, '') + .replace(/\+/g, '-') + .replace(/\//g, '_'); +} + +function signatureAsBuffer(signature) { + if (Buffer.isBuffer(signature)) { + return signature; + } else if ('string' === typeof signature) { + return Buffer.from(signature, 'base64'); + } + + throw new TypeError('ECDSA signature must be a Base64 string or a Buffer'); +} + +function derToJose(signature, alg) { + signature = signatureAsBuffer(signature); + var paramBytes = getParamBytesForAlg(alg); + + // the DER encoded param should at most be the param size, plus a padding + // zero, since due to being a signed integer + var maxEncodedParamLength = paramBytes + 1; + + var inputLength = signature.length; + + var offset = 0; + if (signature[offset++] !== ENCODED_TAG_SEQ) { + throw new Error('Could not find expected "seq"'); + } + + var seqLength = signature[offset++]; + if (seqLength === (MAX_OCTET | 1)) { + seqLength = signature[offset++]; + } + + if (inputLength - offset < seqLength) { + throw new Error('"seq" specified length of "' + seqLength + '", only "' + (inputLength - offset) + '" remaining'); + } + + if (signature[offset++] !== ENCODED_TAG_INT) { + throw new Error('Could not find expected "int" for "r"'); + } + + var rLength = signature[offset++]; + + if (inputLength - offset - 2 < rLength) { + throw new Error('"r" specified length of "' + rLength + '", only "' + (inputLength - offset - 2) + '" available'); + } + + if (maxEncodedParamLength < rLength) { + throw new Error('"r" specified length of "' + rLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); + } + + var rOffset = offset; + offset += rLength; + + if (signature[offset++] !== ENCODED_TAG_INT) { + throw new Error('Could not find expected "int" for "s"'); + } + + var sLength = signature[offset++]; + + if (inputLength - offset !== sLength) { + throw new Error('"s" specified length of "' + sLength + '", expected "' + (inputLength - offset) + '"'); + } + + if (maxEncodedParamLength < sLength) { + throw new Error('"s" specified length of "' + sLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); + } + + var sOffset = offset; + offset += sLength; + + if (offset !== inputLength) { + throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain'); + } + + var rPadding = paramBytes - rLength, + sPadding = paramBytes - sLength; + + var dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength); + + for (offset = 0; offset < rPadding; ++offset) { + dst[offset] = 0; + } + signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength); + + offset = paramBytes; + + for (var o = offset; offset < o + sPadding; ++offset) { + dst[offset] = 0; + } + signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength); + + dst = dst.toString('base64'); + dst = base64Url(dst); + + return dst; +} + +function countPadding(buf, start, stop) { + var padding = 0; + while (start + padding < stop && buf[start + padding] === 0) { + ++padding; + } + + var needsSign = buf[start + padding] >= MAX_OCTET; + if (needsSign) { + --padding; + } + + return padding; +} + +function joseToDer(signature, alg) { + signature = signatureAsBuffer(signature); + var paramBytes = getParamBytesForAlg(alg); + + var signatureBytes = signature.length; + if (signatureBytes !== paramBytes * 2) { + throw new TypeError('"' + alg + '" signatures must be "' + paramBytes * 2 + '" bytes, saw "' + signatureBytes + '"'); + } + + var rPadding = countPadding(signature, 0, paramBytes); + var sPadding = countPadding(signature, paramBytes, signature.length); + var rLength = paramBytes - rPadding; + var sLength = paramBytes - sPadding; + + var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength; + + var shortLength = rsBytes < MAX_OCTET; + + var dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes); + + var offset = 0; + dst[offset++] = ENCODED_TAG_SEQ; + if (shortLength) { + // Bit 8 has value "0" + // bits 7-1 give the length. + dst[offset++] = rsBytes; + } else { + // Bit 8 of first octet has value "1" + // bits 7-1 give the number of additional length octets. + dst[offset++] = MAX_OCTET | 1; + // length, base 256 + dst[offset++] = rsBytes & 0xff; + } + dst[offset++] = ENCODED_TAG_INT; + dst[offset++] = rLength; + if (rPadding < 0) { + dst[offset++] = 0; + offset += signature.copy(dst, offset, 0, paramBytes); + } else { + offset += signature.copy(dst, offset, rPadding, paramBytes); + } + dst[offset++] = ENCODED_TAG_INT; + dst[offset++] = sLength; + if (sPadding < 0) { + dst[offset++] = 0; + signature.copy(dst, offset, paramBytes); + } else { + signature.copy(dst, offset, paramBytes + sPadding); + } + + return dst; +} + +module.exports = { + derToJose: derToJose, + joseToDer: joseToDer +}; diff --git a/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js b/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js new file mode 100644 index 00000000..9fe67acc --- /dev/null +++ b/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js @@ -0,0 +1,23 @@ +'use strict'; + +function getParamSize(keySize) { + var result = ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1); + return result; +} + +var paramBytesForAlg = { + ES256: getParamSize(256), + ES384: getParamSize(384), + ES512: getParamSize(521) +}; + +function getParamBytesForAlg(alg) { + var paramBytes = paramBytesForAlg[alg]; + if (paramBytes) { + return paramBytes; + } + + throw new Error('Unknown algorithm "' + alg + '"'); +} + +module.exports = getParamBytesForAlg; diff --git a/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 00000000..a41e0a7e --- /dev/null +++ b/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/emoji-regex/README.md b/node_modules/emoji-regex/README.md new file mode 100644 index 00000000..f10e1733 --- /dev/null +++ b/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/emoji-regex/es2015/index.js b/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 00000000..b4cf3dcd --- /dev/null +++ b/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/emoji-regex/es2015/text.js b/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 00000000..780309df --- /dev/null +++ b/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/emoji-regex/index.d.ts b/node_modules/emoji-regex/index.d.ts new file mode 100644 index 00000000..1955b470 --- /dev/null +++ b/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,23 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} diff --git a/node_modules/emoji-regex/index.js b/node_modules/emoji-regex/index.js new file mode 100644 index 00000000..d993a3a9 --- /dev/null +++ b/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/emoji-regex/package.json b/node_modules/emoji-regex/package.json new file mode 100644 index 00000000..6d323528 --- /dev/null +++ b/node_modules/emoji-regex/package.json @@ -0,0 +1,50 @@ +{ + "name": "emoji-regex", + "version": "8.0.0", + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "homepage": "https://mths.be/emoji-regex", + "main": "index.js", + "types": "index.d.ts", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/emoji-regex.git" + }, + "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", + "regexgen": "^1.3.0", + "unicode-12.0.0": "^0.7.9" + } +} diff --git a/node_modules/emoji-regex/text.js b/node_modules/emoji-regex/text.js new file mode 100644 index 00000000..0a55ce2f --- /dev/null +++ b/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/follow-redirects/LICENSE b/node_modules/follow-redirects/LICENSE new file mode 100644 index 00000000..742cbada --- /dev/null +++ b/node_modules/follow-redirects/LICENSE @@ -0,0 +1,18 @@ +Copyright 2014–present Olivier Lalonde , James Talmage , Ruben Verborgh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/follow-redirects/README.md b/node_modules/follow-redirects/README.md new file mode 100644 index 00000000..eb869a6f --- /dev/null +++ b/node_modules/follow-redirects/README.md @@ -0,0 +1,155 @@ +## Follow Redirects + +Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects. + +[![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) +[![Build Status](https://github.com/follow-redirects/follow-redirects/workflows/CI/badge.svg)](https://github.com/follow-redirects/follow-redirects/actions) +[![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master) +[![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) +[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh) + +`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) + methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback) + modules, with the exception that they will seamlessly follow redirects. + +```javascript +const { http, https } = require('follow-redirects'); + +http.get('http://bit.ly/900913', response => { + response.on('data', chunk => { + console.log(chunk); + }); +}).on('error', err => { + console.error(err); +}); +``` + +You can inspect the final redirected URL through the `responseUrl` property on the `response`. +If no redirection happened, `responseUrl` is the original request URL. + +```javascript +const request = https.request({ + host: 'bitly.com', + path: '/UHfDGO', +}, response => { + console.log(response.responseUrl); + // 'http://duckduckgo.com/robots.txt' +}); +request.end(); +``` + +## Options +### Global options +Global options are set directly on the `follow-redirects` module: + +```javascript +const followRedirects = require('follow-redirects'); +followRedirects.maxRedirects = 10; +followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB +``` + +The following global options are supported: + +- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. + +- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. + +### Per-request options +Per-request options are set by passing an `options` object: + +```javascript +const url = require('url'); +const { http, https } = require('follow-redirects'); + +const options = url.parse('http://bit.ly/900913'); +options.maxRedirects = 10; +options.beforeRedirect = (options, response, request) => { + // Use this to adjust the request options upon redirecting, + // to inspect the latest response headers, + // or to cancel the request by throwing an error + + // response.headers = the redirect response headers + // response.statusCode = the redirect response code (eg. 301, 307, etc.) + + // request.url = the requested URL that resulted in a redirect + // request.headers = the headers in the request that resulted in a redirect + // request.method = the method of the request that resulted in a redirect + if (options.hostname === "example.com") { + options.auth = "user:password"; + } +}; +http.request(options); +``` + +In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback), +the following per-request options are supported: +- `followRedirects` (default: `true`) – whether redirects should be followed. + +- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. + +- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. + +- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error. + +- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }` + +- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object. + + +### Advanced usage +By default, `follow-redirects` will use the Node.js default implementations +of [`http`](https://nodejs.org/api/http.html) +and [`https`](https://nodejs.org/api/https.html). +To enable features such as caching and/or intermediate request tracking, +you might instead want to wrap `follow-redirects` around custom protocol implementations: + +```javascript +const { http, https } = require('follow-redirects').wrap({ + http: require('your-custom-http'), + https: require('your-custom-https'), +}); +``` + +Such custom protocols only need an implementation of the `request` method. + +## Browser Usage + +Due to the way the browser works, +the `http` and `https` browser equivalents perform redirects by default. + +By requiring `follow-redirects` this way: +```javascript +const http = require('follow-redirects/http'); +const https = require('follow-redirects/https'); +``` +you can easily tell webpack and friends to replace +`follow-redirect` by the built-in versions: + +```json +{ + "follow-redirects/http" : "http", + "follow-redirects/https" : "https" +} +``` + +## Contributing + +Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues) + detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied + by tests. You can run the test suite locally with a simple `npm test` command. + +## Debug Logging + +`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging + set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test + suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well. + +## Authors + +- [Ruben Verborgh](https://ruben.verborgh.org/) +- [Olivier Lalonde](mailto:olalonde@gmail.com) +- [James Talmage](mailto:james@talmage.io) + +## License + +[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE) diff --git a/node_modules/follow-redirects/debug.js b/node_modules/follow-redirects/debug.js new file mode 100644 index 00000000..decb77de --- /dev/null +++ b/node_modules/follow-redirects/debug.js @@ -0,0 +1,15 @@ +var debug; + +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = require("debug")("follow-redirects"); + } + catch (error) { /* */ } + if (typeof debug !== "function") { + debug = function () { /* */ }; + } + } + debug.apply(null, arguments); +}; diff --git a/node_modules/follow-redirects/http.js b/node_modules/follow-redirects/http.js new file mode 100644 index 00000000..695e3561 --- /dev/null +++ b/node_modules/follow-redirects/http.js @@ -0,0 +1 @@ +module.exports = require("./").http; diff --git a/node_modules/follow-redirects/https.js b/node_modules/follow-redirects/https.js new file mode 100644 index 00000000..d21c921d --- /dev/null +++ b/node_modules/follow-redirects/https.js @@ -0,0 +1 @@ +module.exports = require("./").https; diff --git a/node_modules/follow-redirects/index.js b/node_modules/follow-redirects/index.js new file mode 100644 index 00000000..f58b9334 --- /dev/null +++ b/node_modules/follow-redirects/index.js @@ -0,0 +1,672 @@ +var url = require("url"); +var URL = url.URL; +var http = require("http"); +var https = require("https"); +var Writable = require("stream").Writable; +var assert = require("assert"); +var debug = require("./debug"); + +// Whether to use the native URL object or the legacy url module +var useNativeURL = false; +try { + assert(new URL()); +} +catch (error) { + useNativeURL = error.code === "ERR_INVALID_URL"; +} + +// URL fields to preserve in copy operations +var preservedUrlFields = [ + "auth", + "host", + "hostname", + "href", + "path", + "pathname", + "port", + "protocol", + "query", + "search", + "hash", +]; + +// Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; +var eventHandlers = Object.create(null); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; +}); + +// Error types with codes +var InvalidUrlError = createErrorType( + "ERR_INVALID_URL", + "Invalid URL", + TypeError +); +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded", + RedirectionError +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); + +// istanbul ignore next +var destroy = Writable.prototype.destroy || noop; + +// An HTTP(S) request that can be redirected +function RedirectableRequest(options, responseCallback) { + // Initialize the request + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; + + // Attach a callback if passed + if (responseCallback) { + this.on("response", responseCallback); + } + + // React to responses of native requests + var self = this; + this._onNativeResponse = function (response) { + try { + self._processResponse(response); + } + catch (cause) { + self.emit("error", cause instanceof RedirectionError ? + cause : new RedirectionError({ cause: cause })); + } + }; + + // Perform the first request + this._performRequest(); +} +RedirectableRequest.prototype = Object.create(Writable.prototype); + +RedirectableRequest.prototype.abort = function () { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); +}; + +RedirectableRequest.prototype.destroy = function (error) { + destroyRequest(this._currentRequest, error); + destroy.call(this, error); + return this; +}; + +// Writes buffered data to the current native request +RedirectableRequest.prototype.write = function (data, encoding, callback) { + // Writing is not allowed if end has been called + if (this._ending) { + throw new WriteAfterEndError(); + } + + // Validate input and shift parameters if necessary + if (!isString(data) && !isBuffer(data)) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + + // Ignore empty buffers, since writing them doesn't invoke the callback + // https://github.com/nodejs/node/issues/22066 + if (data.length === 0) { + if (callback) { + callback(); + } + return; + } + // Only write when we don't exceed the maximum body length + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data: data, encoding: encoding }); + this._currentRequest.write(data, encoding, callback); + } + // Error when we exceed the maximum body length + else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); + } +}; + +// Ends the current native request +RedirectableRequest.prototype.end = function (data, encoding, callback) { + // Shift parameters if necessary + if (isFunction(data)) { + callback = data; + data = encoding = null; + } + else if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + + // Write data if needed and end + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } + else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function () { + self._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } +}; + +// Sets a header value on the current native request +RedirectableRequest.prototype.setHeader = function (name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); +}; + +// Clears a header value on the current native request +RedirectableRequest.prototype.removeHeader = function (name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); +}; + +// Global timeout for all underlying requests +RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; + + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } + + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); + } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } + + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; + } + + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + self.removeListener("close", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); + } + } + + // Attach callback if passed + if (callback) { + this.on("timeout", callback); + } + + // Start the timer if or when the socket is opened + if (this.socket) { + startTimer(this.socket); + } + else { + this._currentRequest.once("socket", startTimer); + } + + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); + this.on("close", clearTimer); + + return this; +}; + +// Proxy all other public ClientRequest methods +[ + "flushHeaders", "getHeader", + "setNoDelay", "setSocketKeepAlive", +].forEach(function (method) { + RedirectableRequest.prototype[method] = function (a, b) { + return this._currentRequest[method](a, b); + }; +}); + +// Proxy all public ClientRequest properties +["aborted", "connection", "socket"].forEach(function (property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function () { return this._currentRequest[property]; }, + }); +}); + +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; + } + + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; + } + + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } + } +}; + + +// Executes the next native request (initial or redirect) +RedirectableRequest.prototype._performRequest = function () { + // Load the native protocol + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + throw new TypeError("Unsupported protocol " + protocol); + } + + // If specified, use the agent corresponding to the protocol + // (HTTP and HTTPS use different types of agents) + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } + + // Create the native request and set up its event handlers + var request = this._currentRequest = + nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } + + // RFC7230§5.3.1: When making a request directly to an origin server, […] + // a client MUST send only the absolute path […] as the request-target. + this._currentUrl = /^\//.test(this._options.path) ? + url.format(this._options) : + // When making a request to a proxy, […] + // a client MUST send the target URI in absolute-form […]. + this._options.path; + + // End a redirected request + // (The first request must be ended explicitly with RedirectableRequest#end) + if (this._isRedirect) { + // Write the request entity and end + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + // Only write if this request has not been redirected yet + /* istanbul ignore else */ + if (request === self._currentRequest) { + // Report any write errors + /* istanbul ignore if */ + if (error) { + self.emit("error", error); + } + // Write the next buffer if there are still left + else if (i < buffers.length) { + var buffer = buffers[i++]; + /* istanbul ignore else */ + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } + // End the request if `end` has been called on us + else if (self._ended) { + request.end(); + } + } + }()); + } +}; + +// Processes a response from the current native request +RedirectableRequest.prototype._processResponse = function (response) { + // Store the redirected response + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode: statusCode, + }); + } + + // RFC7231§6.4: The 3xx (Redirection) class of status code indicates + // that further action needs to be taken by the user agent in order to + // fulfill the request. If a Location header field is provided, + // the user agent MAY automatically redirect its request to the URI + // referenced by the Location field value, + // even if the specific status code is not understood. + + // If the response is not a redirect; return it as-is + var location = response.headers.location; + if (!location || this._options.followRedirects === false || + statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); + + // Clean up + this._requestBodyBuffers = []; + return; + } + + // The response is a redirect, so abort the current request + destroyRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); + + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); + } + + // Store the request headers if applicable + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host"), + }, this._options.headers); + } + + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } + + // Drop the Host header, as the redirect might lead to a different host + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = parseUrl(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); + + // Create the redirected request + var redirectUrl = resolveUrl(location, currentUrl); + debug("redirecting to", redirectUrl.href); + this._isRedirect = true; + spreadUrlObject(redirectUrl, this._options); + + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if (redirectUrl.protocol !== currentUrlParts.protocol && + redirectUrl.protocol !== "https:" || + redirectUrl.host !== currentHost && + !isSubdomain(redirectUrl.host, currentHost)) { + removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + } + + // Evaluate the beforeRedirect callback + if (isFunction(beforeRedirect)) { + var responseDetails = { + headers: response.headers, + statusCode: statusCode, + }; + var requestDetails = { + url: currentUrl, + method: method, + headers: requestHeaders, + }; + beforeRedirect(this._options, responseDetails, requestDetails); + this._sanitizeOptions(this._options); + } + + // Perform the redirected request + this._performRequest(); +}; + +// Wraps the key/value object of protocols with redirect functionality +function wrap(protocols) { + // Default settings + var exports = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024, + }; + + // Wrap each protocol + var nativeProtocols = {}; + Object.keys(protocols).forEach(function (scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); + + // Executes a request, following redirects + function request(input, options, callback) { + // Parse parameters, ensuring that input is an object + if (isURL(input)) { + input = spreadUrlObject(input); + } + else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } + else { + callback = options; + options = validateUrl(input); + input = { protocol: protocol }; + } + if (isFunction(options)) { + callback = options; + options = null; + } + + // Set defaults + options = Object.assign({ + maxRedirects: exports.maxRedirects, + maxBodyLength: exports.maxBodyLength, + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; + } + + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); + } + + // Executes a GET request, following redirects + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } + + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); + }); + return exports; +} + +function noop() { /* empty */ } + +function parseUrl(input) { + var parsed; + /* istanbul ignore else */ + if (useNativeURL) { + parsed = new URL(input); + } + else { + // Ensure the URL is valid and absolute + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } + } + return parsed; +} + +function resolveUrl(relative, base) { + /* istanbul ignore next */ + return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); +} + +function validateUrl(input) { + if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { + throw new InvalidUrlError({ input: input.href || input }); + } + if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { + throw new InvalidUrlError({ input: input.href || input }); + } + return input; +} + +function spreadUrlObject(urlObject, target) { + var spread = target || {}; + for (var key of preservedUrlFields) { + spread[key] = urlObject[key]; + } + + // Fix IPv6 hostname + if (spread.hostname.startsWith("[")) { + spread.hostname = spread.hostname.slice(1, -1); + } + // Ensure port is a number + if (spread.port !== "") { + spread.port = Number(spread.port); + } + // Concatenate path + spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; + + return spread; +} + +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; + } + } + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); +} + +function createErrorType(code, message, baseClass) { + // Create constructor + function CustomError(properties) { + Error.captureStackTrace(this, this.constructor); + Object.assign(this, properties || {}); + this.code = code; + this.message = this.cause ? message + ": " + this.cause.message : message; + } + + // Attach constructor and set default properties + CustomError.prototype = new (baseClass || Error)(); + Object.defineProperties(CustomError.prototype, { + constructor: { + value: CustomError, + enumerable: false, + }, + name: { + value: "Error [" + code + "]", + enumerable: false, + }, + }); + return CustomError; +} + +function destroyRequest(request, error) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error); +} + +function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); +} + +function isString(value) { + return typeof value === "string" || value instanceof String; +} + +function isFunction(value) { + return typeof value === "function"; +} + +function isBuffer(value) { + return typeof value === "object" && ("length" in value); +} + +function isURL(value) { + return URL && value instanceof URL; +} + +// Exports +module.exports = wrap({ http: http, https: https }); +module.exports.wrap = wrap; diff --git a/node_modules/follow-redirects/package.json b/node_modules/follow-redirects/package.json new file mode 100644 index 00000000..9b87663e --- /dev/null +++ b/node_modules/follow-redirects/package.json @@ -0,0 +1,58 @@ +{ + "name": "follow-redirects", + "version": "1.15.5", + "description": "HTTP and HTTPS modules that follow redirects.", + "license": "MIT", + "main": "index.js", + "files": [ + "*.js" + ], + "engines": { + "node": ">=4.0" + }, + "scripts": { + "lint": "eslint *.js test", + "test": "nyc mocha" + }, + "repository": { + "type": "git", + "url": "git@github.com:follow-redirects/follow-redirects.git" + }, + "homepage": "https://github.com/follow-redirects/follow-redirects", + "bugs": { + "url": "https://github.com/follow-redirects/follow-redirects/issues" + }, + "keywords": [ + "http", + "https", + "url", + "redirect", + "client", + "location", + "utility" + ], + "author": "Ruben Verborgh (https://ruben.verborgh.org/)", + "contributors": [ + "Olivier Lalonde (http://www.syskall.com)", + "James Talmage " + ], + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "peerDependenciesMeta": { + "debug": { + "optional": true + } + }, + "devDependencies": { + "concat-stream": "^2.0.0", + "eslint": "^5.16.0", + "express": "^4.16.4", + "lolex": "^3.1.0", + "mocha": "^6.0.2", + "nyc": "^14.1.1" + } +} diff --git a/node_modules/form-data/License b/node_modules/form-data/License new file mode 100644 index 00000000..c7ff12a2 --- /dev/null +++ b/node_modules/form-data/License @@ -0,0 +1,19 @@ +Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/node_modules/form-data/README.md.bak b/node_modules/form-data/README.md.bak new file mode 100644 index 00000000..298a1a24 --- /dev/null +++ b/node_modules/form-data/README.md.bak @@ -0,0 +1,358 @@ +# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) + +A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. + +The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. + +[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface + +[![Linux Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=linux:6.x-12.x)](https://travis-ci.org/form-data/form-data) +[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=macos:6.x-12.x)](https://travis-ci.org/form-data/form-data) +[![Windows Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=windows:6.x-12.x)](https://travis-ci.org/form-data/form-data) + +[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v4.0.0.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) +[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) + +## Install + +``` +npm install --save form-data +``` + +## Usage + +In this example we are constructing a form with 3 fields that contain a string, +a buffer and a file stream. + +``` javascript +var FormData = require('form-data'); +var fs = require('fs'); + +var form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); +``` + +Also you can use http-response stream: + +``` javascript +var FormData = require('form-data'); +var http = require('http'); + +var form = new FormData(); + +http.request('http://nodejs.org/images/logo.png', function(response) { + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_logo', response); +}); +``` + +Or @mikeal's [request](https://github.com/request/request) stream: + +``` javascript +var FormData = require('form-data'); +var request = require('request'); + +var form = new FormData(); + +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_logo', request('http://nodejs.org/images/logo.png')); +``` + +In order to submit this form to a web application, call ```submit(url, [callback])``` method: + +``` javascript +form.submit('http://example.org/', function(err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +}); + +``` + +For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. + +### Custom options + +You can provide custom options, such as `maxDataSize`: + +``` javascript +var FormData = require('form-data'); + +var form = new FormData({ maxDataSize: 20971520 }); +form.append('my_field', 'my value'); +form.append('my_buffer', /* something big */); +``` + +List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15) + +### Alternative submission methods + +You can use node's http client interface: + +``` javascript +var http = require('http'); + +var request = http.request({ + method: 'post', + host: 'example.org', + path: '/upload', + headers: form.getHeaders() +}); + +form.pipe(request); + +request.on('response', function(res) { + console.log(res.statusCode); +}); +``` + +Or if you would prefer the `'Content-Length'` header to be set for you: + +``` javascript +form.submit('example.org/upload', function(err, res) { + console.log(res.statusCode); +}); +``` + +To use custom headers and pre-known length in parts: + +``` javascript +var CRLF = '\r\n'; +var form = new FormData(); + +var options = { + header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, + knownLength: 1 +}; + +form.append('my_buffer', buffer, options); + +form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); +}); +``` + +Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: + +``` javascript +someModule.stream(function(err, stdout, stderr) { + if (err) throw err; + + var form = new FormData(); + + form.append('file', stdout, { + filename: 'unicycle.jpg', // ... or: + filepath: 'photos/toys/unicycle.jpg', + contentType: 'image/jpeg', + knownLength: 19806 + }); + + form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); + }); +}); +``` + +The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory). + +For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: + +``` javascript +form.submit({ + host: 'example.com', + path: '/probably.php?extra=params', + auth: 'username:password' +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`: + +``` javascript +form.submit({ + host: 'example.com', + path: '/surelynot.php', + headers: {'x-test-header': 'test-header-value'} +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +### Methods + +- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-). +- [_Headers_ getHeaders( [**Headers** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-) +- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary) +- [_Void_ setBoundary()](https://github.com/form-data/form-data#void-setboundary) +- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer) +- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync) +- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-) +- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength) +- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-) +- [_String_ toString()](https://github.com/form-data/form-data#string-tostring) + +#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] ) +Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user. +```javascript +var form = new FormData(); +form.append( 'my_string', 'my value' ); +form.append( 'my_integer', 1 ); +form.append( 'my_boolean', true ); +form.append( 'my_buffer', new Buffer(10) ); +form.append( 'my_array_as_json', JSON.stringify( ['bird','cute'] ) ) +``` + +You may provide a string for options, or an object. +```javascript +// Set filename by providing a string for options +form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg' ); + +// provide an object. +form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), {filename: 'bar.jpg', contentType: 'image/jpeg', knownLength: 19806} ); +``` + +#### _Headers_ getHeaders( [**Headers** _userHeaders_] ) +This method adds the correct `content-type` header to the provided array of `userHeaders`. + +#### _String_ getBoundary() +Return the boundary of the formData. By default, the boundary consists of 26 `-` followed by 24 numbers +for example: +```javascript +--------------------------515890814546601021194782 +``` + +#### _Void_ setBoundary(String _boundary_) +Set the boundary string, overriding the default behavior described above. + +_Note: The boundary must be unique and may not appear in the data._ + +#### _Buffer_ getBuffer() +Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data. +```javascript +var form = new FormData(); +form.append( 'my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73]) ); +form.append( 'my_file', fs.readFileSync('/foo/bar.jpg') ); + +axios.post( 'https://example.com/path/to/api', + form.getBuffer(), + form.getHeaders() + ) +``` +**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error. + +#### _Integer_ getLengthSync() +Same as `getLength` but synchronous. + +_Note: getLengthSync __doesn't__ calculate streams length._ + +#### _Integer_ getLength( **function** _callback_ ) +Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated +```javascript +this.getLength(function(err, length) { + if (err) { + this._error(err); + return; + } + + // add content length + request.setHeader('Content-Length', length); + + ... +}.bind(this)); +``` + +#### _Boolean_ hasKnownLength() +Checks if the length of added values is known. + +#### _Request_ submit( _params_, **function** _callback_ ) +Submit the form to a web application. +```javascript +var form = new FormData(); +form.append( 'my_string', 'Hello World' ); + +form.submit( 'http://example.com/', function(err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +} ); +``` + +#### _String_ toString() +Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead. + +### Integration with other libraries + +#### Request + +Form submission using [request](https://github.com/request/request): + +```javascript +var formData = { + my_field: 'my_value', + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), +}; + +request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads). + +#### node-fetch + +You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch): + +```javascript +var form = new FormData(); + +form.append('a', 1); + +fetch('http://example.com', { method: 'POST', body: form }) + .then(function(res) { + return res.json(); + }).then(function(json) { + console.log(json); + }); +``` + +#### axios + +In Node.js you can post a file using [axios](https://github.com/axios/axios): +```javascript +const form = new FormData(); +const stream = fs.createReadStream(PATH_TO_FILE); + +form.append('image', stream); + +// In Node.js environment you need to set boundary in the header field 'Content-Type' by calling method `getHeaders` +const formHeaders = form.getHeaders(); + +axios.post('http://example.com', form, { + headers: { + ...formHeaders, + }, +}) +.then(response => response) +.catch(error => error) +``` + +## Notes + +- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. +- ```getLength(cb)``` will send an error as first parameter of callback if stream length cannot be calculated (e.g. send in custom streams w/o using ```knownLength```). +- ```submit``` will not add `content-length` if form length is unknown or not calculable. +- Starting version `2.x` FormData has dropped support for `node@0.10.x`. +- Starting version `3.x` FormData has dropped support for `node@4.x`. + +## License + +Form-Data is released under the [MIT](License) license. diff --git a/node_modules/form-data/Readme.md b/node_modules/form-data/Readme.md new file mode 100644 index 00000000..298a1a24 --- /dev/null +++ b/node_modules/form-data/Readme.md @@ -0,0 +1,358 @@ +# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) + +A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. + +The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. + +[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface + +[![Linux Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=linux:6.x-12.x)](https://travis-ci.org/form-data/form-data) +[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=macos:6.x-12.x)](https://travis-ci.org/form-data/form-data) +[![Windows Build](https://img.shields.io/travis/form-data/form-data/v4.0.0.svg?label=windows:6.x-12.x)](https://travis-ci.org/form-data/form-data) + +[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v4.0.0.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) +[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) + +## Install + +``` +npm install --save form-data +``` + +## Usage + +In this example we are constructing a form with 3 fields that contain a string, +a buffer and a file stream. + +``` javascript +var FormData = require('form-data'); +var fs = require('fs'); + +var form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); +``` + +Also you can use http-response stream: + +``` javascript +var FormData = require('form-data'); +var http = require('http'); + +var form = new FormData(); + +http.request('http://nodejs.org/images/logo.png', function(response) { + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_logo', response); +}); +``` + +Or @mikeal's [request](https://github.com/request/request) stream: + +``` javascript +var FormData = require('form-data'); +var request = require('request'); + +var form = new FormData(); + +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_logo', request('http://nodejs.org/images/logo.png')); +``` + +In order to submit this form to a web application, call ```submit(url, [callback])``` method: + +``` javascript +form.submit('http://example.org/', function(err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +}); + +``` + +For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. + +### Custom options + +You can provide custom options, such as `maxDataSize`: + +``` javascript +var FormData = require('form-data'); + +var form = new FormData({ maxDataSize: 20971520 }); +form.append('my_field', 'my value'); +form.append('my_buffer', /* something big */); +``` + +List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15) + +### Alternative submission methods + +You can use node's http client interface: + +``` javascript +var http = require('http'); + +var request = http.request({ + method: 'post', + host: 'example.org', + path: '/upload', + headers: form.getHeaders() +}); + +form.pipe(request); + +request.on('response', function(res) { + console.log(res.statusCode); +}); +``` + +Or if you would prefer the `'Content-Length'` header to be set for you: + +``` javascript +form.submit('example.org/upload', function(err, res) { + console.log(res.statusCode); +}); +``` + +To use custom headers and pre-known length in parts: + +``` javascript +var CRLF = '\r\n'; +var form = new FormData(); + +var options = { + header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, + knownLength: 1 +}; + +form.append('my_buffer', buffer, options); + +form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); +}); +``` + +Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: + +``` javascript +someModule.stream(function(err, stdout, stderr) { + if (err) throw err; + + var form = new FormData(); + + form.append('file', stdout, { + filename: 'unicycle.jpg', // ... or: + filepath: 'photos/toys/unicycle.jpg', + contentType: 'image/jpeg', + knownLength: 19806 + }); + + form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); + }); +}); +``` + +The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory). + +For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: + +``` javascript +form.submit({ + host: 'example.com', + path: '/probably.php?extra=params', + auth: 'username:password' +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`: + +``` javascript +form.submit({ + host: 'example.com', + path: '/surelynot.php', + headers: {'x-test-header': 'test-header-value'} +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +### Methods + +- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-). +- [_Headers_ getHeaders( [**Headers** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-) +- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary) +- [_Void_ setBoundary()](https://github.com/form-data/form-data#void-setboundary) +- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer) +- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync) +- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-) +- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength) +- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-) +- [_String_ toString()](https://github.com/form-data/form-data#string-tostring) + +#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] ) +Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user. +```javascript +var form = new FormData(); +form.append( 'my_string', 'my value' ); +form.append( 'my_integer', 1 ); +form.append( 'my_boolean', true ); +form.append( 'my_buffer', new Buffer(10) ); +form.append( 'my_array_as_json', JSON.stringify( ['bird','cute'] ) ) +``` + +You may provide a string for options, or an object. +```javascript +// Set filename by providing a string for options +form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg' ); + +// provide an object. +form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), {filename: 'bar.jpg', contentType: 'image/jpeg', knownLength: 19806} ); +``` + +#### _Headers_ getHeaders( [**Headers** _userHeaders_] ) +This method adds the correct `content-type` header to the provided array of `userHeaders`. + +#### _String_ getBoundary() +Return the boundary of the formData. By default, the boundary consists of 26 `-` followed by 24 numbers +for example: +```javascript +--------------------------515890814546601021194782 +``` + +#### _Void_ setBoundary(String _boundary_) +Set the boundary string, overriding the default behavior described above. + +_Note: The boundary must be unique and may not appear in the data._ + +#### _Buffer_ getBuffer() +Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data. +```javascript +var form = new FormData(); +form.append( 'my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73]) ); +form.append( 'my_file', fs.readFileSync('/foo/bar.jpg') ); + +axios.post( 'https://example.com/path/to/api', + form.getBuffer(), + form.getHeaders() + ) +``` +**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error. + +#### _Integer_ getLengthSync() +Same as `getLength` but synchronous. + +_Note: getLengthSync __doesn't__ calculate streams length._ + +#### _Integer_ getLength( **function** _callback_ ) +Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated +```javascript +this.getLength(function(err, length) { + if (err) { + this._error(err); + return; + } + + // add content length + request.setHeader('Content-Length', length); + + ... +}.bind(this)); +``` + +#### _Boolean_ hasKnownLength() +Checks if the length of added values is known. + +#### _Request_ submit( _params_, **function** _callback_ ) +Submit the form to a web application. +```javascript +var form = new FormData(); +form.append( 'my_string', 'Hello World' ); + +form.submit( 'http://example.com/', function(err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +} ); +``` + +#### _String_ toString() +Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead. + +### Integration with other libraries + +#### Request + +Form submission using [request](https://github.com/request/request): + +```javascript +var formData = { + my_field: 'my_value', + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), +}; + +request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads). + +#### node-fetch + +You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch): + +```javascript +var form = new FormData(); + +form.append('a', 1); + +fetch('http://example.com', { method: 'POST', body: form }) + .then(function(res) { + return res.json(); + }).then(function(json) { + console.log(json); + }); +``` + +#### axios + +In Node.js you can post a file using [axios](https://github.com/axios/axios): +```javascript +const form = new FormData(); +const stream = fs.createReadStream(PATH_TO_FILE); + +form.append('image', stream); + +// In Node.js environment you need to set boundary in the header field 'Content-Type' by calling method `getHeaders` +const formHeaders = form.getHeaders(); + +axios.post('http://example.com', form, { + headers: { + ...formHeaders, + }, +}) +.then(response => response) +.catch(error => error) +``` + +## Notes + +- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. +- ```getLength(cb)``` will send an error as first parameter of callback if stream length cannot be calculated (e.g. send in custom streams w/o using ```knownLength```). +- ```submit``` will not add `content-length` if form length is unknown or not calculable. +- Starting version `2.x` FormData has dropped support for `node@0.10.x`. +- Starting version `3.x` FormData has dropped support for `node@4.x`. + +## License + +Form-Data is released under the [MIT](License) license. diff --git a/node_modules/form-data/index.d.ts b/node_modules/form-data/index.d.ts new file mode 100644 index 00000000..295e9e9b --- /dev/null +++ b/node_modules/form-data/index.d.ts @@ -0,0 +1,62 @@ +// Definitions by: Carlos Ballesteros Velasco +// Leon Yu +// BendingBender +// Maple Miao + +/// +import * as stream from 'stream'; +import * as http from 'http'; + +export = FormData; + +// Extracted because @types/node doesn't export interfaces. +interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + read?(this: stream.Readable, size: number): void; + destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void; + autoDestroy?: boolean; +} + +interface Options extends ReadableOptions { + writable?: boolean; + readable?: boolean; + dataSize?: number; + maxDataSize?: number; + pauseStreams?: boolean; +} + +declare class FormData extends stream.Readable { + constructor(options?: Options); + append(key: string, value: any, options?: FormData.AppendOptions | string): void; + getHeaders(userHeaders?: FormData.Headers): FormData.Headers; + submit( + params: string | FormData.SubmitOptions, + callback?: (error: Error | null, response: http.IncomingMessage) => void + ): http.ClientRequest; + getBuffer(): Buffer; + setBoundary(boundary: string): void; + getBoundary(): string; + getLength(callback: (err: Error | null, length: number) => void): void; + getLengthSync(): number; + hasKnownLength(): boolean; +} + +declare namespace FormData { + interface Headers { + [key: string]: any; + } + + interface AppendOptions { + header?: string | Headers; + knownLength?: number; + filename?: string; + filepath?: string; + contentType?: string; + } + + interface SubmitOptions extends http.RequestOptions { + protocol?: 'https:' | 'http:'; + } +} diff --git a/node_modules/form-data/lib/browser.js b/node_modules/form-data/lib/browser.js new file mode 100644 index 00000000..09e7c70e --- /dev/null +++ b/node_modules/form-data/lib/browser.js @@ -0,0 +1,2 @@ +/* eslint-env browser */ +module.exports = typeof self == 'object' ? self.FormData : window.FormData; diff --git a/node_modules/form-data/lib/form_data.js b/node_modules/form-data/lib/form_data.js new file mode 100644 index 00000000..18dc819c --- /dev/null +++ b/node_modules/form-data/lib/form_data.js @@ -0,0 +1,501 @@ +var CombinedStream = require('combined-stream'); +var util = require('util'); +var path = require('path'); +var http = require('http'); +var https = require('https'); +var parseUrl = require('url').parse; +var fs = require('fs'); +var Stream = require('stream').Stream; +var mime = require('mime-types'); +var asynckit = require('asynckit'); +var populate = require('./populate.js'); + +// Public API +module.exports = FormData; + +// make it a Stream +util.inherits(FormData, CombinedStream); + +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream + */ +function FormData(options) { + if (!(this instanceof FormData)) { + return new FormData(options); + } + + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; + + CombinedStream.call(this); + + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } +} + +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; + +FormData.prototype.append = function(field, value, options) { + + options = options || {}; + + // allow filename as single option + if (typeof options == 'string') { + options = {filename: options}; + } + + var append = CombinedStream.prototype.append.bind(this); + + // all that streamy business can't handle numbers + if (typeof value == 'number') { + value = '' + value; + } + + // https://github.com/felixge/node-form-data/issues/38 + if (util.isArray(value)) { + // Please convert your array into string + // the way web server expects it + this._error(new Error('Arrays are not supported.')); + return; + } + + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); + + append(header); + append(value); + append(footer); + + // pass along options.knownLength + this._trackLength(header, value, options); +}; + +FormData.prototype._trackLength = function(header, value, options) { + var valueLength = 0; + + // used w/ getLengthSync(), when length is known. + // e.g. for streaming directly from a remote server, + // w/ a known file a size, and not wanting to wait for + // incoming file to finish to get its size. + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); + } + + this._valueLength += valueLength; + + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += + Buffer.byteLength(header) + + FormData.LINE_BREAK.length; + + // empty or either doesn't have path or not an http response or not a stream + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { + return; + } + + // no need to bother with the length + if (!options.knownLength) { + this._valuesToMeasure.push(value); + } +}; + +FormData.prototype._lengthRetriever = function(value, callback) { + + if (value.hasOwnProperty('fd')) { + + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { + + // when end specified + // no need to calculate range + // inclusive, starts with 0 + callback(null, value.end + 1 - (value.start ? value.start : 0)); + + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function(err, stat) { + + var fileSize; + + if (err) { + callback(err); + return; + } + + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); + } + + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + callback(null, +value.headers['content-length']); + + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + callback(null, +response.headers['content-length']); + }); + value.resume(); + + // something else + } else { + callback('Unknown stream'); + } +}; + +FormData.prototype._multiPartHeader = function(field, value, options) { + // custom header specified (as string)? + // it becomes responsible for boundary + // (e.g. to handle extra CRLFs on .NET servers) + if (typeof options.header == 'string') { + return options.header; + } + + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); + + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; + + // allow custom headers. + if (typeof options.header == 'object') { + populate(headers, options.header); + } + + var header; + for (var prop in headers) { + if (!headers.hasOwnProperty(prop)) continue; + header = headers[prop]; + + // skip nullish headers. + if (header == null) { + continue; + } + + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; + } + + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + } + } + + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; + +FormData.prototype._getContentDisposition = function(value, options) { + + var filename + , contentDisposition + ; + + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || value.name || value.path) { + // custom filename take precedence + // formidable and the browser add a name property + // fs- and request- streams have path property + filename = path.basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path || ''); + } + + if (filename) { + contentDisposition = 'filename="' + filename + '"'; + } + + return contentDisposition; +}; + +FormData.prototype._getContentType = function(value, options) { + + // use custom content-type above all + var contentType = options.contentType; + + // or try `name` from formidable, browser + if (!contentType && value.name) { + contentType = mime.lookup(value.name); + } + + // or try `path` from fs-, request- streams + if (!contentType && value.path) { + contentType = mime.lookup(value.path); + } + + // or if it's http-reponse + if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { + contentType = value.headers['content-type']; + } + + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } + + // fallback to the default content type if `value` is not simple value + if (!contentType && typeof value == 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } + + return contentType; +}; + +FormData.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData.LINE_BREAK; + + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); + } + + next(footer); + }.bind(this); +}; + +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; + +FormData.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; + + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } + + return formHeaders; +}; + +FormData.prototype.setBoundary = function(boundary) { + this._boundary = boundary; +}; + +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } + + return this._boundary; +}; + +FormData.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc( 0 ); + var boundary = this.getBoundary(); + + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { + + // Add content to the buffer. + if(Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); + }else { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); + } + + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); + } + } + } + + // Add the footer and return the Buffer object. + return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); +}; + +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } + + this._boundary = boundary; +}; + +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; + + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + // Some async length retrievers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } + + return knownLength; +}; + +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function() { + var hasKnownLength = true; + + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } + + return hasKnownLength; +}; + +FormData.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } + + values.forEach(function(length) { + knownLength += length; + }); + + cb(null, knownLength); + }); +}; + +FormData.prototype.submit = function(params, cb) { + var request + , options + , defaults = {method: 'post'} + ; + + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { + + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + + // use custom params + } else { + + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; + } + } + + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); + + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } + + // get content length and fire away + this.getLength(function(err, length) { + if (err && err !== 'Unknown stream') { + this._error(err); + return; + } + + // add content length + if (length) { + request.setHeader('Content-Length', length); + } + + this.pipe(request); + if (cb) { + var onResponse; + + var callback = function (error, responce) { + request.removeListener('error', callback); + request.removeListener('response', onResponse); + + return cb.call(this, error, responce); + }; + + onResponse = callback.bind(this, null); + + request.on('error', callback); + request.on('response', onResponse); + } + }.bind(this)); + + return request; +}; + +FormData.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; + +FormData.prototype.toString = function () { + return '[object FormData]'; +}; diff --git a/node_modules/form-data/lib/populate.js b/node_modules/form-data/lib/populate.js new file mode 100644 index 00000000..4d35738d --- /dev/null +++ b/node_modules/form-data/lib/populate.js @@ -0,0 +1,10 @@ +// populates missing values +module.exports = function(dst, src) { + + Object.keys(src).forEach(function(prop) + { + dst[prop] = dst[prop] || src[prop]; + }); + + return dst; +}; diff --git a/node_modules/form-data/package.json b/node_modules/form-data/package.json new file mode 100644 index 00000000..0f20240b --- /dev/null +++ b/node_modules/form-data/package.json @@ -0,0 +1,68 @@ +{ + "author": "Felix Geisendörfer (http://debuggable.com/)", + "name": "form-data", + "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", + "version": "4.0.0", + "repository": { + "type": "git", + "url": "git://github.com/form-data/form-data.git" + }, + "main": "./lib/form_data", + "browser": "./lib/browser", + "typings": "./index.d.ts", + "scripts": { + "pretest": "rimraf coverage test/tmp", + "test": "istanbul cover test/run.js", + "posttest": "istanbul report lcov text", + "lint": "eslint lib/*.js test/*.js test/integration/*.js", + "report": "istanbul report lcov text", + "ci-lint": "is-node-modern 8 && npm run lint || is-node-not-modern 8", + "ci-test": "npm run test && npm run browser && npm run report", + "predebug": "rimraf coverage test/tmp", + "debug": "verbose=1 ./test/run.js", + "browser": "browserify -t browserify-istanbul test/run-browser.js | obake --coverage", + "check": "istanbul check-coverage coverage/coverage*.json", + "files": "pkgfiles --sort=name", + "get-version": "node -e \"console.log(require('./package.json').version)\"", + "update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md", + "restore-readme": "mv README.md.bak README.md", + "prepublish": "in-publish && npm run update-readme || not-in-publish", + "postpublish": "npm run restore-readme" + }, + "pre-commit": [ + "lint", + "ci-test", + "check" + ], + "engines": { + "node": ">= 6" + }, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "devDependencies": { + "@types/node": "^12.0.10", + "browserify": "^13.1.1", + "browserify-istanbul": "^2.0.0", + "coveralls": "^3.0.4", + "cross-spawn": "^6.0.5", + "eslint": "^6.0.1", + "fake": "^0.2.2", + "far": "^0.0.7", + "formidable": "^1.0.17", + "in-publish": "^2.0.0", + "is-node-modern": "^1.0.0", + "istanbul": "^0.4.5", + "obake": "^0.1.2", + "puppeteer": "^1.19.0", + "pkgfiles": "^2.3.0", + "pre-commit": "^1.1.3", + "request": "^2.88.0", + "rimraf": "^2.7.1", + "tape": "^4.6.2", + "typescript": "^3.5.2" + }, + "license": "MIT" +} diff --git a/node_modules/fs-minipass/LICENSE b/node_modules/fs-minipass/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/fs-minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fs-minipass/README.md b/node_modules/fs-minipass/README.md new file mode 100644 index 00000000..1e61241c --- /dev/null +++ b/node_modules/fs-minipass/README.md @@ -0,0 +1,70 @@ +# fs-minipass + +Filesystem streams based on [minipass](http://npm.im/minipass). + +4 classes are exported: + +- ReadStream +- ReadStreamSync +- WriteStream +- WriteStreamSync + +When using `ReadStreamSync`, all of the data is made available +immediately upon consuming the stream. Nothing is buffered in memory +when the stream is constructed. If the stream is piped to a writer, +then it will synchronously `read()` and emit data into the writer as +fast as the writer can consume it. (That is, it will respect +backpressure.) If you call `stream.read()` then it will read the +entire file and return the contents. + +When using `WriteStreamSync`, every write is flushed to the file +synchronously. If your writes all come in a single tick, then it'll +write it all out in a single tick. It's as synchronous as you are. + +The async versions work much like their node builtin counterparts, +with the exception of introducing significantly less Stream machinery +overhead. + +## USAGE + +It's just streams, you pipe them or read() them or write() to them. + +```js +const fsm = require('fs-minipass') +const readStream = new fsm.ReadStream('file.txt') +const writeStream = new fsm.WriteStream('output.txt') +writeStream.write('some file header or whatever\n') +readStream.pipe(writeStream) +``` + +## ReadStream(path, options) + +Path string is required, but somewhat irrelevant if an open file +descriptor is passed in as an option. + +Options: + +- `fd` Pass in a numeric file descriptor, if the file is already open. +- `readSize` The size of reads to do, defaults to 16MB +- `size` The size of the file, if known. Prevents zero-byte read() + call at the end. +- `autoClose` Set to `false` to prevent the file descriptor from being + closed when the file is done being read. + +## WriteStream(path, options) + +Path string is required, but somewhat irrelevant if an open file +descriptor is passed in as an option. + +Options: + +- `fd` Pass in a numeric file descriptor, if the file is already open. +- `mode` The mode to create the file with. Defaults to `0o666`. +- `start` The position in the file to start reading. If not + specified, then the file will start writing at position zero, and be + truncated by default. +- `autoClose` Set to `false` to prevent the file descriptor from being + closed when the stream is ended. +- `flags` Flags to use when opening the file. Irrelevant if `fd` is + passed in, since file won't be opened in that case. Defaults to + `'a'` if a `pos` is specified, or `'w'` otherwise. diff --git a/node_modules/fs-minipass/index.js b/node_modules/fs-minipass/index.js new file mode 100644 index 00000000..9b0779c8 --- /dev/null +++ b/node_modules/fs-minipass/index.js @@ -0,0 +1,422 @@ +'use strict' +const MiniPass = require('minipass') +const EE = require('events').EventEmitter +const fs = require('fs') + +let writev = fs.writev +/* istanbul ignore next */ +if (!writev) { + // This entire block can be removed if support for earlier than Node.js + // 12.9.0 is not needed. + const binding = process.binding('fs') + const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback + + writev = (fd, iovec, pos, cb) => { + const done = (er, bw) => cb(er, bw, iovec) + const req = new FSReqWrap() + req.oncomplete = done + binding.writeBuffers(fd, iovec, pos, req) + } +} + +const _autoClose = Symbol('_autoClose') +const _close = Symbol('_close') +const _ended = Symbol('_ended') +const _fd = Symbol('_fd') +const _finished = Symbol('_finished') +const _flags = Symbol('_flags') +const _flush = Symbol('_flush') +const _handleChunk = Symbol('_handleChunk') +const _makeBuf = Symbol('_makeBuf') +const _mode = Symbol('_mode') +const _needDrain = Symbol('_needDrain') +const _onerror = Symbol('_onerror') +const _onopen = Symbol('_onopen') +const _onread = Symbol('_onread') +const _onwrite = Symbol('_onwrite') +const _open = Symbol('_open') +const _path = Symbol('_path') +const _pos = Symbol('_pos') +const _queue = Symbol('_queue') +const _read = Symbol('_read') +const _readSize = Symbol('_readSize') +const _reading = Symbol('_reading') +const _remain = Symbol('_remain') +const _size = Symbol('_size') +const _write = Symbol('_write') +const _writing = Symbol('_writing') +const _defaultFlag = Symbol('_defaultFlag') +const _errored = Symbol('_errored') + +class ReadStream extends MiniPass { + constructor (path, opt) { + opt = opt || {} + super(opt) + + this.readable = true + this.writable = false + + if (typeof path !== 'string') + throw new TypeError('path must be a string') + + this[_errored] = false + this[_fd] = typeof opt.fd === 'number' ? opt.fd : null + this[_path] = path + this[_readSize] = opt.readSize || 16*1024*1024 + this[_reading] = false + this[_size] = typeof opt.size === 'number' ? opt.size : Infinity + this[_remain] = this[_size] + this[_autoClose] = typeof opt.autoClose === 'boolean' ? + opt.autoClose : true + + if (typeof this[_fd] === 'number') + this[_read]() + else + this[_open]() + } + + get fd () { return this[_fd] } + get path () { return this[_path] } + + write () { + throw new TypeError('this is a readable stream') + } + + end () { + throw new TypeError('this is a readable stream') + } + + [_open] () { + fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd)) + } + + [_onopen] (er, fd) { + if (er) + this[_onerror](er) + else { + this[_fd] = fd + this.emit('open', fd) + this[_read]() + } + } + + [_makeBuf] () { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])) + } + + [_read] () { + if (!this[_reading]) { + this[_reading] = true + const buf = this[_makeBuf]() + /* istanbul ignore if */ + if (buf.length === 0) + return process.nextTick(() => this[_onread](null, 0, buf)) + fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) => + this[_onread](er, br, buf)) + } + } + + [_onread] (er, br, buf) { + this[_reading] = false + if (er) + this[_onerror](er) + else if (this[_handleChunk](br, buf)) + this[_read]() + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) + } + } + + [_onerror] (er) { + this[_reading] = true + this[_close]() + this.emit('error', er) + } + + [_handleChunk] (br, buf) { + let ret = false + // no effect if infinite + this[_remain] -= br + if (br > 0) + ret = super.write(br < buf.length ? buf.slice(0, br) : buf) + + if (br === 0 || this[_remain] <= 0) { + ret = false + this[_close]() + super.end() + } + + return ret + } + + emit (ev, data) { + switch (ev) { + case 'prefinish': + case 'finish': + break + + case 'drain': + if (typeof this[_fd] === 'number') + this[_read]() + break + + case 'error': + if (this[_errored]) + return + this[_errored] = true + return super.emit(ev, data) + + default: + return super.emit(ev, data) + } + } +} + +class ReadStreamSync extends ReadStream { + [_open] () { + let threw = true + try { + this[_onopen](null, fs.openSync(this[_path], 'r')) + threw = false + } finally { + if (threw) + this[_close]() + } + } + + [_read] () { + let threw = true + try { + if (!this[_reading]) { + this[_reading] = true + do { + const buf = this[_makeBuf]() + /* istanbul ignore next */ + const br = buf.length === 0 ? 0 + : fs.readSync(this[_fd], buf, 0, buf.length, null) + if (!this[_handleChunk](br, buf)) + break + } while (true) + this[_reading] = false + } + threw = false + } finally { + if (threw) + this[_close]() + } + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.closeSync(fd) + this.emit('close') + } + } +} + +class WriteStream extends EE { + constructor (path, opt) { + opt = opt || {} + super(opt) + this.readable = false + this.writable = true + this[_errored] = false + this[_writing] = false + this[_ended] = false + this[_needDrain] = false + this[_queue] = [] + this[_path] = path + this[_fd] = typeof opt.fd === 'number' ? opt.fd : null + this[_mode] = opt.mode === undefined ? 0o666 : opt.mode + this[_pos] = typeof opt.start === 'number' ? opt.start : null + this[_autoClose] = typeof opt.autoClose === 'boolean' ? + opt.autoClose : true + + // truncating makes no sense when writing into the middle + const defaultFlag = this[_pos] !== null ? 'r+' : 'w' + this[_defaultFlag] = opt.flags === undefined + this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags + + if (this[_fd] === null) + this[_open]() + } + + emit (ev, data) { + if (ev === 'error') { + if (this[_errored]) + return + this[_errored] = true + } + return super.emit(ev, data) + } + + + get fd () { return this[_fd] } + get path () { return this[_path] } + + [_onerror] (er) { + this[_close]() + this[_writing] = true + this.emit('error', er) + } + + [_open] () { + fs.open(this[_path], this[_flags], this[_mode], + (er, fd) => this[_onopen](er, fd)) + } + + [_onopen] (er, fd) { + if (this[_defaultFlag] && + this[_flags] === 'r+' && + er && er.code === 'ENOENT') { + this[_flags] = 'w' + this[_open]() + } else if (er) + this[_onerror](er) + else { + this[_fd] = fd + this.emit('open', fd) + this[_flush]() + } + } + + end (buf, enc) { + if (buf) + this.write(buf, enc) + + this[_ended] = true + + // synthetic after-write logic, where drain/finish live + if (!this[_writing] && !this[_queue].length && + typeof this[_fd] === 'number') + this[_onwrite](null, 0) + return this + } + + write (buf, enc) { + if (typeof buf === 'string') + buf = Buffer.from(buf, enc) + + if (this[_ended]) { + this.emit('error', new Error('write() after end()')) + return false + } + + if (this[_fd] === null || this[_writing] || this[_queue].length) { + this[_queue].push(buf) + this[_needDrain] = true + return false + } + + this[_writing] = true + this[_write](buf) + return true + } + + [_write] (buf) { + fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => + this[_onwrite](er, bw)) + } + + [_onwrite] (er, bw) { + if (er) + this[_onerror](er) + else { + if (this[_pos] !== null) + this[_pos] += bw + if (this[_queue].length) + this[_flush]() + else { + this[_writing] = false + + if (this[_ended] && !this[_finished]) { + this[_finished] = true + this[_close]() + this.emit('finish') + } else if (this[_needDrain]) { + this[_needDrain] = false + this.emit('drain') + } + } + } + } + + [_flush] () { + if (this[_queue].length === 0) { + if (this[_ended]) + this[_onwrite](null, 0) + } else if (this[_queue].length === 1) + this[_write](this[_queue].pop()) + else { + const iovec = this[_queue] + this[_queue] = [] + writev(this[_fd], iovec, this[_pos], + (er, bw) => this[_onwrite](er, bw)) + } + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) + } + } +} + +class WriteStreamSync extends WriteStream { + [_open] () { + let fd + // only wrap in a try{} block if we know we'll retry, to avoid + // the rethrow obscuring the error's source frame in most cases. + if (this[_defaultFlag] && this[_flags] === 'r+') { + try { + fd = fs.openSync(this[_path], this[_flags], this[_mode]) + } catch (er) { + if (er.code === 'ENOENT') { + this[_flags] = 'w' + return this[_open]() + } else + throw er + } + } else + fd = fs.openSync(this[_path], this[_flags], this[_mode]) + + this[_onopen](null, fd) + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.closeSync(fd) + this.emit('close') + } + } + + [_write] (buf) { + // throw the original, but try to close if it fails + let threw = true + try { + this[_onwrite](null, + fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos])) + threw = false + } finally { + if (threw) + try { this[_close]() } catch (_) {} + } + } +} + +exports.ReadStream = ReadStream +exports.ReadStreamSync = ReadStreamSync + +exports.WriteStream = WriteStream +exports.WriteStreamSync = WriteStreamSync diff --git a/node_modules/fs-minipass/node_modules/minipass/LICENSE b/node_modules/fs-minipass/node_modules/minipass/LICENSE new file mode 100644 index 00000000..bf1dece2 --- /dev/null +++ b/node_modules/fs-minipass/node_modules/minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2017-2022 npm, Inc., Isaac Z. Schlueter, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fs-minipass/node_modules/minipass/README.md b/node_modules/fs-minipass/node_modules/minipass/README.md new file mode 100644 index 00000000..2cde46c3 --- /dev/null +++ b/node_modules/fs-minipass/node_modules/minipass/README.md @@ -0,0 +1,728 @@ +# minipass + +A _very_ minimal implementation of a [PassThrough +stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) + +[It's very +fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) +for objects, strings, and buffers. + +Supports `pipe()`ing (including multi-`pipe()` and backpressure transmission), +buffering data until either a `data` event handler or `pipe()` is added (so +you don't lose the first chunk), and most other cases where PassThrough is +a good idea. + +There is a `read()` method, but it's much more efficient to consume data +from this stream via `'data'` events or by calling `pipe()` into some other +stream. Calling `read()` requires the buffer to be flattened in some +cases, which requires copying memory. + +If you set `objectMode: true` in the options, then whatever is written will +be emitted. Otherwise, it'll do a minimal amount of Buffer copying to +ensure proper Streams semantics when `read(n)` is called. + +`objectMode` can also be set by doing `stream.objectMode = true`, or by +writing any non-string/non-buffer data. `objectMode` cannot be set to +false once it is set. + +This is not a `through` or `through2` stream. It doesn't transform the +data, it just passes it right through. If you want to transform the data, +extend the class, and override the `write()` method. Once you're done +transforming the data however you want, call `super.write()` with the +transform output. + +For some examples of streams that extend Minipass in various ways, check +out: + +- [minizlib](http://npm.im/minizlib) +- [fs-minipass](http://npm.im/fs-minipass) +- [tar](http://npm.im/tar) +- [minipass-collect](http://npm.im/minipass-collect) +- [minipass-flush](http://npm.im/minipass-flush) +- [minipass-pipeline](http://npm.im/minipass-pipeline) +- [tap](http://npm.im/tap) +- [tap-parser](http://npm.im/tap-parser) +- [treport](http://npm.im/treport) +- [minipass-fetch](http://npm.im/minipass-fetch) +- [pacote](http://npm.im/pacote) +- [make-fetch-happen](http://npm.im/make-fetch-happen) +- [cacache](http://npm.im/cacache) +- [ssri](http://npm.im/ssri) +- [npm-registry-fetch](http://npm.im/npm-registry-fetch) +- [minipass-json-stream](http://npm.im/minipass-json-stream) +- [minipass-sized](http://npm.im/minipass-sized) + +## Differences from Node.js Streams + +There are several things that make Minipass streams different from (and in +some ways superior to) Node.js core streams. + +Please read these caveats if you are familiar with node-core streams and +intend to use Minipass streams in your programs. + +You can avoid most of these differences entirely (for a very +small performance penalty) by setting `{async: true}` in the +constructor options. + +### Timing + +Minipass streams are designed to support synchronous use-cases. Thus, data +is emitted as soon as it is available, always. It is buffered until read, +but no longer. Another way to look at it is that Minipass streams are +exactly as synchronous as the logic that writes into them. + +This can be surprising if your code relies on `PassThrough.write()` always +providing data on the next tick rather than the current one, or being able +to call `resume()` and not have the entire buffer disappear immediately. + +However, without this synchronicity guarantee, there would be no way for +Minipass to achieve the speeds it does, or support the synchronous use +cases that it does. Simply put, waiting takes time. + +This non-deferring approach makes Minipass streams much easier to reason +about, especially in the context of Promises and other flow-control +mechanisms. + +Example: + +```js +const Minipass = require('minipass') +const stream = new Minipass({ async: true }) +stream.on('data', () => console.log('data event')) +console.log('before write') +stream.write('hello') +console.log('after write') +// output: +// before write +// data event +// after write +``` + +### Exception: Async Opt-In + +If you wish to have a Minipass stream with behavior that more +closely mimics Node.js core streams, you can set the stream in +async mode either by setting `async: true` in the constructor +options, or by setting `stream.async = true` later on. + +```js +const Minipass = require('minipass') +const asyncStream = new Minipass({ async: true }) +asyncStream.on('data', () => console.log('data event')) +console.log('before write') +asyncStream.write('hello') +console.log('after write') +// output: +// before write +// after write +// data event <-- this is deferred until the next tick +``` + +Switching _out_ of async mode is unsafe, as it could cause data +corruption, and so is not enabled. Example: + +```js +const Minipass = require('minipass') +const stream = new Minipass({ encoding: 'utf8' }) +stream.on('data', chunk => console.log(chunk)) +stream.async = true +console.log('before writes') +stream.write('hello') +setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist! +stream.write('world') +console.log('after writes') +// hypothetical output would be: +// before writes +// world +// after writes +// hello +// NOT GOOD! +``` + +To avoid this problem, once set into async mode, any attempt to +make the stream sync again will be ignored. + +```js +const Minipass = require('minipass') +const stream = new Minipass({ encoding: 'utf8' }) +stream.on('data', chunk => console.log(chunk)) +stream.async = true +console.log('before writes') +stream.write('hello') +stream.async = false // <-- no-op, stream already async +stream.write('world') +console.log('after writes') +// actual output: +// before writes +// after writes +// hello +// world +``` + +### No High/Low Water Marks + +Node.js core streams will optimistically fill up a buffer, returning `true` +on all writes until the limit is hit, even if the data has nowhere to go. +Then, they will not attempt to draw more data in until the buffer size dips +below a minimum value. + +Minipass streams are much simpler. The `write()` method will return `true` +if the data has somewhere to go (which is to say, given the timing +guarantees, that the data is already there by the time `write()` returns). + +If the data has nowhere to go, then `write()` returns false, and the data +sits in a buffer, to be drained out immediately as soon as anyone consumes +it. + +Since nothing is ever buffered unnecessarily, there is much less +copying data, and less bookkeeping about buffer capacity levels. + +### Hazards of Buffering (or: Why Minipass Is So Fast) + +Since data written to a Minipass stream is immediately written all the way +through the pipeline, and `write()` always returns true/false based on +whether the data was fully flushed, backpressure is communicated +immediately to the upstream caller. This minimizes buffering. + +Consider this case: + +```js +const {PassThrough} = require('stream') +const p1 = new PassThrough({ highWaterMark: 1024 }) +const p2 = new PassThrough({ highWaterMark: 1024 }) +const p3 = new PassThrough({ highWaterMark: 1024 }) +const p4 = new PassThrough({ highWaterMark: 1024 }) + +p1.pipe(p2).pipe(p3).pipe(p4) +p4.on('data', () => console.log('made it through')) + +// this returns false and buffers, then writes to p2 on next tick (1) +// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) +// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) +// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' +// on next tick (4) +// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and +// 'drain' on next tick (5) +// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) +// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next +// tick (7) + +p1.write(Buffer.alloc(2048)) // returns false +``` + +Along the way, the data was buffered and deferred at each stage, and +multiple event deferrals happened, for an unblocked pipeline where it was +perfectly safe to write all the way through! + +Furthermore, setting a `highWaterMark` of `1024` might lead someone reading +the code to think an advisory maximum of 1KiB is being set for the +pipeline. However, the actual advisory buffering level is the _sum_ of +`highWaterMark` values, since each one has its own bucket. + +Consider the Minipass case: + +```js +const m1 = new Minipass() +const m2 = new Minipass() +const m3 = new Minipass() +const m4 = new Minipass() + +m1.pipe(m2).pipe(m3).pipe(m4) +m4.on('data', () => console.log('made it through')) + +// m1 is flowing, so it writes the data to m2 immediately +// m2 is flowing, so it writes the data to m3 immediately +// m3 is flowing, so it writes the data to m4 immediately +// m4 is flowing, so it fires the 'data' event immediately, returns true +// m4's write returned true, so m3 is still flowing, returns true +// m3's write returned true, so m2 is still flowing, returns true +// m2's write returned true, so m1 is still flowing, returns true +// No event deferrals or buffering along the way! + +m1.write(Buffer.alloc(2048)) // returns true +``` + +It is extremely unlikely that you _don't_ want to buffer any data written, +or _ever_ buffer data that can be flushed all the way through. Neither +node-core streams nor Minipass ever fail to buffer written data, but +node-core streams do a lot of unnecessary buffering and pausing. + +As always, the faster implementation is the one that does less stuff and +waits less time to do it. + +### Immediately emit `end` for empty streams (when not paused) + +If a stream is not paused, and `end()` is called before writing any data +into it, then it will emit `end` immediately. + +If you have logic that occurs on the `end` event which you don't want to +potentially happen immediately (for example, closing file descriptors, +moving on to the next entry in an archive parse stream, etc.) then be sure +to call `stream.pause()` on creation, and then `stream.resume()` once you +are ready to respond to the `end` event. + +However, this is _usually_ not a problem because: + +### Emit `end` When Asked + +One hazard of immediately emitting `'end'` is that you may not yet have had +a chance to add a listener. In order to avoid this hazard, Minipass +streams safely re-emit the `'end'` event if a new listener is added after +`'end'` has been emitted. + +Ie, if you do `stream.on('end', someFunction)`, and the stream has already +emitted `end`, then it will call the handler right away. (You can think of +this somewhat like attaching a new `.then(fn)` to a previously-resolved +Promise.) + +To prevent calling handlers multiple times who would not expect multiple +ends to occur, all listeners are removed from the `'end'` event whenever it +is emitted. + +### Emit `error` When Asked + +The most recent error object passed to the `'error'` event is +stored on the stream. If a new `'error'` event handler is added, +and an error was previously emitted, then the event handler will +be called immediately (or on `process.nextTick` in the case of +async streams). + +This makes it much more difficult to end up trying to interact +with a broken stream, if the error handler is added after an +error was previously emitted. + +### Impact of "immediate flow" on Tee-streams + +A "tee stream" is a stream piping to multiple destinations: + +```js +const tee = new Minipass() +t.pipe(dest1) +t.pipe(dest2) +t.write('foo') // goes to both destinations +``` + +Since Minipass streams _immediately_ process any pending data through the +pipeline when a new pipe destination is added, this can have surprising +effects, especially when a stream comes in from some other function and may +or may not have data in its buffer. + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone +src.pipe(dest2) // gets nothing! +``` + +One solution is to create a dedicated tee-stream junction that pipes to +both locations, and then pipe to _that_ instead. + +```js +// Safe example: tee to both places +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.pipe(dest1) +tee.pipe(dest2) +src.pipe(tee) // tee gets 'foo', pipes to both locations +``` + +The same caveat applies to `on('data')` event listeners. The first one +added will _immediately_ receive all of the data, leaving nothing for the +second: + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.on('data', handler1) // receives 'foo' right away +src.on('data', handler2) // nothing to see here! +``` + +Using a dedicated tee-stream can be used in this case as well: + +```js +// Safe example: tee to both data handlers +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.on('data', handler1) +tee.on('data', handler2) +src.pipe(tee) +``` + +All of the hazards in this section are avoided by setting `{ +async: true }` in the Minipass constructor, or by setting +`stream.async = true` afterwards. Note that this does add some +overhead, so should only be done in cases where you are willing +to lose a bit of performance in order to avoid having to refactor +program logic. + +## USAGE + +It's a stream! Use it like a stream and it'll most likely do what you +want. + +```js +const Minipass = require('minipass') +const mp = new Minipass(options) // optional: { encoding, objectMode } +mp.write('foo') +mp.pipe(someOtherStream) +mp.end('bar') +``` + +### OPTIONS + +* `encoding` How would you like the data coming _out_ of the stream to be + encoded? Accepts any values that can be passed to `Buffer.toString()`. +* `objectMode` Emit data exactly as it comes in. This will be flipped on + by default if you write() something other than a string or Buffer at any + point. Setting `objectMode: true` will prevent setting any encoding + value. +* `async` Defaults to `false`. Set to `true` to defer data + emission until next tick. This reduces performance slightly, + but makes Minipass streams use timing behavior closer to Node + core streams. See [Timing](#timing) for more details. + +### API + +Implements the user-facing portions of Node.js's `Readable` and `Writable` +streams. + +### Methods + +* `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the + base Minipass class, the same data will come out.) Returns `false` if + the stream will buffer the next write, or true if it's still in "flowing" + mode. +* `end([chunk, [encoding]], [callback])` - Signal that you have no more + data to write. This will queue an `end` event to be fired when all the + data has been consumed. +* `setEncoding(encoding)` - Set the encoding for data coming of the stream. + This can only be done once. +* `pause()` - No more data for a while, please. This also prevents `end` + from being emitted for empty streams until the stream is resumed. +* `resume()` - Resume the stream. If there's data in the buffer, it is all + discarded. Any buffered events are immediately emitted. +* `pipe(dest)` - Send all output to the stream provided. When + data is emitted, it is immediately written to any and all pipe + destinations. (Or written on next tick in `async` mode.) +* `unpipe(dest)` - Stop piping to the destination stream. This + is immediate, meaning that any asynchronously queued data will + _not_ make it to the destination when running in `async` mode. + * `options.end` - Boolean, end the destination stream when + the source stream ends. Default `true`. + * `options.proxyErrors` - Boolean, proxy `error` events from + the source stream to the destination stream. Note that + errors are _not_ proxied after the pipeline terminates, + either due to the source emitting `'end'` or manually + unpiping with `src.unpipe(dest)`. Default `false`. +* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. Some + events are given special treatment, however. (See below under "events".) +* `promise()` - Returns a Promise that resolves when the stream emits + `end`, or rejects if the stream emits `error`. +* `collect()` - Return a Promise that resolves on `end` with an array + containing each chunk of data that was emitted, or rejects if the stream + emits `error`. Note that this consumes the stream data. +* `concat()` - Same as `collect()`, but concatenates the data into a single + Buffer object. Will reject the returned promise if the stream is in + objectMode, or if it goes into objectMode by the end of the data. +* `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not + provided, then consume all of it. If `n` bytes are not available, then + it returns null. **Note** consuming streams in this way is less + efficient, and can lead to unnecessary Buffer copying. +* `destroy([er])` - Destroy the stream. If an error is provided, then an + `'error'` event is emitted. If the stream has a `close()` method, and + has not emitted a `'close'` event yet, then `stream.close()` will be + called. Any Promises returned by `.promise()`, `.collect()` or + `.concat()` will be rejected. After being destroyed, writing to the + stream will emit an error. No more data will be emitted if the stream is + destroyed, even if it was previously buffered. + +### Properties + +* `bufferLength` Read-only. Total number of bytes buffered, or in the case + of objectMode, the total number of objects. +* `encoding` The encoding that has been set. (Setting this is equivalent + to calling `setEncoding(enc)` and has the same prohibition against + setting multiple times.) +* `flowing` Read-only. Boolean indicating whether a chunk written to the + stream will be immediately emitted. +* `emittedEnd` Read-only. Boolean indicating whether the end-ish events + (ie, `end`, `prefinish`, `finish`) have been emitted. Note that + listening on any end-ish event will immediateyl re-emit it if it has + already been emitted. +* `writable` Whether the stream is writable. Default `true`. Set to + `false` when `end()` +* `readable` Whether the stream is readable. Default `true`. +* `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written + to the stream that have not yet been emitted. (It's probably a bad idea + to mess with this.) +* `pipes` A [yallist](http://npm.im/yallist) linked list of streams that + this stream is piping into. (It's probably a bad idea to mess with + this.) +* `destroyed` A getter that indicates whether the stream was destroyed. +* `paused` True if the stream has been explicitly paused, otherwise false. +* `objectMode` Indicates whether the stream is in `objectMode`. Once set + to `true`, it cannot be set to `false`. + +### Events + +* `data` Emitted when there's data to read. Argument is the data to read. + This is never emitted while not flowing. If a listener is attached, that + will resume the stream. +* `end` Emitted when there's no more data to read. This will be emitted + immediately for empty streams when `end()` is called. If a listener is + attached, and `end` was already emitted, then it will be emitted again. + All listeners are removed when `end` is emitted. +* `prefinish` An end-ish event that follows the same logic as `end` and is + emitted in the same conditions where `end` is emitted. Emitted after + `'end'`. +* `finish` An end-ish event that follows the same logic as `end` and is + emitted in the same conditions where `end` is emitted. Emitted after + `'prefinish'`. +* `close` An indication that an underlying resource has been released. + Minipass does not emit this event, but will defer it until after `end` + has been emitted, since it throws off some stream libraries otherwise. +* `drain` Emitted when the internal buffer empties, and it is again + suitable to `write()` into the stream. +* `readable` Emitted when data is buffered and ready to be read by a + consumer. +* `resume` Emitted when stream changes state from buffering to flowing + mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event + listener is added.) + +### Static Methods + +* `Minipass.isStream(stream)` Returns `true` if the argument is a stream, + and false otherwise. To be considered a stream, the object must be + either an instance of Minipass, or an EventEmitter that has either a + `pipe()` method, or both `write()` and `end()` methods. (Pretty much any + stream in node-land will return `true` for this.) + +## EXAMPLES + +Here are some examples of things you can do with Minipass streams. + +### simple "are you done yet" promise + +```js +mp.promise().then(() => { + // stream is finished +}, er => { + // stream emitted an error +}) +``` + +### collecting + +```js +mp.collect().then(all => { + // all is an array of all the data emitted + // encoding is supported in this case, so + // so the result will be a collection of strings if + // an encoding is specified, or buffers/objects if not. + // + // In an async function, you may do + // const data = await stream.collect() +}) +``` + +### collecting into a single blob + +This is a bit slower because it concatenates the data into one chunk for +you, but if you're going to do it yourself anyway, it's convenient this +way: + +```js +mp.concat().then(onebigchunk => { + // onebigchunk is a string if the stream + // had an encoding set, or a buffer otherwise. +}) +``` + +### iteration + +You can iterate over streams synchronously or asynchronously in platforms +that support it. + +Synchronous iteration will end when the currently available data is +consumed, even if the `end` event has not been reached. In string and +buffer mode, the data is concatenated, so unless multiple writes are +occurring in the same tick as the `read()`, sync iteration loops will +generally only have a single iteration. + +To consume chunks in this way exactly as they have been written, with no +flattening, create the stream with the `{ objectMode: true }` option. + +```js +const mp = new Minipass({ objectMode: true }) +mp.write('a') +mp.write('b') +for (let letter of mp) { + console.log(letter) // a, b +} +mp.write('c') +mp.write('d') +for (let letter of mp) { + console.log(letter) // c, d +} +mp.write('e') +mp.end() +for (let letter of mp) { + console.log(letter) // e +} +for (let letter of mp) { + console.log(letter) // nothing +} +``` + +Asynchronous iteration will continue until the end event is reached, +consuming all of the data. + +```js +const mp = new Minipass({ encoding: 'utf8' }) + +// some source of some data +let i = 5 +const inter = setInterval(() => { + if (i-- > 0) + mp.write(Buffer.from('foo\n', 'utf8')) + else { + mp.end() + clearInterval(inter) + } +}, 100) + +// consume the data with asynchronous iteration +async function consume () { + for await (let chunk of mp) { + console.log(chunk) + } + return 'ok' +} + +consume().then(res => console.log(res)) +// logs `foo\n` 5 times, and then `ok` +``` + +### subclass that `console.log()`s everything written into it + +```js +class Logger extends Minipass { + write (chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end (chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } +} + +someSource.pipe(new Logger()).pipe(someDest) +``` + +### same thing, but using an inline anonymous class + +```js +// js classes are fun +someSource + .pipe(new (class extends Minipass { + emit (ev, ...data) { + // let's also log events, because debugging some weird thing + console.log('EMIT', ev) + return super.emit(ev, ...data) + } + write (chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end (chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } + })) + .pipe(someDest) +``` + +### subclass that defers 'end' for some reason + +```js +class SlowEnd extends Minipass { + emit (ev, ...args) { + if (ev === 'end') { + console.log('going to end, hold on a sec') + setTimeout(() => { + console.log('ok, ready to end now') + super.emit('end', ...args) + }, 100) + } else { + return super.emit(ev, ...args) + } + } +} +``` + +### transform that creates newline-delimited JSON + +```js +class NDJSONEncode extends Minipass { + write (obj, cb) { + try { + // JSON.stringify can throw, emit an error on that + return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) + } catch (er) { + this.emit('error', er) + } + } + end (obj, cb) { + if (typeof obj === 'function') { + cb = obj + obj = undefined + } + if (obj !== undefined) { + this.write(obj) + } + return super.end(cb) + } +} +``` + +### transform that parses newline-delimited JSON + +```js +class NDJSONDecode extends Minipass { + constructor (options) { + // always be in object mode, as far as Minipass is concerned + super({ objectMode: true }) + this._jsonBuffer = '' + } + write (chunk, encoding, cb) { + if (typeof chunk === 'string' && + typeof encoding === 'string' && + encoding !== 'utf8') { + chunk = Buffer.from(chunk, encoding).toString() + } else if (Buffer.isBuffer(chunk)) + chunk = chunk.toString() + } + if (typeof encoding === 'function') { + cb = encoding + } + const jsonData = (this._jsonBuffer + chunk).split('\n') + this._jsonBuffer = jsonData.pop() + for (let i = 0; i < jsonData.length; i++) { + try { + // JSON.parse can throw, emit an error on that + super.write(JSON.parse(jsonData[i])) + } catch (er) { + this.emit('error', er) + continue + } + } + if (cb) + cb() + } +} +``` diff --git a/node_modules/fs-minipass/node_modules/minipass/index.d.ts b/node_modules/fs-minipass/node_modules/minipass/index.d.ts new file mode 100644 index 00000000..65faf636 --- /dev/null +++ b/node_modules/fs-minipass/node_modules/minipass/index.d.ts @@ -0,0 +1,155 @@ +/// +import { EventEmitter } from 'events' +import { Stream } from 'stream' + +declare namespace Minipass { + type Encoding = BufferEncoding | 'buffer' | null + + interface Writable extends EventEmitter { + end(): any + write(chunk: any, ...args: any[]): any + } + + interface Readable extends EventEmitter { + pause(): any + resume(): any + pipe(): any + } + + interface Pipe { + src: Minipass + dest: Writable + opts: PipeOptions + } + + type DualIterable = Iterable & AsyncIterable + + type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string + + type BufferOrString = Buffer | string + + interface StringOptions { + encoding: BufferEncoding + objectMode?: boolean + async?: boolean + } + + interface BufferOptions { + encoding?: null | 'buffer' + objectMode?: boolean + async?: boolean + } + + interface ObjectModeOptions { + objectMode: true + async?: boolean + } + + interface PipeOptions { + end?: boolean + proxyErrors?: boolean + } + + type Options = T extends string + ? StringOptions + : T extends Buffer + ? BufferOptions + : ObjectModeOptions +} + +declare class Minipass< + RType extends any = Buffer, + WType extends any = RType extends Minipass.BufferOrString + ? Minipass.ContiguousData + : RType + > + extends Stream + implements Minipass.DualIterable +{ + static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable + + readonly bufferLength: number + readonly flowing: boolean + readonly writable: boolean + readonly readable: boolean + readonly paused: boolean + readonly emittedEnd: boolean + readonly destroyed: boolean + + /** + * Not technically private or readonly, but not safe to mutate. + */ + private readonly buffer: RType[] + private readonly pipes: Minipass.Pipe[] + + /** + * Technically writable, but mutating it can change the type, + * so is not safe to do in TypeScript. + */ + readonly objectMode: boolean + async: boolean + + /** + * Note: encoding is not actually read-only, and setEncoding(enc) + * exists. However, this type definition will insist that TypeScript + * programs declare the type of a Minipass stream up front, and if + * that type is string, then an encoding MUST be set in the ctor. If + * the type is Buffer, then the encoding must be missing, or set to + * 'buffer' or null. If the type is anything else, then objectMode + * must be set in the constructor options. So there is effectively + * no allowed way that a TS program can set the encoding after + * construction, as doing so will destroy any hope of type safety. + * TypeScript does not provide many options for changing the type of + * an object at run-time, which is what changing the encoding does. + */ + readonly encoding: Minipass.Encoding + // setEncoding(encoding: Encoding): void + + // Options required if not reading buffers + constructor( + ...args: RType extends Buffer + ? [] | [Minipass.Options] + : [Minipass.Options] + ) + + write(chunk: WType, cb?: () => void): boolean + write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean + read(size?: number): RType + end(cb?: () => void): this + end(chunk: any, cb?: () => void): this + end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this + pause(): void + resume(): void + promise(): Promise + collect(): Promise + + concat(): RType extends Minipass.BufferOrString ? Promise : never + destroy(er?: any): void + pipe(dest: W, opts?: Minipass.PipeOptions): W + unpipe(dest: W): void + + /** + * alias for on() + */ + addEventHandler(event: string, listener: (...args: any[]) => any): this + + on(event: string, listener: (...args: any[]) => any): this + on(event: 'data', listener: (chunk: RType) => any): this + on(event: 'error', listener: (error: any) => any): this + on( + event: + | 'readable' + | 'drain' + | 'resume' + | 'end' + | 'prefinish' + | 'finish' + | 'close', + listener: () => any + ): this + + [Symbol.iterator](): Iterator + [Symbol.asyncIterator](): AsyncIterator +} + +export = Minipass diff --git a/node_modules/fs-minipass/node_modules/minipass/index.js b/node_modules/fs-minipass/node_modules/minipass/index.js new file mode 100644 index 00000000..e8797aab --- /dev/null +++ b/node_modules/fs-minipass/node_modules/minipass/index.js @@ -0,0 +1,649 @@ +'use strict' +const proc = typeof process === 'object' && process ? process : { + stdout: null, + stderr: null, +} +const EE = require('events') +const Stream = require('stream') +const SD = require('string_decoder').StringDecoder + +const EOF = Symbol('EOF') +const MAYBE_EMIT_END = Symbol('maybeEmitEnd') +const EMITTED_END = Symbol('emittedEnd') +const EMITTING_END = Symbol('emittingEnd') +const EMITTED_ERROR = Symbol('emittedError') +const CLOSED = Symbol('closed') +const READ = Symbol('read') +const FLUSH = Symbol('flush') +const FLUSHCHUNK = Symbol('flushChunk') +const ENCODING = Symbol('encoding') +const DECODER = Symbol('decoder') +const FLOWING = Symbol('flowing') +const PAUSED = Symbol('paused') +const RESUME = Symbol('resume') +const BUFFERLENGTH = Symbol('bufferLength') +const BUFFERPUSH = Symbol('bufferPush') +const BUFFERSHIFT = Symbol('bufferShift') +const OBJECTMODE = Symbol('objectMode') +const DESTROYED = Symbol('destroyed') +const EMITDATA = Symbol('emitData') +const EMITEND = Symbol('emitEnd') +const EMITEND2 = Symbol('emitEnd2') +const ASYNC = Symbol('async') + +const defer = fn => Promise.resolve().then(fn) + +// TODO remove when Node v8 support drops +const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' +const ASYNCITERATOR = doIter && Symbol.asyncIterator + || Symbol('asyncIterator not implemented') +const ITERATOR = doIter && Symbol.iterator + || Symbol('iterator not implemented') + +// events that mean 'the stream is over' +// these are treated specially, and re-emitted +// if they are listened for after emitting. +const isEndish = ev => + ev === 'end' || + ev === 'finish' || + ev === 'prefinish' + +const isArrayBuffer = b => b instanceof ArrayBuffer || + typeof b === 'object' && + b.constructor && + b.constructor.name === 'ArrayBuffer' && + b.byteLength >= 0 + +const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) + +class Pipe { + constructor (src, dest, opts) { + this.src = src + this.dest = dest + this.opts = opts + this.ondrain = () => src[RESUME]() + dest.on('drain', this.ondrain) + } + unpipe () { + this.dest.removeListener('drain', this.ondrain) + } + // istanbul ignore next - only here for the prototype + proxyErrors () {} + end () { + this.unpipe() + if (this.opts.end) + this.dest.end() + } +} + +class PipeProxyErrors extends Pipe { + unpipe () { + this.src.removeListener('error', this.proxyErrors) + super.unpipe() + } + constructor (src, dest, opts) { + super(src, dest, opts) + this.proxyErrors = er => dest.emit('error', er) + src.on('error', this.proxyErrors) + } +} + +module.exports = class Minipass extends Stream { + constructor (options) { + super() + this[FLOWING] = false + // whether we're explicitly paused + this[PAUSED] = false + this.pipes = [] + this.buffer = [] + this[OBJECTMODE] = options && options.objectMode || false + if (this[OBJECTMODE]) + this[ENCODING] = null + else + this[ENCODING] = options && options.encoding || null + if (this[ENCODING] === 'buffer') + this[ENCODING] = null + this[ASYNC] = options && !!options.async || false + this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null + this[EOF] = false + this[EMITTED_END] = false + this[EMITTING_END] = false + this[CLOSED] = false + this[EMITTED_ERROR] = null + this.writable = true + this.readable = true + this[BUFFERLENGTH] = 0 + this[DESTROYED] = false + } + + get bufferLength () { return this[BUFFERLENGTH] } + + get encoding () { return this[ENCODING] } + set encoding (enc) { + if (this[OBJECTMODE]) + throw new Error('cannot set encoding in objectMode') + + if (this[ENCODING] && enc !== this[ENCODING] && + (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) + throw new Error('cannot change encoding') + + if (this[ENCODING] !== enc) { + this[DECODER] = enc ? new SD(enc) : null + if (this.buffer.length) + this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) + } + + this[ENCODING] = enc + } + + setEncoding (enc) { + this.encoding = enc + } + + get objectMode () { return this[OBJECTMODE] } + set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om } + + get ['async'] () { return this[ASYNC] } + set ['async'] (a) { this[ASYNC] = this[ASYNC] || !!a } + + write (chunk, encoding, cb) { + if (this[EOF]) + throw new Error('write after end') + + if (this[DESTROYED]) { + this.emit('error', Object.assign( + new Error('Cannot call write after a stream was destroyed'), + { code: 'ERR_STREAM_DESTROYED' } + )) + return true + } + + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + + if (!encoding) + encoding = 'utf8' + + const fn = this[ASYNC] ? defer : f => f() + + // convert array buffers and typed array views into buffers + // at some point in the future, we may want to do the opposite! + // leave strings and buffers as-is + // anything else switches us into object mode + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) + else if (isArrayBuffer(chunk)) + chunk = Buffer.from(chunk) + else if (typeof chunk !== 'string') + // use the setter so we throw if we have encoding set + this.objectMode = true + } + + // handle object mode up front, since it's simpler + // this yields better performance, fewer checks later. + if (this[OBJECTMODE]) { + /* istanbul ignore if - maybe impossible? */ + if (this.flowing && this[BUFFERLENGTH] !== 0) + this[FLUSH](true) + + if (this.flowing) + this.emit('data', chunk) + else + this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + + if (cb) + fn(cb) + + return this.flowing + } + + // at this point the chunk is a buffer or string + // don't buffer it up or send it to the decoder + if (!chunk.length) { + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + if (cb) + fn(cb) + return this.flowing + } + + // fast-path writing strings of same encoding to a stream with + // an empty buffer, skipping the buffer/decoder dance + if (typeof chunk === 'string' && + // unless it is a string already ready for us to use + !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { + chunk = Buffer.from(chunk, encoding) + } + + if (Buffer.isBuffer(chunk) && this[ENCODING]) + chunk = this[DECODER].write(chunk) + + // Note: flushing CAN potentially switch us into not-flowing mode + if (this.flowing && this[BUFFERLENGTH] !== 0) + this[FLUSH](true) + + if (this.flowing) + this.emit('data', chunk) + else + this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + + if (cb) + fn(cb) + + return this.flowing + } + + read (n) { + if (this[DESTROYED]) + return null + + if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) { + this[MAYBE_EMIT_END]() + return null + } + + if (this[OBJECTMODE]) + n = null + + if (this.buffer.length > 1 && !this[OBJECTMODE]) { + if (this.encoding) + this.buffer = [this.buffer.join('')] + else + this.buffer = [Buffer.concat(this.buffer, this[BUFFERLENGTH])] + } + + const ret = this[READ](n || null, this.buffer[0]) + this[MAYBE_EMIT_END]() + return ret + } + + [READ] (n, chunk) { + if (n === chunk.length || n === null) + this[BUFFERSHIFT]() + else { + this.buffer[0] = chunk.slice(n) + chunk = chunk.slice(0, n) + this[BUFFERLENGTH] -= n + } + + this.emit('data', chunk) + + if (!this.buffer.length && !this[EOF]) + this.emit('drain') + + return chunk + } + + end (chunk, encoding, cb) { + if (typeof chunk === 'function') + cb = chunk, chunk = null + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + if (chunk) + this.write(chunk, encoding) + if (cb) + this.once('end', cb) + this[EOF] = true + this.writable = false + + // if we haven't written anything, then go ahead and emit, + // even if we're not reading. + // we'll re-emit if a new 'end' listener is added anyway. + // This makes MP more suitable to write-only use cases. + if (this.flowing || !this[PAUSED]) + this[MAYBE_EMIT_END]() + return this + } + + // don't let the internal resume be overwritten + [RESUME] () { + if (this[DESTROYED]) + return + + this[PAUSED] = false + this[FLOWING] = true + this.emit('resume') + if (this.buffer.length) + this[FLUSH]() + else if (this[EOF]) + this[MAYBE_EMIT_END]() + else + this.emit('drain') + } + + resume () { + return this[RESUME]() + } + + pause () { + this[FLOWING] = false + this[PAUSED] = true + } + + get destroyed () { + return this[DESTROYED] + } + + get flowing () { + return this[FLOWING] + } + + get paused () { + return this[PAUSED] + } + + [BUFFERPUSH] (chunk) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] += 1 + else + this[BUFFERLENGTH] += chunk.length + this.buffer.push(chunk) + } + + [BUFFERSHIFT] () { + if (this.buffer.length) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] -= 1 + else + this[BUFFERLENGTH] -= this.buffer[0].length + } + return this.buffer.shift() + } + + [FLUSH] (noDrain) { + do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) + + if (!noDrain && !this.buffer.length && !this[EOF]) + this.emit('drain') + } + + [FLUSHCHUNK] (chunk) { + return chunk ? (this.emit('data', chunk), this.flowing) : false + } + + pipe (dest, opts) { + if (this[DESTROYED]) + return + + const ended = this[EMITTED_END] + opts = opts || {} + if (dest === proc.stdout || dest === proc.stderr) + opts.end = false + else + opts.end = opts.end !== false + opts.proxyErrors = !!opts.proxyErrors + + // piping an ended stream ends immediately + if (ended) { + if (opts.end) + dest.end() + } else { + this.pipes.push(!opts.proxyErrors ? new Pipe(this, dest, opts) + : new PipeProxyErrors(this, dest, opts)) + if (this[ASYNC]) + defer(() => this[RESUME]()) + else + this[RESUME]() + } + + return dest + } + + unpipe (dest) { + const p = this.pipes.find(p => p.dest === dest) + if (p) { + this.pipes.splice(this.pipes.indexOf(p), 1) + p.unpipe() + } + } + + addListener (ev, fn) { + return this.on(ev, fn) + } + + on (ev, fn) { + const ret = super.on(ev, fn) + if (ev === 'data' && !this.pipes.length && !this.flowing) + this[RESUME]() + else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) + super.emit('readable') + else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev) + this.removeAllListeners(ev) + } else if (ev === 'error' && this[EMITTED_ERROR]) { + if (this[ASYNC]) + defer(() => fn.call(this, this[EMITTED_ERROR])) + else + fn.call(this, this[EMITTED_ERROR]) + } + return ret + } + + get emittedEnd () { + return this[EMITTED_END] + } + + [MAYBE_EMIT_END] () { + if (!this[EMITTING_END] && + !this[EMITTED_END] && + !this[DESTROYED] && + this.buffer.length === 0 && + this[EOF]) { + this[EMITTING_END] = true + this.emit('end') + this.emit('prefinish') + this.emit('finish') + if (this[CLOSED]) + this.emit('close') + this[EMITTING_END] = false + } + } + + emit (ev, data, ...extra) { + // error and close are only events allowed after calling destroy() + if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) + return + else if (ev === 'data') { + return !data ? false + : this[ASYNC] ? defer(() => this[EMITDATA](data)) + : this[EMITDATA](data) + } else if (ev === 'end') { + return this[EMITEND]() + } else if (ev === 'close') { + this[CLOSED] = true + // don't emit close before 'end' and 'finish' + if (!this[EMITTED_END] && !this[DESTROYED]) + return + const ret = super.emit('close') + this.removeAllListeners('close') + return ret + } else if (ev === 'error') { + this[EMITTED_ERROR] = data + const ret = super.emit('error', data) + this[MAYBE_EMIT_END]() + return ret + } else if (ev === 'resume') { + const ret = super.emit('resume') + this[MAYBE_EMIT_END]() + return ret + } else if (ev === 'finish' || ev === 'prefinish') { + const ret = super.emit(ev) + this.removeAllListeners(ev) + return ret + } + + // Some other unknown event + const ret = super.emit(ev, data, ...extra) + this[MAYBE_EMIT_END]() + return ret + } + + [EMITDATA] (data) { + for (const p of this.pipes) { + if (p.dest.write(data) === false) + this.pause() + } + const ret = super.emit('data', data) + this[MAYBE_EMIT_END]() + return ret + } + + [EMITEND] () { + if (this[EMITTED_END]) + return + + this[EMITTED_END] = true + this.readable = false + if (this[ASYNC]) + defer(() => this[EMITEND2]()) + else + this[EMITEND2]() + } + + [EMITEND2] () { + if (this[DECODER]) { + const data = this[DECODER].end() + if (data) { + for (const p of this.pipes) { + p.dest.write(data) + } + super.emit('data', data) + } + } + + for (const p of this.pipes) { + p.end() + } + const ret = super.emit('end') + this.removeAllListeners('end') + return ret + } + + // const all = await stream.collect() + collect () { + const buf = [] + if (!this[OBJECTMODE]) + buf.dataLength = 0 + // set the promise first, in case an error is raised + // by triggering the flow here. + const p = this.promise() + this.on('data', c => { + buf.push(c) + if (!this[OBJECTMODE]) + buf.dataLength += c.length + }) + return p.then(() => buf) + } + + // const data = await stream.concat() + concat () { + return this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this.collect().then(buf => + this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength)) + } + + // stream.promise().then(() => done, er => emitted error) + promise () { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error('stream destroyed'))) + this.on('error', er => reject(er)) + this.on('end', () => resolve()) + }) + } + + // for await (let chunk of stream) + [ASYNCITERATOR] () { + const next = () => { + const res = this.read() + if (res !== null) + return Promise.resolve({ done: false, value: res }) + + if (this[EOF]) + return Promise.resolve({ done: true }) + + let resolve = null + let reject = null + const onerr = er => { + this.removeListener('data', ondata) + this.removeListener('end', onend) + reject(er) + } + const ondata = value => { + this.removeListener('error', onerr) + this.removeListener('end', onend) + this.pause() + resolve({ value: value, done: !!this[EOF] }) + } + const onend = () => { + this.removeListener('error', onerr) + this.removeListener('data', ondata) + resolve({ done: true }) + } + const ondestroy = () => onerr(new Error('stream destroyed')) + return new Promise((res, rej) => { + reject = rej + resolve = res + this.once(DESTROYED, ondestroy) + this.once('error', onerr) + this.once('end', onend) + this.once('data', ondata) + }) + } + + return { next } + } + + // for (let chunk of stream) + [ITERATOR] () { + const next = () => { + const value = this.read() + const done = value === null + return { value, done } + } + return { next } + } + + destroy (er) { + if (this[DESTROYED]) { + if (er) + this.emit('error', er) + else + this.emit(DESTROYED) + return this + } + + this[DESTROYED] = true + + // throw away all buffered data, it's never coming out + this.buffer.length = 0 + this[BUFFERLENGTH] = 0 + + if (typeof this.close === 'function' && !this[CLOSED]) + this.close() + + if (er) + this.emit('error', er) + else // if no error to emit, still reject pending promises + this.emit(DESTROYED) + + return this + } + + static isStream (s) { + return !!s && (s instanceof Minipass || s instanceof Stream || + s instanceof EE && ( + typeof s.pipe === 'function' || // readable + (typeof s.write === 'function' && typeof s.end === 'function') // writable + )) + } +} diff --git a/node_modules/fs-minipass/node_modules/minipass/package.json b/node_modules/fs-minipass/node_modules/minipass/package.json new file mode 100644 index 00000000..548d03fa --- /dev/null +++ b/node_modules/fs-minipass/node_modules/minipass/package.json @@ -0,0 +1,56 @@ +{ + "name": "minipass", + "version": "3.3.6", + "description": "minimal implementation of a PassThrough stream", + "main": "index.js", + "types": "index.d.ts", + "dependencies": { + "yallist": "^4.0.0" + }, + "devDependencies": { + "@types/node": "^17.0.41", + "end-of-stream": "^1.4.0", + "prettier": "^2.6.2", + "tap": "^16.2.0", + "through2": "^2.0.3", + "ts-node": "^10.8.1", + "typescript": "^4.7.3" + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minipass.git" + }, + "keywords": [ + "passthrough", + "stream" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "index.d.ts", + "index.js" + ], + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">=8" + }, + "prettier": { + "semi": false, + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + } +} diff --git a/node_modules/fs-minipass/package.json b/node_modules/fs-minipass/package.json new file mode 100644 index 00000000..2f2436cb --- /dev/null +++ b/node_modules/fs-minipass/package.json @@ -0,0 +1,39 @@ +{ + "name": "fs-minipass", + "version": "2.1.0", + "main": "index.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "keywords": [], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/fs-minipass.git" + }, + "bugs": { + "url": "https://github.com/npm/fs-minipass/issues" + }, + "homepage": "https://github.com/npm/fs-minipass#readme", + "description": "fs read and write streams based on minipass", + "dependencies": { + "minipass": "^3.0.0" + }, + "devDependencies": { + "mutate-fs": "^2.0.1", + "tap": "^14.6.4" + }, + "files": [ + "index.js" + ], + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">= 8" + } +} diff --git a/node_modules/fs.realpath/LICENSE b/node_modules/fs.realpath/LICENSE new file mode 100644 index 00000000..5bd884c2 --- /dev/null +++ b/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fs.realpath/README.md b/node_modules/fs.realpath/README.md new file mode 100644 index 00000000..a42ceac6 --- /dev/null +++ b/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/node_modules/fs.realpath/index.js b/node_modules/fs.realpath/index.js new file mode 100644 index 00000000..b09c7c7e --- /dev/null +++ b/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/node_modules/fs.realpath/old.js b/node_modules/fs.realpath/old.js new file mode 100644 index 00000000..b40305e7 --- /dev/null +++ b/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/node_modules/fs.realpath/package.json b/node_modules/fs.realpath/package.json new file mode 100644 index 00000000..3edc57d2 --- /dev/null +++ b/node_modules/fs.realpath/package.json @@ -0,0 +1,26 @@ +{ + "name": "fs.realpath", + "version": "1.0.0", + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "old.js", + "index.js" + ] +} diff --git a/node_modules/gauge/CHANGELOG.md b/node_modules/gauge/CHANGELOG.md new file mode 100644 index 00000000..3c5cc917 --- /dev/null +++ b/node_modules/gauge/CHANGELOG.md @@ -0,0 +1,163 @@ +### v3.0.0 +* Drops support for Node v4, v6, v7 and v8 + +### v2.7.4 + +* Reset colors prior to ending a line, to eliminate flicker when a line + is trucated between start and end color sequences. + +### v2.7.3 + +* Only create our onExit handler when we're enabled and remove it when we're + disabled. This stops us from creating multiple onExit handlers when + multiple gauge objects are being used. +* Fix bug where if a theme name were given instead of a theme object, it + would crash. +* Remove supports-color because it's not actually used. Uhm. Yes, I just + updated it. >.> + +### v2.7.2 + +* Use supports-color instead of has-color (as the module has been renamed) + +### v2.7.1 + +* Bug fix: Calls to show/pulse while the progress bar is disabled should still + update our internal representation of what would be shown should it be enabled. + +### v2.7.0 + +* New feature: Add new `isEnabled` method to allow introspection of the gauge's + "enabledness" as controlled by `.enable()` and `.disable()`. + +### v2.6.0 + +* Bug fix: Don't run the code associated with `enable`/`disable` if the gauge + is already enabled or disabled respectively. This prevents leaking event + listeners, amongst other weirdness. +* New feature: Template items can have default values that will be used if no + value was otherwise passed in. + +### v2.5.3 + +* Default to `enabled` only if we have a tty. Users can always override + this by passing in the `enabled` option explicitly or by calling calling + `gauge.enable()`. + +### v2.5.2 + +* Externalized `./console-strings.js` into `console-control-strings`. + +### v2.5.1 + +* Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the + node profiler. +* [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add + a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012)) + +### v2.5.0 + +* Add way to programmatically fetch a list of theme names in a themeset + (`Themeset.getThemeNames`). + +### v2.4.0 + +* Add support for setting themesets on existing gauge objects. +* Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when + your terminal is interleaving output from multiple filehandles (ie, stdout + & stderr). + +### v2.3.1 + +* Fix a refactor bug in setTheme where it wasn't accepting the various types + of args it should. + +### v2.3.0 + +#### FEATURES + +* Add setTemplate & setTheme back in. +* Add support for named themes, you can now ask for things like 'colorASCII' + and 'brailleSpinner'. Of course, you can still pass in theme objects. + Additionally you can now pass in an object with `hasUnicode`, `hasColor` and + `platform` keys in order to override our guesses as to those values when + selecting a default theme from the themeset. +* Make the output stream optional (it defaults to `process.stderr` now). +* Add `setWriteTo(stream[, tty])` to change the output stream and, + optionally, tty. + +#### BUG FIXES & REFACTORING + +* Abort the display phase early if we're supposed to be hidden and we are. +* Stop printing a bunch of spaces at the end of lines, since we're already + using an erase-to-end-of-line code anyway. +* The unicode themes were missing the subsection separator. + +### v2.2.1 + +* Fix image in readme + +### v2.2.0 + +* All new themes API– reference themes by name and pass in custom themes and + themesets (themesets get platform support autodetection done on them to + select the best theme). Theme mixins let you add features to all existing + themes. +* Much, much improved test coverage. + +### v2.1.0 + +* Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks + to @yongtw123 for pointing out this had snuck in. +* Fiddled with the demo output to make it easier to see the spinner spin. Also + added prints before each platforms test output. +* I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for + finding this. Then I was lazy and made a new commit instead of using his + PR. Again, thank you for your patience @KenenY. +* Drastically speed up travis testing. +* Add a small javascript demo (demo.js) for showing off the various themes + (and testing them on diff platforms). +* Change: The subsection separator from ⁄ and / (different chars) to >. +* Fix crasher: A show or pulse without a label would cause the template renderer + to complain about a missing value. +* New feature: Add the ability to disable the clean-up-on-exit behavior. + Not something I expect to be widely desirable, but important if you have + multiple distinct gauge instances in your app. +* Use our own color support detection. + The `has-color` module proved too magic for my needs, making assumptions + as to which stream we write to and reading command line arguments. + +### v2.0.0 + +This is a major rewrite of the internals. Externally there are fewer +changes: + +* On node>0.8 gauge object now prints updates at a fixed rate. This means + that when you call `show` it may wate up to `updateInterval` ms before it + actually prints an update. You override this behavior with the + `fixedFramerate` option. +* The gauge object now keeps the cursor hidden as long as it's enabled and + shown. +* The constructor's arguments have changed, now it takes a mandatory output + stream and an optional options object. The stream no longer needs to be + an `ansi`ified stream, although it can be if you want (but we won't make + use of its special features). +* Previously the gauge was disabled by default if `process.stdout` wasn't a + tty. Now it always defaults to enabled. If you want the previous + behavior set the `enabled` option to `process.stdout.isTTY`. +* The constructor's options have changed– see the docs for details. +* Themes are entirely different. If you were using a custom theme, or + referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then + you'll need to change your code. You can get the equivalent of the latter + with: + ``` + var themes = require('gauge/themes') + var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform + ``` + The default themes no longer use any ambiguous width characters, so even + if you choose to display those as wide your progress bar should still + display correctly. +* Templates are entirely different and if you were using a custom one, you + should consult the documentation to learn how to recreate it. If you were + using the default, be aware that it has changed and the result looks quite + a bit different. diff --git a/node_modules/gauge/LICENSE b/node_modules/gauge/LICENSE new file mode 100644 index 00000000..e7560529 --- /dev/null +++ b/node_modules/gauge/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gauge/README.md b/node_modules/gauge/README.md new file mode 100644 index 00000000..47576490 --- /dev/null +++ b/node_modules/gauge/README.md @@ -0,0 +1,402 @@ +gauge +===== + +A nearly stateless terminal based horizontal gauge / progress bar. + +```javascript +var Gauge = require("gauge") + +var gauge = new Gauge() + +gauge.show("working…", 0) +setTimeout(() => { gauge.pulse(); gauge.show("working…", 0.25) }, 500) +setTimeout(() => { gauge.pulse(); gauge.show("working…", 0.50) }, 1000) +setTimeout(() => { gauge.pulse(); gauge.show("working…", 0.75) }, 1500) +setTimeout(() => { gauge.pulse(); gauge.show("working…", 0.99) }, 2000) +setTimeout(() => gauge.hide(), 2300) +``` + +See also the [demos](demo.js): + +![](gauge-demo.gif) + + +### CHANGES FROM 1.x + +Gauge 2.x is breaking release, please see the [changelog] for details on +what's changed if you were previously a user of this module. + +[changelog]: CHANGELOG.md + +### THE GAUGE CLASS + +This is the typical interface to the module– it provides a pretty +fire-and-forget interface to displaying your status information. + +``` +var Gauge = require("gauge") + +var gauge = new Gauge([stream], [options]) +``` + +* **stream** – *(optional, default STDERR)* A stream that progress bar + updates are to be written to. Gauge honors backpressure and will pause + most writing if it is indicated. +* **options** – *(optional)* An option object. + +Constructs a new gauge. Gauges are drawn on a single line, and are not drawn +if **stream** isn't a tty and a tty isn't explicitly provided. + +If **stream** is a terminal or if you pass in **tty** to **options** then we +will detect terminal resizes and redraw to fit. We do this by watching for +`resize` events on the tty. (To work around a bug in versions of Node prior +to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to +larger window sizes will be clean, but shrinking the window will always +result in some cruft. + +**IMPORTANT:** If you previously were passing in a non-tty stream but you still +want output (for example, a stream wrapped by the `ansi` module) then you +need to pass in the **tty** option below, as `gauge` needs access to +the underlying tty in order to do things like terminal resizes and terminal +width detection. + +The **options** object can have the following properties, all of which are +optional: + +* **updateInterval**: How often gauge updates should be drawn, in milliseconds. +* **fixedFramerate**: Defaults to false on node 0.8, true on everything + else. When this is true a timer is created to trigger once every + `updateInterval` ms, when false, updates are printed as soon as they come + in but updates more often than `updateInterval` are ignored. The reason + 0.8 doesn't have this set to true is that it can't `unref` its timer and + so it would stop your program from exiting– if you want to use this + feature with 0.8 just make sure you call `gauge.disable()` before you + expect your program to exit. +* **themes**: A themeset to use when selecting the theme to use. Defaults + to `gauge/themes`, see the [themes] documentation for details. +* **theme**: Select a theme for use, it can be a: + * Theme object, in which case the **themes** is not used. + * The name of a theme, which will be looked up in the current *themes* + object. + * A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if will be used to override our guesses when making + a default theme selection. + + If no theme is selected then a default is picked using a combination of our + best guesses at your OS, color support and unicode support. +* **template**: Describes what you want your gauge to look like. The + default is what npm uses. Detailed [documentation] is later in this + document. +* **hideCursor**: Defaults to true. If true, then the cursor will be hidden + while the gauge is displayed. +* **tty**: The tty that you're ultimately writing to. Defaults to the same + as **stream**. This is used for detecting the width of the terminal and + resizes. The width used is `tty.columns - 1`. If no tty is available then + a width of `79` is assumed. +* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true + the gauge starts enabled. If disabled then all update commands are + ignored and no gauge will be printed until you call `.enable()`. +* **Plumbing**: The class to use to actually generate the gauge for + printing. This defaults to `require('gauge/plumbing')` and ordinarily you + shouldn't need to override this. +* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit + handler to make sure your cursor is turned back on and the progress bar + erased when your process exits, even if you Ctrl-C out or otherwise exit + unexpectedly. You can disable this and it won't register the exit handler. + +[has-unicode]: https://www.npmjs.com/package/has-unicode +[themes]: #themes +[documentation]: #templates + +#### `gauge.show(section | status, [completed])` + +The first argument is either the section, the name of the current thing +contributing to progress, or an object with keys like **section**, +**subsection** & **completed** (or any others you have types for in a custom +template). If you don't want to update or set any of these you can pass +`null` and it will be ignored. + +The second argument is the percent completed as a value between 0 and 1. +Without it, completion is just not updated. You'll also note that completion +can be passed in as part of a status object as the first argument. If both +it and the completed argument are passed in, the completed argument wins. + +#### `gauge.hide([cb])` + +Removes the gauge from the terminal. Optionally, callback `cb` after IO has +had an opportunity to happen (currently this just means after `setImmediate` +has called back.) + +It turns out this is important when you're pausing the progress bar on one +filehandle and printing to another– otherwise (with a big enough print) node +can end up printing the "end progress bar" bits to the progress bar filehandle +while other stuff is printing to another filehandle. These getting interleaved +can cause corruption in some terminals. + +#### `gauge.pulse([subsection])` + +* **subsection** – *(optional)* The specific thing that triggered this pulse + +Spins the spinner in the gauge to show output. If **subsection** is +included then it will be combined with the last name passed to `gauge.show`. + +#### `gauge.disable()` + +Hides the gauge and ignores further calls to `show` or `pulse`. + +#### `gauge.enable()` + +Shows the gauge and resumes updating when `show` or `pulse` is called. + +#### `gauge.isEnabled()` + +Returns true if the gauge is enabled. + +#### `gauge.setThemeset(themes)` + +Change the themeset to select a theme from. The same as the `themes` option +used in the constructor. The theme will be reselected from this themeset. + +#### `gauge.setTheme(theme)` + +Change the active theme, will be displayed with the next show or pulse. This can be: + +* Theme object, in which case the **themes** is not used. +* The name of a theme, which will be looked up in the current *themes* + object. +* A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if will be used to override our guesses when making + a default theme selection. + +If no theme is selected then a default is picked using a combination of our +best guesses at your OS, color support and unicode support. + +#### `gauge.setTemplate(template)` + +Change the active template, will be displayed with the next show or pulse + +### Tracking Completion + +If you have more than one thing going on that you want to track completion +of, you may find the related [are-we-there-yet] helpful. It's `change` +event can be wired up to the `show` method to get a more traditional +progress bar interface. + +[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet + +### THEMES + +``` +var themes = require('gauge/themes') + +// fetch the default color unicode theme for this platform +var ourTheme = themes({hasUnicode: true, hasColor: true}) + +// fetch the default non-color unicode theme for osx +var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'}) + +// create a new theme based on the color ascii theme for this platform +// that brackets the progress bar with arrows +var ourTheme = themes.newTheme(themes({hasUnicode: false, hasColor: true}), { + preProgressbar: '→', + postProgressbar: '←' +}) +``` + +The object returned by `gauge/themes` is an instance of the `ThemeSet` class. + +``` +var ThemeSet = require('gauge/theme-set') +var themes = new ThemeSet() +// or +var themes = require('gauge/themes') +var mythemes = themes.newThemeSet() // creates a new themeset based on the default themes +``` + +#### themes(opts) +#### themes.getDefault(opts) + +Theme objects are a function that fetches the default theme based on +platform, unicode and color support. + +Options is an object with the following properties: + +* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is + available then a non-unicode theme will be used. +* **hasColor** - If true, fetch a color theme, if no color theme is + available a non-color theme will be used. +* **platform** (optional) - Defaults to `process.platform`. If no + platform match is available then `fallback` is used instead. + +If no compatible theme can be found then an error will be thrown with a +`code` of `EMISSINGTHEME`. + +#### themes.addTheme(themeName, themeObj) +#### themes.addTheme(themeName, [parentTheme], newTheme) + +Adds a named theme to the themeset. You can pass in either a theme object, +as returned by `themes.newTheme` or the arguments you'd pass to +`themes.newTheme`. + +#### themes.getThemeNames() + +Return a list of all of the names of the themes in this themeset. Suitable +for use in `themes.getTheme(…)`. + +#### themes.getTheme(name) + +Returns the theme object from this theme set named `name`. + +If `name` does not exist in this themeset an error will be thrown with +a `code` of `EMISSINGTHEME`. + +#### themes.setDefault([opts], themeName) + +`opts` is an object with the following properties. + +* **platform** - Defaults to `'fallback'`. If your theme is platform + specific, specify that here with the platform from `process.platform`, eg, + `win32`, `darwin`, etc. +* **hasUnicode** - Defaults to `false`. If your theme uses unicode you + should set this to true. +* **hasColor** - Defaults to `false`. If your theme uses color you should + set this to true. + +`themeName` is the name of the theme (as given to `addTheme`) to use for +this set of `opts`. + +#### themes.newTheme([parentTheme,] newTheme) + +Create a new theme object based on `parentTheme`. If no `parentTheme` is +provided then a minimal parentTheme that defines functions for rendering the +activity indicator (spinner) and progress bar will be defined. (This +fallback parent is defined in `gauge/base-theme`.) + +newTheme should be a bare object– we'll start by discussing the properties +defined by the default themes: + +* **preProgressbar** - displayed prior to the progress bar, if the progress + bar is displayed. +* **postProgressbar** - displayed after the progress bar, if the progress bar + is displayed. +* **progressBarTheme** - The subtheme passed through to the progress bar + renderer, it's an object with `complete` and `remaining` properties + that are the strings you want repeated for those sections of the progress + bar. +* **activityIndicatorTheme** - The theme for the activity indicator (spinner), + this can either be a string, in which each character is a different step, or + an array of strings. +* **preSubsection** - Displayed as a separator between the `section` and + `subsection` when the latter is printed. + +More generally, themes can have any value that would be a valid value when rendering +templates. The properties in the theme are used when their name matches a type in +the template. Their values can be: + +* **strings & numbers** - They'll be included as is +* **function (values, theme, width)** - Should return what you want in your output. + *values* is an object with values provided via `gauge.show`, + *theme* is the theme specific to this item (see below) or this theme object, + and *width* is the number of characters wide your result should be. + +There are a couple of special prefixes: + +* **pre** - Is shown prior to the property, if its displayed. +* **post** - Is shown after the property, if its displayed. + +And one special suffix: + +* **Theme** - Its value is passed to a function-type item as the theme. + +#### themes.addToAllThemes(theme) + +This *mixes-in* `theme` into all themes currently defined. It also adds it +to the default parent theme for this themeset, so future themes added to +this themeset will get the values from `theme` by default. + +#### themes.newThemeSet() + +Copy the current themeset into a new one. This allows you to easily inherit +one themeset from another. + +### TEMPLATES + +A template is an array of objects and strings that, after being evaluated, +will be turned into the gauge line. The default template is: + +```javascript +[ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} +] +``` + +The various template elements can either be **plain strings**, in which case they will +be be included verbatum in the output, or objects with the following properties: + +* *type* can be any of the following plus any keys you pass into `gauge.show` plus + any keys you have on a custom theme. + * `section` – What big thing you're working on now. + * `subsection` – What component of that thing is currently working. + * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme` + from your active theme. + * `progressbar` – A progress bar representing your current `completed` + using the `progressbarTheme` from your active theme. +* *kerning* – Number of spaces that must be between this item and other + items, if this item is displayed at all. +* *maxLength* – The maximum length for this element. If its value is longer it + will be truncated. +* *minLength* – The minimum length for this element. If its value is shorter it + will be padded according to the *align* value. +* *align* – (Default: left) Possible values "left", "right" and "center". Works + as you'd expect from word processors. +* *length* – Provides a single value for both *minLength* and *maxLength*. If both + *length* and *minLength or *maxLength* are specified then the latter take precedence. +* *value* – A literal value to use for this template item. +* *default* – A default value to use for this template item if a value + wasn't otherwise passed in. + +### PLUMBING + +This is the super simple, assume nothing, do no magic internals used by gauge to +implement its ordinary interface. + +``` +var Plumbing = require('gauge/plumbing') +var gauge = new Plumbing(theme, template, width) +``` + +* **theme**: The theme to use. +* **template**: The template to use. +* **width**: How wide your gauge should be + +#### `gauge.setTheme(theme)` + +Change the active theme. + +#### `gauge.setTemplate(template)` + +Change the active template. + +#### `gauge.setWidth(width)` + +Change the width to render at. + +#### `gauge.hide()` + +Return the string necessary to hide the progress bar + +#### `gauge.hideCursor()` + +Return a string to hide the cursor. + +#### `gauge.showCursor()` + +Return a string to show the cursor. + +#### `gauge.show(status)` + +Using `status` for values, render the provided template with the theme and return +a string that is suitable for printing to update the gauge. diff --git a/node_modules/gauge/base-theme.js b/node_modules/gauge/base-theme.js new file mode 100644 index 00000000..0b67638e --- /dev/null +++ b/node_modules/gauge/base-theme.js @@ -0,0 +1,14 @@ +'use strict' +var spin = require('./spin.js') +var progressBar = require('./progress-bar.js') + +module.exports = { + activityIndicator: function (values, theme, width) { + if (values.spun == null) return + return spin(theme, values.spun) + }, + progressbar: function (values, theme, width) { + if (values.completed == null) return + return progressBar(theme, width, values.completed) + } +} diff --git a/node_modules/gauge/error.js b/node_modules/gauge/error.js new file mode 100644 index 00000000..d9914ba5 --- /dev/null +++ b/node_modules/gauge/error.js @@ -0,0 +1,24 @@ +'use strict' +var util = require('util') + +var User = exports.User = function User (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, User) + err.code = 'EGAUGE' + return err +} + +exports.MissingTemplateValue = function MissingTemplateValue (item, values) { + var err = new User(util.format('Missing template value "%s"', item.type)) + Error.captureStackTrace(err, MissingTemplateValue) + err.template = item + err.values = values + return err +} + +exports.Internal = function Internal (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, Internal) + err.code = 'EGAUGEINTERNAL' + return err +} diff --git a/node_modules/gauge/has-color.js b/node_modules/gauge/has-color.js new file mode 100644 index 00000000..16cba0eb --- /dev/null +++ b/node_modules/gauge/has-color.js @@ -0,0 +1,4 @@ +'use strict' +var colorSupport = require('color-support') + +module.exports = colorSupport().hasBasic diff --git a/node_modules/gauge/index.js b/node_modules/gauge/index.js new file mode 100644 index 00000000..87a4bb93 --- /dev/null +++ b/node_modules/gauge/index.js @@ -0,0 +1,233 @@ +'use strict' +var Plumbing = require('./plumbing.js') +var hasUnicode = require('has-unicode') +var hasColor = require('./has-color.js') +var onExit = require('signal-exit') +var defaultThemes = require('./themes') +var setInterval = require('./set-interval.js') +var process = require('./process.js') +var setImmediate = require('./set-immediate') + +module.exports = Gauge + +function callWith (obj, method) { + return function () { + return method.call(obj) + } +} + +function Gauge (arg1, arg2) { + var options, writeTo + if (arg1 && arg1.write) { + writeTo = arg1 + options = arg2 || {} + } else if (arg2 && arg2.write) { + writeTo = arg2 + options = arg1 || {} + } else { + writeTo = process.stderr + options = arg1 || arg2 || {} + } + + this._status = { + spun: 0, + section: '', + subsection: '' + } + this._paused = false // are we paused for back pressure? + this._disabled = true // are all progress bar updates disabled? + this._showing = false // do we WANT the progress bar on screen + this._onScreen = false // IS the progress bar on screen + this._needsRedraw = false // should we print something at next tick? + this._hideCursor = options.hideCursor == null ? true : options.hideCursor + this._fixedFramerate = options.fixedFramerate == null + ? !(/^v0\.8\./.test(process.version)) + : options.fixedFramerate + this._lastUpdateAt = null + this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval + + this._themes = options.themes || defaultThemes + this._theme = options.theme + var theme = this._computeTheme(options.theme) + var template = options.template || [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} + ] + this.setWriteTo(writeTo, options.tty) + var PlumbingClass = options.Plumbing || Plumbing + this._gauge = new PlumbingClass(theme, template, this.getWidth()) + + this._$$doRedraw = callWith(this, this._doRedraw) + this._$$handleSizeChange = callWith(this, this._handleSizeChange) + + this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit + this._removeOnExit = null + + if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) { + this.enable() + } else { + this.disable() + } +} +Gauge.prototype = {} + +Gauge.prototype.isEnabled = function () { + return !this._disabled +} + +Gauge.prototype.setTemplate = function (template) { + this._gauge.setTemplate(template) + if (this._showing) this._requestRedraw() +} + +Gauge.prototype._computeTheme = function (theme) { + if (!theme) theme = {} + if (typeof theme === 'string') { + theme = this._themes.getTheme(theme) + } else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) { + var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode + var useColor = theme.hasColor == null ? hasColor : theme.hasColor + theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform}) + } + return theme +} + +Gauge.prototype.setThemeset = function (themes) { + this._themes = themes + this.setTheme(this._theme) +} + +Gauge.prototype.setTheme = function (theme) { + this._gauge.setTheme(this._computeTheme(theme)) + if (this._showing) this._requestRedraw() + this._theme = theme +} + +Gauge.prototype._requestRedraw = function () { + this._needsRedraw = true + if (!this._fixedFramerate) this._doRedraw() +} + +Gauge.prototype.getWidth = function () { + return ((this._tty && this._tty.columns) || 80) - 1 +} + +Gauge.prototype.setWriteTo = function (writeTo, tty) { + var enabled = !this._disabled + if (enabled) this.disable() + this._writeTo = writeTo + this._tty = tty || + (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || + (writeTo.isTTY && writeTo) || + this._tty + if (this._gauge) this._gauge.setWidth(this.getWidth()) + if (enabled) this.enable() +} + +Gauge.prototype.enable = function () { + if (!this._disabled) return + this._disabled = false + if (this._tty) this._enableEvents() + if (this._showing) this.show() +} + +Gauge.prototype.disable = function () { + if (this._disabled) return + if (this._showing) { + this._lastUpdateAt = null + this._showing = false + this._doRedraw() + this._showing = true + } + this._disabled = true + if (this._tty) this._disableEvents() +} + +Gauge.prototype._enableEvents = function () { + if (this._cleanupOnExit) { + this._removeOnExit = onExit(callWith(this, this.disable)) + } + this._tty.on('resize', this._$$handleSizeChange) + if (this._fixedFramerate) { + this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) + if (this.redrawTracker.unref) this.redrawTracker.unref() + } +} + +Gauge.prototype._disableEvents = function () { + this._tty.removeListener('resize', this._$$handleSizeChange) + if (this._fixedFramerate) clearInterval(this.redrawTracker) + if (this._removeOnExit) this._removeOnExit() +} + +Gauge.prototype.hide = function (cb) { + if (this._disabled) return cb && process.nextTick(cb) + if (!this._showing) return cb && process.nextTick(cb) + this._showing = false + this._doRedraw() + cb && setImmediate(cb) +} + +Gauge.prototype.show = function (section, completed) { + this._showing = true + if (typeof section === 'string') { + this._status.section = section + } else if (typeof section === 'object') { + var sectionKeys = Object.keys(section) + for (var ii = 0; ii < sectionKeys.length; ++ii) { + var key = sectionKeys[ii] + this._status[key] = section[key] + } + } + if (completed != null) this._status.completed = completed + if (this._disabled) return + this._requestRedraw() +} + +Gauge.prototype.pulse = function (subsection) { + this._status.subsection = subsection || '' + this._status.spun++ + if (this._disabled) return + if (!this._showing) return + this._requestRedraw() +} + +Gauge.prototype._handleSizeChange = function () { + this._gauge.setWidth(this._tty.columns - 1) + this._requestRedraw() +} + +Gauge.prototype._doRedraw = function () { + if (this._disabled || this._paused) return + if (!this._fixedFramerate) { + var now = Date.now() + if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return + this._lastUpdateAt = now + } + if (!this._showing && this._onScreen) { + this._onScreen = false + var result = this._gauge.hide() + if (this._hideCursor) { + result += this._gauge.showCursor() + } + return this._writeTo.write(result) + } + if (!this._showing && !this._onScreen) return + if (this._showing && !this._onScreen) { + this._onScreen = true + this._needsRedraw = true + if (this._hideCursor) { + this._writeTo.write(this._gauge.hideCursor()) + } + } + if (!this._needsRedraw) return + if (!this._writeTo.write(this._gauge.show(this._status))) { + this._paused = true + this._writeTo.on('drain', callWith(this, function () { + this._paused = false + this._doRedraw() + })) + } +} diff --git a/node_modules/gauge/package.json b/node_modules/gauge/package.json new file mode 100644 index 00000000..d3f03546 --- /dev/null +++ b/node_modules/gauge/package.json @@ -0,0 +1,66 @@ +{ + "name": "gauge", + "version": "3.0.2", + "description": "A terminal based horizontal guage", + "main": "index.js", + "scripts": { + "test": "standard && tap test/*.js --coverage" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/gauge" + }, + "keywords": [ + "progressbar", + "progress", + "gauge" + ], + "author": "Rebecca Turner ", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/gauge/issues" + }, + "homepage": "https://github.com/npm/gauge", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "devDependencies": { + "readable-stream": "^2.0.6", + "require-inject": "^1.4.0", + "standard": "^11.0.1", + "tap": "^12.0.1", + "through2": "^2.0.0" + }, + "files": [ + "base-theme.js", + "CHANGELOG.md", + "error.js", + "has-color.js", + "index.js", + "LICENSE", + "package.json", + "plumbing.js", + "process.js", + "progress-bar.js", + "README.md", + "render-template.js", + "set-immediate.js", + "set-interval.js", + "spin.js", + "template-item.js", + "theme-set.js", + "themes.js", + "wide-truncate.js" + ], + "engines": { + "node": ">=10" + } +} diff --git a/node_modules/gauge/plumbing.js b/node_modules/gauge/plumbing.js new file mode 100644 index 00000000..1afb4af6 --- /dev/null +++ b/node_modules/gauge/plumbing.js @@ -0,0 +1,48 @@ +'use strict' +var consoleControl = require('console-control-strings') +var renderTemplate = require('./render-template.js') +var validate = require('aproba') + +var Plumbing = module.exports = function (theme, template, width) { + if (!width) width = 80 + validate('OAN', [theme, template, width]) + this.showing = false + this.theme = theme + this.width = width + this.template = template +} +Plumbing.prototype = {} + +Plumbing.prototype.setTheme = function (theme) { + validate('O', [theme]) + this.theme = theme +} + +Plumbing.prototype.setTemplate = function (template) { + validate('A', [template]) + this.template = template +} + +Plumbing.prototype.setWidth = function (width) { + validate('N', [width]) + this.width = width +} + +Plumbing.prototype.hide = function () { + return consoleControl.gotoSOL() + consoleControl.eraseLine() +} + +Plumbing.prototype.hideCursor = consoleControl.hideCursor + +Plumbing.prototype.showCursor = consoleControl.showCursor + +Plumbing.prototype.show = function (status) { + var values = Object.create(this.theme) + for (var key in status) { + values[key] = status[key] + } + + return renderTemplate(this.width, this.template, values).trim() + + consoleControl.color('reset') + + consoleControl.eraseLine() + consoleControl.gotoSOL() +} diff --git a/node_modules/gauge/process.js b/node_modules/gauge/process.js new file mode 100644 index 00000000..05e85694 --- /dev/null +++ b/node_modules/gauge/process.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = process diff --git a/node_modules/gauge/progress-bar.js b/node_modules/gauge/progress-bar.js new file mode 100644 index 00000000..1780a8a5 --- /dev/null +++ b/node_modules/gauge/progress-bar.js @@ -0,0 +1,35 @@ +'use strict' +var validate = require('aproba') +var renderTemplate = require('./render-template.js') +var wideTruncate = require('./wide-truncate') +var stringWidth = require('string-width') + +module.exports = function (theme, width, completed) { + validate('ONN', [theme, width, completed]) + if (completed < 0) completed = 0 + if (completed > 1) completed = 1 + if (width <= 0) return '' + var sofar = Math.round(width * completed) + var rest = width - sofar + var template = [ + {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, + {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} + ] + return renderTemplate(width, template, theme) +} + +// lodash's way of repeating +function repeat (string, width) { + var result = '' + var n = width + do { + if (n % 2) { + result += string + } + n = Math.floor(n / 2) + /* eslint no-self-assign: 0 */ + string += string + } while (n && stringWidth(result) < width) + + return wideTruncate(result, width) +} diff --git a/node_modules/gauge/render-template.js b/node_modules/gauge/render-template.js new file mode 100644 index 00000000..9764c6e0 --- /dev/null +++ b/node_modules/gauge/render-template.js @@ -0,0 +1,178 @@ +'use strict' +var align = require('wide-align') +var validate = require('aproba') +var wideTruncate = require('./wide-truncate') +var error = require('./error') +var TemplateItem = require('./template-item') + +function renderValueWithValues (values) { + return function (item) { + return renderValue(item, values) + } +} + +var renderTemplate = module.exports = function (width, template, values) { + var items = prepareItems(width, template, values) + var rendered = items.map(renderValueWithValues(values)).join('') + return align.left(wideTruncate(rendered, width), width) +} + +function preType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'pre' + cappedTypeName +} + +function postType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'post' + cappedTypeName +} + +function hasPreOrPost (item, values) { + if (!item.type) return + return values[preType(item)] || values[postType(item)] +} + +function generatePreAndPost (baseItem, parentValues) { + var item = Object.assign({}, baseItem) + var values = Object.create(parentValues) + var template = [] + var pre = preType(item) + var post = postType(item) + if (values[pre]) { + template.push({value: values[pre]}) + values[pre] = null + } + item.minLength = null + item.length = null + item.maxLength = null + template.push(item) + values[item.type] = values[item.type] + if (values[post]) { + template.push({value: values[post]}) + values[post] = null + } + return function ($1, $2, length) { + return renderTemplate(length, template, values) + } +} + +function prepareItems (width, template, values) { + function cloneAndObjectify (item, index, arr) { + var cloned = new TemplateItem(item, width) + var type = cloned.type + if (cloned.value == null) { + if (!(type in values)) { + if (cloned.default == null) { + throw new error.MissingTemplateValue(cloned, values) + } else { + cloned.value = cloned.default + } + } else { + cloned.value = values[type] + } + } + if (cloned.value == null || cloned.value === '') return null + cloned.index = index + cloned.first = index === 0 + cloned.last = index === arr.length - 1 + if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values) + return cloned + } + + var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) + + var remainingSpace = width + var variableCount = output.length + + function consumeSpace (length) { + if (length > remainingSpace) length = remainingSpace + remainingSpace -= length + } + + function finishSizing (item, length) { + if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') + if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') + if (length != null) item.length = length + item.minLength = null + item.maxLength = null + --variableCount + item.finished = true + if (item.length == null) item.length = item.getBaseLength() + if (item.length == null) throw new error.Internal('Finished template items must have a length') + consumeSpace(item.getLength()) + } + + output.forEach(function (item) { + if (!item.kerning) return + var prevPadRight = item.first ? 0 : output[item.index - 1].padRight + if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight + if (!item.last) item.padRight = item.kerning + }) + + // Finish any that have a fixed (literal or intuited) length + output.forEach(function (item) { + if (item.getBaseLength() == null) return + finishSizing(item) + }) + + var resized = 0 + var resizing + var hunkSize + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.maxLength) return + if (item.getMaxLength() < hunkSize) { + finishSizing(item, item.maxLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') + + resized = 0 + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.minLength) return + if (item.getMinLength() >= hunkSize) { + finishSizing(item, item.minLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') + + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + finishSizing(item, hunkSize) + }) + + return output +} + +function renderFunction (item, values, length) { + validate('OON', arguments) + if (item.type) { + return item.value(values, values[item.type + 'Theme'] || {}, length) + } else { + return item.value(values, {}, length) + } +} + +function renderValue (item, values) { + var length = item.getBaseLength() + var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value + if (value == null || value === '') return '' + var alignWith = align[item.align] || align.left + var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' + var rightPadding = item.padRight ? align.right('', item.padRight) : '' + var truncated = wideTruncate(String(value), length) + var aligned = alignWith(truncated, length) + return leftPadding + aligned + rightPadding +} diff --git a/node_modules/gauge/set-immediate.js b/node_modules/gauge/set-immediate.js new file mode 100644 index 00000000..6650a485 --- /dev/null +++ b/node_modules/gauge/set-immediate.js @@ -0,0 +1,7 @@ +'use strict' +var process = require('./process') +try { + module.exports = setImmediate +} catch (ex) { + module.exports = process.nextTick +} diff --git a/node_modules/gauge/set-interval.js b/node_modules/gauge/set-interval.js new file mode 100644 index 00000000..57619879 --- /dev/null +++ b/node_modules/gauge/set-interval.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = setInterval diff --git a/node_modules/gauge/spin.js b/node_modules/gauge/spin.js new file mode 100644 index 00000000..34142ee3 --- /dev/null +++ b/node_modules/gauge/spin.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = function spin (spinstr, spun) { + return spinstr[spun % spinstr.length] +} diff --git a/node_modules/gauge/template-item.js b/node_modules/gauge/template-item.js new file mode 100644 index 00000000..4f02fefa --- /dev/null +++ b/node_modules/gauge/template-item.js @@ -0,0 +1,72 @@ +'use strict' +var stringWidth = require('string-width') + +module.exports = TemplateItem + +function isPercent (num) { + if (typeof num !== 'string') return false + return num.slice(-1) === '%' +} + +function percent (num) { + return Number(num.slice(0, -1)) / 100 +} + +function TemplateItem (values, outputLength) { + this.overallOutputLength = outputLength + this.finished = false + this.type = null + this.value = null + this.length = null + this.maxLength = null + this.minLength = null + this.kerning = null + this.align = 'left' + this.padLeft = 0 + this.padRight = 0 + this.index = null + this.first = null + this.last = null + if (typeof values === 'string') { + this.value = values + } else { + for (var prop in values) this[prop] = values[prop] + } + // Realize percents + if (isPercent(this.length)) { + this.length = Math.round(this.overallOutputLength * percent(this.length)) + } + if (isPercent(this.minLength)) { + this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) + } + if (isPercent(this.maxLength)) { + this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) + } + return this +} + +TemplateItem.prototype = {} + +TemplateItem.prototype.getBaseLength = function () { + var length = this.length + if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { + length = stringWidth(this.value) + } + return length +} + +TemplateItem.prototype.getLength = function () { + var length = this.getBaseLength() + if (length == null) return null + return length + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMaxLength = function () { + if (this.maxLength == null) return null + return this.maxLength + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMinLength = function () { + if (this.minLength == null) return null + return this.minLength + this.padLeft + this.padRight +} diff --git a/node_modules/gauge/theme-set.js b/node_modules/gauge/theme-set.js new file mode 100644 index 00000000..c022d61c --- /dev/null +++ b/node_modules/gauge/theme-set.js @@ -0,0 +1,114 @@ +'use strict' +var objectAssign = require('object-assign') + +module.exports = function () { + return ThemeSetProto.newThemeSet() +} + +var ThemeSetProto = {} + +ThemeSetProto.baseTheme = require('./base-theme.js') + +ThemeSetProto.newTheme = function (parent, theme) { + if (!theme) { + theme = parent + parent = this.baseTheme + } + return objectAssign({}, parent, theme) +} + +ThemeSetProto.getThemeNames = function () { + return Object.keys(this.themes) +} + +ThemeSetProto.addTheme = function (name, parent, theme) { + this.themes[name] = this.newTheme(parent, theme) +} + +ThemeSetProto.addToAllThemes = function (theme) { + var themes = this.themes + Object.keys(themes).forEach(function (name) { + objectAssign(themes[name], theme) + }) + objectAssign(this.baseTheme, theme) +} + +ThemeSetProto.getTheme = function (name) { + if (!this.themes[name]) throw this.newMissingThemeError(name) + return this.themes[name] +} + +ThemeSetProto.setDefault = function (opts, name) { + if (name == null) { + name = opts + opts = {} + } + var platform = opts.platform == null ? 'fallback' : opts.platform + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} + this.defaults[platform][hasUnicode][hasColor] = name +} + +ThemeSetProto.getDefault = function (opts) { + if (!opts) opts = {} + var platformName = opts.platform || process.platform + var platform = this.defaults[platformName] || this.defaults.fallback + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + if (!platform[hasUnicode][hasColor]) { + if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { + hasUnicode = false + hasColor = false + } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (platform === this.defaults.fallback) { + throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + } + } + if (platform[hasUnicode][hasColor]) { + return this.getTheme(platform[hasUnicode][hasColor]) + } else { + return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) + } +} + +ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { + var err = new Error('Could not find a gauge theme named "' + name + '"') + Error.captureStackTrace.call(err, newMissingThemeError) + err.theme = name + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { + var err = new Error( + 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + + ' platform = ' + platformName + '\n' + + ' hasUnicode = ' + hasUnicode + '\n' + + ' hasColor = ' + hasColor) + Error.captureStackTrace.call(err, newMissingDefaultThemeError) + err.platform = platformName + err.hasUnicode = hasUnicode + err.hasColor = hasColor + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newThemeSet = function () { + var themeset = function (opts) { + return themeset.getDefault(opts) + } + return objectAssign(themeset, ThemeSetProto, { + themes: objectAssign({}, this.themes), + baseTheme: objectAssign({}, this.baseTheme), + defaults: JSON.parse(JSON.stringify(this.defaults || {})) + }) +} diff --git a/node_modules/gauge/themes.js b/node_modules/gauge/themes.js new file mode 100644 index 00000000..df1184db --- /dev/null +++ b/node_modules/gauge/themes.js @@ -0,0 +1,56 @@ +'use strict' +var color = require('console-control-strings').color +var ThemeSet = require('./theme-set.js') + +var themes = module.exports = new ThemeSet() + +themes.addTheme('ASCII', { + preProgressbar: '[', + postProgressbar: ']', + progressbarTheme: { + complete: '#', + remaining: '.' + }, + activityIndicatorTheme: '-\\|/', + preSubsection: '>' +}) + +themes.addTheme('colorASCII', themes.getTheme('ASCII'), { + progressbarTheme: { + preComplete: color('bgBrightWhite', 'brightWhite'), + complete: '#', + postComplete: color('reset'), + preRemaining: color('bgBrightBlack', 'brightBlack'), + remaining: '.', + postRemaining: color('reset') + } +}) + +themes.addTheme('brailleSpinner', { + preProgressbar: '⸨', + postProgressbar: '⸩', + progressbarTheme: { + complete: '#', + remaining: '⠂' + }, + activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', + preSubsection: '>' +}) + +themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { + progressbarTheme: { + preComplete: color('bgBrightWhite', 'brightWhite'), + complete: '#', + postComplete: color('reset'), + preRemaining: color('bgBrightBlack', 'brightBlack'), + remaining: '⠂', + postRemaining: color('reset') + } +}) + +themes.setDefault({}, 'ASCII') +themes.setDefault({hasColor: true}, 'colorASCII') +themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') +themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') +themes.setDefault({platform: 'linux', hasUnicode: true}, 'brailleSpinner') +themes.setDefault({platform: 'linux', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') diff --git a/node_modules/gauge/wide-truncate.js b/node_modules/gauge/wide-truncate.js new file mode 100644 index 00000000..c531bc49 --- /dev/null +++ b/node_modules/gauge/wide-truncate.js @@ -0,0 +1,25 @@ +'use strict' +var stringWidth = require('string-width') +var stripAnsi = require('strip-ansi') + +module.exports = wideTruncate + +function wideTruncate (str, target) { + if (stringWidth(str) === 0) return str + if (target <= 0) return '' + if (stringWidth(str) <= target) return str + + // We compute the number of bytes of ansi sequences here and add + // that to our initial truncation to ensure that we don't slice one + // that we want to keep in half. + var noAnsi = stripAnsi(str) + var ansiSize = str.length + noAnsi.length + var truncated = str.slice(0, target + ansiSize) + + // we have to shrink the result to account for our ansi sequence buffer + // (if an ansi sequence was truncated) and double width characters. + while (stringWidth(truncated) > target) { + truncated = truncated.slice(0, -1) + } + return truncated +} diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE new file mode 100644 index 00000000..42ca266d --- /dev/null +++ b/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md new file mode 100644 index 00000000..83f0c83a --- /dev/null +++ b/node_modules/glob/README.md @@ -0,0 +1,378 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![a fun cartoon logo made of glob characters](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. +* `fs` File-system object with Node's `fs` API. By default, the built-in + `fs` module will be used. Set to a volume provided by a library like + `memfs` to avoid using the "real" file-system. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js new file mode 100644 index 00000000..424c46e1 --- /dev/null +++ b/node_modules/glob/common.js @@ -0,0 +1,238 @@ +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var fs = require("fs") +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasort (a, b) { + return a.localeCompare(b, 'en') +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + self.fs = options.fs || fs + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + // always treat \ in patterns as escapes, not path separators + options.allowWindowsEscape = false + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js new file mode 100644 index 00000000..37a4d7e6 --- /dev/null +++ b/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + self.fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + self.fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + self.fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json new file mode 100644 index 00000000..5940b649 --- /dev/null +++ b/node_modules/glob/package.json @@ -0,0 +1,55 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "glob", + "description": "a little globber", + "version": "7.2.3", + "publishConfig": { + "tag": "v7-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "memfs": "^3.2.0", + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^15.0.6", + "tick": "0.0.6" + }, + "tap": { + "before": "test/00-setup.js", + "after": "test/zz-cleanup.js", + "jobs": 1 + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js new file mode 100644 index 00000000..2c4f4801 --- /dev/null +++ b/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert.ok(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert.ok(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/has-unicode/LICENSE b/node_modules/has-unicode/LICENSE new file mode 100644 index 00000000..d42e25e9 --- /dev/null +++ b/node_modules/has-unicode/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/has-unicode/README.md b/node_modules/has-unicode/README.md new file mode 100644 index 00000000..5a03e599 --- /dev/null +++ b/node_modules/has-unicode/README.md @@ -0,0 +1,43 @@ +has-unicode +=========== + +Try to guess if your terminal supports unicode + +```javascript +var hasUnicode = require("has-unicode") + +if (hasUnicode()) { + // the terminal probably has unicode support +} +``` +```javascript +var hasUnicode = require("has-unicode").tryHarder +hasUnicode(function(unicodeSupported) { + if (unicodeSupported) { + // the terminal probably has unicode support + } +}) +``` + +## Detecting Unicode + +What we actually detect is UTF-8 support, as that's what Node itself supports. +If you have a UTF-16 locale then you won't be detected as unicode capable. + +### Windows + +Since at least Windows 7, `cmd` and `powershell` have been unicode capable, +but unfortunately even then it's not guaranteed. In many localizations it +still uses legacy code pages and there's no facility short of running +programs or linking C++ that will let us detect this. As such, we +report any Windows installation as NOT unicode capable, and recommend +that you encourage your users to override this via config. + +### Unix Like Operating Systems + +We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in +that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. +For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient +for most POSIX systems. While locale data can be put in `/etc/locale.conf` +as well, AFAIK it's always copied into the environment. + diff --git a/node_modules/has-unicode/index.js b/node_modules/has-unicode/index.js new file mode 100644 index 00000000..9b0fe445 --- /dev/null +++ b/node_modules/has-unicode/index.js @@ -0,0 +1,16 @@ +"use strict" +var os = require("os") + +var hasUnicode = module.exports = function () { + // Recent Win32 platforms (>XP) CAN support unicode in the console but + // don't have to, and in non-english locales often use traditional local + // code pages. There's no way, short of windows system calls or execing + // the chcp command line program to figure this out. As such, we default + // this to false and encourage your users to override it via config if + // appropriate. + if (os.type() == "Windows_NT") { return false } + + var isUTF8 = /UTF-?8$/i + var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG + return isUTF8.test(ctype) +} diff --git a/node_modules/has-unicode/package.json b/node_modules/has-unicode/package.json new file mode 100644 index 00000000..ebe9d76d --- /dev/null +++ b/node_modules/has-unicode/package.json @@ -0,0 +1,30 @@ +{ + "name": "has-unicode", + "version": "2.0.1", + "description": "Try to guess if your terminal supports unicode", + "main": "index.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/has-unicode" + }, + "keywords": [ + "unicode", + "terminal" + ], + "files": [ + "index.js" + ], + "author": "Rebecca Turner ", + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/has-unicode/issues" + }, + "homepage": "https://github.com/iarna/has-unicode", + "devDependencies": { + "require-inject": "^1.3.0", + "tap": "^2.3.1" + } +} diff --git a/node_modules/https-proxy-agent/README.md b/node_modules/https-proxy-agent/README.md new file mode 100644 index 00000000..328656a9 --- /dev/null +++ b/node_modules/https-proxy-agent/README.md @@ -0,0 +1,137 @@ +https-proxy-agent +================ +### An HTTP(s) proxy `http.Agent` implementation for HTTPS +[![Build Status](https://github.com/TooTallNate/node-https-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI) + +This module provides an `http.Agent` implementation that connects to a specified +HTTP or HTTPS proxy server, and can be used with the built-in `https` module. + +Specifically, this `Agent` implementation connects to an intermediary "proxy" +server and issues the [CONNECT HTTP method][CONNECT], which tells the proxy to +open a direct TCP connection to the destination server. + +Since this agent implements the CONNECT HTTP method, it also works with other +protocols that use this method when connecting over proxies (i.e. WebSockets). +See the "Examples" section below for more. + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install https-proxy-agent +``` + + +Examples +-------- + +#### `https` module example + +``` js +var url = require('url'); +var https = require('https'); +var HttpsProxyAgent = require('https-proxy-agent'); + +// HTTP/HTTPS proxy to connect to +var proxy = process.env.http_proxy || 'http://168.63.76.32:3128'; +console.log('using proxy server %j', proxy); + +// HTTPS endpoint for the proxy to connect to +var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate'; +console.log('attempting to GET %j', endpoint); +var options = url.parse(endpoint); + +// create an instance of the `HttpsProxyAgent` class with the proxy server information +var agent = new HttpsProxyAgent(proxy); +options.agent = agent; + +https.get(options, function (res) { + console.log('"response" event!', res.headers); + res.pipe(process.stdout); +}); +``` + +#### `ws` WebSocket connection example + +``` js +var url = require('url'); +var WebSocket = require('ws'); +var HttpsProxyAgent = require('https-proxy-agent'); + +// HTTP/HTTPS proxy to connect to +var proxy = process.env.http_proxy || 'http://168.63.76.32:3128'; +console.log('using proxy server %j', proxy); + +// WebSocket endpoint for the proxy to connect to +var endpoint = process.argv[2] || 'ws://echo.websocket.org'; +var parsed = url.parse(endpoint); +console.log('attempting to connect to WebSocket %j', endpoint); + +// create an instance of the `HttpsProxyAgent` class with the proxy server information +var options = url.parse(proxy); + +var agent = new HttpsProxyAgent(options); + +// finally, initiate the WebSocket connection +var socket = new WebSocket(endpoint, { agent: agent }); + +socket.on('open', function () { + console.log('"open" event!'); + socket.send('hello world'); +}); + +socket.on('message', function (data, flags) { + console.log('"message" event! %j %j', data, flags); + socket.close(); +}); +``` + +API +--- + +### new HttpsProxyAgent(Object options) + +The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects +to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket +requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT]. + +The `options` argument may either be a string URI of the proxy server to use, or an +"options" object with more specific properties: + + * `host` - String - Proxy host to connect to (may use `hostname` as well). Required. + * `port` - Number - Proxy port to connect to. Required. + * `protocol` - String - If `https:`, then use TLS to connect to the proxy. + * `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method. + * Any other options given are passed to the `net.connect()`/`tls.connect()` functions. + + +License +------- + +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +[CONNECT]: http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_Tunneling diff --git a/node_modules/https-proxy-agent/dist/agent.d.ts b/node_modules/https-proxy-agent/dist/agent.d.ts new file mode 100644 index 00000000..4f1c6362 --- /dev/null +++ b/node_modules/https-proxy-agent/dist/agent.d.ts @@ -0,0 +1,30 @@ +/// +import net from 'net'; +import { Agent, ClientRequest, RequestOptions } from 'agent-base'; +import { HttpsProxyAgentOptions } from '.'; +/** + * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to + * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. + * + * Outgoing HTTP requests are first tunneled through the proxy server using the + * `CONNECT` HTTP request method to establish a connection to the proxy server, + * and then the proxy server connects to the destination target and issues the + * HTTP request from the proxy server. + * + * `https:` requests have their socket connection upgraded to TLS once + * the connection to the proxy server has been established. + * + * @api public + */ +export default class HttpsProxyAgent extends Agent { + private secureProxy; + private proxy; + constructor(_opts: string | HttpsProxyAgentOptions); + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req: ClientRequest, opts: RequestOptions): Promise; +} diff --git a/node_modules/https-proxy-agent/dist/agent.js b/node_modules/https-proxy-agent/dist/agent.js new file mode 100644 index 00000000..75d11364 --- /dev/null +++ b/node_modules/https-proxy-agent/dist/agent.js @@ -0,0 +1,177 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const net_1 = __importDefault(require("net")); +const tls_1 = __importDefault(require("tls")); +const url_1 = __importDefault(require("url")); +const assert_1 = __importDefault(require("assert")); +const debug_1 = __importDefault(require("debug")); +const agent_base_1 = require("agent-base"); +const parse_proxy_response_1 = __importDefault(require("./parse-proxy-response")); +const debug = debug_1.default('https-proxy-agent:agent'); +/** + * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to + * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. + * + * Outgoing HTTP requests are first tunneled through the proxy server using the + * `CONNECT` HTTP request method to establish a connection to the proxy server, + * and then the proxy server connects to the destination target and issues the + * HTTP request from the proxy server. + * + * `https:` requests have their socket connection upgraded to TLS once + * the connection to the proxy server has been established. + * + * @api public + */ +class HttpsProxyAgent extends agent_base_1.Agent { + constructor(_opts) { + let opts; + if (typeof _opts === 'string') { + opts = url_1.default.parse(_opts); + } + else { + opts = _opts; + } + if (!opts) { + throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); + } + debug('creating new HttpsProxyAgent instance: %o', opts); + super(opts); + const proxy = Object.assign({}, opts); + // If `true`, then connect to the proxy server over TLS. + // Defaults to `false`. + this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); + // Prefer `hostname` over `host`, and set the `port` if needed. + proxy.host = proxy.hostname || proxy.host; + if (typeof proxy.port === 'string') { + proxy.port = parseInt(proxy.port, 10); + } + if (!proxy.port && proxy.host) { + proxy.port = this.secureProxy ? 443 : 80; + } + // ALPN is supported by Node.js >= v5. + // attempt to negotiate http/1.1 for proxy servers that support http/2 + if (this.secureProxy && !('ALPNProtocols' in proxy)) { + proxy.ALPNProtocols = ['http 1.1']; + } + if (proxy.host && proxy.path) { + // If both a `host` and `path` are specified then it's most likely + // the result of a `url.parse()` call... we need to remove the + // `path` portion so that `net.connect()` doesn't attempt to open + // that as a Unix socket file. + delete proxy.path; + delete proxy.pathname; + } + this.proxy = proxy; + } + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req, opts) { + return __awaiter(this, void 0, void 0, function* () { + const { proxy, secureProxy } = this; + // Create a socket connection to the proxy server. + let socket; + if (secureProxy) { + debug('Creating `tls.Socket`: %o', proxy); + socket = tls_1.default.connect(proxy); + } + else { + debug('Creating `net.Socket`: %o', proxy); + socket = net_1.default.connect(proxy); + } + const headers = Object.assign({}, proxy.headers); + const hostname = `${opts.host}:${opts.port}`; + let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; + // Inject the `Proxy-Authorization` header if necessary. + if (proxy.auth) { + headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; + } + // The `Host` header should only include the port + // number when it is not the default port. + let { host, port, secureEndpoint } = opts; + if (!isDefaultPort(port, secureEndpoint)) { + host += `:${port}`; + } + headers.Host = host; + headers.Connection = 'close'; + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r\n`; + } + const proxyResponsePromise = parse_proxy_response_1.default(socket); + socket.write(`${payload}\r\n`); + const { statusCode, buffered } = yield proxyResponsePromise; + if (statusCode === 200) { + req.once('socket', resume); + if (opts.secureEndpoint) { + // The proxy is connecting to a TLS server, so upgrade + // this socket connection to a TLS connection. + debug('Upgrading socket connection to TLS'); + const servername = opts.servername || opts.host; + return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, + servername })); + } + return socket; + } + // Some other status code that's not 200... need to re-play the HTTP + // header "data" events onto the socket once the HTTP machinery is + // attached so that the node core `http` can parse and handle the + // error status code. + // Close the original socket, and a new "fake" socket is returned + // instead, so that the proxy doesn't get the HTTP request + // written to it (which may contain `Authorization` headers or other + // sensitive data). + // + // See: https://hackerone.com/reports/541502 + socket.destroy(); + const fakeSocket = new net_1.default.Socket({ writable: false }); + fakeSocket.readable = true; + // Need to wait for the "socket" event to re-play the "data" events. + req.once('socket', (s) => { + debug('replaying proxy buffer for failed request'); + assert_1.default(s.listenerCount('data') > 0); + // Replay the "buffered" Buffer onto the fake `socket`, since at + // this point the HTTP module machinery has been hooked up for + // the user. + s.push(buffered); + s.push(null); + }); + return fakeSocket; + }); + } +} +exports.default = HttpsProxyAgent; +function resume(socket) { + socket.resume(); +} +function isDefaultPort(port, secure) { + return Boolean((!secure && port === 80) || (secure && port === 443)); +} +function isHTTPS(protocol) { + return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; +} +function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; +} +//# sourceMappingURL=agent.js.map \ No newline at end of file diff --git a/node_modules/https-proxy-agent/dist/agent.js.map b/node_modules/https-proxy-agent/dist/agent.js.map new file mode 100644 index 00000000..0af6c17a --- /dev/null +++ b/node_modules/https-proxy-agent/dist/agent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,oDAA4B;AAC5B,kDAAgC;AAEhC,2CAAkE;AAElE,kFAAwD;AAExD,MAAM,KAAK,GAAG,eAAW,CAAC,yBAAyB,CAAC,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAqB,eAAgB,SAAQ,kBAAK;IAIjD,YAAY,KAAsC;QACjD,IAAI,IAA4B,CAAC;QACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,2CAA2C,EAAE,IAAI,CAAC,CAAC;QACzD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAAgC,IAAI,CAAE,CAAC;QAElD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,sCAAsC;QACtC,sEAAsE;QACtE,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,eAAe,IAAI,KAAK,CAAC,EAAE;YACpD,KAAK,CAAC,aAAa,GAAG,CAAC,UAAU,CAAC,CAAC;SACnC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAkB,EAClB,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YAEpC,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,MAAM,OAAO,qBAA6B,KAAK,CAAC,OAAO,CAAE,CAAC;YAC1D,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC7C,IAAI,OAAO,GAAG,WAAW,QAAQ,eAAe,CAAC;YAEjD,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACpD,KAAK,CAAC,IAAI,CACV,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;aACvB;YAED,iDAAiD;YACjD,0CAA0C;YAC1C,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;YAC1C,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE;gBACzC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;aACnB;YACD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;YAEpB,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC;YAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBACxC,OAAO,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;aAC3C;YAED,MAAM,oBAAoB,GAAG,8BAAkB,CAAC,MAAM,CAAC,CAAC;YAExD,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM,CAAC,CAAC;YAE/B,MAAM,EACL,UAAU,EACV,QAAQ,EACR,GAAG,MAAM,oBAAoB,CAAC;YAE/B,IAAI,UAAU,KAAK,GAAG,EAAE;gBACvB,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAE3B,IAAI,IAAI,CAAC,cAAc,EAAE;oBACxB,sDAAsD;oBACtD,8CAA8C;oBAC9C,KAAK,CAAC,oCAAoC,CAAC,CAAC;oBAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC;oBAChD,OAAO,aAAG,CAAC,OAAO,iCACd,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,KACjD,MAAM;wBACN,UAAU,IACT,CAAC;iBACH;gBAED,OAAO,MAAM,CAAC;aACd;YAED,oEAAoE;YACpE,kEAAkE;YAClE,iEAAiE;YACjE,qBAAqB;YAErB,iEAAiE;YACjE,0DAA0D;YAC1D,oEAAoE;YACpE,mBAAmB;YACnB,EAAE;YACF,4CAA4C;YAC5C,MAAM,CAAC,OAAO,EAAE,CAAC;YAEjB,MAAM,UAAU,GAAG,IAAI,aAAG,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;YACvD,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;YAE3B,oEAAoE;YACpE,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAa,EAAE,EAAE;gBACpC,KAAK,CAAC,2CAA2C,CAAC,CAAC;gBACnD,gBAAM,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBAEpC,gEAAgE;gBAChE,8DAA8D;gBAC9D,YAAY;gBACZ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACjB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACnB,CAAC;KAAA;CACD;AA3JD,kCA2JC;AAED,SAAS,MAAM,CAAC,MAAkC;IACjD,MAAM,CAAC,MAAM,EAAE,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,MAAe;IACnD,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED,SAAS,IAAI,CACZ,GAAM,EACN,GAAG,IAAO;IAIV,MAAM,GAAG,GAAG,EAEX,CAAC;IACF,IAAI,GAAqB,CAAC;IAC1B,KAAK,GAAG,IAAI,GAAG,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/node_modules/https-proxy-agent/dist/index.d.ts b/node_modules/https-proxy-agent/dist/index.d.ts new file mode 100644 index 00000000..0d60062e --- /dev/null +++ b/node_modules/https-proxy-agent/dist/index.d.ts @@ -0,0 +1,23 @@ +/// +import net from 'net'; +import tls from 'tls'; +import { Url } from 'url'; +import { AgentOptions } from 'agent-base'; +import { OutgoingHttpHeaders } from 'http'; +import _HttpsProxyAgent from './agent'; +declare function createHttpsProxyAgent(opts: string | createHttpsProxyAgent.HttpsProxyAgentOptions): _HttpsProxyAgent; +declare namespace createHttpsProxyAgent { + interface BaseHttpsProxyAgentOptions { + headers?: OutgoingHttpHeaders; + secureProxy?: boolean; + host?: string | null; + path?: string | null; + port?: string | number | null; + } + export interface HttpsProxyAgentOptions extends AgentOptions, BaseHttpsProxyAgentOptions, Partial> { + } + export type HttpsProxyAgent = _HttpsProxyAgent; + export const HttpsProxyAgent: typeof _HttpsProxyAgent; + export {}; +} +export = createHttpsProxyAgent; diff --git a/node_modules/https-proxy-agent/dist/index.js b/node_modules/https-proxy-agent/dist/index.js new file mode 100644 index 00000000..b03e7631 --- /dev/null +++ b/node_modules/https-proxy-agent/dist/index.js @@ -0,0 +1,14 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const agent_1 = __importDefault(require("./agent")); +function createHttpsProxyAgent(opts) { + return new agent_1.default(opts); +} +(function (createHttpsProxyAgent) { + createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; + createHttpsProxyAgent.prototype = agent_1.default.prototype; +})(createHttpsProxyAgent || (createHttpsProxyAgent = {})); +module.exports = createHttpsProxyAgent; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/https-proxy-agent/dist/index.js.map b/node_modules/https-proxy-agent/dist/index.js.map new file mode 100644 index 00000000..f3ce559d --- /dev/null +++ b/node_modules/https-proxy-agent/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAKA,oDAAuC;AAEvC,SAAS,qBAAqB,CAC7B,IAA2D;IAE3D,OAAO,IAAI,eAAgB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,WAAU,qBAAqB;IAoBjB,qCAAe,GAAG,eAAgB,CAAC;IAEhD,qBAAqB,CAAC,SAAS,GAAG,eAAgB,CAAC,SAAS,CAAC;AAC9D,CAAC,EAvBS,qBAAqB,KAArB,qBAAqB,QAuB9B;AAED,iBAAS,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts b/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts new file mode 100644 index 00000000..7565674a --- /dev/null +++ b/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts @@ -0,0 +1,7 @@ +/// +import { Readable } from 'stream'; +export interface ProxyResponse { + statusCode: number; + buffered: Buffer; +} +export default function parseProxyResponse(socket: Readable): Promise; diff --git a/node_modules/https-proxy-agent/dist/parse-proxy-response.js b/node_modules/https-proxy-agent/dist/parse-proxy-response.js new file mode 100644 index 00000000..aa5ce3cc --- /dev/null +++ b/node_modules/https-proxy-agent/dist/parse-proxy-response.js @@ -0,0 +1,66 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const debug_1 = __importDefault(require("debug")); +const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); +function parseProxyResponse(socket) { + return new Promise((resolve, reject) => { + // we need to buffer any HTTP traffic that happens with the proxy before we get + // the CONNECT response, so that if the response is anything other than an "200" + // response code, then we can re-play the "data" events on the socket once the + // HTTP parser is hooked up... + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once('readable', read); + } + function cleanup() { + socket.removeListener('end', onend); + socket.removeListener('error', onerror); + socket.removeListener('close', onclose); + socket.removeListener('readable', read); + } + function onclose(err) { + debug('onclose had error %o', err); + } + function onend() { + debug('onend'); + } + function onerror(err) { + cleanup(); + debug('onerror %o', err); + reject(err); + } + function ondata(b) { + buffers.push(b); + buffersLength += b.length; + const buffered = Buffer.concat(buffers, buffersLength); + const endOfHeaders = buffered.indexOf('\r\n\r\n'); + if (endOfHeaders === -1) { + // keep buffering + debug('have not received end of HTTP headers yet...'); + read(); + return; + } + const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); + const statusCode = +firstLine.split(' ')[1]; + debug('got proxy server response: %o', firstLine); + resolve({ + statusCode, + buffered + }); + } + socket.on('error', onerror); + socket.on('close', onclose); + socket.on('end', onend); + read(); + }); +} +exports.default = parseProxyResponse; +//# sourceMappingURL=parse-proxy-response.js.map \ No newline at end of file diff --git a/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map b/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map new file mode 100644 index 00000000..bacdb84b --- /dev/null +++ b/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-proxy-response.js","sourceRoot":"","sources":["../src/parse-proxy-response.ts"],"names":[],"mappings":";;;;;AAAA,kDAAgC;AAGhC,MAAM,KAAK,GAAG,eAAW,CAAC,wCAAwC,CAAC,CAAC;AAOpE,SAAwB,kBAAkB,CACzC,MAAgB;IAEhB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,+EAA+E;QAC/E,gFAAgF;QAChF,8EAA8E;QAC9E,8BAA8B;QAC9B,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,SAAS,IAAI;YACZ,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;;gBACZ,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC;QAED,SAAS,OAAO;YACf,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACpC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QAED,SAAS,OAAO,CAAC,GAAW;YAC3B,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;QACpC,CAAC;QAED,SAAS,KAAK;YACb,KAAK,CAAC,OAAO,CAAC,CAAC;QAChB,CAAC;QAED,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QAED,SAAS,MAAM,CAAC,CAAS;YACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,aAAa,IAAI,CAAC,CAAC,MAAM,CAAC;YAE1B,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;YACvD,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAElD,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE;gBACxB,iBAAiB;gBACjB,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBACtD,IAAI,EAAE,CAAC;gBACP,OAAO;aACP;YAED,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAClC,OAAO,EACP,CAAC,EACD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CACxB,CAAC;YACF,MAAM,UAAU,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,KAAK,CAAC,+BAA+B,EAAE,SAAS,CAAC,CAAC;YAClD,OAAO,CAAC;gBACP,UAAU;gBACV,QAAQ;aACR,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAExB,IAAI,EAAE,CAAC;IACR,CAAC,CAAC,CAAC;AACJ,CAAC;AAvED,qCAuEC"} \ No newline at end of file diff --git a/node_modules/https-proxy-agent/node_modules/debug/LICENSE b/node_modules/https-proxy-agent/node_modules/debug/LICENSE new file mode 100644 index 00000000..1a9820e2 --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/debug/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/https-proxy-agent/node_modules/debug/README.md b/node_modules/https-proxy-agent/node_modules/debug/README.md new file mode 100644 index 00000000..e9c3e047 --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/debug/README.md @@ -0,0 +1,481 @@ +# debug +[![Build Status](https://travis-ci.org/debug-js/debug.svg?branch=master)](https://travis-ci.org/debug-js/debug) [![Coverage Status](https://coveralls.io/repos/github/debug-js/debug/badge.svg?branch=master)](https://coveralls.io/github/debug-js/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. + + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +`disable()` + +Will disable all namespaces. The functions returns the namespaces currently +enabled (and skipped). This can be useful if you want to disable debugging +temporarily without knowing what was enabled to begin with. + +For example: + +```js +let debug = require('debug'); +debug.enable('foo:*,-foo:bar'); +let namespaces = debug.disable(); +debug.enable(namespaces); +``` + +Note: There is no guarantee that the string will be identical to the initial +enable string, but semantically they will be identical. + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + +## Usage in child processes + +Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. +For example: + +```javascript +worker = fork(WORKER_WRAP_PATH, [workerPath], { + stdio: [ + /* stdin: */ 0, + /* stdout: */ 'pipe', + /* stderr: */ 'pipe', + 'ipc', + ], + env: Object.assign({}, process.env, { + DEBUG_COLORS: 1 // without this settings, colors won't be shown + }), +}); + +worker.stderr.pipe(process.stderr, { end: false }); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + - Josh Junon + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/https-proxy-agent/node_modules/debug/package.json b/node_modules/https-proxy-agent/node_modules/debug/package.json new file mode 100644 index 00000000..3bcdc242 --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/debug/package.json @@ -0,0 +1,59 @@ +{ + "name": "debug", + "version": "4.3.4", + "repository": { + "type": "git", + "url": "git://github.com/debug-js/debug.git" + }, + "description": "Lightweight debugging utility for Node.js and the browser", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "Josh Junon ", + "contributors": [ + "TJ Holowaychuk ", + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "istanbul cover _mocha -- test.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, + "dependencies": { + "ms": "2.1.2" + }, + "devDependencies": { + "brfs": "^2.0.1", + "browserify": "^16.2.3", + "coveralls": "^3.0.2", + "istanbul": "^0.4.5", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "xo": "^0.23.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + } +} diff --git a/node_modules/https-proxy-agent/node_modules/debug/src/browser.js b/node_modules/https-proxy-agent/node_modules/debug/src/browser.js new file mode 100644 index 00000000..cd0fc35d --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/debug/src/browser.js @@ -0,0 +1,269 @@ +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; diff --git a/node_modules/https-proxy-agent/node_modules/debug/src/common.js b/node_modules/https-proxy-agent/node_modules/debug/src/common.js new file mode 100644 index 00000000..e3291b20 --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/debug/src/common.js @@ -0,0 +1,274 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; diff --git a/node_modules/https-proxy-agent/node_modules/debug/src/index.js b/node_modules/https-proxy-agent/node_modules/debug/src/index.js new file mode 100644 index 00000000..bf4c57f2 --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/https-proxy-agent/node_modules/debug/src/node.js b/node_modules/https-proxy-agent/node_modules/debug/src/node.js new file mode 100644 index 00000000..79bc085c --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/debug/src/node.js @@ -0,0 +1,263 @@ +/** + * Module dependencies. + */ + +const tty = require('tty'); +const util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + */ + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; + +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; diff --git a/node_modules/https-proxy-agent/node_modules/ms/index.js b/node_modules/https-proxy-agent/node_modules/ms/index.js new file mode 100644 index 00000000..c4498bcc --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/node_modules/https-proxy-agent/node_modules/ms/license.md b/node_modules/https-proxy-agent/node_modules/ms/license.md new file mode 100644 index 00000000..69b61253 --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/https-proxy-agent/node_modules/ms/package.json b/node_modules/https-proxy-agent/node_modules/ms/package.json new file mode 100644 index 00000000..eea666e1 --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/ms/package.json @@ -0,0 +1,37 @@ +{ + "name": "ms", + "version": "2.1.2", + "description": "Tiny millisecond conversion utility", + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.12.1", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1" + } +} diff --git a/node_modules/https-proxy-agent/node_modules/ms/readme.md b/node_modules/https-proxy-agent/node_modules/ms/readme.md new file mode 100644 index 00000000..9a1996b1 --- /dev/null +++ b/node_modules/https-proxy-agent/node_modules/ms/readme.md @@ -0,0 +1,60 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/https-proxy-agent/package.json b/node_modules/https-proxy-agent/package.json new file mode 100644 index 00000000..fb2aba1b --- /dev/null +++ b/node_modules/https-proxy-agent/package.json @@ -0,0 +1,56 @@ +{ + "name": "https-proxy-agent", + "version": "5.0.1", + "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", + "main": "dist/index", + "types": "dist/index", + "files": [ + "dist" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "test": "mocha --reporter spec", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-https-proxy-agent.git" + }, + "keywords": [ + "https", + "proxy", + "endpoint", + "agent" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues" + }, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "devDependencies": { + "@types/debug": "4", + "@types/node": "^12.12.11", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.2", + "proxy": "1", + "rimraf": "^3.0.0", + "typescript": "^3.5.3" + }, + "engines": { + "node": ">= 6" + } +} diff --git a/node_modules/inflight/LICENSE b/node_modules/inflight/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/inflight/README.md b/node_modules/inflight/README.md new file mode 100644 index 00000000..6dc89291 --- /dev/null +++ b/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js new file mode 100644 index 00000000..48202b3c --- /dev/null +++ b/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json new file mode 100644 index 00000000..6084d350 --- /dev/null +++ b/node_modules/inflight/package.json @@ -0,0 +1,29 @@ +{ + "name": "inflight", + "version": "1.0.6", + "description": "Add callbacks to requests in flight to avoid async duplication", + "main": "inflight.js", + "files": [ + "inflight.js" + ], + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.1.2" + }, + "scripts": { + "test": "tap test.js --100" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/inflight.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC" +} diff --git a/node_modules/is-fullwidth-code-point/index.d.ts b/node_modules/is-fullwidth-code-point/index.d.ts new file mode 100644 index 00000000..729d2020 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/index.d.ts @@ -0,0 +1,17 @@ +/** +Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms). + +@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. + +@example +``` +import isFullwidthCodePoint from 'is-fullwidth-code-point'; + +isFullwidthCodePoint('谢'.codePointAt(0)); +//=> true + +isFullwidthCodePoint('a'.codePointAt(0)); +//=> false +``` +*/ +export default function isFullwidthCodePoint(codePoint: number): boolean; diff --git a/node_modules/is-fullwidth-code-point/index.js b/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000..671f97f7 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,50 @@ +/* eslint-disable yoda */ +'use strict'; + +const isFullwidthCodePoint = codePoint => { + if (Number.isNaN(codePoint)) { + return false; + } + + // Code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + codePoint >= 0x1100 && ( + codePoint <= 0x115F || // Hangul Jamo + codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET + codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= codePoint && codePoint <= 0x4DBF) || + // CJK Unified Ideographs .. Yi Radicals + (0x4E00 <= codePoint && codePoint <= 0xA4C6) || + // Hangul Jamo Extended-A + (0xA960 <= codePoint && codePoint <= 0xA97C) || + // Hangul Syllables + (0xAC00 <= codePoint && codePoint <= 0xD7A3) || + // CJK Compatibility Ideographs + (0xF900 <= codePoint && codePoint <= 0xFAFF) || + // Vertical Forms + (0xFE10 <= codePoint && codePoint <= 0xFE19) || + // CJK Compatibility Forms .. Small Form Variants + (0xFE30 <= codePoint && codePoint <= 0xFE6B) || + // Halfwidth and Fullwidth Forms + (0xFF01 <= codePoint && codePoint <= 0xFF60) || + (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || + // Kana Supplement + (0x1B000 <= codePoint && codePoint <= 0x1B001) || + // Enclosed Ideographic Supplement + (0x1F200 <= codePoint && codePoint <= 0x1F251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= codePoint && codePoint <= 0x3FFFD) + ) + ) { + return true; + } + + return false; +}; + +module.exports = isFullwidthCodePoint; +module.exports.default = isFullwidthCodePoint; diff --git a/node_modules/is-fullwidth-code-point/license b/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/is-fullwidth-code-point/package.json b/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000..2137e888 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,42 @@ +{ + "name": "is-fullwidth-code-point", + "version": "3.0.0", + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "license": "MIT", + "repository": "sindresorhus/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "string", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/is-fullwidth-code-point/readme.md b/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000..4236bba9 --- /dev/null +++ b/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt(0)); +//=> true + +isFullwidthCodePoint('a'.codePointAt(0)); +//=> false +``` + + +## API + +### isFullwidthCodePoint(codePoint) + +#### codePoint + +Type: `number` + +The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/jsonwebtoken/LICENSE b/node_modules/jsonwebtoken/LICENSE new file mode 100644 index 00000000..bcd1854c --- /dev/null +++ b/node_modules/jsonwebtoken/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Auth0, Inc. (http://auth0.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jsonwebtoken/README.md b/node_modules/jsonwebtoken/README.md new file mode 100644 index 00000000..4e20dd9c --- /dev/null +++ b/node_modules/jsonwebtoken/README.md @@ -0,0 +1,396 @@ +# jsonwebtoken + +| **Build** | **Dependency** | +|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| +| [![Build Status](https://secure.travis-ci.org/auth0/node-jsonwebtoken.svg?branch=master)](http://travis-ci.org/auth0/node-jsonwebtoken) | [![Dependency Status](https://david-dm.org/auth0/node-jsonwebtoken.svg)](https://david-dm.org/auth0/node-jsonwebtoken) | + + +An implementation of [JSON Web Tokens](https://tools.ietf.org/html/rfc7519). + +This was developed against `draft-ietf-oauth-json-web-token-08`. It makes use of [node-jws](https://github.com/brianloveswords/node-jws) + +# Install + +```bash +$ npm install jsonwebtoken +``` + +# Migration notes + +* [From v8 to v9](https://github.com/auth0/node-jsonwebtoken/wiki/Migration-Notes:-v8-to-v9) +* [From v7 to v8](https://github.com/auth0/node-jsonwebtoken/wiki/Migration-Notes:-v7-to-v8) + +# Usage + +### jwt.sign(payload, secretOrPrivateKey, [options, callback]) + +(Asynchronous) If a callback is supplied, the callback is called with the `err` or the JWT. + +(Synchronous) Returns the JsonWebToken as string + +`payload` could be an object literal, buffer or string representing valid JSON. +> **Please _note_ that** `exp` or any other claim is only set if the payload is an object literal. Buffer or string payloads are not checked for JSON validity. + +> If `payload` is not a buffer or a string, it will be coerced into a string using `JSON.stringify`. + +`secretOrPrivateKey` is a string (utf-8 encoded), buffer, object, or KeyObject containing either the secret for HMAC algorithms or the PEM +encoded private key for RSA and ECDSA. In case of a private key with passphrase an object `{ key, passphrase }` can be used (based on [crypto documentation](https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format)), in this case be sure you pass the `algorithm` option. +When signing with RSA algorithms the minimum modulus length is 2048 except when the allowInsecureKeySizes option is set to true. Private keys below this size will be rejected with an error. + +`options`: + +* `algorithm` (default: `HS256`) +* `expiresIn`: expressed in seconds or a string describing a time span [vercel/ms](https://github.com/vercel/ms). + > Eg: `60`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`). +* `notBefore`: expressed in seconds or a string describing a time span [vercel/ms](https://github.com/vercel/ms). + > Eg: `60`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`). +* `audience` +* `issuer` +* `jwtid` +* `subject` +* `noTimestamp` +* `header` +* `keyid` +* `mutatePayload`: if true, the sign function will modify the payload object directly. This is useful if you need a raw reference to the payload after claims have been applied to it but before it has been encoded into a token. +* `allowInsecureKeySizes`: if true allows private keys with a modulus below 2048 to be used for RSA +* `allowInvalidAsymmetricKeyTypes`: if true, allows asymmetric keys which do not match the specified algorithm. This option is intended only for backwards compatability and should be avoided. + + + +> There are no default values for `expiresIn`, `notBefore`, `audience`, `subject`, `issuer`. These claims can also be provided in the payload directly with `exp`, `nbf`, `aud`, `sub` and `iss` respectively, but you **_can't_** include in both places. + +Remember that `exp`, `nbf` and `iat` are **NumericDate**, see related [Token Expiration (exp claim)](#token-expiration-exp-claim) + + +The header can be customized via the `options.header` object. + +Generated jwts will include an `iat` (issued at) claim by default unless `noTimestamp` is specified. If `iat` is inserted in the payload, it will be used instead of the real timestamp for calculating other things like `exp` given a timespan in `options.expiresIn`. + +Synchronous Sign with default (HMAC SHA256) + +```js +var jwt = require('jsonwebtoken'); +var token = jwt.sign({ foo: 'bar' }, 'shhhhh'); +``` + +Synchronous Sign with RSA SHA256 +```js +// sign with RSA SHA256 +var privateKey = fs.readFileSync('private.key'); +var token = jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256' }); +``` + +Sign asynchronously +```js +jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256' }, function(err, token) { + console.log(token); +}); +``` + +Backdate a jwt 30 seconds +```js +var older_token = jwt.sign({ foo: 'bar', iat: Math.floor(Date.now() / 1000) - 30 }, 'shhhhh'); +``` + +#### Token Expiration (exp claim) + +The standard for JWT defines an `exp` claim for expiration. The expiration is represented as a **NumericDate**: + +> A JSON numeric value representing the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap seconds. This is equivalent to the IEEE Std 1003.1, 2013 Edition [POSIX.1] definition "Seconds Since the Epoch", in which each day is accounted for by exactly 86400 seconds, other than that non-integer values can be represented. See RFC 3339 [RFC3339] for details regarding date/times in general and UTC in particular. + +This means that the `exp` field should contain the number of seconds since the epoch. + +Signing a token with 1 hour of expiration: + +```javascript +jwt.sign({ + exp: Math.floor(Date.now() / 1000) + (60 * 60), + data: 'foobar' +}, 'secret'); +``` + +Another way to generate a token like this with this library is: + +```javascript +jwt.sign({ + data: 'foobar' +}, 'secret', { expiresIn: 60 * 60 }); + +//or even better: + +jwt.sign({ + data: 'foobar' +}, 'secret', { expiresIn: '1h' }); +``` + +### jwt.verify(token, secretOrPublicKey, [options, callback]) + +(Asynchronous) If a callback is supplied, function acts asynchronously. The callback is called with the decoded payload if the signature is valid and optional expiration, audience, or issuer are valid. If not, it will be called with the error. + +(Synchronous) If a callback is not supplied, function acts synchronously. Returns the payload decoded if the signature is valid and optional expiration, audience, or issuer are valid. If not, it will throw the error. + +> __Warning:__ When the token comes from an untrusted source (e.g. user input or external requests), the returned decoded payload should be treated like any other user input; please make sure to sanitize and only work with properties that are expected + +`token` is the JsonWebToken string + +`secretOrPublicKey` is a string (utf-8 encoded), buffer, or KeyObject containing either the secret for HMAC algorithms, or the PEM +encoded public key for RSA and ECDSA. +If `jwt.verify` is called asynchronous, `secretOrPublicKey` can be a function that should fetch the secret or public key. See below for a detailed example + +As mentioned in [this comment](https://github.com/auth0/node-jsonwebtoken/issues/208#issuecomment-231861138), there are other libraries that expect base64 encoded secrets (random bytes encoded using base64), if that is your case you can pass `Buffer.from(secret, 'base64')`, by doing this the secret will be decoded using base64 and the token verification will use the original random bytes. + +`options` + +* `algorithms`: List of strings with the names of the allowed algorithms. For instance, `["HS256", "HS384"]`. + > If not specified a defaults will be used based on the type of key provided + > * secret - ['HS256', 'HS384', 'HS512'] + > * rsa - ['RS256', 'RS384', 'RS512'] + > * ec - ['ES256', 'ES384', 'ES512'] + > * default - ['RS256', 'RS384', 'RS512'] +* `audience`: if you want to check audience (`aud`), provide a value here. The audience can be checked against a string, a regular expression or a list of strings and/or regular expressions. + > Eg: `"urn:foo"`, `/urn:f[o]{2}/`, `[/urn:f[o]{2}/, "urn:bar"]` +* `complete`: return an object with the decoded `{ payload, header, signature }` instead of only the usual content of the payload. +* `issuer` (optional): string or array of strings of valid values for the `iss` field. +* `jwtid` (optional): if you want to check JWT ID (`jti`), provide a string value here. +* `ignoreExpiration`: if `true` do not validate the expiration of the token. +* `ignoreNotBefore`... +* `subject`: if you want to check subject (`sub`), provide a value here +* `clockTolerance`: number of seconds to tolerate when checking the `nbf` and `exp` claims, to deal with small clock differences among different servers +* `maxAge`: the maximum allowed age for tokens to still be valid. It is expressed in seconds or a string describing a time span [vercel/ms](https://github.com/vercel/ms). + > Eg: `1000`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`). +* `clockTimestamp`: the time in seconds that should be used as the current time for all necessary comparisons. +* `nonce`: if you want to check `nonce` claim, provide a string value here. It is used on Open ID for the ID Tokens. ([Open ID implementation notes](https://openid.net/specs/openid-connect-core-1_0.html#NonceNotes)) +* `allowInvalidAsymmetricKeyTypes`: if true, allows asymmetric keys which do not match the specified algorithm. This option is intended only for backwards compatability and should be avoided. + +```js +// verify a token symmetric - synchronous +var decoded = jwt.verify(token, 'shhhhh'); +console.log(decoded.foo) // bar + +// verify a token symmetric +jwt.verify(token, 'shhhhh', function(err, decoded) { + console.log(decoded.foo) // bar +}); + +// invalid token - synchronous +try { + var decoded = jwt.verify(token, 'wrong-secret'); +} catch(err) { + // err +} + +// invalid token +jwt.verify(token, 'wrong-secret', function(err, decoded) { + // err + // decoded undefined +}); + +// verify a token asymmetric +var cert = fs.readFileSync('public.pem'); // get public key +jwt.verify(token, cert, function(err, decoded) { + console.log(decoded.foo) // bar +}); + +// verify audience +var cert = fs.readFileSync('public.pem'); // get public key +jwt.verify(token, cert, { audience: 'urn:foo' }, function(err, decoded) { + // if audience mismatch, err == invalid audience +}); + +// verify issuer +var cert = fs.readFileSync('public.pem'); // get public key +jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer' }, function(err, decoded) { + // if issuer mismatch, err == invalid issuer +}); + +// verify jwt id +var cert = fs.readFileSync('public.pem'); // get public key +jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer', jwtid: 'jwtid' }, function(err, decoded) { + // if jwt id mismatch, err == invalid jwt id +}); + +// verify subject +var cert = fs.readFileSync('public.pem'); // get public key +jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer', jwtid: 'jwtid', subject: 'subject' }, function(err, decoded) { + // if subject mismatch, err == invalid subject +}); + +// alg mismatch +var cert = fs.readFileSync('public.pem'); // get public key +jwt.verify(token, cert, { algorithms: ['RS256'] }, function (err, payload) { + // if token alg != RS256, err == invalid signature +}); + +// Verify using getKey callback +// Example uses https://github.com/auth0/node-jwks-rsa as a way to fetch the keys. +var jwksClient = require('jwks-rsa'); +var client = jwksClient({ + jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json' +}); +function getKey(header, callback){ + client.getSigningKey(header.kid, function(err, key) { + var signingKey = key.publicKey || key.rsaPublicKey; + callback(null, signingKey); + }); +} + +jwt.verify(token, getKey, options, function(err, decoded) { + console.log(decoded.foo) // bar +}); + +``` + +
+Need to peek into a JWT without verifying it? (Click to expand) + +### jwt.decode(token [, options]) + +(Synchronous) Returns the decoded payload without verifying if the signature is valid. + +> __Warning:__ This will __not__ verify whether the signature is valid. You should __not__ use this for untrusted messages. You most likely want to use `jwt.verify` instead. + +> __Warning:__ When the token comes from an untrusted source (e.g. user input or external request), the returned decoded payload should be treated like any other user input; please make sure to sanitize and only work with properties that are expected + + +`token` is the JsonWebToken string + +`options`: + +* `json`: force JSON.parse on the payload even if the header doesn't contain `"typ":"JWT"`. +* `complete`: return an object with the decoded payload and header. + +Example + +```js +// get the decoded payload ignoring signature, no secretOrPrivateKey needed +var decoded = jwt.decode(token); + +// get the decoded payload and header +var decoded = jwt.decode(token, {complete: true}); +console.log(decoded.header); +console.log(decoded.payload) +``` + +
+ +## Errors & Codes +Possible thrown errors during verification. +Error is the first argument of the verification callback. + +### TokenExpiredError + +Thrown error if the token is expired. + +Error object: + +* name: 'TokenExpiredError' +* message: 'jwt expired' +* expiredAt: [ExpDate] + +```js +jwt.verify(token, 'shhhhh', function(err, decoded) { + if (err) { + /* + err = { + name: 'TokenExpiredError', + message: 'jwt expired', + expiredAt: 1408621000 + } + */ + } +}); +``` + +### JsonWebTokenError +Error object: + +* name: 'JsonWebTokenError' +* message: + * 'invalid token' - the header or payload could not be parsed + * 'jwt malformed' - the token does not have three components (delimited by a `.`) + * 'jwt signature is required' + * 'invalid signature' + * 'jwt audience invalid. expected: [OPTIONS AUDIENCE]' + * 'jwt issuer invalid. expected: [OPTIONS ISSUER]' + * 'jwt id invalid. expected: [OPTIONS JWT ID]' + * 'jwt subject invalid. expected: [OPTIONS SUBJECT]' + +```js +jwt.verify(token, 'shhhhh', function(err, decoded) { + if (err) { + /* + err = { + name: 'JsonWebTokenError', + message: 'jwt malformed' + } + */ + } +}); +``` + +### NotBeforeError +Thrown if current time is before the nbf claim. + +Error object: + +* name: 'NotBeforeError' +* message: 'jwt not active' +* date: 2018-10-04T16:10:44.000Z + +```js +jwt.verify(token, 'shhhhh', function(err, decoded) { + if (err) { + /* + err = { + name: 'NotBeforeError', + message: 'jwt not active', + date: 2018-10-04T16:10:44.000Z + } + */ + } +}); +``` + + +## Algorithms supported + +Array of supported algorithms. The following algorithms are currently supported. + +| alg Parameter Value | Digital Signature or MAC Algorithm | +|---------------------|------------------------------------------------------------------------| +| HS256 | HMAC using SHA-256 hash algorithm | +| HS384 | HMAC using SHA-384 hash algorithm | +| HS512 | HMAC using SHA-512 hash algorithm | +| RS256 | RSASSA-PKCS1-v1_5 using SHA-256 hash algorithm | +| RS384 | RSASSA-PKCS1-v1_5 using SHA-384 hash algorithm | +| RS512 | RSASSA-PKCS1-v1_5 using SHA-512 hash algorithm | +| PS256 | RSASSA-PSS using SHA-256 hash algorithm (only node ^6.12.0 OR >=8.0.0) | +| PS384 | RSASSA-PSS using SHA-384 hash algorithm (only node ^6.12.0 OR >=8.0.0) | +| PS512 | RSASSA-PSS using SHA-512 hash algorithm (only node ^6.12.0 OR >=8.0.0) | +| ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm | +| ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm | +| ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm | +| none | No digital signature or MAC value included | + +## Refreshing JWTs + +First of all, we recommend you to think carefully if auto-refreshing a JWT will not introduce any vulnerability in your system. + +We are not comfortable including this as part of the library, however, you can take a look at [this example](https://gist.github.com/ziluvatar/a3feb505c4c0ec37059054537b38fc48) to show how this could be accomplished. +Apart from that example there are [an issue](https://github.com/auth0/node-jsonwebtoken/issues/122) and [a pull request](https://github.com/auth0/node-jsonwebtoken/pull/172) to get more knowledge about this topic. + +# TODO + +* X.509 certificate chain is not checked + +## Issue Reporting + +If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues. + +## Author + +[Auth0](https://auth0.com) + +## License + +This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info. diff --git a/node_modules/jsonwebtoken/decode.js b/node_modules/jsonwebtoken/decode.js new file mode 100644 index 00000000..8fe1adcd --- /dev/null +++ b/node_modules/jsonwebtoken/decode.js @@ -0,0 +1,30 @@ +var jws = require('jws'); + +module.exports = function (jwt, options) { + options = options || {}; + var decoded = jws.decode(jwt, options); + if (!decoded) { return null; } + var payload = decoded.payload; + + //try parse the payload + if(typeof payload === 'string') { + try { + var obj = JSON.parse(payload); + if(obj !== null && typeof obj === 'object') { + payload = obj; + } + } catch (e) { } + } + + //return header if `complete` option is enabled. header includes claims + //such as `kid` and `alg` used to select the key within a JWKS needed to + //verify the signature + if (options.complete === true) { + return { + header: decoded.header, + payload: payload, + signature: decoded.signature + }; + } + return payload; +}; diff --git a/node_modules/jsonwebtoken/index.js b/node_modules/jsonwebtoken/index.js new file mode 100644 index 00000000..161eb2dd --- /dev/null +++ b/node_modules/jsonwebtoken/index.js @@ -0,0 +1,8 @@ +module.exports = { + decode: require('./decode'), + verify: require('./verify'), + sign: require('./sign'), + JsonWebTokenError: require('./lib/JsonWebTokenError'), + NotBeforeError: require('./lib/NotBeforeError'), + TokenExpiredError: require('./lib/TokenExpiredError'), +}; diff --git a/node_modules/jsonwebtoken/lib/JsonWebTokenError.js b/node_modules/jsonwebtoken/lib/JsonWebTokenError.js new file mode 100644 index 00000000..e068222a --- /dev/null +++ b/node_modules/jsonwebtoken/lib/JsonWebTokenError.js @@ -0,0 +1,14 @@ +var JsonWebTokenError = function (message, error) { + Error.call(this, message); + if(Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + this.name = 'JsonWebTokenError'; + this.message = message; + if (error) this.inner = error; +}; + +JsonWebTokenError.prototype = Object.create(Error.prototype); +JsonWebTokenError.prototype.constructor = JsonWebTokenError; + +module.exports = JsonWebTokenError; diff --git a/node_modules/jsonwebtoken/lib/NotBeforeError.js b/node_modules/jsonwebtoken/lib/NotBeforeError.js new file mode 100644 index 00000000..7b30084f --- /dev/null +++ b/node_modules/jsonwebtoken/lib/NotBeforeError.js @@ -0,0 +1,13 @@ +var JsonWebTokenError = require('./JsonWebTokenError'); + +var NotBeforeError = function (message, date) { + JsonWebTokenError.call(this, message); + this.name = 'NotBeforeError'; + this.date = date; +}; + +NotBeforeError.prototype = Object.create(JsonWebTokenError.prototype); + +NotBeforeError.prototype.constructor = NotBeforeError; + +module.exports = NotBeforeError; \ No newline at end of file diff --git a/node_modules/jsonwebtoken/lib/TokenExpiredError.js b/node_modules/jsonwebtoken/lib/TokenExpiredError.js new file mode 100644 index 00000000..abb704f2 --- /dev/null +++ b/node_modules/jsonwebtoken/lib/TokenExpiredError.js @@ -0,0 +1,13 @@ +var JsonWebTokenError = require('./JsonWebTokenError'); + +var TokenExpiredError = function (message, expiredAt) { + JsonWebTokenError.call(this, message); + this.name = 'TokenExpiredError'; + this.expiredAt = expiredAt; +}; + +TokenExpiredError.prototype = Object.create(JsonWebTokenError.prototype); + +TokenExpiredError.prototype.constructor = TokenExpiredError; + +module.exports = TokenExpiredError; \ No newline at end of file diff --git a/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js b/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js new file mode 100644 index 00000000..a6ede56e --- /dev/null +++ b/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js @@ -0,0 +1,3 @@ +const semver = require('semver'); + +module.exports = semver.satisfies(process.version, '>=15.7.0'); diff --git a/node_modules/jsonwebtoken/lib/psSupported.js b/node_modules/jsonwebtoken/lib/psSupported.js new file mode 100644 index 00000000..8c04144a --- /dev/null +++ b/node_modules/jsonwebtoken/lib/psSupported.js @@ -0,0 +1,3 @@ +var semver = require('semver'); + +module.exports = semver.satisfies(process.version, '^6.12.0 || >=8.0.0'); diff --git a/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js b/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js new file mode 100644 index 00000000..7fcf3684 --- /dev/null +++ b/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js @@ -0,0 +1,3 @@ +const semver = require('semver'); + +module.exports = semver.satisfies(process.version, '>=16.9.0'); diff --git a/node_modules/jsonwebtoken/lib/timespan.js b/node_modules/jsonwebtoken/lib/timespan.js new file mode 100644 index 00000000..e5098690 --- /dev/null +++ b/node_modules/jsonwebtoken/lib/timespan.js @@ -0,0 +1,18 @@ +var ms = require('ms'); + +module.exports = function (time, iat) { + var timestamp = iat || Math.floor(Date.now() / 1000); + + if (typeof time === 'string') { + var milliseconds = ms(time); + if (typeof milliseconds === 'undefined') { + return; + } + return Math.floor(timestamp + milliseconds / 1000); + } else if (typeof time === 'number') { + return timestamp + time; + } else { + return; + } + +}; \ No newline at end of file diff --git a/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js b/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js new file mode 100644 index 00000000..c10340b0 --- /dev/null +++ b/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js @@ -0,0 +1,66 @@ +const ASYMMETRIC_KEY_DETAILS_SUPPORTED = require('./asymmetricKeyDetailsSupported'); +const RSA_PSS_KEY_DETAILS_SUPPORTED = require('./rsaPssKeyDetailsSupported'); + +const allowedAlgorithmsForKeys = { + 'ec': ['ES256', 'ES384', 'ES512'], + 'rsa': ['RS256', 'PS256', 'RS384', 'PS384', 'RS512', 'PS512'], + 'rsa-pss': ['PS256', 'PS384', 'PS512'] +}; + +const allowedCurves = { + ES256: 'prime256v1', + ES384: 'secp384r1', + ES512: 'secp521r1', +}; + +module.exports = function(algorithm, key) { + if (!algorithm || !key) return; + + const keyType = key.asymmetricKeyType; + if (!keyType) return; + + const allowedAlgorithms = allowedAlgorithmsForKeys[keyType]; + + if (!allowedAlgorithms) { + throw new Error(`Unknown key type "${keyType}".`); + } + + if (!allowedAlgorithms.includes(algorithm)) { + throw new Error(`"alg" parameter for "${keyType}" key type must be one of: ${allowedAlgorithms.join(', ')}.`) + } + + /* + * Ignore the next block from test coverage because it gets executed + * conditionally depending on the Node version. Not ignoring it would + * prevent us from reaching the target % of coverage for versions of + * Node under 15.7.0. + */ + /* istanbul ignore next */ + if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) { + switch (keyType) { + case 'ec': + const keyCurve = key.asymmetricKeyDetails.namedCurve; + const allowedCurve = allowedCurves[algorithm]; + + if (keyCurve !== allowedCurve) { + throw new Error(`"alg" parameter "${algorithm}" requires curve "${allowedCurve}".`); + } + break; + + case 'rsa-pss': + if (RSA_PSS_KEY_DETAILS_SUPPORTED) { + const length = parseInt(algorithm.slice(-3), 10); + const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = key.asymmetricKeyDetails; + + if (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm) { + throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${algorithm}.`); + } + + if (saltLength !== undefined && saltLength > length >> 3) { + throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${algorithm}.`) + } + } + break; + } + } +} diff --git a/node_modules/jsonwebtoken/node_modules/ms/index.js b/node_modules/jsonwebtoken/node_modules/ms/index.js new file mode 100644 index 00000000..ea734fb7 --- /dev/null +++ b/node_modules/jsonwebtoken/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/node_modules/jsonwebtoken/node_modules/ms/license.md b/node_modules/jsonwebtoken/node_modules/ms/license.md new file mode 100644 index 00000000..fa5d39b6 --- /dev/null +++ b/node_modules/jsonwebtoken/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Vercel, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jsonwebtoken/node_modules/ms/package.json b/node_modules/jsonwebtoken/node_modules/ms/package.json new file mode 100644 index 00000000..49971890 --- /dev/null +++ b/node_modules/jsonwebtoken/node_modules/ms/package.json @@ -0,0 +1,38 @@ +{ + "name": "ms", + "version": "2.1.3", + "description": "Tiny millisecond conversion utility", + "repository": "vercel/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.18.2", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1", + "prettier": "2.0.5" + } +} diff --git a/node_modules/jsonwebtoken/node_modules/ms/readme.md b/node_modules/jsonwebtoken/node_modules/ms/readme.md new file mode 100644 index 00000000..0fc1abb3 --- /dev/null +++ b/node_modules/jsonwebtoken/node_modules/ms/readme.md @@ -0,0 +1,59 @@ +# ms + +![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/jsonwebtoken/package.json b/node_modules/jsonwebtoken/package.json new file mode 100644 index 00000000..81f78da0 --- /dev/null +++ b/node_modules/jsonwebtoken/package.json @@ -0,0 +1,71 @@ +{ + "name": "jsonwebtoken", + "version": "9.0.2", + "description": "JSON Web Token implementation (symmetric and asymmetric)", + "main": "index.js", + "nyc": { + "check-coverage": true, + "lines": 95, + "statements": 95, + "functions": 100, + "branches": 95, + "exclude": [ + "./test/**" + ], + "reporter": [ + "json", + "lcov", + "text-summary" + ] + }, + "scripts": { + "lint": "eslint .", + "coverage": "nyc mocha --use_strict", + "test": "npm run lint && npm run coverage && cost-of-modules" + }, + "repository": { + "type": "git", + "url": "https://github.com/auth0/node-jsonwebtoken" + }, + "keywords": [ + "jwt" + ], + "author": "auth0", + "license": "MIT", + "bugs": { + "url": "https://github.com/auth0/node-jsonwebtoken/issues" + }, + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "devDependencies": { + "atob": "^2.1.2", + "chai": "^4.1.2", + "conventional-changelog": "~1.1.0", + "cost-of-modules": "^1.0.1", + "eslint": "^4.19.1", + "mocha": "^5.2.0", + "nsp": "^2.6.2", + "nyc": "^11.9.0", + "sinon": "^6.0.0" + }, + "engines": { + "npm": ">=6", + "node": ">=12" + }, + "files": [ + "lib", + "decode.js", + "sign.js", + "verify.js" + ] +} diff --git a/node_modules/jsonwebtoken/sign.js b/node_modules/jsonwebtoken/sign.js new file mode 100644 index 00000000..82bf526e --- /dev/null +++ b/node_modules/jsonwebtoken/sign.js @@ -0,0 +1,253 @@ +const timespan = require('./lib/timespan'); +const PS_SUPPORTED = require('./lib/psSupported'); +const validateAsymmetricKey = require('./lib/validateAsymmetricKey'); +const jws = require('jws'); +const includes = require('lodash.includes'); +const isBoolean = require('lodash.isboolean'); +const isInteger = require('lodash.isinteger'); +const isNumber = require('lodash.isnumber'); +const isPlainObject = require('lodash.isplainobject'); +const isString = require('lodash.isstring'); +const once = require('lodash.once'); +const { KeyObject, createSecretKey, createPrivateKey } = require('crypto') + +const SUPPORTED_ALGS = ['RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512', 'HS256', 'HS384', 'HS512', 'none']; +if (PS_SUPPORTED) { + SUPPORTED_ALGS.splice(3, 0, 'PS256', 'PS384', 'PS512'); +} + +const sign_options_schema = { + expiresIn: { isValid: function(value) { return isInteger(value) || (isString(value) && value); }, message: '"expiresIn" should be a number of seconds or string representing a timespan' }, + notBefore: { isValid: function(value) { return isInteger(value) || (isString(value) && value); }, message: '"notBefore" should be a number of seconds or string representing a timespan' }, + audience: { isValid: function(value) { return isString(value) || Array.isArray(value); }, message: '"audience" must be a string or array' }, + algorithm: { isValid: includes.bind(null, SUPPORTED_ALGS), message: '"algorithm" must be a valid string enum value' }, + header: { isValid: isPlainObject, message: '"header" must be an object' }, + encoding: { isValid: isString, message: '"encoding" must be a string' }, + issuer: { isValid: isString, message: '"issuer" must be a string' }, + subject: { isValid: isString, message: '"subject" must be a string' }, + jwtid: { isValid: isString, message: '"jwtid" must be a string' }, + noTimestamp: { isValid: isBoolean, message: '"noTimestamp" must be a boolean' }, + keyid: { isValid: isString, message: '"keyid" must be a string' }, + mutatePayload: { isValid: isBoolean, message: '"mutatePayload" must be a boolean' }, + allowInsecureKeySizes: { isValid: isBoolean, message: '"allowInsecureKeySizes" must be a boolean'}, + allowInvalidAsymmetricKeyTypes: { isValid: isBoolean, message: '"allowInvalidAsymmetricKeyTypes" must be a boolean'} +}; + +const registered_claims_schema = { + iat: { isValid: isNumber, message: '"iat" should be a number of seconds' }, + exp: { isValid: isNumber, message: '"exp" should be a number of seconds' }, + nbf: { isValid: isNumber, message: '"nbf" should be a number of seconds' } +}; + +function validate(schema, allowUnknown, object, parameterName) { + if (!isPlainObject(object)) { + throw new Error('Expected "' + parameterName + '" to be a plain object.'); + } + Object.keys(object) + .forEach(function(key) { + const validator = schema[key]; + if (!validator) { + if (!allowUnknown) { + throw new Error('"' + key + '" is not allowed in "' + parameterName + '"'); + } + return; + } + if (!validator.isValid(object[key])) { + throw new Error(validator.message); + } + }); +} + +function validateOptions(options) { + return validate(sign_options_schema, false, options, 'options'); +} + +function validatePayload(payload) { + return validate(registered_claims_schema, true, payload, 'payload'); +} + +const options_to_payload = { + 'audience': 'aud', + 'issuer': 'iss', + 'subject': 'sub', + 'jwtid': 'jti' +}; + +const options_for_objects = [ + 'expiresIn', + 'notBefore', + 'noTimestamp', + 'audience', + 'issuer', + 'subject', + 'jwtid', +]; + +module.exports = function (payload, secretOrPrivateKey, options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } else { + options = options || {}; + } + + const isObjectPayload = typeof payload === 'object' && + !Buffer.isBuffer(payload); + + const header = Object.assign({ + alg: options.algorithm || 'HS256', + typ: isObjectPayload ? 'JWT' : undefined, + kid: options.keyid + }, options.header); + + function failure(err) { + if (callback) { + return callback(err); + } + throw err; + } + + if (!secretOrPrivateKey && options.algorithm !== 'none') { + return failure(new Error('secretOrPrivateKey must have a value')); + } + + if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) { + try { + secretOrPrivateKey = createPrivateKey(secretOrPrivateKey) + } catch (_) { + try { + secretOrPrivateKey = createSecretKey(typeof secretOrPrivateKey === 'string' ? Buffer.from(secretOrPrivateKey) : secretOrPrivateKey) + } catch (_) { + return failure(new Error('secretOrPrivateKey is not valid key material')); + } + } + } + + if (header.alg.startsWith('HS') && secretOrPrivateKey.type !== 'secret') { + return failure(new Error((`secretOrPrivateKey must be a symmetric key when using ${header.alg}`))) + } else if (/^(?:RS|PS|ES)/.test(header.alg)) { + if (secretOrPrivateKey.type !== 'private') { + return failure(new Error((`secretOrPrivateKey must be an asymmetric key when using ${header.alg}`))) + } + if (!options.allowInsecureKeySizes && + !header.alg.startsWith('ES') && + secretOrPrivateKey.asymmetricKeyDetails !== undefined && //KeyObject.asymmetricKeyDetails is supported in Node 15+ + secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) { + return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)); + } + } + + if (typeof payload === 'undefined') { + return failure(new Error('payload is required')); + } else if (isObjectPayload) { + try { + validatePayload(payload); + } + catch (error) { + return failure(error); + } + if (!options.mutatePayload) { + payload = Object.assign({},payload); + } + } else { + const invalid_options = options_for_objects.filter(function (opt) { + return typeof options[opt] !== 'undefined'; + }); + + if (invalid_options.length > 0) { + return failure(new Error('invalid ' + invalid_options.join(',') + ' option for ' + (typeof payload ) + ' payload')); + } + } + + if (typeof payload.exp !== 'undefined' && typeof options.expiresIn !== 'undefined') { + return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.')); + } + + if (typeof payload.nbf !== 'undefined' && typeof options.notBefore !== 'undefined') { + return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.')); + } + + try { + validateOptions(options); + } + catch (error) { + return failure(error); + } + + if (!options.allowInvalidAsymmetricKeyTypes) { + try { + validateAsymmetricKey(header.alg, secretOrPrivateKey); + } catch (error) { + return failure(error); + } + } + + const timestamp = payload.iat || Math.floor(Date.now() / 1000); + + if (options.noTimestamp) { + delete payload.iat; + } else if (isObjectPayload) { + payload.iat = timestamp; + } + + if (typeof options.notBefore !== 'undefined') { + try { + payload.nbf = timespan(options.notBefore, timestamp); + } + catch (err) { + return failure(err); + } + if (typeof payload.nbf === 'undefined') { + return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + } + + if (typeof options.expiresIn !== 'undefined' && typeof payload === 'object') { + try { + payload.exp = timespan(options.expiresIn, timestamp); + } + catch (err) { + return failure(err); + } + if (typeof payload.exp === 'undefined') { + return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + } + + Object.keys(options_to_payload).forEach(function (key) { + const claim = options_to_payload[key]; + if (typeof options[key] !== 'undefined') { + if (typeof payload[claim] !== 'undefined') { + return failure(new Error('Bad "options.' + key + '" option. The payload already has an "' + claim + '" property.')); + } + payload[claim] = options[key]; + } + }); + + const encoding = options.encoding || 'utf8'; + + if (typeof callback === 'function') { + callback = callback && once(callback); + + jws.createSign({ + header: header, + privateKey: secretOrPrivateKey, + payload: payload, + encoding: encoding + }).once('error', callback) + .once('done', function (signature) { + // TODO: Remove in favor of the modulus length check before signing once node 15+ is the minimum supported version + if(!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) { + return callback(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)) + } + callback(null, signature); + }); + } else { + let signature = jws.sign({header: header, payload: payload, secret: secretOrPrivateKey, encoding: encoding}); + // TODO: Remove in favor of the modulus length check before signing once node 15+ is the minimum supported version + if(!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) { + throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`) + } + return signature + } +}; diff --git a/node_modules/jsonwebtoken/verify.js b/node_modules/jsonwebtoken/verify.js new file mode 100644 index 00000000..cdbfdc45 --- /dev/null +++ b/node_modules/jsonwebtoken/verify.js @@ -0,0 +1,263 @@ +const JsonWebTokenError = require('./lib/JsonWebTokenError'); +const NotBeforeError = require('./lib/NotBeforeError'); +const TokenExpiredError = require('./lib/TokenExpiredError'); +const decode = require('./decode'); +const timespan = require('./lib/timespan'); +const validateAsymmetricKey = require('./lib/validateAsymmetricKey'); +const PS_SUPPORTED = require('./lib/psSupported'); +const jws = require('jws'); +const {KeyObject, createSecretKey, createPublicKey} = require("crypto"); + +const PUB_KEY_ALGS = ['RS256', 'RS384', 'RS512']; +const EC_KEY_ALGS = ['ES256', 'ES384', 'ES512']; +const RSA_KEY_ALGS = ['RS256', 'RS384', 'RS512']; +const HS_ALGS = ['HS256', 'HS384', 'HS512']; + +if (PS_SUPPORTED) { + PUB_KEY_ALGS.splice(PUB_KEY_ALGS.length, 0, 'PS256', 'PS384', 'PS512'); + RSA_KEY_ALGS.splice(RSA_KEY_ALGS.length, 0, 'PS256', 'PS384', 'PS512'); +} + +module.exports = function (jwtString, secretOrPublicKey, options, callback) { + if ((typeof options === 'function') && !callback) { + callback = options; + options = {}; + } + + if (!options) { + options = {}; + } + + //clone this object since we are going to mutate it. + options = Object.assign({}, options); + + let done; + + if (callback) { + done = callback; + } else { + done = function(err, data) { + if (err) throw err; + return data; + }; + } + + if (options.clockTimestamp && typeof options.clockTimestamp !== 'number') { + return done(new JsonWebTokenError('clockTimestamp must be a number')); + } + + if (options.nonce !== undefined && (typeof options.nonce !== 'string' || options.nonce.trim() === '')) { + return done(new JsonWebTokenError('nonce must be a non-empty string')); + } + + if (options.allowInvalidAsymmetricKeyTypes !== undefined && typeof options.allowInvalidAsymmetricKeyTypes !== 'boolean') { + return done(new JsonWebTokenError('allowInvalidAsymmetricKeyTypes must be a boolean')); + } + + const clockTimestamp = options.clockTimestamp || Math.floor(Date.now() / 1000); + + if (!jwtString){ + return done(new JsonWebTokenError('jwt must be provided')); + } + + if (typeof jwtString !== 'string') { + return done(new JsonWebTokenError('jwt must be a string')); + } + + const parts = jwtString.split('.'); + + if (parts.length !== 3){ + return done(new JsonWebTokenError('jwt malformed')); + } + + let decodedToken; + + try { + decodedToken = decode(jwtString, { complete: true }); + } catch(err) { + return done(err); + } + + if (!decodedToken) { + return done(new JsonWebTokenError('invalid token')); + } + + const header = decodedToken.header; + let getSecret; + + if(typeof secretOrPublicKey === 'function') { + if(!callback) { + return done(new JsonWebTokenError('verify must be called asynchronous if secret or public key is provided as a callback')); + } + + getSecret = secretOrPublicKey; + } + else { + getSecret = function(header, secretCallback) { + return secretCallback(null, secretOrPublicKey); + }; + } + + return getSecret(header, function(err, secretOrPublicKey) { + if(err) { + return done(new JsonWebTokenError('error in secret or public key callback: ' + err.message)); + } + + const hasSignature = parts[2].trim() !== ''; + + if (!hasSignature && secretOrPublicKey){ + return done(new JsonWebTokenError('jwt signature is required')); + } + + if (hasSignature && !secretOrPublicKey) { + return done(new JsonWebTokenError('secret or public key must be provided')); + } + + if (!hasSignature && !options.algorithms) { + return done(new JsonWebTokenError('please specify "none" in "algorithms" to verify unsigned tokens')); + } + + if (secretOrPublicKey != null && !(secretOrPublicKey instanceof KeyObject)) { + try { + secretOrPublicKey = createPublicKey(secretOrPublicKey); + } catch (_) { + try { + secretOrPublicKey = createSecretKey(typeof secretOrPublicKey === 'string' ? Buffer.from(secretOrPublicKey) : secretOrPublicKey); + } catch (_) { + return done(new JsonWebTokenError('secretOrPublicKey is not valid key material')) + } + } + } + + if (!options.algorithms) { + if (secretOrPublicKey.type === 'secret') { + options.algorithms = HS_ALGS; + } else if (['rsa', 'rsa-pss'].includes(secretOrPublicKey.asymmetricKeyType)) { + options.algorithms = RSA_KEY_ALGS + } else if (secretOrPublicKey.asymmetricKeyType === 'ec') { + options.algorithms = EC_KEY_ALGS + } else { + options.algorithms = PUB_KEY_ALGS + } + } + + if (options.algorithms.indexOf(decodedToken.header.alg) === -1) { + return done(new JsonWebTokenError('invalid algorithm')); + } + + if (header.alg.startsWith('HS') && secretOrPublicKey.type !== 'secret') { + return done(new JsonWebTokenError((`secretOrPublicKey must be a symmetric key when using ${header.alg}`))) + } else if (/^(?:RS|PS|ES)/.test(header.alg) && secretOrPublicKey.type !== 'public') { + return done(new JsonWebTokenError((`secretOrPublicKey must be an asymmetric key when using ${header.alg}`))) + } + + if (!options.allowInvalidAsymmetricKeyTypes) { + try { + validateAsymmetricKey(header.alg, secretOrPublicKey); + } catch (e) { + return done(e); + } + } + + let valid; + + try { + valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey); + } catch (e) { + return done(e); + } + + if (!valid) { + return done(new JsonWebTokenError('invalid signature')); + } + + const payload = decodedToken.payload; + + if (typeof payload.nbf !== 'undefined' && !options.ignoreNotBefore) { + if (typeof payload.nbf !== 'number') { + return done(new JsonWebTokenError('invalid nbf value')); + } + if (payload.nbf > clockTimestamp + (options.clockTolerance || 0)) { + return done(new NotBeforeError('jwt not active', new Date(payload.nbf * 1000))); + } + } + + if (typeof payload.exp !== 'undefined' && !options.ignoreExpiration) { + if (typeof payload.exp !== 'number') { + return done(new JsonWebTokenError('invalid exp value')); + } + if (clockTimestamp >= payload.exp + (options.clockTolerance || 0)) { + return done(new TokenExpiredError('jwt expired', new Date(payload.exp * 1000))); + } + } + + if (options.audience) { + const audiences = Array.isArray(options.audience) ? options.audience : [options.audience]; + const target = Array.isArray(payload.aud) ? payload.aud : [payload.aud]; + + const match = target.some(function (targetAudience) { + return audiences.some(function (audience) { + return audience instanceof RegExp ? audience.test(targetAudience) : audience === targetAudience; + }); + }); + + if (!match) { + return done(new JsonWebTokenError('jwt audience invalid. expected: ' + audiences.join(' or '))); + } + } + + if (options.issuer) { + const invalid_issuer = + (typeof options.issuer === 'string' && payload.iss !== options.issuer) || + (Array.isArray(options.issuer) && options.issuer.indexOf(payload.iss) === -1); + + if (invalid_issuer) { + return done(new JsonWebTokenError('jwt issuer invalid. expected: ' + options.issuer)); + } + } + + if (options.subject) { + if (payload.sub !== options.subject) { + return done(new JsonWebTokenError('jwt subject invalid. expected: ' + options.subject)); + } + } + + if (options.jwtid) { + if (payload.jti !== options.jwtid) { + return done(new JsonWebTokenError('jwt jwtid invalid. expected: ' + options.jwtid)); + } + } + + if (options.nonce) { + if (payload.nonce !== options.nonce) { + return done(new JsonWebTokenError('jwt nonce invalid. expected: ' + options.nonce)); + } + } + + if (options.maxAge) { + if (typeof payload.iat !== 'number') { + return done(new JsonWebTokenError('iat required when maxAge is specified')); + } + + const maxAgeTimestamp = timespan(options.maxAge, payload.iat); + if (typeof maxAgeTimestamp === 'undefined') { + return done(new JsonWebTokenError('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + if (clockTimestamp >= maxAgeTimestamp + (options.clockTolerance || 0)) { + return done(new TokenExpiredError('maxAge exceeded', new Date(maxAgeTimestamp * 1000))); + } + } + + if (options.complete === true) { + const signature = decodedToken.signature; + + return done(null, { + header: header, + payload: payload, + signature: signature + }); + } + + return done(null, payload); + }); +}; diff --git a/node_modules/jwa/LICENSE b/node_modules/jwa/LICENSE new file mode 100644 index 00000000..caeb8495 --- /dev/null +++ b/node_modules/jwa/LICENSE @@ -0,0 +1,17 @@ +Copyright (c) 2013 Brian J. Brennan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jwa/README.md b/node_modules/jwa/README.md new file mode 100644 index 00000000..fb433e23 --- /dev/null +++ b/node_modules/jwa/README.md @@ -0,0 +1,150 @@ +# node-jwa [![Build Status](https://travis-ci.org/brianloveswords/node-jwa.svg?branch=master)](https://travis-ci.org/brianloveswords/node-jwa) + +A +[JSON Web Algorithms](http://tools.ietf.org/id/draft-ietf-jose-json-web-algorithms-08.html) +implementation focusing (exclusively, at this point) on the algorithms necessary for +[JSON Web Signatures](http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html). + +This library supports all of the required, recommended and optional cryptographic algorithms for JWS: + +alg Parameter Value | Digital Signature or MAC Algorithm +----------------|---------------------------- +HS256 | HMAC using SHA-256 hash algorithm +HS384 | HMAC using SHA-384 hash algorithm +HS512 | HMAC using SHA-512 hash algorithm +RS256 | RSASSA using SHA-256 hash algorithm +RS384 | RSASSA using SHA-384 hash algorithm +RS512 | RSASSA using SHA-512 hash algorithm +PS256 | RSASSA-PSS using SHA-256 hash algorithm +PS384 | RSASSA-PSS using SHA-384 hash algorithm +PS512 | RSASSA-PSS using SHA-512 hash algorithm +ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm +ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm +ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm +none | No digital signature or MAC value included + +Please note that PS* only works on Node 6.12+ (excluding 7.x). + +# Requirements + +In order to run the tests, a recent version of OpenSSL is +required. **The version that comes with OS X (OpenSSL 0.9.8r 8 Feb +2011) is not recent enough**, as it does not fully support ECDSA +keys. You'll need to use a version > 1.0.0; I tested with OpenSSL 1.0.1c 10 May 2012. + +# Testing + +To run the tests, do + +```bash +$ npm test +``` + +This will generate a bunch of keypairs to use in testing. If you want to +generate new keypairs, do `make clean` before running `npm test` again. + +## Methodology + +I spawn `openssl dgst -sign` to test OpenSSL sign → JS verify and +`openssl dgst -verify` to test JS sign → OpenSSL verify for each of the +RSA and ECDSA algorithms. + +# Usage + +## jwa(algorithm) + +Creates a new `jwa` object with `sign` and `verify` methods for the +algorithm. Valid values for algorithm can be found in the table above +(`'HS256'`, `'HS384'`, etc) and are case-insensitive. Passing an invalid +algorithm value will throw a `TypeError`. + + +## jwa#sign(input, secretOrPrivateKey) + +Sign some input with either a secret for HMAC algorithms, or a private +key for RSA and ECDSA algorithms. + +If input is not already a string or buffer, `JSON.stringify` will be +called on it to attempt to coerce it. + +For the HMAC algorithm, `secretOrPrivateKey` should be a string or a +buffer. For ECDSA and RSA, the value should be a string representing a +PEM encoded **private** key. + +Output [base64url](http://en.wikipedia.org/wiki/Base64#URL_applications) +formatted. This is for convenience as JWS expects the signature in this +format. If your application needs the output in a different format, +[please open an issue](https://github.com/brianloveswords/node-jwa/issues). In +the meantime, you can use +[brianloveswords/base64url](https://github.com/brianloveswords/base64url) +to decode the signature. + +As of nodejs *v0.11.8*, SPKAC support was introduce. If your nodeJs +version satisfies, then you can pass an object `{ key: '..', passphrase: '...' }` + + +## jwa#verify(input, signature, secretOrPublicKey) + +Verify a signature. Returns `true` or `false`. + +`signature` should be a base64url encoded string. + +For the HMAC algorithm, `secretOrPublicKey` should be a string or a +buffer. For ECDSA and RSA, the value should be a string represented a +PEM encoded **public** key. + + +# Example + +HMAC +```js +const jwa = require('jwa'); + +const hmac = jwa('HS256'); +const input = 'super important stuff'; +const secret = 'shhhhhh'; + +const signature = hmac.sign(input, secret); +hmac.verify(input, signature, secret) // === true +hmac.verify(input, signature, 'trickery!') // === false +``` + +With keys +```js +const fs = require('fs'); +const jwa = require('jwa'); +const privateKey = fs.readFileSync(__dirname + '/ecdsa-p521-private.pem'); +const publicKey = fs.readFileSync(__dirname + '/ecdsa-p521-public.pem'); + +const ecdsa = jwa('ES512'); +const input = 'very important stuff'; + +const signature = ecdsa.sign(input, privateKey); +ecdsa.verify(input, signature, publicKey) // === true +``` +## License + +MIT + +``` +Copyright (c) 2013 Brian J. Brennan + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +``` diff --git a/node_modules/jwa/index.js b/node_modules/jwa/index.js new file mode 100644 index 00000000..e71e6d19 --- /dev/null +++ b/node_modules/jwa/index.js @@ -0,0 +1,252 @@ +var bufferEqual = require('buffer-equal-constant-time'); +var Buffer = require('safe-buffer').Buffer; +var crypto = require('crypto'); +var formatEcdsa = require('ecdsa-sig-formatter'); +var util = require('util'); + +var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".' +var MSG_INVALID_SECRET = 'secret must be a string or buffer'; +var MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer'; +var MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object'; + +var supportsKeyObjects = typeof crypto.createPublicKey === 'function'; +if (supportsKeyObjects) { + MSG_INVALID_VERIFIER_KEY += ' or a KeyObject'; + MSG_INVALID_SECRET += 'or a KeyObject'; +} + +function checkIsPublicKey(key) { + if (Buffer.isBuffer(key)) { + return; + } + + if (typeof key === 'string') { + return; + } + + if (!supportsKeyObjects) { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + + if (typeof key !== 'object') { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + + if (typeof key.type !== 'string') { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + + if (typeof key.asymmetricKeyType !== 'string') { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + + if (typeof key.export !== 'function') { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } +}; + +function checkIsPrivateKey(key) { + if (Buffer.isBuffer(key)) { + return; + } + + if (typeof key === 'string') { + return; + } + + if (typeof key === 'object') { + return; + } + + throw typeError(MSG_INVALID_SIGNER_KEY); +}; + +function checkIsSecretKey(key) { + if (Buffer.isBuffer(key)) { + return; + } + + if (typeof key === 'string') { + return key; + } + + if (!supportsKeyObjects) { + throw typeError(MSG_INVALID_SECRET); + } + + if (typeof key !== 'object') { + throw typeError(MSG_INVALID_SECRET); + } + + if (key.type !== 'secret') { + throw typeError(MSG_INVALID_SECRET); + } + + if (typeof key.export !== 'function') { + throw typeError(MSG_INVALID_SECRET); + } +} + +function fromBase64(base64) { + return base64 + .replace(/=/g, '') + .replace(/\+/g, '-') + .replace(/\//g, '_'); +} + +function toBase64(base64url) { + base64url = base64url.toString(); + + var padding = 4 - base64url.length % 4; + if (padding !== 4) { + for (var i = 0; i < padding; ++i) { + base64url += '='; + } + } + + return base64url + .replace(/\-/g, '+') + .replace(/_/g, '/'); +} + +function typeError(template) { + var args = [].slice.call(arguments, 1); + var errMsg = util.format.bind(util, template).apply(null, args); + return new TypeError(errMsg); +} + +function bufferOrString(obj) { + return Buffer.isBuffer(obj) || typeof obj === 'string'; +} + +function normalizeInput(thing) { + if (!bufferOrString(thing)) + thing = JSON.stringify(thing); + return thing; +} + +function createHmacSigner(bits) { + return function sign(thing, secret) { + checkIsSecretKey(secret); + thing = normalizeInput(thing); + var hmac = crypto.createHmac('sha' + bits, secret); + var sig = (hmac.update(thing), hmac.digest('base64')) + return fromBase64(sig); + } +} + +function createHmacVerifier(bits) { + return function verify(thing, signature, secret) { + var computedSig = createHmacSigner(bits)(thing, secret); + return bufferEqual(Buffer.from(signature), Buffer.from(computedSig)); + } +} + +function createKeySigner(bits) { + return function sign(thing, privateKey) { + checkIsPrivateKey(privateKey); + thing = normalizeInput(thing); + // Even though we are specifying "RSA" here, this works with ECDSA + // keys as well. + var signer = crypto.createSign('RSA-SHA' + bits); + var sig = (signer.update(thing), signer.sign(privateKey, 'base64')); + return fromBase64(sig); + } +} + +function createKeyVerifier(bits) { + return function verify(thing, signature, publicKey) { + checkIsPublicKey(publicKey); + thing = normalizeInput(thing); + signature = toBase64(signature); + var verifier = crypto.createVerify('RSA-SHA' + bits); + verifier.update(thing); + return verifier.verify(publicKey, signature, 'base64'); + } +} + +function createPSSKeySigner(bits) { + return function sign(thing, privateKey) { + checkIsPrivateKey(privateKey); + thing = normalizeInput(thing); + var signer = crypto.createSign('RSA-SHA' + bits); + var sig = (signer.update(thing), signer.sign({ + key: privateKey, + padding: crypto.constants.RSA_PKCS1_PSS_PADDING, + saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST + }, 'base64')); + return fromBase64(sig); + } +} + +function createPSSKeyVerifier(bits) { + return function verify(thing, signature, publicKey) { + checkIsPublicKey(publicKey); + thing = normalizeInput(thing); + signature = toBase64(signature); + var verifier = crypto.createVerify('RSA-SHA' + bits); + verifier.update(thing); + return verifier.verify({ + key: publicKey, + padding: crypto.constants.RSA_PKCS1_PSS_PADDING, + saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST + }, signature, 'base64'); + } +} + +function createECDSASigner(bits) { + var inner = createKeySigner(bits); + return function sign() { + var signature = inner.apply(null, arguments); + signature = formatEcdsa.derToJose(signature, 'ES' + bits); + return signature; + }; +} + +function createECDSAVerifer(bits) { + var inner = createKeyVerifier(bits); + return function verify(thing, signature, publicKey) { + signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64'); + var result = inner(thing, signature, publicKey); + return result; + }; +} + +function createNoneSigner() { + return function sign() { + return ''; + } +} + +function createNoneVerifier() { + return function verify(thing, signature) { + return signature === ''; + } +} + +module.exports = function jwa(algorithm) { + var signerFactories = { + hs: createHmacSigner, + rs: createKeySigner, + ps: createPSSKeySigner, + es: createECDSASigner, + none: createNoneSigner, + } + var verifierFactories = { + hs: createHmacVerifier, + rs: createKeyVerifier, + ps: createPSSKeyVerifier, + es: createECDSAVerifer, + none: createNoneVerifier, + } + var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i); + if (!match) + throw typeError(MSG_INVALID_ALGORITHM, algorithm); + var algo = (match[1] || match[3]).toLowerCase(); + var bits = match[2]; + + return { + sign: signerFactories[algo](bits), + verify: verifierFactories[algo](bits), + } +}; diff --git a/node_modules/jwa/package.json b/node_modules/jwa/package.json new file mode 100644 index 00000000..0777d533 --- /dev/null +++ b/node_modules/jwa/package.json @@ -0,0 +1,37 @@ +{ + "name": "jwa", + "version": "1.4.1", + "description": "JWA implementation (supports all JWS algorithms)", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + }, + "devDependencies": { + "base64url": "^2.0.0", + "jwk-to-pem": "^2.0.1", + "semver": "4.3.6", + "tap": "6.2.0" + }, + "scripts": { + "test": "make test" + }, + "repository": { + "type": "git", + "url": "git://github.com/brianloveswords/node-jwa.git" + }, + "keywords": [ + "jwa", + "jws", + "jwt", + "rsa", + "ecdsa", + "hmac" + ], + "author": "Brian J. Brennan ", + "license": "MIT" +} diff --git a/node_modules/jws/CHANGELOG.md b/node_modules/jws/CHANGELOG.md new file mode 100644 index 00000000..af8fc287 --- /dev/null +++ b/node_modules/jws/CHANGELOG.md @@ -0,0 +1,34 @@ +# Change Log +All notable changes to this project will be documented in this file. + +## [3.0.0] +### Changed +- **BREAKING**: `jwt.verify` now requires an `algorithm` parameter, and + `jws.createVerify` requires an `algorithm` option. The `"alg"` field + signature headers is ignored. This mitigates a critical security flaw + in the library which would allow an attacker to generate signatures with + arbitrary contents that would be accepted by `jwt.verify`. See + https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/ + for details. + +## [2.0.0] - 2015-01-30 +### Changed +- **BREAKING**: Default payload encoding changed from `binary` to + `utf8`. `utf8` is a is a more sensible default than `binary` because + many payloads, as far as I can tell, will contain user-facing + strings that could be in any language. ([6b6de48]) + +- Code reorganization, thanks [@fearphage]! ([7880050]) + +### Added +- Option in all relevant methods for `encoding`. For those few users + that might be depending on a `binary` encoding of the messages, this + is for them. ([6b6de48]) + +[unreleased]: https://github.com/brianloveswords/node-jws/compare/v2.0.0...HEAD +[2.0.0]: https://github.com/brianloveswords/node-jws/compare/v1.0.1...v2.0.0 + +[7880050]: https://github.com/brianloveswords/node-jws/commit/7880050 +[6b6de48]: https://github.com/brianloveswords/node-jws/commit/6b6de48 + +[@fearphage]: https://github.com/fearphage diff --git a/node_modules/jws/LICENSE b/node_modules/jws/LICENSE new file mode 100644 index 00000000..caeb8495 --- /dev/null +++ b/node_modules/jws/LICENSE @@ -0,0 +1,17 @@ +Copyright (c) 2013 Brian J. Brennan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jws/index.js b/node_modules/jws/index.js new file mode 100644 index 00000000..8c8da930 --- /dev/null +++ b/node_modules/jws/index.js @@ -0,0 +1,22 @@ +/*global exports*/ +var SignStream = require('./lib/sign-stream'); +var VerifyStream = require('./lib/verify-stream'); + +var ALGORITHMS = [ + 'HS256', 'HS384', 'HS512', + 'RS256', 'RS384', 'RS512', + 'PS256', 'PS384', 'PS512', + 'ES256', 'ES384', 'ES512' +]; + +exports.ALGORITHMS = ALGORITHMS; +exports.sign = SignStream.sign; +exports.verify = VerifyStream.verify; +exports.decode = VerifyStream.decode; +exports.isValid = VerifyStream.isValid; +exports.createSign = function createSign(opts) { + return new SignStream(opts); +}; +exports.createVerify = function createVerify(opts) { + return new VerifyStream(opts); +}; diff --git a/node_modules/jws/lib/data-stream.js b/node_modules/jws/lib/data-stream.js new file mode 100644 index 00000000..3535d31d --- /dev/null +++ b/node_modules/jws/lib/data-stream.js @@ -0,0 +1,55 @@ +/*global module, process*/ +var Buffer = require('safe-buffer').Buffer; +var Stream = require('stream'); +var util = require('util'); + +function DataStream(data) { + this.buffer = null; + this.writable = true; + this.readable = true; + + // No input + if (!data) { + this.buffer = Buffer.alloc(0); + return this; + } + + // Stream + if (typeof data.pipe === 'function') { + this.buffer = Buffer.alloc(0); + data.pipe(this); + return this; + } + + // Buffer or String + // or Object (assumedly a passworded key) + if (data.length || typeof data === 'object') { + this.buffer = data; + this.writable = false; + process.nextTick(function () { + this.emit('end', data); + this.readable = false; + this.emit('close'); + }.bind(this)); + return this; + } + + throw new TypeError('Unexpected data type ('+ typeof data + ')'); +} +util.inherits(DataStream, Stream); + +DataStream.prototype.write = function write(data) { + this.buffer = Buffer.concat([this.buffer, Buffer.from(data)]); + this.emit('data', data); +}; + +DataStream.prototype.end = function end(data) { + if (data) + this.write(data); + this.emit('end', data); + this.emit('close'); + this.writable = false; + this.readable = false; +}; + +module.exports = DataStream; diff --git a/node_modules/jws/lib/sign-stream.js b/node_modules/jws/lib/sign-stream.js new file mode 100644 index 00000000..6a7ee42f --- /dev/null +++ b/node_modules/jws/lib/sign-stream.js @@ -0,0 +1,78 @@ +/*global module*/ +var Buffer = require('safe-buffer').Buffer; +var DataStream = require('./data-stream'); +var jwa = require('jwa'); +var Stream = require('stream'); +var toString = require('./tostring'); +var util = require('util'); + +function base64url(string, encoding) { + return Buffer + .from(string, encoding) + .toString('base64') + .replace(/=/g, '') + .replace(/\+/g, '-') + .replace(/\//g, '_'); +} + +function jwsSecuredInput(header, payload, encoding) { + encoding = encoding || 'utf8'; + var encodedHeader = base64url(toString(header), 'binary'); + var encodedPayload = base64url(toString(payload), encoding); + return util.format('%s.%s', encodedHeader, encodedPayload); +} + +function jwsSign(opts) { + var header = opts.header; + var payload = opts.payload; + var secretOrKey = opts.secret || opts.privateKey; + var encoding = opts.encoding; + var algo = jwa(header.alg); + var securedInput = jwsSecuredInput(header, payload, encoding); + var signature = algo.sign(securedInput, secretOrKey); + return util.format('%s.%s', securedInput, signature); +} + +function SignStream(opts) { + var secret = opts.secret||opts.privateKey||opts.key; + var secretStream = new DataStream(secret); + this.readable = true; + this.header = opts.header; + this.encoding = opts.encoding; + this.secret = this.privateKey = this.key = secretStream; + this.payload = new DataStream(opts.payload); + this.secret.once('close', function () { + if (!this.payload.writable && this.readable) + this.sign(); + }.bind(this)); + + this.payload.once('close', function () { + if (!this.secret.writable && this.readable) + this.sign(); + }.bind(this)); +} +util.inherits(SignStream, Stream); + +SignStream.prototype.sign = function sign() { + try { + var signature = jwsSign({ + header: this.header, + payload: this.payload.buffer, + secret: this.secret.buffer, + encoding: this.encoding + }); + this.emit('done', signature); + this.emit('data', signature); + this.emit('end'); + this.readable = false; + return signature; + } catch (e) { + this.readable = false; + this.emit('error', e); + this.emit('close'); + } +}; + +SignStream.sign = jwsSign; + +module.exports = SignStream; diff --git a/node_modules/jws/lib/tostring.js b/node_modules/jws/lib/tostring.js new file mode 100644 index 00000000..f5a49a36 --- /dev/null +++ b/node_modules/jws/lib/tostring.js @@ -0,0 +1,10 @@ +/*global module*/ +var Buffer = require('buffer').Buffer; + +module.exports = function toString(obj) { + if (typeof obj === 'string') + return obj; + if (typeof obj === 'number' || Buffer.isBuffer(obj)) + return obj.toString(); + return JSON.stringify(obj); +}; diff --git a/node_modules/jws/lib/verify-stream.js b/node_modules/jws/lib/verify-stream.js new file mode 100644 index 00000000..39f7c73e --- /dev/null +++ b/node_modules/jws/lib/verify-stream.js @@ -0,0 +1,120 @@ +/*global module*/ +var Buffer = require('safe-buffer').Buffer; +var DataStream = require('./data-stream'); +var jwa = require('jwa'); +var Stream = require('stream'); +var toString = require('./tostring'); +var util = require('util'); +var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; + +function isObject(thing) { + return Object.prototype.toString.call(thing) === '[object Object]'; +} + +function safeJsonParse(thing) { + if (isObject(thing)) + return thing; + try { return JSON.parse(thing); } + catch (e) { return undefined; } +} + +function headerFromJWS(jwsSig) { + var encodedHeader = jwsSig.split('.', 1)[0]; + return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary')); +} + +function securedInputFromJWS(jwsSig) { + return jwsSig.split('.', 2).join('.'); +} + +function signatureFromJWS(jwsSig) { + return jwsSig.split('.')[2]; +} + +function payloadFromJWS(jwsSig, encoding) { + encoding = encoding || 'utf8'; + var payload = jwsSig.split('.')[1]; + return Buffer.from(payload, 'base64').toString(encoding); +} + +function isValidJws(string) { + return JWS_REGEX.test(string) && !!headerFromJWS(string); +} + +function jwsVerify(jwsSig, algorithm, secretOrKey) { + if (!algorithm) { + var err = new Error("Missing algorithm parameter for jws.verify"); + err.code = "MISSING_ALGORITHM"; + throw err; + } + jwsSig = toString(jwsSig); + var signature = signatureFromJWS(jwsSig); + var securedInput = securedInputFromJWS(jwsSig); + var algo = jwa(algorithm); + return algo.verify(securedInput, signature, secretOrKey); +} + +function jwsDecode(jwsSig, opts) { + opts = opts || {}; + jwsSig = toString(jwsSig); + + if (!isValidJws(jwsSig)) + return null; + + var header = headerFromJWS(jwsSig); + + if (!header) + return null; + + var payload = payloadFromJWS(jwsSig); + if (header.typ === 'JWT' || opts.json) + payload = JSON.parse(payload, opts.encoding); + + return { + header: header, + payload: payload, + signature: signatureFromJWS(jwsSig) + }; +} + +function VerifyStream(opts) { + opts = opts || {}; + var secretOrKey = opts.secret||opts.publicKey||opts.key; + var secretStream = new DataStream(secretOrKey); + this.readable = true; + this.algorithm = opts.algorithm; + this.encoding = opts.encoding; + this.secret = this.publicKey = this.key = secretStream; + this.signature = new DataStream(opts.signature); + this.secret.once('close', function () { + if (!this.signature.writable && this.readable) + this.verify(); + }.bind(this)); + + this.signature.once('close', function () { + if (!this.secret.writable && this.readable) + this.verify(); + }.bind(this)); +} +util.inherits(VerifyStream, Stream); +VerifyStream.prototype.verify = function verify() { + try { + var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); + var obj = jwsDecode(this.signature.buffer, this.encoding); + this.emit('done', valid, obj); + this.emit('data', valid); + this.emit('end'); + this.readable = false; + return valid; + } catch (e) { + this.readable = false; + this.emit('error', e); + this.emit('close'); + } +}; + +VerifyStream.decode = jwsDecode; +VerifyStream.isValid = isValidJws; +VerifyStream.verify = jwsVerify; + +module.exports = VerifyStream; diff --git a/node_modules/jws/package.json b/node_modules/jws/package.json new file mode 100644 index 00000000..3fb28375 --- /dev/null +++ b/node_modules/jws/package.json @@ -0,0 +1,34 @@ +{ + "name": "jws", + "version": "3.2.2", + "description": "Implementation of JSON Web Signatures", + "main": "index.js", + "directories": { + "test": "test" + }, + "scripts": { + "test": "make test" + }, + "repository": { + "type": "git", + "url": "git://github.com/brianloveswords/node-jws.git" + }, + "keywords": [ + "jws", + "json", + "web", + "signatures" + ], + "author": "Brian J Brennan", + "license": "MIT", + "readmeFilename": "readme.md", + "gitHead": "c0f6b27bcea5a2ad2e304d91c2e842e4076a6b03", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + }, + "devDependencies": { + "semver": "^5.1.0", + "tape": "~2.14.0" + } +} diff --git a/node_modules/jws/readme.md b/node_modules/jws/readme.md new file mode 100644 index 00000000..1910c9a8 --- /dev/null +++ b/node_modules/jws/readme.md @@ -0,0 +1,255 @@ +# node-jws [![Build Status](https://secure.travis-ci.org/brianloveswords/node-jws.png)](http://travis-ci.org/brianloveswords/node-jws) + +An implementation of [JSON Web Signatures](http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html). + +This was developed against `draft-ietf-jose-json-web-signature-08` and +implements the entire spec **except** X.509 Certificate Chain +signing/verifying (patches welcome). + +There are both synchronous (`jws.sign`, `jws.verify`) and streaming +(`jws.createSign`, `jws.createVerify`) APIs. + +# Install + +```bash +$ npm install jws +``` + +# Usage + +## jws.ALGORITHMS + +Array of supported algorithms. The following algorithms are currently supported. + +alg Parameter Value | Digital Signature or MAC Algorithm +----------------|---------------------------- +HS256 | HMAC using SHA-256 hash algorithm +HS384 | HMAC using SHA-384 hash algorithm +HS512 | HMAC using SHA-512 hash algorithm +RS256 | RSASSA using SHA-256 hash algorithm +RS384 | RSASSA using SHA-384 hash algorithm +RS512 | RSASSA using SHA-512 hash algorithm +PS256 | RSASSA-PSS using SHA-256 hash algorithm +PS384 | RSASSA-PSS using SHA-384 hash algorithm +PS512 | RSASSA-PSS using SHA-512 hash algorithm +ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm +ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm +ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm +none | No digital signature or MAC value included + +## jws.sign(options) + +(Synchronous) Return a JSON Web Signature for a header and a payload. + +Options: + +* `header` +* `payload` +* `secret` or `privateKey` +* `encoding` (Optional, defaults to 'utf8') + +`header` must be an object with an `alg` property. `header.alg` must be +one a value found in `jws.ALGORITHMS`. See above for a table of +supported algorithms. + +If `payload` is not a buffer or a string, it will be coerced into a string +using `JSON.stringify`. + +Example + +```js +const signature = jws.sign({ + header: { alg: 'HS256' }, + payload: 'h. jon benjamin', + secret: 'has a van', +}); +``` + +## jws.verify(signature, algorithm, secretOrKey) + +(Synchronous) Returns `true` or `false` for whether a signature matches a +secret or key. + +`signature` is a JWS Signature. `header.alg` must be a value found in `jws.ALGORITHMS`. +See above for a table of supported algorithms. `secretOrKey` is a string or +buffer containing either the secret for HMAC algorithms, or the PEM +encoded public key for RSA and ECDSA. + +Note that the `"alg"` value from the signature header is ignored. + + +## jws.decode(signature) + +(Synchronous) Returns the decoded header, decoded payload, and signature +parts of the JWS Signature. + +Returns an object with three properties, e.g. +```js +{ header: { alg: 'HS256' }, + payload: 'h. jon benjamin', + signature: 'YOWPewyGHKu4Y_0M_vtlEnNlqmFOclqp4Hy6hVHfFT4' +} +``` + +## jws.createSign(options) + +Returns a new SignStream object. + +Options: + +* `header` (required) +* `payload` +* `key` || `privateKey` || `secret` +* `encoding` (Optional, defaults to 'utf8') + +Other than `header`, all options expect a string or a buffer when the +value is known ahead of time, or a stream for convenience. +`key`/`privateKey`/`secret` may also be an object when using an encrypted +private key, see the [crypto documentation][encrypted-key-docs]. + +Example: + +```js + +// This... +jws.createSign({ + header: { alg: 'RS256' }, + privateKey: privateKeyStream, + payload: payloadStream, +}).on('done', function(signature) { + // ... +}); + +// is equivalent to this: +const signer = jws.createSign({ + header: { alg: 'RS256' }, +}); +privateKeyStream.pipe(signer.privateKey); +payloadStream.pipe(signer.payload); +signer.on('done', function(signature) { + // ... +}); +``` + +## jws.createVerify(options) + +Returns a new VerifyStream object. + +Options: + +* `signature` +* `algorithm` +* `key` || `publicKey` || `secret` +* `encoding` (Optional, defaults to 'utf8') + +All options expect a string or a buffer when the value is known ahead of +time, or a stream for convenience. + +Example: + +```js + +// This... +jws.createVerify({ + publicKey: pubKeyStream, + signature: sigStream, +}).on('done', function(verified, obj) { + // ... +}); + +// is equivilant to this: +const verifier = jws.createVerify(); +pubKeyStream.pipe(verifier.publicKey); +sigStream.pipe(verifier.signature); +verifier.on('done', function(verified, obj) { + // ... +}); +``` + +## Class: SignStream + +A `Readable Stream` that emits a single data event (the calculated +signature) when done. + +### Event: 'done' +`function (signature) { }` + +### signer.payload + +A `Writable Stream` that expects the JWS payload. Do *not* use if you +passed a `payload` option to the constructor. + +Example: + +```js +payloadStream.pipe(signer.payload); +``` + +### signer.secret
signer.key
signer.privateKey + +A `Writable Stream`. Expects the JWS secret for HMAC, or the privateKey +for ECDSA and RSA. Do *not* use if you passed a `secret` or `key` option +to the constructor. + +Example: + +```js +privateKeyStream.pipe(signer.privateKey); +``` + +## Class: VerifyStream + +This is a `Readable Stream` that emits a single data event, the result +of whether or not that signature was valid. + +### Event: 'done' +`function (valid, obj) { }` + +`valid` is a boolean for whether or not the signature is valid. + +### verifier.signature + +A `Writable Stream` that expects a JWS Signature. Do *not* use if you +passed a `signature` option to the constructor. + +### verifier.secret
verifier.key
verifier.publicKey + +A `Writable Stream` that expects a public key or secret. Do *not* use if you +passed a `key` or `secret` option to the constructor. + +# TODO + +* It feels like there should be some convenience options/APIs for + defining the algorithm rather than having to define a header object + with `{ alg: 'ES512' }` or whatever every time. + +* X.509 support, ugh + +# License + +MIT + +``` +Copyright (c) 2013-2015 Brian J. Brennan + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +``` + +[encrypted-key-docs]: https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format diff --git a/node_modules/lodash.includes/LICENSE b/node_modules/lodash.includes/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/node_modules/lodash.includes/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.includes/README.md b/node_modules/lodash.includes/README.md new file mode 100644 index 00000000..26e93775 --- /dev/null +++ b/node_modules/lodash.includes/README.md @@ -0,0 +1,18 @@ +# lodash.includes v4.3.0 + +The [lodash](https://lodash.com/) method `_.includes` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.includes +``` + +In Node.js: +```js +var includes = require('lodash.includes'); +``` + +See the [documentation](https://lodash.com/docs#includes) or [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash.includes) for more details. diff --git a/node_modules/lodash.includes/index.js b/node_modules/lodash.includes/index.js new file mode 100644 index 00000000..e88d5338 --- /dev/null +++ b/node_modules/lodash.includes/index.js @@ -0,0 +1,745 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ +function values(object) { + return object ? baseValues(object, keys(object)) : []; +} + +module.exports = includes; diff --git a/node_modules/lodash.includes/package.json b/node_modules/lodash.includes/package.json new file mode 100644 index 00000000..a02e645d --- /dev/null +++ b/node_modules/lodash.includes/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.includes", + "version": "4.3.0", + "description": "The lodash method `_.includes` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, includes", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lodash.isboolean/LICENSE b/node_modules/lodash.isboolean/LICENSE new file mode 100644 index 00000000..b054ca5a --- /dev/null +++ b/node_modules/lodash.isboolean/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/lodash.isboolean/README.md b/node_modules/lodash.isboolean/README.md new file mode 100644 index 00000000..b3c476b0 --- /dev/null +++ b/node_modules/lodash.isboolean/README.md @@ -0,0 +1,18 @@ +# lodash.isboolean v3.0.3 + +The [lodash](https://lodash.com/) method `_.isBoolean` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isboolean +``` + +In Node.js: +```js +var isBoolean = require('lodash.isboolean'); +``` + +See the [documentation](https://lodash.com/docs#isBoolean) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.isboolean) for more details. diff --git a/node_modules/lodash.isboolean/index.js b/node_modules/lodash.isboolean/index.js new file mode 100644 index 00000000..23bbabdc --- /dev/null +++ b/node_modules/lodash.isboolean/index.js @@ -0,0 +1,70 @@ +/** + * lodash 3.0.3 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ +function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && objectToString.call(value) == boolTag); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +module.exports = isBoolean; diff --git a/node_modules/lodash.isboolean/package.json b/node_modules/lodash.isboolean/package.json new file mode 100644 index 00000000..01d6e8b9 --- /dev/null +++ b/node_modules/lodash.isboolean/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.isboolean", + "version": "3.0.3", + "description": "The lodash method `_.isBoolean` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, isboolean", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lodash.isinteger/LICENSE b/node_modules/lodash.isinteger/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/node_modules/lodash.isinteger/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.isinteger/README.md b/node_modules/lodash.isinteger/README.md new file mode 100644 index 00000000..3a78567b --- /dev/null +++ b/node_modules/lodash.isinteger/README.md @@ -0,0 +1,18 @@ +# lodash.isinteger v4.0.4 + +The [lodash](https://lodash.com/) method `_.isInteger` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isinteger +``` + +In Node.js: +```js +var isInteger = require('lodash.isinteger'); +``` + +See the [documentation](https://lodash.com/docs#isInteger) or [package source](https://github.com/lodash/lodash/blob/4.0.4-npm-packages/lodash.isinteger) for more details. diff --git a/node_modules/lodash.isinteger/index.js b/node_modules/lodash.isinteger/index.js new file mode 100644 index 00000000..3bf06f00 --- /dev/null +++ b/node_modules/lodash.isinteger/index.js @@ -0,0 +1,265 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ +function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = isInteger; diff --git a/node_modules/lodash.isinteger/package.json b/node_modules/lodash.isinteger/package.json new file mode 100644 index 00000000..92db256f --- /dev/null +++ b/node_modules/lodash.isinteger/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.isinteger", + "version": "4.0.4", + "description": "The lodash method `_.isInteger` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, isinteger", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lodash.isnumber/LICENSE b/node_modules/lodash.isnumber/LICENSE new file mode 100644 index 00000000..b054ca5a --- /dev/null +++ b/node_modules/lodash.isnumber/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/lodash.isnumber/README.md b/node_modules/lodash.isnumber/README.md new file mode 100644 index 00000000..a1d434dd --- /dev/null +++ b/node_modules/lodash.isnumber/README.md @@ -0,0 +1,18 @@ +# lodash.isnumber v3.0.3 + +The [lodash](https://lodash.com/) method `_.isNumber` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isnumber +``` + +In Node.js: +```js +var isNumber = require('lodash.isnumber'); +``` + +See the [documentation](https://lodash.com/docs#isNumber) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.isnumber) for more details. diff --git a/node_modules/lodash.isnumber/index.js b/node_modules/lodash.isnumber/index.js new file mode 100644 index 00000000..35a85732 --- /dev/null +++ b/node_modules/lodash.isnumber/index.js @@ -0,0 +1,79 @@ +/** + * lodash 3.0.3 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var numberTag = '[object Number]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified + * as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ +function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && objectToString.call(value) == numberTag); +} + +module.exports = isNumber; diff --git a/node_modules/lodash.isnumber/package.json b/node_modules/lodash.isnumber/package.json new file mode 100644 index 00000000..4c33c2a3 --- /dev/null +++ b/node_modules/lodash.isnumber/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.isnumber", + "version": "3.0.3", + "description": "The lodash method `_.isNumber` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, isnumber", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lodash.isplainobject/LICENSE b/node_modules/lodash.isplainobject/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/node_modules/lodash.isplainobject/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.isplainobject/README.md b/node_modules/lodash.isplainobject/README.md new file mode 100644 index 00000000..aeefd74d --- /dev/null +++ b/node_modules/lodash.isplainobject/README.md @@ -0,0 +1,18 @@ +# lodash.isplainobject v4.0.6 + +The [lodash](https://lodash.com/) method `_.isPlainObject` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isplainobject +``` + +In Node.js: +```js +var isPlainObject = require('lodash.isplainobject'); +``` + +See the [documentation](https://lodash.com/docs#isPlainObject) or [package source](https://github.com/lodash/lodash/blob/4.0.6-npm-packages/lodash.isplainobject) for more details. diff --git a/node_modules/lodash.isplainobject/index.js b/node_modules/lodash.isplainobject/index.js new file mode 100644 index 00000000..0f820ee7 --- /dev/null +++ b/node_modules/lodash.isplainobject/index.js @@ -0,0 +1,139 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || + objectToString.call(value) != objectTag || isHostObject(value)) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); +} + +module.exports = isPlainObject; diff --git a/node_modules/lodash.isplainobject/package.json b/node_modules/lodash.isplainobject/package.json new file mode 100644 index 00000000..86f6a07e --- /dev/null +++ b/node_modules/lodash.isplainobject/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.isplainobject", + "version": "4.0.6", + "description": "The lodash method `_.isPlainObject` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, isplainobject", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lodash.isstring/LICENSE b/node_modules/lodash.isstring/LICENSE new file mode 100644 index 00000000..b054ca5a --- /dev/null +++ b/node_modules/lodash.isstring/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/lodash.isstring/README.md b/node_modules/lodash.isstring/README.md new file mode 100644 index 00000000..f184029a --- /dev/null +++ b/node_modules/lodash.isstring/README.md @@ -0,0 +1,18 @@ +# lodash.isstring v4.0.1 + +The [lodash](https://lodash.com/) method `_.isString` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isstring +``` + +In Node.js: +```js +var isString = require('lodash.isstring'); +``` + +See the [documentation](https://lodash.com/docs#isString) or [package source](https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash.isstring) for more details. diff --git a/node_modules/lodash.isstring/index.js b/node_modules/lodash.isstring/index.js new file mode 100644 index 00000000..408225c5 --- /dev/null +++ b/node_modules/lodash.isstring/index.js @@ -0,0 +1,95 @@ +/** + * lodash 4.0.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); +} + +module.exports = isString; diff --git a/node_modules/lodash.isstring/package.json b/node_modules/lodash.isstring/package.json new file mode 100644 index 00000000..1331535d --- /dev/null +++ b/node_modules/lodash.isstring/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.isstring", + "version": "4.0.1", + "description": "The lodash method `_.isString` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, isstring", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lodash.once/LICENSE b/node_modules/lodash.once/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/node_modules/lodash.once/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.once/README.md b/node_modules/lodash.once/README.md new file mode 100644 index 00000000..c4a2f169 --- /dev/null +++ b/node_modules/lodash.once/README.md @@ -0,0 +1,18 @@ +# lodash.once v4.1.1 + +The [lodash](https://lodash.com/) method `_.once` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.once +``` + +In Node.js: +```js +var once = require('lodash.once'); +``` + +See the [documentation](https://lodash.com/docs#once) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.once) for more details. diff --git a/node_modules/lodash.once/index.js b/node_modules/lodash.once/index.js new file mode 100644 index 00000000..414ceb33 --- /dev/null +++ b/node_modules/lodash.once/index.js @@ -0,0 +1,294 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ +function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; +} + +/** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ +function once(func) { + return before(2, func); +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = once; diff --git a/node_modules/lodash.once/package.json b/node_modules/lodash.once/package.json new file mode 100644 index 00000000..fae782c2 --- /dev/null +++ b/node_modules/lodash.once/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.once", + "version": "4.1.1", + "description": "The lodash method `_.once` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, once", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/make-dir/index.d.ts b/node_modules/make-dir/index.d.ts new file mode 100644 index 00000000..3a782512 --- /dev/null +++ b/node_modules/make-dir/index.d.ts @@ -0,0 +1,66 @@ +/// +import * as fs from 'fs'; + +declare namespace makeDir { + interface Options { + /** + Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). + + @default 0o777 + */ + readonly mode?: number; + + /** + Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). + + Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function. + + @default require('fs') + */ + readonly fs?: typeof fs; + } +} + +declare const makeDir: { + /** + Make a directory and its parents if needed - Think `mkdir -p`. + + @param path - Directory to create. + @returns The path to the created directory. + + @example + ``` + import makeDir = require('make-dir'); + + (async () => { + const path = await makeDir('unicorn/rainbow/cake'); + + console.log(path); + //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' + + // Multiple directories: + const paths = await Promise.all([ + makeDir('unicorn/rainbow'), + makeDir('foo/bar') + ]); + + console.log(paths); + // [ + // '/Users/sindresorhus/fun/unicorn/rainbow', + // '/Users/sindresorhus/fun/foo/bar' + // ] + })(); + ``` + */ + (path: string, options?: makeDir.Options): Promise; + + /** + Synchronously make a directory and its parents if needed - Think `mkdir -p`. + + @param path - Directory to create. + @returns The path to the created directory. + */ + sync(path: string, options?: makeDir.Options): string; +}; + +export = makeDir; diff --git a/node_modules/make-dir/index.js b/node_modules/make-dir/index.js new file mode 100644 index 00000000..75889d84 --- /dev/null +++ b/node_modules/make-dir/index.js @@ -0,0 +1,156 @@ +'use strict'; +const fs = require('fs'); +const path = require('path'); +const {promisify} = require('util'); +const semver = require('semver'); + +const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const checkPath = pth => { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); + + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`); + error.code = 'EINVAL'; + throw error; + } + } +}; + +const processOptions = options => { + // https://github.com/sindresorhus/make-dir/issues/18 + const defaults = { + mode: 0o777, + fs + }; + + return { + ...defaults, + ...options + }; +}; + +const permissionError = pth => { + // This replicates the exception of `fs.mkdir` with native the + // `recusive` option when run on an invalid drive under Windows. + const error = new Error(`operation not permitted, mkdir '${pth}'`); + error.code = 'EPERM'; + error.errno = -4048; + error.path = pth; + error.syscall = 'mkdir'; + return error; +}; + +const makeDir = async (input, options) => { + checkPath(input); + options = processOptions(options); + + const mkdir = promisify(options.fs.mkdir); + const stat = promisify(options.fs.stat); + + if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) { + const pth = path.resolve(input); + + await mkdir(pth, { + mode: options.mode, + recursive: true + }); + + return pth; + } + + const make = async pth => { + try { + await mkdir(pth, options.mode); + + return pth; + } catch (error) { + if (error.code === 'EPERM') { + throw error; + } + + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth); + } + + if (error.message.includes('null bytes')) { + throw error; + } + + await make(path.dirname(pth)); + + return make(pth); + } + + try { + const stats = await stat(pth); + if (!stats.isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch (_) { + throw error; + } + + return pth; + } + }; + + return make(path.resolve(input)); +}; + +module.exports = makeDir; + +module.exports.sync = (input, options) => { + checkPath(input); + options = processOptions(options); + + if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { + const pth = path.resolve(input); + + fs.mkdirSync(pth, { + mode: options.mode, + recursive: true + }); + + return pth; + } + + const make = pth => { + try { + options.fs.mkdirSync(pth, options.mode); + } catch (error) { + if (error.code === 'EPERM') { + throw error; + } + + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth); + } + + if (error.message.includes('null bytes')) { + throw error; + } + + make(path.dirname(pth)); + return make(pth); + } + + try { + if (!options.fs.statSync(pth).isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch (_) { + throw error; + } + } + + return pth; + }; + + return make(path.resolve(input)); +}; diff --git a/node_modules/make-dir/license b/node_modules/make-dir/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/make-dir/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/make-dir/node_modules/.bin/semver b/node_modules/make-dir/node_modules/.bin/semver new file mode 100644 index 00000000..97c53279 --- /dev/null +++ b/node_modules/make-dir/node_modules/.bin/semver @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/node_modules/make-dir/node_modules/.bin/semver.cmd b/node_modules/make-dir/node_modules/.bin/semver.cmd new file mode 100644 index 00000000..9913fa9d --- /dev/null +++ b/node_modules/make-dir/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/make-dir/node_modules/.bin/semver.ps1 b/node_modules/make-dir/node_modules/.bin/semver.ps1 new file mode 100644 index 00000000..314717ad --- /dev/null +++ b/node_modules/make-dir/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/make-dir/node_modules/semver/LICENSE b/node_modules/make-dir/node_modules/semver/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/make-dir/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/make-dir/node_modules/semver/README.md b/node_modules/make-dir/node_modules/semver/README.md new file mode 100644 index 00000000..2293a14f --- /dev/null +++ b/node_modules/make-dir/node_modules/semver/README.md @@ -0,0 +1,443 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `2.1.5` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` diff --git a/node_modules/make-dir/node_modules/semver/bin/semver.js b/node_modules/make-dir/node_modules/semver/bin/semver.js new file mode 100644 index 00000000..666034a7 --- /dev/null +++ b/node_modules/make-dir/node_modules/semver/bin/semver.js @@ -0,0 +1,174 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var rtl = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + '--rtl', + ' Coerce version strings right to left', + '', + '--ltr', + ' Coerce version strings left to right (default)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/node_modules/make-dir/node_modules/semver/package.json b/node_modules/make-dir/node_modules/semver/package.json new file mode 100644 index 00000000..6b970a62 --- /dev/null +++ b/node_modules/make-dir/node_modules/semver/package.json @@ -0,0 +1,38 @@ +{ + "name": "semver", + "version": "6.3.1", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap test/ --100 --timeout=30", + "lint": "echo linting disabled", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap test/ --100 --timeout=30", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/template-oss": "4.17.0", + "tap": "^12.7.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "./bin/semver.js" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "content": "./scripts/template-oss", + "version": "4.17.0" + } +} diff --git a/node_modules/make-dir/node_modules/semver/range.bnf b/node_modules/make-dir/node_modules/semver/range.bnf new file mode 100644 index 00000000..d4c6ae0d --- /dev/null +++ b/node_modules/make-dir/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/make-dir/node_modules/semver/semver.js b/node_modules/make-dir/node_modules/semver/semver.js new file mode 100644 index 00000000..39319c13 --- /dev/null +++ b/node_modules/make-dir/node_modules/semver/semver.js @@ -0,0 +1,1643 @@ +exports = module.exports = SemVer + +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +// The actual regexps go on exports.re +var re = exports.re = [] +var safeRe = exports.safeRe = [] +var src = exports.src = [] +var t = exports.tokens = {} +var R = 0 + +function tok (n) { + t[n] = R++ +} + +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' + +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' + +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' + +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' + +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' + +tok('GTLT') +src[t.GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' + +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +tok('COERCE') +src[t.COERCE] = '(^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' +tok('COERCERTL') +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' + +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') +var tildeTrimReplace = '$1~' + +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' + +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') +var caretTrimReplace = '$1^' + +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +tok('COMPARATORLOOSE') +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' +tok('COMPARATOR') +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +tok('COMPARATORTRIM') +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' + +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') +var comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +tok('HYPHENRANGE') +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAIN] + ')' + + '\\s*$' + +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +SemVer.prototype.compareBuild = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + var i = 0 + do { + var a = this.build[i] + var b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.compareBuild = compareBuild +function compareBuild (a, b, loose) { + var versionA = new SemVer(a, loose) + var versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var m = comp.match(r) + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + if (this.operator === '') { + if (this.value === '') { + return true + } + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + this.raw) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return ( + isSatisfiable(thisComparators, options) && + range.set.some(function (rangeComparators) { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every(function (thisComparator) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) +} + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +function isSatisfiable (comparators, options) { + var result = true + var remainingComparators = comparators.slice() + var testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + pr + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(safeRe[t.STAR], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version, options) { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + var match = null + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next + while ((next = safeRe[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + safeRe[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) +} diff --git a/node_modules/make-dir/package.json b/node_modules/make-dir/package.json new file mode 100644 index 00000000..98403ea5 --- /dev/null +++ b/node_modules/make-dir/package.json @@ -0,0 +1,59 @@ +{ + "name": "make-dir", + "version": "3.1.0", + "description": "Make a directory and its parents if needed - Think `mkdir -p`", + "license": "MIT", + "repository": "sindresorhus/make-dir", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && nyc ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "mkdir", + "mkdirp", + "make", + "directories", + "dir", + "dirs", + "folders", + "directory", + "folder", + "path", + "parent", + "parents", + "intermediate", + "recursively", + "recursive", + "create", + "fs", + "filesystem", + "file-system" + ], + "dependencies": { + "semver": "^6.0.0" + }, + "devDependencies": { + "@types/graceful-fs": "^4.1.3", + "@types/node": "^13.7.1", + "ava": "^1.4.0", + "codecov": "^3.2.0", + "graceful-fs": "^4.1.15", + "nyc": "^15.0.0", + "path-type": "^4.0.0", + "tempy": "^0.2.1", + "tsd": "^0.11.0", + "xo": "^0.25.4" + } +} diff --git a/node_modules/make-dir/readme.md b/node_modules/make-dir/readme.md new file mode 100644 index 00000000..a10a1a42 --- /dev/null +++ b/node_modules/make-dir/readme.md @@ -0,0 +1,125 @@ +# make-dir [![Build Status](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir) + +> Make a directory and its parents if needed - Think `mkdir -p` + +## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) + +- Promise API *(Async/await ready!)* +- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66) +- 100% test coverage +- CI-tested on macOS, Linux, and Windows +- Actively maintained +- Doesn't bundle a CLI +- Uses the native `fs.mkdir/mkdirSync` [`recursive` option](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_mkdir_path_options_callback) in Node.js >=10.12.0 unless [overridden](#fs) + +## Install + +``` +$ npm install make-dir +``` + +## Usage + +``` +$ pwd +/Users/sindresorhus/fun +$ tree +. +``` + +```js +const makeDir = require('make-dir'); + +(async () => { + const path = await makeDir('unicorn/rainbow/cake'); + + console.log(path); + //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' +})(); +``` + +``` +$ tree +. +└── unicorn + └── rainbow + └── cake +``` + +Multiple directories: + +```js +const makeDir = require('make-dir'); + +(async () => { + const paths = await Promise.all([ + makeDir('unicorn/rainbow'), + makeDir('foo/bar') + ]); + + console.log(paths); + /* + [ + '/Users/sindresorhus/fun/unicorn/rainbow', + '/Users/sindresorhus/fun/foo/bar' + ] + */ +})(); +``` + +## API + +### makeDir(path, options?) + +Returns a `Promise` for the path to the created directory. + +### makeDir.sync(path, options?) + +Returns the path to the created directory. + +#### path + +Type: `string` + +Directory to create. + +#### options + +Type: `object` + +##### mode + +Type: `integer`\ +Default: `0o777` + +Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). + +##### fs + +Type: `object`\ +Default: `require('fs')` + +Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). + +Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function. + +## Related + +- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module +- [del](https://github.com/sindresorhus/del) - Delete files and directories +- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching +- [cpy](https://github.com/sindresorhus/cpy) - Copy files +- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line +- [move-file](https://github.com/sindresorhus/move-file) - Move a file + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/minipass/LICENSE b/node_modules/minipass/LICENSE new file mode 100644 index 00000000..97f8e32e --- /dev/null +++ b/node_modules/minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2017-2023 npm, Inc., Isaac Z. Schlueter, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/minipass/README.md b/node_modules/minipass/README.md new file mode 100644 index 00000000..61088093 --- /dev/null +++ b/node_modules/minipass/README.md @@ -0,0 +1,769 @@ +# minipass + +A _very_ minimal implementation of a [PassThrough +stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) + +[It's very +fast](https://docs.google.com/spreadsheets/d/1K_HR5oh3r80b8WVMWCPPjfuWXUgfkmhlX7FGI6JJ8tY/edit?usp=sharing) +for objects, strings, and buffers. + +Supports `pipe()`ing (including multi-`pipe()` and backpressure +transmission), buffering data until either a `data` event handler +or `pipe()` is added (so you don't lose the first chunk), and +most other cases where PassThrough is a good idea. + +There is a `read()` method, but it's much more efficient to +consume data from this stream via `'data'` events or by calling +`pipe()` into some other stream. Calling `read()` requires the +buffer to be flattened in some cases, which requires copying +memory. + +If you set `objectMode: true` in the options, then whatever is +written will be emitted. Otherwise, it'll do a minimal amount of +Buffer copying to ensure proper Streams semantics when `read(n)` +is called. + +`objectMode` can also be set by doing `stream.objectMode = true`, +or by writing any non-string/non-buffer data. `objectMode` cannot +be set to false once it is set. + +This is not a `through` or `through2` stream. It doesn't +transform the data, it just passes it right through. If you want +to transform the data, extend the class, and override the +`write()` method. Once you're done transforming the data however +you want, call `super.write()` with the transform output. + +For some examples of streams that extend Minipass in various +ways, check out: + +- [minizlib](http://npm.im/minizlib) +- [fs-minipass](http://npm.im/fs-minipass) +- [tar](http://npm.im/tar) +- [minipass-collect](http://npm.im/minipass-collect) +- [minipass-flush](http://npm.im/minipass-flush) +- [minipass-pipeline](http://npm.im/minipass-pipeline) +- [tap](http://npm.im/tap) +- [tap-parser](http://npm.im/tap-parser) +- [treport](http://npm.im/treport) +- [minipass-fetch](http://npm.im/minipass-fetch) +- [pacote](http://npm.im/pacote) +- [make-fetch-happen](http://npm.im/make-fetch-happen) +- [cacache](http://npm.im/cacache) +- [ssri](http://npm.im/ssri) +- [npm-registry-fetch](http://npm.im/npm-registry-fetch) +- [minipass-json-stream](http://npm.im/minipass-json-stream) +- [minipass-sized](http://npm.im/minipass-sized) + +## Differences from Node.js Streams + +There are several things that make Minipass streams different +from (and in some ways superior to) Node.js core streams. + +Please read these caveats if you are familiar with node-core +streams and intend to use Minipass streams in your programs. + +You can avoid most of these differences entirely (for a very +small performance penalty) by setting `{async: true}` in the +constructor options. + +### Timing + +Minipass streams are designed to support synchronous use-cases. +Thus, data is emitted as soon as it is available, always. It is +buffered until read, but no longer. Another way to look at it is +that Minipass streams are exactly as synchronous as the logic +that writes into them. + +This can be surprising if your code relies on +`PassThrough.write()` always providing data on the next tick +rather than the current one, or being able to call `resume()` and +not have the entire buffer disappear immediately. + +However, without this synchronicity guarantee, there would be no +way for Minipass to achieve the speeds it does, or support the +synchronous use cases that it does. Simply put, waiting takes +time. + +This non-deferring approach makes Minipass streams much easier to +reason about, especially in the context of Promises and other +flow-control mechanisms. + +Example: + +```js +// hybrid module, either works +import { Minipass } from 'minipass' +// or: +const { Minipass } = require('minipass') + +const stream = new Minipass() +stream.on('data', () => console.log('data event')) +console.log('before write') +stream.write('hello') +console.log('after write') +// output: +// before write +// data event +// after write +``` + +### Exception: Async Opt-In + +If you wish to have a Minipass stream with behavior that more +closely mimics Node.js core streams, you can set the stream in +async mode either by setting `async: true` in the constructor +options, or by setting `stream.async = true` later on. + +```js +// hybrid module, either works +import { Minipass } from 'minipass' +// or: +const { Minipass } = require('minipass') + +const asyncStream = new Minipass({ async: true }) +asyncStream.on('data', () => console.log('data event')) +console.log('before write') +asyncStream.write('hello') +console.log('after write') +// output: +// before write +// after write +// data event <-- this is deferred until the next tick +``` + +Switching _out_ of async mode is unsafe, as it could cause data +corruption, and so is not enabled. Example: + +```js +import { Minipass } from 'minipass' +const stream = new Minipass({ encoding: 'utf8' }) +stream.on('data', chunk => console.log(chunk)) +stream.async = true +console.log('before writes') +stream.write('hello') +setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist! +stream.write('world') +console.log('after writes') +// hypothetical output would be: +// before writes +// world +// after writes +// hello +// NOT GOOD! +``` + +To avoid this problem, once set into async mode, any attempt to +make the stream sync again will be ignored. + +```js +const { Minipass } = require('minipass') +const stream = new Minipass({ encoding: 'utf8' }) +stream.on('data', chunk => console.log(chunk)) +stream.async = true +console.log('before writes') +stream.write('hello') +stream.async = false // <-- no-op, stream already async +stream.write('world') +console.log('after writes') +// actual output: +// before writes +// after writes +// hello +// world +``` + +### No High/Low Water Marks + +Node.js core streams will optimistically fill up a buffer, +returning `true` on all writes until the limit is hit, even if +the data has nowhere to go. Then, they will not attempt to draw +more data in until the buffer size dips below a minimum value. + +Minipass streams are much simpler. The `write()` method will +return `true` if the data has somewhere to go (which is to say, +given the timing guarantees, that the data is already there by +the time `write()` returns). + +If the data has nowhere to go, then `write()` returns false, and +the data sits in a buffer, to be drained out immediately as soon +as anyone consumes it. + +Since nothing is ever buffered unnecessarily, there is much less +copying data, and less bookkeeping about buffer capacity levels. + +### Hazards of Buffering (or: Why Minipass Is So Fast) + +Since data written to a Minipass stream is immediately written +all the way through the pipeline, and `write()` always returns +true/false based on whether the data was fully flushed, +backpressure is communicated immediately to the upstream caller. +This minimizes buffering. + +Consider this case: + +```js +const { PassThrough } = require('stream') +const p1 = new PassThrough({ highWaterMark: 1024 }) +const p2 = new PassThrough({ highWaterMark: 1024 }) +const p3 = new PassThrough({ highWaterMark: 1024 }) +const p4 = new PassThrough({ highWaterMark: 1024 }) + +p1.pipe(p2).pipe(p3).pipe(p4) +p4.on('data', () => console.log('made it through')) + +// this returns false and buffers, then writes to p2 on next tick (1) +// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) +// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) +// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' +// on next tick (4) +// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and +// 'drain' on next tick (5) +// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) +// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next +// tick (7) + +p1.write(Buffer.alloc(2048)) // returns false +``` + +Along the way, the data was buffered and deferred at each stage, +and multiple event deferrals happened, for an unblocked pipeline +where it was perfectly safe to write all the way through! + +Furthermore, setting a `highWaterMark` of `1024` might lead +someone reading the code to think an advisory maximum of 1KiB is +being set for the pipeline. However, the actual advisory +buffering level is the _sum_ of `highWaterMark` values, since +each one has its own bucket. + +Consider the Minipass case: + +```js +const m1 = new Minipass() +const m2 = new Minipass() +const m3 = new Minipass() +const m4 = new Minipass() + +m1.pipe(m2).pipe(m3).pipe(m4) +m4.on('data', () => console.log('made it through')) + +// m1 is flowing, so it writes the data to m2 immediately +// m2 is flowing, so it writes the data to m3 immediately +// m3 is flowing, so it writes the data to m4 immediately +// m4 is flowing, so it fires the 'data' event immediately, returns true +// m4's write returned true, so m3 is still flowing, returns true +// m3's write returned true, so m2 is still flowing, returns true +// m2's write returned true, so m1 is still flowing, returns true +// No event deferrals or buffering along the way! + +m1.write(Buffer.alloc(2048)) // returns true +``` + +It is extremely unlikely that you _don't_ want to buffer any data +written, or _ever_ buffer data that can be flushed all the way +through. Neither node-core streams nor Minipass ever fail to +buffer written data, but node-core streams do a lot of +unnecessary buffering and pausing. + +As always, the faster implementation is the one that does less +stuff and waits less time to do it. + +### Immediately emit `end` for empty streams (when not paused) + +If a stream is not paused, and `end()` is called before writing +any data into it, then it will emit `end` immediately. + +If you have logic that occurs on the `end` event which you don't +want to potentially happen immediately (for example, closing file +descriptors, moving on to the next entry in an archive parse +stream, etc.) then be sure to call `stream.pause()` on creation, +and then `stream.resume()` once you are ready to respond to the +`end` event. + +However, this is _usually_ not a problem because: + +### Emit `end` When Asked + +One hazard of immediately emitting `'end'` is that you may not +yet have had a chance to add a listener. In order to avoid this +hazard, Minipass streams safely re-emit the `'end'` event if a +new listener is added after `'end'` has been emitted. + +Ie, if you do `stream.on('end', someFunction)`, and the stream +has already emitted `end`, then it will call the handler right +away. (You can think of this somewhat like attaching a new +`.then(fn)` to a previously-resolved Promise.) + +To prevent calling handlers multiple times who would not expect +multiple ends to occur, all listeners are removed from the +`'end'` event whenever it is emitted. + +### Emit `error` When Asked + +The most recent error object passed to the `'error'` event is +stored on the stream. If a new `'error'` event handler is added, +and an error was previously emitted, then the event handler will +be called immediately (or on `process.nextTick` in the case of +async streams). + +This makes it much more difficult to end up trying to interact +with a broken stream, if the error handler is added after an +error was previously emitted. + +### Impact of "immediate flow" on Tee-streams + +A "tee stream" is a stream piping to multiple destinations: + +```js +const tee = new Minipass() +t.pipe(dest1) +t.pipe(dest2) +t.write('foo') // goes to both destinations +``` + +Since Minipass streams _immediately_ process any pending data +through the pipeline when a new pipe destination is added, this +can have surprising effects, especially when a stream comes in +from some other function and may or may not have data in its +buffer. + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone +src.pipe(dest2) // gets nothing! +``` + +One solution is to create a dedicated tee-stream junction that +pipes to both locations, and then pipe to _that_ instead. + +```js +// Safe example: tee to both places +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.pipe(dest1) +tee.pipe(dest2) +src.pipe(tee) // tee gets 'foo', pipes to both locations +``` + +The same caveat applies to `on('data')` event listeners. The +first one added will _immediately_ receive all of the data, +leaving nothing for the second: + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.on('data', handler1) // receives 'foo' right away +src.on('data', handler2) // nothing to see here! +``` + +Using a dedicated tee-stream can be used in this case as well: + +```js +// Safe example: tee to both data handlers +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.on('data', handler1) +tee.on('data', handler2) +src.pipe(tee) +``` + +All of the hazards in this section are avoided by setting `{ +async: true }` in the Minipass constructor, or by setting +`stream.async = true` afterwards. Note that this does add some +overhead, so should only be done in cases where you are willing +to lose a bit of performance in order to avoid having to refactor +program logic. + +## USAGE + +It's a stream! Use it like a stream and it'll most likely do what +you want. + +```js +import { Minipass } from 'minipass' +const mp = new Minipass(options) // optional: { encoding, objectMode } +mp.write('foo') +mp.pipe(someOtherStream) +mp.end('bar') +``` + +### OPTIONS + +- `encoding` How would you like the data coming _out_ of the + stream to be encoded? Accepts any values that can be passed to + `Buffer.toString()`. +- `objectMode` Emit data exactly as it comes in. This will be + flipped on by default if you write() something other than a + string or Buffer at any point. Setting `objectMode: true` will + prevent setting any encoding value. +- `async` Defaults to `false`. Set to `true` to defer data + emission until next tick. This reduces performance slightly, + but makes Minipass streams use timing behavior closer to Node + core streams. See [Timing](#timing) for more details. +- `signal` An `AbortSignal` that will cause the stream to unhook + itself from everything and become as inert as possible. Note + that providing a `signal` parameter will make `'error'` events + no longer throw if they are unhandled, but they will still be + emitted to handlers if any are attached. + +### API + +Implements the user-facing portions of Node.js's `Readable` and +`Writable` streams. + +### Methods + +- `write(chunk, [encoding], [callback])` - Put data in. (Note + that, in the base Minipass class, the same data will come out.) + Returns `false` if the stream will buffer the next write, or + true if it's still in "flowing" mode. +- `end([chunk, [encoding]], [callback])` - Signal that you have + no more data to write. This will queue an `end` event to be + fired when all the data has been consumed. +- `setEncoding(encoding)` - Set the encoding for data coming of + the stream. This can only be done once. +- `pause()` - No more data for a while, please. This also + prevents `end` from being emitted for empty streams until the + stream is resumed. +- `resume()` - Resume the stream. If there's data in the buffer, + it is all discarded. Any buffered events are immediately + emitted. +- `pipe(dest)` - Send all output to the stream provided. When + data is emitted, it is immediately written to any and all pipe + destinations. (Or written on next tick in `async` mode.) +- `unpipe(dest)` - Stop piping to the destination stream. This is + immediate, meaning that any asynchronously queued data will + _not_ make it to the destination when running in `async` mode. + - `options.end` - Boolean, end the destination stream when the + source stream ends. Default `true`. + - `options.proxyErrors` - Boolean, proxy `error` events from + the source stream to the destination stream. Note that errors + are _not_ proxied after the pipeline terminates, either due + to the source emitting `'end'` or manually unpiping with + `src.unpipe(dest)`. Default `false`. +- `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are + EventEmitters. Some events are given special treatment, + however. (See below under "events".) +- `promise()` - Returns a Promise that resolves when the stream + emits `end`, or rejects if the stream emits `error`. +- `collect()` - Return a Promise that resolves on `end` with an + array containing each chunk of data that was emitted, or + rejects if the stream emits `error`. Note that this consumes + the stream data. +- `concat()` - Same as `collect()`, but concatenates the data + into a single Buffer object. Will reject the returned promise + if the stream is in objectMode, or if it goes into objectMode + by the end of the data. +- `read(n)` - Consume `n` bytes of data out of the buffer. If `n` + is not provided, then consume all of it. If `n` bytes are not + available, then it returns null. **Note** consuming streams in + this way is less efficient, and can lead to unnecessary Buffer + copying. +- `destroy([er])` - Destroy the stream. If an error is provided, + then an `'error'` event is emitted. If the stream has a + `close()` method, and has not emitted a `'close'` event yet, + then `stream.close()` will be called. Any Promises returned by + `.promise()`, `.collect()` or `.concat()` will be rejected. + After being destroyed, writing to the stream will emit an + error. No more data will be emitted if the stream is destroyed, + even if it was previously buffered. + +### Properties + +- `bufferLength` Read-only. Total number of bytes buffered, or in + the case of objectMode, the total number of objects. +- `encoding` The encoding that has been set. (Setting this is + equivalent to calling `setEncoding(enc)` and has the same + prohibition against setting multiple times.) +- `flowing` Read-only. Boolean indicating whether a chunk written + to the stream will be immediately emitted. +- `emittedEnd` Read-only. Boolean indicating whether the end-ish + events (ie, `end`, `prefinish`, `finish`) have been emitted. + Note that listening on any end-ish event will immediateyl + re-emit it if it has already been emitted. +- `writable` Whether the stream is writable. Default `true`. Set + to `false` when `end()` +- `readable` Whether the stream is readable. Default `true`. +- `pipes` An array of Pipe objects referencing streams that this + stream is piping into. +- `destroyed` A getter that indicates whether the stream was + destroyed. +- `paused` True if the stream has been explicitly paused, + otherwise false. +- `objectMode` Indicates whether the stream is in `objectMode`. + Once set to `true`, it cannot be set to `false`. +- `aborted` Readonly property set when the `AbortSignal` + dispatches an `abort` event. + +### Events + +- `data` Emitted when there's data to read. Argument is the data + to read. This is never emitted while not flowing. If a listener + is attached, that will resume the stream. +- `end` Emitted when there's no more data to read. This will be + emitted immediately for empty streams when `end()` is called. + If a listener is attached, and `end` was already emitted, then + it will be emitted again. All listeners are removed when `end` + is emitted. +- `prefinish` An end-ish event that follows the same logic as + `end` and is emitted in the same conditions where `end` is + emitted. Emitted after `'end'`. +- `finish` An end-ish event that follows the same logic as `end` + and is emitted in the same conditions where `end` is emitted. + Emitted after `'prefinish'`. +- `close` An indication that an underlying resource has been + released. Minipass does not emit this event, but will defer it + until after `end` has been emitted, since it throws off some + stream libraries otherwise. +- `drain` Emitted when the internal buffer empties, and it is + again suitable to `write()` into the stream. +- `readable` Emitted when data is buffered and ready to be read + by a consumer. +- `resume` Emitted when stream changes state from buffering to + flowing mode. (Ie, when `resume` is called, `pipe` is called, + or a `data` event listener is added.) + +### Static Methods + +- `Minipass.isStream(stream)` Returns `true` if the argument is a + stream, and false otherwise. To be considered a stream, the + object must be either an instance of Minipass, or an + EventEmitter that has either a `pipe()` method, or both + `write()` and `end()` methods. (Pretty much any stream in + node-land will return `true` for this.) + +## EXAMPLES + +Here are some examples of things you can do with Minipass +streams. + +### simple "are you done yet" promise + +```js +mp.promise().then( + () => { + // stream is finished + }, + er => { + // stream emitted an error + } +) +``` + +### collecting + +```js +mp.collect().then(all => { + // all is an array of all the data emitted + // encoding is supported in this case, so + // so the result will be a collection of strings if + // an encoding is specified, or buffers/objects if not. + // + // In an async function, you may do + // const data = await stream.collect() +}) +``` + +### collecting into a single blob + +This is a bit slower because it concatenates the data into one +chunk for you, but if you're going to do it yourself anyway, it's +convenient this way: + +```js +mp.concat().then(onebigchunk => { + // onebigchunk is a string if the stream + // had an encoding set, or a buffer otherwise. +}) +``` + +### iteration + +You can iterate over streams synchronously or asynchronously in +platforms that support it. + +Synchronous iteration will end when the currently available data +is consumed, even if the `end` event has not been reached. In +string and buffer mode, the data is concatenated, so unless +multiple writes are occurring in the same tick as the `read()`, +sync iteration loops will generally only have a single iteration. + +To consume chunks in this way exactly as they have been written, +with no flattening, create the stream with the `{ objectMode: +true }` option. + +```js +const mp = new Minipass({ objectMode: true }) +mp.write('a') +mp.write('b') +for (let letter of mp) { + console.log(letter) // a, b +} +mp.write('c') +mp.write('d') +for (let letter of mp) { + console.log(letter) // c, d +} +mp.write('e') +mp.end() +for (let letter of mp) { + console.log(letter) // e +} +for (let letter of mp) { + console.log(letter) // nothing +} +``` + +Asynchronous iteration will continue until the end event is reached, +consuming all of the data. + +```js +const mp = new Minipass({ encoding: 'utf8' }) + +// some source of some data +let i = 5 +const inter = setInterval(() => { + if (i-- > 0) mp.write(Buffer.from('foo\n', 'utf8')) + else { + mp.end() + clearInterval(inter) + } +}, 100) + +// consume the data with asynchronous iteration +async function consume() { + for await (let chunk of mp) { + console.log(chunk) + } + return 'ok' +} + +consume().then(res => console.log(res)) +// logs `foo\n` 5 times, and then `ok` +``` + +### subclass that `console.log()`s everything written into it + +```js +class Logger extends Minipass { + write(chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end(chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } +} + +someSource.pipe(new Logger()).pipe(someDest) +``` + +### same thing, but using an inline anonymous class + +```js +// js classes are fun +someSource + .pipe( + new (class extends Minipass { + emit(ev, ...data) { + // let's also log events, because debugging some weird thing + console.log('EMIT', ev) + return super.emit(ev, ...data) + } + write(chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end(chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } + })() + ) + .pipe(someDest) +``` + +### subclass that defers 'end' for some reason + +```js +class SlowEnd extends Minipass { + emit(ev, ...args) { + if (ev === 'end') { + console.log('going to end, hold on a sec') + setTimeout(() => { + console.log('ok, ready to end now') + super.emit('end', ...args) + }, 100) + } else { + return super.emit(ev, ...args) + } + } +} +``` + +### transform that creates newline-delimited JSON + +```js +class NDJSONEncode extends Minipass { + write(obj, cb) { + try { + // JSON.stringify can throw, emit an error on that + return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) + } catch (er) { + this.emit('error', er) + } + } + end(obj, cb) { + if (typeof obj === 'function') { + cb = obj + obj = undefined + } + if (obj !== undefined) { + this.write(obj) + } + return super.end(cb) + } +} +``` + +### transform that parses newline-delimited JSON + +```js +class NDJSONDecode extends Minipass { + constructor (options) { + // always be in object mode, as far as Minipass is concerned + super({ objectMode: true }) + this._jsonBuffer = '' + } + write (chunk, encoding, cb) { + if (typeof chunk === 'string' && + typeof encoding === 'string' && + encoding !== 'utf8') { + chunk = Buffer.from(chunk, encoding).toString() + } else if (Buffer.isBuffer(chunk)) { + chunk = chunk.toString() + } + if (typeof encoding === 'function') { + cb = encoding + } + const jsonData = (this._jsonBuffer + chunk).split('\n') + this._jsonBuffer = jsonData.pop() + for (let i = 0; i < jsonData.length; i++) { + try { + // JSON.parse can throw, emit an error on that + super.write(JSON.parse(jsonData[i])) + } catch (er) { + this.emit('error', er) + continue + } + } + if (cb) + cb() + } +} +``` diff --git a/node_modules/minipass/index.d.ts b/node_modules/minipass/index.d.ts new file mode 100644 index 00000000..86851f96 --- /dev/null +++ b/node_modules/minipass/index.d.ts @@ -0,0 +1,152 @@ +/// + +// Note: marking anything protected or private in the exported +// class will limit Minipass's ability to be used as the base +// for mixin classes. +import { EventEmitter } from 'events' +import { Stream } from 'stream' + +export namespace Minipass { + export type Encoding = BufferEncoding | 'buffer' | null + + export interface Writable extends EventEmitter { + end(): any + write(chunk: any, ...args: any[]): any + } + + export interface Readable extends EventEmitter { + pause(): any + resume(): any + pipe(): any + } + + export type DualIterable = Iterable & AsyncIterable + + export type ContiguousData = + | Buffer + | ArrayBufferLike + | ArrayBufferView + | string + + export type BufferOrString = Buffer | string + + export interface SharedOptions { + async?: boolean + signal?: AbortSignal + } + + export interface StringOptions extends SharedOptions { + encoding: BufferEncoding + objectMode?: boolean + } + + export interface BufferOptions extends SharedOptions { + encoding?: null | 'buffer' + objectMode?: boolean + } + + export interface ObjectModeOptions extends SharedOptions { + objectMode: true + } + + export interface PipeOptions { + end?: boolean + proxyErrors?: boolean + } + + export type Options = T extends string + ? StringOptions + : T extends Buffer + ? BufferOptions + : ObjectModeOptions +} + +export class Minipass< + RType extends any = Buffer, + WType extends any = RType extends Minipass.BufferOrString + ? Minipass.ContiguousData + : RType + > + extends Stream + implements Minipass.DualIterable +{ + static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable + + readonly bufferLength: number + readonly flowing: boolean + readonly writable: boolean + readonly readable: boolean + readonly aborted: boolean + readonly paused: boolean + readonly emittedEnd: boolean + readonly destroyed: boolean + + /** + * Technically writable, but mutating it can change the type, + * so is not safe to do in TypeScript. + */ + readonly objectMode: boolean + async: boolean + + /** + * Note: encoding is not actually read-only, and setEncoding(enc) + * exists. However, this type definition will insist that TypeScript + * programs declare the type of a Minipass stream up front, and if + * that type is string, then an encoding MUST be set in the ctor. If + * the type is Buffer, then the encoding must be missing, or set to + * 'buffer' or null. If the type is anything else, then objectMode + * must be set in the constructor options. So there is effectively + * no allowed way that a TS program can set the encoding after + * construction, as doing so will destroy any hope of type safety. + * TypeScript does not provide many options for changing the type of + * an object at run-time, which is what changing the encoding does. + */ + readonly encoding: Minipass.Encoding + // setEncoding(encoding: Encoding): void + + // Options required if not reading buffers + constructor( + ...args: RType extends Buffer + ? [] | [Minipass.Options] + : [Minipass.Options] + ) + + write(chunk: WType, cb?: () => void): boolean + write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean + read(size?: number): RType + end(cb?: () => void): this + end(chunk: any, cb?: () => void): this + end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this + pause(): void + resume(): void + promise(): Promise + collect(): Promise + + concat(): RType extends Minipass.BufferOrString ? Promise : never + destroy(er?: any): void + pipe(dest: W, opts?: Minipass.PipeOptions): W + unpipe(dest: W): void + + /** + * alias for on() + */ + addEventHandler(event: string, listener: (...args: any[]) => any): this + + on(event: string, listener: (...args: any[]) => any): this + on(event: 'data', listener: (chunk: RType) => any): this + on(event: 'error', listener: (error: any) => any): this + on( + event: + | 'readable' + | 'drain' + | 'resume' + | 'end' + | 'prefinish' + | 'finish' + | 'close', + listener: () => any + ): this + + [Symbol.iterator](): Generator + [Symbol.asyncIterator](): AsyncGenerator +} diff --git a/node_modules/minipass/index.js b/node_modules/minipass/index.js new file mode 100644 index 00000000..ed07c17a --- /dev/null +++ b/node_modules/minipass/index.js @@ -0,0 +1,702 @@ +'use strict' +const proc = + typeof process === 'object' && process + ? process + : { + stdout: null, + stderr: null, + } +const EE = require('events') +const Stream = require('stream') +const stringdecoder = require('string_decoder') +const SD = stringdecoder.StringDecoder + +const EOF = Symbol('EOF') +const MAYBE_EMIT_END = Symbol('maybeEmitEnd') +const EMITTED_END = Symbol('emittedEnd') +const EMITTING_END = Symbol('emittingEnd') +const EMITTED_ERROR = Symbol('emittedError') +const CLOSED = Symbol('closed') +const READ = Symbol('read') +const FLUSH = Symbol('flush') +const FLUSHCHUNK = Symbol('flushChunk') +const ENCODING = Symbol('encoding') +const DECODER = Symbol('decoder') +const FLOWING = Symbol('flowing') +const PAUSED = Symbol('paused') +const RESUME = Symbol('resume') +const BUFFER = Symbol('buffer') +const PIPES = Symbol('pipes') +const BUFFERLENGTH = Symbol('bufferLength') +const BUFFERPUSH = Symbol('bufferPush') +const BUFFERSHIFT = Symbol('bufferShift') +const OBJECTMODE = Symbol('objectMode') +// internal event when stream is destroyed +const DESTROYED = Symbol('destroyed') +// internal event when stream has an error +const ERROR = Symbol('error') +const EMITDATA = Symbol('emitData') +const EMITEND = Symbol('emitEnd') +const EMITEND2 = Symbol('emitEnd2') +const ASYNC = Symbol('async') +const ABORT = Symbol('abort') +const ABORTED = Symbol('aborted') +const SIGNAL = Symbol('signal') + +const defer = fn => Promise.resolve().then(fn) + +// TODO remove when Node v8 support drops +const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' +const ASYNCITERATOR = + (doIter && Symbol.asyncIterator) || Symbol('asyncIterator not implemented') +const ITERATOR = + (doIter && Symbol.iterator) || Symbol('iterator not implemented') + +// events that mean 'the stream is over' +// these are treated specially, and re-emitted +// if they are listened for after emitting. +const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish' + +const isArrayBuffer = b => + b instanceof ArrayBuffer || + (typeof b === 'object' && + b.constructor && + b.constructor.name === 'ArrayBuffer' && + b.byteLength >= 0) + +const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) + +class Pipe { + constructor(src, dest, opts) { + this.src = src + this.dest = dest + this.opts = opts + this.ondrain = () => src[RESUME]() + dest.on('drain', this.ondrain) + } + unpipe() { + this.dest.removeListener('drain', this.ondrain) + } + // istanbul ignore next - only here for the prototype + proxyErrors() {} + end() { + this.unpipe() + if (this.opts.end) this.dest.end() + } +} + +class PipeProxyErrors extends Pipe { + unpipe() { + this.src.removeListener('error', this.proxyErrors) + super.unpipe() + } + constructor(src, dest, opts) { + super(src, dest, opts) + this.proxyErrors = er => dest.emit('error', er) + src.on('error', this.proxyErrors) + } +} + +class Minipass extends Stream { + constructor(options) { + super() + this[FLOWING] = false + // whether we're explicitly paused + this[PAUSED] = false + this[PIPES] = [] + this[BUFFER] = [] + this[OBJECTMODE] = (options && options.objectMode) || false + if (this[OBJECTMODE]) this[ENCODING] = null + else this[ENCODING] = (options && options.encoding) || null + if (this[ENCODING] === 'buffer') this[ENCODING] = null + this[ASYNC] = (options && !!options.async) || false + this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null + this[EOF] = false + this[EMITTED_END] = false + this[EMITTING_END] = false + this[CLOSED] = false + this[EMITTED_ERROR] = null + this.writable = true + this.readable = true + this[BUFFERLENGTH] = 0 + this[DESTROYED] = false + if (options && options.debugExposeBuffer === true) { + Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] }) + } + if (options && options.debugExposePipes === true) { + Object.defineProperty(this, 'pipes', { get: () => this[PIPES] }) + } + this[SIGNAL] = options && options.signal + this[ABORTED] = false + if (this[SIGNAL]) { + this[SIGNAL].addEventListener('abort', () => this[ABORT]()) + if (this[SIGNAL].aborted) { + this[ABORT]() + } + } + } + + get bufferLength() { + return this[BUFFERLENGTH] + } + + get encoding() { + return this[ENCODING] + } + set encoding(enc) { + if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode') + + if ( + this[ENCODING] && + enc !== this[ENCODING] && + ((this[DECODER] && this[DECODER].lastNeed) || this[BUFFERLENGTH]) + ) + throw new Error('cannot change encoding') + + if (this[ENCODING] !== enc) { + this[DECODER] = enc ? new SD(enc) : null + if (this[BUFFER].length) + this[BUFFER] = this[BUFFER].map(chunk => this[DECODER].write(chunk)) + } + + this[ENCODING] = enc + } + + setEncoding(enc) { + this.encoding = enc + } + + get objectMode() { + return this[OBJECTMODE] + } + set objectMode(om) { + this[OBJECTMODE] = this[OBJECTMODE] || !!om + } + + get ['async']() { + return this[ASYNC] + } + set ['async'](a) { + this[ASYNC] = this[ASYNC] || !!a + } + + // drop everything and get out of the flow completely + [ABORT]() { + this[ABORTED] = true + this.emit('abort', this[SIGNAL].reason) + this.destroy(this[SIGNAL].reason) + } + + get aborted() { + return this[ABORTED] + } + set aborted(_) {} + + write(chunk, encoding, cb) { + if (this[ABORTED]) return false + if (this[EOF]) throw new Error('write after end') + + if (this[DESTROYED]) { + this.emit( + 'error', + Object.assign( + new Error('Cannot call write after a stream was destroyed'), + { code: 'ERR_STREAM_DESTROYED' } + ) + ) + return true + } + + if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8') + + if (!encoding) encoding = 'utf8' + + const fn = this[ASYNC] ? defer : f => f() + + // convert array buffers and typed array views into buffers + // at some point in the future, we may want to do the opposite! + // leave strings and buffers as-is + // anything else switches us into object mode + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) + else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk) + else if (typeof chunk !== 'string') + // use the setter so we throw if we have encoding set + this.objectMode = true + } + + // handle object mode up front, since it's simpler + // this yields better performance, fewer checks later. + if (this[OBJECTMODE]) { + /* istanbul ignore if - maybe impossible? */ + if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true) + + if (this.flowing) this.emit('data', chunk) + else this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) this.emit('readable') + + if (cb) fn(cb) + + return this.flowing + } + + // at this point the chunk is a buffer or string + // don't buffer it up or send it to the decoder + if (!chunk.length) { + if (this[BUFFERLENGTH] !== 0) this.emit('readable') + if (cb) fn(cb) + return this.flowing + } + + // fast-path writing strings of same encoding to a stream with + // an empty buffer, skipping the buffer/decoder dance + if ( + typeof chunk === 'string' && + // unless it is a string already ready for us to use + !(encoding === this[ENCODING] && !this[DECODER].lastNeed) + ) { + chunk = Buffer.from(chunk, encoding) + } + + if (Buffer.isBuffer(chunk) && this[ENCODING]) + chunk = this[DECODER].write(chunk) + + // Note: flushing CAN potentially switch us into not-flowing mode + if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true) + + if (this.flowing) this.emit('data', chunk) + else this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) this.emit('readable') + + if (cb) fn(cb) + + return this.flowing + } + + read(n) { + if (this[DESTROYED]) return null + + if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) { + this[MAYBE_EMIT_END]() + return null + } + + if (this[OBJECTMODE]) n = null + + if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { + if (this.encoding) this[BUFFER] = [this[BUFFER].join('')] + else this[BUFFER] = [Buffer.concat(this[BUFFER], this[BUFFERLENGTH])] + } + + const ret = this[READ](n || null, this[BUFFER][0]) + this[MAYBE_EMIT_END]() + return ret + } + + [READ](n, chunk) { + if (n === chunk.length || n === null) this[BUFFERSHIFT]() + else { + this[BUFFER][0] = chunk.slice(n) + chunk = chunk.slice(0, n) + this[BUFFERLENGTH] -= n + } + + this.emit('data', chunk) + + if (!this[BUFFER].length && !this[EOF]) this.emit('drain') + + return chunk + } + + end(chunk, encoding, cb) { + if (typeof chunk === 'function') (cb = chunk), (chunk = null) + if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8') + if (chunk) this.write(chunk, encoding) + if (cb) this.once('end', cb) + this[EOF] = true + this.writable = false + + // if we haven't written anything, then go ahead and emit, + // even if we're not reading. + // we'll re-emit if a new 'end' listener is added anyway. + // This makes MP more suitable to write-only use cases. + if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() + return this + } + + // don't let the internal resume be overwritten + [RESUME]() { + if (this[DESTROYED]) return + + this[PAUSED] = false + this[FLOWING] = true + this.emit('resume') + if (this[BUFFER].length) this[FLUSH]() + else if (this[EOF]) this[MAYBE_EMIT_END]() + else this.emit('drain') + } + + resume() { + return this[RESUME]() + } + + pause() { + this[FLOWING] = false + this[PAUSED] = true + } + + get destroyed() { + return this[DESTROYED] + } + + get flowing() { + return this[FLOWING] + } + + get paused() { + return this[PAUSED] + } + + [BUFFERPUSH](chunk) { + if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 + else this[BUFFERLENGTH] += chunk.length + this[BUFFER].push(chunk) + } + + [BUFFERSHIFT]() { + if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1 + else this[BUFFERLENGTH] -= this[BUFFER][0].length + return this[BUFFER].shift() + } + + [FLUSH](noDrain) { + do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length) + + if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain') + } + + [FLUSHCHUNK](chunk) { + this.emit('data', chunk) + return this.flowing + } + + pipe(dest, opts) { + if (this[DESTROYED]) return + + const ended = this[EMITTED_END] + opts = opts || {} + if (dest === proc.stdout || dest === proc.stderr) opts.end = false + else opts.end = opts.end !== false + opts.proxyErrors = !!opts.proxyErrors + + // piping an ended stream ends immediately + if (ended) { + if (opts.end) dest.end() + } else { + this[PIPES].push( + !opts.proxyErrors + ? new Pipe(this, dest, opts) + : new PipeProxyErrors(this, dest, opts) + ) + if (this[ASYNC]) defer(() => this[RESUME]()) + else this[RESUME]() + } + + return dest + } + + unpipe(dest) { + const p = this[PIPES].find(p => p.dest === dest) + if (p) { + this[PIPES].splice(this[PIPES].indexOf(p), 1) + p.unpipe() + } + } + + addListener(ev, fn) { + return this.on(ev, fn) + } + + on(ev, fn) { + const ret = super.on(ev, fn) + if (ev === 'data' && !this[PIPES].length && !this.flowing) this[RESUME]() + else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) + super.emit('readable') + else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev) + this.removeAllListeners(ev) + } else if (ev === 'error' && this[EMITTED_ERROR]) { + if (this[ASYNC]) defer(() => fn.call(this, this[EMITTED_ERROR])) + else fn.call(this, this[EMITTED_ERROR]) + } + return ret + } + + get emittedEnd() { + return this[EMITTED_END] + } + + [MAYBE_EMIT_END]() { + if ( + !this[EMITTING_END] && + !this[EMITTED_END] && + !this[DESTROYED] && + this[BUFFER].length === 0 && + this[EOF] + ) { + this[EMITTING_END] = true + this.emit('end') + this.emit('prefinish') + this.emit('finish') + if (this[CLOSED]) this.emit('close') + this[EMITTING_END] = false + } + } + + emit(ev, data, ...extra) { + // error and close are only events allowed after calling destroy() + if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) + return + else if (ev === 'data') { + return !this[OBJECTMODE] && !data + ? false + : this[ASYNC] + ? defer(() => this[EMITDATA](data)) + : this[EMITDATA](data) + } else if (ev === 'end') { + return this[EMITEND]() + } else if (ev === 'close') { + this[CLOSED] = true + // don't emit close before 'end' and 'finish' + if (!this[EMITTED_END] && !this[DESTROYED]) return + const ret = super.emit('close') + this.removeAllListeners('close') + return ret + } else if (ev === 'error') { + this[EMITTED_ERROR] = data + super.emit(ERROR, data) + const ret = + !this[SIGNAL] || this.listeners('error').length + ? super.emit('error', data) + : false + this[MAYBE_EMIT_END]() + return ret + } else if (ev === 'resume') { + const ret = super.emit('resume') + this[MAYBE_EMIT_END]() + return ret + } else if (ev === 'finish' || ev === 'prefinish') { + const ret = super.emit(ev) + this.removeAllListeners(ev) + return ret + } + + // Some other unknown event + const ret = super.emit(ev, data, ...extra) + this[MAYBE_EMIT_END]() + return ret + } + + [EMITDATA](data) { + for (const p of this[PIPES]) { + if (p.dest.write(data) === false) this.pause() + } + const ret = super.emit('data', data) + this[MAYBE_EMIT_END]() + return ret + } + + [EMITEND]() { + if (this[EMITTED_END]) return + + this[EMITTED_END] = true + this.readable = false + if (this[ASYNC]) defer(() => this[EMITEND2]()) + else this[EMITEND2]() + } + + [EMITEND2]() { + if (this[DECODER]) { + const data = this[DECODER].end() + if (data) { + for (const p of this[PIPES]) { + p.dest.write(data) + } + super.emit('data', data) + } + } + + for (const p of this[PIPES]) { + p.end() + } + const ret = super.emit('end') + this.removeAllListeners('end') + return ret + } + + // const all = await stream.collect() + collect() { + const buf = [] + if (!this[OBJECTMODE]) buf.dataLength = 0 + // set the promise first, in case an error is raised + // by triggering the flow here. + const p = this.promise() + this.on('data', c => { + buf.push(c) + if (!this[OBJECTMODE]) buf.dataLength += c.length + }) + return p.then(() => buf) + } + + // const data = await stream.concat() + concat() { + return this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this.collect().then(buf => + this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this[ENCODING] + ? buf.join('') + : Buffer.concat(buf, buf.dataLength) + ) + } + + // stream.promise().then(() => done, er => emitted error) + promise() { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error('stream destroyed'))) + this.on('error', er => reject(er)) + this.on('end', () => resolve()) + }) + } + + // for await (let chunk of stream) + [ASYNCITERATOR]() { + let stopped = false + const stop = () => { + this.pause() + stopped = true + return Promise.resolve({ done: true }) + } + const next = () => { + if (stopped) return stop() + const res = this.read() + if (res !== null) return Promise.resolve({ done: false, value: res }) + + if (this[EOF]) return stop() + + let resolve = null + let reject = null + const onerr = er => { + this.removeListener('data', ondata) + this.removeListener('end', onend) + this.removeListener(DESTROYED, ondestroy) + stop() + reject(er) + } + const ondata = value => { + this.removeListener('error', onerr) + this.removeListener('end', onend) + this.removeListener(DESTROYED, ondestroy) + this.pause() + resolve({ value: value, done: !!this[EOF] }) + } + const onend = () => { + this.removeListener('error', onerr) + this.removeListener('data', ondata) + this.removeListener(DESTROYED, ondestroy) + stop() + resolve({ done: true }) + } + const ondestroy = () => onerr(new Error('stream destroyed')) + return new Promise((res, rej) => { + reject = rej + resolve = res + this.once(DESTROYED, ondestroy) + this.once('error', onerr) + this.once('end', onend) + this.once('data', ondata) + }) + } + + return { + next, + throw: stop, + return: stop, + [ASYNCITERATOR]() { + return this + }, + } + } + + // for (let chunk of stream) + [ITERATOR]() { + let stopped = false + const stop = () => { + this.pause() + this.removeListener(ERROR, stop) + this.removeListener(DESTROYED, stop) + this.removeListener('end', stop) + stopped = true + return { done: true } + } + + const next = () => { + if (stopped) return stop() + const value = this.read() + return value === null ? stop() : { value } + } + this.once('end', stop) + this.once(ERROR, stop) + this.once(DESTROYED, stop) + + return { + next, + throw: stop, + return: stop, + [ITERATOR]() { + return this + }, + } + } + + destroy(er) { + if (this[DESTROYED]) { + if (er) this.emit('error', er) + else this.emit(DESTROYED) + return this + } + + this[DESTROYED] = true + + // throw away all buffered data, it's never coming out + this[BUFFER].length = 0 + this[BUFFERLENGTH] = 0 + + if (typeof this.close === 'function' && !this[CLOSED]) this.close() + + if (er) this.emit('error', er) + // if no error to emit, still reject pending promises + else this.emit(DESTROYED) + + return this + } + + static isStream(s) { + return ( + !!s && + (s instanceof Minipass || + s instanceof Stream || + (s instanceof EE && + // readable + (typeof s.pipe === 'function' || + // writable + (typeof s.write === 'function' && typeof s.end === 'function')))) + ) + } +} + +exports.Minipass = Minipass diff --git a/node_modules/minipass/index.mjs b/node_modules/minipass/index.mjs new file mode 100644 index 00000000..6ef6cd8c --- /dev/null +++ b/node_modules/minipass/index.mjs @@ -0,0 +1,702 @@ +'use strict' +const proc = + typeof process === 'object' && process + ? process + : { + stdout: null, + stderr: null, + } +import EE from 'events' +import Stream from 'stream' +import stringdecoder from 'string_decoder' +const SD = stringdecoder.StringDecoder + +const EOF = Symbol('EOF') +const MAYBE_EMIT_END = Symbol('maybeEmitEnd') +const EMITTED_END = Symbol('emittedEnd') +const EMITTING_END = Symbol('emittingEnd') +const EMITTED_ERROR = Symbol('emittedError') +const CLOSED = Symbol('closed') +const READ = Symbol('read') +const FLUSH = Symbol('flush') +const FLUSHCHUNK = Symbol('flushChunk') +const ENCODING = Symbol('encoding') +const DECODER = Symbol('decoder') +const FLOWING = Symbol('flowing') +const PAUSED = Symbol('paused') +const RESUME = Symbol('resume') +const BUFFER = Symbol('buffer') +const PIPES = Symbol('pipes') +const BUFFERLENGTH = Symbol('bufferLength') +const BUFFERPUSH = Symbol('bufferPush') +const BUFFERSHIFT = Symbol('bufferShift') +const OBJECTMODE = Symbol('objectMode') +// internal event when stream is destroyed +const DESTROYED = Symbol('destroyed') +// internal event when stream has an error +const ERROR = Symbol('error') +const EMITDATA = Symbol('emitData') +const EMITEND = Symbol('emitEnd') +const EMITEND2 = Symbol('emitEnd2') +const ASYNC = Symbol('async') +const ABORT = Symbol('abort') +const ABORTED = Symbol('aborted') +const SIGNAL = Symbol('signal') + +const defer = fn => Promise.resolve().then(fn) + +// TODO remove when Node v8 support drops +const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' +const ASYNCITERATOR = + (doIter && Symbol.asyncIterator) || Symbol('asyncIterator not implemented') +const ITERATOR = + (doIter && Symbol.iterator) || Symbol('iterator not implemented') + +// events that mean 'the stream is over' +// these are treated specially, and re-emitted +// if they are listened for after emitting. +const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish' + +const isArrayBuffer = b => + b instanceof ArrayBuffer || + (typeof b === 'object' && + b.constructor && + b.constructor.name === 'ArrayBuffer' && + b.byteLength >= 0) + +const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) + +class Pipe { + constructor(src, dest, opts) { + this.src = src + this.dest = dest + this.opts = opts + this.ondrain = () => src[RESUME]() + dest.on('drain', this.ondrain) + } + unpipe() { + this.dest.removeListener('drain', this.ondrain) + } + // istanbul ignore next - only here for the prototype + proxyErrors() {} + end() { + this.unpipe() + if (this.opts.end) this.dest.end() + } +} + +class PipeProxyErrors extends Pipe { + unpipe() { + this.src.removeListener('error', this.proxyErrors) + super.unpipe() + } + constructor(src, dest, opts) { + super(src, dest, opts) + this.proxyErrors = er => dest.emit('error', er) + src.on('error', this.proxyErrors) + } +} + +export class Minipass extends Stream { + constructor(options) { + super() + this[FLOWING] = false + // whether we're explicitly paused + this[PAUSED] = false + this[PIPES] = [] + this[BUFFER] = [] + this[OBJECTMODE] = (options && options.objectMode) || false + if (this[OBJECTMODE]) this[ENCODING] = null + else this[ENCODING] = (options && options.encoding) || null + if (this[ENCODING] === 'buffer') this[ENCODING] = null + this[ASYNC] = (options && !!options.async) || false + this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null + this[EOF] = false + this[EMITTED_END] = false + this[EMITTING_END] = false + this[CLOSED] = false + this[EMITTED_ERROR] = null + this.writable = true + this.readable = true + this[BUFFERLENGTH] = 0 + this[DESTROYED] = false + if (options && options.debugExposeBuffer === true) { + Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] }) + } + if (options && options.debugExposePipes === true) { + Object.defineProperty(this, 'pipes', { get: () => this[PIPES] }) + } + this[SIGNAL] = options && options.signal + this[ABORTED] = false + if (this[SIGNAL]) { + this[SIGNAL].addEventListener('abort', () => this[ABORT]()) + if (this[SIGNAL].aborted) { + this[ABORT]() + } + } + } + + get bufferLength() { + return this[BUFFERLENGTH] + } + + get encoding() { + return this[ENCODING] + } + set encoding(enc) { + if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode') + + if ( + this[ENCODING] && + enc !== this[ENCODING] && + ((this[DECODER] && this[DECODER].lastNeed) || this[BUFFERLENGTH]) + ) + throw new Error('cannot change encoding') + + if (this[ENCODING] !== enc) { + this[DECODER] = enc ? new SD(enc) : null + if (this[BUFFER].length) + this[BUFFER] = this[BUFFER].map(chunk => this[DECODER].write(chunk)) + } + + this[ENCODING] = enc + } + + setEncoding(enc) { + this.encoding = enc + } + + get objectMode() { + return this[OBJECTMODE] + } + set objectMode(om) { + this[OBJECTMODE] = this[OBJECTMODE] || !!om + } + + get ['async']() { + return this[ASYNC] + } + set ['async'](a) { + this[ASYNC] = this[ASYNC] || !!a + } + + // drop everything and get out of the flow completely + [ABORT]() { + this[ABORTED] = true + this.emit('abort', this[SIGNAL].reason) + this.destroy(this[SIGNAL].reason) + } + + get aborted() { + return this[ABORTED] + } + set aborted(_) {} + + write(chunk, encoding, cb) { + if (this[ABORTED]) return false + if (this[EOF]) throw new Error('write after end') + + if (this[DESTROYED]) { + this.emit( + 'error', + Object.assign( + new Error('Cannot call write after a stream was destroyed'), + { code: 'ERR_STREAM_DESTROYED' } + ) + ) + return true + } + + if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8') + + if (!encoding) encoding = 'utf8' + + const fn = this[ASYNC] ? defer : f => f() + + // convert array buffers and typed array views into buffers + // at some point in the future, we may want to do the opposite! + // leave strings and buffers as-is + // anything else switches us into object mode + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) + else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk) + else if (typeof chunk !== 'string') + // use the setter so we throw if we have encoding set + this.objectMode = true + } + + // handle object mode up front, since it's simpler + // this yields better performance, fewer checks later. + if (this[OBJECTMODE]) { + /* istanbul ignore if - maybe impossible? */ + if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true) + + if (this.flowing) this.emit('data', chunk) + else this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) this.emit('readable') + + if (cb) fn(cb) + + return this.flowing + } + + // at this point the chunk is a buffer or string + // don't buffer it up or send it to the decoder + if (!chunk.length) { + if (this[BUFFERLENGTH] !== 0) this.emit('readable') + if (cb) fn(cb) + return this.flowing + } + + // fast-path writing strings of same encoding to a stream with + // an empty buffer, skipping the buffer/decoder dance + if ( + typeof chunk === 'string' && + // unless it is a string already ready for us to use + !(encoding === this[ENCODING] && !this[DECODER].lastNeed) + ) { + chunk = Buffer.from(chunk, encoding) + } + + if (Buffer.isBuffer(chunk) && this[ENCODING]) + chunk = this[DECODER].write(chunk) + + // Note: flushing CAN potentially switch us into not-flowing mode + if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true) + + if (this.flowing) this.emit('data', chunk) + else this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) this.emit('readable') + + if (cb) fn(cb) + + return this.flowing + } + + read(n) { + if (this[DESTROYED]) return null + + if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) { + this[MAYBE_EMIT_END]() + return null + } + + if (this[OBJECTMODE]) n = null + + if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { + if (this.encoding) this[BUFFER] = [this[BUFFER].join('')] + else this[BUFFER] = [Buffer.concat(this[BUFFER], this[BUFFERLENGTH])] + } + + const ret = this[READ](n || null, this[BUFFER][0]) + this[MAYBE_EMIT_END]() + return ret + } + + [READ](n, chunk) { + if (n === chunk.length || n === null) this[BUFFERSHIFT]() + else { + this[BUFFER][0] = chunk.slice(n) + chunk = chunk.slice(0, n) + this[BUFFERLENGTH] -= n + } + + this.emit('data', chunk) + + if (!this[BUFFER].length && !this[EOF]) this.emit('drain') + + return chunk + } + + end(chunk, encoding, cb) { + if (typeof chunk === 'function') (cb = chunk), (chunk = null) + if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8') + if (chunk) this.write(chunk, encoding) + if (cb) this.once('end', cb) + this[EOF] = true + this.writable = false + + // if we haven't written anything, then go ahead and emit, + // even if we're not reading. + // we'll re-emit if a new 'end' listener is added anyway. + // This makes MP more suitable to write-only use cases. + if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() + return this + } + + // don't let the internal resume be overwritten + [RESUME]() { + if (this[DESTROYED]) return + + this[PAUSED] = false + this[FLOWING] = true + this.emit('resume') + if (this[BUFFER].length) this[FLUSH]() + else if (this[EOF]) this[MAYBE_EMIT_END]() + else this.emit('drain') + } + + resume() { + return this[RESUME]() + } + + pause() { + this[FLOWING] = false + this[PAUSED] = true + } + + get destroyed() { + return this[DESTROYED] + } + + get flowing() { + return this[FLOWING] + } + + get paused() { + return this[PAUSED] + } + + [BUFFERPUSH](chunk) { + if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 + else this[BUFFERLENGTH] += chunk.length + this[BUFFER].push(chunk) + } + + [BUFFERSHIFT]() { + if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1 + else this[BUFFERLENGTH] -= this[BUFFER][0].length + return this[BUFFER].shift() + } + + [FLUSH](noDrain) { + do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length) + + if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain') + } + + [FLUSHCHUNK](chunk) { + this.emit('data', chunk) + return this.flowing + } + + pipe(dest, opts) { + if (this[DESTROYED]) return + + const ended = this[EMITTED_END] + opts = opts || {} + if (dest === proc.stdout || dest === proc.stderr) opts.end = false + else opts.end = opts.end !== false + opts.proxyErrors = !!opts.proxyErrors + + // piping an ended stream ends immediately + if (ended) { + if (opts.end) dest.end() + } else { + this[PIPES].push( + !opts.proxyErrors + ? new Pipe(this, dest, opts) + : new PipeProxyErrors(this, dest, opts) + ) + if (this[ASYNC]) defer(() => this[RESUME]()) + else this[RESUME]() + } + + return dest + } + + unpipe(dest) { + const p = this[PIPES].find(p => p.dest === dest) + if (p) { + this[PIPES].splice(this[PIPES].indexOf(p), 1) + p.unpipe() + } + } + + addListener(ev, fn) { + return this.on(ev, fn) + } + + on(ev, fn) { + const ret = super.on(ev, fn) + if (ev === 'data' && !this[PIPES].length && !this.flowing) this[RESUME]() + else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) + super.emit('readable') + else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev) + this.removeAllListeners(ev) + } else if (ev === 'error' && this[EMITTED_ERROR]) { + if (this[ASYNC]) defer(() => fn.call(this, this[EMITTED_ERROR])) + else fn.call(this, this[EMITTED_ERROR]) + } + return ret + } + + get emittedEnd() { + return this[EMITTED_END] + } + + [MAYBE_EMIT_END]() { + if ( + !this[EMITTING_END] && + !this[EMITTED_END] && + !this[DESTROYED] && + this[BUFFER].length === 0 && + this[EOF] + ) { + this[EMITTING_END] = true + this.emit('end') + this.emit('prefinish') + this.emit('finish') + if (this[CLOSED]) this.emit('close') + this[EMITTING_END] = false + } + } + + emit(ev, data, ...extra) { + // error and close are only events allowed after calling destroy() + if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) + return + else if (ev === 'data') { + return !this[OBJECTMODE] && !data + ? false + : this[ASYNC] + ? defer(() => this[EMITDATA](data)) + : this[EMITDATA](data) + } else if (ev === 'end') { + return this[EMITEND]() + } else if (ev === 'close') { + this[CLOSED] = true + // don't emit close before 'end' and 'finish' + if (!this[EMITTED_END] && !this[DESTROYED]) return + const ret = super.emit('close') + this.removeAllListeners('close') + return ret + } else if (ev === 'error') { + this[EMITTED_ERROR] = data + super.emit(ERROR, data) + const ret = + !this[SIGNAL] || this.listeners('error').length + ? super.emit('error', data) + : false + this[MAYBE_EMIT_END]() + return ret + } else if (ev === 'resume') { + const ret = super.emit('resume') + this[MAYBE_EMIT_END]() + return ret + } else if (ev === 'finish' || ev === 'prefinish') { + const ret = super.emit(ev) + this.removeAllListeners(ev) + return ret + } + + // Some other unknown event + const ret = super.emit(ev, data, ...extra) + this[MAYBE_EMIT_END]() + return ret + } + + [EMITDATA](data) { + for (const p of this[PIPES]) { + if (p.dest.write(data) === false) this.pause() + } + const ret = super.emit('data', data) + this[MAYBE_EMIT_END]() + return ret + } + + [EMITEND]() { + if (this[EMITTED_END]) return + + this[EMITTED_END] = true + this.readable = false + if (this[ASYNC]) defer(() => this[EMITEND2]()) + else this[EMITEND2]() + } + + [EMITEND2]() { + if (this[DECODER]) { + const data = this[DECODER].end() + if (data) { + for (const p of this[PIPES]) { + p.dest.write(data) + } + super.emit('data', data) + } + } + + for (const p of this[PIPES]) { + p.end() + } + const ret = super.emit('end') + this.removeAllListeners('end') + return ret + } + + // const all = await stream.collect() + collect() { + const buf = [] + if (!this[OBJECTMODE]) buf.dataLength = 0 + // set the promise first, in case an error is raised + // by triggering the flow here. + const p = this.promise() + this.on('data', c => { + buf.push(c) + if (!this[OBJECTMODE]) buf.dataLength += c.length + }) + return p.then(() => buf) + } + + // const data = await stream.concat() + concat() { + return this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this.collect().then(buf => + this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this[ENCODING] + ? buf.join('') + : Buffer.concat(buf, buf.dataLength) + ) + } + + // stream.promise().then(() => done, er => emitted error) + promise() { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error('stream destroyed'))) + this.on('error', er => reject(er)) + this.on('end', () => resolve()) + }) + } + + // for await (let chunk of stream) + [ASYNCITERATOR]() { + let stopped = false + const stop = () => { + this.pause() + stopped = true + return Promise.resolve({ done: true }) + } + const next = () => { + if (stopped) return stop() + const res = this.read() + if (res !== null) return Promise.resolve({ done: false, value: res }) + + if (this[EOF]) return stop() + + let resolve = null + let reject = null + const onerr = er => { + this.removeListener('data', ondata) + this.removeListener('end', onend) + this.removeListener(DESTROYED, ondestroy) + stop() + reject(er) + } + const ondata = value => { + this.removeListener('error', onerr) + this.removeListener('end', onend) + this.removeListener(DESTROYED, ondestroy) + this.pause() + resolve({ value: value, done: !!this[EOF] }) + } + const onend = () => { + this.removeListener('error', onerr) + this.removeListener('data', ondata) + this.removeListener(DESTROYED, ondestroy) + stop() + resolve({ done: true }) + } + const ondestroy = () => onerr(new Error('stream destroyed')) + return new Promise((res, rej) => { + reject = rej + resolve = res + this.once(DESTROYED, ondestroy) + this.once('error', onerr) + this.once('end', onend) + this.once('data', ondata) + }) + } + + return { + next, + throw: stop, + return: stop, + [ASYNCITERATOR]() { + return this + }, + } + } + + // for (let chunk of stream) + [ITERATOR]() { + let stopped = false + const stop = () => { + this.pause() + this.removeListener(ERROR, stop) + this.removeListener(DESTROYED, stop) + this.removeListener('end', stop) + stopped = true + return { done: true } + } + + const next = () => { + if (stopped) return stop() + const value = this.read() + return value === null ? stop() : { value } + } + this.once('end', stop) + this.once(ERROR, stop) + this.once(DESTROYED, stop) + + return { + next, + throw: stop, + return: stop, + [ITERATOR]() { + return this + }, + } + } + + destroy(er) { + if (this[DESTROYED]) { + if (er) this.emit('error', er) + else this.emit(DESTROYED) + return this + } + + this[DESTROYED] = true + + // throw away all buffered data, it's never coming out + this[BUFFER].length = 0 + this[BUFFERLENGTH] = 0 + + if (typeof this.close === 'function' && !this[CLOSED]) this.close() + + if (er) this.emit('error', er) + // if no error to emit, still reject pending promises + else this.emit(DESTROYED) + + return this + } + + static isStream(s) { + return ( + !!s && + (s instanceof Minipass || + s instanceof Stream || + (s instanceof EE && + // readable + (typeof s.pipe === 'function' || + // writable + (typeof s.write === 'function' && typeof s.end === 'function')))) + ) + } +} + + diff --git a/node_modules/minipass/package.json b/node_modules/minipass/package.json new file mode 100644 index 00000000..0e20e988 --- /dev/null +++ b/node_modules/minipass/package.json @@ -0,0 +1,76 @@ +{ + "name": "minipass", + "version": "5.0.0", + "description": "minimal implementation of a PassThrough stream", + "main": "./index.js", + "module": "./index.mjs", + "types": "./index.d.ts", + "exports": { + ".": { + "import": { + "types": "./index.d.ts", + "default": "./index.mjs" + }, + "require": { + "types": "./index.d.ts", + "default": "./index.js" + } + }, + "./package.json": "./package.json" + }, + "devDependencies": { + "@types/node": "^17.0.41", + "end-of-stream": "^1.4.0", + "node-abort-controller": "^3.1.1", + "prettier": "^2.6.2", + "tap": "^16.2.0", + "through2": "^2.0.3", + "ts-node": "^10.8.1", + "typedoc": "^0.23.24", + "typescript": "^4.7.3" + }, + "scripts": { + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "prepare": "node ./scripts/transpile-to-esm.js", + "snap": "tap", + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "typedoc": "typedoc ./index.d.ts", + "format": "prettier --write . --loglevel warn" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minipass.git" + }, + "keywords": [ + "passthrough", + "stream" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "index.d.ts", + "index.js", + "index.mjs" + ], + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">=8" + }, + "prettier": { + "semi": false, + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + } +} diff --git a/node_modules/minizlib/LICENSE b/node_modules/minizlib/LICENSE new file mode 100644 index 00000000..ffce7383 --- /dev/null +++ b/node_modules/minizlib/LICENSE @@ -0,0 +1,26 @@ +Minizlib was created by Isaac Z. Schlueter. +It is a derivative work of the Node.js project. + +""" +Copyright Isaac Z. Schlueter and Contributors +Copyright Node.js contributors. All rights reserved. +Copyright Joyent, Inc. and other Node contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +""" diff --git a/node_modules/minizlib/README.md b/node_modules/minizlib/README.md new file mode 100644 index 00000000..80e067ab --- /dev/null +++ b/node_modules/minizlib/README.md @@ -0,0 +1,60 @@ +# minizlib + +A fast zlib stream built on [minipass](http://npm.im/minipass) and +Node.js's zlib binding. + +This module was created to serve the needs of +[node-tar](http://npm.im/tar) and +[minipass-fetch](http://npm.im/minipass-fetch). + +Brotli is supported in versions of node with a Brotli binding. + +## How does this differ from the streams in `require('zlib')`? + +First, there are no convenience methods to compress or decompress a +buffer. If you want those, use the built-in `zlib` module. This is +only streams. That being said, Minipass streams to make it fairly easy to +use as one-liners: `new zlib.Deflate().end(data).read()` will return the +deflate compressed result. + +This module compresses and decompresses the data as fast as you feed +it in. It is synchronous, and runs on the main process thread. Zlib +and Brotli operations can be high CPU, but they're very fast, and doing it +this way means much less bookkeeping and artificial deferral. + +Node's built in zlib streams are built on top of `stream.Transform`. +They do the maximally safe thing with respect to consistent +asynchrony, buffering, and backpressure. + +See [Minipass](http://npm.im/minipass) for more on the differences between +Node.js core streams and Minipass streams, and the convenience methods +provided by that class. + +## Classes + +- Deflate +- Inflate +- Gzip +- Gunzip +- DeflateRaw +- InflateRaw +- Unzip +- BrotliCompress (Node v10 and higher) +- BrotliDecompress (Node v10 and higher) + +## USAGE + +```js +const zlib = require('minizlib') +const input = sourceOfCompressedData() +const decode = new zlib.BrotliDecompress() +const output = whereToWriteTheDecodedData() +input.pipe(decode).pipe(output) +``` + +## REPRODUCIBLE BUILDS + +To create reproducible gzip compressed files across different operating +systems, set `portable: true` in the options. This causes minizlib to set +the `OS` indicator in byte 9 of the extended gzip header to `0xFF` for +'unknown'. diff --git a/node_modules/minizlib/constants.js b/node_modules/minizlib/constants.js new file mode 100644 index 00000000..641ebc73 --- /dev/null +++ b/node_modules/minizlib/constants.js @@ -0,0 +1,115 @@ +// Update with any zlib constants that are added or changed in the future. +// Node v6 didn't export this, so we just hard code the version and rely +// on all the other hard-coded values from zlib v4736. When node v6 +// support drops, we can just export the realZlibConstants object. +const realZlibConstants = require('zlib').constants || + /* istanbul ignore next */ { ZLIB_VERNUM: 4736 } + +module.exports = Object.freeze(Object.assign(Object.create(null), { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + Z_VERSION_ERROR: -6, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + DEFLATE: 1, + INFLATE: 2, + GZIP: 3, + GUNZIP: 4, + DEFLATERAW: 5, + INFLATERAW: 6, + UNZIP: 7, + BROTLI_DECODE: 8, + BROTLI_ENCODE: 9, + Z_MIN_WINDOWBITS: 8, + Z_MAX_WINDOWBITS: 15, + Z_DEFAULT_WINDOWBITS: 15, + Z_MIN_CHUNK: 64, + Z_MAX_CHUNK: Infinity, + Z_DEFAULT_CHUNK: 16384, + Z_MIN_MEMLEVEL: 1, + Z_MAX_MEMLEVEL: 9, + Z_DEFAULT_MEMLEVEL: 8, + Z_MIN_LEVEL: -1, + Z_MAX_LEVEL: 9, + Z_DEFAULT_LEVEL: -1, + BROTLI_OPERATION_PROCESS: 0, + BROTLI_OPERATION_FLUSH: 1, + BROTLI_OPERATION_FINISH: 2, + BROTLI_OPERATION_EMIT_METADATA: 3, + BROTLI_MODE_GENERIC: 0, + BROTLI_MODE_TEXT: 1, + BROTLI_MODE_FONT: 2, + BROTLI_DEFAULT_MODE: 0, + BROTLI_MIN_QUALITY: 0, + BROTLI_MAX_QUALITY: 11, + BROTLI_DEFAULT_QUALITY: 11, + BROTLI_MIN_WINDOW_BITS: 10, + BROTLI_MAX_WINDOW_BITS: 24, + BROTLI_LARGE_MAX_WINDOW_BITS: 30, + BROTLI_DEFAULT_WINDOW: 22, + BROTLI_MIN_INPUT_BLOCK_BITS: 16, + BROTLI_MAX_INPUT_BLOCK_BITS: 24, + BROTLI_PARAM_MODE: 0, + BROTLI_PARAM_QUALITY: 1, + BROTLI_PARAM_LGWIN: 2, + BROTLI_PARAM_LGBLOCK: 3, + BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, + BROTLI_PARAM_SIZE_HINT: 5, + BROTLI_PARAM_LARGE_WINDOW: 6, + BROTLI_PARAM_NPOSTFIX: 7, + BROTLI_PARAM_NDIRECT: 8, + BROTLI_DECODER_RESULT_ERROR: 0, + BROTLI_DECODER_RESULT_SUCCESS: 1, + BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, + BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, + BROTLI_DECODER_NO_ERROR: 0, + BROTLI_DECODER_SUCCESS: 1, + BROTLI_DECODER_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, + BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, + BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, + BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, + BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, + BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, + BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, + BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, + BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, + BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, + BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, + BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, + BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, + BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, + BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, + BROTLI_DECODER_ERROR_UNREACHABLE: -31, +}, realZlibConstants)) diff --git a/node_modules/minizlib/index.js b/node_modules/minizlib/index.js new file mode 100644 index 00000000..fbaf69e1 --- /dev/null +++ b/node_modules/minizlib/index.js @@ -0,0 +1,348 @@ +'use strict' + +const assert = require('assert') +const Buffer = require('buffer').Buffer +const realZlib = require('zlib') + +const constants = exports.constants = require('./constants.js') +const Minipass = require('minipass') + +const OriginalBufferConcat = Buffer.concat + +const _superWrite = Symbol('_superWrite') +class ZlibError extends Error { + constructor (err) { + super('zlib: ' + err.message) + this.code = err.code + this.errno = err.errno + /* istanbul ignore if */ + if (!this.code) + this.code = 'ZLIB_ERROR' + + this.message = 'zlib: ' + err.message + Error.captureStackTrace(this, this.constructor) + } + + get name () { + return 'ZlibError' + } +} + +// the Zlib class they all inherit from +// This thing manages the queue of requests, and returns +// true or false if there is anything in the queue when +// you call the .write() method. +const _opts = Symbol('opts') +const _flushFlag = Symbol('flushFlag') +const _finishFlushFlag = Symbol('finishFlushFlag') +const _fullFlushFlag = Symbol('fullFlushFlag') +const _handle = Symbol('handle') +const _onError = Symbol('onError') +const _sawError = Symbol('sawError') +const _level = Symbol('level') +const _strategy = Symbol('strategy') +const _ended = Symbol('ended') +const _defaultFullFlush = Symbol('_defaultFullFlush') + +class ZlibBase extends Minipass { + constructor (opts, mode) { + if (!opts || typeof opts !== 'object') + throw new TypeError('invalid options for ZlibBase constructor') + + super(opts) + this[_sawError] = false + this[_ended] = false + this[_opts] = opts + + this[_flushFlag] = opts.flush + this[_finishFlushFlag] = opts.finishFlush + // this will throw if any options are invalid for the class selected + try { + this[_handle] = new realZlib[mode](opts) + } catch (er) { + // make sure that all errors get decorated properly + throw new ZlibError(er) + } + + this[_onError] = (err) => { + // no sense raising multiple errors, since we abort on the first one. + if (this[_sawError]) + return + + this[_sawError] = true + + // there is no way to cleanly recover. + // continuing only obscures problems. + this.close() + this.emit('error', err) + } + + this[_handle].on('error', er => this[_onError](new ZlibError(er))) + this.once('end', () => this.close) + } + + close () { + if (this[_handle]) { + this[_handle].close() + this[_handle] = null + this.emit('close') + } + } + + reset () { + if (!this[_sawError]) { + assert(this[_handle], 'zlib binding closed') + return this[_handle].reset() + } + } + + flush (flushFlag) { + if (this.ended) + return + + if (typeof flushFlag !== 'number') + flushFlag = this[_fullFlushFlag] + this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag })) + } + + end (chunk, encoding, cb) { + if (chunk) + this.write(chunk, encoding) + this.flush(this[_finishFlushFlag]) + this[_ended] = true + return super.end(null, null, cb) + } + + get ended () { + return this[_ended] + } + + write (chunk, encoding, cb) { + // process the chunk using the sync process + // then super.write() all the outputted chunks + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + + if (typeof chunk === 'string') + chunk = Buffer.from(chunk, encoding) + + if (this[_sawError]) + return + assert(this[_handle], 'zlib binding closed') + + // _processChunk tries to .close() the native handle after it's done, so we + // intercept that by temporarily making it a no-op. + const nativeHandle = this[_handle]._handle + const originalNativeClose = nativeHandle.close + nativeHandle.close = () => {} + const originalClose = this[_handle].close + this[_handle].close = () => {} + // It also calls `Buffer.concat()` at the end, which may be convenient + // for some, but which we are not interested in as it slows us down. + Buffer.concat = (args) => args + let result + try { + const flushFlag = typeof chunk[_flushFlag] === 'number' + ? chunk[_flushFlag] : this[_flushFlag] + result = this[_handle]._processChunk(chunk, flushFlag) + // if we don't throw, reset it back how it was + Buffer.concat = OriginalBufferConcat + } catch (err) { + // or if we do, put Buffer.concat() back before we emit error + // Error events call into user code, which may call Buffer.concat() + Buffer.concat = OriginalBufferConcat + this[_onError](new ZlibError(err)) + } finally { + if (this[_handle]) { + // Core zlib resets `_handle` to null after attempting to close the + // native handle. Our no-op handler prevented actual closure, but we + // need to restore the `._handle` property. + this[_handle]._handle = nativeHandle + nativeHandle.close = originalNativeClose + this[_handle].close = originalClose + // `_processChunk()` adds an 'error' listener. If we don't remove it + // after each call, these handlers start piling up. + this[_handle].removeAllListeners('error') + // make sure OUR error listener is still attached tho + } + } + + if (this[_handle]) + this[_handle].on('error', er => this[_onError](new ZlibError(er))) + + let writeReturn + if (result) { + if (Array.isArray(result) && result.length > 0) { + // The first buffer is always `handle._outBuffer`, which would be + // re-used for later invocations; so, we always have to copy that one. + writeReturn = this[_superWrite](Buffer.from(result[0])) + for (let i = 1; i < result.length; i++) { + writeReturn = this[_superWrite](result[i]) + } + } else { + writeReturn = this[_superWrite](Buffer.from(result)) + } + } + + if (cb) + cb() + return writeReturn + } + + [_superWrite] (data) { + return super.write(data) + } +} + +class Zlib extends ZlibBase { + constructor (opts, mode) { + opts = opts || {} + + opts.flush = opts.flush || constants.Z_NO_FLUSH + opts.finishFlush = opts.finishFlush || constants.Z_FINISH + super(opts, mode) + + this[_fullFlushFlag] = constants.Z_FULL_FLUSH + this[_level] = opts.level + this[_strategy] = opts.strategy + } + + params (level, strategy) { + if (this[_sawError]) + return + + if (!this[_handle]) + throw new Error('cannot switch params when binding is closed') + + // no way to test this without also not supporting params at all + /* istanbul ignore if */ + if (!this[_handle].params) + throw new Error('not supported in this implementation') + + if (this[_level] !== level || this[_strategy] !== strategy) { + this.flush(constants.Z_SYNC_FLUSH) + assert(this[_handle], 'zlib binding closed') + // .params() calls .flush(), but the latter is always async in the + // core zlib. We override .flush() temporarily to intercept that and + // flush synchronously. + const origFlush = this[_handle].flush + this[_handle].flush = (flushFlag, cb) => { + this.flush(flushFlag) + cb() + } + try { + this[_handle].params(level, strategy) + } finally { + this[_handle].flush = origFlush + } + /* istanbul ignore else */ + if (this[_handle]) { + this[_level] = level + this[_strategy] = strategy + } + } + } +} + +// minimal 2-byte header +class Deflate extends Zlib { + constructor (opts) { + super(opts, 'Deflate') + } +} + +class Inflate extends Zlib { + constructor (opts) { + super(opts, 'Inflate') + } +} + +// gzip - bigger header, same deflate compression +const _portable = Symbol('_portable') +class Gzip extends Zlib { + constructor (opts) { + super(opts, 'Gzip') + this[_portable] = opts && !!opts.portable + } + + [_superWrite] (data) { + if (!this[_portable]) + return super[_superWrite](data) + + // we'll always get the header emitted in one first chunk + // overwrite the OS indicator byte with 0xFF + this[_portable] = false + data[9] = 255 + return super[_superWrite](data) + } +} + +class Gunzip extends Zlib { + constructor (opts) { + super(opts, 'Gunzip') + } +} + +// raw - no header +class DeflateRaw extends Zlib { + constructor (opts) { + super(opts, 'DeflateRaw') + } +} + +class InflateRaw extends Zlib { + constructor (opts) { + super(opts, 'InflateRaw') + } +} + +// auto-detect header. +class Unzip extends Zlib { + constructor (opts) { + super(opts, 'Unzip') + } +} + +class Brotli extends ZlibBase { + constructor (opts, mode) { + opts = opts || {} + + opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS + opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH + + super(opts, mode) + + this[_fullFlushFlag] = constants.BROTLI_OPERATION_FLUSH + } +} + +class BrotliCompress extends Brotli { + constructor (opts) { + super(opts, 'BrotliCompress') + } +} + +class BrotliDecompress extends Brotli { + constructor (opts) { + super(opts, 'BrotliDecompress') + } +} + +exports.Deflate = Deflate +exports.Inflate = Inflate +exports.Gzip = Gzip +exports.Gunzip = Gunzip +exports.DeflateRaw = DeflateRaw +exports.InflateRaw = InflateRaw +exports.Unzip = Unzip +/* istanbul ignore else */ +if (typeof realZlib.BrotliCompress === 'function') { + exports.BrotliCompress = BrotliCompress + exports.BrotliDecompress = BrotliDecompress +} else { + exports.BrotliCompress = exports.BrotliDecompress = class { + constructor () { + throw new Error('Brotli is not supported in this version of Node.js') + } + } +} diff --git a/node_modules/minizlib/node_modules/minipass/LICENSE b/node_modules/minizlib/node_modules/minipass/LICENSE new file mode 100644 index 00000000..bf1dece2 --- /dev/null +++ b/node_modules/minizlib/node_modules/minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2017-2022 npm, Inc., Isaac Z. Schlueter, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/minizlib/node_modules/minipass/README.md b/node_modules/minizlib/node_modules/minipass/README.md new file mode 100644 index 00000000..2cde46c3 --- /dev/null +++ b/node_modules/minizlib/node_modules/minipass/README.md @@ -0,0 +1,728 @@ +# minipass + +A _very_ minimal implementation of a [PassThrough +stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) + +[It's very +fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) +for objects, strings, and buffers. + +Supports `pipe()`ing (including multi-`pipe()` and backpressure transmission), +buffering data until either a `data` event handler or `pipe()` is added (so +you don't lose the first chunk), and most other cases where PassThrough is +a good idea. + +There is a `read()` method, but it's much more efficient to consume data +from this stream via `'data'` events or by calling `pipe()` into some other +stream. Calling `read()` requires the buffer to be flattened in some +cases, which requires copying memory. + +If you set `objectMode: true` in the options, then whatever is written will +be emitted. Otherwise, it'll do a minimal amount of Buffer copying to +ensure proper Streams semantics when `read(n)` is called. + +`objectMode` can also be set by doing `stream.objectMode = true`, or by +writing any non-string/non-buffer data. `objectMode` cannot be set to +false once it is set. + +This is not a `through` or `through2` stream. It doesn't transform the +data, it just passes it right through. If you want to transform the data, +extend the class, and override the `write()` method. Once you're done +transforming the data however you want, call `super.write()` with the +transform output. + +For some examples of streams that extend Minipass in various ways, check +out: + +- [minizlib](http://npm.im/minizlib) +- [fs-minipass](http://npm.im/fs-minipass) +- [tar](http://npm.im/tar) +- [minipass-collect](http://npm.im/minipass-collect) +- [minipass-flush](http://npm.im/minipass-flush) +- [minipass-pipeline](http://npm.im/minipass-pipeline) +- [tap](http://npm.im/tap) +- [tap-parser](http://npm.im/tap-parser) +- [treport](http://npm.im/treport) +- [minipass-fetch](http://npm.im/minipass-fetch) +- [pacote](http://npm.im/pacote) +- [make-fetch-happen](http://npm.im/make-fetch-happen) +- [cacache](http://npm.im/cacache) +- [ssri](http://npm.im/ssri) +- [npm-registry-fetch](http://npm.im/npm-registry-fetch) +- [minipass-json-stream](http://npm.im/minipass-json-stream) +- [minipass-sized](http://npm.im/minipass-sized) + +## Differences from Node.js Streams + +There are several things that make Minipass streams different from (and in +some ways superior to) Node.js core streams. + +Please read these caveats if you are familiar with node-core streams and +intend to use Minipass streams in your programs. + +You can avoid most of these differences entirely (for a very +small performance penalty) by setting `{async: true}` in the +constructor options. + +### Timing + +Minipass streams are designed to support synchronous use-cases. Thus, data +is emitted as soon as it is available, always. It is buffered until read, +but no longer. Another way to look at it is that Minipass streams are +exactly as synchronous as the logic that writes into them. + +This can be surprising if your code relies on `PassThrough.write()` always +providing data on the next tick rather than the current one, or being able +to call `resume()` and not have the entire buffer disappear immediately. + +However, without this synchronicity guarantee, there would be no way for +Minipass to achieve the speeds it does, or support the synchronous use +cases that it does. Simply put, waiting takes time. + +This non-deferring approach makes Minipass streams much easier to reason +about, especially in the context of Promises and other flow-control +mechanisms. + +Example: + +```js +const Minipass = require('minipass') +const stream = new Minipass({ async: true }) +stream.on('data', () => console.log('data event')) +console.log('before write') +stream.write('hello') +console.log('after write') +// output: +// before write +// data event +// after write +``` + +### Exception: Async Opt-In + +If you wish to have a Minipass stream with behavior that more +closely mimics Node.js core streams, you can set the stream in +async mode either by setting `async: true` in the constructor +options, or by setting `stream.async = true` later on. + +```js +const Minipass = require('minipass') +const asyncStream = new Minipass({ async: true }) +asyncStream.on('data', () => console.log('data event')) +console.log('before write') +asyncStream.write('hello') +console.log('after write') +// output: +// before write +// after write +// data event <-- this is deferred until the next tick +``` + +Switching _out_ of async mode is unsafe, as it could cause data +corruption, and so is not enabled. Example: + +```js +const Minipass = require('minipass') +const stream = new Minipass({ encoding: 'utf8' }) +stream.on('data', chunk => console.log(chunk)) +stream.async = true +console.log('before writes') +stream.write('hello') +setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist! +stream.write('world') +console.log('after writes') +// hypothetical output would be: +// before writes +// world +// after writes +// hello +// NOT GOOD! +``` + +To avoid this problem, once set into async mode, any attempt to +make the stream sync again will be ignored. + +```js +const Minipass = require('minipass') +const stream = new Minipass({ encoding: 'utf8' }) +stream.on('data', chunk => console.log(chunk)) +stream.async = true +console.log('before writes') +stream.write('hello') +stream.async = false // <-- no-op, stream already async +stream.write('world') +console.log('after writes') +// actual output: +// before writes +// after writes +// hello +// world +``` + +### No High/Low Water Marks + +Node.js core streams will optimistically fill up a buffer, returning `true` +on all writes until the limit is hit, even if the data has nowhere to go. +Then, they will not attempt to draw more data in until the buffer size dips +below a minimum value. + +Minipass streams are much simpler. The `write()` method will return `true` +if the data has somewhere to go (which is to say, given the timing +guarantees, that the data is already there by the time `write()` returns). + +If the data has nowhere to go, then `write()` returns false, and the data +sits in a buffer, to be drained out immediately as soon as anyone consumes +it. + +Since nothing is ever buffered unnecessarily, there is much less +copying data, and less bookkeeping about buffer capacity levels. + +### Hazards of Buffering (or: Why Minipass Is So Fast) + +Since data written to a Minipass stream is immediately written all the way +through the pipeline, and `write()` always returns true/false based on +whether the data was fully flushed, backpressure is communicated +immediately to the upstream caller. This minimizes buffering. + +Consider this case: + +```js +const {PassThrough} = require('stream') +const p1 = new PassThrough({ highWaterMark: 1024 }) +const p2 = new PassThrough({ highWaterMark: 1024 }) +const p3 = new PassThrough({ highWaterMark: 1024 }) +const p4 = new PassThrough({ highWaterMark: 1024 }) + +p1.pipe(p2).pipe(p3).pipe(p4) +p4.on('data', () => console.log('made it through')) + +// this returns false and buffers, then writes to p2 on next tick (1) +// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) +// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) +// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' +// on next tick (4) +// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and +// 'drain' on next tick (5) +// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) +// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next +// tick (7) + +p1.write(Buffer.alloc(2048)) // returns false +``` + +Along the way, the data was buffered and deferred at each stage, and +multiple event deferrals happened, for an unblocked pipeline where it was +perfectly safe to write all the way through! + +Furthermore, setting a `highWaterMark` of `1024` might lead someone reading +the code to think an advisory maximum of 1KiB is being set for the +pipeline. However, the actual advisory buffering level is the _sum_ of +`highWaterMark` values, since each one has its own bucket. + +Consider the Minipass case: + +```js +const m1 = new Minipass() +const m2 = new Minipass() +const m3 = new Minipass() +const m4 = new Minipass() + +m1.pipe(m2).pipe(m3).pipe(m4) +m4.on('data', () => console.log('made it through')) + +// m1 is flowing, so it writes the data to m2 immediately +// m2 is flowing, so it writes the data to m3 immediately +// m3 is flowing, so it writes the data to m4 immediately +// m4 is flowing, so it fires the 'data' event immediately, returns true +// m4's write returned true, so m3 is still flowing, returns true +// m3's write returned true, so m2 is still flowing, returns true +// m2's write returned true, so m1 is still flowing, returns true +// No event deferrals or buffering along the way! + +m1.write(Buffer.alloc(2048)) // returns true +``` + +It is extremely unlikely that you _don't_ want to buffer any data written, +or _ever_ buffer data that can be flushed all the way through. Neither +node-core streams nor Minipass ever fail to buffer written data, but +node-core streams do a lot of unnecessary buffering and pausing. + +As always, the faster implementation is the one that does less stuff and +waits less time to do it. + +### Immediately emit `end` for empty streams (when not paused) + +If a stream is not paused, and `end()` is called before writing any data +into it, then it will emit `end` immediately. + +If you have logic that occurs on the `end` event which you don't want to +potentially happen immediately (for example, closing file descriptors, +moving on to the next entry in an archive parse stream, etc.) then be sure +to call `stream.pause()` on creation, and then `stream.resume()` once you +are ready to respond to the `end` event. + +However, this is _usually_ not a problem because: + +### Emit `end` When Asked + +One hazard of immediately emitting `'end'` is that you may not yet have had +a chance to add a listener. In order to avoid this hazard, Minipass +streams safely re-emit the `'end'` event if a new listener is added after +`'end'` has been emitted. + +Ie, if you do `stream.on('end', someFunction)`, and the stream has already +emitted `end`, then it will call the handler right away. (You can think of +this somewhat like attaching a new `.then(fn)` to a previously-resolved +Promise.) + +To prevent calling handlers multiple times who would not expect multiple +ends to occur, all listeners are removed from the `'end'` event whenever it +is emitted. + +### Emit `error` When Asked + +The most recent error object passed to the `'error'` event is +stored on the stream. If a new `'error'` event handler is added, +and an error was previously emitted, then the event handler will +be called immediately (or on `process.nextTick` in the case of +async streams). + +This makes it much more difficult to end up trying to interact +with a broken stream, if the error handler is added after an +error was previously emitted. + +### Impact of "immediate flow" on Tee-streams + +A "tee stream" is a stream piping to multiple destinations: + +```js +const tee = new Minipass() +t.pipe(dest1) +t.pipe(dest2) +t.write('foo') // goes to both destinations +``` + +Since Minipass streams _immediately_ process any pending data through the +pipeline when a new pipe destination is added, this can have surprising +effects, especially when a stream comes in from some other function and may +or may not have data in its buffer. + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone +src.pipe(dest2) // gets nothing! +``` + +One solution is to create a dedicated tee-stream junction that pipes to +both locations, and then pipe to _that_ instead. + +```js +// Safe example: tee to both places +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.pipe(dest1) +tee.pipe(dest2) +src.pipe(tee) // tee gets 'foo', pipes to both locations +``` + +The same caveat applies to `on('data')` event listeners. The first one +added will _immediately_ receive all of the data, leaving nothing for the +second: + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.on('data', handler1) // receives 'foo' right away +src.on('data', handler2) // nothing to see here! +``` + +Using a dedicated tee-stream can be used in this case as well: + +```js +// Safe example: tee to both data handlers +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.on('data', handler1) +tee.on('data', handler2) +src.pipe(tee) +``` + +All of the hazards in this section are avoided by setting `{ +async: true }` in the Minipass constructor, or by setting +`stream.async = true` afterwards. Note that this does add some +overhead, so should only be done in cases where you are willing +to lose a bit of performance in order to avoid having to refactor +program logic. + +## USAGE + +It's a stream! Use it like a stream and it'll most likely do what you +want. + +```js +const Minipass = require('minipass') +const mp = new Minipass(options) // optional: { encoding, objectMode } +mp.write('foo') +mp.pipe(someOtherStream) +mp.end('bar') +``` + +### OPTIONS + +* `encoding` How would you like the data coming _out_ of the stream to be + encoded? Accepts any values that can be passed to `Buffer.toString()`. +* `objectMode` Emit data exactly as it comes in. This will be flipped on + by default if you write() something other than a string or Buffer at any + point. Setting `objectMode: true` will prevent setting any encoding + value. +* `async` Defaults to `false`. Set to `true` to defer data + emission until next tick. This reduces performance slightly, + but makes Minipass streams use timing behavior closer to Node + core streams. See [Timing](#timing) for more details. + +### API + +Implements the user-facing portions of Node.js's `Readable` and `Writable` +streams. + +### Methods + +* `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the + base Minipass class, the same data will come out.) Returns `false` if + the stream will buffer the next write, or true if it's still in "flowing" + mode. +* `end([chunk, [encoding]], [callback])` - Signal that you have no more + data to write. This will queue an `end` event to be fired when all the + data has been consumed. +* `setEncoding(encoding)` - Set the encoding for data coming of the stream. + This can only be done once. +* `pause()` - No more data for a while, please. This also prevents `end` + from being emitted for empty streams until the stream is resumed. +* `resume()` - Resume the stream. If there's data in the buffer, it is all + discarded. Any buffered events are immediately emitted. +* `pipe(dest)` - Send all output to the stream provided. When + data is emitted, it is immediately written to any and all pipe + destinations. (Or written on next tick in `async` mode.) +* `unpipe(dest)` - Stop piping to the destination stream. This + is immediate, meaning that any asynchronously queued data will + _not_ make it to the destination when running in `async` mode. + * `options.end` - Boolean, end the destination stream when + the source stream ends. Default `true`. + * `options.proxyErrors` - Boolean, proxy `error` events from + the source stream to the destination stream. Note that + errors are _not_ proxied after the pipeline terminates, + either due to the source emitting `'end'` or manually + unpiping with `src.unpipe(dest)`. Default `false`. +* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. Some + events are given special treatment, however. (See below under "events".) +* `promise()` - Returns a Promise that resolves when the stream emits + `end`, or rejects if the stream emits `error`. +* `collect()` - Return a Promise that resolves on `end` with an array + containing each chunk of data that was emitted, or rejects if the stream + emits `error`. Note that this consumes the stream data. +* `concat()` - Same as `collect()`, but concatenates the data into a single + Buffer object. Will reject the returned promise if the stream is in + objectMode, or if it goes into objectMode by the end of the data. +* `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not + provided, then consume all of it. If `n` bytes are not available, then + it returns null. **Note** consuming streams in this way is less + efficient, and can lead to unnecessary Buffer copying. +* `destroy([er])` - Destroy the stream. If an error is provided, then an + `'error'` event is emitted. If the stream has a `close()` method, and + has not emitted a `'close'` event yet, then `stream.close()` will be + called. Any Promises returned by `.promise()`, `.collect()` or + `.concat()` will be rejected. After being destroyed, writing to the + stream will emit an error. No more data will be emitted if the stream is + destroyed, even if it was previously buffered. + +### Properties + +* `bufferLength` Read-only. Total number of bytes buffered, or in the case + of objectMode, the total number of objects. +* `encoding` The encoding that has been set. (Setting this is equivalent + to calling `setEncoding(enc)` and has the same prohibition against + setting multiple times.) +* `flowing` Read-only. Boolean indicating whether a chunk written to the + stream will be immediately emitted. +* `emittedEnd` Read-only. Boolean indicating whether the end-ish events + (ie, `end`, `prefinish`, `finish`) have been emitted. Note that + listening on any end-ish event will immediateyl re-emit it if it has + already been emitted. +* `writable` Whether the stream is writable. Default `true`. Set to + `false` when `end()` +* `readable` Whether the stream is readable. Default `true`. +* `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written + to the stream that have not yet been emitted. (It's probably a bad idea + to mess with this.) +* `pipes` A [yallist](http://npm.im/yallist) linked list of streams that + this stream is piping into. (It's probably a bad idea to mess with + this.) +* `destroyed` A getter that indicates whether the stream was destroyed. +* `paused` True if the stream has been explicitly paused, otherwise false. +* `objectMode` Indicates whether the stream is in `objectMode`. Once set + to `true`, it cannot be set to `false`. + +### Events + +* `data` Emitted when there's data to read. Argument is the data to read. + This is never emitted while not flowing. If a listener is attached, that + will resume the stream. +* `end` Emitted when there's no more data to read. This will be emitted + immediately for empty streams when `end()` is called. If a listener is + attached, and `end` was already emitted, then it will be emitted again. + All listeners are removed when `end` is emitted. +* `prefinish` An end-ish event that follows the same logic as `end` and is + emitted in the same conditions where `end` is emitted. Emitted after + `'end'`. +* `finish` An end-ish event that follows the same logic as `end` and is + emitted in the same conditions where `end` is emitted. Emitted after + `'prefinish'`. +* `close` An indication that an underlying resource has been released. + Minipass does not emit this event, but will defer it until after `end` + has been emitted, since it throws off some stream libraries otherwise. +* `drain` Emitted when the internal buffer empties, and it is again + suitable to `write()` into the stream. +* `readable` Emitted when data is buffered and ready to be read by a + consumer. +* `resume` Emitted when stream changes state from buffering to flowing + mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event + listener is added.) + +### Static Methods + +* `Minipass.isStream(stream)` Returns `true` if the argument is a stream, + and false otherwise. To be considered a stream, the object must be + either an instance of Minipass, or an EventEmitter that has either a + `pipe()` method, or both `write()` and `end()` methods. (Pretty much any + stream in node-land will return `true` for this.) + +## EXAMPLES + +Here are some examples of things you can do with Minipass streams. + +### simple "are you done yet" promise + +```js +mp.promise().then(() => { + // stream is finished +}, er => { + // stream emitted an error +}) +``` + +### collecting + +```js +mp.collect().then(all => { + // all is an array of all the data emitted + // encoding is supported in this case, so + // so the result will be a collection of strings if + // an encoding is specified, or buffers/objects if not. + // + // In an async function, you may do + // const data = await stream.collect() +}) +``` + +### collecting into a single blob + +This is a bit slower because it concatenates the data into one chunk for +you, but if you're going to do it yourself anyway, it's convenient this +way: + +```js +mp.concat().then(onebigchunk => { + // onebigchunk is a string if the stream + // had an encoding set, or a buffer otherwise. +}) +``` + +### iteration + +You can iterate over streams synchronously or asynchronously in platforms +that support it. + +Synchronous iteration will end when the currently available data is +consumed, even if the `end` event has not been reached. In string and +buffer mode, the data is concatenated, so unless multiple writes are +occurring in the same tick as the `read()`, sync iteration loops will +generally only have a single iteration. + +To consume chunks in this way exactly as they have been written, with no +flattening, create the stream with the `{ objectMode: true }` option. + +```js +const mp = new Minipass({ objectMode: true }) +mp.write('a') +mp.write('b') +for (let letter of mp) { + console.log(letter) // a, b +} +mp.write('c') +mp.write('d') +for (let letter of mp) { + console.log(letter) // c, d +} +mp.write('e') +mp.end() +for (let letter of mp) { + console.log(letter) // e +} +for (let letter of mp) { + console.log(letter) // nothing +} +``` + +Asynchronous iteration will continue until the end event is reached, +consuming all of the data. + +```js +const mp = new Minipass({ encoding: 'utf8' }) + +// some source of some data +let i = 5 +const inter = setInterval(() => { + if (i-- > 0) + mp.write(Buffer.from('foo\n', 'utf8')) + else { + mp.end() + clearInterval(inter) + } +}, 100) + +// consume the data with asynchronous iteration +async function consume () { + for await (let chunk of mp) { + console.log(chunk) + } + return 'ok' +} + +consume().then(res => console.log(res)) +// logs `foo\n` 5 times, and then `ok` +``` + +### subclass that `console.log()`s everything written into it + +```js +class Logger extends Minipass { + write (chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end (chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } +} + +someSource.pipe(new Logger()).pipe(someDest) +``` + +### same thing, but using an inline anonymous class + +```js +// js classes are fun +someSource + .pipe(new (class extends Minipass { + emit (ev, ...data) { + // let's also log events, because debugging some weird thing + console.log('EMIT', ev) + return super.emit(ev, ...data) + } + write (chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end (chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } + })) + .pipe(someDest) +``` + +### subclass that defers 'end' for some reason + +```js +class SlowEnd extends Minipass { + emit (ev, ...args) { + if (ev === 'end') { + console.log('going to end, hold on a sec') + setTimeout(() => { + console.log('ok, ready to end now') + super.emit('end', ...args) + }, 100) + } else { + return super.emit(ev, ...args) + } + } +} +``` + +### transform that creates newline-delimited JSON + +```js +class NDJSONEncode extends Minipass { + write (obj, cb) { + try { + // JSON.stringify can throw, emit an error on that + return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) + } catch (er) { + this.emit('error', er) + } + } + end (obj, cb) { + if (typeof obj === 'function') { + cb = obj + obj = undefined + } + if (obj !== undefined) { + this.write(obj) + } + return super.end(cb) + } +} +``` + +### transform that parses newline-delimited JSON + +```js +class NDJSONDecode extends Minipass { + constructor (options) { + // always be in object mode, as far as Minipass is concerned + super({ objectMode: true }) + this._jsonBuffer = '' + } + write (chunk, encoding, cb) { + if (typeof chunk === 'string' && + typeof encoding === 'string' && + encoding !== 'utf8') { + chunk = Buffer.from(chunk, encoding).toString() + } else if (Buffer.isBuffer(chunk)) + chunk = chunk.toString() + } + if (typeof encoding === 'function') { + cb = encoding + } + const jsonData = (this._jsonBuffer + chunk).split('\n') + this._jsonBuffer = jsonData.pop() + for (let i = 0; i < jsonData.length; i++) { + try { + // JSON.parse can throw, emit an error on that + super.write(JSON.parse(jsonData[i])) + } catch (er) { + this.emit('error', er) + continue + } + } + if (cb) + cb() + } +} +``` diff --git a/node_modules/minizlib/node_modules/minipass/index.d.ts b/node_modules/minizlib/node_modules/minipass/index.d.ts new file mode 100644 index 00000000..65faf636 --- /dev/null +++ b/node_modules/minizlib/node_modules/minipass/index.d.ts @@ -0,0 +1,155 @@ +/// +import { EventEmitter } from 'events' +import { Stream } from 'stream' + +declare namespace Minipass { + type Encoding = BufferEncoding | 'buffer' | null + + interface Writable extends EventEmitter { + end(): any + write(chunk: any, ...args: any[]): any + } + + interface Readable extends EventEmitter { + pause(): any + resume(): any + pipe(): any + } + + interface Pipe { + src: Minipass + dest: Writable + opts: PipeOptions + } + + type DualIterable = Iterable & AsyncIterable + + type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string + + type BufferOrString = Buffer | string + + interface StringOptions { + encoding: BufferEncoding + objectMode?: boolean + async?: boolean + } + + interface BufferOptions { + encoding?: null | 'buffer' + objectMode?: boolean + async?: boolean + } + + interface ObjectModeOptions { + objectMode: true + async?: boolean + } + + interface PipeOptions { + end?: boolean + proxyErrors?: boolean + } + + type Options = T extends string + ? StringOptions + : T extends Buffer + ? BufferOptions + : ObjectModeOptions +} + +declare class Minipass< + RType extends any = Buffer, + WType extends any = RType extends Minipass.BufferOrString + ? Minipass.ContiguousData + : RType + > + extends Stream + implements Minipass.DualIterable +{ + static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable + + readonly bufferLength: number + readonly flowing: boolean + readonly writable: boolean + readonly readable: boolean + readonly paused: boolean + readonly emittedEnd: boolean + readonly destroyed: boolean + + /** + * Not technically private or readonly, but not safe to mutate. + */ + private readonly buffer: RType[] + private readonly pipes: Minipass.Pipe[] + + /** + * Technically writable, but mutating it can change the type, + * so is not safe to do in TypeScript. + */ + readonly objectMode: boolean + async: boolean + + /** + * Note: encoding is not actually read-only, and setEncoding(enc) + * exists. However, this type definition will insist that TypeScript + * programs declare the type of a Minipass stream up front, and if + * that type is string, then an encoding MUST be set in the ctor. If + * the type is Buffer, then the encoding must be missing, or set to + * 'buffer' or null. If the type is anything else, then objectMode + * must be set in the constructor options. So there is effectively + * no allowed way that a TS program can set the encoding after + * construction, as doing so will destroy any hope of type safety. + * TypeScript does not provide many options for changing the type of + * an object at run-time, which is what changing the encoding does. + */ + readonly encoding: Minipass.Encoding + // setEncoding(encoding: Encoding): void + + // Options required if not reading buffers + constructor( + ...args: RType extends Buffer + ? [] | [Minipass.Options] + : [Minipass.Options] + ) + + write(chunk: WType, cb?: () => void): boolean + write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean + read(size?: number): RType + end(cb?: () => void): this + end(chunk: any, cb?: () => void): this + end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this + pause(): void + resume(): void + promise(): Promise + collect(): Promise + + concat(): RType extends Minipass.BufferOrString ? Promise : never + destroy(er?: any): void + pipe(dest: W, opts?: Minipass.PipeOptions): W + unpipe(dest: W): void + + /** + * alias for on() + */ + addEventHandler(event: string, listener: (...args: any[]) => any): this + + on(event: string, listener: (...args: any[]) => any): this + on(event: 'data', listener: (chunk: RType) => any): this + on(event: 'error', listener: (error: any) => any): this + on( + event: + | 'readable' + | 'drain' + | 'resume' + | 'end' + | 'prefinish' + | 'finish' + | 'close', + listener: () => any + ): this + + [Symbol.iterator](): Iterator + [Symbol.asyncIterator](): AsyncIterator +} + +export = Minipass diff --git a/node_modules/minizlib/node_modules/minipass/index.js b/node_modules/minizlib/node_modules/minipass/index.js new file mode 100644 index 00000000..e8797aab --- /dev/null +++ b/node_modules/minizlib/node_modules/minipass/index.js @@ -0,0 +1,649 @@ +'use strict' +const proc = typeof process === 'object' && process ? process : { + stdout: null, + stderr: null, +} +const EE = require('events') +const Stream = require('stream') +const SD = require('string_decoder').StringDecoder + +const EOF = Symbol('EOF') +const MAYBE_EMIT_END = Symbol('maybeEmitEnd') +const EMITTED_END = Symbol('emittedEnd') +const EMITTING_END = Symbol('emittingEnd') +const EMITTED_ERROR = Symbol('emittedError') +const CLOSED = Symbol('closed') +const READ = Symbol('read') +const FLUSH = Symbol('flush') +const FLUSHCHUNK = Symbol('flushChunk') +const ENCODING = Symbol('encoding') +const DECODER = Symbol('decoder') +const FLOWING = Symbol('flowing') +const PAUSED = Symbol('paused') +const RESUME = Symbol('resume') +const BUFFERLENGTH = Symbol('bufferLength') +const BUFFERPUSH = Symbol('bufferPush') +const BUFFERSHIFT = Symbol('bufferShift') +const OBJECTMODE = Symbol('objectMode') +const DESTROYED = Symbol('destroyed') +const EMITDATA = Symbol('emitData') +const EMITEND = Symbol('emitEnd') +const EMITEND2 = Symbol('emitEnd2') +const ASYNC = Symbol('async') + +const defer = fn => Promise.resolve().then(fn) + +// TODO remove when Node v8 support drops +const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' +const ASYNCITERATOR = doIter && Symbol.asyncIterator + || Symbol('asyncIterator not implemented') +const ITERATOR = doIter && Symbol.iterator + || Symbol('iterator not implemented') + +// events that mean 'the stream is over' +// these are treated specially, and re-emitted +// if they are listened for after emitting. +const isEndish = ev => + ev === 'end' || + ev === 'finish' || + ev === 'prefinish' + +const isArrayBuffer = b => b instanceof ArrayBuffer || + typeof b === 'object' && + b.constructor && + b.constructor.name === 'ArrayBuffer' && + b.byteLength >= 0 + +const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) + +class Pipe { + constructor (src, dest, opts) { + this.src = src + this.dest = dest + this.opts = opts + this.ondrain = () => src[RESUME]() + dest.on('drain', this.ondrain) + } + unpipe () { + this.dest.removeListener('drain', this.ondrain) + } + // istanbul ignore next - only here for the prototype + proxyErrors () {} + end () { + this.unpipe() + if (this.opts.end) + this.dest.end() + } +} + +class PipeProxyErrors extends Pipe { + unpipe () { + this.src.removeListener('error', this.proxyErrors) + super.unpipe() + } + constructor (src, dest, opts) { + super(src, dest, opts) + this.proxyErrors = er => dest.emit('error', er) + src.on('error', this.proxyErrors) + } +} + +module.exports = class Minipass extends Stream { + constructor (options) { + super() + this[FLOWING] = false + // whether we're explicitly paused + this[PAUSED] = false + this.pipes = [] + this.buffer = [] + this[OBJECTMODE] = options && options.objectMode || false + if (this[OBJECTMODE]) + this[ENCODING] = null + else + this[ENCODING] = options && options.encoding || null + if (this[ENCODING] === 'buffer') + this[ENCODING] = null + this[ASYNC] = options && !!options.async || false + this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null + this[EOF] = false + this[EMITTED_END] = false + this[EMITTING_END] = false + this[CLOSED] = false + this[EMITTED_ERROR] = null + this.writable = true + this.readable = true + this[BUFFERLENGTH] = 0 + this[DESTROYED] = false + } + + get bufferLength () { return this[BUFFERLENGTH] } + + get encoding () { return this[ENCODING] } + set encoding (enc) { + if (this[OBJECTMODE]) + throw new Error('cannot set encoding in objectMode') + + if (this[ENCODING] && enc !== this[ENCODING] && + (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) + throw new Error('cannot change encoding') + + if (this[ENCODING] !== enc) { + this[DECODER] = enc ? new SD(enc) : null + if (this.buffer.length) + this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) + } + + this[ENCODING] = enc + } + + setEncoding (enc) { + this.encoding = enc + } + + get objectMode () { return this[OBJECTMODE] } + set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om } + + get ['async'] () { return this[ASYNC] } + set ['async'] (a) { this[ASYNC] = this[ASYNC] || !!a } + + write (chunk, encoding, cb) { + if (this[EOF]) + throw new Error('write after end') + + if (this[DESTROYED]) { + this.emit('error', Object.assign( + new Error('Cannot call write after a stream was destroyed'), + { code: 'ERR_STREAM_DESTROYED' } + )) + return true + } + + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + + if (!encoding) + encoding = 'utf8' + + const fn = this[ASYNC] ? defer : f => f() + + // convert array buffers and typed array views into buffers + // at some point in the future, we may want to do the opposite! + // leave strings and buffers as-is + // anything else switches us into object mode + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) + else if (isArrayBuffer(chunk)) + chunk = Buffer.from(chunk) + else if (typeof chunk !== 'string') + // use the setter so we throw if we have encoding set + this.objectMode = true + } + + // handle object mode up front, since it's simpler + // this yields better performance, fewer checks later. + if (this[OBJECTMODE]) { + /* istanbul ignore if - maybe impossible? */ + if (this.flowing && this[BUFFERLENGTH] !== 0) + this[FLUSH](true) + + if (this.flowing) + this.emit('data', chunk) + else + this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + + if (cb) + fn(cb) + + return this.flowing + } + + // at this point the chunk is a buffer or string + // don't buffer it up or send it to the decoder + if (!chunk.length) { + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + if (cb) + fn(cb) + return this.flowing + } + + // fast-path writing strings of same encoding to a stream with + // an empty buffer, skipping the buffer/decoder dance + if (typeof chunk === 'string' && + // unless it is a string already ready for us to use + !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { + chunk = Buffer.from(chunk, encoding) + } + + if (Buffer.isBuffer(chunk) && this[ENCODING]) + chunk = this[DECODER].write(chunk) + + // Note: flushing CAN potentially switch us into not-flowing mode + if (this.flowing && this[BUFFERLENGTH] !== 0) + this[FLUSH](true) + + if (this.flowing) + this.emit('data', chunk) + else + this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + + if (cb) + fn(cb) + + return this.flowing + } + + read (n) { + if (this[DESTROYED]) + return null + + if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) { + this[MAYBE_EMIT_END]() + return null + } + + if (this[OBJECTMODE]) + n = null + + if (this.buffer.length > 1 && !this[OBJECTMODE]) { + if (this.encoding) + this.buffer = [this.buffer.join('')] + else + this.buffer = [Buffer.concat(this.buffer, this[BUFFERLENGTH])] + } + + const ret = this[READ](n || null, this.buffer[0]) + this[MAYBE_EMIT_END]() + return ret + } + + [READ] (n, chunk) { + if (n === chunk.length || n === null) + this[BUFFERSHIFT]() + else { + this.buffer[0] = chunk.slice(n) + chunk = chunk.slice(0, n) + this[BUFFERLENGTH] -= n + } + + this.emit('data', chunk) + + if (!this.buffer.length && !this[EOF]) + this.emit('drain') + + return chunk + } + + end (chunk, encoding, cb) { + if (typeof chunk === 'function') + cb = chunk, chunk = null + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + if (chunk) + this.write(chunk, encoding) + if (cb) + this.once('end', cb) + this[EOF] = true + this.writable = false + + // if we haven't written anything, then go ahead and emit, + // even if we're not reading. + // we'll re-emit if a new 'end' listener is added anyway. + // This makes MP more suitable to write-only use cases. + if (this.flowing || !this[PAUSED]) + this[MAYBE_EMIT_END]() + return this + } + + // don't let the internal resume be overwritten + [RESUME] () { + if (this[DESTROYED]) + return + + this[PAUSED] = false + this[FLOWING] = true + this.emit('resume') + if (this.buffer.length) + this[FLUSH]() + else if (this[EOF]) + this[MAYBE_EMIT_END]() + else + this.emit('drain') + } + + resume () { + return this[RESUME]() + } + + pause () { + this[FLOWING] = false + this[PAUSED] = true + } + + get destroyed () { + return this[DESTROYED] + } + + get flowing () { + return this[FLOWING] + } + + get paused () { + return this[PAUSED] + } + + [BUFFERPUSH] (chunk) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] += 1 + else + this[BUFFERLENGTH] += chunk.length + this.buffer.push(chunk) + } + + [BUFFERSHIFT] () { + if (this.buffer.length) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] -= 1 + else + this[BUFFERLENGTH] -= this.buffer[0].length + } + return this.buffer.shift() + } + + [FLUSH] (noDrain) { + do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) + + if (!noDrain && !this.buffer.length && !this[EOF]) + this.emit('drain') + } + + [FLUSHCHUNK] (chunk) { + return chunk ? (this.emit('data', chunk), this.flowing) : false + } + + pipe (dest, opts) { + if (this[DESTROYED]) + return + + const ended = this[EMITTED_END] + opts = opts || {} + if (dest === proc.stdout || dest === proc.stderr) + opts.end = false + else + opts.end = opts.end !== false + opts.proxyErrors = !!opts.proxyErrors + + // piping an ended stream ends immediately + if (ended) { + if (opts.end) + dest.end() + } else { + this.pipes.push(!opts.proxyErrors ? new Pipe(this, dest, opts) + : new PipeProxyErrors(this, dest, opts)) + if (this[ASYNC]) + defer(() => this[RESUME]()) + else + this[RESUME]() + } + + return dest + } + + unpipe (dest) { + const p = this.pipes.find(p => p.dest === dest) + if (p) { + this.pipes.splice(this.pipes.indexOf(p), 1) + p.unpipe() + } + } + + addListener (ev, fn) { + return this.on(ev, fn) + } + + on (ev, fn) { + const ret = super.on(ev, fn) + if (ev === 'data' && !this.pipes.length && !this.flowing) + this[RESUME]() + else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) + super.emit('readable') + else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev) + this.removeAllListeners(ev) + } else if (ev === 'error' && this[EMITTED_ERROR]) { + if (this[ASYNC]) + defer(() => fn.call(this, this[EMITTED_ERROR])) + else + fn.call(this, this[EMITTED_ERROR]) + } + return ret + } + + get emittedEnd () { + return this[EMITTED_END] + } + + [MAYBE_EMIT_END] () { + if (!this[EMITTING_END] && + !this[EMITTED_END] && + !this[DESTROYED] && + this.buffer.length === 0 && + this[EOF]) { + this[EMITTING_END] = true + this.emit('end') + this.emit('prefinish') + this.emit('finish') + if (this[CLOSED]) + this.emit('close') + this[EMITTING_END] = false + } + } + + emit (ev, data, ...extra) { + // error and close are only events allowed after calling destroy() + if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) + return + else if (ev === 'data') { + return !data ? false + : this[ASYNC] ? defer(() => this[EMITDATA](data)) + : this[EMITDATA](data) + } else if (ev === 'end') { + return this[EMITEND]() + } else if (ev === 'close') { + this[CLOSED] = true + // don't emit close before 'end' and 'finish' + if (!this[EMITTED_END] && !this[DESTROYED]) + return + const ret = super.emit('close') + this.removeAllListeners('close') + return ret + } else if (ev === 'error') { + this[EMITTED_ERROR] = data + const ret = super.emit('error', data) + this[MAYBE_EMIT_END]() + return ret + } else if (ev === 'resume') { + const ret = super.emit('resume') + this[MAYBE_EMIT_END]() + return ret + } else if (ev === 'finish' || ev === 'prefinish') { + const ret = super.emit(ev) + this.removeAllListeners(ev) + return ret + } + + // Some other unknown event + const ret = super.emit(ev, data, ...extra) + this[MAYBE_EMIT_END]() + return ret + } + + [EMITDATA] (data) { + for (const p of this.pipes) { + if (p.dest.write(data) === false) + this.pause() + } + const ret = super.emit('data', data) + this[MAYBE_EMIT_END]() + return ret + } + + [EMITEND] () { + if (this[EMITTED_END]) + return + + this[EMITTED_END] = true + this.readable = false + if (this[ASYNC]) + defer(() => this[EMITEND2]()) + else + this[EMITEND2]() + } + + [EMITEND2] () { + if (this[DECODER]) { + const data = this[DECODER].end() + if (data) { + for (const p of this.pipes) { + p.dest.write(data) + } + super.emit('data', data) + } + } + + for (const p of this.pipes) { + p.end() + } + const ret = super.emit('end') + this.removeAllListeners('end') + return ret + } + + // const all = await stream.collect() + collect () { + const buf = [] + if (!this[OBJECTMODE]) + buf.dataLength = 0 + // set the promise first, in case an error is raised + // by triggering the flow here. + const p = this.promise() + this.on('data', c => { + buf.push(c) + if (!this[OBJECTMODE]) + buf.dataLength += c.length + }) + return p.then(() => buf) + } + + // const data = await stream.concat() + concat () { + return this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this.collect().then(buf => + this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength)) + } + + // stream.promise().then(() => done, er => emitted error) + promise () { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error('stream destroyed'))) + this.on('error', er => reject(er)) + this.on('end', () => resolve()) + }) + } + + // for await (let chunk of stream) + [ASYNCITERATOR] () { + const next = () => { + const res = this.read() + if (res !== null) + return Promise.resolve({ done: false, value: res }) + + if (this[EOF]) + return Promise.resolve({ done: true }) + + let resolve = null + let reject = null + const onerr = er => { + this.removeListener('data', ondata) + this.removeListener('end', onend) + reject(er) + } + const ondata = value => { + this.removeListener('error', onerr) + this.removeListener('end', onend) + this.pause() + resolve({ value: value, done: !!this[EOF] }) + } + const onend = () => { + this.removeListener('error', onerr) + this.removeListener('data', ondata) + resolve({ done: true }) + } + const ondestroy = () => onerr(new Error('stream destroyed')) + return new Promise((res, rej) => { + reject = rej + resolve = res + this.once(DESTROYED, ondestroy) + this.once('error', onerr) + this.once('end', onend) + this.once('data', ondata) + }) + } + + return { next } + } + + // for (let chunk of stream) + [ITERATOR] () { + const next = () => { + const value = this.read() + const done = value === null + return { value, done } + } + return { next } + } + + destroy (er) { + if (this[DESTROYED]) { + if (er) + this.emit('error', er) + else + this.emit(DESTROYED) + return this + } + + this[DESTROYED] = true + + // throw away all buffered data, it's never coming out + this.buffer.length = 0 + this[BUFFERLENGTH] = 0 + + if (typeof this.close === 'function' && !this[CLOSED]) + this.close() + + if (er) + this.emit('error', er) + else // if no error to emit, still reject pending promises + this.emit(DESTROYED) + + return this + } + + static isStream (s) { + return !!s && (s instanceof Minipass || s instanceof Stream || + s instanceof EE && ( + typeof s.pipe === 'function' || // readable + (typeof s.write === 'function' && typeof s.end === 'function') // writable + )) + } +} diff --git a/node_modules/minizlib/node_modules/minipass/package.json b/node_modules/minizlib/node_modules/minipass/package.json new file mode 100644 index 00000000..548d03fa --- /dev/null +++ b/node_modules/minizlib/node_modules/minipass/package.json @@ -0,0 +1,56 @@ +{ + "name": "minipass", + "version": "3.3.6", + "description": "minimal implementation of a PassThrough stream", + "main": "index.js", + "types": "index.d.ts", + "dependencies": { + "yallist": "^4.0.0" + }, + "devDependencies": { + "@types/node": "^17.0.41", + "end-of-stream": "^1.4.0", + "prettier": "^2.6.2", + "tap": "^16.2.0", + "through2": "^2.0.3", + "ts-node": "^10.8.1", + "typescript": "^4.7.3" + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minipass.git" + }, + "keywords": [ + "passthrough", + "stream" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "index.d.ts", + "index.js" + ], + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">=8" + }, + "prettier": { + "semi": false, + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + } +} diff --git a/node_modules/minizlib/package.json b/node_modules/minizlib/package.json new file mode 100644 index 00000000..98825a54 --- /dev/null +++ b/node_modules/minizlib/package.json @@ -0,0 +1,42 @@ +{ + "name": "minizlib", + "version": "2.1.2", + "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.", + "main": "index.js", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "scripts": { + "test": "tap test/*.js --100 -J", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minizlib.git" + }, + "keywords": [ + "zlib", + "gzip", + "gunzip", + "deflate", + "inflate", + "compression", + "zip", + "unzip" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "MIT", + "devDependencies": { + "tap": "^14.6.9" + }, + "files": [ + "index.js", + "constants.js" + ], + "engines": { + "node": ">= 8" + } +} diff --git a/node_modules/mkdirp/CHANGELOG.md b/node_modules/mkdirp/CHANGELOG.md new file mode 100644 index 00000000..81458380 --- /dev/null +++ b/node_modules/mkdirp/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changers Lorgs! + +## 1.0 + +Full rewrite. Essentially a brand new module. + +- Return a promise instead of taking a callback. +- Use native `fs.mkdir(path, { recursive: true })` when available. +- Drop support for outdated Node.js versions. (Technically still works on + Node.js v8, but only 10 and above are officially supported.) + +## 0.x + +Original and most widely used recursive directory creation implementation +in JavaScript, dating back to 2010. diff --git a/node_modules/mkdirp/LICENSE b/node_modules/mkdirp/LICENSE new file mode 100644 index 00000000..13fcd15f --- /dev/null +++ b/node_modules/mkdirp/LICENSE @@ -0,0 +1,21 @@ +Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me) + +This project is free software released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/mkdirp/bin/cmd.js b/node_modules/mkdirp/bin/cmd.js new file mode 100644 index 00000000..6e0aa8dc --- /dev/null +++ b/node_modules/mkdirp/bin/cmd.js @@ -0,0 +1,68 @@ +#!/usr/bin/env node + +const usage = () => ` +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories + that don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m If a directory needs to be created, set the mode as an octal + --mode= permission string. + + -v --version Print the mkdirp version number + + -h --help Print this helpful banner + + -p --print Print the first directories created for each path provided + + --manual Use manual implementation, even if native is available +` + +const dirs = [] +const opts = {} +let print = false +let dashdash = false +let manual = false +for (const arg of process.argv.slice(2)) { + if (dashdash) + dirs.push(arg) + else if (arg === '--') + dashdash = true + else if (arg === '--manual') + manual = true + else if (/^-h/.test(arg) || /^--help/.test(arg)) { + console.log(usage()) + process.exit(0) + } else if (arg === '-v' || arg === '--version') { + console.log(require('../package.json').version) + process.exit(0) + } else if (arg === '-p' || arg === '--print') { + print = true + } else if (/^-m/.test(arg) || /^--mode=/.test(arg)) { + const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8) + if (isNaN(mode)) { + console.error(`invalid mode argument: ${arg}\nMust be an octal number.`) + process.exit(1) + } + opts.mode = mode + } else + dirs.push(arg) +} + +const mkdirp = require('../') +const impl = manual ? mkdirp.manual : mkdirp +if (dirs.length === 0) + console.error(usage()) + +Promise.all(dirs.map(dir => impl(dir, opts))) + .then(made => print ? made.forEach(m => m && console.log(m)) : null) + .catch(er => { + console.error(er.message) + if (er.code) + console.error(' code: ' + er.code) + process.exit(1) + }) diff --git a/node_modules/mkdirp/index.js b/node_modules/mkdirp/index.js new file mode 100644 index 00000000..ad7a16c9 --- /dev/null +++ b/node_modules/mkdirp/index.js @@ -0,0 +1,31 @@ +const optsArg = require('./lib/opts-arg.js') +const pathArg = require('./lib/path-arg.js') + +const {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js') +const {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js') +const {useNative, useNativeSync} = require('./lib/use-native.js') + + +const mkdirp = (path, opts) => { + path = pathArg(path) + opts = optsArg(opts) + return useNative(opts) + ? mkdirpNative(path, opts) + : mkdirpManual(path, opts) +} + +const mkdirpSync = (path, opts) => { + path = pathArg(path) + opts = optsArg(opts) + return useNativeSync(opts) + ? mkdirpNativeSync(path, opts) + : mkdirpManualSync(path, opts) +} + +mkdirp.sync = mkdirpSync +mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts)) +mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts)) +mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts)) +mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts)) + +module.exports = mkdirp diff --git a/node_modules/mkdirp/lib/find-made.js b/node_modules/mkdirp/lib/find-made.js new file mode 100644 index 00000000..022e492c --- /dev/null +++ b/node_modules/mkdirp/lib/find-made.js @@ -0,0 +1,29 @@ +const {dirname} = require('path') + +const findMade = (opts, parent, path = undefined) => { + // we never want the 'made' return value to be a root directory + if (path === parent) + return Promise.resolve() + + return opts.statAsync(parent).then( + st => st.isDirectory() ? path : undefined, // will fail later + er => er.code === 'ENOENT' + ? findMade(opts, dirname(parent), parent) + : undefined + ) +} + +const findMadeSync = (opts, parent, path = undefined) => { + if (path === parent) + return undefined + + try { + return opts.statSync(parent).isDirectory() ? path : undefined + } catch (er) { + return er.code === 'ENOENT' + ? findMadeSync(opts, dirname(parent), parent) + : undefined + } +} + +module.exports = {findMade, findMadeSync} diff --git a/node_modules/mkdirp/lib/mkdirp-manual.js b/node_modules/mkdirp/lib/mkdirp-manual.js new file mode 100644 index 00000000..2eb18cd6 --- /dev/null +++ b/node_modules/mkdirp/lib/mkdirp-manual.js @@ -0,0 +1,64 @@ +const {dirname} = require('path') + +const mkdirpManual = (path, opts, made) => { + opts.recursive = false + const parent = dirname(path) + if (parent === path) { + return opts.mkdirAsync(path, opts).catch(er => { + // swallowed by recursive implementation on posix systems + // any other error is a failure + if (er.code !== 'EISDIR') + throw er + }) + } + + return opts.mkdirAsync(path, opts).then(() => made || path, er => { + if (er.code === 'ENOENT') + return mkdirpManual(parent, opts) + .then(made => mkdirpManual(path, opts, made)) + if (er.code !== 'EEXIST' && er.code !== 'EROFS') + throw er + return opts.statAsync(path).then(st => { + if (st.isDirectory()) + return made + else + throw er + }, () => { throw er }) + }) +} + +const mkdirpManualSync = (path, opts, made) => { + const parent = dirname(path) + opts.recursive = false + + if (parent === path) { + try { + return opts.mkdirSync(path, opts) + } catch (er) { + // swallowed by recursive implementation on posix systems + // any other error is a failure + if (er.code !== 'EISDIR') + throw er + else + return + } + } + + try { + opts.mkdirSync(path, opts) + return made || path + } catch (er) { + if (er.code === 'ENOENT') + return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made)) + if (er.code !== 'EEXIST' && er.code !== 'EROFS') + throw er + try { + if (!opts.statSync(path).isDirectory()) + throw er + } catch (_) { + throw er + } + } +} + +module.exports = {mkdirpManual, mkdirpManualSync} diff --git a/node_modules/mkdirp/lib/mkdirp-native.js b/node_modules/mkdirp/lib/mkdirp-native.js new file mode 100644 index 00000000..c7a6b698 --- /dev/null +++ b/node_modules/mkdirp/lib/mkdirp-native.js @@ -0,0 +1,39 @@ +const {dirname} = require('path') +const {findMade, findMadeSync} = require('./find-made.js') +const {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js') + +const mkdirpNative = (path, opts) => { + opts.recursive = true + const parent = dirname(path) + if (parent === path) + return opts.mkdirAsync(path, opts) + + return findMade(opts, path).then(made => + opts.mkdirAsync(path, opts).then(() => made) + .catch(er => { + if (er.code === 'ENOENT') + return mkdirpManual(path, opts) + else + throw er + })) +} + +const mkdirpNativeSync = (path, opts) => { + opts.recursive = true + const parent = dirname(path) + if (parent === path) + return opts.mkdirSync(path, opts) + + const made = findMadeSync(opts, path) + try { + opts.mkdirSync(path, opts) + return made + } catch (er) { + if (er.code === 'ENOENT') + return mkdirpManualSync(path, opts) + else + throw er + } +} + +module.exports = {mkdirpNative, mkdirpNativeSync} diff --git a/node_modules/mkdirp/lib/opts-arg.js b/node_modules/mkdirp/lib/opts-arg.js new file mode 100644 index 00000000..2fa4833f --- /dev/null +++ b/node_modules/mkdirp/lib/opts-arg.js @@ -0,0 +1,23 @@ +const { promisify } = require('util') +const fs = require('fs') +const optsArg = opts => { + if (!opts) + opts = { mode: 0o777, fs } + else if (typeof opts === 'object') + opts = { mode: 0o777, fs, ...opts } + else if (typeof opts === 'number') + opts = { mode: opts, fs } + else if (typeof opts === 'string') + opts = { mode: parseInt(opts, 8), fs } + else + throw new TypeError('invalid options argument') + + opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir + opts.mkdirAsync = promisify(opts.mkdir) + opts.stat = opts.stat || opts.fs.stat || fs.stat + opts.statAsync = promisify(opts.stat) + opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync + opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync + return opts +} +module.exports = optsArg diff --git a/node_modules/mkdirp/lib/path-arg.js b/node_modules/mkdirp/lib/path-arg.js new file mode 100644 index 00000000..cc07de5a --- /dev/null +++ b/node_modules/mkdirp/lib/path-arg.js @@ -0,0 +1,29 @@ +const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform +const { resolve, parse } = require('path') +const pathArg = path => { + if (/\0/.test(path)) { + // simulate same failure that node raises + throw Object.assign( + new TypeError('path must be a string without null bytes'), + { + path, + code: 'ERR_INVALID_ARG_VALUE', + } + ) + } + + path = resolve(path) + if (platform === 'win32') { + const badWinChars = /[*|"<>?:]/ + const {root} = parse(path) + if (badWinChars.test(path.substr(root.length))) { + throw Object.assign(new Error('Illegal characters in path.'), { + path, + code: 'EINVAL', + }) + } + } + + return path +} +module.exports = pathArg diff --git a/node_modules/mkdirp/lib/use-native.js b/node_modules/mkdirp/lib/use-native.js new file mode 100644 index 00000000..079361de --- /dev/null +++ b/node_modules/mkdirp/lib/use-native.js @@ -0,0 +1,10 @@ +const fs = require('fs') + +const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version +const versArr = version.replace(/^v/, '').split('.') +const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12 + +const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir +const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync + +module.exports = {useNative, useNativeSync} diff --git a/node_modules/mkdirp/package.json b/node_modules/mkdirp/package.json new file mode 100644 index 00000000..2913ed09 --- /dev/null +++ b/node_modules/mkdirp/package.json @@ -0,0 +1,44 @@ +{ + "name": "mkdirp", + "description": "Recursively mkdir, like `mkdir -p`", + "version": "1.0.4", + "main": "index.js", + "keywords": [ + "mkdir", + "directory", + "make dir", + "make", + "dir", + "recursive", + "native" + ], + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-mkdirp.git" + }, + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js" + }, + "devDependencies": { + "require-inject": "^1.4.4", + "tap": "^14.10.7" + }, + "bin": "bin/cmd.js", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "files": [ + "bin", + "lib", + "index.js" + ] +} diff --git a/node_modules/mkdirp/readme.markdown b/node_modules/mkdirp/readme.markdown new file mode 100644 index 00000000..827de590 --- /dev/null +++ b/node_modules/mkdirp/readme.markdown @@ -0,0 +1,266 @@ +# mkdirp + +Like `mkdir -p`, but in Node.js! + +Now with a modern API and no\* bugs! + +\* may contain some bugs + +# example + +## pow.js + +```js +const mkdirp = require('mkdirp') + +// return value is a Promise resolving to the first directory created +mkdirp('/tmp/foo/bar/baz').then(made => + console.log(`made directories, starting with ${made}`)) +``` + +Output (where `/tmp/foo` already exists) + +``` +made directories, starting with /tmp/foo/bar +``` + +Or, if you don't have time to wait around for promises: + +```js +const mkdirp = require('mkdirp') + +// return value is the first directory created +const made = mkdirp.sync('/tmp/foo/bar/baz') +console.log(`made directories, starting with ${made}`) +``` + +And now /tmp/foo/bar/baz exists, huzzah! + +# methods + +```js +const mkdirp = require('mkdirp') +``` + +## mkdirp(dir, [opts]) -> Promise + +Create a new directory and any necessary subdirectories at `dir` with octal +permission string `opts.mode`. If `opts` is a string or number, it will be +treated as the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0o777 & +(~process.umask())`. + +Promise resolves to first directory `made` that had to be created, or +`undefined` if everything already exists. Promise rejects if any errors +are encountered. Note that, in the case of promise rejection, some +directories _may_ have been created, as recursive directory creation is not +an atomic operation. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdir(path, opts, cb)` +and `opts.fs.stat(path, cb)`. + +You can also override just one or the other of `mkdir` and `stat` by +passing in `opts.stat` or `opts.mkdir`, or providing an `fs` option that +only overrides one of these. + +## mkdirp.sync(dir, opts) -> String|null + +Synchronously create a new directory and any necessary subdirectories at +`dir` with octal permission string `opts.mode`. If `opts` is a string or +number, it will be treated as the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0o777 & +(~process.umask())`. + +Returns the first directory that had to be created, or undefined if +everything already exists. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` +and `opts.fs.statSync(path)`. + +You can also override just one or the other of `mkdirSync` and `statSync` +by passing in `opts.statSync` or `opts.mkdirSync`, or providing an `fs` +option that only overrides one of these. + +## mkdirp.manual, mkdirp.manualSync + +Use the manual implementation (not the native one). This is the default +when the native implementation is not available or the stat/mkdir +implementation is overridden. + +## mkdirp.native, mkdirp.nativeSync + +Use the native implementation (not the manual one). This is the default +when the native implementation is available and stat/mkdir are not +overridden. + +# implementation + +On Node.js v10.12.0 and above, use the native `fs.mkdir(p, +{recursive:true})` option, unless `fs.mkdir`/`fs.mkdirSync` has been +overridden by an option. + +## native implementation + +- If the path is a root directory, then pass it to the underlying + implementation and return the result/error. (In this case, it'll either + succeed or fail, but we aren't actually creating any dirs.) +- Walk up the path statting each directory, to find the first path that + will be created, `made`. +- Call `fs.mkdir(path, { recursive: true })` (or `fs.mkdirSync`) +- If error, raise it to the caller. +- Return `made`. + +## manual implementation + +- Call underlying `fs.mkdir` implementation, with `recursive: false` +- If error: + - If path is a root directory, raise to the caller and do not handle it + - If ENOENT, mkdirp parent dir, store result as `made` + - stat(path) + - If error, raise original `mkdir` error + - If directory, return `made` + - Else, raise original `mkdir` error +- else + - return `undefined` if a root dir, or `made` if set, or `path` + +## windows vs unix caveat + +On Windows file systems, attempts to create a root directory (ie, a drive +letter or root UNC path) will fail. If the root directory exists, then it +will fail with `EPERM`. If the root directory does not exist, then it will +fail with `ENOENT`. + +On posix file systems, attempts to create a root directory (in recursive +mode) will succeed silently, as it is treated like just another directory +that already exists. (In non-recursive mode, of course, it fails with +`EEXIST`.) + +In order to preserve this system-specific behavior (and because it's not as +if we can create the parent of a root directory anyway), attempts to create +a root directory are passed directly to the `fs` implementation, and any +errors encountered are not handled. + +## native error caveat + +The native implementation (as of at least Node.js v13.4.0) does not provide +appropriate errors in some cases (see +[nodejs/node#31481](https://github.com/nodejs/node/issues/31481) and +[nodejs/node#28015](https://github.com/nodejs/node/issues/28015)). + +In order to work around this issue, the native implementation will fall +back to the manual implementation if an `ENOENT` error is encountered. + +# choosing a recursive mkdir implementation + +There are a few to choose from! Use the one that suits your needs best :D + +## use `fs.mkdir(path, {recursive: true}, cb)` if: + +- You wish to optimize performance even at the expense of other factors. +- You don't need to know the first dir created. +- You are ok with getting `ENOENT` as the error when some other problem is + the actual cause. +- You can limit your platforms to Node.js v10.12 and above. +- You're ok with using callbacks instead of promises. +- You don't need/want a CLI. +- You don't need to override the `fs` methods in use. + +## use this module (mkdirp 1.x) if: + +- You need to know the first directory that was created. +- You wish to use the native implementation if available, but fall back + when it's not. +- You prefer promise-returning APIs to callback-taking APIs. +- You want more useful error messages than the native recursive mkdir + provides (at least as of Node.js v13.4), and are ok with re-trying on + `ENOENT` to achieve this. +- You need (or at least, are ok with) a CLI. +- You need to override the `fs` methods in use. + +## use [`make-dir`](http://npm.im/make-dir) if: + +- You do not need to know the first dir created (and wish to save a few + `stat` calls when using the native implementation for this reason). +- You wish to use the native implementation if available, but fall back + when it's not. +- You prefer promise-returning APIs to callback-taking APIs. +- You are ok with occasionally getting `ENOENT` errors for failures that + are actually related to something other than a missing file system entry. +- You don't need/want a CLI. +- You need to override the `fs` methods in use. + +## use mkdirp 0.x if: + +- You need to know the first directory that was created. +- You need (or at least, are ok with) a CLI. +- You need to override the `fs` methods in use. +- You're ok with using callbacks instead of promises. +- You are not running on Windows, where the root-level ENOENT errors can + lead to infinite regress. +- You think vinyl just sounds warmer and richer for some weird reason. +- You are supporting truly ancient Node.js versions, before even the advent + of a `Promise` language primitive. (Please don't. You deserve better.) + +# cli + +This package also ships with a `mkdirp` command. + +``` +$ mkdirp -h + +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories + that don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m If a directory needs to be created, set the mode as an octal + --mode= permission string. + + -v --version Print the mkdirp version number + + -h --help Print this helpful banner + + -p --print Print the first directories created for each path provided + + --manual Use manual implementation, even if native is available +``` + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install mkdirp +``` + +to get the library locally, or + +``` +npm install -g mkdirp +``` + +to get the command everywhere, or + +``` +npx mkdirp ... +``` + +to run the command without installing it globally. + +# platform support + +This module works on node v8, but only v10 and above are officially +supported, as Node v8 reached its LTS end of life 2020-01-01, which is in +the past, as of this writing. + +# license + +MIT diff --git a/node_modules/node-addon-api/LICENSE.md b/node_modules/node-addon-api/LICENSE.md new file mode 100644 index 00000000..e2fad666 --- /dev/null +++ b/node_modules/node-addon-api/LICENSE.md @@ -0,0 +1,13 @@ +The MIT License (MIT) +===================== + +Copyright (c) 2017 Node.js API collaborators +----------------------------------- + +*Node.js API collaborators listed at * + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/node-addon-api/README.md b/node_modules/node-addon-api/README.md new file mode 100644 index 00000000..6a79c917 --- /dev/null +++ b/node_modules/node-addon-api/README.md @@ -0,0 +1,317 @@ +NOTE: The default branch has been renamed! +master is now named main + +If you have a local clone, you can update it by running: + +```shell +git branch -m master main +git fetch origin +git branch -u origin/main main +``` + +# **node-addon-api module** +This module contains **header-only C++ wrapper classes** which simplify +the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html) +provided by Node.js when using C++. It provides a C++ object model +and exception handling semantics with low overhead. + +There are three options for implementing addons: Node-API, nan, or direct +use of internal V8, libuv, and Node.js libraries. Unless there is a need for +direct access to functionality that is not exposed by Node-API as outlined +in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html) +in Node.js core, use Node-API. Refer to +[C/C++ addons with Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html) +for more information on Node-API. + +Node-API is an ABI stable C interface provided by Node.js for building native +addons. It is independent of the underlying JavaScript runtime (e.g. V8 or ChakraCore) +and is maintained as part of Node.js itself. It is intended to insulate +native addons from changes in the underlying JavaScript engine and allow +modules compiled for one version to run on later versions of Node.js without +recompilation. + +The `node-addon-api` module, which is not part of Node.js, preserves the benefits +of the Node-API as it consists only of inline code that depends only on the stable API +provided by Node-API. As such, modules built against one version of Node.js +using node-addon-api should run without having to be rebuilt with newer versions +of Node.js. + +It is important to remember that *other* Node.js interfaces such as +`libuv` (included in a project via `#include `) are not ABI-stable across +Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api` +exclusively and build against a version of Node.js that includes an +implementation of Node-API (meaning an active LTS version of Node.js) in +order to benefit from ABI stability across Node.js major versions. Node.js +provides an [ABI stability guide][] containing a detailed explanation of ABI +stability in general, and the Node-API ABI stability guarantee in particular. + +As new APIs are added to Node-API, node-addon-api must be updated to provide +wrappers for those new APIs. For this reason, node-addon-api provides +methods that allow callers to obtain the underlying Node-API handles so +direct calls to Node-API and the use of the objects/methods provided by +node-addon-api can be used together. For example, in order to be able +to use an API for which the node-addon-api does not yet provide a wrapper. + +APIs exposed by node-addon-api are generally used to create and +manipulate JavaScript values. Concepts and operations generally map +to ideas specified in the **ECMA262 Language Specification**. + +The [Node-API Resource](https://nodejs.github.io/node-addon-examples/) offers an +excellent orientation and tips for developers just getting started with Node-API +and node-addon-api. + +- **[Setup](#setup)** +- **[API Documentation](#api)** +- **[Examples](#examples)** +- **[Tests](#tests)** +- **[More resource and info about native Addons](#resources)** +- **[Badges](#badges)** +- **[Code of Conduct](CODE_OF_CONDUCT.md)** +- **[Contributors](#contributors)** +- **[License](#license)** + +## **Current version: 5.1.0** + +(See [CHANGELOG.md](CHANGELOG.md) for complete Changelog) + +[![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/) + + + +node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions. +This allows addons built with it to run with Node.js versions which support the targeted Node-API version. +**However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that +every year there will be a new major which drops support for the Node.js LTS version which has gone out of service. + +The oldest Node.js version supported by the current version of node-addon-api is Node.js 14.x. + +## Setup + - [Installation and usage](doc/setup.md) + - [node-gyp](doc/node-gyp.md) + - [cmake-js](doc/cmake-js.md) + - [Conversion tool](doc/conversion-tool.md) + - [Checker tool](doc/checker-tool.md) + - [Generator](doc/generator.md) + - [Prebuild tools](doc/prebuild_tools.md) + + + +### **API Documentation** + +The following is the documentation for node-addon-api. + + - [Full Class Hierarchy](doc/hierarchy.md) + - [Addon Structure](doc/addon.md) + - Data Types: + - [Env](doc/env.md) + - [CallbackInfo](doc/callbackinfo.md) + - [Reference](doc/reference.md) + - [Value](doc/value.md) + - [Name](doc/name.md) + - [Symbol](doc/symbol.md) + - [String](doc/string.md) + - [Number](doc/number.md) + - [Date](doc/date.md) + - [BigInt](doc/bigint.md) + - [Boolean](doc/boolean.md) + - [External](doc/external.md) + - [Object](doc/object.md) + - [Array](doc/array.md) + - [ObjectReference](doc/object_reference.md) + - [PropertyDescriptor](doc/property_descriptor.md) + - [Function](doc/function.md) + - [FunctionReference](doc/function_reference.md) + - [ObjectWrap](doc/object_wrap.md) + - [ClassPropertyDescriptor](doc/class_property_descriptor.md) + - [Buffer](doc/buffer.md) + - [ArrayBuffer](doc/array_buffer.md) + - [TypedArray](doc/typed_array.md) + - [TypedArrayOf](doc/typed_array_of.md) + - [DataView](doc/dataview.md) + - [Error Handling](doc/error_handling.md) + - [Error](doc/error.md) + - [TypeError](doc/type_error.md) + - [RangeError](doc/range_error.md) + - [Object Lifetime Management](doc/object_lifetime_management.md) + - [HandleScope](doc/handle_scope.md) + - [EscapableHandleScope](doc/escapable_handle_scope.md) + - [Memory Management](doc/memory_management.md) + - [Async Operations](doc/async_operations.md) + - [AsyncWorker](doc/async_worker.md) + - [AsyncContext](doc/async_context.md) + - [AsyncWorker Variants](doc/async_worker_variants.md) + - [Thread-safe Functions](doc/threadsafe.md) + - [ThreadSafeFunction](doc/threadsafe_function.md) + - [TypedThreadSafeFunction](doc/typed_threadsafe_function.md) + - [Promises](doc/promises.md) + - [Version management](doc/version_management.md) + + + +### **Examples** + +Are you new to **node-addon-api**? Take a look at our **[examples](https://github.com/nodejs/node-addon-examples)** + +- **[Hello World](https://github.com/nodejs/node-addon-examples/tree/HEAD/1_hello_world/node-addon-api)** +- **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/HEAD/2_function_arguments/node-addon-api)** +- **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/HEAD/3_callbacks/node-addon-api)** +- **[Object factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/4_object_factory/node-addon-api)** +- **[Function factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/5_function_factory/node-addon-api)** +- **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/HEAD/6_object_wrap/node-addon-api)** +- **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/HEAD/7_factory_wrap/node-addon-api)** +- **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/HEAD/8_passing_wrapped/node-addon-api)** + + + +### **Tests** + +To run the **node-addon-api** tests do: + +``` +npm install +npm test +``` + +To avoid testing the deprecated portions of the API run +``` +npm install +npm test --disable-deprecated +``` + +To run the tests targeting a specific version of Node-API run +``` +npm install +export NAPI_VERSION=X +npm test --NAPI_VERSION=X +``` + +where X is the version of Node-API you want to target. + +To run a specific unit test, filter conditions are available + +**Example:** + compile and run only tests on objectwrap.cc and objectwrap.js + ``` + npm run unit --filter=objectwrap + ``` + +Multiple unit tests cane be selected with wildcards + +**Example:** +compile and run all test files ending with "reference" -> function_reference.cc, object_reference.cc, reference.cc + ``` + npm run unit --filter=*reference + ``` + +Multiple filter conditions can be joined to broaden the test selection + +**Example:** + compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file + npm run unit --filter='*function objectwrap' + +### **Debug** + +To run the **node-addon-api** tests with `--debug` option: + +``` +npm run-script dev +``` + +If you want a faster build, you might use the following option: + +``` +npm run-script dev:incremental +``` + +Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)** + +### **Benchmarks** + +You can run the available benchmarks using the following command: + +``` +npm run-script benchmark +``` + +See [benchmark/README.md](benchmark/README.md) for more details about running and adding benchmarks. + + + +### **More resource and info about native Addons** +- **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)** +- **[Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)** +- **[Node-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)** +- **[How We Migrated Realm JavaScript From NAN to Node-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)** + +As node-addon-api's core mission is to expose the plain C Node-API as C++ +wrappers, tools that facilitate n-api/node-addon-api providing more +convenient patterns for developing a Node.js add-on with n-api/node-addon-api +can be published to NPM as standalone packages. It is also recommended to tag +such packages with `node-addon-api` to provide more visibility to the community. + +Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/search?q=keywords%3Anode-addon-api). + + + +### **Other bindings** + +- **[napi-rs](https://napi.rs)** - (`Rust`) + + + +### **Badges** + +The use of badges is recommended to indicate the minimum version of Node-API +required for the module. This helps to determine which Node.js major versions are +supported. Addon maintainers can consult the [Node-API support matrix][] to determine +which Node.js versions provide a given Node-API version. The following badges are +available: + +![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg) +![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg) +![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg) +![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg) +![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg) +![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg) +![Node-API v7 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v7%20Badge.svg) +![Node-API v8 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v8%20Badge.svg) +![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg) + +## **Contributing** + +We love contributions from the community to **node-addon-api**! +See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module. + + + +## Team members + +### Active +| Name | GitHub Link | +| ------------------- | ----------------------------------------------------- | +| Anna Henningsen | [addaleax](https://github.com/addaleax) | +| Chengzhong Wu | [legendecas](https://github.com/legendecas) | +| Jack Xia | [JckXia](https://github.com/JckXia) | +| Kevin Eady | [KevinEady](https://github.com/KevinEady) | +| Michael Dawson | [mhdawson](https://github.com/mhdawson) | +| Nicola Del Gobbo | [NickNaso](https://github.com/NickNaso) | +| Vladimir Morozov | [vmoroz](https://github.com/vmoroz) | + +### Emeritus +| Name | GitHub Link | +| ------------------- | ----------------------------------------------------- | +| Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) | +| Benjamin Byholm | [kkoopa](https://github.com/kkoopa) | +| Gabriel Schulhof | [gabrielschulhof](https://github.com/gabrielschulhof) | +| Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) | +| Jason Ginchereau | [jasongin](https://github.com/jasongin) | +| Jim Schlight | [jschlight](https://github.com/jschlight) | +| Sampson Gao | [sampsongao](https://github.com/sampsongao) | +| Taylor Woll | [boingoing](https://github.com/boingoing) | + + + +Licensed under [MIT](./LICENSE.md) + +[ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/ +[Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix diff --git a/node_modules/node-addon-api/common.gypi b/node_modules/node-addon-api/common.gypi new file mode 100644 index 00000000..9be254f0 --- /dev/null +++ b/node_modules/node-addon-api/common.gypi @@ -0,0 +1,21 @@ +{ + 'variables': { + 'NAPI_VERSION%': " +inline PropertyDescriptor PropertyDescriptor::Accessor( + const char* utf8name, + Getter getter, + napi_property_attributes attributes, + void* /*data*/) { + using CbData = details::CallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({getter, nullptr}); + + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + const std::string& utf8name, + Getter getter, + napi_property_attributes attributes, + void* data) { + return Accessor(utf8name.c_str(), getter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + napi_value name, + Getter getter, + napi_property_attributes attributes, + void* /*data*/) { + using CbData = details::CallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({getter, nullptr}); + + return PropertyDescriptor({nullptr, + name, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Name name, Getter getter, napi_property_attributes attributes, void* data) { + napi_value nameValue = name; + return PropertyDescriptor::Accessor(nameValue, getter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + const char* utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* /*data*/) { + using CbData = details::AccessorCallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({getter, setter, nullptr}); + + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + CbData::GetterWrapper, + CbData::SetterWrapper, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + const std::string& utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + return Accessor(utf8name.c_str(), getter, setter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + napi_value name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* /*data*/) { + using CbData = details::AccessorCallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({getter, setter, nullptr}); + + return PropertyDescriptor({nullptr, + name, + nullptr, + CbData::GetterWrapper, + CbData::SetterWrapper, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Name name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + napi_value nameValue = name; + return PropertyDescriptor::Accessor( + nameValue, getter, setter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + const char* utf8name, + Callable cb, + napi_property_attributes attributes, + void* /*data*/) { + using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); + using CbData = details::CallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({cb, nullptr}); + + return PropertyDescriptor({utf8name, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + const std::string& utf8name, + Callable cb, + napi_property_attributes attributes, + void* data) { + return Function(utf8name.c_str(), cb, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + napi_value name, + Callable cb, + napi_property_attributes attributes, + void* /*data*/) { + using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); + using CbData = details::CallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({cb, nullptr}); + + return PropertyDescriptor({nullptr, + name, + CbData::Wrapper, + nullptr, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + Name name, Callable cb, napi_property_attributes attributes, void* data) { + napi_value nameValue = name; + return PropertyDescriptor::Function(nameValue, cb, attributes, data); +} + +#endif // !SRC_NAPI_INL_DEPRECATED_H_ diff --git a/node_modules/node-addon-api/napi-inl.h b/node_modules/node-addon-api/napi-inl.h new file mode 100644 index 00000000..3ddc1baa --- /dev/null +++ b/node_modules/node-addon-api/napi-inl.h @@ -0,0 +1,6303 @@ +#ifndef SRC_NAPI_INL_H_ +#define SRC_NAPI_INL_H_ + +//////////////////////////////////////////////////////////////////////////////// +// Node-API C++ Wrapper Classes +// +// Inline header-only implementations for "Node-API" ABI-stable C APIs for +// Node.js. +//////////////////////////////////////////////////////////////////////////////// + +// Note: Do not include this file directly! Include "napi.h" instead. + +#include +#include +#include +#include +#include + +namespace Napi { + +#ifdef NAPI_CPP_CUSTOM_NAMESPACE +namespace NAPI_CPP_CUSTOM_NAMESPACE { +#endif + +// Helpers to handle functions exposed from C++. +namespace details { + +// Attach a data item to an object and delete it when the object gets +// garbage-collected. +// TODO: Replace this code with `napi_add_finalizer()` whenever it becomes +// available on all supported versions of Node.js. +template +inline napi_status AttachData(napi_env env, + napi_value obj, + FreeType* data, + napi_finalize finalizer = nullptr, + void* hint = nullptr) { + napi_status status; + if (finalizer == nullptr) { + finalizer = [](napi_env /*env*/, void* data, void* /*hint*/) { + delete static_cast(data); + }; + } +#if (NAPI_VERSION < 5) + napi_value symbol, external; + status = napi_create_symbol(env, nullptr, &symbol); + if (status == napi_ok) { + status = napi_create_external(env, data, finalizer, hint, &external); + if (status == napi_ok) { + napi_property_descriptor desc = {nullptr, + symbol, + nullptr, + nullptr, + nullptr, + external, + napi_default, + nullptr}; + status = napi_define_properties(env, obj, 1, &desc); + } + } +#else // NAPI_VERSION >= 5 + status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr); +#endif + return status; +} + +// For use in JS to C++ callback wrappers to catch any Napi::Error exceptions +// and rethrow them as JavaScript exceptions before returning from the callback. +template +inline napi_value WrapCallback(Callable callback) { +#ifdef NAPI_CPP_EXCEPTIONS + try { + return callback(); + } catch (const Error& e) { + e.ThrowAsJavaScriptException(); + return nullptr; + } +#else // NAPI_CPP_EXCEPTIONS + // When C++ exceptions are disabled, errors are immediately thrown as JS + // exceptions, so there is no need to catch and rethrow them here. + return callback(); +#endif // NAPI_CPP_EXCEPTIONS +} + +// For use in JS to C++ void callback wrappers to catch any Napi::Error +// exceptions and rethrow them as JavaScript exceptions before returning from +// the callback. +template +inline void WrapVoidCallback(Callable callback) { +#ifdef NAPI_CPP_EXCEPTIONS + try { + callback(); + } catch (const Error& e) { + e.ThrowAsJavaScriptException(); + } +#else // NAPI_CPP_EXCEPTIONS + // When C++ exceptions are disabled, errors are immediately thrown as JS + // exceptions, so there is no need to catch and rethrow them here. + callback(); +#endif // NAPI_CPP_EXCEPTIONS +} + +template +struct CallbackData { + static inline napi_value Wrapper(napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + CallbackData* callbackData = + static_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + return callbackData->callback(callbackInfo); + }); + } + + Callable callback; + void* data; +}; + +template +struct CallbackData { + static inline napi_value Wrapper(napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + CallbackData* callbackData = + static_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + callbackData->callback(callbackInfo); + return nullptr; + }); + } + + Callable callback; + void* data; +}; + +template +napi_value TemplatedVoidCallback(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + CallbackInfo cbInfo(env, info); + Callback(cbInfo); + return nullptr; + }); +} + +template +napi_value TemplatedCallback(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + CallbackInfo cbInfo(env, info); + return Callback(cbInfo); + }); +} + +template +napi_value TemplatedInstanceCallback(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + CallbackInfo cbInfo(env, info); + T* instance = T::Unwrap(cbInfo.This().As()); + return (instance->*UnwrapCallback)(cbInfo); + }); +} + +template +napi_value TemplatedInstanceVoidCallback(napi_env env, napi_callback_info info) + NAPI_NOEXCEPT { + return details::WrapCallback([&] { + CallbackInfo cbInfo(env, info); + T* instance = T::Unwrap(cbInfo.This().As()); + (instance->*UnwrapCallback)(cbInfo); + return nullptr; + }); +} + +template +struct FinalizeData { + static inline void Wrapper(napi_env env, + void* data, + void* finalizeHint) NAPI_NOEXCEPT { + WrapVoidCallback([&] { + FinalizeData* finalizeData = static_cast(finalizeHint); + finalizeData->callback(Env(env), static_cast(data)); + delete finalizeData; + }); + } + + static inline void WrapperWithHint(napi_env env, + void* data, + void* finalizeHint) NAPI_NOEXCEPT { + WrapVoidCallback([&] { + FinalizeData* finalizeData = static_cast(finalizeHint); + finalizeData->callback( + Env(env), static_cast(data), finalizeData->hint); + delete finalizeData; + }); + } + + Finalizer callback; + Hint* hint; +}; + +#if (NAPI_VERSION > 3 && !defined(__wasm32__)) +template , + typename FinalizerDataType = void> +struct ThreadSafeFinalize { + static inline void Wrapper(napi_env env, + void* rawFinalizeData, + void* /* rawContext */) { + if (rawFinalizeData == nullptr) return; + + ThreadSafeFinalize* finalizeData = + static_cast(rawFinalizeData); + finalizeData->callback(Env(env)); + delete finalizeData; + } + + static inline void FinalizeWrapperWithData(napi_env env, + void* rawFinalizeData, + void* /* rawContext */) { + if (rawFinalizeData == nullptr) return; + + ThreadSafeFinalize* finalizeData = + static_cast(rawFinalizeData); + finalizeData->callback(Env(env), finalizeData->data); + delete finalizeData; + } + + static inline void FinalizeWrapperWithContext(napi_env env, + void* rawFinalizeData, + void* rawContext) { + if (rawFinalizeData == nullptr) return; + + ThreadSafeFinalize* finalizeData = + static_cast(rawFinalizeData); + finalizeData->callback(Env(env), static_cast(rawContext)); + delete finalizeData; + } + + static inline void FinalizeFinalizeWrapperWithDataAndContext( + napi_env env, void* rawFinalizeData, void* rawContext) { + if (rawFinalizeData == nullptr) return; + + ThreadSafeFinalize* finalizeData = + static_cast(rawFinalizeData); + finalizeData->callback( + Env(env), finalizeData->data, static_cast(rawContext)); + delete finalizeData; + } + + FinalizerDataType* data; + Finalizer callback; +}; + +template +inline typename std::enable_if(nullptr)>::type +CallJsWrapper(napi_env env, napi_value jsCallback, void* context, void* data) { + call(env, + Function(env, jsCallback), + static_cast(context), + static_cast(data)); +} + +template +inline typename std::enable_if(nullptr)>::type +CallJsWrapper(napi_env env, + napi_value jsCallback, + void* /*context*/, + void* /*data*/) { + if (jsCallback != nullptr) { + Function(env, jsCallback).Call(0, nullptr); + } +} + +#if NAPI_VERSION > 4 + +template +napi_value DefaultCallbackWrapper(napi_env /*env*/, std::nullptr_t /*cb*/) { + return nullptr; +} + +template +napi_value DefaultCallbackWrapper(napi_env /*env*/, Napi::Function cb) { + return cb; +} + +#else +template +napi_value DefaultCallbackWrapper(napi_env env, Napi::Function cb) { + if (cb.IsEmpty()) { + return TSFN::EmptyFunctionFactory(env); + } + return cb; +} +#endif // NAPI_VERSION > 4 +#endif // NAPI_VERSION > 3 && !defined(__wasm32__) + +template +struct AccessorCallbackData { + static inline napi_value GetterWrapper(napi_env env, + napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + AccessorCallbackData* callbackData = + static_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + return callbackData->getterCallback(callbackInfo); + }); + } + + static inline napi_value SetterWrapper(napi_env env, + napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + AccessorCallbackData* callbackData = + static_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + callbackData->setterCallback(callbackInfo); + return nullptr; + }); + } + + Getter getterCallback; + Setter setterCallback; + void* data; +}; + +} // namespace details + +#ifndef NODE_ADDON_API_DISABLE_DEPRECATED +#include "napi-inl.deprecated.h" +#endif // !NODE_ADDON_API_DISABLE_DEPRECATED + +//////////////////////////////////////////////////////////////////////////////// +// Module registration +//////////////////////////////////////////////////////////////////////////////// + +// Register an add-on based on an initializer function. +#define NODE_API_MODULE(modname, regfunc) \ + static napi_value __napi_##regfunc(napi_env env, napi_value exports) { \ + return Napi::RegisterModule(env, exports, regfunc); \ + } \ + NAPI_MODULE(modname, __napi_##regfunc) + +// Register an add-on based on a subclass of `Addon` with a custom Node.js +// module name. +#define NODE_API_NAMED_ADDON(modname, classname) \ + static napi_value __napi_##classname(napi_env env, napi_value exports) { \ + return Napi::RegisterModule(env, exports, &classname::Init); \ + } \ + NAPI_MODULE(modname, __napi_##classname) + +// Register an add-on based on a subclass of `Addon` with the Node.js module +// name given by node-gyp from the `target_name` in binding.gyp. +#define NODE_API_ADDON(classname) \ + NODE_API_NAMED_ADDON(NODE_GYP_MODULE_NAME, classname) + +// Adapt the NAPI_MODULE registration function: +// - Wrap the arguments in NAPI wrappers. +// - Catch any NAPI errors and rethrow as JS exceptions. +inline napi_value RegisterModule(napi_env env, + napi_value exports, + ModuleRegisterCallback registerCallback) { + return details::WrapCallback([&] { + return napi_value( + registerCallback(Napi::Env(env), Napi::Object(env, exports))); + }); +} + +//////////////////////////////////////////////////////////////////////////////// +// Maybe class +//////////////////////////////////////////////////////////////////////////////// + +template +bool Maybe::IsNothing() const { + return !_has_value; +} + +template +bool Maybe::IsJust() const { + return _has_value; +} + +template +void Maybe::Check() const { + NAPI_CHECK(IsJust(), "Napi::Maybe::Check", "Maybe value is Nothing."); +} + +template +T Maybe::Unwrap() const { + NAPI_CHECK(IsJust(), "Napi::Maybe::Unwrap", "Maybe value is Nothing."); + return _value; +} + +template +T Maybe::UnwrapOr(const T& default_value) const { + return _has_value ? _value : default_value; +} + +template +bool Maybe::UnwrapTo(T* out) const { + if (IsJust()) { + *out = _value; + return true; + }; + return false; +} + +template +bool Maybe::operator==(const Maybe& other) const { + return (IsJust() == other.IsJust()) && + (!IsJust() || Unwrap() == other.Unwrap()); +} + +template +bool Maybe::operator!=(const Maybe& other) const { + return !operator==(other); +} + +template +Maybe::Maybe() : _has_value(false) {} + +template +Maybe::Maybe(const T& t) : _has_value(true), _value(t) {} + +template +inline Maybe Nothing() { + return Maybe(); +} + +template +inline Maybe Just(const T& t) { + return Maybe(t); +} + +//////////////////////////////////////////////////////////////////////////////// +// Env class +//////////////////////////////////////////////////////////////////////////////// + +inline Env::Env(napi_env env) : _env(env) {} + +inline Env::operator napi_env() const { + return _env; +} + +inline Object Env::Global() const { + napi_value value; + napi_status status = napi_get_global(*this, &value); + NAPI_THROW_IF_FAILED(*this, status, Object()); + return Object(*this, value); +} + +inline Value Env::Undefined() const { + napi_value value; + napi_status status = napi_get_undefined(*this, &value); + NAPI_THROW_IF_FAILED(*this, status, Value()); + return Value(*this, value); +} + +inline Value Env::Null() const { + napi_value value; + napi_status status = napi_get_null(*this, &value); + NAPI_THROW_IF_FAILED(*this, status, Value()); + return Value(*this, value); +} + +inline bool Env::IsExceptionPending() const { + bool result; + napi_status status = napi_is_exception_pending(_env, &result); + if (status != napi_ok) + result = false; // Checking for a pending exception shouldn't throw. + return result; +} + +inline Error Env::GetAndClearPendingException() const { + napi_value value; + napi_status status = napi_get_and_clear_last_exception(_env, &value); + if (status != napi_ok) { + // Don't throw another exception when failing to get the exception! + return Error(); + } + return Error(_env, value); +} + +inline MaybeOrValue Env::RunScript(const char* utf8script) const { + String script = String::New(_env, utf8script); + return RunScript(script); +} + +inline MaybeOrValue Env::RunScript(const std::string& utf8script) const { + return RunScript(utf8script.c_str()); +} + +inline MaybeOrValue Env::RunScript(String script) const { + napi_value result; + napi_status status = napi_run_script(_env, script, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Value(_env, result), Napi::Value); +} + +#if NAPI_VERSION > 2 +template +void Env::CleanupHook::Wrapper(void* data) NAPI_NOEXCEPT { + auto* cleanupData = + static_cast::CleanupData*>( + data); + cleanupData->hook(); + delete cleanupData; +} + +template +void Env::CleanupHook::WrapperWithArg(void* data) NAPI_NOEXCEPT { + auto* cleanupData = + static_cast::CleanupData*>( + data); + cleanupData->hook(static_cast(cleanupData->arg)); + delete cleanupData; +} +#endif // NAPI_VERSION > 2 + +#if NAPI_VERSION > 5 +template fini> +inline void Env::SetInstanceData(T* data) const { + napi_status status = napi_set_instance_data( + _env, + data, + [](napi_env env, void* data, void*) { fini(env, static_cast(data)); }, + nullptr); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +template fini> +inline void Env::SetInstanceData(DataType* data, HintType* hint) const { + napi_status status = napi_set_instance_data( + _env, + data, + [](napi_env env, void* data, void* hint) { + fini(env, static_cast(data), static_cast(hint)); + }, + hint); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +template +inline T* Env::GetInstanceData() const { + void* data = nullptr; + + napi_status status = napi_get_instance_data(_env, &data); + NAPI_THROW_IF_FAILED(_env, status, nullptr); + + return static_cast(data); +} + +template +void Env::DefaultFini(Env, T* data) { + delete data; +} + +template +void Env::DefaultFiniWithHint(Env, DataType* data, HintType*) { + delete data; +} +#endif // NAPI_VERSION > 5 + +//////////////////////////////////////////////////////////////////////////////// +// Value class +//////////////////////////////////////////////////////////////////////////////// + +inline Value::Value() : _env(nullptr), _value(nullptr) {} + +inline Value::Value(napi_env env, napi_value value) + : _env(env), _value(value) {} + +inline Value::operator napi_value() const { + return _value; +} + +inline bool Value::operator==(const Value& other) const { + return StrictEquals(other); +} + +inline bool Value::operator!=(const Value& other) const { + return !this->operator==(other); +} + +inline bool Value::StrictEquals(const Value& other) const { + bool result; + napi_status status = napi_strict_equals(_env, *this, other, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline Napi::Env Value::Env() const { + return Napi::Env(_env); +} + +inline bool Value::IsEmpty() const { + return _value == nullptr; +} + +inline napi_valuetype Value::Type() const { + if (IsEmpty()) { + return napi_undefined; + } + + napi_valuetype type; + napi_status status = napi_typeof(_env, _value, &type); + NAPI_THROW_IF_FAILED(_env, status, napi_undefined); + return type; +} + +inline bool Value::IsUndefined() const { + return Type() == napi_undefined; +} + +inline bool Value::IsNull() const { + return Type() == napi_null; +} + +inline bool Value::IsBoolean() const { + return Type() == napi_boolean; +} + +inline bool Value::IsNumber() const { + return Type() == napi_number; +} + +#if NAPI_VERSION > 5 +inline bool Value::IsBigInt() const { + return Type() == napi_bigint; +} +#endif // NAPI_VERSION > 5 + +#if (NAPI_VERSION > 4) +inline bool Value::IsDate() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_date(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} +#endif + +inline bool Value::IsString() const { + return Type() == napi_string; +} + +inline bool Value::IsSymbol() const { + return Type() == napi_symbol; +} + +inline bool Value::IsArray() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_array(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsArrayBuffer() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_arraybuffer(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsTypedArray() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_typedarray(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsObject() const { + return Type() == napi_object || IsFunction(); +} + +inline bool Value::IsFunction() const { + return Type() == napi_function; +} + +inline bool Value::IsPromise() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_promise(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsDataView() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_dataview(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsBuffer() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_buffer(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsExternal() const { + return Type() == napi_external; +} + +template +inline T Value::As() const { + return T(_env, _value); +} + +inline MaybeOrValue Value::ToBoolean() const { + napi_value result; + napi_status status = napi_coerce_to_bool(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Boolean(_env, result), Napi::Boolean); +} + +inline MaybeOrValue Value::ToNumber() const { + napi_value result; + napi_status status = napi_coerce_to_number(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Number(_env, result), Napi::Number); +} + +inline MaybeOrValue Value::ToString() const { + napi_value result; + napi_status status = napi_coerce_to_string(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::String(_env, result), Napi::String); +} + +inline MaybeOrValue Value::ToObject() const { + napi_value result; + napi_status status = napi_coerce_to_object(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Object(_env, result), Napi::Object); +} + +//////////////////////////////////////////////////////////////////////////////// +// Boolean class +//////////////////////////////////////////////////////////////////////////////// + +inline Boolean Boolean::New(napi_env env, bool val) { + napi_value value; + napi_status status = napi_get_boolean(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, Boolean()); + return Boolean(env, value); +} + +inline Boolean::Boolean() : Napi::Value() {} + +inline Boolean::Boolean(napi_env env, napi_value value) + : Napi::Value(env, value) {} + +inline Boolean::operator bool() const { + return Value(); +} + +inline bool Boolean::Value() const { + bool result; + napi_status status = napi_get_value_bool(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +//////////////////////////////////////////////////////////////////////////////// +// Number class +//////////////////////////////////////////////////////////////////////////////// + +inline Number Number::New(napi_env env, double val) { + napi_value value; + napi_status status = napi_create_double(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, Number()); + return Number(env, value); +} + +inline Number::Number() : Value() {} + +inline Number::Number(napi_env env, napi_value value) : Value(env, value) {} + +inline Number::operator int32_t() const { + return Int32Value(); +} + +inline Number::operator uint32_t() const { + return Uint32Value(); +} + +inline Number::operator int64_t() const { + return Int64Value(); +} + +inline Number::operator float() const { + return FloatValue(); +} + +inline Number::operator double() const { + return DoubleValue(); +} + +inline int32_t Number::Int32Value() const { + int32_t result; + napi_status status = napi_get_value_int32(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline uint32_t Number::Uint32Value() const { + uint32_t result; + napi_status status = napi_get_value_uint32(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline int64_t Number::Int64Value() const { + int64_t result; + napi_status status = napi_get_value_int64(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline float Number::FloatValue() const { + return static_cast(DoubleValue()); +} + +inline double Number::DoubleValue() const { + double result; + napi_status status = napi_get_value_double(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +#if NAPI_VERSION > 5 +//////////////////////////////////////////////////////////////////////////////// +// BigInt Class +//////////////////////////////////////////////////////////////////////////////// + +inline BigInt BigInt::New(napi_env env, int64_t val) { + napi_value value; + napi_status status = napi_create_bigint_int64(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, BigInt()); + return BigInt(env, value); +} + +inline BigInt BigInt::New(napi_env env, uint64_t val) { + napi_value value; + napi_status status = napi_create_bigint_uint64(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, BigInt()); + return BigInt(env, value); +} + +inline BigInt BigInt::New(napi_env env, + int sign_bit, + size_t word_count, + const uint64_t* words) { + napi_value value; + napi_status status = + napi_create_bigint_words(env, sign_bit, word_count, words, &value); + NAPI_THROW_IF_FAILED(env, status, BigInt()); + return BigInt(env, value); +} + +inline BigInt::BigInt() : Value() {} + +inline BigInt::BigInt(napi_env env, napi_value value) : Value(env, value) {} + +inline int64_t BigInt::Int64Value(bool* lossless) const { + int64_t result; + napi_status status = + napi_get_value_bigint_int64(_env, _value, &result, lossless); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline uint64_t BigInt::Uint64Value(bool* lossless) const { + uint64_t result; + napi_status status = + napi_get_value_bigint_uint64(_env, _value, &result, lossless); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline size_t BigInt::WordCount() const { + size_t word_count; + napi_status status = + napi_get_value_bigint_words(_env, _value, nullptr, &word_count, nullptr); + NAPI_THROW_IF_FAILED(_env, status, 0); + return word_count; +} + +inline void BigInt::ToWords(int* sign_bit, + size_t* word_count, + uint64_t* words) { + napi_status status = + napi_get_value_bigint_words(_env, _value, sign_bit, word_count, words); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} +#endif // NAPI_VERSION > 5 + +#if (NAPI_VERSION > 4) +//////////////////////////////////////////////////////////////////////////////// +// Date Class +//////////////////////////////////////////////////////////////////////////////// + +inline Date Date::New(napi_env env, double val) { + napi_value value; + napi_status status = napi_create_date(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, Date()); + return Date(env, value); +} + +inline Date::Date() : Value() {} + +inline Date::Date(napi_env env, napi_value value) : Value(env, value) {} + +inline Date::operator double() const { + return ValueOf(); +} + +inline double Date::ValueOf() const { + double result; + napi_status status = napi_get_date_value(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Name class +//////////////////////////////////////////////////////////////////////////////// + +inline Name::Name() : Value() {} + +inline Name::Name(napi_env env, napi_value value) : Value(env, value) {} + +//////////////////////////////////////////////////////////////////////////////// +// String class +//////////////////////////////////////////////////////////////////////////////// + +inline String String::New(napi_env env, const std::string& val) { + return String::New(env, val.c_str(), val.size()); +} + +inline String String::New(napi_env env, const std::u16string& val) { + return String::New(env, val.c_str(), val.size()); +} + +inline String String::New(napi_env env, const char* val) { + // TODO(@gabrielschulhof) Remove if-statement when core's error handling is + // available in all supported versions. + if (val == nullptr) { + // Throw an error that looks like it came from core. + NAPI_THROW_IF_FAILED(env, napi_invalid_arg, String()); + } + napi_value value; + napi_status status = + napi_create_string_utf8(env, val, std::strlen(val), &value); + NAPI_THROW_IF_FAILED(env, status, String()); + return String(env, value); +} + +inline String String::New(napi_env env, const char16_t* val) { + napi_value value; + // TODO(@gabrielschulhof) Remove if-statement when core's error handling is + // available in all supported versions. + if (val == nullptr) { + // Throw an error that looks like it came from core. + NAPI_THROW_IF_FAILED(env, napi_invalid_arg, String()); + } + napi_status status = + napi_create_string_utf16(env, val, std::u16string(val).size(), &value); + NAPI_THROW_IF_FAILED(env, status, String()); + return String(env, value); +} + +inline String String::New(napi_env env, const char* val, size_t length) { + napi_value value; + napi_status status = napi_create_string_utf8(env, val, length, &value); + NAPI_THROW_IF_FAILED(env, status, String()); + return String(env, value); +} + +inline String String::New(napi_env env, const char16_t* val, size_t length) { + napi_value value; + napi_status status = napi_create_string_utf16(env, val, length, &value); + NAPI_THROW_IF_FAILED(env, status, String()); + return String(env, value); +} + +inline String::String() : Name() {} + +inline String::String(napi_env env, napi_value value) : Name(env, value) {} + +inline String::operator std::string() const { + return Utf8Value(); +} + +inline String::operator std::u16string() const { + return Utf16Value(); +} + +inline std::string String::Utf8Value() const { + size_t length; + napi_status status = + napi_get_value_string_utf8(_env, _value, nullptr, 0, &length); + NAPI_THROW_IF_FAILED(_env, status, ""); + + std::string value; + value.reserve(length + 1); + value.resize(length); + status = napi_get_value_string_utf8( + _env, _value, &value[0], value.capacity(), nullptr); + NAPI_THROW_IF_FAILED(_env, status, ""); + return value; +} + +inline std::u16string String::Utf16Value() const { + size_t length; + napi_status status = + napi_get_value_string_utf16(_env, _value, nullptr, 0, &length); + NAPI_THROW_IF_FAILED(_env, status, NAPI_WIDE_TEXT("")); + + std::u16string value; + value.reserve(length + 1); + value.resize(length); + status = napi_get_value_string_utf16( + _env, _value, &value[0], value.capacity(), nullptr); + NAPI_THROW_IF_FAILED(_env, status, NAPI_WIDE_TEXT("")); + return value; +} + +//////////////////////////////////////////////////////////////////////////////// +// Symbol class +//////////////////////////////////////////////////////////////////////////////// + +inline Symbol Symbol::New(napi_env env, const char* description) { + napi_value descriptionValue = description != nullptr + ? String::New(env, description) + : static_cast(nullptr); + return Symbol::New(env, descriptionValue); +} + +inline Symbol Symbol::New(napi_env env, const std::string& description) { + napi_value descriptionValue = String::New(env, description); + return Symbol::New(env, descriptionValue); +} + +inline Symbol Symbol::New(napi_env env, String description) { + napi_value descriptionValue = description; + return Symbol::New(env, descriptionValue); +} + +inline Symbol Symbol::New(napi_env env, napi_value description) { + napi_value value; + napi_status status = napi_create_symbol(env, description, &value); + NAPI_THROW_IF_FAILED(env, status, Symbol()); + return Symbol(env, value); +} + +inline MaybeOrValue Symbol::WellKnown(napi_env env, + const std::string& name) { +#if defined(NODE_ADDON_API_ENABLE_MAYBE) + Value symbol_obj; + Value symbol_value; + if (Napi::Env(env).Global().Get("Symbol").UnwrapTo(&symbol_obj) && + symbol_obj.As().Get(name).UnwrapTo(&symbol_value)) { + return Just(symbol_value.As()); + } + return Nothing(); +#else + return Napi::Env(env) + .Global() + .Get("Symbol") + .As() + .Get(name) + .As(); +#endif +} + +inline MaybeOrValue Symbol::For(napi_env env, + const std::string& description) { + napi_value descriptionValue = String::New(env, description); + return Symbol::For(env, descriptionValue); +} + +inline MaybeOrValue Symbol::For(napi_env env, const char* description) { + napi_value descriptionValue = String::New(env, description); + return Symbol::For(env, descriptionValue); +} + +inline MaybeOrValue Symbol::For(napi_env env, String description) { + return Symbol::For(env, static_cast(description)); +} + +inline MaybeOrValue Symbol::For(napi_env env, napi_value description) { +#if defined(NODE_ADDON_API_ENABLE_MAYBE) + Value symbol_obj; + Value symbol_for_value; + Value symbol_value; + if (Napi::Env(env).Global().Get("Symbol").UnwrapTo(&symbol_obj) && + symbol_obj.As().Get("for").UnwrapTo(&symbol_for_value) && + symbol_for_value.As() + .Call(symbol_obj, {description}) + .UnwrapTo(&symbol_value)) { + return Just(symbol_value.As()); + } + return Nothing(); +#else + Object symbol_obj = Napi::Env(env).Global().Get("Symbol").As(); + return symbol_obj.Get("for") + .As() + .Call(symbol_obj, {description}) + .As(); +#endif +} + +inline Symbol::Symbol() : Name() {} + +inline Symbol::Symbol(napi_env env, napi_value value) : Name(env, value) {} + +//////////////////////////////////////////////////////////////////////////////// +// Automagic value creation +//////////////////////////////////////////////////////////////////////////////// + +namespace details { +template +struct vf_number { + static Number From(napi_env env, T value) { + return Number::New(env, static_cast(value)); + } +}; + +template <> +struct vf_number { + static Boolean From(napi_env env, bool value) { + return Boolean::New(env, value); + } +}; + +struct vf_utf8_charp { + static String From(napi_env env, const char* value) { + return String::New(env, value); + } +}; + +struct vf_utf16_charp { + static String From(napi_env env, const char16_t* value) { + return String::New(env, value); + } +}; +struct vf_utf8_string { + static String From(napi_env env, const std::string& value) { + return String::New(env, value); + } +}; + +struct vf_utf16_string { + static String From(napi_env env, const std::u16string& value) { + return String::New(env, value); + } +}; + +template +struct vf_fallback { + static Value From(napi_env env, const T& value) { return Value(env, value); } +}; + +template +struct disjunction : std::false_type {}; +template +struct disjunction : B {}; +template +struct disjunction + : std::conditional>::type {}; + +template +struct can_make_string + : disjunction::type, + typename std::is_convertible::type, + typename std::is_convertible::type, + typename std::is_convertible::type> {}; +} // namespace details + +template +Value Value::From(napi_env env, const T& value) { + using Helper = typename std::conditional< + std::is_integral::value || std::is_floating_point::value, + details::vf_number, + typename std::conditional::value, + String, + details::vf_fallback>::type>::type; + return Helper::From(env, value); +} + +template +String String::From(napi_env env, const T& value) { + struct Dummy {}; + using Helper = typename std::conditional< + std::is_convertible::value, + details::vf_utf8_charp, + typename std::conditional< + std::is_convertible::value, + details::vf_utf16_charp, + typename std::conditional< + std::is_convertible::value, + details::vf_utf8_string, + typename std::conditional< + std::is_convertible::value, + details::vf_utf16_string, + Dummy>::type>::type>::type>::type; + return Helper::From(env, value); +} + +//////////////////////////////////////////////////////////////////////////////// +// Object class +//////////////////////////////////////////////////////////////////////////////// + +template +inline Object::PropertyLValue::operator Value() const { + MaybeOrValue val = Object(_env, _object).Get(_key); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + return val.Unwrap(); +#else + return val; +#endif +} + +template +template +inline Object::PropertyLValue& Object::PropertyLValue::operator=( + ValueType value) { +#ifdef NODE_ADDON_API_ENABLE_MAYBE + MaybeOrValue result = +#endif + Object(_env, _object).Set(_key, value); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + result.Unwrap(); +#endif + return *this; +} + +template +inline Object::PropertyLValue::PropertyLValue(Object object, Key key) + : _env(object.Env()), _object(object), _key(key) {} + +inline Object Object::New(napi_env env) { + napi_value value; + napi_status status = napi_create_object(env, &value); + NAPI_THROW_IF_FAILED(env, status, Object()); + return Object(env, value); +} + +inline Object::Object() : Value() {} + +inline Object::Object(napi_env env, napi_value value) : Value(env, value) {} + +inline Object::PropertyLValue Object::operator[]( + const char* utf8name) { + return PropertyLValue(*this, utf8name); +} + +inline Object::PropertyLValue Object::operator[]( + const std::string& utf8name) { + return PropertyLValue(*this, utf8name); +} + +inline Object::PropertyLValue Object::operator[](uint32_t index) { + return PropertyLValue(*this, index); +} + +inline Object::PropertyLValue Object::operator[](Value index) const { + return PropertyLValue(*this, index); +} + +inline MaybeOrValue Object::operator[](const char* utf8name) const { + return Get(utf8name); +} + +inline MaybeOrValue Object::operator[]( + const std::string& utf8name) const { + return Get(utf8name); +} + +inline MaybeOrValue Object::operator[](uint32_t index) const { + return Get(index); +} + +inline MaybeOrValue Object::Has(napi_value key) const { + bool result; + napi_status status = napi_has_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Has(Value key) const { + bool result; + napi_status status = napi_has_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Has(const char* utf8name) const { + bool result; + napi_status status = napi_has_named_property(_env, _value, utf8name, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Has(const std::string& utf8name) const { + return Has(utf8name.c_str()); +} + +inline MaybeOrValue Object::HasOwnProperty(napi_value key) const { + bool result; + napi_status status = napi_has_own_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::HasOwnProperty(Value key) const { + bool result; + napi_status status = napi_has_own_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::HasOwnProperty(const char* utf8name) const { + napi_value key; + napi_status status = + napi_create_string_utf8(_env, utf8name, std::strlen(utf8name), &key); + NAPI_MAYBE_THROW_IF_FAILED(_env, status, bool); + return HasOwnProperty(key); +} + +inline MaybeOrValue Object::HasOwnProperty( + const std::string& utf8name) const { + return HasOwnProperty(utf8name.c_str()); +} + +inline MaybeOrValue Object::Get(napi_value key) const { + napi_value result; + napi_status status = napi_get_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); +} + +inline MaybeOrValue Object::Get(Value key) const { + napi_value result; + napi_status status = napi_get_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); +} + +inline MaybeOrValue Object::Get(const char* utf8name) const { + napi_value result; + napi_status status = napi_get_named_property(_env, _value, utf8name, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); +} + +inline MaybeOrValue Object::Get(const std::string& utf8name) const { + return Get(utf8name.c_str()); +} + +template +inline MaybeOrValue Object::Set(napi_value key, + const ValueType& value) const { + napi_status status = + napi_set_property(_env, _value, key, Value::From(_env, value)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +template +inline MaybeOrValue Object::Set(Value key, const ValueType& value) const { + napi_status status = + napi_set_property(_env, _value, key, Value::From(_env, value)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +template +inline MaybeOrValue Object::Set(const char* utf8name, + const ValueType& value) const { + napi_status status = + napi_set_named_property(_env, _value, utf8name, Value::From(_env, value)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +template +inline MaybeOrValue Object::Set(const std::string& utf8name, + const ValueType& value) const { + return Set(utf8name.c_str(), value); +} + +inline MaybeOrValue Object::Delete(napi_value key) const { + bool result; + napi_status status = napi_delete_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Delete(Value key) const { + bool result; + napi_status status = napi_delete_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Delete(const char* utf8name) const { + return Delete(String::New(_env, utf8name)); +} + +inline MaybeOrValue Object::Delete(const std::string& utf8name) const { + return Delete(String::New(_env, utf8name)); +} + +inline MaybeOrValue Object::Has(uint32_t index) const { + bool result; + napi_status status = napi_has_element(_env, _value, index, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Get(uint32_t index) const { + napi_value value; + napi_status status = napi_get_element(_env, _value, index, &value); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, value), Value); +} + +template +inline MaybeOrValue Object::Set(uint32_t index, + const ValueType& value) const { + napi_status status = + napi_set_element(_env, _value, index, Value::From(_env, value)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::Delete(uint32_t index) const { + bool result; + napi_status status = napi_delete_element(_env, _value, index, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::GetPropertyNames() const { + napi_value result; + napi_status status = napi_get_property_names(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Array(_env, result), Array); +} + +inline MaybeOrValue Object::DefineProperty( + const PropertyDescriptor& property) const { + napi_status status = napi_define_properties( + _env, + _value, + 1, + reinterpret_cast(&property)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::DefineProperties( + const std::initializer_list& properties) const { + napi_status status = napi_define_properties( + _env, + _value, + properties.size(), + reinterpret_cast(properties.begin())); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::DefineProperties( + const std::vector& properties) const { + napi_status status = napi_define_properties( + _env, + _value, + properties.size(), + reinterpret_cast(properties.data())); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::InstanceOf( + const Function& constructor) const { + bool result; + napi_status status = napi_instanceof(_env, _value, constructor, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +template +inline void Object::AddFinalizer(Finalizer finalizeCallback, T* data) const { + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); + napi_status status = + details::AttachData(_env, + *this, + data, + details::FinalizeData::Wrapper, + finalizeData); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +template +inline void Object::AddFinalizer(Finalizer finalizeCallback, + T* data, + Hint* finalizeHint) const { + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); + napi_status status = details::AttachData( + _env, + *this, + data, + details::FinalizeData::WrapperWithHint, + finalizeData); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +#ifdef NAPI_CPP_EXCEPTIONS +inline Object::const_iterator::const_iterator(const Object* object, + const Type type) { + _object = object; + _keys = object->GetPropertyNames(); + _index = type == Type::BEGIN ? 0 : _keys.Length(); +} + +inline Object::const_iterator Napi::Object::begin() const { + const_iterator it(this, Object::const_iterator::Type::BEGIN); + return it; +} + +inline Object::const_iterator Napi::Object::end() const { + const_iterator it(this, Object::const_iterator::Type::END); + return it; +} + +inline Object::const_iterator& Object::const_iterator::operator++() { + ++_index; + return *this; +} + +inline bool Object::const_iterator::operator==( + const const_iterator& other) const { + return _index == other._index; +} + +inline bool Object::const_iterator::operator!=( + const const_iterator& other) const { + return _index != other._index; +} + +inline const std::pair> +Object::const_iterator::operator*() const { + const Value key = _keys[_index]; + const PropertyLValue value = (*_object)[key]; + return {key, value}; +} + +inline Object::iterator::iterator(Object* object, const Type type) { + _object = object; + _keys = object->GetPropertyNames(); + _index = type == Type::BEGIN ? 0 : _keys.Length(); +} + +inline Object::iterator Napi::Object::begin() { + iterator it(this, Object::iterator::Type::BEGIN); + return it; +} + +inline Object::iterator Napi::Object::end() { + iterator it(this, Object::iterator::Type::END); + return it; +} + +inline Object::iterator& Object::iterator::operator++() { + ++_index; + return *this; +} + +inline bool Object::iterator::operator==(const iterator& other) const { + return _index == other._index; +} + +inline bool Object::iterator::operator!=(const iterator& other) const { + return _index != other._index; +} + +inline std::pair> +Object::iterator::operator*() { + Value key = _keys[_index]; + PropertyLValue value = (*_object)[key]; + return {key, value}; +} +#endif // NAPI_CPP_EXCEPTIONS + +#if NAPI_VERSION >= 8 +inline MaybeOrValue Object::Freeze() const { + napi_status status = napi_object_freeze(_env, _value); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::Seal() const { + napi_status status = napi_object_seal(_env, _value); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} +#endif // NAPI_VERSION >= 8 + +//////////////////////////////////////////////////////////////////////////////// +// External class +//////////////////////////////////////////////////////////////////////////////// + +template +inline External External::New(napi_env env, T* data) { + napi_value value; + napi_status status = + napi_create_external(env, data, nullptr, nullptr, &value); + NAPI_THROW_IF_FAILED(env, status, External()); + return External(env, value); +} + +template +template +inline External External::New(napi_env env, + T* data, + Finalizer finalizeCallback) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); + napi_status status = + napi_create_external(env, + data, + details::FinalizeData::Wrapper, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, External()); + } + return External(env, value); +} + +template +template +inline External External::New(napi_env env, + T* data, + Finalizer finalizeCallback, + Hint* finalizeHint) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); + napi_status status = napi_create_external( + env, + data, + details::FinalizeData::WrapperWithHint, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, External()); + } + return External(env, value); +} + +template +inline External::External() : Value() {} + +template +inline External::External(napi_env env, napi_value value) + : Value(env, value) {} + +template +inline T* External::Data() const { + void* data; + napi_status status = napi_get_value_external(_env, _value, &data); + NAPI_THROW_IF_FAILED(_env, status, nullptr); + return reinterpret_cast(data); +} + +//////////////////////////////////////////////////////////////////////////////// +// Array class +//////////////////////////////////////////////////////////////////////////////// + +inline Array Array::New(napi_env env) { + napi_value value; + napi_status status = napi_create_array(env, &value); + NAPI_THROW_IF_FAILED(env, status, Array()); + return Array(env, value); +} + +inline Array Array::New(napi_env env, size_t length) { + napi_value value; + napi_status status = napi_create_array_with_length(env, length, &value); + NAPI_THROW_IF_FAILED(env, status, Array()); + return Array(env, value); +} + +inline Array::Array() : Object() {} + +inline Array::Array(napi_env env, napi_value value) : Object(env, value) {} + +inline uint32_t Array::Length() const { + uint32_t result; + napi_status status = napi_get_array_length(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +//////////////////////////////////////////////////////////////////////////////// +// ArrayBuffer class +//////////////////////////////////////////////////////////////////////////////// + +inline ArrayBuffer ArrayBuffer::New(napi_env env, size_t byteLength) { + napi_value value; + void* data; + napi_status status = napi_create_arraybuffer(env, byteLength, &data, &value); + NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); + + return ArrayBuffer(env, value); +} + +inline ArrayBuffer ArrayBuffer::New(napi_env env, + void* externalData, + size_t byteLength) { + napi_value value; + napi_status status = napi_create_external_arraybuffer( + env, externalData, byteLength, nullptr, nullptr, &value); + NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); + + return ArrayBuffer(env, value); +} + +template +inline ArrayBuffer ArrayBuffer::New(napi_env env, + void* externalData, + size_t byteLength, + Finalizer finalizeCallback) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); + napi_status status = napi_create_external_arraybuffer( + env, + externalData, + byteLength, + details::FinalizeData::Wrapper, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); + } + + return ArrayBuffer(env, value); +} + +template +inline ArrayBuffer ArrayBuffer::New(napi_env env, + void* externalData, + size_t byteLength, + Finalizer finalizeCallback, + Hint* finalizeHint) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); + napi_status status = napi_create_external_arraybuffer( + env, + externalData, + byteLength, + details::FinalizeData::WrapperWithHint, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); + } + + return ArrayBuffer(env, value); +} + +inline ArrayBuffer::ArrayBuffer() : Object() {} + +inline ArrayBuffer::ArrayBuffer(napi_env env, napi_value value) + : Object(env, value) {} + +inline void* ArrayBuffer::Data() { + void* data; + napi_status status = napi_get_arraybuffer_info(_env, _value, &data, nullptr); + NAPI_THROW_IF_FAILED(_env, status, nullptr); + return data; +} + +inline size_t ArrayBuffer::ByteLength() { + size_t length; + napi_status status = + napi_get_arraybuffer_info(_env, _value, nullptr, &length); + NAPI_THROW_IF_FAILED(_env, status, 0); + return length; +} + +#if NAPI_VERSION >= 7 +inline bool ArrayBuffer::IsDetached() const { + bool detached; + napi_status status = napi_is_detached_arraybuffer(_env, _value, &detached); + NAPI_THROW_IF_FAILED(_env, status, false); + return detached; +} + +inline void ArrayBuffer::Detach() { + napi_status status = napi_detach_arraybuffer(_env, _value); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} +#endif // NAPI_VERSION >= 7 + +//////////////////////////////////////////////////////////////////////////////// +// DataView class +//////////////////////////////////////////////////////////////////////////////// +inline DataView DataView::New(napi_env env, Napi::ArrayBuffer arrayBuffer) { + return New(env, arrayBuffer, 0, arrayBuffer.ByteLength()); +} + +inline DataView DataView::New(napi_env env, + Napi::ArrayBuffer arrayBuffer, + size_t byteOffset) { + if (byteOffset > arrayBuffer.ByteLength()) { + NAPI_THROW(RangeError::New( + env, "Start offset is outside the bounds of the buffer"), + DataView()); + } + return New( + env, arrayBuffer, byteOffset, arrayBuffer.ByteLength() - byteOffset); +} + +inline DataView DataView::New(napi_env env, + Napi::ArrayBuffer arrayBuffer, + size_t byteOffset, + size_t byteLength) { + if (byteOffset + byteLength > arrayBuffer.ByteLength()) { + NAPI_THROW(RangeError::New(env, "Invalid DataView length"), DataView()); + } + napi_value value; + napi_status status = + napi_create_dataview(env, byteLength, arrayBuffer, byteOffset, &value); + NAPI_THROW_IF_FAILED(env, status, DataView()); + return DataView(env, value); +} + +inline DataView::DataView() : Object() {} + +inline DataView::DataView(napi_env env, napi_value value) : Object(env, value) { + napi_status status = napi_get_dataview_info(_env, + _value /* dataView */, + &_length /* byteLength */, + &_data /* data */, + nullptr /* arrayBuffer */, + nullptr /* byteOffset */); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline Napi::ArrayBuffer DataView::ArrayBuffer() const { + napi_value arrayBuffer; + napi_status status = napi_get_dataview_info(_env, + _value /* dataView */, + nullptr /* byteLength */, + nullptr /* data */, + &arrayBuffer /* arrayBuffer */, + nullptr /* byteOffset */); + NAPI_THROW_IF_FAILED(_env, status, Napi::ArrayBuffer()); + return Napi::ArrayBuffer(_env, arrayBuffer); +} + +inline size_t DataView::ByteOffset() const { + size_t byteOffset; + napi_status status = napi_get_dataview_info(_env, + _value /* dataView */, + nullptr /* byteLength */, + nullptr /* data */, + nullptr /* arrayBuffer */, + &byteOffset /* byteOffset */); + NAPI_THROW_IF_FAILED(_env, status, 0); + return byteOffset; +} + +inline size_t DataView::ByteLength() const { + return _length; +} + +inline void* DataView::Data() const { + return _data; +} + +inline float DataView::GetFloat32(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline double DataView::GetFloat64(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline int8_t DataView::GetInt8(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline int16_t DataView::GetInt16(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline int32_t DataView::GetInt32(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline uint8_t DataView::GetUint8(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline uint16_t DataView::GetUint16(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline uint32_t DataView::GetUint32(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline void DataView::SetFloat32(size_t byteOffset, float value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetFloat64(size_t byteOffset, double value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetInt8(size_t byteOffset, int8_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetInt16(size_t byteOffset, int16_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetInt32(size_t byteOffset, int32_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetUint8(size_t byteOffset, uint8_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetUint16(size_t byteOffset, uint16_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetUint32(size_t byteOffset, uint32_t value) const { + WriteData(byteOffset, value); +} + +template +inline T DataView::ReadData(size_t byteOffset) const { + if (byteOffset + sizeof(T) > _length || + byteOffset + sizeof(T) < byteOffset) { // overflow + NAPI_THROW( + RangeError::New(_env, "Offset is outside the bounds of the DataView"), + 0); + } + + return *reinterpret_cast(static_cast(_data) + byteOffset); +} + +template +inline void DataView::WriteData(size_t byteOffset, T value) const { + if (byteOffset + sizeof(T) > _length || + byteOffset + sizeof(T) < byteOffset) { // overflow + NAPI_THROW_VOID( + RangeError::New(_env, "Offset is outside the bounds of the DataView")); + } + + *reinterpret_cast(static_cast(_data) + byteOffset) = value; +} + +//////////////////////////////////////////////////////////////////////////////// +// TypedArray class +//////////////////////////////////////////////////////////////////////////////// + +inline TypedArray::TypedArray() + : Object(), _type(napi_typedarray_type::napi_int8_array), _length(0) {} + +inline TypedArray::TypedArray(napi_env env, napi_value value) + : Object(env, value), + _type(napi_typedarray_type::napi_int8_array), + _length(0) { + if (value != nullptr) { + napi_status status = + napi_get_typedarray_info(_env, + _value, + &const_cast(this)->_type, + &const_cast(this)->_length, + nullptr, + nullptr, + nullptr); + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +inline TypedArray::TypedArray(napi_env env, + napi_value value, + napi_typedarray_type type, + size_t length) + : Object(env, value), _type(type), _length(length) {} + +inline napi_typedarray_type TypedArray::TypedArrayType() const { + return _type; +} + +inline uint8_t TypedArray::ElementSize() const { + switch (_type) { + case napi_int8_array: + case napi_uint8_array: + case napi_uint8_clamped_array: + return 1; + case napi_int16_array: + case napi_uint16_array: + return 2; + case napi_int32_array: + case napi_uint32_array: + case napi_float32_array: + return 4; + case napi_float64_array: +#if (NAPI_VERSION > 5) + case napi_bigint64_array: + case napi_biguint64_array: +#endif // (NAPI_VERSION > 5) + return 8; + default: + return 0; + } +} + +inline size_t TypedArray::ElementLength() const { + return _length; +} + +inline size_t TypedArray::ByteOffset() const { + size_t byteOffset; + napi_status status = napi_get_typedarray_info( + _env, _value, nullptr, nullptr, nullptr, nullptr, &byteOffset); + NAPI_THROW_IF_FAILED(_env, status, 0); + return byteOffset; +} + +inline size_t TypedArray::ByteLength() const { + return ElementSize() * ElementLength(); +} + +inline Napi::ArrayBuffer TypedArray::ArrayBuffer() const { + napi_value arrayBuffer; + napi_status status = napi_get_typedarray_info( + _env, _value, nullptr, nullptr, nullptr, &arrayBuffer, nullptr); + NAPI_THROW_IF_FAILED(_env, status, Napi::ArrayBuffer()); + return Napi::ArrayBuffer(_env, arrayBuffer); +} + +//////////////////////////////////////////////////////////////////////////////// +// TypedArrayOf class +//////////////////////////////////////////////////////////////////////////////// + +template +inline TypedArrayOf TypedArrayOf::New(napi_env env, + size_t elementLength, + napi_typedarray_type type) { + Napi::ArrayBuffer arrayBuffer = + Napi::ArrayBuffer::New(env, elementLength * sizeof(T)); + return New(env, elementLength, arrayBuffer, 0, type); +} + +template +inline TypedArrayOf TypedArrayOf::New(napi_env env, + size_t elementLength, + Napi::ArrayBuffer arrayBuffer, + size_t bufferOffset, + napi_typedarray_type type) { + napi_value value; + napi_status status = napi_create_typedarray( + env, type, elementLength, arrayBuffer, bufferOffset, &value); + NAPI_THROW_IF_FAILED(env, status, TypedArrayOf()); + + return TypedArrayOf( + env, + value, + type, + elementLength, + reinterpret_cast(reinterpret_cast(arrayBuffer.Data()) + + bufferOffset)); +} + +template +inline TypedArrayOf::TypedArrayOf() : TypedArray(), _data(nullptr) {} + +template +inline TypedArrayOf::TypedArrayOf(napi_env env, napi_value value) + : TypedArray(env, value), _data(nullptr) { + napi_status status = napi_ok; + if (value != nullptr) { + void* data = nullptr; + status = napi_get_typedarray_info( + _env, _value, &_type, &_length, &data, nullptr, nullptr); + _data = static_cast(data); + } else { + _type = TypedArrayTypeForPrimitiveType(); + _length = 0; + } + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +template +inline TypedArrayOf::TypedArrayOf(napi_env env, + napi_value value, + napi_typedarray_type type, + size_t length, + T* data) + : TypedArray(env, value, type, length), _data(data) { + if (!(type == TypedArrayTypeForPrimitiveType() || + (type == napi_uint8_clamped_array && + std::is_same::value))) { + NAPI_THROW_VOID(TypeError::New( + env, + "Array type must match the template parameter. " + "(Uint8 arrays may optionally have the \"clamped\" array type.)")); + } +} + +template +inline T& TypedArrayOf::operator[](size_t index) { + return _data[index]; +} + +template +inline const T& TypedArrayOf::operator[](size_t index) const { + return _data[index]; +} + +template +inline T* TypedArrayOf::Data() { + return _data; +} + +template +inline const T* TypedArrayOf::Data() const { + return _data; +} + +//////////////////////////////////////////////////////////////////////////////// +// Function class +//////////////////////////////////////////////////////////////////////////////// + +template +inline napi_status CreateFunction(napi_env env, + const char* utf8name, + napi_callback cb, + CbData* data, + napi_value* result) { + napi_status status = + napi_create_function(env, utf8name, NAPI_AUTO_LENGTH, cb, data, result); + if (status == napi_ok) { + status = Napi::details::AttachData(env, *result, data); + } + + return status; +} + +template +inline Function Function::New(napi_env env, const char* utf8name, void* data) { + napi_value result = nullptr; + napi_status status = napi_create_function(env, + utf8name, + NAPI_AUTO_LENGTH, + details::TemplatedVoidCallback, + data, + &result); + NAPI_THROW_IF_FAILED(env, status, Function()); + return Function(env, result); +} + +template +inline Function Function::New(napi_env env, const char* utf8name, void* data) { + napi_value result = nullptr; + napi_status status = napi_create_function(env, + utf8name, + NAPI_AUTO_LENGTH, + details::TemplatedCallback, + data, + &result); + NAPI_THROW_IF_FAILED(env, status, Function()); + return Function(env, result); +} + +template +inline Function Function::New(napi_env env, + const std::string& utf8name, + void* data) { + return Function::New(env, utf8name.c_str(), data); +} + +template +inline Function Function::New(napi_env env, + const std::string& utf8name, + void* data) { + return Function::New(env, utf8name.c_str(), data); +} + +template +inline Function Function::New(napi_env env, + Callable cb, + const char* utf8name, + void* data) { + using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); + using CbData = details::CallbackData; + auto callbackData = new CbData{std::move(cb), data}; + + napi_value value; + napi_status status = + CreateFunction(env, utf8name, CbData::Wrapper, callbackData, &value); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, Function()); + } + + return Function(env, value); +} + +template +inline Function Function::New(napi_env env, + Callable cb, + const std::string& utf8name, + void* data) { + return New(env, cb, utf8name.c_str(), data); +} + +inline Function::Function() : Object() {} + +inline Function::Function(napi_env env, napi_value value) + : Object(env, value) {} + +inline MaybeOrValue Function::operator()( + const std::initializer_list& args) const { + return Call(Env().Undefined(), args); +} + +inline MaybeOrValue Function::Call( + const std::initializer_list& args) const { + return Call(Env().Undefined(), args); +} + +inline MaybeOrValue Function::Call( + const std::vector& args) const { + return Call(Env().Undefined(), args); +} + +inline MaybeOrValue Function::Call( + const std::vector& args) const { + return Call(Env().Undefined(), args); +} + +inline MaybeOrValue Function::Call(size_t argc, + const napi_value* args) const { + return Call(Env().Undefined(), argc, args); +} + +inline MaybeOrValue Function::Call( + napi_value recv, const std::initializer_list& args) const { + return Call(recv, args.size(), args.begin()); +} + +inline MaybeOrValue Function::Call( + napi_value recv, const std::vector& args) const { + return Call(recv, args.size(), args.data()); +} + +inline MaybeOrValue Function::Call( + napi_value recv, const std::vector& args) const { + const size_t argc = args.size(); + const size_t stackArgsCount = 6; + napi_value stackArgs[stackArgsCount]; + std::vector heapArgs; + napi_value* argv; + if (argc <= stackArgsCount) { + argv = stackArgs; + } else { + heapArgs.resize(argc); + argv = heapArgs.data(); + } + + for (size_t index = 0; index < argc; index++) { + argv[index] = static_cast(args[index]); + } + + return Call(recv, argc, argv); +} + +inline MaybeOrValue Function::Call(napi_value recv, + size_t argc, + const napi_value* args) const { + napi_value result; + napi_status status = + napi_call_function(_env, recv, _value, argc, args, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Value(_env, result), Napi::Value); +} + +inline MaybeOrValue Function::MakeCallback( + napi_value recv, + const std::initializer_list& args, + napi_async_context context) const { + return MakeCallback(recv, args.size(), args.begin(), context); +} + +inline MaybeOrValue Function::MakeCallback( + napi_value recv, + const std::vector& args, + napi_async_context context) const { + return MakeCallback(recv, args.size(), args.data(), context); +} + +inline MaybeOrValue Function::MakeCallback( + napi_value recv, + size_t argc, + const napi_value* args, + napi_async_context context) const { + napi_value result; + napi_status status = + napi_make_callback(_env, context, recv, _value, argc, args, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Value(_env, result), Napi::Value); +} + +inline MaybeOrValue Function::New( + const std::initializer_list& args) const { + return New(args.size(), args.begin()); +} + +inline MaybeOrValue Function::New( + const std::vector& args) const { + return New(args.size(), args.data()); +} + +inline MaybeOrValue Function::New(size_t argc, + const napi_value* args) const { + napi_value result; + napi_status status = napi_new_instance(_env, _value, argc, args, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Object(_env, result), Napi::Object); +} + +//////////////////////////////////////////////////////////////////////////////// +// Promise class +//////////////////////////////////////////////////////////////////////////////// + +inline Promise::Deferred Promise::Deferred::New(napi_env env) { + return Promise::Deferred(env); +} + +inline Promise::Deferred::Deferred(napi_env env) : _env(env) { + napi_status status = napi_create_promise(_env, &_deferred, &_promise); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline Promise Promise::Deferred::Promise() const { + return Napi::Promise(_env, _promise); +} + +inline Napi::Env Promise::Deferred::Env() const { + return Napi::Env(_env); +} + +inline void Promise::Deferred::Resolve(napi_value value) const { + napi_status status = napi_resolve_deferred(_env, _deferred, value); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline void Promise::Deferred::Reject(napi_value value) const { + napi_status status = napi_reject_deferred(_env, _deferred, value); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline Promise::Promise(napi_env env, napi_value value) : Object(env, value) {} + +//////////////////////////////////////////////////////////////////////////////// +// Buffer class +//////////////////////////////////////////////////////////////////////////////// + +template +inline Buffer Buffer::New(napi_env env, size_t length) { + napi_value value; + void* data; + napi_status status = + napi_create_buffer(env, length * sizeof(T), &data, &value); + NAPI_THROW_IF_FAILED(env, status, Buffer()); + return Buffer(env, value, length, static_cast(data)); +} + +template +inline Buffer Buffer::New(napi_env env, T* data, size_t length) { + napi_value value; + napi_status status = napi_create_external_buffer( + env, length * sizeof(T), data, nullptr, nullptr, &value); + NAPI_THROW_IF_FAILED(env, status, Buffer()); + return Buffer(env, value, length, data); +} + +template +template +inline Buffer Buffer::New(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); + napi_status status = + napi_create_external_buffer(env, + length * sizeof(T), + data, + details::FinalizeData::Wrapper, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, Buffer()); + } + return Buffer(env, value, length, data); +} + +template +template +inline Buffer Buffer::New(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback, + Hint* finalizeHint) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); + napi_status status = napi_create_external_buffer( + env, + length * sizeof(T), + data, + details::FinalizeData::WrapperWithHint, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, Buffer()); + } + return Buffer(env, value, length, data); +} + +template +inline Buffer Buffer::Copy(napi_env env, const T* data, size_t length) { + napi_value value; + napi_status status = + napi_create_buffer_copy(env, length * sizeof(T), data, nullptr, &value); + NAPI_THROW_IF_FAILED(env, status, Buffer()); + return Buffer(env, value); +} + +template +inline Buffer::Buffer() : Uint8Array(), _length(0), _data(nullptr) {} + +template +inline Buffer::Buffer(napi_env env, napi_value value) + : Uint8Array(env, value), _length(0), _data(nullptr) {} + +template +inline Buffer::Buffer(napi_env env, napi_value value, size_t length, T* data) + : Uint8Array(env, value), _length(length), _data(data) {} + +template +inline size_t Buffer::Length() const { + EnsureInfo(); + return _length; +} + +template +inline T* Buffer::Data() const { + EnsureInfo(); + return _data; +} + +template +inline void Buffer::EnsureInfo() const { + // The Buffer instance may have been constructed from a napi_value whose + // length/data are not yet known. Fetch and cache these values just once, + // since they can never change during the lifetime of the Buffer. + if (_data == nullptr) { + size_t byteLength; + void* voidData; + napi_status status = + napi_get_buffer_info(_env, _value, &voidData, &byteLength); + NAPI_THROW_IF_FAILED_VOID(_env, status); + _length = byteLength / sizeof(T); + _data = static_cast(voidData); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Error class +//////////////////////////////////////////////////////////////////////////////// + +inline Error Error::New(napi_env env) { + napi_status status; + napi_value error = nullptr; + bool is_exception_pending; + napi_extended_error_info last_error_info_copy; + + { + // We must retrieve the last error info before doing anything else because + // doing anything else will replace the last error info. + const napi_extended_error_info* last_error_info; + status = napi_get_last_error_info(env, &last_error_info); + NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_get_last_error_info"); + + // All fields of the `napi_extended_error_info` structure gets reset in + // subsequent Node-API function calls on the same `env`. This includes a + // call to `napi_is_exception_pending()`. So here it is necessary to make a + // copy of the information as the `error_code` field is used later on. + memcpy(&last_error_info_copy, + last_error_info, + sizeof(napi_extended_error_info)); + } + + status = napi_is_exception_pending(env, &is_exception_pending); + NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_is_exception_pending"); + + // A pending exception takes precedence over any internal error status. + if (is_exception_pending) { + status = napi_get_and_clear_last_exception(env, &error); + NAPI_FATAL_IF_FAILED( + status, "Error::New", "napi_get_and_clear_last_exception"); + } else { + const char* error_message = last_error_info_copy.error_message != nullptr + ? last_error_info_copy.error_message + : "Error in native callback"; + + napi_value message; + status = napi_create_string_utf8( + env, error_message, std::strlen(error_message), &message); + NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_create_string_utf8"); + + switch (last_error_info_copy.error_code) { + case napi_object_expected: + case napi_string_expected: + case napi_boolean_expected: + case napi_number_expected: + status = napi_create_type_error(env, nullptr, message, &error); + break; + default: + status = napi_create_error(env, nullptr, message, &error); + break; + } + NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_create_error"); + } + + return Error(env, error); +} + +inline Error Error::New(napi_env env, const char* message) { + return Error::New( + env, message, std::strlen(message), napi_create_error); +} + +inline Error Error::New(napi_env env, const std::string& message) { + return Error::New( + env, message.c_str(), message.size(), napi_create_error); +} + +inline NAPI_NO_RETURN void Error::Fatal(const char* location, + const char* message) { + napi_fatal_error(location, NAPI_AUTO_LENGTH, message, NAPI_AUTO_LENGTH); +} + +inline Error::Error() : ObjectReference() {} + +inline Error::Error(napi_env env, napi_value value) + : ObjectReference(env, nullptr) { + if (value != nullptr) { + // Attempting to create a reference on the error object. + // If it's not a Object/Function/Symbol, this call will return an error + // status. + napi_status status = napi_create_reference(env, value, 1, &_ref); + + if (status != napi_ok) { + napi_value wrappedErrorObj; + + // Create an error object + status = napi_create_object(env, &wrappedErrorObj); + NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_create_object"); + + // property flag that we attach to show the error object is wrapped + napi_property_descriptor wrapObjFlag = { + ERROR_WRAP_VALUE(), // Unique GUID identifier since Symbol isn't a + // viable option + nullptr, + nullptr, + nullptr, + nullptr, + Value::From(env, value), + napi_enumerable, + nullptr}; + + status = napi_define_properties(env, wrappedErrorObj, 1, &wrapObjFlag); + NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_define_properties"); + + // Create a reference on the newly wrapped object + status = napi_create_reference(env, wrappedErrorObj, 1, &_ref); + } + + // Avoid infinite recursion in the failure case. + NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_create_reference"); + } +} + +inline Object Error::Value() const { + if (_ref == nullptr) { + return Object(_env, nullptr); + } + + napi_value refValue; + napi_status status = napi_get_reference_value(_env, _ref, &refValue); + NAPI_THROW_IF_FAILED(_env, status, Object()); + + napi_valuetype type; + status = napi_typeof(_env, refValue, &type); + NAPI_THROW_IF_FAILED(_env, status, Object()); + + // If refValue isn't a symbol, then we proceed to whether the refValue has the + // wrapped error flag + if (type != napi_symbol) { + // We are checking if the object is wrapped + bool isWrappedObject = false; + + status = napi_has_property(_env, + refValue, + String::From(_env, ERROR_WRAP_VALUE()), + &isWrappedObject); + + // Don't care about status + if (isWrappedObject) { + napi_value unwrappedValue; + status = napi_get_property(_env, + refValue, + String::From(_env, ERROR_WRAP_VALUE()), + &unwrappedValue); + NAPI_THROW_IF_FAILED(_env, status, Object()); + + return Object(_env, unwrappedValue); + } + } + + return Object(_env, refValue); +} + +inline Error::Error(Error&& other) : ObjectReference(std::move(other)) {} + +inline Error& Error::operator=(Error&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline Error::Error(const Error& other) : ObjectReference(other) {} + +inline Error& Error::operator=(const Error& other) { + Reset(); + + _env = other.Env(); + HandleScope scope(_env); + + napi_value value = other.Value(); + if (value != nullptr) { + napi_status status = napi_create_reference(_env, value, 1, &_ref); + NAPI_THROW_IF_FAILED(_env, status, *this); + } + + return *this; +} + +inline const std::string& Error::Message() const NAPI_NOEXCEPT { + if (_message.size() == 0 && _env != nullptr) { +#ifdef NAPI_CPP_EXCEPTIONS + try { + _message = Get("message").As(); + } catch (...) { + // Catch all errors here, to include e.g. a std::bad_alloc from + // the std::string::operator=, because this method may not throw. + } +#else // NAPI_CPP_EXCEPTIONS +#if defined(NODE_ADDON_API_ENABLE_MAYBE) + Napi::Value message_val; + if (Get("message").UnwrapTo(&message_val)) { + _message = message_val.As(); + } +#else + _message = Get("message").As(); +#endif +#endif // NAPI_CPP_EXCEPTIONS + } + return _message; +} + +// we created an object on the &_ref +inline void Error::ThrowAsJavaScriptException() const { + HandleScope scope(_env); + if (!IsEmpty()) { +#ifdef NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS + bool pendingException = false; + + // check if there is already a pending exception. If so don't try to throw a + // new one as that is not allowed/possible + napi_status status = napi_is_exception_pending(_env, &pendingException); + + if ((status != napi_ok) || + ((status == napi_ok) && (pendingException == false))) { + // We intentionally don't use `NAPI_THROW_*` macros here to ensure + // that there is no possible recursion as `ThrowAsJavaScriptException` + // is part of `NAPI_THROW_*` macro definition for noexcept. + + status = napi_throw(_env, Value()); + + if (status == napi_pending_exception) { + // The environment must be terminating as we checked earlier and there + // was no pending exception. In this case continuing will result + // in a fatal error and there is nothing the author has done incorrectly + // in their code that is worth flagging through a fatal error + return; + } + } else { + status = napi_pending_exception; + } +#else + // We intentionally don't use `NAPI_THROW_*` macros here to ensure + // that there is no possible recursion as `ThrowAsJavaScriptException` + // is part of `NAPI_THROW_*` macro definition for noexcept. + + napi_status status = napi_throw(_env, Value()); +#endif + +#ifdef NAPI_CPP_EXCEPTIONS + if (status != napi_ok) { + throw Error::New(_env); + } +#else // NAPI_CPP_EXCEPTIONS + NAPI_FATAL_IF_FAILED( + status, "Error::ThrowAsJavaScriptException", "napi_throw"); +#endif // NAPI_CPP_EXCEPTIONS + } +} + +#ifdef NAPI_CPP_EXCEPTIONS + +inline const char* Error::what() const NAPI_NOEXCEPT { + return Message().c_str(); +} + +#endif // NAPI_CPP_EXCEPTIONS + +inline const char* Error::ERROR_WRAP_VALUE() NAPI_NOEXCEPT { + return "4bda9e7e-4913-4dbc-95de-891cbf66598e-errorVal"; +} + +template +inline TError Error::New(napi_env env, + const char* message, + size_t length, + create_error_fn create_error) { + napi_value str; + napi_status status = napi_create_string_utf8(env, message, length, &str); + NAPI_THROW_IF_FAILED(env, status, TError()); + + napi_value error; + status = create_error(env, nullptr, str, &error); + NAPI_THROW_IF_FAILED(env, status, TError()); + + return TError(env, error); +} + +inline TypeError TypeError::New(napi_env env, const char* message) { + return Error::New( + env, message, std::strlen(message), napi_create_type_error); +} + +inline TypeError TypeError::New(napi_env env, const std::string& message) { + return Error::New( + env, message.c_str(), message.size(), napi_create_type_error); +} + +inline TypeError::TypeError() : Error() {} + +inline TypeError::TypeError(napi_env env, napi_value value) + : Error(env, value) {} + +inline RangeError RangeError::New(napi_env env, const char* message) { + return Error::New( + env, message, std::strlen(message), napi_create_range_error); +} + +inline RangeError RangeError::New(napi_env env, const std::string& message) { + return Error::New( + env, message.c_str(), message.size(), napi_create_range_error); +} + +inline RangeError::RangeError() : Error() {} + +inline RangeError::RangeError(napi_env env, napi_value value) + : Error(env, value) {} + +//////////////////////////////////////////////////////////////////////////////// +// Reference class +//////////////////////////////////////////////////////////////////////////////// + +template +inline Reference Reference::New(const T& value, + uint32_t initialRefcount) { + napi_env env = value.Env(); + napi_value val = value; + + if (val == nullptr) { + return Reference(env, nullptr); + } + + napi_ref ref; + napi_status status = napi_create_reference(env, value, initialRefcount, &ref); + NAPI_THROW_IF_FAILED(env, status, Reference()); + + return Reference(env, ref); +} + +template +inline Reference::Reference() + : _env(nullptr), _ref(nullptr), _suppressDestruct(false) {} + +template +inline Reference::Reference(napi_env env, napi_ref ref) + : _env(env), _ref(ref), _suppressDestruct(false) {} + +template +inline Reference::~Reference() { + if (_ref != nullptr) { + if (!_suppressDestruct) { + napi_delete_reference(_env, _ref); + } + + _ref = nullptr; + } +} + +template +inline Reference::Reference(Reference&& other) + : _env(other._env), + _ref(other._ref), + _suppressDestruct(other._suppressDestruct) { + other._env = nullptr; + other._ref = nullptr; + other._suppressDestruct = false; +} + +template +inline Reference& Reference::operator=(Reference&& other) { + Reset(); + _env = other._env; + _ref = other._ref; + _suppressDestruct = other._suppressDestruct; + other._env = nullptr; + other._ref = nullptr; + other._suppressDestruct = false; + return *this; +} + +template +inline Reference::Reference(const Reference& other) + : _env(other._env), _ref(nullptr), _suppressDestruct(false) { + HandleScope scope(_env); + + napi_value value = other.Value(); + if (value != nullptr) { + // Copying is a limited scenario (currently only used for Error object) and + // always creates a strong reference to the given value even if the incoming + // reference is weak. + napi_status status = napi_create_reference(_env, value, 1, &_ref); + NAPI_FATAL_IF_FAILED( + status, "Reference::Reference", "napi_create_reference"); + } +} + +template +inline Reference::operator napi_ref() const { + return _ref; +} + +template +inline bool Reference::operator==(const Reference& other) const { + HandleScope scope(_env); + return this->Value().StrictEquals(other.Value()); +} + +template +inline bool Reference::operator!=(const Reference& other) const { + return !this->operator==(other); +} + +template +inline Napi::Env Reference::Env() const { + return Napi::Env(_env); +} + +template +inline bool Reference::IsEmpty() const { + return _ref == nullptr; +} + +template +inline T Reference::Value() const { + if (_ref == nullptr) { + return T(_env, nullptr); + } + + napi_value value; + napi_status status = napi_get_reference_value(_env, _ref, &value); + NAPI_THROW_IF_FAILED(_env, status, T()); + return T(_env, value); +} + +template +inline uint32_t Reference::Ref() const { + uint32_t result; + napi_status status = napi_reference_ref(_env, _ref, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +template +inline uint32_t Reference::Unref() const { + uint32_t result; + napi_status status = napi_reference_unref(_env, _ref, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +template +inline void Reference::Reset() { + if (_ref != nullptr) { + napi_status status = napi_delete_reference(_env, _ref); + NAPI_THROW_IF_FAILED_VOID(_env, status); + _ref = nullptr; + } +} + +template +inline void Reference::Reset(const T& value, uint32_t refcount) { + Reset(); + _env = value.Env(); + + napi_value val = value; + if (val != nullptr) { + napi_status status = napi_create_reference(_env, value, refcount, &_ref); + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +template +inline void Reference::SuppressDestruct() { + _suppressDestruct = true; +} + +template +inline Reference Weak(T value) { + return Reference::New(value, 0); +} + +inline ObjectReference Weak(Object value) { + return Reference::New(value, 0); +} + +inline FunctionReference Weak(Function value) { + return Reference::New(value, 0); +} + +template +inline Reference Persistent(T value) { + return Reference::New(value, 1); +} + +inline ObjectReference Persistent(Object value) { + return Reference::New(value, 1); +} + +inline FunctionReference Persistent(Function value) { + return Reference::New(value, 1); +} + +//////////////////////////////////////////////////////////////////////////////// +// ObjectReference class +//////////////////////////////////////////////////////////////////////////////// + +inline ObjectReference::ObjectReference() : Reference() {} + +inline ObjectReference::ObjectReference(napi_env env, napi_ref ref) + : Reference(env, ref) {} + +inline ObjectReference::ObjectReference(Reference&& other) + : Reference(std::move(other)) {} + +inline ObjectReference& ObjectReference::operator=(Reference&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline ObjectReference::ObjectReference(ObjectReference&& other) + : Reference(std::move(other)) {} + +inline ObjectReference& ObjectReference::operator=(ObjectReference&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline ObjectReference::ObjectReference(const ObjectReference& other) + : Reference(other) {} + +inline MaybeOrValue ObjectReference::Get( + const char* utf8name) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Get(utf8name); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue ObjectReference::Get( + const std::string& utf8name) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Get(utf8name); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + napi_value value) const { + HandleScope scope(_env); + return Value().Set(utf8name, value); +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + Napi::Value value) const { + HandleScope scope(_env); + return Value().Set(utf8name, value); +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + const char* utf8value) const { + HandleScope scope(_env); + return Value().Set(utf8name, utf8value); +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + bool boolValue) const { + HandleScope scope(_env); + return Value().Set(utf8name, boolValue); +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + double numberValue) const { + HandleScope scope(_env); + return Value().Set(utf8name, numberValue); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + napi_value value) const { + HandleScope scope(_env); + return Value().Set(utf8name, value); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + Napi::Value value) const { + HandleScope scope(_env); + return Value().Set(utf8name, value); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + std::string& utf8value) const { + HandleScope scope(_env); + return Value().Set(utf8name, utf8value); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + bool boolValue) const { + HandleScope scope(_env); + return Value().Set(utf8name, boolValue); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + double numberValue) const { + HandleScope scope(_env); + return Value().Set(utf8name, numberValue); +} + +inline MaybeOrValue ObjectReference::Get(uint32_t index) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Get(index); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + napi_value value) const { + HandleScope scope(_env); + return Value().Set(index, value); +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + Napi::Value value) const { + HandleScope scope(_env); + return Value().Set(index, value); +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + const char* utf8value) const { + HandleScope scope(_env); + return Value().Set(index, utf8value); +} + +inline MaybeOrValue ObjectReference::Set( + uint32_t index, const std::string& utf8value) const { + HandleScope scope(_env); + return Value().Set(index, utf8value); +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + bool boolValue) const { + HandleScope scope(_env); + return Value().Set(index, boolValue); +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + double numberValue) const { + HandleScope scope(_env); + return Value().Set(index, numberValue); +} + +//////////////////////////////////////////////////////////////////////////////// +// FunctionReference class +//////////////////////////////////////////////////////////////////////////////// + +inline FunctionReference::FunctionReference() : Reference() {} + +inline FunctionReference::FunctionReference(napi_env env, napi_ref ref) + : Reference(env, ref) {} + +inline FunctionReference::FunctionReference(Reference&& other) + : Reference(std::move(other)) {} + +inline FunctionReference& FunctionReference::operator=( + Reference&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline FunctionReference::FunctionReference(FunctionReference&& other) + : Reference(std::move(other)) {} + +inline FunctionReference& FunctionReference::operator=( + FunctionReference&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline MaybeOrValue FunctionReference::operator()( + const std::initializer_list& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value()(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + const std::initializer_list& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + const std::vector& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + napi_value recv, const std::initializer_list& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(recv, args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + napi_value recv, const std::vector& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(recv, args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + napi_value recv, size_t argc, const napi_value* args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(recv, argc, args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::MakeCallback( + napi_value recv, + const std::initializer_list& args, + napi_async_context context) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().MakeCallback(recv, args, context); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::MakeCallback( + napi_value recv, + const std::vector& args, + napi_async_context context) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().MakeCallback(recv, args, context); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::MakeCallback( + napi_value recv, + size_t argc, + const napi_value* args, + napi_async_context context) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = + Value().MakeCallback(recv, argc, args, context); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::New( + const std::initializer_list& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().New(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap()).As()); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Object(); + } + return scope.Escape(result).As(); +#endif +} + +inline MaybeOrValue FunctionReference::New( + const std::vector& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().New(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap()).As()); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Object(); + } + return scope.Escape(result).As(); +#endif +} + +//////////////////////////////////////////////////////////////////////////////// +// CallbackInfo class +//////////////////////////////////////////////////////////////////////////////// + +inline CallbackInfo::CallbackInfo(napi_env env, napi_callback_info info) + : _env(env), + _info(info), + _this(nullptr), + _dynamicArgs(nullptr), + _data(nullptr) { + _argc = _staticArgCount; + _argv = _staticArgs; + napi_status status = + napi_get_cb_info(env, info, &_argc, _argv, &_this, &_data); + NAPI_THROW_IF_FAILED_VOID(_env, status); + + if (_argc > _staticArgCount) { + // Use either a fixed-size array (on the stack) or a dynamically-allocated + // array (on the heap) depending on the number of args. + _dynamicArgs = new napi_value[_argc]; + _argv = _dynamicArgs; + + status = napi_get_cb_info(env, info, &_argc, _argv, nullptr, nullptr); + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +inline CallbackInfo::~CallbackInfo() { + if (_dynamicArgs != nullptr) { + delete[] _dynamicArgs; + } +} + +inline CallbackInfo::operator napi_callback_info() const { + return _info; +} + +inline Value CallbackInfo::NewTarget() const { + napi_value newTarget; + napi_status status = napi_get_new_target(_env, _info, &newTarget); + NAPI_THROW_IF_FAILED(_env, status, Value()); + return Value(_env, newTarget); +} + +inline bool CallbackInfo::IsConstructCall() const { + return !NewTarget().IsEmpty(); +} + +inline Napi::Env CallbackInfo::Env() const { + return Napi::Env(_env); +} + +inline size_t CallbackInfo::Length() const { + return _argc; +} + +inline const Value CallbackInfo::operator[](size_t index) const { + return index < _argc ? Value(_env, _argv[index]) : Env().Undefined(); +} + +inline Value CallbackInfo::This() const { + if (_this == nullptr) { + return Env().Undefined(); + } + return Object(_env, _this); +} + +inline void* CallbackInfo::Data() const { + return _data; +} + +inline void CallbackInfo::SetData(void* data) { + _data = data; +} + +//////////////////////////////////////////////////////////////////////////////// +// PropertyDescriptor class +//////////////////////////////////////////////////////////////////////////////// + +template +PropertyDescriptor PropertyDescriptor::Accessor( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + + desc.utf8name = utf8name; + desc.getter = details::TemplatedCallback; + desc.attributes = attributes; + desc.data = data; + + return desc; +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + const std::string& utf8name, + napi_property_attributes attributes, + void* data) { + return Accessor(utf8name.c_str(), attributes, data); +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + Name name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + + desc.name = name; + desc.getter = details::TemplatedCallback; + desc.attributes = attributes; + desc.data = data; + + return desc; +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + + desc.utf8name = utf8name; + desc.getter = details::TemplatedCallback; + desc.setter = details::TemplatedVoidCallback; + desc.attributes = attributes; + desc.data = data; + + return desc; +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + const std::string& utf8name, + napi_property_attributes attributes, + void* data) { + return Accessor(utf8name.c_str(), attributes, data); +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + Name name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + + desc.name = name; + desc.getter = details::TemplatedCallback; + desc.setter = details::TemplatedVoidCallback; + desc.attributes = attributes; + desc.data = data; + + return desc; +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Getter getter, + napi_property_attributes attributes, + void* data) { + using CbData = details::CallbackData; + auto callbackData = new CbData({getter, data}); + + napi_status status = AttachData(env, object, callbackData); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); + } + + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Getter getter, + napi_property_attributes attributes, + void* data) { + return Accessor(env, object, utf8name.c_str(), getter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + Name name, + Getter getter, + napi_property_attributes attributes, + void* data) { + using CbData = details::CallbackData; + auto callbackData = new CbData({getter, data}); + + napi_status status = AttachData(env, object, callbackData); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); + } + + return PropertyDescriptor({nullptr, + name, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + using CbData = details::AccessorCallbackData; + auto callbackData = new CbData({getter, setter, data}); + + napi_status status = AttachData(env, object, callbackData); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); + } + + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + CbData::GetterWrapper, + CbData::SetterWrapper, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + return Accessor( + env, object, utf8name.c_str(), getter, setter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + Name name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + using CbData = details::AccessorCallbackData; + auto callbackData = new CbData({getter, setter, data}); + + napi_status status = AttachData(env, object, callbackData); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); + } + + return PropertyDescriptor({nullptr, + name, + nullptr, + CbData::GetterWrapper, + CbData::SetterWrapper, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + Napi::Env env, + Napi::Object /*object*/, + const char* utf8name, + Callable cb, + napi_property_attributes attributes, + void* data) { + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + nullptr, + nullptr, + Napi::Function::New(env, cb, utf8name, data), + attributes, + nullptr}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Callable cb, + napi_property_attributes attributes, + void* data) { + return Function(env, object, utf8name.c_str(), cb, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + Napi::Env env, + Napi::Object /*object*/, + Name name, + Callable cb, + napi_property_attributes attributes, + void* data) { + return PropertyDescriptor({nullptr, + name, + nullptr, + nullptr, + nullptr, + Napi::Function::New(env, cb, nullptr, data), + attributes, + nullptr}); +} + +inline PropertyDescriptor PropertyDescriptor::Value( + const char* utf8name, + napi_value value, + napi_property_attributes attributes) { + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + nullptr, + nullptr, + value, + attributes, + nullptr}); +} + +inline PropertyDescriptor PropertyDescriptor::Value( + const std::string& utf8name, + napi_value value, + napi_property_attributes attributes) { + return Value(utf8name.c_str(), value, attributes); +} + +inline PropertyDescriptor PropertyDescriptor::Value( + napi_value name, napi_value value, napi_property_attributes attributes) { + return PropertyDescriptor( + {nullptr, name, nullptr, nullptr, nullptr, value, attributes, nullptr}); +} + +inline PropertyDescriptor PropertyDescriptor::Value( + Name name, Napi::Value value, napi_property_attributes attributes) { + napi_value nameValue = name; + napi_value valueValue = value; + return PropertyDescriptor::Value(nameValue, valueValue, attributes); +} + +inline PropertyDescriptor::PropertyDescriptor(napi_property_descriptor desc) + : _desc(desc) {} + +inline PropertyDescriptor::operator napi_property_descriptor&() { + return _desc; +} + +inline PropertyDescriptor::operator const napi_property_descriptor&() const { + return _desc; +} + +//////////////////////////////////////////////////////////////////////////////// +// InstanceWrap class +//////////////////////////////////////////////////////////////////////////////// + +template +inline void InstanceWrap::AttachPropData( + napi_env env, napi_value value, const napi_property_descriptor* prop) { + napi_status status; + if (!(prop->attributes & napi_static)) { + if (prop->method == T::InstanceVoidMethodCallbackWrapper) { + status = Napi::details::AttachData( + env, value, static_cast(prop->data)); + NAPI_THROW_IF_FAILED_VOID(env, status); + } else if (prop->method == T::InstanceMethodCallbackWrapper) { + status = Napi::details::AttachData( + env, value, static_cast(prop->data)); + NAPI_THROW_IF_FAILED_VOID(env, status); + } else if (prop->getter == T::InstanceGetterCallbackWrapper || + prop->setter == T::InstanceSetterCallbackWrapper) { + status = Napi::details::AttachData( + env, value, static_cast(prop->data)); + NAPI_THROW_IF_FAILED_VOID(env, status); + } + } +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + const char* utf8name, + InstanceVoidMethodCallback method, + napi_property_attributes attributes, + void* data) { + InstanceVoidMethodCallbackData* callbackData = + new InstanceVoidMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = T::InstanceVoidMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + const char* utf8name, + InstanceMethodCallback method, + napi_property_attributes attributes, + void* data) { + InstanceMethodCallbackData* callbackData = + new InstanceMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = T::InstanceMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + Symbol name, + InstanceVoidMethodCallback method, + napi_property_attributes attributes, + void* data) { + InstanceVoidMethodCallbackData* callbackData = + new InstanceVoidMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = T::InstanceVoidMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + Symbol name, + InstanceMethodCallback method, + napi_property_attributes attributes, + void* data) { + InstanceMethodCallbackData* callbackData = + new InstanceMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = T::InstanceMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceVoidMethodCallback method> +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = details::TemplatedInstanceVoidCallback; + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceMethodCallback method> +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = details::TemplatedInstanceCallback; + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceVoidMethodCallback method> +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = details::TemplatedInstanceVoidCallback; + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceMethodCallback method> +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = details::TemplatedInstanceCallback; + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( + const char* utf8name, + InstanceGetterCallback getter, + InstanceSetterCallback setter, + napi_property_attributes attributes, + void* data) { + InstanceAccessorCallbackData* callbackData = + new InstanceAccessorCallbackData({getter, setter, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.getter = getter != nullptr ? T::InstanceGetterCallbackWrapper : nullptr; + desc.setter = setter != nullptr ? T::InstanceSetterCallbackWrapper : nullptr; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( + Symbol name, + InstanceGetterCallback getter, + InstanceSetterCallback setter, + napi_property_attributes attributes, + void* data) { + InstanceAccessorCallbackData* callbackData = + new InstanceAccessorCallbackData({getter, setter, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.getter = getter != nullptr ? T::InstanceGetterCallbackWrapper : nullptr; + desc.setter = setter != nullptr ? T::InstanceSetterCallbackWrapper : nullptr; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceGetterCallback getter, + typename InstanceWrap::InstanceSetterCallback setter> +inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.getter = details::TemplatedInstanceCallback; + desc.setter = This::WrapSetter(This::SetterTag()); + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceGetterCallback getter, + typename InstanceWrap::InstanceSetterCallback setter> +inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.getter = details::TemplatedInstanceCallback; + desc.setter = This::WrapSetter(This::SetterTag()); + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceValue( + const char* utf8name, + Napi::Value value, + napi_property_attributes attributes) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.value = value; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceValue( + Symbol name, Napi::Value value, napi_property_attributes attributes) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.value = value; + desc.attributes = attributes; + return desc; +} + +template +inline napi_value InstanceWrap::InstanceVoidMethodCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + InstanceVoidMethodCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + T* instance = T::Unwrap(callbackInfo.This().As()); + auto cb = callbackData->callback; + (instance->*cb)(callbackInfo); + return nullptr; + }); +} + +template +inline napi_value InstanceWrap::InstanceMethodCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + InstanceMethodCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + T* instance = T::Unwrap(callbackInfo.This().As()); + auto cb = callbackData->callback; + return (instance->*cb)(callbackInfo); + }); +} + +template +inline napi_value InstanceWrap::InstanceGetterCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + InstanceAccessorCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + T* instance = T::Unwrap(callbackInfo.This().As()); + auto cb = callbackData->getterCallback; + return (instance->*cb)(callbackInfo); + }); +} + +template +inline napi_value InstanceWrap::InstanceSetterCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + InstanceAccessorCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + T* instance = T::Unwrap(callbackInfo.This().As()); + auto cb = callbackData->setterCallback; + (instance->*cb)(callbackInfo, callbackInfo[0]); + return nullptr; + }); +} + +template +template ::InstanceSetterCallback method> +inline napi_value InstanceWrap::WrappedMethod( + napi_env env, napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + const CallbackInfo cbInfo(env, info); + T* instance = T::Unwrap(cbInfo.This().As()); + (instance->*method)(cbInfo, cbInfo[0]); + return nullptr; + }); +} + +//////////////////////////////////////////////////////////////////////////////// +// ObjectWrap class +//////////////////////////////////////////////////////////////////////////////// + +template +inline ObjectWrap::ObjectWrap(const Napi::CallbackInfo& callbackInfo) { + napi_env env = callbackInfo.Env(); + napi_value wrapper = callbackInfo.This(); + napi_status status; + napi_ref ref; + T* instance = static_cast(this); + status = napi_wrap(env, wrapper, instance, FinalizeCallback, nullptr, &ref); + NAPI_THROW_IF_FAILED_VOID(env, status); + + Reference* instanceRef = instance; + *instanceRef = Reference(env, ref); +} + +template +inline ObjectWrap::~ObjectWrap() { + // If the JS object still exists at this point, remove the finalizer added + // through `napi_wrap()`. + if (!IsEmpty()) { + Object object = Value(); + // It is not valid to call `napi_remove_wrap()` with an empty `object`. + // This happens e.g. during garbage collection. + if (!object.IsEmpty() && _construction_failed) { + napi_remove_wrap(Env(), object, nullptr); + } + } +} + +template +inline T* ObjectWrap::Unwrap(Object wrapper) { + void* unwrapped; + napi_status status = napi_unwrap(wrapper.Env(), wrapper, &unwrapped); + NAPI_THROW_IF_FAILED(wrapper.Env(), status, nullptr); + return static_cast(unwrapped); +} + +template +inline Function ObjectWrap::DefineClass( + Napi::Env env, + const char* utf8name, + const size_t props_count, + const napi_property_descriptor* descriptors, + void* data) { + napi_status status; + std::vector props(props_count); + + // We copy the descriptors to a local array because before defining the class + // we must replace static method property descriptors with value property + // descriptors such that the value is a function-valued `napi_value` created + // with `CreateFunction()`. + // + // This replacement could be made for instance methods as well, but V8 aborts + // if we do that, because it expects methods defined on the prototype template + // to have `FunctionTemplate`s. + for (size_t index = 0; index < props_count; index++) { + props[index] = descriptors[index]; + napi_property_descriptor* prop = &props[index]; + if (prop->method == T::StaticMethodCallbackWrapper) { + status = + CreateFunction(env, + utf8name, + prop->method, + static_cast(prop->data), + &(prop->value)); + NAPI_THROW_IF_FAILED(env, status, Function()); + prop->method = nullptr; + prop->data = nullptr; + } else if (prop->method == T::StaticVoidMethodCallbackWrapper) { + status = + CreateFunction(env, + utf8name, + prop->method, + static_cast(prop->data), + &(prop->value)); + NAPI_THROW_IF_FAILED(env, status, Function()); + prop->method = nullptr; + prop->data = nullptr; + } + } + + napi_value value; + status = napi_define_class(env, + utf8name, + NAPI_AUTO_LENGTH, + T::ConstructorCallbackWrapper, + data, + props_count, + props.data(), + &value); + NAPI_THROW_IF_FAILED(env, status, Function()); + + // After defining the class we iterate once more over the property descriptors + // and attach the data associated with accessors and instance methods to the + // newly created JavaScript class. + for (size_t idx = 0; idx < props_count; idx++) { + const napi_property_descriptor* prop = &props[idx]; + + if (prop->getter == T::StaticGetterCallbackWrapper || + prop->setter == T::StaticSetterCallbackWrapper) { + status = Napi::details::AttachData( + env, value, static_cast(prop->data)); + NAPI_THROW_IF_FAILED(env, status, Function()); + } else { + // InstanceWrap::AttachPropData is responsible for attaching the data + // of instance methods and accessors. + T::AttachPropData(env, value, prop); + } + } + + return Function(env, value); +} + +template +inline Function ObjectWrap::DefineClass( + Napi::Env env, + const char* utf8name, + const std::initializer_list>& properties, + void* data) { + return DefineClass( + env, + utf8name, + properties.size(), + reinterpret_cast(properties.begin()), + data); +} + +template +inline Function ObjectWrap::DefineClass( + Napi::Env env, + const char* utf8name, + const std::vector>& properties, + void* data) { + return DefineClass( + env, + utf8name, + properties.size(), + reinterpret_cast(properties.data()), + data); +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + const char* utf8name, + StaticVoidMethodCallback method, + napi_property_attributes attributes, + void* data) { + StaticVoidMethodCallbackData* callbackData = + new StaticVoidMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = T::StaticVoidMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + const char* utf8name, + StaticMethodCallback method, + napi_property_attributes attributes, + void* data) { + StaticMethodCallbackData* callbackData = + new StaticMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = T::StaticMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + Symbol name, + StaticVoidMethodCallback method, + napi_property_attributes attributes, + void* data) { + StaticVoidMethodCallbackData* callbackData = + new StaticVoidMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = T::StaticVoidMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + Symbol name, + StaticMethodCallback method, + napi_property_attributes attributes, + void* data) { + StaticMethodCallbackData* callbackData = + new StaticMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = T::StaticMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticVoidMethodCallback method> +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = details::TemplatedVoidCallback; + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticVoidMethodCallback method> +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = details::TemplatedVoidCallback; + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticMethodCallback method> +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = details::TemplatedCallback; + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticMethodCallback method> +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = details::TemplatedCallback; + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( + const char* utf8name, + StaticGetterCallback getter, + StaticSetterCallback setter, + napi_property_attributes attributes, + void* data) { + StaticAccessorCallbackData* callbackData = + new StaticAccessorCallbackData({getter, setter, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.getter = getter != nullptr ? T::StaticGetterCallbackWrapper : nullptr; + desc.setter = setter != nullptr ? T::StaticSetterCallbackWrapper : nullptr; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( + Symbol name, + StaticGetterCallback getter, + StaticSetterCallback setter, + napi_property_attributes attributes, + void* data) { + StaticAccessorCallbackData* callbackData = + new StaticAccessorCallbackData({getter, setter, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.getter = getter != nullptr ? T::StaticGetterCallbackWrapper : nullptr; + desc.setter = setter != nullptr ? T::StaticSetterCallbackWrapper : nullptr; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticGetterCallback getter, + typename ObjectWrap::StaticSetterCallback setter> +inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.getter = details::TemplatedCallback; + desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticGetterCallback getter, + typename ObjectWrap::StaticSetterCallback setter> +inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.getter = details::TemplatedCallback; + desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticValue( + const char* utf8name, + Napi::Value value, + napi_property_attributes attributes) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.value = value; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticValue( + Symbol name, Napi::Value value, napi_property_attributes attributes) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.value = value; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline Value ObjectWrap::OnCalledAsFunction( + const Napi::CallbackInfo& callbackInfo) { + NAPI_THROW( + TypeError::New(callbackInfo.Env(), + "Class constructors cannot be invoked without 'new'"), + Napi::Value()); +} + +template +inline void ObjectWrap::Finalize(Napi::Env /*env*/) {} + +template +inline napi_value ObjectWrap::ConstructorCallbackWrapper( + napi_env env, napi_callback_info info) { + napi_value new_target; + napi_status status = napi_get_new_target(env, info, &new_target); + if (status != napi_ok) return nullptr; + + bool isConstructCall = (new_target != nullptr); + if (!isConstructCall) { + return details::WrapCallback( + [&] { return T::OnCalledAsFunction(CallbackInfo(env, info)); }); + } + + napi_value wrapper = details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + T* instance = new T(callbackInfo); +#ifdef NAPI_CPP_EXCEPTIONS + instance->_construction_failed = false; +#else + if (callbackInfo.Env().IsExceptionPending()) { + // We need to clear the exception so that removing the wrap might work. + Error e = callbackInfo.Env().GetAndClearPendingException(); + delete instance; + e.ThrowAsJavaScriptException(); + } else { + instance->_construction_failed = false; + } +#endif // NAPI_CPP_EXCEPTIONS + return callbackInfo.This(); + }); + + return wrapper; +} + +template +inline napi_value ObjectWrap::StaticVoidMethodCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + StaticVoidMethodCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + callbackData->callback(callbackInfo); + return nullptr; + }); +} + +template +inline napi_value ObjectWrap::StaticMethodCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + StaticMethodCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + return callbackData->callback(callbackInfo); + }); +} + +template +inline napi_value ObjectWrap::StaticGetterCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + StaticAccessorCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + return callbackData->getterCallback(callbackInfo); + }); +} + +template +inline napi_value ObjectWrap::StaticSetterCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + StaticAccessorCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + callbackData->setterCallback(callbackInfo, callbackInfo[0]); + return nullptr; + }); +} + +template +inline void ObjectWrap::FinalizeCallback(napi_env env, + void* data, + void* /*hint*/) { + HandleScope scope(env); + T* instance = static_cast(data); + instance->Finalize(Napi::Env(env)); + delete instance; +} + +template +template ::StaticSetterCallback method> +inline napi_value ObjectWrap::WrappedMethod( + napi_env env, napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + const CallbackInfo cbInfo(env, info); + method(cbInfo, cbInfo[0]); + return nullptr; + }); +} + +//////////////////////////////////////////////////////////////////////////////// +// HandleScope class +//////////////////////////////////////////////////////////////////////////////// + +inline HandleScope::HandleScope(napi_env env, napi_handle_scope scope) + : _env(env), _scope(scope) {} + +inline HandleScope::HandleScope(Napi::Env env) : _env(env) { + napi_status status = napi_open_handle_scope(_env, &_scope); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline HandleScope::~HandleScope() { + napi_status status = napi_close_handle_scope(_env, _scope); + NAPI_FATAL_IF_FAILED( + status, "HandleScope::~HandleScope", "napi_close_handle_scope"); +} + +inline HandleScope::operator napi_handle_scope() const { + return _scope; +} + +inline Napi::Env HandleScope::Env() const { + return Napi::Env(_env); +} + +//////////////////////////////////////////////////////////////////////////////// +// EscapableHandleScope class +//////////////////////////////////////////////////////////////////////////////// + +inline EscapableHandleScope::EscapableHandleScope( + napi_env env, napi_escapable_handle_scope scope) + : _env(env), _scope(scope) {} + +inline EscapableHandleScope::EscapableHandleScope(Napi::Env env) : _env(env) { + napi_status status = napi_open_escapable_handle_scope(_env, &_scope); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline EscapableHandleScope::~EscapableHandleScope() { + napi_status status = napi_close_escapable_handle_scope(_env, _scope); + NAPI_FATAL_IF_FAILED(status, + "EscapableHandleScope::~EscapableHandleScope", + "napi_close_escapable_handle_scope"); +} + +inline EscapableHandleScope::operator napi_escapable_handle_scope() const { + return _scope; +} + +inline Napi::Env EscapableHandleScope::Env() const { + return Napi::Env(_env); +} + +inline Value EscapableHandleScope::Escape(napi_value escapee) { + napi_value result; + napi_status status = napi_escape_handle(_env, _scope, escapee, &result); + NAPI_THROW_IF_FAILED(_env, status, Value()); + return Value(_env, result); +} + +#if (NAPI_VERSION > 2) +//////////////////////////////////////////////////////////////////////////////// +// CallbackScope class +//////////////////////////////////////////////////////////////////////////////// + +inline CallbackScope::CallbackScope(napi_env env, napi_callback_scope scope) + : _env(env), _scope(scope) {} + +inline CallbackScope::CallbackScope(napi_env env, napi_async_context context) + : _env(env) { + napi_status status = + napi_open_callback_scope(_env, Object::New(env), context, &_scope); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline CallbackScope::~CallbackScope() { + napi_status status = napi_close_callback_scope(_env, _scope); + NAPI_FATAL_IF_FAILED( + status, "CallbackScope::~CallbackScope", "napi_close_callback_scope"); +} + +inline CallbackScope::operator napi_callback_scope() const { + return _scope; +} + +inline Napi::Env CallbackScope::Env() const { + return Napi::Env(_env); +} +#endif + +//////////////////////////////////////////////////////////////////////////////// +// AsyncContext class +//////////////////////////////////////////////////////////////////////////////// + +inline AsyncContext::AsyncContext(napi_env env, const char* resource_name) + : AsyncContext(env, resource_name, Object::New(env)) {} + +inline AsyncContext::AsyncContext(napi_env env, + const char* resource_name, + const Object& resource) + : _env(env), _context(nullptr) { + napi_value resource_id; + napi_status status = napi_create_string_utf8( + _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); + NAPI_THROW_IF_FAILED_VOID(_env, status); + + status = napi_async_init(_env, resource, resource_id, &_context); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline AsyncContext::~AsyncContext() { + if (_context != nullptr) { + napi_async_destroy(_env, _context); + _context = nullptr; + } +} + +inline AsyncContext::AsyncContext(AsyncContext&& other) { + _env = other._env; + other._env = nullptr; + _context = other._context; + other._context = nullptr; +} + +inline AsyncContext& AsyncContext::operator=(AsyncContext&& other) { + _env = other._env; + other._env = nullptr; + _context = other._context; + other._context = nullptr; + return *this; +} + +inline AsyncContext::operator napi_async_context() const { + return _context; +} + +inline Napi::Env AsyncContext::Env() const { + return Napi::Env(_env); +} + +//////////////////////////////////////////////////////////////////////////////// +// AsyncWorker class +//////////////////////////////////////////////////////////////////////////////// + +inline AsyncWorker::AsyncWorker(const Function& callback) + : AsyncWorker(callback, "generic") {} + +inline AsyncWorker::AsyncWorker(const Function& callback, + const char* resource_name) + : AsyncWorker(callback, resource_name, Object::New(callback.Env())) {} + +inline AsyncWorker::AsyncWorker(const Function& callback, + const char* resource_name, + const Object& resource) + : AsyncWorker( + Object::New(callback.Env()), callback, resource_name, resource) {} + +inline AsyncWorker::AsyncWorker(const Object& receiver, + const Function& callback) + : AsyncWorker(receiver, callback, "generic") {} + +inline AsyncWorker::AsyncWorker(const Object& receiver, + const Function& callback, + const char* resource_name) + : AsyncWorker( + receiver, callback, resource_name, Object::New(callback.Env())) {} + +inline AsyncWorker::AsyncWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource) + : _env(callback.Env()), + _receiver(Napi::Persistent(receiver)), + _callback(Napi::Persistent(callback)), + _suppress_destruct(false) { + napi_value resource_id; + napi_status status = napi_create_string_latin1( + _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); + NAPI_THROW_IF_FAILED_VOID(_env, status); + + status = napi_create_async_work(_env, + resource, + resource_id, + OnAsyncWorkExecute, + OnAsyncWorkComplete, + this, + &_work); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline AsyncWorker::AsyncWorker(Napi::Env env) : AsyncWorker(env, "generic") {} + +inline AsyncWorker::AsyncWorker(Napi::Env env, const char* resource_name) + : AsyncWorker(env, resource_name, Object::New(env)) {} + +inline AsyncWorker::AsyncWorker(Napi::Env env, + const char* resource_name, + const Object& resource) + : _env(env), _receiver(), _callback(), _suppress_destruct(false) { + napi_value resource_id; + napi_status status = napi_create_string_latin1( + _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); + NAPI_THROW_IF_FAILED_VOID(_env, status); + + status = napi_create_async_work(_env, + resource, + resource_id, + OnAsyncWorkExecute, + OnAsyncWorkComplete, + this, + &_work); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline AsyncWorker::~AsyncWorker() { + if (_work != nullptr) { + napi_delete_async_work(_env, _work); + _work = nullptr; + } +} + +inline void AsyncWorker::Destroy() { + delete this; +} + +inline AsyncWorker::AsyncWorker(AsyncWorker&& other) { + _env = other._env; + other._env = nullptr; + _work = other._work; + other._work = nullptr; + _receiver = std::move(other._receiver); + _callback = std::move(other._callback); + _error = std::move(other._error); + _suppress_destruct = other._suppress_destruct; +} + +inline AsyncWorker& AsyncWorker::operator=(AsyncWorker&& other) { + _env = other._env; + other._env = nullptr; + _work = other._work; + other._work = nullptr; + _receiver = std::move(other._receiver); + _callback = std::move(other._callback); + _error = std::move(other._error); + _suppress_destruct = other._suppress_destruct; + return *this; +} + +inline AsyncWorker::operator napi_async_work() const { + return _work; +} + +inline Napi::Env AsyncWorker::Env() const { + return Napi::Env(_env); +} + +inline void AsyncWorker::Queue() { + napi_status status = napi_queue_async_work(_env, _work); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline void AsyncWorker::Cancel() { + napi_status status = napi_cancel_async_work(_env, _work); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline ObjectReference& AsyncWorker::Receiver() { + return _receiver; +} + +inline FunctionReference& AsyncWorker::Callback() { + return _callback; +} + +inline void AsyncWorker::SuppressDestruct() { + _suppress_destruct = true; +} + +inline void AsyncWorker::OnOK() { + if (!_callback.IsEmpty()) { + _callback.Call(_receiver.Value(), GetResult(_callback.Env())); + } +} + +inline void AsyncWorker::OnError(const Error& e) { + if (!_callback.IsEmpty()) { + _callback.Call(_receiver.Value(), + std::initializer_list{e.Value()}); + } +} + +inline void AsyncWorker::SetError(const std::string& error) { + _error = error; +} + +inline std::vector AsyncWorker::GetResult(Napi::Env /*env*/) { + return {}; +} +// The OnAsyncWorkExecute method receives an napi_env argument. However, do NOT +// use it within this method, as it does not run on the JavaScript thread and +// must not run any method that would cause JavaScript to run. In practice, +// this means that almost any use of napi_env will be incorrect. +inline void AsyncWorker::OnAsyncWorkExecute(napi_env env, void* asyncworker) { + AsyncWorker* self = static_cast(asyncworker); + self->OnExecute(env); +} +// The OnExecute method receives an napi_env argument. However, do NOT +// use it within this method, as it does not run on the JavaScript thread and +// must not run any method that would cause JavaScript to run. In practice, +// this means that almost any use of napi_env will be incorrect. +inline void AsyncWorker::OnExecute(Napi::Env /*DO_NOT_USE*/) { +#ifdef NAPI_CPP_EXCEPTIONS + try { + Execute(); + } catch (const std::exception& e) { + SetError(e.what()); + } +#else // NAPI_CPP_EXCEPTIONS + Execute(); +#endif // NAPI_CPP_EXCEPTIONS +} + +inline void AsyncWorker::OnAsyncWorkComplete(napi_env env, + napi_status status, + void* asyncworker) { + AsyncWorker* self = static_cast(asyncworker); + self->OnWorkComplete(env, status); +} +inline void AsyncWorker::OnWorkComplete(Napi::Env /*env*/, napi_status status) { + if (status != napi_cancelled) { + HandleScope scope(_env); + details::WrapCallback([&] { + if (_error.size() == 0) { + OnOK(); + } else { + OnError(Error::New(_env, _error)); + } + return nullptr; + }); + } + if (!_suppress_destruct) { + Destroy(); + } +} + +#if (NAPI_VERSION > 3 && !defined(__wasm32__)) +//////////////////////////////////////////////////////////////////////////////// +// TypedThreadSafeFunction class +//////////////////////////////////////////////////////////////////////////////// + +// Starting with NAPI 5, the JavaScript function `func` parameter of +// `napi_create_threadsafe_function` is optional. +#if NAPI_VERSION > 4 +// static, with Callback [missing] Resource [missing] Finalizer [missing] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + TypedThreadSafeFunction tsfn; + + napi_status status = + napi_create_threadsafe_function(env, + nullptr, + nullptr, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + nullptr, + nullptr, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [missing] Resource [passed] Finalizer [missing] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + TypedThreadSafeFunction tsfn; + + napi_status status = + napi_create_threadsafe_function(env, + nullptr, + resource, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + nullptr, + nullptr, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [missing] Resource [missing] Finalizer [passed] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + TypedThreadSafeFunction tsfn; + + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = napi_create_threadsafe_function( + env, + nullptr, + nullptr, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [missing] Resource [passed] Finalizer [passed] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + TypedThreadSafeFunction tsfn; + + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = napi_create_threadsafe_function( + env, + nullptr, + resource, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} +#endif + +// static, with Callback [passed] Resource [missing] Finalizer [missing] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + TypedThreadSafeFunction tsfn; + + napi_status status = + napi_create_threadsafe_function(env, + callback, + nullptr, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + nullptr, + nullptr, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [passed] Resource [passed] Finalizer [missing] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + TypedThreadSafeFunction tsfn; + + napi_status status = + napi_create_threadsafe_function(env, + callback, + resource, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + nullptr, + nullptr, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [passed] Resource [missing] Finalizer [passed] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + TypedThreadSafeFunction tsfn; + + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = napi_create_threadsafe_function( + env, + callback, + nullptr, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with: Callback [passed] Resource [passed] Finalizer [passed] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + CallbackType callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + TypedThreadSafeFunction tsfn; + + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = napi_create_threadsafe_function( + env, + details::DefaultCallbackWrapper< + CallbackType, + TypedThreadSafeFunction>(env, + callback), + resource, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +template +inline TypedThreadSafeFunction:: + TypedThreadSafeFunction() + : _tsfn() {} + +template +inline TypedThreadSafeFunction:: + TypedThreadSafeFunction(napi_threadsafe_function tsfn) + : _tsfn(tsfn) {} + +template +inline TypedThreadSafeFunction:: +operator napi_threadsafe_function() const { + return _tsfn; +} + +template +inline napi_status +TypedThreadSafeFunction::BlockingCall( + DataType* data) const { + return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_blocking); +} + +template +inline napi_status +TypedThreadSafeFunction::NonBlockingCall( + DataType* data) const { + return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_nonblocking); +} + +template +inline void TypedThreadSafeFunction::Ref( + napi_env env) const { + if (_tsfn != nullptr) { + napi_status status = napi_ref_threadsafe_function(env, _tsfn); + NAPI_THROW_IF_FAILED_VOID(env, status); + } +} + +template +inline void TypedThreadSafeFunction::Unref( + napi_env env) const { + if (_tsfn != nullptr) { + napi_status status = napi_unref_threadsafe_function(env, _tsfn); + NAPI_THROW_IF_FAILED_VOID(env, status); + } +} + +template +inline napi_status +TypedThreadSafeFunction::Acquire() const { + return napi_acquire_threadsafe_function(_tsfn); +} + +template +inline napi_status +TypedThreadSafeFunction::Release() const { + return napi_release_threadsafe_function(_tsfn, napi_tsfn_release); +} + +template +inline napi_status +TypedThreadSafeFunction::Abort() const { + return napi_release_threadsafe_function(_tsfn, napi_tsfn_abort); +} + +template +inline ContextType* +TypedThreadSafeFunction::GetContext() const { + void* context; + napi_status status = napi_get_threadsafe_function_context(_tsfn, &context); + NAPI_FATAL_IF_FAILED(status, + "TypedThreadSafeFunction::GetContext", + "napi_get_threadsafe_function_context"); + return static_cast(context); +} + +// static +template +void TypedThreadSafeFunction::CallJsInternal( + napi_env env, napi_value jsCallback, void* context, void* data) { + details::CallJsWrapper( + env, jsCallback, context, data); +} + +#if NAPI_VERSION == 4 +// static +template +Napi::Function +TypedThreadSafeFunction::EmptyFunctionFactory( + Napi::Env env) { + return Napi::Function::New(env, [](const CallbackInfo& cb) {}); +} + +// static +template +Napi::Function +TypedThreadSafeFunction::FunctionOrEmpty( + Napi::Env env, Napi::Function& callback) { + if (callback.IsEmpty()) { + return EmptyFunctionFactory(env); + } + return callback; +} + +#else +// static +template +std::nullptr_t +TypedThreadSafeFunction::EmptyFunctionFactory( + Napi::Env /*env*/) { + return nullptr; +} + +// static +template +Napi::Function +TypedThreadSafeFunction::FunctionOrEmpty( + Napi::Env /*env*/, Napi::Function& callback) { + return callback; +} + +#endif + +//////////////////////////////////////////////////////////////////////////////// +// ThreadSafeFunction class +//////////////////////////////////////////////////////////////////////////////// + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount) { + return New( + env, callback, Object(), resourceName, maxQueueSize, initialThreadCount); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + context); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + finalizeCallback); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback, + FinalizerDataType* data) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + finalizeCallback, + data); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + context, + finalizeCallback); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + context, + finalizeCallback, + data); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount) { + return New(env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + static_cast(nullptr) /* context */); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + return New(env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + context, + [](Env, ContextType*) {} /* empty finalizer */); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback) { + return New(env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + static_cast(nullptr) /* context */, + finalizeCallback, + static_cast(nullptr) /* data */, + details::ThreadSafeFinalize::Wrapper); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback, + FinalizerDataType* data) { + return New(env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + static_cast(nullptr) /* context */, + finalizeCallback, + data, + details::ThreadSafeFinalize:: + FinalizeWrapperWithData); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback) { + return New( + env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + context, + finalizeCallback, + static_cast(nullptr) /* data */, + details::ThreadSafeFinalize::FinalizeWrapperWithContext); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + return New( + env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + context, + finalizeCallback, + data, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext); +} + +inline ThreadSafeFunction::ThreadSafeFunction() : _tsfn() {} + +inline ThreadSafeFunction::ThreadSafeFunction(napi_threadsafe_function tsfn) + : _tsfn(tsfn) {} + +inline ThreadSafeFunction::operator napi_threadsafe_function() const { + return _tsfn; +} + +inline napi_status ThreadSafeFunction::BlockingCall() const { + return CallInternal(nullptr, napi_tsfn_blocking); +} + +template <> +inline napi_status ThreadSafeFunction::BlockingCall(void* data) const { + return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_blocking); +} + +template +inline napi_status ThreadSafeFunction::BlockingCall(Callback callback) const { + return CallInternal(new CallbackWrapper(callback), napi_tsfn_blocking); +} + +template +inline napi_status ThreadSafeFunction::BlockingCall(DataType* data, + Callback callback) const { + auto wrapper = [data, callback](Env env, Function jsCallback) { + callback(env, jsCallback, data); + }; + return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_blocking); +} + +inline napi_status ThreadSafeFunction::NonBlockingCall() const { + return CallInternal(nullptr, napi_tsfn_nonblocking); +} + +template <> +inline napi_status ThreadSafeFunction::NonBlockingCall(void* data) const { + return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_nonblocking); +} + +template +inline napi_status ThreadSafeFunction::NonBlockingCall( + Callback callback) const { + return CallInternal(new CallbackWrapper(callback), napi_tsfn_nonblocking); +} + +template +inline napi_status ThreadSafeFunction::NonBlockingCall( + DataType* data, Callback callback) const { + auto wrapper = [data, callback](Env env, Function jsCallback) { + callback(env, jsCallback, data); + }; + return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_nonblocking); +} + +inline void ThreadSafeFunction::Ref(napi_env env) const { + if (_tsfn != nullptr) { + napi_status status = napi_ref_threadsafe_function(env, _tsfn); + NAPI_THROW_IF_FAILED_VOID(env, status); + } +} + +inline void ThreadSafeFunction::Unref(napi_env env) const { + if (_tsfn != nullptr) { + napi_status status = napi_unref_threadsafe_function(env, _tsfn); + NAPI_THROW_IF_FAILED_VOID(env, status); + } +} + +inline napi_status ThreadSafeFunction::Acquire() const { + return napi_acquire_threadsafe_function(_tsfn); +} + +inline napi_status ThreadSafeFunction::Release() const { + return napi_release_threadsafe_function(_tsfn, napi_tsfn_release); +} + +inline napi_status ThreadSafeFunction::Abort() const { + return napi_release_threadsafe_function(_tsfn, napi_tsfn_abort); +} + +inline ThreadSafeFunction::ConvertibleContext ThreadSafeFunction::GetContext() + const { + void* context; + napi_status status = napi_get_threadsafe_function_context(_tsfn, &context); + NAPI_FATAL_IF_FAILED(status, + "ThreadSafeFunction::GetContext", + "napi_get_threadsafe_function_context"); + return ConvertibleContext({context}); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data, + napi_finalize wrapper) { + static_assert(details::can_make_string::value || + std::is_convertible::value, + "Resource name should be convertible to the string type"); + + ThreadSafeFunction tsfn; + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = + napi_create_threadsafe_function(env, + callback, + resource, + Value::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + wrapper, + context, + CallJS, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction()); + } + + return tsfn; +} + +inline napi_status ThreadSafeFunction::CallInternal( + CallbackWrapper* callbackWrapper, + napi_threadsafe_function_call_mode mode) const { + napi_status status = + napi_call_threadsafe_function(_tsfn, callbackWrapper, mode); + if (status != napi_ok && callbackWrapper != nullptr) { + delete callbackWrapper; + } + + return status; +} + +// static +inline void ThreadSafeFunction::CallJS(napi_env env, + napi_value jsCallback, + void* /* context */, + void* data) { + if (env == nullptr && jsCallback == nullptr) { + return; + } + + if (data != nullptr) { + auto* callbackWrapper = static_cast(data); + (*callbackWrapper)(env, Function(env, jsCallback)); + delete callbackWrapper; + } else if (jsCallback != nullptr) { + Function(env, jsCallback).Call({}); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Async Progress Worker Base class +//////////////////////////////////////////////////////////////////////////////// +template +inline AsyncProgressWorkerBase::AsyncProgressWorkerBase( + const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource, + size_t queue_size) + : AsyncWorker(receiver, callback, resource_name, resource) { + // Fill all possible arguments to work around ambiguous + // ThreadSafeFunction::New signatures. + _tsfn = ThreadSafeFunction::New(callback.Env(), + callback, + resource, + resource_name, + queue_size, + /** initialThreadCount */ 1, + /** context */ this, + OnThreadSafeFunctionFinalize, + /** finalizeData */ this); +} + +#if NAPI_VERSION > 4 +template +inline AsyncProgressWorkerBase::AsyncProgressWorkerBase( + Napi::Env env, + const char* resource_name, + const Object& resource, + size_t queue_size) + : AsyncWorker(env, resource_name, resource) { + // TODO: Once the changes to make the callback optional for threadsafe + // functions are available on all versions we can remove the dummy Function + // here. + Function callback; + // Fill all possible arguments to work around ambiguous + // ThreadSafeFunction::New signatures. + _tsfn = ThreadSafeFunction::New(env, + callback, + resource, + resource_name, + queue_size, + /** initialThreadCount */ 1, + /** context */ this, + OnThreadSafeFunctionFinalize, + /** finalizeData */ this); +} +#endif + +template +inline AsyncProgressWorkerBase::~AsyncProgressWorkerBase() { + // Abort pending tsfn call. + // Don't send progress events after we've already completed. + // It's ok to call ThreadSafeFunction::Abort and ThreadSafeFunction::Release + // duplicated. + _tsfn.Abort(); +} + +template +inline void AsyncProgressWorkerBase::OnAsyncWorkProgress( + Napi::Env /* env */, Napi::Function /* jsCallback */, void* data) { + ThreadSafeData* tsd = static_cast(data); + tsd->asyncprogressworker()->OnWorkProgress(tsd->data()); + delete tsd; +} + +template +inline napi_status AsyncProgressWorkerBase::NonBlockingCall( + DataType* data) { + auto tsd = new AsyncProgressWorkerBase::ThreadSafeData(this, data); + auto ret = _tsfn.NonBlockingCall(tsd, OnAsyncWorkProgress); + if (ret != napi_ok) { + delete tsd; + } + return ret; +} + +template +inline void AsyncProgressWorkerBase::OnWorkComplete( + Napi::Env /* env */, napi_status status) { + _work_completed = true; + _complete_status = status; + _tsfn.Release(); +} + +template +inline void AsyncProgressWorkerBase::OnThreadSafeFunctionFinalize( + Napi::Env env, void* /* data */, AsyncProgressWorkerBase* context) { + if (context->_work_completed) { + context->AsyncWorker::OnWorkComplete(env, context->_complete_status); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Async Progress Worker class +//////////////////////////////////////////////////////////////////////////////// +template +inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback) + : AsyncProgressWorker(callback, "generic") {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback, + const char* resource_name) + : AsyncProgressWorker( + callback, resource_name, Object::New(callback.Env())) {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback, + const char* resource_name, + const Object& resource) + : AsyncProgressWorker( + Object::New(callback.Env()), callback, resource_name, resource) {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, + const Function& callback) + : AsyncProgressWorker(receiver, callback, "generic") {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, + const Function& callback, + const char* resource_name) + : AsyncProgressWorker( + receiver, callback, resource_name, Object::New(callback.Env())) {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource) + : AsyncProgressWorkerBase(receiver, callback, resource_name, resource), + _asyncdata(nullptr), + _asyncsize(0), + _signaled(false) {} + +#if NAPI_VERSION > 4 +template +inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env) + : AsyncProgressWorker(env, "generic") {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env, + const char* resource_name) + : AsyncProgressWorker(env, resource_name, Object::New(env)) {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env, + const char* resource_name, + const Object& resource) + : AsyncProgressWorkerBase(env, resource_name, resource), + _asyncdata(nullptr), + _asyncsize(0) {} +#endif + +template +inline AsyncProgressWorker::~AsyncProgressWorker() { + { + std::lock_guard lock(this->_mutex); + _asyncdata = nullptr; + _asyncsize = 0; + } +} + +template +inline void AsyncProgressWorker::Execute() { + ExecutionProgress progress(this); + Execute(progress); +} + +template +inline void AsyncProgressWorker::OnWorkProgress(void*) { + T* data; + size_t size; + bool signaled; + { + std::lock_guard lock(this->_mutex); + data = this->_asyncdata; + size = this->_asyncsize; + signaled = this->_signaled; + this->_asyncdata = nullptr; + this->_asyncsize = 0; + this->_signaled = false; + } + + /** + * The callback of ThreadSafeFunction is not been invoked immediately on the + * callback of uv_async_t (uv io poll), rather the callback of TSFN is + * invoked on the right next uv idle callback. There are chances that during + * the deferring the signal of uv_async_t is been sent again, i.e. potential + * not coalesced two calls of the TSFN callback. + */ + if (data == nullptr && !signaled) { + return; + } + + this->OnProgress(data, size); + delete[] data; +} + +template +inline void AsyncProgressWorker::SendProgress_(const T* data, size_t count) { + T* new_data = new T[count]; + std::copy(data, data + count, new_data); + + T* old_data; + { + std::lock_guard lock(this->_mutex); + old_data = _asyncdata; + _asyncdata = new_data; + _asyncsize = count; + _signaled = false; + } + this->NonBlockingCall(nullptr); + + delete[] old_data; +} + +template +inline void AsyncProgressWorker::Signal() { + { + std::lock_guard lock(this->_mutex); + _signaled = true; + } + this->NonBlockingCall(static_cast(nullptr)); +} + +template +inline void AsyncProgressWorker::ExecutionProgress::Signal() const { + this->_worker->Signal(); +} + +template +inline void AsyncProgressWorker::ExecutionProgress::Send( + const T* data, size_t count) const { + _worker->SendProgress_(data, count); +} + +//////////////////////////////////////////////////////////////////////////////// +// Async Progress Queue Worker class +//////////////////////////////////////////////////////////////////////////////// +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Function& callback) + : AsyncProgressQueueWorker(callback, "generic") {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Function& callback, const char* resource_name) + : AsyncProgressQueueWorker( + callback, resource_name, Object::New(callback.Env())) {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Function& callback, const char* resource_name, const Object& resource) + : AsyncProgressQueueWorker( + Object::New(callback.Env()), callback, resource_name, resource) {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Object& receiver, const Function& callback) + : AsyncProgressQueueWorker(receiver, callback, "generic") {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Object& receiver, const Function& callback, const char* resource_name) + : AsyncProgressQueueWorker( + receiver, callback, resource_name, Object::New(callback.Env())) {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource) + : AsyncProgressWorkerBase>( + receiver, + callback, + resource_name, + resource, + /** unlimited queue size */ 0) {} + +#if NAPI_VERSION > 4 +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(Napi::Env env) + : AsyncProgressQueueWorker(env, "generic") {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + Napi::Env env, const char* resource_name) + : AsyncProgressQueueWorker(env, resource_name, Object::New(env)) {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + Napi::Env env, const char* resource_name, const Object& resource) + : AsyncProgressWorkerBase>( + env, resource_name, resource, /** unlimited queue size */ 0) {} +#endif + +template +inline void AsyncProgressQueueWorker::Execute() { + ExecutionProgress progress(this); + Execute(progress); +} + +template +inline void AsyncProgressQueueWorker::OnWorkProgress( + std::pair* datapair) { + if (datapair == nullptr) { + return; + } + + T* data = datapair->first; + size_t size = datapair->second; + + this->OnProgress(data, size); + delete datapair; + delete[] data; +} + +template +inline void AsyncProgressQueueWorker::SendProgress_(const T* data, + size_t count) { + T* new_data = new T[count]; + std::copy(data, data + count, new_data); + + auto pair = new std::pair(new_data, count); + this->NonBlockingCall(pair); +} + +template +inline void AsyncProgressQueueWorker::Signal() const { + this->SendProgress_(static_cast(nullptr), 0); +} + +template +inline void AsyncProgressQueueWorker::OnWorkComplete(Napi::Env env, + napi_status status) { + // Draining queued items in TSFN. + AsyncProgressWorkerBase>::OnWorkComplete(env, status); +} + +template +inline void AsyncProgressQueueWorker::ExecutionProgress::Signal() const { + _worker->SendProgress_(static_cast(nullptr), 0); +} + +template +inline void AsyncProgressQueueWorker::ExecutionProgress::Send( + const T* data, size_t count) const { + _worker->SendProgress_(data, count); +} +#endif // NAPI_VERSION > 3 && !defined(__wasm32__) + +//////////////////////////////////////////////////////////////////////////////// +// Memory Management class +//////////////////////////////////////////////////////////////////////////////// + +inline int64_t MemoryManagement::AdjustExternalMemory(Env env, + int64_t change_in_bytes) { + int64_t result; + napi_status status = + napi_adjust_external_memory(env, change_in_bytes, &result); + NAPI_THROW_IF_FAILED(env, status, 0); + return result; +} + +//////////////////////////////////////////////////////////////////////////////// +// Version Management class +//////////////////////////////////////////////////////////////////////////////// + +inline uint32_t VersionManagement::GetNapiVersion(Env env) { + uint32_t result; + napi_status status = napi_get_version(env, &result); + NAPI_THROW_IF_FAILED(env, status, 0); + return result; +} + +inline const napi_node_version* VersionManagement::GetNodeVersion(Env env) { + const napi_node_version* result; + napi_status status = napi_get_node_version(env, &result); + NAPI_THROW_IF_FAILED(env, status, 0); + return result; +} + +#if NAPI_VERSION > 5 +//////////////////////////////////////////////////////////////////////////////// +// Addon class +//////////////////////////////////////////////////////////////////////////////// + +template +inline Object Addon::Init(Env env, Object exports) { + T* addon = new T(env, exports); + env.SetInstanceData(addon); + return addon->entry_point_; +} + +template +inline T* Addon::Unwrap(Object wrapper) { + return wrapper.Env().GetInstanceData(); +} + +template +inline void Addon::DefineAddon( + Object exports, const std::initializer_list& props) { + DefineProperties(exports, props); + entry_point_ = exports; +} + +template +inline Napi::Object Addon::DefineProperties( + Object object, const std::initializer_list& props) { + const napi_property_descriptor* properties = + reinterpret_cast(props.begin()); + size_t size = props.size(); + napi_status status = + napi_define_properties(object.Env(), object, size, properties); + NAPI_THROW_IF_FAILED(object.Env(), status, object); + for (size_t idx = 0; idx < size; idx++) + T::AttachPropData(object.Env(), object, &properties[idx]); + return object; +} +#endif // NAPI_VERSION > 5 + +#if NAPI_VERSION > 2 +template +Env::CleanupHook Env::AddCleanupHook(Hook hook, Arg* arg) { + return CleanupHook(*this, hook, arg); +} + +template +Env::CleanupHook Env::AddCleanupHook(Hook hook) { + return CleanupHook(*this, hook); +} + +template +Env::CleanupHook::CleanupHook() { + data = nullptr; +} + +template +Env::CleanupHook::CleanupHook(Napi::Env env, Hook hook) + : wrapper(Env::CleanupHook::Wrapper) { + data = new CleanupData{std::move(hook), nullptr}; + napi_status status = napi_add_env_cleanup_hook(env, wrapper, data); + if (status != napi_ok) { + delete data; + data = nullptr; + } +} + +template +Env::CleanupHook::CleanupHook(Napi::Env env, Hook hook, Arg* arg) + : wrapper(Env::CleanupHook::WrapperWithArg) { + data = new CleanupData{std::move(hook), arg}; + napi_status status = napi_add_env_cleanup_hook(env, wrapper, data); + if (status != napi_ok) { + delete data; + data = nullptr; + } +} + +template +bool Env::CleanupHook::Remove(Env env) { + napi_status status = napi_remove_env_cleanup_hook(env, wrapper, data); + delete data; + data = nullptr; + return status == napi_ok; +} + +template +bool Env::CleanupHook::IsEmpty() const { + return data == nullptr; +} +#endif // NAPI_VERSION > 2 + +#ifdef NAPI_CPP_CUSTOM_NAMESPACE +} // namespace NAPI_CPP_CUSTOM_NAMESPACE +#endif + +} // namespace Napi + +#endif // SRC_NAPI_INL_H_ diff --git a/node_modules/node-addon-api/napi.h b/node_modules/node-addon-api/napi.h new file mode 100644 index 00000000..831b3b6d --- /dev/null +++ b/node_modules/node-addon-api/napi.h @@ -0,0 +1,3114 @@ +#ifndef SRC_NAPI_H_ +#define SRC_NAPI_H_ + +#include +#include +#include +#include +#include +#include +#include + +// VS2015 RTM has bugs with constexpr, so require min of VS2015 Update 3 (known +// good version) +#if !defined(_MSC_VER) || _MSC_FULL_VER >= 190024210 +#define NAPI_HAS_CONSTEXPR 1 +#endif + +// VS2013 does not support char16_t literal strings, so we'll work around it +// using wchar_t strings and casting them. This is safe as long as the character +// sizes are the same. +#if defined(_MSC_VER) && _MSC_VER <= 1800 +static_assert(sizeof(char16_t) == sizeof(wchar_t), + "Size mismatch between char16_t and wchar_t"); +#define NAPI_WIDE_TEXT(x) reinterpret_cast(L##x) +#else +#define NAPI_WIDE_TEXT(x) u##x +#endif + +// If C++ exceptions are not explicitly enabled or disabled, enable them +// if exceptions were enabled in the compiler settings. +#if !defined(NAPI_CPP_EXCEPTIONS) && !defined(NAPI_DISABLE_CPP_EXCEPTIONS) +#if defined(_CPPUNWIND) || defined(__EXCEPTIONS) +#define NAPI_CPP_EXCEPTIONS +#else +#error Exception support not detected. \ + Define either NAPI_CPP_EXCEPTIONS or NAPI_DISABLE_CPP_EXCEPTIONS. +#endif +#endif + +// If C++ NAPI_CPP_EXCEPTIONS are enabled, NODE_ADDON_API_ENABLE_MAYBE should +// not be set +#if defined(NAPI_CPP_EXCEPTIONS) && defined(NODE_ADDON_API_ENABLE_MAYBE) +#error NODE_ADDON_API_ENABLE_MAYBE should not be set when \ + NAPI_CPP_EXCEPTIONS is defined. +#endif + +#ifdef _NOEXCEPT +#define NAPI_NOEXCEPT _NOEXCEPT +#else +#define NAPI_NOEXCEPT noexcept +#endif + +#ifdef NAPI_CPP_EXCEPTIONS + +// When C++ exceptions are enabled, Errors are thrown directly. There is no need +// to return anything after the throw statements. The variadic parameter is an +// optional return value that is ignored. +// We need _VOID versions of the macros to avoid warnings resulting from +// leaving the NAPI_THROW_* `...` argument empty. + +#define NAPI_THROW(e, ...) throw e +#define NAPI_THROW_VOID(e) throw e + +#define NAPI_THROW_IF_FAILED(env, status, ...) \ + if ((status) != napi_ok) throw Napi::Error::New(env); + +#define NAPI_THROW_IF_FAILED_VOID(env, status) \ + if ((status) != napi_ok) throw Napi::Error::New(env); + +#else // NAPI_CPP_EXCEPTIONS + +// When C++ exceptions are disabled, Errors are thrown as JavaScript exceptions, +// which are pending until the callback returns to JS. The variadic parameter +// is an optional return value; usually it is an empty result. +// We need _VOID versions of the macros to avoid warnings resulting from +// leaving the NAPI_THROW_* `...` argument empty. + +#define NAPI_THROW(e, ...) \ + do { \ + (e).ThrowAsJavaScriptException(); \ + return __VA_ARGS__; \ + } while (0) + +#define NAPI_THROW_VOID(e) \ + do { \ + (e).ThrowAsJavaScriptException(); \ + return; \ + } while (0) + +#define NAPI_THROW_IF_FAILED(env, status, ...) \ + if ((status) != napi_ok) { \ + Napi::Error::New(env).ThrowAsJavaScriptException(); \ + return __VA_ARGS__; \ + } + +#define NAPI_THROW_IF_FAILED_VOID(env, status) \ + if ((status) != napi_ok) { \ + Napi::Error::New(env).ThrowAsJavaScriptException(); \ + return; \ + } + +#endif // NAPI_CPP_EXCEPTIONS + +#ifdef NODE_ADDON_API_ENABLE_MAYBE +#define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \ + NAPI_THROW_IF_FAILED(env, status, Napi::Nothing()) + +#define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \ + NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \ + return Napi::Just(result); +#else +#define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \ + NAPI_THROW_IF_FAILED(env, status, type()) + +#define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \ + NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \ + return result; +#endif + +#define NAPI_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete; +#define NAPI_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete; + +#define NAPI_DISALLOW_ASSIGN_COPY(CLASS) \ + NAPI_DISALLOW_ASSIGN(CLASS) \ + NAPI_DISALLOW_COPY(CLASS) + +#define NAPI_CHECK(condition, location, message) \ + do { \ + if (!(condition)) { \ + Napi::Error::Fatal((location), (message)); \ + } \ + } while (0) + +#define NAPI_FATAL_IF_FAILED(status, location, message) \ + NAPI_CHECK((status) == napi_ok, location, message) + +//////////////////////////////////////////////////////////////////////////////// +/// Node-API C++ Wrapper Classes +/// +/// These classes wrap the "Node-API" ABI-stable C APIs for Node.js, providing a +/// C++ object model and C++ exception-handling semantics with low overhead. +/// The wrappers are all header-only so that they do not affect the ABI. +//////////////////////////////////////////////////////////////////////////////// +namespace Napi { + +#ifdef NAPI_CPP_CUSTOM_NAMESPACE +// NAPI_CPP_CUSTOM_NAMESPACE can be #define'd per-addon to avoid symbol +// conflicts between different instances of node-addon-api + +// First dummy definition of the namespace to make sure that Napi::(name) still +// refers to the right things inside this file. +namespace NAPI_CPP_CUSTOM_NAMESPACE {} +using namespace NAPI_CPP_CUSTOM_NAMESPACE; + +namespace NAPI_CPP_CUSTOM_NAMESPACE { +#endif + +// Forward declarations +class Env; +class Value; +class Boolean; +class Number; +#if NAPI_VERSION > 5 +class BigInt; +#endif // NAPI_VERSION > 5 +#if (NAPI_VERSION > 4) +class Date; +#endif +class String; +class Object; +class Array; +class ArrayBuffer; +class Function; +class Error; +class PropertyDescriptor; +class CallbackInfo; +class TypedArray; +template +class TypedArrayOf; + +using Int8Array = + TypedArrayOf; ///< Typed-array of signed 8-bit integers +using Uint8Array = + TypedArrayOf; ///< Typed-array of unsigned 8-bit integers +using Int16Array = + TypedArrayOf; ///< Typed-array of signed 16-bit integers +using Uint16Array = + TypedArrayOf; ///< Typed-array of unsigned 16-bit integers +using Int32Array = + TypedArrayOf; ///< Typed-array of signed 32-bit integers +using Uint32Array = + TypedArrayOf; ///< Typed-array of unsigned 32-bit integers +using Float32Array = + TypedArrayOf; ///< Typed-array of 32-bit floating-point values +using Float64Array = + TypedArrayOf; ///< Typed-array of 64-bit floating-point values +#if NAPI_VERSION > 5 +using BigInt64Array = + TypedArrayOf; ///< Typed array of signed 64-bit integers +using BigUint64Array = + TypedArrayOf; ///< Typed array of unsigned 64-bit integers +#endif // NAPI_VERSION > 5 + +/// Defines the signature of a Node-API C++ module's registration callback +/// (init) function. +using ModuleRegisterCallback = Object (*)(Env env, Object exports); + +class MemoryManagement; + +/// A simple Maybe type, representing an object which may or may not have a +/// value. +/// +/// If an API method returns a Maybe<>, the API method can potentially fail +/// either because an exception is thrown, or because an exception is pending, +/// e.g. because a previous API call threw an exception that hasn't been +/// caught yet. In that case, a "Nothing" value is returned. +template +class Maybe { + public: + bool IsNothing() const; + bool IsJust() const; + + /// Short-hand for Unwrap(), which doesn't return a value. Could be used + /// where the actual value of the Maybe is not needed like Object::Set. + /// If this Maybe is nothing (empty), node-addon-api will crash the + /// process. + void Check() const; + + /// Return the value of type T contained in the Maybe. If this Maybe is + /// nothing (empty), node-addon-api will crash the process. + T Unwrap() const; + + /// Return the value of type T contained in the Maybe, or using a default + /// value if this Maybe is nothing (empty). + T UnwrapOr(const T& default_value) const; + + /// Converts this Maybe to a value of type T in the out. If this Maybe is + /// nothing (empty), `false` is returned and `out` is left untouched. + bool UnwrapTo(T* out) const; + + bool operator==(const Maybe& other) const; + bool operator!=(const Maybe& other) const; + + private: + Maybe(); + explicit Maybe(const T& t); + + bool _has_value; + T _value; + + template + friend Maybe Nothing(); + template + friend Maybe Just(const U& u); +}; + +template +inline Maybe Nothing(); + +template +inline Maybe Just(const T& t); + +#if defined(NODE_ADDON_API_ENABLE_MAYBE) +template +using MaybeOrValue = Maybe; +#else +template +using MaybeOrValue = T; +#endif + +/// Environment for Node-API values and operations. +/// +/// All Node-API values and operations must be associated with an environment. +/// An environment instance is always provided to callback functions; that +/// environment must then be used for any creation of Node-API values or other +/// Node-API operations within the callback. (Many methods infer the +/// environment from the `this` instance that the method is called on.) +/// +/// In the future, multiple environments per process may be supported, +/// although current implementations only support one environment per process. +/// +/// In the V8 JavaScript engine, a Node-API environment approximately +/// corresponds to an Isolate. +class Env { + private: + napi_env _env; +#if NAPI_VERSION > 5 + template + static void DefaultFini(Env, T* data); + template + static void DefaultFiniWithHint(Env, DataType* data, HintType* hint); +#endif // NAPI_VERSION > 5 + public: + Env(napi_env env); + + operator napi_env() const; + + Object Global() const; + Value Undefined() const; + Value Null() const; + + bool IsExceptionPending() const; + Error GetAndClearPendingException() const; + + MaybeOrValue RunScript(const char* utf8script) const; + MaybeOrValue RunScript(const std::string& utf8script) const; + MaybeOrValue RunScript(String script) const; + +#if NAPI_VERSION > 2 + template + class CleanupHook; + + template + CleanupHook AddCleanupHook(Hook hook); + + template + CleanupHook AddCleanupHook(Hook hook, Arg* arg); +#endif // NAPI_VERSION > 2 + +#if NAPI_VERSION > 5 + template + T* GetInstanceData() const; + + template + using Finalizer = void (*)(Env, T*); + template fini = Env::DefaultFini> + void SetInstanceData(T* data) const; + + template + using FinalizerWithHint = void (*)(Env, DataType*, HintType*); + template fini = + Env::DefaultFiniWithHint> + void SetInstanceData(DataType* data, HintType* hint) const; +#endif // NAPI_VERSION > 5 + +#if NAPI_VERSION > 2 + template + class CleanupHook { + public: + CleanupHook(); + CleanupHook(Env env, Hook hook, Arg* arg); + CleanupHook(Env env, Hook hook); + bool Remove(Env env); + bool IsEmpty() const; + + private: + static inline void Wrapper(void* data) NAPI_NOEXCEPT; + static inline void WrapperWithArg(void* data) NAPI_NOEXCEPT; + + void (*wrapper)(void* arg); + struct CleanupData { + Hook hook; + Arg* arg; + } * data; + }; +#endif // NAPI_VERSION > 2 +}; + +/// A JavaScript value of unknown type. +/// +/// For type-specific operations, convert to one of the Value subclasses using a +/// `To*` or `As()` method. The `To*` methods do type coercion; the `As()` +/// method does not. +/// +/// Napi::Value value = ... +/// if (!value.IsString()) throw Napi::TypeError::New(env, "Invalid +/// arg..."); Napi::String str = value.As(); // Cast to a +/// string value +/// +/// Napi::Value anotherValue = ... +/// bool isTruthy = anotherValue.ToBoolean(); // Coerce to a boolean value +class Value { + public: + Value(); ///< Creates a new _empty_ Value instance. + Value(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + /// Creates a JS value from a C++ primitive. + /// + /// `value` may be any of: + /// - bool + /// - Any integer type + /// - Any floating point type + /// - const char* (encoded using UTF-8, null-terminated) + /// - const char16_t* (encoded using UTF-16-LE, null-terminated) + /// - std::string (encoded using UTF-8) + /// - std::u16string + /// - napi::Value + /// - napi_value + template + static Value From(napi_env env, const T& value); + + /// Converts to a Node-API value primitive. + /// + /// If the instance is _empty_, this returns `nullptr`. + operator napi_value() const; + + /// Tests if this value strictly equals another value. + bool operator==(const Value& other) const; + + /// Tests if this value does not strictly equal another value. + bool operator!=(const Value& other) const; + + /// Tests if this value strictly equals another value. + bool StrictEquals(const Value& other) const; + + /// Gets the environment the value is associated with. + Napi::Env Env() const; + + /// Checks if the value is empty (uninitialized). + /// + /// An empty value is invalid, and most attempts to perform an operation on an + /// empty value will result in an exception. Note an empty value is distinct + /// from JavaScript `null` or `undefined`, which are valid values. + /// + /// When C++ exceptions are disabled at compile time, a method with a `Value` + /// return type may return an empty value to indicate a pending exception. So + /// when not using C++ exceptions, callers should check whether the value is + /// empty before attempting to use it. + bool IsEmpty() const; + + napi_valuetype Type() const; ///< Gets the type of the value. + + bool IsUndefined() + const; ///< Tests if a value is an undefined JavaScript value. + bool IsNull() const; ///< Tests if a value is a null JavaScript value. + bool IsBoolean() const; ///< Tests if a value is a JavaScript boolean. + bool IsNumber() const; ///< Tests if a value is a JavaScript number. +#if NAPI_VERSION > 5 + bool IsBigInt() const; ///< Tests if a value is a JavaScript bigint. +#endif // NAPI_VERSION > 5 +#if (NAPI_VERSION > 4) + bool IsDate() const; ///< Tests if a value is a JavaScript date. +#endif + bool IsString() const; ///< Tests if a value is a JavaScript string. + bool IsSymbol() const; ///< Tests if a value is a JavaScript symbol. + bool IsArray() const; ///< Tests if a value is a JavaScript array. + bool IsArrayBuffer() + const; ///< Tests if a value is a JavaScript array buffer. + bool IsTypedArray() const; ///< Tests if a value is a JavaScript typed array. + bool IsObject() const; ///< Tests if a value is a JavaScript object. + bool IsFunction() const; ///< Tests if a value is a JavaScript function. + bool IsPromise() const; ///< Tests if a value is a JavaScript promise. + bool IsDataView() const; ///< Tests if a value is a JavaScript data view. + bool IsBuffer() const; ///< Tests if a value is a Node buffer. + bool IsExternal() const; ///< Tests if a value is a pointer to external data. + + /// Casts to another type of `Napi::Value`, when the actual type is known or + /// assumed. + /// + /// This conversion does NOT coerce the type. Calling any methods + /// inappropriate for the actual value type will throw `Napi::Error`. + template + T As() const; + + MaybeOrValue ToBoolean() + const; ///< Coerces a value to a JavaScript boolean. + MaybeOrValue ToNumber() + const; ///< Coerces a value to a JavaScript number. + MaybeOrValue ToString() + const; ///< Coerces a value to a JavaScript string. + MaybeOrValue ToObject() + const; ///< Coerces a value to a JavaScript object. + + protected: + /// !cond INTERNAL + napi_env _env; + napi_value _value; + /// !endcond +}; + +/// A JavaScript boolean value. +class Boolean : public Value { + public: + static Boolean New(napi_env env, ///< Node-API environment + bool value ///< Boolean value + ); + + Boolean(); ///< Creates a new _empty_ Boolean instance. + Boolean(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + operator bool() const; ///< Converts a Boolean value to a boolean primitive. + bool Value() const; ///< Converts a Boolean value to a boolean primitive. +}; + +/// A JavaScript number value. +class Number : public Value { + public: + static Number New(napi_env env, ///< Node-API environment + double value ///< Number value + ); + + Number(); ///< Creates a new _empty_ Number instance. + Number(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + operator int32_t() + const; ///< Converts a Number value to a 32-bit signed integer value. + operator uint32_t() + const; ///< Converts a Number value to a 32-bit unsigned integer value. + operator int64_t() + const; ///< Converts a Number value to a 64-bit signed integer value. + operator float() + const; ///< Converts a Number value to a 32-bit floating-point value. + operator double() + const; ///< Converts a Number value to a 64-bit floating-point value. + + int32_t Int32Value() + const; ///< Converts a Number value to a 32-bit signed integer value. + uint32_t Uint32Value() + const; ///< Converts a Number value to a 32-bit unsigned integer value. + int64_t Int64Value() + const; ///< Converts a Number value to a 64-bit signed integer value. + float FloatValue() + const; ///< Converts a Number value to a 32-bit floating-point value. + double DoubleValue() + const; ///< Converts a Number value to a 64-bit floating-point value. +}; + +#if NAPI_VERSION > 5 +/// A JavaScript bigint value. +class BigInt : public Value { + public: + static BigInt New(napi_env env, ///< Node-API environment + int64_t value ///< Number value + ); + static BigInt New(napi_env env, ///< Node-API environment + uint64_t value ///< Number value + ); + + /// Creates a new BigInt object using a specified sign bit and a + /// specified list of digits/words. + /// The resulting number is calculated as: + /// (-1)^sign_bit * (words[0] * (2^64)^0 + words[1] * (2^64)^1 + ...) + static BigInt New(napi_env env, ///< Node-API environment + int sign_bit, ///< Sign bit. 1 if negative. + size_t word_count, ///< Number of words in array + const uint64_t* words ///< Array of words + ); + + BigInt(); ///< Creates a new _empty_ BigInt instance. + BigInt(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + int64_t Int64Value(bool* lossless) + const; ///< Converts a BigInt value to a 64-bit signed integer value. + uint64_t Uint64Value(bool* lossless) + const; ///< Converts a BigInt value to a 64-bit unsigned integer value. + + size_t WordCount() const; ///< The number of 64-bit words needed to store + ///< the result of ToWords(). + + /// Writes the contents of this BigInt to a specified memory location. + /// `sign_bit` must be provided and will be set to 1 if this BigInt is + /// negative. + /// `*word_count` has to be initialized to the length of the `words` array. + /// Upon return, it will be set to the actual number of words that would + /// be needed to store this BigInt (i.e. the return value of `WordCount()`). + void ToWords(int* sign_bit, size_t* word_count, uint64_t* words); +}; +#endif // NAPI_VERSION > 5 + +#if (NAPI_VERSION > 4) +/// A JavaScript date value. +class Date : public Value { + public: + /// Creates a new Date value from a double primitive. + static Date New(napi_env env, ///< Node-API environment + double value ///< Number value + ); + + Date(); ///< Creates a new _empty_ Date instance. + Date(napi_env env, napi_value value); ///< Wraps a Node-API value primitive. + operator double() const; ///< Converts a Date value to double primitive + + double ValueOf() const; ///< Converts a Date value to a double primitive. +}; +#endif + +/// A JavaScript string or symbol value (that can be used as a property name). +class Name : public Value { + public: + Name(); ///< Creates a new _empty_ Name instance. + Name(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. +}; + +/// A JavaScript string value. +class String : public Name { + public: + /// Creates a new String value from a UTF-8 encoded C++ string. + static String New(napi_env env, ///< Node-API environment + const std::string& value ///< UTF-8 encoded C++ string + ); + + /// Creates a new String value from a UTF-16 encoded C++ string. + static String New(napi_env env, ///< Node-API environment + const std::u16string& value ///< UTF-16 encoded C++ string + ); + + /// Creates a new String value from a UTF-8 encoded C string. + static String New( + napi_env env, ///< Node-API environment + const char* value ///< UTF-8 encoded null-terminated C string + ); + + /// Creates a new String value from a UTF-16 encoded C string. + static String New( + napi_env env, ///< Node-API environment + const char16_t* value ///< UTF-16 encoded null-terminated C string + ); + + /// Creates a new String value from a UTF-8 encoded C string with specified + /// length. + static String New(napi_env env, ///< Node-API environment + const char* value, ///< UTF-8 encoded C string (not + ///< necessarily null-terminated) + size_t length ///< length of the string in bytes + ); + + /// Creates a new String value from a UTF-16 encoded C string with specified + /// length. + static String New( + napi_env env, ///< Node-API environment + const char16_t* value, ///< UTF-16 encoded C string (not necessarily + ///< null-terminated) + size_t length ///< Length of the string in 2-byte code units + ); + + /// Creates a new String based on the original object's type. + /// + /// `value` may be any of: + /// - const char* (encoded using UTF-8, null-terminated) + /// - const char16_t* (encoded using UTF-16-LE, null-terminated) + /// - std::string (encoded using UTF-8) + /// - std::u16string + template + static String From(napi_env env, const T& value); + + String(); ///< Creates a new _empty_ String instance. + String(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + operator std::string() + const; ///< Converts a String value to a UTF-8 encoded C++ string. + operator std::u16string() + const; ///< Converts a String value to a UTF-16 encoded C++ string. + std::string Utf8Value() + const; ///< Converts a String value to a UTF-8 encoded C++ string. + std::u16string Utf16Value() + const; ///< Converts a String value to a UTF-16 encoded C++ string. +}; + +/// A JavaScript symbol value. +class Symbol : public Name { + public: + /// Creates a new Symbol value with an optional description. + static Symbol New( + napi_env env, ///< Node-API environment + const char* description = + nullptr ///< Optional UTF-8 encoded null-terminated C string + /// describing the symbol + ); + + /// Creates a new Symbol value with a description. + static Symbol New( + napi_env env, ///< Node-API environment + const std::string& + description ///< UTF-8 encoded C++ string describing the symbol + ); + + /// Creates a new Symbol value with a description. + static Symbol New(napi_env env, ///< Node-API environment + String description ///< String value describing the symbol + ); + + /// Creates a new Symbol value with a description. + static Symbol New( + napi_env env, ///< Node-API environment + napi_value description ///< String value describing the symbol + ); + + /// Get a public Symbol (e.g. Symbol.iterator). + static MaybeOrValue WellKnown(napi_env, const std::string& name); + + // Create a symbol in the global registry, UTF-8 Encoded cpp string + static MaybeOrValue For(napi_env env, const std::string& description); + + // Create a symbol in the global registry, C style string (null terminated) + static MaybeOrValue For(napi_env env, const char* description); + + // Create a symbol in the global registry, String value describing the symbol + static MaybeOrValue For(napi_env env, String description); + + // Create a symbol in the global registry, napi_value describing the symbol + static MaybeOrValue For(napi_env env, napi_value description); + + Symbol(); ///< Creates a new _empty_ Symbol instance. + Symbol(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. +}; + +/// A JavaScript object value. +class Object : public Value { + public: + /// Enables property and element assignments using indexing syntax. + /// + /// This is a convenient helper to get and set object properties. As + /// getting and setting object properties may throw with JavaScript + /// exceptions, it is notable that these operations may fail. + /// When NODE_ADDON_API_ENABLE_MAYBE is defined, the process will abort + /// on JavaScript exceptions. + /// + /// Example: + /// + /// Napi::Value propertyValue = object1['A']; + /// object2['A'] = propertyValue; + /// Napi::Value elementValue = array[0]; + /// array[1] = elementValue; + template + class PropertyLValue { + public: + /// Converts an L-value to a value. + operator Value() const; + + /// Assigns a value to the property. The type of value can be + /// anything supported by `Object::Set`. + template + PropertyLValue& operator=(ValueType value); + + private: + PropertyLValue() = delete; + PropertyLValue(Object object, Key key); + napi_env _env; + napi_value _object; + Key _key; + + friend class Napi::Object; + }; + + /// Creates a new Object value. + static Object New(napi_env env ///< Node-API environment + ); + + Object(); ///< Creates a new _empty_ Object instance. + Object(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + /// Gets or sets a named property. + PropertyLValue operator[]( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ); + + /// Gets or sets a named property. + PropertyLValue operator[]( + const std::string& utf8name ///< UTF-8 encoded property name + ); + + /// Gets or sets an indexed property or array element. + PropertyLValue operator[]( + uint32_t index /// Property / element index + ); + + /// Gets or sets an indexed property or array element. + PropertyLValue operator[](Value index /// Property / element index + ) const; + + /// Gets a named property. + MaybeOrValue operator[]( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Gets a named property. + MaybeOrValue operator[]( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Gets an indexed property or array element. + MaybeOrValue operator[](uint32_t index ///< Property / element index + ) const; + + /// Checks whether a property is present. + MaybeOrValue Has(napi_value key ///< Property key primitive + ) const; + + /// Checks whether a property is present. + MaybeOrValue Has(Value key ///< Property key + ) const; + + /// Checks whether a named property is present. + MaybeOrValue Has( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Checks whether a named property is present. + MaybeOrValue Has( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Checks whether a own property is present. + MaybeOrValue HasOwnProperty(napi_value key ///< Property key primitive + ) const; + + /// Checks whether a own property is present. + MaybeOrValue HasOwnProperty(Value key ///< Property key + ) const; + + /// Checks whether a own property is present. + MaybeOrValue HasOwnProperty( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Checks whether a own property is present. + MaybeOrValue HasOwnProperty( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Gets a property. + MaybeOrValue Get(napi_value key ///< Property key primitive + ) const; + + /// Gets a property. + MaybeOrValue Get(Value key ///< Property key + ) const; + + /// Gets a named property. + MaybeOrValue Get( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Gets a named property. + MaybeOrValue Get( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Sets a property. + template + MaybeOrValue Set(napi_value key, ///< Property key primitive + const ValueType& value ///< Property value primitive + ) const; + + /// Sets a property. + template + MaybeOrValue Set(Value key, ///< Property key + const ValueType& value ///< Property value + ) const; + + /// Sets a named property. + template + MaybeOrValue Set( + const char* utf8name, ///< UTF-8 encoded null-terminated property name + const ValueType& value) const; + + /// Sets a named property. + template + MaybeOrValue Set( + const std::string& utf8name, ///< UTF-8 encoded property name + const ValueType& value ///< Property value primitive + ) const; + + /// Delete property. + MaybeOrValue Delete(napi_value key ///< Property key primitive + ) const; + + /// Delete property. + MaybeOrValue Delete(Value key ///< Property key + ) const; + + /// Delete property. + MaybeOrValue Delete( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Delete property. + MaybeOrValue Delete( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Checks whether an indexed property is present. + MaybeOrValue Has(uint32_t index ///< Property / element index + ) const; + + /// Gets an indexed property or array element. + MaybeOrValue Get(uint32_t index ///< Property / element index + ) const; + + /// Sets an indexed property or array element. + template + MaybeOrValue Set(uint32_t index, ///< Property / element index + const ValueType& value ///< Property value primitive + ) const; + + /// Deletes an indexed property or array element. + MaybeOrValue Delete(uint32_t index ///< Property / element index + ) const; + + /// This operation can fail in case of Proxy.[[OwnPropertyKeys]] and + /// Proxy.[[GetOwnProperty]] calling into JavaScript. See: + /// - + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys + /// - + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p + MaybeOrValue GetPropertyNames() const; ///< Get all property names + + /// Defines a property on the object. + /// + /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling + /// into JavaScript. See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc + MaybeOrValue DefineProperty( + const PropertyDescriptor& + property ///< Descriptor for the property to be defined + ) const; + + /// Defines properties on the object. + /// + /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling + /// into JavaScript. See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc + MaybeOrValue DefineProperties( + const std::initializer_list& properties + ///< List of descriptors for the properties to be defined + ) const; + + /// Defines properties on the object. + /// + /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling + /// into JavaScript. See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc + MaybeOrValue DefineProperties( + const std::vector& properties + ///< Vector of descriptors for the properties to be defined + ) const; + + /// Checks if an object is an instance created by a constructor function. + /// + /// This is equivalent to the JavaScript `instanceof` operator. + /// + /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into + /// JavaScript. + /// See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof + MaybeOrValue InstanceOf( + const Function& constructor ///< Constructor function + ) const; + + template + inline void AddFinalizer(Finalizer finalizeCallback, T* data) const; + + template + inline void AddFinalizer(Finalizer finalizeCallback, + T* data, + Hint* finalizeHint) const; + +#ifdef NAPI_CPP_EXCEPTIONS + class const_iterator; + + inline const_iterator begin() const; + + inline const_iterator end() const; + + class iterator; + + inline iterator begin(); + + inline iterator end(); +#endif // NAPI_CPP_EXCEPTIONS + +#if NAPI_VERSION >= 8 + /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into + /// JavaScript. + /// See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof + MaybeOrValue Freeze() const; + /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into + /// JavaScript. + /// See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof + MaybeOrValue Seal() const; +#endif // NAPI_VERSION >= 8 +}; + +template +class External : public Value { + public: + static External New(napi_env env, T* data); + + // Finalizer must implement `void operator()(Env env, T* data)`. + template + static External New(napi_env env, T* data, Finalizer finalizeCallback); + // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. + template + static External New(napi_env env, + T* data, + Finalizer finalizeCallback, + Hint* finalizeHint); + + External(); + External(napi_env env, napi_value value); + + T* Data() const; +}; + +class Array : public Object { + public: + static Array New(napi_env env); + static Array New(napi_env env, size_t length); + + Array(); + Array(napi_env env, napi_value value); + + uint32_t Length() const; +}; + +#ifdef NAPI_CPP_EXCEPTIONS +class Object::const_iterator { + private: + enum class Type { BEGIN, END }; + + inline const_iterator(const Object* object, const Type type); + + public: + inline const_iterator& operator++(); + + inline bool operator==(const const_iterator& other) const; + + inline bool operator!=(const const_iterator& other) const; + + inline const std::pair> operator*() + const; + + private: + const Napi::Object* _object; + Array _keys; + uint32_t _index; + + friend class Object; +}; + +class Object::iterator { + private: + enum class Type { BEGIN, END }; + + inline iterator(Object* object, const Type type); + + public: + inline iterator& operator++(); + + inline bool operator==(const iterator& other) const; + + inline bool operator!=(const iterator& other) const; + + inline std::pair> operator*(); + + private: + Napi::Object* _object; + Array _keys; + uint32_t _index; + + friend class Object; +}; +#endif // NAPI_CPP_EXCEPTIONS + +/// A JavaScript array buffer value. +class ArrayBuffer : public Object { + public: + /// Creates a new ArrayBuffer instance over a new automatically-allocated + /// buffer. + static ArrayBuffer New( + napi_env env, ///< Node-API environment + size_t byteLength ///< Length of the buffer to be allocated, in bytes + ); + + /// Creates a new ArrayBuffer instance, using an external buffer with + /// specified byte length. + static ArrayBuffer New( + napi_env env, ///< Node-API environment + void* externalData, ///< Pointer to the external buffer to be used by + ///< the array + size_t byteLength ///< Length of the external buffer to be used by the + ///< array, in bytes + ); + + /// Creates a new ArrayBuffer instance, using an external buffer with + /// specified byte length. + template + static ArrayBuffer New( + napi_env env, ///< Node-API environment + void* externalData, ///< Pointer to the external buffer to be used by + ///< the array + size_t byteLength, ///< Length of the external buffer to be used by the + ///< array, + /// in bytes + Finalizer finalizeCallback ///< Function to be called when the array + ///< buffer is destroyed; + /// must implement `void operator()(Env env, + /// void* externalData)` + ); + + /// Creates a new ArrayBuffer instance, using an external buffer with + /// specified byte length. + template + static ArrayBuffer New( + napi_env env, ///< Node-API environment + void* externalData, ///< Pointer to the external buffer to be used by + ///< the array + size_t byteLength, ///< Length of the external buffer to be used by the + ///< array, + /// in bytes + Finalizer finalizeCallback, ///< Function to be called when the array + ///< buffer is destroyed; + /// must implement `void operator()(Env + /// env, void* externalData, Hint* hint)` + Hint* finalizeHint ///< Hint (second parameter) to be passed to the + ///< finalize callback + ); + + ArrayBuffer(); ///< Creates a new _empty_ ArrayBuffer instance. + ArrayBuffer(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + void* Data(); ///< Gets a pointer to the data buffer. + size_t ByteLength(); ///< Gets the length of the array buffer in bytes. + +#if NAPI_VERSION >= 7 + bool IsDetached() const; + void Detach(); +#endif // NAPI_VERSION >= 7 +}; + +/// A JavaScript typed-array value with unknown array type. +/// +/// For type-specific operations, cast to a `TypedArrayOf` instance using the +/// `As()` method: +/// +/// Napi::TypedArray array = ... +/// if (t.TypedArrayType() == napi_int32_array) { +/// Napi::Int32Array int32Array = t.As(); +/// } +class TypedArray : public Object { + public: + TypedArray(); ///< Creates a new _empty_ TypedArray instance. + TypedArray(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + napi_typedarray_type TypedArrayType() + const; ///< Gets the type of this typed-array. + Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. + + uint8_t ElementSize() + const; ///< Gets the size in bytes of one element in the array. + size_t ElementLength() const; ///< Gets the number of elements in the array. + size_t ByteOffset() + const; ///< Gets the offset into the buffer where the array starts. + size_t ByteLength() const; ///< Gets the length of the array in bytes. + + protected: + /// !cond INTERNAL + napi_typedarray_type _type; + size_t _length; + + TypedArray(napi_env env, + napi_value value, + napi_typedarray_type type, + size_t length); + + template + static +#if defined(NAPI_HAS_CONSTEXPR) + constexpr +#endif + napi_typedarray_type + TypedArrayTypeForPrimitiveType() { + return std::is_same::value ? napi_int8_array + : std::is_same::value ? napi_uint8_array + : std::is_same::value ? napi_int16_array + : std::is_same::value ? napi_uint16_array + : std::is_same::value ? napi_int32_array + : std::is_same::value ? napi_uint32_array + : std::is_same::value ? napi_float32_array + : std::is_same::value ? napi_float64_array +#if NAPI_VERSION > 5 + : std::is_same::value ? napi_bigint64_array + : std::is_same::value ? napi_biguint64_array +#endif // NAPI_VERSION > 5 + : napi_int8_array; + } + /// !endcond +}; + +/// A JavaScript typed-array value with known array type. +/// +/// Note while it is possible to create and access Uint8 "clamped" arrays using +/// this class, the _clamping_ behavior is only applied in JavaScript. +template +class TypedArrayOf : public TypedArray { + public: + /// Creates a new TypedArray instance over a new automatically-allocated array + /// buffer. + /// + /// The array type parameter can normally be omitted (because it is inferred + /// from the template parameter T), except when creating a "clamped" array: + /// + /// Uint8Array::New(env, length, napi_uint8_clamped_array) + static TypedArrayOf New( + napi_env env, ///< Node-API environment + size_t elementLength, ///< Length of the created array, as a number of + ///< elements +#if defined(NAPI_HAS_CONSTEXPR) + napi_typedarray_type type = + TypedArray::TypedArrayTypeForPrimitiveType() +#else + napi_typedarray_type type +#endif + ///< Type of array, if different from the default array type for the + ///< template parameter T. + ); + + /// Creates a new TypedArray instance over a provided array buffer. + /// + /// The array type parameter can normally be omitted (because it is inferred + /// from the template parameter T), except when creating a "clamped" array: + /// + /// Uint8Array::New(env, length, buffer, 0, napi_uint8_clamped_array) + static TypedArrayOf New( + napi_env env, ///< Node-API environment + size_t elementLength, ///< Length of the created array, as a number of + ///< elements + Napi::ArrayBuffer arrayBuffer, ///< Backing array buffer instance to use + size_t bufferOffset, ///< Offset into the array buffer where the + ///< typed-array starts +#if defined(NAPI_HAS_CONSTEXPR) + napi_typedarray_type type = + TypedArray::TypedArrayTypeForPrimitiveType() +#else + napi_typedarray_type type +#endif + ///< Type of array, if different from the default array type for the + ///< template parameter T. + ); + + TypedArrayOf(); ///< Creates a new _empty_ TypedArrayOf instance. + TypedArrayOf(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + T& operator[](size_t index); ///< Gets or sets an element in the array. + const T& operator[](size_t index) const; ///< Gets an element in the array. + + /// Gets a pointer to the array's backing buffer. + /// + /// This is not necessarily the same as the `ArrayBuffer::Data()` pointer, + /// because the typed-array may have a non-zero `ByteOffset()` into the + /// `ArrayBuffer`. + T* Data(); + + /// Gets a pointer to the array's backing buffer. + /// + /// This is not necessarily the same as the `ArrayBuffer::Data()` pointer, + /// because the typed-array may have a non-zero `ByteOffset()` into the + /// `ArrayBuffer`. + const T* Data() const; + + private: + T* _data; + + TypedArrayOf(napi_env env, + napi_value value, + napi_typedarray_type type, + size_t length, + T* data); +}; + +/// The DataView provides a low-level interface for reading/writing multiple +/// number types in an ArrayBuffer irrespective of the platform's endianness. +class DataView : public Object { + public: + static DataView New(napi_env env, Napi::ArrayBuffer arrayBuffer); + static DataView New(napi_env env, + Napi::ArrayBuffer arrayBuffer, + size_t byteOffset); + static DataView New(napi_env env, + Napi::ArrayBuffer arrayBuffer, + size_t byteOffset, + size_t byteLength); + + DataView(); ///< Creates a new _empty_ DataView instance. + DataView(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. + size_t ByteOffset() + const; ///< Gets the offset into the buffer where the array starts. + size_t ByteLength() const; ///< Gets the length of the array in bytes. + + void* Data() const; + + float GetFloat32(size_t byteOffset) const; + double GetFloat64(size_t byteOffset) const; + int8_t GetInt8(size_t byteOffset) const; + int16_t GetInt16(size_t byteOffset) const; + int32_t GetInt32(size_t byteOffset) const; + uint8_t GetUint8(size_t byteOffset) const; + uint16_t GetUint16(size_t byteOffset) const; + uint32_t GetUint32(size_t byteOffset) const; + + void SetFloat32(size_t byteOffset, float value) const; + void SetFloat64(size_t byteOffset, double value) const; + void SetInt8(size_t byteOffset, int8_t value) const; + void SetInt16(size_t byteOffset, int16_t value) const; + void SetInt32(size_t byteOffset, int32_t value) const; + void SetUint8(size_t byteOffset, uint8_t value) const; + void SetUint16(size_t byteOffset, uint16_t value) const; + void SetUint32(size_t byteOffset, uint32_t value) const; + + private: + template + T ReadData(size_t byteOffset) const; + + template + void WriteData(size_t byteOffset, T value) const; + + void* _data; + size_t _length; +}; + +class Function : public Object { + public: + using VoidCallback = void (*)(const CallbackInfo& info); + using Callback = Value (*)(const CallbackInfo& info); + + template + static Function New(napi_env env, + const char* utf8name = nullptr, + void* data = nullptr); + + template + static Function New(napi_env env, + const char* utf8name = nullptr, + void* data = nullptr); + + template + static Function New(napi_env env, + const std::string& utf8name, + void* data = nullptr); + + template + static Function New(napi_env env, + const std::string& utf8name, + void* data = nullptr); + + /// Callable must implement operator() accepting a const CallbackInfo& + /// and return either void or Value. + template + static Function New(napi_env env, + Callable cb, + const char* utf8name = nullptr, + void* data = nullptr); + /// Callable must implement operator() accepting a const CallbackInfo& + /// and return either void or Value. + template + static Function New(napi_env env, + Callable cb, + const std::string& utf8name, + void* data = nullptr); + + Function(); + Function(napi_env env, napi_value value); + + MaybeOrValue operator()( + const std::initializer_list& args) const; + + MaybeOrValue Call(const std::initializer_list& args) const; + MaybeOrValue Call(const std::vector& args) const; + MaybeOrValue Call(const std::vector& args) const; + MaybeOrValue Call(size_t argc, const napi_value* args) const; + MaybeOrValue Call(napi_value recv, + const std::initializer_list& args) const; + MaybeOrValue Call(napi_value recv, + const std::vector& args) const; + MaybeOrValue Call(napi_value recv, + const std::vector& args) const; + MaybeOrValue Call(napi_value recv, + size_t argc, + const napi_value* args) const; + + MaybeOrValue MakeCallback( + napi_value recv, + const std::initializer_list& args, + napi_async_context context = nullptr) const; + MaybeOrValue MakeCallback(napi_value recv, + const std::vector& args, + napi_async_context context = nullptr) const; + MaybeOrValue MakeCallback(napi_value recv, + size_t argc, + const napi_value* args, + napi_async_context context = nullptr) const; + + MaybeOrValue New(const std::initializer_list& args) const; + MaybeOrValue New(const std::vector& args) const; + MaybeOrValue New(size_t argc, const napi_value* args) const; +}; + +class Promise : public Object { + public: + class Deferred { + public: + static Deferred New(napi_env env); + Deferred(napi_env env); + + Napi::Promise Promise() const; + Napi::Env Env() const; + + void Resolve(napi_value value) const; + void Reject(napi_value value) const; + + private: + napi_env _env; + napi_deferred _deferred; + napi_value _promise; + }; + + Promise(napi_env env, napi_value value); +}; + +template +class Buffer : public Uint8Array { + public: + static Buffer New(napi_env env, size_t length); + static Buffer New(napi_env env, T* data, size_t length); + + // Finalizer must implement `void operator()(Env env, T* data)`. + template + static Buffer New(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback); + // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. + template + static Buffer New(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback, + Hint* finalizeHint); + + static Buffer Copy(napi_env env, const T* data, size_t length); + + Buffer(); + Buffer(napi_env env, napi_value value); + size_t Length() const; + T* Data() const; + + private: + mutable size_t _length; + mutable T* _data; + + Buffer(napi_env env, napi_value value, size_t length, T* data); + void EnsureInfo() const; +}; + +/// Holds a counted reference to a value; initially a weak reference unless +/// otherwise specified, may be changed to/from a strong reference by adjusting +/// the refcount. +/// +/// The referenced value is not immediately destroyed when the reference count +/// is zero; it is merely then eligible for garbage-collection if there are no +/// other references to the value. +template +class Reference { + public: + static Reference New(const T& value, uint32_t initialRefcount = 0); + + Reference(); + Reference(napi_env env, napi_ref ref); + ~Reference(); + + // A reference can be moved but cannot be copied. + Reference(Reference&& other); + Reference& operator=(Reference&& other); + NAPI_DISALLOW_ASSIGN(Reference) + + operator napi_ref() const; + bool operator==(const Reference& other) const; + bool operator!=(const Reference& other) const; + + Napi::Env Env() const; + bool IsEmpty() const; + + // Note when getting the value of a Reference it is usually correct to do so + // within a HandleScope so that the value handle gets cleaned up efficiently. + T Value() const; + + uint32_t Ref() const; + uint32_t Unref() const; + void Reset(); + void Reset(const T& value, uint32_t refcount = 0); + + // Call this on a reference that is declared as static data, to prevent its + // destructor from running at program shutdown time, which would attempt to + // reset the reference when the environment is no longer valid. Avoid using + // this if at all possible. If you do need to use static data, MAKE SURE to + // warn your users that your addon is NOT threadsafe. + void SuppressDestruct(); + + protected: + Reference(const Reference&); + + /// !cond INTERNAL + napi_env _env; + napi_ref _ref; + /// !endcond + + private: + bool _suppressDestruct; +}; + +class ObjectReference : public Reference { + public: + ObjectReference(); + ObjectReference(napi_env env, napi_ref ref); + + // A reference can be moved but cannot be copied. + ObjectReference(Reference&& other); + ObjectReference& operator=(Reference&& other); + ObjectReference(ObjectReference&& other); + ObjectReference& operator=(ObjectReference&& other); + NAPI_DISALLOW_ASSIGN(ObjectReference) + + MaybeOrValue Get(const char* utf8name) const; + MaybeOrValue Get(const std::string& utf8name) const; + MaybeOrValue Set(const char* utf8name, napi_value value) const; + MaybeOrValue Set(const char* utf8name, Napi::Value value) const; + MaybeOrValue Set(const char* utf8name, const char* utf8value) const; + MaybeOrValue Set(const char* utf8name, bool boolValue) const; + MaybeOrValue Set(const char* utf8name, double numberValue) const; + MaybeOrValue Set(const std::string& utf8name, napi_value value) const; + MaybeOrValue Set(const std::string& utf8name, Napi::Value value) const; + MaybeOrValue Set(const std::string& utf8name, + std::string& utf8value) const; + MaybeOrValue Set(const std::string& utf8name, bool boolValue) const; + MaybeOrValue Set(const std::string& utf8name, double numberValue) const; + + MaybeOrValue Get(uint32_t index) const; + MaybeOrValue Set(uint32_t index, const napi_value value) const; + MaybeOrValue Set(uint32_t index, const Napi::Value value) const; + MaybeOrValue Set(uint32_t index, const char* utf8value) const; + MaybeOrValue Set(uint32_t index, const std::string& utf8value) const; + MaybeOrValue Set(uint32_t index, bool boolValue) const; + MaybeOrValue Set(uint32_t index, double numberValue) const; + + protected: + ObjectReference(const ObjectReference&); +}; + +class FunctionReference : public Reference { + public: + FunctionReference(); + FunctionReference(napi_env env, napi_ref ref); + + // A reference can be moved but cannot be copied. + FunctionReference(Reference&& other); + FunctionReference& operator=(Reference&& other); + FunctionReference(FunctionReference&& other); + FunctionReference& operator=(FunctionReference&& other); + NAPI_DISALLOW_ASSIGN_COPY(FunctionReference) + + MaybeOrValue operator()( + const std::initializer_list& args) const; + + MaybeOrValue Call( + const std::initializer_list& args) const; + MaybeOrValue Call(const std::vector& args) const; + MaybeOrValue Call( + napi_value recv, const std::initializer_list& args) const; + MaybeOrValue Call(napi_value recv, + const std::vector& args) const; + MaybeOrValue Call(napi_value recv, + size_t argc, + const napi_value* args) const; + + MaybeOrValue MakeCallback( + napi_value recv, + const std::initializer_list& args, + napi_async_context context = nullptr) const; + MaybeOrValue MakeCallback( + napi_value recv, + const std::vector& args, + napi_async_context context = nullptr) const; + MaybeOrValue MakeCallback( + napi_value recv, + size_t argc, + const napi_value* args, + napi_async_context context = nullptr) const; + + MaybeOrValue New(const std::initializer_list& args) const; + MaybeOrValue New(const std::vector& args) const; +}; + +// Shortcuts to creating a new reference with inferred type and refcount = 0. +template +Reference Weak(T value); +ObjectReference Weak(Object value); +FunctionReference Weak(Function value); + +// Shortcuts to creating a new reference with inferred type and refcount = 1. +template +Reference Persistent(T value); +ObjectReference Persistent(Object value); +FunctionReference Persistent(Function value); + +/// A persistent reference to a JavaScript error object. Use of this class +/// depends somewhat on whether C++ exceptions are enabled at compile time. +/// +/// ### Handling Errors With C++ Exceptions +/// +/// If C++ exceptions are enabled, then the `Error` class extends +/// `std::exception` and enables integrated error-handling for C++ exceptions +/// and JavaScript exceptions. +/// +/// If a Node-API call fails without executing any JavaScript code (for +/// example due to an invalid argument), then the Node-API wrapper +/// automatically converts and throws the error as a C++ exception of type +/// `Napi::Error`. Or if a JavaScript function called by C++ code via Node-API +/// throws a JavaScript exception, then the Node-API wrapper automatically +/// converts and throws it as a C++ exception of type `Napi::Error`. +/// +/// If a C++ exception of type `Napi::Error` escapes from a Node-API C++ +/// callback, then the Node-API wrapper automatically converts and throws it +/// as a JavaScript exception. Therefore, catching a C++ exception of type +/// `Napi::Error` prevents a JavaScript exception from being thrown. +/// +/// #### Example 1A - Throwing a C++ exception: +/// +/// Napi::Env env = ... +/// throw Napi::Error::New(env, "Example exception"); +/// +/// Following C++ statements will not be executed. The exception will bubble +/// up as a C++ exception of type `Napi::Error`, until it is either caught +/// while still in C++, or else automatically propataged as a JavaScript +/// exception when the callback returns to JavaScript. +/// +/// #### Example 2A - Propagating a Node-API C++ exception: +/// +/// Napi::Function jsFunctionThatThrows = someObj.As(); +/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); +/// +/// Following C++ statements will not be executed. The exception will bubble +/// up as a C++ exception of type `Napi::Error`, until it is either caught +/// while still in C++, or else automatically propagated as a JavaScript +/// exception when the callback returns to JavaScript. +/// +/// #### Example 3A - Handling a Node-API C++ exception: +/// +/// Napi::Function jsFunctionThatThrows = someObj.As(); +/// Napi::Value result; +/// try { +/// result = jsFunctionThatThrows({ arg1, arg2 }); +/// } catch (const Napi::Error& e) { +/// cerr << "Caught JavaScript exception: " + e.what(); +/// } +/// +/// Since the exception was caught here, it will not be propagated as a +/// JavaScript exception. +/// +/// ### Handling Errors Without C++ Exceptions +/// +/// If C++ exceptions are disabled (by defining `NAPI_DISABLE_CPP_EXCEPTIONS`) +/// then this class does not extend `std::exception`, and APIs in the `Napi` +/// namespace do not throw C++ exceptions when they fail. Instead, they raise +/// _pending_ JavaScript exceptions and return _empty_ `Value`s. Calling code +/// should check `Value::IsEmpty()` before attempting to use a returned value, +/// and may use methods on the `Env` class to check for, get, and clear a +/// pending JavaScript exception. If the pending exception is not cleared, it +/// will be thrown when the native callback returns to JavaScript. +/// +/// #### Example 1B - Throwing a JS exception +/// +/// Napi::Env env = ... +/// Napi::Error::New(env, "Example +/// exception").ThrowAsJavaScriptException(); return; +/// +/// After throwing a JS exception, the code should generally return +/// immediately from the native callback, after performing any necessary +/// cleanup. +/// +/// #### Example 2B - Propagating a Node-API JS exception: +/// +/// Napi::Function jsFunctionThatThrows = someObj.As(); +/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); +/// if (result.IsEmpty()) return; +/// +/// An empty value result from a Node-API call indicates an error occurred, +/// and a JavaScript exception is pending. To let the exception propagate, the +/// code should generally return immediately from the native callback, after +/// performing any necessary cleanup. +/// +/// #### Example 3B - Handling a Node-API JS exception: +/// +/// Napi::Function jsFunctionThatThrows = someObj.As(); +/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); +/// if (result.IsEmpty()) { +/// Napi::Error e = env.GetAndClearPendingException(); +/// cerr << "Caught JavaScript exception: " + e.Message(); +/// } +/// +/// Since the exception was cleared here, it will not be propagated as a +/// JavaScript exception after the native callback returns. +class Error : public ObjectReference +#ifdef NAPI_CPP_EXCEPTIONS + , + public std::exception +#endif // NAPI_CPP_EXCEPTIONS +{ + public: + static Error New(napi_env env); + static Error New(napi_env env, const char* message); + static Error New(napi_env env, const std::string& message); + + static NAPI_NO_RETURN void Fatal(const char* location, const char* message); + + Error(); + Error(napi_env env, napi_value value); + + // An error can be moved or copied. + Error(Error&& other); + Error& operator=(Error&& other); + Error(const Error&); + Error& operator=(const Error&); + + const std::string& Message() const NAPI_NOEXCEPT; + void ThrowAsJavaScriptException() const; + + Object Value() const; + +#ifdef NAPI_CPP_EXCEPTIONS + const char* what() const NAPI_NOEXCEPT override; +#endif // NAPI_CPP_EXCEPTIONS + + protected: + /// !cond INTERNAL + using create_error_fn = napi_status (*)(napi_env envb, + napi_value code, + napi_value msg, + napi_value* result); + + template + static TError New(napi_env env, + const char* message, + size_t length, + create_error_fn create_error); + /// !endcond + + private: + static inline const char* ERROR_WRAP_VALUE() NAPI_NOEXCEPT; + mutable std::string _message; +}; + +class TypeError : public Error { + public: + static TypeError New(napi_env env, const char* message); + static TypeError New(napi_env env, const std::string& message); + + TypeError(); + TypeError(napi_env env, napi_value value); +}; + +class RangeError : public Error { + public: + static RangeError New(napi_env env, const char* message); + static RangeError New(napi_env env, const std::string& message); + + RangeError(); + RangeError(napi_env env, napi_value value); +}; + +class CallbackInfo { + public: + CallbackInfo(napi_env env, napi_callback_info info); + ~CallbackInfo(); + + // Disallow copying to prevent multiple free of _dynamicArgs + NAPI_DISALLOW_ASSIGN_COPY(CallbackInfo) + + Napi::Env Env() const; + Value NewTarget() const; + bool IsConstructCall() const; + size_t Length() const; + const Value operator[](size_t index) const; + Value This() const; + void* Data() const; + void SetData(void* data); + operator napi_callback_info() const; + + private: + const size_t _staticArgCount = 6; + napi_env _env; + napi_callback_info _info; + napi_value _this; + size_t _argc; + napi_value* _argv; + napi_value _staticArgs[6]; + napi_value* _dynamicArgs; + void* _data; +}; + +class PropertyDescriptor { + public: + using GetterCallback = Napi::Value (*)(const Napi::CallbackInfo& info); + using SetterCallback = void (*)(const Napi::CallbackInfo& info); + +#ifndef NODE_ADDON_API_DISABLE_DEPRECATED + template + static PropertyDescriptor Accessor( + const char* utf8name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + const std::string& utf8name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + napi_value name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Name name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + const char* utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + const std::string& utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + napi_value name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Name name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + const char* utf8name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + const std::string& utf8name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + napi_value name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + Name name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); +#endif // !NODE_ADDON_API_DISABLE_DEPRECATED + + template + static PropertyDescriptor Accessor( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + const std::string& utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + Name name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + const std::string& utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + Name name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + Name name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + Name name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + Napi::Env env, + Napi::Object object, + Name name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor Value( + const char* utf8name, + napi_value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor Value( + const std::string& utf8name, + napi_value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor Value( + napi_value name, + napi_value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor Value( + Name name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + + PropertyDescriptor(napi_property_descriptor desc); + + operator napi_property_descriptor&(); + operator const napi_property_descriptor&() const; + + private: + napi_property_descriptor _desc; +}; + +/// Property descriptor for use with `ObjectWrap::DefineClass()`. +/// +/// This is different from the standalone `PropertyDescriptor` because it is +/// specific to each `ObjectWrap` subclass. This prevents using descriptors +/// from a different class when defining a new class (preventing the callbacks +/// from having incorrect `this` pointers). +template +class ClassPropertyDescriptor { + public: + ClassPropertyDescriptor(napi_property_descriptor desc) : _desc(desc) {} + + operator napi_property_descriptor&() { return _desc; } + operator const napi_property_descriptor&() const { return _desc; } + + private: + napi_property_descriptor _desc; +}; + +template +struct MethodCallbackData { + TCallback callback; + void* data; +}; + +template +struct AccessorCallbackData { + TGetterCallback getterCallback; + TSetterCallback setterCallback; + void* data; +}; + +template +class InstanceWrap { + public: + using InstanceVoidMethodCallback = void (T::*)(const CallbackInfo& info); + using InstanceMethodCallback = Napi::Value (T::*)(const CallbackInfo& info); + using InstanceGetterCallback = Napi::Value (T::*)(const CallbackInfo& info); + using InstanceSetterCallback = void (T::*)(const CallbackInfo& info, + const Napi::Value& value); + + using PropertyDescriptor = ClassPropertyDescriptor; + + static PropertyDescriptor InstanceMethod( + const char* utf8name, + InstanceVoidMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceMethod( + const char* utf8name, + InstanceMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceMethod( + Symbol name, + InstanceVoidMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceMethod( + Symbol name, + InstanceMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceMethod( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceMethod( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceMethod( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceMethod( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceAccessor( + const char* utf8name, + InstanceGetterCallback getter, + InstanceSetterCallback setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceAccessor( + Symbol name, + InstanceGetterCallback getter, + InstanceSetterCallback setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceAccessor( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceAccessor( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceValue( + const char* utf8name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor InstanceValue( + Symbol name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + + protected: + static void AttachPropData(napi_env env, + napi_value value, + const napi_property_descriptor* prop); + + private: + using This = InstanceWrap; + + using InstanceVoidMethodCallbackData = + MethodCallbackData; + using InstanceMethodCallbackData = + MethodCallbackData; + using InstanceAccessorCallbackData = + AccessorCallbackData; + + static napi_value InstanceVoidMethodCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value InstanceMethodCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value InstanceGetterCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value InstanceSetterCallbackWrapper(napi_env env, + napi_callback_info info); + + template + static napi_value WrappedMethod(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT; + + template + struct SetterTag {}; + + template + static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { + return &This::WrappedMethod; + } + static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { + return nullptr; + } +}; + +/// Base class to be extended by C++ classes exposed to JavaScript; each C++ +/// class instance gets "wrapped" by a JavaScript object that is managed by this +/// class. +/// +/// At initialization time, the `DefineClass()` method must be used to +/// hook up the accessor and method callbacks. It takes a list of +/// property descriptors, which can be constructed via the various +/// static methods on the base class. +/// +/// #### Example: +/// +/// class Example: public Napi::ObjectWrap { +/// public: +/// static void Initialize(Napi::Env& env, Napi::Object& target) { +/// Napi::Function constructor = DefineClass(env, "Example", { +/// InstanceAccessor<&Example::GetSomething, +/// &Example::SetSomething>("value"), +/// InstanceMethod<&Example::DoSomething>("doSomething"), +/// }); +/// target.Set("Example", constructor); +/// } +/// +/// Example(const Napi::CallbackInfo& info); // Constructor +/// Napi::Value GetSomething(const Napi::CallbackInfo& info); +/// void SetSomething(const Napi::CallbackInfo& info, const Napi::Value& +/// value); Napi::Value DoSomething(const Napi::CallbackInfo& info); +/// } +template +class ObjectWrap : public InstanceWrap, public Reference { + public: + ObjectWrap(const CallbackInfo& callbackInfo); + virtual ~ObjectWrap(); + + static T* Unwrap(Object wrapper); + + // Methods exposed to JavaScript must conform to one of these callback + // signatures. + using StaticVoidMethodCallback = void (*)(const CallbackInfo& info); + using StaticMethodCallback = Napi::Value (*)(const CallbackInfo& info); + using StaticGetterCallback = Napi::Value (*)(const CallbackInfo& info); + using StaticSetterCallback = void (*)(const CallbackInfo& info, + const Napi::Value& value); + + using PropertyDescriptor = ClassPropertyDescriptor; + + static Function DefineClass( + Napi::Env env, + const char* utf8name, + const std::initializer_list& properties, + void* data = nullptr); + static Function DefineClass(Napi::Env env, + const char* utf8name, + const std::vector& properties, + void* data = nullptr); + static PropertyDescriptor StaticMethod( + const char* utf8name, + StaticVoidMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticMethod( + const char* utf8name, + StaticMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticMethod( + Symbol name, + StaticVoidMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticMethod( + Symbol name, + StaticMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticMethod( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticMethod( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticMethod( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticMethod( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticAccessor( + const char* utf8name, + StaticGetterCallback getter, + StaticSetterCallback setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticAccessor( + Symbol name, + StaticGetterCallback getter, + StaticSetterCallback setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticAccessor( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticAccessor( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticValue( + const char* utf8name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor StaticValue( + Symbol name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + static Napi::Value OnCalledAsFunction(const Napi::CallbackInfo& callbackInfo); + virtual void Finalize(Napi::Env env); + + private: + using This = ObjectWrap; + + static napi_value ConstructorCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value StaticVoidMethodCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value StaticMethodCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value StaticGetterCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value StaticSetterCallbackWrapper(napi_env env, + napi_callback_info info); + static void FinalizeCallback(napi_env env, void* data, void* hint); + static Function DefineClass(Napi::Env env, + const char* utf8name, + const size_t props_count, + const napi_property_descriptor* props, + void* data = nullptr); + + using StaticVoidMethodCallbackData = + MethodCallbackData; + using StaticMethodCallbackData = MethodCallbackData; + + using StaticAccessorCallbackData = + AccessorCallbackData; + + template + static napi_value WrappedMethod(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT; + + template + struct StaticSetterTag {}; + + template + static napi_callback WrapStaticSetter(StaticSetterTag) NAPI_NOEXCEPT { + return &This::WrappedMethod; + } + static napi_callback WrapStaticSetter(StaticSetterTag) + NAPI_NOEXCEPT { + return nullptr; + } + + bool _construction_failed = true; +}; + +class HandleScope { + public: + HandleScope(napi_env env, napi_handle_scope scope); + explicit HandleScope(Napi::Env env); + ~HandleScope(); + + // Disallow copying to prevent double close of napi_handle_scope + NAPI_DISALLOW_ASSIGN_COPY(HandleScope) + + operator napi_handle_scope() const; + + Napi::Env Env() const; + + private: + napi_env _env; + napi_handle_scope _scope; +}; + +class EscapableHandleScope { + public: + EscapableHandleScope(napi_env env, napi_escapable_handle_scope scope); + explicit EscapableHandleScope(Napi::Env env); + ~EscapableHandleScope(); + + // Disallow copying to prevent double close of napi_escapable_handle_scope + NAPI_DISALLOW_ASSIGN_COPY(EscapableHandleScope) + + operator napi_escapable_handle_scope() const; + + Napi::Env Env() const; + Value Escape(napi_value escapee); + + private: + napi_env _env; + napi_escapable_handle_scope _scope; +}; + +#if (NAPI_VERSION > 2) +class CallbackScope { + public: + CallbackScope(napi_env env, napi_callback_scope scope); + CallbackScope(napi_env env, napi_async_context context); + virtual ~CallbackScope(); + + // Disallow copying to prevent double close of napi_callback_scope + NAPI_DISALLOW_ASSIGN_COPY(CallbackScope) + + operator napi_callback_scope() const; + + Napi::Env Env() const; + + private: + napi_env _env; + napi_callback_scope _scope; +}; +#endif + +class AsyncContext { + public: + explicit AsyncContext(napi_env env, const char* resource_name); + explicit AsyncContext(napi_env env, + const char* resource_name, + const Object& resource); + virtual ~AsyncContext(); + + AsyncContext(AsyncContext&& other); + AsyncContext& operator=(AsyncContext&& other); + NAPI_DISALLOW_ASSIGN_COPY(AsyncContext) + + operator napi_async_context() const; + + Napi::Env Env() const; + + private: + napi_env _env; + napi_async_context _context; +}; + +class AsyncWorker { + public: + virtual ~AsyncWorker(); + + // An async worker can be moved but cannot be copied. + AsyncWorker(AsyncWorker&& other); + AsyncWorker& operator=(AsyncWorker&& other); + NAPI_DISALLOW_ASSIGN_COPY(AsyncWorker) + + operator napi_async_work() const; + + Napi::Env Env() const; + + void Queue(); + void Cancel(); + void SuppressDestruct(); + + ObjectReference& Receiver(); + FunctionReference& Callback(); + + virtual void OnExecute(Napi::Env env); + virtual void OnWorkComplete(Napi::Env env, napi_status status); + + protected: + explicit AsyncWorker(const Function& callback); + explicit AsyncWorker(const Function& callback, const char* resource_name); + explicit AsyncWorker(const Function& callback, + const char* resource_name, + const Object& resource); + explicit AsyncWorker(const Object& receiver, const Function& callback); + explicit AsyncWorker(const Object& receiver, + const Function& callback, + const char* resource_name); + explicit AsyncWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource); + + explicit AsyncWorker(Napi::Env env); + explicit AsyncWorker(Napi::Env env, const char* resource_name); + explicit AsyncWorker(Napi::Env env, + const char* resource_name, + const Object& resource); + + virtual void Execute() = 0; + virtual void OnOK(); + virtual void OnError(const Error& e); + virtual void Destroy(); + virtual std::vector GetResult(Napi::Env env); + + void SetError(const std::string& error); + + private: + static inline void OnAsyncWorkExecute(napi_env env, void* asyncworker); + static inline void OnAsyncWorkComplete(napi_env env, + napi_status status, + void* asyncworker); + + napi_env _env; + napi_async_work _work; + ObjectReference _receiver; + FunctionReference _callback; + std::string _error; + bool _suppress_destruct; +}; + +#if (NAPI_VERSION > 3 && !defined(__wasm32__)) +class ThreadSafeFunction { + public: + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback, + FinalizerDataType* data); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback, + FinalizerDataType* data); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data); + + ThreadSafeFunction(); + ThreadSafeFunction(napi_threadsafe_function tsFunctionValue); + + operator napi_threadsafe_function() const; + + // This API may be called from any thread. + napi_status BlockingCall() const; + + // This API may be called from any thread. + template + napi_status BlockingCall(Callback callback) const; + + // This API may be called from any thread. + template + napi_status BlockingCall(DataType* data, Callback callback) const; + + // This API may be called from any thread. + napi_status NonBlockingCall() const; + + // This API may be called from any thread. + template + napi_status NonBlockingCall(Callback callback) const; + + // This API may be called from any thread. + template + napi_status NonBlockingCall(DataType* data, Callback callback) const; + + // This API may only be called from the main thread. + void Ref(napi_env env) const; + + // This API may only be called from the main thread. + void Unref(napi_env env) const; + + // This API may be called from any thread. + napi_status Acquire() const; + + // This API may be called from any thread. + napi_status Release() const; + + // This API may be called from any thread. + napi_status Abort() const; + + struct ConvertibleContext { + template + operator T*() { + return static_cast(context); + } + void* context; + }; + + // This API may be called from any thread. + ConvertibleContext GetContext() const; + + private: + using CallbackWrapper = std::function; + + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data, + napi_finalize wrapper); + + napi_status CallInternal(CallbackWrapper* callbackWrapper, + napi_threadsafe_function_call_mode mode) const; + + static void CallJS(napi_env env, + napi_value jsCallback, + void* context, + void* data); + + napi_threadsafe_function _tsfn; +}; + +// A TypedThreadSafeFunction by default has no context (nullptr) and can +// accept any type (void) to its CallJs. +template +class TypedThreadSafeFunction { + public: + // This API may only be called from the main thread. + // Helper function that returns nullptr if running Node-API 5+, otherwise a + // non-empty, no-op Function. This provides the ability to specify at + // compile-time a callback parameter to `New` that safely does no action + // when targeting _any_ Node-API version. +#if NAPI_VERSION > 4 + static std::nullptr_t EmptyFunctionFactory(Napi::Env env); +#else + static Napi::Function EmptyFunctionFactory(Napi::Env env); +#endif + static Napi::Function FunctionOrEmpty(Napi::Env env, + Napi::Function& callback); + +#if NAPI_VERSION > 4 + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [missing] Resource [missing] Finalizer [missing] + template + static TypedThreadSafeFunction New( + napi_env env, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [missing] Resource [passed] Finalizer [missing] + template + static TypedThreadSafeFunction New( + napi_env env, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [missing] Resource [missing] Finalizer [passed] + template + static TypedThreadSafeFunction New( + napi_env env, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [missing] Resource [passed] Finalizer [passed] + template + static TypedThreadSafeFunction New( + napi_env env, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data = nullptr); +#endif + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [passed] Resource [missing] Finalizer [missing] + template + static TypedThreadSafeFunction New( + napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [passed] Resource [passed] Finalizer [missing] + template + static TypedThreadSafeFunction New( + napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [passed] Resource [missing] Finalizer [passed] + template + static TypedThreadSafeFunction New( + napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [passed] Resource [passed] Finalizer [passed] + template + static TypedThreadSafeFunction New( + napi_env env, + CallbackType callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data = nullptr); + + TypedThreadSafeFunction(); + TypedThreadSafeFunction(napi_threadsafe_function tsFunctionValue); + + operator napi_threadsafe_function() const; + + // This API may be called from any thread. + napi_status BlockingCall(DataType* data = nullptr) const; + + // This API may be called from any thread. + napi_status NonBlockingCall(DataType* data = nullptr) const; + + // This API may only be called from the main thread. + void Ref(napi_env env) const; + + // This API may only be called from the main thread. + void Unref(napi_env env) const; + + // This API may be called from any thread. + napi_status Acquire() const; + + // This API may be called from any thread. + napi_status Release() const; + + // This API may be called from any thread. + napi_status Abort() const; + + // This API may be called from any thread. + ContextType* GetContext() const; + + private: + template + static TypedThreadSafeFunction New( + napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data, + napi_finalize wrapper); + + static void CallJsInternal(napi_env env, + napi_value jsCallback, + void* context, + void* data); + + protected: + napi_threadsafe_function _tsfn; +}; +template +class AsyncProgressWorkerBase : public AsyncWorker { + public: + virtual void OnWorkProgress(DataType* data) = 0; + class ThreadSafeData { + public: + ThreadSafeData(AsyncProgressWorkerBase* asyncprogressworker, DataType* data) + : _asyncprogressworker(asyncprogressworker), _data(data) {} + + AsyncProgressWorkerBase* asyncprogressworker() { + return _asyncprogressworker; + }; + DataType* data() { return _data; }; + + private: + AsyncProgressWorkerBase* _asyncprogressworker; + DataType* _data; + }; + void OnWorkComplete(Napi::Env env, napi_status status) override; + + protected: + explicit AsyncProgressWorkerBase(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource, + size_t queue_size = 1); + virtual ~AsyncProgressWorkerBase(); + +// Optional callback of Napi::ThreadSafeFunction only available after +// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 +#if NAPI_VERSION > 4 + explicit AsyncProgressWorkerBase(Napi::Env env, + const char* resource_name, + const Object& resource, + size_t queue_size = 1); +#endif + + static inline void OnAsyncWorkProgress(Napi::Env env, + Napi::Function jsCallback, + void* data); + + napi_status NonBlockingCall(DataType* data); + + private: + ThreadSafeFunction _tsfn; + bool _work_completed = false; + napi_status _complete_status; + static inline void OnThreadSafeFunctionFinalize( + Napi::Env env, void* data, AsyncProgressWorkerBase* context); +}; + +template +class AsyncProgressWorker : public AsyncProgressWorkerBase { + public: + virtual ~AsyncProgressWorker(); + + class ExecutionProgress { + friend class AsyncProgressWorker; + + public: + void Signal() const; + void Send(const T* data, size_t count) const; + + private: + explicit ExecutionProgress(AsyncProgressWorker* worker) : _worker(worker) {} + AsyncProgressWorker* const _worker; + }; + + void OnWorkProgress(void*) override; + + protected: + explicit AsyncProgressWorker(const Function& callback); + explicit AsyncProgressWorker(const Function& callback, + const char* resource_name); + explicit AsyncProgressWorker(const Function& callback, + const char* resource_name, + const Object& resource); + explicit AsyncProgressWorker(const Object& receiver, + const Function& callback); + explicit AsyncProgressWorker(const Object& receiver, + const Function& callback, + const char* resource_name); + explicit AsyncProgressWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource); + +// Optional callback of Napi::ThreadSafeFunction only available after +// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 +#if NAPI_VERSION > 4 + explicit AsyncProgressWorker(Napi::Env env); + explicit AsyncProgressWorker(Napi::Env env, const char* resource_name); + explicit AsyncProgressWorker(Napi::Env env, + const char* resource_name, + const Object& resource); +#endif + virtual void Execute(const ExecutionProgress& progress) = 0; + virtual void OnProgress(const T* data, size_t count) = 0; + + private: + void Execute() override; + void Signal(); + void SendProgress_(const T* data, size_t count); + + std::mutex _mutex; + T* _asyncdata; + size_t _asyncsize; + bool _signaled; +}; + +template +class AsyncProgressQueueWorker + : public AsyncProgressWorkerBase> { + public: + virtual ~AsyncProgressQueueWorker(){}; + + class ExecutionProgress { + friend class AsyncProgressQueueWorker; + + public: + void Signal() const; + void Send(const T* data, size_t count) const; + + private: + explicit ExecutionProgress(AsyncProgressQueueWorker* worker) + : _worker(worker) {} + AsyncProgressQueueWorker* const _worker; + }; + + void OnWorkComplete(Napi::Env env, napi_status status) override; + void OnWorkProgress(std::pair*) override; + + protected: + explicit AsyncProgressQueueWorker(const Function& callback); + explicit AsyncProgressQueueWorker(const Function& callback, + const char* resource_name); + explicit AsyncProgressQueueWorker(const Function& callback, + const char* resource_name, + const Object& resource); + explicit AsyncProgressQueueWorker(const Object& receiver, + const Function& callback); + explicit AsyncProgressQueueWorker(const Object& receiver, + const Function& callback, + const char* resource_name); + explicit AsyncProgressQueueWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource); + +// Optional callback of Napi::ThreadSafeFunction only available after +// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 +#if NAPI_VERSION > 4 + explicit AsyncProgressQueueWorker(Napi::Env env); + explicit AsyncProgressQueueWorker(Napi::Env env, const char* resource_name); + explicit AsyncProgressQueueWorker(Napi::Env env, + const char* resource_name, + const Object& resource); +#endif + virtual void Execute(const ExecutionProgress& progress) = 0; + virtual void OnProgress(const T* data, size_t count) = 0; + + private: + void Execute() override; + void Signal() const; + void SendProgress_(const T* data, size_t count); +}; +#endif // NAPI_VERSION > 3 && !defined(__wasm32__) + +// Memory management. +class MemoryManagement { + public: + static int64_t AdjustExternalMemory(Env env, int64_t change_in_bytes); +}; + +// Version management +class VersionManagement { + public: + static uint32_t GetNapiVersion(Env env); + static const napi_node_version* GetNodeVersion(Env env); +}; + +#if NAPI_VERSION > 5 +template +class Addon : public InstanceWrap { + public: + static inline Object Init(Env env, Object exports); + static T* Unwrap(Object wrapper); + + protected: + using AddonProp = ClassPropertyDescriptor; + void DefineAddon(Object exports, + const std::initializer_list& props); + Napi::Object DefineProperties(Object object, + const std::initializer_list& props); + + private: + Object entry_point_; +}; +#endif // NAPI_VERSION > 5 + +#ifdef NAPI_CPP_CUSTOM_NAMESPACE +} // namespace NAPI_CPP_CUSTOM_NAMESPACE +#endif + +} // namespace Napi + +// Inline implementations of all the above class methods are included here. +#include "napi-inl.h" + +#endif // SRC_NAPI_H_ diff --git a/node_modules/node-addon-api/node_api.gyp b/node_modules/node-addon-api/node_api.gyp new file mode 100644 index 00000000..4ff0ae7d --- /dev/null +++ b/node_modules/node-addon-api/node_api.gyp @@ -0,0 +1,9 @@ +{ + 'targets': [ + { + 'target_name': 'nothing', + 'type': 'static_library', + 'sources': [ 'nothing.c' ] + } + ] +} diff --git a/node_modules/node-addon-api/noexcept.gypi b/node_modules/node-addon-api/noexcept.gypi new file mode 100644 index 00000000..404a05f3 --- /dev/null +++ b/node_modules/node-addon-api/noexcept.gypi @@ -0,0 +1,26 @@ +{ + 'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ], + 'cflags': [ '-fno-exceptions' ], + 'cflags_cc': [ '-fno-exceptions' ], + 'conditions': [ + ["OS=='win'", { + # _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi + #"defines": [ + # "_HAS_EXCEPTIONS=0" + #], + "msvs_settings": { + "VCCLCompilerTool": { + 'ExceptionHandling': 0, + 'EnablePREfast': 'true', + }, + }, + }], + ["OS=='mac'", { + 'xcode_settings': { + 'CLANG_CXX_LIBRARY': 'libc++', + 'MACOSX_DEPLOYMENT_TARGET': '10.7', + 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', + }, + }], + ], +} diff --git a/node_modules/node-addon-api/nothing.c b/node_modules/node-addon-api/nothing.c new file mode 100644 index 00000000..e69de29b diff --git a/node_modules/node-addon-api/package-support.json b/node_modules/node-addon-api/package-support.json new file mode 100644 index 00000000..10d3607a --- /dev/null +++ b/node_modules/node-addon-api/package-support.json @@ -0,0 +1,21 @@ +{ + "versions": [ + { + "version": "*", + "target": { + "node": "active" + }, + "response": { + "type": "time-permitting", + "paid": false, + "contact": { + "name": "node-addon-api team", + "url": "https://github.com/nodejs/node-addon-api/issues" + } + }, + "backing": [ { "project": "https://github.com/nodejs" }, + { "foundation": "https://openjsf.org/" } + ] + } + ] +} diff --git a/node_modules/node-addon-api/package.json b/node_modules/node-addon-api/package.json new file mode 100644 index 00000000..3ec3776e --- /dev/null +++ b/node_modules/node-addon-api/package.json @@ -0,0 +1,456 @@ +{ + "bugs": { + "url": "https://github.com/nodejs/node-addon-api/issues" + }, + "contributors": [ + { + "name": "Abhishek Kumar Singh", + "url": "https://github.com/abhi11210646" + }, + { + "name": "Alba Mendez", + "url": "https://github.com/jmendeth" + }, + { + "name": "Alexander Floh", + "url": "https://github.com/alexanderfloh" + }, + { + "name": "Ammar Faizi", + "url": "https://github.com/ammarfaizi2" + }, + { + "name": "András Timár, Dr", + "url": "https://github.com/timarandras" + }, + { + "name": "Andrew Petersen", + "url": "https://github.com/kirbysayshi" + }, + { + "name": "Anisha Rohra", + "url": "https://github.com/anisha-rohra" + }, + { + "name": "Anna Henningsen", + "url": "https://github.com/addaleax" + }, + { + "name": "Arnaud Botella", + "url": "https://github.com/BotellaA" + }, + { + "name": "Arunesh Chandra", + "url": "https://github.com/aruneshchandra" + }, + { + "name": "Azlan Mukhtar", + "url": "https://github.com/azlan" + }, + { + "name": "Ben Berman", + "url": "https://github.com/rivertam" + }, + { + "name": "Benjamin Byholm", + "url": "https://github.com/kkoopa" + }, + { + "name": "Bill Gallafent", + "url": "https://github.com/gallafent" + }, + { + "name": "blagoev", + "url": "https://github.com/blagoev" + }, + { + "name": "Bruce A. MacNaughton", + "url": "https://github.com/bmacnaughton" + }, + { + "name": "Cory Mickelson", + "url": "https://github.com/corymickelson" + }, + { + "name": "Daniel Bevenius", + "url": "https://github.com/danbev" + }, + { + "name": "Dante Calderón", + "url": "https://github.com/dantehemerson" + }, + { + "name": "Darshan Sen", + "url": "https://github.com/RaisinTen" + }, + { + "name": "David Halls", + "url": "https://github.com/davedoesdev" + }, + { + "name": "Deepak Rajamohan", + "url": "https://github.com/deepakrkris" + }, + { + "name": "Dmitry Ashkadov", + "url": "https://github.com/dmitryash" + }, + { + "name": "Dongjin Na", + "url": "https://github.com/nadongguri" + }, + { + "name": "Doni Rubiagatra", + "url": "https://github.com/rubiagatra" + }, + { + "name": "Eric Bickle", + "url": "https://github.com/ebickle" + }, + { + "name": "extremeheat", + "url": "https://github.com/extremeheat" + }, + { + "name": "Feng Yu", + "url": "https://github.com/F3n67u" + }, + { + "name": "Ferdinand Holzer", + "url": "https://github.com/fholzer" + }, + { + "name": "Gabriel Schulhof", + "url": "https://github.com/gabrielschulhof" + }, + { + "name": "Guenter Sandner", + "url": "https://github.com/gms1" + }, + { + "name": "Gus Caplan", + "url": "https://github.com/devsnek" + }, + { + "name": "Helio Frota", + "url": "https://github.com/helio-frota" + }, + { + "name": "Hitesh Kanwathirtha", + "url": "https://github.com/digitalinfinity" + }, + { + "name": "ikokostya", + "url": "https://github.com/ikokostya" + }, + { + "name": "Jack Xia", + "url": "https://github.com/JckXia" + }, + { + "name": "Jake Barnes", + "url": "https://github.com/DuBistKomisch" + }, + { + "name": "Jake Yoon", + "url": "https://github.com/yjaeseok" + }, + { + "name": "Jason Ginchereau", + "url": "https://github.com/jasongin" + }, + { + "name": "Jenny", + "url": "https://github.com/egg-bread" + }, + { + "name": "Jeroen Janssen", + "url": "https://github.com/japj" + }, + { + "name": "Jim Schlight", + "url": "https://github.com/jschlight" + }, + { + "name": "Jinho Bang", + "url": "https://github.com/romandev" + }, + { + "name": "José Expósito", + "url": "https://github.com/JoseExposito" + }, + { + "name": "joshgarde", + "url": "https://github.com/joshgarde" + }, + { + "name": "Julian Mesa", + "url": "https://github.com/julianmesa-gitkraken" + }, + { + "name": "Kasumi Hanazuki", + "url": "https://github.com/hanazuki" + }, + { + "name": "Kelvin", + "url": "https://github.com/kelvinhammond" + }, + { + "name": "Kevin Eady", + "url": "https://github.com/KevinEady" + }, + { + "name": "Kévin VOYER", + "url": "https://github.com/kecsou" + }, + { + "name": "kidneysolo", + "url": "https://github.com/kidneysolo" + }, + { + "name": "Koki Nishihara", + "url": "https://github.com/Nishikoh" + }, + { + "name": "Konstantin Tarkus", + "url": "https://github.com/koistya" + }, + { + "name": "Kyle Farnung", + "url": "https://github.com/kfarnung" + }, + { + "name": "Kyle Kovacs", + "url": "https://github.com/nullromo" + }, + { + "name": "legendecas", + "url": "https://github.com/legendecas" + }, + { + "name": "LongYinan", + "url": "https://github.com/Brooooooklyn" + }, + { + "name": "Lovell Fuller", + "url": "https://github.com/lovell" + }, + { + "name": "Luciano Martorella", + "url": "https://github.com/lmartorella" + }, + { + "name": "mastergberry", + "url": "https://github.com/mastergberry" + }, + { + "name": "Mathias Küsel", + "url": "https://github.com/mathiask88" + }, + { + "name": "Matteo Collina", + "url": "https://github.com/mcollina" + }, + { + "name": "Michael Dawson", + "url": "https://github.com/mhdawson" + }, + { + "name": "Michael Price", + "url": "https://github.com/mikepricedev" + }, + { + "name": "Michele Campus", + "url": "https://github.com/kYroL01" + }, + { + "name": "Mikhail Cheshkov", + "url": "https://github.com/mcheshkov" + }, + { + "name": "nempoBu4", + "url": "https://github.com/nempoBu4" + }, + { + "name": "Nicola Del Gobbo", + "url": "https://github.com/NickNaso" + }, + { + "name": "Nick Soggin", + "url": "https://github.com/iSkore" + }, + { + "name": "Nikolai Vavilov", + "url": "https://github.com/seishun" + }, + { + "name": "Nurbol Alpysbayev", + "url": "https://github.com/anurbol" + }, + { + "name": "pacop", + "url": "https://github.com/pacop" + }, + { + "name": "Peter Šándor", + "url": "https://github.com/petersandor" + }, + { + "name": "Philipp Renoth", + "url": "https://github.com/DaAitch" + }, + { + "name": "rgerd", + "url": "https://github.com/rgerd" + }, + { + "name": "Richard Lau", + "url": "https://github.com/richardlau" + }, + { + "name": "Rolf Timmermans", + "url": "https://github.com/rolftimmermans" + }, + { + "name": "Ross Weir", + "url": "https://github.com/ross-weir" + }, + { + "name": "Ryuichi Okumura", + "url": "https://github.com/okuryu" + }, + { + "name": "Saint Gabriel", + "url": "https://github.com/chineduG" + }, + { + "name": "Sampson Gao", + "url": "https://github.com/sampsongao" + }, + { + "name": "Sam Roberts", + "url": "https://github.com/sam-github" + }, + { + "name": "strager", + "url": "https://github.com/strager" + }, + { + "name": "Taylor Woll", + "url": "https://github.com/boingoing" + }, + { + "name": "Thomas Gentilhomme", + "url": "https://github.com/fraxken" + }, + { + "name": "Tim Rach", + "url": "https://github.com/timrach" + }, + { + "name": "Tobias Nießen", + "url": "https://github.com/tniessen" + }, + { + "name": "todoroff", + "url": "https://github.com/todoroff" + }, + { + "name": "Tux3", + "url": "https://github.com/tux3" + }, + { + "name": "Vlad Velmisov", + "url": "https://github.com/Velmisov" + }, + { + "name": "Vladimir Morozov", + "url": "https://github.com/vmoroz" + + }, + { + "name": "WenheLI", + "url": "https://github.com/WenheLI" + }, + { + "name": "Xuguang Mei", + "url": "https://github.com/meixg" + }, + { + "name": "Yohei Kishimoto", + "url": "https://github.com/morokosi" + }, + { + "name": "Yulong Wang", + "url": "https://github.com/fs-eire" + }, + { + "name": "Ziqiu Zhao", + "url": "https://github.com/ZzqiZQute" + }, + { + "name": "Feng Yu", + "url": "https://github.com/F3n67u" + } + ], + "description": "Node.js API (Node-API)", + "devDependencies": { + "benchmark": "^2.1.4", + "bindings": "^1.5.0", + "clang-format": "^1.4.0", + "eslint": "^7.32.0", + "eslint-config-semistandard": "^16.0.0", + "eslint-config-standard": "^16.0.3", + "eslint-plugin-import": "^2.24.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "fs-extra": "^9.0.1", + "path": "^0.12.7", + "pre-commit": "^1.2.2", + "safe-buffer": "^5.1.1" + }, + "directories": {}, + "gypfile": false, + "homepage": "https://github.com/nodejs/node-addon-api", + "keywords": [ + "n-api", + "napi", + "addon", + "native", + "bindings", + "c", + "c++", + "nan", + "node-addon-api" + ], + "license": "MIT", + "main": "index.js", + "name": "node-addon-api", + "readme": "README.md", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/node-addon-api.git" + }, + "files": [ + "*.{c,h,gyp,gypi}", + "package-support.json", + "tools/" + ], + "scripts": { + "prebenchmark": "node-gyp rebuild -C benchmark", + "benchmark": "node benchmark", + "pretest": "node-gyp rebuild -C test", + "test": "node test", + "test:debug": "node-gyp rebuild -C test --debug && NODE_API_BUILD_CONFIG=Debug node ./test/index.js", + "predev": "node-gyp rebuild -C test --debug", + "dev": "node test", + "predev:incremental": "node-gyp configure build -C test --debug", + "dev:incremental": "node test", + "doc": "doxygen doc/Doxyfile", + "lint": "node tools/eslint-format && node tools/clang-format", + "lint:fix": "node tools/clang-format --fix && node tools/eslint-format --fix" + }, + "pre-commit": "lint", + "version": "5.1.0", + "support": true +} diff --git a/node_modules/node-addon-api/tools/README.md b/node_modules/node-addon-api/tools/README.md new file mode 100644 index 00000000..6b80e94f --- /dev/null +++ b/node_modules/node-addon-api/tools/README.md @@ -0,0 +1,73 @@ +# Tools + +## clang-format + +The clang-format checking tools is designed to check changed lines of code compared to given git-refs. + +## Migration Script + +The migration tool is designed to reduce repetitive work in the migration process. However, the script is not aiming to convert every thing for you. There are usually some small fixes and major reconstruction required. + +### How To Use + +To run the conversion script, first make sure you have the latest `node-addon-api` in your `node_modules` directory. +``` +npm install node-addon-api +``` + +Then run the script passing your project directory +``` +node ./node_modules/node-addon-api/tools/conversion.js ./ +``` + +After finish, recompile and debug things that are missed by the script. + + +### Quick Fixes +Here is the list of things that can be fixed easily. + 1. Change your methods' return value to void if it doesn't return value to JavaScript. + 2. Use `.` to access attribute or to invoke member function in Napi::Object instead of `->`. + 3. `Napi::New(env, value);` to `Napi::[Type]::New(env, value); + + +### Major Reconstructions +The implementation of `Napi::ObjectWrap` is significantly different from NAN's. `Napi::ObjectWrap` takes a pointer to the wrapped object and creates a reference to the wrapped object inside ObjectWrap constructor. `Napi::ObjectWrap` also associates wrapped object's instance methods to Javascript module instead of static methods like NAN. + +So if you use Nan::ObjectWrap in your module, you will need to execute the following steps. + + 1. Convert your [ClassName]::New function to a constructor function that takes a `Napi::CallbackInfo`. Declare it as +``` +[ClassName](const Napi::CallbackInfo& info); +``` +and define it as +``` +[ClassName]::[ClassName](const Napi::CallbackInfo& info) : Napi::ObjectWrap<[ClassName]>(info){ + ... +} +``` +This way, the `Napi::ObjectWrap` constructor will be invoked after the object has been instantiated and `Napi::ObjectWrap` can use the `this` pointer to create a reference to the wrapped object. + + 2. Move your original constructor code into the new constructor. Delete your original constructor. + 3. In your class initialization function, associate native methods in the following way. +``` +Napi::FunctionReference constructor; + +void [ClassName]::Init(Napi::Env env, Napi::Object exports, Napi::Object module) { + Napi::HandleScope scope(env); + Napi::Function ctor = DefineClass(env, "Canvas", { + InstanceMethod<&[ClassName]::Func1>("Func1"), + InstanceMethod<&[ClassName]::Func2>("Func2"), + InstanceAccessor<&[ClassName]::ValueGetter>("Value"), + StaticMethod<&[ClassName]::StaticMethod>("MethodName"), + InstanceValue("Value", Napi::[Type]::New(env, value)), + }); + + constructor = Napi::Persistent(ctor); + constructor .SuppressDestruct(); + exports.Set("[ClassName]", ctor); +} +``` + 4. In function where you need to Unwrap the ObjectWrap in NAN like `[ClassName]* native = Nan::ObjectWrap::Unwrap<[ClassName]>(info.This());`, use `this` pointer directly as the unwrapped object as each ObjectWrap instance is associated with a unique object instance. + + +If you still find issues after following this guide, please leave us an issue describing your problem and we will try to resolve it. diff --git a/node_modules/node-addon-api/tools/check-napi.js b/node_modules/node-addon-api/tools/check-napi.js new file mode 100644 index 00000000..9199af33 --- /dev/null +++ b/node_modules/node-addon-api/tools/check-napi.js @@ -0,0 +1,99 @@ +'use strict'; +// Descend into a directory structure and, for each file matching *.node, output +// based on the imports found in the file whether it's an N-API module or not. + +const fs = require('fs'); +const path = require('path'); + +// Read the output of the command, break it into lines, and use the reducer to +// decide whether the file is an N-API module or not. +function checkFile (file, command, argv, reducer) { + const child = require('child_process').spawn(command, argv, { + stdio: ['inherit', 'pipe', 'inherit'] + }); + let leftover = ''; + let isNapi; + child.stdout.on('data', (chunk) => { + if (isNapi === undefined) { + chunk = (leftover + chunk.toString()).split(/[\r\n]+/); + leftover = chunk.pop(); + isNapi = chunk.reduce(reducer, isNapi); + if (isNapi !== undefined) { + child.kill(); + } + } + }); + child.on('close', (code, signal) => { + if ((code === null && signal !== null) || (code !== 0)) { + console.log( + command + ' exited with code: ' + code + ' and signal: ' + signal); + } else { + // Green if it's a N-API module, red otherwise. + console.log( + '\x1b[' + (isNapi ? '42' : '41') + 'm' + + (isNapi ? ' N-API' : 'Not N-API') + + '\x1b[0m: ' + file); + } + }); +} + +// Use nm -a to list symbols. +function checkFileUNIX (file) { + checkFile(file, 'nm', ['-a', file], (soFar, line) => { + if (soFar === undefined) { + line = line.match(/([0-9a-f]*)? ([a-zA-Z]) (.*$)/); + if (line[2] === 'U') { + if (/^napi/.test(line[3])) { + soFar = true; + } + } + } + return soFar; + }); +} + +// Use dumpbin /imports to list symbols. +function checkFileWin32 (file) { + checkFile(file, 'dumpbin', ['/imports', file], (soFar, line) => { + if (soFar === undefined) { + line = line.match(/([0-9a-f]*)? +([a-zA-Z0-9]) (.*$)/); + if (line && /^napi/.test(line[line.length - 1])) { + soFar = true; + } + } + return soFar; + }); +} + +// Descend into a directory structure and pass each file ending in '.node' to +// one of the above checks, depending on the OS. +function recurse (top) { + fs.readdir(top, (error, items) => { + if (error) { + throw new Error('error reading directory ' + top + ': ' + error); + } + items.forEach((item) => { + item = path.join(top, item); + fs.stat(item, ((item) => (error, stats) => { + if (error) { + throw new Error('error about ' + item + ': ' + error); + } + if (stats.isDirectory()) { + recurse(item); + } else if (/[.]node$/.test(item) && + // Explicitly ignore files called 'nothing.node' because they are + // artefacts of node-addon-api having identified a version of + // Node.js that ships with a correct implementation of N-API. + path.basename(item) !== 'nothing.node') { + process.platform === 'win32' + ? checkFileWin32(item) + : checkFileUNIX(item); + } + })(item)); + }); + }); +} + +// Start with the directory given on the command line or the current directory +// if nothing was given. +recurse(process.argv.length > 3 ? process.argv[2] : '.'); diff --git a/node_modules/node-addon-api/tools/clang-format.js b/node_modules/node-addon-api/tools/clang-format.js new file mode 100644 index 00000000..e4bb4f52 --- /dev/null +++ b/node_modules/node-addon-api/tools/clang-format.js @@ -0,0 +1,71 @@ +#!/usr/bin/env node + +const spawn = require('child_process').spawnSync; +const path = require('path'); + +const filesToCheck = ['*.h', '*.cc']; +const FORMAT_START = process.env.FORMAT_START || 'main'; + +function main (args) { + let fix = false; + while (args.length > 0) { + switch (args[0]) { + case '-f': + case '--fix': + fix = true; + break; + default: + } + args.shift(); + } + + const clangFormatPath = path.dirname(require.resolve('clang-format')); + const binary = process.platform === 'win32' + ? 'node_modules\\.bin\\clang-format.cmd' + : 'node_modules/.bin/clang-format'; + const options = ['--binary=' + binary, '--style=file']; + if (fix) { + options.push(FORMAT_START); + } else { + options.push('--diff', FORMAT_START); + } + + const gitClangFormatPath = path.join(clangFormatPath, 'bin/git-clang-format'); + const result = spawn( + 'python', + [gitClangFormatPath, ...options, '--', ...filesToCheck], + { encoding: 'utf-8' } + ); + + if (result.stderr) { + console.error('Error running git-clang-format:', result.stderr); + return 2; + } + + const clangFormatOutput = result.stdout.trim(); + // Bail fast if in fix mode. + if (fix) { + console.log(clangFormatOutput); + return 0; + } + // Detect if there is any complains from clang-format + if ( + clangFormatOutput !== '' && + clangFormatOutput !== 'no modified files to format' && + clangFormatOutput !== 'clang-format did not modify any files' + ) { + console.error(clangFormatOutput); + const fixCmd = 'npm run lint:fix'; + console.error(` + ERROR: please run "${fixCmd}" to format changes in your commit + Note that when running the command locally, please keep your local + main branch and working branch up to date with nodejs/node-addon-api + to exclude un-related complains. + Or you can run "env FORMAT_START=upstream/main ${fixCmd}".`); + return 1; + } +} + +if (require.main === module) { + process.exitCode = main(process.argv.slice(2)); +} diff --git a/node_modules/node-addon-api/tools/conversion.js b/node_modules/node-addon-api/tools/conversion.js new file mode 100644 index 00000000..f89245ac --- /dev/null +++ b/node_modules/node-addon-api/tools/conversion.js @@ -0,0 +1,301 @@ +#! /usr/bin/env node + +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +const args = process.argv.slice(2); +const dir = args[0]; +if (!dir) { + console.log('Usage: node ' + path.basename(__filename) + ' '); + process.exit(1); +} + +const NodeApiVersion = require('../package.json').version; + +const disable = args[1]; +let ConfigFileOperations; +if (disable !== '--disable' && dir !== '--disable') { + ConfigFileOperations = { + 'package.json': [ + [/([ ]*)"dependencies": {/g, '$1"dependencies": {\n$1 "node-addon-api": "' + NodeApiVersion + '",'], + [/[ ]*"nan": *"[^"]+"(,|)[\n\r]/g, ''] + ], + 'binding.gyp': [ + [/([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {'], + [/Local\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);\s+(\w+)\.Reset\((\1)\);\s+\1->SetClassName\((Nan::String::New|Nan::New<(v8::)*String>)\("(.+?)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$6", {'], + [/Local\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {'], + [/Nan::New\(([\w\d:]+)\)->GetFunction\(\)/g, 'Napi::Function::New(env, $1)'], + [/Nan::New\(([\w\d:]+)\)->GetFunction()/g, 'Napi::Function::New(env, $1);'], + [/Nan::New\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)'], + [/Nan::New\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)'], + + // FunctionTemplate to FunctionReference + [/Nan::Persistent<(v8::)*FunctionTemplate>/g, 'Napi::FunctionReference'], + [/Nan::Persistent<(v8::)*Function>/g, 'Napi::FunctionReference'], + [/v8::Local/g, 'Napi::FunctionReference'], + [/Local/g, 'Napi::FunctionReference'], + [/v8::FunctionTemplate/g, 'Napi::FunctionReference'], + [/FunctionTemplate/g, 'Napi::FunctionReference'], + + [/([ ]*)Nan::SetPrototypeMethod\(\w+, "(\w+)", (\w+)\);/g, '$1InstanceMethod("$2", &$3),'], + [/([ ]*)(?:\w+\.Reset\(\w+\);\s+)?\(target\)\.Set\("(\w+)",\s*Nan::GetFunction\((\w+)\)\);/gm, + '});\n\n' + + '$1constructor = Napi::Persistent($3);\n' + + '$1constructor.SuppressDestruct();\n' + + '$1target.Set("$2", $3);'], + + // TODO: Other attribute combinations + [/static_cast\(ReadOnly\s*\|\s*DontDelete\)/gm, + 'static_cast(napi_enumerable | napi_configurable)'], + + [/([\w\d:<>]+?)::Cast\((.+?)\)/g, '$2.As<$1>()'], + + [/\*Nan::Utf8String\(([^)]+)\)/g, '$1->As().Utf8Value().c_str()'], + [/Nan::Utf8String +(\w+)\(([^)]+)\)/g, 'std::string $1 = $2.As()'], + [/Nan::Utf8String/g, 'std::string'], + + [/v8::String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)'], + [/String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)'], + [/\.length\(\)/g, '.Length()'], + + [/Nan::MakeCallback\(([^,]+),[\s\\]+([^,]+),/gm, '$2.MakeCallback($1,'], + + [/class\s+(\w+)\s*:\s*public\s+Nan::ObjectWrap/g, 'class $1 : public Napi::ObjectWrap<$1>'], + [/(\w+)\(([^)]*)\)\s*:\s*Nan::ObjectWrap\(\)\s*(,)?/gm, '$1($2) : Napi::ObjectWrap<$1>()$3'], + + // HandleOKCallback to OnOK + [/HandleOKCallback/g, 'OnOK'], + // HandleErrorCallback to OnError + [/HandleErrorCallback/g, 'OnError'], + + // ex. .As() to .As() + [/\.As\(\)/g, '.As()'], + [/\.As<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>\(\)/g, '.As()'], + + // ex. Nan::New(info[0]) to Napi::Number::New(info[0]) + [/Nan::New<(v8::)*Integer>\((.+?)\)/g, 'Napi::Number::New(env, $2)'], + [/Nan::New\(([0-9.]+)\)/g, 'Napi::Number::New(env, $1)'], + [/Nan::New<(v8::)*String>\("(.+?)"\)/g, 'Napi::String::New(env, "$2")'], + [/Nan::New\("(.+?)"\)/g, 'Napi::String::New(env, "$1")'], + [/Nan::New<(v8::)*(.+?)>\(\)/g, 'Napi::$2::New(env)'], + [/Nan::New<(.+?)>\(\)/g, 'Napi::$1::New(env)'], + [/Nan::New<(v8::)*(.+?)>\(/g, 'Napi::$2::New(env, '], + [/Nan::New<(.+?)>\(/g, 'Napi::$1::New(env, '], + [/Nan::NewBuffer\(/g, 'Napi::Buffer::New(env, '], + // TODO: Properly handle this + [/Nan::New\(/g, 'Napi::New(env, '], + + [/\.IsInt32\(\)/g, '.IsNumber()'], + [/->IsInt32\(\)/g, '.IsNumber()'], + + [/(.+?)->BooleanValue\(\)/g, '$1.As().Value()'], + [/(.+?)->Int32Value\(\)/g, '$1.As().Int32Value()'], + [/(.+?)->Uint32Value\(\)/g, '$1.As().Uint32Value()'], + [/(.+?)->IntegerValue\(\)/g, '$1.As().Int64Value()'], + [/(.+?)->NumberValue\(\)/g, '$1.As().DoubleValue()'], + + // ex. Nan::To(info[0]) to info[0].Value() + [/Nan::To\((.+?)\)/g, '$2.To()'], + [/Nan::To<(Boolean|String|Number|Object|Array|Symbol|Function)>\((.+?)\)/g, '$2.To()'], + // ex. Nan::To(info[0]) to info[0].As().Value() + [/Nan::To\((.+?)\)/g, '$1.As().Value()'], + // ex. Nan::To(info[0]) to info[0].As().Int32Value() + [/Nan::To\((.+?)\)/g, '$1.As().Int32Value()'], + // ex. Nan::To(info[0]) to info[0].As().Int32Value() + [/Nan::To\((.+?)\)/g, '$1.As().Int32Value()'], + // ex. Nan::To(info[0]) to info[0].As().Uint32Value() + [/Nan::To\((.+?)\)/g, '$1.As().Uint32Value()'], + // ex. Nan::To(info[0]) to info[0].As().Int64Value() + [/Nan::To\((.+?)\)/g, '$1.As().Int64Value()'], + // ex. Nan::To(info[0]) to info[0].As().FloatValue() + [/Nan::To\((.+?)\)/g, '$1.As().FloatValue()'], + // ex. Nan::To(info[0]) to info[0].As().DoubleValue() + [/Nan::To\((.+?)\)/g, '$1.As().DoubleValue()'], + + [/Nan::New\((\w+)\)->HasInstance\((\w+)\)/g, '$2.InstanceOf($1.Value())'], + + [/Nan::Has\(([^,]+),\s*/gm, '($1).Has('], + [/\.Has\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Has($1)'], + [/\.Has\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Has($1)'], + + [/Nan::Get\(([^,]+),\s*/gm, '($1).Get('], + [/\.Get\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Get($1)'], + [/\.Get\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Get($1)'], + + [/Nan::Set\(([^,]+),\s*/gm, '($1).Set('], + [/\.Set\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\s*,/gm, '.Set($1,'], + [/\.Set\([\s|\\]*Nan::New\(([^)]+)\)\s*,/gm, '.Set($1,'], + + // ex. node::Buffer::HasInstance(info[0]) to info[0].IsBuffer() + [/node::Buffer::HasInstance\((.+?)\)/g, '$1.IsBuffer()'], + // ex. node::Buffer::Length(info[0]) to info[0].Length() + [/node::Buffer::Length\((.+?)\)/g, '$1.As>().Length()'], + // ex. node::Buffer::Data(info[0]) to info[0].Data() + [/node::Buffer::Data\((.+?)\)/g, '$1.As>().Data()'], + [/Nan::CopyBuffer\(/g, 'Napi::Buffer::Copy(env, '], + + // Nan::AsyncQueueWorker(worker) + [/Nan::AsyncQueueWorker\((.+)\);/g, '$1.Queue();'], + [/Nan::(Undefined|Null|True|False)\(\)/g, 'env.$1()'], + + // Nan::ThrowError(error) to Napi::Error::New(env, error).ThrowAsJavaScriptException() + [/([ ]*)return Nan::Throw(\w*?)Error\((.+?)\);/g, '$1Napi::$2Error::New(env, $3).ThrowAsJavaScriptException();\n$1return env.Null();'], + [/Nan::Throw(\w*?)Error\((.+?)\);\n(\s*)return;/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n$3return env.Null();'], + [/Nan::Throw(\w*?)Error\((.+?)\);/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n'], + // Nan::RangeError(error) to Napi::RangeError::New(env, error) + [/Nan::(\w*?)Error\((.+)\)/g, 'Napi::$1Error::New(env, $2)'], + + [/Nan::Set\((.+?),\n* *(.+?),\n* *(.+?),\n* *(.+?)\)/g, '$1.Set($2, $3, $4)'], + + [/Nan::(Escapable)?HandleScope\s+(\w+)\s*;/g, 'Napi::$1HandleScope $2(env);'], + [/Nan::(Escapable)?HandleScope/g, 'Napi::$1HandleScope'], + [/Nan::ForceSet\(([^,]+), ?/g, '$1->DefineProperty('], + [/\.ForceSet\(Napi::String::New\(env, "(\w+)"\),\s*?/g, '.DefineProperty("$1", '], + // [ /Nan::GetPropertyNames\(([^,]+)\)/, '$1->GetPropertyNames()' ], + [/Nan::Equals\(([^,]+),/g, '$1.StrictEquals('], + + [/(.+)->Set\(/g, '$1.Set('], + + [/Nan::Callback/g, 'Napi::FunctionReference'], + + [/Nan::Persistent/g, 'Napi::ObjectReference'], + [/Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target/g, 'Napi::Env& env, Napi::Object& target'], + + [/(\w+)\*\s+(\w+)\s*=\s*Nan::ObjectWrap::Unwrap<\w+>\(info\.This\(\)\);/g, '$1* $2 = this;'], + [/Nan::ObjectWrap::Unwrap<(\w+)>\((.*)\);/g, '$2.Unwrap<$1>();'], + + [/Nan::NAN_METHOD_RETURN_TYPE/g, 'void'], + [/NAN_INLINE/g, 'inline'], + + [/Nan::NAN_METHOD_ARGS_TYPE/g, 'const Napi::CallbackInfo&'], + [/NAN_METHOD\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], + [/static\s*NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], + [/NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], + [/static\s*NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)'], + [/NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)'], + [/void Init\((v8::)*Local<(v8::)*Object> exports\)/g, 'Napi::Object Init(Napi::Env env, Napi::Object exports)'], + [/NAN_MODULE_INIT\(([\w\d:]+?)\);/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports);'], + [/NAN_MODULE_INIT\(([\w\d:]+?)\)/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports)'], + + [/::(Init(?:ialize)?)\(target\)/g, '::$1(env, target, module)'], + [/constructor_template/g, 'constructor'], + + [/Nan::FunctionCallbackInfo<(v8::)?Value>[ ]*& [ ]*info\)[ ]*{\n*([ ]*)/gm, 'Napi::CallbackInfo& info) {\n$2Napi::Env env = info.Env();\n$2'], + [/Nan::FunctionCallbackInfo<(v8::)*Value>\s*&\s*info\);/g, 'Napi::CallbackInfo& info);'], + [/Nan::FunctionCallbackInfo<(v8::)*Value>\s*&/g, 'Napi::CallbackInfo&'], + + [/Buffer::HasInstance\(([^)]+)\)/g, '$1.IsBuffer()'], + + [/info\[(\d+)\]->/g, 'info[$1].'], + [/info\[([\w\d]+)\]->/g, 'info[$1].'], + [/info\.This\(\)->/g, 'info.This().'], + [/->Is(Object|String|Int32|Number)\(\)/g, '.Is$1()'], + [/info.GetReturnValue\(\).SetUndefined\(\)/g, 'return env.Undefined()'], + [/info\.GetReturnValue\(\)\.Set\(((\n|.)+?)\);/g, 'return $1;'], + + // ex. Local to Napi::Value + [/v8::Local/g, 'Napi::$1'], + [/Local<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>/g, 'Napi::$1'], + + // Declare an env in helper functions that take a Napi::Value + [/(\w+)\(Napi::Value (\w+)(,\s*[^()]+)?\)\s*{\n*([ ]*)/gm, '$1(Napi::Value $2$3) {\n$4Napi::Env env = $2.Env();\n$4'], + + // delete #include and/or + [/#include +(<|")(?:node|nan).h("|>)/g, '#include $1napi.h$2\n#include $1uv.h$2'], + // NODE_MODULE to NODE_API_MODULE + [/NODE_MODULE/g, 'NODE_API_MODULE'], + [/Nan::/g, 'Napi::'], + [/nan.h/g, 'napi.h'], + + // delete .FromJust() + [/\.FromJust\(\)/g, ''], + // delete .ToLocalCheck() + [/\.ToLocalChecked\(\)/g, ''], + [/^.*->SetInternalFieldCount\(.*$/gm, ''], + + // replace using node; and/or using v8; to using Napi; + [/using (node|v8);/g, 'using Napi;'], + [/using namespace (node|Nan|v8);/g, 'using namespace Napi;'], + // delete using v8::Local; + [/using v8::Local;\n/g, ''], + // replace using v8::XXX; with using Napi::XXX + [/using v8::([A-Za-z]+);/g, 'using Napi::$1;'] + +]; + +const paths = listFiles(dir); +paths.forEach(function (dirEntry) { + const filename = dirEntry.split('\\').pop().split('/').pop(); + + // Check whether the file is a source file or a config file + // then execute function accordingly + const sourcePattern = /.+\.h|.+\.cc|.+\.cpp/; + if (sourcePattern.test(filename)) { + convertFile(dirEntry, SourceFileOperations); + } else if (ConfigFileOperations[filename] != null) { + convertFile(dirEntry, ConfigFileOperations[filename]); + } +}); + +function listFiles (dir, filelist) { + const files = fs.readdirSync(dir); + filelist = filelist || []; + files.forEach(function (file) { + if (file === 'node_modules') { + return; + } + + if (fs.statSync(path.join(dir, file)).isDirectory()) { + filelist = listFiles(path.join(dir, file), filelist); + } else { + filelist.push(path.join(dir, file)); + } + }); + return filelist; +} + +function convert (content, operations) { + for (let i = 0; i < operations.length; i++) { + const operation = operations[i]; + content = content.replace(operation[0], operation[1]); + } + return content; +} + +function convertFile (fileName, operations) { + fs.readFile(fileName, 'utf-8', function (err, file) { + if (err) throw err; + + file = convert(file, operations); + + fs.writeFile(fileName, file, function (err) { + if (err) throw err; + }); + }); +} diff --git a/node_modules/node-addon-api/tools/eslint-format.js b/node_modules/node-addon-api/tools/eslint-format.js new file mode 100644 index 00000000..1dda4449 --- /dev/null +++ b/node_modules/node-addon-api/tools/eslint-format.js @@ -0,0 +1,79 @@ +#!/usr/bin/env node + +const spawn = require('child_process').spawnSync; + +const filesToCheck = '*.js'; +const FORMAT_START = process.env.FORMAT_START || 'main'; +const IS_WIN = process.platform === 'win32'; +const ESLINT_PATH = IS_WIN ? 'node_modules\\.bin\\eslint.cmd' : 'node_modules/.bin/eslint'; + +function main (args) { + let fix = false; + while (args.length > 0) { + switch (args[0]) { + case '-f': + case '--fix': + fix = true; + break; + default: + } + args.shift(); + } + + // Check js files that change on unstaged file + const fileUnStaged = spawn( + 'git', + ['diff', '--name-only', FORMAT_START, filesToCheck], + { + encoding: 'utf-8' + } + ); + + // Check js files that change on staged file + const fileStaged = spawn( + 'git', + ['diff', '--name-only', '--cached', FORMAT_START, filesToCheck], + { + encoding: 'utf-8' + } + ); + + const options = [ + ...fileStaged.stdout.split('\n').filter((f) => f !== ''), + ...fileUnStaged.stdout.split('\n').filter((f) => f !== '') + ]; + + if (fix) { + options.push('--fix'); + } + + const result = spawn(ESLINT_PATH, [...options], { + encoding: 'utf-8' + }); + + if (result.error && result.error.errno === 'ENOENT') { + console.error('Eslint not found! Eslint is supposed to be found at ', ESLINT_PATH); + return 2; + } + + if (result.status === 1) { + console.error('Eslint error:', result.stdout); + const fixCmd = 'npm run lint:fix'; + console.error(`ERROR: please run "${fixCmd}" to format changes in your commit + Note that when running the command locally, please keep your local + main branch and working branch up to date with nodejs/node-addon-api + to exclude un-related complains. + Or you can run "env FORMAT_START=upstream/main ${fixCmd}". + Also fix JS files by yourself if necessary.`); + return 1; + } + + if (result.stderr) { + console.error('Error running eslint:', result.stderr); + return 2; + } +} + +if (require.main === module) { + process.exitCode = main(process.argv.slice(2)); +} diff --git a/node_modules/node-fetch/LICENSE.md b/node_modules/node-fetch/LICENSE.md new file mode 100644 index 00000000..660ffecb --- /dev/null +++ b/node_modules/node-fetch/LICENSE.md @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 David Frank + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/node-fetch/README.md b/node_modules/node-fetch/README.md new file mode 100644 index 00000000..55f09b7f --- /dev/null +++ b/node_modules/node-fetch/README.md @@ -0,0 +1,634 @@ +node-fetch +========== + +[![npm version][npm-image]][npm-url] +[![build status][travis-image]][travis-url] +[![coverage status][codecov-image]][codecov-url] +[![install size][install-size-image]][install-size-url] +[![Discord][discord-image]][discord-url] + +A light-weight module that brings `window.fetch` to Node.js + +(We are looking for [v2 maintainers and collaborators](https://github.com/bitinn/node-fetch/issues/567)) + +[![Backers][opencollective-image]][opencollective-url] + + + +- [Motivation](#motivation) +- [Features](#features) +- [Difference from client-side fetch](#difference-from-client-side-fetch) +- [Installation](#installation) +- [Loading and configuring the module](#loading-and-configuring-the-module) +- [Common Usage](#common-usage) + - [Plain text or HTML](#plain-text-or-html) + - [JSON](#json) + - [Simple Post](#simple-post) + - [Post with JSON](#post-with-json) + - [Post with form parameters](#post-with-form-parameters) + - [Handling exceptions](#handling-exceptions) + - [Handling client and server errors](#handling-client-and-server-errors) +- [Advanced Usage](#advanced-usage) + - [Streams](#streams) + - [Buffer](#buffer) + - [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data) + - [Extract Set-Cookie Header](#extract-set-cookie-header) + - [Post data using a file stream](#post-data-using-a-file-stream) + - [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart) + - [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal) +- [API](#api) + - [fetch(url[, options])](#fetchurl-options) + - [Options](#options) + - [Class: Request](#class-request) + - [Class: Response](#class-response) + - [Class: Headers](#class-headers) + - [Interface: Body](#interface-body) + - [Class: FetchError](#class-fetcherror) +- [License](#license) +- [Acknowledgement](#acknowledgement) + + + +## Motivation + +Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime. + +See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side). + +## Features + +- Stay consistent with `window.fetch` API. +- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences. +- Use native promise but allow substituting it with [insert your favorite promise library]. +- Use native Node streams for body on both request and response. +- Decode content encoding (gzip/deflate) properly and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically. +- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors](ERROR-HANDLING.md) for troubleshooting. + +## Difference from client-side fetch + +- See [Known Differences](LIMITS.md) for details. +- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue. +- Pull requests are welcomed too! + +## Installation + +Current stable release (`2.x`) + +```sh +$ npm install node-fetch +``` + +## Loading and configuring the module +We suggest you load the module via `require` until the stabilization of ES modules in node: +```js +const fetch = require('node-fetch'); +``` + +If you are using a Promise library other than native, set it through `fetch.Promise`: +```js +const Bluebird = require('bluebird'); + +fetch.Promise = Bluebird; +``` + +## Common Usage + +NOTE: The documentation below is up-to-date with `2.x` releases; see the [`1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences. + +#### Plain text or HTML +```js +fetch('https://github.com/') + .then(res => res.text()) + .then(body => console.log(body)); +``` + +#### JSON + +```js + +fetch('https://api.github.com/users/github') + .then(res => res.json()) + .then(json => console.log(json)); +``` + +#### Simple Post +```js +fetch('https://httpbin.org/post', { method: 'POST', body: 'a=1' }) + .then(res => res.json()) // expecting a json response + .then(json => console.log(json)); +``` + +#### Post with JSON + +```js +const body = { a: 1 }; + +fetch('https://httpbin.org/post', { + method: 'post', + body: JSON.stringify(body), + headers: { 'Content-Type': 'application/json' }, + }) + .then(res => res.json()) + .then(json => console.log(json)); +``` + +#### Post with form parameters +`URLSearchParams` is available in Node.js as of v7.5.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods. + +NOTE: The `Content-Type` header is only set automatically to `x-www-form-urlencoded` when an instance of `URLSearchParams` is given as such: + +```js +const { URLSearchParams } = require('url'); + +const params = new URLSearchParams(); +params.append('a', 1); + +fetch('https://httpbin.org/post', { method: 'POST', body: params }) + .then(res => res.json()) + .then(json => console.log(json)); +``` + +#### Handling exceptions +NOTE: 3xx-5xx responses are *NOT* exceptions and should be handled in `then()`; see the next section for more information. + +Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, network errors and operational errors, which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details. + +```js +fetch('https://domain.invalid/') + .catch(err => console.error(err)); +``` + +#### Handling client and server errors +It is common to create a helper function to check that the response contains no client (4xx) or server (5xx) error responses: + +```js +function checkStatus(res) { + if (res.ok) { // res.status >= 200 && res.status < 300 + return res; + } else { + throw MyCustomError(res.statusText); + } +} + +fetch('https://httpbin.org/status/400') + .then(checkStatus) + .then(res => console.log('will not get here...')) +``` + +## Advanced Usage + +#### Streams +The "Node.js way" is to use streams when possible: + +```js +fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png') + .then(res => { + const dest = fs.createWriteStream('./octocat.png'); + res.body.pipe(dest); + }); +``` + +In Node.js 14 you can also use async iterators to read `body`; however, be careful to catch +errors -- the longer a response runs, the more likely it is to encounter an error. + +```js +const fetch = require('node-fetch'); +const response = await fetch('https://httpbin.org/stream/3'); +try { + for await (const chunk of response.body) { + console.dir(JSON.parse(chunk.toString())); + } +} catch (err) { + console.error(err.stack); +} +``` + +In Node.js 12 you can also use async iterators to read `body`; however, async iterators with streams +did not mature until Node.js 14, so you need to do some extra work to ensure you handle errors +directly from the stream and wait on it response to fully close. + +```js +const fetch = require('node-fetch'); +const read = async body => { + let error; + body.on('error', err => { + error = err; + }); + for await (const chunk of body) { + console.dir(JSON.parse(chunk.toString())); + } + return new Promise((resolve, reject) => { + body.on('close', () => { + error ? reject(error) : resolve(); + }); + }); +}; +try { + const response = await fetch('https://httpbin.org/stream/3'); + await read(response.body); +} catch (err) { + console.error(err.stack); +} +``` + +#### Buffer +If you prefer to cache binary data in full, use buffer(). (NOTE: `buffer()` is a `node-fetch`-only API) + +```js +const fileType = require('file-type'); + +fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png') + .then(res => res.buffer()) + .then(buffer => fileType(buffer)) + .then(type => { /* ... */ }); +``` + +#### Accessing Headers and other Meta data +```js +fetch('https://github.com/') + .then(res => { + console.log(res.ok); + console.log(res.status); + console.log(res.statusText); + console.log(res.headers.raw()); + console.log(res.headers.get('content-type')); + }); +``` + +#### Extract Set-Cookie Header + +Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API. + +```js +fetch(url).then(res => { + // returns an array of values, instead of a string of comma-separated values + console.log(res.headers.raw()['set-cookie']); +}); +``` + +#### Post data using a file stream + +```js +const { createReadStream } = require('fs'); + +const stream = createReadStream('input.txt'); + +fetch('https://httpbin.org/post', { method: 'POST', body: stream }) + .then(res => res.json()) + .then(json => console.log(json)); +``` + +#### Post with form-data (detect multipart) + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('a', 1); + +fetch('https://httpbin.org/post', { method: 'POST', body: form }) + .then(res => res.json()) + .then(json => console.log(json)); + +// OR, using custom headers +// NOTE: getHeaders() is non-standard API + +const form = new FormData(); +form.append('a', 1); + +const options = { + method: 'POST', + body: form, + headers: form.getHeaders() +} + +fetch('https://httpbin.org/post', options) + .then(res => res.json()) + .then(json => console.log(json)); +``` + +#### Request cancellation with AbortSignal + +> NOTE: You may cancel streamed requests only on Node >= v8.0.0 + +You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller). + +An example of timing out a request after 150ms could be achieved as the following: + +```js +import AbortController from 'abort-controller'; + +const controller = new AbortController(); +const timeout = setTimeout( + () => { controller.abort(); }, + 150, +); + +fetch(url, { signal: controller.signal }) + .then(res => res.json()) + .then( + data => { + useData(data) + }, + err => { + if (err.name === 'AbortError') { + // request was aborted + } + }, + ) + .finally(() => { + clearTimeout(timeout); + }); +``` + +See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for more examples. + + +## API + +### fetch(url[, options]) + +- `url` A string representing the URL for fetching +- `options` [Options](#fetch-options) for the HTTP(S) request +- Returns: Promise<[Response](#class-response)> + +Perform an HTTP(S) fetch. + +`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`. + + +### Options + +The default values are shown after each option key. + +```js +{ + // These properties are part of the Fetch Standard + method: 'GET', + headers: {}, // request headers. format is the identical to that accepted by the Headers constructor (see below) + body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream + redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect + signal: null, // pass an instance of AbortSignal to optionally abort requests + + // The following properties are node-fetch extensions + follow: 20, // maximum redirect count. 0 to not follow redirect + timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies). Signal is recommended instead. + compress: true, // support gzip/deflate content encoding. false to disable + size: 0, // maximum response body size in bytes. 0 to disable + agent: null // http(s).Agent instance or function that returns an instance (see below) +} +``` + +##### Default Headers + +If no values are set, the following request headers will be sent automatically: + +Header | Value +------------------- | -------------------------------------------------------- +`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_ +`Accept` | `*/*` +`Content-Length` | _(automatically calculated, if possible)_ +`Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_ +`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)` + +Note: when `body` is a `Stream`, `Content-Length` is not set automatically. + +##### Custom Agent + +The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following: + +- Support self-signed certificate +- Use only IPv4 or IPv6 +- Custom DNS Lookup + +See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information. + +If no agent is specified, the default agent provided by Node.js is used. Note that [this changed in Node.js 19](https://github.com/nodejs/node/blob/4267b92604ad78584244488e7f7508a690cb80d0/lib/_http_agent.js#L564) to have `keepalive` true by default. If you wish to enable `keepalive` in an earlier version of Node.js, you can override the agent as per the following code sample. + +In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol. + +```js +const httpAgent = new http.Agent({ + keepAlive: true +}); +const httpsAgent = new https.Agent({ + keepAlive: true +}); + +const options = { + agent: function (_parsedURL) { + if (_parsedURL.protocol == 'http:') { + return httpAgent; + } else { + return httpsAgent; + } + } +} +``` + + +### Class: Request + +An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface. + +Due to the nature of Node.js, the following properties are not implemented at this moment: + +- `type` +- `destination` +- `referrer` +- `referrerPolicy` +- `mode` +- `credentials` +- `cache` +- `integrity` +- `keepalive` + +The following node-fetch extension properties are provided: + +- `follow` +- `compress` +- `counter` +- `agent` + +See [options](#fetch-options) for exact meaning of these extensions. + +#### new Request(input[, options]) + +*(spec-compliant)* + +- `input` A string representing a URL, or another `Request` (which will be cloned) +- `options` [Options][#fetch-options] for the HTTP(S) request + +Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). + +In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object. + + +### Class: Response + +An HTTP(S) response. This class implements the [Body](#iface-body) interface. + +The following properties are not implemented in node-fetch at this moment: + +- `Response.error()` +- `Response.redirect()` +- `type` +- `trailer` + +#### new Response([body[, options]]) + +*(spec-compliant)* + +- `body` A `String` or [`Readable` stream][node-readable] +- `options` A [`ResponseInit`][response-init] options dictionary + +Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response). + +Because Node.js does not implement service workers (for which this class was designed), one rarely has to construct a `Response` directly. + +#### response.ok + +*(spec-compliant)* + +Convenience property representing if the request ended normally. Will evaluate to true if the response status was greater than or equal to 200 but smaller than 300. + +#### response.redirected + +*(spec-compliant)* + +Convenience property representing if the request has been redirected at least once. Will evaluate to true if the internal redirect counter is greater than 0. + + +### Class: Headers + +This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented. + +#### new Headers([init]) + +*(spec-compliant)* + +- `init` Optional argument to pre-fill the `Headers` object + +Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object or any iterable object. + +```js +// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class + +const meta = { + 'Content-Type': 'text/xml', + 'Breaking-Bad': '<3' +}; +const headers = new Headers(meta); + +// The above is equivalent to +const meta = [ + [ 'Content-Type', 'text/xml' ], + [ 'Breaking-Bad', '<3' ] +]; +const headers = new Headers(meta); + +// You can in fact use any iterable objects, like a Map or even another Headers +const meta = new Map(); +meta.set('Content-Type', 'text/xml'); +meta.set('Breaking-Bad', '<3'); +const headers = new Headers(meta); +const copyOfHeaders = new Headers(headers); +``` + + +### Interface: Body + +`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes. + +The following methods are not yet implemented in node-fetch at this moment: + +- `formData()` + +#### body.body + +*(deviation from spec)* + +* Node.js [`Readable` stream][node-readable] + +Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable]. + +#### body.bodyUsed + +*(spec-compliant)* + +* `Boolean` + +A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again. + +#### body.arrayBuffer() +#### body.blob() +#### body.json() +#### body.text() + +*(spec-compliant)* + +* Returns: Promise + +Consume the body and return a promise that will resolve to one of these formats. + +#### body.buffer() + +*(node-fetch extension)* + +* Returns: Promise<Buffer> + +Consume the body and return a promise that will resolve to a Buffer. + +#### body.textConverted() + +*(node-fetch extension)* + +* Returns: Promise<String> + +Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8 if possible. + +(This API requires an optional dependency of the npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.) + + +### Class: FetchError + +*(node-fetch extension)* + +An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info. + + +### Class: AbortError + +*(node-fetch extension)* + +An Error thrown when the request is aborted in response to an `AbortSignal`'s `abort` event. It has a `name` property of `AbortError`. See [ERROR-HANDLING.MD][] for more info. + +## Acknowledgement + +Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference. + +`node-fetch` v1 was maintained by [@bitinn](https://github.com/bitinn); v2 was maintained by [@TimothyGu](https://github.com/timothygu), [@bitinn](https://github.com/bitinn) and [@jimmywarting](https://github.com/jimmywarting); v2 readme is written by [@jkantr](https://github.com/jkantr). + +## License + +MIT + +[npm-image]: https://flat.badgen.net/npm/v/node-fetch +[npm-url]: https://www.npmjs.com/package/node-fetch +[travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch +[travis-url]: https://travis-ci.org/bitinn/node-fetch +[codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master +[codecov-url]: https://codecov.io/gh/bitinn/node-fetch +[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch +[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch +[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square +[discord-url]: https://discord.gg/Zxbndcm +[opencollective-image]: https://opencollective.com/node-fetch/backers.svg +[opencollective-url]: https://opencollective.com/node-fetch +[whatwg-fetch]: https://fetch.spec.whatwg.org/ +[response-init]: https://fetch.spec.whatwg.org/#responseinit +[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams +[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers +[LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md +[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md +[UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md diff --git a/node_modules/node-fetch/browser.js b/node_modules/node-fetch/browser.js new file mode 100644 index 00000000..ee86265a --- /dev/null +++ b/node_modules/node-fetch/browser.js @@ -0,0 +1,25 @@ +"use strict"; + +// ref: https://github.com/tc39/proposal-global +var getGlobal = function () { + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. + if (typeof self !== 'undefined') { return self; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + throw new Error('unable to locate global object'); +} + +var globalObject = getGlobal(); + +module.exports = exports = globalObject.fetch; + +// Needed for TypeScript and Webpack. +if (globalObject.fetch) { + exports.default = globalObject.fetch.bind(globalObject); +} + +exports.Headers = globalObject.Headers; +exports.Request = globalObject.Request; +exports.Response = globalObject.Response; diff --git a/node_modules/node-fetch/lib/index.es.js b/node_modules/node-fetch/lib/index.es.js new file mode 100644 index 00000000..aae9799c --- /dev/null +++ b/node_modules/node-fetch/lib/index.es.js @@ -0,0 +1,1777 @@ +process.emitWarning("The .es.js file is deprecated. Use .mjs instead."); + +import Stream from 'stream'; +import http from 'http'; +import Url from 'url'; +import whatwgUrl from 'whatwg-url'; +import https from 'https'; +import zlib from 'zlib'; + +// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js + +// fix for "Readable" isn't a named export issue +const Readable = Stream.Readable; + +const BUFFER = Symbol('buffer'); +const TYPE = Symbol('type'); + +class Blob { + constructor() { + this[TYPE] = ''; + + const blobParts = arguments[0]; + const options = arguments[1]; + + const buffers = []; + let size = 0; + + if (blobParts) { + const a = blobParts; + const length = Number(a.length); + for (let i = 0; i < length; i++) { + const element = a[i]; + let buffer; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(element); + } else if (element instanceof Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === 'string' ? element : String(element)); + } + size += buffer.length; + buffers.push(buffer); + } + } + + this[BUFFER] = Buffer.concat(buffers); + + let type = options && options.type !== undefined && String(options.type).toLowerCase(); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } + get size() { + return this[BUFFER].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER].toString()); + } + arrayBuffer() { + const buf = this[BUFFER]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable(); + readable._read = function () {}; + readable.push(this[BUFFER]); + readable.push(null); + return readable; + } + toString() { + return '[object Blob]'; + } + slice() { + const size = this.size; + + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === undefined) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === undefined) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); + + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new Blob([], { type: arguments[2] }); + blob[BUFFER] = slicedBuffer; + return blob; + } +} + +Object.defineProperties(Blob.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } +}); + +Object.defineProperty(Blob.prototype, Symbol.toStringTag, { + value: 'Blob', + writable: false, + enumerable: false, + configurable: true +}); + +/** + * fetch-error.js + * + * FetchError interface for operational errors + */ + +/** + * Create FetchError instance + * + * @param String message Error message for human + * @param String type Error type for machine + * @param String systemError For Node.js system error + * @return FetchError + */ +function FetchError(message, type, systemError) { + Error.call(this, message); + + this.message = message; + this.type = type; + + // when err.type is `system`, err.code contains system error code + if (systemError) { + this.code = this.errno = systemError.code; + } + + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} + +FetchError.prototype = Object.create(Error.prototype); +FetchError.prototype.constructor = FetchError; +FetchError.prototype.name = 'FetchError'; + +let convert; +try { + convert = require('encoding').convert; +} catch (e) {} + +const INTERNALS = Symbol('Body internals'); + +// fix an issue where "PassThrough" isn't a named export for node <10 +const PassThrough = Stream.PassThrough; + +/** + * Body mixin + * + * Ref: https://fetch.spec.whatwg.org/#body + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +function Body(body) { + var _this = this; + + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$size = _ref.size; + + let size = _ref$size === undefined ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; + + if (body == null) { + // body is undefined or null + body = null; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + body = Buffer.from(body.toString()); + } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + body = Buffer.from(body); + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); + } else if (body instanceof Stream) ; else { + // none of the above + // coerce to string then buffer + body = Buffer.from(String(body)); + } + this[INTERNALS] = { + body, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout; + + if (body instanceof Stream) { + body.on('error', function (err) { + const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); + _this[INTERNALS].error = error; + }); + } +} + +Body.prototype = { + get body() { + return this[INTERNALS].body; + }, + + get bodyUsed() { + return this[INTERNALS].disturbed; + }, + + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function (buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); + }, + + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct = this.headers && this.headers.get('content-type') || ''; + return consumeBody.call(this).then(function (buf) { + return Object.assign( + // Prevent copying + new Blob([], { + type: ct.toLowerCase() + }), { + [BUFFER]: buf + }); + }); + }, + + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; + + return consumeBody.call(this).then(function (buffer) { + try { + return JSON.parse(buffer.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); + } + }); + }, + + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function (buffer) { + return buffer.toString(); + }); + }, + + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); + }, + + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; + + return consumeBody.call(this).then(function (buffer) { + return convertBody(buffer, _this3.headers); + }); + } +}; + +// In browsers, all properties are enumerable. +Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } +}); + +Body.mixIn = function (proto) { + for (const name of Object.getOwnPropertyNames(Body.prototype)) { + // istanbul ignore else: future proof + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } + } +}; + +/** + * Consume and convert an entire Body to a Buffer. + * + * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body + * + * @return Promise + */ +function consumeBody() { + var _this4 = this; + + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + } + + this[INTERNALS].disturbed = true; + + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } + + let body = this.body; + + // body is null + if (body === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + + // body is blob + if (isBlob(body)) { + body = body.stream(); + } + + // body is buffer + if (Buffer.isBuffer(body)) { + return Body.Promise.resolve(body); + } + + // istanbul ignore if: should never happen + if (!(body instanceof Stream)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + + // body is stream + // get ready to actually consume the body + let accum = []; + let accumBytes = 0; + let abort = false; + + return new Body.Promise(function (resolve, reject) { + let resTimeout; + + // allow timeout on slow response body + if (_this4.timeout) { + resTimeout = setTimeout(function () { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); + }, _this4.timeout); + } + + // handle stream errors + body.on('error', function (err) { + if (err.name === 'AbortError') { + // if the request was aborted, reject with this Error + abort = true; + reject(err); + } else { + // other errors, such as incorrect content-encoding + reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + + body.on('data', function (chunk) { + if (abort || chunk === null) { + return; + } + + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); + return; + } + + accumBytes += chunk.length; + accum.push(chunk); + }); + + body.on('end', function () { + if (abort) { + return; + } + + clearTimeout(resTimeout); + + try { + resolve(Buffer.concat(accum, accumBytes)); + } catch (err) { + // handle streams that have accumulated too much data (issue #414) + reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + }); +} + +/** + * Detect buffer encoding and convert to target encoding + * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding + * + * @param Buffer buffer Incoming buffer + * @param String encoding Target encoding + * @return String + */ +function convertBody(buffer, headers) { + if (typeof convert !== 'function') { + throw new Error('The package `encoding` must be installed to use the textConverted() function'); + } + + const ct = headers.get('content-type'); + let charset = 'utf-8'; + let res, str; + + // header + if (ct) { + res = /charset=([^;]*)/i.exec(ct); + } + + // no charset in content type, peek at response body for at most 1024 bytes + str = buffer.slice(0, 1024).toString(); + + // html5 + if (!res && str) { + res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; + + this[MAP] = Object.create(null); + + if (init instanceof Headers) { + const rawHeaders = init.raw(); + const headerNames = Object.keys(rawHeaders); + + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } + } + + return; + } + + // We don't worry about converting prop to ByteString here as append() + // will handle it. + if (init == null) ; else if (typeof init === 'object') { + const method = init[Symbol.iterator]; + if (method != null) { + if (typeof method !== 'function') { + throw new TypeError('Header pairs must be iterable'); + } + + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = []; + for (const pair of init) { + if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError('Each header pair must be iterable'); + } + pairs.push(Array.from(pair)); + } + + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError('Each header pair must be a name/value tuple'); + } + this.append(pair[0], pair[1]); + } + } else { + // record + for (const key of Object.keys(init)) { + const value = init[key]; + this.append(key, value); + } + } + } else { + throw new TypeError('Provided initializer must be an object'); + } + } + + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key === undefined) { + return null; + } + + return this[MAP][key].join(', '); + } + + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + + let pairs = getHeaders(this); + let i = 0; + while (i < pairs.length) { + var _pairs$i = pairs[i]; + const name = _pairs$i[0], + value = _pairs$i[1]; + + callback.call(thisArg, value, name, this); + pairs = getHeaders(this); + i++; + } + } + + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + this[MAP][key !== undefined ? key : name] = [value]; + } + + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + if (key !== undefined) { + this[MAP][key].push(value); + } else { + this[MAP][name] = [value]; + } + } + + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name) { + name = `${name}`; + validateName(name); + return find(this[MAP], name) !== undefined; + } + + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key !== undefined) { + delete this[MAP][key]; + } + } + + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; + } + + /** + * Get an iterator on keys. + * + * @return Iterator + */ + keys() { + return createHeadersIterator(this, 'key'); + } + + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, 'value'); + } + + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, 'key+value'); + } +} +Headers.prototype.entries = Headers.prototype[Symbol.iterator]; + +Object.defineProperty(Headers.prototype, Symbol.toStringTag, { + value: 'Headers', + writable: false, + enumerable: false, + configurable: true +}); + +Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } +}); + +function getHeaders(headers) { + let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; + + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === 'key' ? function (k) { + return k.toLowerCase(); + } : kind === 'value' ? function (k) { + return headers[MAP][k].join(', '); + } : function (k) { + return [k.toLowerCase(), headers[MAP][k].join(', ')]; + }); +} + +const INTERNAL = Symbol('internal'); + +function createHeadersIterator(target, kind) { + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; +} + +const HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + // istanbul ignore if + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError('Value of `this` is not a HeadersIterator'); + } + + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, + kind = _INTERNAL.kind, + index = _INTERNAL.index; + + const values = getHeaders(target, kind); + const len = values.length; + if (index >= len) { + return { + value: undefined, + done: true + }; + } + + this[INTERNAL].index = index + 1; + + return { + value: values[index], + done: false + }; + } +}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); + +Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: 'HeadersIterator', + writable: false, + enumerable: false, + configurable: true +}); + +/** + * Export the Headers object in a form that Node.js can consume. + * + * @param Headers headers + * @return Object + */ +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); + + // http.request() only supports string as Host header. This hack makes + // specifying custom Host header possible. + const hostHeaderKey = find(headers[MAP], 'Host'); + if (hostHeaderKey !== undefined) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } + + return obj; +} + +/** + * Create a Headers object from an object of headers, ignoring those that do + * not conform to HTTP grammar productions. + * + * @param Object obj Object of headers + * @return Headers + */ +function createHeadersLenient(obj) { + const headers = new Headers(); + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) { + continue; + } + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name] === undefined) { + headers[MAP][name] = [val]; + } else { + headers[MAP][name].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name])) { + headers[MAP][name] = [obj[name]]; + } + } + return headers; +} + +const INTERNALS$1 = Symbol('Response internals'); + +// fix an issue where "STATUS_CODES" aren't a named export for node <10 +const STATUS_CODES = http.STATUS_CODES; + +/** + * Response class + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +class Response { + constructor() { + let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + Body.call(this, body, opts); + + const status = opts.status || 200; + const headers = new Headers(opts.headers); + + if (body != null && !headers.has('Content-Type')) { + const contentType = extractContentType(body); + if (contentType) { + headers.append('Content-Type', contentType); + } + } + + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter + }; + } + + get url() { + return this[INTERNALS$1].url || ''; + } + + get status() { + return this[INTERNALS$1].status; + } + + /** + * Convenience property representing if the request ended normally + */ + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + } + + get redirected() { + return this[INTERNALS$1].counter > 0; + } + + get statusText() { + return this[INTERNALS$1].statusText; + } + + get headers() { + return this[INTERNALS$1].headers; + } + + /** + * Clone this response + * + * @return Response + */ + clone() { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected + }); + } +} + +Body.mixIn(Response.prototype); + +Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } +}); + +Object.defineProperty(Response.prototype, Symbol.toStringTag, { + value: 'Response', + writable: false, + enumerable: false, + configurable: true +}); + +const INTERNALS$2 = Symbol('Request internals'); +const URL = Url.URL || whatwgUrl.URL; + +// fix an issue where "format", "parse" aren't a named export for node <10 +const parse_url = Url.parse; +const format_url = Url.format; + +/** + * Wrapper around `new URL` to handle arbitrary URLs + * + * @param {string} urlStr + * @return {void} + */ +function parseURL(urlStr) { + /* + Check whether the URL is absolute or not + Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 + Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 + */ + if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { + urlStr = new URL(urlStr).toString(); + } + + // Fallback to old implementation for arbitrary URLs + return parse_url(urlStr); +} + +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; + +/** + * Check if a value is an instance of Request. + * + * @param Mixed input + * @return Boolean + */ +function isRequest(input) { + return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; +} + +function isAbortSignal(signal) { + const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === 'AbortSignal'); +} + +/** + * Request class + * + * @param Mixed input Url or Request instance + * @param Object init Custom options + * @return Void + */ +class Request { + constructor(input) { + let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + let parsedURL; + + // normalize input + if (!isRequest(input)) { + if (input && input.href) { + // in order to support Node.js' Url objects; though WHATWG's URL objects + // will fall into this branch also (since their `toString()` will return + // `href` property anyway) + parsedURL = parseURL(input.href); + } else { + // coerce input to a string before attempting to parse + parsedURL = parseURL(`${input}`); + } + input = {}; + } else { + parsedURL = parseURL(input.url); + } + + let method = init.method || input.method || 'GET'; + method = method.toUpperCase(); + + if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { + throw new TypeError('Request with GET/HEAD method cannot have body'); + } + + let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; + + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); + + const headers = new Headers(init.headers || input.headers || {}); + + if (inputBody != null && !headers.has('Content-Type')) { + const contentType = extractContentType(inputBody); + if (contentType) { + headers.append('Content-Type', contentType); + } + } + + let signal = isRequest(input) ? input.signal : null; + if ('signal' in init) signal = init.signal; + + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError('Expected signal to be an instanceof AbortSignal'); + } + + this[INTERNALS$2] = { + method, + redirect: init.redirect || input.redirect || 'follow', + headers, + parsedURL, + signal + }; + + // node-fetch-only options + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; + } + + get method() { + return this[INTERNALS$2].method; + } + + get url() { + return format_url(this[INTERNALS$2].parsedURL); + } + + get headers() { + return this[INTERNALS$2].headers; + } + + get redirect() { + return this[INTERNALS$2].redirect; + } + + get signal() { + return this[INTERNALS$2].signal; + } + + /** + * Clone this request + * + * @return Request + */ + clone() { + return new Request(this); + } +} + +Body.mixIn(Request.prototype); + +Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: 'Request', + writable: false, + enumerable: false, + configurable: true +}); + +Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } +}); + +/** + * Convert a Request to Node.js http request options. + * + * @param Request A Request instance + * @return Object The options object to be passed to http.request + */ +function getNodeRequestOptions(request) { + const parsedURL = request[INTERNALS$2].parsedURL; + const headers = new Headers(request[INTERNALS$2].headers); + + // fetch step 1.3 + if (!headers.has('Accept')) { + headers.set('Accept', '*/*'); + } + + // Basic fetch + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError('Only absolute URLs are supported'); + } + + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError('Only HTTP(S) protocols are supported'); + } + + if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { + throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); + } + + // HTTP-network-or-cache fetch steps 2.4-2.7 + let contentLengthValue = null; + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = '0'; + } + if (request.body != null) { + const totalBytes = getTotalBytes(request); + if (typeof totalBytes === 'number') { + contentLengthValue = String(totalBytes); + } + } + if (contentLengthValue) { + headers.set('Content-Length', contentLengthValue); + } + + // HTTP-network-or-cache fetch step 2.11 + if (!headers.has('User-Agent')) { + headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); + } + + // HTTP-network-or-cache fetch step 2.15 + if (request.compress && !headers.has('Accept-Encoding')) { + headers.set('Accept-Encoding', 'gzip,deflate'); + } + + let agent = request.agent; + if (typeof agent === 'function') { + agent = agent(parsedURL); + } + + // HTTP-network fetch step 4.2 + // chunked encoding is handled by Node.js + + return Object.assign({}, parsedURL, { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); +} + +/** + * abort-error.js + * + * AbortError interface for cancelled requests + */ + +/** + * Create AbortError instance + * + * @param String message Error message for human + * @return AbortError + */ +function AbortError(message) { + Error.call(this, message); + + this.type = 'aborted'; + this.message = message; + + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} + +AbortError.prototype = Object.create(Error.prototype); +AbortError.prototype.constructor = AbortError; +AbortError.prototype.name = 'AbortError'; + +const URL$1 = Url.URL || whatwgUrl.URL; + +// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 +const PassThrough$1 = Stream.PassThrough; + +const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { + const orig = new URL$1(original).hostname; + const dest = new URL$1(destination).hostname; + + return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); +}; + +/** + * isSameProtocol reports whether the two provided URLs use the same protocol. + * + * Both domains must already be in canonical form. + * @param {string|URL} original + * @param {string|URL} destination + */ +const isSameProtocol = function isSameProtocol(destination, original) { + const orig = new URL$1(original).protocol; + const dest = new URL$1(destination).protocol; + + return orig === dest; +}; + +/** + * Fetch function + * + * @param Mixed url Absolute url or Request instance + * @param Object opts Fetch options + * @return Promise + */ +function fetch(url, opts) { + + // allow custom promise + if (!fetch.Promise) { + throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); + } + + Body.Promise = fetch.Promise; + + // wrap http.request into fetch + return new fetch.Promise(function (resolve, reject) { + // build request object + const request = new Request(url, opts); + const options = getNodeRequestOptions(request); + + const send = (options.protocol === 'https:' ? https : http).request; + const signal = request.signal; + + let response = null; + + const abort = function abort() { + let error = new AbortError('The user aborted a request.'); + reject(error); + if (request.body && request.body instanceof Stream.Readable) { + destroyStream(request.body, error); + } + if (!response || !response.body) return; + response.body.emit('error', error); + }; + + if (signal && signal.aborted) { + abort(); + return; + } + + const abortAndFinalize = function abortAndFinalize() { + abort(); + finalize(); + }; + + // send request + const req = send(options); + let reqTimeout; + + if (signal) { + signal.addEventListener('abort', abortAndFinalize); + } + + function finalize() { + req.abort(); + if (signal) signal.removeEventListener('abort', abortAndFinalize); + clearTimeout(reqTimeout); + } + + if (request.timeout) { + req.once('socket', function (socket) { + reqTimeout = setTimeout(function () { + reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); + finalize(); + }, request.timeout); + }); + } + + req.on('error', function (err) { + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); + + if (response && response.body) { + destroyStream(response.body, err); + } + + finalize(); + }); + + fixResponseChunkedTransferBadEnding(req, function (err) { + if (signal && signal.aborted) { + return; + } + + if (response && response.body) { + destroyStream(response.body, err); + } + }); + + /* c8 ignore next 18 */ + if (parseInt(process.version.substring(1)) < 14) { + // Before Node.js 14, pipeline() does not fully support async iterators and does not always + // properly handle when the socket close/end events are out of order. + req.on('socket', function (s) { + s.addListener('close', function (hadError) { + // if a data listener is still present we didn't end cleanly + const hasDataListener = s.listenerCount('data') > 0; + + // if end happened before close but the socket didn't emit an error, do it now + if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { + const err = new Error('Premature close'); + err.code = 'ERR_STREAM_PREMATURE_CLOSE'; + response.body.emit('error', err); + } + }); + }); + } + + req.on('response', function (res) { + clearTimeout(reqTimeout); + + const headers = createHeadersLenient(res.headers); + + // HTTP fetch step 5 + if (fetch.isRedirect(res.statusCode)) { + // HTTP fetch step 5.2 + const location = headers.get('Location'); + + // HTTP fetch step 5.3 + let locationURL = null; + try { + locationURL = location === null ? null : new URL$1(location, request.url).toString(); + } catch (err) { + // error here can only be invalid URL in Location: header + // do not throw when options.redirect == manual + // let the user extract the errorneous redirect URL + if (request.redirect !== 'manual') { + reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); + finalize(); + return; + } + } + + // HTTP fetch step 5.5 + switch (request.redirect) { + case 'error': + reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); + finalize(); + return; + case 'manual': + // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. + if (locationURL !== null) { + // handle corrupted header + try { + headers.set('Location', locationURL); + } catch (err) { + // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request + reject(err); + } + } + break; + case 'follow': + // HTTP-redirect fetch step 2 + if (locationURL === null) { + break; + } + + // HTTP-redirect fetch step 5 + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); + finalize(); + return; + } + + // HTTP-redirect fetch step 6 (counter increment) + // Create a new Request object. + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout, + size: request.size + }; + + if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { + for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { + requestOpts.headers.delete(name); + } + } + + // HTTP-redirect fetch step 9 + if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { + reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); + finalize(); + return; + } + + // HTTP-redirect fetch step 11 + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { + requestOpts.method = 'GET'; + requestOpts.body = undefined; + requestOpts.headers.delete('content-length'); + } + + // HTTP-redirect fetch step 15 + resolve(fetch(new Request(locationURL, requestOpts))); + finalize(); + return; + } + } + + // prepare response + res.once('end', function () { + if (signal) signal.removeEventListener('abort', abortAndFinalize); + }); + let body = res.pipe(new PassThrough$1()); + + const response_options = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers: headers, + size: request.size, + timeout: request.timeout, + counter: request.counter + }; + + // HTTP-network fetch step 12.1.1.3 + const codings = headers.get('Content-Encoding'); + + // HTTP-network fetch step 12.1.1.4: handle content codings + + // in following scenarios we ignore compression support + // 1. compression support is disabled + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) + if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response(body, response_options); + resolve(response); + return; + } + + // For Node v6+ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + const zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + }; + + // for gzip + if (codings == 'gzip' || codings == 'x-gzip') { + body = body.pipe(zlib.createGunzip(zlibOptions)); + response = new Response(body, response_options); + resolve(response); + return; + } + + // for deflate + if (codings == 'deflate' || codings == 'x-deflate') { + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new PassThrough$1()); + raw.once('data', function (chunk) { + // see http://stackoverflow.com/questions/37519828 + if ((chunk[0] & 0x0F) === 0x08) { + body = body.pipe(zlib.createInflate()); + } else { + body = body.pipe(zlib.createInflateRaw()); + } + response = new Response(body, response_options); + resolve(response); + }); + raw.on('end', function () { + // some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted. + if (!response) { + response = new Response(body, response_options); + resolve(response); + } + }); + return; + } + + // for br + if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { + body = body.pipe(zlib.createBrotliDecompress()); + response = new Response(body, response_options); + resolve(response); + return; + } + + // otherwise, use response as-is + response = new Response(body, response_options); + resolve(response); + }); + + writeToStream(req, request); + }); +} +function fixResponseChunkedTransferBadEnding(request, errorCallback) { + let socket; + + request.on('socket', function (s) { + socket = s; + }); + + request.on('response', function (response) { + const headers = response.headers; + + if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) { + response.once('close', function (hadError) { + // tests for socket presence, as in some situations the + // the 'socket' event is not triggered for the request + // (happens in deno), avoids `TypeError` + // if a data listener is still present we didn't end cleanly + const hasDataListener = socket && socket.listenerCount('data') > 0; + + if (hasDataListener && !hadError) { + const err = new Error('Premature close'); + err.code = 'ERR_STREAM_PREMATURE_CLOSE'; + errorCallback(err); + } + }); + } + }); +} + +function destroyStream(stream, err) { + if (stream.destroy) { + stream.destroy(err); + } else { + // node < 8 + stream.emit('error', err); + stream.end(); + } +} + +/** + * Redirect code matching + * + * @param Number code Status code + * @return Boolean + */ +fetch.isRedirect = function (code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; +}; + +// expose Promise +fetch.Promise = global.Promise; + +export default fetch; +export { Headers, Request, Response, FetchError, AbortError }; diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/node-fetch/lib/index.js new file mode 100644 index 00000000..567ff5da --- /dev/null +++ b/node_modules/node-fetch/lib/index.js @@ -0,0 +1,1787 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var Stream = _interopDefault(require('stream')); +var http = _interopDefault(require('http')); +var Url = _interopDefault(require('url')); +var whatwgUrl = _interopDefault(require('whatwg-url')); +var https = _interopDefault(require('https')); +var zlib = _interopDefault(require('zlib')); + +// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js + +// fix for "Readable" isn't a named export issue +const Readable = Stream.Readable; + +const BUFFER = Symbol('buffer'); +const TYPE = Symbol('type'); + +class Blob { + constructor() { + this[TYPE] = ''; + + const blobParts = arguments[0]; + const options = arguments[1]; + + const buffers = []; + let size = 0; + + if (blobParts) { + const a = blobParts; + const length = Number(a.length); + for (let i = 0; i < length; i++) { + const element = a[i]; + let buffer; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(element); + } else if (element instanceof Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === 'string' ? element : String(element)); + } + size += buffer.length; + buffers.push(buffer); + } + } + + this[BUFFER] = Buffer.concat(buffers); + + let type = options && options.type !== undefined && String(options.type).toLowerCase(); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } + get size() { + return this[BUFFER].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER].toString()); + } + arrayBuffer() { + const buf = this[BUFFER]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable(); + readable._read = function () {}; + readable.push(this[BUFFER]); + readable.push(null); + return readable; + } + toString() { + return '[object Blob]'; + } + slice() { + const size = this.size; + + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === undefined) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === undefined) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); + + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new Blob([], { type: arguments[2] }); + blob[BUFFER] = slicedBuffer; + return blob; + } +} + +Object.defineProperties(Blob.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } +}); + +Object.defineProperty(Blob.prototype, Symbol.toStringTag, { + value: 'Blob', + writable: false, + enumerable: false, + configurable: true +}); + +/** + * fetch-error.js + * + * FetchError interface for operational errors + */ + +/** + * Create FetchError instance + * + * @param String message Error message for human + * @param String type Error type for machine + * @param String systemError For Node.js system error + * @return FetchError + */ +function FetchError(message, type, systemError) { + Error.call(this, message); + + this.message = message; + this.type = type; + + // when err.type is `system`, err.code contains system error code + if (systemError) { + this.code = this.errno = systemError.code; + } + + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} + +FetchError.prototype = Object.create(Error.prototype); +FetchError.prototype.constructor = FetchError; +FetchError.prototype.name = 'FetchError'; + +let convert; +try { + convert = require('encoding').convert; +} catch (e) {} + +const INTERNALS = Symbol('Body internals'); + +// fix an issue where "PassThrough" isn't a named export for node <10 +const PassThrough = Stream.PassThrough; + +/** + * Body mixin + * + * Ref: https://fetch.spec.whatwg.org/#body + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +function Body(body) { + var _this = this; + + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$size = _ref.size; + + let size = _ref$size === undefined ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; + + if (body == null) { + // body is undefined or null + body = null; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + body = Buffer.from(body.toString()); + } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + body = Buffer.from(body); + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); + } else if (body instanceof Stream) ; else { + // none of the above + // coerce to string then buffer + body = Buffer.from(String(body)); + } + this[INTERNALS] = { + body, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout; + + if (body instanceof Stream) { + body.on('error', function (err) { + const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); + _this[INTERNALS].error = error; + }); + } +} + +Body.prototype = { + get body() { + return this[INTERNALS].body; + }, + + get bodyUsed() { + return this[INTERNALS].disturbed; + }, + + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function (buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); + }, + + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct = this.headers && this.headers.get('content-type') || ''; + return consumeBody.call(this).then(function (buf) { + return Object.assign( + // Prevent copying + new Blob([], { + type: ct.toLowerCase() + }), { + [BUFFER]: buf + }); + }); + }, + + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; + + return consumeBody.call(this).then(function (buffer) { + try { + return JSON.parse(buffer.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); + } + }); + }, + + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function (buffer) { + return buffer.toString(); + }); + }, + + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); + }, + + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; + + return consumeBody.call(this).then(function (buffer) { + return convertBody(buffer, _this3.headers); + }); + } +}; + +// In browsers, all properties are enumerable. +Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } +}); + +Body.mixIn = function (proto) { + for (const name of Object.getOwnPropertyNames(Body.prototype)) { + // istanbul ignore else: future proof + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } + } +}; + +/** + * Consume and convert an entire Body to a Buffer. + * + * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body + * + * @return Promise + */ +function consumeBody() { + var _this4 = this; + + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + } + + this[INTERNALS].disturbed = true; + + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } + + let body = this.body; + + // body is null + if (body === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + + // body is blob + if (isBlob(body)) { + body = body.stream(); + } + + // body is buffer + if (Buffer.isBuffer(body)) { + return Body.Promise.resolve(body); + } + + // istanbul ignore if: should never happen + if (!(body instanceof Stream)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + + // body is stream + // get ready to actually consume the body + let accum = []; + let accumBytes = 0; + let abort = false; + + return new Body.Promise(function (resolve, reject) { + let resTimeout; + + // allow timeout on slow response body + if (_this4.timeout) { + resTimeout = setTimeout(function () { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); + }, _this4.timeout); + } + + // handle stream errors + body.on('error', function (err) { + if (err.name === 'AbortError') { + // if the request was aborted, reject with this Error + abort = true; + reject(err); + } else { + // other errors, such as incorrect content-encoding + reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + + body.on('data', function (chunk) { + if (abort || chunk === null) { + return; + } + + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); + return; + } + + accumBytes += chunk.length; + accum.push(chunk); + }); + + body.on('end', function () { + if (abort) { + return; + } + + clearTimeout(resTimeout); + + try { + resolve(Buffer.concat(accum, accumBytes)); + } catch (err) { + // handle streams that have accumulated too much data (issue #414) + reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + }); +} + +/** + * Detect buffer encoding and convert to target encoding + * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding + * + * @param Buffer buffer Incoming buffer + * @param String encoding Target encoding + * @return String + */ +function convertBody(buffer, headers) { + if (typeof convert !== 'function') { + throw new Error('The package `encoding` must be installed to use the textConverted() function'); + } + + const ct = headers.get('content-type'); + let charset = 'utf-8'; + let res, str; + + // header + if (ct) { + res = /charset=([^;]*)/i.exec(ct); + } + + // no charset in content type, peek at response body for at most 1024 bytes + str = buffer.slice(0, 1024).toString(); + + // html5 + if (!res && str) { + res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; + + this[MAP] = Object.create(null); + + if (init instanceof Headers) { + const rawHeaders = init.raw(); + const headerNames = Object.keys(rawHeaders); + + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } + } + + return; + } + + // We don't worry about converting prop to ByteString here as append() + // will handle it. + if (init == null) ; else if (typeof init === 'object') { + const method = init[Symbol.iterator]; + if (method != null) { + if (typeof method !== 'function') { + throw new TypeError('Header pairs must be iterable'); + } + + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = []; + for (const pair of init) { + if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError('Each header pair must be iterable'); + } + pairs.push(Array.from(pair)); + } + + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError('Each header pair must be a name/value tuple'); + } + this.append(pair[0], pair[1]); + } + } else { + // record + for (const key of Object.keys(init)) { + const value = init[key]; + this.append(key, value); + } + } + } else { + throw new TypeError('Provided initializer must be an object'); + } + } + + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key === undefined) { + return null; + } + + return this[MAP][key].join(', '); + } + + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + + let pairs = getHeaders(this); + let i = 0; + while (i < pairs.length) { + var _pairs$i = pairs[i]; + const name = _pairs$i[0], + value = _pairs$i[1]; + + callback.call(thisArg, value, name, this); + pairs = getHeaders(this); + i++; + } + } + + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + this[MAP][key !== undefined ? key : name] = [value]; + } + + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + if (key !== undefined) { + this[MAP][key].push(value); + } else { + this[MAP][name] = [value]; + } + } + + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name) { + name = `${name}`; + validateName(name); + return find(this[MAP], name) !== undefined; + } + + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key !== undefined) { + delete this[MAP][key]; + } + } + + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; + } + + /** + * Get an iterator on keys. + * + * @return Iterator + */ + keys() { + return createHeadersIterator(this, 'key'); + } + + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, 'value'); + } + + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, 'key+value'); + } +} +Headers.prototype.entries = Headers.prototype[Symbol.iterator]; + +Object.defineProperty(Headers.prototype, Symbol.toStringTag, { + value: 'Headers', + writable: false, + enumerable: false, + configurable: true +}); + +Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } +}); + +function getHeaders(headers) { + let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; + + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === 'key' ? function (k) { + return k.toLowerCase(); + } : kind === 'value' ? function (k) { + return headers[MAP][k].join(', '); + } : function (k) { + return [k.toLowerCase(), headers[MAP][k].join(', ')]; + }); +} + +const INTERNAL = Symbol('internal'); + +function createHeadersIterator(target, kind) { + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; +} + +const HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + // istanbul ignore if + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError('Value of `this` is not a HeadersIterator'); + } + + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, + kind = _INTERNAL.kind, + index = _INTERNAL.index; + + const values = getHeaders(target, kind); + const len = values.length; + if (index >= len) { + return { + value: undefined, + done: true + }; + } + + this[INTERNAL].index = index + 1; + + return { + value: values[index], + done: false + }; + } +}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); + +Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: 'HeadersIterator', + writable: false, + enumerable: false, + configurable: true +}); + +/** + * Export the Headers object in a form that Node.js can consume. + * + * @param Headers headers + * @return Object + */ +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); + + // http.request() only supports string as Host header. This hack makes + // specifying custom Host header possible. + const hostHeaderKey = find(headers[MAP], 'Host'); + if (hostHeaderKey !== undefined) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } + + return obj; +} + +/** + * Create a Headers object from an object of headers, ignoring those that do + * not conform to HTTP grammar productions. + * + * @param Object obj Object of headers + * @return Headers + */ +function createHeadersLenient(obj) { + const headers = new Headers(); + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) { + continue; + } + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name] === undefined) { + headers[MAP][name] = [val]; + } else { + headers[MAP][name].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name])) { + headers[MAP][name] = [obj[name]]; + } + } + return headers; +} + +const INTERNALS$1 = Symbol('Response internals'); + +// fix an issue where "STATUS_CODES" aren't a named export for node <10 +const STATUS_CODES = http.STATUS_CODES; + +/** + * Response class + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +class Response { + constructor() { + let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + Body.call(this, body, opts); + + const status = opts.status || 200; + const headers = new Headers(opts.headers); + + if (body != null && !headers.has('Content-Type')) { + const contentType = extractContentType(body); + if (contentType) { + headers.append('Content-Type', contentType); + } + } + + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter + }; + } + + get url() { + return this[INTERNALS$1].url || ''; + } + + get status() { + return this[INTERNALS$1].status; + } + + /** + * Convenience property representing if the request ended normally + */ + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + } + + get redirected() { + return this[INTERNALS$1].counter > 0; + } + + get statusText() { + return this[INTERNALS$1].statusText; + } + + get headers() { + return this[INTERNALS$1].headers; + } + + /** + * Clone this response + * + * @return Response + */ + clone() { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected + }); + } +} + +Body.mixIn(Response.prototype); + +Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } +}); + +Object.defineProperty(Response.prototype, Symbol.toStringTag, { + value: 'Response', + writable: false, + enumerable: false, + configurable: true +}); + +const INTERNALS$2 = Symbol('Request internals'); +const URL = Url.URL || whatwgUrl.URL; + +// fix an issue where "format", "parse" aren't a named export for node <10 +const parse_url = Url.parse; +const format_url = Url.format; + +/** + * Wrapper around `new URL` to handle arbitrary URLs + * + * @param {string} urlStr + * @return {void} + */ +function parseURL(urlStr) { + /* + Check whether the URL is absolute or not + Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 + Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 + */ + if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { + urlStr = new URL(urlStr).toString(); + } + + // Fallback to old implementation for arbitrary URLs + return parse_url(urlStr); +} + +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; + +/** + * Check if a value is an instance of Request. + * + * @param Mixed input + * @return Boolean + */ +function isRequest(input) { + return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; +} + +function isAbortSignal(signal) { + const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === 'AbortSignal'); +} + +/** + * Request class + * + * @param Mixed input Url or Request instance + * @param Object init Custom options + * @return Void + */ +class Request { + constructor(input) { + let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + let parsedURL; + + // normalize input + if (!isRequest(input)) { + if (input && input.href) { + // in order to support Node.js' Url objects; though WHATWG's URL objects + // will fall into this branch also (since their `toString()` will return + // `href` property anyway) + parsedURL = parseURL(input.href); + } else { + // coerce input to a string before attempting to parse + parsedURL = parseURL(`${input}`); + } + input = {}; + } else { + parsedURL = parseURL(input.url); + } + + let method = init.method || input.method || 'GET'; + method = method.toUpperCase(); + + if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { + throw new TypeError('Request with GET/HEAD method cannot have body'); + } + + let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; + + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); + + const headers = new Headers(init.headers || input.headers || {}); + + if (inputBody != null && !headers.has('Content-Type')) { + const contentType = extractContentType(inputBody); + if (contentType) { + headers.append('Content-Type', contentType); + } + } + + let signal = isRequest(input) ? input.signal : null; + if ('signal' in init) signal = init.signal; + + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError('Expected signal to be an instanceof AbortSignal'); + } + + this[INTERNALS$2] = { + method, + redirect: init.redirect || input.redirect || 'follow', + headers, + parsedURL, + signal + }; + + // node-fetch-only options + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; + } + + get method() { + return this[INTERNALS$2].method; + } + + get url() { + return format_url(this[INTERNALS$2].parsedURL); + } + + get headers() { + return this[INTERNALS$2].headers; + } + + get redirect() { + return this[INTERNALS$2].redirect; + } + + get signal() { + return this[INTERNALS$2].signal; + } + + /** + * Clone this request + * + * @return Request + */ + clone() { + return new Request(this); + } +} + +Body.mixIn(Request.prototype); + +Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: 'Request', + writable: false, + enumerable: false, + configurable: true +}); + +Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } +}); + +/** + * Convert a Request to Node.js http request options. + * + * @param Request A Request instance + * @return Object The options object to be passed to http.request + */ +function getNodeRequestOptions(request) { + const parsedURL = request[INTERNALS$2].parsedURL; + const headers = new Headers(request[INTERNALS$2].headers); + + // fetch step 1.3 + if (!headers.has('Accept')) { + headers.set('Accept', '*/*'); + } + + // Basic fetch + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError('Only absolute URLs are supported'); + } + + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError('Only HTTP(S) protocols are supported'); + } + + if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { + throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); + } + + // HTTP-network-or-cache fetch steps 2.4-2.7 + let contentLengthValue = null; + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = '0'; + } + if (request.body != null) { + const totalBytes = getTotalBytes(request); + if (typeof totalBytes === 'number') { + contentLengthValue = String(totalBytes); + } + } + if (contentLengthValue) { + headers.set('Content-Length', contentLengthValue); + } + + // HTTP-network-or-cache fetch step 2.11 + if (!headers.has('User-Agent')) { + headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); + } + + // HTTP-network-or-cache fetch step 2.15 + if (request.compress && !headers.has('Accept-Encoding')) { + headers.set('Accept-Encoding', 'gzip,deflate'); + } + + let agent = request.agent; + if (typeof agent === 'function') { + agent = agent(parsedURL); + } + + // HTTP-network fetch step 4.2 + // chunked encoding is handled by Node.js + + return Object.assign({}, parsedURL, { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); +} + +/** + * abort-error.js + * + * AbortError interface for cancelled requests + */ + +/** + * Create AbortError instance + * + * @param String message Error message for human + * @return AbortError + */ +function AbortError(message) { + Error.call(this, message); + + this.type = 'aborted'; + this.message = message; + + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} + +AbortError.prototype = Object.create(Error.prototype); +AbortError.prototype.constructor = AbortError; +AbortError.prototype.name = 'AbortError'; + +const URL$1 = Url.URL || whatwgUrl.URL; + +// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 +const PassThrough$1 = Stream.PassThrough; + +const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { + const orig = new URL$1(original).hostname; + const dest = new URL$1(destination).hostname; + + return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); +}; + +/** + * isSameProtocol reports whether the two provided URLs use the same protocol. + * + * Both domains must already be in canonical form. + * @param {string|URL} original + * @param {string|URL} destination + */ +const isSameProtocol = function isSameProtocol(destination, original) { + const orig = new URL$1(original).protocol; + const dest = new URL$1(destination).protocol; + + return orig === dest; +}; + +/** + * Fetch function + * + * @param Mixed url Absolute url or Request instance + * @param Object opts Fetch options + * @return Promise + */ +function fetch(url, opts) { + + // allow custom promise + if (!fetch.Promise) { + throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); + } + + Body.Promise = fetch.Promise; + + // wrap http.request into fetch + return new fetch.Promise(function (resolve, reject) { + // build request object + const request = new Request(url, opts); + const options = getNodeRequestOptions(request); + + const send = (options.protocol === 'https:' ? https : http).request; + const signal = request.signal; + + let response = null; + + const abort = function abort() { + let error = new AbortError('The user aborted a request.'); + reject(error); + if (request.body && request.body instanceof Stream.Readable) { + destroyStream(request.body, error); + } + if (!response || !response.body) return; + response.body.emit('error', error); + }; + + if (signal && signal.aborted) { + abort(); + return; + } + + const abortAndFinalize = function abortAndFinalize() { + abort(); + finalize(); + }; + + // send request + const req = send(options); + let reqTimeout; + + if (signal) { + signal.addEventListener('abort', abortAndFinalize); + } + + function finalize() { + req.abort(); + if (signal) signal.removeEventListener('abort', abortAndFinalize); + clearTimeout(reqTimeout); + } + + if (request.timeout) { + req.once('socket', function (socket) { + reqTimeout = setTimeout(function () { + reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); + finalize(); + }, request.timeout); + }); + } + + req.on('error', function (err) { + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); + + if (response && response.body) { + destroyStream(response.body, err); + } + + finalize(); + }); + + fixResponseChunkedTransferBadEnding(req, function (err) { + if (signal && signal.aborted) { + return; + } + + if (response && response.body) { + destroyStream(response.body, err); + } + }); + + /* c8 ignore next 18 */ + if (parseInt(process.version.substring(1)) < 14) { + // Before Node.js 14, pipeline() does not fully support async iterators and does not always + // properly handle when the socket close/end events are out of order. + req.on('socket', function (s) { + s.addListener('close', function (hadError) { + // if a data listener is still present we didn't end cleanly + const hasDataListener = s.listenerCount('data') > 0; + + // if end happened before close but the socket didn't emit an error, do it now + if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { + const err = new Error('Premature close'); + err.code = 'ERR_STREAM_PREMATURE_CLOSE'; + response.body.emit('error', err); + } + }); + }); + } + + req.on('response', function (res) { + clearTimeout(reqTimeout); + + const headers = createHeadersLenient(res.headers); + + // HTTP fetch step 5 + if (fetch.isRedirect(res.statusCode)) { + // HTTP fetch step 5.2 + const location = headers.get('Location'); + + // HTTP fetch step 5.3 + let locationURL = null; + try { + locationURL = location === null ? null : new URL$1(location, request.url).toString(); + } catch (err) { + // error here can only be invalid URL in Location: header + // do not throw when options.redirect == manual + // let the user extract the errorneous redirect URL + if (request.redirect !== 'manual') { + reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); + finalize(); + return; + } + } + + // HTTP fetch step 5.5 + switch (request.redirect) { + case 'error': + reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); + finalize(); + return; + case 'manual': + // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. + if (locationURL !== null) { + // handle corrupted header + try { + headers.set('Location', locationURL); + } catch (err) { + // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request + reject(err); + } + } + break; + case 'follow': + // HTTP-redirect fetch step 2 + if (locationURL === null) { + break; + } + + // HTTP-redirect fetch step 5 + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); + finalize(); + return; + } + + // HTTP-redirect fetch step 6 (counter increment) + // Create a new Request object. + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout, + size: request.size + }; + + if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { + for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { + requestOpts.headers.delete(name); + } + } + + // HTTP-redirect fetch step 9 + if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { + reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); + finalize(); + return; + } + + // HTTP-redirect fetch step 11 + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { + requestOpts.method = 'GET'; + requestOpts.body = undefined; + requestOpts.headers.delete('content-length'); + } + + // HTTP-redirect fetch step 15 + resolve(fetch(new Request(locationURL, requestOpts))); + finalize(); + return; + } + } + + // prepare response + res.once('end', function () { + if (signal) signal.removeEventListener('abort', abortAndFinalize); + }); + let body = res.pipe(new PassThrough$1()); + + const response_options = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers: headers, + size: request.size, + timeout: request.timeout, + counter: request.counter + }; + + // HTTP-network fetch step 12.1.1.3 + const codings = headers.get('Content-Encoding'); + + // HTTP-network fetch step 12.1.1.4: handle content codings + + // in following scenarios we ignore compression support + // 1. compression support is disabled + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) + if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response(body, response_options); + resolve(response); + return; + } + + // For Node v6+ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + const zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + }; + + // for gzip + if (codings == 'gzip' || codings == 'x-gzip') { + body = body.pipe(zlib.createGunzip(zlibOptions)); + response = new Response(body, response_options); + resolve(response); + return; + } + + // for deflate + if (codings == 'deflate' || codings == 'x-deflate') { + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new PassThrough$1()); + raw.once('data', function (chunk) { + // see http://stackoverflow.com/questions/37519828 + if ((chunk[0] & 0x0F) === 0x08) { + body = body.pipe(zlib.createInflate()); + } else { + body = body.pipe(zlib.createInflateRaw()); + } + response = new Response(body, response_options); + resolve(response); + }); + raw.on('end', function () { + // some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted. + if (!response) { + response = new Response(body, response_options); + resolve(response); + } + }); + return; + } + + // for br + if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { + body = body.pipe(zlib.createBrotliDecompress()); + response = new Response(body, response_options); + resolve(response); + return; + } + + // otherwise, use response as-is + response = new Response(body, response_options); + resolve(response); + }); + + writeToStream(req, request); + }); +} +function fixResponseChunkedTransferBadEnding(request, errorCallback) { + let socket; + + request.on('socket', function (s) { + socket = s; + }); + + request.on('response', function (response) { + const headers = response.headers; + + if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) { + response.once('close', function (hadError) { + // tests for socket presence, as in some situations the + // the 'socket' event is not triggered for the request + // (happens in deno), avoids `TypeError` + // if a data listener is still present we didn't end cleanly + const hasDataListener = socket && socket.listenerCount('data') > 0; + + if (hasDataListener && !hadError) { + const err = new Error('Premature close'); + err.code = 'ERR_STREAM_PREMATURE_CLOSE'; + errorCallback(err); + } + }); + } + }); +} + +function destroyStream(stream, err) { + if (stream.destroy) { + stream.destroy(err); + } else { + // node < 8 + stream.emit('error', err); + stream.end(); + } +} + +/** + * Redirect code matching + * + * @param Number code Status code + * @return Boolean + */ +fetch.isRedirect = function (code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; +}; + +// expose Promise +fetch.Promise = global.Promise; + +module.exports = exports = fetch; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = exports; +exports.Headers = Headers; +exports.Request = Request; +exports.Response = Response; +exports.FetchError = FetchError; +exports.AbortError = AbortError; diff --git a/node_modules/node-fetch/lib/index.mjs b/node_modules/node-fetch/lib/index.mjs new file mode 100644 index 00000000..2863dd9c --- /dev/null +++ b/node_modules/node-fetch/lib/index.mjs @@ -0,0 +1,1775 @@ +import Stream from 'stream'; +import http from 'http'; +import Url from 'url'; +import whatwgUrl from 'whatwg-url'; +import https from 'https'; +import zlib from 'zlib'; + +// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js + +// fix for "Readable" isn't a named export issue +const Readable = Stream.Readable; + +const BUFFER = Symbol('buffer'); +const TYPE = Symbol('type'); + +class Blob { + constructor() { + this[TYPE] = ''; + + const blobParts = arguments[0]; + const options = arguments[1]; + + const buffers = []; + let size = 0; + + if (blobParts) { + const a = blobParts; + const length = Number(a.length); + for (let i = 0; i < length; i++) { + const element = a[i]; + let buffer; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(element); + } else if (element instanceof Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === 'string' ? element : String(element)); + } + size += buffer.length; + buffers.push(buffer); + } + } + + this[BUFFER] = Buffer.concat(buffers); + + let type = options && options.type !== undefined && String(options.type).toLowerCase(); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } + get size() { + return this[BUFFER].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER].toString()); + } + arrayBuffer() { + const buf = this[BUFFER]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable(); + readable._read = function () {}; + readable.push(this[BUFFER]); + readable.push(null); + return readable; + } + toString() { + return '[object Blob]'; + } + slice() { + const size = this.size; + + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === undefined) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === undefined) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); + + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new Blob([], { type: arguments[2] }); + blob[BUFFER] = slicedBuffer; + return blob; + } +} + +Object.defineProperties(Blob.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } +}); + +Object.defineProperty(Blob.prototype, Symbol.toStringTag, { + value: 'Blob', + writable: false, + enumerable: false, + configurable: true +}); + +/** + * fetch-error.js + * + * FetchError interface for operational errors + */ + +/** + * Create FetchError instance + * + * @param String message Error message for human + * @param String type Error type for machine + * @param String systemError For Node.js system error + * @return FetchError + */ +function FetchError(message, type, systemError) { + Error.call(this, message); + + this.message = message; + this.type = type; + + // when err.type is `system`, err.code contains system error code + if (systemError) { + this.code = this.errno = systemError.code; + } + + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} + +FetchError.prototype = Object.create(Error.prototype); +FetchError.prototype.constructor = FetchError; +FetchError.prototype.name = 'FetchError'; + +let convert; +try { + convert = require('encoding').convert; +} catch (e) {} + +const INTERNALS = Symbol('Body internals'); + +// fix an issue where "PassThrough" isn't a named export for node <10 +const PassThrough = Stream.PassThrough; + +/** + * Body mixin + * + * Ref: https://fetch.spec.whatwg.org/#body + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +function Body(body) { + var _this = this; + + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$size = _ref.size; + + let size = _ref$size === undefined ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; + + if (body == null) { + // body is undefined or null + body = null; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + body = Buffer.from(body.toString()); + } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + body = Buffer.from(body); + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); + } else if (body instanceof Stream) ; else { + // none of the above + // coerce to string then buffer + body = Buffer.from(String(body)); + } + this[INTERNALS] = { + body, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout; + + if (body instanceof Stream) { + body.on('error', function (err) { + const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); + _this[INTERNALS].error = error; + }); + } +} + +Body.prototype = { + get body() { + return this[INTERNALS].body; + }, + + get bodyUsed() { + return this[INTERNALS].disturbed; + }, + + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function (buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); + }, + + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct = this.headers && this.headers.get('content-type') || ''; + return consumeBody.call(this).then(function (buf) { + return Object.assign( + // Prevent copying + new Blob([], { + type: ct.toLowerCase() + }), { + [BUFFER]: buf + }); + }); + }, + + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; + + return consumeBody.call(this).then(function (buffer) { + try { + return JSON.parse(buffer.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); + } + }); + }, + + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function (buffer) { + return buffer.toString(); + }); + }, + + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); + }, + + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; + + return consumeBody.call(this).then(function (buffer) { + return convertBody(buffer, _this3.headers); + }); + } +}; + +// In browsers, all properties are enumerable. +Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } +}); + +Body.mixIn = function (proto) { + for (const name of Object.getOwnPropertyNames(Body.prototype)) { + // istanbul ignore else: future proof + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } + } +}; + +/** + * Consume and convert an entire Body to a Buffer. + * + * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body + * + * @return Promise + */ +function consumeBody() { + var _this4 = this; + + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + } + + this[INTERNALS].disturbed = true; + + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } + + let body = this.body; + + // body is null + if (body === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + + // body is blob + if (isBlob(body)) { + body = body.stream(); + } + + // body is buffer + if (Buffer.isBuffer(body)) { + return Body.Promise.resolve(body); + } + + // istanbul ignore if: should never happen + if (!(body instanceof Stream)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + + // body is stream + // get ready to actually consume the body + let accum = []; + let accumBytes = 0; + let abort = false; + + return new Body.Promise(function (resolve, reject) { + let resTimeout; + + // allow timeout on slow response body + if (_this4.timeout) { + resTimeout = setTimeout(function () { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); + }, _this4.timeout); + } + + // handle stream errors + body.on('error', function (err) { + if (err.name === 'AbortError') { + // if the request was aborted, reject with this Error + abort = true; + reject(err); + } else { + // other errors, such as incorrect content-encoding + reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + + body.on('data', function (chunk) { + if (abort || chunk === null) { + return; + } + + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); + return; + } + + accumBytes += chunk.length; + accum.push(chunk); + }); + + body.on('end', function () { + if (abort) { + return; + } + + clearTimeout(resTimeout); + + try { + resolve(Buffer.concat(accum, accumBytes)); + } catch (err) { + // handle streams that have accumulated too much data (issue #414) + reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + }); +} + +/** + * Detect buffer encoding and convert to target encoding + * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding + * + * @param Buffer buffer Incoming buffer + * @param String encoding Target encoding + * @return String + */ +function convertBody(buffer, headers) { + if (typeof convert !== 'function') { + throw new Error('The package `encoding` must be installed to use the textConverted() function'); + } + + const ct = headers.get('content-type'); + let charset = 'utf-8'; + let res, str; + + // header + if (ct) { + res = /charset=([^;]*)/i.exec(ct); + } + + // no charset in content type, peek at response body for at most 1024 bytes + str = buffer.slice(0, 1024).toString(); + + // html5 + if (!res && str) { + res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; + + this[MAP] = Object.create(null); + + if (init instanceof Headers) { + const rawHeaders = init.raw(); + const headerNames = Object.keys(rawHeaders); + + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } + } + + return; + } + + // We don't worry about converting prop to ByteString here as append() + // will handle it. + if (init == null) ; else if (typeof init === 'object') { + const method = init[Symbol.iterator]; + if (method != null) { + if (typeof method !== 'function') { + throw new TypeError('Header pairs must be iterable'); + } + + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = []; + for (const pair of init) { + if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError('Each header pair must be iterable'); + } + pairs.push(Array.from(pair)); + } + + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError('Each header pair must be a name/value tuple'); + } + this.append(pair[0], pair[1]); + } + } else { + // record + for (const key of Object.keys(init)) { + const value = init[key]; + this.append(key, value); + } + } + } else { + throw new TypeError('Provided initializer must be an object'); + } + } + + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key === undefined) { + return null; + } + + return this[MAP][key].join(', '); + } + + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + + let pairs = getHeaders(this); + let i = 0; + while (i < pairs.length) { + var _pairs$i = pairs[i]; + const name = _pairs$i[0], + value = _pairs$i[1]; + + callback.call(thisArg, value, name, this); + pairs = getHeaders(this); + i++; + } + } + + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + this[MAP][key !== undefined ? key : name] = [value]; + } + + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + if (key !== undefined) { + this[MAP][key].push(value); + } else { + this[MAP][name] = [value]; + } + } + + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name) { + name = `${name}`; + validateName(name); + return find(this[MAP], name) !== undefined; + } + + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key !== undefined) { + delete this[MAP][key]; + } + } + + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; + } + + /** + * Get an iterator on keys. + * + * @return Iterator + */ + keys() { + return createHeadersIterator(this, 'key'); + } + + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, 'value'); + } + + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, 'key+value'); + } +} +Headers.prototype.entries = Headers.prototype[Symbol.iterator]; + +Object.defineProperty(Headers.prototype, Symbol.toStringTag, { + value: 'Headers', + writable: false, + enumerable: false, + configurable: true +}); + +Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } +}); + +function getHeaders(headers) { + let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; + + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === 'key' ? function (k) { + return k.toLowerCase(); + } : kind === 'value' ? function (k) { + return headers[MAP][k].join(', '); + } : function (k) { + return [k.toLowerCase(), headers[MAP][k].join(', ')]; + }); +} + +const INTERNAL = Symbol('internal'); + +function createHeadersIterator(target, kind) { + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; +} + +const HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + // istanbul ignore if + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError('Value of `this` is not a HeadersIterator'); + } + + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, + kind = _INTERNAL.kind, + index = _INTERNAL.index; + + const values = getHeaders(target, kind); + const len = values.length; + if (index >= len) { + return { + value: undefined, + done: true + }; + } + + this[INTERNAL].index = index + 1; + + return { + value: values[index], + done: false + }; + } +}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); + +Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: 'HeadersIterator', + writable: false, + enumerable: false, + configurable: true +}); + +/** + * Export the Headers object in a form that Node.js can consume. + * + * @param Headers headers + * @return Object + */ +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); + + // http.request() only supports string as Host header. This hack makes + // specifying custom Host header possible. + const hostHeaderKey = find(headers[MAP], 'Host'); + if (hostHeaderKey !== undefined) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } + + return obj; +} + +/** + * Create a Headers object from an object of headers, ignoring those that do + * not conform to HTTP grammar productions. + * + * @param Object obj Object of headers + * @return Headers + */ +function createHeadersLenient(obj) { + const headers = new Headers(); + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) { + continue; + } + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name] === undefined) { + headers[MAP][name] = [val]; + } else { + headers[MAP][name].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name])) { + headers[MAP][name] = [obj[name]]; + } + } + return headers; +} + +const INTERNALS$1 = Symbol('Response internals'); + +// fix an issue where "STATUS_CODES" aren't a named export for node <10 +const STATUS_CODES = http.STATUS_CODES; + +/** + * Response class + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +class Response { + constructor() { + let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + Body.call(this, body, opts); + + const status = opts.status || 200; + const headers = new Headers(opts.headers); + + if (body != null && !headers.has('Content-Type')) { + const contentType = extractContentType(body); + if (contentType) { + headers.append('Content-Type', contentType); + } + } + + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter + }; + } + + get url() { + return this[INTERNALS$1].url || ''; + } + + get status() { + return this[INTERNALS$1].status; + } + + /** + * Convenience property representing if the request ended normally + */ + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + } + + get redirected() { + return this[INTERNALS$1].counter > 0; + } + + get statusText() { + return this[INTERNALS$1].statusText; + } + + get headers() { + return this[INTERNALS$1].headers; + } + + /** + * Clone this response + * + * @return Response + */ + clone() { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected + }); + } +} + +Body.mixIn(Response.prototype); + +Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } +}); + +Object.defineProperty(Response.prototype, Symbol.toStringTag, { + value: 'Response', + writable: false, + enumerable: false, + configurable: true +}); + +const INTERNALS$2 = Symbol('Request internals'); +const URL = Url.URL || whatwgUrl.URL; + +// fix an issue where "format", "parse" aren't a named export for node <10 +const parse_url = Url.parse; +const format_url = Url.format; + +/** + * Wrapper around `new URL` to handle arbitrary URLs + * + * @param {string} urlStr + * @return {void} + */ +function parseURL(urlStr) { + /* + Check whether the URL is absolute or not + Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 + Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 + */ + if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { + urlStr = new URL(urlStr).toString(); + } + + // Fallback to old implementation for arbitrary URLs + return parse_url(urlStr); +} + +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; + +/** + * Check if a value is an instance of Request. + * + * @param Mixed input + * @return Boolean + */ +function isRequest(input) { + return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; +} + +function isAbortSignal(signal) { + const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === 'AbortSignal'); +} + +/** + * Request class + * + * @param Mixed input Url or Request instance + * @param Object init Custom options + * @return Void + */ +class Request { + constructor(input) { + let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + let parsedURL; + + // normalize input + if (!isRequest(input)) { + if (input && input.href) { + // in order to support Node.js' Url objects; though WHATWG's URL objects + // will fall into this branch also (since their `toString()` will return + // `href` property anyway) + parsedURL = parseURL(input.href); + } else { + // coerce input to a string before attempting to parse + parsedURL = parseURL(`${input}`); + } + input = {}; + } else { + parsedURL = parseURL(input.url); + } + + let method = init.method || input.method || 'GET'; + method = method.toUpperCase(); + + if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { + throw new TypeError('Request with GET/HEAD method cannot have body'); + } + + let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; + + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); + + const headers = new Headers(init.headers || input.headers || {}); + + if (inputBody != null && !headers.has('Content-Type')) { + const contentType = extractContentType(inputBody); + if (contentType) { + headers.append('Content-Type', contentType); + } + } + + let signal = isRequest(input) ? input.signal : null; + if ('signal' in init) signal = init.signal; + + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError('Expected signal to be an instanceof AbortSignal'); + } + + this[INTERNALS$2] = { + method, + redirect: init.redirect || input.redirect || 'follow', + headers, + parsedURL, + signal + }; + + // node-fetch-only options + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; + } + + get method() { + return this[INTERNALS$2].method; + } + + get url() { + return format_url(this[INTERNALS$2].parsedURL); + } + + get headers() { + return this[INTERNALS$2].headers; + } + + get redirect() { + return this[INTERNALS$2].redirect; + } + + get signal() { + return this[INTERNALS$2].signal; + } + + /** + * Clone this request + * + * @return Request + */ + clone() { + return new Request(this); + } +} + +Body.mixIn(Request.prototype); + +Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: 'Request', + writable: false, + enumerable: false, + configurable: true +}); + +Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } +}); + +/** + * Convert a Request to Node.js http request options. + * + * @param Request A Request instance + * @return Object The options object to be passed to http.request + */ +function getNodeRequestOptions(request) { + const parsedURL = request[INTERNALS$2].parsedURL; + const headers = new Headers(request[INTERNALS$2].headers); + + // fetch step 1.3 + if (!headers.has('Accept')) { + headers.set('Accept', '*/*'); + } + + // Basic fetch + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError('Only absolute URLs are supported'); + } + + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError('Only HTTP(S) protocols are supported'); + } + + if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { + throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); + } + + // HTTP-network-or-cache fetch steps 2.4-2.7 + let contentLengthValue = null; + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = '0'; + } + if (request.body != null) { + const totalBytes = getTotalBytes(request); + if (typeof totalBytes === 'number') { + contentLengthValue = String(totalBytes); + } + } + if (contentLengthValue) { + headers.set('Content-Length', contentLengthValue); + } + + // HTTP-network-or-cache fetch step 2.11 + if (!headers.has('User-Agent')) { + headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); + } + + // HTTP-network-or-cache fetch step 2.15 + if (request.compress && !headers.has('Accept-Encoding')) { + headers.set('Accept-Encoding', 'gzip,deflate'); + } + + let agent = request.agent; + if (typeof agent === 'function') { + agent = agent(parsedURL); + } + + // HTTP-network fetch step 4.2 + // chunked encoding is handled by Node.js + + return Object.assign({}, parsedURL, { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); +} + +/** + * abort-error.js + * + * AbortError interface for cancelled requests + */ + +/** + * Create AbortError instance + * + * @param String message Error message for human + * @return AbortError + */ +function AbortError(message) { + Error.call(this, message); + + this.type = 'aborted'; + this.message = message; + + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} + +AbortError.prototype = Object.create(Error.prototype); +AbortError.prototype.constructor = AbortError; +AbortError.prototype.name = 'AbortError'; + +const URL$1 = Url.URL || whatwgUrl.URL; + +// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 +const PassThrough$1 = Stream.PassThrough; + +const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { + const orig = new URL$1(original).hostname; + const dest = new URL$1(destination).hostname; + + return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); +}; + +/** + * isSameProtocol reports whether the two provided URLs use the same protocol. + * + * Both domains must already be in canonical form. + * @param {string|URL} original + * @param {string|URL} destination + */ +const isSameProtocol = function isSameProtocol(destination, original) { + const orig = new URL$1(original).protocol; + const dest = new URL$1(destination).protocol; + + return orig === dest; +}; + +/** + * Fetch function + * + * @param Mixed url Absolute url or Request instance + * @param Object opts Fetch options + * @return Promise + */ +function fetch(url, opts) { + + // allow custom promise + if (!fetch.Promise) { + throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); + } + + Body.Promise = fetch.Promise; + + // wrap http.request into fetch + return new fetch.Promise(function (resolve, reject) { + // build request object + const request = new Request(url, opts); + const options = getNodeRequestOptions(request); + + const send = (options.protocol === 'https:' ? https : http).request; + const signal = request.signal; + + let response = null; + + const abort = function abort() { + let error = new AbortError('The user aborted a request.'); + reject(error); + if (request.body && request.body instanceof Stream.Readable) { + destroyStream(request.body, error); + } + if (!response || !response.body) return; + response.body.emit('error', error); + }; + + if (signal && signal.aborted) { + abort(); + return; + } + + const abortAndFinalize = function abortAndFinalize() { + abort(); + finalize(); + }; + + // send request + const req = send(options); + let reqTimeout; + + if (signal) { + signal.addEventListener('abort', abortAndFinalize); + } + + function finalize() { + req.abort(); + if (signal) signal.removeEventListener('abort', abortAndFinalize); + clearTimeout(reqTimeout); + } + + if (request.timeout) { + req.once('socket', function (socket) { + reqTimeout = setTimeout(function () { + reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); + finalize(); + }, request.timeout); + }); + } + + req.on('error', function (err) { + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); + + if (response && response.body) { + destroyStream(response.body, err); + } + + finalize(); + }); + + fixResponseChunkedTransferBadEnding(req, function (err) { + if (signal && signal.aborted) { + return; + } + + if (response && response.body) { + destroyStream(response.body, err); + } + }); + + /* c8 ignore next 18 */ + if (parseInt(process.version.substring(1)) < 14) { + // Before Node.js 14, pipeline() does not fully support async iterators and does not always + // properly handle when the socket close/end events are out of order. + req.on('socket', function (s) { + s.addListener('close', function (hadError) { + // if a data listener is still present we didn't end cleanly + const hasDataListener = s.listenerCount('data') > 0; + + // if end happened before close but the socket didn't emit an error, do it now + if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { + const err = new Error('Premature close'); + err.code = 'ERR_STREAM_PREMATURE_CLOSE'; + response.body.emit('error', err); + } + }); + }); + } + + req.on('response', function (res) { + clearTimeout(reqTimeout); + + const headers = createHeadersLenient(res.headers); + + // HTTP fetch step 5 + if (fetch.isRedirect(res.statusCode)) { + // HTTP fetch step 5.2 + const location = headers.get('Location'); + + // HTTP fetch step 5.3 + let locationURL = null; + try { + locationURL = location === null ? null : new URL$1(location, request.url).toString(); + } catch (err) { + // error here can only be invalid URL in Location: header + // do not throw when options.redirect == manual + // let the user extract the errorneous redirect URL + if (request.redirect !== 'manual') { + reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); + finalize(); + return; + } + } + + // HTTP fetch step 5.5 + switch (request.redirect) { + case 'error': + reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); + finalize(); + return; + case 'manual': + // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. + if (locationURL !== null) { + // handle corrupted header + try { + headers.set('Location', locationURL); + } catch (err) { + // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request + reject(err); + } + } + break; + case 'follow': + // HTTP-redirect fetch step 2 + if (locationURL === null) { + break; + } + + // HTTP-redirect fetch step 5 + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); + finalize(); + return; + } + + // HTTP-redirect fetch step 6 (counter increment) + // Create a new Request object. + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout, + size: request.size + }; + + if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { + for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { + requestOpts.headers.delete(name); + } + } + + // HTTP-redirect fetch step 9 + if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { + reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); + finalize(); + return; + } + + // HTTP-redirect fetch step 11 + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { + requestOpts.method = 'GET'; + requestOpts.body = undefined; + requestOpts.headers.delete('content-length'); + } + + // HTTP-redirect fetch step 15 + resolve(fetch(new Request(locationURL, requestOpts))); + finalize(); + return; + } + } + + // prepare response + res.once('end', function () { + if (signal) signal.removeEventListener('abort', abortAndFinalize); + }); + let body = res.pipe(new PassThrough$1()); + + const response_options = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers: headers, + size: request.size, + timeout: request.timeout, + counter: request.counter + }; + + // HTTP-network fetch step 12.1.1.3 + const codings = headers.get('Content-Encoding'); + + // HTTP-network fetch step 12.1.1.4: handle content codings + + // in following scenarios we ignore compression support + // 1. compression support is disabled + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) + if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response(body, response_options); + resolve(response); + return; + } + + // For Node v6+ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + const zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + }; + + // for gzip + if (codings == 'gzip' || codings == 'x-gzip') { + body = body.pipe(zlib.createGunzip(zlibOptions)); + response = new Response(body, response_options); + resolve(response); + return; + } + + // for deflate + if (codings == 'deflate' || codings == 'x-deflate') { + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new PassThrough$1()); + raw.once('data', function (chunk) { + // see http://stackoverflow.com/questions/37519828 + if ((chunk[0] & 0x0F) === 0x08) { + body = body.pipe(zlib.createInflate()); + } else { + body = body.pipe(zlib.createInflateRaw()); + } + response = new Response(body, response_options); + resolve(response); + }); + raw.on('end', function () { + // some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted. + if (!response) { + response = new Response(body, response_options); + resolve(response); + } + }); + return; + } + + // for br + if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { + body = body.pipe(zlib.createBrotliDecompress()); + response = new Response(body, response_options); + resolve(response); + return; + } + + // otherwise, use response as-is + response = new Response(body, response_options); + resolve(response); + }); + + writeToStream(req, request); + }); +} +function fixResponseChunkedTransferBadEnding(request, errorCallback) { + let socket; + + request.on('socket', function (s) { + socket = s; + }); + + request.on('response', function (response) { + const headers = response.headers; + + if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) { + response.once('close', function (hadError) { + // tests for socket presence, as in some situations the + // the 'socket' event is not triggered for the request + // (happens in deno), avoids `TypeError` + // if a data listener is still present we didn't end cleanly + const hasDataListener = socket && socket.listenerCount('data') > 0; + + if (hasDataListener && !hadError) { + const err = new Error('Premature close'); + err.code = 'ERR_STREAM_PREMATURE_CLOSE'; + errorCallback(err); + } + }); + } + }); +} + +function destroyStream(stream, err) { + if (stream.destroy) { + stream.destroy(err); + } else { + // node < 8 + stream.emit('error', err); + stream.end(); + } +} + +/** + * Redirect code matching + * + * @param Number code Status code + * @return Boolean + */ +fetch.isRedirect = function (code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; +}; + +// expose Promise +fetch.Promise = global.Promise; + +export default fetch; +export { Headers, Request, Response, FetchError, AbortError }; diff --git a/node_modules/node-fetch/node_modules/tr46/.npmignore b/node_modules/node-fetch/node_modules/tr46/.npmignore new file mode 100644 index 00000000..96e9161f --- /dev/null +++ b/node_modules/node-fetch/node_modules/tr46/.npmignore @@ -0,0 +1,4 @@ +scripts/ +test/ + +!lib/mapping_table.json diff --git a/node_modules/node-fetch/node_modules/tr46/index.js b/node_modules/node-fetch/node_modules/tr46/index.js new file mode 100644 index 00000000..9ce12ca2 --- /dev/null +++ b/node_modules/node-fetch/node_modules/tr46/index.js @@ -0,0 +1,193 @@ +"use strict"; + +var punycode = require("punycode"); +var mappingTable = require("./lib/mappingTable.json"); + +var PROCESSING_OPTIONS = { + TRANSITIONAL: 0, + NONTRANSITIONAL: 1 +}; + +function normalize(str) { // fix bug in v8 + return str.split('\u0000').map(function (s) { return s.normalize('NFC'); }).join('\u0000'); +} + +function findStatus(val) { + var start = 0; + var end = mappingTable.length - 1; + + while (start <= end) { + var mid = Math.floor((start + end) / 2); + + var target = mappingTable[mid]; + if (target[0][0] <= val && target[0][1] >= val) { + return target; + } else if (target[0][0] > val) { + end = mid - 1; + } else { + start = mid + 1; + } + } + + return null; +} + +var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + +function countSymbols(string) { + return string + // replace every surrogate pair with a BMP symbol + .replace(regexAstralSymbols, '_') + // then get the length + .length; +} + +function mapChars(domain_name, useSTD3, processing_option) { + var hasError = false; + var processed = ""; + + var len = countSymbols(domain_name); + for (var i = 0; i < len; ++i) { + var codePoint = domain_name.codePointAt(i); + var status = findStatus(codePoint); + + switch (status[1]) { + case "disallowed": + hasError = true; + processed += String.fromCodePoint(codePoint); + break; + case "ignored": + break; + case "mapped": + processed += String.fromCodePoint.apply(String, status[2]); + break; + case "deviation": + if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { + processed += String.fromCodePoint.apply(String, status[2]); + } else { + processed += String.fromCodePoint(codePoint); + } + break; + case "valid": + processed += String.fromCodePoint(codePoint); + break; + case "disallowed_STD3_mapped": + if (useSTD3) { + hasError = true; + processed += String.fromCodePoint(codePoint); + } else { + processed += String.fromCodePoint.apply(String, status[2]); + } + break; + case "disallowed_STD3_valid": + if (useSTD3) { + hasError = true; + } + + processed += String.fromCodePoint(codePoint); + break; + } + } + + return { + string: processed, + error: hasError + }; +} + +var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; + +function validateLabel(label, processing_option) { + if (label.substr(0, 4) === "xn--") { + label = punycode.toUnicode(label); + processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; + } + + var error = false; + + if (normalize(label) !== label || + (label[3] === "-" && label[4] === "-") || + label[0] === "-" || label[label.length - 1] === "-" || + label.indexOf(".") !== -1 || + label.search(combiningMarksRegex) === 0) { + error = true; + } + + var len = countSymbols(label); + for (var i = 0; i < len; ++i) { + var status = findStatus(label.codePointAt(i)); + if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid") || + (processing === PROCESSING_OPTIONS.NONTRANSITIONAL && + status[1] !== "valid" && status[1] !== "deviation")) { + error = true; + break; + } + } + + return { + label: label, + error: error + }; +} + +function processing(domain_name, useSTD3, processing_option) { + var result = mapChars(domain_name, useSTD3, processing_option); + result.string = normalize(result.string); + + var labels = result.string.split("."); + for (var i = 0; i < labels.length; ++i) { + try { + var validation = validateLabel(labels[i]); + labels[i] = validation.label; + result.error = result.error || validation.error; + } catch(e) { + result.error = true; + } + } + + return { + string: labels.join("."), + error: result.error + }; +} + +module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { + var result = processing(domain_name, useSTD3, processing_option); + var labels = result.string.split("."); + labels = labels.map(function(l) { + try { + return punycode.toASCII(l); + } catch(e) { + result.error = true; + return l; + } + }); + + if (verifyDnsLength) { + var total = labels.slice(0, labels.length - 1).join(".").length; + if (total.length > 253 || total.length === 0) { + result.error = true; + } + + for (var i=0; i < labels.length; ++i) { + if (labels.length > 63 || labels.length === 0) { + result.error = true; + break; + } + } + } + + if (result.error) return null; + return labels.join("."); +}; + +module.exports.toUnicode = function(domain_name, useSTD3) { + var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); + + return { + domain: result.string, + error: result.error + }; +}; + +module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; diff --git a/node_modules/node-fetch/node_modules/tr46/lib/.gitkeep b/node_modules/node-fetch/node_modules/tr46/lib/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json b/node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json new file mode 100644 index 00000000..89cf19a7 --- /dev/null +++ b/node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json @@ -0,0 +1 @@ +[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"],[[47,47],"disallowed_STD3_valid"],[[48,57],"valid"],[[58,64],"disallowed_STD3_valid"],[[65,65],"mapped",[97]],[[66,66],"mapped",[98]],[[67,67],"mapped",[99]],[[68,68],"mapped",[100]],[[69,69],"mapped",[101]],[[70,70],"mapped",[102]],[[71,71],"mapped",[103]],[[72,72],"mapped",[104]],[[73,73],"mapped",[105]],[[74,74],"mapped",[106]],[[75,75],"mapped",[107]],[[76,76],"mapped",[108]],[[77,77],"mapped",[109]],[[78,78],"mapped",[110]],[[79,79],"mapped",[111]],[[80,80],"mapped",[112]],[[81,81],"mapped",[113]],[[82,82],"mapped",[114]],[[83,83],"mapped",[115]],[[84,84],"mapped",[116]],[[85,85],"mapped",[117]],[[86,86],"mapped",[118]],[[87,87],"mapped",[119]],[[88,88],"mapped",[120]],[[89,89],"mapped",[121]],[[90,90],"mapped",[122]],[[91,96],"disallowed_STD3_valid"],[[97,122],"valid"],[[123,127],"disallowed_STD3_valid"],[[128,159],"disallowed"],[[160,160],"disallowed_STD3_mapped",[32]],[[161,167],"valid",[],"NV8"],[[168,168],"disallowed_STD3_mapped",[32,776]],[[169,169],"valid",[],"NV8"],[[170,170],"mapped",[97]],[[171,172],"valid",[],"NV8"],[[173,173],"ignored"],[[174,174],"valid",[],"NV8"],[[175,175],"disallowed_STD3_mapped",[32,772]],[[176,177],"valid",[],"NV8"],[[178,178],"mapped",[50]],[[179,179],"mapped",[51]],[[180,180],"disallowed_STD3_mapped",[32,769]],[[181,181],"mapped",[956]],[[182,182],"valid",[],"NV8"],[[183,183],"valid"],[[184,184],"disallowed_STD3_mapped",[32,807]],[[185,185],"mapped",[49]],[[186,186],"mapped",[111]],[[187,187],"valid",[],"NV8"],[[188,188],"mapped",[49,8260,52]],[[189,189],"mapped",[49,8260,50]],[[190,190],"mapped",[51,8260,52]],[[191,191],"valid",[],"NV8"],[[192,192],"mapped",[224]],[[193,193],"mapped",[225]],[[194,194],"mapped",[226]],[[195,195],"mapped",[227]],[[196,196],"mapped",[228]],[[197,197],"mapped",[229]],[[198,198],"mapped",[230]],[[199,199],"mapped",[231]],[[200,200],"mapped",[232]],[[201,201],"mapped",[233]],[[202,202],"mapped",[234]],[[203,203],"mapped",[235]],[[204,204],"mapped",[236]],[[205,205],"mapped",[237]],[[206,206],"mapped",[238]],[[207,207],"mapped",[239]],[[208,208],"mapped",[240]],[[209,209],"mapped",[241]],[[210,210],"mapped",[242]],[[211,211],"mapped",[243]],[[212,212],"mapped",[244]],[[213,213],"mapped",[245]],[[214,214],"mapped",[246]],[[215,215],"valid",[],"NV8"],[[216,216],"mapped",[248]],[[217,217],"mapped",[249]],[[218,218],"mapped",[250]],[[219,219],"mapped",[251]],[[220,220],"mapped",[252]],[[221,221],"mapped",[253]],[[222,222],"mapped",[254]],[[223,223],"deviation",[115,115]],[[224,246],"valid"],[[247,247],"valid",[],"NV8"],[[248,255],"valid"],[[256,256],"mapped",[257]],[[257,257],"valid"],[[258,258],"mapped",[259]],[[259,259],"valid"],[[260,260],"mapped",[261]],[[261,261],"valid"],[[262,262],"mapped",[263]],[[263,263],"valid"],[[264,264],"mapped",[265]],[[265,265],"valid"],[[266,266],"mapped",[267]],[[267,267],"valid"],[[268,268],"mapped",[269]],[[269,269],"valid"],[[270,270],"mapped",[271]],[[271,271],"valid"],[[272,272],"mapped",[273]],[[273,273],"valid"],[[274,274],"mapped",[275]],[[275,275],"valid"],[[276,276],"mapped",[277]],[[277,277],"valid"],[[278,278],"mapped",[279]],[[279,279],"valid"],[[280,280],"mapped",[281]],[[281,281],"valid"],[[282,282],"mapped",[283]],[[283,283],"valid"],[[284,284],"mapped",[285]],[[285,285],"valid"],[[286,286],"mapped",[287]],[[287,287],"valid"],[[288,288],"mapped",[289]],[[289,289],"valid"],[[290,290],"mapped",[291]],[[291,291],"valid"],[[292,292],"mapped",[293]],[[293,293],"valid"],[[294,294],"mapped",[295]],[[295,295],"valid"],[[296,296],"mapped",[297]],[[297,297],"valid"],[[298,298],"mapped",[299]],[[299,299],"valid"],[[300,300],"mapped",[301]],[[301,301],"valid"],[[302,302],"mapped",[303]],[[303,303],"valid"],[[304,304],"mapped",[105,775]],[[305,305],"valid"],[[306,307],"mapped",[105,106]],[[308,308],"mapped",[309]],[[309,309],"valid"],[[310,310],"mapped",[311]],[[311,312],"valid"],[[313,313],"mapped",[314]],[[314,314],"valid"],[[315,315],"mapped",[316]],[[316,316],"valid"],[[317,317],"mapped",[318]],[[318,318],"valid"],[[319,320],"mapped",[108,183]],[[321,321],"mapped",[322]],[[322,322],"valid"],[[323,323],"mapped",[324]],[[324,324],"valid"],[[325,325],"mapped",[326]],[[326,326],"valid"],[[327,327],"mapped",[328]],[[328,328],"valid"],[[329,329],"mapped",[700,110]],[[330,330],"mapped",[331]],[[331,331],"valid"],[[332,332],"mapped",[333]],[[333,333],"valid"],[[334,334],"mapped",[335]],[[335,335],"valid"],[[336,336],"mapped",[337]],[[337,337],"valid"],[[338,338],"mapped",[339]],[[339,339],"valid"],[[340,340],"mapped",[341]],[[341,341],"valid"],[[342,342],"mapped",[343]],[[343,343],"valid"],[[344,344],"mapped",[345]],[[345,345],"valid"],[[346,346],"mapped",[347]],[[347,347],"valid"],[[348,348],"mapped",[349]],[[349,349],"valid"],[[350,350],"mapped",[351]],[[351,351],"valid"],[[352,352],"mapped",[353]],[[353,353],"valid"],[[354,354],"mapped",[355]],[[355,355],"valid"],[[356,356],"mapped",[357]],[[357,357],"valid"],[[358,358],"mapped",[359]],[[359,359],"valid"],[[360,360],"mapped",[361]],[[361,361],"valid"],[[362,362],"mapped",[363]],[[363,363],"valid"],[[364,364],"mapped",[365]],[[365,365],"valid"],[[366,366],"mapped",[367]],[[367,367],"valid"],[[368,368],"mapped",[369]],[[369,369],"valid"],[[370,370],"mapped",[371]],[[371,371],"valid"],[[372,372],"mapped",[373]],[[373,373],"valid"],[[374,374],"mapped",[375]],[[375,375],"valid"],[[376,376],"mapped",[255]],[[377,377],"mapped",[378]],[[378,378],"valid"],[[379,379],"mapped",[380]],[[380,380],"valid"],[[381,381],"mapped",[382]],[[382,382],"valid"],[[383,383],"mapped",[115]],[[384,384],"valid"],[[385,385],"mapped",[595]],[[386,386],"mapped",[387]],[[387,387],"valid"],[[388,388],"mapped",[389]],[[389,389],"valid"],[[390,390],"mapped",[596]],[[391,391],"mapped",[392]],[[392,392],"valid"],[[393,393],"mapped",[598]],[[394,394],"mapped",[599]],[[395,395],"mapped",[396]],[[396,397],"valid"],[[398,398],"mapped",[477]],[[399,399],"mapped",[601]],[[400,400],"mapped",[603]],[[401,401],"mapped",[402]],[[402,402],"valid"],[[403,403],"mapped",[608]],[[404,404],"mapped",[611]],[[405,405],"valid"],[[406,406],"mapped",[617]],[[407,407],"mapped",[616]],[[408,408],"mapped",[409]],[[409,411],"valid"],[[412,412],"mapped",[623]],[[413,413],"mapped",[626]],[[414,414],"valid"],[[415,415],"mapped",[629]],[[416,416],"mapped",[417]],[[417,417],"valid"],[[418,418],"mapped",[419]],[[419,419],"valid"],[[420,420],"mapped",[421]],[[421,421],"valid"],[[422,422],"mapped",[640]],[[423,423],"mapped",[424]],[[424,424],"valid"],[[425,425],"mapped",[643]],[[426,427],"valid"],[[428,428],"mapped",[429]],[[429,429],"valid"],[[430,430],"mapped",[648]],[[431,431],"mapped",[432]],[[432,432],"valid"],[[433,433],"mapped",[650]],[[434,434],"mapped",[651]],[[435,435],"mapped",[436]],[[436,436],"valid"],[[437,437],"mapped",[438]],[[438,438],"valid"],[[439,439],"mapped",[658]],[[440,440],"mapped",[441]],[[441,443],"valid"],[[444,444],"mapped",[445]],[[445,451],"valid"],[[452,454],"mapped",[100,382]],[[455,457],"mapped",[108,106]],[[458,460],"mapped",[110,106]],[[461,461],"mapped",[462]],[[462,462],"valid"],[[463,463],"mapped",[464]],[[464,464],"valid"],[[465,465],"mapped",[466]],[[466,466],"valid"],[[467,467],"mapped",[468]],[[468,468],"valid"],[[469,469],"mapped",[470]],[[470,470],"valid"],[[471,471],"mapped",[472]],[[472,472],"valid"],[[473,473],"mapped",[474]],[[474,474],"valid"],[[475,475],"mapped",[476]],[[476,477],"valid"],[[478,478],"mapped",[479]],[[479,479],"valid"],[[480,480],"mapped",[481]],[[481,481],"valid"],[[482,482],"mapped",[483]],[[483,483],"valid"],[[484,484],"mapped",[485]],[[485,485],"valid"],[[486,486],"mapped",[487]],[[487,487],"valid"],[[488,488],"mapped",[489]],[[489,489],"valid"],[[490,490],"mapped",[491]],[[491,491],"valid"],[[492,492],"mapped",[493]],[[493,493],"valid"],[[494,494],"mapped",[495]],[[495,496],"valid"],[[497,499],"mapped",[100,122]],[[500,500],"mapped",[501]],[[501,501],"valid"],[[502,502],"mapped",[405]],[[503,503],"mapped",[447]],[[504,504],"mapped",[505]],[[505,505],"valid"],[[506,506],"mapped",[507]],[[507,507],"valid"],[[508,508],"mapped",[509]],[[509,509],"valid"],[[510,510],"mapped",[511]],[[511,511],"valid"],[[512,512],"mapped",[513]],[[513,513],"valid"],[[514,514],"mapped",[515]],[[515,515],"valid"],[[516,516],"mapped",[517]],[[517,517],"valid"],[[518,518],"mapped",[519]],[[519,519],"valid"],[[520,520],"mapped",[521]],[[521,521],"valid"],[[522,522],"mapped",[523]],[[523,523],"valid"],[[524,524],"mapped",[525]],[[525,525],"valid"],[[526,526],"mapped",[527]],[[527,527],"valid"],[[528,528],"mapped",[529]],[[529,529],"valid"],[[530,530],"mapped",[531]],[[531,531],"valid"],[[532,532],"mapped",[533]],[[533,533],"valid"],[[534,534],"mapped",[535]],[[535,535],"valid"],[[536,536],"mapped",[537]],[[537,537],"valid"],[[538,538],"mapped",[539]],[[539,539],"valid"],[[540,540],"mapped",[541]],[[541,541],"valid"],[[542,542],"mapped",[543]],[[543,543],"valid"],[[544,544],"mapped",[414]],[[545,545],"valid"],[[546,546],"mapped",[547]],[[547,547],"valid"],[[548,548],"mapped",[549]],[[549,549],"valid"],[[550,550],"mapped",[551]],[[551,551],"valid"],[[552,552],"mapped",[553]],[[553,553],"valid"],[[554,554],"mapped",[555]],[[555,555],"valid"],[[556,556],"mapped",[557]],[[557,557],"valid"],[[558,558],"mapped",[559]],[[559,559],"valid"],[[560,560],"mapped",[561]],[[561,561],"valid"],[[562,562],"mapped",[563]],[[563,563],"valid"],[[564,566],"valid"],[[567,569],"valid"],[[570,570],"mapped",[11365]],[[571,571],"mapped",[572]],[[572,572],"valid"],[[573,573],"mapped",[410]],[[574,574],"mapped",[11366]],[[575,576],"valid"],[[577,577],"mapped",[578]],[[578,578],"valid"],[[579,579],"mapped",[384]],[[580,580],"mapped",[649]],[[581,581],"mapped",[652]],[[582,582],"mapped",[583]],[[583,583],"valid"],[[584,584],"mapped",[585]],[[585,585],"valid"],[[586,586],"mapped",[587]],[[587,587],"valid"],[[588,588],"mapped",[589]],[[589,589],"valid"],[[590,590],"mapped",[591]],[[591,591],"valid"],[[592,680],"valid"],[[681,685],"valid"],[[686,687],"valid"],[[688,688],"mapped",[104]],[[689,689],"mapped",[614]],[[690,690],"mapped",[106]],[[691,691],"mapped",[114]],[[692,692],"mapped",[633]],[[693,693],"mapped",[635]],[[694,694],"mapped",[641]],[[695,695],"mapped",[119]],[[696,696],"mapped",[121]],[[697,705],"valid"],[[706,709],"valid",[],"NV8"],[[710,721],"valid"],[[722,727],"valid",[],"NV8"],[[728,728],"disallowed_STD3_mapped",[32,774]],[[729,729],"disallowed_STD3_mapped",[32,775]],[[730,730],"disallowed_STD3_mapped",[32,778]],[[731,731],"disallowed_STD3_mapped",[32,808]],[[732,732],"disallowed_STD3_mapped",[32,771]],[[733,733],"disallowed_STD3_mapped",[32,779]],[[734,734],"valid",[],"NV8"],[[735,735],"valid",[],"NV8"],[[736,736],"mapped",[611]],[[737,737],"mapped",[108]],[[738,738],"mapped",[115]],[[739,739],"mapped",[120]],[[740,740],"mapped",[661]],[[741,745],"valid",[],"NV8"],[[746,747],"valid",[],"NV8"],[[748,748],"valid"],[[749,749],"valid",[],"NV8"],[[750,750],"valid"],[[751,767],"valid",[],"NV8"],[[768,831],"valid"],[[832,832],"mapped",[768]],[[833,833],"mapped",[769]],[[834,834],"valid"],[[835,835],"mapped",[787]],[[836,836],"mapped",[776,769]],[[837,837],"mapped",[953]],[[838,846],"valid"],[[847,847],"ignored"],[[848,855],"valid"],[[856,860],"valid"],[[861,863],"valid"],[[864,865],"valid"],[[866,866],"valid"],[[867,879],"valid"],[[880,880],"mapped",[881]],[[881,881],"valid"],[[882,882],"mapped",[883]],[[883,883],"valid"],[[884,884],"mapped",[697]],[[885,885],"valid"],[[886,886],"mapped",[887]],[[887,887],"valid"],[[888,889],"disallowed"],[[890,890],"disallowed_STD3_mapped",[32,953]],[[891,893],"valid"],[[894,894],"disallowed_STD3_mapped",[59]],[[895,895],"mapped",[1011]],[[896,899],"disallowed"],[[900,900],"disallowed_STD3_mapped",[32,769]],[[901,901],"disallowed_STD3_mapped",[32,776,769]],[[902,902],"mapped",[940]],[[903,903],"mapped",[183]],[[904,904],"mapped",[941]],[[905,905],"mapped",[942]],[[906,906],"mapped",[943]],[[907,907],"disallowed"],[[908,908],"mapped",[972]],[[909,909],"disallowed"],[[910,910],"mapped",[973]],[[911,911],"mapped",[974]],[[912,912],"valid"],[[913,913],"mapped",[945]],[[914,914],"mapped",[946]],[[915,915],"mapped",[947]],[[916,916],"mapped",[948]],[[917,917],"mapped",[949]],[[918,918],"mapped",[950]],[[919,919],"mapped",[951]],[[920,920],"mapped",[952]],[[921,921],"mapped",[953]],[[922,922],"mapped",[954]],[[923,923],"mapped",[955]],[[924,924],"mapped",[956]],[[925,925],"mapped",[957]],[[926,926],"mapped",[958]],[[927,927],"mapped",[959]],[[928,928],"mapped",[960]],[[929,929],"mapped",[961]],[[930,930],"disallowed"],[[931,931],"mapped",[963]],[[932,932],"mapped",[964]],[[933,933],"mapped",[965]],[[934,934],"mapped",[966]],[[935,935],"mapped",[967]],[[936,936],"mapped",[968]],[[937,937],"mapped",[969]],[[938,938],"mapped",[970]],[[939,939],"mapped",[971]],[[940,961],"valid"],[[962,962],"deviation",[963]],[[963,974],"valid"],[[975,975],"mapped",[983]],[[976,976],"mapped",[946]],[[977,977],"mapped",[952]],[[978,978],"mapped",[965]],[[979,979],"mapped",[973]],[[980,980],"mapped",[971]],[[981,981],"mapped",[966]],[[982,982],"mapped",[960]],[[983,983],"valid"],[[984,984],"mapped",[985]],[[985,985],"valid"],[[986,986],"mapped",[987]],[[987,987],"valid"],[[988,988],"mapped",[989]],[[989,989],"valid"],[[990,990],"mapped",[991]],[[991,991],"valid"],[[992,992],"mapped",[993]],[[993,993],"valid"],[[994,994],"mapped",[995]],[[995,995],"valid"],[[996,996],"mapped",[997]],[[997,997],"valid"],[[998,998],"mapped",[999]],[[999,999],"valid"],[[1000,1000],"mapped",[1001]],[[1001,1001],"valid"],[[1002,1002],"mapped",[1003]],[[1003,1003],"valid"],[[1004,1004],"mapped",[1005]],[[1005,1005],"valid"],[[1006,1006],"mapped",[1007]],[[1007,1007],"valid"],[[1008,1008],"mapped",[954]],[[1009,1009],"mapped",[961]],[[1010,1010],"mapped",[963]],[[1011,1011],"valid"],[[1012,1012],"mapped",[952]],[[1013,1013],"mapped",[949]],[[1014,1014],"valid",[],"NV8"],[[1015,1015],"mapped",[1016]],[[1016,1016],"valid"],[[1017,1017],"mapped",[963]],[[1018,1018],"mapped",[1019]],[[1019,1019],"valid"],[[1020,1020],"valid"],[[1021,1021],"mapped",[891]],[[1022,1022],"mapped",[892]],[[1023,1023],"mapped",[893]],[[1024,1024],"mapped",[1104]],[[1025,1025],"mapped",[1105]],[[1026,1026],"mapped",[1106]],[[1027,1027],"mapped",[1107]],[[1028,1028],"mapped",[1108]],[[1029,1029],"mapped",[1109]],[[1030,1030],"mapped",[1110]],[[1031,1031],"mapped",[1111]],[[1032,1032],"mapped",[1112]],[[1033,1033],"mapped",[1113]],[[1034,1034],"mapped",[1114]],[[1035,1035],"mapped",[1115]],[[1036,1036],"mapped",[1116]],[[1037,1037],"mapped",[1117]],[[1038,1038],"mapped",[1118]],[[1039,1039],"mapped",[1119]],[[1040,1040],"mapped",[1072]],[[1041,1041],"mapped",[1073]],[[1042,1042],"mapped",[1074]],[[1043,1043],"mapped",[1075]],[[1044,1044],"mapped",[1076]],[[1045,1045],"mapped",[1077]],[[1046,1046],"mapped",[1078]],[[1047,1047],"mapped",[1079]],[[1048,1048],"mapped",[1080]],[[1049,1049],"mapped",[1081]],[[1050,1050],"mapped",[1082]],[[1051,1051],"mapped",[1083]],[[1052,1052],"mapped",[1084]],[[1053,1053],"mapped",[1085]],[[1054,1054],"mapped",[1086]],[[1055,1055],"mapped",[1087]],[[1056,1056],"mapped",[1088]],[[1057,1057],"mapped",[1089]],[[1058,1058],"mapped",[1090]],[[1059,1059],"mapped",[1091]],[[1060,1060],"mapped",[1092]],[[1061,1061],"mapped",[1093]],[[1062,1062],"mapped",[1094]],[[1063,1063],"mapped",[1095]],[[1064,1064],"mapped",[1096]],[[1065,1065],"mapped",[1097]],[[1066,1066],"mapped",[1098]],[[1067,1067],"mapped",[1099]],[[1068,1068],"mapped",[1100]],[[1069,1069],"mapped",[1101]],[[1070,1070],"mapped",[1102]],[[1071,1071],"mapped",[1103]],[[1072,1103],"valid"],[[1104,1104],"valid"],[[1105,1116],"valid"],[[1117,1117],"valid"],[[1118,1119],"valid"],[[1120,1120],"mapped",[1121]],[[1121,1121],"valid"],[[1122,1122],"mapped",[1123]],[[1123,1123],"valid"],[[1124,1124],"mapped",[1125]],[[1125,1125],"valid"],[[1126,1126],"mapped",[1127]],[[1127,1127],"valid"],[[1128,1128],"mapped",[1129]],[[1129,1129],"valid"],[[1130,1130],"mapped",[1131]],[[1131,1131],"valid"],[[1132,1132],"mapped",[1133]],[[1133,1133],"valid"],[[1134,1134],"mapped",[1135]],[[1135,1135],"valid"],[[1136,1136],"mapped",[1137]],[[1137,1137],"valid"],[[1138,1138],"mapped",[1139]],[[1139,1139],"valid"],[[1140,1140],"mapped",[1141]],[[1141,1141],"valid"],[[1142,1142],"mapped",[1143]],[[1143,1143],"valid"],[[1144,1144],"mapped",[1145]],[[1145,1145],"valid"],[[1146,1146],"mapped",[1147]],[[1147,1147],"valid"],[[1148,1148],"mapped",[1149]],[[1149,1149],"valid"],[[1150,1150],"mapped",[1151]],[[1151,1151],"valid"],[[1152,1152],"mapped",[1153]],[[1153,1153],"valid"],[[1154,1154],"valid",[],"NV8"],[[1155,1158],"valid"],[[1159,1159],"valid"],[[1160,1161],"valid",[],"NV8"],[[1162,1162],"mapped",[1163]],[[1163,1163],"valid"],[[1164,1164],"mapped",[1165]],[[1165,1165],"valid"],[[1166,1166],"mapped",[1167]],[[1167,1167],"valid"],[[1168,1168],"mapped",[1169]],[[1169,1169],"valid"],[[1170,1170],"mapped",[1171]],[[1171,1171],"valid"],[[1172,1172],"mapped",[1173]],[[1173,1173],"valid"],[[1174,1174],"mapped",[1175]],[[1175,1175],"valid"],[[1176,1176],"mapped",[1177]],[[1177,1177],"valid"],[[1178,1178],"mapped",[1179]],[[1179,1179],"valid"],[[1180,1180],"mapped",[1181]],[[1181,1181],"valid"],[[1182,1182],"mapped",[1183]],[[1183,1183],"valid"],[[1184,1184],"mapped",[1185]],[[1185,1185],"valid"],[[1186,1186],"mapped",[1187]],[[1187,1187],"valid"],[[1188,1188],"mapped",[1189]],[[1189,1189],"valid"],[[1190,1190],"mapped",[1191]],[[1191,1191],"valid"],[[1192,1192],"mapped",[1193]],[[1193,1193],"valid"],[[1194,1194],"mapped",[1195]],[[1195,1195],"valid"],[[1196,1196],"mapped",[1197]],[[1197,1197],"valid"],[[1198,1198],"mapped",[1199]],[[1199,1199],"valid"],[[1200,1200],"mapped",[1201]],[[1201,1201],"valid"],[[1202,1202],"mapped",[1203]],[[1203,1203],"valid"],[[1204,1204],"mapped",[1205]],[[1205,1205],"valid"],[[1206,1206],"mapped",[1207]],[[1207,1207],"valid"],[[1208,1208],"mapped",[1209]],[[1209,1209],"valid"],[[1210,1210],"mapped",[1211]],[[1211,1211],"valid"],[[1212,1212],"mapped",[1213]],[[1213,1213],"valid"],[[1214,1214],"mapped",[1215]],[[1215,1215],"valid"],[[1216,1216],"disallowed"],[[1217,1217],"mapped",[1218]],[[1218,1218],"valid"],[[1219,1219],"mapped",[1220]],[[1220,1220],"valid"],[[1221,1221],"mapped",[1222]],[[1222,1222],"valid"],[[1223,1223],"mapped",[1224]],[[1224,1224],"valid"],[[1225,1225],"mapped",[1226]],[[1226,1226],"valid"],[[1227,1227],"mapped",[1228]],[[1228,1228],"valid"],[[1229,1229],"mapped",[1230]],[[1230,1230],"valid"],[[1231,1231],"valid"],[[1232,1232],"mapped",[1233]],[[1233,1233],"valid"],[[1234,1234],"mapped",[1235]],[[1235,1235],"valid"],[[1236,1236],"mapped",[1237]],[[1237,1237],"valid"],[[1238,1238],"mapped",[1239]],[[1239,1239],"valid"],[[1240,1240],"mapped",[1241]],[[1241,1241],"valid"],[[1242,1242],"mapped",[1243]],[[1243,1243],"valid"],[[1244,1244],"mapped",[1245]],[[1245,1245],"valid"],[[1246,1246],"mapped",[1247]],[[1247,1247],"valid"],[[1248,1248],"mapped",[1249]],[[1249,1249],"valid"],[[1250,1250],"mapped",[1251]],[[1251,1251],"valid"],[[1252,1252],"mapped",[1253]],[[1253,1253],"valid"],[[1254,1254],"mapped",[1255]],[[1255,1255],"valid"],[[1256,1256],"mapped",[1257]],[[1257,1257],"valid"],[[1258,1258],"mapped",[1259]],[[1259,1259],"valid"],[[1260,1260],"mapped",[1261]],[[1261,1261],"valid"],[[1262,1262],"mapped",[1263]],[[1263,1263],"valid"],[[1264,1264],"mapped",[1265]],[[1265,1265],"valid"],[[1266,1266],"mapped",[1267]],[[1267,1267],"valid"],[[1268,1268],"mapped",[1269]],[[1269,1269],"valid"],[[1270,1270],"mapped",[1271]],[[1271,1271],"valid"],[[1272,1272],"mapped",[1273]],[[1273,1273],"valid"],[[1274,1274],"mapped",[1275]],[[1275,1275],"valid"],[[1276,1276],"mapped",[1277]],[[1277,1277],"valid"],[[1278,1278],"mapped",[1279]],[[1279,1279],"valid"],[[1280,1280],"mapped",[1281]],[[1281,1281],"valid"],[[1282,1282],"mapped",[1283]],[[1283,1283],"valid"],[[1284,1284],"mapped",[1285]],[[1285,1285],"valid"],[[1286,1286],"mapped",[1287]],[[1287,1287],"valid"],[[1288,1288],"mapped",[1289]],[[1289,1289],"valid"],[[1290,1290],"mapped",[1291]],[[1291,1291],"valid"],[[1292,1292],"mapped",[1293]],[[1293,1293],"valid"],[[1294,1294],"mapped",[1295]],[[1295,1295],"valid"],[[1296,1296],"mapped",[1297]],[[1297,1297],"valid"],[[1298,1298],"mapped",[1299]],[[1299,1299],"valid"],[[1300,1300],"mapped",[1301]],[[1301,1301],"valid"],[[1302,1302],"mapped",[1303]],[[1303,1303],"valid"],[[1304,1304],"mapped",[1305]],[[1305,1305],"valid"],[[1306,1306],"mapped",[1307]],[[1307,1307],"valid"],[[1308,1308],"mapped",[1309]],[[1309,1309],"valid"],[[1310,1310],"mapped",[1311]],[[1311,1311],"valid"],[[1312,1312],"mapped",[1313]],[[1313,1313],"valid"],[[1314,1314],"mapped",[1315]],[[1315,1315],"valid"],[[1316,1316],"mapped",[1317]],[[1317,1317],"valid"],[[1318,1318],"mapped",[1319]],[[1319,1319],"valid"],[[1320,1320],"mapped",[1321]],[[1321,1321],"valid"],[[1322,1322],"mapped",[1323]],[[1323,1323],"valid"],[[1324,1324],"mapped",[1325]],[[1325,1325],"valid"],[[1326,1326],"mapped",[1327]],[[1327,1327],"valid"],[[1328,1328],"disallowed"],[[1329,1329],"mapped",[1377]],[[1330,1330],"mapped",[1378]],[[1331,1331],"mapped",[1379]],[[1332,1332],"mapped",[1380]],[[1333,1333],"mapped",[1381]],[[1334,1334],"mapped",[1382]],[[1335,1335],"mapped",[1383]],[[1336,1336],"mapped",[1384]],[[1337,1337],"mapped",[1385]],[[1338,1338],"mapped",[1386]],[[1339,1339],"mapped",[1387]],[[1340,1340],"mapped",[1388]],[[1341,1341],"mapped",[1389]],[[1342,1342],"mapped",[1390]],[[1343,1343],"mapped",[1391]],[[1344,1344],"mapped",[1392]],[[1345,1345],"mapped",[1393]],[[1346,1346],"mapped",[1394]],[[1347,1347],"mapped",[1395]],[[1348,1348],"mapped",[1396]],[[1349,1349],"mapped",[1397]],[[1350,1350],"mapped",[1398]],[[1351,1351],"mapped",[1399]],[[1352,1352],"mapped",[1400]],[[1353,1353],"mapped",[1401]],[[1354,1354],"mapped",[1402]],[[1355,1355],"mapped",[1403]],[[1356,1356],"mapped",[1404]],[[1357,1357],"mapped",[1405]],[[1358,1358],"mapped",[1406]],[[1359,1359],"mapped",[1407]],[[1360,1360],"mapped",[1408]],[[1361,1361],"mapped",[1409]],[[1362,1362],"mapped",[1410]],[[1363,1363],"mapped",[1411]],[[1364,1364],"mapped",[1412]],[[1365,1365],"mapped",[1413]],[[1366,1366],"mapped",[1414]],[[1367,1368],"disallowed"],[[1369,1369],"valid"],[[1370,1375],"valid",[],"NV8"],[[1376,1376],"disallowed"],[[1377,1414],"valid"],[[1415,1415],"mapped",[1381,1410]],[[1416,1416],"disallowed"],[[1417,1417],"valid",[],"NV8"],[[1418,1418],"valid",[],"NV8"],[[1419,1420],"disallowed"],[[1421,1422],"valid",[],"NV8"],[[1423,1423],"valid",[],"NV8"],[[1424,1424],"disallowed"],[[1425,1441],"valid"],[[1442,1442],"valid"],[[1443,1455],"valid"],[[1456,1465],"valid"],[[1466,1466],"valid"],[[1467,1469],"valid"],[[1470,1470],"valid",[],"NV8"],[[1471,1471],"valid"],[[1472,1472],"valid",[],"NV8"],[[1473,1474],"valid"],[[1475,1475],"valid",[],"NV8"],[[1476,1476],"valid"],[[1477,1477],"valid"],[[1478,1478],"valid",[],"NV8"],[[1479,1479],"valid"],[[1480,1487],"disallowed"],[[1488,1514],"valid"],[[1515,1519],"disallowed"],[[1520,1524],"valid"],[[1525,1535],"disallowed"],[[1536,1539],"disallowed"],[[1540,1540],"disallowed"],[[1541,1541],"disallowed"],[[1542,1546],"valid",[],"NV8"],[[1547,1547],"valid",[],"NV8"],[[1548,1548],"valid",[],"NV8"],[[1549,1551],"valid",[],"NV8"],[[1552,1557],"valid"],[[1558,1562],"valid"],[[1563,1563],"valid",[],"NV8"],[[1564,1564],"disallowed"],[[1565,1565],"disallowed"],[[1566,1566],"valid",[],"NV8"],[[1567,1567],"valid",[],"NV8"],[[1568,1568],"valid"],[[1569,1594],"valid"],[[1595,1599],"valid"],[[1600,1600],"valid",[],"NV8"],[[1601,1618],"valid"],[[1619,1621],"valid"],[[1622,1624],"valid"],[[1625,1630],"valid"],[[1631,1631],"valid"],[[1632,1641],"valid"],[[1642,1645],"valid",[],"NV8"],[[1646,1647],"valid"],[[1648,1652],"valid"],[[1653,1653],"mapped",[1575,1652]],[[1654,1654],"mapped",[1608,1652]],[[1655,1655],"mapped",[1735,1652]],[[1656,1656],"mapped",[1610,1652]],[[1657,1719],"valid"],[[1720,1721],"valid"],[[1722,1726],"valid"],[[1727,1727],"valid"],[[1728,1742],"valid"],[[1743,1743],"valid"],[[1744,1747],"valid"],[[1748,1748],"valid",[],"NV8"],[[1749,1756],"valid"],[[1757,1757],"disallowed"],[[1758,1758],"valid",[],"NV8"],[[1759,1768],"valid"],[[1769,1769],"valid",[],"NV8"],[[1770,1773],"valid"],[[1774,1775],"valid"],[[1776,1785],"valid"],[[1786,1790],"valid"],[[1791,1791],"valid"],[[1792,1805],"valid",[],"NV8"],[[1806,1806],"disallowed"],[[1807,1807],"disallowed"],[[1808,1836],"valid"],[[1837,1839],"valid"],[[1840,1866],"valid"],[[1867,1868],"disallowed"],[[1869,1871],"valid"],[[1872,1901],"valid"],[[1902,1919],"valid"],[[1920,1968],"valid"],[[1969,1969],"valid"],[[1970,1983],"disallowed"],[[1984,2037],"valid"],[[2038,2042],"valid",[],"NV8"],[[2043,2047],"disallowed"],[[2048,2093],"valid"],[[2094,2095],"disallowed"],[[2096,2110],"valid",[],"NV8"],[[2111,2111],"disallowed"],[[2112,2139],"valid"],[[2140,2141],"disallowed"],[[2142,2142],"valid",[],"NV8"],[[2143,2207],"disallowed"],[[2208,2208],"valid"],[[2209,2209],"valid"],[[2210,2220],"valid"],[[2221,2226],"valid"],[[2227,2228],"valid"],[[2229,2274],"disallowed"],[[2275,2275],"valid"],[[2276,2302],"valid"],[[2303,2303],"valid"],[[2304,2304],"valid"],[[2305,2307],"valid"],[[2308,2308],"valid"],[[2309,2361],"valid"],[[2362,2363],"valid"],[[2364,2381],"valid"],[[2382,2382],"valid"],[[2383,2383],"valid"],[[2384,2388],"valid"],[[2389,2389],"valid"],[[2390,2391],"valid"],[[2392,2392],"mapped",[2325,2364]],[[2393,2393],"mapped",[2326,2364]],[[2394,2394],"mapped",[2327,2364]],[[2395,2395],"mapped",[2332,2364]],[[2396,2396],"mapped",[2337,2364]],[[2397,2397],"mapped",[2338,2364]],[[2398,2398],"mapped",[2347,2364]],[[2399,2399],"mapped",[2351,2364]],[[2400,2403],"valid"],[[2404,2405],"valid",[],"NV8"],[[2406,2415],"valid"],[[2416,2416],"valid",[],"NV8"],[[2417,2418],"valid"],[[2419,2423],"valid"],[[2424,2424],"valid"],[[2425,2426],"valid"],[[2427,2428],"valid"],[[2429,2429],"valid"],[[2430,2431],"valid"],[[2432,2432],"valid"],[[2433,2435],"valid"],[[2436,2436],"disallowed"],[[2437,2444],"valid"],[[2445,2446],"disallowed"],[[2447,2448],"valid"],[[2449,2450],"disallowed"],[[2451,2472],"valid"],[[2473,2473],"disallowed"],[[2474,2480],"valid"],[[2481,2481],"disallowed"],[[2482,2482],"valid"],[[2483,2485],"disallowed"],[[2486,2489],"valid"],[[2490,2491],"disallowed"],[[2492,2492],"valid"],[[2493,2493],"valid"],[[2494,2500],"valid"],[[2501,2502],"disallowed"],[[2503,2504],"valid"],[[2505,2506],"disallowed"],[[2507,2509],"valid"],[[2510,2510],"valid"],[[2511,2518],"disallowed"],[[2519,2519],"valid"],[[2520,2523],"disallowed"],[[2524,2524],"mapped",[2465,2492]],[[2525,2525],"mapped",[2466,2492]],[[2526,2526],"disallowed"],[[2527,2527],"mapped",[2479,2492]],[[2528,2531],"valid"],[[2532,2533],"disallowed"],[[2534,2545],"valid"],[[2546,2554],"valid",[],"NV8"],[[2555,2555],"valid",[],"NV8"],[[2556,2560],"disallowed"],[[2561,2561],"valid"],[[2562,2562],"valid"],[[2563,2563],"valid"],[[2564,2564],"disallowed"],[[2565,2570],"valid"],[[2571,2574],"disallowed"],[[2575,2576],"valid"],[[2577,2578],"disallowed"],[[2579,2600],"valid"],[[2601,2601],"disallowed"],[[2602,2608],"valid"],[[2609,2609],"disallowed"],[[2610,2610],"valid"],[[2611,2611],"mapped",[2610,2620]],[[2612,2612],"disallowed"],[[2613,2613],"valid"],[[2614,2614],"mapped",[2616,2620]],[[2615,2615],"disallowed"],[[2616,2617],"valid"],[[2618,2619],"disallowed"],[[2620,2620],"valid"],[[2621,2621],"disallowed"],[[2622,2626],"valid"],[[2627,2630],"disallowed"],[[2631,2632],"valid"],[[2633,2634],"disallowed"],[[2635,2637],"valid"],[[2638,2640],"disallowed"],[[2641,2641],"valid"],[[2642,2648],"disallowed"],[[2649,2649],"mapped",[2582,2620]],[[2650,2650],"mapped",[2583,2620]],[[2651,2651],"mapped",[2588,2620]],[[2652,2652],"valid"],[[2653,2653],"disallowed"],[[2654,2654],"mapped",[2603,2620]],[[2655,2661],"disallowed"],[[2662,2676],"valid"],[[2677,2677],"valid"],[[2678,2688],"disallowed"],[[2689,2691],"valid"],[[2692,2692],"disallowed"],[[2693,2699],"valid"],[[2700,2700],"valid"],[[2701,2701],"valid"],[[2702,2702],"disallowed"],[[2703,2705],"valid"],[[2706,2706],"disallowed"],[[2707,2728],"valid"],[[2729,2729],"disallowed"],[[2730,2736],"valid"],[[2737,2737],"disallowed"],[[2738,2739],"valid"],[[2740,2740],"disallowed"],[[2741,2745],"valid"],[[2746,2747],"disallowed"],[[2748,2757],"valid"],[[2758,2758],"disallowed"],[[2759,2761],"valid"],[[2762,2762],"disallowed"],[[2763,2765],"valid"],[[2766,2767],"disallowed"],[[2768,2768],"valid"],[[2769,2783],"disallowed"],[[2784,2784],"valid"],[[2785,2787],"valid"],[[2788,2789],"disallowed"],[[2790,2799],"valid"],[[2800,2800],"valid",[],"NV8"],[[2801,2801],"valid",[],"NV8"],[[2802,2808],"disallowed"],[[2809,2809],"valid"],[[2810,2816],"disallowed"],[[2817,2819],"valid"],[[2820,2820],"disallowed"],[[2821,2828],"valid"],[[2829,2830],"disallowed"],[[2831,2832],"valid"],[[2833,2834],"disallowed"],[[2835,2856],"valid"],[[2857,2857],"disallowed"],[[2858,2864],"valid"],[[2865,2865],"disallowed"],[[2866,2867],"valid"],[[2868,2868],"disallowed"],[[2869,2869],"valid"],[[2870,2873],"valid"],[[2874,2875],"disallowed"],[[2876,2883],"valid"],[[2884,2884],"valid"],[[2885,2886],"disallowed"],[[2887,2888],"valid"],[[2889,2890],"disallowed"],[[2891,2893],"valid"],[[2894,2901],"disallowed"],[[2902,2903],"valid"],[[2904,2907],"disallowed"],[[2908,2908],"mapped",[2849,2876]],[[2909,2909],"mapped",[2850,2876]],[[2910,2910],"disallowed"],[[2911,2913],"valid"],[[2914,2915],"valid"],[[2916,2917],"disallowed"],[[2918,2927],"valid"],[[2928,2928],"valid",[],"NV8"],[[2929,2929],"valid"],[[2930,2935],"valid",[],"NV8"],[[2936,2945],"disallowed"],[[2946,2947],"valid"],[[2948,2948],"disallowed"],[[2949,2954],"valid"],[[2955,2957],"disallowed"],[[2958,2960],"valid"],[[2961,2961],"disallowed"],[[2962,2965],"valid"],[[2966,2968],"disallowed"],[[2969,2970],"valid"],[[2971,2971],"disallowed"],[[2972,2972],"valid"],[[2973,2973],"disallowed"],[[2974,2975],"valid"],[[2976,2978],"disallowed"],[[2979,2980],"valid"],[[2981,2983],"disallowed"],[[2984,2986],"valid"],[[2987,2989],"disallowed"],[[2990,2997],"valid"],[[2998,2998],"valid"],[[2999,3001],"valid"],[[3002,3005],"disallowed"],[[3006,3010],"valid"],[[3011,3013],"disallowed"],[[3014,3016],"valid"],[[3017,3017],"disallowed"],[[3018,3021],"valid"],[[3022,3023],"disallowed"],[[3024,3024],"valid"],[[3025,3030],"disallowed"],[[3031,3031],"valid"],[[3032,3045],"disallowed"],[[3046,3046],"valid"],[[3047,3055],"valid"],[[3056,3058],"valid",[],"NV8"],[[3059,3066],"valid",[],"NV8"],[[3067,3071],"disallowed"],[[3072,3072],"valid"],[[3073,3075],"valid"],[[3076,3076],"disallowed"],[[3077,3084],"valid"],[[3085,3085],"disallowed"],[[3086,3088],"valid"],[[3089,3089],"disallowed"],[[3090,3112],"valid"],[[3113,3113],"disallowed"],[[3114,3123],"valid"],[[3124,3124],"valid"],[[3125,3129],"valid"],[[3130,3132],"disallowed"],[[3133,3133],"valid"],[[3134,3140],"valid"],[[3141,3141],"disallowed"],[[3142,3144],"valid"],[[3145,3145],"disallowed"],[[3146,3149],"valid"],[[3150,3156],"disallowed"],[[3157,3158],"valid"],[[3159,3159],"disallowed"],[[3160,3161],"valid"],[[3162,3162],"valid"],[[3163,3167],"disallowed"],[[3168,3169],"valid"],[[3170,3171],"valid"],[[3172,3173],"disallowed"],[[3174,3183],"valid"],[[3184,3191],"disallowed"],[[3192,3199],"valid",[],"NV8"],[[3200,3200],"disallowed"],[[3201,3201],"valid"],[[3202,3203],"valid"],[[3204,3204],"disallowed"],[[3205,3212],"valid"],[[3213,3213],"disallowed"],[[3214,3216],"valid"],[[3217,3217],"disallowed"],[[3218,3240],"valid"],[[3241,3241],"disallowed"],[[3242,3251],"valid"],[[3252,3252],"disallowed"],[[3253,3257],"valid"],[[3258,3259],"disallowed"],[[3260,3261],"valid"],[[3262,3268],"valid"],[[3269,3269],"disallowed"],[[3270,3272],"valid"],[[3273,3273],"disallowed"],[[3274,3277],"valid"],[[3278,3284],"disallowed"],[[3285,3286],"valid"],[[3287,3293],"disallowed"],[[3294,3294],"valid"],[[3295,3295],"disallowed"],[[3296,3297],"valid"],[[3298,3299],"valid"],[[3300,3301],"disallowed"],[[3302,3311],"valid"],[[3312,3312],"disallowed"],[[3313,3314],"valid"],[[3315,3328],"disallowed"],[[3329,3329],"valid"],[[3330,3331],"valid"],[[3332,3332],"disallowed"],[[3333,3340],"valid"],[[3341,3341],"disallowed"],[[3342,3344],"valid"],[[3345,3345],"disallowed"],[[3346,3368],"valid"],[[3369,3369],"valid"],[[3370,3385],"valid"],[[3386,3386],"valid"],[[3387,3388],"disallowed"],[[3389,3389],"valid"],[[3390,3395],"valid"],[[3396,3396],"valid"],[[3397,3397],"disallowed"],[[3398,3400],"valid"],[[3401,3401],"disallowed"],[[3402,3405],"valid"],[[3406,3406],"valid"],[[3407,3414],"disallowed"],[[3415,3415],"valid"],[[3416,3422],"disallowed"],[[3423,3423],"valid"],[[3424,3425],"valid"],[[3426,3427],"valid"],[[3428,3429],"disallowed"],[[3430,3439],"valid"],[[3440,3445],"valid",[],"NV8"],[[3446,3448],"disallowed"],[[3449,3449],"valid",[],"NV8"],[[3450,3455],"valid"],[[3456,3457],"disallowed"],[[3458,3459],"valid"],[[3460,3460],"disallowed"],[[3461,3478],"valid"],[[3479,3481],"disallowed"],[[3482,3505],"valid"],[[3506,3506],"disallowed"],[[3507,3515],"valid"],[[3516,3516],"disallowed"],[[3517,3517],"valid"],[[3518,3519],"disallowed"],[[3520,3526],"valid"],[[3527,3529],"disallowed"],[[3530,3530],"valid"],[[3531,3534],"disallowed"],[[3535,3540],"valid"],[[3541,3541],"disallowed"],[[3542,3542],"valid"],[[3543,3543],"disallowed"],[[3544,3551],"valid"],[[3552,3557],"disallowed"],[[3558,3567],"valid"],[[3568,3569],"disallowed"],[[3570,3571],"valid"],[[3572,3572],"valid",[],"NV8"],[[3573,3584],"disallowed"],[[3585,3634],"valid"],[[3635,3635],"mapped",[3661,3634]],[[3636,3642],"valid"],[[3643,3646],"disallowed"],[[3647,3647],"valid",[],"NV8"],[[3648,3662],"valid"],[[3663,3663],"valid",[],"NV8"],[[3664,3673],"valid"],[[3674,3675],"valid",[],"NV8"],[[3676,3712],"disallowed"],[[3713,3714],"valid"],[[3715,3715],"disallowed"],[[3716,3716],"valid"],[[3717,3718],"disallowed"],[[3719,3720],"valid"],[[3721,3721],"disallowed"],[[3722,3722],"valid"],[[3723,3724],"disallowed"],[[3725,3725],"valid"],[[3726,3731],"disallowed"],[[3732,3735],"valid"],[[3736,3736],"disallowed"],[[3737,3743],"valid"],[[3744,3744],"disallowed"],[[3745,3747],"valid"],[[3748,3748],"disallowed"],[[3749,3749],"valid"],[[3750,3750],"disallowed"],[[3751,3751],"valid"],[[3752,3753],"disallowed"],[[3754,3755],"valid"],[[3756,3756],"disallowed"],[[3757,3762],"valid"],[[3763,3763],"mapped",[3789,3762]],[[3764,3769],"valid"],[[3770,3770],"disallowed"],[[3771,3773],"valid"],[[3774,3775],"disallowed"],[[3776,3780],"valid"],[[3781,3781],"disallowed"],[[3782,3782],"valid"],[[3783,3783],"disallowed"],[[3784,3789],"valid"],[[3790,3791],"disallowed"],[[3792,3801],"valid"],[[3802,3803],"disallowed"],[[3804,3804],"mapped",[3755,3737]],[[3805,3805],"mapped",[3755,3745]],[[3806,3807],"valid"],[[3808,3839],"disallowed"],[[3840,3840],"valid"],[[3841,3850],"valid",[],"NV8"],[[3851,3851],"valid"],[[3852,3852],"mapped",[3851]],[[3853,3863],"valid",[],"NV8"],[[3864,3865],"valid"],[[3866,3871],"valid",[],"NV8"],[[3872,3881],"valid"],[[3882,3892],"valid",[],"NV8"],[[3893,3893],"valid"],[[3894,3894],"valid",[],"NV8"],[[3895,3895],"valid"],[[3896,3896],"valid",[],"NV8"],[[3897,3897],"valid"],[[3898,3901],"valid",[],"NV8"],[[3902,3906],"valid"],[[3907,3907],"mapped",[3906,4023]],[[3908,3911],"valid"],[[3912,3912],"disallowed"],[[3913,3916],"valid"],[[3917,3917],"mapped",[3916,4023]],[[3918,3921],"valid"],[[3922,3922],"mapped",[3921,4023]],[[3923,3926],"valid"],[[3927,3927],"mapped",[3926,4023]],[[3928,3931],"valid"],[[3932,3932],"mapped",[3931,4023]],[[3933,3944],"valid"],[[3945,3945],"mapped",[3904,4021]],[[3946,3946],"valid"],[[3947,3948],"valid"],[[3949,3952],"disallowed"],[[3953,3954],"valid"],[[3955,3955],"mapped",[3953,3954]],[[3956,3956],"valid"],[[3957,3957],"mapped",[3953,3956]],[[3958,3958],"mapped",[4018,3968]],[[3959,3959],"mapped",[4018,3953,3968]],[[3960,3960],"mapped",[4019,3968]],[[3961,3961],"mapped",[4019,3953,3968]],[[3962,3968],"valid"],[[3969,3969],"mapped",[3953,3968]],[[3970,3972],"valid"],[[3973,3973],"valid",[],"NV8"],[[3974,3979],"valid"],[[3980,3983],"valid"],[[3984,3986],"valid"],[[3987,3987],"mapped",[3986,4023]],[[3988,3989],"valid"],[[3990,3990],"valid"],[[3991,3991],"valid"],[[3992,3992],"disallowed"],[[3993,3996],"valid"],[[3997,3997],"mapped",[3996,4023]],[[3998,4001],"valid"],[[4002,4002],"mapped",[4001,4023]],[[4003,4006],"valid"],[[4007,4007],"mapped",[4006,4023]],[[4008,4011],"valid"],[[4012,4012],"mapped",[4011,4023]],[[4013,4013],"valid"],[[4014,4016],"valid"],[[4017,4023],"valid"],[[4024,4024],"valid"],[[4025,4025],"mapped",[3984,4021]],[[4026,4028],"valid"],[[4029,4029],"disallowed"],[[4030,4037],"valid",[],"NV8"],[[4038,4038],"valid"],[[4039,4044],"valid",[],"NV8"],[[4045,4045],"disallowed"],[[4046,4046],"valid",[],"NV8"],[[4047,4047],"valid",[],"NV8"],[[4048,4049],"valid",[],"NV8"],[[4050,4052],"valid",[],"NV8"],[[4053,4056],"valid",[],"NV8"],[[4057,4058],"valid",[],"NV8"],[[4059,4095],"disallowed"],[[4096,4129],"valid"],[[4130,4130],"valid"],[[4131,4135],"valid"],[[4136,4136],"valid"],[[4137,4138],"valid"],[[4139,4139],"valid"],[[4140,4146],"valid"],[[4147,4149],"valid"],[[4150,4153],"valid"],[[4154,4159],"valid"],[[4160,4169],"valid"],[[4170,4175],"valid",[],"NV8"],[[4176,4185],"valid"],[[4186,4249],"valid"],[[4250,4253],"valid"],[[4254,4255],"valid",[],"NV8"],[[4256,4293],"disallowed"],[[4294,4294],"disallowed"],[[4295,4295],"mapped",[11559]],[[4296,4300],"disallowed"],[[4301,4301],"mapped",[11565]],[[4302,4303],"disallowed"],[[4304,4342],"valid"],[[4343,4344],"valid"],[[4345,4346],"valid"],[[4347,4347],"valid",[],"NV8"],[[4348,4348],"mapped",[4316]],[[4349,4351],"valid"],[[4352,4441],"valid",[],"NV8"],[[4442,4446],"valid",[],"NV8"],[[4447,4448],"disallowed"],[[4449,4514],"valid",[],"NV8"],[[4515,4519],"valid",[],"NV8"],[[4520,4601],"valid",[],"NV8"],[[4602,4607],"valid",[],"NV8"],[[4608,4614],"valid"],[[4615,4615],"valid"],[[4616,4678],"valid"],[[4679,4679],"valid"],[[4680,4680],"valid"],[[4681,4681],"disallowed"],[[4682,4685],"valid"],[[4686,4687],"disallowed"],[[4688,4694],"valid"],[[4695,4695],"disallowed"],[[4696,4696],"valid"],[[4697,4697],"disallowed"],[[4698,4701],"valid"],[[4702,4703],"disallowed"],[[4704,4742],"valid"],[[4743,4743],"valid"],[[4744,4744],"valid"],[[4745,4745],"disallowed"],[[4746,4749],"valid"],[[4750,4751],"disallowed"],[[4752,4782],"valid"],[[4783,4783],"valid"],[[4784,4784],"valid"],[[4785,4785],"disallowed"],[[4786,4789],"valid"],[[4790,4791],"disallowed"],[[4792,4798],"valid"],[[4799,4799],"disallowed"],[[4800,4800],"valid"],[[4801,4801],"disallowed"],[[4802,4805],"valid"],[[4806,4807],"disallowed"],[[4808,4814],"valid"],[[4815,4815],"valid"],[[4816,4822],"valid"],[[4823,4823],"disallowed"],[[4824,4846],"valid"],[[4847,4847],"valid"],[[4848,4878],"valid"],[[4879,4879],"valid"],[[4880,4880],"valid"],[[4881,4881],"disallowed"],[[4882,4885],"valid"],[[4886,4887],"disallowed"],[[4888,4894],"valid"],[[4895,4895],"valid"],[[4896,4934],"valid"],[[4935,4935],"valid"],[[4936,4954],"valid"],[[4955,4956],"disallowed"],[[4957,4958],"valid"],[[4959,4959],"valid"],[[4960,4960],"valid",[],"NV8"],[[4961,4988],"valid",[],"NV8"],[[4989,4991],"disallowed"],[[4992,5007],"valid"],[[5008,5017],"valid",[],"NV8"],[[5018,5023],"disallowed"],[[5024,5108],"valid"],[[5109,5109],"valid"],[[5110,5111],"disallowed"],[[5112,5112],"mapped",[5104]],[[5113,5113],"mapped",[5105]],[[5114,5114],"mapped",[5106]],[[5115,5115],"mapped",[5107]],[[5116,5116],"mapped",[5108]],[[5117,5117],"mapped",[5109]],[[5118,5119],"disallowed"],[[5120,5120],"valid",[],"NV8"],[[5121,5740],"valid"],[[5741,5742],"valid",[],"NV8"],[[5743,5750],"valid"],[[5751,5759],"valid"],[[5760,5760],"disallowed"],[[5761,5786],"valid"],[[5787,5788],"valid",[],"NV8"],[[5789,5791],"disallowed"],[[5792,5866],"valid"],[[5867,5872],"valid",[],"NV8"],[[5873,5880],"valid"],[[5881,5887],"disallowed"],[[5888,5900],"valid"],[[5901,5901],"disallowed"],[[5902,5908],"valid"],[[5909,5919],"disallowed"],[[5920,5940],"valid"],[[5941,5942],"valid",[],"NV8"],[[5943,5951],"disallowed"],[[5952,5971],"valid"],[[5972,5983],"disallowed"],[[5984,5996],"valid"],[[5997,5997],"disallowed"],[[5998,6000],"valid"],[[6001,6001],"disallowed"],[[6002,6003],"valid"],[[6004,6015],"disallowed"],[[6016,6067],"valid"],[[6068,6069],"disallowed"],[[6070,6099],"valid"],[[6100,6102],"valid",[],"NV8"],[[6103,6103],"valid"],[[6104,6107],"valid",[],"NV8"],[[6108,6108],"valid"],[[6109,6109],"valid"],[[6110,6111],"disallowed"],[[6112,6121],"valid"],[[6122,6127],"disallowed"],[[6128,6137],"valid",[],"NV8"],[[6138,6143],"disallowed"],[[6144,6149],"valid",[],"NV8"],[[6150,6150],"disallowed"],[[6151,6154],"valid",[],"NV8"],[[6155,6157],"ignored"],[[6158,6158],"disallowed"],[[6159,6159],"disallowed"],[[6160,6169],"valid"],[[6170,6175],"disallowed"],[[6176,6263],"valid"],[[6264,6271],"disallowed"],[[6272,6313],"valid"],[[6314,6314],"valid"],[[6315,6319],"disallowed"],[[6320,6389],"valid"],[[6390,6399],"disallowed"],[[6400,6428],"valid"],[[6429,6430],"valid"],[[6431,6431],"disallowed"],[[6432,6443],"valid"],[[6444,6447],"disallowed"],[[6448,6459],"valid"],[[6460,6463],"disallowed"],[[6464,6464],"valid",[],"NV8"],[[6465,6467],"disallowed"],[[6468,6469],"valid",[],"NV8"],[[6470,6509],"valid"],[[6510,6511],"disallowed"],[[6512,6516],"valid"],[[6517,6527],"disallowed"],[[6528,6569],"valid"],[[6570,6571],"valid"],[[6572,6575],"disallowed"],[[6576,6601],"valid"],[[6602,6607],"disallowed"],[[6608,6617],"valid"],[[6618,6618],"valid",[],"XV8"],[[6619,6621],"disallowed"],[[6622,6623],"valid",[],"NV8"],[[6624,6655],"valid",[],"NV8"],[[6656,6683],"valid"],[[6684,6685],"disallowed"],[[6686,6687],"valid",[],"NV8"],[[6688,6750],"valid"],[[6751,6751],"disallowed"],[[6752,6780],"valid"],[[6781,6782],"disallowed"],[[6783,6793],"valid"],[[6794,6799],"disallowed"],[[6800,6809],"valid"],[[6810,6815],"disallowed"],[[6816,6822],"valid",[],"NV8"],[[6823,6823],"valid"],[[6824,6829],"valid",[],"NV8"],[[6830,6831],"disallowed"],[[6832,6845],"valid"],[[6846,6846],"valid",[],"NV8"],[[6847,6911],"disallowed"],[[6912,6987],"valid"],[[6988,6991],"disallowed"],[[6992,7001],"valid"],[[7002,7018],"valid",[],"NV8"],[[7019,7027],"valid"],[[7028,7036],"valid",[],"NV8"],[[7037,7039],"disallowed"],[[7040,7082],"valid"],[[7083,7085],"valid"],[[7086,7097],"valid"],[[7098,7103],"valid"],[[7104,7155],"valid"],[[7156,7163],"disallowed"],[[7164,7167],"valid",[],"NV8"],[[7168,7223],"valid"],[[7224,7226],"disallowed"],[[7227,7231],"valid",[],"NV8"],[[7232,7241],"valid"],[[7242,7244],"disallowed"],[[7245,7293],"valid"],[[7294,7295],"valid",[],"NV8"],[[7296,7359],"disallowed"],[[7360,7367],"valid",[],"NV8"],[[7368,7375],"disallowed"],[[7376,7378],"valid"],[[7379,7379],"valid",[],"NV8"],[[7380,7410],"valid"],[[7411,7414],"valid"],[[7415,7415],"disallowed"],[[7416,7417],"valid"],[[7418,7423],"disallowed"],[[7424,7467],"valid"],[[7468,7468],"mapped",[97]],[[7469,7469],"mapped",[230]],[[7470,7470],"mapped",[98]],[[7471,7471],"valid"],[[7472,7472],"mapped",[100]],[[7473,7473],"mapped",[101]],[[7474,7474],"mapped",[477]],[[7475,7475],"mapped",[103]],[[7476,7476],"mapped",[104]],[[7477,7477],"mapped",[105]],[[7478,7478],"mapped",[106]],[[7479,7479],"mapped",[107]],[[7480,7480],"mapped",[108]],[[7481,7481],"mapped",[109]],[[7482,7482],"mapped",[110]],[[7483,7483],"valid"],[[7484,7484],"mapped",[111]],[[7485,7485],"mapped",[547]],[[7486,7486],"mapped",[112]],[[7487,7487],"mapped",[114]],[[7488,7488],"mapped",[116]],[[7489,7489],"mapped",[117]],[[7490,7490],"mapped",[119]],[[7491,7491],"mapped",[97]],[[7492,7492],"mapped",[592]],[[7493,7493],"mapped",[593]],[[7494,7494],"mapped",[7426]],[[7495,7495],"mapped",[98]],[[7496,7496],"mapped",[100]],[[7497,7497],"mapped",[101]],[[7498,7498],"mapped",[601]],[[7499,7499],"mapped",[603]],[[7500,7500],"mapped",[604]],[[7501,7501],"mapped",[103]],[[7502,7502],"valid"],[[7503,7503],"mapped",[107]],[[7504,7504],"mapped",[109]],[[7505,7505],"mapped",[331]],[[7506,7506],"mapped",[111]],[[7507,7507],"mapped",[596]],[[7508,7508],"mapped",[7446]],[[7509,7509],"mapped",[7447]],[[7510,7510],"mapped",[112]],[[7511,7511],"mapped",[116]],[[7512,7512],"mapped",[117]],[[7513,7513],"mapped",[7453]],[[7514,7514],"mapped",[623]],[[7515,7515],"mapped",[118]],[[7516,7516],"mapped",[7461]],[[7517,7517],"mapped",[946]],[[7518,7518],"mapped",[947]],[[7519,7519],"mapped",[948]],[[7520,7520],"mapped",[966]],[[7521,7521],"mapped",[967]],[[7522,7522],"mapped",[105]],[[7523,7523],"mapped",[114]],[[7524,7524],"mapped",[117]],[[7525,7525],"mapped",[118]],[[7526,7526],"mapped",[946]],[[7527,7527],"mapped",[947]],[[7528,7528],"mapped",[961]],[[7529,7529],"mapped",[966]],[[7530,7530],"mapped",[967]],[[7531,7531],"valid"],[[7532,7543],"valid"],[[7544,7544],"mapped",[1085]],[[7545,7578],"valid"],[[7579,7579],"mapped",[594]],[[7580,7580],"mapped",[99]],[[7581,7581],"mapped",[597]],[[7582,7582],"mapped",[240]],[[7583,7583],"mapped",[604]],[[7584,7584],"mapped",[102]],[[7585,7585],"mapped",[607]],[[7586,7586],"mapped",[609]],[[7587,7587],"mapped",[613]],[[7588,7588],"mapped",[616]],[[7589,7589],"mapped",[617]],[[7590,7590],"mapped",[618]],[[7591,7591],"mapped",[7547]],[[7592,7592],"mapped",[669]],[[7593,7593],"mapped",[621]],[[7594,7594],"mapped",[7557]],[[7595,7595],"mapped",[671]],[[7596,7596],"mapped",[625]],[[7597,7597],"mapped",[624]],[[7598,7598],"mapped",[626]],[[7599,7599],"mapped",[627]],[[7600,7600],"mapped",[628]],[[7601,7601],"mapped",[629]],[[7602,7602],"mapped",[632]],[[7603,7603],"mapped",[642]],[[7604,7604],"mapped",[643]],[[7605,7605],"mapped",[427]],[[7606,7606],"mapped",[649]],[[7607,7607],"mapped",[650]],[[7608,7608],"mapped",[7452]],[[7609,7609],"mapped",[651]],[[7610,7610],"mapped",[652]],[[7611,7611],"mapped",[122]],[[7612,7612],"mapped",[656]],[[7613,7613],"mapped",[657]],[[7614,7614],"mapped",[658]],[[7615,7615],"mapped",[952]],[[7616,7619],"valid"],[[7620,7626],"valid"],[[7627,7654],"valid"],[[7655,7669],"valid"],[[7670,7675],"disallowed"],[[7676,7676],"valid"],[[7677,7677],"valid"],[[7678,7679],"valid"],[[7680,7680],"mapped",[7681]],[[7681,7681],"valid"],[[7682,7682],"mapped",[7683]],[[7683,7683],"valid"],[[7684,7684],"mapped",[7685]],[[7685,7685],"valid"],[[7686,7686],"mapped",[7687]],[[7687,7687],"valid"],[[7688,7688],"mapped",[7689]],[[7689,7689],"valid"],[[7690,7690],"mapped",[7691]],[[7691,7691],"valid"],[[7692,7692],"mapped",[7693]],[[7693,7693],"valid"],[[7694,7694],"mapped",[7695]],[[7695,7695],"valid"],[[7696,7696],"mapped",[7697]],[[7697,7697],"valid"],[[7698,7698],"mapped",[7699]],[[7699,7699],"valid"],[[7700,7700],"mapped",[7701]],[[7701,7701],"valid"],[[7702,7702],"mapped",[7703]],[[7703,7703],"valid"],[[7704,7704],"mapped",[7705]],[[7705,7705],"valid"],[[7706,7706],"mapped",[7707]],[[7707,7707],"valid"],[[7708,7708],"mapped",[7709]],[[7709,7709],"valid"],[[7710,7710],"mapped",[7711]],[[7711,7711],"valid"],[[7712,7712],"mapped",[7713]],[[7713,7713],"valid"],[[7714,7714],"mapped",[7715]],[[7715,7715],"valid"],[[7716,7716],"mapped",[7717]],[[7717,7717],"valid"],[[7718,7718],"mapped",[7719]],[[7719,7719],"valid"],[[7720,7720],"mapped",[7721]],[[7721,7721],"valid"],[[7722,7722],"mapped",[7723]],[[7723,7723],"valid"],[[7724,7724],"mapped",[7725]],[[7725,7725],"valid"],[[7726,7726],"mapped",[7727]],[[7727,7727],"valid"],[[7728,7728],"mapped",[7729]],[[7729,7729],"valid"],[[7730,7730],"mapped",[7731]],[[7731,7731],"valid"],[[7732,7732],"mapped",[7733]],[[7733,7733],"valid"],[[7734,7734],"mapped",[7735]],[[7735,7735],"valid"],[[7736,7736],"mapped",[7737]],[[7737,7737],"valid"],[[7738,7738],"mapped",[7739]],[[7739,7739],"valid"],[[7740,7740],"mapped",[7741]],[[7741,7741],"valid"],[[7742,7742],"mapped",[7743]],[[7743,7743],"valid"],[[7744,7744],"mapped",[7745]],[[7745,7745],"valid"],[[7746,7746],"mapped",[7747]],[[7747,7747],"valid"],[[7748,7748],"mapped",[7749]],[[7749,7749],"valid"],[[7750,7750],"mapped",[7751]],[[7751,7751],"valid"],[[7752,7752],"mapped",[7753]],[[7753,7753],"valid"],[[7754,7754],"mapped",[7755]],[[7755,7755],"valid"],[[7756,7756],"mapped",[7757]],[[7757,7757],"valid"],[[7758,7758],"mapped",[7759]],[[7759,7759],"valid"],[[7760,7760],"mapped",[7761]],[[7761,7761],"valid"],[[7762,7762],"mapped",[7763]],[[7763,7763],"valid"],[[7764,7764],"mapped",[7765]],[[7765,7765],"valid"],[[7766,7766],"mapped",[7767]],[[7767,7767],"valid"],[[7768,7768],"mapped",[7769]],[[7769,7769],"valid"],[[7770,7770],"mapped",[7771]],[[7771,7771],"valid"],[[7772,7772],"mapped",[7773]],[[7773,7773],"valid"],[[7774,7774],"mapped",[7775]],[[7775,7775],"valid"],[[7776,7776],"mapped",[7777]],[[7777,7777],"valid"],[[7778,7778],"mapped",[7779]],[[7779,7779],"valid"],[[7780,7780],"mapped",[7781]],[[7781,7781],"valid"],[[7782,7782],"mapped",[7783]],[[7783,7783],"valid"],[[7784,7784],"mapped",[7785]],[[7785,7785],"valid"],[[7786,7786],"mapped",[7787]],[[7787,7787],"valid"],[[7788,7788],"mapped",[7789]],[[7789,7789],"valid"],[[7790,7790],"mapped",[7791]],[[7791,7791],"valid"],[[7792,7792],"mapped",[7793]],[[7793,7793],"valid"],[[7794,7794],"mapped",[7795]],[[7795,7795],"valid"],[[7796,7796],"mapped",[7797]],[[7797,7797],"valid"],[[7798,7798],"mapped",[7799]],[[7799,7799],"valid"],[[7800,7800],"mapped",[7801]],[[7801,7801],"valid"],[[7802,7802],"mapped",[7803]],[[7803,7803],"valid"],[[7804,7804],"mapped",[7805]],[[7805,7805],"valid"],[[7806,7806],"mapped",[7807]],[[7807,7807],"valid"],[[7808,7808],"mapped",[7809]],[[7809,7809],"valid"],[[7810,7810],"mapped",[7811]],[[7811,7811],"valid"],[[7812,7812],"mapped",[7813]],[[7813,7813],"valid"],[[7814,7814],"mapped",[7815]],[[7815,7815],"valid"],[[7816,7816],"mapped",[7817]],[[7817,7817],"valid"],[[7818,7818],"mapped",[7819]],[[7819,7819],"valid"],[[7820,7820],"mapped",[7821]],[[7821,7821],"valid"],[[7822,7822],"mapped",[7823]],[[7823,7823],"valid"],[[7824,7824],"mapped",[7825]],[[7825,7825],"valid"],[[7826,7826],"mapped",[7827]],[[7827,7827],"valid"],[[7828,7828],"mapped",[7829]],[[7829,7833],"valid"],[[7834,7834],"mapped",[97,702]],[[7835,7835],"mapped",[7777]],[[7836,7837],"valid"],[[7838,7838],"mapped",[115,115]],[[7839,7839],"valid"],[[7840,7840],"mapped",[7841]],[[7841,7841],"valid"],[[7842,7842],"mapped",[7843]],[[7843,7843],"valid"],[[7844,7844],"mapped",[7845]],[[7845,7845],"valid"],[[7846,7846],"mapped",[7847]],[[7847,7847],"valid"],[[7848,7848],"mapped",[7849]],[[7849,7849],"valid"],[[7850,7850],"mapped",[7851]],[[7851,7851],"valid"],[[7852,7852],"mapped",[7853]],[[7853,7853],"valid"],[[7854,7854],"mapped",[7855]],[[7855,7855],"valid"],[[7856,7856],"mapped",[7857]],[[7857,7857],"valid"],[[7858,7858],"mapped",[7859]],[[7859,7859],"valid"],[[7860,7860],"mapped",[7861]],[[7861,7861],"valid"],[[7862,7862],"mapped",[7863]],[[7863,7863],"valid"],[[7864,7864],"mapped",[7865]],[[7865,7865],"valid"],[[7866,7866],"mapped",[7867]],[[7867,7867],"valid"],[[7868,7868],"mapped",[7869]],[[7869,7869],"valid"],[[7870,7870],"mapped",[7871]],[[7871,7871],"valid"],[[7872,7872],"mapped",[7873]],[[7873,7873],"valid"],[[7874,7874],"mapped",[7875]],[[7875,7875],"valid"],[[7876,7876],"mapped",[7877]],[[7877,7877],"valid"],[[7878,7878],"mapped",[7879]],[[7879,7879],"valid"],[[7880,7880],"mapped",[7881]],[[7881,7881],"valid"],[[7882,7882],"mapped",[7883]],[[7883,7883],"valid"],[[7884,7884],"mapped",[7885]],[[7885,7885],"valid"],[[7886,7886],"mapped",[7887]],[[7887,7887],"valid"],[[7888,7888],"mapped",[7889]],[[7889,7889],"valid"],[[7890,7890],"mapped",[7891]],[[7891,7891],"valid"],[[7892,7892],"mapped",[7893]],[[7893,7893],"valid"],[[7894,7894],"mapped",[7895]],[[7895,7895],"valid"],[[7896,7896],"mapped",[7897]],[[7897,7897],"valid"],[[7898,7898],"mapped",[7899]],[[7899,7899],"valid"],[[7900,7900],"mapped",[7901]],[[7901,7901],"valid"],[[7902,7902],"mapped",[7903]],[[7903,7903],"valid"],[[7904,7904],"mapped",[7905]],[[7905,7905],"valid"],[[7906,7906],"mapped",[7907]],[[7907,7907],"valid"],[[7908,7908],"mapped",[7909]],[[7909,7909],"valid"],[[7910,7910],"mapped",[7911]],[[7911,7911],"valid"],[[7912,7912],"mapped",[7913]],[[7913,7913],"valid"],[[7914,7914],"mapped",[7915]],[[7915,7915],"valid"],[[7916,7916],"mapped",[7917]],[[7917,7917],"valid"],[[7918,7918],"mapped",[7919]],[[7919,7919],"valid"],[[7920,7920],"mapped",[7921]],[[7921,7921],"valid"],[[7922,7922],"mapped",[7923]],[[7923,7923],"valid"],[[7924,7924],"mapped",[7925]],[[7925,7925],"valid"],[[7926,7926],"mapped",[7927]],[[7927,7927],"valid"],[[7928,7928],"mapped",[7929]],[[7929,7929],"valid"],[[7930,7930],"mapped",[7931]],[[7931,7931],"valid"],[[7932,7932],"mapped",[7933]],[[7933,7933],"valid"],[[7934,7934],"mapped",[7935]],[[7935,7935],"valid"],[[7936,7943],"valid"],[[7944,7944],"mapped",[7936]],[[7945,7945],"mapped",[7937]],[[7946,7946],"mapped",[7938]],[[7947,7947],"mapped",[7939]],[[7948,7948],"mapped",[7940]],[[7949,7949],"mapped",[7941]],[[7950,7950],"mapped",[7942]],[[7951,7951],"mapped",[7943]],[[7952,7957],"valid"],[[7958,7959],"disallowed"],[[7960,7960],"mapped",[7952]],[[7961,7961],"mapped",[7953]],[[7962,7962],"mapped",[7954]],[[7963,7963],"mapped",[7955]],[[7964,7964],"mapped",[7956]],[[7965,7965],"mapped",[7957]],[[7966,7967],"disallowed"],[[7968,7975],"valid"],[[7976,7976],"mapped",[7968]],[[7977,7977],"mapped",[7969]],[[7978,7978],"mapped",[7970]],[[7979,7979],"mapped",[7971]],[[7980,7980],"mapped",[7972]],[[7981,7981],"mapped",[7973]],[[7982,7982],"mapped",[7974]],[[7983,7983],"mapped",[7975]],[[7984,7991],"valid"],[[7992,7992],"mapped",[7984]],[[7993,7993],"mapped",[7985]],[[7994,7994],"mapped",[7986]],[[7995,7995],"mapped",[7987]],[[7996,7996],"mapped",[7988]],[[7997,7997],"mapped",[7989]],[[7998,7998],"mapped",[7990]],[[7999,7999],"mapped",[7991]],[[8000,8005],"valid"],[[8006,8007],"disallowed"],[[8008,8008],"mapped",[8000]],[[8009,8009],"mapped",[8001]],[[8010,8010],"mapped",[8002]],[[8011,8011],"mapped",[8003]],[[8012,8012],"mapped",[8004]],[[8013,8013],"mapped",[8005]],[[8014,8015],"disallowed"],[[8016,8023],"valid"],[[8024,8024],"disallowed"],[[8025,8025],"mapped",[8017]],[[8026,8026],"disallowed"],[[8027,8027],"mapped",[8019]],[[8028,8028],"disallowed"],[[8029,8029],"mapped",[8021]],[[8030,8030],"disallowed"],[[8031,8031],"mapped",[8023]],[[8032,8039],"valid"],[[8040,8040],"mapped",[8032]],[[8041,8041],"mapped",[8033]],[[8042,8042],"mapped",[8034]],[[8043,8043],"mapped",[8035]],[[8044,8044],"mapped",[8036]],[[8045,8045],"mapped",[8037]],[[8046,8046],"mapped",[8038]],[[8047,8047],"mapped",[8039]],[[8048,8048],"valid"],[[8049,8049],"mapped",[940]],[[8050,8050],"valid"],[[8051,8051],"mapped",[941]],[[8052,8052],"valid"],[[8053,8053],"mapped",[942]],[[8054,8054],"valid"],[[8055,8055],"mapped",[943]],[[8056,8056],"valid"],[[8057,8057],"mapped",[972]],[[8058,8058],"valid"],[[8059,8059],"mapped",[973]],[[8060,8060],"valid"],[[8061,8061],"mapped",[974]],[[8062,8063],"disallowed"],[[8064,8064],"mapped",[7936,953]],[[8065,8065],"mapped",[7937,953]],[[8066,8066],"mapped",[7938,953]],[[8067,8067],"mapped",[7939,953]],[[8068,8068],"mapped",[7940,953]],[[8069,8069],"mapped",[7941,953]],[[8070,8070],"mapped",[7942,953]],[[8071,8071],"mapped",[7943,953]],[[8072,8072],"mapped",[7936,953]],[[8073,8073],"mapped",[7937,953]],[[8074,8074],"mapped",[7938,953]],[[8075,8075],"mapped",[7939,953]],[[8076,8076],"mapped",[7940,953]],[[8077,8077],"mapped",[7941,953]],[[8078,8078],"mapped",[7942,953]],[[8079,8079],"mapped",[7943,953]],[[8080,8080],"mapped",[7968,953]],[[8081,8081],"mapped",[7969,953]],[[8082,8082],"mapped",[7970,953]],[[8083,8083],"mapped",[7971,953]],[[8084,8084],"mapped",[7972,953]],[[8085,8085],"mapped",[7973,953]],[[8086,8086],"mapped",[7974,953]],[[8087,8087],"mapped",[7975,953]],[[8088,8088],"mapped",[7968,953]],[[8089,8089],"mapped",[7969,953]],[[8090,8090],"mapped",[7970,953]],[[8091,8091],"mapped",[7971,953]],[[8092,8092],"mapped",[7972,953]],[[8093,8093],"mapped",[7973,953]],[[8094,8094],"mapped",[7974,953]],[[8095,8095],"mapped",[7975,953]],[[8096,8096],"mapped",[8032,953]],[[8097,8097],"mapped",[8033,953]],[[8098,8098],"mapped",[8034,953]],[[8099,8099],"mapped",[8035,953]],[[8100,8100],"mapped",[8036,953]],[[8101,8101],"mapped",[8037,953]],[[8102,8102],"mapped",[8038,953]],[[8103,8103],"mapped",[8039,953]],[[8104,8104],"mapped",[8032,953]],[[8105,8105],"mapped",[8033,953]],[[8106,8106],"mapped",[8034,953]],[[8107,8107],"mapped",[8035,953]],[[8108,8108],"mapped",[8036,953]],[[8109,8109],"mapped",[8037,953]],[[8110,8110],"mapped",[8038,953]],[[8111,8111],"mapped",[8039,953]],[[8112,8113],"valid"],[[8114,8114],"mapped",[8048,953]],[[8115,8115],"mapped",[945,953]],[[8116,8116],"mapped",[940,953]],[[8117,8117],"disallowed"],[[8118,8118],"valid"],[[8119,8119],"mapped",[8118,953]],[[8120,8120],"mapped",[8112]],[[8121,8121],"mapped",[8113]],[[8122,8122],"mapped",[8048]],[[8123,8123],"mapped",[940]],[[8124,8124],"mapped",[945,953]],[[8125,8125],"disallowed_STD3_mapped",[32,787]],[[8126,8126],"mapped",[953]],[[8127,8127],"disallowed_STD3_mapped",[32,787]],[[8128,8128],"disallowed_STD3_mapped",[32,834]],[[8129,8129],"disallowed_STD3_mapped",[32,776,834]],[[8130,8130],"mapped",[8052,953]],[[8131,8131],"mapped",[951,953]],[[8132,8132],"mapped",[942,953]],[[8133,8133],"disallowed"],[[8134,8134],"valid"],[[8135,8135],"mapped",[8134,953]],[[8136,8136],"mapped",[8050]],[[8137,8137],"mapped",[941]],[[8138,8138],"mapped",[8052]],[[8139,8139],"mapped",[942]],[[8140,8140],"mapped",[951,953]],[[8141,8141],"disallowed_STD3_mapped",[32,787,768]],[[8142,8142],"disallowed_STD3_mapped",[32,787,769]],[[8143,8143],"disallowed_STD3_mapped",[32,787,834]],[[8144,8146],"valid"],[[8147,8147],"mapped",[912]],[[8148,8149],"disallowed"],[[8150,8151],"valid"],[[8152,8152],"mapped",[8144]],[[8153,8153],"mapped",[8145]],[[8154,8154],"mapped",[8054]],[[8155,8155],"mapped",[943]],[[8156,8156],"disallowed"],[[8157,8157],"disallowed_STD3_mapped",[32,788,768]],[[8158,8158],"disallowed_STD3_mapped",[32,788,769]],[[8159,8159],"disallowed_STD3_mapped",[32,788,834]],[[8160,8162],"valid"],[[8163,8163],"mapped",[944]],[[8164,8167],"valid"],[[8168,8168],"mapped",[8160]],[[8169,8169],"mapped",[8161]],[[8170,8170],"mapped",[8058]],[[8171,8171],"mapped",[973]],[[8172,8172],"mapped",[8165]],[[8173,8173],"disallowed_STD3_mapped",[32,776,768]],[[8174,8174],"disallowed_STD3_mapped",[32,776,769]],[[8175,8175],"disallowed_STD3_mapped",[96]],[[8176,8177],"disallowed"],[[8178,8178],"mapped",[8060,953]],[[8179,8179],"mapped",[969,953]],[[8180,8180],"mapped",[974,953]],[[8181,8181],"disallowed"],[[8182,8182],"valid"],[[8183,8183],"mapped",[8182,953]],[[8184,8184],"mapped",[8056]],[[8185,8185],"mapped",[972]],[[8186,8186],"mapped",[8060]],[[8187,8187],"mapped",[974]],[[8188,8188],"mapped",[969,953]],[[8189,8189],"disallowed_STD3_mapped",[32,769]],[[8190,8190],"disallowed_STD3_mapped",[32,788]],[[8191,8191],"disallowed"],[[8192,8202],"disallowed_STD3_mapped",[32]],[[8203,8203],"ignored"],[[8204,8205],"deviation",[]],[[8206,8207],"disallowed"],[[8208,8208],"valid",[],"NV8"],[[8209,8209],"mapped",[8208]],[[8210,8214],"valid",[],"NV8"],[[8215,8215],"disallowed_STD3_mapped",[32,819]],[[8216,8227],"valid",[],"NV8"],[[8228,8230],"disallowed"],[[8231,8231],"valid",[],"NV8"],[[8232,8238],"disallowed"],[[8239,8239],"disallowed_STD3_mapped",[32]],[[8240,8242],"valid",[],"NV8"],[[8243,8243],"mapped",[8242,8242]],[[8244,8244],"mapped",[8242,8242,8242]],[[8245,8245],"valid",[],"NV8"],[[8246,8246],"mapped",[8245,8245]],[[8247,8247],"mapped",[8245,8245,8245]],[[8248,8251],"valid",[],"NV8"],[[8252,8252],"disallowed_STD3_mapped",[33,33]],[[8253,8253],"valid",[],"NV8"],[[8254,8254],"disallowed_STD3_mapped",[32,773]],[[8255,8262],"valid",[],"NV8"],[[8263,8263],"disallowed_STD3_mapped",[63,63]],[[8264,8264],"disallowed_STD3_mapped",[63,33]],[[8265,8265],"disallowed_STD3_mapped",[33,63]],[[8266,8269],"valid",[],"NV8"],[[8270,8274],"valid",[],"NV8"],[[8275,8276],"valid",[],"NV8"],[[8277,8278],"valid",[],"NV8"],[[8279,8279],"mapped",[8242,8242,8242,8242]],[[8280,8286],"valid",[],"NV8"],[[8287,8287],"disallowed_STD3_mapped",[32]],[[8288,8288],"ignored"],[[8289,8291],"disallowed"],[[8292,8292],"ignored"],[[8293,8293],"disallowed"],[[8294,8297],"disallowed"],[[8298,8303],"disallowed"],[[8304,8304],"mapped",[48]],[[8305,8305],"mapped",[105]],[[8306,8307],"disallowed"],[[8308,8308],"mapped",[52]],[[8309,8309],"mapped",[53]],[[8310,8310],"mapped",[54]],[[8311,8311],"mapped",[55]],[[8312,8312],"mapped",[56]],[[8313,8313],"mapped",[57]],[[8314,8314],"disallowed_STD3_mapped",[43]],[[8315,8315],"mapped",[8722]],[[8316,8316],"disallowed_STD3_mapped",[61]],[[8317,8317],"disallowed_STD3_mapped",[40]],[[8318,8318],"disallowed_STD3_mapped",[41]],[[8319,8319],"mapped",[110]],[[8320,8320],"mapped",[48]],[[8321,8321],"mapped",[49]],[[8322,8322],"mapped",[50]],[[8323,8323],"mapped",[51]],[[8324,8324],"mapped",[52]],[[8325,8325],"mapped",[53]],[[8326,8326],"mapped",[54]],[[8327,8327],"mapped",[55]],[[8328,8328],"mapped",[56]],[[8329,8329],"mapped",[57]],[[8330,8330],"disallowed_STD3_mapped",[43]],[[8331,8331],"mapped",[8722]],[[8332,8332],"disallowed_STD3_mapped",[61]],[[8333,8333],"disallowed_STD3_mapped",[40]],[[8334,8334],"disallowed_STD3_mapped",[41]],[[8335,8335],"disallowed"],[[8336,8336],"mapped",[97]],[[8337,8337],"mapped",[101]],[[8338,8338],"mapped",[111]],[[8339,8339],"mapped",[120]],[[8340,8340],"mapped",[601]],[[8341,8341],"mapped",[104]],[[8342,8342],"mapped",[107]],[[8343,8343],"mapped",[108]],[[8344,8344],"mapped",[109]],[[8345,8345],"mapped",[110]],[[8346,8346],"mapped",[112]],[[8347,8347],"mapped",[115]],[[8348,8348],"mapped",[116]],[[8349,8351],"disallowed"],[[8352,8359],"valid",[],"NV8"],[[8360,8360],"mapped",[114,115]],[[8361,8362],"valid",[],"NV8"],[[8363,8363],"valid",[],"NV8"],[[8364,8364],"valid",[],"NV8"],[[8365,8367],"valid",[],"NV8"],[[8368,8369],"valid",[],"NV8"],[[8370,8373],"valid",[],"NV8"],[[8374,8376],"valid",[],"NV8"],[[8377,8377],"valid",[],"NV8"],[[8378,8378],"valid",[],"NV8"],[[8379,8381],"valid",[],"NV8"],[[8382,8382],"valid",[],"NV8"],[[8383,8399],"disallowed"],[[8400,8417],"valid",[],"NV8"],[[8418,8419],"valid",[],"NV8"],[[8420,8426],"valid",[],"NV8"],[[8427,8427],"valid",[],"NV8"],[[8428,8431],"valid",[],"NV8"],[[8432,8432],"valid",[],"NV8"],[[8433,8447],"disallowed"],[[8448,8448],"disallowed_STD3_mapped",[97,47,99]],[[8449,8449],"disallowed_STD3_mapped",[97,47,115]],[[8450,8450],"mapped",[99]],[[8451,8451],"mapped",[176,99]],[[8452,8452],"valid",[],"NV8"],[[8453,8453],"disallowed_STD3_mapped",[99,47,111]],[[8454,8454],"disallowed_STD3_mapped",[99,47,117]],[[8455,8455],"mapped",[603]],[[8456,8456],"valid",[],"NV8"],[[8457,8457],"mapped",[176,102]],[[8458,8458],"mapped",[103]],[[8459,8462],"mapped",[104]],[[8463,8463],"mapped",[295]],[[8464,8465],"mapped",[105]],[[8466,8467],"mapped",[108]],[[8468,8468],"valid",[],"NV8"],[[8469,8469],"mapped",[110]],[[8470,8470],"mapped",[110,111]],[[8471,8472],"valid",[],"NV8"],[[8473,8473],"mapped",[112]],[[8474,8474],"mapped",[113]],[[8475,8477],"mapped",[114]],[[8478,8479],"valid",[],"NV8"],[[8480,8480],"mapped",[115,109]],[[8481,8481],"mapped",[116,101,108]],[[8482,8482],"mapped",[116,109]],[[8483,8483],"valid",[],"NV8"],[[8484,8484],"mapped",[122]],[[8485,8485],"valid",[],"NV8"],[[8486,8486],"mapped",[969]],[[8487,8487],"valid",[],"NV8"],[[8488,8488],"mapped",[122]],[[8489,8489],"valid",[],"NV8"],[[8490,8490],"mapped",[107]],[[8491,8491],"mapped",[229]],[[8492,8492],"mapped",[98]],[[8493,8493],"mapped",[99]],[[8494,8494],"valid",[],"NV8"],[[8495,8496],"mapped",[101]],[[8497,8497],"mapped",[102]],[[8498,8498],"disallowed"],[[8499,8499],"mapped",[109]],[[8500,8500],"mapped",[111]],[[8501,8501],"mapped",[1488]],[[8502,8502],"mapped",[1489]],[[8503,8503],"mapped",[1490]],[[8504,8504],"mapped",[1491]],[[8505,8505],"mapped",[105]],[[8506,8506],"valid",[],"NV8"],[[8507,8507],"mapped",[102,97,120]],[[8508,8508],"mapped",[960]],[[8509,8510],"mapped",[947]],[[8511,8511],"mapped",[960]],[[8512,8512],"mapped",[8721]],[[8513,8516],"valid",[],"NV8"],[[8517,8518],"mapped",[100]],[[8519,8519],"mapped",[101]],[[8520,8520],"mapped",[105]],[[8521,8521],"mapped",[106]],[[8522,8523],"valid",[],"NV8"],[[8524,8524],"valid",[],"NV8"],[[8525,8525],"valid",[],"NV8"],[[8526,8526],"valid"],[[8527,8527],"valid",[],"NV8"],[[8528,8528],"mapped",[49,8260,55]],[[8529,8529],"mapped",[49,8260,57]],[[8530,8530],"mapped",[49,8260,49,48]],[[8531,8531],"mapped",[49,8260,51]],[[8532,8532],"mapped",[50,8260,51]],[[8533,8533],"mapped",[49,8260,53]],[[8534,8534],"mapped",[50,8260,53]],[[8535,8535],"mapped",[51,8260,53]],[[8536,8536],"mapped",[52,8260,53]],[[8537,8537],"mapped",[49,8260,54]],[[8538,8538],"mapped",[53,8260,54]],[[8539,8539],"mapped",[49,8260,56]],[[8540,8540],"mapped",[51,8260,56]],[[8541,8541],"mapped",[53,8260,56]],[[8542,8542],"mapped",[55,8260,56]],[[8543,8543],"mapped",[49,8260]],[[8544,8544],"mapped",[105]],[[8545,8545],"mapped",[105,105]],[[8546,8546],"mapped",[105,105,105]],[[8547,8547],"mapped",[105,118]],[[8548,8548],"mapped",[118]],[[8549,8549],"mapped",[118,105]],[[8550,8550],"mapped",[118,105,105]],[[8551,8551],"mapped",[118,105,105,105]],[[8552,8552],"mapped",[105,120]],[[8553,8553],"mapped",[120]],[[8554,8554],"mapped",[120,105]],[[8555,8555],"mapped",[120,105,105]],[[8556,8556],"mapped",[108]],[[8557,8557],"mapped",[99]],[[8558,8558],"mapped",[100]],[[8559,8559],"mapped",[109]],[[8560,8560],"mapped",[105]],[[8561,8561],"mapped",[105,105]],[[8562,8562],"mapped",[105,105,105]],[[8563,8563],"mapped",[105,118]],[[8564,8564],"mapped",[118]],[[8565,8565],"mapped",[118,105]],[[8566,8566],"mapped",[118,105,105]],[[8567,8567],"mapped",[118,105,105,105]],[[8568,8568],"mapped",[105,120]],[[8569,8569],"mapped",[120]],[[8570,8570],"mapped",[120,105]],[[8571,8571],"mapped",[120,105,105]],[[8572,8572],"mapped",[108]],[[8573,8573],"mapped",[99]],[[8574,8574],"mapped",[100]],[[8575,8575],"mapped",[109]],[[8576,8578],"valid",[],"NV8"],[[8579,8579],"disallowed"],[[8580,8580],"valid"],[[8581,8584],"valid",[],"NV8"],[[8585,8585],"mapped",[48,8260,51]],[[8586,8587],"valid",[],"NV8"],[[8588,8591],"disallowed"],[[8592,8682],"valid",[],"NV8"],[[8683,8691],"valid",[],"NV8"],[[8692,8703],"valid",[],"NV8"],[[8704,8747],"valid",[],"NV8"],[[8748,8748],"mapped",[8747,8747]],[[8749,8749],"mapped",[8747,8747,8747]],[[8750,8750],"valid",[],"NV8"],[[8751,8751],"mapped",[8750,8750]],[[8752,8752],"mapped",[8750,8750,8750]],[[8753,8799],"valid",[],"NV8"],[[8800,8800],"disallowed_STD3_valid"],[[8801,8813],"valid",[],"NV8"],[[8814,8815],"disallowed_STD3_valid"],[[8816,8945],"valid",[],"NV8"],[[8946,8959],"valid",[],"NV8"],[[8960,8960],"valid",[],"NV8"],[[8961,8961],"valid",[],"NV8"],[[8962,9000],"valid",[],"NV8"],[[9001,9001],"mapped",[12296]],[[9002,9002],"mapped",[12297]],[[9003,9082],"valid",[],"NV8"],[[9083,9083],"valid",[],"NV8"],[[9084,9084],"valid",[],"NV8"],[[9085,9114],"valid",[],"NV8"],[[9115,9166],"valid",[],"NV8"],[[9167,9168],"valid",[],"NV8"],[[9169,9179],"valid",[],"NV8"],[[9180,9191],"valid",[],"NV8"],[[9192,9192],"valid",[],"NV8"],[[9193,9203],"valid",[],"NV8"],[[9204,9210],"valid",[],"NV8"],[[9211,9215],"disallowed"],[[9216,9252],"valid",[],"NV8"],[[9253,9254],"valid",[],"NV8"],[[9255,9279],"disallowed"],[[9280,9290],"valid",[],"NV8"],[[9291,9311],"disallowed"],[[9312,9312],"mapped",[49]],[[9313,9313],"mapped",[50]],[[9314,9314],"mapped",[51]],[[9315,9315],"mapped",[52]],[[9316,9316],"mapped",[53]],[[9317,9317],"mapped",[54]],[[9318,9318],"mapped",[55]],[[9319,9319],"mapped",[56]],[[9320,9320],"mapped",[57]],[[9321,9321],"mapped",[49,48]],[[9322,9322],"mapped",[49,49]],[[9323,9323],"mapped",[49,50]],[[9324,9324],"mapped",[49,51]],[[9325,9325],"mapped",[49,52]],[[9326,9326],"mapped",[49,53]],[[9327,9327],"mapped",[49,54]],[[9328,9328],"mapped",[49,55]],[[9329,9329],"mapped",[49,56]],[[9330,9330],"mapped",[49,57]],[[9331,9331],"mapped",[50,48]],[[9332,9332],"disallowed_STD3_mapped",[40,49,41]],[[9333,9333],"disallowed_STD3_mapped",[40,50,41]],[[9334,9334],"disallowed_STD3_mapped",[40,51,41]],[[9335,9335],"disallowed_STD3_mapped",[40,52,41]],[[9336,9336],"disallowed_STD3_mapped",[40,53,41]],[[9337,9337],"disallowed_STD3_mapped",[40,54,41]],[[9338,9338],"disallowed_STD3_mapped",[40,55,41]],[[9339,9339],"disallowed_STD3_mapped",[40,56,41]],[[9340,9340],"disallowed_STD3_mapped",[40,57,41]],[[9341,9341],"disallowed_STD3_mapped",[40,49,48,41]],[[9342,9342],"disallowed_STD3_mapped",[40,49,49,41]],[[9343,9343],"disallowed_STD3_mapped",[40,49,50,41]],[[9344,9344],"disallowed_STD3_mapped",[40,49,51,41]],[[9345,9345],"disallowed_STD3_mapped",[40,49,52,41]],[[9346,9346],"disallowed_STD3_mapped",[40,49,53,41]],[[9347,9347],"disallowed_STD3_mapped",[40,49,54,41]],[[9348,9348],"disallowed_STD3_mapped",[40,49,55,41]],[[9349,9349],"disallowed_STD3_mapped",[40,49,56,41]],[[9350,9350],"disallowed_STD3_mapped",[40,49,57,41]],[[9351,9351],"disallowed_STD3_mapped",[40,50,48,41]],[[9352,9371],"disallowed"],[[9372,9372],"disallowed_STD3_mapped",[40,97,41]],[[9373,9373],"disallowed_STD3_mapped",[40,98,41]],[[9374,9374],"disallowed_STD3_mapped",[40,99,41]],[[9375,9375],"disallowed_STD3_mapped",[40,100,41]],[[9376,9376],"disallowed_STD3_mapped",[40,101,41]],[[9377,9377],"disallowed_STD3_mapped",[40,102,41]],[[9378,9378],"disallowed_STD3_mapped",[40,103,41]],[[9379,9379],"disallowed_STD3_mapped",[40,104,41]],[[9380,9380],"disallowed_STD3_mapped",[40,105,41]],[[9381,9381],"disallowed_STD3_mapped",[40,106,41]],[[9382,9382],"disallowed_STD3_mapped",[40,107,41]],[[9383,9383],"disallowed_STD3_mapped",[40,108,41]],[[9384,9384],"disallowed_STD3_mapped",[40,109,41]],[[9385,9385],"disallowed_STD3_mapped",[40,110,41]],[[9386,9386],"disallowed_STD3_mapped",[40,111,41]],[[9387,9387],"disallowed_STD3_mapped",[40,112,41]],[[9388,9388],"disallowed_STD3_mapped",[40,113,41]],[[9389,9389],"disallowed_STD3_mapped",[40,114,41]],[[9390,9390],"disallowed_STD3_mapped",[40,115,41]],[[9391,9391],"disallowed_STD3_mapped",[40,116,41]],[[9392,9392],"disallowed_STD3_mapped",[40,117,41]],[[9393,9393],"disallowed_STD3_mapped",[40,118,41]],[[9394,9394],"disallowed_STD3_mapped",[40,119,41]],[[9395,9395],"disallowed_STD3_mapped",[40,120,41]],[[9396,9396],"disallowed_STD3_mapped",[40,121,41]],[[9397,9397],"disallowed_STD3_mapped",[40,122,41]],[[9398,9398],"mapped",[97]],[[9399,9399],"mapped",[98]],[[9400,9400],"mapped",[99]],[[9401,9401],"mapped",[100]],[[9402,9402],"mapped",[101]],[[9403,9403],"mapped",[102]],[[9404,9404],"mapped",[103]],[[9405,9405],"mapped",[104]],[[9406,9406],"mapped",[105]],[[9407,9407],"mapped",[106]],[[9408,9408],"mapped",[107]],[[9409,9409],"mapped",[108]],[[9410,9410],"mapped",[109]],[[9411,9411],"mapped",[110]],[[9412,9412],"mapped",[111]],[[9413,9413],"mapped",[112]],[[9414,9414],"mapped",[113]],[[9415,9415],"mapped",[114]],[[9416,9416],"mapped",[115]],[[9417,9417],"mapped",[116]],[[9418,9418],"mapped",[117]],[[9419,9419],"mapped",[118]],[[9420,9420],"mapped",[119]],[[9421,9421],"mapped",[120]],[[9422,9422],"mapped",[121]],[[9423,9423],"mapped",[122]],[[9424,9424],"mapped",[97]],[[9425,9425],"mapped",[98]],[[9426,9426],"mapped",[99]],[[9427,9427],"mapped",[100]],[[9428,9428],"mapped",[101]],[[9429,9429],"mapped",[102]],[[9430,9430],"mapped",[103]],[[9431,9431],"mapped",[104]],[[9432,9432],"mapped",[105]],[[9433,9433],"mapped",[106]],[[9434,9434],"mapped",[107]],[[9435,9435],"mapped",[108]],[[9436,9436],"mapped",[109]],[[9437,9437],"mapped",[110]],[[9438,9438],"mapped",[111]],[[9439,9439],"mapped",[112]],[[9440,9440],"mapped",[113]],[[9441,9441],"mapped",[114]],[[9442,9442],"mapped",[115]],[[9443,9443],"mapped",[116]],[[9444,9444],"mapped",[117]],[[9445,9445],"mapped",[118]],[[9446,9446],"mapped",[119]],[[9447,9447],"mapped",[120]],[[9448,9448],"mapped",[121]],[[9449,9449],"mapped",[122]],[[9450,9450],"mapped",[48]],[[9451,9470],"valid",[],"NV8"],[[9471,9471],"valid",[],"NV8"],[[9472,9621],"valid",[],"NV8"],[[9622,9631],"valid",[],"NV8"],[[9632,9711],"valid",[],"NV8"],[[9712,9719],"valid",[],"NV8"],[[9720,9727],"valid",[],"NV8"],[[9728,9747],"valid",[],"NV8"],[[9748,9749],"valid",[],"NV8"],[[9750,9751],"valid",[],"NV8"],[[9752,9752],"valid",[],"NV8"],[[9753,9753],"valid",[],"NV8"],[[9754,9839],"valid",[],"NV8"],[[9840,9841],"valid",[],"NV8"],[[9842,9853],"valid",[],"NV8"],[[9854,9855],"valid",[],"NV8"],[[9856,9865],"valid",[],"NV8"],[[9866,9873],"valid",[],"NV8"],[[9874,9884],"valid",[],"NV8"],[[9885,9885],"valid",[],"NV8"],[[9886,9887],"valid",[],"NV8"],[[9888,9889],"valid",[],"NV8"],[[9890,9905],"valid",[],"NV8"],[[9906,9906],"valid",[],"NV8"],[[9907,9916],"valid",[],"NV8"],[[9917,9919],"valid",[],"NV8"],[[9920,9923],"valid",[],"NV8"],[[9924,9933],"valid",[],"NV8"],[[9934,9934],"valid",[],"NV8"],[[9935,9953],"valid",[],"NV8"],[[9954,9954],"valid",[],"NV8"],[[9955,9955],"valid",[],"NV8"],[[9956,9959],"valid",[],"NV8"],[[9960,9983],"valid",[],"NV8"],[[9984,9984],"valid",[],"NV8"],[[9985,9988],"valid",[],"NV8"],[[9989,9989],"valid",[],"NV8"],[[9990,9993],"valid",[],"NV8"],[[9994,9995],"valid",[],"NV8"],[[9996,10023],"valid",[],"NV8"],[[10024,10024],"valid",[],"NV8"],[[10025,10059],"valid",[],"NV8"],[[10060,10060],"valid",[],"NV8"],[[10061,10061],"valid",[],"NV8"],[[10062,10062],"valid",[],"NV8"],[[10063,10066],"valid",[],"NV8"],[[10067,10069],"valid",[],"NV8"],[[10070,10070],"valid",[],"NV8"],[[10071,10071],"valid",[],"NV8"],[[10072,10078],"valid",[],"NV8"],[[10079,10080],"valid",[],"NV8"],[[10081,10087],"valid",[],"NV8"],[[10088,10101],"valid",[],"NV8"],[[10102,10132],"valid",[],"NV8"],[[10133,10135],"valid",[],"NV8"],[[10136,10159],"valid",[],"NV8"],[[10160,10160],"valid",[],"NV8"],[[10161,10174],"valid",[],"NV8"],[[10175,10175],"valid",[],"NV8"],[[10176,10182],"valid",[],"NV8"],[[10183,10186],"valid",[],"NV8"],[[10187,10187],"valid",[],"NV8"],[[10188,10188],"valid",[],"NV8"],[[10189,10189],"valid",[],"NV8"],[[10190,10191],"valid",[],"NV8"],[[10192,10219],"valid",[],"NV8"],[[10220,10223],"valid",[],"NV8"],[[10224,10239],"valid",[],"NV8"],[[10240,10495],"valid",[],"NV8"],[[10496,10763],"valid",[],"NV8"],[[10764,10764],"mapped",[8747,8747,8747,8747]],[[10765,10867],"valid",[],"NV8"],[[10868,10868],"disallowed_STD3_mapped",[58,58,61]],[[10869,10869],"disallowed_STD3_mapped",[61,61]],[[10870,10870],"disallowed_STD3_mapped",[61,61,61]],[[10871,10971],"valid",[],"NV8"],[[10972,10972],"mapped",[10973,824]],[[10973,11007],"valid",[],"NV8"],[[11008,11021],"valid",[],"NV8"],[[11022,11027],"valid",[],"NV8"],[[11028,11034],"valid",[],"NV8"],[[11035,11039],"valid",[],"NV8"],[[11040,11043],"valid",[],"NV8"],[[11044,11084],"valid",[],"NV8"],[[11085,11087],"valid",[],"NV8"],[[11088,11092],"valid",[],"NV8"],[[11093,11097],"valid",[],"NV8"],[[11098,11123],"valid",[],"NV8"],[[11124,11125],"disallowed"],[[11126,11157],"valid",[],"NV8"],[[11158,11159],"disallowed"],[[11160,11193],"valid",[],"NV8"],[[11194,11196],"disallowed"],[[11197,11208],"valid",[],"NV8"],[[11209,11209],"disallowed"],[[11210,11217],"valid",[],"NV8"],[[11218,11243],"disallowed"],[[11244,11247],"valid",[],"NV8"],[[11248,11263],"disallowed"],[[11264,11264],"mapped",[11312]],[[11265,11265],"mapped",[11313]],[[11266,11266],"mapped",[11314]],[[11267,11267],"mapped",[11315]],[[11268,11268],"mapped",[11316]],[[11269,11269],"mapped",[11317]],[[11270,11270],"mapped",[11318]],[[11271,11271],"mapped",[11319]],[[11272,11272],"mapped",[11320]],[[11273,11273],"mapped",[11321]],[[11274,11274],"mapped",[11322]],[[11275,11275],"mapped",[11323]],[[11276,11276],"mapped",[11324]],[[11277,11277],"mapped",[11325]],[[11278,11278],"mapped",[11326]],[[11279,11279],"mapped",[11327]],[[11280,11280],"mapped",[11328]],[[11281,11281],"mapped",[11329]],[[11282,11282],"mapped",[11330]],[[11283,11283],"mapped",[11331]],[[11284,11284],"mapped",[11332]],[[11285,11285],"mapped",[11333]],[[11286,11286],"mapped",[11334]],[[11287,11287],"mapped",[11335]],[[11288,11288],"mapped",[11336]],[[11289,11289],"mapped",[11337]],[[11290,11290],"mapped",[11338]],[[11291,11291],"mapped",[11339]],[[11292,11292],"mapped",[11340]],[[11293,11293],"mapped",[11341]],[[11294,11294],"mapped",[11342]],[[11295,11295],"mapped",[11343]],[[11296,11296],"mapped",[11344]],[[11297,11297],"mapped",[11345]],[[11298,11298],"mapped",[11346]],[[11299,11299],"mapped",[11347]],[[11300,11300],"mapped",[11348]],[[11301,11301],"mapped",[11349]],[[11302,11302],"mapped",[11350]],[[11303,11303],"mapped",[11351]],[[11304,11304],"mapped",[11352]],[[11305,11305],"mapped",[11353]],[[11306,11306],"mapped",[11354]],[[11307,11307],"mapped",[11355]],[[11308,11308],"mapped",[11356]],[[11309,11309],"mapped",[11357]],[[11310,11310],"mapped",[11358]],[[11311,11311],"disallowed"],[[11312,11358],"valid"],[[11359,11359],"disallowed"],[[11360,11360],"mapped",[11361]],[[11361,11361],"valid"],[[11362,11362],"mapped",[619]],[[11363,11363],"mapped",[7549]],[[11364,11364],"mapped",[637]],[[11365,11366],"valid"],[[11367,11367],"mapped",[11368]],[[11368,11368],"valid"],[[11369,11369],"mapped",[11370]],[[11370,11370],"valid"],[[11371,11371],"mapped",[11372]],[[11372,11372],"valid"],[[11373,11373],"mapped",[593]],[[11374,11374],"mapped",[625]],[[11375,11375],"mapped",[592]],[[11376,11376],"mapped",[594]],[[11377,11377],"valid"],[[11378,11378],"mapped",[11379]],[[11379,11379],"valid"],[[11380,11380],"valid"],[[11381,11381],"mapped",[11382]],[[11382,11383],"valid"],[[11384,11387],"valid"],[[11388,11388],"mapped",[106]],[[11389,11389],"mapped",[118]],[[11390,11390],"mapped",[575]],[[11391,11391],"mapped",[576]],[[11392,11392],"mapped",[11393]],[[11393,11393],"valid"],[[11394,11394],"mapped",[11395]],[[11395,11395],"valid"],[[11396,11396],"mapped",[11397]],[[11397,11397],"valid"],[[11398,11398],"mapped",[11399]],[[11399,11399],"valid"],[[11400,11400],"mapped",[11401]],[[11401,11401],"valid"],[[11402,11402],"mapped",[11403]],[[11403,11403],"valid"],[[11404,11404],"mapped",[11405]],[[11405,11405],"valid"],[[11406,11406],"mapped",[11407]],[[11407,11407],"valid"],[[11408,11408],"mapped",[11409]],[[11409,11409],"valid"],[[11410,11410],"mapped",[11411]],[[11411,11411],"valid"],[[11412,11412],"mapped",[11413]],[[11413,11413],"valid"],[[11414,11414],"mapped",[11415]],[[11415,11415],"valid"],[[11416,11416],"mapped",[11417]],[[11417,11417],"valid"],[[11418,11418],"mapped",[11419]],[[11419,11419],"valid"],[[11420,11420],"mapped",[11421]],[[11421,11421],"valid"],[[11422,11422],"mapped",[11423]],[[11423,11423],"valid"],[[11424,11424],"mapped",[11425]],[[11425,11425],"valid"],[[11426,11426],"mapped",[11427]],[[11427,11427],"valid"],[[11428,11428],"mapped",[11429]],[[11429,11429],"valid"],[[11430,11430],"mapped",[11431]],[[11431,11431],"valid"],[[11432,11432],"mapped",[11433]],[[11433,11433],"valid"],[[11434,11434],"mapped",[11435]],[[11435,11435],"valid"],[[11436,11436],"mapped",[11437]],[[11437,11437],"valid"],[[11438,11438],"mapped",[11439]],[[11439,11439],"valid"],[[11440,11440],"mapped",[11441]],[[11441,11441],"valid"],[[11442,11442],"mapped",[11443]],[[11443,11443],"valid"],[[11444,11444],"mapped",[11445]],[[11445,11445],"valid"],[[11446,11446],"mapped",[11447]],[[11447,11447],"valid"],[[11448,11448],"mapped",[11449]],[[11449,11449],"valid"],[[11450,11450],"mapped",[11451]],[[11451,11451],"valid"],[[11452,11452],"mapped",[11453]],[[11453,11453],"valid"],[[11454,11454],"mapped",[11455]],[[11455,11455],"valid"],[[11456,11456],"mapped",[11457]],[[11457,11457],"valid"],[[11458,11458],"mapped",[11459]],[[11459,11459],"valid"],[[11460,11460],"mapped",[11461]],[[11461,11461],"valid"],[[11462,11462],"mapped",[11463]],[[11463,11463],"valid"],[[11464,11464],"mapped",[11465]],[[11465,11465],"valid"],[[11466,11466],"mapped",[11467]],[[11467,11467],"valid"],[[11468,11468],"mapped",[11469]],[[11469,11469],"valid"],[[11470,11470],"mapped",[11471]],[[11471,11471],"valid"],[[11472,11472],"mapped",[11473]],[[11473,11473],"valid"],[[11474,11474],"mapped",[11475]],[[11475,11475],"valid"],[[11476,11476],"mapped",[11477]],[[11477,11477],"valid"],[[11478,11478],"mapped",[11479]],[[11479,11479],"valid"],[[11480,11480],"mapped",[11481]],[[11481,11481],"valid"],[[11482,11482],"mapped",[11483]],[[11483,11483],"valid"],[[11484,11484],"mapped",[11485]],[[11485,11485],"valid"],[[11486,11486],"mapped",[11487]],[[11487,11487],"valid"],[[11488,11488],"mapped",[11489]],[[11489,11489],"valid"],[[11490,11490],"mapped",[11491]],[[11491,11492],"valid"],[[11493,11498],"valid",[],"NV8"],[[11499,11499],"mapped",[11500]],[[11500,11500],"valid"],[[11501,11501],"mapped",[11502]],[[11502,11505],"valid"],[[11506,11506],"mapped",[11507]],[[11507,11507],"valid"],[[11508,11512],"disallowed"],[[11513,11519],"valid",[],"NV8"],[[11520,11557],"valid"],[[11558,11558],"disallowed"],[[11559,11559],"valid"],[[11560,11564],"disallowed"],[[11565,11565],"valid"],[[11566,11567],"disallowed"],[[11568,11621],"valid"],[[11622,11623],"valid"],[[11624,11630],"disallowed"],[[11631,11631],"mapped",[11617]],[[11632,11632],"valid",[],"NV8"],[[11633,11646],"disallowed"],[[11647,11647],"valid"],[[11648,11670],"valid"],[[11671,11679],"disallowed"],[[11680,11686],"valid"],[[11687,11687],"disallowed"],[[11688,11694],"valid"],[[11695,11695],"disallowed"],[[11696,11702],"valid"],[[11703,11703],"disallowed"],[[11704,11710],"valid"],[[11711,11711],"disallowed"],[[11712,11718],"valid"],[[11719,11719],"disallowed"],[[11720,11726],"valid"],[[11727,11727],"disallowed"],[[11728,11734],"valid"],[[11735,11735],"disallowed"],[[11736,11742],"valid"],[[11743,11743],"disallowed"],[[11744,11775],"valid"],[[11776,11799],"valid",[],"NV8"],[[11800,11803],"valid",[],"NV8"],[[11804,11805],"valid",[],"NV8"],[[11806,11822],"valid",[],"NV8"],[[11823,11823],"valid"],[[11824,11824],"valid",[],"NV8"],[[11825,11825],"valid",[],"NV8"],[[11826,11835],"valid",[],"NV8"],[[11836,11842],"valid",[],"NV8"],[[11843,11903],"disallowed"],[[11904,11929],"valid",[],"NV8"],[[11930,11930],"disallowed"],[[11931,11934],"valid",[],"NV8"],[[11935,11935],"mapped",[27597]],[[11936,12018],"valid",[],"NV8"],[[12019,12019],"mapped",[40863]],[[12020,12031],"disallowed"],[[12032,12032],"mapped",[19968]],[[12033,12033],"mapped",[20008]],[[12034,12034],"mapped",[20022]],[[12035,12035],"mapped",[20031]],[[12036,12036],"mapped",[20057]],[[12037,12037],"mapped",[20101]],[[12038,12038],"mapped",[20108]],[[12039,12039],"mapped",[20128]],[[12040,12040],"mapped",[20154]],[[12041,12041],"mapped",[20799]],[[12042,12042],"mapped",[20837]],[[12043,12043],"mapped",[20843]],[[12044,12044],"mapped",[20866]],[[12045,12045],"mapped",[20886]],[[12046,12046],"mapped",[20907]],[[12047,12047],"mapped",[20960]],[[12048,12048],"mapped",[20981]],[[12049,12049],"mapped",[20992]],[[12050,12050],"mapped",[21147]],[[12051,12051],"mapped",[21241]],[[12052,12052],"mapped",[21269]],[[12053,12053],"mapped",[21274]],[[12054,12054],"mapped",[21304]],[[12055,12055],"mapped",[21313]],[[12056,12056],"mapped",[21340]],[[12057,12057],"mapped",[21353]],[[12058,12058],"mapped",[21378]],[[12059,12059],"mapped",[21430]],[[12060,12060],"mapped",[21448]],[[12061,12061],"mapped",[21475]],[[12062,12062],"mapped",[22231]],[[12063,12063],"mapped",[22303]],[[12064,12064],"mapped",[22763]],[[12065,12065],"mapped",[22786]],[[12066,12066],"mapped",[22794]],[[12067,12067],"mapped",[22805]],[[12068,12068],"mapped",[22823]],[[12069,12069],"mapped",[22899]],[[12070,12070],"mapped",[23376]],[[12071,12071],"mapped",[23424]],[[12072,12072],"mapped",[23544]],[[12073,12073],"mapped",[23567]],[[12074,12074],"mapped",[23586]],[[12075,12075],"mapped",[23608]],[[12076,12076],"mapped",[23662]],[[12077,12077],"mapped",[23665]],[[12078,12078],"mapped",[24027]],[[12079,12079],"mapped",[24037]],[[12080,12080],"mapped",[24049]],[[12081,12081],"mapped",[24062]],[[12082,12082],"mapped",[24178]],[[12083,12083],"mapped",[24186]],[[12084,12084],"mapped",[24191]],[[12085,12085],"mapped",[24308]],[[12086,12086],"mapped",[24318]],[[12087,12087],"mapped",[24331]],[[12088,12088],"mapped",[24339]],[[12089,12089],"mapped",[24400]],[[12090,12090],"mapped",[24417]],[[12091,12091],"mapped",[24435]],[[12092,12092],"mapped",[24515]],[[12093,12093],"mapped",[25096]],[[12094,12094],"mapped",[25142]],[[12095,12095],"mapped",[25163]],[[12096,12096],"mapped",[25903]],[[12097,12097],"mapped",[25908]],[[12098,12098],"mapped",[25991]],[[12099,12099],"mapped",[26007]],[[12100,12100],"mapped",[26020]],[[12101,12101],"mapped",[26041]],[[12102,12102],"mapped",[26080]],[[12103,12103],"mapped",[26085]],[[12104,12104],"mapped",[26352]],[[12105,12105],"mapped",[26376]],[[12106,12106],"mapped",[26408]],[[12107,12107],"mapped",[27424]],[[12108,12108],"mapped",[27490]],[[12109,12109],"mapped",[27513]],[[12110,12110],"mapped",[27571]],[[12111,12111],"mapped",[27595]],[[12112,12112],"mapped",[27604]],[[12113,12113],"mapped",[27611]],[[12114,12114],"mapped",[27663]],[[12115,12115],"mapped",[27668]],[[12116,12116],"mapped",[27700]],[[12117,12117],"mapped",[28779]],[[12118,12118],"mapped",[29226]],[[12119,12119],"mapped",[29238]],[[12120,12120],"mapped",[29243]],[[12121,12121],"mapped",[29247]],[[12122,12122],"mapped",[29255]],[[12123,12123],"mapped",[29273]],[[12124,12124],"mapped",[29275]],[[12125,12125],"mapped",[29356]],[[12126,12126],"mapped",[29572]],[[12127,12127],"mapped",[29577]],[[12128,12128],"mapped",[29916]],[[12129,12129],"mapped",[29926]],[[12130,12130],"mapped",[29976]],[[12131,12131],"mapped",[29983]],[[12132,12132],"mapped",[29992]],[[12133,12133],"mapped",[30000]],[[12134,12134],"mapped",[30091]],[[12135,12135],"mapped",[30098]],[[12136,12136],"mapped",[30326]],[[12137,12137],"mapped",[30333]],[[12138,12138],"mapped",[30382]],[[12139,12139],"mapped",[30399]],[[12140,12140],"mapped",[30446]],[[12141,12141],"mapped",[30683]],[[12142,12142],"mapped",[30690]],[[12143,12143],"mapped",[30707]],[[12144,12144],"mapped",[31034]],[[12145,12145],"mapped",[31160]],[[12146,12146],"mapped",[31166]],[[12147,12147],"mapped",[31348]],[[12148,12148],"mapped",[31435]],[[12149,12149],"mapped",[31481]],[[12150,12150],"mapped",[31859]],[[12151,12151],"mapped",[31992]],[[12152,12152],"mapped",[32566]],[[12153,12153],"mapped",[32593]],[[12154,12154],"mapped",[32650]],[[12155,12155],"mapped",[32701]],[[12156,12156],"mapped",[32769]],[[12157,12157],"mapped",[32780]],[[12158,12158],"mapped",[32786]],[[12159,12159],"mapped",[32819]],[[12160,12160],"mapped",[32895]],[[12161,12161],"mapped",[32905]],[[12162,12162],"mapped",[33251]],[[12163,12163],"mapped",[33258]],[[12164,12164],"mapped",[33267]],[[12165,12165],"mapped",[33276]],[[12166,12166],"mapped",[33292]],[[12167,12167],"mapped",[33307]],[[12168,12168],"mapped",[33311]],[[12169,12169],"mapped",[33390]],[[12170,12170],"mapped",[33394]],[[12171,12171],"mapped",[33400]],[[12172,12172],"mapped",[34381]],[[12173,12173],"mapped",[34411]],[[12174,12174],"mapped",[34880]],[[12175,12175],"mapped",[34892]],[[12176,12176],"mapped",[34915]],[[12177,12177],"mapped",[35198]],[[12178,12178],"mapped",[35211]],[[12179,12179],"mapped",[35282]],[[12180,12180],"mapped",[35328]],[[12181,12181],"mapped",[35895]],[[12182,12182],"mapped",[35910]],[[12183,12183],"mapped",[35925]],[[12184,12184],"mapped",[35960]],[[12185,12185],"mapped",[35997]],[[12186,12186],"mapped",[36196]],[[12187,12187],"mapped",[36208]],[[12188,12188],"mapped",[36275]],[[12189,12189],"mapped",[36523]],[[12190,12190],"mapped",[36554]],[[12191,12191],"mapped",[36763]],[[12192,12192],"mapped",[36784]],[[12193,12193],"mapped",[36789]],[[12194,12194],"mapped",[37009]],[[12195,12195],"mapped",[37193]],[[12196,12196],"mapped",[37318]],[[12197,12197],"mapped",[37324]],[[12198,12198],"mapped",[37329]],[[12199,12199],"mapped",[38263]],[[12200,12200],"mapped",[38272]],[[12201,12201],"mapped",[38428]],[[12202,12202],"mapped",[38582]],[[12203,12203],"mapped",[38585]],[[12204,12204],"mapped",[38632]],[[12205,12205],"mapped",[38737]],[[12206,12206],"mapped",[38750]],[[12207,12207],"mapped",[38754]],[[12208,12208],"mapped",[38761]],[[12209,12209],"mapped",[38859]],[[12210,12210],"mapped",[38893]],[[12211,12211],"mapped",[38899]],[[12212,12212],"mapped",[38913]],[[12213,12213],"mapped",[39080]],[[12214,12214],"mapped",[39131]],[[12215,12215],"mapped",[39135]],[[12216,12216],"mapped",[39318]],[[12217,12217],"mapped",[39321]],[[12218,12218],"mapped",[39340]],[[12219,12219],"mapped",[39592]],[[12220,12220],"mapped",[39640]],[[12221,12221],"mapped",[39647]],[[12222,12222],"mapped",[39717]],[[12223,12223],"mapped",[39727]],[[12224,12224],"mapped",[39730]],[[12225,12225],"mapped",[39740]],[[12226,12226],"mapped",[39770]],[[12227,12227],"mapped",[40165]],[[12228,12228],"mapped",[40565]],[[12229,12229],"mapped",[40575]],[[12230,12230],"mapped",[40613]],[[12231,12231],"mapped",[40635]],[[12232,12232],"mapped",[40643]],[[12233,12233],"mapped",[40653]],[[12234,12234],"mapped",[40657]],[[12235,12235],"mapped",[40697]],[[12236,12236],"mapped",[40701]],[[12237,12237],"mapped",[40718]],[[12238,12238],"mapped",[40723]],[[12239,12239],"mapped",[40736]],[[12240,12240],"mapped",[40763]],[[12241,12241],"mapped",[40778]],[[12242,12242],"mapped",[40786]],[[12243,12243],"mapped",[40845]],[[12244,12244],"mapped",[40860]],[[12245,12245],"mapped",[40864]],[[12246,12271],"disallowed"],[[12272,12283],"disallowed"],[[12284,12287],"disallowed"],[[12288,12288],"disallowed_STD3_mapped",[32]],[[12289,12289],"valid",[],"NV8"],[[12290,12290],"mapped",[46]],[[12291,12292],"valid",[],"NV8"],[[12293,12295],"valid"],[[12296,12329],"valid",[],"NV8"],[[12330,12333],"valid"],[[12334,12341],"valid",[],"NV8"],[[12342,12342],"mapped",[12306]],[[12343,12343],"valid",[],"NV8"],[[12344,12344],"mapped",[21313]],[[12345,12345],"mapped",[21316]],[[12346,12346],"mapped",[21317]],[[12347,12347],"valid",[],"NV8"],[[12348,12348],"valid"],[[12349,12349],"valid",[],"NV8"],[[12350,12350],"valid",[],"NV8"],[[12351,12351],"valid",[],"NV8"],[[12352,12352],"disallowed"],[[12353,12436],"valid"],[[12437,12438],"valid"],[[12439,12440],"disallowed"],[[12441,12442],"valid"],[[12443,12443],"disallowed_STD3_mapped",[32,12441]],[[12444,12444],"disallowed_STD3_mapped",[32,12442]],[[12445,12446],"valid"],[[12447,12447],"mapped",[12424,12426]],[[12448,12448],"valid",[],"NV8"],[[12449,12542],"valid"],[[12543,12543],"mapped",[12467,12488]],[[12544,12548],"disallowed"],[[12549,12588],"valid"],[[12589,12589],"valid"],[[12590,12592],"disallowed"],[[12593,12593],"mapped",[4352]],[[12594,12594],"mapped",[4353]],[[12595,12595],"mapped",[4522]],[[12596,12596],"mapped",[4354]],[[12597,12597],"mapped",[4524]],[[12598,12598],"mapped",[4525]],[[12599,12599],"mapped",[4355]],[[12600,12600],"mapped",[4356]],[[12601,12601],"mapped",[4357]],[[12602,12602],"mapped",[4528]],[[12603,12603],"mapped",[4529]],[[12604,12604],"mapped",[4530]],[[12605,12605],"mapped",[4531]],[[12606,12606],"mapped",[4532]],[[12607,12607],"mapped",[4533]],[[12608,12608],"mapped",[4378]],[[12609,12609],"mapped",[4358]],[[12610,12610],"mapped",[4359]],[[12611,12611],"mapped",[4360]],[[12612,12612],"mapped",[4385]],[[12613,12613],"mapped",[4361]],[[12614,12614],"mapped",[4362]],[[12615,12615],"mapped",[4363]],[[12616,12616],"mapped",[4364]],[[12617,12617],"mapped",[4365]],[[12618,12618],"mapped",[4366]],[[12619,12619],"mapped",[4367]],[[12620,12620],"mapped",[4368]],[[12621,12621],"mapped",[4369]],[[12622,12622],"mapped",[4370]],[[12623,12623],"mapped",[4449]],[[12624,12624],"mapped",[4450]],[[12625,12625],"mapped",[4451]],[[12626,12626],"mapped",[4452]],[[12627,12627],"mapped",[4453]],[[12628,12628],"mapped",[4454]],[[12629,12629],"mapped",[4455]],[[12630,12630],"mapped",[4456]],[[12631,12631],"mapped",[4457]],[[12632,12632],"mapped",[4458]],[[12633,12633],"mapped",[4459]],[[12634,12634],"mapped",[4460]],[[12635,12635],"mapped",[4461]],[[12636,12636],"mapped",[4462]],[[12637,12637],"mapped",[4463]],[[12638,12638],"mapped",[4464]],[[12639,12639],"mapped",[4465]],[[12640,12640],"mapped",[4466]],[[12641,12641],"mapped",[4467]],[[12642,12642],"mapped",[4468]],[[12643,12643],"mapped",[4469]],[[12644,12644],"disallowed"],[[12645,12645],"mapped",[4372]],[[12646,12646],"mapped",[4373]],[[12647,12647],"mapped",[4551]],[[12648,12648],"mapped",[4552]],[[12649,12649],"mapped",[4556]],[[12650,12650],"mapped",[4558]],[[12651,12651],"mapped",[4563]],[[12652,12652],"mapped",[4567]],[[12653,12653],"mapped",[4569]],[[12654,12654],"mapped",[4380]],[[12655,12655],"mapped",[4573]],[[12656,12656],"mapped",[4575]],[[12657,12657],"mapped",[4381]],[[12658,12658],"mapped",[4382]],[[12659,12659],"mapped",[4384]],[[12660,12660],"mapped",[4386]],[[12661,12661],"mapped",[4387]],[[12662,12662],"mapped",[4391]],[[12663,12663],"mapped",[4393]],[[12664,12664],"mapped",[4395]],[[12665,12665],"mapped",[4396]],[[12666,12666],"mapped",[4397]],[[12667,12667],"mapped",[4398]],[[12668,12668],"mapped",[4399]],[[12669,12669],"mapped",[4402]],[[12670,12670],"mapped",[4406]],[[12671,12671],"mapped",[4416]],[[12672,12672],"mapped",[4423]],[[12673,12673],"mapped",[4428]],[[12674,12674],"mapped",[4593]],[[12675,12675],"mapped",[4594]],[[12676,12676],"mapped",[4439]],[[12677,12677],"mapped",[4440]],[[12678,12678],"mapped",[4441]],[[12679,12679],"mapped",[4484]],[[12680,12680],"mapped",[4485]],[[12681,12681],"mapped",[4488]],[[12682,12682],"mapped",[4497]],[[12683,12683],"mapped",[4498]],[[12684,12684],"mapped",[4500]],[[12685,12685],"mapped",[4510]],[[12686,12686],"mapped",[4513]],[[12687,12687],"disallowed"],[[12688,12689],"valid",[],"NV8"],[[12690,12690],"mapped",[19968]],[[12691,12691],"mapped",[20108]],[[12692,12692],"mapped",[19977]],[[12693,12693],"mapped",[22235]],[[12694,12694],"mapped",[19978]],[[12695,12695],"mapped",[20013]],[[12696,12696],"mapped",[19979]],[[12697,12697],"mapped",[30002]],[[12698,12698],"mapped",[20057]],[[12699,12699],"mapped",[19993]],[[12700,12700],"mapped",[19969]],[[12701,12701],"mapped",[22825]],[[12702,12702],"mapped",[22320]],[[12703,12703],"mapped",[20154]],[[12704,12727],"valid"],[[12728,12730],"valid"],[[12731,12735],"disallowed"],[[12736,12751],"valid",[],"NV8"],[[12752,12771],"valid",[],"NV8"],[[12772,12783],"disallowed"],[[12784,12799],"valid"],[[12800,12800],"disallowed_STD3_mapped",[40,4352,41]],[[12801,12801],"disallowed_STD3_mapped",[40,4354,41]],[[12802,12802],"disallowed_STD3_mapped",[40,4355,41]],[[12803,12803],"disallowed_STD3_mapped",[40,4357,41]],[[12804,12804],"disallowed_STD3_mapped",[40,4358,41]],[[12805,12805],"disallowed_STD3_mapped",[40,4359,41]],[[12806,12806],"disallowed_STD3_mapped",[40,4361,41]],[[12807,12807],"disallowed_STD3_mapped",[40,4363,41]],[[12808,12808],"disallowed_STD3_mapped",[40,4364,41]],[[12809,12809],"disallowed_STD3_mapped",[40,4366,41]],[[12810,12810],"disallowed_STD3_mapped",[40,4367,41]],[[12811,12811],"disallowed_STD3_mapped",[40,4368,41]],[[12812,12812],"disallowed_STD3_mapped",[40,4369,41]],[[12813,12813],"disallowed_STD3_mapped",[40,4370,41]],[[12814,12814],"disallowed_STD3_mapped",[40,44032,41]],[[12815,12815],"disallowed_STD3_mapped",[40,45208,41]],[[12816,12816],"disallowed_STD3_mapped",[40,45796,41]],[[12817,12817],"disallowed_STD3_mapped",[40,46972,41]],[[12818,12818],"disallowed_STD3_mapped",[40,47560,41]],[[12819,12819],"disallowed_STD3_mapped",[40,48148,41]],[[12820,12820],"disallowed_STD3_mapped",[40,49324,41]],[[12821,12821],"disallowed_STD3_mapped",[40,50500,41]],[[12822,12822],"disallowed_STD3_mapped",[40,51088,41]],[[12823,12823],"disallowed_STD3_mapped",[40,52264,41]],[[12824,12824],"disallowed_STD3_mapped",[40,52852,41]],[[12825,12825],"disallowed_STD3_mapped",[40,53440,41]],[[12826,12826],"disallowed_STD3_mapped",[40,54028,41]],[[12827,12827],"disallowed_STD3_mapped",[40,54616,41]],[[12828,12828],"disallowed_STD3_mapped",[40,51452,41]],[[12829,12829],"disallowed_STD3_mapped",[40,50724,51204,41]],[[12830,12830],"disallowed_STD3_mapped",[40,50724,54980,41]],[[12831,12831],"disallowed"],[[12832,12832],"disallowed_STD3_mapped",[40,19968,41]],[[12833,12833],"disallowed_STD3_mapped",[40,20108,41]],[[12834,12834],"disallowed_STD3_mapped",[40,19977,41]],[[12835,12835],"disallowed_STD3_mapped",[40,22235,41]],[[12836,12836],"disallowed_STD3_mapped",[40,20116,41]],[[12837,12837],"disallowed_STD3_mapped",[40,20845,41]],[[12838,12838],"disallowed_STD3_mapped",[40,19971,41]],[[12839,12839],"disallowed_STD3_mapped",[40,20843,41]],[[12840,12840],"disallowed_STD3_mapped",[40,20061,41]],[[12841,12841],"disallowed_STD3_mapped",[40,21313,41]],[[12842,12842],"disallowed_STD3_mapped",[40,26376,41]],[[12843,12843],"disallowed_STD3_mapped",[40,28779,41]],[[12844,12844],"disallowed_STD3_mapped",[40,27700,41]],[[12845,12845],"disallowed_STD3_mapped",[40,26408,41]],[[12846,12846],"disallowed_STD3_mapped",[40,37329,41]],[[12847,12847],"disallowed_STD3_mapped",[40,22303,41]],[[12848,12848],"disallowed_STD3_mapped",[40,26085,41]],[[12849,12849],"disallowed_STD3_mapped",[40,26666,41]],[[12850,12850],"disallowed_STD3_mapped",[40,26377,41]],[[12851,12851],"disallowed_STD3_mapped",[40,31038,41]],[[12852,12852],"disallowed_STD3_mapped",[40,21517,41]],[[12853,12853],"disallowed_STD3_mapped",[40,29305,41]],[[12854,12854],"disallowed_STD3_mapped",[40,36001,41]],[[12855,12855],"disallowed_STD3_mapped",[40,31069,41]],[[12856,12856],"disallowed_STD3_mapped",[40,21172,41]],[[12857,12857],"disallowed_STD3_mapped",[40,20195,41]],[[12858,12858],"disallowed_STD3_mapped",[40,21628,41]],[[12859,12859],"disallowed_STD3_mapped",[40,23398,41]],[[12860,12860],"disallowed_STD3_mapped",[40,30435,41]],[[12861,12861],"disallowed_STD3_mapped",[40,20225,41]],[[12862,12862],"disallowed_STD3_mapped",[40,36039,41]],[[12863,12863],"disallowed_STD3_mapped",[40,21332,41]],[[12864,12864],"disallowed_STD3_mapped",[40,31085,41]],[[12865,12865],"disallowed_STD3_mapped",[40,20241,41]],[[12866,12866],"disallowed_STD3_mapped",[40,33258,41]],[[12867,12867],"disallowed_STD3_mapped",[40,33267,41]],[[12868,12868],"mapped",[21839]],[[12869,12869],"mapped",[24188]],[[12870,12870],"mapped",[25991]],[[12871,12871],"mapped",[31631]],[[12872,12879],"valid",[],"NV8"],[[12880,12880],"mapped",[112,116,101]],[[12881,12881],"mapped",[50,49]],[[12882,12882],"mapped",[50,50]],[[12883,12883],"mapped",[50,51]],[[12884,12884],"mapped",[50,52]],[[12885,12885],"mapped",[50,53]],[[12886,12886],"mapped",[50,54]],[[12887,12887],"mapped",[50,55]],[[12888,12888],"mapped",[50,56]],[[12889,12889],"mapped",[50,57]],[[12890,12890],"mapped",[51,48]],[[12891,12891],"mapped",[51,49]],[[12892,12892],"mapped",[51,50]],[[12893,12893],"mapped",[51,51]],[[12894,12894],"mapped",[51,52]],[[12895,12895],"mapped",[51,53]],[[12896,12896],"mapped",[4352]],[[12897,12897],"mapped",[4354]],[[12898,12898],"mapped",[4355]],[[12899,12899],"mapped",[4357]],[[12900,12900],"mapped",[4358]],[[12901,12901],"mapped",[4359]],[[12902,12902],"mapped",[4361]],[[12903,12903],"mapped",[4363]],[[12904,12904],"mapped",[4364]],[[12905,12905],"mapped",[4366]],[[12906,12906],"mapped",[4367]],[[12907,12907],"mapped",[4368]],[[12908,12908],"mapped",[4369]],[[12909,12909],"mapped",[4370]],[[12910,12910],"mapped",[44032]],[[12911,12911],"mapped",[45208]],[[12912,12912],"mapped",[45796]],[[12913,12913],"mapped",[46972]],[[12914,12914],"mapped",[47560]],[[12915,12915],"mapped",[48148]],[[12916,12916],"mapped",[49324]],[[12917,12917],"mapped",[50500]],[[12918,12918],"mapped",[51088]],[[12919,12919],"mapped",[52264]],[[12920,12920],"mapped",[52852]],[[12921,12921],"mapped",[53440]],[[12922,12922],"mapped",[54028]],[[12923,12923],"mapped",[54616]],[[12924,12924],"mapped",[52280,44256]],[[12925,12925],"mapped",[51452,51032]],[[12926,12926],"mapped",[50864]],[[12927,12927],"valid",[],"NV8"],[[12928,12928],"mapped",[19968]],[[12929,12929],"mapped",[20108]],[[12930,12930],"mapped",[19977]],[[12931,12931],"mapped",[22235]],[[12932,12932],"mapped",[20116]],[[12933,12933],"mapped",[20845]],[[12934,12934],"mapped",[19971]],[[12935,12935],"mapped",[20843]],[[12936,12936],"mapped",[20061]],[[12937,12937],"mapped",[21313]],[[12938,12938],"mapped",[26376]],[[12939,12939],"mapped",[28779]],[[12940,12940],"mapped",[27700]],[[12941,12941],"mapped",[26408]],[[12942,12942],"mapped",[37329]],[[12943,12943],"mapped",[22303]],[[12944,12944],"mapped",[26085]],[[12945,12945],"mapped",[26666]],[[12946,12946],"mapped",[26377]],[[12947,12947],"mapped",[31038]],[[12948,12948],"mapped",[21517]],[[12949,12949],"mapped",[29305]],[[12950,12950],"mapped",[36001]],[[12951,12951],"mapped",[31069]],[[12952,12952],"mapped",[21172]],[[12953,12953],"mapped",[31192]],[[12954,12954],"mapped",[30007]],[[12955,12955],"mapped",[22899]],[[12956,12956],"mapped",[36969]],[[12957,12957],"mapped",[20778]],[[12958,12958],"mapped",[21360]],[[12959,12959],"mapped",[27880]],[[12960,12960],"mapped",[38917]],[[12961,12961],"mapped",[20241]],[[12962,12962],"mapped",[20889]],[[12963,12963],"mapped",[27491]],[[12964,12964],"mapped",[19978]],[[12965,12965],"mapped",[20013]],[[12966,12966],"mapped",[19979]],[[12967,12967],"mapped",[24038]],[[12968,12968],"mapped",[21491]],[[12969,12969],"mapped",[21307]],[[12970,12970],"mapped",[23447]],[[12971,12971],"mapped",[23398]],[[12972,12972],"mapped",[30435]],[[12973,12973],"mapped",[20225]],[[12974,12974],"mapped",[36039]],[[12975,12975],"mapped",[21332]],[[12976,12976],"mapped",[22812]],[[12977,12977],"mapped",[51,54]],[[12978,12978],"mapped",[51,55]],[[12979,12979],"mapped",[51,56]],[[12980,12980],"mapped",[51,57]],[[12981,12981],"mapped",[52,48]],[[12982,12982],"mapped",[52,49]],[[12983,12983],"mapped",[52,50]],[[12984,12984],"mapped",[52,51]],[[12985,12985],"mapped",[52,52]],[[12986,12986],"mapped",[52,53]],[[12987,12987],"mapped",[52,54]],[[12988,12988],"mapped",[52,55]],[[12989,12989],"mapped",[52,56]],[[12990,12990],"mapped",[52,57]],[[12991,12991],"mapped",[53,48]],[[12992,12992],"mapped",[49,26376]],[[12993,12993],"mapped",[50,26376]],[[12994,12994],"mapped",[51,26376]],[[12995,12995],"mapped",[52,26376]],[[12996,12996],"mapped",[53,26376]],[[12997,12997],"mapped",[54,26376]],[[12998,12998],"mapped",[55,26376]],[[12999,12999],"mapped",[56,26376]],[[13000,13000],"mapped",[57,26376]],[[13001,13001],"mapped",[49,48,26376]],[[13002,13002],"mapped",[49,49,26376]],[[13003,13003],"mapped",[49,50,26376]],[[13004,13004],"mapped",[104,103]],[[13005,13005],"mapped",[101,114,103]],[[13006,13006],"mapped",[101,118]],[[13007,13007],"mapped",[108,116,100]],[[13008,13008],"mapped",[12450]],[[13009,13009],"mapped",[12452]],[[13010,13010],"mapped",[12454]],[[13011,13011],"mapped",[12456]],[[13012,13012],"mapped",[12458]],[[13013,13013],"mapped",[12459]],[[13014,13014],"mapped",[12461]],[[13015,13015],"mapped",[12463]],[[13016,13016],"mapped",[12465]],[[13017,13017],"mapped",[12467]],[[13018,13018],"mapped",[12469]],[[13019,13019],"mapped",[12471]],[[13020,13020],"mapped",[12473]],[[13021,13021],"mapped",[12475]],[[13022,13022],"mapped",[12477]],[[13023,13023],"mapped",[12479]],[[13024,13024],"mapped",[12481]],[[13025,13025],"mapped",[12484]],[[13026,13026],"mapped",[12486]],[[13027,13027],"mapped",[12488]],[[13028,13028],"mapped",[12490]],[[13029,13029],"mapped",[12491]],[[13030,13030],"mapped",[12492]],[[13031,13031],"mapped",[12493]],[[13032,13032],"mapped",[12494]],[[13033,13033],"mapped",[12495]],[[13034,13034],"mapped",[12498]],[[13035,13035],"mapped",[12501]],[[13036,13036],"mapped",[12504]],[[13037,13037],"mapped",[12507]],[[13038,13038],"mapped",[12510]],[[13039,13039],"mapped",[12511]],[[13040,13040],"mapped",[12512]],[[13041,13041],"mapped",[12513]],[[13042,13042],"mapped",[12514]],[[13043,13043],"mapped",[12516]],[[13044,13044],"mapped",[12518]],[[13045,13045],"mapped",[12520]],[[13046,13046],"mapped",[12521]],[[13047,13047],"mapped",[12522]],[[13048,13048],"mapped",[12523]],[[13049,13049],"mapped",[12524]],[[13050,13050],"mapped",[12525]],[[13051,13051],"mapped",[12527]],[[13052,13052],"mapped",[12528]],[[13053,13053],"mapped",[12529]],[[13054,13054],"mapped",[12530]],[[13055,13055],"disallowed"],[[13056,13056],"mapped",[12450,12497,12540,12488]],[[13057,13057],"mapped",[12450,12523,12501,12449]],[[13058,13058],"mapped",[12450,12531,12506,12450]],[[13059,13059],"mapped",[12450,12540,12523]],[[13060,13060],"mapped",[12452,12491,12531,12464]],[[13061,13061],"mapped",[12452,12531,12481]],[[13062,13062],"mapped",[12454,12457,12531]],[[13063,13063],"mapped",[12456,12473,12463,12540,12489]],[[13064,13064],"mapped",[12456,12540,12459,12540]],[[13065,13065],"mapped",[12458,12531,12473]],[[13066,13066],"mapped",[12458,12540,12512]],[[13067,13067],"mapped",[12459,12452,12522]],[[13068,13068],"mapped",[12459,12521,12483,12488]],[[13069,13069],"mapped",[12459,12525,12522,12540]],[[13070,13070],"mapped",[12460,12525,12531]],[[13071,13071],"mapped",[12460,12531,12510]],[[13072,13072],"mapped",[12462,12460]],[[13073,13073],"mapped",[12462,12491,12540]],[[13074,13074],"mapped",[12461,12517,12522,12540]],[[13075,13075],"mapped",[12462,12523,12480,12540]],[[13076,13076],"mapped",[12461,12525]],[[13077,13077],"mapped",[12461,12525,12464,12521,12512]],[[13078,13078],"mapped",[12461,12525,12513,12540,12488,12523]],[[13079,13079],"mapped",[12461,12525,12527,12483,12488]],[[13080,13080],"mapped",[12464,12521,12512]],[[13081,13081],"mapped",[12464,12521,12512,12488,12531]],[[13082,13082],"mapped",[12463,12523,12476,12452,12525]],[[13083,13083],"mapped",[12463,12525,12540,12493]],[[13084,13084],"mapped",[12465,12540,12473]],[[13085,13085],"mapped",[12467,12523,12490]],[[13086,13086],"mapped",[12467,12540,12509]],[[13087,13087],"mapped",[12469,12452,12463,12523]],[[13088,13088],"mapped",[12469,12531,12481,12540,12512]],[[13089,13089],"mapped",[12471,12522,12531,12464]],[[13090,13090],"mapped",[12475,12531,12481]],[[13091,13091],"mapped",[12475,12531,12488]],[[13092,13092],"mapped",[12480,12540,12473]],[[13093,13093],"mapped",[12487,12471]],[[13094,13094],"mapped",[12489,12523]],[[13095,13095],"mapped",[12488,12531]],[[13096,13096],"mapped",[12490,12494]],[[13097,13097],"mapped",[12494,12483,12488]],[[13098,13098],"mapped",[12495,12452,12484]],[[13099,13099],"mapped",[12497,12540,12475,12531,12488]],[[13100,13100],"mapped",[12497,12540,12484]],[[13101,13101],"mapped",[12496,12540,12524,12523]],[[13102,13102],"mapped",[12500,12450,12473,12488,12523]],[[13103,13103],"mapped",[12500,12463,12523]],[[13104,13104],"mapped",[12500,12467]],[[13105,13105],"mapped",[12499,12523]],[[13106,13106],"mapped",[12501,12449,12521,12483,12489]],[[13107,13107],"mapped",[12501,12451,12540,12488]],[[13108,13108],"mapped",[12502,12483,12471,12455,12523]],[[13109,13109],"mapped",[12501,12521,12531]],[[13110,13110],"mapped",[12504,12463,12479,12540,12523]],[[13111,13111],"mapped",[12506,12477]],[[13112,13112],"mapped",[12506,12491,12498]],[[13113,13113],"mapped",[12504,12523,12484]],[[13114,13114],"mapped",[12506,12531,12473]],[[13115,13115],"mapped",[12506,12540,12472]],[[13116,13116],"mapped",[12505,12540,12479]],[[13117,13117],"mapped",[12509,12452,12531,12488]],[[13118,13118],"mapped",[12508,12523,12488]],[[13119,13119],"mapped",[12507,12531]],[[13120,13120],"mapped",[12509,12531,12489]],[[13121,13121],"mapped",[12507,12540,12523]],[[13122,13122],"mapped",[12507,12540,12531]],[[13123,13123],"mapped",[12510,12452,12463,12525]],[[13124,13124],"mapped",[12510,12452,12523]],[[13125,13125],"mapped",[12510,12483,12495]],[[13126,13126],"mapped",[12510,12523,12463]],[[13127,13127],"mapped",[12510,12531,12471,12519,12531]],[[13128,13128],"mapped",[12511,12463,12525,12531]],[[13129,13129],"mapped",[12511,12522]],[[13130,13130],"mapped",[12511,12522,12496,12540,12523]],[[13131,13131],"mapped",[12513,12460]],[[13132,13132],"mapped",[12513,12460,12488,12531]],[[13133,13133],"mapped",[12513,12540,12488,12523]],[[13134,13134],"mapped",[12516,12540,12489]],[[13135,13135],"mapped",[12516,12540,12523]],[[13136,13136],"mapped",[12518,12450,12531]],[[13137,13137],"mapped",[12522,12483,12488,12523]],[[13138,13138],"mapped",[12522,12521]],[[13139,13139],"mapped",[12523,12500,12540]],[[13140,13140],"mapped",[12523,12540,12502,12523]],[[13141,13141],"mapped",[12524,12512]],[[13142,13142],"mapped",[12524,12531,12488,12466,12531]],[[13143,13143],"mapped",[12527,12483,12488]],[[13144,13144],"mapped",[48,28857]],[[13145,13145],"mapped",[49,28857]],[[13146,13146],"mapped",[50,28857]],[[13147,13147],"mapped",[51,28857]],[[13148,13148],"mapped",[52,28857]],[[13149,13149],"mapped",[53,28857]],[[13150,13150],"mapped",[54,28857]],[[13151,13151],"mapped",[55,28857]],[[13152,13152],"mapped",[56,28857]],[[13153,13153],"mapped",[57,28857]],[[13154,13154],"mapped",[49,48,28857]],[[13155,13155],"mapped",[49,49,28857]],[[13156,13156],"mapped",[49,50,28857]],[[13157,13157],"mapped",[49,51,28857]],[[13158,13158],"mapped",[49,52,28857]],[[13159,13159],"mapped",[49,53,28857]],[[13160,13160],"mapped",[49,54,28857]],[[13161,13161],"mapped",[49,55,28857]],[[13162,13162],"mapped",[49,56,28857]],[[13163,13163],"mapped",[49,57,28857]],[[13164,13164],"mapped",[50,48,28857]],[[13165,13165],"mapped",[50,49,28857]],[[13166,13166],"mapped",[50,50,28857]],[[13167,13167],"mapped",[50,51,28857]],[[13168,13168],"mapped",[50,52,28857]],[[13169,13169],"mapped",[104,112,97]],[[13170,13170],"mapped",[100,97]],[[13171,13171],"mapped",[97,117]],[[13172,13172],"mapped",[98,97,114]],[[13173,13173],"mapped",[111,118]],[[13174,13174],"mapped",[112,99]],[[13175,13175],"mapped",[100,109]],[[13176,13176],"mapped",[100,109,50]],[[13177,13177],"mapped",[100,109,51]],[[13178,13178],"mapped",[105,117]],[[13179,13179],"mapped",[24179,25104]],[[13180,13180],"mapped",[26157,21644]],[[13181,13181],"mapped",[22823,27491]],[[13182,13182],"mapped",[26126,27835]],[[13183,13183],"mapped",[26666,24335,20250,31038]],[[13184,13184],"mapped",[112,97]],[[13185,13185],"mapped",[110,97]],[[13186,13186],"mapped",[956,97]],[[13187,13187],"mapped",[109,97]],[[13188,13188],"mapped",[107,97]],[[13189,13189],"mapped",[107,98]],[[13190,13190],"mapped",[109,98]],[[13191,13191],"mapped",[103,98]],[[13192,13192],"mapped",[99,97,108]],[[13193,13193],"mapped",[107,99,97,108]],[[13194,13194],"mapped",[112,102]],[[13195,13195],"mapped",[110,102]],[[13196,13196],"mapped",[956,102]],[[13197,13197],"mapped",[956,103]],[[13198,13198],"mapped",[109,103]],[[13199,13199],"mapped",[107,103]],[[13200,13200],"mapped",[104,122]],[[13201,13201],"mapped",[107,104,122]],[[13202,13202],"mapped",[109,104,122]],[[13203,13203],"mapped",[103,104,122]],[[13204,13204],"mapped",[116,104,122]],[[13205,13205],"mapped",[956,108]],[[13206,13206],"mapped",[109,108]],[[13207,13207],"mapped",[100,108]],[[13208,13208],"mapped",[107,108]],[[13209,13209],"mapped",[102,109]],[[13210,13210],"mapped",[110,109]],[[13211,13211],"mapped",[956,109]],[[13212,13212],"mapped",[109,109]],[[13213,13213],"mapped",[99,109]],[[13214,13214],"mapped",[107,109]],[[13215,13215],"mapped",[109,109,50]],[[13216,13216],"mapped",[99,109,50]],[[13217,13217],"mapped",[109,50]],[[13218,13218],"mapped",[107,109,50]],[[13219,13219],"mapped",[109,109,51]],[[13220,13220],"mapped",[99,109,51]],[[13221,13221],"mapped",[109,51]],[[13222,13222],"mapped",[107,109,51]],[[13223,13223],"mapped",[109,8725,115]],[[13224,13224],"mapped",[109,8725,115,50]],[[13225,13225],"mapped",[112,97]],[[13226,13226],"mapped",[107,112,97]],[[13227,13227],"mapped",[109,112,97]],[[13228,13228],"mapped",[103,112,97]],[[13229,13229],"mapped",[114,97,100]],[[13230,13230],"mapped",[114,97,100,8725,115]],[[13231,13231],"mapped",[114,97,100,8725,115,50]],[[13232,13232],"mapped",[112,115]],[[13233,13233],"mapped",[110,115]],[[13234,13234],"mapped",[956,115]],[[13235,13235],"mapped",[109,115]],[[13236,13236],"mapped",[112,118]],[[13237,13237],"mapped",[110,118]],[[13238,13238],"mapped",[956,118]],[[13239,13239],"mapped",[109,118]],[[13240,13240],"mapped",[107,118]],[[13241,13241],"mapped",[109,118]],[[13242,13242],"mapped",[112,119]],[[13243,13243],"mapped",[110,119]],[[13244,13244],"mapped",[956,119]],[[13245,13245],"mapped",[109,119]],[[13246,13246],"mapped",[107,119]],[[13247,13247],"mapped",[109,119]],[[13248,13248],"mapped",[107,969]],[[13249,13249],"mapped",[109,969]],[[13250,13250],"disallowed"],[[13251,13251],"mapped",[98,113]],[[13252,13252],"mapped",[99,99]],[[13253,13253],"mapped",[99,100]],[[13254,13254],"mapped",[99,8725,107,103]],[[13255,13255],"disallowed"],[[13256,13256],"mapped",[100,98]],[[13257,13257],"mapped",[103,121]],[[13258,13258],"mapped",[104,97]],[[13259,13259],"mapped",[104,112]],[[13260,13260],"mapped",[105,110]],[[13261,13261],"mapped",[107,107]],[[13262,13262],"mapped",[107,109]],[[13263,13263],"mapped",[107,116]],[[13264,13264],"mapped",[108,109]],[[13265,13265],"mapped",[108,110]],[[13266,13266],"mapped",[108,111,103]],[[13267,13267],"mapped",[108,120]],[[13268,13268],"mapped",[109,98]],[[13269,13269],"mapped",[109,105,108]],[[13270,13270],"mapped",[109,111,108]],[[13271,13271],"mapped",[112,104]],[[13272,13272],"disallowed"],[[13273,13273],"mapped",[112,112,109]],[[13274,13274],"mapped",[112,114]],[[13275,13275],"mapped",[115,114]],[[13276,13276],"mapped",[115,118]],[[13277,13277],"mapped",[119,98]],[[13278,13278],"mapped",[118,8725,109]],[[13279,13279],"mapped",[97,8725,109]],[[13280,13280],"mapped",[49,26085]],[[13281,13281],"mapped",[50,26085]],[[13282,13282],"mapped",[51,26085]],[[13283,13283],"mapped",[52,26085]],[[13284,13284],"mapped",[53,26085]],[[13285,13285],"mapped",[54,26085]],[[13286,13286],"mapped",[55,26085]],[[13287,13287],"mapped",[56,26085]],[[13288,13288],"mapped",[57,26085]],[[13289,13289],"mapped",[49,48,26085]],[[13290,13290],"mapped",[49,49,26085]],[[13291,13291],"mapped",[49,50,26085]],[[13292,13292],"mapped",[49,51,26085]],[[13293,13293],"mapped",[49,52,26085]],[[13294,13294],"mapped",[49,53,26085]],[[13295,13295],"mapped",[49,54,26085]],[[13296,13296],"mapped",[49,55,26085]],[[13297,13297],"mapped",[49,56,26085]],[[13298,13298],"mapped",[49,57,26085]],[[13299,13299],"mapped",[50,48,26085]],[[13300,13300],"mapped",[50,49,26085]],[[13301,13301],"mapped",[50,50,26085]],[[13302,13302],"mapped",[50,51,26085]],[[13303,13303],"mapped",[50,52,26085]],[[13304,13304],"mapped",[50,53,26085]],[[13305,13305],"mapped",[50,54,26085]],[[13306,13306],"mapped",[50,55,26085]],[[13307,13307],"mapped",[50,56,26085]],[[13308,13308],"mapped",[50,57,26085]],[[13309,13309],"mapped",[51,48,26085]],[[13310,13310],"mapped",[51,49,26085]],[[13311,13311],"mapped",[103,97,108]],[[13312,19893],"valid"],[[19894,19903],"disallowed"],[[19904,19967],"valid",[],"NV8"],[[19968,40869],"valid"],[[40870,40891],"valid"],[[40892,40899],"valid"],[[40900,40907],"valid"],[[40908,40908],"valid"],[[40909,40917],"valid"],[[40918,40959],"disallowed"],[[40960,42124],"valid"],[[42125,42127],"disallowed"],[[42128,42145],"valid",[],"NV8"],[[42146,42147],"valid",[],"NV8"],[[42148,42163],"valid",[],"NV8"],[[42164,42164],"valid",[],"NV8"],[[42165,42176],"valid",[],"NV8"],[[42177,42177],"valid",[],"NV8"],[[42178,42180],"valid",[],"NV8"],[[42181,42181],"valid",[],"NV8"],[[42182,42182],"valid",[],"NV8"],[[42183,42191],"disallowed"],[[42192,42237],"valid"],[[42238,42239],"valid",[],"NV8"],[[42240,42508],"valid"],[[42509,42511],"valid",[],"NV8"],[[42512,42539],"valid"],[[42540,42559],"disallowed"],[[42560,42560],"mapped",[42561]],[[42561,42561],"valid"],[[42562,42562],"mapped",[42563]],[[42563,42563],"valid"],[[42564,42564],"mapped",[42565]],[[42565,42565],"valid"],[[42566,42566],"mapped",[42567]],[[42567,42567],"valid"],[[42568,42568],"mapped",[42569]],[[42569,42569],"valid"],[[42570,42570],"mapped",[42571]],[[42571,42571],"valid"],[[42572,42572],"mapped",[42573]],[[42573,42573],"valid"],[[42574,42574],"mapped",[42575]],[[42575,42575],"valid"],[[42576,42576],"mapped",[42577]],[[42577,42577],"valid"],[[42578,42578],"mapped",[42579]],[[42579,42579],"valid"],[[42580,42580],"mapped",[42581]],[[42581,42581],"valid"],[[42582,42582],"mapped",[42583]],[[42583,42583],"valid"],[[42584,42584],"mapped",[42585]],[[42585,42585],"valid"],[[42586,42586],"mapped",[42587]],[[42587,42587],"valid"],[[42588,42588],"mapped",[42589]],[[42589,42589],"valid"],[[42590,42590],"mapped",[42591]],[[42591,42591],"valid"],[[42592,42592],"mapped",[42593]],[[42593,42593],"valid"],[[42594,42594],"mapped",[42595]],[[42595,42595],"valid"],[[42596,42596],"mapped",[42597]],[[42597,42597],"valid"],[[42598,42598],"mapped",[42599]],[[42599,42599],"valid"],[[42600,42600],"mapped",[42601]],[[42601,42601],"valid"],[[42602,42602],"mapped",[42603]],[[42603,42603],"valid"],[[42604,42604],"mapped",[42605]],[[42605,42607],"valid"],[[42608,42611],"valid",[],"NV8"],[[42612,42619],"valid"],[[42620,42621],"valid"],[[42622,42622],"valid",[],"NV8"],[[42623,42623],"valid"],[[42624,42624],"mapped",[42625]],[[42625,42625],"valid"],[[42626,42626],"mapped",[42627]],[[42627,42627],"valid"],[[42628,42628],"mapped",[42629]],[[42629,42629],"valid"],[[42630,42630],"mapped",[42631]],[[42631,42631],"valid"],[[42632,42632],"mapped",[42633]],[[42633,42633],"valid"],[[42634,42634],"mapped",[42635]],[[42635,42635],"valid"],[[42636,42636],"mapped",[42637]],[[42637,42637],"valid"],[[42638,42638],"mapped",[42639]],[[42639,42639],"valid"],[[42640,42640],"mapped",[42641]],[[42641,42641],"valid"],[[42642,42642],"mapped",[42643]],[[42643,42643],"valid"],[[42644,42644],"mapped",[42645]],[[42645,42645],"valid"],[[42646,42646],"mapped",[42647]],[[42647,42647],"valid"],[[42648,42648],"mapped",[42649]],[[42649,42649],"valid"],[[42650,42650],"mapped",[42651]],[[42651,42651],"valid"],[[42652,42652],"mapped",[1098]],[[42653,42653],"mapped",[1100]],[[42654,42654],"valid"],[[42655,42655],"valid"],[[42656,42725],"valid"],[[42726,42735],"valid",[],"NV8"],[[42736,42737],"valid"],[[42738,42743],"valid",[],"NV8"],[[42744,42751],"disallowed"],[[42752,42774],"valid",[],"NV8"],[[42775,42778],"valid"],[[42779,42783],"valid"],[[42784,42785],"valid",[],"NV8"],[[42786,42786],"mapped",[42787]],[[42787,42787],"valid"],[[42788,42788],"mapped",[42789]],[[42789,42789],"valid"],[[42790,42790],"mapped",[42791]],[[42791,42791],"valid"],[[42792,42792],"mapped",[42793]],[[42793,42793],"valid"],[[42794,42794],"mapped",[42795]],[[42795,42795],"valid"],[[42796,42796],"mapped",[42797]],[[42797,42797],"valid"],[[42798,42798],"mapped",[42799]],[[42799,42801],"valid"],[[42802,42802],"mapped",[42803]],[[42803,42803],"valid"],[[42804,42804],"mapped",[42805]],[[42805,42805],"valid"],[[42806,42806],"mapped",[42807]],[[42807,42807],"valid"],[[42808,42808],"mapped",[42809]],[[42809,42809],"valid"],[[42810,42810],"mapped",[42811]],[[42811,42811],"valid"],[[42812,42812],"mapped",[42813]],[[42813,42813],"valid"],[[42814,42814],"mapped",[42815]],[[42815,42815],"valid"],[[42816,42816],"mapped",[42817]],[[42817,42817],"valid"],[[42818,42818],"mapped",[42819]],[[42819,42819],"valid"],[[42820,42820],"mapped",[42821]],[[42821,42821],"valid"],[[42822,42822],"mapped",[42823]],[[42823,42823],"valid"],[[42824,42824],"mapped",[42825]],[[42825,42825],"valid"],[[42826,42826],"mapped",[42827]],[[42827,42827],"valid"],[[42828,42828],"mapped",[42829]],[[42829,42829],"valid"],[[42830,42830],"mapped",[42831]],[[42831,42831],"valid"],[[42832,42832],"mapped",[42833]],[[42833,42833],"valid"],[[42834,42834],"mapped",[42835]],[[42835,42835],"valid"],[[42836,42836],"mapped",[42837]],[[42837,42837],"valid"],[[42838,42838],"mapped",[42839]],[[42839,42839],"valid"],[[42840,42840],"mapped",[42841]],[[42841,42841],"valid"],[[42842,42842],"mapped",[42843]],[[42843,42843],"valid"],[[42844,42844],"mapped",[42845]],[[42845,42845],"valid"],[[42846,42846],"mapped",[42847]],[[42847,42847],"valid"],[[42848,42848],"mapped",[42849]],[[42849,42849],"valid"],[[42850,42850],"mapped",[42851]],[[42851,42851],"valid"],[[42852,42852],"mapped",[42853]],[[42853,42853],"valid"],[[42854,42854],"mapped",[42855]],[[42855,42855],"valid"],[[42856,42856],"mapped",[42857]],[[42857,42857],"valid"],[[42858,42858],"mapped",[42859]],[[42859,42859],"valid"],[[42860,42860],"mapped",[42861]],[[42861,42861],"valid"],[[42862,42862],"mapped",[42863]],[[42863,42863],"valid"],[[42864,42864],"mapped",[42863]],[[42865,42872],"valid"],[[42873,42873],"mapped",[42874]],[[42874,42874],"valid"],[[42875,42875],"mapped",[42876]],[[42876,42876],"valid"],[[42877,42877],"mapped",[7545]],[[42878,42878],"mapped",[42879]],[[42879,42879],"valid"],[[42880,42880],"mapped",[42881]],[[42881,42881],"valid"],[[42882,42882],"mapped",[42883]],[[42883,42883],"valid"],[[42884,42884],"mapped",[42885]],[[42885,42885],"valid"],[[42886,42886],"mapped",[42887]],[[42887,42888],"valid"],[[42889,42890],"valid",[],"NV8"],[[42891,42891],"mapped",[42892]],[[42892,42892],"valid"],[[42893,42893],"mapped",[613]],[[42894,42894],"valid"],[[42895,42895],"valid"],[[42896,42896],"mapped",[42897]],[[42897,42897],"valid"],[[42898,42898],"mapped",[42899]],[[42899,42899],"valid"],[[42900,42901],"valid"],[[42902,42902],"mapped",[42903]],[[42903,42903],"valid"],[[42904,42904],"mapped",[42905]],[[42905,42905],"valid"],[[42906,42906],"mapped",[42907]],[[42907,42907],"valid"],[[42908,42908],"mapped",[42909]],[[42909,42909],"valid"],[[42910,42910],"mapped",[42911]],[[42911,42911],"valid"],[[42912,42912],"mapped",[42913]],[[42913,42913],"valid"],[[42914,42914],"mapped",[42915]],[[42915,42915],"valid"],[[42916,42916],"mapped",[42917]],[[42917,42917],"valid"],[[42918,42918],"mapped",[42919]],[[42919,42919],"valid"],[[42920,42920],"mapped",[42921]],[[42921,42921],"valid"],[[42922,42922],"mapped",[614]],[[42923,42923],"mapped",[604]],[[42924,42924],"mapped",[609]],[[42925,42925],"mapped",[620]],[[42926,42927],"disallowed"],[[42928,42928],"mapped",[670]],[[42929,42929],"mapped",[647]],[[42930,42930],"mapped",[669]],[[42931,42931],"mapped",[43859]],[[42932,42932],"mapped",[42933]],[[42933,42933],"valid"],[[42934,42934],"mapped",[42935]],[[42935,42935],"valid"],[[42936,42998],"disallowed"],[[42999,42999],"valid"],[[43000,43000],"mapped",[295]],[[43001,43001],"mapped",[339]],[[43002,43002],"valid"],[[43003,43007],"valid"],[[43008,43047],"valid"],[[43048,43051],"valid",[],"NV8"],[[43052,43055],"disallowed"],[[43056,43065],"valid",[],"NV8"],[[43066,43071],"disallowed"],[[43072,43123],"valid"],[[43124,43127],"valid",[],"NV8"],[[43128,43135],"disallowed"],[[43136,43204],"valid"],[[43205,43213],"disallowed"],[[43214,43215],"valid",[],"NV8"],[[43216,43225],"valid"],[[43226,43231],"disallowed"],[[43232,43255],"valid"],[[43256,43258],"valid",[],"NV8"],[[43259,43259],"valid"],[[43260,43260],"valid",[],"NV8"],[[43261,43261],"valid"],[[43262,43263],"disallowed"],[[43264,43309],"valid"],[[43310,43311],"valid",[],"NV8"],[[43312,43347],"valid"],[[43348,43358],"disallowed"],[[43359,43359],"valid",[],"NV8"],[[43360,43388],"valid",[],"NV8"],[[43389,43391],"disallowed"],[[43392,43456],"valid"],[[43457,43469],"valid",[],"NV8"],[[43470,43470],"disallowed"],[[43471,43481],"valid"],[[43482,43485],"disallowed"],[[43486,43487],"valid",[],"NV8"],[[43488,43518],"valid"],[[43519,43519],"disallowed"],[[43520,43574],"valid"],[[43575,43583],"disallowed"],[[43584,43597],"valid"],[[43598,43599],"disallowed"],[[43600,43609],"valid"],[[43610,43611],"disallowed"],[[43612,43615],"valid",[],"NV8"],[[43616,43638],"valid"],[[43639,43641],"valid",[],"NV8"],[[43642,43643],"valid"],[[43644,43647],"valid"],[[43648,43714],"valid"],[[43715,43738],"disallowed"],[[43739,43741],"valid"],[[43742,43743],"valid",[],"NV8"],[[43744,43759],"valid"],[[43760,43761],"valid",[],"NV8"],[[43762,43766],"valid"],[[43767,43776],"disallowed"],[[43777,43782],"valid"],[[43783,43784],"disallowed"],[[43785,43790],"valid"],[[43791,43792],"disallowed"],[[43793,43798],"valid"],[[43799,43807],"disallowed"],[[43808,43814],"valid"],[[43815,43815],"disallowed"],[[43816,43822],"valid"],[[43823,43823],"disallowed"],[[43824,43866],"valid"],[[43867,43867],"valid",[],"NV8"],[[43868,43868],"mapped",[42791]],[[43869,43869],"mapped",[43831]],[[43870,43870],"mapped",[619]],[[43871,43871],"mapped",[43858]],[[43872,43875],"valid"],[[43876,43877],"valid"],[[43878,43887],"disallowed"],[[43888,43888],"mapped",[5024]],[[43889,43889],"mapped",[5025]],[[43890,43890],"mapped",[5026]],[[43891,43891],"mapped",[5027]],[[43892,43892],"mapped",[5028]],[[43893,43893],"mapped",[5029]],[[43894,43894],"mapped",[5030]],[[43895,43895],"mapped",[5031]],[[43896,43896],"mapped",[5032]],[[43897,43897],"mapped",[5033]],[[43898,43898],"mapped",[5034]],[[43899,43899],"mapped",[5035]],[[43900,43900],"mapped",[5036]],[[43901,43901],"mapped",[5037]],[[43902,43902],"mapped",[5038]],[[43903,43903],"mapped",[5039]],[[43904,43904],"mapped",[5040]],[[43905,43905],"mapped",[5041]],[[43906,43906],"mapped",[5042]],[[43907,43907],"mapped",[5043]],[[43908,43908],"mapped",[5044]],[[43909,43909],"mapped",[5045]],[[43910,43910],"mapped",[5046]],[[43911,43911],"mapped",[5047]],[[43912,43912],"mapped",[5048]],[[43913,43913],"mapped",[5049]],[[43914,43914],"mapped",[5050]],[[43915,43915],"mapped",[5051]],[[43916,43916],"mapped",[5052]],[[43917,43917],"mapped",[5053]],[[43918,43918],"mapped",[5054]],[[43919,43919],"mapped",[5055]],[[43920,43920],"mapped",[5056]],[[43921,43921],"mapped",[5057]],[[43922,43922],"mapped",[5058]],[[43923,43923],"mapped",[5059]],[[43924,43924],"mapped",[5060]],[[43925,43925],"mapped",[5061]],[[43926,43926],"mapped",[5062]],[[43927,43927],"mapped",[5063]],[[43928,43928],"mapped",[5064]],[[43929,43929],"mapped",[5065]],[[43930,43930],"mapped",[5066]],[[43931,43931],"mapped",[5067]],[[43932,43932],"mapped",[5068]],[[43933,43933],"mapped",[5069]],[[43934,43934],"mapped",[5070]],[[43935,43935],"mapped",[5071]],[[43936,43936],"mapped",[5072]],[[43937,43937],"mapped",[5073]],[[43938,43938],"mapped",[5074]],[[43939,43939],"mapped",[5075]],[[43940,43940],"mapped",[5076]],[[43941,43941],"mapped",[5077]],[[43942,43942],"mapped",[5078]],[[43943,43943],"mapped",[5079]],[[43944,43944],"mapped",[5080]],[[43945,43945],"mapped",[5081]],[[43946,43946],"mapped",[5082]],[[43947,43947],"mapped",[5083]],[[43948,43948],"mapped",[5084]],[[43949,43949],"mapped",[5085]],[[43950,43950],"mapped",[5086]],[[43951,43951],"mapped",[5087]],[[43952,43952],"mapped",[5088]],[[43953,43953],"mapped",[5089]],[[43954,43954],"mapped",[5090]],[[43955,43955],"mapped",[5091]],[[43956,43956],"mapped",[5092]],[[43957,43957],"mapped",[5093]],[[43958,43958],"mapped",[5094]],[[43959,43959],"mapped",[5095]],[[43960,43960],"mapped",[5096]],[[43961,43961],"mapped",[5097]],[[43962,43962],"mapped",[5098]],[[43963,43963],"mapped",[5099]],[[43964,43964],"mapped",[5100]],[[43965,43965],"mapped",[5101]],[[43966,43966],"mapped",[5102]],[[43967,43967],"mapped",[5103]],[[43968,44010],"valid"],[[44011,44011],"valid",[],"NV8"],[[44012,44013],"valid"],[[44014,44015],"disallowed"],[[44016,44025],"valid"],[[44026,44031],"disallowed"],[[44032,55203],"valid"],[[55204,55215],"disallowed"],[[55216,55238],"valid",[],"NV8"],[[55239,55242],"disallowed"],[[55243,55291],"valid",[],"NV8"],[[55292,55295],"disallowed"],[[55296,57343],"disallowed"],[[57344,63743],"disallowed"],[[63744,63744],"mapped",[35912]],[[63745,63745],"mapped",[26356]],[[63746,63746],"mapped",[36554]],[[63747,63747],"mapped",[36040]],[[63748,63748],"mapped",[28369]],[[63749,63749],"mapped",[20018]],[[63750,63750],"mapped",[21477]],[[63751,63752],"mapped",[40860]],[[63753,63753],"mapped",[22865]],[[63754,63754],"mapped",[37329]],[[63755,63755],"mapped",[21895]],[[63756,63756],"mapped",[22856]],[[63757,63757],"mapped",[25078]],[[63758,63758],"mapped",[30313]],[[63759,63759],"mapped",[32645]],[[63760,63760],"mapped",[34367]],[[63761,63761],"mapped",[34746]],[[63762,63762],"mapped",[35064]],[[63763,63763],"mapped",[37007]],[[63764,63764],"mapped",[27138]],[[63765,63765],"mapped",[27931]],[[63766,63766],"mapped",[28889]],[[63767,63767],"mapped",[29662]],[[63768,63768],"mapped",[33853]],[[63769,63769],"mapped",[37226]],[[63770,63770],"mapped",[39409]],[[63771,63771],"mapped",[20098]],[[63772,63772],"mapped",[21365]],[[63773,63773],"mapped",[27396]],[[63774,63774],"mapped",[29211]],[[63775,63775],"mapped",[34349]],[[63776,63776],"mapped",[40478]],[[63777,63777],"mapped",[23888]],[[63778,63778],"mapped",[28651]],[[63779,63779],"mapped",[34253]],[[63780,63780],"mapped",[35172]],[[63781,63781],"mapped",[25289]],[[63782,63782],"mapped",[33240]],[[63783,63783],"mapped",[34847]],[[63784,63784],"mapped",[24266]],[[63785,63785],"mapped",[26391]],[[63786,63786],"mapped",[28010]],[[63787,63787],"mapped",[29436]],[[63788,63788],"mapped",[37070]],[[63789,63789],"mapped",[20358]],[[63790,63790],"mapped",[20919]],[[63791,63791],"mapped",[21214]],[[63792,63792],"mapped",[25796]],[[63793,63793],"mapped",[27347]],[[63794,63794],"mapped",[29200]],[[63795,63795],"mapped",[30439]],[[63796,63796],"mapped",[32769]],[[63797,63797],"mapped",[34310]],[[63798,63798],"mapped",[34396]],[[63799,63799],"mapped",[36335]],[[63800,63800],"mapped",[38706]],[[63801,63801],"mapped",[39791]],[[63802,63802],"mapped",[40442]],[[63803,63803],"mapped",[30860]],[[63804,63804],"mapped",[31103]],[[63805,63805],"mapped",[32160]],[[63806,63806],"mapped",[33737]],[[63807,63807],"mapped",[37636]],[[63808,63808],"mapped",[40575]],[[63809,63809],"mapped",[35542]],[[63810,63810],"mapped",[22751]],[[63811,63811],"mapped",[24324]],[[63812,63812],"mapped",[31840]],[[63813,63813],"mapped",[32894]],[[63814,63814],"mapped",[29282]],[[63815,63815],"mapped",[30922]],[[63816,63816],"mapped",[36034]],[[63817,63817],"mapped",[38647]],[[63818,63818],"mapped",[22744]],[[63819,63819],"mapped",[23650]],[[63820,63820],"mapped",[27155]],[[63821,63821],"mapped",[28122]],[[63822,63822],"mapped",[28431]],[[63823,63823],"mapped",[32047]],[[63824,63824],"mapped",[32311]],[[63825,63825],"mapped",[38475]],[[63826,63826],"mapped",[21202]],[[63827,63827],"mapped",[32907]],[[63828,63828],"mapped",[20956]],[[63829,63829],"mapped",[20940]],[[63830,63830],"mapped",[31260]],[[63831,63831],"mapped",[32190]],[[63832,63832],"mapped",[33777]],[[63833,63833],"mapped",[38517]],[[63834,63834],"mapped",[35712]],[[63835,63835],"mapped",[25295]],[[63836,63836],"mapped",[27138]],[[63837,63837],"mapped",[35582]],[[63838,63838],"mapped",[20025]],[[63839,63839],"mapped",[23527]],[[63840,63840],"mapped",[24594]],[[63841,63841],"mapped",[29575]],[[63842,63842],"mapped",[30064]],[[63843,63843],"mapped",[21271]],[[63844,63844],"mapped",[30971]],[[63845,63845],"mapped",[20415]],[[63846,63846],"mapped",[24489]],[[63847,63847],"mapped",[19981]],[[63848,63848],"mapped",[27852]],[[63849,63849],"mapped",[25976]],[[63850,63850],"mapped",[32034]],[[63851,63851],"mapped",[21443]],[[63852,63852],"mapped",[22622]],[[63853,63853],"mapped",[30465]],[[63854,63854],"mapped",[33865]],[[63855,63855],"mapped",[35498]],[[63856,63856],"mapped",[27578]],[[63857,63857],"mapped",[36784]],[[63858,63858],"mapped",[27784]],[[63859,63859],"mapped",[25342]],[[63860,63860],"mapped",[33509]],[[63861,63861],"mapped",[25504]],[[63862,63862],"mapped",[30053]],[[63863,63863],"mapped",[20142]],[[63864,63864],"mapped",[20841]],[[63865,63865],"mapped",[20937]],[[63866,63866],"mapped",[26753]],[[63867,63867],"mapped",[31975]],[[63868,63868],"mapped",[33391]],[[63869,63869],"mapped",[35538]],[[63870,63870],"mapped",[37327]],[[63871,63871],"mapped",[21237]],[[63872,63872],"mapped",[21570]],[[63873,63873],"mapped",[22899]],[[63874,63874],"mapped",[24300]],[[63875,63875],"mapped",[26053]],[[63876,63876],"mapped",[28670]],[[63877,63877],"mapped",[31018]],[[63878,63878],"mapped",[38317]],[[63879,63879],"mapped",[39530]],[[63880,63880],"mapped",[40599]],[[63881,63881],"mapped",[40654]],[[63882,63882],"mapped",[21147]],[[63883,63883],"mapped",[26310]],[[63884,63884],"mapped",[27511]],[[63885,63885],"mapped",[36706]],[[63886,63886],"mapped",[24180]],[[63887,63887],"mapped",[24976]],[[63888,63888],"mapped",[25088]],[[63889,63889],"mapped",[25754]],[[63890,63890],"mapped",[28451]],[[63891,63891],"mapped",[29001]],[[63892,63892],"mapped",[29833]],[[63893,63893],"mapped",[31178]],[[63894,63894],"mapped",[32244]],[[63895,63895],"mapped",[32879]],[[63896,63896],"mapped",[36646]],[[63897,63897],"mapped",[34030]],[[63898,63898],"mapped",[36899]],[[63899,63899],"mapped",[37706]],[[63900,63900],"mapped",[21015]],[[63901,63901],"mapped",[21155]],[[63902,63902],"mapped",[21693]],[[63903,63903],"mapped",[28872]],[[63904,63904],"mapped",[35010]],[[63905,63905],"mapped",[35498]],[[63906,63906],"mapped",[24265]],[[63907,63907],"mapped",[24565]],[[63908,63908],"mapped",[25467]],[[63909,63909],"mapped",[27566]],[[63910,63910],"mapped",[31806]],[[63911,63911],"mapped",[29557]],[[63912,63912],"mapped",[20196]],[[63913,63913],"mapped",[22265]],[[63914,63914],"mapped",[23527]],[[63915,63915],"mapped",[23994]],[[63916,63916],"mapped",[24604]],[[63917,63917],"mapped",[29618]],[[63918,63918],"mapped",[29801]],[[63919,63919],"mapped",[32666]],[[63920,63920],"mapped",[32838]],[[63921,63921],"mapped",[37428]],[[63922,63922],"mapped",[38646]],[[63923,63923],"mapped",[38728]],[[63924,63924],"mapped",[38936]],[[63925,63925],"mapped",[20363]],[[63926,63926],"mapped",[31150]],[[63927,63927],"mapped",[37300]],[[63928,63928],"mapped",[38584]],[[63929,63929],"mapped",[24801]],[[63930,63930],"mapped",[20102]],[[63931,63931],"mapped",[20698]],[[63932,63932],"mapped",[23534]],[[63933,63933],"mapped",[23615]],[[63934,63934],"mapped",[26009]],[[63935,63935],"mapped",[27138]],[[63936,63936],"mapped",[29134]],[[63937,63937],"mapped",[30274]],[[63938,63938],"mapped",[34044]],[[63939,63939],"mapped",[36988]],[[63940,63940],"mapped",[40845]],[[63941,63941],"mapped",[26248]],[[63942,63942],"mapped",[38446]],[[63943,63943],"mapped",[21129]],[[63944,63944],"mapped",[26491]],[[63945,63945],"mapped",[26611]],[[63946,63946],"mapped",[27969]],[[63947,63947],"mapped",[28316]],[[63948,63948],"mapped",[29705]],[[63949,63949],"mapped",[30041]],[[63950,63950],"mapped",[30827]],[[63951,63951],"mapped",[32016]],[[63952,63952],"mapped",[39006]],[[63953,63953],"mapped",[20845]],[[63954,63954],"mapped",[25134]],[[63955,63955],"mapped",[38520]],[[63956,63956],"mapped",[20523]],[[63957,63957],"mapped",[23833]],[[63958,63958],"mapped",[28138]],[[63959,63959],"mapped",[36650]],[[63960,63960],"mapped",[24459]],[[63961,63961],"mapped",[24900]],[[63962,63962],"mapped",[26647]],[[63963,63963],"mapped",[29575]],[[63964,63964],"mapped",[38534]],[[63965,63965],"mapped",[21033]],[[63966,63966],"mapped",[21519]],[[63967,63967],"mapped",[23653]],[[63968,63968],"mapped",[26131]],[[63969,63969],"mapped",[26446]],[[63970,63970],"mapped",[26792]],[[63971,63971],"mapped",[27877]],[[63972,63972],"mapped",[29702]],[[63973,63973],"mapped",[30178]],[[63974,63974],"mapped",[32633]],[[63975,63975],"mapped",[35023]],[[63976,63976],"mapped",[35041]],[[63977,63977],"mapped",[37324]],[[63978,63978],"mapped",[38626]],[[63979,63979],"mapped",[21311]],[[63980,63980],"mapped",[28346]],[[63981,63981],"mapped",[21533]],[[63982,63982],"mapped",[29136]],[[63983,63983],"mapped",[29848]],[[63984,63984],"mapped",[34298]],[[63985,63985],"mapped",[38563]],[[63986,63986],"mapped",[40023]],[[63987,63987],"mapped",[40607]],[[63988,63988],"mapped",[26519]],[[63989,63989],"mapped",[28107]],[[63990,63990],"mapped",[33256]],[[63991,63991],"mapped",[31435]],[[63992,63992],"mapped",[31520]],[[63993,63993],"mapped",[31890]],[[63994,63994],"mapped",[29376]],[[63995,63995],"mapped",[28825]],[[63996,63996],"mapped",[35672]],[[63997,63997],"mapped",[20160]],[[63998,63998],"mapped",[33590]],[[63999,63999],"mapped",[21050]],[[64000,64000],"mapped",[20999]],[[64001,64001],"mapped",[24230]],[[64002,64002],"mapped",[25299]],[[64003,64003],"mapped",[31958]],[[64004,64004],"mapped",[23429]],[[64005,64005],"mapped",[27934]],[[64006,64006],"mapped",[26292]],[[64007,64007],"mapped",[36667]],[[64008,64008],"mapped",[34892]],[[64009,64009],"mapped",[38477]],[[64010,64010],"mapped",[35211]],[[64011,64011],"mapped",[24275]],[[64012,64012],"mapped",[20800]],[[64013,64013],"mapped",[21952]],[[64014,64015],"valid"],[[64016,64016],"mapped",[22618]],[[64017,64017],"valid"],[[64018,64018],"mapped",[26228]],[[64019,64020],"valid"],[[64021,64021],"mapped",[20958]],[[64022,64022],"mapped",[29482]],[[64023,64023],"mapped",[30410]],[[64024,64024],"mapped",[31036]],[[64025,64025],"mapped",[31070]],[[64026,64026],"mapped",[31077]],[[64027,64027],"mapped",[31119]],[[64028,64028],"mapped",[38742]],[[64029,64029],"mapped",[31934]],[[64030,64030],"mapped",[32701]],[[64031,64031],"valid"],[[64032,64032],"mapped",[34322]],[[64033,64033],"valid"],[[64034,64034],"mapped",[35576]],[[64035,64036],"valid"],[[64037,64037],"mapped",[36920]],[[64038,64038],"mapped",[37117]],[[64039,64041],"valid"],[[64042,64042],"mapped",[39151]],[[64043,64043],"mapped",[39164]],[[64044,64044],"mapped",[39208]],[[64045,64045],"mapped",[40372]],[[64046,64046],"mapped",[37086]],[[64047,64047],"mapped",[38583]],[[64048,64048],"mapped",[20398]],[[64049,64049],"mapped",[20711]],[[64050,64050],"mapped",[20813]],[[64051,64051],"mapped",[21193]],[[64052,64052],"mapped",[21220]],[[64053,64053],"mapped",[21329]],[[64054,64054],"mapped",[21917]],[[64055,64055],"mapped",[22022]],[[64056,64056],"mapped",[22120]],[[64057,64057],"mapped",[22592]],[[64058,64058],"mapped",[22696]],[[64059,64059],"mapped",[23652]],[[64060,64060],"mapped",[23662]],[[64061,64061],"mapped",[24724]],[[64062,64062],"mapped",[24936]],[[64063,64063],"mapped",[24974]],[[64064,64064],"mapped",[25074]],[[64065,64065],"mapped",[25935]],[[64066,64066],"mapped",[26082]],[[64067,64067],"mapped",[26257]],[[64068,64068],"mapped",[26757]],[[64069,64069],"mapped",[28023]],[[64070,64070],"mapped",[28186]],[[64071,64071],"mapped",[28450]],[[64072,64072],"mapped",[29038]],[[64073,64073],"mapped",[29227]],[[64074,64074],"mapped",[29730]],[[64075,64075],"mapped",[30865]],[[64076,64076],"mapped",[31038]],[[64077,64077],"mapped",[31049]],[[64078,64078],"mapped",[31048]],[[64079,64079],"mapped",[31056]],[[64080,64080],"mapped",[31062]],[[64081,64081],"mapped",[31069]],[[64082,64082],"mapped",[31117]],[[64083,64083],"mapped",[31118]],[[64084,64084],"mapped",[31296]],[[64085,64085],"mapped",[31361]],[[64086,64086],"mapped",[31680]],[[64087,64087],"mapped",[32244]],[[64088,64088],"mapped",[32265]],[[64089,64089],"mapped",[32321]],[[64090,64090],"mapped",[32626]],[[64091,64091],"mapped",[32773]],[[64092,64092],"mapped",[33261]],[[64093,64094],"mapped",[33401]],[[64095,64095],"mapped",[33879]],[[64096,64096],"mapped",[35088]],[[64097,64097],"mapped",[35222]],[[64098,64098],"mapped",[35585]],[[64099,64099],"mapped",[35641]],[[64100,64100],"mapped",[36051]],[[64101,64101],"mapped",[36104]],[[64102,64102],"mapped",[36790]],[[64103,64103],"mapped",[36920]],[[64104,64104],"mapped",[38627]],[[64105,64105],"mapped",[38911]],[[64106,64106],"mapped",[38971]],[[64107,64107],"mapped",[24693]],[[64108,64108],"mapped",[148206]],[[64109,64109],"mapped",[33304]],[[64110,64111],"disallowed"],[[64112,64112],"mapped",[20006]],[[64113,64113],"mapped",[20917]],[[64114,64114],"mapped",[20840]],[[64115,64115],"mapped",[20352]],[[64116,64116],"mapped",[20805]],[[64117,64117],"mapped",[20864]],[[64118,64118],"mapped",[21191]],[[64119,64119],"mapped",[21242]],[[64120,64120],"mapped",[21917]],[[64121,64121],"mapped",[21845]],[[64122,64122],"mapped",[21913]],[[64123,64123],"mapped",[21986]],[[64124,64124],"mapped",[22618]],[[64125,64125],"mapped",[22707]],[[64126,64126],"mapped",[22852]],[[64127,64127],"mapped",[22868]],[[64128,64128],"mapped",[23138]],[[64129,64129],"mapped",[23336]],[[64130,64130],"mapped",[24274]],[[64131,64131],"mapped",[24281]],[[64132,64132],"mapped",[24425]],[[64133,64133],"mapped",[24493]],[[64134,64134],"mapped",[24792]],[[64135,64135],"mapped",[24910]],[[64136,64136],"mapped",[24840]],[[64137,64137],"mapped",[24974]],[[64138,64138],"mapped",[24928]],[[64139,64139],"mapped",[25074]],[[64140,64140],"mapped",[25140]],[[64141,64141],"mapped",[25540]],[[64142,64142],"mapped",[25628]],[[64143,64143],"mapped",[25682]],[[64144,64144],"mapped",[25942]],[[64145,64145],"mapped",[26228]],[[64146,64146],"mapped",[26391]],[[64147,64147],"mapped",[26395]],[[64148,64148],"mapped",[26454]],[[64149,64149],"mapped",[27513]],[[64150,64150],"mapped",[27578]],[[64151,64151],"mapped",[27969]],[[64152,64152],"mapped",[28379]],[[64153,64153],"mapped",[28363]],[[64154,64154],"mapped",[28450]],[[64155,64155],"mapped",[28702]],[[64156,64156],"mapped",[29038]],[[64157,64157],"mapped",[30631]],[[64158,64158],"mapped",[29237]],[[64159,64159],"mapped",[29359]],[[64160,64160],"mapped",[29482]],[[64161,64161],"mapped",[29809]],[[64162,64162],"mapped",[29958]],[[64163,64163],"mapped",[30011]],[[64164,64164],"mapped",[30237]],[[64165,64165],"mapped",[30239]],[[64166,64166],"mapped",[30410]],[[64167,64167],"mapped",[30427]],[[64168,64168],"mapped",[30452]],[[64169,64169],"mapped",[30538]],[[64170,64170],"mapped",[30528]],[[64171,64171],"mapped",[30924]],[[64172,64172],"mapped",[31409]],[[64173,64173],"mapped",[31680]],[[64174,64174],"mapped",[31867]],[[64175,64175],"mapped",[32091]],[[64176,64176],"mapped",[32244]],[[64177,64177],"mapped",[32574]],[[64178,64178],"mapped",[32773]],[[64179,64179],"mapped",[33618]],[[64180,64180],"mapped",[33775]],[[64181,64181],"mapped",[34681]],[[64182,64182],"mapped",[35137]],[[64183,64183],"mapped",[35206]],[[64184,64184],"mapped",[35222]],[[64185,64185],"mapped",[35519]],[[64186,64186],"mapped",[35576]],[[64187,64187],"mapped",[35531]],[[64188,64188],"mapped",[35585]],[[64189,64189],"mapped",[35582]],[[64190,64190],"mapped",[35565]],[[64191,64191],"mapped",[35641]],[[64192,64192],"mapped",[35722]],[[64193,64193],"mapped",[36104]],[[64194,64194],"mapped",[36664]],[[64195,64195],"mapped",[36978]],[[64196,64196],"mapped",[37273]],[[64197,64197],"mapped",[37494]],[[64198,64198],"mapped",[38524]],[[64199,64199],"mapped",[38627]],[[64200,64200],"mapped",[38742]],[[64201,64201],"mapped",[38875]],[[64202,64202],"mapped",[38911]],[[64203,64203],"mapped",[38923]],[[64204,64204],"mapped",[38971]],[[64205,64205],"mapped",[39698]],[[64206,64206],"mapped",[40860]],[[64207,64207],"mapped",[141386]],[[64208,64208],"mapped",[141380]],[[64209,64209],"mapped",[144341]],[[64210,64210],"mapped",[15261]],[[64211,64211],"mapped",[16408]],[[64212,64212],"mapped",[16441]],[[64213,64213],"mapped",[152137]],[[64214,64214],"mapped",[154832]],[[64215,64215],"mapped",[163539]],[[64216,64216],"mapped",[40771]],[[64217,64217],"mapped",[40846]],[[64218,64255],"disallowed"],[[64256,64256],"mapped",[102,102]],[[64257,64257],"mapped",[102,105]],[[64258,64258],"mapped",[102,108]],[[64259,64259],"mapped",[102,102,105]],[[64260,64260],"mapped",[102,102,108]],[[64261,64262],"mapped",[115,116]],[[64263,64274],"disallowed"],[[64275,64275],"mapped",[1396,1398]],[[64276,64276],"mapped",[1396,1381]],[[64277,64277],"mapped",[1396,1387]],[[64278,64278],"mapped",[1406,1398]],[[64279,64279],"mapped",[1396,1389]],[[64280,64284],"disallowed"],[[64285,64285],"mapped",[1497,1460]],[[64286,64286],"valid"],[[64287,64287],"mapped",[1522,1463]],[[64288,64288],"mapped",[1506]],[[64289,64289],"mapped",[1488]],[[64290,64290],"mapped",[1491]],[[64291,64291],"mapped",[1492]],[[64292,64292],"mapped",[1499]],[[64293,64293],"mapped",[1500]],[[64294,64294],"mapped",[1501]],[[64295,64295],"mapped",[1512]],[[64296,64296],"mapped",[1514]],[[64297,64297],"disallowed_STD3_mapped",[43]],[[64298,64298],"mapped",[1513,1473]],[[64299,64299],"mapped",[1513,1474]],[[64300,64300],"mapped",[1513,1468,1473]],[[64301,64301],"mapped",[1513,1468,1474]],[[64302,64302],"mapped",[1488,1463]],[[64303,64303],"mapped",[1488,1464]],[[64304,64304],"mapped",[1488,1468]],[[64305,64305],"mapped",[1489,1468]],[[64306,64306],"mapped",[1490,1468]],[[64307,64307],"mapped",[1491,1468]],[[64308,64308],"mapped",[1492,1468]],[[64309,64309],"mapped",[1493,1468]],[[64310,64310],"mapped",[1494,1468]],[[64311,64311],"disallowed"],[[64312,64312],"mapped",[1496,1468]],[[64313,64313],"mapped",[1497,1468]],[[64314,64314],"mapped",[1498,1468]],[[64315,64315],"mapped",[1499,1468]],[[64316,64316],"mapped",[1500,1468]],[[64317,64317],"disallowed"],[[64318,64318],"mapped",[1502,1468]],[[64319,64319],"disallowed"],[[64320,64320],"mapped",[1504,1468]],[[64321,64321],"mapped",[1505,1468]],[[64322,64322],"disallowed"],[[64323,64323],"mapped",[1507,1468]],[[64324,64324],"mapped",[1508,1468]],[[64325,64325],"disallowed"],[[64326,64326],"mapped",[1510,1468]],[[64327,64327],"mapped",[1511,1468]],[[64328,64328],"mapped",[1512,1468]],[[64329,64329],"mapped",[1513,1468]],[[64330,64330],"mapped",[1514,1468]],[[64331,64331],"mapped",[1493,1465]],[[64332,64332],"mapped",[1489,1471]],[[64333,64333],"mapped",[1499,1471]],[[64334,64334],"mapped",[1508,1471]],[[64335,64335],"mapped",[1488,1500]],[[64336,64337],"mapped",[1649]],[[64338,64341],"mapped",[1659]],[[64342,64345],"mapped",[1662]],[[64346,64349],"mapped",[1664]],[[64350,64353],"mapped",[1658]],[[64354,64357],"mapped",[1663]],[[64358,64361],"mapped",[1657]],[[64362,64365],"mapped",[1700]],[[64366,64369],"mapped",[1702]],[[64370,64373],"mapped",[1668]],[[64374,64377],"mapped",[1667]],[[64378,64381],"mapped",[1670]],[[64382,64385],"mapped",[1671]],[[64386,64387],"mapped",[1677]],[[64388,64389],"mapped",[1676]],[[64390,64391],"mapped",[1678]],[[64392,64393],"mapped",[1672]],[[64394,64395],"mapped",[1688]],[[64396,64397],"mapped",[1681]],[[64398,64401],"mapped",[1705]],[[64402,64405],"mapped",[1711]],[[64406,64409],"mapped",[1715]],[[64410,64413],"mapped",[1713]],[[64414,64415],"mapped",[1722]],[[64416,64419],"mapped",[1723]],[[64420,64421],"mapped",[1728]],[[64422,64425],"mapped",[1729]],[[64426,64429],"mapped",[1726]],[[64430,64431],"mapped",[1746]],[[64432,64433],"mapped",[1747]],[[64434,64449],"valid",[],"NV8"],[[64450,64466],"disallowed"],[[64467,64470],"mapped",[1709]],[[64471,64472],"mapped",[1735]],[[64473,64474],"mapped",[1734]],[[64475,64476],"mapped",[1736]],[[64477,64477],"mapped",[1735,1652]],[[64478,64479],"mapped",[1739]],[[64480,64481],"mapped",[1733]],[[64482,64483],"mapped",[1737]],[[64484,64487],"mapped",[1744]],[[64488,64489],"mapped",[1609]],[[64490,64491],"mapped",[1574,1575]],[[64492,64493],"mapped",[1574,1749]],[[64494,64495],"mapped",[1574,1608]],[[64496,64497],"mapped",[1574,1735]],[[64498,64499],"mapped",[1574,1734]],[[64500,64501],"mapped",[1574,1736]],[[64502,64504],"mapped",[1574,1744]],[[64505,64507],"mapped",[1574,1609]],[[64508,64511],"mapped",[1740]],[[64512,64512],"mapped",[1574,1580]],[[64513,64513],"mapped",[1574,1581]],[[64514,64514],"mapped",[1574,1605]],[[64515,64515],"mapped",[1574,1609]],[[64516,64516],"mapped",[1574,1610]],[[64517,64517],"mapped",[1576,1580]],[[64518,64518],"mapped",[1576,1581]],[[64519,64519],"mapped",[1576,1582]],[[64520,64520],"mapped",[1576,1605]],[[64521,64521],"mapped",[1576,1609]],[[64522,64522],"mapped",[1576,1610]],[[64523,64523],"mapped",[1578,1580]],[[64524,64524],"mapped",[1578,1581]],[[64525,64525],"mapped",[1578,1582]],[[64526,64526],"mapped",[1578,1605]],[[64527,64527],"mapped",[1578,1609]],[[64528,64528],"mapped",[1578,1610]],[[64529,64529],"mapped",[1579,1580]],[[64530,64530],"mapped",[1579,1605]],[[64531,64531],"mapped",[1579,1609]],[[64532,64532],"mapped",[1579,1610]],[[64533,64533],"mapped",[1580,1581]],[[64534,64534],"mapped",[1580,1605]],[[64535,64535],"mapped",[1581,1580]],[[64536,64536],"mapped",[1581,1605]],[[64537,64537],"mapped",[1582,1580]],[[64538,64538],"mapped",[1582,1581]],[[64539,64539],"mapped",[1582,1605]],[[64540,64540],"mapped",[1587,1580]],[[64541,64541],"mapped",[1587,1581]],[[64542,64542],"mapped",[1587,1582]],[[64543,64543],"mapped",[1587,1605]],[[64544,64544],"mapped",[1589,1581]],[[64545,64545],"mapped",[1589,1605]],[[64546,64546],"mapped",[1590,1580]],[[64547,64547],"mapped",[1590,1581]],[[64548,64548],"mapped",[1590,1582]],[[64549,64549],"mapped",[1590,1605]],[[64550,64550],"mapped",[1591,1581]],[[64551,64551],"mapped",[1591,1605]],[[64552,64552],"mapped",[1592,1605]],[[64553,64553],"mapped",[1593,1580]],[[64554,64554],"mapped",[1593,1605]],[[64555,64555],"mapped",[1594,1580]],[[64556,64556],"mapped",[1594,1605]],[[64557,64557],"mapped",[1601,1580]],[[64558,64558],"mapped",[1601,1581]],[[64559,64559],"mapped",[1601,1582]],[[64560,64560],"mapped",[1601,1605]],[[64561,64561],"mapped",[1601,1609]],[[64562,64562],"mapped",[1601,1610]],[[64563,64563],"mapped",[1602,1581]],[[64564,64564],"mapped",[1602,1605]],[[64565,64565],"mapped",[1602,1609]],[[64566,64566],"mapped",[1602,1610]],[[64567,64567],"mapped",[1603,1575]],[[64568,64568],"mapped",[1603,1580]],[[64569,64569],"mapped",[1603,1581]],[[64570,64570],"mapped",[1603,1582]],[[64571,64571],"mapped",[1603,1604]],[[64572,64572],"mapped",[1603,1605]],[[64573,64573],"mapped",[1603,1609]],[[64574,64574],"mapped",[1603,1610]],[[64575,64575],"mapped",[1604,1580]],[[64576,64576],"mapped",[1604,1581]],[[64577,64577],"mapped",[1604,1582]],[[64578,64578],"mapped",[1604,1605]],[[64579,64579],"mapped",[1604,1609]],[[64580,64580],"mapped",[1604,1610]],[[64581,64581],"mapped",[1605,1580]],[[64582,64582],"mapped",[1605,1581]],[[64583,64583],"mapped",[1605,1582]],[[64584,64584],"mapped",[1605,1605]],[[64585,64585],"mapped",[1605,1609]],[[64586,64586],"mapped",[1605,1610]],[[64587,64587],"mapped",[1606,1580]],[[64588,64588],"mapped",[1606,1581]],[[64589,64589],"mapped",[1606,1582]],[[64590,64590],"mapped",[1606,1605]],[[64591,64591],"mapped",[1606,1609]],[[64592,64592],"mapped",[1606,1610]],[[64593,64593],"mapped",[1607,1580]],[[64594,64594],"mapped",[1607,1605]],[[64595,64595],"mapped",[1607,1609]],[[64596,64596],"mapped",[1607,1610]],[[64597,64597],"mapped",[1610,1580]],[[64598,64598],"mapped",[1610,1581]],[[64599,64599],"mapped",[1610,1582]],[[64600,64600],"mapped",[1610,1605]],[[64601,64601],"mapped",[1610,1609]],[[64602,64602],"mapped",[1610,1610]],[[64603,64603],"mapped",[1584,1648]],[[64604,64604],"mapped",[1585,1648]],[[64605,64605],"mapped",[1609,1648]],[[64606,64606],"disallowed_STD3_mapped",[32,1612,1617]],[[64607,64607],"disallowed_STD3_mapped",[32,1613,1617]],[[64608,64608],"disallowed_STD3_mapped",[32,1614,1617]],[[64609,64609],"disallowed_STD3_mapped",[32,1615,1617]],[[64610,64610],"disallowed_STD3_mapped",[32,1616,1617]],[[64611,64611],"disallowed_STD3_mapped",[32,1617,1648]],[[64612,64612],"mapped",[1574,1585]],[[64613,64613],"mapped",[1574,1586]],[[64614,64614],"mapped",[1574,1605]],[[64615,64615],"mapped",[1574,1606]],[[64616,64616],"mapped",[1574,1609]],[[64617,64617],"mapped",[1574,1610]],[[64618,64618],"mapped",[1576,1585]],[[64619,64619],"mapped",[1576,1586]],[[64620,64620],"mapped",[1576,1605]],[[64621,64621],"mapped",[1576,1606]],[[64622,64622],"mapped",[1576,1609]],[[64623,64623],"mapped",[1576,1610]],[[64624,64624],"mapped",[1578,1585]],[[64625,64625],"mapped",[1578,1586]],[[64626,64626],"mapped",[1578,1605]],[[64627,64627],"mapped",[1578,1606]],[[64628,64628],"mapped",[1578,1609]],[[64629,64629],"mapped",[1578,1610]],[[64630,64630],"mapped",[1579,1585]],[[64631,64631],"mapped",[1579,1586]],[[64632,64632],"mapped",[1579,1605]],[[64633,64633],"mapped",[1579,1606]],[[64634,64634],"mapped",[1579,1609]],[[64635,64635],"mapped",[1579,1610]],[[64636,64636],"mapped",[1601,1609]],[[64637,64637],"mapped",[1601,1610]],[[64638,64638],"mapped",[1602,1609]],[[64639,64639],"mapped",[1602,1610]],[[64640,64640],"mapped",[1603,1575]],[[64641,64641],"mapped",[1603,1604]],[[64642,64642],"mapped",[1603,1605]],[[64643,64643],"mapped",[1603,1609]],[[64644,64644],"mapped",[1603,1610]],[[64645,64645],"mapped",[1604,1605]],[[64646,64646],"mapped",[1604,1609]],[[64647,64647],"mapped",[1604,1610]],[[64648,64648],"mapped",[1605,1575]],[[64649,64649],"mapped",[1605,1605]],[[64650,64650],"mapped",[1606,1585]],[[64651,64651],"mapped",[1606,1586]],[[64652,64652],"mapped",[1606,1605]],[[64653,64653],"mapped",[1606,1606]],[[64654,64654],"mapped",[1606,1609]],[[64655,64655],"mapped",[1606,1610]],[[64656,64656],"mapped",[1609,1648]],[[64657,64657],"mapped",[1610,1585]],[[64658,64658],"mapped",[1610,1586]],[[64659,64659],"mapped",[1610,1605]],[[64660,64660],"mapped",[1610,1606]],[[64661,64661],"mapped",[1610,1609]],[[64662,64662],"mapped",[1610,1610]],[[64663,64663],"mapped",[1574,1580]],[[64664,64664],"mapped",[1574,1581]],[[64665,64665],"mapped",[1574,1582]],[[64666,64666],"mapped",[1574,1605]],[[64667,64667],"mapped",[1574,1607]],[[64668,64668],"mapped",[1576,1580]],[[64669,64669],"mapped",[1576,1581]],[[64670,64670],"mapped",[1576,1582]],[[64671,64671],"mapped",[1576,1605]],[[64672,64672],"mapped",[1576,1607]],[[64673,64673],"mapped",[1578,1580]],[[64674,64674],"mapped",[1578,1581]],[[64675,64675],"mapped",[1578,1582]],[[64676,64676],"mapped",[1578,1605]],[[64677,64677],"mapped",[1578,1607]],[[64678,64678],"mapped",[1579,1605]],[[64679,64679],"mapped",[1580,1581]],[[64680,64680],"mapped",[1580,1605]],[[64681,64681],"mapped",[1581,1580]],[[64682,64682],"mapped",[1581,1605]],[[64683,64683],"mapped",[1582,1580]],[[64684,64684],"mapped",[1582,1605]],[[64685,64685],"mapped",[1587,1580]],[[64686,64686],"mapped",[1587,1581]],[[64687,64687],"mapped",[1587,1582]],[[64688,64688],"mapped",[1587,1605]],[[64689,64689],"mapped",[1589,1581]],[[64690,64690],"mapped",[1589,1582]],[[64691,64691],"mapped",[1589,1605]],[[64692,64692],"mapped",[1590,1580]],[[64693,64693],"mapped",[1590,1581]],[[64694,64694],"mapped",[1590,1582]],[[64695,64695],"mapped",[1590,1605]],[[64696,64696],"mapped",[1591,1581]],[[64697,64697],"mapped",[1592,1605]],[[64698,64698],"mapped",[1593,1580]],[[64699,64699],"mapped",[1593,1605]],[[64700,64700],"mapped",[1594,1580]],[[64701,64701],"mapped",[1594,1605]],[[64702,64702],"mapped",[1601,1580]],[[64703,64703],"mapped",[1601,1581]],[[64704,64704],"mapped",[1601,1582]],[[64705,64705],"mapped",[1601,1605]],[[64706,64706],"mapped",[1602,1581]],[[64707,64707],"mapped",[1602,1605]],[[64708,64708],"mapped",[1603,1580]],[[64709,64709],"mapped",[1603,1581]],[[64710,64710],"mapped",[1603,1582]],[[64711,64711],"mapped",[1603,1604]],[[64712,64712],"mapped",[1603,1605]],[[64713,64713],"mapped",[1604,1580]],[[64714,64714],"mapped",[1604,1581]],[[64715,64715],"mapped",[1604,1582]],[[64716,64716],"mapped",[1604,1605]],[[64717,64717],"mapped",[1604,1607]],[[64718,64718],"mapped",[1605,1580]],[[64719,64719],"mapped",[1605,1581]],[[64720,64720],"mapped",[1605,1582]],[[64721,64721],"mapped",[1605,1605]],[[64722,64722],"mapped",[1606,1580]],[[64723,64723],"mapped",[1606,1581]],[[64724,64724],"mapped",[1606,1582]],[[64725,64725],"mapped",[1606,1605]],[[64726,64726],"mapped",[1606,1607]],[[64727,64727],"mapped",[1607,1580]],[[64728,64728],"mapped",[1607,1605]],[[64729,64729],"mapped",[1607,1648]],[[64730,64730],"mapped",[1610,1580]],[[64731,64731],"mapped",[1610,1581]],[[64732,64732],"mapped",[1610,1582]],[[64733,64733],"mapped",[1610,1605]],[[64734,64734],"mapped",[1610,1607]],[[64735,64735],"mapped",[1574,1605]],[[64736,64736],"mapped",[1574,1607]],[[64737,64737],"mapped",[1576,1605]],[[64738,64738],"mapped",[1576,1607]],[[64739,64739],"mapped",[1578,1605]],[[64740,64740],"mapped",[1578,1607]],[[64741,64741],"mapped",[1579,1605]],[[64742,64742],"mapped",[1579,1607]],[[64743,64743],"mapped",[1587,1605]],[[64744,64744],"mapped",[1587,1607]],[[64745,64745],"mapped",[1588,1605]],[[64746,64746],"mapped",[1588,1607]],[[64747,64747],"mapped",[1603,1604]],[[64748,64748],"mapped",[1603,1605]],[[64749,64749],"mapped",[1604,1605]],[[64750,64750],"mapped",[1606,1605]],[[64751,64751],"mapped",[1606,1607]],[[64752,64752],"mapped",[1610,1605]],[[64753,64753],"mapped",[1610,1607]],[[64754,64754],"mapped",[1600,1614,1617]],[[64755,64755],"mapped",[1600,1615,1617]],[[64756,64756],"mapped",[1600,1616,1617]],[[64757,64757],"mapped",[1591,1609]],[[64758,64758],"mapped",[1591,1610]],[[64759,64759],"mapped",[1593,1609]],[[64760,64760],"mapped",[1593,1610]],[[64761,64761],"mapped",[1594,1609]],[[64762,64762],"mapped",[1594,1610]],[[64763,64763],"mapped",[1587,1609]],[[64764,64764],"mapped",[1587,1610]],[[64765,64765],"mapped",[1588,1609]],[[64766,64766],"mapped",[1588,1610]],[[64767,64767],"mapped",[1581,1609]],[[64768,64768],"mapped",[1581,1610]],[[64769,64769],"mapped",[1580,1609]],[[64770,64770],"mapped",[1580,1610]],[[64771,64771],"mapped",[1582,1609]],[[64772,64772],"mapped",[1582,1610]],[[64773,64773],"mapped",[1589,1609]],[[64774,64774],"mapped",[1589,1610]],[[64775,64775],"mapped",[1590,1609]],[[64776,64776],"mapped",[1590,1610]],[[64777,64777],"mapped",[1588,1580]],[[64778,64778],"mapped",[1588,1581]],[[64779,64779],"mapped",[1588,1582]],[[64780,64780],"mapped",[1588,1605]],[[64781,64781],"mapped",[1588,1585]],[[64782,64782],"mapped",[1587,1585]],[[64783,64783],"mapped",[1589,1585]],[[64784,64784],"mapped",[1590,1585]],[[64785,64785],"mapped",[1591,1609]],[[64786,64786],"mapped",[1591,1610]],[[64787,64787],"mapped",[1593,1609]],[[64788,64788],"mapped",[1593,1610]],[[64789,64789],"mapped",[1594,1609]],[[64790,64790],"mapped",[1594,1610]],[[64791,64791],"mapped",[1587,1609]],[[64792,64792],"mapped",[1587,1610]],[[64793,64793],"mapped",[1588,1609]],[[64794,64794],"mapped",[1588,1610]],[[64795,64795],"mapped",[1581,1609]],[[64796,64796],"mapped",[1581,1610]],[[64797,64797],"mapped",[1580,1609]],[[64798,64798],"mapped",[1580,1610]],[[64799,64799],"mapped",[1582,1609]],[[64800,64800],"mapped",[1582,1610]],[[64801,64801],"mapped",[1589,1609]],[[64802,64802],"mapped",[1589,1610]],[[64803,64803],"mapped",[1590,1609]],[[64804,64804],"mapped",[1590,1610]],[[64805,64805],"mapped",[1588,1580]],[[64806,64806],"mapped",[1588,1581]],[[64807,64807],"mapped",[1588,1582]],[[64808,64808],"mapped",[1588,1605]],[[64809,64809],"mapped",[1588,1585]],[[64810,64810],"mapped",[1587,1585]],[[64811,64811],"mapped",[1589,1585]],[[64812,64812],"mapped",[1590,1585]],[[64813,64813],"mapped",[1588,1580]],[[64814,64814],"mapped",[1588,1581]],[[64815,64815],"mapped",[1588,1582]],[[64816,64816],"mapped",[1588,1605]],[[64817,64817],"mapped",[1587,1607]],[[64818,64818],"mapped",[1588,1607]],[[64819,64819],"mapped",[1591,1605]],[[64820,64820],"mapped",[1587,1580]],[[64821,64821],"mapped",[1587,1581]],[[64822,64822],"mapped",[1587,1582]],[[64823,64823],"mapped",[1588,1580]],[[64824,64824],"mapped",[1588,1581]],[[64825,64825],"mapped",[1588,1582]],[[64826,64826],"mapped",[1591,1605]],[[64827,64827],"mapped",[1592,1605]],[[64828,64829],"mapped",[1575,1611]],[[64830,64831],"valid",[],"NV8"],[[64832,64847],"disallowed"],[[64848,64848],"mapped",[1578,1580,1605]],[[64849,64850],"mapped",[1578,1581,1580]],[[64851,64851],"mapped",[1578,1581,1605]],[[64852,64852],"mapped",[1578,1582,1605]],[[64853,64853],"mapped",[1578,1605,1580]],[[64854,64854],"mapped",[1578,1605,1581]],[[64855,64855],"mapped",[1578,1605,1582]],[[64856,64857],"mapped",[1580,1605,1581]],[[64858,64858],"mapped",[1581,1605,1610]],[[64859,64859],"mapped",[1581,1605,1609]],[[64860,64860],"mapped",[1587,1581,1580]],[[64861,64861],"mapped",[1587,1580,1581]],[[64862,64862],"mapped",[1587,1580,1609]],[[64863,64864],"mapped",[1587,1605,1581]],[[64865,64865],"mapped",[1587,1605,1580]],[[64866,64867],"mapped",[1587,1605,1605]],[[64868,64869],"mapped",[1589,1581,1581]],[[64870,64870],"mapped",[1589,1605,1605]],[[64871,64872],"mapped",[1588,1581,1605]],[[64873,64873],"mapped",[1588,1580,1610]],[[64874,64875],"mapped",[1588,1605,1582]],[[64876,64877],"mapped",[1588,1605,1605]],[[64878,64878],"mapped",[1590,1581,1609]],[[64879,64880],"mapped",[1590,1582,1605]],[[64881,64882],"mapped",[1591,1605,1581]],[[64883,64883],"mapped",[1591,1605,1605]],[[64884,64884],"mapped",[1591,1605,1610]],[[64885,64885],"mapped",[1593,1580,1605]],[[64886,64887],"mapped",[1593,1605,1605]],[[64888,64888],"mapped",[1593,1605,1609]],[[64889,64889],"mapped",[1594,1605,1605]],[[64890,64890],"mapped",[1594,1605,1610]],[[64891,64891],"mapped",[1594,1605,1609]],[[64892,64893],"mapped",[1601,1582,1605]],[[64894,64894],"mapped",[1602,1605,1581]],[[64895,64895],"mapped",[1602,1605,1605]],[[64896,64896],"mapped",[1604,1581,1605]],[[64897,64897],"mapped",[1604,1581,1610]],[[64898,64898],"mapped",[1604,1581,1609]],[[64899,64900],"mapped",[1604,1580,1580]],[[64901,64902],"mapped",[1604,1582,1605]],[[64903,64904],"mapped",[1604,1605,1581]],[[64905,64905],"mapped",[1605,1581,1580]],[[64906,64906],"mapped",[1605,1581,1605]],[[64907,64907],"mapped",[1605,1581,1610]],[[64908,64908],"mapped",[1605,1580,1581]],[[64909,64909],"mapped",[1605,1580,1605]],[[64910,64910],"mapped",[1605,1582,1580]],[[64911,64911],"mapped",[1605,1582,1605]],[[64912,64913],"disallowed"],[[64914,64914],"mapped",[1605,1580,1582]],[[64915,64915],"mapped",[1607,1605,1580]],[[64916,64916],"mapped",[1607,1605,1605]],[[64917,64917],"mapped",[1606,1581,1605]],[[64918,64918],"mapped",[1606,1581,1609]],[[64919,64920],"mapped",[1606,1580,1605]],[[64921,64921],"mapped",[1606,1580,1609]],[[64922,64922],"mapped",[1606,1605,1610]],[[64923,64923],"mapped",[1606,1605,1609]],[[64924,64925],"mapped",[1610,1605,1605]],[[64926,64926],"mapped",[1576,1582,1610]],[[64927,64927],"mapped",[1578,1580,1610]],[[64928,64928],"mapped",[1578,1580,1609]],[[64929,64929],"mapped",[1578,1582,1610]],[[64930,64930],"mapped",[1578,1582,1609]],[[64931,64931],"mapped",[1578,1605,1610]],[[64932,64932],"mapped",[1578,1605,1609]],[[64933,64933],"mapped",[1580,1605,1610]],[[64934,64934],"mapped",[1580,1581,1609]],[[64935,64935],"mapped",[1580,1605,1609]],[[64936,64936],"mapped",[1587,1582,1609]],[[64937,64937],"mapped",[1589,1581,1610]],[[64938,64938],"mapped",[1588,1581,1610]],[[64939,64939],"mapped",[1590,1581,1610]],[[64940,64940],"mapped",[1604,1580,1610]],[[64941,64941],"mapped",[1604,1605,1610]],[[64942,64942],"mapped",[1610,1581,1610]],[[64943,64943],"mapped",[1610,1580,1610]],[[64944,64944],"mapped",[1610,1605,1610]],[[64945,64945],"mapped",[1605,1605,1610]],[[64946,64946],"mapped",[1602,1605,1610]],[[64947,64947],"mapped",[1606,1581,1610]],[[64948,64948],"mapped",[1602,1605,1581]],[[64949,64949],"mapped",[1604,1581,1605]],[[64950,64950],"mapped",[1593,1605,1610]],[[64951,64951],"mapped",[1603,1605,1610]],[[64952,64952],"mapped",[1606,1580,1581]],[[64953,64953],"mapped",[1605,1582,1610]],[[64954,64954],"mapped",[1604,1580,1605]],[[64955,64955],"mapped",[1603,1605,1605]],[[64956,64956],"mapped",[1604,1580,1605]],[[64957,64957],"mapped",[1606,1580,1581]],[[64958,64958],"mapped",[1580,1581,1610]],[[64959,64959],"mapped",[1581,1580,1610]],[[64960,64960],"mapped",[1605,1580,1610]],[[64961,64961],"mapped",[1601,1605,1610]],[[64962,64962],"mapped",[1576,1581,1610]],[[64963,64963],"mapped",[1603,1605,1605]],[[64964,64964],"mapped",[1593,1580,1605]],[[64965,64965],"mapped",[1589,1605,1605]],[[64966,64966],"mapped",[1587,1582,1610]],[[64967,64967],"mapped",[1606,1580,1610]],[[64968,64975],"disallowed"],[[64976,65007],"disallowed"],[[65008,65008],"mapped",[1589,1604,1746]],[[65009,65009],"mapped",[1602,1604,1746]],[[65010,65010],"mapped",[1575,1604,1604,1607]],[[65011,65011],"mapped",[1575,1603,1576,1585]],[[65012,65012],"mapped",[1605,1581,1605,1583]],[[65013,65013],"mapped",[1589,1604,1593,1605]],[[65014,65014],"mapped",[1585,1587,1608,1604]],[[65015,65015],"mapped",[1593,1604,1610,1607]],[[65016,65016],"mapped",[1608,1587,1604,1605]],[[65017,65017],"mapped",[1589,1604,1609]],[[65018,65018],"disallowed_STD3_mapped",[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605]],[[65019,65019],"disallowed_STD3_mapped",[1580,1604,32,1580,1604,1575,1604,1607]],[[65020,65020],"mapped",[1585,1740,1575,1604]],[[65021,65021],"valid",[],"NV8"],[[65022,65023],"disallowed"],[[65024,65039],"ignored"],[[65040,65040],"disallowed_STD3_mapped",[44]],[[65041,65041],"mapped",[12289]],[[65042,65042],"disallowed"],[[65043,65043],"disallowed_STD3_mapped",[58]],[[65044,65044],"disallowed_STD3_mapped",[59]],[[65045,65045],"disallowed_STD3_mapped",[33]],[[65046,65046],"disallowed_STD3_mapped",[63]],[[65047,65047],"mapped",[12310]],[[65048,65048],"mapped",[12311]],[[65049,65049],"disallowed"],[[65050,65055],"disallowed"],[[65056,65059],"valid"],[[65060,65062],"valid"],[[65063,65069],"valid"],[[65070,65071],"valid"],[[65072,65072],"disallowed"],[[65073,65073],"mapped",[8212]],[[65074,65074],"mapped",[8211]],[[65075,65076],"disallowed_STD3_mapped",[95]],[[65077,65077],"disallowed_STD3_mapped",[40]],[[65078,65078],"disallowed_STD3_mapped",[41]],[[65079,65079],"disallowed_STD3_mapped",[123]],[[65080,65080],"disallowed_STD3_mapped",[125]],[[65081,65081],"mapped",[12308]],[[65082,65082],"mapped",[12309]],[[65083,65083],"mapped",[12304]],[[65084,65084],"mapped",[12305]],[[65085,65085],"mapped",[12298]],[[65086,65086],"mapped",[12299]],[[65087,65087],"mapped",[12296]],[[65088,65088],"mapped",[12297]],[[65089,65089],"mapped",[12300]],[[65090,65090],"mapped",[12301]],[[65091,65091],"mapped",[12302]],[[65092,65092],"mapped",[12303]],[[65093,65094],"valid",[],"NV8"],[[65095,65095],"disallowed_STD3_mapped",[91]],[[65096,65096],"disallowed_STD3_mapped",[93]],[[65097,65100],"disallowed_STD3_mapped",[32,773]],[[65101,65103],"disallowed_STD3_mapped",[95]],[[65104,65104],"disallowed_STD3_mapped",[44]],[[65105,65105],"mapped",[12289]],[[65106,65106],"disallowed"],[[65107,65107],"disallowed"],[[65108,65108],"disallowed_STD3_mapped",[59]],[[65109,65109],"disallowed_STD3_mapped",[58]],[[65110,65110],"disallowed_STD3_mapped",[63]],[[65111,65111],"disallowed_STD3_mapped",[33]],[[65112,65112],"mapped",[8212]],[[65113,65113],"disallowed_STD3_mapped",[40]],[[65114,65114],"disallowed_STD3_mapped",[41]],[[65115,65115],"disallowed_STD3_mapped",[123]],[[65116,65116],"disallowed_STD3_mapped",[125]],[[65117,65117],"mapped",[12308]],[[65118,65118],"mapped",[12309]],[[65119,65119],"disallowed_STD3_mapped",[35]],[[65120,65120],"disallowed_STD3_mapped",[38]],[[65121,65121],"disallowed_STD3_mapped",[42]],[[65122,65122],"disallowed_STD3_mapped",[43]],[[65123,65123],"mapped",[45]],[[65124,65124],"disallowed_STD3_mapped",[60]],[[65125,65125],"disallowed_STD3_mapped",[62]],[[65126,65126],"disallowed_STD3_mapped",[61]],[[65127,65127],"disallowed"],[[65128,65128],"disallowed_STD3_mapped",[92]],[[65129,65129],"disallowed_STD3_mapped",[36]],[[65130,65130],"disallowed_STD3_mapped",[37]],[[65131,65131],"disallowed_STD3_mapped",[64]],[[65132,65135],"disallowed"],[[65136,65136],"disallowed_STD3_mapped",[32,1611]],[[65137,65137],"mapped",[1600,1611]],[[65138,65138],"disallowed_STD3_mapped",[32,1612]],[[65139,65139],"valid"],[[65140,65140],"disallowed_STD3_mapped",[32,1613]],[[65141,65141],"disallowed"],[[65142,65142],"disallowed_STD3_mapped",[32,1614]],[[65143,65143],"mapped",[1600,1614]],[[65144,65144],"disallowed_STD3_mapped",[32,1615]],[[65145,65145],"mapped",[1600,1615]],[[65146,65146],"disallowed_STD3_mapped",[32,1616]],[[65147,65147],"mapped",[1600,1616]],[[65148,65148],"disallowed_STD3_mapped",[32,1617]],[[65149,65149],"mapped",[1600,1617]],[[65150,65150],"disallowed_STD3_mapped",[32,1618]],[[65151,65151],"mapped",[1600,1618]],[[65152,65152],"mapped",[1569]],[[65153,65154],"mapped",[1570]],[[65155,65156],"mapped",[1571]],[[65157,65158],"mapped",[1572]],[[65159,65160],"mapped",[1573]],[[65161,65164],"mapped",[1574]],[[65165,65166],"mapped",[1575]],[[65167,65170],"mapped",[1576]],[[65171,65172],"mapped",[1577]],[[65173,65176],"mapped",[1578]],[[65177,65180],"mapped",[1579]],[[65181,65184],"mapped",[1580]],[[65185,65188],"mapped",[1581]],[[65189,65192],"mapped",[1582]],[[65193,65194],"mapped",[1583]],[[65195,65196],"mapped",[1584]],[[65197,65198],"mapped",[1585]],[[65199,65200],"mapped",[1586]],[[65201,65204],"mapped",[1587]],[[65205,65208],"mapped",[1588]],[[65209,65212],"mapped",[1589]],[[65213,65216],"mapped",[1590]],[[65217,65220],"mapped",[1591]],[[65221,65224],"mapped",[1592]],[[65225,65228],"mapped",[1593]],[[65229,65232],"mapped",[1594]],[[65233,65236],"mapped",[1601]],[[65237,65240],"mapped",[1602]],[[65241,65244],"mapped",[1603]],[[65245,65248],"mapped",[1604]],[[65249,65252],"mapped",[1605]],[[65253,65256],"mapped",[1606]],[[65257,65260],"mapped",[1607]],[[65261,65262],"mapped",[1608]],[[65263,65264],"mapped",[1609]],[[65265,65268],"mapped",[1610]],[[65269,65270],"mapped",[1604,1570]],[[65271,65272],"mapped",[1604,1571]],[[65273,65274],"mapped",[1604,1573]],[[65275,65276],"mapped",[1604,1575]],[[65277,65278],"disallowed"],[[65279,65279],"ignored"],[[65280,65280],"disallowed"],[[65281,65281],"disallowed_STD3_mapped",[33]],[[65282,65282],"disallowed_STD3_mapped",[34]],[[65283,65283],"disallowed_STD3_mapped",[35]],[[65284,65284],"disallowed_STD3_mapped",[36]],[[65285,65285],"disallowed_STD3_mapped",[37]],[[65286,65286],"disallowed_STD3_mapped",[38]],[[65287,65287],"disallowed_STD3_mapped",[39]],[[65288,65288],"disallowed_STD3_mapped",[40]],[[65289,65289],"disallowed_STD3_mapped",[41]],[[65290,65290],"disallowed_STD3_mapped",[42]],[[65291,65291],"disallowed_STD3_mapped",[43]],[[65292,65292],"disallowed_STD3_mapped",[44]],[[65293,65293],"mapped",[45]],[[65294,65294],"mapped",[46]],[[65295,65295],"disallowed_STD3_mapped",[47]],[[65296,65296],"mapped",[48]],[[65297,65297],"mapped",[49]],[[65298,65298],"mapped",[50]],[[65299,65299],"mapped",[51]],[[65300,65300],"mapped",[52]],[[65301,65301],"mapped",[53]],[[65302,65302],"mapped",[54]],[[65303,65303],"mapped",[55]],[[65304,65304],"mapped",[56]],[[65305,65305],"mapped",[57]],[[65306,65306],"disallowed_STD3_mapped",[58]],[[65307,65307],"disallowed_STD3_mapped",[59]],[[65308,65308],"disallowed_STD3_mapped",[60]],[[65309,65309],"disallowed_STD3_mapped",[61]],[[65310,65310],"disallowed_STD3_mapped",[62]],[[65311,65311],"disallowed_STD3_mapped",[63]],[[65312,65312],"disallowed_STD3_mapped",[64]],[[65313,65313],"mapped",[97]],[[65314,65314],"mapped",[98]],[[65315,65315],"mapped",[99]],[[65316,65316],"mapped",[100]],[[65317,65317],"mapped",[101]],[[65318,65318],"mapped",[102]],[[65319,65319],"mapped",[103]],[[65320,65320],"mapped",[104]],[[65321,65321],"mapped",[105]],[[65322,65322],"mapped",[106]],[[65323,65323],"mapped",[107]],[[65324,65324],"mapped",[108]],[[65325,65325],"mapped",[109]],[[65326,65326],"mapped",[110]],[[65327,65327],"mapped",[111]],[[65328,65328],"mapped",[112]],[[65329,65329],"mapped",[113]],[[65330,65330],"mapped",[114]],[[65331,65331],"mapped",[115]],[[65332,65332],"mapped",[116]],[[65333,65333],"mapped",[117]],[[65334,65334],"mapped",[118]],[[65335,65335],"mapped",[119]],[[65336,65336],"mapped",[120]],[[65337,65337],"mapped",[121]],[[65338,65338],"mapped",[122]],[[65339,65339],"disallowed_STD3_mapped",[91]],[[65340,65340],"disallowed_STD3_mapped",[92]],[[65341,65341],"disallowed_STD3_mapped",[93]],[[65342,65342],"disallowed_STD3_mapped",[94]],[[65343,65343],"disallowed_STD3_mapped",[95]],[[65344,65344],"disallowed_STD3_mapped",[96]],[[65345,65345],"mapped",[97]],[[65346,65346],"mapped",[98]],[[65347,65347],"mapped",[99]],[[65348,65348],"mapped",[100]],[[65349,65349],"mapped",[101]],[[65350,65350],"mapped",[102]],[[65351,65351],"mapped",[103]],[[65352,65352],"mapped",[104]],[[65353,65353],"mapped",[105]],[[65354,65354],"mapped",[106]],[[65355,65355],"mapped",[107]],[[65356,65356],"mapped",[108]],[[65357,65357],"mapped",[109]],[[65358,65358],"mapped",[110]],[[65359,65359],"mapped",[111]],[[65360,65360],"mapped",[112]],[[65361,65361],"mapped",[113]],[[65362,65362],"mapped",[114]],[[65363,65363],"mapped",[115]],[[65364,65364],"mapped",[116]],[[65365,65365],"mapped",[117]],[[65366,65366],"mapped",[118]],[[65367,65367],"mapped",[119]],[[65368,65368],"mapped",[120]],[[65369,65369],"mapped",[121]],[[65370,65370],"mapped",[122]],[[65371,65371],"disallowed_STD3_mapped",[123]],[[65372,65372],"disallowed_STD3_mapped",[124]],[[65373,65373],"disallowed_STD3_mapped",[125]],[[65374,65374],"disallowed_STD3_mapped",[126]],[[65375,65375],"mapped",[10629]],[[65376,65376],"mapped",[10630]],[[65377,65377],"mapped",[46]],[[65378,65378],"mapped",[12300]],[[65379,65379],"mapped",[12301]],[[65380,65380],"mapped",[12289]],[[65381,65381],"mapped",[12539]],[[65382,65382],"mapped",[12530]],[[65383,65383],"mapped",[12449]],[[65384,65384],"mapped",[12451]],[[65385,65385],"mapped",[12453]],[[65386,65386],"mapped",[12455]],[[65387,65387],"mapped",[12457]],[[65388,65388],"mapped",[12515]],[[65389,65389],"mapped",[12517]],[[65390,65390],"mapped",[12519]],[[65391,65391],"mapped",[12483]],[[65392,65392],"mapped",[12540]],[[65393,65393],"mapped",[12450]],[[65394,65394],"mapped",[12452]],[[65395,65395],"mapped",[12454]],[[65396,65396],"mapped",[12456]],[[65397,65397],"mapped",[12458]],[[65398,65398],"mapped",[12459]],[[65399,65399],"mapped",[12461]],[[65400,65400],"mapped",[12463]],[[65401,65401],"mapped",[12465]],[[65402,65402],"mapped",[12467]],[[65403,65403],"mapped",[12469]],[[65404,65404],"mapped",[12471]],[[65405,65405],"mapped",[12473]],[[65406,65406],"mapped",[12475]],[[65407,65407],"mapped",[12477]],[[65408,65408],"mapped",[12479]],[[65409,65409],"mapped",[12481]],[[65410,65410],"mapped",[12484]],[[65411,65411],"mapped",[12486]],[[65412,65412],"mapped",[12488]],[[65413,65413],"mapped",[12490]],[[65414,65414],"mapped",[12491]],[[65415,65415],"mapped",[12492]],[[65416,65416],"mapped",[12493]],[[65417,65417],"mapped",[12494]],[[65418,65418],"mapped",[12495]],[[65419,65419],"mapped",[12498]],[[65420,65420],"mapped",[12501]],[[65421,65421],"mapped",[12504]],[[65422,65422],"mapped",[12507]],[[65423,65423],"mapped",[12510]],[[65424,65424],"mapped",[12511]],[[65425,65425],"mapped",[12512]],[[65426,65426],"mapped",[12513]],[[65427,65427],"mapped",[12514]],[[65428,65428],"mapped",[12516]],[[65429,65429],"mapped",[12518]],[[65430,65430],"mapped",[12520]],[[65431,65431],"mapped",[12521]],[[65432,65432],"mapped",[12522]],[[65433,65433],"mapped",[12523]],[[65434,65434],"mapped",[12524]],[[65435,65435],"mapped",[12525]],[[65436,65436],"mapped",[12527]],[[65437,65437],"mapped",[12531]],[[65438,65438],"mapped",[12441]],[[65439,65439],"mapped",[12442]],[[65440,65440],"disallowed"],[[65441,65441],"mapped",[4352]],[[65442,65442],"mapped",[4353]],[[65443,65443],"mapped",[4522]],[[65444,65444],"mapped",[4354]],[[65445,65445],"mapped",[4524]],[[65446,65446],"mapped",[4525]],[[65447,65447],"mapped",[4355]],[[65448,65448],"mapped",[4356]],[[65449,65449],"mapped",[4357]],[[65450,65450],"mapped",[4528]],[[65451,65451],"mapped",[4529]],[[65452,65452],"mapped",[4530]],[[65453,65453],"mapped",[4531]],[[65454,65454],"mapped",[4532]],[[65455,65455],"mapped",[4533]],[[65456,65456],"mapped",[4378]],[[65457,65457],"mapped",[4358]],[[65458,65458],"mapped",[4359]],[[65459,65459],"mapped",[4360]],[[65460,65460],"mapped",[4385]],[[65461,65461],"mapped",[4361]],[[65462,65462],"mapped",[4362]],[[65463,65463],"mapped",[4363]],[[65464,65464],"mapped",[4364]],[[65465,65465],"mapped",[4365]],[[65466,65466],"mapped",[4366]],[[65467,65467],"mapped",[4367]],[[65468,65468],"mapped",[4368]],[[65469,65469],"mapped",[4369]],[[65470,65470],"mapped",[4370]],[[65471,65473],"disallowed"],[[65474,65474],"mapped",[4449]],[[65475,65475],"mapped",[4450]],[[65476,65476],"mapped",[4451]],[[65477,65477],"mapped",[4452]],[[65478,65478],"mapped",[4453]],[[65479,65479],"mapped",[4454]],[[65480,65481],"disallowed"],[[65482,65482],"mapped",[4455]],[[65483,65483],"mapped",[4456]],[[65484,65484],"mapped",[4457]],[[65485,65485],"mapped",[4458]],[[65486,65486],"mapped",[4459]],[[65487,65487],"mapped",[4460]],[[65488,65489],"disallowed"],[[65490,65490],"mapped",[4461]],[[65491,65491],"mapped",[4462]],[[65492,65492],"mapped",[4463]],[[65493,65493],"mapped",[4464]],[[65494,65494],"mapped",[4465]],[[65495,65495],"mapped",[4466]],[[65496,65497],"disallowed"],[[65498,65498],"mapped",[4467]],[[65499,65499],"mapped",[4468]],[[65500,65500],"mapped",[4469]],[[65501,65503],"disallowed"],[[65504,65504],"mapped",[162]],[[65505,65505],"mapped",[163]],[[65506,65506],"mapped",[172]],[[65507,65507],"disallowed_STD3_mapped",[32,772]],[[65508,65508],"mapped",[166]],[[65509,65509],"mapped",[165]],[[65510,65510],"mapped",[8361]],[[65511,65511],"disallowed"],[[65512,65512],"mapped",[9474]],[[65513,65513],"mapped",[8592]],[[65514,65514],"mapped",[8593]],[[65515,65515],"mapped",[8594]],[[65516,65516],"mapped",[8595]],[[65517,65517],"mapped",[9632]],[[65518,65518],"mapped",[9675]],[[65519,65528],"disallowed"],[[65529,65531],"disallowed"],[[65532,65532],"disallowed"],[[65533,65533],"disallowed"],[[65534,65535],"disallowed"],[[65536,65547],"valid"],[[65548,65548],"disallowed"],[[65549,65574],"valid"],[[65575,65575],"disallowed"],[[65576,65594],"valid"],[[65595,65595],"disallowed"],[[65596,65597],"valid"],[[65598,65598],"disallowed"],[[65599,65613],"valid"],[[65614,65615],"disallowed"],[[65616,65629],"valid"],[[65630,65663],"disallowed"],[[65664,65786],"valid"],[[65787,65791],"disallowed"],[[65792,65794],"valid",[],"NV8"],[[65795,65798],"disallowed"],[[65799,65843],"valid",[],"NV8"],[[65844,65846],"disallowed"],[[65847,65855],"valid",[],"NV8"],[[65856,65930],"valid",[],"NV8"],[[65931,65932],"valid",[],"NV8"],[[65933,65935],"disallowed"],[[65936,65947],"valid",[],"NV8"],[[65948,65951],"disallowed"],[[65952,65952],"valid",[],"NV8"],[[65953,65999],"disallowed"],[[66000,66044],"valid",[],"NV8"],[[66045,66045],"valid"],[[66046,66175],"disallowed"],[[66176,66204],"valid"],[[66205,66207],"disallowed"],[[66208,66256],"valid"],[[66257,66271],"disallowed"],[[66272,66272],"valid"],[[66273,66299],"valid",[],"NV8"],[[66300,66303],"disallowed"],[[66304,66334],"valid"],[[66335,66335],"valid"],[[66336,66339],"valid",[],"NV8"],[[66340,66351],"disallowed"],[[66352,66368],"valid"],[[66369,66369],"valid",[],"NV8"],[[66370,66377],"valid"],[[66378,66378],"valid",[],"NV8"],[[66379,66383],"disallowed"],[[66384,66426],"valid"],[[66427,66431],"disallowed"],[[66432,66461],"valid"],[[66462,66462],"disallowed"],[[66463,66463],"valid",[],"NV8"],[[66464,66499],"valid"],[[66500,66503],"disallowed"],[[66504,66511],"valid"],[[66512,66517],"valid",[],"NV8"],[[66518,66559],"disallowed"],[[66560,66560],"mapped",[66600]],[[66561,66561],"mapped",[66601]],[[66562,66562],"mapped",[66602]],[[66563,66563],"mapped",[66603]],[[66564,66564],"mapped",[66604]],[[66565,66565],"mapped",[66605]],[[66566,66566],"mapped",[66606]],[[66567,66567],"mapped",[66607]],[[66568,66568],"mapped",[66608]],[[66569,66569],"mapped",[66609]],[[66570,66570],"mapped",[66610]],[[66571,66571],"mapped",[66611]],[[66572,66572],"mapped",[66612]],[[66573,66573],"mapped",[66613]],[[66574,66574],"mapped",[66614]],[[66575,66575],"mapped",[66615]],[[66576,66576],"mapped",[66616]],[[66577,66577],"mapped",[66617]],[[66578,66578],"mapped",[66618]],[[66579,66579],"mapped",[66619]],[[66580,66580],"mapped",[66620]],[[66581,66581],"mapped",[66621]],[[66582,66582],"mapped",[66622]],[[66583,66583],"mapped",[66623]],[[66584,66584],"mapped",[66624]],[[66585,66585],"mapped",[66625]],[[66586,66586],"mapped",[66626]],[[66587,66587],"mapped",[66627]],[[66588,66588],"mapped",[66628]],[[66589,66589],"mapped",[66629]],[[66590,66590],"mapped",[66630]],[[66591,66591],"mapped",[66631]],[[66592,66592],"mapped",[66632]],[[66593,66593],"mapped",[66633]],[[66594,66594],"mapped",[66634]],[[66595,66595],"mapped",[66635]],[[66596,66596],"mapped",[66636]],[[66597,66597],"mapped",[66637]],[[66598,66598],"mapped",[66638]],[[66599,66599],"mapped",[66639]],[[66600,66637],"valid"],[[66638,66717],"valid"],[[66718,66719],"disallowed"],[[66720,66729],"valid"],[[66730,66815],"disallowed"],[[66816,66855],"valid"],[[66856,66863],"disallowed"],[[66864,66915],"valid"],[[66916,66926],"disallowed"],[[66927,66927],"valid",[],"NV8"],[[66928,67071],"disallowed"],[[67072,67382],"valid"],[[67383,67391],"disallowed"],[[67392,67413],"valid"],[[67414,67423],"disallowed"],[[67424,67431],"valid"],[[67432,67583],"disallowed"],[[67584,67589],"valid"],[[67590,67591],"disallowed"],[[67592,67592],"valid"],[[67593,67593],"disallowed"],[[67594,67637],"valid"],[[67638,67638],"disallowed"],[[67639,67640],"valid"],[[67641,67643],"disallowed"],[[67644,67644],"valid"],[[67645,67646],"disallowed"],[[67647,67647],"valid"],[[67648,67669],"valid"],[[67670,67670],"disallowed"],[[67671,67679],"valid",[],"NV8"],[[67680,67702],"valid"],[[67703,67711],"valid",[],"NV8"],[[67712,67742],"valid"],[[67743,67750],"disallowed"],[[67751,67759],"valid",[],"NV8"],[[67760,67807],"disallowed"],[[67808,67826],"valid"],[[67827,67827],"disallowed"],[[67828,67829],"valid"],[[67830,67834],"disallowed"],[[67835,67839],"valid",[],"NV8"],[[67840,67861],"valid"],[[67862,67865],"valid",[],"NV8"],[[67866,67867],"valid",[],"NV8"],[[67868,67870],"disallowed"],[[67871,67871],"valid",[],"NV8"],[[67872,67897],"valid"],[[67898,67902],"disallowed"],[[67903,67903],"valid",[],"NV8"],[[67904,67967],"disallowed"],[[67968,68023],"valid"],[[68024,68027],"disallowed"],[[68028,68029],"valid",[],"NV8"],[[68030,68031],"valid"],[[68032,68047],"valid",[],"NV8"],[[68048,68049],"disallowed"],[[68050,68095],"valid",[],"NV8"],[[68096,68099],"valid"],[[68100,68100],"disallowed"],[[68101,68102],"valid"],[[68103,68107],"disallowed"],[[68108,68115],"valid"],[[68116,68116],"disallowed"],[[68117,68119],"valid"],[[68120,68120],"disallowed"],[[68121,68147],"valid"],[[68148,68151],"disallowed"],[[68152,68154],"valid"],[[68155,68158],"disallowed"],[[68159,68159],"valid"],[[68160,68167],"valid",[],"NV8"],[[68168,68175],"disallowed"],[[68176,68184],"valid",[],"NV8"],[[68185,68191],"disallowed"],[[68192,68220],"valid"],[[68221,68223],"valid",[],"NV8"],[[68224,68252],"valid"],[[68253,68255],"valid",[],"NV8"],[[68256,68287],"disallowed"],[[68288,68295],"valid"],[[68296,68296],"valid",[],"NV8"],[[68297,68326],"valid"],[[68327,68330],"disallowed"],[[68331,68342],"valid",[],"NV8"],[[68343,68351],"disallowed"],[[68352,68405],"valid"],[[68406,68408],"disallowed"],[[68409,68415],"valid",[],"NV8"],[[68416,68437],"valid"],[[68438,68439],"disallowed"],[[68440,68447],"valid",[],"NV8"],[[68448,68466],"valid"],[[68467,68471],"disallowed"],[[68472,68479],"valid",[],"NV8"],[[68480,68497],"valid"],[[68498,68504],"disallowed"],[[68505,68508],"valid",[],"NV8"],[[68509,68520],"disallowed"],[[68521,68527],"valid",[],"NV8"],[[68528,68607],"disallowed"],[[68608,68680],"valid"],[[68681,68735],"disallowed"],[[68736,68736],"mapped",[68800]],[[68737,68737],"mapped",[68801]],[[68738,68738],"mapped",[68802]],[[68739,68739],"mapped",[68803]],[[68740,68740],"mapped",[68804]],[[68741,68741],"mapped",[68805]],[[68742,68742],"mapped",[68806]],[[68743,68743],"mapped",[68807]],[[68744,68744],"mapped",[68808]],[[68745,68745],"mapped",[68809]],[[68746,68746],"mapped",[68810]],[[68747,68747],"mapped",[68811]],[[68748,68748],"mapped",[68812]],[[68749,68749],"mapped",[68813]],[[68750,68750],"mapped",[68814]],[[68751,68751],"mapped",[68815]],[[68752,68752],"mapped",[68816]],[[68753,68753],"mapped",[68817]],[[68754,68754],"mapped",[68818]],[[68755,68755],"mapped",[68819]],[[68756,68756],"mapped",[68820]],[[68757,68757],"mapped",[68821]],[[68758,68758],"mapped",[68822]],[[68759,68759],"mapped",[68823]],[[68760,68760],"mapped",[68824]],[[68761,68761],"mapped",[68825]],[[68762,68762],"mapped",[68826]],[[68763,68763],"mapped",[68827]],[[68764,68764],"mapped",[68828]],[[68765,68765],"mapped",[68829]],[[68766,68766],"mapped",[68830]],[[68767,68767],"mapped",[68831]],[[68768,68768],"mapped",[68832]],[[68769,68769],"mapped",[68833]],[[68770,68770],"mapped",[68834]],[[68771,68771],"mapped",[68835]],[[68772,68772],"mapped",[68836]],[[68773,68773],"mapped",[68837]],[[68774,68774],"mapped",[68838]],[[68775,68775],"mapped",[68839]],[[68776,68776],"mapped",[68840]],[[68777,68777],"mapped",[68841]],[[68778,68778],"mapped",[68842]],[[68779,68779],"mapped",[68843]],[[68780,68780],"mapped",[68844]],[[68781,68781],"mapped",[68845]],[[68782,68782],"mapped",[68846]],[[68783,68783],"mapped",[68847]],[[68784,68784],"mapped",[68848]],[[68785,68785],"mapped",[68849]],[[68786,68786],"mapped",[68850]],[[68787,68799],"disallowed"],[[68800,68850],"valid"],[[68851,68857],"disallowed"],[[68858,68863],"valid",[],"NV8"],[[68864,69215],"disallowed"],[[69216,69246],"valid",[],"NV8"],[[69247,69631],"disallowed"],[[69632,69702],"valid"],[[69703,69709],"valid",[],"NV8"],[[69710,69713],"disallowed"],[[69714,69733],"valid",[],"NV8"],[[69734,69743],"valid"],[[69744,69758],"disallowed"],[[69759,69759],"valid"],[[69760,69818],"valid"],[[69819,69820],"valid",[],"NV8"],[[69821,69821],"disallowed"],[[69822,69825],"valid",[],"NV8"],[[69826,69839],"disallowed"],[[69840,69864],"valid"],[[69865,69871],"disallowed"],[[69872,69881],"valid"],[[69882,69887],"disallowed"],[[69888,69940],"valid"],[[69941,69941],"disallowed"],[[69942,69951],"valid"],[[69952,69955],"valid",[],"NV8"],[[69956,69967],"disallowed"],[[69968,70003],"valid"],[[70004,70005],"valid",[],"NV8"],[[70006,70006],"valid"],[[70007,70015],"disallowed"],[[70016,70084],"valid"],[[70085,70088],"valid",[],"NV8"],[[70089,70089],"valid",[],"NV8"],[[70090,70092],"valid"],[[70093,70093],"valid",[],"NV8"],[[70094,70095],"disallowed"],[[70096,70105],"valid"],[[70106,70106],"valid"],[[70107,70107],"valid",[],"NV8"],[[70108,70108],"valid"],[[70109,70111],"valid",[],"NV8"],[[70112,70112],"disallowed"],[[70113,70132],"valid",[],"NV8"],[[70133,70143],"disallowed"],[[70144,70161],"valid"],[[70162,70162],"disallowed"],[[70163,70199],"valid"],[[70200,70205],"valid",[],"NV8"],[[70206,70271],"disallowed"],[[70272,70278],"valid"],[[70279,70279],"disallowed"],[[70280,70280],"valid"],[[70281,70281],"disallowed"],[[70282,70285],"valid"],[[70286,70286],"disallowed"],[[70287,70301],"valid"],[[70302,70302],"disallowed"],[[70303,70312],"valid"],[[70313,70313],"valid",[],"NV8"],[[70314,70319],"disallowed"],[[70320,70378],"valid"],[[70379,70383],"disallowed"],[[70384,70393],"valid"],[[70394,70399],"disallowed"],[[70400,70400],"valid"],[[70401,70403],"valid"],[[70404,70404],"disallowed"],[[70405,70412],"valid"],[[70413,70414],"disallowed"],[[70415,70416],"valid"],[[70417,70418],"disallowed"],[[70419,70440],"valid"],[[70441,70441],"disallowed"],[[70442,70448],"valid"],[[70449,70449],"disallowed"],[[70450,70451],"valid"],[[70452,70452],"disallowed"],[[70453,70457],"valid"],[[70458,70459],"disallowed"],[[70460,70468],"valid"],[[70469,70470],"disallowed"],[[70471,70472],"valid"],[[70473,70474],"disallowed"],[[70475,70477],"valid"],[[70478,70479],"disallowed"],[[70480,70480],"valid"],[[70481,70486],"disallowed"],[[70487,70487],"valid"],[[70488,70492],"disallowed"],[[70493,70499],"valid"],[[70500,70501],"disallowed"],[[70502,70508],"valid"],[[70509,70511],"disallowed"],[[70512,70516],"valid"],[[70517,70783],"disallowed"],[[70784,70853],"valid"],[[70854,70854],"valid",[],"NV8"],[[70855,70855],"valid"],[[70856,70863],"disallowed"],[[70864,70873],"valid"],[[70874,71039],"disallowed"],[[71040,71093],"valid"],[[71094,71095],"disallowed"],[[71096,71104],"valid"],[[71105,71113],"valid",[],"NV8"],[[71114,71127],"valid",[],"NV8"],[[71128,71133],"valid"],[[71134,71167],"disallowed"],[[71168,71232],"valid"],[[71233,71235],"valid",[],"NV8"],[[71236,71236],"valid"],[[71237,71247],"disallowed"],[[71248,71257],"valid"],[[71258,71295],"disallowed"],[[71296,71351],"valid"],[[71352,71359],"disallowed"],[[71360,71369],"valid"],[[71370,71423],"disallowed"],[[71424,71449],"valid"],[[71450,71452],"disallowed"],[[71453,71467],"valid"],[[71468,71471],"disallowed"],[[71472,71481],"valid"],[[71482,71487],"valid",[],"NV8"],[[71488,71839],"disallowed"],[[71840,71840],"mapped",[71872]],[[71841,71841],"mapped",[71873]],[[71842,71842],"mapped",[71874]],[[71843,71843],"mapped",[71875]],[[71844,71844],"mapped",[71876]],[[71845,71845],"mapped",[71877]],[[71846,71846],"mapped",[71878]],[[71847,71847],"mapped",[71879]],[[71848,71848],"mapped",[71880]],[[71849,71849],"mapped",[71881]],[[71850,71850],"mapped",[71882]],[[71851,71851],"mapped",[71883]],[[71852,71852],"mapped",[71884]],[[71853,71853],"mapped",[71885]],[[71854,71854],"mapped",[71886]],[[71855,71855],"mapped",[71887]],[[71856,71856],"mapped",[71888]],[[71857,71857],"mapped",[71889]],[[71858,71858],"mapped",[71890]],[[71859,71859],"mapped",[71891]],[[71860,71860],"mapped",[71892]],[[71861,71861],"mapped",[71893]],[[71862,71862],"mapped",[71894]],[[71863,71863],"mapped",[71895]],[[71864,71864],"mapped",[71896]],[[71865,71865],"mapped",[71897]],[[71866,71866],"mapped",[71898]],[[71867,71867],"mapped",[71899]],[[71868,71868],"mapped",[71900]],[[71869,71869],"mapped",[71901]],[[71870,71870],"mapped",[71902]],[[71871,71871],"mapped",[71903]],[[71872,71913],"valid"],[[71914,71922],"valid",[],"NV8"],[[71923,71934],"disallowed"],[[71935,71935],"valid"],[[71936,72383],"disallowed"],[[72384,72440],"valid"],[[72441,73727],"disallowed"],[[73728,74606],"valid"],[[74607,74648],"valid"],[[74649,74649],"valid"],[[74650,74751],"disallowed"],[[74752,74850],"valid",[],"NV8"],[[74851,74862],"valid",[],"NV8"],[[74863,74863],"disallowed"],[[74864,74867],"valid",[],"NV8"],[[74868,74868],"valid",[],"NV8"],[[74869,74879],"disallowed"],[[74880,75075],"valid"],[[75076,77823],"disallowed"],[[77824,78894],"valid"],[[78895,82943],"disallowed"],[[82944,83526],"valid"],[[83527,92159],"disallowed"],[[92160,92728],"valid"],[[92729,92735],"disallowed"],[[92736,92766],"valid"],[[92767,92767],"disallowed"],[[92768,92777],"valid"],[[92778,92781],"disallowed"],[[92782,92783],"valid",[],"NV8"],[[92784,92879],"disallowed"],[[92880,92909],"valid"],[[92910,92911],"disallowed"],[[92912,92916],"valid"],[[92917,92917],"valid",[],"NV8"],[[92918,92927],"disallowed"],[[92928,92982],"valid"],[[92983,92991],"valid",[],"NV8"],[[92992,92995],"valid"],[[92996,92997],"valid",[],"NV8"],[[92998,93007],"disallowed"],[[93008,93017],"valid"],[[93018,93018],"disallowed"],[[93019,93025],"valid",[],"NV8"],[[93026,93026],"disallowed"],[[93027,93047],"valid"],[[93048,93052],"disallowed"],[[93053,93071],"valid"],[[93072,93951],"disallowed"],[[93952,94020],"valid"],[[94021,94031],"disallowed"],[[94032,94078],"valid"],[[94079,94094],"disallowed"],[[94095,94111],"valid"],[[94112,110591],"disallowed"],[[110592,110593],"valid"],[[110594,113663],"disallowed"],[[113664,113770],"valid"],[[113771,113775],"disallowed"],[[113776,113788],"valid"],[[113789,113791],"disallowed"],[[113792,113800],"valid"],[[113801,113807],"disallowed"],[[113808,113817],"valid"],[[113818,113819],"disallowed"],[[113820,113820],"valid",[],"NV8"],[[113821,113822],"valid"],[[113823,113823],"valid",[],"NV8"],[[113824,113827],"ignored"],[[113828,118783],"disallowed"],[[118784,119029],"valid",[],"NV8"],[[119030,119039],"disallowed"],[[119040,119078],"valid",[],"NV8"],[[119079,119080],"disallowed"],[[119081,119081],"valid",[],"NV8"],[[119082,119133],"valid",[],"NV8"],[[119134,119134],"mapped",[119127,119141]],[[119135,119135],"mapped",[119128,119141]],[[119136,119136],"mapped",[119128,119141,119150]],[[119137,119137],"mapped",[119128,119141,119151]],[[119138,119138],"mapped",[119128,119141,119152]],[[119139,119139],"mapped",[119128,119141,119153]],[[119140,119140],"mapped",[119128,119141,119154]],[[119141,119154],"valid",[],"NV8"],[[119155,119162],"disallowed"],[[119163,119226],"valid",[],"NV8"],[[119227,119227],"mapped",[119225,119141]],[[119228,119228],"mapped",[119226,119141]],[[119229,119229],"mapped",[119225,119141,119150]],[[119230,119230],"mapped",[119226,119141,119150]],[[119231,119231],"mapped",[119225,119141,119151]],[[119232,119232],"mapped",[119226,119141,119151]],[[119233,119261],"valid",[],"NV8"],[[119262,119272],"valid",[],"NV8"],[[119273,119295],"disallowed"],[[119296,119365],"valid",[],"NV8"],[[119366,119551],"disallowed"],[[119552,119638],"valid",[],"NV8"],[[119639,119647],"disallowed"],[[119648,119665],"valid",[],"NV8"],[[119666,119807],"disallowed"],[[119808,119808],"mapped",[97]],[[119809,119809],"mapped",[98]],[[119810,119810],"mapped",[99]],[[119811,119811],"mapped",[100]],[[119812,119812],"mapped",[101]],[[119813,119813],"mapped",[102]],[[119814,119814],"mapped",[103]],[[119815,119815],"mapped",[104]],[[119816,119816],"mapped",[105]],[[119817,119817],"mapped",[106]],[[119818,119818],"mapped",[107]],[[119819,119819],"mapped",[108]],[[119820,119820],"mapped",[109]],[[119821,119821],"mapped",[110]],[[119822,119822],"mapped",[111]],[[119823,119823],"mapped",[112]],[[119824,119824],"mapped",[113]],[[119825,119825],"mapped",[114]],[[119826,119826],"mapped",[115]],[[119827,119827],"mapped",[116]],[[119828,119828],"mapped",[117]],[[119829,119829],"mapped",[118]],[[119830,119830],"mapped",[119]],[[119831,119831],"mapped",[120]],[[119832,119832],"mapped",[121]],[[119833,119833],"mapped",[122]],[[119834,119834],"mapped",[97]],[[119835,119835],"mapped",[98]],[[119836,119836],"mapped",[99]],[[119837,119837],"mapped",[100]],[[119838,119838],"mapped",[101]],[[119839,119839],"mapped",[102]],[[119840,119840],"mapped",[103]],[[119841,119841],"mapped",[104]],[[119842,119842],"mapped",[105]],[[119843,119843],"mapped",[106]],[[119844,119844],"mapped",[107]],[[119845,119845],"mapped",[108]],[[119846,119846],"mapped",[109]],[[119847,119847],"mapped",[110]],[[119848,119848],"mapped",[111]],[[119849,119849],"mapped",[112]],[[119850,119850],"mapped",[113]],[[119851,119851],"mapped",[114]],[[119852,119852],"mapped",[115]],[[119853,119853],"mapped",[116]],[[119854,119854],"mapped",[117]],[[119855,119855],"mapped",[118]],[[119856,119856],"mapped",[119]],[[119857,119857],"mapped",[120]],[[119858,119858],"mapped",[121]],[[119859,119859],"mapped",[122]],[[119860,119860],"mapped",[97]],[[119861,119861],"mapped",[98]],[[119862,119862],"mapped",[99]],[[119863,119863],"mapped",[100]],[[119864,119864],"mapped",[101]],[[119865,119865],"mapped",[102]],[[119866,119866],"mapped",[103]],[[119867,119867],"mapped",[104]],[[119868,119868],"mapped",[105]],[[119869,119869],"mapped",[106]],[[119870,119870],"mapped",[107]],[[119871,119871],"mapped",[108]],[[119872,119872],"mapped",[109]],[[119873,119873],"mapped",[110]],[[119874,119874],"mapped",[111]],[[119875,119875],"mapped",[112]],[[119876,119876],"mapped",[113]],[[119877,119877],"mapped",[114]],[[119878,119878],"mapped",[115]],[[119879,119879],"mapped",[116]],[[119880,119880],"mapped",[117]],[[119881,119881],"mapped",[118]],[[119882,119882],"mapped",[119]],[[119883,119883],"mapped",[120]],[[119884,119884],"mapped",[121]],[[119885,119885],"mapped",[122]],[[119886,119886],"mapped",[97]],[[119887,119887],"mapped",[98]],[[119888,119888],"mapped",[99]],[[119889,119889],"mapped",[100]],[[119890,119890],"mapped",[101]],[[119891,119891],"mapped",[102]],[[119892,119892],"mapped",[103]],[[119893,119893],"disallowed"],[[119894,119894],"mapped",[105]],[[119895,119895],"mapped",[106]],[[119896,119896],"mapped",[107]],[[119897,119897],"mapped",[108]],[[119898,119898],"mapped",[109]],[[119899,119899],"mapped",[110]],[[119900,119900],"mapped",[111]],[[119901,119901],"mapped",[112]],[[119902,119902],"mapped",[113]],[[119903,119903],"mapped",[114]],[[119904,119904],"mapped",[115]],[[119905,119905],"mapped",[116]],[[119906,119906],"mapped",[117]],[[119907,119907],"mapped",[118]],[[119908,119908],"mapped",[119]],[[119909,119909],"mapped",[120]],[[119910,119910],"mapped",[121]],[[119911,119911],"mapped",[122]],[[119912,119912],"mapped",[97]],[[119913,119913],"mapped",[98]],[[119914,119914],"mapped",[99]],[[119915,119915],"mapped",[100]],[[119916,119916],"mapped",[101]],[[119917,119917],"mapped",[102]],[[119918,119918],"mapped",[103]],[[119919,119919],"mapped",[104]],[[119920,119920],"mapped",[105]],[[119921,119921],"mapped",[106]],[[119922,119922],"mapped",[107]],[[119923,119923],"mapped",[108]],[[119924,119924],"mapped",[109]],[[119925,119925],"mapped",[110]],[[119926,119926],"mapped",[111]],[[119927,119927],"mapped",[112]],[[119928,119928],"mapped",[113]],[[119929,119929],"mapped",[114]],[[119930,119930],"mapped",[115]],[[119931,119931],"mapped",[116]],[[119932,119932],"mapped",[117]],[[119933,119933],"mapped",[118]],[[119934,119934],"mapped",[119]],[[119935,119935],"mapped",[120]],[[119936,119936],"mapped",[121]],[[119937,119937],"mapped",[122]],[[119938,119938],"mapped",[97]],[[119939,119939],"mapped",[98]],[[119940,119940],"mapped",[99]],[[119941,119941],"mapped",[100]],[[119942,119942],"mapped",[101]],[[119943,119943],"mapped",[102]],[[119944,119944],"mapped",[103]],[[119945,119945],"mapped",[104]],[[119946,119946],"mapped",[105]],[[119947,119947],"mapped",[106]],[[119948,119948],"mapped",[107]],[[119949,119949],"mapped",[108]],[[119950,119950],"mapped",[109]],[[119951,119951],"mapped",[110]],[[119952,119952],"mapped",[111]],[[119953,119953],"mapped",[112]],[[119954,119954],"mapped",[113]],[[119955,119955],"mapped",[114]],[[119956,119956],"mapped",[115]],[[119957,119957],"mapped",[116]],[[119958,119958],"mapped",[117]],[[119959,119959],"mapped",[118]],[[119960,119960],"mapped",[119]],[[119961,119961],"mapped",[120]],[[119962,119962],"mapped",[121]],[[119963,119963],"mapped",[122]],[[119964,119964],"mapped",[97]],[[119965,119965],"disallowed"],[[119966,119966],"mapped",[99]],[[119967,119967],"mapped",[100]],[[119968,119969],"disallowed"],[[119970,119970],"mapped",[103]],[[119971,119972],"disallowed"],[[119973,119973],"mapped",[106]],[[119974,119974],"mapped",[107]],[[119975,119976],"disallowed"],[[119977,119977],"mapped",[110]],[[119978,119978],"mapped",[111]],[[119979,119979],"mapped",[112]],[[119980,119980],"mapped",[113]],[[119981,119981],"disallowed"],[[119982,119982],"mapped",[115]],[[119983,119983],"mapped",[116]],[[119984,119984],"mapped",[117]],[[119985,119985],"mapped",[118]],[[119986,119986],"mapped",[119]],[[119987,119987],"mapped",[120]],[[119988,119988],"mapped",[121]],[[119989,119989],"mapped",[122]],[[119990,119990],"mapped",[97]],[[119991,119991],"mapped",[98]],[[119992,119992],"mapped",[99]],[[119993,119993],"mapped",[100]],[[119994,119994],"disallowed"],[[119995,119995],"mapped",[102]],[[119996,119996],"disallowed"],[[119997,119997],"mapped",[104]],[[119998,119998],"mapped",[105]],[[119999,119999],"mapped",[106]],[[120000,120000],"mapped",[107]],[[120001,120001],"mapped",[108]],[[120002,120002],"mapped",[109]],[[120003,120003],"mapped",[110]],[[120004,120004],"disallowed"],[[120005,120005],"mapped",[112]],[[120006,120006],"mapped",[113]],[[120007,120007],"mapped",[114]],[[120008,120008],"mapped",[115]],[[120009,120009],"mapped",[116]],[[120010,120010],"mapped",[117]],[[120011,120011],"mapped",[118]],[[120012,120012],"mapped",[119]],[[120013,120013],"mapped",[120]],[[120014,120014],"mapped",[121]],[[120015,120015],"mapped",[122]],[[120016,120016],"mapped",[97]],[[120017,120017],"mapped",[98]],[[120018,120018],"mapped",[99]],[[120019,120019],"mapped",[100]],[[120020,120020],"mapped",[101]],[[120021,120021],"mapped",[102]],[[120022,120022],"mapped",[103]],[[120023,120023],"mapped",[104]],[[120024,120024],"mapped",[105]],[[120025,120025],"mapped",[106]],[[120026,120026],"mapped",[107]],[[120027,120027],"mapped",[108]],[[120028,120028],"mapped",[109]],[[120029,120029],"mapped",[110]],[[120030,120030],"mapped",[111]],[[120031,120031],"mapped",[112]],[[120032,120032],"mapped",[113]],[[120033,120033],"mapped",[114]],[[120034,120034],"mapped",[115]],[[120035,120035],"mapped",[116]],[[120036,120036],"mapped",[117]],[[120037,120037],"mapped",[118]],[[120038,120038],"mapped",[119]],[[120039,120039],"mapped",[120]],[[120040,120040],"mapped",[121]],[[120041,120041],"mapped",[122]],[[120042,120042],"mapped",[97]],[[120043,120043],"mapped",[98]],[[120044,120044],"mapped",[99]],[[120045,120045],"mapped",[100]],[[120046,120046],"mapped",[101]],[[120047,120047],"mapped",[102]],[[120048,120048],"mapped",[103]],[[120049,120049],"mapped",[104]],[[120050,120050],"mapped",[105]],[[120051,120051],"mapped",[106]],[[120052,120052],"mapped",[107]],[[120053,120053],"mapped",[108]],[[120054,120054],"mapped",[109]],[[120055,120055],"mapped",[110]],[[120056,120056],"mapped",[111]],[[120057,120057],"mapped",[112]],[[120058,120058],"mapped",[113]],[[120059,120059],"mapped",[114]],[[120060,120060],"mapped",[115]],[[120061,120061],"mapped",[116]],[[120062,120062],"mapped",[117]],[[120063,120063],"mapped",[118]],[[120064,120064],"mapped",[119]],[[120065,120065],"mapped",[120]],[[120066,120066],"mapped",[121]],[[120067,120067],"mapped",[122]],[[120068,120068],"mapped",[97]],[[120069,120069],"mapped",[98]],[[120070,120070],"disallowed"],[[120071,120071],"mapped",[100]],[[120072,120072],"mapped",[101]],[[120073,120073],"mapped",[102]],[[120074,120074],"mapped",[103]],[[120075,120076],"disallowed"],[[120077,120077],"mapped",[106]],[[120078,120078],"mapped",[107]],[[120079,120079],"mapped",[108]],[[120080,120080],"mapped",[109]],[[120081,120081],"mapped",[110]],[[120082,120082],"mapped",[111]],[[120083,120083],"mapped",[112]],[[120084,120084],"mapped",[113]],[[120085,120085],"disallowed"],[[120086,120086],"mapped",[115]],[[120087,120087],"mapped",[116]],[[120088,120088],"mapped",[117]],[[120089,120089],"mapped",[118]],[[120090,120090],"mapped",[119]],[[120091,120091],"mapped",[120]],[[120092,120092],"mapped",[121]],[[120093,120093],"disallowed"],[[120094,120094],"mapped",[97]],[[120095,120095],"mapped",[98]],[[120096,120096],"mapped",[99]],[[120097,120097],"mapped",[100]],[[120098,120098],"mapped",[101]],[[120099,120099],"mapped",[102]],[[120100,120100],"mapped",[103]],[[120101,120101],"mapped",[104]],[[120102,120102],"mapped",[105]],[[120103,120103],"mapped",[106]],[[120104,120104],"mapped",[107]],[[120105,120105],"mapped",[108]],[[120106,120106],"mapped",[109]],[[120107,120107],"mapped",[110]],[[120108,120108],"mapped",[111]],[[120109,120109],"mapped",[112]],[[120110,120110],"mapped",[113]],[[120111,120111],"mapped",[114]],[[120112,120112],"mapped",[115]],[[120113,120113],"mapped",[116]],[[120114,120114],"mapped",[117]],[[120115,120115],"mapped",[118]],[[120116,120116],"mapped",[119]],[[120117,120117],"mapped",[120]],[[120118,120118],"mapped",[121]],[[120119,120119],"mapped",[122]],[[120120,120120],"mapped",[97]],[[120121,120121],"mapped",[98]],[[120122,120122],"disallowed"],[[120123,120123],"mapped",[100]],[[120124,120124],"mapped",[101]],[[120125,120125],"mapped",[102]],[[120126,120126],"mapped",[103]],[[120127,120127],"disallowed"],[[120128,120128],"mapped",[105]],[[120129,120129],"mapped",[106]],[[120130,120130],"mapped",[107]],[[120131,120131],"mapped",[108]],[[120132,120132],"mapped",[109]],[[120133,120133],"disallowed"],[[120134,120134],"mapped",[111]],[[120135,120137],"disallowed"],[[120138,120138],"mapped",[115]],[[120139,120139],"mapped",[116]],[[120140,120140],"mapped",[117]],[[120141,120141],"mapped",[118]],[[120142,120142],"mapped",[119]],[[120143,120143],"mapped",[120]],[[120144,120144],"mapped",[121]],[[120145,120145],"disallowed"],[[120146,120146],"mapped",[97]],[[120147,120147],"mapped",[98]],[[120148,120148],"mapped",[99]],[[120149,120149],"mapped",[100]],[[120150,120150],"mapped",[101]],[[120151,120151],"mapped",[102]],[[120152,120152],"mapped",[103]],[[120153,120153],"mapped",[104]],[[120154,120154],"mapped",[105]],[[120155,120155],"mapped",[106]],[[120156,120156],"mapped",[107]],[[120157,120157],"mapped",[108]],[[120158,120158],"mapped",[109]],[[120159,120159],"mapped",[110]],[[120160,120160],"mapped",[111]],[[120161,120161],"mapped",[112]],[[120162,120162],"mapped",[113]],[[120163,120163],"mapped",[114]],[[120164,120164],"mapped",[115]],[[120165,120165],"mapped",[116]],[[120166,120166],"mapped",[117]],[[120167,120167],"mapped",[118]],[[120168,120168],"mapped",[119]],[[120169,120169],"mapped",[120]],[[120170,120170],"mapped",[121]],[[120171,120171],"mapped",[122]],[[120172,120172],"mapped",[97]],[[120173,120173],"mapped",[98]],[[120174,120174],"mapped",[99]],[[120175,120175],"mapped",[100]],[[120176,120176],"mapped",[101]],[[120177,120177],"mapped",[102]],[[120178,120178],"mapped",[103]],[[120179,120179],"mapped",[104]],[[120180,120180],"mapped",[105]],[[120181,120181],"mapped",[106]],[[120182,120182],"mapped",[107]],[[120183,120183],"mapped",[108]],[[120184,120184],"mapped",[109]],[[120185,120185],"mapped",[110]],[[120186,120186],"mapped",[111]],[[120187,120187],"mapped",[112]],[[120188,120188],"mapped",[113]],[[120189,120189],"mapped",[114]],[[120190,120190],"mapped",[115]],[[120191,120191],"mapped",[116]],[[120192,120192],"mapped",[117]],[[120193,120193],"mapped",[118]],[[120194,120194],"mapped",[119]],[[120195,120195],"mapped",[120]],[[120196,120196],"mapped",[121]],[[120197,120197],"mapped",[122]],[[120198,120198],"mapped",[97]],[[120199,120199],"mapped",[98]],[[120200,120200],"mapped",[99]],[[120201,120201],"mapped",[100]],[[120202,120202],"mapped",[101]],[[120203,120203],"mapped",[102]],[[120204,120204],"mapped",[103]],[[120205,120205],"mapped",[104]],[[120206,120206],"mapped",[105]],[[120207,120207],"mapped",[106]],[[120208,120208],"mapped",[107]],[[120209,120209],"mapped",[108]],[[120210,120210],"mapped",[109]],[[120211,120211],"mapped",[110]],[[120212,120212],"mapped",[111]],[[120213,120213],"mapped",[112]],[[120214,120214],"mapped",[113]],[[120215,120215],"mapped",[114]],[[120216,120216],"mapped",[115]],[[120217,120217],"mapped",[116]],[[120218,120218],"mapped",[117]],[[120219,120219],"mapped",[118]],[[120220,120220],"mapped",[119]],[[120221,120221],"mapped",[120]],[[120222,120222],"mapped",[121]],[[120223,120223],"mapped",[122]],[[120224,120224],"mapped",[97]],[[120225,120225],"mapped",[98]],[[120226,120226],"mapped",[99]],[[120227,120227],"mapped",[100]],[[120228,120228],"mapped",[101]],[[120229,120229],"mapped",[102]],[[120230,120230],"mapped",[103]],[[120231,120231],"mapped",[104]],[[120232,120232],"mapped",[105]],[[120233,120233],"mapped",[106]],[[120234,120234],"mapped",[107]],[[120235,120235],"mapped",[108]],[[120236,120236],"mapped",[109]],[[120237,120237],"mapped",[110]],[[120238,120238],"mapped",[111]],[[120239,120239],"mapped",[112]],[[120240,120240],"mapped",[113]],[[120241,120241],"mapped",[114]],[[120242,120242],"mapped",[115]],[[120243,120243],"mapped",[116]],[[120244,120244],"mapped",[117]],[[120245,120245],"mapped",[118]],[[120246,120246],"mapped",[119]],[[120247,120247],"mapped",[120]],[[120248,120248],"mapped",[121]],[[120249,120249],"mapped",[122]],[[120250,120250],"mapped",[97]],[[120251,120251],"mapped",[98]],[[120252,120252],"mapped",[99]],[[120253,120253],"mapped",[100]],[[120254,120254],"mapped",[101]],[[120255,120255],"mapped",[102]],[[120256,120256],"mapped",[103]],[[120257,120257],"mapped",[104]],[[120258,120258],"mapped",[105]],[[120259,120259],"mapped",[106]],[[120260,120260],"mapped",[107]],[[120261,120261],"mapped",[108]],[[120262,120262],"mapped",[109]],[[120263,120263],"mapped",[110]],[[120264,120264],"mapped",[111]],[[120265,120265],"mapped",[112]],[[120266,120266],"mapped",[113]],[[120267,120267],"mapped",[114]],[[120268,120268],"mapped",[115]],[[120269,120269],"mapped",[116]],[[120270,120270],"mapped",[117]],[[120271,120271],"mapped",[118]],[[120272,120272],"mapped",[119]],[[120273,120273],"mapped",[120]],[[120274,120274],"mapped",[121]],[[120275,120275],"mapped",[122]],[[120276,120276],"mapped",[97]],[[120277,120277],"mapped",[98]],[[120278,120278],"mapped",[99]],[[120279,120279],"mapped",[100]],[[120280,120280],"mapped",[101]],[[120281,120281],"mapped",[102]],[[120282,120282],"mapped",[103]],[[120283,120283],"mapped",[104]],[[120284,120284],"mapped",[105]],[[120285,120285],"mapped",[106]],[[120286,120286],"mapped",[107]],[[120287,120287],"mapped",[108]],[[120288,120288],"mapped",[109]],[[120289,120289],"mapped",[110]],[[120290,120290],"mapped",[111]],[[120291,120291],"mapped",[112]],[[120292,120292],"mapped",[113]],[[120293,120293],"mapped",[114]],[[120294,120294],"mapped",[115]],[[120295,120295],"mapped",[116]],[[120296,120296],"mapped",[117]],[[120297,120297],"mapped",[118]],[[120298,120298],"mapped",[119]],[[120299,120299],"mapped",[120]],[[120300,120300],"mapped",[121]],[[120301,120301],"mapped",[122]],[[120302,120302],"mapped",[97]],[[120303,120303],"mapped",[98]],[[120304,120304],"mapped",[99]],[[120305,120305],"mapped",[100]],[[120306,120306],"mapped",[101]],[[120307,120307],"mapped",[102]],[[120308,120308],"mapped",[103]],[[120309,120309],"mapped",[104]],[[120310,120310],"mapped",[105]],[[120311,120311],"mapped",[106]],[[120312,120312],"mapped",[107]],[[120313,120313],"mapped",[108]],[[120314,120314],"mapped",[109]],[[120315,120315],"mapped",[110]],[[120316,120316],"mapped",[111]],[[120317,120317],"mapped",[112]],[[120318,120318],"mapped",[113]],[[120319,120319],"mapped",[114]],[[120320,120320],"mapped",[115]],[[120321,120321],"mapped",[116]],[[120322,120322],"mapped",[117]],[[120323,120323],"mapped",[118]],[[120324,120324],"mapped",[119]],[[120325,120325],"mapped",[120]],[[120326,120326],"mapped",[121]],[[120327,120327],"mapped",[122]],[[120328,120328],"mapped",[97]],[[120329,120329],"mapped",[98]],[[120330,120330],"mapped",[99]],[[120331,120331],"mapped",[100]],[[120332,120332],"mapped",[101]],[[120333,120333],"mapped",[102]],[[120334,120334],"mapped",[103]],[[120335,120335],"mapped",[104]],[[120336,120336],"mapped",[105]],[[120337,120337],"mapped",[106]],[[120338,120338],"mapped",[107]],[[120339,120339],"mapped",[108]],[[120340,120340],"mapped",[109]],[[120341,120341],"mapped",[110]],[[120342,120342],"mapped",[111]],[[120343,120343],"mapped",[112]],[[120344,120344],"mapped",[113]],[[120345,120345],"mapped",[114]],[[120346,120346],"mapped",[115]],[[120347,120347],"mapped",[116]],[[120348,120348],"mapped",[117]],[[120349,120349],"mapped",[118]],[[120350,120350],"mapped",[119]],[[120351,120351],"mapped",[120]],[[120352,120352],"mapped",[121]],[[120353,120353],"mapped",[122]],[[120354,120354],"mapped",[97]],[[120355,120355],"mapped",[98]],[[120356,120356],"mapped",[99]],[[120357,120357],"mapped",[100]],[[120358,120358],"mapped",[101]],[[120359,120359],"mapped",[102]],[[120360,120360],"mapped",[103]],[[120361,120361],"mapped",[104]],[[120362,120362],"mapped",[105]],[[120363,120363],"mapped",[106]],[[120364,120364],"mapped",[107]],[[120365,120365],"mapped",[108]],[[120366,120366],"mapped",[109]],[[120367,120367],"mapped",[110]],[[120368,120368],"mapped",[111]],[[120369,120369],"mapped",[112]],[[120370,120370],"mapped",[113]],[[120371,120371],"mapped",[114]],[[120372,120372],"mapped",[115]],[[120373,120373],"mapped",[116]],[[120374,120374],"mapped",[117]],[[120375,120375],"mapped",[118]],[[120376,120376],"mapped",[119]],[[120377,120377],"mapped",[120]],[[120378,120378],"mapped",[121]],[[120379,120379],"mapped",[122]],[[120380,120380],"mapped",[97]],[[120381,120381],"mapped",[98]],[[120382,120382],"mapped",[99]],[[120383,120383],"mapped",[100]],[[120384,120384],"mapped",[101]],[[120385,120385],"mapped",[102]],[[120386,120386],"mapped",[103]],[[120387,120387],"mapped",[104]],[[120388,120388],"mapped",[105]],[[120389,120389],"mapped",[106]],[[120390,120390],"mapped",[107]],[[120391,120391],"mapped",[108]],[[120392,120392],"mapped",[109]],[[120393,120393],"mapped",[110]],[[120394,120394],"mapped",[111]],[[120395,120395],"mapped",[112]],[[120396,120396],"mapped",[113]],[[120397,120397],"mapped",[114]],[[120398,120398],"mapped",[115]],[[120399,120399],"mapped",[116]],[[120400,120400],"mapped",[117]],[[120401,120401],"mapped",[118]],[[120402,120402],"mapped",[119]],[[120403,120403],"mapped",[120]],[[120404,120404],"mapped",[121]],[[120405,120405],"mapped",[122]],[[120406,120406],"mapped",[97]],[[120407,120407],"mapped",[98]],[[120408,120408],"mapped",[99]],[[120409,120409],"mapped",[100]],[[120410,120410],"mapped",[101]],[[120411,120411],"mapped",[102]],[[120412,120412],"mapped",[103]],[[120413,120413],"mapped",[104]],[[120414,120414],"mapped",[105]],[[120415,120415],"mapped",[106]],[[120416,120416],"mapped",[107]],[[120417,120417],"mapped",[108]],[[120418,120418],"mapped",[109]],[[120419,120419],"mapped",[110]],[[120420,120420],"mapped",[111]],[[120421,120421],"mapped",[112]],[[120422,120422],"mapped",[113]],[[120423,120423],"mapped",[114]],[[120424,120424],"mapped",[115]],[[120425,120425],"mapped",[116]],[[120426,120426],"mapped",[117]],[[120427,120427],"mapped",[118]],[[120428,120428],"mapped",[119]],[[120429,120429],"mapped",[120]],[[120430,120430],"mapped",[121]],[[120431,120431],"mapped",[122]],[[120432,120432],"mapped",[97]],[[120433,120433],"mapped",[98]],[[120434,120434],"mapped",[99]],[[120435,120435],"mapped",[100]],[[120436,120436],"mapped",[101]],[[120437,120437],"mapped",[102]],[[120438,120438],"mapped",[103]],[[120439,120439],"mapped",[104]],[[120440,120440],"mapped",[105]],[[120441,120441],"mapped",[106]],[[120442,120442],"mapped",[107]],[[120443,120443],"mapped",[108]],[[120444,120444],"mapped",[109]],[[120445,120445],"mapped",[110]],[[120446,120446],"mapped",[111]],[[120447,120447],"mapped",[112]],[[120448,120448],"mapped",[113]],[[120449,120449],"mapped",[114]],[[120450,120450],"mapped",[115]],[[120451,120451],"mapped",[116]],[[120452,120452],"mapped",[117]],[[120453,120453],"mapped",[118]],[[120454,120454],"mapped",[119]],[[120455,120455],"mapped",[120]],[[120456,120456],"mapped",[121]],[[120457,120457],"mapped",[122]],[[120458,120458],"mapped",[97]],[[120459,120459],"mapped",[98]],[[120460,120460],"mapped",[99]],[[120461,120461],"mapped",[100]],[[120462,120462],"mapped",[101]],[[120463,120463],"mapped",[102]],[[120464,120464],"mapped",[103]],[[120465,120465],"mapped",[104]],[[120466,120466],"mapped",[105]],[[120467,120467],"mapped",[106]],[[120468,120468],"mapped",[107]],[[120469,120469],"mapped",[108]],[[120470,120470],"mapped",[109]],[[120471,120471],"mapped",[110]],[[120472,120472],"mapped",[111]],[[120473,120473],"mapped",[112]],[[120474,120474],"mapped",[113]],[[120475,120475],"mapped",[114]],[[120476,120476],"mapped",[115]],[[120477,120477],"mapped",[116]],[[120478,120478],"mapped",[117]],[[120479,120479],"mapped",[118]],[[120480,120480],"mapped",[119]],[[120481,120481],"mapped",[120]],[[120482,120482],"mapped",[121]],[[120483,120483],"mapped",[122]],[[120484,120484],"mapped",[305]],[[120485,120485],"mapped",[567]],[[120486,120487],"disallowed"],[[120488,120488],"mapped",[945]],[[120489,120489],"mapped",[946]],[[120490,120490],"mapped",[947]],[[120491,120491],"mapped",[948]],[[120492,120492],"mapped",[949]],[[120493,120493],"mapped",[950]],[[120494,120494],"mapped",[951]],[[120495,120495],"mapped",[952]],[[120496,120496],"mapped",[953]],[[120497,120497],"mapped",[954]],[[120498,120498],"mapped",[955]],[[120499,120499],"mapped",[956]],[[120500,120500],"mapped",[957]],[[120501,120501],"mapped",[958]],[[120502,120502],"mapped",[959]],[[120503,120503],"mapped",[960]],[[120504,120504],"mapped",[961]],[[120505,120505],"mapped",[952]],[[120506,120506],"mapped",[963]],[[120507,120507],"mapped",[964]],[[120508,120508],"mapped",[965]],[[120509,120509],"mapped",[966]],[[120510,120510],"mapped",[967]],[[120511,120511],"mapped",[968]],[[120512,120512],"mapped",[969]],[[120513,120513],"mapped",[8711]],[[120514,120514],"mapped",[945]],[[120515,120515],"mapped",[946]],[[120516,120516],"mapped",[947]],[[120517,120517],"mapped",[948]],[[120518,120518],"mapped",[949]],[[120519,120519],"mapped",[950]],[[120520,120520],"mapped",[951]],[[120521,120521],"mapped",[952]],[[120522,120522],"mapped",[953]],[[120523,120523],"mapped",[954]],[[120524,120524],"mapped",[955]],[[120525,120525],"mapped",[956]],[[120526,120526],"mapped",[957]],[[120527,120527],"mapped",[958]],[[120528,120528],"mapped",[959]],[[120529,120529],"mapped",[960]],[[120530,120530],"mapped",[961]],[[120531,120532],"mapped",[963]],[[120533,120533],"mapped",[964]],[[120534,120534],"mapped",[965]],[[120535,120535],"mapped",[966]],[[120536,120536],"mapped",[967]],[[120537,120537],"mapped",[968]],[[120538,120538],"mapped",[969]],[[120539,120539],"mapped",[8706]],[[120540,120540],"mapped",[949]],[[120541,120541],"mapped",[952]],[[120542,120542],"mapped",[954]],[[120543,120543],"mapped",[966]],[[120544,120544],"mapped",[961]],[[120545,120545],"mapped",[960]],[[120546,120546],"mapped",[945]],[[120547,120547],"mapped",[946]],[[120548,120548],"mapped",[947]],[[120549,120549],"mapped",[948]],[[120550,120550],"mapped",[949]],[[120551,120551],"mapped",[950]],[[120552,120552],"mapped",[951]],[[120553,120553],"mapped",[952]],[[120554,120554],"mapped",[953]],[[120555,120555],"mapped",[954]],[[120556,120556],"mapped",[955]],[[120557,120557],"mapped",[956]],[[120558,120558],"mapped",[957]],[[120559,120559],"mapped",[958]],[[120560,120560],"mapped",[959]],[[120561,120561],"mapped",[960]],[[120562,120562],"mapped",[961]],[[120563,120563],"mapped",[952]],[[120564,120564],"mapped",[963]],[[120565,120565],"mapped",[964]],[[120566,120566],"mapped",[965]],[[120567,120567],"mapped",[966]],[[120568,120568],"mapped",[967]],[[120569,120569],"mapped",[968]],[[120570,120570],"mapped",[969]],[[120571,120571],"mapped",[8711]],[[120572,120572],"mapped",[945]],[[120573,120573],"mapped",[946]],[[120574,120574],"mapped",[947]],[[120575,120575],"mapped",[948]],[[120576,120576],"mapped",[949]],[[120577,120577],"mapped",[950]],[[120578,120578],"mapped",[951]],[[120579,120579],"mapped",[952]],[[120580,120580],"mapped",[953]],[[120581,120581],"mapped",[954]],[[120582,120582],"mapped",[955]],[[120583,120583],"mapped",[956]],[[120584,120584],"mapped",[957]],[[120585,120585],"mapped",[958]],[[120586,120586],"mapped",[959]],[[120587,120587],"mapped",[960]],[[120588,120588],"mapped",[961]],[[120589,120590],"mapped",[963]],[[120591,120591],"mapped",[964]],[[120592,120592],"mapped",[965]],[[120593,120593],"mapped",[966]],[[120594,120594],"mapped",[967]],[[120595,120595],"mapped",[968]],[[120596,120596],"mapped",[969]],[[120597,120597],"mapped",[8706]],[[120598,120598],"mapped",[949]],[[120599,120599],"mapped",[952]],[[120600,120600],"mapped",[954]],[[120601,120601],"mapped",[966]],[[120602,120602],"mapped",[961]],[[120603,120603],"mapped",[960]],[[120604,120604],"mapped",[945]],[[120605,120605],"mapped",[946]],[[120606,120606],"mapped",[947]],[[120607,120607],"mapped",[948]],[[120608,120608],"mapped",[949]],[[120609,120609],"mapped",[950]],[[120610,120610],"mapped",[951]],[[120611,120611],"mapped",[952]],[[120612,120612],"mapped",[953]],[[120613,120613],"mapped",[954]],[[120614,120614],"mapped",[955]],[[120615,120615],"mapped",[956]],[[120616,120616],"mapped",[957]],[[120617,120617],"mapped",[958]],[[120618,120618],"mapped",[959]],[[120619,120619],"mapped",[960]],[[120620,120620],"mapped",[961]],[[120621,120621],"mapped",[952]],[[120622,120622],"mapped",[963]],[[120623,120623],"mapped",[964]],[[120624,120624],"mapped",[965]],[[120625,120625],"mapped",[966]],[[120626,120626],"mapped",[967]],[[120627,120627],"mapped",[968]],[[120628,120628],"mapped",[969]],[[120629,120629],"mapped",[8711]],[[120630,120630],"mapped",[945]],[[120631,120631],"mapped",[946]],[[120632,120632],"mapped",[947]],[[120633,120633],"mapped",[948]],[[120634,120634],"mapped",[949]],[[120635,120635],"mapped",[950]],[[120636,120636],"mapped",[951]],[[120637,120637],"mapped",[952]],[[120638,120638],"mapped",[953]],[[120639,120639],"mapped",[954]],[[120640,120640],"mapped",[955]],[[120641,120641],"mapped",[956]],[[120642,120642],"mapped",[957]],[[120643,120643],"mapped",[958]],[[120644,120644],"mapped",[959]],[[120645,120645],"mapped",[960]],[[120646,120646],"mapped",[961]],[[120647,120648],"mapped",[963]],[[120649,120649],"mapped",[964]],[[120650,120650],"mapped",[965]],[[120651,120651],"mapped",[966]],[[120652,120652],"mapped",[967]],[[120653,120653],"mapped",[968]],[[120654,120654],"mapped",[969]],[[120655,120655],"mapped",[8706]],[[120656,120656],"mapped",[949]],[[120657,120657],"mapped",[952]],[[120658,120658],"mapped",[954]],[[120659,120659],"mapped",[966]],[[120660,120660],"mapped",[961]],[[120661,120661],"mapped",[960]],[[120662,120662],"mapped",[945]],[[120663,120663],"mapped",[946]],[[120664,120664],"mapped",[947]],[[120665,120665],"mapped",[948]],[[120666,120666],"mapped",[949]],[[120667,120667],"mapped",[950]],[[120668,120668],"mapped",[951]],[[120669,120669],"mapped",[952]],[[120670,120670],"mapped",[953]],[[120671,120671],"mapped",[954]],[[120672,120672],"mapped",[955]],[[120673,120673],"mapped",[956]],[[120674,120674],"mapped",[957]],[[120675,120675],"mapped",[958]],[[120676,120676],"mapped",[959]],[[120677,120677],"mapped",[960]],[[120678,120678],"mapped",[961]],[[120679,120679],"mapped",[952]],[[120680,120680],"mapped",[963]],[[120681,120681],"mapped",[964]],[[120682,120682],"mapped",[965]],[[120683,120683],"mapped",[966]],[[120684,120684],"mapped",[967]],[[120685,120685],"mapped",[968]],[[120686,120686],"mapped",[969]],[[120687,120687],"mapped",[8711]],[[120688,120688],"mapped",[945]],[[120689,120689],"mapped",[946]],[[120690,120690],"mapped",[947]],[[120691,120691],"mapped",[948]],[[120692,120692],"mapped",[949]],[[120693,120693],"mapped",[950]],[[120694,120694],"mapped",[951]],[[120695,120695],"mapped",[952]],[[120696,120696],"mapped",[953]],[[120697,120697],"mapped",[954]],[[120698,120698],"mapped",[955]],[[120699,120699],"mapped",[956]],[[120700,120700],"mapped",[957]],[[120701,120701],"mapped",[958]],[[120702,120702],"mapped",[959]],[[120703,120703],"mapped",[960]],[[120704,120704],"mapped",[961]],[[120705,120706],"mapped",[963]],[[120707,120707],"mapped",[964]],[[120708,120708],"mapped",[965]],[[120709,120709],"mapped",[966]],[[120710,120710],"mapped",[967]],[[120711,120711],"mapped",[968]],[[120712,120712],"mapped",[969]],[[120713,120713],"mapped",[8706]],[[120714,120714],"mapped",[949]],[[120715,120715],"mapped",[952]],[[120716,120716],"mapped",[954]],[[120717,120717],"mapped",[966]],[[120718,120718],"mapped",[961]],[[120719,120719],"mapped",[960]],[[120720,120720],"mapped",[945]],[[120721,120721],"mapped",[946]],[[120722,120722],"mapped",[947]],[[120723,120723],"mapped",[948]],[[120724,120724],"mapped",[949]],[[120725,120725],"mapped",[950]],[[120726,120726],"mapped",[951]],[[120727,120727],"mapped",[952]],[[120728,120728],"mapped",[953]],[[120729,120729],"mapped",[954]],[[120730,120730],"mapped",[955]],[[120731,120731],"mapped",[956]],[[120732,120732],"mapped",[957]],[[120733,120733],"mapped",[958]],[[120734,120734],"mapped",[959]],[[120735,120735],"mapped",[960]],[[120736,120736],"mapped",[961]],[[120737,120737],"mapped",[952]],[[120738,120738],"mapped",[963]],[[120739,120739],"mapped",[964]],[[120740,120740],"mapped",[965]],[[120741,120741],"mapped",[966]],[[120742,120742],"mapped",[967]],[[120743,120743],"mapped",[968]],[[120744,120744],"mapped",[969]],[[120745,120745],"mapped",[8711]],[[120746,120746],"mapped",[945]],[[120747,120747],"mapped",[946]],[[120748,120748],"mapped",[947]],[[120749,120749],"mapped",[948]],[[120750,120750],"mapped",[949]],[[120751,120751],"mapped",[950]],[[120752,120752],"mapped",[951]],[[120753,120753],"mapped",[952]],[[120754,120754],"mapped",[953]],[[120755,120755],"mapped",[954]],[[120756,120756],"mapped",[955]],[[120757,120757],"mapped",[956]],[[120758,120758],"mapped",[957]],[[120759,120759],"mapped",[958]],[[120760,120760],"mapped",[959]],[[120761,120761],"mapped",[960]],[[120762,120762],"mapped",[961]],[[120763,120764],"mapped",[963]],[[120765,120765],"mapped",[964]],[[120766,120766],"mapped",[965]],[[120767,120767],"mapped",[966]],[[120768,120768],"mapped",[967]],[[120769,120769],"mapped",[968]],[[120770,120770],"mapped",[969]],[[120771,120771],"mapped",[8706]],[[120772,120772],"mapped",[949]],[[120773,120773],"mapped",[952]],[[120774,120774],"mapped",[954]],[[120775,120775],"mapped",[966]],[[120776,120776],"mapped",[961]],[[120777,120777],"mapped",[960]],[[120778,120779],"mapped",[989]],[[120780,120781],"disallowed"],[[120782,120782],"mapped",[48]],[[120783,120783],"mapped",[49]],[[120784,120784],"mapped",[50]],[[120785,120785],"mapped",[51]],[[120786,120786],"mapped",[52]],[[120787,120787],"mapped",[53]],[[120788,120788],"mapped",[54]],[[120789,120789],"mapped",[55]],[[120790,120790],"mapped",[56]],[[120791,120791],"mapped",[57]],[[120792,120792],"mapped",[48]],[[120793,120793],"mapped",[49]],[[120794,120794],"mapped",[50]],[[120795,120795],"mapped",[51]],[[120796,120796],"mapped",[52]],[[120797,120797],"mapped",[53]],[[120798,120798],"mapped",[54]],[[120799,120799],"mapped",[55]],[[120800,120800],"mapped",[56]],[[120801,120801],"mapped",[57]],[[120802,120802],"mapped",[48]],[[120803,120803],"mapped",[49]],[[120804,120804],"mapped",[50]],[[120805,120805],"mapped",[51]],[[120806,120806],"mapped",[52]],[[120807,120807],"mapped",[53]],[[120808,120808],"mapped",[54]],[[120809,120809],"mapped",[55]],[[120810,120810],"mapped",[56]],[[120811,120811],"mapped",[57]],[[120812,120812],"mapped",[48]],[[120813,120813],"mapped",[49]],[[120814,120814],"mapped",[50]],[[120815,120815],"mapped",[51]],[[120816,120816],"mapped",[52]],[[120817,120817],"mapped",[53]],[[120818,120818],"mapped",[54]],[[120819,120819],"mapped",[55]],[[120820,120820],"mapped",[56]],[[120821,120821],"mapped",[57]],[[120822,120822],"mapped",[48]],[[120823,120823],"mapped",[49]],[[120824,120824],"mapped",[50]],[[120825,120825],"mapped",[51]],[[120826,120826],"mapped",[52]],[[120827,120827],"mapped",[53]],[[120828,120828],"mapped",[54]],[[120829,120829],"mapped",[55]],[[120830,120830],"mapped",[56]],[[120831,120831],"mapped",[57]],[[120832,121343],"valid",[],"NV8"],[[121344,121398],"valid"],[[121399,121402],"valid",[],"NV8"],[[121403,121452],"valid"],[[121453,121460],"valid",[],"NV8"],[[121461,121461],"valid"],[[121462,121475],"valid",[],"NV8"],[[121476,121476],"valid"],[[121477,121483],"valid",[],"NV8"],[[121484,121498],"disallowed"],[[121499,121503],"valid"],[[121504,121504],"disallowed"],[[121505,121519],"valid"],[[121520,124927],"disallowed"],[[124928,125124],"valid"],[[125125,125126],"disallowed"],[[125127,125135],"valid",[],"NV8"],[[125136,125142],"valid"],[[125143,126463],"disallowed"],[[126464,126464],"mapped",[1575]],[[126465,126465],"mapped",[1576]],[[126466,126466],"mapped",[1580]],[[126467,126467],"mapped",[1583]],[[126468,126468],"disallowed"],[[126469,126469],"mapped",[1608]],[[126470,126470],"mapped",[1586]],[[126471,126471],"mapped",[1581]],[[126472,126472],"mapped",[1591]],[[126473,126473],"mapped",[1610]],[[126474,126474],"mapped",[1603]],[[126475,126475],"mapped",[1604]],[[126476,126476],"mapped",[1605]],[[126477,126477],"mapped",[1606]],[[126478,126478],"mapped",[1587]],[[126479,126479],"mapped",[1593]],[[126480,126480],"mapped",[1601]],[[126481,126481],"mapped",[1589]],[[126482,126482],"mapped",[1602]],[[126483,126483],"mapped",[1585]],[[126484,126484],"mapped",[1588]],[[126485,126485],"mapped",[1578]],[[126486,126486],"mapped",[1579]],[[126487,126487],"mapped",[1582]],[[126488,126488],"mapped",[1584]],[[126489,126489],"mapped",[1590]],[[126490,126490],"mapped",[1592]],[[126491,126491],"mapped",[1594]],[[126492,126492],"mapped",[1646]],[[126493,126493],"mapped",[1722]],[[126494,126494],"mapped",[1697]],[[126495,126495],"mapped",[1647]],[[126496,126496],"disallowed"],[[126497,126497],"mapped",[1576]],[[126498,126498],"mapped",[1580]],[[126499,126499],"disallowed"],[[126500,126500],"mapped",[1607]],[[126501,126502],"disallowed"],[[126503,126503],"mapped",[1581]],[[126504,126504],"disallowed"],[[126505,126505],"mapped",[1610]],[[126506,126506],"mapped",[1603]],[[126507,126507],"mapped",[1604]],[[126508,126508],"mapped",[1605]],[[126509,126509],"mapped",[1606]],[[126510,126510],"mapped",[1587]],[[126511,126511],"mapped",[1593]],[[126512,126512],"mapped",[1601]],[[126513,126513],"mapped",[1589]],[[126514,126514],"mapped",[1602]],[[126515,126515],"disallowed"],[[126516,126516],"mapped",[1588]],[[126517,126517],"mapped",[1578]],[[126518,126518],"mapped",[1579]],[[126519,126519],"mapped",[1582]],[[126520,126520],"disallowed"],[[126521,126521],"mapped",[1590]],[[126522,126522],"disallowed"],[[126523,126523],"mapped",[1594]],[[126524,126529],"disallowed"],[[126530,126530],"mapped",[1580]],[[126531,126534],"disallowed"],[[126535,126535],"mapped",[1581]],[[126536,126536],"disallowed"],[[126537,126537],"mapped",[1610]],[[126538,126538],"disallowed"],[[126539,126539],"mapped",[1604]],[[126540,126540],"disallowed"],[[126541,126541],"mapped",[1606]],[[126542,126542],"mapped",[1587]],[[126543,126543],"mapped",[1593]],[[126544,126544],"disallowed"],[[126545,126545],"mapped",[1589]],[[126546,126546],"mapped",[1602]],[[126547,126547],"disallowed"],[[126548,126548],"mapped",[1588]],[[126549,126550],"disallowed"],[[126551,126551],"mapped",[1582]],[[126552,126552],"disallowed"],[[126553,126553],"mapped",[1590]],[[126554,126554],"disallowed"],[[126555,126555],"mapped",[1594]],[[126556,126556],"disallowed"],[[126557,126557],"mapped",[1722]],[[126558,126558],"disallowed"],[[126559,126559],"mapped",[1647]],[[126560,126560],"disallowed"],[[126561,126561],"mapped",[1576]],[[126562,126562],"mapped",[1580]],[[126563,126563],"disallowed"],[[126564,126564],"mapped",[1607]],[[126565,126566],"disallowed"],[[126567,126567],"mapped",[1581]],[[126568,126568],"mapped",[1591]],[[126569,126569],"mapped",[1610]],[[126570,126570],"mapped",[1603]],[[126571,126571],"disallowed"],[[126572,126572],"mapped",[1605]],[[126573,126573],"mapped",[1606]],[[126574,126574],"mapped",[1587]],[[126575,126575],"mapped",[1593]],[[126576,126576],"mapped",[1601]],[[126577,126577],"mapped",[1589]],[[126578,126578],"mapped",[1602]],[[126579,126579],"disallowed"],[[126580,126580],"mapped",[1588]],[[126581,126581],"mapped",[1578]],[[126582,126582],"mapped",[1579]],[[126583,126583],"mapped",[1582]],[[126584,126584],"disallowed"],[[126585,126585],"mapped",[1590]],[[126586,126586],"mapped",[1592]],[[126587,126587],"mapped",[1594]],[[126588,126588],"mapped",[1646]],[[126589,126589],"disallowed"],[[126590,126590],"mapped",[1697]],[[126591,126591],"disallowed"],[[126592,126592],"mapped",[1575]],[[126593,126593],"mapped",[1576]],[[126594,126594],"mapped",[1580]],[[126595,126595],"mapped",[1583]],[[126596,126596],"mapped",[1607]],[[126597,126597],"mapped",[1608]],[[126598,126598],"mapped",[1586]],[[126599,126599],"mapped",[1581]],[[126600,126600],"mapped",[1591]],[[126601,126601],"mapped",[1610]],[[126602,126602],"disallowed"],[[126603,126603],"mapped",[1604]],[[126604,126604],"mapped",[1605]],[[126605,126605],"mapped",[1606]],[[126606,126606],"mapped",[1587]],[[126607,126607],"mapped",[1593]],[[126608,126608],"mapped",[1601]],[[126609,126609],"mapped",[1589]],[[126610,126610],"mapped",[1602]],[[126611,126611],"mapped",[1585]],[[126612,126612],"mapped",[1588]],[[126613,126613],"mapped",[1578]],[[126614,126614],"mapped",[1579]],[[126615,126615],"mapped",[1582]],[[126616,126616],"mapped",[1584]],[[126617,126617],"mapped",[1590]],[[126618,126618],"mapped",[1592]],[[126619,126619],"mapped",[1594]],[[126620,126624],"disallowed"],[[126625,126625],"mapped",[1576]],[[126626,126626],"mapped",[1580]],[[126627,126627],"mapped",[1583]],[[126628,126628],"disallowed"],[[126629,126629],"mapped",[1608]],[[126630,126630],"mapped",[1586]],[[126631,126631],"mapped",[1581]],[[126632,126632],"mapped",[1591]],[[126633,126633],"mapped",[1610]],[[126634,126634],"disallowed"],[[126635,126635],"mapped",[1604]],[[126636,126636],"mapped",[1605]],[[126637,126637],"mapped",[1606]],[[126638,126638],"mapped",[1587]],[[126639,126639],"mapped",[1593]],[[126640,126640],"mapped",[1601]],[[126641,126641],"mapped",[1589]],[[126642,126642],"mapped",[1602]],[[126643,126643],"mapped",[1585]],[[126644,126644],"mapped",[1588]],[[126645,126645],"mapped",[1578]],[[126646,126646],"mapped",[1579]],[[126647,126647],"mapped",[1582]],[[126648,126648],"mapped",[1584]],[[126649,126649],"mapped",[1590]],[[126650,126650],"mapped",[1592]],[[126651,126651],"mapped",[1594]],[[126652,126703],"disallowed"],[[126704,126705],"valid",[],"NV8"],[[126706,126975],"disallowed"],[[126976,127019],"valid",[],"NV8"],[[127020,127023],"disallowed"],[[127024,127123],"valid",[],"NV8"],[[127124,127135],"disallowed"],[[127136,127150],"valid",[],"NV8"],[[127151,127152],"disallowed"],[[127153,127166],"valid",[],"NV8"],[[127167,127167],"valid",[],"NV8"],[[127168,127168],"disallowed"],[[127169,127183],"valid",[],"NV8"],[[127184,127184],"disallowed"],[[127185,127199],"valid",[],"NV8"],[[127200,127221],"valid",[],"NV8"],[[127222,127231],"disallowed"],[[127232,127232],"disallowed"],[[127233,127233],"disallowed_STD3_mapped",[48,44]],[[127234,127234],"disallowed_STD3_mapped",[49,44]],[[127235,127235],"disallowed_STD3_mapped",[50,44]],[[127236,127236],"disallowed_STD3_mapped",[51,44]],[[127237,127237],"disallowed_STD3_mapped",[52,44]],[[127238,127238],"disallowed_STD3_mapped",[53,44]],[[127239,127239],"disallowed_STD3_mapped",[54,44]],[[127240,127240],"disallowed_STD3_mapped",[55,44]],[[127241,127241],"disallowed_STD3_mapped",[56,44]],[[127242,127242],"disallowed_STD3_mapped",[57,44]],[[127243,127244],"valid",[],"NV8"],[[127245,127247],"disallowed"],[[127248,127248],"disallowed_STD3_mapped",[40,97,41]],[[127249,127249],"disallowed_STD3_mapped",[40,98,41]],[[127250,127250],"disallowed_STD3_mapped",[40,99,41]],[[127251,127251],"disallowed_STD3_mapped",[40,100,41]],[[127252,127252],"disallowed_STD3_mapped",[40,101,41]],[[127253,127253],"disallowed_STD3_mapped",[40,102,41]],[[127254,127254],"disallowed_STD3_mapped",[40,103,41]],[[127255,127255],"disallowed_STD3_mapped",[40,104,41]],[[127256,127256],"disallowed_STD3_mapped",[40,105,41]],[[127257,127257],"disallowed_STD3_mapped",[40,106,41]],[[127258,127258],"disallowed_STD3_mapped",[40,107,41]],[[127259,127259],"disallowed_STD3_mapped",[40,108,41]],[[127260,127260],"disallowed_STD3_mapped",[40,109,41]],[[127261,127261],"disallowed_STD3_mapped",[40,110,41]],[[127262,127262],"disallowed_STD3_mapped",[40,111,41]],[[127263,127263],"disallowed_STD3_mapped",[40,112,41]],[[127264,127264],"disallowed_STD3_mapped",[40,113,41]],[[127265,127265],"disallowed_STD3_mapped",[40,114,41]],[[127266,127266],"disallowed_STD3_mapped",[40,115,41]],[[127267,127267],"disallowed_STD3_mapped",[40,116,41]],[[127268,127268],"disallowed_STD3_mapped",[40,117,41]],[[127269,127269],"disallowed_STD3_mapped",[40,118,41]],[[127270,127270],"disallowed_STD3_mapped",[40,119,41]],[[127271,127271],"disallowed_STD3_mapped",[40,120,41]],[[127272,127272],"disallowed_STD3_mapped",[40,121,41]],[[127273,127273],"disallowed_STD3_mapped",[40,122,41]],[[127274,127274],"mapped",[12308,115,12309]],[[127275,127275],"mapped",[99]],[[127276,127276],"mapped",[114]],[[127277,127277],"mapped",[99,100]],[[127278,127278],"mapped",[119,122]],[[127279,127279],"disallowed"],[[127280,127280],"mapped",[97]],[[127281,127281],"mapped",[98]],[[127282,127282],"mapped",[99]],[[127283,127283],"mapped",[100]],[[127284,127284],"mapped",[101]],[[127285,127285],"mapped",[102]],[[127286,127286],"mapped",[103]],[[127287,127287],"mapped",[104]],[[127288,127288],"mapped",[105]],[[127289,127289],"mapped",[106]],[[127290,127290],"mapped",[107]],[[127291,127291],"mapped",[108]],[[127292,127292],"mapped",[109]],[[127293,127293],"mapped",[110]],[[127294,127294],"mapped",[111]],[[127295,127295],"mapped",[112]],[[127296,127296],"mapped",[113]],[[127297,127297],"mapped",[114]],[[127298,127298],"mapped",[115]],[[127299,127299],"mapped",[116]],[[127300,127300],"mapped",[117]],[[127301,127301],"mapped",[118]],[[127302,127302],"mapped",[119]],[[127303,127303],"mapped",[120]],[[127304,127304],"mapped",[121]],[[127305,127305],"mapped",[122]],[[127306,127306],"mapped",[104,118]],[[127307,127307],"mapped",[109,118]],[[127308,127308],"mapped",[115,100]],[[127309,127309],"mapped",[115,115]],[[127310,127310],"mapped",[112,112,118]],[[127311,127311],"mapped",[119,99]],[[127312,127318],"valid",[],"NV8"],[[127319,127319],"valid",[],"NV8"],[[127320,127326],"valid",[],"NV8"],[[127327,127327],"valid",[],"NV8"],[[127328,127337],"valid",[],"NV8"],[[127338,127338],"mapped",[109,99]],[[127339,127339],"mapped",[109,100]],[[127340,127343],"disallowed"],[[127344,127352],"valid",[],"NV8"],[[127353,127353],"valid",[],"NV8"],[[127354,127354],"valid",[],"NV8"],[[127355,127356],"valid",[],"NV8"],[[127357,127358],"valid",[],"NV8"],[[127359,127359],"valid",[],"NV8"],[[127360,127369],"valid",[],"NV8"],[[127370,127373],"valid",[],"NV8"],[[127374,127375],"valid",[],"NV8"],[[127376,127376],"mapped",[100,106]],[[127377,127386],"valid",[],"NV8"],[[127387,127461],"disallowed"],[[127462,127487],"valid",[],"NV8"],[[127488,127488],"mapped",[12411,12363]],[[127489,127489],"mapped",[12467,12467]],[[127490,127490],"mapped",[12469]],[[127491,127503],"disallowed"],[[127504,127504],"mapped",[25163]],[[127505,127505],"mapped",[23383]],[[127506,127506],"mapped",[21452]],[[127507,127507],"mapped",[12487]],[[127508,127508],"mapped",[20108]],[[127509,127509],"mapped",[22810]],[[127510,127510],"mapped",[35299]],[[127511,127511],"mapped",[22825]],[[127512,127512],"mapped",[20132]],[[127513,127513],"mapped",[26144]],[[127514,127514],"mapped",[28961]],[[127515,127515],"mapped",[26009]],[[127516,127516],"mapped",[21069]],[[127517,127517],"mapped",[24460]],[[127518,127518],"mapped",[20877]],[[127519,127519],"mapped",[26032]],[[127520,127520],"mapped",[21021]],[[127521,127521],"mapped",[32066]],[[127522,127522],"mapped",[29983]],[[127523,127523],"mapped",[36009]],[[127524,127524],"mapped",[22768]],[[127525,127525],"mapped",[21561]],[[127526,127526],"mapped",[28436]],[[127527,127527],"mapped",[25237]],[[127528,127528],"mapped",[25429]],[[127529,127529],"mapped",[19968]],[[127530,127530],"mapped",[19977]],[[127531,127531],"mapped",[36938]],[[127532,127532],"mapped",[24038]],[[127533,127533],"mapped",[20013]],[[127534,127534],"mapped",[21491]],[[127535,127535],"mapped",[25351]],[[127536,127536],"mapped",[36208]],[[127537,127537],"mapped",[25171]],[[127538,127538],"mapped",[31105]],[[127539,127539],"mapped",[31354]],[[127540,127540],"mapped",[21512]],[[127541,127541],"mapped",[28288]],[[127542,127542],"mapped",[26377]],[[127543,127543],"mapped",[26376]],[[127544,127544],"mapped",[30003]],[[127545,127545],"mapped",[21106]],[[127546,127546],"mapped",[21942]],[[127547,127551],"disallowed"],[[127552,127552],"mapped",[12308,26412,12309]],[[127553,127553],"mapped",[12308,19977,12309]],[[127554,127554],"mapped",[12308,20108,12309]],[[127555,127555],"mapped",[12308,23433,12309]],[[127556,127556],"mapped",[12308,28857,12309]],[[127557,127557],"mapped",[12308,25171,12309]],[[127558,127558],"mapped",[12308,30423,12309]],[[127559,127559],"mapped",[12308,21213,12309]],[[127560,127560],"mapped",[12308,25943,12309]],[[127561,127567],"disallowed"],[[127568,127568],"mapped",[24471]],[[127569,127569],"mapped",[21487]],[[127570,127743],"disallowed"],[[127744,127776],"valid",[],"NV8"],[[127777,127788],"valid",[],"NV8"],[[127789,127791],"valid",[],"NV8"],[[127792,127797],"valid",[],"NV8"],[[127798,127798],"valid",[],"NV8"],[[127799,127868],"valid",[],"NV8"],[[127869,127869],"valid",[],"NV8"],[[127870,127871],"valid",[],"NV8"],[[127872,127891],"valid",[],"NV8"],[[127892,127903],"valid",[],"NV8"],[[127904,127940],"valid",[],"NV8"],[[127941,127941],"valid",[],"NV8"],[[127942,127946],"valid",[],"NV8"],[[127947,127950],"valid",[],"NV8"],[[127951,127955],"valid",[],"NV8"],[[127956,127967],"valid",[],"NV8"],[[127968,127984],"valid",[],"NV8"],[[127985,127991],"valid",[],"NV8"],[[127992,127999],"valid",[],"NV8"],[[128000,128062],"valid",[],"NV8"],[[128063,128063],"valid",[],"NV8"],[[128064,128064],"valid",[],"NV8"],[[128065,128065],"valid",[],"NV8"],[[128066,128247],"valid",[],"NV8"],[[128248,128248],"valid",[],"NV8"],[[128249,128252],"valid",[],"NV8"],[[128253,128254],"valid",[],"NV8"],[[128255,128255],"valid",[],"NV8"],[[128256,128317],"valid",[],"NV8"],[[128318,128319],"valid",[],"NV8"],[[128320,128323],"valid",[],"NV8"],[[128324,128330],"valid",[],"NV8"],[[128331,128335],"valid",[],"NV8"],[[128336,128359],"valid",[],"NV8"],[[128360,128377],"valid",[],"NV8"],[[128378,128378],"disallowed"],[[128379,128419],"valid",[],"NV8"],[[128420,128420],"disallowed"],[[128421,128506],"valid",[],"NV8"],[[128507,128511],"valid",[],"NV8"],[[128512,128512],"valid",[],"NV8"],[[128513,128528],"valid",[],"NV8"],[[128529,128529],"valid",[],"NV8"],[[128530,128532],"valid",[],"NV8"],[[128533,128533],"valid",[],"NV8"],[[128534,128534],"valid",[],"NV8"],[[128535,128535],"valid",[],"NV8"],[[128536,128536],"valid",[],"NV8"],[[128537,128537],"valid",[],"NV8"],[[128538,128538],"valid",[],"NV8"],[[128539,128539],"valid",[],"NV8"],[[128540,128542],"valid",[],"NV8"],[[128543,128543],"valid",[],"NV8"],[[128544,128549],"valid",[],"NV8"],[[128550,128551],"valid",[],"NV8"],[[128552,128555],"valid",[],"NV8"],[[128556,128556],"valid",[],"NV8"],[[128557,128557],"valid",[],"NV8"],[[128558,128559],"valid",[],"NV8"],[[128560,128563],"valid",[],"NV8"],[[128564,128564],"valid",[],"NV8"],[[128565,128576],"valid",[],"NV8"],[[128577,128578],"valid",[],"NV8"],[[128579,128580],"valid",[],"NV8"],[[128581,128591],"valid",[],"NV8"],[[128592,128639],"valid",[],"NV8"],[[128640,128709],"valid",[],"NV8"],[[128710,128719],"valid",[],"NV8"],[[128720,128720],"valid",[],"NV8"],[[128721,128735],"disallowed"],[[128736,128748],"valid",[],"NV8"],[[128749,128751],"disallowed"],[[128752,128755],"valid",[],"NV8"],[[128756,128767],"disallowed"],[[128768,128883],"valid",[],"NV8"],[[128884,128895],"disallowed"],[[128896,128980],"valid",[],"NV8"],[[128981,129023],"disallowed"],[[129024,129035],"valid",[],"NV8"],[[129036,129039],"disallowed"],[[129040,129095],"valid",[],"NV8"],[[129096,129103],"disallowed"],[[129104,129113],"valid",[],"NV8"],[[129114,129119],"disallowed"],[[129120,129159],"valid",[],"NV8"],[[129160,129167],"disallowed"],[[129168,129197],"valid",[],"NV8"],[[129198,129295],"disallowed"],[[129296,129304],"valid",[],"NV8"],[[129305,129407],"disallowed"],[[129408,129412],"valid",[],"NV8"],[[129413,129471],"disallowed"],[[129472,129472],"valid",[],"NV8"],[[129473,131069],"disallowed"],[[131070,131071],"disallowed"],[[131072,173782],"valid"],[[173783,173823],"disallowed"],[[173824,177972],"valid"],[[177973,177983],"disallowed"],[[177984,178205],"valid"],[[178206,178207],"disallowed"],[[178208,183969],"valid"],[[183970,194559],"disallowed"],[[194560,194560],"mapped",[20029]],[[194561,194561],"mapped",[20024]],[[194562,194562],"mapped",[20033]],[[194563,194563],"mapped",[131362]],[[194564,194564],"mapped",[20320]],[[194565,194565],"mapped",[20398]],[[194566,194566],"mapped",[20411]],[[194567,194567],"mapped",[20482]],[[194568,194568],"mapped",[20602]],[[194569,194569],"mapped",[20633]],[[194570,194570],"mapped",[20711]],[[194571,194571],"mapped",[20687]],[[194572,194572],"mapped",[13470]],[[194573,194573],"mapped",[132666]],[[194574,194574],"mapped",[20813]],[[194575,194575],"mapped",[20820]],[[194576,194576],"mapped",[20836]],[[194577,194577],"mapped",[20855]],[[194578,194578],"mapped",[132380]],[[194579,194579],"mapped",[13497]],[[194580,194580],"mapped",[20839]],[[194581,194581],"mapped",[20877]],[[194582,194582],"mapped",[132427]],[[194583,194583],"mapped",[20887]],[[194584,194584],"mapped",[20900]],[[194585,194585],"mapped",[20172]],[[194586,194586],"mapped",[20908]],[[194587,194587],"mapped",[20917]],[[194588,194588],"mapped",[168415]],[[194589,194589],"mapped",[20981]],[[194590,194590],"mapped",[20995]],[[194591,194591],"mapped",[13535]],[[194592,194592],"mapped",[21051]],[[194593,194593],"mapped",[21062]],[[194594,194594],"mapped",[21106]],[[194595,194595],"mapped",[21111]],[[194596,194596],"mapped",[13589]],[[194597,194597],"mapped",[21191]],[[194598,194598],"mapped",[21193]],[[194599,194599],"mapped",[21220]],[[194600,194600],"mapped",[21242]],[[194601,194601],"mapped",[21253]],[[194602,194602],"mapped",[21254]],[[194603,194603],"mapped",[21271]],[[194604,194604],"mapped",[21321]],[[194605,194605],"mapped",[21329]],[[194606,194606],"mapped",[21338]],[[194607,194607],"mapped",[21363]],[[194608,194608],"mapped",[21373]],[[194609,194611],"mapped",[21375]],[[194612,194612],"mapped",[133676]],[[194613,194613],"mapped",[28784]],[[194614,194614],"mapped",[21450]],[[194615,194615],"mapped",[21471]],[[194616,194616],"mapped",[133987]],[[194617,194617],"mapped",[21483]],[[194618,194618],"mapped",[21489]],[[194619,194619],"mapped",[21510]],[[194620,194620],"mapped",[21662]],[[194621,194621],"mapped",[21560]],[[194622,194622],"mapped",[21576]],[[194623,194623],"mapped",[21608]],[[194624,194624],"mapped",[21666]],[[194625,194625],"mapped",[21750]],[[194626,194626],"mapped",[21776]],[[194627,194627],"mapped",[21843]],[[194628,194628],"mapped",[21859]],[[194629,194630],"mapped",[21892]],[[194631,194631],"mapped",[21913]],[[194632,194632],"mapped",[21931]],[[194633,194633],"mapped",[21939]],[[194634,194634],"mapped",[21954]],[[194635,194635],"mapped",[22294]],[[194636,194636],"mapped",[22022]],[[194637,194637],"mapped",[22295]],[[194638,194638],"mapped",[22097]],[[194639,194639],"mapped",[22132]],[[194640,194640],"mapped",[20999]],[[194641,194641],"mapped",[22766]],[[194642,194642],"mapped",[22478]],[[194643,194643],"mapped",[22516]],[[194644,194644],"mapped",[22541]],[[194645,194645],"mapped",[22411]],[[194646,194646],"mapped",[22578]],[[194647,194647],"mapped",[22577]],[[194648,194648],"mapped",[22700]],[[194649,194649],"mapped",[136420]],[[194650,194650],"mapped",[22770]],[[194651,194651],"mapped",[22775]],[[194652,194652],"mapped",[22790]],[[194653,194653],"mapped",[22810]],[[194654,194654],"mapped",[22818]],[[194655,194655],"mapped",[22882]],[[194656,194656],"mapped",[136872]],[[194657,194657],"mapped",[136938]],[[194658,194658],"mapped",[23020]],[[194659,194659],"mapped",[23067]],[[194660,194660],"mapped",[23079]],[[194661,194661],"mapped",[23000]],[[194662,194662],"mapped",[23142]],[[194663,194663],"mapped",[14062]],[[194664,194664],"disallowed"],[[194665,194665],"mapped",[23304]],[[194666,194667],"mapped",[23358]],[[194668,194668],"mapped",[137672]],[[194669,194669],"mapped",[23491]],[[194670,194670],"mapped",[23512]],[[194671,194671],"mapped",[23527]],[[194672,194672],"mapped",[23539]],[[194673,194673],"mapped",[138008]],[[194674,194674],"mapped",[23551]],[[194675,194675],"mapped",[23558]],[[194676,194676],"disallowed"],[[194677,194677],"mapped",[23586]],[[194678,194678],"mapped",[14209]],[[194679,194679],"mapped",[23648]],[[194680,194680],"mapped",[23662]],[[194681,194681],"mapped",[23744]],[[194682,194682],"mapped",[23693]],[[194683,194683],"mapped",[138724]],[[194684,194684],"mapped",[23875]],[[194685,194685],"mapped",[138726]],[[194686,194686],"mapped",[23918]],[[194687,194687],"mapped",[23915]],[[194688,194688],"mapped",[23932]],[[194689,194689],"mapped",[24033]],[[194690,194690],"mapped",[24034]],[[194691,194691],"mapped",[14383]],[[194692,194692],"mapped",[24061]],[[194693,194693],"mapped",[24104]],[[194694,194694],"mapped",[24125]],[[194695,194695],"mapped",[24169]],[[194696,194696],"mapped",[14434]],[[194697,194697],"mapped",[139651]],[[194698,194698],"mapped",[14460]],[[194699,194699],"mapped",[24240]],[[194700,194700],"mapped",[24243]],[[194701,194701],"mapped",[24246]],[[194702,194702],"mapped",[24266]],[[194703,194703],"mapped",[172946]],[[194704,194704],"mapped",[24318]],[[194705,194706],"mapped",[140081]],[[194707,194707],"mapped",[33281]],[[194708,194709],"mapped",[24354]],[[194710,194710],"mapped",[14535]],[[194711,194711],"mapped",[144056]],[[194712,194712],"mapped",[156122]],[[194713,194713],"mapped",[24418]],[[194714,194714],"mapped",[24427]],[[194715,194715],"mapped",[14563]],[[194716,194716],"mapped",[24474]],[[194717,194717],"mapped",[24525]],[[194718,194718],"mapped",[24535]],[[194719,194719],"mapped",[24569]],[[194720,194720],"mapped",[24705]],[[194721,194721],"mapped",[14650]],[[194722,194722],"mapped",[14620]],[[194723,194723],"mapped",[24724]],[[194724,194724],"mapped",[141012]],[[194725,194725],"mapped",[24775]],[[194726,194726],"mapped",[24904]],[[194727,194727],"mapped",[24908]],[[194728,194728],"mapped",[24910]],[[194729,194729],"mapped",[24908]],[[194730,194730],"mapped",[24954]],[[194731,194731],"mapped",[24974]],[[194732,194732],"mapped",[25010]],[[194733,194733],"mapped",[24996]],[[194734,194734],"mapped",[25007]],[[194735,194735],"mapped",[25054]],[[194736,194736],"mapped",[25074]],[[194737,194737],"mapped",[25078]],[[194738,194738],"mapped",[25104]],[[194739,194739],"mapped",[25115]],[[194740,194740],"mapped",[25181]],[[194741,194741],"mapped",[25265]],[[194742,194742],"mapped",[25300]],[[194743,194743],"mapped",[25424]],[[194744,194744],"mapped",[142092]],[[194745,194745],"mapped",[25405]],[[194746,194746],"mapped",[25340]],[[194747,194747],"mapped",[25448]],[[194748,194748],"mapped",[25475]],[[194749,194749],"mapped",[25572]],[[194750,194750],"mapped",[142321]],[[194751,194751],"mapped",[25634]],[[194752,194752],"mapped",[25541]],[[194753,194753],"mapped",[25513]],[[194754,194754],"mapped",[14894]],[[194755,194755],"mapped",[25705]],[[194756,194756],"mapped",[25726]],[[194757,194757],"mapped",[25757]],[[194758,194758],"mapped",[25719]],[[194759,194759],"mapped",[14956]],[[194760,194760],"mapped",[25935]],[[194761,194761],"mapped",[25964]],[[194762,194762],"mapped",[143370]],[[194763,194763],"mapped",[26083]],[[194764,194764],"mapped",[26360]],[[194765,194765],"mapped",[26185]],[[194766,194766],"mapped",[15129]],[[194767,194767],"mapped",[26257]],[[194768,194768],"mapped",[15112]],[[194769,194769],"mapped",[15076]],[[194770,194770],"mapped",[20882]],[[194771,194771],"mapped",[20885]],[[194772,194772],"mapped",[26368]],[[194773,194773],"mapped",[26268]],[[194774,194774],"mapped",[32941]],[[194775,194775],"mapped",[17369]],[[194776,194776],"mapped",[26391]],[[194777,194777],"mapped",[26395]],[[194778,194778],"mapped",[26401]],[[194779,194779],"mapped",[26462]],[[194780,194780],"mapped",[26451]],[[194781,194781],"mapped",[144323]],[[194782,194782],"mapped",[15177]],[[194783,194783],"mapped",[26618]],[[194784,194784],"mapped",[26501]],[[194785,194785],"mapped",[26706]],[[194786,194786],"mapped",[26757]],[[194787,194787],"mapped",[144493]],[[194788,194788],"mapped",[26766]],[[194789,194789],"mapped",[26655]],[[194790,194790],"mapped",[26900]],[[194791,194791],"mapped",[15261]],[[194792,194792],"mapped",[26946]],[[194793,194793],"mapped",[27043]],[[194794,194794],"mapped",[27114]],[[194795,194795],"mapped",[27304]],[[194796,194796],"mapped",[145059]],[[194797,194797],"mapped",[27355]],[[194798,194798],"mapped",[15384]],[[194799,194799],"mapped",[27425]],[[194800,194800],"mapped",[145575]],[[194801,194801],"mapped",[27476]],[[194802,194802],"mapped",[15438]],[[194803,194803],"mapped",[27506]],[[194804,194804],"mapped",[27551]],[[194805,194805],"mapped",[27578]],[[194806,194806],"mapped",[27579]],[[194807,194807],"mapped",[146061]],[[194808,194808],"mapped",[138507]],[[194809,194809],"mapped",[146170]],[[194810,194810],"mapped",[27726]],[[194811,194811],"mapped",[146620]],[[194812,194812],"mapped",[27839]],[[194813,194813],"mapped",[27853]],[[194814,194814],"mapped",[27751]],[[194815,194815],"mapped",[27926]],[[194816,194816],"mapped",[27966]],[[194817,194817],"mapped",[28023]],[[194818,194818],"mapped",[27969]],[[194819,194819],"mapped",[28009]],[[194820,194820],"mapped",[28024]],[[194821,194821],"mapped",[28037]],[[194822,194822],"mapped",[146718]],[[194823,194823],"mapped",[27956]],[[194824,194824],"mapped",[28207]],[[194825,194825],"mapped",[28270]],[[194826,194826],"mapped",[15667]],[[194827,194827],"mapped",[28363]],[[194828,194828],"mapped",[28359]],[[194829,194829],"mapped",[147153]],[[194830,194830],"mapped",[28153]],[[194831,194831],"mapped",[28526]],[[194832,194832],"mapped",[147294]],[[194833,194833],"mapped",[147342]],[[194834,194834],"mapped",[28614]],[[194835,194835],"mapped",[28729]],[[194836,194836],"mapped",[28702]],[[194837,194837],"mapped",[28699]],[[194838,194838],"mapped",[15766]],[[194839,194839],"mapped",[28746]],[[194840,194840],"mapped",[28797]],[[194841,194841],"mapped",[28791]],[[194842,194842],"mapped",[28845]],[[194843,194843],"mapped",[132389]],[[194844,194844],"mapped",[28997]],[[194845,194845],"mapped",[148067]],[[194846,194846],"mapped",[29084]],[[194847,194847],"disallowed"],[[194848,194848],"mapped",[29224]],[[194849,194849],"mapped",[29237]],[[194850,194850],"mapped",[29264]],[[194851,194851],"mapped",[149000]],[[194852,194852],"mapped",[29312]],[[194853,194853],"mapped",[29333]],[[194854,194854],"mapped",[149301]],[[194855,194855],"mapped",[149524]],[[194856,194856],"mapped",[29562]],[[194857,194857],"mapped",[29579]],[[194858,194858],"mapped",[16044]],[[194859,194859],"mapped",[29605]],[[194860,194861],"mapped",[16056]],[[194862,194862],"mapped",[29767]],[[194863,194863],"mapped",[29788]],[[194864,194864],"mapped",[29809]],[[194865,194865],"mapped",[29829]],[[194866,194866],"mapped",[29898]],[[194867,194867],"mapped",[16155]],[[194868,194868],"mapped",[29988]],[[194869,194869],"mapped",[150582]],[[194870,194870],"mapped",[30014]],[[194871,194871],"mapped",[150674]],[[194872,194872],"mapped",[30064]],[[194873,194873],"mapped",[139679]],[[194874,194874],"mapped",[30224]],[[194875,194875],"mapped",[151457]],[[194876,194876],"mapped",[151480]],[[194877,194877],"mapped",[151620]],[[194878,194878],"mapped",[16380]],[[194879,194879],"mapped",[16392]],[[194880,194880],"mapped",[30452]],[[194881,194881],"mapped",[151795]],[[194882,194882],"mapped",[151794]],[[194883,194883],"mapped",[151833]],[[194884,194884],"mapped",[151859]],[[194885,194885],"mapped",[30494]],[[194886,194887],"mapped",[30495]],[[194888,194888],"mapped",[30538]],[[194889,194889],"mapped",[16441]],[[194890,194890],"mapped",[30603]],[[194891,194891],"mapped",[16454]],[[194892,194892],"mapped",[16534]],[[194893,194893],"mapped",[152605]],[[194894,194894],"mapped",[30798]],[[194895,194895],"mapped",[30860]],[[194896,194896],"mapped",[30924]],[[194897,194897],"mapped",[16611]],[[194898,194898],"mapped",[153126]],[[194899,194899],"mapped",[31062]],[[194900,194900],"mapped",[153242]],[[194901,194901],"mapped",[153285]],[[194902,194902],"mapped",[31119]],[[194903,194903],"mapped",[31211]],[[194904,194904],"mapped",[16687]],[[194905,194905],"mapped",[31296]],[[194906,194906],"mapped",[31306]],[[194907,194907],"mapped",[31311]],[[194908,194908],"mapped",[153980]],[[194909,194910],"mapped",[154279]],[[194911,194911],"disallowed"],[[194912,194912],"mapped",[16898]],[[194913,194913],"mapped",[154539]],[[194914,194914],"mapped",[31686]],[[194915,194915],"mapped",[31689]],[[194916,194916],"mapped",[16935]],[[194917,194917],"mapped",[154752]],[[194918,194918],"mapped",[31954]],[[194919,194919],"mapped",[17056]],[[194920,194920],"mapped",[31976]],[[194921,194921],"mapped",[31971]],[[194922,194922],"mapped",[32000]],[[194923,194923],"mapped",[155526]],[[194924,194924],"mapped",[32099]],[[194925,194925],"mapped",[17153]],[[194926,194926],"mapped",[32199]],[[194927,194927],"mapped",[32258]],[[194928,194928],"mapped",[32325]],[[194929,194929],"mapped",[17204]],[[194930,194930],"mapped",[156200]],[[194931,194931],"mapped",[156231]],[[194932,194932],"mapped",[17241]],[[194933,194933],"mapped",[156377]],[[194934,194934],"mapped",[32634]],[[194935,194935],"mapped",[156478]],[[194936,194936],"mapped",[32661]],[[194937,194937],"mapped",[32762]],[[194938,194938],"mapped",[32773]],[[194939,194939],"mapped",[156890]],[[194940,194940],"mapped",[156963]],[[194941,194941],"mapped",[32864]],[[194942,194942],"mapped",[157096]],[[194943,194943],"mapped",[32880]],[[194944,194944],"mapped",[144223]],[[194945,194945],"mapped",[17365]],[[194946,194946],"mapped",[32946]],[[194947,194947],"mapped",[33027]],[[194948,194948],"mapped",[17419]],[[194949,194949],"mapped",[33086]],[[194950,194950],"mapped",[23221]],[[194951,194951],"mapped",[157607]],[[194952,194952],"mapped",[157621]],[[194953,194953],"mapped",[144275]],[[194954,194954],"mapped",[144284]],[[194955,194955],"mapped",[33281]],[[194956,194956],"mapped",[33284]],[[194957,194957],"mapped",[36766]],[[194958,194958],"mapped",[17515]],[[194959,194959],"mapped",[33425]],[[194960,194960],"mapped",[33419]],[[194961,194961],"mapped",[33437]],[[194962,194962],"mapped",[21171]],[[194963,194963],"mapped",[33457]],[[194964,194964],"mapped",[33459]],[[194965,194965],"mapped",[33469]],[[194966,194966],"mapped",[33510]],[[194967,194967],"mapped",[158524]],[[194968,194968],"mapped",[33509]],[[194969,194969],"mapped",[33565]],[[194970,194970],"mapped",[33635]],[[194971,194971],"mapped",[33709]],[[194972,194972],"mapped",[33571]],[[194973,194973],"mapped",[33725]],[[194974,194974],"mapped",[33767]],[[194975,194975],"mapped",[33879]],[[194976,194976],"mapped",[33619]],[[194977,194977],"mapped",[33738]],[[194978,194978],"mapped",[33740]],[[194979,194979],"mapped",[33756]],[[194980,194980],"mapped",[158774]],[[194981,194981],"mapped",[159083]],[[194982,194982],"mapped",[158933]],[[194983,194983],"mapped",[17707]],[[194984,194984],"mapped",[34033]],[[194985,194985],"mapped",[34035]],[[194986,194986],"mapped",[34070]],[[194987,194987],"mapped",[160714]],[[194988,194988],"mapped",[34148]],[[194989,194989],"mapped",[159532]],[[194990,194990],"mapped",[17757]],[[194991,194991],"mapped",[17761]],[[194992,194992],"mapped",[159665]],[[194993,194993],"mapped",[159954]],[[194994,194994],"mapped",[17771]],[[194995,194995],"mapped",[34384]],[[194996,194996],"mapped",[34396]],[[194997,194997],"mapped",[34407]],[[194998,194998],"mapped",[34409]],[[194999,194999],"mapped",[34473]],[[195000,195000],"mapped",[34440]],[[195001,195001],"mapped",[34574]],[[195002,195002],"mapped",[34530]],[[195003,195003],"mapped",[34681]],[[195004,195004],"mapped",[34600]],[[195005,195005],"mapped",[34667]],[[195006,195006],"mapped",[34694]],[[195007,195007],"disallowed"],[[195008,195008],"mapped",[34785]],[[195009,195009],"mapped",[34817]],[[195010,195010],"mapped",[17913]],[[195011,195011],"mapped",[34912]],[[195012,195012],"mapped",[34915]],[[195013,195013],"mapped",[161383]],[[195014,195014],"mapped",[35031]],[[195015,195015],"mapped",[35038]],[[195016,195016],"mapped",[17973]],[[195017,195017],"mapped",[35066]],[[195018,195018],"mapped",[13499]],[[195019,195019],"mapped",[161966]],[[195020,195020],"mapped",[162150]],[[195021,195021],"mapped",[18110]],[[195022,195022],"mapped",[18119]],[[195023,195023],"mapped",[35488]],[[195024,195024],"mapped",[35565]],[[195025,195025],"mapped",[35722]],[[195026,195026],"mapped",[35925]],[[195027,195027],"mapped",[162984]],[[195028,195028],"mapped",[36011]],[[195029,195029],"mapped",[36033]],[[195030,195030],"mapped",[36123]],[[195031,195031],"mapped",[36215]],[[195032,195032],"mapped",[163631]],[[195033,195033],"mapped",[133124]],[[195034,195034],"mapped",[36299]],[[195035,195035],"mapped",[36284]],[[195036,195036],"mapped",[36336]],[[195037,195037],"mapped",[133342]],[[195038,195038],"mapped",[36564]],[[195039,195039],"mapped",[36664]],[[195040,195040],"mapped",[165330]],[[195041,195041],"mapped",[165357]],[[195042,195042],"mapped",[37012]],[[195043,195043],"mapped",[37105]],[[195044,195044],"mapped",[37137]],[[195045,195045],"mapped",[165678]],[[195046,195046],"mapped",[37147]],[[195047,195047],"mapped",[37432]],[[195048,195048],"mapped",[37591]],[[195049,195049],"mapped",[37592]],[[195050,195050],"mapped",[37500]],[[195051,195051],"mapped",[37881]],[[195052,195052],"mapped",[37909]],[[195053,195053],"mapped",[166906]],[[195054,195054],"mapped",[38283]],[[195055,195055],"mapped",[18837]],[[195056,195056],"mapped",[38327]],[[195057,195057],"mapped",[167287]],[[195058,195058],"mapped",[18918]],[[195059,195059],"mapped",[38595]],[[195060,195060],"mapped",[23986]],[[195061,195061],"mapped",[38691]],[[195062,195062],"mapped",[168261]],[[195063,195063],"mapped",[168474]],[[195064,195064],"mapped",[19054]],[[195065,195065],"mapped",[19062]],[[195066,195066],"mapped",[38880]],[[195067,195067],"mapped",[168970]],[[195068,195068],"mapped",[19122]],[[195069,195069],"mapped",[169110]],[[195070,195071],"mapped",[38923]],[[195072,195072],"mapped",[38953]],[[195073,195073],"mapped",[169398]],[[195074,195074],"mapped",[39138]],[[195075,195075],"mapped",[19251]],[[195076,195076],"mapped",[39209]],[[195077,195077],"mapped",[39335]],[[195078,195078],"mapped",[39362]],[[195079,195079],"mapped",[39422]],[[195080,195080],"mapped",[19406]],[[195081,195081],"mapped",[170800]],[[195082,195082],"mapped",[39698]],[[195083,195083],"mapped",[40000]],[[195084,195084],"mapped",[40189]],[[195085,195085],"mapped",[19662]],[[195086,195086],"mapped",[19693]],[[195087,195087],"mapped",[40295]],[[195088,195088],"mapped",[172238]],[[195089,195089],"mapped",[19704]],[[195090,195090],"mapped",[172293]],[[195091,195091],"mapped",[172558]],[[195092,195092],"mapped",[172689]],[[195093,195093],"mapped",[40635]],[[195094,195094],"mapped",[19798]],[[195095,195095],"mapped",[40697]],[[195096,195096],"mapped",[40702]],[[195097,195097],"mapped",[40709]],[[195098,195098],"mapped",[40719]],[[195099,195099],"mapped",[40726]],[[195100,195100],"mapped",[40763]],[[195101,195101],"mapped",[173568]],[[195102,196605],"disallowed"],[[196606,196607],"disallowed"],[[196608,262141],"disallowed"],[[262142,262143],"disallowed"],[[262144,327677],"disallowed"],[[327678,327679],"disallowed"],[[327680,393213],"disallowed"],[[393214,393215],"disallowed"],[[393216,458749],"disallowed"],[[458750,458751],"disallowed"],[[458752,524285],"disallowed"],[[524286,524287],"disallowed"],[[524288,589821],"disallowed"],[[589822,589823],"disallowed"],[[589824,655357],"disallowed"],[[655358,655359],"disallowed"],[[655360,720893],"disallowed"],[[720894,720895],"disallowed"],[[720896,786429],"disallowed"],[[786430,786431],"disallowed"],[[786432,851965],"disallowed"],[[851966,851967],"disallowed"],[[851968,917501],"disallowed"],[[917502,917503],"disallowed"],[[917504,917504],"disallowed"],[[917505,917505],"disallowed"],[[917506,917535],"disallowed"],[[917536,917631],"disallowed"],[[917632,917759],"disallowed"],[[917760,917999],"ignored"],[[918000,983037],"disallowed"],[[983038,983039],"disallowed"],[[983040,1048573],"disallowed"],[[1048574,1048575],"disallowed"],[[1048576,1114109],"disallowed"],[[1114110,1114111],"disallowed"]] \ No newline at end of file diff --git a/node_modules/node-fetch/node_modules/tr46/package.json b/node_modules/node-fetch/node_modules/tr46/package.json new file mode 100644 index 00000000..b6826da1 --- /dev/null +++ b/node_modules/node-fetch/node_modules/tr46/package.json @@ -0,0 +1,31 @@ +{ + "name": "tr46", + "version": "0.0.3", + "description": "An implementation of the Unicode TR46 spec", + "main": "index.js", + "scripts": { + "test": "mocha", + "pretest": "node scripts/getLatestUnicodeTests.js", + "prepublish": "node scripts/generateMappingTable.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Sebmaster/tr46.js.git" + }, + "keywords": [ + "unicode", + "tr46", + "url", + "whatwg" + ], + "author": "Sebastian Mayr ", + "license": "MIT", + "bugs": { + "url": "https://github.com/Sebmaster/tr46.js/issues" + }, + "homepage": "https://github.com/Sebmaster/tr46.js#readme", + "devDependencies": { + "mocha": "^2.2.5", + "request": "^2.57.0" + } +} diff --git a/node_modules/node-fetch/node_modules/webidl-conversions/LICENSE.md b/node_modules/node-fetch/node_modules/webidl-conversions/LICENSE.md new file mode 100644 index 00000000..d4a994f5 --- /dev/null +++ b/node_modules/node-fetch/node_modules/webidl-conversions/LICENSE.md @@ -0,0 +1,12 @@ +# The BSD 2-Clause License + +Copyright (c) 2014, Domenic Denicola +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/node-fetch/node_modules/webidl-conversions/README.md b/node_modules/node-fetch/node_modules/webidl-conversions/README.md new file mode 100644 index 00000000..3657890a --- /dev/null +++ b/node_modules/node-fetch/node_modules/webidl-conversions/README.md @@ -0,0 +1,53 @@ +# WebIDL Type Conversions on JavaScript Values + +This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [WebIDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types). + +The goal is that you should be able to write code like + +```js +const conversions = require("webidl-conversions"); + +function doStuff(x, y) { + x = conversions["boolean"](x); + y = conversions["unsigned long"](y); + // actual algorithm code here +} +``` + +and your function `doStuff` will behave the same as a WebIDL operation declared as + +```webidl +void doStuff(boolean x, unsigned long y); +``` + +## API + +This package's main module's default export is an object with a variety of methods, each corresponding to a different WebIDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the WebIDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the WebIDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float). + +## Status + +All of the numeric types are implemented (float being implemented as double) and some others are as well - check the source for all of them. This list will grow over time in service of the [HTML as Custom Elements](https://github.com/dglazkov/html-as-custom-elements) project, but in the meantime, pull requests welcome! + +I'm not sure yet what the strategy will be for modifiers, e.g. [`[Clamp]`](http://heycam.github.io/webidl/#Clamp). Maybe something like `conversions["unsigned long"](x, { clamp: true })`? We'll see. + +We might also want to extend the API to give better error messages, e.g. "Argument 1 of HTMLMediaElement.fastSeek is not a finite floating-point value" instead of "Argument is not a finite floating-point value." This would require passing in more information to the conversion functions than we currently do. + +## Background + +What's actually going on here, conceptually, is pretty weird. Let's try to explain. + +WebIDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on WebIDL values, i.e. instances of WebIDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a WebIDL value of [WebIDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules. + +Separately from its type system, WebIDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given WebIDL operation, how does that get converted into a WebIDL value? For example, a JavaScript `true` passed in the position of a WebIDL `boolean` argument becomes a WebIDL `true`. But, a JavaScript `true` passed in the position of a [WebIDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a WebIDL `1`. And so on. + +Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the WebIDL algorithms, they don't actually use WebIDL values, since those aren't "real" outside of specs. Instead, implementations apply the WebIDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`. + +The upside of all this is that implementations can abstract all the conversion logic away, letting WebIDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of WebIDL, in a nutshell. + +And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given WebIDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ WebIDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ WebIDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a WebIDL `1` in an unsigned long context, which then becomes a JavaScript `1`. + +## Don't Use This + +Seriously, why would you ever use this? You really shouldn't. WebIDL is … not great, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from WebIDL. In general, your JavaScript should not be trying to become more like WebIDL; if anything, we should fix WebIDL to make it more like JavaScript. + +The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in WebIDL. diff --git a/node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js b/node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js new file mode 100644 index 00000000..c5153a3a --- /dev/null +++ b/node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js @@ -0,0 +1,189 @@ +"use strict"; + +var conversions = {}; +module.exports = conversions; + +function sign(x) { + return x < 0 ? -1 : 1; +} + +function evenRound(x) { + // Round x to the nearest integer, choosing the even integer if it lies halfway between two. + if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor) + return Math.floor(x); + } else { + return Math.round(x); + } +} + +function createNumberConversion(bitLength, typeOpts) { + if (!typeOpts.unsigned) { + --bitLength; + } + const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); + const upperBound = Math.pow(2, bitLength) - 1; + + const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); + const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); + + return function(V, opts) { + if (!opts) opts = {}; + + let x = +V; + + if (opts.enforceRange) { + if (!Number.isFinite(x)) { + throw new TypeError("Argument is not a finite number"); + } + + x = sign(x) * Math.floor(Math.abs(x)); + if (x < lowerBound || x > upperBound) { + throw new TypeError("Argument is not in byte range"); + } + + return x; + } + + if (!isNaN(x) && opts.clamp) { + x = evenRound(x); + + if (x < lowerBound) x = lowerBound; + if (x > upperBound) x = upperBound; + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + + x = sign(x) * Math.floor(Math.abs(x)); + x = x % moduloVal; + + if (!typeOpts.unsigned && x >= moduloBound) { + return x - moduloVal; + } else if (typeOpts.unsigned) { + if (x < 0) { + x += moduloVal; + } else if (x === -0) { // don't return negative zero + return 0; + } + } + + return x; + } +} + +conversions["void"] = function () { + return undefined; +}; + +conversions["boolean"] = function (val) { + return !!val; +}; + +conversions["byte"] = createNumberConversion(8, { unsigned: false }); +conversions["octet"] = createNumberConversion(8, { unsigned: true }); + +conversions["short"] = createNumberConversion(16, { unsigned: false }); +conversions["unsigned short"] = createNumberConversion(16, { unsigned: true }); + +conversions["long"] = createNumberConversion(32, { unsigned: false }); +conversions["unsigned long"] = createNumberConversion(32, { unsigned: true }); + +conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 }); +conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 }); + +conversions["double"] = function (V) { + const x = +V; + + if (!Number.isFinite(x)) { + throw new TypeError("Argument is not a finite floating-point value"); + } + + return x; +}; + +conversions["unrestricted double"] = function (V) { + const x = +V; + + if (isNaN(x)) { + throw new TypeError("Argument is NaN"); + } + + return x; +}; + +// not quite valid, but good enough for JS +conversions["float"] = conversions["double"]; +conversions["unrestricted float"] = conversions["unrestricted double"]; + +conversions["DOMString"] = function (V, opts) { + if (!opts) opts = {}; + + if (opts.treatNullAsEmptyString && V === null) { + return ""; + } + + return String(V); +}; + +conversions["ByteString"] = function (V, opts) { + const x = String(V); + let c = undefined; + for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { + if (c > 255) { + throw new TypeError("Argument is not a valid bytestring"); + } + } + + return x; +}; + +conversions["USVString"] = function (V) { + const S = String(V); + const n = S.length; + const U = []; + for (let i = 0; i < n; ++i) { + const c = S.charCodeAt(i); + if (c < 0xD800 || c > 0xDFFF) { + U.push(String.fromCodePoint(c)); + } else if (0xDC00 <= c && c <= 0xDFFF) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + if (i === n - 1) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + const d = S.charCodeAt(i + 1); + if (0xDC00 <= d && d <= 0xDFFF) { + const a = c & 0x3FF; + const b = d & 0x3FF; + U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b)); + ++i; + } else { + U.push(String.fromCodePoint(0xFFFD)); + } + } + } + } + + return U.join(''); +}; + +conversions["Date"] = function (V, opts) { + if (!(V instanceof Date)) { + throw new TypeError("Argument is not a Date object"); + } + if (isNaN(V)) { + return undefined; + } + + return V; +}; + +conversions["RegExp"] = function (V, opts) { + if (!(V instanceof RegExp)) { + V = new RegExp(V); + } + + return V; +}; diff --git a/node_modules/node-fetch/node_modules/webidl-conversions/package.json b/node_modules/node-fetch/node_modules/webidl-conversions/package.json new file mode 100644 index 00000000..c31bc074 --- /dev/null +++ b/node_modules/node-fetch/node_modules/webidl-conversions/package.json @@ -0,0 +1,23 @@ +{ + "name": "webidl-conversions", + "version": "3.0.1", + "description": "Implements the WebIDL algorithms for converting to and from JavaScript values", + "main": "lib/index.js", + "scripts": { + "test": "mocha test/*.js" + }, + "repository": "jsdom/webidl-conversions", + "keywords": [ + "webidl", + "web", + "types" + ], + "files": [ + "lib/" + ], + "author": "Domenic Denicola (https://domenic.me/)", + "license": "BSD-2-Clause", + "devDependencies": { + "mocha": "^1.21.4" + } +} diff --git a/node_modules/node-fetch/node_modules/whatwg-url/LICENSE.txt b/node_modules/node-fetch/node_modules/whatwg-url/LICENSE.txt new file mode 100644 index 00000000..54dfac39 --- /dev/null +++ b/node_modules/node-fetch/node_modules/whatwg-url/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015–2016 Sebastian Mayr + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/node-fetch/node_modules/whatwg-url/README.md b/node_modules/node-fetch/node_modules/whatwg-url/README.md new file mode 100644 index 00000000..4347a7fc --- /dev/null +++ b/node_modules/node-fetch/node_modules/whatwg-url/README.md @@ -0,0 +1,67 @@ +# whatwg-url + +whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/tmpvar/jsdom). + +## Current Status + +whatwg-url is currently up to date with the URL spec up to commit [a62223](https://github.com/whatwg/url/commit/a622235308342c9adc7fc2fd1659ff059f7d5e2a). + +## API + +### The `URL` Constructor + +The main API is the [`URL`](https://url.spec.whatwg.org/#url) export, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use this. + +### Low-level URL Standard API + +The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type. + +- [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL, encodingOverride })` +- [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, encodingOverride, url, stateOverride })` +- [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)` +- [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)` +- [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)` +- [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/browsers.html#serialization-of-an-origin): `serializeURLOrigin(urlRecord)` +- [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)` +- [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)` +- [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)` + +The `stateOverride` parameter is one of the following strings: + +- [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state) +- [`"scheme"`](https://url.spec.whatwg.org/#scheme-state) +- [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state) +- [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state) +- [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state) +- [`"relative"`](https://url.spec.whatwg.org/#relative-state) +- [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state) +- [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state) +- [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state) +- [`"authority"`](https://url.spec.whatwg.org/#authority-state) +- [`"host"`](https://url.spec.whatwg.org/#host-state) +- [`"hostname"`](https://url.spec.whatwg.org/#hostname-state) +- [`"port"`](https://url.spec.whatwg.org/#port-state) +- [`"file"`](https://url.spec.whatwg.org/#file-state) +- [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state) +- [`"file host"`](https://url.spec.whatwg.org/#file-host-state) +- [`"path start"`](https://url.spec.whatwg.org/#path-start-state) +- [`"path"`](https://url.spec.whatwg.org/#path-state) +- [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state) +- [`"query"`](https://url.spec.whatwg.org/#query-state) +- [`"fragment"`](https://url.spec.whatwg.org/#fragment-state) + +The URL record type has the following API: + +- [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme) +- [`username`](https://url.spec.whatwg.org/#concept-url-username) +- [`password`](https://url.spec.whatwg.org/#concept-url-password) +- [`host`](https://url.spec.whatwg.org/#concept-url-host) +- [`port`](https://url.spec.whatwg.org/#concept-url-port) +- [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array) +- [`query`](https://url.spec.whatwg.org/#concept-url-query) +- [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment) +- [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean) + +These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state. + +The return value of "failure" in the spec is represented by the string `"failure"`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ the string `"failure"`. diff --git a/node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js b/node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js new file mode 100644 index 00000000..dc7452cc --- /dev/null +++ b/node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js @@ -0,0 +1,200 @@ +"use strict"; +const usm = require("./url-state-machine"); + +exports.implementation = class URLImpl { + constructor(constructorArgs) { + const url = constructorArgs[0]; + const base = constructorArgs[1]; + + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === "failure") { + throw new TypeError("Invalid base URL"); + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === "failure") { + throw new TypeError("Invalid URL"); + } + + this._url = parsedURL; + + // TODO: query stuff + } + + get href() { + return usm.serializeURL(this._url); + } + + set href(v) { + const parsedURL = usm.basicURLParse(v); + if (parsedURL === "failure") { + throw new TypeError("Invalid URL"); + } + + this._url = parsedURL; + } + + get origin() { + return usm.serializeURLOrigin(this._url); + } + + get protocol() { + return this._url.scheme + ":"; + } + + set protocol(v) { + usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" }); + } + + get username() { + return this._url.username; + } + + set username(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setTheUsername(this._url, v); + } + + get password() { + return this._url.password; + } + + set password(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setThePassword(this._url, v); + } + + get host() { + const url = this._url; + + if (url.host === null) { + return ""; + } + + if (url.port === null) { + return usm.serializeHost(url.host); + } + + return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port); + } + + set host(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); + } + + get hostname() { + if (this._url.host === null) { + return ""; + } + + return usm.serializeHost(this._url.host); + } + + set hostname(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); + } + + get port() { + if (this._url.port === null) { + return ""; + } + + return usm.serializeInteger(this._url.port); + } + + set port(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + if (v === "") { + this._url.port = null; + } else { + usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); + } + } + + get pathname() { + if (this._url.cannotBeABaseURL) { + return this._url.path[0]; + } + + if (this._url.path.length === 0) { + return ""; + } + + return "/" + this._url.path.join("/"); + } + + set pathname(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + this._url.path = []; + usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); + } + + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + + return "?" + this._url.query; + } + + set search(v) { + // TODO: query stuff + + const url = this._url; + + if (v === "") { + url.query = null; + return; + } + + const input = v[0] === "?" ? v.substring(1) : v; + url.query = ""; + usm.basicURLParse(input, { url, stateOverride: "query" }); + } + + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + + return "#" + this._url.fragment; + } + + set hash(v) { + if (v === "") { + this._url.fragment = null; + return; + } + + const input = v[0] === "#" ? v.substring(1) : v; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + + toJSON() { + return this.href; + } +}; diff --git a/node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js b/node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js new file mode 100644 index 00000000..78c7207e --- /dev/null +++ b/node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js @@ -0,0 +1,196 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); +const Impl = require(".//URL-impl.js"); + +const impl = utils.implSymbol; + +function URL(url) { + if (!this || this[impl] || !(this instanceof URL)) { + throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); + } + if (arguments.length < 1) { + throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); + } + const args = []; + for (let i = 0; i < arguments.length && i < 2; ++i) { + args[i] = arguments[i]; + } + args[0] = conversions["USVString"](args[0]); + if (args[1] !== undefined) { + args[1] = conversions["USVString"](args[1]); + } + + module.exports.setup(this, args); +} + +URL.prototype.toJSON = function toJSON() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + const args = []; + for (let i = 0; i < arguments.length && i < 0; ++i) { + args[i] = arguments[i]; + } + return this[impl].toJSON.apply(this[impl], args); +}; +Object.defineProperty(URL.prototype, "href", { + get() { + return this[impl].href; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].href = V; + }, + enumerable: true, + configurable: true +}); + +URL.prototype.toString = function () { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return this.href; +}; + +Object.defineProperty(URL.prototype, "origin", { + get() { + return this[impl].origin; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "protocol", { + get() { + return this[impl].protocol; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].protocol = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "username", { + get() { + return this[impl].username; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].username = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "password", { + get() { + return this[impl].password; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].password = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "host", { + get() { + return this[impl].host; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].host = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "hostname", { + get() { + return this[impl].hostname; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].hostname = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "port", { + get() { + return this[impl].port; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].port = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "pathname", { + get() { + return this[impl].pathname; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].pathname = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "search", { + get() { + return this[impl].search; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].search = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "hash", { + get() { + return this[impl].hash; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].hash = V; + }, + enumerable: true, + configurable: true +}); + + +module.exports = { + is(obj) { + return !!obj && obj[impl] instanceof Impl.implementation; + }, + create(constructorArgs, privateData) { + let obj = Object.create(URL.prototype); + this.setup(obj, constructorArgs, privateData); + return obj; + }, + setup(obj, constructorArgs, privateData) { + if (!privateData) privateData = {}; + privateData.wrapper = obj; + + obj[impl] = new Impl.implementation(constructorArgs, privateData); + obj[impl][utils.wrapperSymbol] = obj; + }, + interface: URL, + expose: { + Window: { URL: URL }, + Worker: { URL: URL } + } +}; + diff --git a/node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js b/node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js new file mode 100644 index 00000000..932dcada --- /dev/null +++ b/node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js @@ -0,0 +1,11 @@ +"use strict"; + +exports.URL = require("./URL").interface; +exports.serializeURL = require("./url-state-machine").serializeURL; +exports.serializeURLOrigin = require("./url-state-machine").serializeURLOrigin; +exports.basicURLParse = require("./url-state-machine").basicURLParse; +exports.setTheUsername = require("./url-state-machine").setTheUsername; +exports.setThePassword = require("./url-state-machine").setThePassword; +exports.serializeHost = require("./url-state-machine").serializeHost; +exports.serializeInteger = require("./url-state-machine").serializeInteger; +exports.parseURL = require("./url-state-machine").parseURL; diff --git a/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js b/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js new file mode 100644 index 00000000..27d977a2 --- /dev/null +++ b/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js @@ -0,0 +1,1297 @@ +"use strict"; +const punycode = require("punycode"); +const tr46 = require("tr46"); + +const specialSchemes = { + ftp: 21, + file: null, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443 +}; + +const failure = Symbol("failure"); + +function countSymbols(str) { + return punycode.ucs2.decode(str).length; +} + +function at(input, idx) { + const c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); +} + +function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; +} + +function isASCIIAlpha(c) { + return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); +} + +function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); +} + +function isASCIIHex(c) { + return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); +} + +function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; +} + +function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; +} + +function isWindowsDriveLetterCodePoints(cp1, cp2) { + return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); +} + +function isWindowsDriveLetterString(string) { + return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); +} + +function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; +} + +function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; +} + +function containsForbiddenHostCodePointExcludingPercent(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; +} + +function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; +} + +function isSpecial(url) { + return isSpecialScheme(url.scheme); +} + +function defaultPort(scheme) { + return specialSchemes[scheme]; +} + +function percentEncode(c) { + let hex = c.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = "0" + hex; + } + + return "%" + hex; +} + +function utf8PercentEncode(c) { + const buf = new Buffer(c); + + let str = ""; + + for (let i = 0; i < buf.length; ++i) { + str += percentEncode(buf[i]); + } + + return str; +} + +function utf8PercentDecode(str) { + const input = new Buffer(str); + const output = []; + for (let i = 0; i < input.length; ++i) { + if (input[i] !== 37) { + output.push(input[i]); + } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { + output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); + i += 2; + } else { + output.push(input[i]); + } + } + return new Buffer(output).toString(); +} + +function isC0ControlPercentEncode(c) { + return c <= 0x1F || c > 0x7E; +} + +const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); +function isPathPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); +} + +const extraUserinfoPercentEncodeSet = + new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); +function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); +} + +function percentEncodeChar(c, encodeSetPredicate) { + const cStr = String.fromCodePoint(c); + + if (encodeSetPredicate(c)) { + return utf8PercentEncode(cStr); + } + + return cStr; +} + +function parseIPv4Number(input) { + let R = 10; + + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/); + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); +} + +function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return input; + } + + const numbers = []; + for (const part of parts) { + if (part === "") { + return input; + } + const n = parseIPv4Number(part); + if (n === failure) { + return input; + } + + numbers.push(n); + } + + for (let i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { + return failure; + } + + let ipv4 = numbers.pop(); + let counter = 0; + + for (const n of numbers) { + ipv4 += n * Math.pow(256, 3 - counter); + ++counter; + } + + return ipv4; +} + +function serializeIPv4(address) { + let output = ""; + let n = address; + + for (let i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + if (i !== 4) { + output = "." + output; + } + n = Math.floor(n / 256); + } + + return output; +} + +function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + + input = punycode.ucs2.decode(input); + + if (input[pointer] === 58) { + if (input[pointer + 1] !== 58) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === 58) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + let value = 0; + let length = 0; + + while (length < 4 && isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === 46) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + let numbersSeen = 0; + + while (input[pointer] !== undefined) { + let ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === 46 && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!isASCIIDigit(input[pointer])) { + return failure; + } + + while (isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === 58) { + ++pointer; + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; +} + +function serializeIPv6(address) { + let output = ""; + const seqResult = findLongestZeroSequence(address); + const compress = seqResult.idx; + let ignore0 = false; + + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; +} + +function parseHost(input, isSpecialArg) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (!isSpecialArg) { + return parseOpaqueHost(input); + } + + const domain = utf8PercentDecode(input); + const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); + if (asciiDomain === null) { + return failure; + } + + if (containsForbiddenHostCodePoint(asciiDomain)) { + return failure; + } + + const ipv4Host = parseIPv4(asciiDomain); + if (typeof ipv4Host === "number" || ipv4Host === failure) { + return ipv4Host; + } + + return asciiDomain; +} + +function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { + return failure; + } + + let output = ""; + const decoded = punycode.ucs2.decode(input); + for (let i = 0; i < decoded.length; ++i) { + output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); + } + return output; +} + +function findLongestZeroSequence(arr) { + let maxIdx = null; + let maxLen = 1; // only find elements > 1 + let currStart = null; + let currLen = 0; + + for (let i = 0; i < arr.length; ++i) { + if (arr[i] !== 0) { + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + currStart = null; + currLen = 0; + } else { + if (currStart === null) { + currStart = i; + } + ++currLen; + } + } + + // if trailing zeros + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + return { + idx: maxIdx, + len: maxLen + }; +} + +function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + // IPv6 serializer + if (host instanceof Array) { + return "[" + serializeIPv6(host) + "]"; + } + + return host; +} + +function trimControlChars(url) { + return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); +} + +function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/g, ""); +} + +function shortenPath(url) { + const path = url.path; + if (path.length === 0) { + return; + } + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + + path.pop(); +} + +function includesCredentials(url) { + return url.username !== "" || url.password !== ""; +} + +function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; +} + +function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/.test(string); +} + +function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null, + + cannotBeABaseURL: false + }; + + const res = trimControlChars(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + } + + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + + this.state = stateOverride || "scheme start"; + + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + + this.input = punycode.ucs2.decode(this.input); + + for (; this.pointer <= this.input.length; ++this.pointer) { + const c = this.input[this.pointer]; + const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + + // exec state machine + const ret = this["parse " + this.state](c, cStr); + if (!ret) { + break; // terminate algorithm + } else if (ret === failure) { + this.failure = true; + break; + } + } +} + +URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { + if (isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { + this.buffer += cStr.toLowerCase(); + } else if (c === 58) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + + if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { + return false; + } + } + this.url.scheme = this.buffer; + this.buffer = ""; + if (this.stateOverride) { + return false; + } + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { + this.parseError = true; + } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === 47) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.cannotBeABaseURL = true; + this.url.path.push(""); + this.state = "cannot-be-a-base-URL path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { + return failure; + } else if (this.base.cannotBeABaseURL && c === 35) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.url.cannotBeABaseURL = true; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { + if (c === 47) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + if (isNaN(c)) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 47) { + this.state = "relative slash"; + } else if (c === 63) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (isSpecial(this.url) && c === 92) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(0, this.base.path.length - 1); + + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === 47 || c === 92)) { + if (c === 92) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c === 47) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== 47 && c !== 92) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; +}; + +URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { + if (c === 64) { + this.parseError = true; + if (this.atFlag) { + this.buffer = "%40" + this.buffer; + } + this.atFlag = true; + + // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === 58 && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92)) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse hostname"] = +URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === 58 && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + if (this.stateOverride === "hostname") { + return false; + } + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92)) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && + (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c === 91) { + this.arrFlag = true; + } else if (c === 93) { + this.arrFlag = false; + } + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (isASCIIDigit(c)) { + this.buffer += cStr; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92) || + this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > Math.pow(2, 16) - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); + +URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + if (isNaN(c)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 63) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else { + if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points + !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || + (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points + !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + shortenPath(this.url); + } else { + this.parseError = true; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } else { + this.url.host = this.base.host; + } + } + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { + if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + + if (this.stateOverride) { + return false; + } + + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === 92) { + this.parseError = true; + } + this.state = "path"; + + if (c !== 47 && c !== 92) { + --this.pointer; + } + } else if (!this.stateOverride && c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + if (c !== 47) { + --this.pointer; + } + } + + return true; +}; + +URLStateMachine.prototype["parse path"] = function parsePath(c) { + if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || + (!this.stateOverride && (c === 63 || c === 35))) { + if (isSpecial(this.url) && c === 92) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c !== 47 && !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c !== 47 && + !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + if (this.url.host !== "" && this.url.host !== null) { + this.parseError = true; + this.url.host = ""; + } + this.buffer = this.buffer[0] + ":"; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; + if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { + while (this.url.path.length > 1 && this.url.path[0] === "") { + this.parseError = true; + this.url.path.shift(); + } + } + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += percentEncodeChar(c, isPathPercentEncode); + } + + return true; +}; + +URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else { + // TODO: Add: not a URL code point + if (!isNaN(c) && c !== 37) { + this.parseError = true; + } + + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + if (!isNaN(c)) { + this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); + } + } + + return true; +}; + +URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (isNaN(c) || (!this.stateOverride && c === 35)) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + + const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead + for (let i = 0; i < buffer.length; ++i) { + if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || + buffer[i] === 0x3C || buffer[i] === 0x3E) { + this.url.query += percentEncode(buffer[i]); + } else { + this.url.query += String.fromCodePoint(buffer[i]); + } + } + + this.buffer = ""; + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (isNaN(c)) { // do nothing + } else if (c === 0x0) { + this.parseError = true; + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); + } + + return true; +}; + +function serializeURL(url, excludeFragment) { + let output = url.scheme + ":"; + if (url.host !== null) { + output += "//"; + + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += ":" + url.password; + } + output += "@"; + } + + output += serializeHost(url.host); + + if (url.port !== null) { + output += ":" + url.port; + } + } else if (url.host === null && url.scheme === "file") { + output += "//"; + } + + if (url.cannotBeABaseURL) { + output += url.path[0]; + } else { + for (const string of url.path) { + output += "/" + string; + } + } + + if (url.query !== null) { + output += "?" + url.query; + } + + if (!excludeFragment && url.fragment !== null) { + output += "#" + url.fragment; + } + + return output; +} + +function serializeOrigin(tuple) { + let result = tuple.scheme + "://"; + result += serializeHost(tuple.host); + + if (tuple.port !== null) { + result += ":" + tuple.port; + } + + return result; +} + +module.exports.serializeURL = serializeURL; + +module.exports.serializeURLOrigin = function (url) { + // https://url.spec.whatwg.org/#concept-url-origin + switch (url.scheme) { + case "blob": + try { + return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); + } catch (e) { + // serializing an opaque origin returns "null" + return "null"; + } + case "ftp": + case "gopher": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + case "file": + // spec says "exercise to the reader", chrome says "file://" + return "file://"; + default: + // serializing an opaque origin returns "null" + return "null"; + } +}; + +module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; + } + + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return "failure"; + } + + return usm.url; +}; + +module.exports.setTheUsername = function (url, username) { + url.username = ""; + const decoded = punycode.ucs2.decode(username); + for (let i = 0; i < decoded.length; ++i) { + url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } +}; + +module.exports.setThePassword = function (url, password) { + url.password = ""; + const decoded = punycode.ucs2.decode(password); + for (let i = 0; i < decoded.length; ++i) { + url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } +}; + +module.exports.serializeHost = serializeHost; + +module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + +module.exports.serializeInteger = function (integer) { + return String(integer); +}; + +module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; + } + + // We don't handle blobs, so this just delegates: + return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); +}; diff --git a/node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js b/node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js new file mode 100644 index 00000000..a562009c --- /dev/null +++ b/node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js @@ -0,0 +1,20 @@ +"use strict"; + +module.exports.mixin = function mixin(target, source) { + const keys = Object.getOwnPropertyNames(source); + for (let i = 0; i < keys.length; ++i) { + Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); + } +}; + +module.exports.wrapperSymbol = Symbol("wrapper"); +module.exports.implSymbol = Symbol("impl"); + +module.exports.wrapperForImpl = function (impl) { + return impl[module.exports.wrapperSymbol]; +}; + +module.exports.implForWrapper = function (wrapper) { + return wrapper[module.exports.implSymbol]; +}; + diff --git a/node_modules/node-fetch/node_modules/whatwg-url/package.json b/node_modules/node-fetch/node_modules/whatwg-url/package.json new file mode 100644 index 00000000..fce35ae7 --- /dev/null +++ b/node_modules/node-fetch/node_modules/whatwg-url/package.json @@ -0,0 +1,32 @@ +{ + "name": "whatwg-url", + "version": "5.0.0", + "description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery", + "main": "lib/public-api.js", + "files": [ + "lib/" + ], + "author": "Sebastian Mayr ", + "license": "MIT", + "repository": "jsdom/whatwg-url", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + }, + "devDependencies": { + "eslint": "^2.6.0", + "istanbul": "~0.4.3", + "mocha": "^2.2.4", + "recast": "~0.10.29", + "request": "^2.55.0", + "webidl2js": "^3.0.2" + }, + "scripts": { + "build": "node scripts/transform.js && node scripts/convert-idl.js", + "coverage": "istanbul cover node_modules/mocha/bin/_mocha", + "lint": "eslint .", + "prepublish": "npm run build", + "pretest": "node scripts/get-latest-platform-tests.js && npm run build", + "test": "mocha" + } +} diff --git a/node_modules/node-fetch/package.json b/node_modules/node-fetch/package.json new file mode 100644 index 00000000..e0be1768 --- /dev/null +++ b/node_modules/node-fetch/package.json @@ -0,0 +1,89 @@ +{ + "name": "node-fetch", + "version": "2.7.0", + "description": "A light-weight module that brings window.fetch to node.js", + "main": "lib/index.js", + "browser": "./browser.js", + "module": "lib/index.mjs", + "files": [ + "lib/index.js", + "lib/index.mjs", + "lib/index.es.js", + "browser.js" + ], + "engines": { + "node": "4.x || >=6.0.0" + }, + "scripts": { + "build": "cross-env BABEL_ENV=rollup rollup -c", + "prepare": "npm run build", + "test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js", + "report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js", + "coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json" + }, + "repository": { + "type": "git", + "url": "https://github.com/bitinn/node-fetch.git" + }, + "keywords": [ + "fetch", + "http", + "promise" + ], + "author": "David Frank", + "license": "MIT", + "bugs": { + "url": "https://github.com/bitinn/node-fetch/issues" + }, + "homepage": "https://github.com/bitinn/node-fetch", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + }, + "devDependencies": { + "@ungap/url-search-params": "^0.1.2", + "abort-controller": "^1.1.0", + "abortcontroller-polyfill": "^1.3.0", + "babel-core": "^6.26.3", + "babel-plugin-istanbul": "^4.1.6", + "babel-plugin-transform-async-generator-functions": "^6.24.1", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "1.4.0", + "babel-register": "^6.16.3", + "chai": "^3.5.0", + "chai-as-promised": "^7.1.1", + "chai-iterator": "^1.1.1", + "chai-string": "~1.3.0", + "codecov": "3.3.0", + "cross-env": "^5.2.0", + "form-data": "^2.3.3", + "is-builtin-module": "^1.0.0", + "mocha": "^5.0.0", + "nyc": "11.9.0", + "parted": "^0.1.1", + "promise": "^8.0.3", + "resumer": "0.0.0", + "rollup": "^0.63.4", + "rollup-plugin-babel": "^3.0.7", + "string-to-arraybuffer": "^1.0.2", + "teeny-request": "3.7.0" + }, + "release": { + "branches": [ + "+([0-9]).x", + "main", + "next", + { + "name": "beta", + "prerelease": true + } + ] + } +} diff --git a/node_modules/npmlog/LICENSE b/node_modules/npmlog/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/npmlog/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/npmlog/README.md b/node_modules/npmlog/README.md new file mode 100644 index 00000000..268a4af4 --- /dev/null +++ b/node_modules/npmlog/README.md @@ -0,0 +1,216 @@ +# npmlog + +The logger util that npm uses. + +This logger is very basic. It does the logging for npm. It supports +custom levels and colored output. + +By default, logs are written to stderr. If you want to send log messages +to outputs other than streams, then you can change the `log.stream` +member, or you can just listen to the events that it emits, and do +whatever you want with them. + +# Installation + +```console +npm install npmlog --save +``` + +# Basic Usage + +```javascript +var log = require('npmlog') + +// additional stuff ---------------------------+ +// message ----------+ | +// prefix ----+ | | +// level -+ | | | +// v v v v + log.info('fyi', 'I have a kitty cat: %j', myKittyCat) +``` + +## log.level + +* {String} + +The level to display logs at. Any logs at or above this level will be +displayed. The special level `silent` will prevent anything from being +displayed ever. + +## log.record + +* {Array} + +An array of all the log messages that have been entered. + +## log.maxRecordSize + +* {Number} + +The maximum number of records to keep. If log.record gets bigger than +10% over this value, then it is sliced down to 90% of this value. + +The reason for the 10% window is so that it doesn't have to resize a +large array on every log entry. + +## log.prefixStyle + +* {Object} + +A style object that specifies how prefixes are styled. (See below) + +## log.headingStyle + +* {Object} + +A style object that specifies how the heading is styled. (See below) + +## log.heading + +* {String} Default: "" + +If set, a heading that is printed at the start of every line. + +## log.stream + +* {Stream} Default: `process.stderr` + +The stream where output is written. + +## log.enableColor() + +Force colors to be used on all messages, regardless of the output +stream. + +## log.disableColor() + +Disable colors on all messages. + +## log.enableProgress() + +Enable the display of log activity spinner and progress bar + +## log.disableProgress() + +Disable the display of a progress bar + +## log.enableUnicode() + +Force the unicode theme to be used for the progress bar. + +## log.disableUnicode() + +Disable the use of unicode in the progress bar. + +## log.setGaugeTemplate(template) + +Set a template for outputting the progress bar. See the [gauge documentation] for details. + +[gauge documentation]: https://npmjs.com/package/gauge + +## log.setGaugeThemeset(themes) + +Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details. + +## log.pause() + +Stop emitting messages to the stream, but do not drop them. + +## log.resume() + +Emit all buffered messages that were written while paused. + +## log.log(level, prefix, message, ...) + +* `level` {String} The level to emit the message at +* `prefix` {String} A string prefix. Set to "" to skip. +* `message...` Arguments to `util.format` + +Emit a log message at the specified level. + +## log\[level](prefix, message, ...) + +For example, + +* log.silly(prefix, message, ...) +* log.verbose(prefix, message, ...) +* log.info(prefix, message, ...) +* log.http(prefix, message, ...) +* log.warn(prefix, message, ...) +* log.error(prefix, message, ...) + +Like `log.log(level, prefix, message, ...)`. In this way, each level is +given a shorthand, so you can do `log.info(prefix, message)`. + +## log.addLevel(level, n, style, disp) + +* `level` {String} Level indicator +* `n` {Number} The numeric level +* `style` {Object} Object with fg, bg, inverse, etc. +* `disp` {String} Optional replacement for `level` in the output. + +Sets up a new level with a shorthand function and so forth. + +Note that if the number is `Infinity`, then setting the level to that +will cause all log messages to be suppressed. If the number is +`-Infinity`, then the only way to show it is to enable all log messages. + +## log.newItem(name, todo, weight) + +* `name` {String} Optional; progress item name. +* `todo` {Number} Optional; total amount of work to be done. Default 0. +* `weight` {Number} Optional; the weight of this item relative to others. Default 1. + +This adds a new `are-we-there-yet` item tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `Tracker` object. + +## log.newStream(name, todo, weight) + +This adds a new `are-we-there-yet` stream tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerStream` object. + +## log.newGroup(name, weight) + +This adds a new `are-we-there-yet` tracker group to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerGroup` object. + +# Events + +Events are all emitted with the message object. + +* `log` Emitted for all messages +* `log.` Emitted for all messages with the `` level. +* `` Messages with prefixes also emit their prefix as an event. + +# Style Objects + +Style objects can have the following fields: + +* `fg` {String} Color for the foreground text +* `bg` {String} Color for the background +* `bold`, `inverse`, `underline` {Boolean} Set the associated property +* `bell` {Boolean} Make a noise (This is pretty annoying, probably.) + +# Message Objects + +Every log event is emitted with a message object, and the `log.record` +list contains all of them that have been created. They have the +following fields: + +* `id` {Number} +* `level` {String} +* `prefix` {String} +* `message` {String} Result of `util.format()` +* `messageRaw` {Array} Arguments to `util.format()` + +# Blocking TTYs + +We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set +stderr and stdout blocking if they are tty's and have the setBlocking call. +This is a work around for an issue in early versions of Node.js 6.x, which +made stderr and stdout non-blocking on OSX. (They are always blocking +Windows and were never blocking on Linux.) `npmlog` needs them to be blocking +so that it can allow output to stdout and stderr to be interlaced. diff --git a/node_modules/npmlog/log.js b/node_modules/npmlog/log.js new file mode 100644 index 00000000..85ab8a4c --- /dev/null +++ b/node_modules/npmlog/log.js @@ -0,0 +1,403 @@ +'use strict' +var Progress = require('are-we-there-yet') +var Gauge = require('gauge') +var EE = require('events').EventEmitter +var log = exports = module.exports = new EE() +var util = require('util') + +var setBlocking = require('set-blocking') +var consoleControl = require('console-control-strings') + +setBlocking(true) +var stream = process.stderr +Object.defineProperty(log, 'stream', { + set: function (newStream) { + stream = newStream + if (this.gauge) { + this.gauge.setWriteTo(stream, stream) + } + }, + get: function () { + return stream + }, +}) + +// by default, decide based on tty-ness. +var colorEnabled +log.useColor = function () { + return colorEnabled != null ? colorEnabled : stream.isTTY +} + +log.enableColor = function () { + colorEnabled = true + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) +} +log.disableColor = function () { + colorEnabled = false + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) +} + +// default level +log.level = 'info' + +log.gauge = new Gauge(stream, { + enabled: false, // no progress bars unless asked + theme: {hasColor: log.useColor()}, + template: [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', default: ''}, + ':', + {type: 'logline', kerning: 1, default: ''}, + ], +}) + +log.tracker = new Progress.TrackerGroup() + +// we track this separately as we may need to temporarily disable the +// display of the status bar for our own loggy purposes. +log.progressEnabled = log.gauge.isEnabled() + +var unicodeEnabled + +log.enableUnicode = function () { + unicodeEnabled = true + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.disableUnicode = function () { + unicodeEnabled = false + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.setGaugeThemeset = function (themes) { + this.gauge.setThemeset(themes) +} + +log.setGaugeTemplate = function (template) { + this.gauge.setTemplate(template) +} + +log.enableProgress = function () { + if (this.progressEnabled) { + return + } + + this.progressEnabled = true + this.tracker.on('change', this.showProgress) + if (this._paused) { + return + } + + this.gauge.enable() +} + +log.disableProgress = function () { + if (!this.progressEnabled) { + return + } + this.progressEnabled = false + this.tracker.removeListener('change', this.showProgress) + this.gauge.disable() +} + +var trackerConstructors = ['newGroup', 'newItem', 'newStream'] + +var mixinLog = function (tracker) { + // mixin the public methods from log into the tracker + // (except: conflicts and one's we handle specially) + Object.keys(log).forEach(function (P) { + if (P[0] === '_') { + return + } + + if (trackerConstructors.filter(function (C) { + return C === P + }).length) { + return + } + + if (tracker[P]) { + return + } + + if (typeof log[P] !== 'function') { + return + } + + var func = log[P] + tracker[P] = function () { + return func.apply(log, arguments) + } + }) + // if the new tracker is a group, make sure any subtrackers get + // mixed in too + if (tracker instanceof Progress.TrackerGroup) { + trackerConstructors.forEach(function (C) { + var func = tracker[C] + tracker[C] = function () { + return mixinLog(func.apply(tracker, arguments)) + } + }) + } + return tracker +} + +// Add tracker constructors to the top level log object +trackerConstructors.forEach(function (C) { + log[C] = function () { + return mixinLog(this.tracker[C].apply(this.tracker, arguments)) + } +}) + +log.clearProgress = function (cb) { + if (!this.progressEnabled) { + return cb && process.nextTick(cb) + } + + this.gauge.hide(cb) +} + +log.showProgress = function (name, completed) { + if (!this.progressEnabled) { + return + } + + var values = {} + if (name) { + values.section = name + } + + var last = log.record[log.record.length - 1] + if (last) { + values.subsection = last.prefix + var disp = log.disp[last.level] || last.level + var logline = this._format(disp, log.style[last.level]) + if (last.prefix) { + logline += ' ' + this._format(last.prefix, this.prefixStyle) + } + + logline += ' ' + last.message.split(/\r?\n/)[0] + values.logline = logline + } + values.completed = completed || this.tracker.completed() + this.gauge.show(values) +}.bind(log) // bind for use in tracker's on-change listener + +// temporarily stop emitting, but don't drop +log.pause = function () { + this._paused = true + if (this.progressEnabled) { + this.gauge.disable() + } +} + +log.resume = function () { + if (!this._paused) { + return + } + + this._paused = false + + var b = this._buffer + this._buffer = [] + b.forEach(function (m) { + this.emitLog(m) + }, this) + if (this.progressEnabled) { + this.gauge.enable() + } +} + +log._buffer = [] + +var id = 0 +log.record = [] +log.maxRecordSize = 10000 +log.log = function (lvl, prefix, message) { + var l = this.levels[lvl] + if (l === undefined) { + return this.emit('error', new Error(util.format( + 'Undefined log level: %j', lvl))) + } + + var a = new Array(arguments.length - 2) + var stack = null + for (var i = 2; i < arguments.length; i++) { + var arg = a[i - 2] = arguments[i] + + // resolve stack traces to a plain string. + if (typeof arg === 'object' && arg instanceof Error && arg.stack) { + Object.defineProperty(arg, 'stack', { + value: stack = arg.stack + '', + enumerable: true, + writable: true, + }) + } + } + if (stack) { + a.unshift(stack + '\n') + } + message = util.format.apply(util, a) + + var m = { + id: id++, + level: lvl, + prefix: String(prefix || ''), + message: message, + messageRaw: a, + } + + this.emit('log', m) + this.emit('log.' + lvl, m) + if (m.prefix) { + this.emit(m.prefix, m) + } + + this.record.push(m) + var mrs = this.maxRecordSize + var n = this.record.length - mrs + if (n > mrs / 10) { + var newSize = Math.floor(mrs * 0.9) + this.record = this.record.slice(-1 * newSize) + } + + this.emitLog(m) +}.bind(log) + +log.emitLog = function (m) { + if (this._paused) { + this._buffer.push(m) + return + } + if (this.progressEnabled) { + this.gauge.pulse(m.prefix) + } + + var l = this.levels[m.level] + if (l === undefined) { + return + } + + if (l < this.levels[this.level]) { + return + } + + if (l > 0 && !isFinite(l)) { + return + } + + // If 'disp' is null or undefined, use the lvl as a default + // Allows: '', 0 as valid disp + var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level + this.clearProgress() + m.message.split(/\r?\n/).forEach(function (line) { + if (this.heading) { + this.write(this.heading, this.headingStyle) + this.write(' ') + } + this.write(disp, log.style[m.level]) + var p = m.prefix || '' + if (p) { + this.write(' ') + } + + this.write(p, this.prefixStyle) + this.write(' ' + line + '\n') + }, this) + this.showProgress() +} + +log._format = function (msg, style) { + if (!stream) { + return + } + + var output = '' + if (this.useColor()) { + style = style || {} + var settings = [] + if (style.fg) { + settings.push(style.fg) + } + + if (style.bg) { + settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1)) + } + + if (style.bold) { + settings.push('bold') + } + + if (style.underline) { + settings.push('underline') + } + + if (style.inverse) { + settings.push('inverse') + } + + if (settings.length) { + output += consoleControl.color(settings) + } + + if (style.beep) { + output += consoleControl.beep() + } + } + output += msg + if (this.useColor()) { + output += consoleControl.color('reset') + } + + return output +} + +log.write = function (msg, style) { + if (!stream) { + return + } + + stream.write(this._format(msg, style)) +} + +log.addLevel = function (lvl, n, style, disp) { + // If 'disp' is null or undefined, use the lvl as a default + if (disp == null) { + disp = lvl + } + + this.levels[lvl] = n + this.style[lvl] = style + if (!this[lvl]) { + this[lvl] = function () { + var a = new Array(arguments.length + 1) + a[0] = lvl + for (var i = 0; i < arguments.length; i++) { + a[i + 1] = arguments[i] + } + + return this.log.apply(this, a) + }.bind(this) + } + this.disp[lvl] = disp +} + +log.prefixStyle = { fg: 'magenta' } +log.headingStyle = { fg: 'white', bg: 'black' } + +log.style = {} +log.levels = {} +log.disp = {} +log.addLevel('silly', -Infinity, { inverse: true }, 'sill') +log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb') +log.addLevel('info', 2000, { fg: 'green' }) +log.addLevel('timing', 2500, { fg: 'green', bg: 'black' }) +log.addLevel('http', 3000, { fg: 'green', bg: 'black' }) +log.addLevel('notice', 3500, { fg: 'blue', bg: 'black' }) +log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN') +log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') +log.addLevel('silent', Infinity) + +// allow 'error' prefix +log.on('error', function () {}) diff --git a/node_modules/npmlog/package.json b/node_modules/npmlog/package.json new file mode 100644 index 00000000..960ea925 --- /dev/null +++ b/node_modules/npmlog/package.json @@ -0,0 +1,33 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "npmlog", + "description": "logger for npm", + "version": "5.0.1", + "repository": { + "type": "git", + "url": "https://github.com/npm/npmlog.git" + }, + "main": "log.js", + "files": [ + "log.js" + ], + "scripts": { + "test": "tap test/*.js --branches=95", + "npmclilint": "npmcli-lint", + "lint": "npm run npmclilint -- \"*.*js\" \"test/**/*.*js\"", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint --", + "postsnap": "npm run lintfix --" + }, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + }, + "devDependencies": { + "@npmcli/lint": "^1.0.1", + "tap": "^15.0.9" + }, + "license": "ISC" +} diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100644 index 00000000..0930cf88 --- /dev/null +++ b/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json new file mode 100644 index 00000000..503eb1e6 --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,42 @@ +{ + "name": "object-assign", + "version": "4.1.1", + "description": "ES2015 `Object.assign()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/object-assign", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "bench": "matcha bench.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + } +} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md new file mode 100644 index 00000000..1be09d35 --- /dev/null +++ b/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/once/README.md b/node_modules/once/README.md new file mode 100644 index 00000000..1f1ffca9 --- /dev/null +++ b/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js new file mode 100644 index 00000000..23540673 --- /dev/null +++ b/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/node_modules/once/package.json b/node_modules/once/package.json new file mode 100644 index 00000000..16815b2f --- /dev/null +++ b/node_modules/once/package.json @@ -0,0 +1,33 @@ +{ + "name": "once", + "version": "1.4.0", + "description": "Run a function exactly one time", + "main": "once.js", + "directories": { + "test": "test" + }, + "dependencies": { + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.0.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "files": [ + "once.js" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once" + }, + "keywords": [ + "once", + "function", + "one", + "single" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js new file mode 100644 index 00000000..22aa6c35 --- /dev/null +++ b/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/node_modules/path-is-absolute/license b/node_modules/path-is-absolute/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json new file mode 100644 index 00000000..91196d5e --- /dev/null +++ b/node_modules/path-is-absolute/package.json @@ -0,0 +1,43 @@ +{ + "name": "path-is-absolute", + "version": "1.0.1", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": "sindresorhus/path-is-absolute", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "devDependencies": { + "xo": "^0.16.0" + } +} diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md new file mode 100644 index 00000000..8dbdf5fc --- /dev/null +++ b/node_modules/path-is-absolute/readme.md @@ -0,0 +1,59 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +const pathIsAbsolute = require('path-is-absolute'); + +// Running on Linux +pathIsAbsolute('/home/foo'); +//=> true +pathIsAbsolute('C:/Users/foo'); +//=> false + +// Running on Windows +pathIsAbsolute('C:/Users/foo'); +//=> true +pathIsAbsolute('/home/foo'); +//=> false + +// Running on any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +POSIX specific version. + +### pathIsAbsolute.win32(path) + +Windows specific version. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/proxy-from-env/.eslintrc b/node_modules/proxy-from-env/.eslintrc new file mode 100644 index 00000000..a51449b2 --- /dev/null +++ b/node_modules/proxy-from-env/.eslintrc @@ -0,0 +1,29 @@ +{ + "env": { + "node": true + }, + "rules": { + "array-bracket-spacing": [2, "never"], + "block-scoped-var": 2, + "brace-style": [2, "1tbs"], + "camelcase": 1, + "computed-property-spacing": [2, "never"], + "curly": 2, + "eol-last": 2, + "eqeqeq": [2, "smart"], + "max-depth": [1, 3], + "max-len": [1, 80], + "max-statements": [1, 15], + "new-cap": 1, + "no-extend-native": 2, + "no-mixed-spaces-and-tabs": 2, + "no-trailing-spaces": 2, + "no-unused-vars": 1, + "no-use-before-define": [2, "nofunc"], + "object-curly-spacing": [2, "never"], + "quotes": [2, "single", "avoid-escape"], + "semi": [2, "always"], + "keyword-spacing": [2, {"before": true, "after": true}], + "space-unary-ops": 2 + } +} diff --git a/node_modules/proxy-from-env/.travis.yml b/node_modules/proxy-from-env/.travis.yml new file mode 100644 index 00000000..64a05f94 --- /dev/null +++ b/node_modules/proxy-from-env/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - node + - lts/* +script: + - npm run lint + # test-coverage will also run the tests, but does not print helpful output upon test failure. + # So we also run the tests separately. + - npm run test + - npm run test-coverage && cat coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf coverage diff --git a/node_modules/proxy-from-env/LICENSE b/node_modules/proxy-from-env/LICENSE new file mode 100644 index 00000000..8f25097d --- /dev/null +++ b/node_modules/proxy-from-env/LICENSE @@ -0,0 +1,20 @@ +The MIT License + +Copyright (C) 2016-2018 Rob Wu + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/proxy-from-env/README.md b/node_modules/proxy-from-env/README.md new file mode 100644 index 00000000..e82520c1 --- /dev/null +++ b/node_modules/proxy-from-env/README.md @@ -0,0 +1,131 @@ +# proxy-from-env + +[![Build Status](https://travis-ci.org/Rob--W/proxy-from-env.svg?branch=master)](https://travis-ci.org/Rob--W/proxy-from-env) +[![Coverage Status](https://coveralls.io/repos/github/Rob--W/proxy-from-env/badge.svg?branch=master)](https://coveralls.io/github/Rob--W/proxy-from-env?branch=master) + +`proxy-from-env` is a Node.js package that exports a function (`getProxyForUrl`) +that takes an input URL (a string or +[`url.parse`](https://nodejs.org/docs/latest/api/url.html#url_url_parsing)'s +return value) and returns the desired proxy URL (also a string) based on +standard proxy environment variables. If no proxy is set, an empty string is +returned. + +It is your responsibility to actually proxy the request using the given URL. + +Installation: + +```sh +npm install proxy-from-env +``` + +## Example +This example shows how the data for a URL can be fetched via the +[`http` module](https://nodejs.org/api/http.html), in a proxy-aware way. + +```javascript +var http = require('http'); +var parseUrl = require('url').parse; +var getProxyForUrl = require('proxy-from-env').getProxyForUrl; + +var some_url = 'http://example.com/something'; + +// // Example, if there is a proxy server at 10.0.0.1:1234, then setting the +// // http_proxy environment variable causes the request to go through a proxy. +// process.env.http_proxy = 'http://10.0.0.1:1234'; +// +// // But if the host to be proxied is listed in NO_PROXY, then the request is +// // not proxied (but a direct request is made). +// process.env.no_proxy = 'example.com'; + +var proxy_url = getProxyForUrl(some_url); // <-- Our magic. +if (proxy_url) { + // Should be proxied through proxy_url. + var parsed_some_url = parseUrl(some_url); + var parsed_proxy_url = parseUrl(proxy_url); + // A HTTP proxy is quite simple. It is similar to a normal request, except the + // path is an absolute URL, and the proxied URL's host is put in the header + // instead of the server's actual host. + httpOptions = { + protocol: parsed_proxy_url.protocol, + hostname: parsed_proxy_url.hostname, + port: parsed_proxy_url.port, + path: parsed_some_url.href, + headers: { + Host: parsed_some_url.host, // = host name + optional port. + }, + }; +} else { + // Direct request. + httpOptions = some_url; +} +http.get(httpOptions, function(res) { + var responses = []; + res.on('data', function(chunk) { responses.push(chunk); }); + res.on('end', function() { console.log(responses.join('')); }); +}); + +``` + +## Environment variables +The environment variables can be specified in lowercase or uppercase, with the +lowercase name having precedence over the uppercase variant. A variable that is +not set has the same meaning as a variable that is set but has no value. + +### NO\_PROXY + +`NO_PROXY` is a list of host names (optionally with a port). If the input URL +matches any of the entries in `NO_PROXY`, then the input URL should be fetched +by a direct request (i.e. without a proxy). + +Matching follows the following rules: + +- `NO_PROXY=*` disables all proxies. +- Space and commas may be used to separate the entries in the `NO_PROXY` list. +- If `NO_PROXY` does not contain any entries, then proxies are never disabled. +- If a port is added after the host name, then the ports must match. If the URL + does not have an explicit port name, the protocol's default port is used. +- Generally, the proxy is only disabled if the host name is an exact match for + an entry in the `NO_PROXY` list. The only exceptions are entries that start + with a dot or with a wildcard; then the proxy is disabled if the host name + ends with the entry. + +See `test.js` for examples of what should match and what does not. + +### \*\_PROXY + +The environment variable used for the proxy depends on the protocol of the URL. +For example, `https://example.com` uses the "https" protocol, and therefore the +proxy to be used is `HTTPS_PROXY` (_NOT_ `HTTP_PROXY`, which is _only_ used for +http:-URLs). + +The library is not limited to http(s), other schemes such as +`FTP_PROXY` (ftp:), +`WSS_PROXY` (wss:), +`WS_PROXY` (ws:) +are also supported. + +If present, `ALL_PROXY` is used as fallback if there is no other match. + + +## External resources +The exact way of parsing the environment variables is not codified in any +standard. This library is designed to be compatible with formats as expected by +existing software. +The following resources were used to determine the desired behavior: + +- cURL: + https://curl.haxx.se/docs/manpage.html#ENVIRONMENT + https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4446-L4514 + https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4608-L4638 + +- wget: + https://www.gnu.org/software/wget/manual/wget.html#Proxies + http://git.savannah.gnu.org/cgit/wget.git/tree/src/init.c?id=636a5f9a1c508aa39e35a3a8e9e54520a284d93d#n383 + http://git.savannah.gnu.org/cgit/wget.git/tree/src/retr.c?id=93c1517c4071c4288ba5a4b038e7634e4c6b5482#n1278 + +- W3: + https://www.w3.org/Daemon/User/Proxies/ProxyClients.html + +- Python's urllib: + https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L755-L782 + https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L2444-L2479 diff --git a/node_modules/proxy-from-env/index.js b/node_modules/proxy-from-env/index.js new file mode 100644 index 00000000..df75004a --- /dev/null +++ b/node_modules/proxy-from-env/index.js @@ -0,0 +1,108 @@ +'use strict'; + +var parseUrl = require('url').parse; + +var DEFAULT_PORTS = { + ftp: 21, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443, +}; + +var stringEndsWith = String.prototype.endsWith || function(s) { + return s.length <= this.length && + this.indexOf(s, this.length - s.length) !== -1; +}; + +/** + * @param {string|object} url - The URL, or the result from url.parse. + * @return {string} The URL of the proxy that should handle the request to the + * given URL. If no proxy is set, this will be an empty string. + */ +function getProxyForUrl(url) { + var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {}; + var proto = parsedUrl.protocol; + var hostname = parsedUrl.host; + var port = parsedUrl.port; + if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') { + return ''; // Don't proxy URLs without a valid scheme or host. + } + + proto = proto.split(':', 1)[0]; + // Stripping ports in this way instead of using parsedUrl.hostname to make + // sure that the brackets around IPv6 addresses are kept. + hostname = hostname.replace(/:\d*$/, ''); + port = parseInt(port) || DEFAULT_PORTS[proto] || 0; + if (!shouldProxy(hostname, port)) { + return ''; // Don't proxy URLs that match NO_PROXY. + } + + var proxy = + getEnv('npm_config_' + proto + '_proxy') || + getEnv(proto + '_proxy') || + getEnv('npm_config_proxy') || + getEnv('all_proxy'); + if (proxy && proxy.indexOf('://') === -1) { + // Missing scheme in proxy, default to the requested URL's scheme. + proxy = proto + '://' + proxy; + } + return proxy; +} + +/** + * Determines whether a given URL should be proxied. + * + * @param {string} hostname - The host name of the URL. + * @param {number} port - The effective port of the URL. + * @returns {boolean} Whether the given URL should be proxied. + * @private + */ +function shouldProxy(hostname, port) { + var NO_PROXY = + (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase(); + if (!NO_PROXY) { + return true; // Always proxy if NO_PROXY is not set. + } + if (NO_PROXY === '*') { + return false; // Never proxy if wildcard is set. + } + + return NO_PROXY.split(/[,\s]/).every(function(proxy) { + if (!proxy) { + return true; // Skip zero-length hosts. + } + var parsedProxy = proxy.match(/^(.+):(\d+)$/); + var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; + var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; + if (parsedProxyPort && parsedProxyPort !== port) { + return true; // Skip if ports don't match. + } + + if (!/^[.*]/.test(parsedProxyHostname)) { + // No wildcards, so stop proxying if there is an exact match. + return hostname !== parsedProxyHostname; + } + + if (parsedProxyHostname.charAt(0) === '*') { + // Remove leading wildcard. + parsedProxyHostname = parsedProxyHostname.slice(1); + } + // Stop proxying if the hostname ends with the no_proxy host. + return !stringEndsWith.call(hostname, parsedProxyHostname); + }); +} + +/** + * Get the value for an environment variable. + * + * @param {string} key - The name of the environment variable. + * @return {string} The value of the environment variable. + * @private + */ +function getEnv(key) { + return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ''; +} + +exports.getProxyForUrl = getProxyForUrl; diff --git a/node_modules/proxy-from-env/package.json b/node_modules/proxy-from-env/package.json new file mode 100644 index 00000000..be2b845b --- /dev/null +++ b/node_modules/proxy-from-env/package.json @@ -0,0 +1,34 @@ +{ + "name": "proxy-from-env", + "version": "1.1.0", + "description": "Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and NO_PROXY environment variables.", + "main": "index.js", + "scripts": { + "lint": "eslint *.js", + "test": "mocha ./test.js --reporter spec", + "test-coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter spec" + }, + "repository": { + "type": "git", + "url": "https://github.com/Rob--W/proxy-from-env.git" + }, + "keywords": [ + "proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "environment" + ], + "author": "Rob Wu (https://robwu.nl/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/Rob--W/proxy-from-env/issues" + }, + "homepage": "https://github.com/Rob--W/proxy-from-env#readme", + "devDependencies": { + "coveralls": "^3.0.9", + "eslint": "^6.8.0", + "istanbul": "^0.4.5", + "mocha": "^7.1.0" + } +} diff --git a/node_modules/proxy-from-env/test.js b/node_modules/proxy-from-env/test.js new file mode 100644 index 00000000..abf65423 --- /dev/null +++ b/node_modules/proxy-from-env/test.js @@ -0,0 +1,483 @@ +/* eslint max-statements:0 */ +'use strict'; + +var assert = require('assert'); +var parseUrl = require('url').parse; + +var getProxyForUrl = require('./').getProxyForUrl; + +// Runs the callback with process.env temporarily set to env. +function runWithEnv(env, callback) { + var originalEnv = process.env; + process.env = env; + try { + callback(); + } finally { + process.env = originalEnv; + } +} + +// Defines a test case that checks whether getProxyForUrl(input) === expected. +function testProxyUrl(env, expected, input) { + assert(typeof env === 'object' && env !== null); + // Copy object to make sure that the in param does not get modified between + // the call of this function and the use of it below. + env = JSON.parse(JSON.stringify(env)); + + var title = 'getProxyForUrl(' + JSON.stringify(input) + ')' + + ' === ' + JSON.stringify(expected); + + // Save call stack for later use. + var stack = {}; + Error.captureStackTrace(stack, testProxyUrl); + // Only use the last stack frame because that shows where this function is + // called, and that is sufficient for our purpose. No need to flood the logs + // with an uninteresting stack trace. + stack = stack.stack.split('\n', 2)[1]; + + it(title, function() { + var actual; + runWithEnv(env, function() { + actual = getProxyForUrl(input); + }); + if (expected === actual) { + return; // Good! + } + try { + assert.strictEqual(expected, actual); // Create a formatted error message. + // Should not happen because previously we determined expected !== actual. + throw new Error('assert.strictEqual passed. This is impossible!'); + } catch (e) { + // Use the original stack trace, so we can see a helpful line number. + e.stack = e.message + stack; + throw e; + } + }); +} + +describe('getProxyForUrl', function() { + describe('No proxy variables', function() { + var env = {}; + testProxyUrl(env, '', 'http://example.com'); + testProxyUrl(env, '', 'https://example.com'); + testProxyUrl(env, '', 'ftp://example.com'); + }); + + describe('Invalid URLs', function() { + var env = {}; + env.ALL_PROXY = 'http://unexpected.proxy'; + testProxyUrl(env, '', 'bogus'); + testProxyUrl(env, '', '//example.com'); + testProxyUrl(env, '', '://example.com'); + testProxyUrl(env, '', '://'); + testProxyUrl(env, '', '/path'); + testProxyUrl(env, '', ''); + testProxyUrl(env, '', 'http:'); + testProxyUrl(env, '', 'http:/'); + testProxyUrl(env, '', 'http://'); + testProxyUrl(env, '', 'prototype://'); + testProxyUrl(env, '', 'hasOwnProperty://'); + testProxyUrl(env, '', '__proto__://'); + testProxyUrl(env, '', undefined); + testProxyUrl(env, '', null); + testProxyUrl(env, '', {}); + testProxyUrl(env, '', {host: 'x', protocol: 1}); + testProxyUrl(env, '', {host: 1, protocol: 'x'}); + }); + + describe('http_proxy and HTTP_PROXY', function() { + var env = {}; + env.HTTP_PROXY = 'http://http-proxy'; + + testProxyUrl(env, '', 'https://example'); + testProxyUrl(env, 'http://http-proxy', 'http://example'); + testProxyUrl(env, 'http://http-proxy', parseUrl('http://example')); + + // eslint-disable-next-line camelcase + env.http_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'http://example'); + }); + + describe('http_proxy with non-sensical value', function() { + var env = {}; + // Crazy values should be passed as-is. It is the responsibility of the + // one who launches the application that the value makes sense. + // TODO: Should we be stricter and perform validation? + env.HTTP_PROXY = 'Crazy \n!() { ::// }'; + testProxyUrl(env, 'Crazy \n!() { ::// }', 'http://wow'); + + // The implementation assumes that the HTTP_PROXY environment variable is + // somewhat reasonable, and if the scheme is missing, it is added. + // Garbage in, garbage out some would say... + env.HTTP_PROXY = 'crazy without colon slash slash'; + testProxyUrl(env, 'http://crazy without colon slash slash', 'http://wow'); + }); + + describe('https_proxy and HTTPS_PROXY', function() { + var env = {}; + // Assert that there is no fall back to http_proxy + env.HTTP_PROXY = 'http://unexpected.proxy'; + testProxyUrl(env, '', 'https://example'); + + env.HTTPS_PROXY = 'http://https-proxy'; + testProxyUrl(env, 'http://https-proxy', 'https://example'); + + // eslint-disable-next-line camelcase + env.https_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'https://example'); + }); + + describe('ftp_proxy', function() { + var env = {}; + // Something else than http_proxy / https, as a sanity check. + env.FTP_PROXY = 'http://ftp-proxy'; + + testProxyUrl(env, 'http://ftp-proxy', 'ftp://example'); + testProxyUrl(env, '', 'ftps://example'); + }); + + describe('all_proxy', function() { + var env = {}; + env.ALL_PROXY = 'http://catch-all'; + testProxyUrl(env, 'http://catch-all', 'https://example'); + + // eslint-disable-next-line camelcase + env.all_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'https://example'); + }); + + describe('all_proxy without scheme', function() { + var env = {}; + env.ALL_PROXY = 'noscheme'; + testProxyUrl(env, 'http://noscheme', 'http://example'); + testProxyUrl(env, 'https://noscheme', 'https://example'); + + // The module does not impose restrictions on the scheme. + testProxyUrl(env, 'bogus-scheme://noscheme', 'bogus-scheme://example'); + + // But the URL should still be valid. + testProxyUrl(env, '', 'bogus'); + }); + + describe('no_proxy empty', function() { + var env = {}; + env.HTTPS_PROXY = 'http://proxy'; + + // NO_PROXY set but empty. + env.NO_PROXY = ''; + testProxyUrl(env, 'http://proxy', 'https://example'); + + // No entries in NO_PROXY (comma). + env.NO_PROXY = ','; + testProxyUrl(env, 'http://proxy', 'https://example'); + + // No entries in NO_PROXY (whitespace). + env.NO_PROXY = ' '; + testProxyUrl(env, 'http://proxy', 'https://example'); + + // No entries in NO_PROXY (multiple whitespace / commas). + env.NO_PROXY = ',\t,,,\n, ,\r'; + testProxyUrl(env, 'http://proxy', 'https://example'); + }); + + describe('no_proxy=example (single host)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = 'example'; + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, '', 'http://example:80'); + testProxyUrl(env, '', 'http://example:0'); + testProxyUrl(env, '', 'http://example:1337'); + testProxyUrl(env, 'http://proxy', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, 'http://proxy', 'http://a.b.example'); + testProxyUrl(env, 'http://proxy', 'http://host/example'); + }); + + describe('no_proxy=sub.example (subdomain)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = 'sub.example'; + testProxyUrl(env, 'http://proxy', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://example:80'); + testProxyUrl(env, 'http://proxy', 'http://example:0'); + testProxyUrl(env, 'http://proxy', 'http://example:1337'); + testProxyUrl(env, '', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://no.sub.example'); + testProxyUrl(env, 'http://proxy', 'http://sub-example'); + testProxyUrl(env, 'http://proxy', 'http://example.sub'); + }); + + describe('no_proxy=example:80 (host + port)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = 'example:80'; + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, '', 'http://example:80'); + testProxyUrl(env, '', 'http://example:0'); + testProxyUrl(env, 'http://proxy', 'http://example:1337'); + testProxyUrl(env, 'http://proxy', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, 'http://proxy', 'http://a.b.example'); + }); + + describe('no_proxy=.example (host suffix)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '.example'; + testProxyUrl(env, 'http://proxy', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://example:80'); + testProxyUrl(env, 'http://proxy', 'http://example:1337'); + testProxyUrl(env, '', 'http://sub.example'); + testProxyUrl(env, '', 'http://sub.example:80'); + testProxyUrl(env, '', 'http://sub.example:1337'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, '', 'http://a.b.example'); + }); + + describe('no_proxy=*', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + env.NO_PROXY = '*'; + testProxyUrl(env, '', 'http://example.com'); + }); + + describe('no_proxy=*.example (host suffix with *.)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '*.example'; + testProxyUrl(env, 'http://proxy', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://example:80'); + testProxyUrl(env, 'http://proxy', 'http://example:1337'); + testProxyUrl(env, '', 'http://sub.example'); + testProxyUrl(env, '', 'http://sub.example:80'); + testProxyUrl(env, '', 'http://sub.example:1337'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, '', 'http://a.b.example'); + }); + + describe('no_proxy=*example (substring suffix)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '*example'; + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, '', 'http://example:80'); + testProxyUrl(env, '', 'http://example:1337'); + testProxyUrl(env, '', 'http://sub.example'); + testProxyUrl(env, '', 'http://sub.example:80'); + testProxyUrl(env, '', 'http://sub.example:1337'); + testProxyUrl(env, '', 'http://prefexample'); + testProxyUrl(env, '', 'http://a.b.example'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, 'http://proxy', 'http://host/example'); + }); + + describe('no_proxy=.*example (arbitrary wildcards are NOT supported)', + function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '.*example'; + testProxyUrl(env, 'http://proxy', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://x.prefexample'); + testProxyUrl(env, 'http://proxy', 'http://a.b.example'); + }); + + describe('no_proxy=[::1],[::2]:80,10.0.0.1,10.0.0.2:80 (IP addresses)', + function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '[::1],[::2]:80,10.0.0.1,10.0.0.2:80'; + testProxyUrl(env, '', 'http://[::1]/'); + testProxyUrl(env, '', 'http://[::1]:80/'); + testProxyUrl(env, '', 'http://[::1]:1337/'); + + testProxyUrl(env, '', 'http://[::2]/'); + testProxyUrl(env, '', 'http://[::2]:80/'); + testProxyUrl(env, 'http://proxy', 'http://[::2]:1337/'); + + testProxyUrl(env, '', 'http://10.0.0.1/'); + testProxyUrl(env, '', 'http://10.0.0.1:80/'); + testProxyUrl(env, '', 'http://10.0.0.1:1337/'); + + testProxyUrl(env, '', 'http://10.0.0.2/'); + testProxyUrl(env, '', 'http://10.0.0.2:80/'); + testProxyUrl(env, 'http://proxy', 'http://10.0.0.2:1337/'); + }); + + describe('no_proxy=127.0.0.1/32 (CIDR is NOT supported)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '127.0.0.1/32'; + testProxyUrl(env, 'http://proxy', 'http://127.0.0.1'); + testProxyUrl(env, 'http://proxy', 'http://127.0.0.1/32'); + }); + + describe('no_proxy=127.0.0.1 does NOT match localhost', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '127.0.0.1'; + testProxyUrl(env, '', 'http://127.0.0.1'); + // We're not performing DNS queries, so this shouldn't match. + testProxyUrl(env, 'http://proxy', 'http://localhost'); + }); + + describe('no_proxy with protocols that have a default port', function() { + var env = {}; + env.WS_PROXY = 'http://ws'; + env.WSS_PROXY = 'http://wss'; + env.HTTP_PROXY = 'http://http'; + env.HTTPS_PROXY = 'http://https'; + env.GOPHER_PROXY = 'http://gopher'; + env.FTP_PROXY = 'http://ftp'; + env.ALL_PROXY = 'http://all'; + + env.NO_PROXY = 'xxx:21,xxx:70,xxx:80,xxx:443'; + + testProxyUrl(env, '', 'http://xxx'); + testProxyUrl(env, '', 'http://xxx:80'); + testProxyUrl(env, 'http://http', 'http://xxx:1337'); + + testProxyUrl(env, '', 'ws://xxx'); + testProxyUrl(env, '', 'ws://xxx:80'); + testProxyUrl(env, 'http://ws', 'ws://xxx:1337'); + + testProxyUrl(env, '', 'https://xxx'); + testProxyUrl(env, '', 'https://xxx:443'); + testProxyUrl(env, 'http://https', 'https://xxx:1337'); + + testProxyUrl(env, '', 'wss://xxx'); + testProxyUrl(env, '', 'wss://xxx:443'); + testProxyUrl(env, 'http://wss', 'wss://xxx:1337'); + + testProxyUrl(env, '', 'gopher://xxx'); + testProxyUrl(env, '', 'gopher://xxx:70'); + testProxyUrl(env, 'http://gopher', 'gopher://xxx:1337'); + + testProxyUrl(env, '', 'ftp://xxx'); + testProxyUrl(env, '', 'ftp://xxx:21'); + testProxyUrl(env, 'http://ftp', 'ftp://xxx:1337'); + }); + + describe('no_proxy should not be case-sensitive', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + env.NO_PROXY = 'XXX,YYY,ZzZ'; + + testProxyUrl(env, '', 'http://xxx'); + testProxyUrl(env, '', 'http://XXX'); + testProxyUrl(env, '', 'http://yyy'); + testProxyUrl(env, '', 'http://YYY'); + testProxyUrl(env, '', 'http://ZzZ'); + testProxyUrl(env, '', 'http://zZz'); + }); + + describe('NPM proxy configuration', function() { + describe('npm_config_http_proxy should work', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_http_proxy = 'http://http-proxy'; + + testProxyUrl(env, '', 'https://example'); + testProxyUrl(env, 'http://http-proxy', 'http://example'); + + // eslint-disable-next-line camelcase + env.npm_config_http_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'http://example'); + }); + // eslint-disable-next-line max-len + describe('npm_config_http_proxy should take precedence over HTTP_PROXY and npm_config_proxy', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_http_proxy = 'http://http-proxy'; + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://unexpected-proxy'; + env.HTTP_PROXY = 'http://unexpected-proxy'; + + testProxyUrl(env, 'http://http-proxy', 'http://example'); + }); + describe('npm_config_https_proxy should work', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_http_proxy = 'http://unexpected.proxy'; + testProxyUrl(env, '', 'https://example'); + + // eslint-disable-next-line camelcase + env.npm_config_https_proxy = 'http://https-proxy'; + testProxyUrl(env, 'http://https-proxy', 'https://example'); + + // eslint-disable-next-line camelcase + env.npm_config_https_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'https://example'); + }); + // eslint-disable-next-line max-len + describe('npm_config_https_proxy should take precedence over HTTPS_PROXY and npm_config_proxy', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_https_proxy = 'http://https-proxy'; + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://unexpected-proxy'; + env.HTTPS_PROXY = 'http://unexpected-proxy'; + + testProxyUrl(env, 'http://https-proxy', 'https://example'); + }); + describe('npm_config_proxy should work', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://http-proxy'; + testProxyUrl(env, 'http://http-proxy', 'http://example'); + testProxyUrl(env, 'http://http-proxy', 'https://example'); + + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'http://example'); + testProxyUrl(env, 'http://priority', 'https://example'); + }); + // eslint-disable-next-line max-len + describe('HTTP_PROXY and HTTPS_PROXY should take precedence over npm_config_proxy', function() { + var env = {}; + env.HTTP_PROXY = 'http://http-proxy'; + env.HTTPS_PROXY = 'http://https-proxy'; + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://unexpected-proxy'; + testProxyUrl(env, 'http://http-proxy', 'http://example'); + testProxyUrl(env, 'http://https-proxy', 'https://example'); + }); + describe('npm_config_no_proxy should work', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + // eslint-disable-next-line camelcase + env.npm_config_no_proxy = 'example'; + + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://otherwebsite'); + }); + // eslint-disable-next-line max-len + describe('npm_config_no_proxy should take precedence over NO_PROXY', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + env.NO_PROXY = 'otherwebsite'; + // eslint-disable-next-line camelcase + env.npm_config_no_proxy = 'example'; + + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://otherwebsite'); + }); + }); +}); diff --git a/node_modules/querystringify/LICENSE b/node_modules/querystringify/LICENSE new file mode 100644 index 00000000..6dc9316a --- /dev/null +++ b/node_modules/querystringify/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/querystringify/README.md b/node_modules/querystringify/README.md new file mode 100644 index 00000000..0339638c --- /dev/null +++ b/node_modules/querystringify/README.md @@ -0,0 +1,61 @@ +# querystringify + +[![Version npm](http://img.shields.io/npm/v/querystringify.svg?style=flat-square)](https://www.npmjs.com/package/querystringify)[![Build Status](http://img.shields.io/travis/unshiftio/querystringify/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/querystringify)[![Dependencies](https://img.shields.io/david/unshiftio/querystringify.svg?style=flat-square)](https://david-dm.org/unshiftio/querystringify)[![Coverage Status](http://img.shields.io/coveralls/unshiftio/querystringify/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/querystringify?branch=master) + +A somewhat JSON compatible interface for query string parsing. This query string +parser is dumb, don't expect to much from it as it only wants to parse simple +query strings. If you want to parse complex, multi level and deeply nested +query strings then you should ask your self. WTF am I doing? + +## Installation + +This module is released in npm as `querystringify`. It's also compatible with +`browserify` so it can be used on the server as well as on the client. To +install it simply run the following command from your CLI: + +``` +npm install --save querystringify +``` + +## Usage + +In the following examples we assume that you've already required the library as: + +```js +'use strict'; + +var qs = require('querystringify'); +``` + +### qs.parse() + +The parse method transforms a given query string in to an object. Parameters +without values are set to empty strings. It does not care if your query string +is prefixed with a `?`, a `#`, or not prefixed. It just extracts the parts +between the `=` and `&`: + +```js +qs.parse('?foo=bar'); // { foo: 'bar' } +qs.parse('#foo=bar'); // { foo: 'bar' } +qs.parse('foo=bar'); // { foo: 'bar' } +qs.parse('foo=bar&bar=foo'); // { foo: 'bar', bar: 'foo' } +qs.parse('foo&bar=foo'); // { foo: '', bar: 'foo' } +``` + +### qs.stringify() + +This transforms a given object in to a query string. By default we return the +query string without a `?` prefix. If you want to prefix it by default simply +supply `true` as second argument. If it should be prefixed by something else +simply supply a string with the prefix value as second argument: + +```js +qs.stringify({ foo: bar }); // foo=bar +qs.stringify({ foo: bar }, true); // ?foo=bar +qs.stringify({ foo: bar }, '#'); // #foo=bar +qs.stringify({ foo: '' }, '&'); // &foo= +``` + +## License + +MIT diff --git a/node_modules/querystringify/index.js b/node_modules/querystringify/index.js new file mode 100644 index 00000000..58c9808b --- /dev/null +++ b/node_modules/querystringify/index.js @@ -0,0 +1,118 @@ +'use strict'; + +var has = Object.prototype.hasOwnProperty + , undef; + +/** + * Decode a URI encoded string. + * + * @param {String} input The URI encoded string. + * @returns {String|Null} The decoded string. + * @api private + */ +function decode(input) { + try { + return decodeURIComponent(input.replace(/\+/g, ' ')); + } catch (e) { + return null; + } +} + +/** + * Attempts to encode a given input. + * + * @param {String} input The string that needs to be encoded. + * @returns {String|Null} The encoded string. + * @api private + */ +function encode(input) { + try { + return encodeURIComponent(input); + } catch (e) { + return null; + } +} + +/** + * Simple query string parser. + * + * @param {String} query The query string that needs to be parsed. + * @returns {Object} + * @api public + */ +function querystring(query) { + var parser = /([^=?#&]+)=?([^&]*)/g + , result = {} + , part; + + while (part = parser.exec(query)) { + var key = decode(part[1]) + , value = decode(part[2]); + + // + // Prevent overriding of existing properties. This ensures that build-in + // methods like `toString` or __proto__ are not overriden by malicious + // querystrings. + // + // In the case if failed decoding, we want to omit the key/value pairs + // from the result. + // + if (key === null || value === null || key in result) continue; + result[key] = value; + } + + return result; +} + +/** + * Transform a query string to an object. + * + * @param {Object} obj Object that should be transformed. + * @param {String} prefix Optional prefix. + * @returns {String} + * @api public + */ +function querystringify(obj, prefix) { + prefix = prefix || ''; + + var pairs = [] + , value + , key; + + // + // Optionally prefix with a '?' if needed + // + if ('string' !== typeof prefix) prefix = '?'; + + for (key in obj) { + if (has.call(obj, key)) { + value = obj[key]; + + // + // Edge cases where we actually want to encode the value to an empty + // string instead of the stringified value. + // + if (!value && (value === null || value === undef || isNaN(value))) { + value = ''; + } + + key = encode(key); + value = encode(value); + + // + // If we failed to encode the strings, we should bail out as we don't + // want to add invalid strings to the query. + // + if (key === null || value === null) continue; + pairs.push(key +'='+ value); + } + } + + return pairs.length ? prefix + pairs.join('&') : ''; +} + +// +// Expose the module. +// +exports.stringify = querystringify; +exports.parse = querystring; diff --git a/node_modules/querystringify/package.json b/node_modules/querystringify/package.json new file mode 100644 index 00000000..7b259047 --- /dev/null +++ b/node_modules/querystringify/package.json @@ -0,0 +1,38 @@ +{ + "name": "querystringify", + "version": "2.2.0", + "description": "Querystringify - Small, simple but powerful query string parser.", + "main": "index.js", + "scripts": { + "test": "nyc --reporter=html --reporter=text mocha test.js", + "watch": "mocha --watch test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/unshiftio/querystringify" + }, + "keywords": [ + "query", + "string", + "query-string", + "querystring", + "qs", + "stringify", + "parse", + "decode", + "encode" + ], + "author": "Arnout Kazemier", + "license": "MIT", + "bugs": { + "url": "https://github.com/unshiftio/querystringify/issues" + }, + "homepage": "https://github.com/unshiftio/querystringify", + "devDependencies": { + "assume": "^2.1.0", + "coveralls": "^3.1.0", + "mocha": "^8.1.1", + "nyc": "^15.1.0", + "pre-commit": "^1.2.2" + } +} diff --git a/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 00000000..f478d58d --- /dev/null +++ b/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/node_modules/readable-stream/GOVERNANCE.md b/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 00000000..16ffb93f --- /dev/null +++ b/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/node_modules/readable-stream/LICENSE b/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000..2873b3b2 --- /dev/null +++ b/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/node_modules/readable-stream/README.md b/node_modules/readable-stream/README.md new file mode 100644 index 00000000..19117c1a --- /dev/null +++ b/node_modules/readable-stream/README.md @@ -0,0 +1,106 @@ +# readable-stream + +***Node.js core streams for userland*** [![Build Status](https://travis-ci.com/nodejs/readable-stream.svg?branch=master)](https://travis-ci.com/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readabe-stream.svg)](https://saucelabs.com/u/readabe-stream) + +```bash +npm install --save readable-stream +``` + +This package is a mirror of the streams implementations in Node.js. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.18.1/docs/api/stream.html). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +## Version 3.x.x + +v3.x.x of `readable-stream` is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in [Node v9](https://nodejs.org/en/blog/release/v9.0.0/) and [Node v10](https://nodejs.org/en/blog/release/v10.0.0/), as follows: + +1. Error codes: https://github.com/nodejs/node/pull/13310, + https://github.com/nodejs/node/pull/13291, + https://github.com/nodejs/node/pull/16589, + https://github.com/nodejs/node/pull/15042, + https://github.com/nodejs/node/pull/15665, + https://github.com/nodejs/readable-stream/pull/344 +2. 'readable' have precedence over flowing + https://github.com/nodejs/node/pull/18994 +3. make virtual methods errors consistent + https://github.com/nodejs/node/pull/18813 +4. updated streams error handling + https://github.com/nodejs/node/pull/18438 +5. writable.end should return this. + https://github.com/nodejs/node/pull/18780 +6. readable continues to read when push('') + https://github.com/nodejs/node/pull/18211 +7. add custom inspect to BufferList + https://github.com/nodejs/node/pull/17907 +8. always defer 'readable' with nextTick + https://github.com/nodejs/node/pull/17979 + +## Version 2.x.x +v2.x.x of `readable-stream` is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11. + +### Big Thanks + +Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][sauce] + +# Usage + +You can swap your `require('stream')` with `require('readable-stream')` +without any changes, if you are just using one of the main classes and +functions. + +```js +const { + Readable, + Writable, + Transform, + Duplex, + pipeline, + finished +} = require('readable-stream') +```` + +Note that `require('stream')` will return `Stream`, while +`require('readable-stream')` will return `Readable`. We discourage using +whatever is exported directly, but rather use one of the properties as +shown in the example above. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> +* **Yoshua Wyuts** ([@yoshuawuyts](https://github.com/yoshuawuyts)) <yoshuawuyts@gmail.com> + +[sauce]: https://saucelabs.com diff --git a/node_modules/readable-stream/errors-browser.js b/node_modules/readable-stream/errors-browser.js new file mode 100644 index 00000000..fb8e73e1 --- /dev/null +++ b/node_modules/readable-stream/errors-browser.js @@ -0,0 +1,127 @@ +'use strict'; + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } + +var codes = {}; + +function createErrorType(code, message, Base) { + if (!Base) { + Base = Error; + } + + function getMessage(arg1, arg2, arg3) { + if (typeof message === 'string') { + return message; + } else { + return message(arg1, arg2, arg3); + } + } + + var NodeError = + /*#__PURE__*/ + function (_Base) { + _inheritsLoose(NodeError, _Base); + + function NodeError(arg1, arg2, arg3) { + return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; + } + + return NodeError; + }(Base); + + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; + codes[code] = NodeError; +} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js + + +function oneOf(expected, thing) { + if (Array.isArray(expected)) { + var len = expected.length; + expected = expected.map(function (i) { + return String(i); + }); + + if (len > 2) { + return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; + } else if (len === 2) { + return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); + } else { + return "of ".concat(thing, " ").concat(expected[0]); + } + } else { + return "of ".concat(thing, " ").concat(String(expected)); + } +} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith + + +function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; +} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith + + +function endsWith(str, search, this_len) { + if (this_len === undefined || this_len > str.length) { + this_len = str.length; + } + + return str.substring(this_len - search.length, this_len) === search; +} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes + + +function includes(str, search, start) { + if (typeof start !== 'number') { + start = 0; + } + + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } +} + +createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"'; +}, TypeError); +createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { + // determiner: 'must be' or 'must not be' + var determiner; + + if (typeof expected === 'string' && startsWith(expected, 'not ')) { + determiner = 'must not be'; + expected = expected.replace(/^not /, ''); + } else { + determiner = 'must be'; + } + + var msg; + + if (endsWith(name, ' argument')) { + // For cases like 'first argument' + msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); + } else { + var type = includes(name, '.') ? 'property' : 'argument'; + msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); + } + + msg += ". Received type ".concat(typeof actual); + return msg; +}, TypeError); +createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); +createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { + return 'The ' + name + ' method is not implemented'; +}); +createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); +createErrorType('ERR_STREAM_DESTROYED', function (name) { + return 'Cannot call ' + name + ' after a stream was destroyed'; +}); +createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); +createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); +createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); +createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); +createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { + return 'Unknown encoding: ' + arg; +}, TypeError); +createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); +module.exports.codes = codes; diff --git a/node_modules/readable-stream/errors.js b/node_modules/readable-stream/errors.js new file mode 100644 index 00000000..8471526d --- /dev/null +++ b/node_modules/readable-stream/errors.js @@ -0,0 +1,116 @@ +'use strict'; + +const codes = {}; + +function createErrorType(code, message, Base) { + if (!Base) { + Base = Error + } + + function getMessage (arg1, arg2, arg3) { + if (typeof message === 'string') { + return message + } else { + return message(arg1, arg2, arg3) + } + } + + class NodeError extends Base { + constructor (arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } + + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; + + codes[code] = NodeError; +} + +// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js +function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i) => String(i)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } +} + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith +function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; +} + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith +function endsWith(str, search, this_len) { + if (this_len === undefined || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; +} + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes +function includes(str, search, start) { + if (typeof start !== 'number') { + start = 0; + } + + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } +} + +createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"' +}, TypeError); +createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { + // determiner: 'must be' or 'must not be' + let determiner; + if (typeof expected === 'string' && startsWith(expected, 'not ')) { + determiner = 'must not be'; + expected = expected.replace(/^not /, ''); + } else { + determiner = 'must be'; + } + + let msg; + if (endsWith(name, ' argument')) { + // For cases like 'first argument' + msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; + } else { + const type = includes(name, '.') ? 'property' : 'argument'; + msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; + } + + msg += `. Received type ${typeof actual}`; + return msg; +}, TypeError); +createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); +createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { + return 'The ' + name + ' method is not implemented' +}); +createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); +createErrorType('ERR_STREAM_DESTROYED', function (name) { + return 'Cannot call ' + name + ' after a stream was destroyed'; +}); +createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); +createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); +createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); +createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); +createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { + return 'Unknown encoding: ' + arg +}, TypeError); +createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); + +module.exports.codes = codes; diff --git a/node_modules/readable-stream/experimentalWarning.js b/node_modules/readable-stream/experimentalWarning.js new file mode 100644 index 00000000..78e84149 --- /dev/null +++ b/node_modules/readable-stream/experimentalWarning.js @@ -0,0 +1,17 @@ +'use strict' + +var experimentalWarnings = new Set(); + +function emitExperimentalWarning(feature) { + if (experimentalWarnings.has(feature)) return; + var msg = feature + ' is an experimental feature. This feature could ' + + 'change at any time'; + experimentalWarnings.add(feature); + process.emitWarning(msg, 'ExperimentalWarning'); +} + +function noop() {} + +module.exports.emitExperimentalWarning = process.emitWarning + ? emitExperimentalWarning + : noop; diff --git a/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000..19abfa60 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,126 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +}; +/**/ + +module.exports = Duplex; +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); +require('inherits')(Duplex, Readable); +{ + // Allow the keys array to be GC'ed. + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once('end', onend); + } + } +} +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); +Object.defineProperty(Duplex.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); +Object.defineProperty(Duplex.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); + +// the no-half-open enforcer +function onend() { + // If the writable side ended, then we're ok. + if (this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + process.nextTick(onEndNT, this); +} +function onEndNT(self) { + self.end(); +} +Object.defineProperty(Duplex.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000..24a6bdde --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,37 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; +var Transform = require('./_stream_transform'); +require('inherits')(PassThrough, Transform); +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); +} +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000..df1f608d --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1027 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +module.exports = Readable; + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; +var EElistenerCount = function EElistenerCount(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +var Buffer = require('buffer').Buffer; +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ +var debugUtil = require('util'); +var debug; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function debug() {}; +} +/**/ + +var BufferList = require('./internal/streams/buffer_list'); +var destroyImpl = require('./internal/streams/destroy'); +var _require = require('./internal/streams/state'), + getHighWaterMark = _require.getHighWaterMark; +var _require$codes = require('../errors').codes, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + +// Lazy loaded to improve the startup performance. +var StringDecoder; +var createReadableStreamAsyncIterator; +var from; +require('inherits')(Readable, Stream); +var errorOrDestroy = destroyImpl.errorOrDestroy; +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} +function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || require('./_stream_duplex'); + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + + // Should close be emitted on destroy. Defaults to true. + this.emitClose = options.emitClose !== false; + + // Should .destroy() be called after 'end' (and potentially 'finish') + this.autoDestroy = !!options.autoDestroy; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + if (!(this instanceof Readable)) return new Readable(options); + + // Checking for a Stream.Duplex instance is faster here instead of inside + // the ReadableState constructor, at least with V8 6.5 + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); + + // legacy + this.readable = true; + if (options) { + if (typeof options.read === 'function') this._read = options.read; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + Stream.call(this); +} +Object.defineProperty(Readable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + debug('readableAddChunk', chunk); + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + errorOrDestroy(stream, er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (addToFront) { + if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); + } else if (state.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream, state); + } + } + + // We can push more data if we are below the highWaterMark. + // Also, if we have no data yet, we can stand some more bytes. + // This is to work around cases where hwm=0, such as the repl. + return !state.ended && (state.length < state.highWaterMark || state.length === 0); +} +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream.emit('data', chunk); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); + } + return er; +} +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; + // If setEncoding(null), decoder.encoding equals utf8 + this._readableState.encoding = this._readableState.decoder.encoding; + + // Iterate over current buffer to convert already stored Buffers: + var p = this._readableState.buffer.head; + var content = ''; + while (p !== null) { + content += decoder.write(p.data); + p = p.next; + } + this._readableState.buffer.clear(); + if (content !== '') this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; +}; + +// Don't raise the hwm > 1GB +var MAX_HWM = 0x40000000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n = 0; + } else { + state.length -= n; + state.awaitDrain = 0; + } + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + if (ret !== null) this.emit('data', ret); + return ret; +}; +function onEofChunk(stream, state) { + debug('onEofChunk'); + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + if (state.sync) { + // if we are sync, wait until next tick to emit the data. + // Otherwise we risk emitting data in the flow() + // the readable code triggers during a read() call + emitReadable(stream); + } else { + // emit 'readable' now to make sure it gets picked up. + state.needReadable = false; + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream); + } + } +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + debug('emitReadable', state.needReadable, state.emittedReadable); + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + process.nextTick(emitReadable_, stream); + } +} +function emitReadable_(stream) { + var state = stream._readableState; + debug('emitReadable_', state.destroyed, state.length, state.ended); + if (!state.destroyed && (state.length || state.ended)) { + stream.emit('readable'); + state.emittedReadable = false; + } + + // The stream needs another readable event if + // 1. It is not flowing, as the flow mechanism will take + // care of it. + // 2. It is not ended. + // 3. It is below the highWaterMark, so we can schedule + // another readable later. + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(maybeReadMore_, stream, state); + } +} +function maybeReadMore_(stream, state) { + // Attempt to read more data if we should. + // + // The conditions for reading more data are (one of): + // - Not enough data buffered (state.length < state.highWaterMark). The loop + // is responsible for filling the buffer with enough data if such data + // is available. If highWaterMark is 0 and we are not in the flowing mode + // we should _not_ attempt to buffer any extra data. We'll get more data + // when the stream consumer calls read() instead. + // - No data in the buffer, and the stream is in flowing mode. In this mode + // the loop below is responsible for ensuring read() is called. Failing to + // call read here would abort the flow and there's no other mechanism for + // continuing the flow if the stream consumer has just subscribed to the + // 'data' event. + // + // In addition to the above conditions to keep reading data, the following + // conditions prevent the data from being read: + // - The stream has ended (state.ended). + // - There is already a pending 'read' operation (state.reading). This is a + // case where the the stream has called the implementation defined _read() + // method, but they are processing the call asynchronously and have _not_ + // called push() with new data. In this case we skip performing more + // read()s. The execution ends in this method again after the _read() ends + // up calling push() with more data. + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); +}; +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + debug('dest.write', ret); + if (ret === false) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', state.awaitDrain); + state.awaitDrain++; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + return dest; +}; +function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, { + hasUnpiped: false + }); + return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit('unpipe', this, unpipeInfo); + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + var state = this._readableState; + if (ev === 'data') { + // update readableListening so that resume() may be a no-op + // a few lines down. This is needed to support once('readable'). + state.readableListening = this.listenerCount('readable') > 0; + + // Try start flowing on next tick if stream isn't explicitly paused + if (state.flowing !== false) this.resume(); + } else if (ev === 'readable') { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug('on readable', state.length, state.reading); + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process.nextTick(nReadingNextTick, this); + } + } + } + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; +Readable.prototype.removeListener = function (ev, fn) { + var res = Stream.prototype.removeListener.call(this, ev, fn); + if (ev === 'readable') { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } + return res; +}; +Readable.prototype.removeAllListeners = function (ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); + if (ev === 'readable' || ev === undefined) { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } + return res; +}; +function updateReadableListening(self) { + var state = self._readableState; + state.readableListening = self.listenerCount('readable') > 0; + if (state.resumeScheduled && !state.paused) { + // flowing needs to be set to true now, otherwise + // the upcoming resume will not flow. + state.flowing = true; + + // crude way to check if we should resume + } else if (self.listenerCount('data') > 0) { + self.resume(); + } +} +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + // we flow only if there is no one listening + // for readable, but we still have to call + // resume() + state.flowing = !state.readableListening; + resume(this, state); + } + state.paused = false; + return this; +}; +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(resume_, stream, state); + } +} +function resume_(stream, state) { + debug('resume', state.reading); + if (!state.reading) { + stream.read(0); + } + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + this._readableState.paused = true; + return this; +}; +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null); +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + var state = this._readableState; + var paused = false; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + _this.push(null); + }); + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + return this; +}; +if (typeof Symbol === 'function') { + Readable.prototype[Symbol.asyncIterator] = function () { + if (createReadableStreamAsyncIterator === undefined) { + createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); + } + return createReadableStreamAsyncIterator(this); + }; +} +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.highWaterMark; + } +}); +Object.defineProperty(Readable.prototype, 'readableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState && this._readableState.buffer; + } +}); +Object.defineProperty(Readable.prototype, 'readableFlowing', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.flowing; + }, + set: function set(state) { + if (this._readableState) { + this._readableState.flowing = state; + } + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; +Object.defineProperty(Readable.prototype, 'readableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.length; + } +}); + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = state.buffer.consume(n, state.decoder); + } + return ret; +} +function endReadable(stream) { + var state = stream._readableState; + debug('endReadable', state.endEmitted); + if (!state.endEmitted) { + state.ended = true; + process.nextTick(endReadableNT, state, stream); + } +} +function endReadableNT(state, stream) { + debug('endReadableNT', state.endEmitted, state.length); + + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the writable side is ready for autoDestroy as well + var wState = stream._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream.destroy(); + } + } + } +} +if (typeof Symbol === 'function') { + Readable.from = function (iterable, opts) { + if (from === undefined) { + from = require('./internal/streams/from'); + } + return from(Readable, iterable, opts); + }; +} +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000..1ccb7157 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,190 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; +var _require$codes = require('../errors').codes, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, + ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; +var Duplex = require('./_stream_duplex'); +require('inherits')(Transform, Duplex); +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit('error', new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) + // single equals check for both `null` and `undefined` + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} +function prefinish() { + var _this = this; + if (typeof this._flush === 'function' && !this._readableState.destroyed) { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); +}; +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; +Transform.prototype._destroy = function (err, cb) { + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + }); +}; +function done(stream, er, data) { + if (er) return stream.emit('error', er); + if (data != null) + // single equals check for both `null` and `undefined` + stream.push(data); + + // TODO(BridgeAR): Write a test for these two error cases + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000..292415e2 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,641 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +var Buffer = require('buffer').Buffer; +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} +var destroyImpl = require('./internal/streams/destroy'); +var _require = require('./internal/streams/state'), + getHighWaterMark = _require.getHighWaterMark; +var _require$codes = require('../errors').codes, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, + ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, + ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, + ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; +var errorOrDestroy = destroyImpl.errorOrDestroy; +require('inherits')(Writable, Stream); +function nop() {} +function WritableState(options, stream, isDuplex) { + Duplex = Duplex || require('./_stream_duplex'); + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream, + // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // Should close be emitted on destroy. Defaults to true. + this.emitClose = options.emitClose !== false; + + // Should .destroy() be called after 'finish' (and potentially 'end') + this.autoDestroy = !!options.autoDestroy; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function realHasInstance(object) { + return object instanceof this; + }; +} +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + + // Checking for a Stream.Duplex instance is faster here instead of inside + // the WritableState constructor, at least with V8 6.5 + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); + + // legacy. + this.writable = true; + if (options) { + if (typeof options.write === 'function') this._write = options.write; + if (typeof options.writev === 'function') this._writev = options.writev; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (typeof options.final === 'function') this._final = options.final; + } + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); +}; +function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + // TODO: defer error events consistently everywhere, not just the cb + errorOrDestroy(stream, er); + process.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var er; + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== 'string' && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); + } + if (er) { + errorOrDestroy(stream, er); + process.nextTick(cb, er); + return false; + } + return true; +} +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== 'function') cb = nop; + if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + return ret; +}; +Writable.prototype.cork = function () { + this._writableState.corked++; +}; +Writable.prototype.uncork = function () { + var state = this._writableState; + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; +Object.defineProperty(Writable.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + return ret; +} +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + process.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + process.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state) || stream.destroyed; + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + if (sync) { + process.nextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } + } +} +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + if (entry === null) state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; +} +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); +}; +Writable.prototype._writev = null; +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending) endWritable(this, state, cb); + return this; +}; +Object.defineProperty(Writable.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + errorOrDestroy(stream, err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function' && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the readable side is ready for autoDestroy as well + var rState = stream._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream.destroy(); + } + } + } + } + return need; +} +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) process.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + + // reuse the free corkReq. + state.corkedRequestsFree.next = corkReq; +} +Object.defineProperty(Writable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + cb(err); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/node_modules/readable-stream/lib/internal/streams/async_iterator.js new file mode 100644 index 00000000..742c5a46 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/async_iterator.js @@ -0,0 +1,180 @@ +'use strict'; + +var _Object$setPrototypeO; +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var finished = require('./end-of-stream'); +var kLastResolve = Symbol('lastResolve'); +var kLastReject = Symbol('lastReject'); +var kError = Symbol('error'); +var kEnded = Symbol('ended'); +var kLastPromise = Symbol('lastPromise'); +var kHandlePromise = Symbol('handlePromise'); +var kStream = Symbol('stream'); +function createIterResult(value, done) { + return { + value: value, + done: done + }; +} +function readAndResolve(iter) { + var resolve = iter[kLastResolve]; + if (resolve !== null) { + var data = iter[kStream].read(); + // we defer if data is null + // we can be expecting either 'end' or + // 'error' + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data, false)); + } + } +} +function onReadable(iter) { + // we wait for the next tick, because it might + // emit an error with process.nextTick + process.nextTick(readAndResolve, iter); +} +function wrapForNext(lastPromise, iter) { + return function (resolve, reject) { + lastPromise.then(function () { + if (iter[kEnded]) { + resolve(createIterResult(undefined, true)); + return; + } + iter[kHandlePromise](resolve, reject); + }, reject); + }; +} +var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); +var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next() { + var _this = this; + // if we have detected an error in the meanwhile + // reject straight away + var error = this[kError]; + if (error !== null) { + return Promise.reject(error); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult(undefined, true)); + } + if (this[kStream].destroyed) { + // We need to defer via nextTick because if .destroy(err) is + // called, the error will be emitted via nextTick, and + // we cannot guarantee that there is no error lingering around + // waiting to be emitted. + return new Promise(function (resolve, reject) { + process.nextTick(function () { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(undefined, true)); + } + }); + }); + } + + // if we have multiple next() calls + // we will wait for the previous Promise to finish + // this logic is optimized to support for await loops, + // where next() is only called once at a time + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + // fast path needed to support multiple this.push() + // without triggering the next() queue + var data = this[kStream].read(); + if (data !== null) { + return Promise.resolve(createIterResult(data, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } +}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { + return this; +}), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + // destroy(err, cb) is a private API + // we can guarantee we have that here, because we control the + // Readable class this is attached to + return new Promise(function (resolve, reject) { + _this2[kStream].destroy(null, function (err) { + if (err) { + reject(err); + return; + } + resolve(createIterResult(undefined, true)); + }); + }); +}), _Object$setPrototypeO), AsyncIteratorPrototype); +var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data = iterator[kStream].read(); + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream, function (err) { + if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { + var reject = iterator[kLastReject]; + // reject if we are waiting for data in the Promise + // returned by next() and store the error + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + iterator[kError] = err; + return; + } + var resolve = iterator[kLastResolve]; + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(undefined, true)); + } + iterator[kEnded] = true; + }); + stream.on('readable', onReadable.bind(null, iterator)); + return iterator; +}; +module.exports = createReadableStreamAsyncIterator; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/node_modules/readable-stream/lib/internal/streams/buffer_list.js new file mode 100644 index 00000000..69bda497 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/buffer_list.js @@ -0,0 +1,183 @@ +'use strict'; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var _require = require('buffer'), + Buffer = _require.Buffer; +var _require2 = require('util'), + inspect = _require2.inspect; +var custom = inspect && inspect.custom || 'inspect'; +function copyBuffer(src, target, offset) { + Buffer.prototype.copy.call(src, target, offset); +} +module.exports = /*#__PURE__*/function () { + function BufferList() { + _classCallCheck(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass(BufferList, [{ + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null + }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) ret += s + p.data; + return ret; + } + }, { + key: "concat", + value: function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + } + + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n, hasStrings) { + var ret; + if (n < this.head.data.length) { + // `slice` is the same for buffers and strings. + ret = this.head.data.slice(0, n); + this.head.data = this.head.data.slice(n); + } else if (n === this.head.data.length) { + // First chunk is a perfect match. + ret = this.shift(); + } else { + // Result spans more than one buffer. + ret = hasStrings ? this._getString(n) : this._getBuffer(n); + } + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } + + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n) { + var p = this.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + this.length -= c; + return ret; + } + + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n) { + var ret = Buffer.allocUnsafe(n); + var p = this.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + this.length -= c; + return ret; + } + + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread(_objectSpread({}, options), {}, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; +}(); \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 00000000..31a17c4d --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,96 @@ +'use strict'; + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err); + } else { + process.nextTick(emitCloseNT, _this); + } + }); + return this; +} +function emitErrorAndCloseNT(self, err) { + emitErrorNT(self, err); + emitCloseNT(self); +} +function emitCloseNT(self) { + if (self._writableState && !self._writableState.emitClose) return; + if (self._readableState && !self._readableState.emitClose) return; + self.emit('close'); +} +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} +function emitErrorNT(self, err) { + self.emit('error', err); +} +function errorOrDestroy(stream, err) { + // We have tests that rely on errors being emitted + // in the same tick, so changing this is semver major. + // For now when you opt-in to autoDestroy we allow + // the error to be emitted nextTick. In a future + // semver major update we should change the default to this. + + var rState = stream._readableState; + var wState = stream._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); +} +module.exports = { + destroy: destroy, + undestroy: undestroy, + errorOrDestroy: errorOrDestroy +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/node_modules/readable-stream/lib/internal/streams/end-of-stream.js new file mode 100644 index 00000000..59c671b5 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/end-of-stream.js @@ -0,0 +1,86 @@ +// Ported from https://github.com/mafintosh/end-of-stream with +// permission from the author, Mathias Buus (@mafintosh). + +'use strict'; + +var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + callback.apply(this, args); + }; +} +function noop() {} +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} +function eos(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop); + var readable = opts.readable || opts.readable !== false && stream.readable; + var writable = opts.writable || opts.writable !== false && stream.writable; + var onlegacyfinish = function onlegacyfinish() { + if (!stream.writable) onfinish(); + }; + var writableEnded = stream._writableState && stream._writableState.finished; + var onfinish = function onfinish() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream); + }; + var readableEnded = stream._readableState && stream._readableState.endEmitted; + var onend = function onend() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream); + }; + var onerror = function onerror(err) { + callback.call(stream, err); + }; + var onclose = function onclose() { + var err; + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + }; + var onrequest = function onrequest() { + stream.req.on('finish', onfinish); + }; + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest();else stream.on('request', onrequest); + } else if (writable && !stream._writableState) { + // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + return function () { + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +} +module.exports = eos; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/from-browser.js b/node_modules/readable-stream/lib/internal/streams/from-browser.js new file mode 100644 index 00000000..a4ce56f3 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/from-browser.js @@ -0,0 +1,3 @@ +module.exports = function () { + throw new Error('Readable.from is not available in the browser') +}; diff --git a/node_modules/readable-stream/lib/internal/streams/from.js b/node_modules/readable-stream/lib/internal/streams/from.js new file mode 100644 index 00000000..0a34ee92 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/from.js @@ -0,0 +1,52 @@ +'use strict'; + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; +function from(Readable, iterable, opts) { + var iterator; + if (iterable && typeof iterable.next === 'function') { + iterator = iterable; + } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); + var readable = new Readable(_objectSpread({ + objectMode: true + }, opts)); + // Reading boolean to protect against _read + // being called before last iteration completion. + var reading = false; + readable._read = function () { + if (!reading) { + reading = true; + next(); + } + }; + function next() { + return _next2.apply(this, arguments); + } + function _next2() { + _next2 = _asyncToGenerator(function* () { + try { + var _yield$iterator$next = yield iterator.next(), + value = _yield$iterator$next.value, + done = _yield$iterator$next.done; + if (done) { + readable.push(null); + } else if (readable.push(yield value)) { + next(); + } else { + reading = false; + } + } catch (err) { + readable.destroy(err); + } + }); + return _next2.apply(this, arguments); + } + return readable; +} +module.exports = from; diff --git a/node_modules/readable-stream/lib/internal/streams/pipeline.js b/node_modules/readable-stream/lib/internal/streams/pipeline.js new file mode 100644 index 00000000..e6f39241 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/pipeline.js @@ -0,0 +1,86 @@ +// Ported from https://github.com/mafintosh/pump with +// permission from the author, Mathias Buus (@mafintosh). + +'use strict'; + +var eos; +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; +} +var _require$codes = require('../../../errors').codes, + ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; +function noop(err) { + // Rethrow the error if it exists to avoid swallowing it + if (err) throw err; +} +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} +function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on('close', function () { + closed = true; + }); + if (eos === undefined) eos = require('./end-of-stream'); + eos(stream, { + readable: reading, + writable: writing + }, function (err) { + if (err) return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function (err) { + if (closed) return; + if (destroyed) return; + destroyed = true; + + // request.destroy just do .end - .abort is what we want + if (isRequest(stream)) return stream.abort(); + if (typeof stream.destroy === 'function') return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED('pipe')); + }; +} +function call(fn) { + fn(); +} +function pipe(from, to) { + return from.pipe(to); +} +function popCallback(streams) { + if (!streams.length) return noop; + if (typeof streams[streams.length - 1] !== 'function') return noop; + return streams.pop(); +} +function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS('streams'); + } + var error; + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1; + var writing = i > 0; + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); +} +module.exports = pipeline; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/state.js b/node_modules/readable-stream/lib/internal/streams/state.js new file mode 100644 index 00000000..3fbf8927 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/state.js @@ -0,0 +1,22 @@ +'use strict'; + +var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; +function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; +} +function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : 'highWaterMark'; + throw new ERR_INVALID_OPT_VALUE(name, hwm); + } + return Math.floor(hwm); + } + + // Default value + return state.objectMode ? 16 : 16 * 1024; +} +module.exports = { + getHighWaterMark: getHighWaterMark +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 00000000..9332a3fd --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 00000000..ce2ad5b6 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/node_modules/readable-stream/package.json b/node_modules/readable-stream/package.json new file mode 100644 index 00000000..ade59e71 --- /dev/null +++ b/node_modules/readable-stream/package.json @@ -0,0 +1,68 @@ +{ + "name": "readable-stream", + "version": "3.6.2", + "description": "Streams3, a user-land copy of the stream library from Node.js", + "main": "readable.js", + "engines": { + "node": ">= 6" + }, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "devDependencies": { + "@babel/cli": "^7.2.0", + "@babel/core": "^7.2.0", + "@babel/polyfill": "^7.0.0", + "@babel/preset-env": "^7.2.0", + "airtap": "0.0.9", + "assert": "^1.4.0", + "bl": "^2.0.0", + "deep-strict-equal": "^0.2.0", + "events.once": "^2.0.2", + "glob": "^7.1.2", + "gunzip-maybe": "^1.4.1", + "hyperquest": "^2.1.3", + "lolex": "^2.6.0", + "nyc": "^11.0.0", + "pump": "^3.0.0", + "rimraf": "^2.6.2", + "tap": "^12.0.0", + "tape": "^4.9.0", + "tar-fs": "^1.16.2", + "util-promisify": "^2.1.0" + }, + "scripts": { + "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", + "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", + "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", + "test-browser-local": "airtap --open --local -- test/browser.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "update-browser-errors": "babel -o errors-browser.js errors.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false, + "worker_threads": false, + "./errors": "./errors-browser.js", + "./readable.js": "./readable-browser.js", + "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "license": "MIT" +} diff --git a/node_modules/readable-stream/readable-browser.js b/node_modules/readable-stream/readable-browser.js new file mode 100644 index 00000000..adbf60de --- /dev/null +++ b/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,9 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); +exports.finished = require('./lib/internal/streams/end-of-stream.js'); +exports.pipeline = require('./lib/internal/streams/pipeline.js'); diff --git a/node_modules/readable-stream/readable.js b/node_modules/readable-stream/readable.js new file mode 100644 index 00000000..9e0ca120 --- /dev/null +++ b/node_modules/readable-stream/readable.js @@ -0,0 +1,16 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream.Readable; + Object.assign(module.exports, Stream); + module.exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); + exports.finished = require('./lib/internal/streams/end-of-stream.js'); + exports.pipeline = require('./lib/internal/streams/pipeline.js'); +} diff --git a/node_modules/requires-port/.npmignore b/node_modules/requires-port/.npmignore new file mode 100644 index 00000000..ba2a97b5 --- /dev/null +++ b/node_modules/requires-port/.npmignore @@ -0,0 +1,2 @@ +node_modules +coverage diff --git a/node_modules/requires-port/.travis.yml b/node_modules/requires-port/.travis.yml new file mode 100644 index 00000000..0765106a --- /dev/null +++ b/node_modules/requires-port/.travis.yml @@ -0,0 +1,19 @@ +sudo: false +language: node_js +node_js: + - "4" + - "iojs" + - "0.12" + - "0.10" +script: + - "npm run test-travis" +after_script: + - "npm install coveralls@2 && cat coverage/lcov.info | coveralls" +matrix: + fast_finish: true +notifications: + irc: + channels: + - "irc.freenode.org#unshift" + on_success: change + on_failure: change diff --git a/node_modules/requires-port/LICENSE b/node_modules/requires-port/LICENSE new file mode 100644 index 00000000..6dc9316a --- /dev/null +++ b/node_modules/requires-port/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/requires-port/README.md b/node_modules/requires-port/README.md new file mode 100644 index 00000000..3effe759 --- /dev/null +++ b/node_modules/requires-port/README.md @@ -0,0 +1,47 @@ +# requires-port + +[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](http://img.shields.io/npm/v/requires-port.svg?style=flat-square)](http://browsenpm.org/package/requires-port)[![Build Status](http://img.shields.io/travis/unshiftio/requires-port/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/requires-port)[![Dependencies](https://img.shields.io/david/unshiftio/requires-port.svg?style=flat-square)](https://david-dm.org/unshiftio/requires-port)[![Coverage Status](http://img.shields.io/coveralls/unshiftio/requires-port/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/requires-port?branch=master)[![IRC channel](http://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](http://webchat.freenode.net/?channels=unshift) + +The module name says it all, check if a protocol requires a given port. + +## Installation + +This module is intended to be used with browserify or Node.js and is distributed +in the public npm registry. To install it simply run the following command from +your CLI: + +```j +npm install --save requires-port +``` + +## Usage + +The module exports it self as function and requires 2 arguments: + +1. The port number, can be a string or number. +2. Protocol, can be `http`, `http:` or even `https://yomoma.com`. We just split + it at `:` and use the first result. We currently accept the following + protocols: + - `http` + - `https` + - `ws` + - `wss` + - `ftp` + - `gopher` + - `file` + +It returns a boolean that indicates if protocol requires this port to be added +to your URL. + +```js +'use strict'; + +var required = require('requires-port'); + +console.log(required('8080', 'http')) // true +console.log(required('80', 'http')) // false +``` + +# License + +MIT diff --git a/node_modules/requires-port/index.js b/node_modules/requires-port/index.js new file mode 100644 index 00000000..4f267b26 --- /dev/null +++ b/node_modules/requires-port/index.js @@ -0,0 +1,38 @@ +'use strict'; + +/** + * Check if we're required to add a port number. + * + * @see https://url.spec.whatwg.org/#default-port + * @param {Number|String} port Port number we need to check + * @param {String} protocol Protocol we need to check against. + * @returns {Boolean} Is it a default port for the given protocol + * @api private + */ +module.exports = function required(port, protocol) { + protocol = protocol.split(':')[0]; + port = +port; + + if (!port) return false; + + switch (protocol) { + case 'http': + case 'ws': + return port !== 80; + + case 'https': + case 'wss': + return port !== 443; + + case 'ftp': + return port !== 21; + + case 'gopher': + return port !== 70; + + case 'file': + return false; + } + + return port !== 0; +}; diff --git a/node_modules/requires-port/package.json b/node_modules/requires-port/package.json new file mode 100644 index 00000000..c113b4bf --- /dev/null +++ b/node_modules/requires-port/package.json @@ -0,0 +1,47 @@ +{ + "name": "requires-port", + "version": "1.0.0", + "description": "Check if a protocol requires a certain port number to be added to an URL.", + "main": "index.js", + "scripts": { + "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", + "test-travis": "istanbul cover _mocha --report lcovonly -- test.js", + "coverage": "istanbul cover _mocha -- test.js", + "watch": "mocha --watch test.js", + "test": "mocha test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/unshiftio/requires-port" + }, + "keywords": [ + "port", + "require", + "http", + "https", + "ws", + "wss", + "gopher", + "file", + "ftp", + "requires", + "requried", + "portnumber", + "url", + "parsing", + "validation", + "cows" + ], + "author": "Arnout Kazemier", + "license": "MIT", + "bugs": { + "url": "https://github.com/unshiftio/requires-port/issues" + }, + "homepage": "https://github.com/unshiftio/requires-port", + "devDependencies": { + "assume": "1.3.x", + "istanbul": "0.4.x", + "mocha": "2.3.x", + "pre-commit": "1.1.x" + } +} diff --git a/node_modules/requires-port/test.js b/node_modules/requires-port/test.js new file mode 100644 index 00000000..93a0c749 --- /dev/null +++ b/node_modules/requires-port/test.js @@ -0,0 +1,98 @@ +describe('requires-port', function () { + 'use strict'; + + var assume = require('assume') + , required = require('./'); + + it('is exported as a function', function () { + assume(required).is.a('function'); + }); + + it('does not require empty ports', function () { + assume(required('', 'http')).false(); + assume(required('', 'wss')).false(); + assume(required('', 'ws')).false(); + assume(required('', 'cowsack')).false(); + }); + + it('assumes true for unknown protocols',function () { + assume(required('808', 'foo')).true(); + assume(required('80', 'bar')).true(); + }); + + it('never requires port numbers for file', function () { + assume(required(8080, 'file')).false(); + }); + + it('does not require port 80 for http', function () { + assume(required('80', 'http')).false(); + assume(required(80, 'http')).false(); + assume(required(80, 'http://')).false(); + assume(required(80, 'http://www.google.com')).false(); + + assume(required('8080', 'http')).true(); + assume(required(8080, 'http')).true(); + assume(required(8080, 'http://')).true(); + assume(required(8080, 'http://www.google.com')).true(); + }); + + it('does not require port 80 for ws', function () { + assume(required('80', 'ws')).false(); + assume(required(80, 'ws')).false(); + assume(required(80, 'ws://')).false(); + assume(required(80, 'ws://www.google.com')).false(); + + assume(required('8080', 'ws')).true(); + assume(required(8080, 'ws')).true(); + assume(required(8080, 'ws://')).true(); + assume(required(8080, 'ws://www.google.com')).true(); + }); + + it('does not require port 443 for https', function () { + assume(required('443', 'https')).false(); + assume(required(443, 'https')).false(); + assume(required(443, 'https://')).false(); + assume(required(443, 'https://www.google.com')).false(); + + assume(required('8080', 'https')).true(); + assume(required(8080, 'https')).true(); + assume(required(8080, 'https://')).true(); + assume(required(8080, 'https://www.google.com')).true(); + }); + + it('does not require port 443 for wss', function () { + assume(required('443', 'wss')).false(); + assume(required(443, 'wss')).false(); + assume(required(443, 'wss://')).false(); + assume(required(443, 'wss://www.google.com')).false(); + + assume(required('8080', 'wss')).true(); + assume(required(8080, 'wss')).true(); + assume(required(8080, 'wss://')).true(); + assume(required(8080, 'wss://www.google.com')).true(); + }); + + it('does not require port 21 for ftp', function () { + assume(required('21', 'ftp')).false(); + assume(required(21, 'ftp')).false(); + assume(required(21, 'ftp://')).false(); + assume(required(21, 'ftp://www.google.com')).false(); + + assume(required('8080', 'ftp')).true(); + assume(required(8080, 'ftp')).true(); + assume(required(8080, 'ftp://')).true(); + assume(required(8080, 'ftp://www.google.com')).true(); + }); + + it('does not require port 70 for gopher', function () { + assume(required('70', 'gopher')).false(); + assume(required(70, 'gopher')).false(); + assume(required(70, 'gopher://')).false(); + assume(required(70, 'gopher://www.google.com')).false(); + + assume(required('8080', 'gopher')).true(); + assume(required(8080, 'gopher')).true(); + assume(required(8080, 'gopher://')).true(); + assume(required(8080, 'gopher://www.google.com')).true(); + }); +}); diff --git a/node_modules/rimraf/CHANGELOG.md b/node_modules/rimraf/CHANGELOG.md new file mode 100644 index 00000000..f116f141 --- /dev/null +++ b/node_modules/rimraf/CHANGELOG.md @@ -0,0 +1,65 @@ +# v3.0 + +- Add `--preserve-root` option to executable (default true) +- Drop support for Node.js below version 6 + +# v2.7 + +- Make `glob` an optional dependency + +# 2.6 + +- Retry on EBUSY on non-windows platforms as well +- Make `rimraf.sync` 10000% more reliable on Windows + +# 2.5 + +- Handle Windows EPERM when lstat-ing read-only dirs +- Add glob option to pass options to glob + +# 2.4 + +- Add EPERM to delay/retry loop +- Add `disableGlob` option + +# 2.3 + +- Make maxBusyTries and emfileWait configurable +- Handle weird SunOS unlink-dir issue +- Glob the CLI arg for better Windows support + +# 2.2 + +- Handle ENOENT properly on Windows +- Allow overriding fs methods +- Treat EPERM as indicative of non-empty dir +- Remove optional graceful-fs dep +- Consistently return null error instead of undefined on success +- win32: Treat ENOTEMPTY the same as EBUSY +- Add `rimraf` binary + +# 2.1 + +- Fix SunOS error code for a non-empty directory +- Try rmdir before readdir +- Treat EISDIR like EPERM +- Remove chmod +- Remove lstat polyfill, node 0.7 is not supported + +# 2.0 + +- Fix myGid call to check process.getgid +- Simplify the EBUSY backoff logic. +- Use fs.lstat in node >= 0.7.9 +- Remove gently option +- remove fiber implementation +- Delete files that are marked read-only + +# 1.0 + +- Allow ENOENT in sync method +- Throw when no callback is provided +- Make opts.gently an absolute path +- use 'stat' if 'lstat' is not available +- Consistent error naming, and rethrow non-ENOENT stat errors +- add fiber implementation diff --git a/node_modules/rimraf/LICENSE b/node_modules/rimraf/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/rimraf/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/rimraf/README.md b/node_modules/rimraf/README.md new file mode 100644 index 00000000..423b8cf8 --- /dev/null +++ b/node_modules/rimraf/README.md @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) + +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up, adding 100ms of wait + between each attempt. The default `maxBusyTries` is 3. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. +* `EMFILE` - Since `readdir` requires opening a file descriptor, it's + possible to hit `EMFILE` if too many file descriptors are in use. + In the sync case, there's nothing to be done for this. But in the + async case, rimraf will gradually back off with timeouts up to + `opts.emfileWait` ms, which defaults to 1000. + +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf [ ...]` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/rimraf/bin.js b/node_modules/rimraf/bin.js new file mode 100644 index 00000000..023814cc --- /dev/null +++ b/node_modules/rimraf/bin.js @@ -0,0 +1,68 @@ +#!/usr/bin/env node + +const rimraf = require('./') + +const path = require('path') + +const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) +const filterOutRoot = arg => { + const ok = preserveRoot === false || !isRoot(arg) + if (!ok) { + console.error(`refusing to remove ${arg}`) + console.error('Set --no-preserve-root to allow this') + } + return ok +} + +let help = false +let dashdash = false +let noglob = false +let preserveRoot = true +const args = process.argv.slice(2).filter(arg => { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else if (arg === '--preserve-root') + preserveRoot = true + else if (arg === '--no-preserve-root') + preserveRoot = false + else + return !!arg +}).filter(arg => !preserveRoot || filterOutRoot(arg)) + +const go = n => { + if (n >= args.length) + return + const options = noglob ? { glob: false } : {} + rimraf(args[n], options, er => { + if (er) + throw er + go(n+1) + }) +} + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + const log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + log(' --preserve-root Do not remove \'/\' (default)') + log(' --no-preserve-root Do not treat \'/\' specially') + log(' -- Stop parsing flags') + process.exit(help ? 0 : 1) +} else + go(0) diff --git a/node_modules/rimraf/package.json b/node_modules/rimraf/package.json new file mode 100644 index 00000000..1bf8d5e3 --- /dev/null +++ b/node_modules/rimraf/package.json @@ -0,0 +1,32 @@ +{ + "name": "rimraf", + "version": "3.0.2", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": "git://github.com/isaacs/rimraf.git", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "tap test/*.js" + }, + "bin": "./bin.js", + "dependencies": { + "glob": "^7.1.3" + }, + "files": [ + "LICENSE", + "README.md", + "bin.js", + "rimraf.js" + ], + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js new file mode 100644 index 00000000..34da4171 --- /dev/null +++ b/node_modules/rimraf/rimraf.js @@ -0,0 +1,360 @@ +const assert = require("assert") +const path = require("path") +const fs = require("fs") +let glob = undefined +try { + glob = require("glob") +} catch (_err) { + // treat glob as optional. +} + +const defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +let timeout = 0 + +const isWindows = (process.platform === "win32") + +const defaults = options => { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + if (options.disableGlob !== true && glob === undefined) { + throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +const rimraf = (p, options, cb) => { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + let busyTries = 0 + let errState = null + let n = 0 + + const next = (er) => { + errState = errState || er + if (--n === 0) + cb(errState) + } + + const afterGlob = (er, results) => { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(p => { + const CB = (er) => { + if (er) { + if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(() => rimraf_(p, options, CB), timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + } + rimraf_(p, options, CB) + }) + } + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, (er, stat) => { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +const rimraf_ = (p, options, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === "ENOENT") + return cb(null) + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, er => { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +const fixWinEPERM = (p, options, er, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.chmod(p, 0o666, er2 => { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, (er3, stats) => { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +const fixWinEPERMSync = (p, options, er) => { + assert(p) + assert(options) + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + let stats + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +const rmdir = (p, options, originalEr, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +const rmkids = (p, options, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) + return cb(er) + let n = files.length + if (n === 0) + return options.rmdir(p, cb) + let errState + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +const rimrafSync = (p, options) => { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + let results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + options.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (let i = 0; i < results.length; i++) { + const p = results[i] + + let st + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + + rmdirSync(p, options, er) + } + } +} + +const rmdirSync = (p, options, originalEr) => { + assert(p) + assert(options) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +const rmkidsSync = (p, options) => { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) + continue + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/node_modules/scmp/.travis.yml b/node_modules/scmp/.travis.yml new file mode 100644 index 00000000..ceafed96 --- /dev/null +++ b/node_modules/scmp/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "6" + - "8" + - "10" diff --git a/node_modules/scmp/HISTORY.md b/node_modules/scmp/HISTORY.md new file mode 100644 index 00000000..d4d47e39 --- /dev/null +++ b/node_modules/scmp/HISTORY.md @@ -0,0 +1,12 @@ +# History + +## v2.1.0 (2019/12/26) +* code now uses `standard` as linter +* `var` has been replaced with `const` and `let` +* code now executed in strict mode + +## v2.0.0 (2016/11/05) +* Buffers are now required to be passed as arguments. In 1.x, + the arguments were assumed to be strings, and were always run through + `String()`. +* Starting with Node.js v6.6.0, use `crypto.timingSafeEqual()` (if available). diff --git a/node_modules/scmp/LICENSE b/node_modules/scmp/LICENSE new file mode 100644 index 00000000..1917835e --- /dev/null +++ b/node_modules/scmp/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2014, Sean Lavine +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the scmp project nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/scmp/README.md b/node_modules/scmp/README.md new file mode 100644 index 00000000..a8014bc8 --- /dev/null +++ b/node_modules/scmp/README.md @@ -0,0 +1,42 @@ +# scmp +[![travis][travis-image]][travis-url] +[![npm][npm-image]][npm-url] +[![downloads][downloads-image]][downloads-url] + +[travis-image]: https://travis-ci.org/freewil/scmp.svg?branch=master +[travis-url]: https://travis-ci.org/freewil/scmp + +[npm-image]: https://img.shields.io/npm/v/scmp.svg?style=flat +[npm-url]: https://npmjs.org/package/scmp + +[downloads-image]: https://img.shields.io/npm/dm/scmp.svg?style=flat +[downloads-url]: https://npmjs.org/package/scmp + +Safe, constant-time comparison of Buffers. + +## Install + +``` +npm install scmp +``` + +## Why? + +To minimize vulnerability against [timing attacks](http://codahale.com/a-lesson-in-timing-attacks/). + +## Example + +```js +const scmp = require('scmp'); +const Buffer = require('safe-buffer').Buffer; + +const hash = Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex'); +const givenHash = Buffer.from('e727e1b80e448a213b392049888111e1779a52db', 'hex'); + +if (scmp(hash, givenHash)) { + console.log('good hash'); +} else { + console.log('bad hash'); +} + +``` diff --git a/node_modules/scmp/benchmark/benchmark.js b/node_modules/scmp/benchmark/benchmark.js new file mode 100644 index 00000000..fda8ba3f --- /dev/null +++ b/node_modules/scmp/benchmark/benchmark.js @@ -0,0 +1,26 @@ +'use strict' + +const Benchmark = require('benchmark') +const scmp = require('../') + +// `safe-buffer` in case `Buffer.from` in newer versions of node aren't available +const Buffer = require('safe-buffer').Buffer + +const HASH1 = Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex') +const HASH2 = Buffer.from('f727d1464ae12436e899a726da5b2f11d8381b26', 'hex') + +const suite = new Benchmark.Suite() +suite.add('short-circuit compares', function () { + // eslint-disable-next-line no-unused-expressions + HASH1 === HASH2 +}) + .add('scmp compares', function () { + scmp(HASH1, HASH2) + }) + .on('cycle', function (event) { + console.log(String(event.target)) + }) + .on('complete', function () { + console.log('Fastest is ' + this.filter('fastest').map('name')) + }) + .run() diff --git a/node_modules/scmp/benchmark/crypto-check.js b/node_modules/scmp/benchmark/crypto-check.js new file mode 100644 index 00000000..3bcf7c72 --- /dev/null +++ b/node_modules/scmp/benchmark/crypto-check.js @@ -0,0 +1,31 @@ +'use strict' + +const crypto = require('crypto') +const Benchmark = require('benchmark') + +const scmpCompare = require('../lib/scmpCompare') +const compareFn = crypto.timingSafeEqual || scmpCompare + +// `safe-buffer` in case `Buffer.from` in newer versions of node aren't available +const Buffer = require('safe-buffer').Buffer + +const HASH1 = Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex') +const HASH2 = Buffer.from('f727d1464ae12436e899a726da5b2f11d8381b26', 'hex') + +const suite = new Benchmark.Suite() +suite.add('crypto check each fn call', function () { + if (crypto.timingSafeEqual) { + return crypto.timingSafeEqual(HASH1, HASH2) + } + return scmpCompare(HASH1, HASH2) +}) + .add('crypto check once', function () { + return compareFn(HASH1, HASH2) + }) + .on('cycle', function (event) { + console.log(String(event.target)) + }) + .on('complete', function () { + console.log('Fastest is ' + this.filter('fastest').map('name')) + }) + .run() diff --git a/node_modules/scmp/index.js b/node_modules/scmp/index.js new file mode 100644 index 00000000..daaf3600 --- /dev/null +++ b/node_modules/scmp/index.js @@ -0,0 +1,33 @@ +'use strict' + +const crypto = require('crypto') +const scmpCompare = require('./lib/scmpCompare') + +/** + * Does a constant-time Buffer comparison by not short-circuiting + * on first sign of non-equivalency. + * + * @param {Buffer} a The first Buffer to be compared against the second + * @param {Buffer} b The second Buffer to be compared against the first + * @return {Boolean} + */ +module.exports = function scmp (a, b) { + // check that both inputs are buffers + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new Error('Both scmp args must be Buffers') + } + + // return early here if buffer lengths are not equal since timingSafeEqual + // will throw if buffer lengths are not equal + if (a.length !== b.length) { + return false + } + + // use crypto.timingSafeEqual if available (since Node.js v6.6.0), + // otherwise use our own scmp-internal function. + if (crypto.timingSafeEqual) { + return crypto.timingSafeEqual(a, b) + } + + return scmpCompare(a, b) +} diff --git a/node_modules/scmp/lib/scmpCompare.js b/node_modules/scmp/lib/scmpCompare.js new file mode 100644 index 00000000..5d83001a --- /dev/null +++ b/node_modules/scmp/lib/scmpCompare.js @@ -0,0 +1,10 @@ +'use strict' + +module.exports = function scmpCompare (a, b) { + const len = a.length + let result = 0 + for (let i = 0; i < len; ++i) { + result |= a[i] ^ b[i] + } + return result === 0 +} diff --git a/node_modules/scmp/package.json b/node_modules/scmp/package.json new file mode 100644 index 00000000..894a063a --- /dev/null +++ b/node_modules/scmp/package.json @@ -0,0 +1,33 @@ +{ + "name": "scmp", + "version": "2.1.0", + "description": "safe, constant-time comparison of Buffers", + "main": "index.js", + "scripts": { + "pretest": "standard --verbose", + "test": "mocha", + "posttest": "node benchmark/benchmark.js && node benchmark/crypto-check.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/freewil/scmp.git" + }, + "keywords": [ + "safe-compare", + "compare", + "time-equivalent-comparison", + "time equivalent", + "constant-time", + "constant time" + ], + "author": "Sean Lavine", + "license": "BSD-3-Clause", + "readmeFilename": "README.md", + "devDependencies": { + "benchmark": "^2.1.4", + "mocha": "^6.2.0", + "safe-buffer": "^5.1.2", + "standard": "^14.3.1" + }, + "dependencies": {} +} diff --git a/node_modules/scmp/test/test.js b/node_modules/scmp/test/test.js new file mode 100644 index 00000000..45c62194 --- /dev/null +++ b/node_modules/scmp/test/test.js @@ -0,0 +1,31 @@ +/* eslint-env mocha */ +'use strict' + +const assert = require('assert') +const scmp = require('../') + +// use safe-buffer in case Buffer.from in newer versions of node aren't +// available +const Buffer = require('safe-buffer').Buffer + +describe('scmp', function () { + it('should return true for identical strings', function () { + assert(scmp(Buffer.from('a', 'utf8'), Buffer.from('a', 'utf8'))) + assert(scmp(Buffer.from('abc', 'utf8'), Buffer.from('abc', 'utf8'))) + assert(scmp(Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex'), Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex'))) + }) + + it('should return false for non-identical strings', function () { + assert(!scmp(Buffer.from('a', 'utf8'), Buffer.from('b', 'utf8'))) + assert(!scmp(Buffer.from('abc', 'utf8'), Buffer.from('b', 'utf8'))) + assert(!scmp(Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex'), Buffer.from('e727e1b80e448a213b392049888111e1779a52db', 'hex'))) + }) + + it('should throw errors for non-Buffers', function () { + assert.throws(scmp.bind(null, 'a', {})) + assert.throws(scmp.bind(null, {}, 'b')) + assert.throws(scmp.bind(null, 1, 2)) + assert.throws(scmp.bind(null, undefined, 2)) + assert.throws(scmp.bind(null, null, 2)) + }) +}) diff --git a/node_modules/set-blocking/CHANGELOG.md b/node_modules/set-blocking/CHANGELOG.md new file mode 100644 index 00000000..03bf5919 --- /dev/null +++ b/node_modules/set-blocking/CHANGELOG.md @@ -0,0 +1,26 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [2.0.0](https://github.com/yargs/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17) + + +### Features + +* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277)) + + +### BREAKING CHANGES + +* stdio/stderr will not be set to blocking if isTTY === false + + + + +# 1.0.0 (2016-05-14) + + +### Features + +* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0)) diff --git a/node_modules/set-blocking/LICENSE.txt b/node_modules/set-blocking/LICENSE.txt new file mode 100644 index 00000000..836440be --- /dev/null +++ b/node_modules/set-blocking/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/set-blocking/README.md b/node_modules/set-blocking/README.md new file mode 100644 index 00000000..e93b4202 --- /dev/null +++ b/node_modules/set-blocking/README.md @@ -0,0 +1,31 @@ +# set-blocking + +[![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking) +[![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking) +[![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +set blocking `stdio` and `stderr` ensuring that terminal output does not truncate. + +```js +const setBlocking = require('set-blocking') +setBlocking(true) +console.log(someLargeStringToOutput) +``` + +## Historical Context/Word of Warning + +This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on +newer versions of Node.js (`0.12+`), truncating terminal output. + +You should be mindful of the side-effects caused by using `set-blocking`: + +* if your module sets blocking to `true`, it will effect other modules + consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call + `setBlocking(true)` once we already know we are about to call `process.exit(code)`. +* this patch will not apply to subprocesses spawned with `isTTY = true`, this is + the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). + +## License + +ISC diff --git a/node_modules/set-blocking/index.js b/node_modules/set-blocking/index.js new file mode 100644 index 00000000..6f78774b --- /dev/null +++ b/node_modules/set-blocking/index.js @@ -0,0 +1,7 @@ +module.exports = function (blocking) { + [process.stdout, process.stderr].forEach(function (stream) { + if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(blocking) + } + }) +} diff --git a/node_modules/set-blocking/package.json b/node_modules/set-blocking/package.json new file mode 100644 index 00000000..c082db72 --- /dev/null +++ b/node_modules/set-blocking/package.json @@ -0,0 +1,42 @@ +{ + "name": "set-blocking", + "version": "2.0.0", + "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", + "main": "index.js", + "scripts": { + "pretest": "standard", + "test": "nyc mocha ./test/*.js", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "version": "standard-version" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/yargs/set-blocking.git" + }, + "keywords": [ + "flush", + "terminal", + "blocking", + "shim", + "stdio", + "stderr" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/yargs/set-blocking/issues" + }, + "homepage": "https://github.com/yargs/set-blocking#readme", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.9", + "mocha": "^2.4.5", + "nyc": "^6.4.4", + "standard": "^7.0.1", + "standard-version": "^2.2.1" + }, + "files": [ + "index.js", + "LICENSE.txt" + ] +} \ No newline at end of file diff --git a/node_modules/signal-exit/LICENSE.txt b/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 00000000..eead04a1 --- /dev/null +++ b/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/signal-exit/README.md b/node_modules/signal-exit/README.md new file mode 100644 index 00000000..f9c7c007 --- /dev/null +++ b/node_modules/signal-exit/README.md @@ -0,0 +1,39 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the process to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/node_modules/signal-exit/index.js b/node_modules/signal-exit/index.js new file mode 100644 index 00000000..93703f36 --- /dev/null +++ b/node_modules/signal-exit/index.js @@ -0,0 +1,202 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +var process = global.process + +const processOk = function (process) { + return process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function' +} + +// some kind of non-node environment, just no-op +/* istanbul ignore if */ +if (!processOk(process)) { + module.exports = function () { + return function () {} + } +} else { + var assert = require('assert') + var signals = require('./signals.js') + var isWin = /^win/i.test(process.platform) + + var EE = require('events') + /* istanbul ignore if */ + if (typeof EE !== 'function') { + EE = EE.EventEmitter + } + + var emitter + if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ + } else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} + } + + // Because this emitter is a global, we have to check to see if a + // previous version of this library failed to enable infinite listeners. + // I know what you're about to say. But literally everything about + // signal-exit is a compromise with evil. Get used to it. + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity) + emitter.infinite = true + } + + module.exports = function (cb, opts) { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return function () {} + } + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove + } + + var unload = function unload () { + if (!loaded || !processOk(global.process)) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 + } + module.exports.unload = unload + + var emit = function emit (event, code, signal) { + /* istanbul ignore if */ + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) + } + + // { : , ... } + var sigListeners = {} + signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return + } + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + if (isWin && sig === 'SIGHUP') { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + sig = 'SIGINT' + } + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } + }) + + module.exports.signals = function () { + return signals + } + + var loaded = false + + var load = function load () { + if (loaded || !processOk(global.process)) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit + } + module.exports.load = load + + var originalProcessReallyExit = process.reallyExit + var processReallyExit = function processReallyExit (code) { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return + } + process.exitCode = code || /* istanbul ignore next */ 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) + } + + var originalProcessEmit = process.emit + var processEmit = function processEmit (ev, arg) { + if (ev === 'exit' && processOk(global.process)) { + /* istanbul ignore else */ + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + /* istanbul ignore next */ + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } + } +} diff --git a/node_modules/signal-exit/package.json b/node_modules/signal-exit/package.json new file mode 100644 index 00000000..e1a00311 --- /dev/null +++ b/node_modules/signal-exit/package.json @@ -0,0 +1,38 @@ +{ + "name": "signal-exit", + "version": "3.0.7", + "description": "when you want to fire an event no matter how a process exits.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "files": [ + "index.js", + "signals.js" + ], + "repository": { + "type": "git", + "url": "https://github.com/tapjs/signal-exit.git" + }, + "keywords": [ + "signal", + "exit" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "homepage": "https://github.com/tapjs/signal-exit", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^3.1.1", + "nyc": "^15.1.0", + "standard-version": "^9.3.1", + "tap": "^15.1.1" + } +} diff --git a/node_modules/signal-exit/signals.js b/node_modules/signal-exit/signals.js new file mode 100644 index 00000000..3bd67a8a --- /dev/null +++ b/node_modules/signal-exit/signals.js @@ -0,0 +1,53 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/node_modules/string-width/index.d.ts b/node_modules/string-width/index.d.ts new file mode 100644 index 00000000..12b53097 --- /dev/null +++ b/node_modules/string-width/index.d.ts @@ -0,0 +1,29 @@ +declare const stringWidth: { + /** + Get the visual width of a string - the number of columns required to display it. + + Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + + @example + ``` + import stringWidth = require('string-width'); + + stringWidth('a'); + //=> 1 + + stringWidth('古'); + //=> 2 + + stringWidth('\u001B[1m古\u001B[22m'); + //=> 2 + ``` + */ + (string: string): number; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function stringWidth(string: string): number; + // export = stringWidth; + default: typeof stringWidth; +} + +export = stringWidth; diff --git a/node_modules/string-width/index.js b/node_modules/string-width/index.js new file mode 100644 index 00000000..f4d261a9 --- /dev/null +++ b/node_modules/string-width/index.js @@ -0,0 +1,47 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); + +const stringWidth = string => { + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + string = stripAnsi(string); + + if (string.length === 0) { + return 0; + } + + string = string.replace(emojiRegex(), ' '); + + let width = 0; + + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/node_modules/string-width/license b/node_modules/string-width/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width/package.json b/node_modules/string-width/package.json new file mode 100644 index 00000000..28ba7b4c --- /dev/null +++ b/node_modules/string-width/package.json @@ -0,0 +1,56 @@ +{ + "name": "string-width", + "version": "4.2.3", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/string-width/readme.md b/node_modules/string-width/readme.md new file mode 100644 index 00000000..bdd31412 --- /dev/null +++ b/node_modules/string-width/readme.md @@ -0,0 +1,50 @@ +# string-width + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/string_decoder/LICENSE b/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000..778edb20 --- /dev/null +++ b/node_modules/string_decoder/LICENSE @@ -0,0 +1,48 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + diff --git a/node_modules/string_decoder/README.md b/node_modules/string_decoder/README.md new file mode 100644 index 00000000..5fd58315 --- /dev/null +++ b/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/node_modules/string_decoder/lib/string_decoder.js b/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 00000000..2e89e63f --- /dev/null +++ b/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/node_modules/string_decoder/package.json b/node_modules/string_decoder/package.json new file mode 100644 index 00000000..b2bb1411 --- /dev/null +++ b/node_modules/string_decoder/package.json @@ -0,0 +1,34 @@ +{ + "name": "string_decoder", + "version": "1.3.0", + "description": "The string_decoder module from Node core", + "main": "lib/string_decoder.js", + "files": [ + "lib" + ], + "dependencies": { + "safe-buffer": "~5.2.0" + }, + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/parallel/*.js && node test/verify-dependencies", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT" +} diff --git a/node_modules/strip-ansi/index.d.ts b/node_modules/strip-ansi/index.d.ts new file mode 100644 index 00000000..907fccc2 --- /dev/null +++ b/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js new file mode 100644 index 00000000..9a593dfc --- /dev/null +++ b/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json new file mode 100644 index 00000000..1a41108d --- /dev/null +++ b/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/strip-ansi/readme.md b/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000..7c4b56d4 --- /dev/null +++ b/node_modules/strip-ansi/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/tar/LICENSE b/node_modules/tar/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/tar/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/tar/README.md b/node_modules/tar/README.md new file mode 100644 index 00000000..7cb09da6 --- /dev/null +++ b/node_modules/tar/README.md @@ -0,0 +1,1070 @@ +# node-tar + +Fast and full-featured Tar for Node.js + +The API is designed to mimic the behavior of `tar(1)` on unix systems. +If you are familiar with how tar works, most of this will hopefully be +straightforward for you. If not, then hopefully this module can teach +you useful unix skills that may come in handy someday :) + +## Background + +A "tar file" or "tarball" is an archive of file system entries +(directories, files, links, etc.) The name comes from "tape archive". +If you run `man tar` on almost any Unix command line, you'll learn +quite a bit about what it can do, and its history. + +Tar has 5 main top-level commands: + +* `c` Create an archive +* `r` Replace entries within an archive +* `u` Update entries within an archive (ie, replace if they're newer) +* `t` List out the contents of an archive +* `x` Extract an archive to disk + +The other flags and options modify how this top level function works. + +## High-Level API + +These 5 functions are the high-level API. All of them have a +single-character name (for unix nerds familiar with `tar(1)`) as well +as a long name (for everyone else). + +All the high-level functions take the following arguments, all three +of which are optional and may be omitted. + +1. `options` - An optional object specifying various options +2. `paths` - An array of paths to add or extract +3. `callback` - Called when the command is completed, if async. (If + sync or no file specified, providing a callback throws a + `TypeError`.) + +If the command is sync (ie, if `options.sync=true`), then the +callback is not allowed, since the action will be completed immediately. + +If a `file` argument is specified, and the command is async, then a +`Promise` is returned. In this case, if async, a callback may be +provided which is called when the command is completed. + +If a `file` option is not specified, then a stream is returned. For +`create`, this is a readable stream of the generated archive. For +`list` and `extract` this is a writable stream that an archive should +be written into. If a file is not specified, then a callback is not +allowed, because you're already getting a stream to work with. + +`replace` and `update` only work on existing archives, and so require +a `file` argument. + +Sync commands without a file argument return a stream that acts on its +input immediately in the same tick. For readable streams, this means +that all of the data is immediately available by calling +`stream.read()`. For writable streams, it will be acted upon as soon +as it is provided, but this can be at any time. + +### Warnings and Errors + +Tar emits warnings and errors for recoverable and unrecoverable situations, +respectively. In many cases, a warning only affects a single entry in an +archive, or is simply informing you that it's modifying an entry to comply +with the settings provided. + +Unrecoverable warnings will always raise an error (ie, emit `'error'` on +streaming actions, throw for non-streaming sync actions, reject the +returned Promise for non-streaming async operations, or call a provided +callback with an `Error` as the first argument). Recoverable errors will +raise an error only if `strict: true` is set in the options. + +Respond to (recoverable) warnings by listening to the `warn` event. +Handlers receive 3 arguments: + +- `code` String. One of the error codes below. This may not match + `data.code`, which preserves the original error code from fs and zlib. +- `message` String. More details about the error. +- `data` Metadata about the error. An `Error` object for errors raised by + fs and zlib. All fields are attached to errors raisd by tar. Typically + contains the following fields, as relevant: + - `tarCode` The tar error code. + - `code` Either the tar error code, or the error code set by the + underlying system. + - `file` The archive file being read or written. + - `cwd` Working directory for creation and extraction operations. + - `entry` The entry object (if it could be created) for `TAR_ENTRY_INFO`, + `TAR_ENTRY_INVALID`, and `TAR_ENTRY_ERROR` warnings. + - `header` The header object (if it could be created, and the entry could + not be created) for `TAR_ENTRY_INFO` and `TAR_ENTRY_INVALID` warnings. + - `recoverable` Boolean. If `false`, then the warning will emit an + `error`, even in non-strict mode. + +#### Error Codes + +* `TAR_ENTRY_INFO` An informative error indicating that an entry is being + modified, but otherwise processed normally. For example, removing `/` or + `C:\` from absolute paths if `preservePaths` is not set. + +* `TAR_ENTRY_INVALID` An indication that a given entry is not a valid tar + archive entry, and will be skipped. This occurs when: + - a checksum fails, + - a `linkpath` is missing for a link type, or + - a `linkpath` is provided for a non-link type. + + If every entry in a parsed archive raises an `TAR_ENTRY_INVALID` error, + then the archive is presumed to be unrecoverably broken, and + `TAR_BAD_ARCHIVE` will be raised. + +* `TAR_ENTRY_ERROR` The entry appears to be a valid tar archive entry, but + encountered an error which prevented it from being unpacked. This occurs + when: + - an unrecoverable fs error happens during unpacking, + - an entry has `..` in the path and `preservePaths` is not set, or + - an entry is extracting through a symbolic link, when `preservePaths` is + not set. + +* `TAR_ENTRY_UNSUPPORTED` An indication that a given entry is + a valid archive entry, but of a type that is unsupported, and so will be + skipped in archive creation or extracting. + +* `TAR_ABORT` When parsing gzipped-encoded archives, the parser will + abort the parse process raise a warning for any zlib errors encountered. + Aborts are considered unrecoverable for both parsing and unpacking. + +* `TAR_BAD_ARCHIVE` The archive file is totally hosed. This can happen for + a number of reasons, and always occurs at the end of a parse or extract: + + - An entry body was truncated before seeing the full number of bytes. + - The archive contained only invalid entries, indicating that it is + likely not an archive, or at least, not an archive this library can + parse. + + `TAR_BAD_ARCHIVE` is considered informative for parse operations, but + unrecoverable for extraction. Note that, if encountered at the end of an + extraction, tar WILL still have extracted as much it could from the + archive, so there may be some garbage files to clean up. + +Errors that occur deeper in the system (ie, either the filesystem or zlib) +will have their error codes left intact, and a `tarCode` matching one of +the above will be added to the warning metadata or the raised error object. + +Errors generated by tar will have one of the above codes set as the +`error.code` field as well, but since errors originating in zlib or fs will +have their original codes, it's better to read `error.tarCode` if you wish +to see how tar is handling the issue. + +### Examples + +The API mimics the `tar(1)` command line functionality, with aliases +for more human-readable option and function names. The goal is that +if you know how to use `tar(1)` in Unix, then you know how to use +`require('tar')` in JavaScript. + +To replicate `tar czf my-tarball.tgz files and folders`, you'd do: + +```js +tar.c( + { + gzip: , + file: 'my-tarball.tgz' + }, + ['some', 'files', 'and', 'folders'] +).then(_ => { .. tarball has been created .. }) +``` + +To replicate `tar cz files and folders > my-tarball.tgz`, you'd do: + +```js +tar.c( // or tar.create + { + gzip: + }, + ['some', 'files', 'and', 'folders'] +).pipe(fs.createWriteStream('my-tarball.tgz')) +``` + +To replicate `tar xf my-tarball.tgz` you'd do: + +```js +tar.x( // or tar.extract( + { + file: 'my-tarball.tgz' + } +).then(_=> { .. tarball has been dumped in cwd .. }) +``` + +To replicate `cat my-tarball.tgz | tar x -C some-dir --strip=1`: + +```js +fs.createReadStream('my-tarball.tgz').pipe( + tar.x({ + strip: 1, + C: 'some-dir' // alias for cwd:'some-dir', also ok + }) +) +``` + +To replicate `tar tf my-tarball.tgz`, do this: + +```js +tar.t({ + file: 'my-tarball.tgz', + onentry: entry => { .. do whatever with it .. } +}) +``` + +For example, to just get the list of filenames from an archive: + +```js +const getEntryFilenames = async tarballFilename => { + const filenames = [] + await tar.t({ + file: tarballFilename, + onentry: entry => filenames.push(entry.path), + }) + return filenames +} +``` + +To replicate `cat my-tarball.tgz | tar t` do: + +```js +fs.createReadStream('my-tarball.tgz') + .pipe(tar.t()) + .on('entry', entry => { .. do whatever with it .. }) +``` + +To do anything synchronous, add `sync: true` to the options. Note +that sync functions don't take a callback and don't return a promise. +When the function returns, it's already done. Sync methods without a +file argument return a sync stream, which flushes immediately. But, +of course, it still won't be done until you `.end()` it. + +```js +const getEntryFilenamesSync = tarballFilename => { + const filenames = [] + tar.t({ + file: tarballFilename, + onentry: entry => filenames.push(entry.path), + sync: true, + }) + return filenames +} +``` + +To filter entries, add `filter: ` to the options. +Tar-creating methods call the filter with `filter(path, stat)`. +Tar-reading methods (including extraction) call the filter with +`filter(path, entry)`. The filter is called in the `this`-context of +the `Pack` or `Unpack` stream object. + +The arguments list to `tar t` and `tar x` specify a list of filenames +to extract or list, so they're equivalent to a filter that tests if +the file is in the list. + +For those who _aren't_ fans of tar's single-character command names: + +``` +tar.c === tar.create +tar.r === tar.replace (appends to archive, file is required) +tar.u === tar.update (appends if newer, file is required) +tar.x === tar.extract +tar.t === tar.list +``` + +Keep reading for all the command descriptions and options, as well as +the low-level API that they are built on. + +### tar.c(options, fileList, callback) [alias: tar.create] + +Create a tarball archive. + +The `fileList` is an array of paths to add to the tarball. Adding a +directory also adds its children recursively. + +An entry in `fileList` that starts with an `@` symbol is a tar archive +whose entries will be added. To add a file that starts with `@`, +prepend it with `./`. + +The following options are supported: + +- `file` Write the tarball archive to the specified filename. If this + is specified, then the callback will be fired when the file has been + written, and a promise will be returned that resolves when the file + is written. If a filename is not specified, then a Readable Stream + will be returned which will emit the file data. [Alias: `f`] +- `sync` Act synchronously. If this is set, then any provided file + will be fully written after the call to `tar.c`. If this is set, + and a file is not provided, then the resulting stream will already + have the data ready to `read` or `emit('data')` as soon as you + request it. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `strict` Treat warnings as crash-worthy errors. Default false. +- `cwd` The current working directory for creating the archive. + Defaults to `process.cwd()`. [Alias: `C`] +- `prefix` A path portion to prefix onto the entries in the archive. +- `gzip` Set to any truthy value to create a gzipped archive, or an + object with settings for `zlib.Gzip()` [Alias: `z`] +- `filter` A function that gets called with `(path, stat)` for each + entry being added. Return `true` to add the entry to the archive, + or `false` to omit it. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary for other + time-based operations. Additionally, `mode` is set to a "reasonable + default" for most unix systems, based on a `umask` value of `0o22`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. [Alias: `P`] +- `mode` The mode to set on the created file archive +- `noDirRecurse` Do not recursively archive the contents of + directories. [Alias: `n`] +- `follow` Set to true to pack the targets of symbolic links. Without + this option, symbolic links are archived as such. [Alias: `L`, `h`] +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + [Alias: `m`, `no-mtime`] +- `mtime` Set to a `Date` object to force a specific `mtime` for + everything added to the archive. Overridden by `noMtime`. + +The following options are mostly internal, but can be modified in some +advanced use cases, such as re-using caches between runs. + +- `linkCache` A Map object containing the device and inode value for + any file whose nlink is > 1, to identify hard links. +- `statCache` A Map object that caches calls `lstat`. +- `readdirCache` A Map object that caches calls to `readdir`. +- `jobs` A number specifying how many concurrent jobs to run. + Defaults to 4. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. + +### tar.x(options, fileList, callback) [alias: tar.extract] + +Extract a tarball archive. + +The `fileList` is an array of paths to extract from the tarball. If +no paths are provided, then all the entries are extracted. + +If the archive is gzipped, then tar will detect this and unzip it. + +Note that all directories that are created will be forced to be +writable, readable, and listable by their owner, to avoid cases where +a directory prevents extraction of child entries by virtue of its +mode. + +Most extraction errors will cause a `warn` event to be emitted. If +the `cwd` is missing, or not a directory, then the extraction will +fail completely. + +The following options are supported: + +- `cwd` Extract files relative to the specified directory. Defaults + to `process.cwd()`. If provided, this must exist and must be a + directory. [Alias: `C`] +- `file` The archive file to extract. If not specified, then a + Writable stream is returned where the archive data should be + written. [Alias: `f`] +- `sync` Create files and directories synchronously. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `filter` A function that gets called with `(path, entry)` for each + entry being unpacked. Return `true` to unpack the entry from the + archive, or `false` to skip it. +- `newer` Set to true to keep the existing file on disk if it's newer + than the file in the archive. [Alias: `keep-newer`, + `keep-newer-files`] +- `keep` Do not overwrite existing files. In particular, if a file + appears more than once in an archive, later copies will not + overwrite earlier copies. [Alias: `k`, `keep-existing`] +- `preservePaths` Allow absolute paths, paths containing `..`, and + extracting through symbolic links. By default, `/` is stripped from + absolute paths, `..` paths are not extracted, and any file whose + location would be modified by a symbolic link is not extracted. + [Alias: `P`] +- `unlink` Unlink files before creating them. Without this option, + tar overwrites existing files, which preserves existing hardlinks. + With this option, existing hardlinks will be broken, as will any + symlink that would affect the location of an extracted file. [Alias: + `U`] +- `strip` Remove the specified number of leading path elements. + Pathnames with fewer elements will be silently skipped. Note that + the pathname is edited after applying the filter, but before + security checks. [Alias: `strip-components`, `stripComponents`] +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `preserveOwner` If true, tar will set the `uid` and `gid` of + extracted entries to the `uid` and `gid` fields in the archive. + This defaults to true when run as root, and false otherwise. If + false, then files and directories will be set with the owner and + group of the user running the process. This is similar to `-p` in + `tar(1)`, but ACLs and other system-specific data is never unpacked + in this implementation, and modes are set by default already. + [Alias: `p`] +- `uid` Set to a number to force ownership of all extracted files and + folders, and all implicitly created directories, to be owned by the + specified user id, regardless of the `uid` field in the archive. + Cannot be used along with `preserveOwner`. Requires also setting a + `gid` option. +- `gid` Set to a number to force ownership of all extracted files and + folders, and all implicitly created directories, to be owned by the + specified group id, regardless of the `gid` field in the archive. + Cannot be used along with `preserveOwner`. Requires also setting a + `uid` option. +- `noMtime` Set to true to omit writing `mtime` value for extracted + entries. [Alias: `m`, `no-mtime`] +- `transform` Provide a function that takes an `entry` object, and + returns a stream, or any falsey value. If a stream is provided, + then that stream's data will be written instead of the contents of + the archive entry. If a falsey value is provided, then the entry is + written to disk as normal. (To exclude items from extraction, use + the `filter` option described above.) +- `onentry` A function that gets called with `(entry)` for each entry + that passes the filter. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `noChmod` Set to true to omit calling `fs.chmod()` to ensure that the + extracted file matches the entry mode. This also suppresses the call to + `process.umask()` to determine the default umask value, since tar will + extract with whatever mode is provided, and let the process `umask` apply + normally. + +The following options are mostly internal, but can be modified in some +advanced use cases, such as re-using caches between runs. + +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `umask` Filter the modes of entries like `process.umask()`. +- `dmode` Default mode for directories +- `fmode` Default mode for files +- `dirCache` A Map object of which directories exist. +- `maxMetaEntrySize` The maximum size of meta entries that is + supported. Defaults to 1 MB. + +Note that using an asynchronous stream type with the `transform` +option will cause undefined behavior in sync extractions. +[MiniPass](http://npm.im/minipass)-based streams are designed for this +use case. + +### tar.t(options, fileList, callback) [alias: tar.list] + +List the contents of a tarball archive. + +The `fileList` is an array of paths to list from the tarball. If +no paths are provided, then all the entries are listed. + +If the archive is gzipped, then tar will detect this and unzip it. + +If the `file` option is _not_ provided, then returns an event emitter that +emits `entry` events with `tar.ReadEntry` objects. However, they don't +emit `'data'` or `'end'` events. (If you want to get actual readable +entries, use the `tar.Parse` class instead.) + +If a `file` option _is_ provided, then the return value will be a promise +that resolves when the file has been fully traversed in async mode, or +`undefined` if `sync: true` is set. Thus, you _must_ specify an `onentry` +method in order to do anything useful with the data it parses. + +The following options are supported: + +- `file` The archive file to list. If not specified, then a + Writable stream is returned where the archive data should be + written. [Alias: `f`] +- `sync` Read the specified file synchronously. (This has no effect + when a file option isn't specified, because entries are emitted as + fast as they are parsed from the stream anyway.) +- `strict` Treat warnings as crash-worthy errors. Default false. +- `filter` A function that gets called with `(path, entry)` for each + entry being listed. Return `true` to emit the entry from the + archive, or `false` to skip it. +- `onentry` A function that gets called with `(entry)` for each entry + that passes the filter. This is important for when `file` is set, + because there is no other way to do anything useful with this method. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `noResume` By default, `entry` streams are resumed immediately after + the call to `onentry`. Set `noResume: true` to suppress this + behavior. Note that by opting into this, the stream will never + complete until the entry data is consumed. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") + +### tar.u(options, fileList, callback) [alias: tar.update] + +Add files to an archive if they are newer than the entry already in +the tarball archive. + +The `fileList` is an array of paths to add to the tarball. Adding a +directory also adds its children recursively. + +An entry in `fileList` that starts with an `@` symbol is a tar archive +whose entries will be added. To add a file that starts with `@`, +prepend it with `./`. + +The following options are supported: + +- `file` Required. Write the tarball archive to the specified + filename. [Alias: `f`] +- `sync` Act synchronously. If this is set, then any provided file + will be fully written after the call to `tar.c`. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `strict` Treat warnings as crash-worthy errors. Default false. +- `cwd` The current working directory for adding entries to the + archive. Defaults to `process.cwd()`. [Alias: `C`] +- `prefix` A path portion to prefix onto the entries in the archive. +- `gzip` Set to any truthy value to create a gzipped archive, or an + object with settings for `zlib.Gzip()` [Alias: `z`] +- `filter` A function that gets called with `(path, stat)` for each + entry being added. Return `true` to add the entry to the archive, + or `false` to omit it. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary for other + time-based operations. Additionally, `mode` is set to a "reasonable + default" for most unix systems, based on a `umask` value of `0o22`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. [Alias: `P`] +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `noDirRecurse` Do not recursively archive the contents of + directories. [Alias: `n`] +- `follow` Set to true to pack the targets of symbolic links. Without + this option, symbolic links are archived as such. [Alias: `L`, `h`] +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + [Alias: `m`, `no-mtime`] +- `mtime` Set to a `Date` object to force a specific `mtime` for + everything added to the archive. Overridden by `noMtime`. + +### tar.r(options, fileList, callback) [alias: tar.replace] + +Add files to an existing archive. Because later entries override +earlier entries, this effectively replaces any existing entries. + +The `fileList` is an array of paths to add to the tarball. Adding a +directory also adds its children recursively. + +An entry in `fileList` that starts with an `@` symbol is a tar archive +whose entries will be added. To add a file that starts with `@`, +prepend it with `./`. + +The following options are supported: + +- `file` Required. Write the tarball archive to the specified + filename. [Alias: `f`] +- `sync` Act synchronously. If this is set, then any provided file + will be fully written after the call to `tar.c`. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `strict` Treat warnings as crash-worthy errors. Default false. +- `cwd` The current working directory for adding entries to the + archive. Defaults to `process.cwd()`. [Alias: `C`] +- `prefix` A path portion to prefix onto the entries in the archive. +- `gzip` Set to any truthy value to create a gzipped archive, or an + object with settings for `zlib.Gzip()` [Alias: `z`] +- `filter` A function that gets called with `(path, stat)` for each + entry being added. Return `true` to add the entry to the archive, + or `false` to omit it. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary for other + time-based operations. Additionally, `mode` is set to a "reasonable + default" for most unix systems, based on a `umask` value of `0o22`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. [Alias: `P`] +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `noDirRecurse` Do not recursively archive the contents of + directories. [Alias: `n`] +- `follow` Set to true to pack the targets of symbolic links. Without + this option, symbolic links are archived as such. [Alias: `L`, `h`] +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + [Alias: `m`, `no-mtime`] +- `mtime` Set to a `Date` object to force a specific `mtime` for + everything added to the archive. Overridden by `noMtime`. + + +## Low-Level API + +### class tar.Pack + +A readable tar stream. + +Has all the standard readable stream interface stuff. `'data'` and +`'end'` events, `read()` method, `pause()` and `resume()`, etc. + +#### constructor(options) + +The following options are supported: + +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `strict` Treat warnings as crash-worthy errors. Default false. +- `cwd` The current working directory for creating the archive. + Defaults to `process.cwd()`. +- `prefix` A path portion to prefix onto the entries in the archive. +- `gzip` Set to any truthy value to create a gzipped archive, or an + object with settings for `zlib.Gzip()` +- `filter` A function that gets called with `(path, stat)` for each + entry being added. Return `true` to add the entry to the archive, + or `false` to omit it. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary for other + time-based operations. Additionally, `mode` is set to a "reasonable + default" for most unix systems, based on a `umask` value of `0o22`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. +- `linkCache` A Map object containing the device and inode value for + any file whose nlink is > 1, to identify hard links. +- `statCache` A Map object that caches calls `lstat`. +- `readdirCache` A Map object that caches calls to `readdir`. +- `jobs` A number specifying how many concurrent jobs to run. + Defaults to 4. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `noDirRecurse` Do not recursively archive the contents of + directories. +- `follow` Set to true to pack the targets of symbolic links. Without + this option, symbolic links are archived as such. +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. +- `mtime` Set to a `Date` object to force a specific `mtime` for + everything added to the archive. Overridden by `noMtime`. + +#### add(path) + +Adds an entry to the archive. Returns the Pack stream. + +#### write(path) + +Adds an entry to the archive. Returns true if flushed. + +#### end() + +Finishes the archive. + +### class tar.Pack.Sync + +Synchronous version of `tar.Pack`. + +### class tar.Unpack + +A writable stream that unpacks a tar archive onto the file system. + +All the normal writable stream stuff is supported. `write()` and +`end()` methods, `'drain'` events, etc. + +Note that all directories that are created will be forced to be +writable, readable, and listable by their owner, to avoid cases where +a directory prevents extraction of child entries by virtue of its +mode. + +`'close'` is emitted when it's done writing stuff to the file system. + +Most unpack errors will cause a `warn` event to be emitted. If the +`cwd` is missing, or not a directory, then an error will be emitted. + +#### constructor(options) + +- `cwd` Extract files relative to the specified directory. Defaults + to `process.cwd()`. If provided, this must exist and must be a + directory. +- `filter` A function that gets called with `(path, entry)` for each + entry being unpacked. Return `true` to unpack the entry from the + archive, or `false` to skip it. +- `newer` Set to true to keep the existing file on disk if it's newer + than the file in the archive. +- `keep` Do not overwrite existing files. In particular, if a file + appears more than once in an archive, later copies will not + overwrite earlier copies. +- `preservePaths` Allow absolute paths, paths containing `..`, and + extracting through symbolic links. By default, `/` is stripped from + absolute paths, `..` paths are not extracted, and any file whose + location would be modified by a symbolic link is not extracted. +- `unlink` Unlink files before creating them. Without this option, + tar overwrites existing files, which preserves existing hardlinks. + With this option, existing hardlinks will be broken, as will any + symlink that would affect the location of an extracted file. +- `strip` Remove the specified number of leading path elements. + Pathnames with fewer elements will be silently skipped. Note that + the pathname is edited after applying the filter, but before + security checks. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `umask` Filter the modes of entries like `process.umask()`. +- `dmode` Default mode for directories +- `fmode` Default mode for files +- `dirCache` A Map object of which directories exist. +- `maxMetaEntrySize` The maximum size of meta entries that is + supported. Defaults to 1 MB. +- `preserveOwner` If true, tar will set the `uid` and `gid` of + extracted entries to the `uid` and `gid` fields in the archive. + This defaults to true when run as root, and false otherwise. If + false, then files and directories will be set with the owner and + group of the user running the process. This is similar to `-p` in + `tar(1)`, but ACLs and other system-specific data is never unpacked + in this implementation, and modes are set by default already. +- `win32` True if on a windows platform. Causes behavior where + filenames containing `<|>?` chars are converted to + windows-compatible values while being unpacked. +- `uid` Set to a number to force ownership of all extracted files and + folders, and all implicitly created directories, to be owned by the + specified user id, regardless of the `uid` field in the archive. + Cannot be used along with `preserveOwner`. Requires also setting a + `gid` option. +- `gid` Set to a number to force ownership of all extracted files and + folders, and all implicitly created directories, to be owned by the + specified group id, regardless of the `gid` field in the archive. + Cannot be used along with `preserveOwner`. Requires also setting a + `uid` option. +- `noMtime` Set to true to omit writing `mtime` value for extracted + entries. +- `transform` Provide a function that takes an `entry` object, and + returns a stream, or any falsey value. If a stream is provided, + then that stream's data will be written instead of the contents of + the archive entry. If a falsey value is provided, then the entry is + written to disk as normal. (To exclude items from extraction, use + the `filter` option described above.) +- `strict` Treat warnings as crash-worthy errors. Default false. +- `onentry` A function that gets called with `(entry)` for each entry + that passes the filter. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `noChmod` Set to true to omit calling `fs.chmod()` to ensure that the + extracted file matches the entry mode. This also suppresses the call to + `process.umask()` to determine the default umask value, since tar will + extract with whatever mode is provided, and let the process `umask` apply + normally. + +### class tar.Unpack.Sync + +Synchronous version of `tar.Unpack`. + +Note that using an asynchronous stream type with the `transform` +option will cause undefined behavior in sync unpack streams. +[MiniPass](http://npm.im/minipass)-based streams are designed for this +use case. + +### class tar.Parse + +A writable stream that parses a tar archive stream. All the standard +writable stream stuff is supported. + +If the archive is gzipped, then tar will detect this and unzip it. + +Emits `'entry'` events with `tar.ReadEntry` objects, which are +themselves readable streams that you can pipe wherever. + +Each `entry` will not emit until the one before it is flushed through, +so make sure to either consume the data (with `on('data', ...)` or +`.pipe(...)`) or throw it away with `.resume()` to keep the stream +flowing. + +#### constructor(options) + +Returns an event emitter that emits `entry` events with +`tar.ReadEntry` objects. + +The following options are supported: + +- `strict` Treat warnings as crash-worthy errors. Default false. +- `filter` A function that gets called with `(path, entry)` for each + entry being listed. Return `true` to emit the entry from the + archive, or `false` to skip it. +- `onentry` A function that gets called with `(entry)` for each entry + that passes the filter. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") + +#### abort(error) + +Stop all parsing activities. This is called when there are zlib +errors. It also emits an unrecoverable warning with the error provided. + +### class tar.ReadEntry extends [MiniPass](http://npm.im/minipass) + +A representation of an entry that is being read out of a tar archive. + +It has the following fields: + +- `extended` The extended metadata object provided to the constructor. +- `globalExtended` The global extended metadata object provided to the + constructor. +- `remain` The number of bytes remaining to be written into the + stream. +- `blockRemain` The number of 512-byte blocks remaining to be written + into the stream. +- `ignore` Whether this entry should be ignored. +- `meta` True if this represents metadata about the next entry, false + if it represents a filesystem object. +- All the fields from the header, extended header, and global extended + header are added to the ReadEntry object. So it has `path`, `type`, + `size`, `mode`, and so on. + +#### constructor(header, extended, globalExtended) + +Create a new ReadEntry object with the specified header, extended +header, and global extended header values. + +### class tar.WriteEntry extends [MiniPass](http://npm.im/minipass) + +A representation of an entry that is being written from the file +system into a tar archive. + +Emits data for the Header, and for the Pax Extended Header if one is +required, as well as any body data. + +Creating a WriteEntry for a directory does not also create +WriteEntry objects for all of the directory contents. + +It has the following fields: + +- `path` The path field that will be written to the archive. By + default, this is also the path from the cwd to the file system + object. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary for other + time-based operations. Additionally, `mode` is set to a "reasonable + default" for most unix systems, based on a `umask` value of `0o22`. +- `myuid` If supported, the uid of the user running the current + process. +- `myuser` The `env.USER` string if set, or `''`. Set as the entry + `uname` field if the file's `uid` matches `this.myuid`. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 1 MB. +- `linkCache` A Map object containing the device and inode value for + any file whose nlink is > 1, to identify hard links. +- `statCache` A Map object that caches calls `lstat`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. +- `cwd` The current working directory for creating the archive. + Defaults to `process.cwd()`. +- `absolute` The absolute path to the entry on the filesystem. By + default, this is `path.resolve(this.cwd, this.path)`, but it can be + overridden explicitly. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `win32` True if on a windows platform. Causes behavior where paths + replace `\` with `/` and filenames containing the windows-compatible + forms of `<|>?:` characters are converted to actual `<|>?:` characters + in the archive. +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + + +#### constructor(path, options) + +`path` is the path of the entry as it is written in the archive. + +The following options are supported: + +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary for other + time-based operations. Additionally, `mode` is set to a "reasonable + default" for most unix systems, based on a `umask` value of `0o22`. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 1 MB. +- `linkCache` A Map object containing the device and inode value for + any file whose nlink is > 1, to identify hard links. +- `statCache` A Map object that caches calls `lstat`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. +- `cwd` The current working directory for creating the archive. + Defaults to `process.cwd()`. +- `absolute` The absolute path to the entry on the filesystem. By + default, this is `path.resolve(this.cwd, this.path)`, but it can be + overridden explicitly. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `win32` True if on a windows platform. Causes behavior where paths + replace `\` with `/`. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. +- `umask` Set to restrict the modes on the entries in the archive, + somewhat like how umask works on file creation. Defaults to + `process.umask()` on unix systems, or `0o22` on Windows. + +#### warn(message, data) + +If strict, emit an error with the provided message. + +Othewise, emit a `'warn'` event with the provided message and data. + +### class tar.WriteEntry.Sync + +Synchronous version of tar.WriteEntry + +### class tar.WriteEntry.Tar + +A version of tar.WriteEntry that gets its data from a tar.ReadEntry +instead of from the filesystem. + +#### constructor(readEntry, options) + +`readEntry` is the entry being read out of another archive. + +The following options are supported: + +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary for other + time-based operations. Additionally, `mode` is set to a "reasonable + default" for most unix systems, based on a `umask` value of `0o22`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + +### class tar.Header + +A class for reading and writing header blocks. + +It has the following fields: + +- `nullBlock` True if decoding a block which is entirely composed of + `0x00` null bytes. (Useful because tar files are terminated by + at least 2 null blocks.) +- `cksumValid` True if the checksum in the header is valid, false + otherwise. +- `needPax` True if the values, as encoded, will require a Pax + extended header. +- `path` The path of the entry. +- `mode` The 4 lowest-order octal digits of the file mode. That is, + read/write/execute permissions for world, group, and owner, and the + setuid, setgid, and sticky bits. +- `uid` Numeric user id of the file owner +- `gid` Numeric group id of the file owner +- `size` Size of the file in bytes +- `mtime` Modified time of the file +- `cksum` The checksum of the header. This is generated by adding all + the bytes of the header block, treating the checksum field itself as + all ascii space characters (that is, `0x20`). +- `type` The human-readable name of the type of entry this represents, + or the alphanumeric key if unknown. +- `typeKey` The alphanumeric key for the type of entry this header + represents. +- `linkpath` The target of Link and SymbolicLink entries. +- `uname` Human-readable user name of the file owner +- `gname` Human-readable group name of the file owner +- `devmaj` The major portion of the device number. Always `0` for + files, directories, and links. +- `devmin` The minor portion of the device number. Always `0` for + files, directories, and links. +- `atime` File access time. +- `ctime` File change time. + +#### constructor(data, [offset=0]) + +`data` is optional. It is either a Buffer that should be interpreted +as a tar Header starting at the specified offset and continuing for +512 bytes, or a data object of keys and values to set on the header +object, and eventually encode as a tar Header. + +#### decode(block, offset) + +Decode the provided buffer starting at the specified offset. + +Buffer length must be greater than 512 bytes. + +#### set(data) + +Set the fields in the data object. + +#### encode(buffer, offset) + +Encode the header fields into the buffer at the specified offset. + +Returns `this.needPax` to indicate whether a Pax Extended Header is +required to properly encode the specified data. + +### class tar.Pax + +An object representing a set of key-value pairs in an Pax extended +header entry. + +It has the following fields. Where the same name is used, they have +the same semantics as the tar.Header field of the same name. + +- `global` True if this represents a global extended header, or false + if it is for a single entry. +- `atime` +- `charset` +- `comment` +- `ctime` +- `gid` +- `gname` +- `linkpath` +- `mtime` +- `path` +- `size` +- `uid` +- `uname` +- `dev` +- `ino` +- `nlink` + +#### constructor(object, global) + +Set the fields set in the object. `global` is a boolean that defaults +to false. + +#### encode() + +Return a Buffer containing the header and body for the Pax extended +header entry, or `null` if there is nothing to encode. + +#### encodeBody() + +Return a string representing the body of the pax extended header +entry. + +#### encodeField(fieldName) + +Return a string representing the key/value encoding for the specified +fieldName, or `''` if the field is unset. + +### tar.Pax.parse(string, extended, global) + +Return a new Pax object created by parsing the contents of the string +provided. + +If the `extended` object is set, then also add the fields from that +object. (This is necessary because multiple metadata entries can +occur in sequence.) + +### tar.types + +A translation table for the `type` field in tar headers. + +#### tar.types.name.get(code) + +Get the human-readable name for a given alphanumeric code. + +#### tar.types.code.get(name) + +Get the alphanumeric code for a given human-readable name. diff --git a/node_modules/tar/index.js b/node_modules/tar/index.js new file mode 100644 index 00000000..c9ae06e7 --- /dev/null +++ b/node_modules/tar/index.js @@ -0,0 +1,18 @@ +'use strict' + +// high-level commands +exports.c = exports.create = require('./lib/create.js') +exports.r = exports.replace = require('./lib/replace.js') +exports.t = exports.list = require('./lib/list.js') +exports.u = exports.update = require('./lib/update.js') +exports.x = exports.extract = require('./lib/extract.js') + +// classes +exports.Pack = require('./lib/pack.js') +exports.Unpack = require('./lib/unpack.js') +exports.Parse = require('./lib/parse.js') +exports.ReadEntry = require('./lib/read-entry.js') +exports.WriteEntry = require('./lib/write-entry.js') +exports.Header = require('./lib/header.js') +exports.Pax = require('./lib/pax.js') +exports.types = require('./lib/types.js') diff --git a/node_modules/tar/lib/create.js b/node_modules/tar/lib/create.js new file mode 100644 index 00000000..9c860d4e --- /dev/null +++ b/node_modules/tar/lib/create.js @@ -0,0 +1,111 @@ +'use strict' + +// tar -c +const hlo = require('./high-level-opt.js') + +const Pack = require('./pack.js') +const fsm = require('fs-minipass') +const t = require('./list.js') +const path = require('path') + +module.exports = (opt_, files, cb) => { + if (typeof files === 'function') { + cb = files + } + + if (Array.isArray(opt_)) { + files = opt_, opt_ = {} + } + + if (!files || !Array.isArray(files) || !files.length) { + throw new TypeError('no files or directories specified') + } + + files = Array.from(files) + + const opt = hlo(opt_) + + if (opt.sync && typeof cb === 'function') { + throw new TypeError('callback not supported for sync tar functions') + } + + if (!opt.file && typeof cb === 'function') { + throw new TypeError('callback only supported with file option') + } + + return opt.file && opt.sync ? createFileSync(opt, files) + : opt.file ? createFile(opt, files, cb) + : opt.sync ? createSync(opt, files) + : create(opt, files) +} + +const createFileSync = (opt, files) => { + const p = new Pack.Sync(opt) + const stream = new fsm.WriteStreamSync(opt.file, { + mode: opt.mode || 0o666, + }) + p.pipe(stream) + addFilesSync(p, files) +} + +const createFile = (opt, files, cb) => { + const p = new Pack(opt) + const stream = new fsm.WriteStream(opt.file, { + mode: opt.mode || 0o666, + }) + p.pipe(stream) + + const promise = new Promise((res, rej) => { + stream.on('error', rej) + stream.on('close', res) + p.on('error', rej) + }) + + addFilesAsync(p, files) + + return cb ? promise.then(cb, cb) : promise +} + +const addFilesSync = (p, files) => { + files.forEach(file => { + if (file.charAt(0) === '@') { + t({ + file: path.resolve(p.cwd, file.slice(1)), + sync: true, + noResume: true, + onentry: entry => p.add(entry), + }) + } else { + p.add(file) + } + }) + p.end() +} + +const addFilesAsync = (p, files) => { + while (files.length) { + const file = files.shift() + if (file.charAt(0) === '@') { + return t({ + file: path.resolve(p.cwd, file.slice(1)), + noResume: true, + onentry: entry => p.add(entry), + }).then(_ => addFilesAsync(p, files)) + } else { + p.add(file) + } + } + p.end() +} + +const createSync = (opt, files) => { + const p = new Pack.Sync(opt) + addFilesSync(p, files) + return p +} + +const create = (opt, files) => { + const p = new Pack(opt) + addFilesAsync(p, files) + return p +} diff --git a/node_modules/tar/lib/extract.js b/node_modules/tar/lib/extract.js new file mode 100644 index 00000000..54767982 --- /dev/null +++ b/node_modules/tar/lib/extract.js @@ -0,0 +1,113 @@ +'use strict' + +// tar -x +const hlo = require('./high-level-opt.js') +const Unpack = require('./unpack.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const path = require('path') +const stripSlash = require('./strip-trailing-slashes.js') + +module.exports = (opt_, files, cb) => { + if (typeof opt_ === 'function') { + cb = opt_, files = null, opt_ = {} + } else if (Array.isArray(opt_)) { + files = opt_, opt_ = {} + } + + if (typeof files === 'function') { + cb = files, files = null + } + + if (!files) { + files = [] + } else { + files = Array.from(files) + } + + const opt = hlo(opt_) + + if (opt.sync && typeof cb === 'function') { + throw new TypeError('callback not supported for sync tar functions') + } + + if (!opt.file && typeof cb === 'function') { + throw new TypeError('callback only supported with file option') + } + + if (files.length) { + filesFilter(opt, files) + } + + return opt.file && opt.sync ? extractFileSync(opt) + : opt.file ? extractFile(opt, cb) + : opt.sync ? extractSync(opt) + : extract(opt) +} + +// construct a filter that limits the file entries listed +// include child entries if a dir is included +const filesFilter = (opt, files) => { + const map = new Map(files.map(f => [stripSlash(f), true])) + const filter = opt.filter + + const mapHas = (file, r) => { + const root = r || path.parse(file).root || '.' + const ret = file === root ? false + : map.has(file) ? map.get(file) + : mapHas(path.dirname(file), root) + + map.set(file, ret) + return ret + } + + opt.filter = filter + ? (file, entry) => filter(file, entry) && mapHas(stripSlash(file)) + : file => mapHas(stripSlash(file)) +} + +const extractFileSync = opt => { + const u = new Unpack.Sync(opt) + + const file = opt.file + const stat = fs.statSync(file) + // This trades a zero-byte read() syscall for a stat + // However, it will usually result in less memory allocation + const readSize = opt.maxReadSize || 16 * 1024 * 1024 + const stream = new fsm.ReadStreamSync(file, { + readSize: readSize, + size: stat.size, + }) + stream.pipe(u) +} + +const extractFile = (opt, cb) => { + const u = new Unpack(opt) + const readSize = opt.maxReadSize || 16 * 1024 * 1024 + + const file = opt.file + const p = new Promise((resolve, reject) => { + u.on('error', reject) + u.on('close', resolve) + + // This trades a zero-byte read() syscall for a stat + // However, it will usually result in less memory allocation + fs.stat(file, (er, stat) => { + if (er) { + reject(er) + } else { + const stream = new fsm.ReadStream(file, { + readSize: readSize, + size: stat.size, + }) + stream.on('error', reject) + stream.pipe(u) + } + }) + }) + return cb ? p.then(cb, cb) : p +} + +const extractSync = opt => new Unpack.Sync(opt) + +const extract = opt => new Unpack(opt) diff --git a/node_modules/tar/lib/get-write-flag.js b/node_modules/tar/lib/get-write-flag.js new file mode 100644 index 00000000..e8695999 --- /dev/null +++ b/node_modules/tar/lib/get-write-flag.js @@ -0,0 +1,20 @@ +// Get the appropriate flag to use for creating files +// We use fmap on Windows platforms for files less than +// 512kb. This is a fairly low limit, but avoids making +// things slower in some cases. Since most of what this +// library is used for is extracting tarballs of many +// relatively small files in npm packages and the like, +// it can be a big boost on Windows platforms. +// Only supported in Node v12.9.0 and above. +const platform = process.env.__FAKE_PLATFORM__ || process.platform +const isWindows = platform === 'win32' +const fs = global.__FAKE_TESTING_FS__ || require('fs') + +/* istanbul ignore next */ +const { O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP = 0 } = fs.constants + +const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP +const fMapLimit = 512 * 1024 +const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY +module.exports = !fMapEnabled ? () => 'w' + : size => size < fMapLimit ? fMapFlag : 'w' diff --git a/node_modules/tar/lib/header.js b/node_modules/tar/lib/header.js new file mode 100644 index 00000000..411d5e45 --- /dev/null +++ b/node_modules/tar/lib/header.js @@ -0,0 +1,304 @@ +'use strict' +// parse a 512-byte header block to a data object, or vice-versa +// encode returns `true` if a pax extended header is needed, because +// the data could not be faithfully encoded in a simple header. +// (Also, check header.needPax to see if it needs a pax header.) + +const types = require('./types.js') +const pathModule = require('path').posix +const large = require('./large-numbers.js') + +const SLURP = Symbol('slurp') +const TYPE = Symbol('type') + +class Header { + constructor (data, off, ex, gex) { + this.cksumValid = false + this.needPax = false + this.nullBlock = false + + this.block = null + this.path = null + this.mode = null + this.uid = null + this.gid = null + this.size = null + this.mtime = null + this.cksum = null + this[TYPE] = '0' + this.linkpath = null + this.uname = null + this.gname = null + this.devmaj = 0 + this.devmin = 0 + this.atime = null + this.ctime = null + + if (Buffer.isBuffer(data)) { + this.decode(data, off || 0, ex, gex) + } else if (data) { + this.set(data) + } + } + + decode (buf, off, ex, gex) { + if (!off) { + off = 0 + } + + if (!buf || !(buf.length >= off + 512)) { + throw new Error('need 512 bytes for header') + } + + this.path = decString(buf, off, 100) + this.mode = decNumber(buf, off + 100, 8) + this.uid = decNumber(buf, off + 108, 8) + this.gid = decNumber(buf, off + 116, 8) + this.size = decNumber(buf, off + 124, 12) + this.mtime = decDate(buf, off + 136, 12) + this.cksum = decNumber(buf, off + 148, 12) + + // if we have extended or global extended headers, apply them now + // See https://github.com/npm/node-tar/pull/187 + this[SLURP](ex) + this[SLURP](gex, true) + + // old tar versions marked dirs as a file with a trailing / + this[TYPE] = decString(buf, off + 156, 1) + if (this[TYPE] === '') { + this[TYPE] = '0' + } + if (this[TYPE] === '0' && this.path.slice(-1) === '/') { + this[TYPE] = '5' + } + + // tar implementations sometimes incorrectly put the stat(dir).size + // as the size in the tarball, even though Directory entries are + // not able to have any body at all. In the very rare chance that + // it actually DOES have a body, we weren't going to do anything with + // it anyway, and it'll just be a warning about an invalid header. + if (this[TYPE] === '5') { + this.size = 0 + } + + this.linkpath = decString(buf, off + 157, 100) + if (buf.slice(off + 257, off + 265).toString() === 'ustar\u000000') { + this.uname = decString(buf, off + 265, 32) + this.gname = decString(buf, off + 297, 32) + this.devmaj = decNumber(buf, off + 329, 8) + this.devmin = decNumber(buf, off + 337, 8) + if (buf[off + 475] !== 0) { + // definitely a prefix, definitely >130 chars. + const prefix = decString(buf, off + 345, 155) + this.path = prefix + '/' + this.path + } else { + const prefix = decString(buf, off + 345, 130) + if (prefix) { + this.path = prefix + '/' + this.path + } + this.atime = decDate(buf, off + 476, 12) + this.ctime = decDate(buf, off + 488, 12) + } + } + + let sum = 8 * 0x20 + for (let i = off; i < off + 148; i++) { + sum += buf[i] + } + + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i] + } + + this.cksumValid = sum === this.cksum + if (this.cksum === null && sum === 8 * 0x20) { + this.nullBlock = true + } + } + + [SLURP] (ex, global) { + for (const k in ex) { + // we slurp in everything except for the path attribute in + // a global extended header, because that's weird. + if (ex[k] !== null && ex[k] !== undefined && + !(global && k === 'path')) { + this[k] = ex[k] + } + } + } + + encode (buf, off) { + if (!buf) { + buf = this.block = Buffer.alloc(512) + off = 0 + } + + if (!off) { + off = 0 + } + + if (!(buf.length >= off + 512)) { + throw new Error('need 512 bytes for header') + } + + const prefixSize = this.ctime || this.atime ? 130 : 155 + const split = splitPrefix(this.path || '', prefixSize) + const path = split[0] + const prefix = split[1] + this.needPax = split[2] + + this.needPax = encString(buf, off, 100, path) || this.needPax + this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax + this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax + this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax + this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax + this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax + buf[off + 156] = this[TYPE].charCodeAt(0) + this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax + buf.write('ustar\u000000', off + 257, 8) + this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax + this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax + this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax + this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax + this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax + if (buf[off + 475] !== 0) { + this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax + } else { + this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax + this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax + this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax + } + + let sum = 8 * 0x20 + for (let i = off; i < off + 148; i++) { + sum += buf[i] + } + + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i] + } + + this.cksum = sum + encNumber(buf, off + 148, 8, this.cksum) + this.cksumValid = true + + return this.needPax + } + + set (data) { + for (const i in data) { + if (data[i] !== null && data[i] !== undefined) { + this[i] = data[i] + } + } + } + + get type () { + return types.name.get(this[TYPE]) || this[TYPE] + } + + get typeKey () { + return this[TYPE] + } + + set type (type) { + if (types.code.has(type)) { + this[TYPE] = types.code.get(type) + } else { + this[TYPE] = type + } + } +} + +const splitPrefix = (p, prefixSize) => { + const pathSize = 100 + let pp = p + let prefix = '' + let ret + const root = pathModule.parse(p).root || '.' + + if (Buffer.byteLength(pp) < pathSize) { + ret = [pp, prefix, false] + } else { + // first set prefix to the dir, and path to the base + prefix = pathModule.dirname(pp) + pp = pathModule.basename(pp) + + do { + if (Buffer.byteLength(pp) <= pathSize && + Buffer.byteLength(prefix) <= prefixSize) { + // both fit! + ret = [pp, prefix, false] + } else if (Buffer.byteLength(pp) > pathSize && + Buffer.byteLength(prefix) <= prefixSize) { + // prefix fits in prefix, but path doesn't fit in path + ret = [pp.slice(0, pathSize - 1), prefix, true] + } else { + // make path take a bit from prefix + pp = pathModule.join(pathModule.basename(prefix), pp) + prefix = pathModule.dirname(prefix) + } + } while (prefix !== root && !ret) + + // at this point, found no resolution, just truncate + if (!ret) { + ret = [p.slice(0, pathSize - 1), '', true] + } + } + return ret +} + +const decString = (buf, off, size) => + buf.slice(off, off + size).toString('utf8').replace(/\0.*/, '') + +const decDate = (buf, off, size) => + numToDate(decNumber(buf, off, size)) + +const numToDate = num => num === null ? null : new Date(num * 1000) + +const decNumber = (buf, off, size) => + buf[off] & 0x80 ? large.parse(buf.slice(off, off + size)) + : decSmallNumber(buf, off, size) + +const nanNull = value => isNaN(value) ? null : value + +const decSmallNumber = (buf, off, size) => + nanNull(parseInt( + buf.slice(off, off + size) + .toString('utf8').replace(/\0.*$/, '').trim(), 8)) + +// the maximum encodable as a null-terminated octal, by field size +const MAXNUM = { + 12: 0o77777777777, + 8: 0o7777777, +} + +const encNumber = (buf, off, size, number) => + number === null ? false : + number > MAXNUM[size] || number < 0 + ? (large.encode(number, buf.slice(off, off + size)), true) + : (encSmallNumber(buf, off, size, number), false) + +const encSmallNumber = (buf, off, size, number) => + buf.write(octalString(number, size), off, size, 'ascii') + +const octalString = (number, size) => + padOctal(Math.floor(number).toString(8), size) + +const padOctal = (string, size) => + (string.length === size - 1 ? string + : new Array(size - string.length - 1).join('0') + string + ' ') + '\0' + +const encDate = (buf, off, size, date) => + date === null ? false : + encNumber(buf, off, size, date.getTime() / 1000) + +// enough to fill the longest string we've got +const NULLS = new Array(156).join('\0') +// pad with nulls, return true if it's longer or non-ascii +const encString = (buf, off, size, string) => + string === null ? false : + (buf.write(string + NULLS, off, size, 'utf8'), + string.length !== Buffer.byteLength(string) || string.length > size) + +module.exports = Header diff --git a/node_modules/tar/lib/high-level-opt.js b/node_modules/tar/lib/high-level-opt.js new file mode 100644 index 00000000..40e44180 --- /dev/null +++ b/node_modules/tar/lib/high-level-opt.js @@ -0,0 +1,29 @@ +'use strict' + +// turn tar(1) style args like `C` into the more verbose things like `cwd` + +const argmap = new Map([ + ['C', 'cwd'], + ['f', 'file'], + ['z', 'gzip'], + ['P', 'preservePaths'], + ['U', 'unlink'], + ['strip-components', 'strip'], + ['stripComponents', 'strip'], + ['keep-newer', 'newer'], + ['keepNewer', 'newer'], + ['keep-newer-files', 'newer'], + ['keepNewerFiles', 'newer'], + ['k', 'keep'], + ['keep-existing', 'keep'], + ['keepExisting', 'keep'], + ['m', 'noMtime'], + ['no-mtime', 'noMtime'], + ['p', 'preserveOwner'], + ['L', 'follow'], + ['h', 'follow'], +]) + +module.exports = opt => opt ? Object.keys(opt).map(k => [ + argmap.has(k) ? argmap.get(k) : k, opt[k], +]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {} diff --git a/node_modules/tar/lib/large-numbers.js b/node_modules/tar/lib/large-numbers.js new file mode 100644 index 00000000..b11e72d9 --- /dev/null +++ b/node_modules/tar/lib/large-numbers.js @@ -0,0 +1,104 @@ +'use strict' +// Tar can encode large and negative numbers using a leading byte of +// 0xff for negative, and 0x80 for positive. + +const encode = (num, buf) => { + if (!Number.isSafeInteger(num)) { + // The number is so large that javascript cannot represent it with integer + // precision. + throw Error('cannot encode number outside of javascript safe integer range') + } else if (num < 0) { + encodeNegative(num, buf) + } else { + encodePositive(num, buf) + } + return buf +} + +const encodePositive = (num, buf) => { + buf[0] = 0x80 + + for (var i = buf.length; i > 1; i--) { + buf[i - 1] = num & 0xff + num = Math.floor(num / 0x100) + } +} + +const encodeNegative = (num, buf) => { + buf[0] = 0xff + var flipped = false + num = num * -1 + for (var i = buf.length; i > 1; i--) { + var byte = num & 0xff + num = Math.floor(num / 0x100) + if (flipped) { + buf[i - 1] = onesComp(byte) + } else if (byte === 0) { + buf[i - 1] = 0 + } else { + flipped = true + buf[i - 1] = twosComp(byte) + } + } +} + +const parse = (buf) => { + const pre = buf[0] + const value = pre === 0x80 ? pos(buf.slice(1, buf.length)) + : pre === 0xff ? twos(buf) + : null + if (value === null) { + throw Error('invalid base256 encoding') + } + + if (!Number.isSafeInteger(value)) { + // The number is so large that javascript cannot represent it with integer + // precision. + throw Error('parsed number outside of javascript safe integer range') + } + + return value +} + +const twos = (buf) => { + var len = buf.length + var sum = 0 + var flipped = false + for (var i = len - 1; i > -1; i--) { + var byte = buf[i] + var f + if (flipped) { + f = onesComp(byte) + } else if (byte === 0) { + f = byte + } else { + flipped = true + f = twosComp(byte) + } + if (f !== 0) { + sum -= f * Math.pow(256, len - i - 1) + } + } + return sum +} + +const pos = (buf) => { + var len = buf.length + var sum = 0 + for (var i = len - 1; i > -1; i--) { + var byte = buf[i] + if (byte !== 0) { + sum += byte * Math.pow(256, len - i - 1) + } + } + return sum +} + +const onesComp = byte => (0xff ^ byte) & 0xff + +const twosComp = byte => ((0xff ^ byte) + 1) & 0xff + +module.exports = { + encode, + parse, +} diff --git a/node_modules/tar/lib/list.js b/node_modules/tar/lib/list.js new file mode 100644 index 00000000..f2358c25 --- /dev/null +++ b/node_modules/tar/lib/list.js @@ -0,0 +1,139 @@ +'use strict' + +// XXX: This shares a lot in common with extract.js +// maybe some DRY opportunity here? + +// tar -t +const hlo = require('./high-level-opt.js') +const Parser = require('./parse.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const path = require('path') +const stripSlash = require('./strip-trailing-slashes.js') + +module.exports = (opt_, files, cb) => { + if (typeof opt_ === 'function') { + cb = opt_, files = null, opt_ = {} + } else if (Array.isArray(opt_)) { + files = opt_, opt_ = {} + } + + if (typeof files === 'function') { + cb = files, files = null + } + + if (!files) { + files = [] + } else { + files = Array.from(files) + } + + const opt = hlo(opt_) + + if (opt.sync && typeof cb === 'function') { + throw new TypeError('callback not supported for sync tar functions') + } + + if (!opt.file && typeof cb === 'function') { + throw new TypeError('callback only supported with file option') + } + + if (files.length) { + filesFilter(opt, files) + } + + if (!opt.noResume) { + onentryFunction(opt) + } + + return opt.file && opt.sync ? listFileSync(opt) + : opt.file ? listFile(opt, cb) + : list(opt) +} + +const onentryFunction = opt => { + const onentry = opt.onentry + opt.onentry = onentry ? e => { + onentry(e) + e.resume() + } : e => e.resume() +} + +// construct a filter that limits the file entries listed +// include child entries if a dir is included +const filesFilter = (opt, files) => { + const map = new Map(files.map(f => [stripSlash(f), true])) + const filter = opt.filter + + const mapHas = (file, r) => { + const root = r || path.parse(file).root || '.' + const ret = file === root ? false + : map.has(file) ? map.get(file) + : mapHas(path.dirname(file), root) + + map.set(file, ret) + return ret + } + + opt.filter = filter + ? (file, entry) => filter(file, entry) && mapHas(stripSlash(file)) + : file => mapHas(stripSlash(file)) +} + +const listFileSync = opt => { + const p = list(opt) + const file = opt.file + let threw = true + let fd + try { + const stat = fs.statSync(file) + const readSize = opt.maxReadSize || 16 * 1024 * 1024 + if (stat.size < readSize) { + p.end(fs.readFileSync(file)) + } else { + let pos = 0 + const buf = Buffer.allocUnsafe(readSize) + fd = fs.openSync(file, 'r') + while (pos < stat.size) { + const bytesRead = fs.readSync(fd, buf, 0, readSize, pos) + pos += bytesRead + p.write(buf.slice(0, bytesRead)) + } + p.end() + } + threw = false + } finally { + if (threw && fd) { + try { + fs.closeSync(fd) + } catch (er) {} + } + } +} + +const listFile = (opt, cb) => { + const parse = new Parser(opt) + const readSize = opt.maxReadSize || 16 * 1024 * 1024 + + const file = opt.file + const p = new Promise((resolve, reject) => { + parse.on('error', reject) + parse.on('end', resolve) + + fs.stat(file, (er, stat) => { + if (er) { + reject(er) + } else { + const stream = new fsm.ReadStream(file, { + readSize: readSize, + size: stat.size, + }) + stream.on('error', reject) + stream.pipe(parse) + } + }) + }) + return cb ? p.then(cb, cb) : p +} + +const list = opt => new Parser(opt) diff --git a/node_modules/tar/lib/mkdir.js b/node_modules/tar/lib/mkdir.js new file mode 100644 index 00000000..8ee8de78 --- /dev/null +++ b/node_modules/tar/lib/mkdir.js @@ -0,0 +1,229 @@ +'use strict' +// wrapper around mkdirp for tar's needs. + +// TODO: This should probably be a class, not functionally +// passing around state in a gazillion args. + +const mkdirp = require('mkdirp') +const fs = require('fs') +const path = require('path') +const chownr = require('chownr') +const normPath = require('./normalize-windows-path.js') + +class SymlinkError extends Error { + constructor (symlink, path) { + super('Cannot extract through symbolic link') + this.path = path + this.symlink = symlink + } + + get name () { + return 'SylinkError' + } +} + +class CwdError extends Error { + constructor (path, code) { + super(code + ': Cannot cd into \'' + path + '\'') + this.path = path + this.code = code + } + + get name () { + return 'CwdError' + } +} + +const cGet = (cache, key) => cache.get(normPath(key)) +const cSet = (cache, key, val) => cache.set(normPath(key), val) + +const checkCwd = (dir, cb) => { + fs.stat(dir, (er, st) => { + if (er || !st.isDirectory()) { + er = new CwdError(dir, er && er.code || 'ENOTDIR') + } + cb(er) + }) +} + +module.exports = (dir, opt, cb) => { + dir = normPath(dir) + + // if there's any overlap between mask and mode, + // then we'll need an explicit chmod + const umask = opt.umask + const mode = opt.mode | 0o0700 + const needChmod = (mode & umask) !== 0 + + const uid = opt.uid + const gid = opt.gid + const doChown = typeof uid === 'number' && + typeof gid === 'number' && + (uid !== opt.processUid || gid !== opt.processGid) + + const preserve = opt.preserve + const unlink = opt.unlink + const cache = opt.cache + const cwd = normPath(opt.cwd) + + const done = (er, created) => { + if (er) { + cb(er) + } else { + cSet(cache, dir, true) + if (created && doChown) { + chownr(created, uid, gid, er => done(er)) + } else if (needChmod) { + fs.chmod(dir, mode, cb) + } else { + cb() + } + } + } + + if (cache && cGet(cache, dir) === true) { + return done() + } + + if (dir === cwd) { + return checkCwd(dir, done) + } + + if (preserve) { + return mkdirp(dir, { mode }).then(made => done(null, made), done) + } + + const sub = normPath(path.relative(cwd, dir)) + const parts = sub.split('/') + mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done) +} + +const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => { + if (!parts.length) { + return cb(null, created) + } + const p = parts.shift() + const part = normPath(path.resolve(base + '/' + p)) + if (cGet(cache, part)) { + return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) + } + fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) +} + +const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => { + if (er) { + fs.lstat(part, (statEr, st) => { + if (statEr) { + statEr.path = statEr.path && normPath(statEr.path) + cb(statEr) + } else if (st.isDirectory()) { + mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) + } else if (unlink) { + fs.unlink(part, er => { + if (er) { + return cb(er) + } + fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) + }) + } else if (st.isSymbolicLink()) { + return cb(new SymlinkError(part, part + '/' + parts.join('/'))) + } else { + cb(er) + } + }) + } else { + created = created || part + mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) + } +} + +const checkCwdSync = dir => { + let ok = false + let code = 'ENOTDIR' + try { + ok = fs.statSync(dir).isDirectory() + } catch (er) { + code = er.code + } finally { + if (!ok) { + throw new CwdError(dir, code) + } + } +} + +module.exports.sync = (dir, opt) => { + dir = normPath(dir) + // if there's any overlap between mask and mode, + // then we'll need an explicit chmod + const umask = opt.umask + const mode = opt.mode | 0o0700 + const needChmod = (mode & umask) !== 0 + + const uid = opt.uid + const gid = opt.gid + const doChown = typeof uid === 'number' && + typeof gid === 'number' && + (uid !== opt.processUid || gid !== opt.processGid) + + const preserve = opt.preserve + const unlink = opt.unlink + const cache = opt.cache + const cwd = normPath(opt.cwd) + + const done = (created) => { + cSet(cache, dir, true) + if (created && doChown) { + chownr.sync(created, uid, gid) + } + if (needChmod) { + fs.chmodSync(dir, mode) + } + } + + if (cache && cGet(cache, dir) === true) { + return done() + } + + if (dir === cwd) { + checkCwdSync(cwd) + return done() + } + + if (preserve) { + return done(mkdirp.sync(dir, mode)) + } + + const sub = normPath(path.relative(cwd, dir)) + const parts = sub.split('/') + let created = null + for (let p = parts.shift(), part = cwd; + p && (part += '/' + p); + p = parts.shift()) { + part = normPath(path.resolve(part)) + if (cGet(cache, part)) { + continue + } + + try { + fs.mkdirSync(part, mode) + created = created || part + cSet(cache, part, true) + } catch (er) { + const st = fs.lstatSync(part) + if (st.isDirectory()) { + cSet(cache, part, true) + continue + } else if (unlink) { + fs.unlinkSync(part) + fs.mkdirSync(part, mode) + created = created || part + cSet(cache, part, true) + continue + } else if (st.isSymbolicLink()) { + return new SymlinkError(part, part + '/' + parts.join('/')) + } + } + } + + return done(created) +} diff --git a/node_modules/tar/lib/mode-fix.js b/node_modules/tar/lib/mode-fix.js new file mode 100644 index 00000000..42f1d6e6 --- /dev/null +++ b/node_modules/tar/lib/mode-fix.js @@ -0,0 +1,27 @@ +'use strict' +module.exports = (mode, isDir, portable) => { + mode &= 0o7777 + + // in portable mode, use the minimum reasonable umask + // if this system creates files with 0o664 by default + // (as some linux distros do), then we'll write the + // archive with 0o644 instead. Also, don't ever create + // a file that is not readable/writable by the owner. + if (portable) { + mode = (mode | 0o600) & ~0o22 + } + + // if dirs are readable, then they should be listable + if (isDir) { + if (mode & 0o400) { + mode |= 0o100 + } + if (mode & 0o40) { + mode |= 0o10 + } + if (mode & 0o4) { + mode |= 0o1 + } + } + return mode +} diff --git a/node_modules/tar/lib/normalize-unicode.js b/node_modules/tar/lib/normalize-unicode.js new file mode 100644 index 00000000..79e285ab --- /dev/null +++ b/node_modules/tar/lib/normalize-unicode.js @@ -0,0 +1,12 @@ +// warning: extremely hot code path. +// This has been meticulously optimized for use +// within npm install on large package trees. +// Do not edit without careful benchmarking. +const normalizeCache = Object.create(null) +const { hasOwnProperty } = Object.prototype +module.exports = s => { + if (!hasOwnProperty.call(normalizeCache, s)) { + normalizeCache[s] = s.normalize('NFD') + } + return normalizeCache[s] +} diff --git a/node_modules/tar/lib/normalize-windows-path.js b/node_modules/tar/lib/normalize-windows-path.js new file mode 100644 index 00000000..eb13ba01 --- /dev/null +++ b/node_modules/tar/lib/normalize-windows-path.js @@ -0,0 +1,8 @@ +// on windows, either \ or / are valid directory separators. +// on unix, \ is a valid character in filenames. +// so, on windows, and only on windows, we replace all \ chars with /, +// so that we can use / as our one and only directory separator char. + +const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform +module.exports = platform !== 'win32' ? p => p + : p => p && p.replace(/\\/g, '/') diff --git a/node_modules/tar/lib/pack.js b/node_modules/tar/lib/pack.js new file mode 100644 index 00000000..d533a068 --- /dev/null +++ b/node_modules/tar/lib/pack.js @@ -0,0 +1,432 @@ +'use strict' + +// A readable tar stream creator +// Technically, this is a transform stream that you write paths into, +// and tar format comes out of. +// The `add()` method is like `write()` but returns this, +// and end() return `this` as well, so you can +// do `new Pack(opt).add('files').add('dir').end().pipe(output) +// You could also do something like: +// streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar')) + +class PackJob { + constructor (path, absolute) { + this.path = path || './' + this.absolute = absolute + this.entry = null + this.stat = null + this.readdir = null + this.pending = false + this.ignore = false + this.piped = false + } +} + +const { Minipass } = require('minipass') +const zlib = require('minizlib') +const ReadEntry = require('./read-entry.js') +const WriteEntry = require('./write-entry.js') +const WriteEntrySync = WriteEntry.Sync +const WriteEntryTar = WriteEntry.Tar +const Yallist = require('yallist') +const EOF = Buffer.alloc(1024) +const ONSTAT = Symbol('onStat') +const ENDED = Symbol('ended') +const QUEUE = Symbol('queue') +const CURRENT = Symbol('current') +const PROCESS = Symbol('process') +const PROCESSING = Symbol('processing') +const PROCESSJOB = Symbol('processJob') +const JOBS = Symbol('jobs') +const JOBDONE = Symbol('jobDone') +const ADDFSENTRY = Symbol('addFSEntry') +const ADDTARENTRY = Symbol('addTarEntry') +const STAT = Symbol('stat') +const READDIR = Symbol('readdir') +const ONREADDIR = Symbol('onreaddir') +const PIPE = Symbol('pipe') +const ENTRY = Symbol('entry') +const ENTRYOPT = Symbol('entryOpt') +const WRITEENTRYCLASS = Symbol('writeEntryClass') +const WRITE = Symbol('write') +const ONDRAIN = Symbol('ondrain') + +const fs = require('fs') +const path = require('path') +const warner = require('./warn-mixin.js') +const normPath = require('./normalize-windows-path.js') + +const Pack = warner(class Pack extends Minipass { + constructor (opt) { + super(opt) + opt = opt || Object.create(null) + this.opt = opt + this.file = opt.file || '' + this.cwd = opt.cwd || process.cwd() + this.maxReadSize = opt.maxReadSize + this.preservePaths = !!opt.preservePaths + this.strict = !!opt.strict + this.noPax = !!opt.noPax + this.prefix = normPath(opt.prefix || '') + this.linkCache = opt.linkCache || new Map() + this.statCache = opt.statCache || new Map() + this.readdirCache = opt.readdirCache || new Map() + + this[WRITEENTRYCLASS] = WriteEntry + if (typeof opt.onwarn === 'function') { + this.on('warn', opt.onwarn) + } + + this.portable = !!opt.portable + this.zip = null + + if (opt.gzip || opt.brotli) { + if (opt.gzip && opt.brotli) { + throw new TypeError('gzip and brotli are mutually exclusive') + } + if (opt.gzip) { + if (typeof opt.gzip !== 'object') { + opt.gzip = {} + } + if (this.portable) { + opt.gzip.portable = true + } + this.zip = new zlib.Gzip(opt.gzip) + } + if (opt.brotli) { + if (typeof opt.brotli !== 'object') { + opt.brotli = {} + } + this.zip = new zlib.BrotliCompress(opt.brotli) + } + this.zip.on('data', chunk => super.write(chunk)) + this.zip.on('end', _ => super.end()) + this.zip.on('drain', _ => this[ONDRAIN]()) + this.on('resume', _ => this.zip.resume()) + } else { + this.on('drain', this[ONDRAIN]) + } + + this.noDirRecurse = !!opt.noDirRecurse + this.follow = !!opt.follow + this.noMtime = !!opt.noMtime + this.mtime = opt.mtime || null + + this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true + + this[QUEUE] = new Yallist() + this[JOBS] = 0 + this.jobs = +opt.jobs || 4 + this[PROCESSING] = false + this[ENDED] = false + } + + [WRITE] (chunk) { + return super.write(chunk) + } + + add (path) { + this.write(path) + return this + } + + end (path) { + if (path) { + this.write(path) + } + this[ENDED] = true + this[PROCESS]() + return this + } + + write (path) { + if (this[ENDED]) { + throw new Error('write after end') + } + + if (path instanceof ReadEntry) { + this[ADDTARENTRY](path) + } else { + this[ADDFSENTRY](path) + } + return this.flowing + } + + [ADDTARENTRY] (p) { + const absolute = normPath(path.resolve(this.cwd, p.path)) + // in this case, we don't have to wait for the stat + if (!this.filter(p.path, p)) { + p.resume() + } else { + const job = new PackJob(p.path, absolute, false) + job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)) + job.entry.on('end', _ => this[JOBDONE](job)) + this[JOBS] += 1 + this[QUEUE].push(job) + } + + this[PROCESS]() + } + + [ADDFSENTRY] (p) { + const absolute = normPath(path.resolve(this.cwd, p)) + this[QUEUE].push(new PackJob(p, absolute)) + this[PROCESS]() + } + + [STAT] (job) { + job.pending = true + this[JOBS] += 1 + const stat = this.follow ? 'stat' : 'lstat' + fs[stat](job.absolute, (er, stat) => { + job.pending = false + this[JOBS] -= 1 + if (er) { + this.emit('error', er) + } else { + this[ONSTAT](job, stat) + } + }) + } + + [ONSTAT] (job, stat) { + this.statCache.set(job.absolute, stat) + job.stat = stat + + // now we have the stat, we can filter it. + if (!this.filter(job.path, stat)) { + job.ignore = true + } + + this[PROCESS]() + } + + [READDIR] (job) { + job.pending = true + this[JOBS] += 1 + fs.readdir(job.absolute, (er, entries) => { + job.pending = false + this[JOBS] -= 1 + if (er) { + return this.emit('error', er) + } + this[ONREADDIR](job, entries) + }) + } + + [ONREADDIR] (job, entries) { + this.readdirCache.set(job.absolute, entries) + job.readdir = entries + this[PROCESS]() + } + + [PROCESS] () { + if (this[PROCESSING]) { + return + } + + this[PROCESSING] = true + for (let w = this[QUEUE].head; + w !== null && this[JOBS] < this.jobs; + w = w.next) { + this[PROCESSJOB](w.value) + if (w.value.ignore) { + const p = w.next + this[QUEUE].removeNode(w) + w.next = p + } + } + + this[PROCESSING] = false + + if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) { + if (this.zip) { + this.zip.end(EOF) + } else { + super.write(EOF) + super.end() + } + } + } + + get [CURRENT] () { + return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value + } + + [JOBDONE] (job) { + this[QUEUE].shift() + this[JOBS] -= 1 + this[PROCESS]() + } + + [PROCESSJOB] (job) { + if (job.pending) { + return + } + + if (job.entry) { + if (job === this[CURRENT] && !job.piped) { + this[PIPE](job) + } + return + } + + if (!job.stat) { + if (this.statCache.has(job.absolute)) { + this[ONSTAT](job, this.statCache.get(job.absolute)) + } else { + this[STAT](job) + } + } + if (!job.stat) { + return + } + + // filtered out! + if (job.ignore) { + return + } + + if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { + if (this.readdirCache.has(job.absolute)) { + this[ONREADDIR](job, this.readdirCache.get(job.absolute)) + } else { + this[READDIR](job) + } + if (!job.readdir) { + return + } + } + + // we know it doesn't have an entry, because that got checked above + job.entry = this[ENTRY](job) + if (!job.entry) { + job.ignore = true + return + } + + if (job === this[CURRENT] && !job.piped) { + this[PIPE](job) + } + } + + [ENTRYOPT] (job) { + return { + onwarn: (code, msg, data) => this.warn(code, msg, data), + noPax: this.noPax, + cwd: this.cwd, + absolute: job.absolute, + preservePaths: this.preservePaths, + maxReadSize: this.maxReadSize, + strict: this.strict, + portable: this.portable, + linkCache: this.linkCache, + statCache: this.statCache, + noMtime: this.noMtime, + mtime: this.mtime, + prefix: this.prefix, + } + } + + [ENTRY] (job) { + this[JOBS] += 1 + try { + return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)) + .on('end', () => this[JOBDONE](job)) + .on('error', er => this.emit('error', er)) + } catch (er) { + this.emit('error', er) + } + } + + [ONDRAIN] () { + if (this[CURRENT] && this[CURRENT].entry) { + this[CURRENT].entry.resume() + } + } + + // like .pipe() but using super, because our write() is special + [PIPE] (job) { + job.piped = true + + if (job.readdir) { + job.readdir.forEach(entry => { + const p = job.path + const base = p === './' ? '' : p.replace(/\/*$/, '/') + this[ADDFSENTRY](base + entry) + }) + } + + const source = job.entry + const zip = this.zip + + if (zip) { + source.on('data', chunk => { + if (!zip.write(chunk)) { + source.pause() + } + }) + } else { + source.on('data', chunk => { + if (!super.write(chunk)) { + source.pause() + } + }) + } + } + + pause () { + if (this.zip) { + this.zip.pause() + } + return super.pause() + } +}) + +class PackSync extends Pack { + constructor (opt) { + super(opt) + this[WRITEENTRYCLASS] = WriteEntrySync + } + + // pause/resume are no-ops in sync streams. + pause () {} + resume () {} + + [STAT] (job) { + const stat = this.follow ? 'statSync' : 'lstatSync' + this[ONSTAT](job, fs[stat](job.absolute)) + } + + [READDIR] (job, stat) { + this[ONREADDIR](job, fs.readdirSync(job.absolute)) + } + + // gotta get it all in this tick + [PIPE] (job) { + const source = job.entry + const zip = this.zip + + if (job.readdir) { + job.readdir.forEach(entry => { + const p = job.path + const base = p === './' ? '' : p.replace(/\/*$/, '/') + this[ADDFSENTRY](base + entry) + }) + } + + if (zip) { + source.on('data', chunk => { + zip.write(chunk) + }) + } else { + source.on('data', chunk => { + super[WRITE](chunk) + }) + } + } +} + +Pack.Sync = PackSync + +module.exports = Pack diff --git a/node_modules/tar/lib/parse.js b/node_modules/tar/lib/parse.js new file mode 100644 index 00000000..94e53042 --- /dev/null +++ b/node_modules/tar/lib/parse.js @@ -0,0 +1,552 @@ +'use strict' + +// this[BUFFER] is the remainder of a chunk if we're waiting for +// the full 512 bytes of a header to come in. We will Buffer.concat() +// it to the next write(), which is a mem copy, but a small one. +// +// this[QUEUE] is a Yallist of entries that haven't been emitted +// yet this can only get filled up if the user keeps write()ing after +// a write() returns false, or does a write() with more than one entry +// +// We don't buffer chunks, we always parse them and either create an +// entry, or push it into the active entry. The ReadEntry class knows +// to throw data away if .ignore=true +// +// Shift entry off the buffer when it emits 'end', and emit 'entry' for +// the next one in the list. +// +// At any time, we're pushing body chunks into the entry at WRITEENTRY, +// and waiting for 'end' on the entry at READENTRY +// +// ignored entries get .resume() called on them straight away + +const warner = require('./warn-mixin.js') +const Header = require('./header.js') +const EE = require('events') +const Yallist = require('yallist') +const maxMetaEntrySize = 1024 * 1024 +const Entry = require('./read-entry.js') +const Pax = require('./pax.js') +const zlib = require('minizlib') +const { nextTick } = require('process') + +const gzipHeader = Buffer.from([0x1f, 0x8b]) +const STATE = Symbol('state') +const WRITEENTRY = Symbol('writeEntry') +const READENTRY = Symbol('readEntry') +const NEXTENTRY = Symbol('nextEntry') +const PROCESSENTRY = Symbol('processEntry') +const EX = Symbol('extendedHeader') +const GEX = Symbol('globalExtendedHeader') +const META = Symbol('meta') +const EMITMETA = Symbol('emitMeta') +const BUFFER = Symbol('buffer') +const QUEUE = Symbol('queue') +const ENDED = Symbol('ended') +const EMITTEDEND = Symbol('emittedEnd') +const EMIT = Symbol('emit') +const UNZIP = Symbol('unzip') +const CONSUMECHUNK = Symbol('consumeChunk') +const CONSUMECHUNKSUB = Symbol('consumeChunkSub') +const CONSUMEBODY = Symbol('consumeBody') +const CONSUMEMETA = Symbol('consumeMeta') +const CONSUMEHEADER = Symbol('consumeHeader') +const CONSUMING = Symbol('consuming') +const BUFFERCONCAT = Symbol('bufferConcat') +const MAYBEEND = Symbol('maybeEnd') +const WRITING = Symbol('writing') +const ABORTED = Symbol('aborted') +const DONE = Symbol('onDone') +const SAW_VALID_ENTRY = Symbol('sawValidEntry') +const SAW_NULL_BLOCK = Symbol('sawNullBlock') +const SAW_EOF = Symbol('sawEOF') +const CLOSESTREAM = Symbol('closeStream') + +const noop = _ => true + +module.exports = warner(class Parser extends EE { + constructor (opt) { + opt = opt || {} + super(opt) + + this.file = opt.file || '' + + // set to boolean false when an entry starts. 1024 bytes of \0 + // is technically a valid tarball, albeit a boring one. + this[SAW_VALID_ENTRY] = null + + // these BADARCHIVE errors can't be detected early. listen on DONE. + this.on(DONE, _ => { + if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) { + // either less than 1 block of data, or all entries were invalid. + // Either way, probably not even a tarball. + this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format') + } + }) + + if (opt.ondone) { + this.on(DONE, opt.ondone) + } else { + this.on(DONE, _ => { + this.emit('prefinish') + this.emit('finish') + this.emit('end') + }) + } + + this.strict = !!opt.strict + this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize + this.filter = typeof opt.filter === 'function' ? opt.filter : noop + // Unlike gzip, brotli doesn't have any magic bytes to identify it + // Users need to explicitly tell us they're extracting a brotli file + // Or we infer from the file extension + const isTBR = (opt.file && ( + opt.file.endsWith('.tar.br') || opt.file.endsWith('.tbr'))) + // if it's a tbr file it MIGHT be brotli, but we don't know until + // we look at it and verify it's not a valid tar file. + this.brotli = !opt.gzip && opt.brotli !== undefined ? opt.brotli + : isTBR ? undefined + : false + + // have to set this so that streams are ok piping into it + this.writable = true + this.readable = false + + this[QUEUE] = new Yallist() + this[BUFFER] = null + this[READENTRY] = null + this[WRITEENTRY] = null + this[STATE] = 'begin' + this[META] = '' + this[EX] = null + this[GEX] = null + this[ENDED] = false + this[UNZIP] = null + this[ABORTED] = false + this[SAW_NULL_BLOCK] = false + this[SAW_EOF] = false + + this.on('end', () => this[CLOSESTREAM]()) + + if (typeof opt.onwarn === 'function') { + this.on('warn', opt.onwarn) + } + if (typeof opt.onentry === 'function') { + this.on('entry', opt.onentry) + } + } + + [CONSUMEHEADER] (chunk, position) { + if (this[SAW_VALID_ENTRY] === null) { + this[SAW_VALID_ENTRY] = false + } + let header + try { + header = new Header(chunk, position, this[EX], this[GEX]) + } catch (er) { + return this.warn('TAR_ENTRY_INVALID', er) + } + + if (header.nullBlock) { + if (this[SAW_NULL_BLOCK]) { + this[SAW_EOF] = true + // ending an archive with no entries. pointless, but legal. + if (this[STATE] === 'begin') { + this[STATE] = 'header' + } + this[EMIT]('eof') + } else { + this[SAW_NULL_BLOCK] = true + this[EMIT]('nullBlock') + } + } else { + this[SAW_NULL_BLOCK] = false + if (!header.cksumValid) { + this.warn('TAR_ENTRY_INVALID', 'checksum failure', { header }) + } else if (!header.path) { + this.warn('TAR_ENTRY_INVALID', 'path is required', { header }) + } else { + const type = header.type + if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) { + this.warn('TAR_ENTRY_INVALID', 'linkpath required', { header }) + } else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) { + this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', { header }) + } else { + const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]) + + // we do this for meta & ignored entries as well, because they + // are still valid tar, or else we wouldn't know to ignore them + if (!this[SAW_VALID_ENTRY]) { + if (entry.remain) { + // this might be the one! + const onend = () => { + if (!entry.invalid) { + this[SAW_VALID_ENTRY] = true + } + } + entry.on('end', onend) + } else { + this[SAW_VALID_ENTRY] = true + } + } + + if (entry.meta) { + if (entry.size > this.maxMetaEntrySize) { + entry.ignore = true + this[EMIT]('ignoredEntry', entry) + this[STATE] = 'ignore' + entry.resume() + } else if (entry.size > 0) { + this[META] = '' + entry.on('data', c => this[META] += c) + this[STATE] = 'meta' + } + } else { + this[EX] = null + entry.ignore = entry.ignore || !this.filter(entry.path, entry) + + if (entry.ignore) { + // probably valid, just not something we care about + this[EMIT]('ignoredEntry', entry) + this[STATE] = entry.remain ? 'ignore' : 'header' + entry.resume() + } else { + if (entry.remain) { + this[STATE] = 'body' + } else { + this[STATE] = 'header' + entry.end() + } + + if (!this[READENTRY]) { + this[QUEUE].push(entry) + this[NEXTENTRY]() + } else { + this[QUEUE].push(entry) + } + } + } + } + } + } + } + + [CLOSESTREAM] () { + nextTick(() => this.emit('close')) + } + + [PROCESSENTRY] (entry) { + let go = true + + if (!entry) { + this[READENTRY] = null + go = false + } else if (Array.isArray(entry)) { + this.emit.apply(this, entry) + } else { + this[READENTRY] = entry + this.emit('entry', entry) + if (!entry.emittedEnd) { + entry.on('end', _ => this[NEXTENTRY]()) + go = false + } + } + + return go + } + + [NEXTENTRY] () { + do {} while (this[PROCESSENTRY](this[QUEUE].shift())) + + if (!this[QUEUE].length) { + // At this point, there's nothing in the queue, but we may have an + // entry which is being consumed (readEntry). + // If we don't, then we definitely can handle more data. + // If we do, and either it's flowing, or it has never had any data + // written to it, then it needs more. + // The only other possibility is that it has returned false from a + // write() call, so we wait for the next drain to continue. + const re = this[READENTRY] + const drainNow = !re || re.flowing || re.size === re.remain + if (drainNow) { + if (!this[WRITING]) { + this.emit('drain') + } + } else { + re.once('drain', _ => this.emit('drain')) + } + } + } + + [CONSUMEBODY] (chunk, position) { + // write up to but no more than writeEntry.blockRemain + const entry = this[WRITEENTRY] + const br = entry.blockRemain + const c = (br >= chunk.length && position === 0) ? chunk + : chunk.slice(position, position + br) + + entry.write(c) + + if (!entry.blockRemain) { + this[STATE] = 'header' + this[WRITEENTRY] = null + entry.end() + } + + return c.length + } + + [CONSUMEMETA] (chunk, position) { + const entry = this[WRITEENTRY] + const ret = this[CONSUMEBODY](chunk, position) + + // if we finished, then the entry is reset + if (!this[WRITEENTRY]) { + this[EMITMETA](entry) + } + + return ret + } + + [EMIT] (ev, data, extra) { + if (!this[QUEUE].length && !this[READENTRY]) { + this.emit(ev, data, extra) + } else { + this[QUEUE].push([ev, data, extra]) + } + } + + [EMITMETA] (entry) { + this[EMIT]('meta', this[META]) + switch (entry.type) { + case 'ExtendedHeader': + case 'OldExtendedHeader': + this[EX] = Pax.parse(this[META], this[EX], false) + break + + case 'GlobalExtendedHeader': + this[GEX] = Pax.parse(this[META], this[GEX], true) + break + + case 'NextFileHasLongPath': + case 'OldGnuLongPath': + this[EX] = this[EX] || Object.create(null) + this[EX].path = this[META].replace(/\0.*/, '') + break + + case 'NextFileHasLongLinkpath': + this[EX] = this[EX] || Object.create(null) + this[EX].linkpath = this[META].replace(/\0.*/, '') + break + + /* istanbul ignore next */ + default: throw new Error('unknown meta: ' + entry.type) + } + } + + abort (error) { + this[ABORTED] = true + this.emit('abort', error) + // always throws, even in non-strict mode + this.warn('TAR_ABORT', error, { recoverable: false }) + } + + write (chunk) { + if (this[ABORTED]) { + return + } + + // first write, might be gzipped + const needSniff = this[UNZIP] === null || + this.brotli === undefined && this[UNZIP] === false + if (needSniff && chunk) { + if (this[BUFFER]) { + chunk = Buffer.concat([this[BUFFER], chunk]) + this[BUFFER] = null + } + if (chunk.length < gzipHeader.length) { + this[BUFFER] = chunk + return true + } + + // look for gzip header + for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) { + if (chunk[i] !== gzipHeader[i]) { + this[UNZIP] = false + } + } + + const maybeBrotli = this.brotli === undefined + if (this[UNZIP] === false && maybeBrotli) { + // read the first header to see if it's a valid tar file. If so, + // we can safely assume that it's not actually brotli, despite the + // .tbr or .tar.br file extension. + // if we ended before getting a full chunk, yes, def brotli + if (chunk.length < 512) { + if (this[ENDED]) { + this.brotli = true + } else { + this[BUFFER] = chunk + return true + } + } else { + // if it's tar, it's pretty reliably not brotli, chances of + // that happening are astronomical. + try { + new Header(chunk.slice(0, 512)) + this.brotli = false + } catch (_) { + this.brotli = true + } + } + } + + if (this[UNZIP] === null || (this[UNZIP] === false && this.brotli)) { + const ended = this[ENDED] + this[ENDED] = false + this[UNZIP] = this[UNZIP] === null + ? new zlib.Unzip() + : new zlib.BrotliDecompress() + this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk)) + this[UNZIP].on('error', er => this.abort(er)) + this[UNZIP].on('end', _ => { + this[ENDED] = true + this[CONSUMECHUNK]() + }) + this[WRITING] = true + const ret = this[UNZIP][ended ? 'end' : 'write'](chunk) + this[WRITING] = false + return ret + } + } + + this[WRITING] = true + if (this[UNZIP]) { + this[UNZIP].write(chunk) + } else { + this[CONSUMECHUNK](chunk) + } + this[WRITING] = false + + // return false if there's a queue, or if the current entry isn't flowing + const ret = + this[QUEUE].length ? false : + this[READENTRY] ? this[READENTRY].flowing : + true + + // if we have no queue, then that means a clogged READENTRY + if (!ret && !this[QUEUE].length) { + this[READENTRY].once('drain', _ => this.emit('drain')) + } + + return ret + } + + [BUFFERCONCAT] (c) { + if (c && !this[ABORTED]) { + this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c + } + } + + [MAYBEEND] () { + if (this[ENDED] && + !this[EMITTEDEND] && + !this[ABORTED] && + !this[CONSUMING]) { + this[EMITTEDEND] = true + const entry = this[WRITEENTRY] + if (entry && entry.blockRemain) { + // truncated, likely a damaged file + const have = this[BUFFER] ? this[BUFFER].length : 0 + this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${ + entry.blockRemain} more bytes, only ${have} available)`, { entry }) + if (this[BUFFER]) { + entry.write(this[BUFFER]) + } + entry.end() + } + this[EMIT](DONE) + } + } + + [CONSUMECHUNK] (chunk) { + if (this[CONSUMING]) { + this[BUFFERCONCAT](chunk) + } else if (!chunk && !this[BUFFER]) { + this[MAYBEEND]() + } else { + this[CONSUMING] = true + if (this[BUFFER]) { + this[BUFFERCONCAT](chunk) + const c = this[BUFFER] + this[BUFFER] = null + this[CONSUMECHUNKSUB](c) + } else { + this[CONSUMECHUNKSUB](chunk) + } + + while (this[BUFFER] && + this[BUFFER].length >= 512 && + !this[ABORTED] && + !this[SAW_EOF]) { + const c = this[BUFFER] + this[BUFFER] = null + this[CONSUMECHUNKSUB](c) + } + this[CONSUMING] = false + } + + if (!this[BUFFER] || this[ENDED]) { + this[MAYBEEND]() + } + } + + [CONSUMECHUNKSUB] (chunk) { + // we know that we are in CONSUMING mode, so anything written goes into + // the buffer. Advance the position and put any remainder in the buffer. + let position = 0 + const length = chunk.length + while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) { + switch (this[STATE]) { + case 'begin': + case 'header': + this[CONSUMEHEADER](chunk, position) + position += 512 + break + + case 'ignore': + case 'body': + position += this[CONSUMEBODY](chunk, position) + break + + case 'meta': + position += this[CONSUMEMETA](chunk, position) + break + + /* istanbul ignore next */ + default: + throw new Error('invalid state: ' + this[STATE]) + } + } + + if (position < length) { + if (this[BUFFER]) { + this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]]) + } else { + this[BUFFER] = chunk.slice(position) + } + } + } + + end (chunk) { + if (!this[ABORTED]) { + if (this[UNZIP]) { + this[UNZIP].end(chunk) + } else { + this[ENDED] = true + if (this.brotli === undefined) chunk = chunk || Buffer.alloc(0) + this.write(chunk) + } + } + } +}) diff --git a/node_modules/tar/lib/path-reservations.js b/node_modules/tar/lib/path-reservations.js new file mode 100644 index 00000000..8d349d58 --- /dev/null +++ b/node_modules/tar/lib/path-reservations.js @@ -0,0 +1,156 @@ +// A path exclusive reservation system +// reserve([list, of, paths], fn) +// When the fn is first in line for all its paths, it +// is called with a cb that clears the reservation. +// +// Used by async unpack to avoid clobbering paths in use, +// while still allowing maximal safe parallelization. + +const assert = require('assert') +const normalize = require('./normalize-unicode.js') +const stripSlashes = require('./strip-trailing-slashes.js') +const { join } = require('path') + +const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform +const isWindows = platform === 'win32' + +module.exports = () => { + // path => [function or Set] + // A Set object means a directory reservation + // A fn is a direct reservation on that path + const queues = new Map() + + // fn => {paths:[path,...], dirs:[path, ...]} + const reservations = new Map() + + // return a set of parent dirs for a given path + // '/a/b/c/d' -> ['/', '/a', '/a/b', '/a/b/c', '/a/b/c/d'] + const getDirs = path => { + const dirs = path.split('/').slice(0, -1).reduce((set, path) => { + if (set.length) { + path = join(set[set.length - 1], path) + } + set.push(path || '/') + return set + }, []) + return dirs + } + + // functions currently running + const running = new Set() + + // return the queues for each path the function cares about + // fn => {paths, dirs} + const getQueues = fn => { + const res = reservations.get(fn) + /* istanbul ignore if - unpossible */ + if (!res) { + throw new Error('function does not have any path reservations') + } + return { + paths: res.paths.map(path => queues.get(path)), + dirs: [...res.dirs].map(path => queues.get(path)), + } + } + + // check if fn is first in line for all its paths, and is + // included in the first set for all its dir queues + const check = fn => { + const { paths, dirs } = getQueues(fn) + return paths.every(q => q[0] === fn) && + dirs.every(q => q[0] instanceof Set && q[0].has(fn)) + } + + // run the function if it's first in line and not already running + const run = fn => { + if (running.has(fn) || !check(fn)) { + return false + } + running.add(fn) + fn(() => clear(fn)) + return true + } + + const clear = fn => { + if (!running.has(fn)) { + return false + } + + const { paths, dirs } = reservations.get(fn) + const next = new Set() + + paths.forEach(path => { + const q = queues.get(path) + assert.equal(q[0], fn) + if (q.length === 1) { + queues.delete(path) + } else { + q.shift() + if (typeof q[0] === 'function') { + next.add(q[0]) + } else { + q[0].forEach(fn => next.add(fn)) + } + } + }) + + dirs.forEach(dir => { + const q = queues.get(dir) + assert(q[0] instanceof Set) + if (q[0].size === 1 && q.length === 1) { + queues.delete(dir) + } else if (q[0].size === 1) { + q.shift() + + // must be a function or else the Set would've been reused + next.add(q[0]) + } else { + q[0].delete(fn) + } + }) + running.delete(fn) + + next.forEach(fn => run(fn)) + return true + } + + const reserve = (paths, fn) => { + // collide on matches across case and unicode normalization + // On windows, thanks to the magic of 8.3 shortnames, it is fundamentally + // impossible to determine whether two paths refer to the same thing on + // disk, without asking the kernel for a shortname. + // So, we just pretend that every path matches every other path here, + // effectively removing all parallelization on windows. + paths = isWindows ? ['win32 parallelization disabled'] : paths.map(p => { + // don't need normPath, because we skip this entirely for windows + return stripSlashes(join(normalize(p))).toLowerCase() + }) + + const dirs = new Set( + paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b)) + ) + reservations.set(fn, { dirs, paths }) + paths.forEach(path => { + const q = queues.get(path) + if (!q) { + queues.set(path, [fn]) + } else { + q.push(fn) + } + }) + dirs.forEach(dir => { + const q = queues.get(dir) + if (!q) { + queues.set(dir, [new Set([fn])]) + } else if (q[q.length - 1] instanceof Set) { + q[q.length - 1].add(fn) + } else { + q.push(new Set([fn])) + } + }) + + return run(fn) + } + + return { check, reserve } +} diff --git a/node_modules/tar/lib/pax.js b/node_modules/tar/lib/pax.js new file mode 100644 index 00000000..4a7ca853 --- /dev/null +++ b/node_modules/tar/lib/pax.js @@ -0,0 +1,150 @@ +'use strict' +const Header = require('./header.js') +const path = require('path') + +class Pax { + constructor (obj, global) { + this.atime = obj.atime || null + this.charset = obj.charset || null + this.comment = obj.comment || null + this.ctime = obj.ctime || null + this.gid = obj.gid || null + this.gname = obj.gname || null + this.linkpath = obj.linkpath || null + this.mtime = obj.mtime || null + this.path = obj.path || null + this.size = obj.size || null + this.uid = obj.uid || null + this.uname = obj.uname || null + this.dev = obj.dev || null + this.ino = obj.ino || null + this.nlink = obj.nlink || null + this.global = global || false + } + + encode () { + const body = this.encodeBody() + if (body === '') { + return null + } + + const bodyLen = Buffer.byteLength(body) + // round up to 512 bytes + // add 512 for header + const bufLen = 512 * Math.ceil(1 + bodyLen / 512) + const buf = Buffer.allocUnsafe(bufLen) + + // 0-fill the header section, it might not hit every field + for (let i = 0; i < 512; i++) { + buf[i] = 0 + } + + new Header({ + // XXX split the path + // then the path should be PaxHeader + basename, but less than 99, + // prepend with the dirname + path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99), + mode: this.mode || 0o644, + uid: this.uid || null, + gid: this.gid || null, + size: bodyLen, + mtime: this.mtime || null, + type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader', + linkpath: '', + uname: this.uname || '', + gname: this.gname || '', + devmaj: 0, + devmin: 0, + atime: this.atime || null, + ctime: this.ctime || null, + }).encode(buf) + + buf.write(body, 512, bodyLen, 'utf8') + + // null pad after the body + for (let i = bodyLen + 512; i < buf.length; i++) { + buf[i] = 0 + } + + return buf + } + + encodeBody () { + return ( + this.encodeField('path') + + this.encodeField('ctime') + + this.encodeField('atime') + + this.encodeField('dev') + + this.encodeField('ino') + + this.encodeField('nlink') + + this.encodeField('charset') + + this.encodeField('comment') + + this.encodeField('gid') + + this.encodeField('gname') + + this.encodeField('linkpath') + + this.encodeField('mtime') + + this.encodeField('size') + + this.encodeField('uid') + + this.encodeField('uname') + ) + } + + encodeField (field) { + if (this[field] === null || this[field] === undefined) { + return '' + } + const v = this[field] instanceof Date ? this[field].getTime() / 1000 + : this[field] + const s = ' ' + + (field === 'dev' || field === 'ino' || field === 'nlink' + ? 'SCHILY.' : '') + + field + '=' + v + '\n' + const byteLen = Buffer.byteLength(s) + // the digits includes the length of the digits in ascii base-10 + // so if it's 9 characters, then adding 1 for the 9 makes it 10 + // which makes it 11 chars. + let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1 + if (byteLen + digits >= Math.pow(10, digits)) { + digits += 1 + } + const len = digits + byteLen + return len + s + } +} + +Pax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g) + +const merge = (a, b) => + b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a + +const parseKV = string => + string + .replace(/\n$/, '') + .split('\n') + .reduce(parseKVLine, Object.create(null)) + +const parseKVLine = (set, line) => { + const n = parseInt(line, 10) + + // XXX Values with \n in them will fail this. + // Refactor to not be a naive line-by-line parse. + if (n !== Buffer.byteLength(line) + 1) { + return set + } + + line = line.slice((n + ' ').length) + const kv = line.split('=') + const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, '$1') + if (!k) { + return set + } + + const v = kv.join('=') + set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) + ? new Date(v * 1000) + : /^[0-9]+$/.test(v) ? +v + : v + return set +} + +module.exports = Pax diff --git a/node_modules/tar/lib/read-entry.js b/node_modules/tar/lib/read-entry.js new file mode 100644 index 00000000..6186266e --- /dev/null +++ b/node_modules/tar/lib/read-entry.js @@ -0,0 +1,107 @@ +'use strict' +const { Minipass } = require('minipass') +const normPath = require('./normalize-windows-path.js') + +const SLURP = Symbol('slurp') +module.exports = class ReadEntry extends Minipass { + constructor (header, ex, gex) { + super() + // read entries always start life paused. this is to avoid the + // situation where Minipass's auto-ending empty streams results + // in an entry ending before we're ready for it. + this.pause() + this.extended = ex + this.globalExtended = gex + this.header = header + this.startBlockSize = 512 * Math.ceil(header.size / 512) + this.blockRemain = this.startBlockSize + this.remain = header.size + this.type = header.type + this.meta = false + this.ignore = false + switch (this.type) { + case 'File': + case 'OldFile': + case 'Link': + case 'SymbolicLink': + case 'CharacterDevice': + case 'BlockDevice': + case 'Directory': + case 'FIFO': + case 'ContiguousFile': + case 'GNUDumpDir': + break + + case 'NextFileHasLongLinkpath': + case 'NextFileHasLongPath': + case 'OldGnuLongPath': + case 'GlobalExtendedHeader': + case 'ExtendedHeader': + case 'OldExtendedHeader': + this.meta = true + break + + // NOTE: gnutar and bsdtar treat unrecognized types as 'File' + // it may be worth doing the same, but with a warning. + default: + this.ignore = true + } + + this.path = normPath(header.path) + this.mode = header.mode + if (this.mode) { + this.mode = this.mode & 0o7777 + } + this.uid = header.uid + this.gid = header.gid + this.uname = header.uname + this.gname = header.gname + this.size = header.size + this.mtime = header.mtime + this.atime = header.atime + this.ctime = header.ctime + this.linkpath = normPath(header.linkpath) + this.uname = header.uname + this.gname = header.gname + + if (ex) { + this[SLURP](ex) + } + if (gex) { + this[SLURP](gex, true) + } + } + + write (data) { + const writeLen = data.length + if (writeLen > this.blockRemain) { + throw new Error('writing more to entry than is appropriate') + } + + const r = this.remain + const br = this.blockRemain + this.remain = Math.max(0, r - writeLen) + this.blockRemain = Math.max(0, br - writeLen) + if (this.ignore) { + return true + } + + if (r >= writeLen) { + return super.write(data) + } + + // r < writeLen + return super.write(data.slice(0, r)) + } + + [SLURP] (ex, global) { + for (const k in ex) { + // we slurp in everything except for the path attribute in + // a global extended header, because that's weird. + if (ex[k] !== null && ex[k] !== undefined && + !(global && k === 'path')) { + this[k] = k === 'path' || k === 'linkpath' ? normPath(ex[k]) : ex[k] + } + } + } +} diff --git a/node_modules/tar/lib/replace.js b/node_modules/tar/lib/replace.js new file mode 100644 index 00000000..8db6800b --- /dev/null +++ b/node_modules/tar/lib/replace.js @@ -0,0 +1,246 @@ +'use strict' + +// tar -r +const hlo = require('./high-level-opt.js') +const Pack = require('./pack.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const t = require('./list.js') +const path = require('path') + +// starting at the head of the file, read a Header +// If the checksum is invalid, that's our position to start writing +// If it is, jump forward by the specified size (round up to 512) +// and try again. +// Write the new Pack stream starting there. + +const Header = require('./header.js') + +module.exports = (opt_, files, cb) => { + const opt = hlo(opt_) + + if (!opt.file) { + throw new TypeError('file is required') + } + + if (opt.gzip || opt.brotli || opt.file.endsWith('.br') || opt.file.endsWith('.tbr')) { + throw new TypeError('cannot append to compressed archives') + } + + if (!files || !Array.isArray(files) || !files.length) { + throw new TypeError('no files or directories specified') + } + + files = Array.from(files) + + return opt.sync ? replaceSync(opt, files) + : replace(opt, files, cb) +} + +const replaceSync = (opt, files) => { + const p = new Pack.Sync(opt) + + let threw = true + let fd + let position + + try { + try { + fd = fs.openSync(opt.file, 'r+') + } catch (er) { + if (er.code === 'ENOENT') { + fd = fs.openSync(opt.file, 'w+') + } else { + throw er + } + } + + const st = fs.fstatSync(fd) + const headBuf = Buffer.alloc(512) + + POSITION: for (position = 0; position < st.size; position += 512) { + for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) { + bytes = fs.readSync( + fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos + ) + + if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) { + throw new Error('cannot append to compressed archives') + } + + if (!bytes) { + break POSITION + } + } + + const h = new Header(headBuf) + if (!h.cksumValid) { + break + } + const entryBlockSize = 512 * Math.ceil(h.size / 512) + if (position + entryBlockSize + 512 > st.size) { + break + } + // the 512 for the header we just parsed will be added as well + // also jump ahead all the blocks for the body + position += entryBlockSize + if (opt.mtimeCache) { + opt.mtimeCache.set(h.path, h.mtime) + } + } + threw = false + + streamSync(opt, p, position, fd, files) + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } + } +} + +const streamSync = (opt, p, position, fd, files) => { + const stream = new fsm.WriteStreamSync(opt.file, { + fd: fd, + start: position, + }) + p.pipe(stream) + addFilesSync(p, files) +} + +const replace = (opt, files, cb) => { + files = Array.from(files) + const p = new Pack(opt) + + const getPos = (fd, size, cb_) => { + const cb = (er, pos) => { + if (er) { + fs.close(fd, _ => cb_(er)) + } else { + cb_(null, pos) + } + } + + let position = 0 + if (size === 0) { + return cb(null, 0) + } + + let bufPos = 0 + const headBuf = Buffer.alloc(512) + const onread = (er, bytes) => { + if (er) { + return cb(er) + } + bufPos += bytes + if (bufPos < 512 && bytes) { + return fs.read( + fd, headBuf, bufPos, headBuf.length - bufPos, + position + bufPos, onread + ) + } + + if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) { + return cb(new Error('cannot append to compressed archives')) + } + + // truncated header + if (bufPos < 512) { + return cb(null, position) + } + + const h = new Header(headBuf) + if (!h.cksumValid) { + return cb(null, position) + } + + const entryBlockSize = 512 * Math.ceil(h.size / 512) + if (position + entryBlockSize + 512 > size) { + return cb(null, position) + } + + position += entryBlockSize + 512 + if (position >= size) { + return cb(null, position) + } + + if (opt.mtimeCache) { + opt.mtimeCache.set(h.path, h.mtime) + } + bufPos = 0 + fs.read(fd, headBuf, 0, 512, position, onread) + } + fs.read(fd, headBuf, 0, 512, position, onread) + } + + const promise = new Promise((resolve, reject) => { + p.on('error', reject) + let flag = 'r+' + const onopen = (er, fd) => { + if (er && er.code === 'ENOENT' && flag === 'r+') { + flag = 'w+' + return fs.open(opt.file, flag, onopen) + } + + if (er) { + return reject(er) + } + + fs.fstat(fd, (er, st) => { + if (er) { + return fs.close(fd, () => reject(er)) + } + + getPos(fd, st.size, (er, position) => { + if (er) { + return reject(er) + } + const stream = new fsm.WriteStream(opt.file, { + fd: fd, + start: position, + }) + p.pipe(stream) + stream.on('error', reject) + stream.on('close', resolve) + addFilesAsync(p, files) + }) + }) + } + fs.open(opt.file, flag, onopen) + }) + + return cb ? promise.then(cb, cb) : promise +} + +const addFilesSync = (p, files) => { + files.forEach(file => { + if (file.charAt(0) === '@') { + t({ + file: path.resolve(p.cwd, file.slice(1)), + sync: true, + noResume: true, + onentry: entry => p.add(entry), + }) + } else { + p.add(file) + } + }) + p.end() +} + +const addFilesAsync = (p, files) => { + while (files.length) { + const file = files.shift() + if (file.charAt(0) === '@') { + return t({ + file: path.resolve(p.cwd, file.slice(1)), + noResume: true, + onentry: entry => p.add(entry), + }).then(_ => addFilesAsync(p, files)) + } else { + p.add(file) + } + } + p.end() +} diff --git a/node_modules/tar/lib/strip-absolute-path.js b/node_modules/tar/lib/strip-absolute-path.js new file mode 100644 index 00000000..185e2dea --- /dev/null +++ b/node_modules/tar/lib/strip-absolute-path.js @@ -0,0 +1,24 @@ +// unix absolute paths are also absolute on win32, so we use this for both +const { isAbsolute, parse } = require('path').win32 + +// returns [root, stripped] +// Note that windows will think that //x/y/z/a has a "root" of //x/y, and in +// those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip / +// explicitly if it's the first character. +// drive-specific relative paths on Windows get their root stripped off even +// though they are not absolute, so `c:../foo` becomes ['c:', '../foo'] +module.exports = path => { + let r = '' + + let parsed = parse(path) + while (isAbsolute(path) || parsed.root) { + // windows will think that //x/y/z has a "root" of //x/y/ + // but strip the //?/C:/ off of //?/C:/path + const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ? '/' + : parsed.root + path = path.slice(root.length) + r += root + parsed = parse(path) + } + return [r, path] +} diff --git a/node_modules/tar/lib/strip-trailing-slashes.js b/node_modules/tar/lib/strip-trailing-slashes.js new file mode 100644 index 00000000..3e3ecec5 --- /dev/null +++ b/node_modules/tar/lib/strip-trailing-slashes.js @@ -0,0 +1,13 @@ +// warning: extremely hot code path. +// This has been meticulously optimized for use +// within npm install on large package trees. +// Do not edit without careful benchmarking. +module.exports = str => { + let i = str.length - 1 + let slashesStart = -1 + while (i > -1 && str.charAt(i) === '/') { + slashesStart = i + i-- + } + return slashesStart === -1 ? str : str.slice(0, slashesStart) +} diff --git a/node_modules/tar/lib/types.js b/node_modules/tar/lib/types.js new file mode 100644 index 00000000..7bfc2546 --- /dev/null +++ b/node_modules/tar/lib/types.js @@ -0,0 +1,44 @@ +'use strict' +// map types from key to human-friendly name +exports.name = new Map([ + ['0', 'File'], + // same as File + ['', 'OldFile'], + ['1', 'Link'], + ['2', 'SymbolicLink'], + // Devices and FIFOs aren't fully supported + // they are parsed, but skipped when unpacking + ['3', 'CharacterDevice'], + ['4', 'BlockDevice'], + ['5', 'Directory'], + ['6', 'FIFO'], + // same as File + ['7', 'ContiguousFile'], + // pax headers + ['g', 'GlobalExtendedHeader'], + ['x', 'ExtendedHeader'], + // vendor-specific stuff + // skip + ['A', 'SolarisACL'], + // like 5, but with data, which should be skipped + ['D', 'GNUDumpDir'], + // metadata only, skip + ['I', 'Inode'], + // data = link path of next file + ['K', 'NextFileHasLongLinkpath'], + // data = path of next file + ['L', 'NextFileHasLongPath'], + // skip + ['M', 'ContinuationFile'], + // like L + ['N', 'OldGnuLongPath'], + // skip + ['S', 'SparseFile'], + // skip + ['V', 'TapeVolumeHeader'], + // like x + ['X', 'OldExtendedHeader'], +]) + +// map the other direction +exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]])) diff --git a/node_modules/tar/lib/unpack.js b/node_modules/tar/lib/unpack.js new file mode 100644 index 00000000..fa46611c --- /dev/null +++ b/node_modules/tar/lib/unpack.js @@ -0,0 +1,906 @@ +'use strict' + +// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet. +// but the path reservations are required to avoid race conditions where +// parallelized unpack ops may mess with one another, due to dependencies +// (like a Link depending on its target) or destructive operations (like +// clobbering an fs object to create one of a different type.) + +const assert = require('assert') +const Parser = require('./parse.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const path = require('path') +const mkdir = require('./mkdir.js') +const wc = require('./winchars.js') +const pathReservations = require('./path-reservations.js') +const stripAbsolutePath = require('./strip-absolute-path.js') +const normPath = require('./normalize-windows-path.js') +const stripSlash = require('./strip-trailing-slashes.js') +const normalize = require('./normalize-unicode.js') + +const ONENTRY = Symbol('onEntry') +const CHECKFS = Symbol('checkFs') +const CHECKFS2 = Symbol('checkFs2') +const PRUNECACHE = Symbol('pruneCache') +const ISREUSABLE = Symbol('isReusable') +const MAKEFS = Symbol('makeFs') +const FILE = Symbol('file') +const DIRECTORY = Symbol('directory') +const LINK = Symbol('link') +const SYMLINK = Symbol('symlink') +const HARDLINK = Symbol('hardlink') +const UNSUPPORTED = Symbol('unsupported') +const CHECKPATH = Symbol('checkPath') +const MKDIR = Symbol('mkdir') +const ONERROR = Symbol('onError') +const PENDING = Symbol('pending') +const PEND = Symbol('pend') +const UNPEND = Symbol('unpend') +const ENDED = Symbol('ended') +const MAYBECLOSE = Symbol('maybeClose') +const SKIP = Symbol('skip') +const DOCHOWN = Symbol('doChown') +const UID = Symbol('uid') +const GID = Symbol('gid') +const CHECKED_CWD = Symbol('checkedCwd') +const crypto = require('crypto') +const getFlag = require('./get-write-flag.js') +const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform +const isWindows = platform === 'win32' + +// Unlinks on Windows are not atomic. +// +// This means that if you have a file entry, followed by another +// file entry with an identical name, and you cannot re-use the file +// (because it's a hardlink, or because unlink:true is set, or it's +// Windows, which does not have useful nlink values), then the unlink +// will be committed to the disk AFTER the new file has been written +// over the old one, deleting the new file. +// +// To work around this, on Windows systems, we rename the file and then +// delete the renamed file. It's a sloppy kludge, but frankly, I do not +// know of a better way to do this, given windows' non-atomic unlink +// semantics. +// +// See: https://github.com/npm/node-tar/issues/183 +/* istanbul ignore next */ +const unlinkFile = (path, cb) => { + if (!isWindows) { + return fs.unlink(path, cb) + } + + const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') + fs.rename(path, name, er => { + if (er) { + return cb(er) + } + fs.unlink(name, cb) + }) +} + +/* istanbul ignore next */ +const unlinkFileSync = path => { + if (!isWindows) { + return fs.unlinkSync(path) + } + + const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') + fs.renameSync(path, name) + fs.unlinkSync(name) +} + +// this.gid, entry.gid, this.processUid +const uint32 = (a, b, c) => + a === a >>> 0 ? a + : b === b >>> 0 ? b + : c + +// clear the cache if it's a case-insensitive unicode-squashing match. +// we can't know if the current file system is case-sensitive or supports +// unicode fully, so we check for similarity on the maximally compatible +// representation. Err on the side of pruning, since all it's doing is +// preventing lstats, and it's not the end of the world if we get a false +// positive. +// Note that on windows, we always drop the entire cache whenever a +// symbolic link is encountered, because 8.3 filenames are impossible +// to reason about, and collisions are hazards rather than just failures. +const cacheKeyNormalize = path => stripSlash(normPath(normalize(path))) + .toLowerCase() + +const pruneCache = (cache, abs) => { + abs = cacheKeyNormalize(abs) + for (const path of cache.keys()) { + const pnorm = cacheKeyNormalize(path) + if (pnorm === abs || pnorm.indexOf(abs + '/') === 0) { + cache.delete(path) + } + } +} + +const dropCache = cache => { + for (const key of cache.keys()) { + cache.delete(key) + } +} + +class Unpack extends Parser { + constructor (opt) { + if (!opt) { + opt = {} + } + + opt.ondone = _ => { + this[ENDED] = true + this[MAYBECLOSE]() + } + + super(opt) + + this[CHECKED_CWD] = false + + this.reservations = pathReservations() + + this.transform = typeof opt.transform === 'function' ? opt.transform : null + + this.writable = true + this.readable = false + + this[PENDING] = 0 + this[ENDED] = false + + this.dirCache = opt.dirCache || new Map() + + if (typeof opt.uid === 'number' || typeof opt.gid === 'number') { + // need both or neither + if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number') { + throw new TypeError('cannot set owner without number uid and gid') + } + if (opt.preserveOwner) { + throw new TypeError( + 'cannot preserve owner in archive and also set owner explicitly') + } + this.uid = opt.uid + this.gid = opt.gid + this.setOwner = true + } else { + this.uid = null + this.gid = null + this.setOwner = false + } + + // default true for root + if (opt.preserveOwner === undefined && typeof opt.uid !== 'number') { + this.preserveOwner = process.getuid && process.getuid() === 0 + } else { + this.preserveOwner = !!opt.preserveOwner + } + + this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? + process.getuid() : null + this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? + process.getgid() : null + + // mostly just for testing, but useful in some cases. + // Forcibly trigger a chown on every entry, no matter what + this.forceChown = opt.forceChown === true + + // turn > this[ONENTRY](entry)) + } + + // a bad or damaged archive is a warning for Parser, but an error + // when extracting. Mark those errors as unrecoverable, because + // the Unpack contract cannot be met. + warn (code, msg, data = {}) { + if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') { + data.recoverable = false + } + return super.warn(code, msg, data) + } + + [MAYBECLOSE] () { + if (this[ENDED] && this[PENDING] === 0) { + this.emit('prefinish') + this.emit('finish') + this.emit('end') + } + } + + [CHECKPATH] (entry) { + if (this.strip) { + const parts = normPath(entry.path).split('/') + if (parts.length < this.strip) { + return false + } + entry.path = parts.slice(this.strip).join('/') + + if (entry.type === 'Link') { + const linkparts = normPath(entry.linkpath).split('/') + if (linkparts.length >= this.strip) { + entry.linkpath = linkparts.slice(this.strip).join('/') + } else { + return false + } + } + } + + if (!this.preservePaths) { + const p = normPath(entry.path) + const parts = p.split('/') + if (parts.includes('..') || isWindows && /^[a-z]:\.\.$/i.test(parts[0])) { + this.warn('TAR_ENTRY_ERROR', `path contains '..'`, { + entry, + path: p, + }) + return false + } + + // strip off the root + const [root, stripped] = stripAbsolutePath(p) + if (root) { + entry.path = stripped + this.warn('TAR_ENTRY_INFO', `stripping ${root} from absolute path`, { + entry, + path: p, + }) + } + } + + if (path.isAbsolute(entry.path)) { + entry.absolute = normPath(path.resolve(entry.path)) + } else { + entry.absolute = normPath(path.resolve(this.cwd, entry.path)) + } + + // if we somehow ended up with a path that escapes the cwd, and we are + // not in preservePaths mode, then something is fishy! This should have + // been prevented above, so ignore this for coverage. + /* istanbul ignore if - defense in depth */ + if (!this.preservePaths && + entry.absolute.indexOf(this.cwd + '/') !== 0 && + entry.absolute !== this.cwd) { + this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', { + entry, + path: normPath(entry.path), + resolvedPath: entry.absolute, + cwd: this.cwd, + }) + return false + } + + // an archive can set properties on the extraction directory, but it + // may not replace the cwd with a different kind of thing entirely. + if (entry.absolute === this.cwd && + entry.type !== 'Directory' && + entry.type !== 'GNUDumpDir') { + return false + } + + // only encode : chars that aren't drive letter indicators + if (this.win32) { + const { root: aRoot } = path.win32.parse(entry.absolute) + entry.absolute = aRoot + wc.encode(entry.absolute.slice(aRoot.length)) + const { root: pRoot } = path.win32.parse(entry.path) + entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length)) + } + + return true + } + + [ONENTRY] (entry) { + if (!this[CHECKPATH](entry)) { + return entry.resume() + } + + assert.equal(typeof entry.absolute, 'string') + + switch (entry.type) { + case 'Directory': + case 'GNUDumpDir': + if (entry.mode) { + entry.mode = entry.mode | 0o700 + } + + // eslint-disable-next-line no-fallthrough + case 'File': + case 'OldFile': + case 'ContiguousFile': + case 'Link': + case 'SymbolicLink': + return this[CHECKFS](entry) + + case 'CharacterDevice': + case 'BlockDevice': + case 'FIFO': + default: + return this[UNSUPPORTED](entry) + } + } + + [ONERROR] (er, entry) { + // Cwd has to exist, or else nothing works. That's serious. + // Other errors are warnings, which raise the error in strict + // mode, but otherwise continue on. + if (er.name === 'CwdError') { + this.emit('error', er) + } else { + this.warn('TAR_ENTRY_ERROR', er, { entry }) + this[UNPEND]() + entry.resume() + } + } + + [MKDIR] (dir, mode, cb) { + mkdir(normPath(dir), { + uid: this.uid, + gid: this.gid, + processUid: this.processUid, + processGid: this.processGid, + umask: this.processUmask, + preserve: this.preservePaths, + unlink: this.unlink, + cache: this.dirCache, + cwd: this.cwd, + mode: mode, + noChmod: this.noChmod, + }, cb) + } + + [DOCHOWN] (entry) { + // in preserve owner mode, chown if the entry doesn't match process + // in set owner mode, chown if setting doesn't match process + return this.forceChown || + this.preserveOwner && + (typeof entry.uid === 'number' && entry.uid !== this.processUid || + typeof entry.gid === 'number' && entry.gid !== this.processGid) + || + (typeof this.uid === 'number' && this.uid !== this.processUid || + typeof this.gid === 'number' && this.gid !== this.processGid) + } + + [UID] (entry) { + return uint32(this.uid, entry.uid, this.processUid) + } + + [GID] (entry) { + return uint32(this.gid, entry.gid, this.processGid) + } + + [FILE] (entry, fullyDone) { + const mode = entry.mode & 0o7777 || this.fmode + const stream = new fsm.WriteStream(entry.absolute, { + flags: getFlag(entry.size), + mode: mode, + autoClose: false, + }) + stream.on('error', er => { + if (stream.fd) { + fs.close(stream.fd, () => {}) + } + + // flush all the data out so that we aren't left hanging + // if the error wasn't actually fatal. otherwise the parse + // is blocked, and we never proceed. + stream.write = () => true + this[ONERROR](er, entry) + fullyDone() + }) + + let actions = 1 + const done = er => { + if (er) { + /* istanbul ignore else - we should always have a fd by now */ + if (stream.fd) { + fs.close(stream.fd, () => {}) + } + + this[ONERROR](er, entry) + fullyDone() + return + } + + if (--actions === 0) { + fs.close(stream.fd, er => { + if (er) { + this[ONERROR](er, entry) + } else { + this[UNPEND]() + } + fullyDone() + }) + } + } + + stream.on('finish', _ => { + // if futimes fails, try utimes + // if utimes fails, fail with the original error + // same for fchown/chown + const abs = entry.absolute + const fd = stream.fd + + if (entry.mtime && !this.noMtime) { + actions++ + const atime = entry.atime || new Date() + const mtime = entry.mtime + fs.futimes(fd, atime, mtime, er => + er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er)) + : done()) + } + + if (this[DOCHOWN](entry)) { + actions++ + const uid = this[UID](entry) + const gid = this[GID](entry) + fs.fchown(fd, uid, gid, er => + er ? fs.chown(abs, uid, gid, er2 => done(er2 && er)) + : done()) + } + + done() + }) + + const tx = this.transform ? this.transform(entry) || entry : entry + if (tx !== entry) { + tx.on('error', er => { + this[ONERROR](er, entry) + fullyDone() + }) + entry.pipe(tx) + } + tx.pipe(stream) + } + + [DIRECTORY] (entry, fullyDone) { + const mode = entry.mode & 0o7777 || this.dmode + this[MKDIR](entry.absolute, mode, er => { + if (er) { + this[ONERROR](er, entry) + fullyDone() + return + } + + let actions = 1 + const done = _ => { + if (--actions === 0) { + fullyDone() + this[UNPEND]() + entry.resume() + } + } + + if (entry.mtime && !this.noMtime) { + actions++ + fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done) + } + + if (this[DOCHOWN](entry)) { + actions++ + fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done) + } + + done() + }) + } + + [UNSUPPORTED] (entry) { + entry.unsupported = true + this.warn('TAR_ENTRY_UNSUPPORTED', + `unsupported entry type: ${entry.type}`, { entry }) + entry.resume() + } + + [SYMLINK] (entry, done) { + this[LINK](entry, entry.linkpath, 'symlink', done) + } + + [HARDLINK] (entry, done) { + const linkpath = normPath(path.resolve(this.cwd, entry.linkpath)) + this[LINK](entry, linkpath, 'link', done) + } + + [PEND] () { + this[PENDING]++ + } + + [UNPEND] () { + this[PENDING]-- + this[MAYBECLOSE]() + } + + [SKIP] (entry) { + this[UNPEND]() + entry.resume() + } + + // Check if we can reuse an existing filesystem entry safely and + // overwrite it, rather than unlinking and recreating + // Windows doesn't report a useful nlink, so we just never reuse entries + [ISREUSABLE] (entry, st) { + return entry.type === 'File' && + !this.unlink && + st.isFile() && + st.nlink <= 1 && + !isWindows + } + + // check if a thing is there, and if so, try to clobber it + [CHECKFS] (entry) { + this[PEND]() + const paths = [entry.path] + if (entry.linkpath) { + paths.push(entry.linkpath) + } + this.reservations.reserve(paths, done => this[CHECKFS2](entry, done)) + } + + [PRUNECACHE] (entry) { + // if we are not creating a directory, and the path is in the dirCache, + // then that means we are about to delete the directory we created + // previously, and it is no longer going to be a directory, and neither + // is any of its children. + // If a symbolic link is encountered, all bets are off. There is no + // reasonable way to sanitize the cache in such a way we will be able to + // avoid having filesystem collisions. If this happens with a non-symlink + // entry, it'll just fail to unpack, but a symlink to a directory, using an + // 8.3 shortname or certain unicode attacks, can evade detection and lead + // to arbitrary writes to anywhere on the system. + if (entry.type === 'SymbolicLink') { + dropCache(this.dirCache) + } else if (entry.type !== 'Directory') { + pruneCache(this.dirCache, entry.absolute) + } + } + + [CHECKFS2] (entry, fullyDone) { + this[PRUNECACHE](entry) + + const done = er => { + this[PRUNECACHE](entry) + fullyDone(er) + } + + const checkCwd = () => { + this[MKDIR](this.cwd, this.dmode, er => { + if (er) { + this[ONERROR](er, entry) + done() + return + } + this[CHECKED_CWD] = true + start() + }) + } + + const start = () => { + if (entry.absolute !== this.cwd) { + const parent = normPath(path.dirname(entry.absolute)) + if (parent !== this.cwd) { + return this[MKDIR](parent, this.dmode, er => { + if (er) { + this[ONERROR](er, entry) + done() + return + } + afterMakeParent() + }) + } + } + afterMakeParent() + } + + const afterMakeParent = () => { + fs.lstat(entry.absolute, (lstatEr, st) => { + if (st && (this.keep || this.newer && st.mtime > entry.mtime)) { + this[SKIP](entry) + done() + return + } + if (lstatEr || this[ISREUSABLE](entry, st)) { + return this[MAKEFS](null, entry, done) + } + + if (st.isDirectory()) { + if (entry.type === 'Directory') { + const needChmod = !this.noChmod && + entry.mode && + (st.mode & 0o7777) !== entry.mode + const afterChmod = er => this[MAKEFS](er, entry, done) + if (!needChmod) { + return afterChmod() + } + return fs.chmod(entry.absolute, entry.mode, afterChmod) + } + // Not a dir entry, have to remove it. + // NB: the only way to end up with an entry that is the cwd + // itself, in such a way that == does not detect, is a + // tricky windows absolute path with UNC or 8.3 parts (and + // preservePaths:true, or else it will have been stripped). + // In that case, the user has opted out of path protections + // explicitly, so if they blow away the cwd, c'est la vie. + if (entry.absolute !== this.cwd) { + return fs.rmdir(entry.absolute, er => + this[MAKEFS](er, entry, done)) + } + } + + // not a dir, and not reusable + // don't remove if the cwd, we want that error + if (entry.absolute === this.cwd) { + return this[MAKEFS](null, entry, done) + } + + unlinkFile(entry.absolute, er => + this[MAKEFS](er, entry, done)) + }) + } + + if (this[CHECKED_CWD]) { + start() + } else { + checkCwd() + } + } + + [MAKEFS] (er, entry, done) { + if (er) { + this[ONERROR](er, entry) + done() + return + } + + switch (entry.type) { + case 'File': + case 'OldFile': + case 'ContiguousFile': + return this[FILE](entry, done) + + case 'Link': + return this[HARDLINK](entry, done) + + case 'SymbolicLink': + return this[SYMLINK](entry, done) + + case 'Directory': + case 'GNUDumpDir': + return this[DIRECTORY](entry, done) + } + } + + [LINK] (entry, linkpath, link, done) { + // XXX: get the type ('symlink' or 'junction') for windows + fs[link](linkpath, entry.absolute, er => { + if (er) { + this[ONERROR](er, entry) + } else { + this[UNPEND]() + entry.resume() + } + done() + }) + } +} + +const callSync = fn => { + try { + return [null, fn()] + } catch (er) { + return [er, null] + } +} +class UnpackSync extends Unpack { + [MAKEFS] (er, entry) { + return super[MAKEFS](er, entry, () => {}) + } + + [CHECKFS] (entry) { + this[PRUNECACHE](entry) + + if (!this[CHECKED_CWD]) { + const er = this[MKDIR](this.cwd, this.dmode) + if (er) { + return this[ONERROR](er, entry) + } + this[CHECKED_CWD] = true + } + + // don't bother to make the parent if the current entry is the cwd, + // we've already checked it. + if (entry.absolute !== this.cwd) { + const parent = normPath(path.dirname(entry.absolute)) + if (parent !== this.cwd) { + const mkParent = this[MKDIR](parent, this.dmode) + if (mkParent) { + return this[ONERROR](mkParent, entry) + } + } + } + + const [lstatEr, st] = callSync(() => fs.lstatSync(entry.absolute)) + if (st && (this.keep || this.newer && st.mtime > entry.mtime)) { + return this[SKIP](entry) + } + + if (lstatEr || this[ISREUSABLE](entry, st)) { + return this[MAKEFS](null, entry) + } + + if (st.isDirectory()) { + if (entry.type === 'Directory') { + const needChmod = !this.noChmod && + entry.mode && + (st.mode & 0o7777) !== entry.mode + const [er] = needChmod ? callSync(() => { + fs.chmodSync(entry.absolute, entry.mode) + }) : [] + return this[MAKEFS](er, entry) + } + // not a dir entry, have to remove it + const [er] = callSync(() => fs.rmdirSync(entry.absolute)) + this[MAKEFS](er, entry) + } + + // not a dir, and not reusable. + // don't remove if it's the cwd, since we want that error. + const [er] = entry.absolute === this.cwd ? [] + : callSync(() => unlinkFileSync(entry.absolute)) + this[MAKEFS](er, entry) + } + + [FILE] (entry, done) { + const mode = entry.mode & 0o7777 || this.fmode + + const oner = er => { + let closeError + try { + fs.closeSync(fd) + } catch (e) { + closeError = e + } + if (er || closeError) { + this[ONERROR](er || closeError, entry) + } + done() + } + + let fd + try { + fd = fs.openSync(entry.absolute, getFlag(entry.size), mode) + } catch (er) { + return oner(er) + } + const tx = this.transform ? this.transform(entry) || entry : entry + if (tx !== entry) { + tx.on('error', er => this[ONERROR](er, entry)) + entry.pipe(tx) + } + + tx.on('data', chunk => { + try { + fs.writeSync(fd, chunk, 0, chunk.length) + } catch (er) { + oner(er) + } + }) + + tx.on('end', _ => { + let er = null + // try both, falling futimes back to utimes + // if either fails, handle the first error + if (entry.mtime && !this.noMtime) { + const atime = entry.atime || new Date() + const mtime = entry.mtime + try { + fs.futimesSync(fd, atime, mtime) + } catch (futimeser) { + try { + fs.utimesSync(entry.absolute, atime, mtime) + } catch (utimeser) { + er = futimeser + } + } + } + + if (this[DOCHOWN](entry)) { + const uid = this[UID](entry) + const gid = this[GID](entry) + + try { + fs.fchownSync(fd, uid, gid) + } catch (fchowner) { + try { + fs.chownSync(entry.absolute, uid, gid) + } catch (chowner) { + er = er || fchowner + } + } + } + + oner(er) + }) + } + + [DIRECTORY] (entry, done) { + const mode = entry.mode & 0o7777 || this.dmode + const er = this[MKDIR](entry.absolute, mode) + if (er) { + this[ONERROR](er, entry) + done() + return + } + if (entry.mtime && !this.noMtime) { + try { + fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime) + } catch (er) {} + } + if (this[DOCHOWN](entry)) { + try { + fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry)) + } catch (er) {} + } + done() + entry.resume() + } + + [MKDIR] (dir, mode) { + try { + return mkdir.sync(normPath(dir), { + uid: this.uid, + gid: this.gid, + processUid: this.processUid, + processGid: this.processGid, + umask: this.processUmask, + preserve: this.preservePaths, + unlink: this.unlink, + cache: this.dirCache, + cwd: this.cwd, + mode: mode, + }) + } catch (er) { + return er + } + } + + [LINK] (entry, linkpath, link, done) { + try { + fs[link + 'Sync'](linkpath, entry.absolute) + done() + entry.resume() + } catch (er) { + return this[ONERROR](er, entry) + } + } +} + +Unpack.Sync = UnpackSync +module.exports = Unpack diff --git a/node_modules/tar/lib/update.js b/node_modules/tar/lib/update.js new file mode 100644 index 00000000..4d328543 --- /dev/null +++ b/node_modules/tar/lib/update.js @@ -0,0 +1,40 @@ +'use strict' + +// tar -u + +const hlo = require('./high-level-opt.js') +const r = require('./replace.js') +// just call tar.r with the filter and mtimeCache + +module.exports = (opt_, files, cb) => { + const opt = hlo(opt_) + + if (!opt.file) { + throw new TypeError('file is required') + } + + if (opt.gzip || opt.brotli || opt.file.endsWith('.br') || opt.file.endsWith('.tbr')) { + throw new TypeError('cannot append to compressed archives') + } + + if (!files || !Array.isArray(files) || !files.length) { + throw new TypeError('no files or directories specified') + } + + files = Array.from(files) + + mtimeFilter(opt) + return r(opt, files, cb) +} + +const mtimeFilter = opt => { + const filter = opt.filter + + if (!opt.mtimeCache) { + opt.mtimeCache = new Map() + } + + opt.filter = filter ? (path, stat) => + filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime) + : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime) +} diff --git a/node_modules/tar/lib/warn-mixin.js b/node_modules/tar/lib/warn-mixin.js new file mode 100644 index 00000000..a9406396 --- /dev/null +++ b/node_modules/tar/lib/warn-mixin.js @@ -0,0 +1,24 @@ +'use strict' +module.exports = Base => class extends Base { + warn (code, message, data = {}) { + if (this.file) { + data.file = this.file + } + if (this.cwd) { + data.cwd = this.cwd + } + data.code = message instanceof Error && message.code || code + data.tarCode = code + if (!this.strict && data.recoverable !== false) { + if (message instanceof Error) { + data = Object.assign(message, data) + message = message.message + } + this.emit('warn', data.tarCode, message, data) + } else if (message instanceof Error) { + this.emit('error', Object.assign(message, data)) + } else { + this.emit('error', Object.assign(new Error(`${code}: ${message}`), data)) + } + } +} diff --git a/node_modules/tar/lib/winchars.js b/node_modules/tar/lib/winchars.js new file mode 100644 index 00000000..ebcab4ae --- /dev/null +++ b/node_modules/tar/lib/winchars.js @@ -0,0 +1,23 @@ +'use strict' + +// When writing files on Windows, translate the characters to their +// 0xf000 higher-encoded versions. + +const raw = [ + '|', + '<', + '>', + '?', + ':', +] + +const win = raw.map(char => + String.fromCharCode(0xf000 + char.charCodeAt(0))) + +const toWin = new Map(raw.map((char, i) => [char, win[i]])) +const toRaw = new Map(win.map((char, i) => [char, raw[i]])) + +module.exports = { + encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s), + decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s), +} diff --git a/node_modules/tar/lib/write-entry.js b/node_modules/tar/lib/write-entry.js new file mode 100644 index 00000000..7d2f3eb1 --- /dev/null +++ b/node_modules/tar/lib/write-entry.js @@ -0,0 +1,546 @@ +'use strict' +const { Minipass } = require('minipass') +const Pax = require('./pax.js') +const Header = require('./header.js') +const fs = require('fs') +const path = require('path') +const normPath = require('./normalize-windows-path.js') +const stripSlash = require('./strip-trailing-slashes.js') + +const prefixPath = (path, prefix) => { + if (!prefix) { + return normPath(path) + } + path = normPath(path).replace(/^\.(\/|$)/, '') + return stripSlash(prefix) + '/' + path +} + +const maxReadSize = 16 * 1024 * 1024 +const PROCESS = Symbol('process') +const FILE = Symbol('file') +const DIRECTORY = Symbol('directory') +const SYMLINK = Symbol('symlink') +const HARDLINK = Symbol('hardlink') +const HEADER = Symbol('header') +const READ = Symbol('read') +const LSTAT = Symbol('lstat') +const ONLSTAT = Symbol('onlstat') +const ONREAD = Symbol('onread') +const ONREADLINK = Symbol('onreadlink') +const OPENFILE = Symbol('openfile') +const ONOPENFILE = Symbol('onopenfile') +const CLOSE = Symbol('close') +const MODE = Symbol('mode') +const AWAITDRAIN = Symbol('awaitDrain') +const ONDRAIN = Symbol('ondrain') +const PREFIX = Symbol('prefix') +const HAD_ERROR = Symbol('hadError') +const warner = require('./warn-mixin.js') +const winchars = require('./winchars.js') +const stripAbsolutePath = require('./strip-absolute-path.js') + +const modeFix = require('./mode-fix.js') + +const WriteEntry = warner(class WriteEntry extends Minipass { + constructor (p, opt) { + opt = opt || {} + super(opt) + if (typeof p !== 'string') { + throw new TypeError('path is required') + } + this.path = normPath(p) + // suppress atime, ctime, uid, gid, uname, gname + this.portable = !!opt.portable + // until node has builtin pwnam functions, this'll have to do + this.myuid = process.getuid && process.getuid() || 0 + this.myuser = process.env.USER || '' + this.maxReadSize = opt.maxReadSize || maxReadSize + this.linkCache = opt.linkCache || new Map() + this.statCache = opt.statCache || new Map() + this.preservePaths = !!opt.preservePaths + this.cwd = normPath(opt.cwd || process.cwd()) + this.strict = !!opt.strict + this.noPax = !!opt.noPax + this.noMtime = !!opt.noMtime + this.mtime = opt.mtime || null + this.prefix = opt.prefix ? normPath(opt.prefix) : null + + this.fd = null + this.blockLen = null + this.blockRemain = null + this.buf = null + this.offset = null + this.length = null + this.pos = null + this.remain = null + + if (typeof opt.onwarn === 'function') { + this.on('warn', opt.onwarn) + } + + let pathWarn = false + if (!this.preservePaths) { + const [root, stripped] = stripAbsolutePath(this.path) + if (root) { + this.path = stripped + pathWarn = root + } + } + + this.win32 = !!opt.win32 || process.platform === 'win32' + if (this.win32) { + // force the \ to / normalization, since we might not *actually* + // be on windows, but want \ to be considered a path separator. + this.path = winchars.decode(this.path.replace(/\\/g, '/')) + p = p.replace(/\\/g, '/') + } + + this.absolute = normPath(opt.absolute || path.resolve(this.cwd, p)) + + if (this.path === '') { + this.path = './' + } + + if (pathWarn) { + this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { + entry: this, + path: pathWarn + this.path, + }) + } + + if (this.statCache.has(this.absolute)) { + this[ONLSTAT](this.statCache.get(this.absolute)) + } else { + this[LSTAT]() + } + } + + emit (ev, ...data) { + if (ev === 'error') { + this[HAD_ERROR] = true + } + return super.emit(ev, ...data) + } + + [LSTAT] () { + fs.lstat(this.absolute, (er, stat) => { + if (er) { + return this.emit('error', er) + } + this[ONLSTAT](stat) + }) + } + + [ONLSTAT] (stat) { + this.statCache.set(this.absolute, stat) + this.stat = stat + if (!stat.isFile()) { + stat.size = 0 + } + this.type = getType(stat) + this.emit('stat', stat) + this[PROCESS]() + } + + [PROCESS] () { + switch (this.type) { + case 'File': return this[FILE]() + case 'Directory': return this[DIRECTORY]() + case 'SymbolicLink': return this[SYMLINK]() + // unsupported types are ignored. + default: return this.end() + } + } + + [MODE] (mode) { + return modeFix(mode, this.type === 'Directory', this.portable) + } + + [PREFIX] (path) { + return prefixPath(path, this.prefix) + } + + [HEADER] () { + if (this.type === 'Directory' && this.portable) { + this.noMtime = true + } + + this.header = new Header({ + path: this[PREFIX](this.path), + // only apply the prefix to hard links. + linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath) + : this.linkpath, + // only the permissions and setuid/setgid/sticky bitflags + // not the higher-order bits that specify file type + mode: this[MODE](this.stat.mode), + uid: this.portable ? null : this.stat.uid, + gid: this.portable ? null : this.stat.gid, + size: this.stat.size, + mtime: this.noMtime ? null : this.mtime || this.stat.mtime, + type: this.type, + uname: this.portable ? null : + this.stat.uid === this.myuid ? this.myuser : '', + atime: this.portable ? null : this.stat.atime, + ctime: this.portable ? null : this.stat.ctime, + }) + + if (this.header.encode() && !this.noPax) { + super.write(new Pax({ + atime: this.portable ? null : this.header.atime, + ctime: this.portable ? null : this.header.ctime, + gid: this.portable ? null : this.header.gid, + mtime: this.noMtime ? null : this.mtime || this.header.mtime, + path: this[PREFIX](this.path), + linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath) + : this.linkpath, + size: this.header.size, + uid: this.portable ? null : this.header.uid, + uname: this.portable ? null : this.header.uname, + dev: this.portable ? null : this.stat.dev, + ino: this.portable ? null : this.stat.ino, + nlink: this.portable ? null : this.stat.nlink, + }).encode()) + } + super.write(this.header.block) + } + + [DIRECTORY] () { + if (this.path.slice(-1) !== '/') { + this.path += '/' + } + this.stat.size = 0 + this[HEADER]() + this.end() + } + + [SYMLINK] () { + fs.readlink(this.absolute, (er, linkpath) => { + if (er) { + return this.emit('error', er) + } + this[ONREADLINK](linkpath) + }) + } + + [ONREADLINK] (linkpath) { + this.linkpath = normPath(linkpath) + this[HEADER]() + this.end() + } + + [HARDLINK] (linkpath) { + this.type = 'Link' + this.linkpath = normPath(path.relative(this.cwd, linkpath)) + this.stat.size = 0 + this[HEADER]() + this.end() + } + + [FILE] () { + if (this.stat.nlink > 1) { + const linkKey = this.stat.dev + ':' + this.stat.ino + if (this.linkCache.has(linkKey)) { + const linkpath = this.linkCache.get(linkKey) + if (linkpath.indexOf(this.cwd) === 0) { + return this[HARDLINK](linkpath) + } + } + this.linkCache.set(linkKey, this.absolute) + } + + this[HEADER]() + if (this.stat.size === 0) { + return this.end() + } + + this[OPENFILE]() + } + + [OPENFILE] () { + fs.open(this.absolute, 'r', (er, fd) => { + if (er) { + return this.emit('error', er) + } + this[ONOPENFILE](fd) + }) + } + + [ONOPENFILE] (fd) { + this.fd = fd + if (this[HAD_ERROR]) { + return this[CLOSE]() + } + + this.blockLen = 512 * Math.ceil(this.stat.size / 512) + this.blockRemain = this.blockLen + const bufLen = Math.min(this.blockLen, this.maxReadSize) + this.buf = Buffer.allocUnsafe(bufLen) + this.offset = 0 + this.pos = 0 + this.remain = this.stat.size + this.length = this.buf.length + this[READ]() + } + + [READ] () { + const { fd, buf, offset, length, pos } = this + fs.read(fd, buf, offset, length, pos, (er, bytesRead) => { + if (er) { + // ignoring the error from close(2) is a bad practice, but at + // this point we already have an error, don't need another one + return this[CLOSE](() => this.emit('error', er)) + } + this[ONREAD](bytesRead) + }) + } + + [CLOSE] (cb) { + fs.close(this.fd, cb) + } + + [ONREAD] (bytesRead) { + if (bytesRead <= 0 && this.remain > 0) { + const er = new Error('encountered unexpected EOF') + er.path = this.absolute + er.syscall = 'read' + er.code = 'EOF' + return this[CLOSE](() => this.emit('error', er)) + } + + if (bytesRead > this.remain) { + const er = new Error('did not encounter expected EOF') + er.path = this.absolute + er.syscall = 'read' + er.code = 'EOF' + return this[CLOSE](() => this.emit('error', er)) + } + + // null out the rest of the buffer, if we could fit the block padding + // at the end of this loop, we've incremented bytesRead and this.remain + // to be incremented up to the blockRemain level, as if we had expected + // to get a null-padded file, and read it until the end. then we will + // decrement both remain and blockRemain by bytesRead, and know that we + // reached the expected EOF, without any null buffer to append. + if (bytesRead === this.remain) { + for (let i = bytesRead; i < this.length && bytesRead < this.blockRemain; i++) { + this.buf[i + this.offset] = 0 + bytesRead++ + this.remain++ + } + } + + const writeBuf = this.offset === 0 && bytesRead === this.buf.length ? + this.buf : this.buf.slice(this.offset, this.offset + bytesRead) + + const flushed = this.write(writeBuf) + if (!flushed) { + this[AWAITDRAIN](() => this[ONDRAIN]()) + } else { + this[ONDRAIN]() + } + } + + [AWAITDRAIN] (cb) { + this.once('drain', cb) + } + + write (writeBuf) { + if (this.blockRemain < writeBuf.length) { + const er = new Error('writing more data than expected') + er.path = this.absolute + return this.emit('error', er) + } + this.remain -= writeBuf.length + this.blockRemain -= writeBuf.length + this.pos += writeBuf.length + this.offset += writeBuf.length + return super.write(writeBuf) + } + + [ONDRAIN] () { + if (!this.remain) { + if (this.blockRemain) { + super.write(Buffer.alloc(this.blockRemain)) + } + return this[CLOSE](er => er ? this.emit('error', er) : this.end()) + } + + if (this.offset >= this.length) { + // if we only have a smaller bit left to read, alloc a smaller buffer + // otherwise, keep it the same length it was before. + this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)) + this.offset = 0 + } + this.length = this.buf.length - this.offset + this[READ]() + } +}) + +class WriteEntrySync extends WriteEntry { + [LSTAT] () { + this[ONLSTAT](fs.lstatSync(this.absolute)) + } + + [SYMLINK] () { + this[ONREADLINK](fs.readlinkSync(this.absolute)) + } + + [OPENFILE] () { + this[ONOPENFILE](fs.openSync(this.absolute, 'r')) + } + + [READ] () { + let threw = true + try { + const { fd, buf, offset, length, pos } = this + const bytesRead = fs.readSync(fd, buf, offset, length, pos) + this[ONREAD](bytesRead) + threw = false + } finally { + // ignoring the error from close(2) is a bad practice, but at + // this point we already have an error, don't need another one + if (threw) { + try { + this[CLOSE](() => {}) + } catch (er) {} + } + } + } + + [AWAITDRAIN] (cb) { + cb() + } + + [CLOSE] (cb) { + fs.closeSync(this.fd) + cb() + } +} + +const WriteEntryTar = warner(class WriteEntryTar extends Minipass { + constructor (readEntry, opt) { + opt = opt || {} + super(opt) + this.preservePaths = !!opt.preservePaths + this.portable = !!opt.portable + this.strict = !!opt.strict + this.noPax = !!opt.noPax + this.noMtime = !!opt.noMtime + + this.readEntry = readEntry + this.type = readEntry.type + if (this.type === 'Directory' && this.portable) { + this.noMtime = true + } + + this.prefix = opt.prefix || null + + this.path = normPath(readEntry.path) + this.mode = this[MODE](readEntry.mode) + this.uid = this.portable ? null : readEntry.uid + this.gid = this.portable ? null : readEntry.gid + this.uname = this.portable ? null : readEntry.uname + this.gname = this.portable ? null : readEntry.gname + this.size = readEntry.size + this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime + this.atime = this.portable ? null : readEntry.atime + this.ctime = this.portable ? null : readEntry.ctime + this.linkpath = normPath(readEntry.linkpath) + + if (typeof opt.onwarn === 'function') { + this.on('warn', opt.onwarn) + } + + let pathWarn = false + if (!this.preservePaths) { + const [root, stripped] = stripAbsolutePath(this.path) + if (root) { + this.path = stripped + pathWarn = root + } + } + + this.remain = readEntry.size + this.blockRemain = readEntry.startBlockSize + + this.header = new Header({ + path: this[PREFIX](this.path), + linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath) + : this.linkpath, + // only the permissions and setuid/setgid/sticky bitflags + // not the higher-order bits that specify file type + mode: this.mode, + uid: this.portable ? null : this.uid, + gid: this.portable ? null : this.gid, + size: this.size, + mtime: this.noMtime ? null : this.mtime, + type: this.type, + uname: this.portable ? null : this.uname, + atime: this.portable ? null : this.atime, + ctime: this.portable ? null : this.ctime, + }) + + if (pathWarn) { + this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { + entry: this, + path: pathWarn + this.path, + }) + } + + if (this.header.encode() && !this.noPax) { + super.write(new Pax({ + atime: this.portable ? null : this.atime, + ctime: this.portable ? null : this.ctime, + gid: this.portable ? null : this.gid, + mtime: this.noMtime ? null : this.mtime, + path: this[PREFIX](this.path), + linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath) + : this.linkpath, + size: this.size, + uid: this.portable ? null : this.uid, + uname: this.portable ? null : this.uname, + dev: this.portable ? null : this.readEntry.dev, + ino: this.portable ? null : this.readEntry.ino, + nlink: this.portable ? null : this.readEntry.nlink, + }).encode()) + } + + super.write(this.header.block) + readEntry.pipe(this) + } + + [PREFIX] (path) { + return prefixPath(path, this.prefix) + } + + [MODE] (mode) { + return modeFix(mode, this.type === 'Directory', this.portable) + } + + write (data) { + const writeLen = data.length + if (writeLen > this.blockRemain) { + throw new Error('writing more to entry than is appropriate') + } + this.blockRemain -= writeLen + return super.write(data) + } + + end () { + if (this.blockRemain) { + super.write(Buffer.alloc(this.blockRemain)) + } + return super.end() + } +}) + +WriteEntry.Sync = WriteEntrySync +WriteEntry.Tar = WriteEntryTar + +const getType = stat => + stat.isFile() ? 'File' + : stat.isDirectory() ? 'Directory' + : stat.isSymbolicLink() ? 'SymbolicLink' + : 'Unsupported' + +module.exports = WriteEntry diff --git a/node_modules/tar/package.json b/node_modules/tar/package.json new file mode 100644 index 00000000..46d91ee1 --- /dev/null +++ b/node_modules/tar/package.json @@ -0,0 +1,70 @@ +{ + "author": "GitHub Inc.", + "name": "tar", + "description": "tar for node", + "version": "6.2.0", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-tar.git" + }, + "scripts": { + "genparse": "node scripts/generate-parse-fixtures.js", + "snap": "tap", + "test": "tap" + }, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^4.0.0", + "@npmcli/template-oss": "4.11.0", + "chmodr": "^1.2.0", + "end-of-stream": "^1.4.3", + "events-to-array": "^2.0.3", + "mutate-fs": "^2.1.1", + "nock": "^13.2.9", + "rimraf": "^3.0.2", + "tap": "^16.0.1" + }, + "license": "ISC", + "engines": { + "node": ">=10" + }, + "files": [ + "bin/", + "lib/", + "index.js" + ], + "tap": { + "coverage-map": "map.js", + "timeout": 0, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.11.0", + "content": "scripts/template-oss", + "engines": ">=10", + "distPaths": [ + "index.js" + ], + "allowPaths": [ + "/index.js" + ], + "ciVersions": [ + "10.x", + "12.x", + "14.x", + "16.x", + "18.x" + ] + } +} diff --git a/node_modules/twilio/LICENSE b/node_modules/twilio/LICENSE new file mode 100644 index 00000000..6485c1f8 --- /dev/null +++ b/node_modules/twilio/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (C) 2023, Twilio, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/twilio/README.md b/node_modules/twilio/README.md new file mode 100644 index 00000000..3177afe3 --- /dev/null +++ b/node_modules/twilio/README.md @@ -0,0 +1,305 @@ +# twilio-node + +[![][test-workflow-image]][test-workflow-url] +[![][npm-version-image]][npm-url] +[![][npm-install-size-image]][npm-install-size-url] +[![][npm-downloads-image]][npm-downloads-url] + +## Documentation + +The documentation for the Twilio API can be found [here][apidocs]. + +The Node library documentation can be found [here][libdocs]. + +## Versions + +`twilio-node` uses a modified version of [Semantic Versioning](https://semver.org) for all changes. [See this document](VERSIONS.md) for details. + +### Supported Node.js Versions + +This library supports the following Node.js implementations: + +- Node.js 14 +- Node.js 16 +- Node.js 18 + +TypeScript is supported for TypeScript version 2.9 and above. + +> **Warning** +> Do not use this Node.js library in a front-end application. Doing so can expose your Twilio credentials to end-users as part of the bundled HTML/JavaScript sent to their browser. + +## Installation + +`npm install twilio` or `yarn add twilio` + +### Test your installation + +To make sure the installation was successful, try sending yourself an SMS message, like this: + +```js +// Your AccountSID and Auth Token from console.twilio.com +const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; +const authToken = 'your_auth_token'; + +const client = require('twilio')(accountSid, authToken); + +client.messages + .create({ + body: 'Hello from twilio-node', + to: '+12345678901', // Text your number + from: '+12345678901', // From a valid Twilio number + }) + .then((message) => console.log(message.sid)); +``` + +After a brief delay, you will receive the text message on your phone. + +> **Warning** +> It's okay to hardcode your credentials when testing locally, but you should use environment variables to keep them secret before committing any code or deploying to production. Check out [How to Set Environment Variables](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html) for more information. + +## Usage + +Check out these [code examples](examples) in JavaScript and TypeScript to get up and running quickly. + +### Environment Variables + +`twilio-node` supports credential storage in environment variables. If no credentials are provided when instantiating the Twilio client (e.g., `const client = require('twilio')();`), the values in following env vars will be used: `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN`. + +If your environment requires SSL decryption, you can set the path to CA bundle in the env var `TWILIO_CA_BUNDLE`. + +### Client Initialization + +If you invoke any V2010 operations without specifying an account SID, `twilio-node` will automatically use the `TWILIO_ACCOUNT_SID` value that the client was initialized with. This is useful for when you'd like to, for example, fetch resources for your main account but also your subaccount. See below: + +```javascript +// Your Account SID, Subaccount SID Auth Token from console.twilio.com +const accountSid = process.env.TWILIO_ACCOUNT_SID; +const authToken = process.env.TWILIO_AUTH_TOKEN; +const subaccountSid = process.env.TWILIO_ACCOUNT_SUBACCOUNT_SID; + +const client = require('twilio')(accountSid, authToken); +const mainAccountCalls = client.api.v2010.account.calls.list; // SID not specified, so defaults to accountSid +const subaccountCalls = client.api.v2010.account(subaccountSid).calls.list; // SID specified as subaccountSid +``` + +### Lazy Loading + +`twilio-node` supports lazy loading required modules for faster loading time. Lazy loading is enabled by default. To disable lazy loading, simply instantiate the Twilio client with the `lazyLoading` flag set to `false`: + +```javascript +// Your Account SID and Auth Token from console.twilio.com +const accountSid = process.env.TWILIO_ACCOUNT_SID; +const authToken = process.env.TWILIO_AUTH_TOKEN; + +const client = require('twilio')(accountSid, authToken, { + lazyLoading: false, +}); +``` + +### Enable Auto-Retry with Exponential Backoff + +`twilio-node` supports automatic retry with exponential backoff when API requests receive an [Error 429 response](https://support.twilio.com/hc/en-us/articles/360044308153-Twilio-API-response-Error-429-Too-Many-Requests-). This retry with exponential backoff feature is disabled by default. To enable this feature, instantiate the Twilio client with the `autoRetry` flag set to `true`. + +Optionally, the maximum number of retries performed by this feature can be set with the `maxRetries` flag. The default maximum number of retries is `3`. + +```javascript +const accountSid = process.env.TWILIO_ACCOUNT_SID; +const authToken = process.env.TWILIO_AUTH_TOKEN; + +const client = require('twilio')(accountSid, authToken, { + autoRetry: true, + maxRetries: 3, +}); +``` + +### Specify Region and/or Edge + +To take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/docs/global-infrastructure), specify the target Region and/or Edge for the client: + +```javascript +const accountSid = process.env.TWILIO_ACCOUNT_SID; +const authToken = process.env.TWILIO_AUTH_TOKEN; + +const client = require('twilio')(accountSid, authToken, { + region: 'au1', + edge: 'sydney', +}); +``` + +Alternatively, specify the edge and/or region after constructing the Twilio client: + +```javascript +const client = require('twilio')(accountSid, authToken); +client.region = 'au1'; +client.edge = 'sydney'; +``` + +This will result in the `hostname` transforming from `api.twilio.com` to `api.sydney.au1.twilio.com`. + +### Iterate through records + +The library automatically handles paging for you. Collections, such as `calls` and `messages`, have `list` and `each` methods that page under the hood. With both `list` and `each`, you can specify the number of records you want to receive (`limit`) and the maximum size you want each page fetch to be (`pageSize`). The library will then handle the task for you. + +`list` eagerly fetches all records and returns them as a list, whereas `each` streams records and lazily retrieves pages of records as you iterate over the collection. You can also page manually using the `page` method. + +For more information about these methods, view the [auto-generated library docs](https://www.twilio.com/docs/libraries/reference/twilio-node/). + +```js +// Your Account SID and Auth Token from console.twilio.com +const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; +const authToken = 'your_auth_token'; +const client = require('twilio')(accountSid, authToken); + +client.calls.each((call) => console.log(call.direction)); +``` + +### Enable Debug Logging + +There are two ways to enable debug logging in the default HTTP client. You can create an environment variable called `TWILIO_LOG_LEVEL` and set it to `debug` or you can set the logLevel variable on the client as debug: + +```javascript +const accountSid = process.env.TWILIO_ACCOUNT_SID; +const authToken = process.env.TWILIO_AUTH_TOKEN; + +const client = require('twilio')(accountSid, authToken, { + logLevel: 'debug', +}); +``` + +You can also set the logLevel variable on the client after constructing the Twilio client: + +```javascript +const client = require('twilio')(accountSid, authToken); +client.logLevel = 'debug'; +``` + +### Debug API requests + +To assist with debugging, the library allows you to access the underlying request and response objects. This capability is built into the default HTTP client that ships with the library. + +For example, you can retrieve the status code of the last response like so: + +```js +const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; +const authToken = 'your_auth_token'; + +const client = require('twilio')(accountSid, authToken); + +client.messages + .create({ + to: '+14158675309', + from: '+14258675310', + body: 'Ahoy!', + }) + .then(() => { + // Access details about the last request + console.log(client.lastRequest.method); + console.log(client.lastRequest.url); + console.log(client.lastRequest.auth); + console.log(client.lastRequest.params); + console.log(client.lastRequest.headers); + console.log(client.lastRequest.data); + + // Access details about the last response + console.log(client.httpClient.lastResponse.statusCode); + console.log(client.httpClient.lastResponse.body); + }); +``` + +### Handle exceptions + +If the Twilio API returns a 400 or a 500 level HTTP response, `twilio-node` will throw an error including relevant information, which you can then `catch`: + +```js +client.messages + .create({ + body: 'Hello from Node', + to: '+12345678901', + from: '+12345678901', + }) + .then((message) => console.log(message)) + .catch((error) => { + // You can implement your fallback code here + console.log(error); + }); +``` + +or with `async/await`: + +```js +try { + const message = await client.messages.create({ + body: 'Hello from Node', + to: '+12345678901', + from: '+12345678901', + }); + console.log(message); +} catch (error) { + // You can implement your fallback code here + console.error(error); +} +``` + +If you are using callbacks, error information will be included in the `error` parameter of the callback. + +400-level errors are [normal during API operation](https://www.twilio.com/docs/api/rest/request#get-responses) ("Invalid number", "Cannot deliver SMS to that number", for example) and should be handled appropriately. + +### Use a custom HTTP Client + +To use a custom HTTP client with this helper library, please see the [advanced example of how to do so](./advanced-examples/custom-http-client.md). + +### Use webhook validation + +See [example](examples/express.js) for a code sample for incoming Twilio request validation. + +## Docker image + +The `Dockerfile` present in this repository and its respective `twilio/twilio-node` Docker image are currently used by Twilio for testing purposes only. + +## Getting help + +If you need help installing or using the library, please check the [Twilio Support Help Center](https://support.twilio.com) first, and [file a support ticket](https://twilio.com/help/contact) if you don't find an answer to your question. + +If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo! + +## Contributing + +Bug fixes, docs, and library improvements are always welcome. Please refer to our [Contributing Guide](CONTRIBUTING.md) for detailed information on how you can contribute. + +> ⚠️ Please be aware that a large share of the files are auto-generated by our backend tool. You are welcome to suggest changes and submit PRs illustrating the changes. However, we'll have to make the changes in the underlying tool. You can find more info about this in the [Contributing Guide](CONTRIBUTING.md). + +If you're not familiar with the GitHub pull request/contribution process, [this is a nice tutorial](https://gun.io/blog/how-to-github-fork-branch-and-pull-request/). + +### Get started + +If you want to familiarize yourself with the project, you can start by [forking the repository](https://help.github.com/articles/fork-a-repo/) and [cloning it in your local development environment](https://help.github.com/articles/cloning-a-repository/). The project requires [Node.js](https://nodejs.org) to be installed on your machine. + +After cloning the repository, install the dependencies by running the following command in the directory of your cloned repository: + +```bash +npm install +``` + +You can run the existing tests to see if everything is okay by executing: + +```bash +npm test +``` + +To run just one specific test file instead of the whole suite, provide a JavaScript regular expression that will match your spec file's name, like: + +```bash +npm run test:javascript -- -m .\*client.\* +``` + +[apidocs]: https://www.twilio.com/docs/api +[libdocs]: https://twilio.github.io/twilio-node + +[test-workflow-image]: https://github.com/twilio/twilio-node/actions/workflows/test-and-deploy.yml/badge.svg +[test-workflow-url]: https://github.com/twilio/twilio-node/actions/workflows/test-and-deploy.yml +[npm-downloads-image]: https://img.shields.io/npm/dm/twilio.svg +[npm-downloads-url]: https://npmcharts.com/compare/twilio?minimal=true +[npm-install-size-image]: https://badgen.net/packagephobia/install/twilio +[npm-install-size-url]: https://packagephobia.com/result?p=twilio +[npm-url]: https://npmjs.org/package/twilio +[npm-version-image]: https://img.shields.io/npm/v/twilio.svg diff --git a/node_modules/twilio/index.d.ts b/node_modules/twilio/index.d.ts new file mode 100644 index 00000000..1e39038b --- /dev/null +++ b/node_modules/twilio/index.d.ts @@ -0,0 +1,2 @@ +import lib from "./lib"; +export = lib; diff --git a/node_modules/twilio/index.js b/node_modules/twilio/index.js new file mode 100644 index 00000000..2d0545e6 --- /dev/null +++ b/node_modules/twilio/index.js @@ -0,0 +1,9 @@ +"use strict"; +var __importDefault = + (this && this.__importDefault) || + function (mod) { + return mod && mod.__esModule ? mod : { default: mod }; + }; +Object.defineProperty(exports, "__esModule", { value: true }); +const lib_1 = __importDefault(require("./lib")); +module.exports = lib_1.default; diff --git a/node_modules/twilio/lib/base/BaseTwilio.d.ts b/node_modules/twilio/lib/base/BaseTwilio.d.ts new file mode 100644 index 00000000..0b21bf9a --- /dev/null +++ b/node_modules/twilio/lib/base/BaseTwilio.d.ts @@ -0,0 +1,86 @@ +/// +import RequestClient from "./RequestClient"; +import { HttpMethod } from "../interfaces"; +import { Headers } from "../http/request"; +declare namespace Twilio { + interface ClientOpts { + httpClient?: RequestClient; + accountSid?: string; + env?: NodeJS.ProcessEnv; + edge?: string; + region?: string; + lazyLoading?: boolean; + logLevel?: string; + userAgentExtensions?: string[]; + autoRetry?: boolean; + maxRetries?: number; + } + interface RequestOpts { + method?: HttpMethod; + uri?: string; + username?: string; + password?: string; + headers?: Headers; + params?: object; + data?: object; + timeout?: number; + allowRedirects?: boolean; + logLevel?: string; + } + /** + * Parent class for Twilio Client that implements request & validation logic + */ + class Client { + username: string; + password: string; + accountSid: string; + opts?: ClientOpts; + env?: NodeJS.ProcessEnv; + edge?: string; + region?: string; + logLevel?: string; + autoRetry: boolean; + maxRetries?: number; + userAgentExtensions?: string[]; + _httpClient?: RequestClient; + /** + * Create a BaseTwilio instance + * + * @param username - + * The username used for authentication. This is normally account sid, but if using key/secret auth will be + * the api key sid. + * @param password - + * The password used for authentication. This is normally auth token, but if using key/secret auth will be + * the secret. + * @param opts - The options argument + * + * @returns A new instance of BaseTwilio + */ + constructor(username?: string, password?: string, opts?: ClientOpts); + get httpClient(): RequestClient; + /** + * Makes a request to the Twilio API using the configured http client. + * Authentication information is automatically added if none is provided. + * + * @param opts - The options argument + */ + request(opts: RequestOpts): Promise; + /** + * Adds a region and/or edge to a given hostname + * + * @param hostname - A URI hostname (e.g. api.twilio.com) + * @param targetEdge - The targeted edge location (e.g. sydney) + * @param targetRegion - The targeted region location (e.g. au1) + */ + getHostname(hostname: string, targetEdge: string | undefined, targetRegion: string | undefined): string; + /** + * Test if your environment is impacted by a TLS or certificate + * change is by sending an HTTP request to the test endpoint + * + * @throws RestException if the request fails + * + */ + validateSslCert(): Promise; + } +} +export = Twilio; diff --git a/node_modules/twilio/lib/base/BaseTwilio.js b/node_modules/twilio/lib/base/BaseTwilio.js new file mode 100644 index 00000000..ff6e6fb1 --- /dev/null +++ b/node_modules/twilio/lib/base/BaseTwilio.js @@ -0,0 +1,182 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const RequestClient_1 = __importDefault(require("./RequestClient")); /* jshint ignore:line */ +const os = require("os"); /* jshint ignore:line */ +const url = require("url"); /* jshint ignore:line */ +const moduleInfo = require("../../package.json"); /* jshint ignore:line */ +const util = require("util"); /* jshint ignore:line */ +const RestException = require("../base/RestException"); /* jshint ignore:line */ +var Twilio; +(function (Twilio) { + /* jshint ignore:start */ + /** + * Parent class for Twilio Client that implements request & validation logic + */ + /* jshint ignore:end */ + class Client { + /* jshint ignore:start */ + /** + * Create a BaseTwilio instance + * + * @param username - + * The username used for authentication. This is normally account sid, but if using key/secret auth will be + * the api key sid. + * @param password - + * The password used for authentication. This is normally auth token, but if using key/secret auth will be + * the secret. + * @param opts - The options argument + * + * @returns A new instance of BaseTwilio + */ + /* jshint ignore:end */ + constructor(username, password, opts) { + this.opts = opts || {}; + this.env = this.opts.env || {}; + this.username = + username ?? + this.env.TWILIO_ACCOUNT_SID ?? + process.env.TWILIO_ACCOUNT_SID ?? + (() => { + throw new Error("username is required"); + })(); + this.password = + password ?? + this.env.TWILIO_AUTH_TOKEN ?? + process.env.TWILIO_AUTH_TOKEN ?? + (() => { + throw new Error("password is required"); + })(); + this.accountSid = this.opts.accountSid || this.username; + this.edge = + this.opts.edge ?? this.env.TWILIO_EDGE ?? process.env.TWILIO_EDGE; + this.region = + this.opts.region ?? this.env.TWILIO_REGION ?? process.env.TWILIO_REGION; + this.logLevel = + this.opts.logLevel ?? + this.env.TWILIO_LOG_LEVEL ?? + process.env.TWILIO_LOG_LEVEL; + this.autoRetry = this.opts.autoRetry || false; + this.maxRetries = this.opts.maxRetries; + this.userAgentExtensions = this.opts.userAgentExtensions || []; + this._httpClient = this.opts.httpClient; + if (this.opts.lazyLoading === false) { + this._httpClient = this.httpClient; + } + if (!this.accountSid.startsWith("AC")) { + const apiKeyMsg = this.accountSid.startsWith("SK") + ? ". The given SID indicates an API Key which requires the accountSid to be passed as an additional option" + : ""; + throw new Error("accountSid must start with AC" + apiKeyMsg); + } + } + get httpClient() { + if (!this._httpClient) { + this._httpClient = new RequestClient_1.default({ + autoRetry: this.autoRetry, + maxRetries: this.maxRetries, + }); + } + return this._httpClient; + } + /* jshint ignore:start */ + /** + * Makes a request to the Twilio API using the configured http client. + * Authentication information is automatically added if none is provided. + * + * @param opts - The options argument + */ + /* jshint ignore:end */ + request(opts) { + opts = opts || {}; + if (!opts.method) { + throw new Error("method is required"); + } + if (!opts.uri) { + throw new Error("uri is required"); + } + const username = opts.username || this.username; + const password = opts.password || this.password; + const headers = opts.headers || {}; + const pkgVersion = moduleInfo.version; + const osName = os.platform(); + const osArch = os.arch(); + const nodeVersion = process.version; + headers["User-Agent"] = util.format("twilio-node/%s (%s %s) node/%s", pkgVersion, osName, osArch, nodeVersion); + this.userAgentExtensions?.forEach((extension) => { + headers["User-Agent"] += ` ${extension}`; + }); + headers["Accept-Charset"] = "utf-8"; + if (opts.method === "post" && !headers["Content-Type"]) { + headers["Content-Type"] = "application/x-www-form-urlencoded"; + } + if (!headers["Accept"]) { + headers["Accept"] = "application/json"; + } + var uri = new url.URL(opts.uri); + uri.hostname = this.getHostname(uri.hostname, this.edge, this.region); + return this.httpClient?.request({ + method: opts.method, + uri: uri.href, + username: username, + password: password, + headers: headers, + params: opts.params, + data: opts.data, + timeout: opts.timeout, + allowRedirects: opts.allowRedirects, + logLevel: opts.logLevel, + }); + } + /* jshint ignore:start */ + /** + * Adds a region and/or edge to a given hostname + * + * @param hostname - A URI hostname (e.g. api.twilio.com) + * @param targetEdge - The targeted edge location (e.g. sydney) + * @param targetRegion - The targeted region location (e.g. au1) + */ + /* jshint ignore:end */ + getHostname(hostname, targetEdge, targetRegion) { + const defaultRegion = "us1"; + const domain = hostname.split(".").slice(-2).join("."); + const prefix = hostname.split("." + domain)[0]; + let [product, edge, region] = prefix.split("."); + if (edge && !region) { + region = edge; + edge = undefined; + } + region = targetRegion || region || (targetEdge && defaultRegion); + if (!region) { + return hostname; + } + edge = targetEdge || edge; + return [product, edge, region, domain].filter((part) => part).join("."); + } + /* jshint ignore:start */ + /** + * Test if your environment is impacted by a TLS or certificate + * change is by sending an HTTP request to the test endpoint + * + * @throws RestException if the request fails + * + */ + /* jshint ignore:end */ + validateSslCert() { + return this.httpClient + ?.request({ + method: "get", + uri: "https://tls-test.twilio.com:443", + }) + .then((response) => { + if (response["statusCode"] < 200 || response["statusCode"] >= 300) { + throw new RestException(response); + } + return response; + }); + } + } + Twilio.Client = Client; +})(Twilio || (Twilio = {})); +module.exports = Twilio; diff --git a/node_modules/twilio/lib/base/Domain.d.ts b/node_modules/twilio/lib/base/Domain.d.ts new file mode 100644 index 00000000..f574e979 --- /dev/null +++ b/node_modules/twilio/lib/base/Domain.d.ts @@ -0,0 +1,29 @@ +import { Client as BaseTwilio, RequestOpts } from "./BaseTwilio"; +/** + * Base domain object + */ +export default class Domain { + twilio: BaseTwilio; + baseUrl: string; + /** + * Creates a Domain instance + * + * @param twilio - A Twilio Client + * @param baseUrl - Base url for this domain + */ + constructor(twilio: BaseTwilio, baseUrl: string); + /** + * Turn a uri into an absolute url + * + * @param uri - uri to transform + * @returns absolute url + */ + absoluteUrl(uri?: string): string; + /** + * Make request to this domain + * + * @param opts - request options + * @returns request promise + */ + request(opts: RequestOpts): Promise; +} diff --git a/node_modules/twilio/lib/base/Domain.js b/node_modules/twilio/lib/base/Domain.js new file mode 100644 index 00000000..203e53ef --- /dev/null +++ b/node_modules/twilio/lib/base/Domain.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utility_1 = require("./utility"); +/** + * Base domain object + */ +class Domain { + /** + * Creates a Domain instance + * + * @param twilio - A Twilio Client + * @param baseUrl - Base url for this domain + */ + constructor(twilio, baseUrl) { + this.twilio = twilio; + this.baseUrl = baseUrl; + } + /** + * Turn a uri into an absolute url + * + * @param uri - uri to transform + * @returns absolute url + */ + absoluteUrl(uri) { + var result = ""; + if (typeof this.baseUrl === "string") { + const cleanBaseUrl = (0, utility_1.trim)(this.baseUrl, "/"); + result += cleanBaseUrl; + result += "/"; + } + if (typeof uri === "string") { + uri = (0, utility_1.trim)(uri, "/"); + if (result === "") { + result += "/"; + } + result += uri; + } + return result; + } + /** + * Make request to this domain + * + * @param opts - request options + * @returns request promise + */ + request(opts) { + return this.twilio.request({ + ...opts, + uri: this.absoluteUrl(opts.uri), + }); + } +} +exports.default = Domain; diff --git a/node_modules/twilio/lib/base/Page.d.ts b/node_modules/twilio/lib/base/Page.d.ts new file mode 100644 index 00000000..55e57e83 --- /dev/null +++ b/node_modules/twilio/lib/base/Page.d.ts @@ -0,0 +1,104 @@ +import Version from "./Version"; +import Response from "../http/response"; +export interface TwilioResponsePayload { + [key: string]: any; + first_page_uri: string; + next_page_uri: string; + page: number; + page_size: number; + previous_page_uri: string; + uri: string; + meta?: { + key?: string; + next_page_url?: string; + previous_page_url?: string; + }; +} +interface Solution { + [name: string]: any; +} +export default class Page { + nextPageUrl?: string; + previousPageUrl?: string; + instances: TInstance[]; + _version: TVersion; + _payload: TPayload; + _solution: Solution; + /** + * + * Base page object to maintain request state. + * + * @param version - A twilio version instance + * @param response - The http response + * @param solution - path solution + */ + constructor(version: TVersion, response: Response, solution: Solution); + /** + * Meta keys returned in a list request + * + * @constant META_KEYS + */ + static META_KEYS: string[]; + /** + * Get the url of the previous page of records + * + * @returns url of the previous page, or undefined if the + * previous page URI/URL is not defined. + */ + getPreviousPageUrl(): string | undefined; + /** + * Get the url of the next page of records + * + * @returns url of the next page, or undefined if the + * next page URI/URL is not defined. + */ + getNextPageUrl(): string | undefined; + /** + * Build a new instance given a json payload + * + * @param payload - Payload response from the API + * @returns instance of a resource + */ + getInstance(payload: any): TInstance; + /** + * Load a list of records + * + * @param resources - json payload of records + * @returns list of resources + */ + loadInstances(resources: TResource[]): TInstance[]; + /** + * Fetch the next page of records + * + * @returns promise that resolves to next page of results, + * or undefined if there isn't a nextPageUrl undefined. + */ + nextPage(): Promise> | undefined; + /** + * Fetch the previous page of records + * + * @returns promise that resolves to previous page of + * results, or undefined if there isn't a previousPageUrl undefined. + */ + previousPage(): Promise> | undefined; + /** + * Parse json response from API + * + * @param response - API response + * + * @throws Error If non 200 status code is returned + * + * @returns json parsed response + */ + processResponse(response: Response): TPayload; + /** + * Load a page of records + * + * @param {object} payload json payload + * @return {array} the page of records + */ + loadPage(payload: TPayload): TResource[]; + forOwn(obj: object, iteratee: (val: any, key: string, object: object) => void): void; + toJSON(): object; +} +export {}; diff --git a/node_modules/twilio/lib/base/Page.js b/node_modules/twilio/lib/base/Page.js new file mode 100644 index 00000000..3d5d6aa4 --- /dev/null +++ b/node_modules/twilio/lib/base/Page.js @@ -0,0 +1,192 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const RestException_1 = __importDefault(require("./RestException")); +class Page { + /** + * + * Base page object to maintain request state. + * + * @param version - A twilio version instance + * @param response - The http response + * @param solution - path solution + */ + constructor(version, response, solution) { + let payload = this.processResponse(response); + this._version = version; + this._payload = payload; + this._solution = solution; + this.nextPageUrl = this.getNextPageUrl(); + this.previousPageUrl = this.getPreviousPageUrl(); + this.instances = this.loadInstances(this.loadPage(payload)); + } + /** + * Get the url of the previous page of records + * + * @returns url of the previous page, or undefined if the + * previous page URI/URL is not defined. + */ + getPreviousPageUrl() { + if (this._payload.meta && + "previous_page_url" in this._payload.meta && + this._payload.meta.previous_page_url) { + // jshint ignore:line + return this._payload.meta.previous_page_url; // jshint ignore:line + } + if ("previous_page_uri" in this._payload && + this._payload.previous_page_uri) { + // jshint ignore:line + return this._version._domain.absoluteUrl(this._payload.previous_page_uri); // jshint ignore:line + } + return undefined; + } + /** + * Get the url of the next page of records + * + * @returns url of the next page, or undefined if the + * next page URI/URL is not defined. + */ + getNextPageUrl() { + if (this._payload.meta && + "next_page_url" in this._payload.meta && + this._payload.meta.next_page_url) { + // jshint ignore:line + return this._payload.meta.next_page_url; // jshint ignore:line + } + if ("next_page_uri" in this._payload && this._payload.next_page_uri) { + // jshint ignore:line + return this._version._domain.absoluteUrl(this._payload.next_page_uri); // jshint ignore:line + } + return undefined; + } + /** + * Build a new instance given a json payload + * + * @param payload - Payload response from the API + * @returns instance of a resource + */ + getInstance(payload) { + throw new Error("Page.get_instance() must be implemented in the derived class"); + } + /** + * Load a list of records + * + * @param resources - json payload of records + * @returns list of resources + */ + loadInstances(resources) { + let instances = []; + resources.forEach((resource) => { + instances.push(this.getInstance(resource)); + }); + return instances; + } + /** + * Fetch the next page of records + * + * @returns promise that resolves to next page of results, + * or undefined if there isn't a nextPageUrl undefined. + */ + nextPage() { + if (!this.nextPageUrl) { + return undefined; + } + var reqPromise = this._version._domain.twilio.request({ + method: "get", + uri: this.nextPageUrl, + }); + var nextPagePromise = reqPromise.then(function (response) { + return new this.constructor(this._version, response, this._solution); + }.bind(this)); + return nextPagePromise; + } + /** + * Fetch the previous page of records + * + * @returns promise that resolves to previous page of + * results, or undefined if there isn't a previousPageUrl undefined. + */ + previousPage() { + if (!this.previousPageUrl) { + return undefined; + } + var reqPromise = this._version._domain.twilio.request({ + method: "get", + uri: this.previousPageUrl, + }); + var prevPagePromise = reqPromise.then(function (response) { + return new this.constructor(this._version, response, this._solution); + }.bind(this)); + return prevPagePromise; + } + /** + * Parse json response from API + * + * @param response - API response + * + * @throws Error If non 200 status code is returned + * + * @returns json parsed response + */ + processResponse(response) { + if (response.statusCode !== 200) { + throw new RestException_1.default(response); + } + if (typeof response.body === "string") { + return JSON.parse(response.body); + } + return response.body; + } + /** + * Load a page of records + * + * @param {object} payload json payload + * @return {array} the page of records + */ + loadPage(payload) { + if (payload.meta?.key) { + return payload[payload.meta.key]; + } + const keys = Object.keys(payload).filter((key) => !Page.META_KEYS.includes(key)); + if (keys.length === 1) { + return payload[keys[0]]; + } + throw new Error("Page Records cannot be deserialized"); + } + forOwn(obj, iteratee) { + obj = Object(obj); + for (const [key, val] of Object.entries(obj)) { + iteratee(val, key, obj); + } + } + toJSON() { + const clone = {}; + this.forOwn(this, (value, key) => { + if (!key.startsWith("_") && typeof value !== "function") { + clone[key] = value; + } + }); + return clone; + } +} +exports.default = Page; +/** + * Meta keys returned in a list request + * + * @constant META_KEYS + */ +Page.META_KEYS = [ + "end", + "first_page_uri", + "last_page_uri", + "next_page_uri", + "num_pages", + "page", + "page_size", + "previous_page_uri", + "start", + "total", + "uri", +]; diff --git a/node_modules/twilio/lib/base/RequestClient.d.ts b/node_modules/twilio/lib/base/RequestClient.d.ts new file mode 100644 index 00000000..be42cb3d --- /dev/null +++ b/node_modules/twilio/lib/base/RequestClient.d.ts @@ -0,0 +1,145 @@ +/// +import { HttpMethod } from "../interfaces"; +import { AxiosInstance } from "axios"; +import Response from "../http/response"; +import Request, { Headers } from "../http/request"; +declare class RequestClient { + defaultTimeout: number; + axios: AxiosInstance; + lastResponse?: Response; + lastRequest?: Request; + autoRetry: boolean; + maxRetryDelay: number; + maxRetries: number; + /** + * Make http request + * @param opts - The options passed to https.Agent + * @param opts.timeout - https.Agent timeout option. Used as the socket timeout, AND as the default request timeout. + * @param opts.keepAlive - https.Agent keepAlive option + * @param opts.keepAliveMsecs - https.Agent keepAliveMsecs option + * @param opts.maxSockets - https.Agent maxSockets option + * @param opts.maxTotalSockets - https.Agent maxTotalSockets option + * @param opts.maxFreeSockets - https.Agent maxFreeSockets option + * @param opts.scheduling - https.Agent scheduling option + * @param opts.autoRetry - Enable auto-retry requests with exponential backoff on 429 responses. Defaults to false. + * @param opts.maxRetryDelay - Max retry delay in milliseconds for 429 Too Many Request response retries. Defaults to 3000. + * @param opts.maxRetries - Max number of request retries for 429 Too Many Request responses. Defaults to 3. + */ + constructor(opts?: RequestClient.RequestClientOptions); + /** + * Make http request + * @param opts - The options argument + * @param opts.method - The http method + * @param opts.uri - The request uri + * @param opts.username - The username used for auth + * @param opts.password - The password used for auth + * @param opts.headers - The request headers + * @param opts.params - The request params + * @param opts.data - The request data + * @param opts.timeout - The request timeout in milliseconds (default 30000) + * @param opts.allowRedirects - Should the client follow redirects + * @param opts.forever - Set to true to use the forever-agent + * @param opts.logLevel - Show debug logs + */ + request(opts: RequestClient.RequestOptions): Promise>; + filterLoggingHeaders(headers: Headers): string[]; + private logRequest; +} +declare namespace RequestClient { + interface RequestOptions { + /** + * The HTTP method + */ + method: HttpMethod; + /** + * The request URI + */ + uri: string; + /** + * The username used for auth + */ + username?: string; + /** + * The password used for auth + */ + password?: string; + /** + * The request headers + */ + headers?: Headers; + /** + * The object of params added as query string to the request + */ + params?: TParams; + /** + * The form data that should be submitted + */ + data?: TData; + /** + * The request timeout in milliseconds + */ + timeout?: number; + /** + * Should the client follow redirects + */ + allowRedirects?: boolean; + /** + * Set to true to use the forever-agent + */ + forever?: boolean; + /** + * Set to 'debug' to enable debug logging + */ + logLevel?: string; + } + interface RequestClientOptions { + /** + * A timeout in milliseconds. This will be used as the HTTPS agent's socket + * timeout, AND as the default request timeout. + */ + timeout?: number; + /** + * https.Agent keepAlive option + */ + keepAlive?: boolean; + /** + * https.Agent keepAliveMSecs option + */ + keepAliveMsecs?: number; + /** + * https.Agent maxSockets option + */ + maxSockets?: number; + /** + * https.Agent maxTotalSockets option + */ + maxTotalSockets?: number; + /** + * https.Agent maxFreeSockets option + */ + maxFreeSockets?: number; + /** + * https.Agent scheduling option + */ + scheduling?: "fifo" | "lifo" | undefined; + /** + * The private CA certificate bundle (if private SSL certificate) + */ + ca?: string | Buffer; + /** + * Enable auto-retry with exponential backoff when receiving 429 Errors from + * the API. Disabled by default. + */ + autoRetry?: boolean; + /** + * Maximum retry delay in milliseconds for 429 Error response retries. + * Defaults to 3000. + */ + maxRetryDelay?: number; + /** + * Maximum number of request retries for 429 Error responses. Defaults to 3. + */ + maxRetries?: number; + } +} +export = RequestClient; diff --git a/node_modules/twilio/lib/base/RequestClient.js b/node_modules/twilio/lib/base/RequestClient.js new file mode 100644 index 00000000..ff99817a --- /dev/null +++ b/node_modules/twilio/lib/base/RequestClient.js @@ -0,0 +1,222 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const axios_1 = __importDefault(require("axios")); +const fs = __importStar(require("fs")); +const https_proxy_agent_1 = __importDefault(require("https-proxy-agent")); +const qs_1 = __importDefault(require("qs")); +const https = __importStar(require("https")); +const response_1 = __importDefault(require("../http/response")); +const request_1 = __importDefault(require("../http/request")); +const DEFAULT_CONTENT_TYPE = "application/x-www-form-urlencoded"; +const DEFAULT_TIMEOUT = 30000; +const DEFAULT_INITIAL_RETRY_INTERVAL_MILLIS = 100; +const DEFAULT_MAX_RETRY_DELAY = 3000; +const DEFAULT_MAX_RETRIES = 3; +function getExponentialBackoffResponseHandler(axios, opts) { + const maxIntervalMillis = opts.maxIntervalMillis; + const maxRetries = opts.maxRetries; + return function (res) { + const config = res.config; + if (res.status !== 429) { + return res; + } + const retryCount = (config.retryCount || 0) + 1; + if (retryCount <= maxRetries) { + config.retryCount = retryCount; + const baseDelay = Math.min(maxIntervalMillis, DEFAULT_INITIAL_RETRY_INTERVAL_MILLIS * Math.pow(2, retryCount)); + const delay = Math.floor(baseDelay * Math.random()); // Full jitter backoff + return new Promise((resolve) => { + setTimeout(() => resolve(axios(config)), delay); + }); + } + return res; + }; +} +class RequestClient { + /** + * Make http request + * @param opts - The options passed to https.Agent + * @param opts.timeout - https.Agent timeout option. Used as the socket timeout, AND as the default request timeout. + * @param opts.keepAlive - https.Agent keepAlive option + * @param opts.keepAliveMsecs - https.Agent keepAliveMsecs option + * @param opts.maxSockets - https.Agent maxSockets option + * @param opts.maxTotalSockets - https.Agent maxTotalSockets option + * @param opts.maxFreeSockets - https.Agent maxFreeSockets option + * @param opts.scheduling - https.Agent scheduling option + * @param opts.autoRetry - Enable auto-retry requests with exponential backoff on 429 responses. Defaults to false. + * @param opts.maxRetryDelay - Max retry delay in milliseconds for 429 Too Many Request response retries. Defaults to 3000. + * @param opts.maxRetries - Max number of request retries for 429 Too Many Request responses. Defaults to 3. + */ + constructor(opts) { + opts = opts || {}; + this.defaultTimeout = opts.timeout || DEFAULT_TIMEOUT; + this.autoRetry = opts.autoRetry || false; + this.maxRetryDelay = opts.maxRetryDelay || DEFAULT_MAX_RETRY_DELAY; + this.maxRetries = opts.maxRetries || DEFAULT_MAX_RETRIES; + // construct an https agent + let agentOpts = { + timeout: this.defaultTimeout, + keepAlive: opts.keepAlive, + keepAliveMsecs: opts.keepAliveMsecs, + maxSockets: opts.maxSockets, + maxTotalSockets: opts.maxTotalSockets, + maxFreeSockets: opts.maxFreeSockets, + scheduling: opts.scheduling, + ca: opts.ca, + }; + // sets https agent CA bundle if defined in CA bundle filepath env variable + if (process.env.TWILIO_CA_BUNDLE !== undefined) { + if (agentOpts.ca === undefined) { + agentOpts.ca = fs.readFileSync(process.env.TWILIO_CA_BUNDLE); + } + } + let agent; + if (process.env.HTTP_PROXY) { + // Note: if process.env.HTTP_PROXY is set, we're not able to apply the given + // socket timeout. See: https://github.com/TooTallNate/node-https-proxy-agent/pull/96 + agent = (0, https_proxy_agent_1.default)(process.env.HTTP_PROXY); + } + else { + agent = new https.Agent(agentOpts); + } + // construct an axios instance + this.axios = axios_1.default.create(); + this.axios.defaults.headers.post["Content-Type"] = DEFAULT_CONTENT_TYPE; + this.axios.defaults.httpsAgent = agent; + if (opts.autoRetry) { + this.axios.interceptors.response.use(getExponentialBackoffResponseHandler(this.axios, { + maxIntervalMillis: this.maxRetryDelay, + maxRetries: this.maxRetries, + })); + } + } + /** + * Make http request + * @param opts - The options argument + * @param opts.method - The http method + * @param opts.uri - The request uri + * @param opts.username - The username used for auth + * @param opts.password - The password used for auth + * @param opts.headers - The request headers + * @param opts.params - The request params + * @param opts.data - The request data + * @param opts.timeout - The request timeout in milliseconds (default 30000) + * @param opts.allowRedirects - Should the client follow redirects + * @param opts.forever - Set to true to use the forever-agent + * @param opts.logLevel - Show debug logs + */ + request(opts) { + if (!opts.method) { + throw new Error("http method is required"); + } + if (!opts.uri) { + throw new Error("uri is required"); + } + var headers = opts.headers || {}; + if (!headers.Connection && !headers.connection && opts.forever) { + headers.Connection = "keep-alive"; + } + else if (!headers.Connection && !headers.connection) { + headers.Connection = "close"; + } + let auth = undefined; + if (opts.username && opts.password) { + auth = Buffer.from(opts.username + ":" + opts.password).toString("base64"); + headers.Authorization = "Basic " + auth; + } + const options = { + timeout: opts.timeout || this.defaultTimeout, + maxRedirects: opts.allowRedirects ? 10 : 0, + url: opts.uri, + method: opts.method, + headers: opts.headers, + proxy: false, + validateStatus: (status) => status >= 100 && status < 600, + }; + if (opts.data) { + options.data = qs_1.default.stringify(opts.data, { arrayFormat: "repeat" }); + } + if (opts.params) { + options.params = opts.params; + options.paramsSerializer = (params) => { + return qs_1.default.stringify(params, { arrayFormat: "repeat" }); + }; + } + const requestOptions = { + method: opts.method, + url: opts.uri, + auth: auth, + params: options.params, + data: opts.data, + headers: opts.headers, + }; + if (opts.logLevel === "debug") { + this.logRequest(requestOptions); + } + const _this = this; + this.lastResponse = undefined; + this.lastRequest = new request_1.default(requestOptions); + return this.axios(options) + .then((response) => { + if (opts.logLevel === "debug") { + console.log(`response.statusCode: ${response.status}`); + console.log(`response.headers: ${JSON.stringify(response.headers)}`); + } + _this.lastResponse = new response_1.default(response.status, response.data, response.headers); + return { + statusCode: response.status, + body: response.data, + headers: response.headers, + }; + }) + .catch((error) => { + _this.lastResponse = undefined; + throw error; + }); + } + filterLoggingHeaders(headers) { + return Object.keys(headers).filter((header) => { + return !"authorization".includes(header.toLowerCase()); + }); + } + logRequest(options) { + console.log("-- BEGIN Twilio API Request --"); + console.log(`${options.method} ${options.url}`); + if (options.params) { + console.log("Querystring:"); + console.log(options.params); + } + if (options.headers) { + console.log("Headers:"); + const filteredHeaderKeys = this.filterLoggingHeaders(options.headers); + filteredHeaderKeys.forEach((header) => console.log(`${header}: ${options.headers?.header}`)); + } + console.log("-- END Twilio API Request --"); + } +} +module.exports = RequestClient; diff --git a/node_modules/twilio/lib/base/RestException.d.ts b/node_modules/twilio/lib/base/RestException.d.ts new file mode 100644 index 00000000..b91e4791 --- /dev/null +++ b/node_modules/twilio/lib/base/RestException.d.ts @@ -0,0 +1,16 @@ +interface RestExceptionError { + status: number; + message?: string; + code?: number; + moreInfo?: string; + details?: object; +} +export default class RestException extends Error implements RestExceptionError { + status: number; + message: string; + code?: number; + moreInfo?: string; + details?: object; + constructor(response: any); +} +export {}; diff --git a/node_modules/twilio/lib/base/RestException.js b/node_modules/twilio/lib/base/RestException.js new file mode 100644 index 00000000..45995d59 --- /dev/null +++ b/node_modules/twilio/lib/base/RestException.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class RestException extends Error { + constructor(response) { + super("[HTTP " + response.statusCode + "] Failed to execute request"); + const isResponseBodyString = typeof response.body == "string"; + const body = isResponseBodyString + ? parseResponseBody(response.body) + : response.body; + this.status = response.statusCode; + if (body !== null) { + this.message = body.message; + this.code = body.code; + this.moreInfo = body.more_info; /* jshint ignore:line */ + this.details = body.details; + } + else { + this.message = + "[HTTP " + response.statusCode + "] Failed to execute request"; + } + } +} +exports.default = RestException; +function parseResponseBody(response_body) { + let body = null; + try { + body = JSON.parse(response_body); + } + catch (catchError) { + body = null; + } + return body; +} diff --git a/node_modules/twilio/lib/base/Version.d.ts b/node_modules/twilio/lib/base/Version.d.ts new file mode 100644 index 00000000..d0e12841 --- /dev/null +++ b/node_modules/twilio/lib/base/Version.d.ts @@ -0,0 +1,129 @@ +import Domain from "./Domain"; +import { RequestOpts } from "./BaseTwilio"; +export interface PageLimitOptions { + /** + * The maximum number of items to fetch + */ + limit: number; + /** + * The maximum number of items to return with every request + */ + pageSize: number; +} +export interface PageLimit { + limit: number; + pageSize: number; +} +export default class Version { + _domain: Domain; + _version: Version | string; + /** + * + * Base version object + * + * @param domain - twilio domain + * @param version - api version + */ + constructor(domain: Domain, version: string | Version); + get domain(): Domain; + /** + * Generate absolute url from a uri + * + * @param uri - uri to transform + * @returns transformed url + */ + absoluteUrl(uri: string): string; + /** + * Generate relative url from a uri + * + * @param uri - uri to transform + * @returns transformed url + */ + relativeUrl(uri: string): string; + /** + * Make a request against the domain + * + * @param opts - request options + * @returns promise that resolves to request response + */ + request(opts: RequestOpts): Promise; + /** + * Create a new record + * + * @param opts - request options + * + * @throws Error If response returns non 2xx or 201 status code + * + * @returns promise that resolves to created record + */ + create(opts: RequestOpts): Promise; + /** + * Fetch an instance of a record + * + * @param opts - request options + * + * @throws Error If response returns non 2xx or 3xx status code + * + * @returns promise that resolves to fetched result + */ + fetch(opts: RequestOpts): Promise; + /** + * Fetch a page of records + * + * @param opts - request options + * @returns promise that resolves to page of records + */ + page(opts: RequestOpts): Promise; + /** + * Update a record + * + * @param opts - request options + * + * @throws Error If response returns non 2xx status code + * + * @returns promise that resolves to updated result + */ + update(opts: RequestOpts): Promise; + /** + * Delete a record + * + * @param opts - request options + * + * @throws Error If response returns a 5xx status + * + * @returns promise that resolves to true if record was deleted + */ + remove(opts: RequestOpts): Promise; + /** + * Process limits for list requests + * + * @param opts.limit - The maximum number of items to fetch + * @param opts.pageSize - The maximum number of items to return with every request + * + */ + readLimits(opts: PageLimitOptions): PageLimit; + setPromiseCallback(operationPromise: any, callback: any): Promise; + /** + * For each record instance, executes a provided callback function with that + * instance + * + * @param params - Parameters (Optional) + * @param params.limit - Optional maximum number of record instances to + * fetch + * @param params.pageSize - Optional maximum number of records to return + * with every request + * @param params.callback - Callback function to call with each + * record instance + * @param params.done - Optional done function to call when all + * records are processed, the limit is reached, or an error occurs. + * Receives an error argument if an error occurs. + * @param callback - Callback function to call with each record. + * Receives a done function argument that will short-circuit the for-each + * loop that may accept an error argument. + * @returns Returns a promise that resolves when all records + * processed or if the limit is reached, and rejects with an error if an + * error occurs and is not handled in the user provided done function. + */ + each(params?: any, callback?: (item: T, done: (err?: Error) => void) => void): Promise; + list(params?: any, callback?: (error: Error | null, items: T) => any): Promise; +} diff --git a/node_modules/twilio/lib/base/Version.js b/node_modules/twilio/lib/base/Version.js new file mode 100644 index 00000000..822a5d6d --- /dev/null +++ b/node_modules/twilio/lib/base/Version.js @@ -0,0 +1,336 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const RestException_1 = __importDefault(require("./RestException")); +const utility_1 = require("./utility"); +class Version { + /** + * + * Base version object + * + * @param domain - twilio domain + * @param version - api version + */ + constructor(domain, version) { + this._domain = domain; + this._version = version; + } + get domain() { + return this._domain; + } + /** + * Generate absolute url from a uri + * + * @param uri - uri to transform + * @returns transformed url + */ + absoluteUrl(uri) { + return this._domain.absoluteUrl(this.relativeUrl(uri)); + } + /** + * Generate relative url from a uri + * + * @param uri - uri to transform + * @returns transformed url + */ + relativeUrl(uri) { + var result = ""; + if (typeof this._version === "string") { + const version = (0, utility_1.trim)(this._version, "/"); + result += version; + result += "/"; + } + if (typeof uri === "string") { + uri = (0, utility_1.trim)(uri, "/"); + if (result === "") { + result += "/"; + } + result += uri; + } + return result; + } + /** + * Make a request against the domain + * + * @param opts - request options + * @returns promise that resolves to request response + */ + request(opts) { + return this._domain.request({ + ...opts, + uri: this.relativeUrl(opts.uri || ""), + }); + } + /** + * Create a new record + * + * @param opts - request options + * + * @throws Error If response returns non 2xx or 201 status code + * + * @returns promise that resolves to created record + */ + create(opts) { + var qResponse = this.request(opts); + qResponse = qResponse.then(function success(response) { + if (response.statusCode < 200 || response.statusCode >= 300) { + throw new RestException_1.default(response); + } + if (typeof response.body === "string") { + return JSON.parse(response.body); + } + return response.body; + }); + return qResponse; + } + /** + * Fetch an instance of a record + * + * @param opts - request options + * + * @throws Error If response returns non 2xx or 3xx status code + * + * @returns promise that resolves to fetched result + */ + fetch(opts) { + var qResponse = this.request(opts); + qResponse = qResponse.then(function success(response) { + if (response.statusCode < 200 || response.statusCode >= 400) { + throw new RestException_1.default(response); + } + if (typeof response.body === "string") { + return JSON.parse(response.body); + } + return response.body; + }); + return qResponse; + } + /** + * Fetch a page of records + * + * @param opts - request options + * @returns promise that resolves to page of records + */ + page(opts) { + return this.request(opts); + } + /** + * Update a record + * + * @param opts - request options + * + * @throws Error If response returns non 2xx status code + * + * @returns promise that resolves to updated result + */ + update(opts) { + var qResponse = this.request(opts); + qResponse = qResponse.then(function success(response) { + if (response.statusCode < 200 || response.statusCode >= 300) { + throw new RestException_1.default(response); + } + if (typeof response.body === "string") { + return JSON.parse(response.body); + } + return response.body; + }); + return qResponse; + } + /** + * Delete a record + * + * @param opts - request options + * + * @throws Error If response returns a 5xx status + * + * @returns promise that resolves to true if record was deleted + */ + remove(opts) { + var qResponse = this.request(opts); + qResponse = qResponse.then(function success(response) { + if (response.statusCode < 200 || response.statusCode >= 300) { + throw new RestException_1.default(response); + } + return response.statusCode === 204; + }); + return qResponse; + } + /** + * Process limits for list requests + * + * @param opts.limit - The maximum number of items to fetch + * @param opts.pageSize - The maximum number of items to return with every request + * + */ + readLimits(opts) { + var limit = opts.limit; + var pageSize = opts.pageSize; + if ((limit && !Number.isFinite(limit)) || limit <= 0) { + throw new TypeError("Parameter limit must be a positive integer"); + } + if (pageSize && (!Number.isFinite(pageSize) || pageSize <= 0)) { + throw new TypeError("Parameter pageSize must be a positive integer"); + } + if (limit && !pageSize) { + pageSize = limit; + } + return { + limit: limit, + pageSize: pageSize, + }; + } + setPromiseCallback(operationPromise, callback) { + if (typeof callback === "function") { + operationPromise = operationPromise + .then((value) => callback(null, value)) + .catch((error) => callback(error)); + } + return operationPromise; + } + /** + * For each record instance, executes a provided callback function with that + * instance + * + * @param params - Parameters (Optional) + * @param params.limit - Optional maximum number of record instances to + * fetch + * @param params.pageSize - Optional maximum number of records to return + * with every request + * @param params.callback - Callback function to call with each + * record instance + * @param params.done - Optional done function to call when all + * records are processed, the limit is reached, or an error occurs. + * Receives an error argument if an error occurs. + * @param callback - Callback function to call with each record. + * Receives a done function argument that will short-circuit the for-each + * loop that may accept an error argument. + * @returns Returns a promise that resolves when all records + * processed or if the limit is reached, and rejects with an error if an + * error occurs and is not handled in the user provided done function. + */ + each(params, callback) { + if (typeof params === "function") { + callback = params; + params = {}; + } + else { + params = params || {}; + } + if (params.callback) { + callback = params.callback; + } + if (typeof callback === "undefined") { + throw new Error("Callback function must be provided"); + } + let done = false; + let doneCalled = false; + let currentPage = 1; + let currentResource = 0; + let limits = {}; + let pPending = true; + let pResolve; + let pReject; + if (this._version instanceof Version) { + limits = this._version.readLimits({ + limit: params.limit, + pageSize: params.pageSize, + }); + } + function onComplete(error) { + let unhandledError = error; + done = true; + if (typeof params.done === "function" && !doneCalled) { + try { + params.done(unhandledError); + unhandledError = null; + } + catch (e) { + unhandledError = e; + } + } + doneCalled = true; + if (pPending) { + if (unhandledError) { + pReject(unhandledError); + } + else { + pResolve(); + } + pPending = false; + } + } + function fetchNextPage(fn) { + let promise = fn(); + if (typeof promise === "undefined") { + onComplete(); + return; + } + promise + .then((page) => { + try { + page.instances.forEach(function (instance) { + if (done || + (typeof params.limit !== "undefined" && + currentResource >= params.limit)) { + done = true; + return false; + } + currentResource++; + callback?.(instance, onComplete); + }); + } + catch (e) { + return onComplete(e); + } + if (!done) { + currentPage++; + fetchNextPage(page.nextPage.bind(page)); + } + else { + onComplete(); + } + }) + .catch(onComplete); + } + return new Promise((resolve, reject) => { + pResolve = resolve; + pReject = reject; + fetchNextPage(this.page.bind(this, Object.assign(params, limits))); + }); + } + list(params, callback) { + if (typeof params === "function") { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let allResources = []; + params.callback = function (resource, done) { + allResources.push(resource); + if (typeof params.limit !== "undefined" && + allResources.length === params.limit) { + done(); + } + }; + let operationPromise = new Promise((resolve, reject) => { + params.done = function (error) { + if (typeof error === "undefined") { + resolve(allResources); + } + else { + reject(error); + } + }; + }); + if (this._version instanceof Version) { + operationPromise = this._version.setPromiseCallback(operationPromise, callback); + } + this.each(params); + return operationPromise; + } +} +exports.default = Version; diff --git a/node_modules/twilio/lib/base/deserialize.d.ts b/node_modules/twilio/lib/base/deserialize.d.ts new file mode 100644 index 00000000..c611dc09 --- /dev/null +++ b/node_modules/twilio/lib/base/deserialize.d.ts @@ -0,0 +1,41 @@ +export interface NumberParser { + (n: string): number; +} +/** + * @namespace deserialize + */ +/** + * Parse a string into a Date object + * + * @param s - Date string in YYYY-MM-DD format + * @returns Date object, or the original date string if the argument is not a valid date + */ +export declare function iso8601Date(s: string): string | Date; +/** + * Parse a string into a Date object + * + * @param s - Date string in YYYY-MM-DD[T]HH:mm:ss[Z] format + * @returns Date object, or the original date string if the argument is not a valid date + */ +export declare function iso8601DateTime(s: string): string | Date; +/** + * Parse a string into a Date object + * + * @param s - Date string in ddd, DD MMM YYYY HH:mm:ss [+0000] format + * @returns Date object, or the original date string if the argument is not a valid date + */ +export declare function rfc2822DateTime(s: string): string | Date; +/** + * Parse a string into a decimal + * + * @param d - Decimal value as string + * @returns Number, or the original string if the argument is NaN + */ +export declare function decimal(d: string): string | number; +/** + * Parse a string into a integer + * + * @param i - Integer value as string + * @returns Number, or the original string if the argument is NaN + */ +export declare function integer(i: string): string | number; diff --git a/node_modules/twilio/lib/base/deserialize.js b/node_modules/twilio/lib/base/deserialize.js new file mode 100644 index 00000000..0924f229 --- /dev/null +++ b/node_modules/twilio/lib/base/deserialize.js @@ -0,0 +1,76 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.integer = exports.decimal = exports.rfc2822DateTime = exports.iso8601DateTime = exports.iso8601Date = void 0; +const dayjs_1 = __importDefault(require("dayjs")); +const utc_1 = __importDefault(require("dayjs/plugin/utc")); +dayjs_1.default.extend(utc_1.default); +/** + * @namespace deserialize + */ +/** + * Parse a string into a Date object + * + * @param s - Date string in YYYY-MM-DD format + * @returns Date object, or the original date string if the argument is not a valid date + */ +function iso8601Date(s) { + return parseDate(s, "YYYY-MM-DD"); +} +exports.iso8601Date = iso8601Date; +/** + * Parse a string into a Date object + * + * @param s - Date string in YYYY-MM-DD[T]HH:mm:ss[Z] format + * @returns Date object, or the original date string if the argument is not a valid date + */ +function iso8601DateTime(s) { + return parseDate(s, "YYYY-MM-DD[T]HH:mm:ss[Z]"); +} +exports.iso8601DateTime = iso8601DateTime; +/** + * Parse a string into a Date object + * + * @param s - Date string in ddd, DD MMM YYYY HH:mm:ss [+0000] format + * @returns Date object, or the original date string if the argument is not a valid date + */ +function rfc2822DateTime(s) { + return parseDate(s, "ddd, DD MMM YYYY HH:mm:ss [+0000]"); +} +exports.rfc2822DateTime = rfc2822DateTime; +/** + * Parse a string into a decimal + * + * @param d - Decimal value as string + * @returns Number, or the original string if the argument is NaN + */ +function decimal(d) { + return parseNumber(d, parseFloat); +} +exports.decimal = decimal; +/** + * Parse a string into a integer + * + * @param i - Integer value as string + * @returns Number, or the original string if the argument is NaN + */ +function integer(i) { + return parseNumber(i, parseInt); +} +exports.integer = integer; +function parseDate(s, format) { + var m = dayjs_1.default.utc(s, format); + if (m.isValid()) { + return m.toDate(); + } + return s; +} +function parseNumber(n, parser) { + var parsed = parser(n); + if (typeof parsed === "number" && isNaN(parsed)) { + return n; + } + return parsed; +} diff --git a/node_modules/twilio/lib/base/serialize.d.ts b/node_modules/twilio/lib/base/serialize.d.ts new file mode 100644 index 00000000..d4b316d0 --- /dev/null +++ b/node_modules/twilio/lib/base/serialize.d.ts @@ -0,0 +1,53 @@ +import TwiML from "../twiml/TwiML"; +/** + * @namespace serialize + */ +/** + * Turns a Date object into a string if parameter is a Date otherwise returns the parameter + * + * @param d - date object to format + * @returns date formatted in YYYY-MM-DD form, otherwise the + * provided parameter. + */ +export declare function iso8601Date(date: T | Date): T | string; +/** + * Turns a Date object into a string if parameter is a Date otherwise returns the parameter + * + * @param d - date object to format + * @returns date formatted in YYYY-MM-DD[T]HH:mm:ss[Z] form, otherwise the + * provided parameter. + */ +export declare function iso8601DateTime(date: T | Date): T | string; +/** + * Turns a map of params int oa flattened map separated by dots if the parameter is an object, otherwise returns an empty map + * + * @param m - map to transform + * @param prefix - to append to each flattened value + * @returns flattened map + */ +export declare function prefixedCollapsibleMap(m: T, prefix?: string): T; +/** + * Turns an object into a JSON string if the parameter is an object, otherwise returns the passed in object + * + * @param o - json object or array + * @returns stringified object + */ +export declare function object(o: T): T; +/** + * Coerces a boolean literal into a string + * + * @param input - boolean or string to be coerced + * @returns a string 'true' or 'false' if passed a boolean, else the value + */ +export declare function bool(input: string | boolean): string | "true" | "false"; +export declare function twiml(input: TwiML | string): string; +type MapFunction = (input: TInput) => TOutput; +/** + * Maps transform over each element in input if input is an array + * + * @param input - array to map transform over, if not an array then it is + * returned as is. + * @returns new array with transform applied to each element. + */ +export declare function map(input: Array, transform: MapFunction): Array; +export {}; diff --git a/node_modules/twilio/lib/base/serialize.js b/node_modules/twilio/lib/base/serialize.js new file mode 100644 index 00000000..92132c39 --- /dev/null +++ b/node_modules/twilio/lib/base/serialize.js @@ -0,0 +1,122 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.map = exports.twiml = exports.bool = exports.object = exports.prefixedCollapsibleMap = exports.iso8601DateTime = exports.iso8601Date = void 0; +const dayjs_1 = __importDefault(require("dayjs")); +const utc_1 = __importDefault(require("dayjs/plugin/utc")); +dayjs_1.default.extend(utc_1.default); +/** + * @namespace serialize + */ +/** + * Turns a Date object into a string if parameter is a Date otherwise returns the parameter + * + * @param d - date object to format + * @returns date formatted in YYYY-MM-DD form, otherwise the + * provided parameter. + */ +function iso8601Date(date) { + if (!date || !(date instanceof Date)) { + return date; + } + else { + return dayjs_1.default.utc(date).format("YYYY-MM-DD"); + } +} +exports.iso8601Date = iso8601Date; +/** + * Turns a Date object into a string if parameter is a Date otherwise returns the parameter + * + * @param d - date object to format + * @returns date formatted in YYYY-MM-DD[T]HH:mm:ss[Z] form, otherwise the + * provided parameter. + */ +function iso8601DateTime(date) { + if (!date || !(date instanceof Date)) { + return date; + } + else { + return dayjs_1.default.utc(date).format("YYYY-MM-DD[T]HH:mm:ss[Z]"); + } +} +exports.iso8601DateTime = iso8601DateTime; +function prefixedCollapsibleMap(m, prefix) { + if (!m || + typeof m !== "object" || + Object.prototype.toString.call(m) !== "[object Object]") { + return {}; + } + function flatten(m, result, previous) { + result = result || {}; + previous = previous || []; + Object.keys(m).forEach((key) => { + const unionKeys = [...previous]; + if (!unionKeys.includes(key)) { + unionKeys.push(key); + } + if (typeof m[key] === "object" && + Object.prototype.toString.call(m[key]) === "[object Object]") { + flatten(m[key], result, unionKeys); + } + else { + result[unionKeys.join(".")] = m[key]; + } + }); + return result; + } + var flattened = flatten(m); + var result = flattened; + if (prefix) { + result = {}; + Object.keys(flattened).forEach((key) => { + result[prefix + "." + key] = flattened[key]; + }); + } + return result; +} +exports.prefixedCollapsibleMap = prefixedCollapsibleMap; +function object(o) { + if (typeof o === "object") { + return JSON.stringify(o); + } + return o; +} +exports.object = object; +/** + * Coerces a boolean literal into a string + * + * @param input - boolean or string to be coerced + * @returns a string 'true' or 'false' if passed a boolean, else the value + */ +function bool(input) { + if (typeof input === "string") { + return input; + } + if (typeof input === "boolean" || + (typeof input === "object" && + Object.prototype.toString.call(input) === "[object Boolean]")) { + return input.toString(); + } + return input; +} +exports.bool = bool; +function twiml(input) { + return input.toString(); +} +exports.twiml = twiml; +/** + * Maps transform over each element in input if input is an array + * + * @param input - array to map transform over, if not an array then it is + * returned as is. + * @returns new array with transform applied to each element. + */ +function map(input, transform) { + if (typeof input === "object" && Array.isArray(input)) { + return input.map((element) => transform(element)); + } + return input; +} +exports.map = map; diff --git a/node_modules/twilio/lib/base/utility.d.ts b/node_modules/twilio/lib/base/utility.d.ts new file mode 100644 index 00000000..004a0fa7 --- /dev/null +++ b/node_modules/twilio/lib/base/utility.d.ts @@ -0,0 +1,2 @@ +export declare const trim: (str: string, c?: string) => string; +export declare function isValidPathParam(param: any): boolean; diff --git a/node_modules/twilio/lib/base/utility.js b/node_modules/twilio/lib/base/utility.js new file mode 100644 index 00000000..bb2643c1 --- /dev/null +++ b/node_modules/twilio/lib/base/utility.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isValidPathParam = exports.trim = void 0; +const INVALID_PATH_PARAM_CHARS = ["/", "?"]; +const trim = (str, c = "\\s") => str.replace(new RegExp(`^([${c}]*)(.*?)([${c}]*)$`), "$2"); +exports.trim = trim; +function isValidPathParam(param) { + if (param === null || param === undefined) + return false; + const paramString = param.toString(); + return INVALID_PATH_PARAM_CHARS.every((invalidChar) => !paramString.includes(invalidChar)); +} +exports.isValidPathParam = isValidPathParam; diff --git a/node_modules/twilio/lib/base/values.d.ts b/node_modules/twilio/lib/base/values.d.ts new file mode 100644 index 00000000..f0723a6f --- /dev/null +++ b/node_modules/twilio/lib/base/values.d.ts @@ -0,0 +1,10 @@ +/** + * @namespace values + */ +/** + * Removes all undefined values of an object + * + * @param obj - object to filter + * @returns object with no undefined values + */ +export declare function of(obj: Object): Object; diff --git a/node_modules/twilio/lib/base/values.js b/node_modules/twilio/lib/base/values.js new file mode 100644 index 00000000..c7408252 --- /dev/null +++ b/node_modules/twilio/lib/base/values.js @@ -0,0 +1,16 @@ +"use strict"; +/** + * @namespace values + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.of = void 0; +/** + * Removes all undefined values of an object + * + * @param obj - object to filter + * @returns object with no undefined values + */ +function of(obj) { + return Object.fromEntries(Object.entries(obj).filter((entry) => entry[1] !== undefined)); +} +exports.of = of; diff --git a/node_modules/twilio/lib/http/request.d.ts b/node_modules/twilio/lib/http/request.d.ts new file mode 100644 index 00000000..30debd2d --- /dev/null +++ b/node_modules/twilio/lib/http/request.d.ts @@ -0,0 +1,25 @@ +import { HttpMethod } from "../interfaces"; +export interface RequestOptions { + method?: HttpMethod | "*"; + url?: string; + auth?: string; + params?: object | "*"; + data?: TData | "*"; + headers?: Headers; +} +export interface Headers { + [header: string]: string; +} +export default class Request { + method: HttpMethod | "*"; + url: string; + auth: string; + params: object | "*"; + data: TData | "*"; + headers: Headers | "*"; + constructor(opts?: RequestOptions); + get ANY(): "*"; + attributeEqual(lhs: any, rhs: any): boolean; + isEqual(other: Request): boolean; + toString(): string; +} diff --git a/node_modules/twilio/lib/http/request.js b/node_modules/twilio/lib/http/request.js new file mode 100644 index 00000000..a47258ee --- /dev/null +++ b/node_modules/twilio/lib/http/request.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Request { + constructor(opts) { + opts = opts || {}; + this.method = opts.method || this.ANY; + this.url = opts.url || this.ANY; + this.auth = opts.auth || this.ANY; + this.params = opts.params || this.ANY; + this.data = opts.data || this.ANY; + this.headers = opts.headers || this.ANY; + } + get ANY() { + return "*"; + } + attributeEqual(lhs, rhs) { + if (lhs === this.ANY || rhs === this.ANY) { + return true; + } + lhs = lhs || undefined; + rhs = rhs || undefined; + if (typeof lhs !== typeof rhs) { + return false; + } + if (typeof lhs !== "object") { + return lhs === rhs; + } + return (Object.entries(lhs) + .sort((a, b) => a[0].localeCompare(b[0])) + .toString() === + Object.entries(rhs) + .sort((a, b) => a[0].localeCompare(b[0])) + .toString()); + } + isEqual(other) { + return (this.attributeEqual(this.method, other.method) && + this.attributeEqual(this.url, other.url) && + this.attributeEqual(this.auth, other.auth) && + this.attributeEqual(this.params, other.params) && + this.attributeEqual(this.data, other.data) && + this.attributeEqual(this.headers, other.headers)); + } + toString() { + var auth = ""; + if (this.auth && this.auth !== this.ANY) { + auth = this.auth + " "; + } + var params = ""; + if (this.params && this.params !== this.ANY) { + params = + "?" + + Object.keys(this.params) + .map((key) => function () { + return key + "=" + this.params[key]; + }.bind(this)()) + .join("&"); + } + var data = ""; + if (this.data && this.data !== this.ANY) { + if (this.method === "get") { + data = "\n -G"; + } + data = + data + + "\n" + + Object.entries(this.data) + .map((d) => { + return " -d " + d[0] + "=" + d[1]; + }) + .join("\n"); + } + var headers = ""; + if (this.headers && this.headers !== this.ANY) { + headers = + "\n" + + Object.entries(this.headers) + .map((header) => { + return " -H " + header[0] + "=" + header[1]; + }) + .join("\n"); + } + return auth + this.method + " " + this.url + params + data + headers; + } +} +exports.default = Request; diff --git a/node_modules/twilio/lib/http/response.d.ts b/node_modules/twilio/lib/http/response.d.ts new file mode 100644 index 00000000..04b31126 --- /dev/null +++ b/node_modules/twilio/lib/http/response.d.ts @@ -0,0 +1,7 @@ +export default class Response { + statusCode: number; + body: TPayload; + headers: any; + constructor(statusCode: number, body: TPayload, headers: any); + toString(): string; +} diff --git a/node_modules/twilio/lib/http/response.js b/node_modules/twilio/lib/http/response.js new file mode 100644 index 00000000..3199a9c1 --- /dev/null +++ b/node_modules/twilio/lib/http/response.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Response { + constructor(statusCode, body, headers) { + this.statusCode = statusCode; + this.body = body; + this.headers = headers; + } + toString() { + return "HTTP " + this.statusCode + " " + this.body; + } +} +exports.default = Response; diff --git a/node_modules/twilio/lib/index.d.ts b/node_modules/twilio/lib/index.d.ts new file mode 100644 index 00000000..df49c014 --- /dev/null +++ b/node_modules/twilio/lib/index.d.ts @@ -0,0 +1,55 @@ +import ITwilio from "./rest/Twilio"; +import * as webhooks from "./webhooks/webhooks"; +import IRequestClient from "./base/RequestClient"; +import type { ClientOpts as IClientOpts } from "./base/BaseTwilio"; +import IAccessToken from "./jwt/AccessToken"; +import IClientCapability from "./jwt/ClientCapability"; +import ITaskRouterCapability from "./jwt/taskrouter/TaskRouterCapability"; +import * as taskRouterUtil from "./jwt/taskrouter/util"; +import IVoiceResponse from "./twiml/VoiceResponse"; +import IMessagingResponse from "./twiml/MessagingResponse"; +import IFaxResponse from "./twiml/FaxResponse"; +declare function TwilioSDK(accountSid?: string, authToken?: string, opts?: IClientOpts): TwilioSDK.Twilio; +declare namespace TwilioSDK { + type Twilio = ITwilio; + const Twilio: typeof ITwilio; + namespace jwt { + type AccessToken = IAccessToken; + const AccessToken: typeof IAccessToken; + type ClientCapability = IClientCapability; + const ClientCapability: typeof IClientCapability; + namespace taskrouter { + type TaskRouterCapability = ITaskRouterCapability; + const TaskRouterCapability: typeof ITaskRouterCapability; + const util: typeof taskRouterUtil; + } + } + namespace twiml { + type VoiceResponse = IVoiceResponse; + const VoiceResponse: typeof IVoiceResponse; + type MessagingResponse = IMessagingResponse; + const MessagingResponse: typeof IMessagingResponse; + type FaxResponse = IFaxResponse; + const FaxResponse: typeof IFaxResponse; + } + type RequestClient = IRequestClient; + const RequestClient: typeof IRequestClient; + type validateBody = typeof webhooks.validateBody; + const validateBody: typeof webhooks.validateBody; + type validateRequest = typeof webhooks.validateRequest; + const validateRequest: typeof webhooks.validateRequest; + type validateRequestWithBody = typeof webhooks.validateRequestWithBody; + const validateRequestWithBody: typeof webhooks.validateRequestWithBody; + type validateExpressRequest = typeof webhooks.validateExpressRequest; + const validateExpressRequest: typeof webhooks.validateExpressRequest; + type validateIncomingRequest = typeof webhooks.validateIncomingRequest; + const validateIncomingRequest: typeof webhooks.validateIncomingRequest; + type getExpectedBodyHash = typeof webhooks.getExpectedBodyHash; + const getExpectedBodyHash: typeof webhooks.getExpectedBodyHash; + type getExpectedTwilioSignature = typeof webhooks.getExpectedTwilioSignature; + const getExpectedTwilioSignature: typeof webhooks.getExpectedTwilioSignature; + type webhook = typeof webhooks.webhook; + const webhook: typeof webhooks.webhook; + type ClientOpts = IClientOpts; +} +export = TwilioSDK; diff --git a/node_modules/twilio/lib/index.js b/node_modules/twilio/lib/index.js new file mode 100644 index 00000000..743eb44d --- /dev/null +++ b/node_modules/twilio/lib/index.js @@ -0,0 +1,70 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Twilio_1 = __importDefault(require("./rest/Twilio")); +const webhooks = __importStar(require("./webhooks/webhooks")); +const RequestClient_1 = __importDefault(require("./base/RequestClient")); +const AccessToken_1 = __importDefault(require("./jwt/AccessToken")); +const ClientCapability_1 = __importDefault(require("./jwt/ClientCapability")); +const TaskRouterCapability_1 = __importDefault(require("./jwt/taskrouter/TaskRouterCapability")); +const taskRouterUtil = __importStar(require("./jwt/taskrouter/util")); +const VoiceResponse_1 = __importDefault(require("./twiml/VoiceResponse")); +const MessagingResponse_1 = __importDefault(require("./twiml/MessagingResponse")); +const FaxResponse_1 = __importDefault(require("./twiml/FaxResponse")); +// Shorthand to automatically create a RestClient +function TwilioSDK(accountSid, authToken, opts) { + return new TwilioSDK.Twilio(accountSid, authToken, opts); +} +(function (TwilioSDK) { + TwilioSDK.Twilio = Twilio_1.default; + let jwt; + (function (jwt) { + jwt.AccessToken = AccessToken_1.default; + jwt.ClientCapability = ClientCapability_1.default; + let taskrouter; + (function (taskrouter) { + taskrouter.TaskRouterCapability = TaskRouterCapability_1.default; + taskrouter.util = taskRouterUtil; + })(taskrouter = jwt.taskrouter || (jwt.taskrouter = {})); + })(jwt = TwilioSDK.jwt || (TwilioSDK.jwt = {})); + let twiml; + (function (twiml) { + twiml.VoiceResponse = VoiceResponse_1.default; + twiml.MessagingResponse = MessagingResponse_1.default; + twiml.FaxResponse = FaxResponse_1.default; + })(twiml = TwilioSDK.twiml || (TwilioSDK.twiml = {})); + TwilioSDK.RequestClient = RequestClient_1.default; + TwilioSDK.validateBody = webhooks.validateBody; + TwilioSDK.validateRequest = webhooks.validateRequest; + TwilioSDK.validateRequestWithBody = webhooks.validateRequestWithBody; + TwilioSDK.validateExpressRequest = webhooks.validateExpressRequest; + TwilioSDK.validateIncomingRequest = webhooks.validateIncomingRequest; + TwilioSDK.getExpectedBodyHash = webhooks.getExpectedBodyHash; + TwilioSDK.getExpectedTwilioSignature = webhooks.getExpectedTwilioSignature; + TwilioSDK.webhook = webhooks.webhook; +})(TwilioSDK || (TwilioSDK = {})); +module.exports = TwilioSDK; diff --git a/node_modules/twilio/lib/interfaces.d.ts b/node_modules/twilio/lib/interfaces.d.ts new file mode 100644 index 00000000..c5703a5e --- /dev/null +++ b/node_modules/twilio/lib/interfaces.d.ts @@ -0,0 +1,94 @@ +export type HttpMethod = "get" | "post" | "put" | "patch" | "delete"; +export type Url = string; +export type PhoneNumber = string; +export type PhoneNumberCapabilities = { + mms: boolean; + sms: boolean; + voice: boolean; + fax: boolean; +}; +export type Sid = string; +export interface ListEachOptions { + /** + * Upper limit for the number of records to return. + * each() guarantees never to return more than limit. + * Default is no limit + */ + limit?: number; + /** + * Number of records to fetch per request, + * when not set will use the default value of 50 records. + * If no pageSize is defined but a limit is defined, + * each() will attempt to read the limit with the most efficient + * page size, i.e. min(limit, 1000) + */ + pageSize?: number; + /** + * Function to process each record. If this and a positional + * callback are passed, this one will be used + */ + callback?: (item: TInstance, done: (err?: Error) => void) => void; + /** + * Function to be called upon completion of streaming + */ + done?: (err?: Error) => void; +} +export interface ListOptions { + /** + * Upper limit for the number of records to return. + * each() guarantees never to return more than limit. + * Default is no limit + */ + limit?: number; + /** + * Number of records to fetch per request, + * when not set will use the default value of 50 records. + * If no pageSize is defined but a limit is defined, + * each() will attempt to read the limit with the most efficient + * page size, i.e. min(limit, 1000) + */ + pageSize?: number; + /** + * Callback to handle list of records + */ + callback?: (items: TInstance[]) => void; +} +export interface PageOptions { + /** + * PageToken provided by the API + */ + pageToken?: string; + /** + * Page Number, this value is simply for client state + */ + pageNumber?: number; + /** + * Number of records to return, defaults to 50 + */ + pageSize?: number; + /** + * Callback to handle list of records + */ + callback?: (page: TPage) => void; +} +/** + * A generic type that returns all property names of a class whose type is not "function" + */ +export type NonFunctionPropertyNames = { + [K in keyof T]: T[K] extends Function ? never : K; +}[keyof T]; +/** + * A generic type that returns only properties of a class that are not functions + */ +export type NonFunctionProperties = Pick>; +/** + * A type alias for better readibility + */ +export type Json = NonFunctionProperties; +export declare class SerializableClass { + /** + * Converts the current instance in a regular JSON. + * It will be automatically called by JSON.stringify() + */ + toJSON(): Json; +} diff --git a/node_modules/twilio/lib/interfaces.js b/node_modules/twilio/lib/interfaces.js new file mode 100644 index 00000000..c8ad2e54 --- /dev/null +++ b/node_modules/twilio/lib/interfaces.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/twilio/lib/jwt/AccessToken.d.ts b/node_modules/twilio/lib/jwt/AccessToken.d.ts new file mode 100644 index 00000000..9f608bb1 --- /dev/null +++ b/node_modules/twilio/lib/jwt/AccessToken.d.ts @@ -0,0 +1,186 @@ +declare class AccessToken implements AccessToken.AccessTokenOptions { + static DEFAULT_ALGORITHM: "HS256"; + static ALGORITHMS: string[]; + accountSid: string; + keySid: string; + secret: string; + ttl: number; + identity: string; + nbf?: number; + region?: string; + grants: AccessToken.Grant[]; + /** + * @param accountSid - The account's unique ID to which access is scoped + * @param keySid - The signing key's unique ID + * @param secret - The secret to sign the token with + * @param options - ... + * @param options.ttl - Time to live in seconds (default 3600) + * @param options.identity - The identity of the first person. Required. + * @param options.nbf - Time from epoch in seconds for not before value + * @param options.region - The region value associated with this account + */ + constructor(accountSid: string, keySid: string, secret: string, options: AccessToken.AccessTokenOptions); + addGrant>(grant: T): void; + toJwt(algorithm?: "HS256" | "HS384" | "HS512"): string; +} +declare namespace AccessToken { + abstract class Grant { + key: TKey; + protected constructor(key: TKey); + abstract toPayload(): TPayload; + } + interface TaskRouterGrantOptions { + workspaceSid?: string; + workerSid?: string; + role?: string; + } + interface TaskRouterGrantPayload { + workspace_sid?: string; + worker_sid?: string; + role?: string; + } + interface ChatGrantOptions { + serviceSid?: string; + endpointId?: string; + deploymentRoleSid?: string; + pushCredentialSid?: string; + } + interface ChatGrantPayload { + service_sid?: string; + endpoint_id?: string; + deployment_role_sid?: string; + push_credential_sid?: string; + } + interface VideoGrantOptions { + room?: string; + } + interface VideoGrantPayload { + room?: string; + } + interface SyncGrantOptions { + serviceSid?: string; + endpointId?: string; + } + interface SyncGrantPayload { + service_sid?: string; + endpoint_id?: string; + } + interface VoiceGrantOptions { + incomingAllow?: boolean; + outgoingApplicationSid?: string; + outgoingApplicationParams?: object; + pushCredentialSid?: string; + endpointId?: string; + } + interface VoiceGrantPayload { + incoming?: { + allow: boolean; + }; + outgoing?: { + application_sid: string; + params?: object; + }; + push_credential_sid?: string; + endpoint_id?: string; + } + interface PlaybackGrantOptions { + grant?: object; + } + interface PlaybackGrantPayload { + grant?: object; + } + interface AccessTokenOptions { + /** + * Time to live in seconds + */ + ttl?: number; + /** + * The identity of the first person. Required. + */ + identity: string; + /** + * Time from epoch in seconds for not before value + */ + nbf?: number; + /** + * The region value associated with this account + */ + region?: string; + } + class TaskRouterGrant extends Grant implements TaskRouterGrantOptions { + workspaceSid?: string; + workerSid?: string; + role?: string; + /** + * @param options - ... + * @param options.workspaceSid - The workspace unique ID + * @param options.workerSid - The worker unique ID + * @param options.role - The role of the grant + */ + constructor(options?: TaskRouterGrantOptions); + toPayload(): TaskRouterGrantPayload; + } + class ChatGrant extends Grant implements ChatGrantOptions { + serviceSid?: string; + endpointId?: string; + deploymentRoleSid?: string; + pushCredentialSid?: string; + /** + * @param options - ... + * @param options.serviceSid - The service unique ID + * @param options.endpointId - The endpoint ID + * @param options.deploymentRoleSid - SID of the deployment role to be + * assigned to the user + * @param options.pushCredentialSid - The Push Credentials SID + */ + constructor(options?: ChatGrantOptions); + toPayload(): ChatGrantPayload; + } + class VideoGrant extends Grant implements VideoGrantOptions { + room?: string; + /** + * @param options - ... + * @param options.room - The Room name or Room sid. + */ + constructor(options?: VideoGrantOptions); + toPayload(): VideoGrantPayload; + } + class SyncGrant extends Grant implements SyncGrantOptions { + serviceSid?: string; + endpointId?: string; + /** + * @param options.serviceSid - The service unique ID + * @param options.endpointId - The endpoint ID + */ + constructor(options?: SyncGrantOptions); + toPayload(): SyncGrantPayload; + } + class VoiceGrant extends Grant implements VoiceGrantOptions { + incomingAllow?: boolean; + outgoingApplicationSid?: string; + outgoingApplicationParams?: object; + pushCredentialSid?: string; + endpointId?: string; + /** + * @param options - ... + * @param options.incomingAllow - Whether or not this endpoint is allowed to receive incoming calls as grants.identity + * @param options.outgoingApplicationSid - application sid to call when placing outgoing call + * @param options.outgoingApplicationParams - request params to pass to the application + * @param options.pushCredentialSid - Push Credential Sid to use when registering to receive incoming call notifications + * @param options.endpointId - Specify an endpoint identifier for this device, which will allow the developer + * to direct calls to a specific endpoint when multiple devices are associated with a single identity + */ + constructor(options?: VoiceGrantOptions); + toPayload(): VoiceGrantPayload; + } + class PlaybackGrant extends Grant implements PlaybackGrantOptions { + grant?: object; + /** + * @param options - ... + * @param options.grant - The PlaybackGrant retrieved from Twilio's API + */ + constructor(options?: PlaybackGrantOptions); + toPayload(): PlaybackGrantPayload; + } +} +export = AccessToken; diff --git a/node_modules/twilio/lib/jwt/AccessToken.js b/node_modules/twilio/lib/jwt/AccessToken.js new file mode 100644 index 00000000..5a2c0caa --- /dev/null +++ b/node_modules/twilio/lib/jwt/AccessToken.js @@ -0,0 +1,256 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); +class AccessToken { + /** + * @param accountSid - The account's unique ID to which access is scoped + * @param keySid - The signing key's unique ID + * @param secret - The secret to sign the token with + * @param options - ... + * @param options.ttl - Time to live in seconds (default 3600) + * @param options.identity - The identity of the first person. Required. + * @param options.nbf - Time from epoch in seconds for not before value + * @param options.region - The region value associated with this account + */ + constructor(accountSid, keySid, secret, options) { + if (!accountSid) { + throw new Error("accountSid is required"); + } + if (!keySid) { + throw new Error("keySid is required"); + } + if (!secret) { + throw new Error("secret is required"); + } + if (!options || !options.identity) { + throw new Error("identity is required to be specified in options"); + } + this.accountSid = accountSid; + this.keySid = keySid; + this.secret = secret; + this.ttl = options.ttl || 3600; + this.identity = options.identity; + this.nbf = options.nbf; + this.region = options.region; + this.grants = []; + } + addGrant(grant) { + this.grants.push(grant); + } + toJwt(algorithm) { + algorithm = algorithm || AccessToken.DEFAULT_ALGORITHM; + if (!AccessToken.ALGORITHMS.includes(algorithm)) { + throw new Error("Algorithm not supported. Allowed values are " + + AccessToken.ALGORITHMS.join(", ")); + } + let grants = {}; + if (Number.isInteger(this.identity) || typeof this.identity === "string") { + grants.identity = String(this.identity); + } + for (const grant of this.grants) { + grants[grant.key] = grant.toPayload(); + } + const now = Math.floor(Date.now() / 1000); + let payload = { + jti: this.keySid + "-" + now, + grants: grants, + }; + if (typeof this.nbf === "number") { + payload.nbf = this.nbf; + } + let header = { + cty: "twilio-fpa;v=1", + typ: "JWT", + }; + if (this.region && typeof this.region === "string") { + header.twr = this.region; + } + return jsonwebtoken_1.default.sign(payload, this.secret, { + header: header, + algorithm: algorithm, + issuer: this.keySid, + subject: this.accountSid, + expiresIn: this.ttl, + }); + } +} +AccessToken.DEFAULT_ALGORITHM = "HS256"; +AccessToken.ALGORITHMS = ["HS256", "HS384", "HS512"]; +(function (AccessToken) { + class Grant { + constructor(key) { + this.key = key; + } + } + AccessToken.Grant = Grant; + class TaskRouterGrant extends Grant { + /** + * @param options - ... + * @param options.workspaceSid - The workspace unique ID + * @param options.workerSid - The worker unique ID + * @param options.role - The role of the grant + */ + constructor(options) { + options = options || {}; + super("task_router"); + this.workspaceSid = options.workspaceSid; + this.workerSid = options.workerSid; + this.role = options.role; + } + toPayload() { + let grant = {}; + if (this.workspaceSid) { + grant.workspace_sid = this.workspaceSid; + } + if (this.workerSid) { + grant.worker_sid = this.workerSid; + } + if (this.role) { + grant.role = this.role; + } + return grant; + } + } + AccessToken.TaskRouterGrant = TaskRouterGrant; + class ChatGrant extends Grant { + /** + * @param options - ... + * @param options.serviceSid - The service unique ID + * @param options.endpointId - The endpoint ID + * @param options.deploymentRoleSid - SID of the deployment role to be + * assigned to the user + * @param options.pushCredentialSid - The Push Credentials SID + */ + constructor(options) { + options = options || {}; + super("chat"); + this.serviceSid = options.serviceSid; + this.endpointId = options.endpointId; + this.deploymentRoleSid = options.deploymentRoleSid; + this.pushCredentialSid = options.pushCredentialSid; + } + toPayload() { + let grant = {}; + if (this.serviceSid) { + grant.service_sid = this.serviceSid; + } + if (this.endpointId) { + grant.endpoint_id = this.endpointId; + } + if (this.deploymentRoleSid) { + grant.deployment_role_sid = this.deploymentRoleSid; + } + if (this.pushCredentialSid) { + grant.push_credential_sid = this.pushCredentialSid; + } + return grant; + } + } + AccessToken.ChatGrant = ChatGrant; + class VideoGrant extends Grant { + /** + * @param options - ... + * @param options.room - The Room name or Room sid. + */ + constructor(options) { + options = options || {}; + super("video"); + this.room = options.room; + } + toPayload() { + let grant = {}; + if (this.room) { + grant.room = this.room; + } + return grant; + } + } + AccessToken.VideoGrant = VideoGrant; + class SyncGrant extends Grant { + /** + * @param options.serviceSid - The service unique ID + * @param options.endpointId - The endpoint ID + */ + constructor(options) { + options = options || {}; + super("data_sync"); + this.serviceSid = options.serviceSid; + this.endpointId = options.endpointId; + } + toPayload() { + let grant = {}; + if (this.serviceSid) { + grant.service_sid = this.serviceSid; + } + if (this.endpointId) { + grant.endpoint_id = this.endpointId; + } + return grant; + } + } + AccessToken.SyncGrant = SyncGrant; + class VoiceGrant extends Grant { + /** + * @param options - ... + * @param options.incomingAllow - Whether or not this endpoint is allowed to receive incoming calls as grants.identity + * @param options.outgoingApplicationSid - application sid to call when placing outgoing call + * @param options.outgoingApplicationParams - request params to pass to the application + * @param options.pushCredentialSid - Push Credential Sid to use when registering to receive incoming call notifications + * @param options.endpointId - Specify an endpoint identifier for this device, which will allow the developer + * to direct calls to a specific endpoint when multiple devices are associated with a single identity + */ + constructor(options) { + options = options || {}; + super("voice"); + this.incomingAllow = options.incomingAllow; + this.outgoingApplicationSid = options.outgoingApplicationSid; + this.outgoingApplicationParams = options.outgoingApplicationParams; + this.pushCredentialSid = options.pushCredentialSid; + this.endpointId = options.endpointId; + } + toPayload() { + let grant = {}; + if (this.incomingAllow === true) { + grant.incoming = { allow: true }; + } + if (this.outgoingApplicationSid) { + grant.outgoing = { + application_sid: this.outgoingApplicationSid, + }; + if (this.outgoingApplicationParams) { + grant.outgoing.params = this.outgoingApplicationParams; + } + } + if (this.pushCredentialSid) { + grant.push_credential_sid = this.pushCredentialSid; + } + if (this.endpointId) { + grant.endpoint_id = this.endpointId; + } + return grant; + } + } + AccessToken.VoiceGrant = VoiceGrant; + class PlaybackGrant extends Grant { + /** + * @param options - ... + * @param options.grant - The PlaybackGrant retrieved from Twilio's API + */ + constructor(options) { + options = options || {}; + super("player"); + this.grant = options.grant; + } + toPayload() { + let grant = {}; + if (this.grant) { + grant = this.grant; + } + return grant; + } + } + AccessToken.PlaybackGrant = PlaybackGrant; +})(AccessToken || (AccessToken = {})); +module.exports = AccessToken; diff --git a/node_modules/twilio/lib/jwt/ClientCapability.d.ts b/node_modules/twilio/lib/jwt/ClientCapability.d.ts new file mode 100644 index 00000000..0b785a69 --- /dev/null +++ b/node_modules/twilio/lib/jwt/ClientCapability.d.ts @@ -0,0 +1,61 @@ +export interface Scope { + scope: string; + payload(): string; +} +export interface OutgoingClientScopeOptions { + applicationSid: string; + clientName?: string; + params?: object; +} +export interface ClientCapabilityOptions { + accountSid: string; + authToken: string; + ttl?: number; +} +/** + * @param filters + */ +export declare class EventStreamScope implements Scope { + scope: string; + filters: object; + constructor(filters?: object); + payload(): string; +} +/** + * @param clientName + */ +export declare class IncomingClientScope implements Scope { + scope: string; + clientName: string; + constructor(clientName: string); + payload(): string; +} +export declare class OutgoingClientScope implements Scope { + scope: string; + applicationSid: string; + clientName?: string; + params?: object; + /** + * @param options - ... + * @param options.applicationSid - the application sid + * @param options.clientName - the client name + * @param options.params - parameters + */ + constructor(options: OutgoingClientScopeOptions); + payload(): string; +} +/** + * @param options + */ +export default class ClientCapability { + static EventStreamScope: typeof EventStreamScope; + static IncomingClientScope: typeof IncomingClientScope; + static OutgoingClientScope: typeof OutgoingClientScope; + accountSid: string; + authToken: string; + ttl: number; + scopes: Scope[]; + constructor(options: ClientCapabilityOptions); + addScope(scope: Scope): void; + toJwt(): string; +} diff --git a/node_modules/twilio/lib/jwt/ClientCapability.js b/node_modules/twilio/lib/jwt/ClientCapability.js new file mode 100644 index 00000000..d83d6b89 --- /dev/null +++ b/node_modules/twilio/lib/jwt/ClientCapability.js @@ -0,0 +1,122 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OutgoingClientScope = exports.IncomingClientScope = exports.EventStreamScope = void 0; +const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); +const querystring_1 = __importDefault(require("querystring")); +/** + * @param filters + */ +class EventStreamScope { + constructor(filters) { + this.scope = "scope:stream:subscribe"; + this.filters = filters || {}; + } + payload() { + var queryArgs = ["path=/2010-04-01/Events"]; + if (Object.keys(this.filters).length > 0) { + var queryParams = Object.entries(this.filters).map((filter) => { + return [querystring_1.default.escape(filter[0]), querystring_1.default.escape(filter[1])].join("="); + }); + var filterParams = queryParams.join("&"); + queryArgs.push(["appParams", querystring_1.default.escape(filterParams)].join("=")); + } + var queryString = queryArgs.join("&"); + return [this.scope, queryString].join("?"); + } +} +exports.EventStreamScope = EventStreamScope; +/** + * @param clientName + */ +class IncomingClientScope { + constructor(clientName) { + this.scope = "scope:client:incoming"; + this.clientName = clientName; + } + payload() { + var query = ["clientName", querystring_1.default.escape(this.clientName)].join("="); + return [this.scope, query].join("?"); + } +} +exports.IncomingClientScope = IncomingClientScope; +class OutgoingClientScope { + /** + * @param options - ... + * @param options.applicationSid - the application sid + * @param options.clientName - the client name + * @param options.params - parameters + */ + constructor(options) { + this.scope = "scope:client:outgoing"; + if (!options) { + throw new Error('Required parameter "options" missing.'); + } + if (typeof options !== "object") { + throw new TypeError('Parameter "options" must be a type Object'); + } + if (!options.applicationSid) { + throw new Error('Required parameter "options.applicationSid" missing.'); + } + this.applicationSid = options.applicationSid; + this.clientName = options.clientName; + this.params = options.params; + } + payload() { + var queryArgs = [["appSid", querystring_1.default.escape(this.applicationSid)].join("=")]; + if (typeof this.clientName === "string") { + queryArgs.push(["clientName", querystring_1.default.escape(this.clientName)].join("=")); + } + if (typeof this.params === "object") { + var queryParams = Object.entries(this.params).map((param) => { + return [querystring_1.default.escape(param[0]), querystring_1.default.escape(param[1])].join("="); + }); + var filterParams = queryParams.join("&"); + queryArgs.push(["appParams", querystring_1.default.escape(filterParams)].join("=")); + } + var queryString = queryArgs.join("&"); + return [this.scope, queryString].join("?"); + } +} +exports.OutgoingClientScope = OutgoingClientScope; +/** + * @param options + */ +class ClientCapability { + constructor(options) { + if (!options) { + throw new Error('Required parameter "options" missing.'); + } + if (typeof options !== "object") { + throw new TypeError('Parameter "options" must be a type Object'); + } + if (!options.accountSid) { + throw new Error('Required parameter "options.accountSid" missing.'); + } + if (!options.authToken) { + throw new Error('Required parameter "options.authToken" missing.'); + } + this.accountSid = options.accountSid; + this.authToken = options.authToken; + this.ttl = options.ttl || 3600; + this.scopes = []; + } + addScope(scope) { + this.scopes.push(scope); + } + toJwt() { + const scope = this.scopes.map((scope) => scope.payload()).join(" "); + var payload = { + scope: scope, + iss: this.accountSid, + exp: Math.floor(new Date().valueOf() / 1000) + this.ttl, + }; + return jsonwebtoken_1.default.sign(payload, this.authToken); + } +} +exports.default = ClientCapability; +ClientCapability.EventStreamScope = EventStreamScope; +ClientCapability.IncomingClientScope = IncomingClientScope; +ClientCapability.OutgoingClientScope = OutgoingClientScope; diff --git a/node_modules/twilio/lib/jwt/taskrouter/TaskRouterCapability.d.ts b/node_modules/twilio/lib/jwt/taskrouter/TaskRouterCapability.d.ts new file mode 100644 index 00000000..3f99c6b8 --- /dev/null +++ b/node_modules/twilio/lib/jwt/taskrouter/TaskRouterCapability.d.ts @@ -0,0 +1,74 @@ +export interface TaskRouterCapabilityOptions { + accountSid: string; + authToken: string; + workspaceSid: string; + channelId: string; + friendlyName?: string; + ttl?: number; + version?: string; +} +export interface PolicyOptions { + /** Policy URL */ + url?: string; + /** HTTP Method */ + method?: string; + /** Request query filter allowances */ + queryFilter?: object; + /** Request post filter allowances */ + postFilter?: object; + /** Allow the policy */ + allow?: boolean; +} +export interface PolicyPayload { + url: string; + method: string; + query_filter: object; + post_filter: object; + allow: boolean; +} +/** + * Create a new Policy + */ +export declare class Policy { + url: string; + method: string; + queryFilter: object; + postFilter: object; + allow: boolean; + /** + * Create a new Policy instance + * + * @param options - ... + * @param options.url - Policy URL + * @param options.method - HTTP Method + * @param options.queryFilter - Request query filter allowances + * @param options.postFilter - Request post filter allowances + * @param options.allowed - Allow the policy + */ + constructor(options?: PolicyOptions); + payload(): PolicyPayload; +} +export default class TaskRouterCapability { + accountSid: string; + authToken: string; + workspaceSid: string; + channelId: string; + ttl: number; + version: string; + policies: Policy[]; + friendlyName?: string; + /** + * @param options - ... + * @param options.accountSid - account sid + * @param options.authToken - auth token + * @param options.workspaceSid - workspace sid + * @param options.channelId - taskrouter channel id + * @param options.friendlyName - friendly name for the jwt + * @param options.ttl - time to live + * @param options.version - taskrouter version + */ + constructor(options: TaskRouterCapabilityOptions); + static Policy: typeof Policy; + addPolicy(policy: Policy): void; + toJwt(): string; +} diff --git a/node_modules/twilio/lib/jwt/taskrouter/TaskRouterCapability.js b/node_modules/twilio/lib/jwt/taskrouter/TaskRouterCapability.js new file mode 100644 index 00000000..8937e772 --- /dev/null +++ b/node_modules/twilio/lib/jwt/taskrouter/TaskRouterCapability.js @@ -0,0 +1,101 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Policy = void 0; +const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); +/** + * Create a new Policy + */ +class Policy { + /** + * Create a new Policy instance + * + * @param options - ... + * @param options.url - Policy URL + * @param options.method - HTTP Method + * @param options.queryFilter - Request query filter allowances + * @param options.postFilter - Request post filter allowances + * @param options.allowed - Allow the policy + */ + constructor(options) { + options = options || {}; + this.url = options.url || ""; + this.method = options.method || "GET"; + this.queryFilter = options.queryFilter || {}; + this.postFilter = options.postFilter || {}; + this.allow = options.allow || true; + } + payload() { + return { + url: this.url, + method: this.method, + query_filter: this.queryFilter, + post_filter: this.postFilter, + allow: this.allow, + }; + } +} +exports.Policy = Policy; +class TaskRouterCapability { + /** + * @param options - ... + * @param options.accountSid - account sid + * @param options.authToken - auth token + * @param options.workspaceSid - workspace sid + * @param options.channelId - taskrouter channel id + * @param options.friendlyName - friendly name for the jwt + * @param options.ttl - time to live + * @param options.version - taskrouter version + */ + constructor(options) { + if (!options) { + throw new Error('Required parameter "options" missing.'); + } + if (!options.accountSid) { + throw new Error('Required parameter "options.accountSid" missing.'); + } + if (!options.authToken) { + throw new Error('Required parameter "options.authToken" missing.'); + } + if (!options.workspaceSid) { + throw new Error('Required parameter "options.workspaceSid" missing.'); + } + if (!options.channelId) { + throw new Error('Required parameter "options.channelId" missing.'); + } + this.accountSid = options.accountSid; + this.authToken = options.authToken; + this.workspaceSid = options.workspaceSid; + this.channelId = options.channelId; + this.friendlyName = options.friendlyName; + this.ttl = options.ttl || 3600; + this.version = options.version || "v1"; + this.policies = []; + } + addPolicy(policy) { + this.policies.push(policy); + } + toJwt() { + var payload = { + iss: this.accountSid, + exp: Math.floor(new Date().valueOf() / 1000) + this.ttl, + version: this.version, + friendly_name: this.friendlyName, + account_sid: this.accountSid, + channel: this.channelId, + workspace_sid: this.workspaceSid, + policies: this.policies.map((policy) => policy.payload()), + }; + if (this.channelId.startsWith("WK")) { + payload.worker_sid = this.channelId; + } + else if (this.channelId.startsWith("WQ")) { + payload.taskqueue_sid = this.channelId; + } + return jsonwebtoken_1.default.sign(payload, this.authToken); + } +} +exports.default = TaskRouterCapability; +TaskRouterCapability.Policy = Policy; diff --git a/node_modules/twilio/lib/jwt/taskrouter/util.d.ts b/node_modules/twilio/lib/jwt/taskrouter/util.d.ts new file mode 100644 index 00000000..3faa9292 --- /dev/null +++ b/node_modules/twilio/lib/jwt/taskrouter/util.d.ts @@ -0,0 +1,66 @@ +import { Policy } from "./TaskRouterCapability"; +/** + * Build the default Policies for a worker + * + * @param version - TaskRouter version + * @param workspaceSid - workspace sid + * @param workerSid - worker sid + * @returns list of Policies + */ +export declare function defaultWorkerPolicies(version: string, workspaceSid: string, workerSid: string): Policy[]; +/** + * Build the default Event Bridge Policies + * + * @param accountSid - account sid + * @param channelId - channel id + * @returns list of Policies + */ +export declare function defaultEventBridgePolicies(accountSid: string, channelId: string): Policy[]; +/** + * Generate TaskRouter workspace url + * + * @param workspaceSid - workspace sid or '**' for all workspaces + * @returns generated url + */ +export declare function workspacesUrl(workspaceSid?: string): string; +/** + * Generate TaskRouter task queue url + * + * @param workspaceSid - workspace sid + * @param taskQueueSid - task queue sid or '**' for all task queues + * @returns generated url + */ +export declare function taskQueuesUrl(workspaceSid: string, taskQueueSid?: string): string; +/** + * Generate TaskRouter task url + * + * @param workspaceSid - workspace sid + * @param taskSid - task sid or '**' for all tasks + * @returns generated url + */ +export declare function tasksUrl(workspaceSid: string, taskSid?: string): string; +/** + * Generate TaskRouter activity url + * + * @param workspaceSid - workspace sid + * @param activitySid - activity sid or '**' for all activities + * @returns generated url + */ +export declare function activitiesUrl(workspaceSid: string, activitySid?: string): string; +/** + * Generate TaskRouter worker url + * + * @param workspaceSid - workspace sid + * @param workerSid - worker sid or '**' for all workers + * @returns generated url + */ +export declare function workersUrl(workspaceSid: string, workerSid?: string): string; +/** + * Generate TaskRouter worker reservation url + * + * @param workspaceSid - workspace sid + * @param workerSid - worker sid + * @param reservationSid - reservation sid or '**' for all reservations + * @returns generated url + */ +export declare function reservationsUrl(workspaceSid: string, workerSid: string, reservationSid?: string): string; diff --git a/node_modules/twilio/lib/jwt/taskrouter/util.js b/node_modules/twilio/lib/jwt/taskrouter/util.js new file mode 100644 index 00000000..7f35baf9 --- /dev/null +++ b/node_modules/twilio/lib/jwt/taskrouter/util.js @@ -0,0 +1,169 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.reservationsUrl = exports.workersUrl = exports.activitiesUrl = exports.tasksUrl = exports.taskQueuesUrl = exports.workspacesUrl = exports.defaultEventBridgePolicies = exports.defaultWorkerPolicies = void 0; +const TaskRouterCapability_1 = require("./TaskRouterCapability"); +const EVENT_URL_BASE = "https://event-bridge.twilio.com/v1/wschannels"; +const TASKROUTER_BASE_URL = "https://taskrouter.twilio.com"; +const TASKROUTER_VERSION = "v1"; +/** + * Build the default Policies for a worker + * + * @param version - TaskRouter version + * @param workspaceSid - workspace sid + * @param workerSid - worker sid + * @returns list of Policies + */ +function defaultWorkerPolicies(version, workspaceSid, workerSid) { + var activities = new TaskRouterCapability_1.Policy({ + url: [ + TASKROUTER_BASE_URL, + version, + "Workspaces", + workspaceSid, + "Activities", + ].join("/"), + method: "GET", + allow: true, + }); + var tasks = new TaskRouterCapability_1.Policy({ + url: [ + TASKROUTER_BASE_URL, + version, + "Workspaces", + workspaceSid, + "Tasks", + "**", + ].join("/"), + method: "GET", + allow: true, + }); + var reservations = new TaskRouterCapability_1.Policy({ + url: [ + TASKROUTER_BASE_URL, + version, + "Workspaces", + workspaceSid, + "Workers", + workerSid, + "Reservations", + "**", + ].join("/"), + method: "GET", + allow: true, + }); + var workerFetch = new TaskRouterCapability_1.Policy({ + url: [ + TASKROUTER_BASE_URL, + version, + "Workspaces", + workspaceSid, + "Workers", + workerSid, + ].join("/"), + method: "GET", + allow: true, + }); + return [activities, tasks, reservations, workerFetch]; +} +exports.defaultWorkerPolicies = defaultWorkerPolicies; +/** + * Build the default Event Bridge Policies + * + * @param accountSid - account sid + * @param channelId - channel id + * @returns list of Policies + */ +function defaultEventBridgePolicies(accountSid, channelId) { + var url = [EVENT_URL_BASE, accountSid, channelId].join("/"); + return [ + new TaskRouterCapability_1.Policy({ + url: url, + method: "GET", + allow: true, + }), + new TaskRouterCapability_1.Policy({ + url: url, + method: "POST", + allow: true, + }), + ]; +} +exports.defaultEventBridgePolicies = defaultEventBridgePolicies; +/** + * Generate TaskRouter workspace url + * + * @param workspaceSid - workspace sid or '**' for all workspaces + * @returns generated url + */ +function workspacesUrl(workspaceSid) { + return [TASKROUTER_BASE_URL, TASKROUTER_VERSION, "Workspaces", workspaceSid] + .filter((item) => typeof item === "string") + .join("/"); +} +exports.workspacesUrl = workspacesUrl; +/** + * Generate TaskRouter task queue url + * + * @param workspaceSid - workspace sid + * @param taskQueueSid - task queue sid or '**' for all task queues + * @returns generated url + */ +function taskQueuesUrl(workspaceSid, taskQueueSid) { + return [workspacesUrl(workspaceSid), "TaskQueues", taskQueueSid] + .filter((item) => typeof item === "string") + .join("/"); +} +exports.taskQueuesUrl = taskQueuesUrl; +/** + * Generate TaskRouter task url + * + * @param workspaceSid - workspace sid + * @param taskSid - task sid or '**' for all tasks + * @returns generated url + */ +function tasksUrl(workspaceSid, taskSid) { + return [workspacesUrl(workspaceSid), "Tasks", taskSid] + .filter((item) => typeof item === "string") + .join("/"); +} +exports.tasksUrl = tasksUrl; +/** + * Generate TaskRouter activity url + * + * @param workspaceSid - workspace sid + * @param activitySid - activity sid or '**' for all activities + * @returns generated url + */ +function activitiesUrl(workspaceSid, activitySid) { + return [workspacesUrl(workspaceSid), "Activities", activitySid] + .filter((item) => typeof item === "string") + .join("/"); +} +exports.activitiesUrl = activitiesUrl; +/** + * Generate TaskRouter worker url + * + * @param workspaceSid - workspace sid + * @param workerSid - worker sid or '**' for all workers + * @returns generated url + */ +function workersUrl(workspaceSid, workerSid) { + return [workspacesUrl(workspaceSid), "Workers", workerSid] + .filter((item) => typeof item === "string") + .join("/"); +} +exports.workersUrl = workersUrl; +/** + * Generate TaskRouter worker reservation url + * + * @param workspaceSid - workspace sid + * @param workerSid - worker sid + * @param reservationSid - reservation sid or '**' for all reservations + * @returns generated url + */ +function reservationsUrl(workspaceSid, workerSid, reservationSid) { + return [workersUrl(workspaceSid, workerSid), "Reservations", reservationSid] + .filter((item) => typeof item === "string") + .join("/"); +} +exports.reservationsUrl = reservationsUrl; diff --git a/node_modules/twilio/lib/rest/Accounts.d.ts b/node_modules/twilio/lib/rest/Accounts.d.ts new file mode 100644 index 00000000..ea997cbc --- /dev/null +++ b/node_modules/twilio/lib/rest/Accounts.d.ts @@ -0,0 +1,19 @@ +import { AuthTokenPromotionListInstance } from "./accounts/v1/authTokenPromotion"; +import { CredentialListInstance } from "./accounts/v1/credential"; +import { SecondaryAuthTokenListInstance } from "./accounts/v1/secondaryAuthToken"; +import AccountsBase from "./AccountsBase"; +declare class Accounts extends AccountsBase { + /** + * @deprecated - Use v1.authTokenPromotion; instead + */ + get authTokenPromotion(): AuthTokenPromotionListInstance; + /** + * @deprecated - Use v1.credentials; instead + */ + get credentials(): CredentialListInstance; + /** + * @deprecated - Use v1.secondaryAuthToken; instead + */ + get secondaryAuthToken(): SecondaryAuthTokenListInstance; +} +export = Accounts; diff --git a/node_modules/twilio/lib/rest/Accounts.js b/node_modules/twilio/lib/rest/Accounts.js new file mode 100644 index 00000000..7a23c041 --- /dev/null +++ b/node_modules/twilio/lib/rest/Accounts.js @@ -0,0 +1,29 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const AccountsBase_1 = __importDefault(require("./AccountsBase")); +class Accounts extends AccountsBase_1.default { + /** + * @deprecated - Use v1.authTokenPromotion; instead + */ + get authTokenPromotion() { + console.warn("authTokenPromotion is deprecated. Use v1.authTokenPromotion; instead."); + return this.v1.authTokenPromotion; + } + /** + * @deprecated - Use v1.credentials; instead + */ + get credentials() { + console.warn("credentials is deprecated. Use v1.credentials; instead."); + return this.v1.credentials; + } + /** + * @deprecated - Use v1.secondaryAuthToken; instead + */ + get secondaryAuthToken() { + console.warn("secondaryAuthToken is deprecated. Use v1.secondaryAuthToken; instead."); + return this.v1.secondaryAuthToken; + } +} +module.exports = Accounts; diff --git a/node_modules/twilio/lib/rest/AccountsBase.d.ts b/node_modules/twilio/lib/rest/AccountsBase.d.ts new file mode 100644 index 00000000..cfd33ca7 --- /dev/null +++ b/node_modules/twilio/lib/rest/AccountsBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./accounts/V1"; +declare class AccountsBase extends Domain { + _v1?: V1; + /** + * Initialize accounts domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = AccountsBase; diff --git a/node_modules/twilio/lib/rest/AccountsBase.js b/node_modules/twilio/lib/rest/AccountsBase.js new file mode 100644 index 00000000..b9f8fce8 --- /dev/null +++ b/node_modules/twilio/lib/rest/AccountsBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./accounts/V1")); +class AccountsBase extends Domain_1.default { + /** + * Initialize accounts domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://accounts.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = AccountsBase; diff --git a/node_modules/twilio/lib/rest/Api.d.ts b/node_modules/twilio/lib/rest/Api.d.ts new file mode 100644 index 00000000..263bffc6 --- /dev/null +++ b/node_modules/twilio/lib/rest/Api.d.ts @@ -0,0 +1,127 @@ +import { AccountContext, AccountListInstance } from "./api/v2010/account"; +import { AddressListInstance } from "./api/v2010/account/address"; +import { ApplicationListInstance } from "./api/v2010/account/application"; +import { AuthorizedConnectAppListInstance } from "./api/v2010/account/authorizedConnectApp"; +import { AvailablePhoneNumberCountryListInstance } from "./api/v2010/account/availablePhoneNumberCountry"; +import { BalanceListInstance } from "./api/v2010/account/balance"; +import { CallListInstance } from "./api/v2010/account/call"; +import { ConferenceListInstance } from "./api/v2010/account/conference"; +import { ConnectAppListInstance } from "./api/v2010/account/connectApp"; +import { IncomingPhoneNumberListInstance } from "./api/v2010/account/incomingPhoneNumber"; +import { KeyListInstance } from "./api/v2010/account/key"; +import { MessageListInstance } from "./api/v2010/account/message"; +import { NewKeyListInstance } from "./api/v2010/account/newKey"; +import { NewSigningKeyListInstance } from "./api/v2010/account/newSigningKey"; +import { NotificationListInstance } from "./api/v2010/account/notification"; +import { OutgoingCallerIdListInstance } from "./api/v2010/account/outgoingCallerId"; +import { QueueListInstance } from "./api/v2010/account/queue"; +import { RecordingListInstance } from "./api/v2010/account/recording"; +import { ShortCodeListInstance } from "./api/v2010/account/shortCode"; +import { SigningKeyListInstance } from "./api/v2010/account/signingKey"; +import { SipListInstance } from "./api/v2010/account/sip"; +import { TokenListInstance } from "./api/v2010/account/token"; +import { TranscriptionListInstance } from "./api/v2010/account/transcription"; +import { UsageListInstance } from "./api/v2010/account/usage"; +import { ValidationRequestListInstance } from "./api/v2010/account/validationRequest"; +import ApiBase from "./ApiBase"; +declare class Api extends ApiBase { + get account(): AccountContext; + get accounts(): AccountListInstance; + /** + * @deprecated - Use account.addresses instead + */ + get addresses(): AddressListInstance; + /** + * @deprecated - Use account.applications instead + */ + get applications(): ApplicationListInstance; + /** + * @deprecated - Use account.authorizedConnectApps instead + */ + get authorizedConnectApps(): AuthorizedConnectAppListInstance; + /** + * @deprecated - Use account.availablePhoneNumbers instead + */ + get availablePhoneNumbers(): AvailablePhoneNumberCountryListInstance; + /** + * @deprecated - Use account.balance instead + */ + get balance(): BalanceListInstance; + /** + * @deprecated - Use account.calls instead + */ + get calls(): CallListInstance; + /** + * @deprecated - Use account.conferences instead + */ + get conferences(): ConferenceListInstance; + /** + * @deprecated - Use account.connectApps instead + */ + get connectApps(): ConnectAppListInstance; + /** + * @deprecated - Use account.incomingPhoneNumbers instead + */ + get incomingPhoneNumbers(): IncomingPhoneNumberListInstance; + /** + * @deprecated - Use account.keys instead + */ + get keys(): KeyListInstance; + /** + * @deprecated - Use account.messages instead + */ + get messages(): MessageListInstance; + /** + * @deprecated - Use account.newKeys instead + */ + get newKeys(): NewKeyListInstance; + /** + * @deprecated - Use account.newSigningKeys instead + */ + get newSigningKeys(): NewSigningKeyListInstance; + /** + * @deprecated - Use account.notifications instead + */ + get notifications(): NotificationListInstance; + /** + * @deprecated - Use account.outgoingCallerIds instead + */ + get outgoingCallerIds(): OutgoingCallerIdListInstance; + /** + * @deprecated - Use account.queues instead + */ + get queues(): QueueListInstance; + /** + * @deprecated - Use account.recordings instead + */ + get recordings(): RecordingListInstance; + /** + * @deprecated - Use account.signingKeys instead + */ + get signingKeys(): SigningKeyListInstance; + /** + * @deprecated - Use account.sip instead + */ + get sip(): SipListInstance; + /** + * @deprecated - Use account.shortCodes instead + */ + get shortCodes(): ShortCodeListInstance; + /** + * @deprecated - Use account.tokens instead + */ + get tokens(): TokenListInstance; + /** + * @deprecated - Use account.transcriptions instead + */ + get transcriptions(): TranscriptionListInstance; + /** + * @deprecated - Use account.usage instead + */ + get usage(): UsageListInstance; + /** + * @deprecated - Use account.validationRequests instead + */ + get validationRequests(): ValidationRequestListInstance; +} +export = Api; diff --git a/node_modules/twilio/lib/rest/Api.js b/node_modules/twilio/lib/rest/Api.js new file mode 100644 index 00000000..90d974a9 --- /dev/null +++ b/node_modules/twilio/lib/rest/Api.js @@ -0,0 +1,182 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const ApiBase_1 = __importDefault(require("./ApiBase")); +class Api extends ApiBase_1.default { + get account() { + return this.v2010.account; + } + get accounts() { + return this.v2010.accounts; + } + /** + * @deprecated - Use account.addresses instead + */ + get addresses() { + console.warn("addresses is deprecated. Use account.addresses instead."); + return this.account.addresses; + } + /** + * @deprecated - Use account.applications instead + */ + get applications() { + console.warn("applications is deprecated. Use account.applications instead."); + return this.account.applications; + } + /** + * @deprecated - Use account.authorizedConnectApps instead + */ + get authorizedConnectApps() { + console.warn("authorizedConnectApps is deprecated. Use account.authorizedConnectApps instead."); + return this.account.authorizedConnectApps; + } + /** + * @deprecated - Use account.availablePhoneNumbers instead + */ + get availablePhoneNumbers() { + console.warn("availablePhoneNumbers is deprecated. Use account.availablePhoneNumbers instead."); + return this.account.availablePhoneNumbers; + } + /** + * @deprecated - Use account.balance instead + */ + get balance() { + console.warn("balance is deprecated. Use account.balance instead."); + return this.account.balance; + } + /** + * @deprecated - Use account.calls instead + */ + get calls() { + console.warn("calls is deprecated. Use account.calls instead."); + return this.account.calls; + } + /** + * @deprecated - Use account.conferences instead + */ + get conferences() { + console.warn("conferences is deprecated. Use account.conferences instead."); + return this.account.conferences; + } + /** + * @deprecated - Use account.connectApps instead + */ + get connectApps() { + console.warn("connectApps is deprecated. Use account.connectApps instead."); + return this.account.connectApps; + } + /** + * @deprecated - Use account.incomingPhoneNumbers instead + */ + get incomingPhoneNumbers() { + console.warn("incomingPhoneNumbers is deprecated. Use account.incomingPhoneNumbers instead."); + return this.account.incomingPhoneNumbers; + } + /** + * @deprecated - Use account.keys instead + */ + get keys() { + console.warn("keys is deprecated. Use account.keys instead."); + return this.account.keys; + } + /** + * @deprecated - Use account.messages instead + */ + get messages() { + console.warn("messages is deprecated. Use account.messages instead."); + return this.account.messages; + } + /** + * @deprecated - Use account.newKeys instead + */ + get newKeys() { + console.warn("newKeys is deprecated. Use account.newKeys instead."); + return this.account.newKeys; + } + /** + * @deprecated - Use account.newSigningKeys instead + */ + get newSigningKeys() { + console.warn("newSigningKeys is deprecated. Use account.newSigningKeys instead."); + return this.account.newSigningKeys; + } + /** + * @deprecated - Use account.notifications instead + */ + get notifications() { + console.warn("notifications is deprecated. Use account.notifications instead."); + return this.account.notifications; + } + /** + * @deprecated - Use account.outgoingCallerIds instead + */ + get outgoingCallerIds() { + console.warn("outgoingCallerIds is deprecated. Use account.outgoingCallerIds instead."); + return this.account.outgoingCallerIds; + } + /** + * @deprecated - Use account.queues instead + */ + get queues() { + console.warn("queues is deprecated. Use account.queues instead."); + return this.account.queues; + } + /** + * @deprecated - Use account.recordings instead + */ + get recordings() { + console.warn("recordings is deprecated. Use account.recordings instead."); + return this.account.recordings; + } + /** + * @deprecated - Use account.signingKeys instead + */ + get signingKeys() { + console.warn("signingKeys is deprecated. Use account.signingKeys instead."); + return this.account.signingKeys; + } + /** + * @deprecated - Use account.sip instead + */ + get sip() { + console.warn("sip is deprecated. Use account.sip instead."); + return this.account.sip; + } + /** + * @deprecated - Use account.shortCodes instead + */ + get shortCodes() { + console.warn("shortCodes is deprecated. Use account.shortCodes instead."); + return this.account.shortCodes; + } + /** + * @deprecated - Use account.tokens instead + */ + get tokens() { + console.warn("tokens is deprecated. Use account.tokens instead."); + return this.account.tokens; + } + /** + * @deprecated - Use account.transcriptions instead + */ + get transcriptions() { + console.warn("transcriptions is deprecated. Use account.transcriptions instead."); + return this.account.transcriptions; + } + /** + * @deprecated - Use account.usage instead + */ + get usage() { + console.warn("usage is deprecated. Use account.usage instead."); + return this.account.usage; + } + /** + * @deprecated - Use account.validationRequests instead + */ + get validationRequests() { + console.warn("validationRequests is deprecated. Use account.validationRequests instead."); + return this.account.validationRequests; + } +} +module.exports = Api; diff --git a/node_modules/twilio/lib/rest/ApiBase.d.ts b/node_modules/twilio/lib/rest/ApiBase.d.ts new file mode 100644 index 00000000..052fdd2d --- /dev/null +++ b/node_modules/twilio/lib/rest/ApiBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V2010 from "./api/V2010"; +declare class ApiBase extends Domain { + _v2010?: V2010; + /** + * Initialize api domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v2010(): V2010; +} +export = ApiBase; diff --git a/node_modules/twilio/lib/rest/ApiBase.js b/node_modules/twilio/lib/rest/ApiBase.js new file mode 100644 index 00000000..ef3c8179 --- /dev/null +++ b/node_modules/twilio/lib/rest/ApiBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V2010_1 = __importDefault(require("./api/V2010")); +class ApiBase extends Domain_1.default { + /** + * Initialize api domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://api.twilio.com"); + } + get v2010() { + this._v2010 = this._v2010 || new V2010_1.default(this); + return this._v2010; + } +} +module.exports = ApiBase; diff --git a/node_modules/twilio/lib/rest/Bulkexports.d.ts b/node_modules/twilio/lib/rest/Bulkexports.d.ts new file mode 100644 index 00000000..024eb00f --- /dev/null +++ b/node_modules/twilio/lib/rest/Bulkexports.d.ts @@ -0,0 +1,14 @@ +import { ExportListInstance } from "./bulkexports/v1/export"; +import { ExportConfigurationListInstance } from "./bulkexports/v1/exportConfiguration"; +import BulkexportsBase from "./BulkexportsBase"; +declare class Bulkexports extends BulkexportsBase { + /** + * @deprecated - Use v1.exports instead + */ + get exports(): ExportListInstance; + /** + * @deprecated - Use v1.exportConfiguration instead + */ + get exportConfiguration(): ExportConfigurationListInstance; +} +export = Bulkexports; diff --git a/node_modules/twilio/lib/rest/Bulkexports.js b/node_modules/twilio/lib/rest/Bulkexports.js new file mode 100644 index 00000000..5526a92d --- /dev/null +++ b/node_modules/twilio/lib/rest/Bulkexports.js @@ -0,0 +1,22 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const BulkexportsBase_1 = __importDefault(require("./BulkexportsBase")); +class Bulkexports extends BulkexportsBase_1.default { + /** + * @deprecated - Use v1.exports instead + */ + get exports() { + console.warn("exports is deprecated. Use v1.exports instead."); + return this.v1.exports; + } + /** + * @deprecated - Use v1.exportConfiguration instead + */ + get exportConfiguration() { + console.warn("exportConfiguration is deprecated. Use v1.exportConfiguration instead."); + return this.v1.exportConfiguration; + } +} +module.exports = Bulkexports; diff --git a/node_modules/twilio/lib/rest/BulkexportsBase.d.ts b/node_modules/twilio/lib/rest/BulkexportsBase.d.ts new file mode 100644 index 00000000..0ff80f73 --- /dev/null +++ b/node_modules/twilio/lib/rest/BulkexportsBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./bulkexports/V1"; +declare class BulkexportsBase extends Domain { + _v1?: V1; + /** + * Initialize bulkexports domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = BulkexportsBase; diff --git a/node_modules/twilio/lib/rest/BulkexportsBase.js b/node_modules/twilio/lib/rest/BulkexportsBase.js new file mode 100644 index 00000000..716a5963 --- /dev/null +++ b/node_modules/twilio/lib/rest/BulkexportsBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./bulkexports/V1")); +class BulkexportsBase extends Domain_1.default { + /** + * Initialize bulkexports domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://bulkexports.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = BulkexportsBase; diff --git a/node_modules/twilio/lib/rest/Chat.d.ts b/node_modules/twilio/lib/rest/Chat.d.ts new file mode 100644 index 00000000..24a22dfb --- /dev/null +++ b/node_modules/twilio/lib/rest/Chat.d.ts @@ -0,0 +1,19 @@ +import { CredentialListInstance } from "./chat/v2/credential"; +import { ServiceListInstance } from "./chat/v2/service"; +import { ChannelListInstance } from "./chat/v3/channel"; +import ChatBase from "./ChatBase"; +declare class Chat extends ChatBase { + /** + * @deprecated - Use v2.credentials instead + */ + get credentials(): CredentialListInstance; + /** + * @deprecated - Use v2.services instead + */ + get services(): ServiceListInstance; + /** + * @deprecated - Use v3.channels instead + */ + get channels(): ChannelListInstance; +} +export = Chat; diff --git a/node_modules/twilio/lib/rest/Chat.js b/node_modules/twilio/lib/rest/Chat.js new file mode 100644 index 00000000..4df5b9ee --- /dev/null +++ b/node_modules/twilio/lib/rest/Chat.js @@ -0,0 +1,29 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const ChatBase_1 = __importDefault(require("./ChatBase")); +class Chat extends ChatBase_1.default { + /** + * @deprecated - Use v2.credentials instead + */ + get credentials() { + console.warn("credentials is deprecated. Use v2.credentials instead."); + return this.v2.credentials; + } + /** + * @deprecated - Use v2.services instead + */ + get services() { + console.warn("services is deprecated. Use v2.services instead."); + return this.v2.services; + } + /** + * @deprecated - Use v3.channels instead + */ + get channels() { + console.warn("channels is deprecated. Use v3.channels instead."); + return this.v3.channels; + } +} +module.exports = Chat; diff --git a/node_modules/twilio/lib/rest/ChatBase.d.ts b/node_modules/twilio/lib/rest/ChatBase.d.ts new file mode 100644 index 00000000..8c18e58b --- /dev/null +++ b/node_modules/twilio/lib/rest/ChatBase.d.ts @@ -0,0 +1,19 @@ +import Domain from "../base/Domain"; +import V1 from "./chat/V1"; +import V2 from "./chat/V2"; +import V3 from "./chat/V3"; +declare class ChatBase extends Domain { + _v1?: V1; + _v2?: V2; + _v3?: V3; + /** + * Initialize chat domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; + get v2(): V2; + get v3(): V3; +} +export = ChatBase; diff --git a/node_modules/twilio/lib/rest/ChatBase.js b/node_modules/twilio/lib/rest/ChatBase.js new file mode 100644 index 00000000..cd6122f5 --- /dev/null +++ b/node_modules/twilio/lib/rest/ChatBase.js @@ -0,0 +1,41 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./chat/V1")); +const V2_1 = __importDefault(require("./chat/V2")); +const V3_1 = __importDefault(require("./chat/V3")); +class ChatBase extends Domain_1.default { + /** + * Initialize chat domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://chat.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } + get v3() { + this._v3 = this._v3 || new V3_1.default(this); + return this._v3; + } +} +module.exports = ChatBase; diff --git a/node_modules/twilio/lib/rest/Content.d.ts b/node_modules/twilio/lib/rest/Content.d.ts new file mode 100644 index 00000000..2d06398e --- /dev/null +++ b/node_modules/twilio/lib/rest/Content.d.ts @@ -0,0 +1,9 @@ +import ContentBase from "./ContentBase"; +import { ContentListInstance } from "./content/v1/content"; +declare class Content extends ContentBase { + /** + * @deprecated - Use v1.contents instead + */ + get contents(): ContentListInstance; +} +export = Content; diff --git a/node_modules/twilio/lib/rest/Content.js b/node_modules/twilio/lib/rest/Content.js new file mode 100644 index 00000000..5102caca --- /dev/null +++ b/node_modules/twilio/lib/rest/Content.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const ContentBase_1 = __importDefault(require("./ContentBase")); +class Content extends ContentBase_1.default { + /** + * @deprecated - Use v1.contents instead + */ + get contents() { + console.warn("contents is deprecated. Use v1.contents instead."); + return this.v1.contents; + } +} +module.exports = Content; diff --git a/node_modules/twilio/lib/rest/ContentBase.d.ts b/node_modules/twilio/lib/rest/ContentBase.d.ts new file mode 100644 index 00000000..0054966c --- /dev/null +++ b/node_modules/twilio/lib/rest/ContentBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./content/V1"; +declare class ContentBase extends Domain { + _v1?: V1; + /** + * Initialize content domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = ContentBase; diff --git a/node_modules/twilio/lib/rest/ContentBase.js b/node_modules/twilio/lib/rest/ContentBase.js new file mode 100644 index 00000000..6c6bf3bb --- /dev/null +++ b/node_modules/twilio/lib/rest/ContentBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./content/V1")); +class ContentBase extends Domain_1.default { + /** + * Initialize content domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://content.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = ContentBase; diff --git a/node_modules/twilio/lib/rest/Conversations.d.ts b/node_modules/twilio/lib/rest/Conversations.d.ts new file mode 100644 index 00000000..0cb376f7 --- /dev/null +++ b/node_modules/twilio/lib/rest/Conversations.d.ts @@ -0,0 +1,44 @@ +import { AddressConfigurationListInstance } from "./conversations/v1/addressConfiguration"; +import { ConfigurationListInstance } from "./conversations/v1/configuration"; +import { ConversationListInstance } from "./conversations/v1/conversation"; +import { CredentialListInstance } from "./conversations/v1/credential"; +import { ParticipantConversationListInstance } from "./conversations/v1/participantConversation"; +import { RoleListInstance } from "./conversations/v1/role"; +import { ServiceListInstance } from "./conversations/v1/service"; +import { UserListInstance } from "./conversations/v1/user"; +import ConversationsBase from "./ConversationsBase"; +declare class Conversations extends ConversationsBase { + /** + * @deprecated - Use v1.configuration instead + */ + get configuration(): ConfigurationListInstance; + /** + * @deprecated - Use v1.addressConfigurations instead + */ + get addressConfigurations(): AddressConfigurationListInstance; + /** + * @deprecated - Use v1.conversations instead + */ + get conversations(): ConversationListInstance; + /** + * @deprecated - Use v1.credentials instead + */ + get credentials(): CredentialListInstance; + /** + * @deprecated - Use v1.participantConversations instead + */ + get participantConversations(): ParticipantConversationListInstance; + /** + * @deprecated - Use v1.roles instead + */ + get roles(): RoleListInstance; + /** + * @deprecated - Use v1.services instead + */ + get services(): ServiceListInstance; + /** + * @deprecated - Use v1.users instead + */ + get users(): UserListInstance; +} +export = Conversations; diff --git a/node_modules/twilio/lib/rest/Conversations.js b/node_modules/twilio/lib/rest/Conversations.js new file mode 100644 index 00000000..91e6e4ad --- /dev/null +++ b/node_modules/twilio/lib/rest/Conversations.js @@ -0,0 +1,64 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const ConversationsBase_1 = __importDefault(require("./ConversationsBase")); +class Conversations extends ConversationsBase_1.default { + /** + * @deprecated - Use v1.configuration instead + */ + get configuration() { + console.warn("configuration is deprecated. Use v1.configuration instead."); + return this.v1.configuration; + } + /** + * @deprecated - Use v1.addressConfigurations instead + */ + get addressConfigurations() { + console.warn("addressConfigurations is deprecated. Use v1.addressConfigurations instead."); + return this.v1.addressConfigurations; + } + /** + * @deprecated - Use v1.conversations instead + */ + get conversations() { + console.warn("conversations is deprecated. Use v1.conversations instead."); + return this.v1.conversations; + } + /** + * @deprecated - Use v1.credentials instead + */ + get credentials() { + console.warn("credentials is deprecated. Use v1.credentials instead."); + return this.v1.credentials; + } + /** + * @deprecated - Use v1.participantConversations instead + */ + get participantConversations() { + console.warn("participantConversations is deprecated. Use v1.participantConversations instead."); + return this.v1.participantConversations; + } + /** + * @deprecated - Use v1.roles instead + */ + get roles() { + console.warn("roles is deprecated. Use v1.roles instead."); + return this.v1.roles; + } + /** + * @deprecated - Use v1.services instead + */ + get services() { + console.warn("services is deprecated. Use v1.services instead."); + return this.v1.services; + } + /** + * @deprecated - Use v1.users instead + */ + get users() { + console.warn("users is deprecated. Use v1.users instead."); + return this.v1.users; + } +} +module.exports = Conversations; diff --git a/node_modules/twilio/lib/rest/ConversationsBase.d.ts b/node_modules/twilio/lib/rest/ConversationsBase.d.ts new file mode 100644 index 00000000..0b6e6353 --- /dev/null +++ b/node_modules/twilio/lib/rest/ConversationsBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./conversations/V1"; +declare class ConversationsBase extends Domain { + _v1?: V1; + /** + * Initialize conversations domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = ConversationsBase; diff --git a/node_modules/twilio/lib/rest/ConversationsBase.js b/node_modules/twilio/lib/rest/ConversationsBase.js new file mode 100644 index 00000000..8b62f1bb --- /dev/null +++ b/node_modules/twilio/lib/rest/ConversationsBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./conversations/V1")); +class ConversationsBase extends Domain_1.default { + /** + * Initialize conversations domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://conversations.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = ConversationsBase; diff --git a/node_modules/twilio/lib/rest/Events.d.ts b/node_modules/twilio/lib/rest/Events.d.ts new file mode 100644 index 00000000..b49fe043 --- /dev/null +++ b/node_modules/twilio/lib/rest/Events.d.ts @@ -0,0 +1,24 @@ +import { EventTypeListInstance } from "./events/v1/eventType"; +import { SchemaListInstance } from "./events/v1/schema"; +import { SinkListInstance } from "./events/v1/sink"; +import { SubscriptionListInstance } from "./events/v1/subscription"; +import EventsBase from "./EventsBase"; +declare class Events extends EventsBase { + /** + * @deprecated - Use v1.eventTypes instead + */ + get eventTypes(): EventTypeListInstance; + /** + * @deprecated - Use v1.schemas instead + */ + get schemas(): SchemaListInstance; + /** + * @deprecated - Use v1.sinks instead + */ + get sinks(): SinkListInstance; + /** + * @deprecated - Use v1.subscriptions instead + */ + get subscriptions(): SubscriptionListInstance; +} +export = Events; diff --git a/node_modules/twilio/lib/rest/Events.js b/node_modules/twilio/lib/rest/Events.js new file mode 100644 index 00000000..321cab67 --- /dev/null +++ b/node_modules/twilio/lib/rest/Events.js @@ -0,0 +1,36 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const EventsBase_1 = __importDefault(require("./EventsBase")); +class Events extends EventsBase_1.default { + /** + * @deprecated - Use v1.eventTypes instead + */ + get eventTypes() { + console.warn("eventTypes is deprecated. Use v1.eventTypes instead."); + return this.v1.eventTypes; + } + /** + * @deprecated - Use v1.schemas instead + */ + get schemas() { + console.warn("schemas is deprecated. Use v1.schemas instead."); + return this.v1.schemas; + } + /** + * @deprecated - Use v1.sinks instead + */ + get sinks() { + console.warn("sinks is deprecated. Use v1.sinks instead."); + return this.v1.sinks; + } + /** + * @deprecated - Use v1.subscriptions instead + */ + get subscriptions() { + console.warn("subscriptions is deprecated. Use v1.subscriptions instead."); + return this.v1.subscriptions; + } +} +module.exports = Events; diff --git a/node_modules/twilio/lib/rest/EventsBase.d.ts b/node_modules/twilio/lib/rest/EventsBase.d.ts new file mode 100644 index 00000000..65ee9a9c --- /dev/null +++ b/node_modules/twilio/lib/rest/EventsBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./events/V1"; +declare class EventsBase extends Domain { + _v1?: V1; + /** + * Initialize events domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = EventsBase; diff --git a/node_modules/twilio/lib/rest/EventsBase.js b/node_modules/twilio/lib/rest/EventsBase.js new file mode 100644 index 00000000..88563a66 --- /dev/null +++ b/node_modules/twilio/lib/rest/EventsBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./events/V1")); +class EventsBase extends Domain_1.default { + /** + * Initialize events domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://events.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = EventsBase; diff --git a/node_modules/twilio/lib/rest/FlexApi.d.ts b/node_modules/twilio/lib/rest/FlexApi.d.ts new file mode 100644 index 00000000..3f3aee16 --- /dev/null +++ b/node_modules/twilio/lib/rest/FlexApi.d.ts @@ -0,0 +1,39 @@ +import { ChannelListInstance } from "./flexApi/v1/channel"; +import { ConfigurationListInstance } from "./flexApi/v1/configuration"; +import { FlexFlowListInstance } from "./flexApi/v1/flexFlow"; +import { InteractionListInstance } from "./flexApi/v1/interaction"; +import { WebChannelListInstance } from "./flexApi/v1/webChannel"; +import { AssessmentsListInstance } from "./flexApi/v1/assessments"; +import { WebChannelsListInstance } from "./flexApi/v2/webChannels"; +import FlexApiBase from "./FlexApiBase"; +declare class FlexApi extends FlexApiBase { + /** + * @deprecated - Use v1.assessments instead + */ + get assessments(): AssessmentsListInstance; + /** + * @deprecated - Use v1.channel instead + */ + get channel(): ChannelListInstance; + /** + * @deprecated - Use v1.configuration instead + */ + get configuration(): ConfigurationListInstance; + /** + * @deprecated - Use v1.flexFlow instead + */ + get flexFlow(): FlexFlowListInstance; + /** + * @deprecated - Use v1.interaction instead + */ + get interaction(): InteractionListInstance; + /** + * @deprecated - Use v1.webChannel instead + */ + get webChannel(): WebChannelListInstance; + /** + * @deprecated - Use v2.webChannels instead + */ + get webChannels(): WebChannelsListInstance; +} +export = FlexApi; diff --git a/node_modules/twilio/lib/rest/FlexApi.js b/node_modules/twilio/lib/rest/FlexApi.js new file mode 100644 index 00000000..7c50a59c --- /dev/null +++ b/node_modules/twilio/lib/rest/FlexApi.js @@ -0,0 +1,57 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const FlexApiBase_1 = __importDefault(require("./FlexApiBase")); +class FlexApi extends FlexApiBase_1.default { + /** + * @deprecated - Use v1.assessments instead + */ + get assessments() { + console.warn("assessments is deprecated. Use v1.assessments instead."); + return this.v1.assessments; + } + /** + * @deprecated - Use v1.channel instead + */ + get channel() { + console.warn("channel is deprecated. Use v1.channel instead."); + return this.v1.channel; + } + /** + * @deprecated - Use v1.configuration instead + */ + get configuration() { + console.warn("configuration is deprecated. Use v1.configuration instead."); + return this.v1.configuration; + } + /** + * @deprecated - Use v1.flexFlow instead + */ + get flexFlow() { + console.warn("flexFlow is deprecated. Use v1.flexFlow instead."); + return this.v1.flexFlow; + } + /** + * @deprecated - Use v1.interaction instead + */ + get interaction() { + console.warn("interaction is deprecated. Use v1.interaction instead."); + return this.v1.interaction; + } + /** + * @deprecated - Use v1.webChannel instead + */ + get webChannel() { + console.warn("webChannel is deprecated. Use v1.webChannel instead."); + return this.v1.webChannel; + } + /** + * @deprecated - Use v2.webChannels instead + */ + get webChannels() { + console.warn("webChannels is deprecated. Use v2.webChannels instead."); + return this.v2.webChannels; + } +} +module.exports = FlexApi; diff --git a/node_modules/twilio/lib/rest/FlexApiBase.d.ts b/node_modules/twilio/lib/rest/FlexApiBase.d.ts new file mode 100644 index 00000000..d6f57dde --- /dev/null +++ b/node_modules/twilio/lib/rest/FlexApiBase.d.ts @@ -0,0 +1,16 @@ +import Domain from "../base/Domain"; +import V1 from "./flexApi/V1"; +import V2 from "./flexApi/V2"; +declare class FlexApiBase extends Domain { + _v1?: V1; + _v2?: V2; + /** + * Initialize flexApi domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; + get v2(): V2; +} +export = FlexApiBase; diff --git a/node_modules/twilio/lib/rest/FlexApiBase.js b/node_modules/twilio/lib/rest/FlexApiBase.js new file mode 100644 index 00000000..6260b009 --- /dev/null +++ b/node_modules/twilio/lib/rest/FlexApiBase.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./flexApi/V1")); +const V2_1 = __importDefault(require("./flexApi/V2")); +class FlexApiBase extends Domain_1.default { + /** + * Initialize flexApi domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://flex-api.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = FlexApiBase; diff --git a/node_modules/twilio/lib/rest/FrontlineApi.d.ts b/node_modules/twilio/lib/rest/FrontlineApi.d.ts new file mode 100644 index 00000000..e23f1355 --- /dev/null +++ b/node_modules/twilio/lib/rest/FrontlineApi.d.ts @@ -0,0 +1,9 @@ +import { UserListInstance } from "./frontlineApi/v1/user"; +import FrontlineApiBase from "./FrontlineApiBase"; +declare class FrontlineApi extends FrontlineApiBase { + /** + * @deprecated - Use v1.users instead + */ + get users(): UserListInstance; +} +export = FrontlineApi; diff --git a/node_modules/twilio/lib/rest/FrontlineApi.js b/node_modules/twilio/lib/rest/FrontlineApi.js new file mode 100644 index 00000000..73e4fee3 --- /dev/null +++ b/node_modules/twilio/lib/rest/FrontlineApi.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const FrontlineApiBase_1 = __importDefault(require("./FrontlineApiBase")); +class FrontlineApi extends FrontlineApiBase_1.default { + /** + * @deprecated - Use v1.users instead + */ + get users() { + console.warn("users is deprecated. Use v1.users instead."); + return this.v1.users; + } +} +module.exports = FrontlineApi; diff --git a/node_modules/twilio/lib/rest/FrontlineApiBase.d.ts b/node_modules/twilio/lib/rest/FrontlineApiBase.d.ts new file mode 100644 index 00000000..03095cbd --- /dev/null +++ b/node_modules/twilio/lib/rest/FrontlineApiBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./frontlineApi/V1"; +declare class FrontlineApiBase extends Domain { + _v1?: V1; + /** + * Initialize frontlineApi domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = FrontlineApiBase; diff --git a/node_modules/twilio/lib/rest/FrontlineApiBase.js b/node_modules/twilio/lib/rest/FrontlineApiBase.js new file mode 100644 index 00000000..b6e6b719 --- /dev/null +++ b/node_modules/twilio/lib/rest/FrontlineApiBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./frontlineApi/V1")); +class FrontlineApiBase extends Domain_1.default { + /** + * Initialize frontlineApi domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://frontline-api.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = FrontlineApiBase; diff --git a/node_modules/twilio/lib/rest/Insights.d.ts b/node_modules/twilio/lib/rest/Insights.d.ts new file mode 100644 index 00000000..faf05cc1 --- /dev/null +++ b/node_modules/twilio/lib/rest/Insights.d.ts @@ -0,0 +1,29 @@ +import { CallListInstance } from "./insights/v1/call"; +import { CallSummariesListInstance } from "./insights/v1/callSummaries"; +import { ConferenceListInstance } from "./insights/v1/conference"; +import { RoomListInstance } from "./insights/v1/room"; +import { SettingListInstance } from "./insights/v1/setting"; +import InsightsBase from "./InsightsBase"; +declare class Insights extends InsightsBase { + /** + * @deprecated - Use v1.settings instead + */ + get settings(): SettingListInstance; + /** + * @deprecated - Use v1.calls instead + */ + get calls(): CallListInstance; + /** + * @deprecated - Use v1.callSummaries instead + */ + get callSummaries(): CallSummariesListInstance; + /** + * @deprecated - Use v1.conferences instead + */ + get conferences(): ConferenceListInstance; + /** + * @deprecated - Use v1.rooms instead + */ + get rooms(): RoomListInstance; +} +export = Insights; diff --git a/node_modules/twilio/lib/rest/Insights.js b/node_modules/twilio/lib/rest/Insights.js new file mode 100644 index 00000000..6b43709b --- /dev/null +++ b/node_modules/twilio/lib/rest/Insights.js @@ -0,0 +1,43 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const InsightsBase_1 = __importDefault(require("./InsightsBase")); +class Insights extends InsightsBase_1.default { + /** + * @deprecated - Use v1.settings instead + */ + get settings() { + console.warn("settings is deprecated. Use v1.settings instead."); + return this.v1.settings; + } + /** + * @deprecated - Use v1.calls instead + */ + get calls() { + console.warn("calls is deprecated. Use v1.calls instead."); + return this.v1.calls; + } + /** + * @deprecated - Use v1.callSummaries instead + */ + get callSummaries() { + console.warn("callSummaries is deprecated. Use v1.callSummaries instead."); + return this.v1.callSummaries; + } + /** + * @deprecated - Use v1.conferences instead + */ + get conferences() { + console.warn("conferences is deprecated. Use v1.conferences instead."); + return this.v1.conferences; + } + /** + * @deprecated - Use v1.rooms instead + */ + get rooms() { + console.warn("rooms is deprecated. Use v1.rooms instead."); + return this.v1.rooms; + } +} +module.exports = Insights; diff --git a/node_modules/twilio/lib/rest/InsightsBase.d.ts b/node_modules/twilio/lib/rest/InsightsBase.d.ts new file mode 100644 index 00000000..82f9040c --- /dev/null +++ b/node_modules/twilio/lib/rest/InsightsBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./insights/V1"; +declare class InsightsBase extends Domain { + _v1?: V1; + /** + * Initialize insights domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = InsightsBase; diff --git a/node_modules/twilio/lib/rest/InsightsBase.js b/node_modules/twilio/lib/rest/InsightsBase.js new file mode 100644 index 00000000..fd396e8d --- /dev/null +++ b/node_modules/twilio/lib/rest/InsightsBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./insights/V1")); +class InsightsBase extends Domain_1.default { + /** + * Initialize insights domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://insights.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = InsightsBase; diff --git a/node_modules/twilio/lib/rest/Intelligence.d.ts b/node_modules/twilio/lib/rest/Intelligence.d.ts new file mode 100644 index 00000000..9d3064dc --- /dev/null +++ b/node_modules/twilio/lib/rest/Intelligence.d.ts @@ -0,0 +1,4 @@ +import IntelligenceBase from "./IntelligenceBase"; +declare class Intelligence extends IntelligenceBase { +} +export = Intelligence; diff --git a/node_modules/twilio/lib/rest/Intelligence.js b/node_modules/twilio/lib/rest/Intelligence.js new file mode 100644 index 00000000..9a311b23 --- /dev/null +++ b/node_modules/twilio/lib/rest/Intelligence.js @@ -0,0 +1,8 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const IntelligenceBase_1 = __importDefault(require("./IntelligenceBase")); +class Intelligence extends IntelligenceBase_1.default { +} +module.exports = Intelligence; diff --git a/node_modules/twilio/lib/rest/IntelligenceBase.d.ts b/node_modules/twilio/lib/rest/IntelligenceBase.d.ts new file mode 100644 index 00000000..8b2956d0 --- /dev/null +++ b/node_modules/twilio/lib/rest/IntelligenceBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V2 from "./intelligence/V2"; +declare class IntelligenceBase extends Domain { + _v2?: V2; + /** + * Initialize intelligence domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v2(): V2; +} +export = IntelligenceBase; diff --git a/node_modules/twilio/lib/rest/IntelligenceBase.js b/node_modules/twilio/lib/rest/IntelligenceBase.js new file mode 100644 index 00000000..f9668050 --- /dev/null +++ b/node_modules/twilio/lib/rest/IntelligenceBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V2_1 = __importDefault(require("./intelligence/V2")); +class IntelligenceBase extends Domain_1.default { + /** + * Initialize intelligence domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://intelligence.twilio.com"); + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = IntelligenceBase; diff --git a/node_modules/twilio/lib/rest/IpMessaging.d.ts b/node_modules/twilio/lib/rest/IpMessaging.d.ts new file mode 100644 index 00000000..5a5a969f --- /dev/null +++ b/node_modules/twilio/lib/rest/IpMessaging.d.ts @@ -0,0 +1,14 @@ +import { CredentialListInstance } from "./ipMessaging/v2/credential"; +import { ServiceListInstance } from "./ipMessaging/v2/service"; +import IpMessagingBase from "./IpMessagingBase"; +declare class IpMessaging extends IpMessagingBase { + /** + * @deprecated - Use v2.credentials instead + */ + get credentials(): CredentialListInstance; + /** + * @deprecated - Use v2.services instead + */ + get services(): ServiceListInstance; +} +export = IpMessaging; diff --git a/node_modules/twilio/lib/rest/IpMessaging.js b/node_modules/twilio/lib/rest/IpMessaging.js new file mode 100644 index 00000000..b7715eee --- /dev/null +++ b/node_modules/twilio/lib/rest/IpMessaging.js @@ -0,0 +1,22 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const IpMessagingBase_1 = __importDefault(require("./IpMessagingBase")); +class IpMessaging extends IpMessagingBase_1.default { + /** + * @deprecated - Use v2.credentials instead + */ + get credentials() { + console.warn("credentials is deprecated. Use v2.credentials instead."); + return this.v2.credentials; + } + /** + * @deprecated - Use v2.services instead + */ + get services() { + console.warn("services is deprecated. Use v2.services instead."); + return this.v2.services; + } +} +module.exports = IpMessaging; diff --git a/node_modules/twilio/lib/rest/IpMessagingBase.d.ts b/node_modules/twilio/lib/rest/IpMessagingBase.d.ts new file mode 100644 index 00000000..7b75526a --- /dev/null +++ b/node_modules/twilio/lib/rest/IpMessagingBase.d.ts @@ -0,0 +1,16 @@ +import Domain from "../base/Domain"; +import V1 from "./ipMessaging/V1"; +import V2 from "./ipMessaging/V2"; +declare class IpMessagingBase extends Domain { + _v1?: V1; + _v2?: V2; + /** + * Initialize ipMessaging domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; + get v2(): V2; +} +export = IpMessagingBase; diff --git a/node_modules/twilio/lib/rest/IpMessagingBase.js b/node_modules/twilio/lib/rest/IpMessagingBase.js new file mode 100644 index 00000000..9145b8d7 --- /dev/null +++ b/node_modules/twilio/lib/rest/IpMessagingBase.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./ipMessaging/V1")); +const V2_1 = __importDefault(require("./ipMessaging/V2")); +class IpMessagingBase extends Domain_1.default { + /** + * Initialize ipMessaging domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://ip-messaging.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = IpMessagingBase; diff --git a/node_modules/twilio/lib/rest/Lookups.d.ts b/node_modules/twilio/lib/rest/Lookups.d.ts new file mode 100644 index 00000000..c1868c87 --- /dev/null +++ b/node_modules/twilio/lib/rest/Lookups.d.ts @@ -0,0 +1,9 @@ +import { PhoneNumberListInstance } from "./lookups/v1/phoneNumber"; +import LookupsBase from "./LookupsBase"; +declare class Lookups extends LookupsBase { + /** + * @deprecated - Use v1.phoneNumbers instead + */ + get phoneNumbers(): PhoneNumberListInstance; +} +export = Lookups; diff --git a/node_modules/twilio/lib/rest/Lookups.js b/node_modules/twilio/lib/rest/Lookups.js new file mode 100644 index 00000000..f29e9c3f --- /dev/null +++ b/node_modules/twilio/lib/rest/Lookups.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const LookupsBase_1 = __importDefault(require("./LookupsBase")); +class Lookups extends LookupsBase_1.default { + /** + * @deprecated - Use v1.phoneNumbers instead + */ + get phoneNumbers() { + console.warn("phoneNumbers is deprecated. Use v1.phoneNumbers instead."); + return this.v1.phoneNumbers; + } +} +module.exports = Lookups; diff --git a/node_modules/twilio/lib/rest/LookupsBase.d.ts b/node_modules/twilio/lib/rest/LookupsBase.d.ts new file mode 100644 index 00000000..9575be6c --- /dev/null +++ b/node_modules/twilio/lib/rest/LookupsBase.d.ts @@ -0,0 +1,16 @@ +import Domain from "../base/Domain"; +import V1 from "./lookups/V1"; +import V2 from "./lookups/V2"; +declare class LookupsBase extends Domain { + _v1?: V1; + _v2?: V2; + /** + * Initialize lookups domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; + get v2(): V2; +} +export = LookupsBase; diff --git a/node_modules/twilio/lib/rest/LookupsBase.js b/node_modules/twilio/lib/rest/LookupsBase.js new file mode 100644 index 00000000..e91efe2c --- /dev/null +++ b/node_modules/twilio/lib/rest/LookupsBase.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./lookups/V1")); +const V2_1 = __importDefault(require("./lookups/V2")); +class LookupsBase extends Domain_1.default { + /** + * Initialize lookups domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://lookups.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = LookupsBase; diff --git a/node_modules/twilio/lib/rest/Media.d.ts b/node_modules/twilio/lib/rest/Media.d.ts new file mode 100644 index 00000000..fcb62d7f --- /dev/null +++ b/node_modules/twilio/lib/rest/Media.d.ts @@ -0,0 +1,4 @@ +import MediaBase from "./MediaBase"; +declare class Media extends MediaBase { +} +export = Media; diff --git a/node_modules/twilio/lib/rest/Media.js b/node_modules/twilio/lib/rest/Media.js new file mode 100644 index 00000000..fe60f246 --- /dev/null +++ b/node_modules/twilio/lib/rest/Media.js @@ -0,0 +1,8 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const MediaBase_1 = __importDefault(require("./MediaBase")); +class Media extends MediaBase_1.default { +} +module.exports = Media; diff --git a/node_modules/twilio/lib/rest/MediaBase.d.ts b/node_modules/twilio/lib/rest/MediaBase.d.ts new file mode 100644 index 00000000..a42f89d9 --- /dev/null +++ b/node_modules/twilio/lib/rest/MediaBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./media/V1"; +declare class MediaBase extends Domain { + _v1?: V1; + /** + * Initialize media domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = MediaBase; diff --git a/node_modules/twilio/lib/rest/MediaBase.js b/node_modules/twilio/lib/rest/MediaBase.js new file mode 100644 index 00000000..993145d3 --- /dev/null +++ b/node_modules/twilio/lib/rest/MediaBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./media/V1")); +class MediaBase extends Domain_1.default { + /** + * Initialize media domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://media.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = MediaBase; diff --git a/node_modules/twilio/lib/rest/Messaging.d.ts b/node_modules/twilio/lib/rest/Messaging.d.ts new file mode 100644 index 00000000..148c1791 --- /dev/null +++ b/node_modules/twilio/lib/rest/Messaging.d.ts @@ -0,0 +1,39 @@ +import { BrandRegistrationListInstance } from "./messaging/v1/brandRegistration"; +import { DeactivationsListInstance } from "./messaging/v1/deactivations"; +import { ExternalCampaignListInstance } from "./messaging/v1/externalCampaign"; +import { ServiceListInstance } from "./messaging/v1/service"; +import { UsecaseListInstance } from "./messaging/v1/usecase"; +import { DomainCertsListInstance } from "./messaging/v1/domainCerts"; +import { DomainConfigListInstance } from "./messaging/v1/domainConfig"; +import MessagingBase from "./MessagingBase"; +declare class Messaging extends MessagingBase { + /** + * @deprecated - Use v1.brandRegistrations instead + */ + get brandRegistrations(): BrandRegistrationListInstance; + /** + * @deprecated - Use v1.deactivations instead + */ + get deactivations(): DeactivationsListInstance; + /** + * @deprecated - Use v1.domainCerts instead + */ + get domainCerts(): DomainCertsListInstance; + /** + * @deprecated - Use v1.domainConfig instead + */ + get domainConfig(): DomainConfigListInstance; + /** + * @deprecated - Use v1.externalCampaign instead + */ + get externalCampaign(): ExternalCampaignListInstance; + /** + * @deprecated - Use v1.services instead + */ + get services(): ServiceListInstance; + /** + * @deprecated - Use v1.usecases instead + */ + get usecases(): UsecaseListInstance; +} +export = Messaging; diff --git a/node_modules/twilio/lib/rest/Messaging.js b/node_modules/twilio/lib/rest/Messaging.js new file mode 100644 index 00000000..4e2db61f --- /dev/null +++ b/node_modules/twilio/lib/rest/Messaging.js @@ -0,0 +1,57 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const MessagingBase_1 = __importDefault(require("./MessagingBase")); +class Messaging extends MessagingBase_1.default { + /** + * @deprecated - Use v1.brandRegistrations instead + */ + get brandRegistrations() { + console.warn("brandRegistrations is deprecated. Use v1.brandRegistrations instead."); + return this.v1.brandRegistrations; + } + /** + * @deprecated - Use v1.deactivations instead + */ + get deactivations() { + console.warn("deactivations is deprecated. Use v1.deactivations instead."); + return this.v1.deactivations; + } + /** + * @deprecated - Use v1.domainCerts instead + */ + get domainCerts() { + console.warn("domainCerts is deprecated. Use v1.domainCerts instead."); + return this.v1.domainCerts; + } + /** + * @deprecated - Use v1.domainConfig instead + */ + get domainConfig() { + console.warn("domainConfig is deprecated. Use v1.domainConfig instead."); + return this.v1.domainConfig; + } + /** + * @deprecated - Use v1.externalCampaign instead + */ + get externalCampaign() { + console.warn("externalCampaign is deprecated. Use v1.externalCampaign instead."); + return this.v1.externalCampaign; + } + /** + * @deprecated - Use v1.services instead + */ + get services() { + console.warn("services is deprecated. Use v1.services instead."); + return this.v1.services; + } + /** + * @deprecated - Use v1.usecases instead + */ + get usecases() { + console.warn("usecases is deprecated. Use v1.usecases instead."); + return this.v1.usecases; + } +} +module.exports = Messaging; diff --git a/node_modules/twilio/lib/rest/MessagingBase.d.ts b/node_modules/twilio/lib/rest/MessagingBase.d.ts new file mode 100644 index 00000000..2eb9af07 --- /dev/null +++ b/node_modules/twilio/lib/rest/MessagingBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./messaging/V1"; +declare class MessagingBase extends Domain { + _v1?: V1; + /** + * Initialize messaging domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = MessagingBase; diff --git a/node_modules/twilio/lib/rest/MessagingBase.js b/node_modules/twilio/lib/rest/MessagingBase.js new file mode 100644 index 00000000..9133c626 --- /dev/null +++ b/node_modules/twilio/lib/rest/MessagingBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./messaging/V1")); +class MessagingBase extends Domain_1.default { + /** + * Initialize messaging domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://messaging.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = MessagingBase; diff --git a/node_modules/twilio/lib/rest/Microvisor.d.ts b/node_modules/twilio/lib/rest/Microvisor.d.ts new file mode 100644 index 00000000..4c073d44 --- /dev/null +++ b/node_modules/twilio/lib/rest/Microvisor.d.ts @@ -0,0 +1,14 @@ +import { AppListInstance } from "./microvisor/v1/app"; +import { DeviceListInstance } from "./microvisor/v1/device"; +import MicrovisorBase from "./MicrovisorBase"; +declare class Microvisor extends MicrovisorBase { + /** + * @deprecated - Use v1.apps instead + */ + get apps(): AppListInstance; + /** + * @deprecated - Use v1.devices instead + */ + get devices(): DeviceListInstance; +} +export = Microvisor; diff --git a/node_modules/twilio/lib/rest/Microvisor.js b/node_modules/twilio/lib/rest/Microvisor.js new file mode 100644 index 00000000..eb288137 --- /dev/null +++ b/node_modules/twilio/lib/rest/Microvisor.js @@ -0,0 +1,22 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const MicrovisorBase_1 = __importDefault(require("./MicrovisorBase")); +class Microvisor extends MicrovisorBase_1.default { + /** + * @deprecated - Use v1.apps instead + */ + get apps() { + console.warn("apps is deprecated. Use v1.apps instead."); + return this.v1.apps; + } + /** + * @deprecated - Use v1.devices instead + */ + get devices() { + console.warn("devices is deprecated. Use v1.devices instead."); + return this.v1.devices; + } +} +module.exports = Microvisor; diff --git a/node_modules/twilio/lib/rest/MicrovisorBase.d.ts b/node_modules/twilio/lib/rest/MicrovisorBase.d.ts new file mode 100644 index 00000000..1af9fca0 --- /dev/null +++ b/node_modules/twilio/lib/rest/MicrovisorBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./microvisor/V1"; +declare class MicrovisorBase extends Domain { + _v1?: V1; + /** + * Initialize microvisor domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = MicrovisorBase; diff --git a/node_modules/twilio/lib/rest/MicrovisorBase.js b/node_modules/twilio/lib/rest/MicrovisorBase.js new file mode 100644 index 00000000..ee65123f --- /dev/null +++ b/node_modules/twilio/lib/rest/MicrovisorBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./microvisor/V1")); +class MicrovisorBase extends Domain_1.default { + /** + * Initialize microvisor domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://microvisor.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = MicrovisorBase; diff --git a/node_modules/twilio/lib/rest/Monitor.d.ts b/node_modules/twilio/lib/rest/Monitor.d.ts new file mode 100644 index 00000000..a0777176 --- /dev/null +++ b/node_modules/twilio/lib/rest/Monitor.d.ts @@ -0,0 +1,14 @@ +import { AlertListInstance } from "./monitor/v1/alert"; +import { EventListInstance } from "./monitor/v1/event"; +import MonitorBase from "./MonitorBase"; +declare class Monitor extends MonitorBase { + /** + * @deprecated - Use v1.alerts instead + */ + get alerts(): AlertListInstance; + /** + * @deprecated - Use v1.events instead + */ + get events(): EventListInstance; +} +export = Monitor; diff --git a/node_modules/twilio/lib/rest/Monitor.js b/node_modules/twilio/lib/rest/Monitor.js new file mode 100644 index 00000000..53d15995 --- /dev/null +++ b/node_modules/twilio/lib/rest/Monitor.js @@ -0,0 +1,22 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const MonitorBase_1 = __importDefault(require("./MonitorBase")); +class Monitor extends MonitorBase_1.default { + /** + * @deprecated - Use v1.alerts instead + */ + get alerts() { + console.warn("alerts is deprecated. Use v1.alerts instead."); + return this.v1.alerts; + } + /** + * @deprecated - Use v1.events instead + */ + get events() { + console.warn("events is deprecated. Use v1.events instead."); + return this.v1.events; + } +} +module.exports = Monitor; diff --git a/node_modules/twilio/lib/rest/MonitorBase.d.ts b/node_modules/twilio/lib/rest/MonitorBase.d.ts new file mode 100644 index 00000000..12b68a84 --- /dev/null +++ b/node_modules/twilio/lib/rest/MonitorBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./monitor/V1"; +declare class MonitorBase extends Domain { + _v1?: V1; + /** + * Initialize monitor domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = MonitorBase; diff --git a/node_modules/twilio/lib/rest/MonitorBase.js b/node_modules/twilio/lib/rest/MonitorBase.js new file mode 100644 index 00000000..4ca991ec --- /dev/null +++ b/node_modules/twilio/lib/rest/MonitorBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./monitor/V1")); +class MonitorBase extends Domain_1.default { + /** + * Initialize monitor domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://monitor.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = MonitorBase; diff --git a/node_modules/twilio/lib/rest/Notify.d.ts b/node_modules/twilio/lib/rest/Notify.d.ts new file mode 100644 index 00000000..7262a3ff --- /dev/null +++ b/node_modules/twilio/lib/rest/Notify.d.ts @@ -0,0 +1,14 @@ +import { CredentialListInstance } from "./notify/v1/credential"; +import { ServiceListInstance } from "./notify/v1/service"; +import NotifyBase from "./NotifyBase"; +declare class Notify extends NotifyBase { + /** + * @deprecated - Use v1.credentials instead + */ + get credentials(): CredentialListInstance; + /** + * @deprecated - Use v1.services instead + */ + get services(): ServiceListInstance; +} +export = Notify; diff --git a/node_modules/twilio/lib/rest/Notify.js b/node_modules/twilio/lib/rest/Notify.js new file mode 100644 index 00000000..78dcc19d --- /dev/null +++ b/node_modules/twilio/lib/rest/Notify.js @@ -0,0 +1,22 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const NotifyBase_1 = __importDefault(require("./NotifyBase")); +class Notify extends NotifyBase_1.default { + /** + * @deprecated - Use v1.credentials instead + */ + get credentials() { + console.warn("credentials is deprecated. Use v1.credentials instead."); + return this.v1.credentials; + } + /** + * @deprecated - Use v1.services instead + */ + get services() { + console.warn("services is deprecated. Use v1.services instead."); + return this.v1.services; + } +} +module.exports = Notify; diff --git a/node_modules/twilio/lib/rest/NotifyBase.d.ts b/node_modules/twilio/lib/rest/NotifyBase.d.ts new file mode 100644 index 00000000..44d814e7 --- /dev/null +++ b/node_modules/twilio/lib/rest/NotifyBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./notify/V1"; +declare class NotifyBase extends Domain { + _v1?: V1; + /** + * Initialize notify domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = NotifyBase; diff --git a/node_modules/twilio/lib/rest/NotifyBase.js b/node_modules/twilio/lib/rest/NotifyBase.js new file mode 100644 index 00000000..d552df92 --- /dev/null +++ b/node_modules/twilio/lib/rest/NotifyBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./notify/V1")); +class NotifyBase extends Domain_1.default { + /** + * Initialize notify domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://notify.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = NotifyBase; diff --git a/node_modules/twilio/lib/rest/Numbers.d.ts b/node_modules/twilio/lib/rest/Numbers.d.ts new file mode 100644 index 00000000..8f74807b --- /dev/null +++ b/node_modules/twilio/lib/rest/Numbers.d.ts @@ -0,0 +1,9 @@ +import { RegulatoryComplianceListInstance } from "./numbers/v2/regulatoryCompliance"; +import NumbersBase from "./NumbersBase"; +declare class Numbers extends NumbersBase { + /** + * @deprecated - Use v2.regulatoryCompliance instead + */ + get regulatoryCompliance(): RegulatoryComplianceListInstance; +} +export = Numbers; diff --git a/node_modules/twilio/lib/rest/Numbers.js b/node_modules/twilio/lib/rest/Numbers.js new file mode 100644 index 00000000..19bdb22b --- /dev/null +++ b/node_modules/twilio/lib/rest/Numbers.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const NumbersBase_1 = __importDefault(require("./NumbersBase")); +class Numbers extends NumbersBase_1.default { + /** + * @deprecated - Use v2.regulatoryCompliance instead + */ + get regulatoryCompliance() { + console.warn("regulatoryCompliance is deprecated. Use v2.regulatoryCompliance instead."); + return this.v2.regulatoryCompliance; + } +} +module.exports = Numbers; diff --git a/node_modules/twilio/lib/rest/NumbersBase.d.ts b/node_modules/twilio/lib/rest/NumbersBase.d.ts new file mode 100644 index 00000000..eab0e389 --- /dev/null +++ b/node_modules/twilio/lib/rest/NumbersBase.d.ts @@ -0,0 +1,16 @@ +import Domain from "../base/Domain"; +import V1 from "./numbers/V1"; +import V2 from "./numbers/V2"; +declare class NumbersBase extends Domain { + _v1?: V1; + _v2?: V2; + /** + * Initialize numbers domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; + get v2(): V2; +} +export = NumbersBase; diff --git a/node_modules/twilio/lib/rest/NumbersBase.js b/node_modules/twilio/lib/rest/NumbersBase.js new file mode 100644 index 00000000..2a5cc351 --- /dev/null +++ b/node_modules/twilio/lib/rest/NumbersBase.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./numbers/V1")); +const V2_1 = __importDefault(require("./numbers/V2")); +class NumbersBase extends Domain_1.default { + /** + * Initialize numbers domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://numbers.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = NumbersBase; diff --git a/node_modules/twilio/lib/rest/Preview.d.ts b/node_modules/twilio/lib/rest/Preview.d.ts new file mode 100644 index 00000000..b1858dab --- /dev/null +++ b/node_modules/twilio/lib/rest/Preview.d.ts @@ -0,0 +1,49 @@ +import { FleetListInstance } from "./preview/deployed_devices/fleet"; +import { AuthorizationDocumentListInstance } from "./preview/hosted_numbers/authorizationDocument"; +import { HostedNumberOrderListInstance } from "./preview/hosted_numbers/hostedNumberOrder"; +import { AvailableAddOnListInstance } from "./preview/marketplace/availableAddOn"; +import { InstalledAddOnListInstance } from "./preview/marketplace/installedAddOn"; +import { ServiceListInstance } from "./preview/sync/service"; +import { CommandListInstance } from "./preview/wireless/command"; +import { RatePlanListInstance } from "./preview/wireless/ratePlan"; +import { SimListInstance } from "./preview/wireless/sim"; +import PreviewBase from "./PreviewBase"; +declare class Preview extends PreviewBase { + /** + * @deprecated - Use deployed_devices.fleets instead + */ + get fleets(): FleetListInstance; + /** + * @deprecated - Use hosted_numbers.authorizationDocuments instead + */ + get authorizationDocuments(): AuthorizationDocumentListInstance; + /** + * @deprecated - Use hosted_numbers.hostedNumberOrders instead + */ + get hostedNumberOrders(): HostedNumberOrderListInstance; + /** + * @deprecated - Use marketplace.availableAddOns instead + */ + get availableAddOns(): AvailableAddOnListInstance; + /** + * @deprecated - Use marketplace.installedAddOns instead + */ + get installedAddOns(): InstalledAddOnListInstance; + /** + * @deprecated - Use sync.services instead + */ + get services(): ServiceListInstance; + /** + * @deprecated - Use wireless.commands instead + */ + get commands(): CommandListInstance; + /** + * @deprecated - Use wireless.ratePlans instead + */ + get ratePlans(): RatePlanListInstance; + /** + * @deprecated - Use wireless.sims instead + */ + get sims(): SimListInstance; +} +export = Preview; diff --git a/node_modules/twilio/lib/rest/Preview.js b/node_modules/twilio/lib/rest/Preview.js new file mode 100644 index 00000000..6852c09d --- /dev/null +++ b/node_modules/twilio/lib/rest/Preview.js @@ -0,0 +1,71 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const PreviewBase_1 = __importDefault(require("./PreviewBase")); +class Preview extends PreviewBase_1.default { + /** + * @deprecated - Use deployed_devices.fleets instead + */ + get fleets() { + console.warn("fleets is deprecated. Use deployed_devices.fleets instead."); + return this.deployed_devices.fleets; + } + /** + * @deprecated - Use hosted_numbers.authorizationDocuments instead + */ + get authorizationDocuments() { + console.warn("authorizationDocuments is deprecated. Use hosted_numbers.authorizationDocuments instead."); + return this.hosted_numbers.authorizationDocuments; + } + /** + * @deprecated - Use hosted_numbers.hostedNumberOrders instead + */ + get hostedNumberOrders() { + console.warn("hostedNumberOrders is deprecated. Use hosted_numbers.hostedNumberOrders instead."); + return this.hosted_numbers.hostedNumberOrders; + } + /** + * @deprecated - Use marketplace.availableAddOns instead + */ + get availableAddOns() { + console.warn("availableAddOns is deprecated. Use marketplace.availableAddOns instead."); + return this.marketplace.availableAddOns; + } + /** + * @deprecated - Use marketplace.installedAddOns instead + */ + get installedAddOns() { + console.warn("installedAddOns is deprecated. Use marketplace.installedAddOns instead."); + return this.marketplace.installedAddOns; + } + /** + * @deprecated - Use sync.services instead + */ + get services() { + console.warn("services is deprecated. Use sync.services instead."); + return this.sync.services; + } + /** + * @deprecated - Use wireless.commands instead + */ + get commands() { + console.warn("commands is deprecated. Use wireless.commands instead."); + return this.wireless.commands; + } + /** + * @deprecated - Use wireless.ratePlans instead + */ + get ratePlans() { + console.warn("ratePlans is deprecated. Use wireless.ratePlans instead."); + return this.wireless.ratePlans; + } + /** + * @deprecated - Use wireless.sims instead + */ + get sims() { + console.warn("sims is deprecated. Use wireless.sims instead."); + return this.wireless.sims; + } +} +module.exports = Preview; diff --git a/node_modules/twilio/lib/rest/PreviewBase.d.ts b/node_modules/twilio/lib/rest/PreviewBase.d.ts new file mode 100644 index 00000000..95b52fb8 --- /dev/null +++ b/node_modules/twilio/lib/rest/PreviewBase.d.ts @@ -0,0 +1,25 @@ +import Domain from "../base/Domain"; +import DeployedDevices from "./preview/DeployedDevices"; +import HostedNumbers from "./preview/HostedNumbers"; +import Sync from "./preview/Sync"; +import Marketplace from "./preview/Marketplace"; +import Wireless from "./preview/Wireless"; +declare class PreviewBase extends Domain { + _deployed_devices?: DeployedDevices; + _hosted_numbers?: HostedNumbers; + _sync?: Sync; + _marketplace?: Marketplace; + _wireless?: Wireless; + /** + * Initialize preview domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get deployed_devices(): DeployedDevices; + get hosted_numbers(): HostedNumbers; + get sync(): Sync; + get marketplace(): Marketplace; + get wireless(): Wireless; +} +export = PreviewBase; diff --git a/node_modules/twilio/lib/rest/PreviewBase.js b/node_modules/twilio/lib/rest/PreviewBase.js new file mode 100644 index 00000000..6a7c639a --- /dev/null +++ b/node_modules/twilio/lib/rest/PreviewBase.js @@ -0,0 +1,52 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const DeployedDevices_1 = __importDefault(require("./preview/DeployedDevices")); +const HostedNumbers_1 = __importDefault(require("./preview/HostedNumbers")); +const Sync_1 = __importDefault(require("./preview/Sync")); +const Marketplace_1 = __importDefault(require("./preview/Marketplace")); +const Wireless_1 = __importDefault(require("./preview/Wireless")); +class PreviewBase extends Domain_1.default { + /** + * Initialize preview domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://preview.twilio.com"); + } + get deployed_devices() { + this._deployed_devices = + this._deployed_devices || new DeployedDevices_1.default(this); + return this._deployed_devices; + } + get hosted_numbers() { + this._hosted_numbers = this._hosted_numbers || new HostedNumbers_1.default(this); + return this._hosted_numbers; + } + get sync() { + this._sync = this._sync || new Sync_1.default(this); + return this._sync; + } + get marketplace() { + this._marketplace = this._marketplace || new Marketplace_1.default(this); + return this._marketplace; + } + get wireless() { + this._wireless = this._wireless || new Wireless_1.default(this); + return this._wireless; + } +} +module.exports = PreviewBase; diff --git a/node_modules/twilio/lib/rest/Pricing.d.ts b/node_modules/twilio/lib/rest/Pricing.d.ts new file mode 100644 index 00000000..12eb9cf0 --- /dev/null +++ b/node_modules/twilio/lib/rest/Pricing.d.ts @@ -0,0 +1,29 @@ +import { MessagingListInstance } from "./pricing/v1/messaging"; +import { PhoneNumberListInstance } from "./pricing/v1/phoneNumber"; +import { VoiceListInstance } from "./pricing/v2/voice"; +import { CountryListInstance } from "./pricing/v2/country"; +import { NumberListInstance } from "./pricing/v2/number"; +import PricingBase from "./PricingBase"; +declare class Pricing extends PricingBase { + /** + * @deprecated - Use v1.messaging instead + */ + get messaging(): MessagingListInstance; + /** + * @deprecated - Use v1.phoneNumbers instead + */ + get phoneNumbers(): PhoneNumberListInstance; + /** + * @deprecated - Use v2.voice instead + */ + get voice(): VoiceListInstance; + /** + * @deprecated - Use v2.countries instead + */ + get countries(): CountryListInstance; + /** + * @deprecated - Use v2.numbers instead + */ + get numbers(): NumberListInstance; +} +export = Pricing; diff --git a/node_modules/twilio/lib/rest/Pricing.js b/node_modules/twilio/lib/rest/Pricing.js new file mode 100644 index 00000000..9a941b77 --- /dev/null +++ b/node_modules/twilio/lib/rest/Pricing.js @@ -0,0 +1,43 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const PricingBase_1 = __importDefault(require("./PricingBase")); +class Pricing extends PricingBase_1.default { + /** + * @deprecated - Use v1.messaging instead + */ + get messaging() { + console.warn("messaging is deprecated. Use v1.messaging instead."); + return this.v1.messaging; + } + /** + * @deprecated - Use v1.phoneNumbers instead + */ + get phoneNumbers() { + console.warn("phoneNumbers is deprecated. Use v1.phoneNumbers instead."); + return this.v1.phoneNumbers; + } + /** + * @deprecated - Use v2.voice instead + */ + get voice() { + console.warn("voice is deprecated. Use v2.voice instead."); + return this.v2.voice; + } + /** + * @deprecated - Use v2.countries instead + */ + get countries() { + console.warn("countries is deprecated. Use v2.countries instead."); + return this.v2.countries; + } + /** + * @deprecated - Use v2.numbers instead + */ + get numbers() { + console.warn("numbers is deprecated. Use v2.numbers instead."); + return this.v2.numbers; + } +} +module.exports = Pricing; diff --git a/node_modules/twilio/lib/rest/PricingBase.d.ts b/node_modules/twilio/lib/rest/PricingBase.d.ts new file mode 100644 index 00000000..5eaf8593 --- /dev/null +++ b/node_modules/twilio/lib/rest/PricingBase.d.ts @@ -0,0 +1,16 @@ +import Domain from "../base/Domain"; +import V1 from "./pricing/V1"; +import V2 from "./pricing/V2"; +declare class PricingBase extends Domain { + _v1?: V1; + _v2?: V2; + /** + * Initialize pricing domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; + get v2(): V2; +} +export = PricingBase; diff --git a/node_modules/twilio/lib/rest/PricingBase.js b/node_modules/twilio/lib/rest/PricingBase.js new file mode 100644 index 00000000..d21d309b --- /dev/null +++ b/node_modules/twilio/lib/rest/PricingBase.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./pricing/V1")); +const V2_1 = __importDefault(require("./pricing/V2")); +class PricingBase extends Domain_1.default { + /** + * Initialize pricing domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://pricing.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = PricingBase; diff --git a/node_modules/twilio/lib/rest/Proxy.d.ts b/node_modules/twilio/lib/rest/Proxy.d.ts new file mode 100644 index 00000000..d8828f68 --- /dev/null +++ b/node_modules/twilio/lib/rest/Proxy.d.ts @@ -0,0 +1,9 @@ +import { ServiceListInstance } from "./proxy/v1/service"; +import ProxyBase from "./ProxyBase"; +declare class Proxy extends ProxyBase { + /** + * @deprecated - Use v1.services instead + */ + get services(): ServiceListInstance; +} +export = Proxy; diff --git a/node_modules/twilio/lib/rest/Proxy.js b/node_modules/twilio/lib/rest/Proxy.js new file mode 100644 index 00000000..01ff72c8 --- /dev/null +++ b/node_modules/twilio/lib/rest/Proxy.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const ProxyBase_1 = __importDefault(require("./ProxyBase")); +class Proxy extends ProxyBase_1.default { + /** + * @deprecated - Use v1.services instead + */ + get services() { + console.warn("services is deprecated. Use v1.services instead."); + return this.v1.services; + } +} +module.exports = Proxy; diff --git a/node_modules/twilio/lib/rest/ProxyBase.d.ts b/node_modules/twilio/lib/rest/ProxyBase.d.ts new file mode 100644 index 00000000..3bb8880d --- /dev/null +++ b/node_modules/twilio/lib/rest/ProxyBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./proxy/V1"; +declare class ProxyBase extends Domain { + _v1?: V1; + /** + * Initialize proxy domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = ProxyBase; diff --git a/node_modules/twilio/lib/rest/ProxyBase.js b/node_modules/twilio/lib/rest/ProxyBase.js new file mode 100644 index 00000000..8faf0bc6 --- /dev/null +++ b/node_modules/twilio/lib/rest/ProxyBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./proxy/V1")); +class ProxyBase extends Domain_1.default { + /** + * Initialize proxy domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://proxy.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = ProxyBase; diff --git a/node_modules/twilio/lib/rest/Routes.d.ts b/node_modules/twilio/lib/rest/Routes.d.ts new file mode 100644 index 00000000..5c608d2a --- /dev/null +++ b/node_modules/twilio/lib/rest/Routes.d.ts @@ -0,0 +1,19 @@ +import { PhoneNumberListInstance } from "./routes/v2/phoneNumber"; +import { SipDomainListInstance } from "./routes/v2/sipDomain"; +import { TrunkListInstance } from "./routes/v2/trunk"; +import RoutesBase from "./RoutesBase"; +declare class Routes extends RoutesBase { + /** + * @deprecated - Use v1.phoneNumbers instead + */ + get phoneNumbers(): PhoneNumberListInstance; + /** + * @deprecated - Use v1.sipDomains instead + */ + get sipDomains(): SipDomainListInstance; + /** + * @deprecated - Use v1.trunks instead + */ + get trunks(): TrunkListInstance; +} +export = Routes; diff --git a/node_modules/twilio/lib/rest/Routes.js b/node_modules/twilio/lib/rest/Routes.js new file mode 100644 index 00000000..70f2f20b --- /dev/null +++ b/node_modules/twilio/lib/rest/Routes.js @@ -0,0 +1,29 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const RoutesBase_1 = __importDefault(require("./RoutesBase")); +class Routes extends RoutesBase_1.default { + /** + * @deprecated - Use v1.phoneNumbers instead + */ + get phoneNumbers() { + console.warn("phoneNumbers is deprecated. Use v1.phoneNumbers instead."); + return this.v2.phoneNumbers; + } + /** + * @deprecated - Use v1.sipDomains instead + */ + get sipDomains() { + console.warn("sipDomains is deprecated. Use v1.sipDomains instead."); + return this.v2.sipDomains; + } + /** + * @deprecated - Use v1.trunks instead + */ + get trunks() { + console.warn("trunks is deprecated. Use v1.trunks instead."); + return this.v2.trunks; + } +} +module.exports = Routes; diff --git a/node_modules/twilio/lib/rest/RoutesBase.d.ts b/node_modules/twilio/lib/rest/RoutesBase.d.ts new file mode 100644 index 00000000..71f0c19e --- /dev/null +++ b/node_modules/twilio/lib/rest/RoutesBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V2 from "./routes/V2"; +declare class RoutesBase extends Domain { + _v2?: V2; + /** + * Initialize routes domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v2(): V2; +} +export = RoutesBase; diff --git a/node_modules/twilio/lib/rest/RoutesBase.js b/node_modules/twilio/lib/rest/RoutesBase.js new file mode 100644 index 00000000..33fcd315 --- /dev/null +++ b/node_modules/twilio/lib/rest/RoutesBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V2_1 = __importDefault(require("./routes/V2")); +class RoutesBase extends Domain_1.default { + /** + * Initialize routes domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://routes.twilio.com"); + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = RoutesBase; diff --git a/node_modules/twilio/lib/rest/Serverless.d.ts b/node_modules/twilio/lib/rest/Serverless.d.ts new file mode 100644 index 00000000..285bda32 --- /dev/null +++ b/node_modules/twilio/lib/rest/Serverless.d.ts @@ -0,0 +1,9 @@ +import { ServiceListInstance } from "./serverless/v1/service"; +import ServerlessBase from "./ServerlessBase"; +declare class Serverless extends ServerlessBase { + /** + * @deprecated - Use v1.services instead + */ + get services(): ServiceListInstance; +} +export = Serverless; diff --git a/node_modules/twilio/lib/rest/Serverless.js b/node_modules/twilio/lib/rest/Serverless.js new file mode 100644 index 00000000..41426fac --- /dev/null +++ b/node_modules/twilio/lib/rest/Serverless.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const ServerlessBase_1 = __importDefault(require("./ServerlessBase")); +class Serverless extends ServerlessBase_1.default { + /** + * @deprecated - Use v1.services instead + */ + get services() { + console.warn("services is deprecated. Use v1.services instead."); + return this.v1.services; + } +} +module.exports = Serverless; diff --git a/node_modules/twilio/lib/rest/ServerlessBase.d.ts b/node_modules/twilio/lib/rest/ServerlessBase.d.ts new file mode 100644 index 00000000..6365fa30 --- /dev/null +++ b/node_modules/twilio/lib/rest/ServerlessBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./serverless/V1"; +declare class ServerlessBase extends Domain { + _v1?: V1; + /** + * Initialize serverless domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = ServerlessBase; diff --git a/node_modules/twilio/lib/rest/ServerlessBase.js b/node_modules/twilio/lib/rest/ServerlessBase.js new file mode 100644 index 00000000..a8914303 --- /dev/null +++ b/node_modules/twilio/lib/rest/ServerlessBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./serverless/V1")); +class ServerlessBase extends Domain_1.default { + /** + * Initialize serverless domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://serverless.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = ServerlessBase; diff --git a/node_modules/twilio/lib/rest/Studio.d.ts b/node_modules/twilio/lib/rest/Studio.d.ts new file mode 100644 index 00000000..d5464920 --- /dev/null +++ b/node_modules/twilio/lib/rest/Studio.d.ts @@ -0,0 +1,14 @@ +import { FlowListInstance } from "./studio/v2/flow"; +import { FlowValidateListInstance } from "./studio/v2/flowValidate"; +import StudioBase from "./StudioBase"; +declare class Studio extends StudioBase { + /** + * @deprecated - Use v2.flows instead + */ + get flows(): FlowListInstance; + /** + * @deprecated - Use v2.flowValidate instead + */ + get flowValidate(): FlowValidateListInstance; +} +export = Studio; diff --git a/node_modules/twilio/lib/rest/Studio.js b/node_modules/twilio/lib/rest/Studio.js new file mode 100644 index 00000000..1bc565f2 --- /dev/null +++ b/node_modules/twilio/lib/rest/Studio.js @@ -0,0 +1,22 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const StudioBase_1 = __importDefault(require("./StudioBase")); +class Studio extends StudioBase_1.default { + /** + * @deprecated - Use v2.flows instead + */ + get flows() { + console.warn("flows is deprecated. Use v2.flows instead."); + return this.v2.flows; + } + /** + * @deprecated - Use v2.flowValidate instead + */ + get flowValidate() { + console.warn("flowValidate is deprecated. Use v2.flowValidate instead."); + return this.v2.flowValidate; + } +} +module.exports = Studio; diff --git a/node_modules/twilio/lib/rest/StudioBase.d.ts b/node_modules/twilio/lib/rest/StudioBase.d.ts new file mode 100644 index 00000000..1d37669f --- /dev/null +++ b/node_modules/twilio/lib/rest/StudioBase.d.ts @@ -0,0 +1,16 @@ +import Domain from "../base/Domain"; +import V1 from "./studio/V1"; +import V2 from "./studio/V2"; +declare class StudioBase extends Domain { + _v1?: V1; + _v2?: V2; + /** + * Initialize studio domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; + get v2(): V2; +} +export = StudioBase; diff --git a/node_modules/twilio/lib/rest/StudioBase.js b/node_modules/twilio/lib/rest/StudioBase.js new file mode 100644 index 00000000..f196ca02 --- /dev/null +++ b/node_modules/twilio/lib/rest/StudioBase.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./studio/V1")); +const V2_1 = __importDefault(require("./studio/V2")); +class StudioBase extends Domain_1.default { + /** + * Initialize studio domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://studio.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = StudioBase; diff --git a/node_modules/twilio/lib/rest/Supersim.d.ts b/node_modules/twilio/lib/rest/Supersim.d.ts new file mode 100644 index 00000000..0cad98df --- /dev/null +++ b/node_modules/twilio/lib/rest/Supersim.d.ts @@ -0,0 +1,49 @@ +import { EsimProfileListInstance } from "./supersim/v1/esimProfile"; +import { FleetListInstance } from "./supersim/v1/fleet"; +import { IpCommandListInstance } from "./supersim/v1/ipCommand"; +import { NetworkListInstance } from "./supersim/v1/network"; +import { NetworkAccessProfileListInstance } from "./supersim/v1/networkAccessProfile"; +import { SettingsUpdateListInstance } from "./supersim/v1/settingsUpdate"; +import { SimListInstance } from "./supersim/v1/sim"; +import { SmsCommandListInstance } from "./supersim/v1/smsCommand"; +import { UsageRecordListInstance } from "./supersim/v1/usageRecord"; +import SupersimBase from "./SupersimBase"; +declare class Supersim extends SupersimBase { + /** + * @deprecated - Use v1.esimProfiles instead + */ + get esimProfiles(): EsimProfileListInstance; + /** + * @deprecated - Use v1.fleets instead + */ + get fleets(): FleetListInstance; + /** + * @deprecated - Use v1.ipCommands instead + */ + get ipCommands(): IpCommandListInstance; + /** + * @deprecated - Use v1.networks instead + */ + get networks(): NetworkListInstance; + /** + * @deprecated - Use v1.settingsUpdates instead + */ + get settingsUpdates(): SettingsUpdateListInstance; + /** + * @deprecated - Use v1.networkAccessProfiles instead + */ + get networkAccessProfiles(): NetworkAccessProfileListInstance; + /** + * @deprecated - Use v1.sims instead + */ + get sims(): SimListInstance; + /** + * @deprecated - Use v1.smsCommands instead + */ + get smsCommands(): SmsCommandListInstance; + /** + * @deprecated - Use v1.usageRecords instead + */ + get usageRecords(): UsageRecordListInstance; +} +export = Supersim; diff --git a/node_modules/twilio/lib/rest/Supersim.js b/node_modules/twilio/lib/rest/Supersim.js new file mode 100644 index 00000000..76813491 --- /dev/null +++ b/node_modules/twilio/lib/rest/Supersim.js @@ -0,0 +1,71 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const SupersimBase_1 = __importDefault(require("./SupersimBase")); +class Supersim extends SupersimBase_1.default { + /** + * @deprecated - Use v1.esimProfiles instead + */ + get esimProfiles() { + console.warn("esimProfiles is deprecated. Use v1.esimProfiles instead."); + return this.v1.esimProfiles; + } + /** + * @deprecated - Use v1.fleets instead + */ + get fleets() { + console.warn("fleets is deprecated. Use v1.fleets instead."); + return this.v1.fleets; + } + /** + * @deprecated - Use v1.ipCommands instead + */ + get ipCommands() { + console.warn("ipCommands is deprecated. Use v1.ipCommands instead."); + return this.v1.ipCommands; + } + /** + * @deprecated - Use v1.networks instead + */ + get networks() { + console.warn("networks is deprecated. Use v1.networks instead."); + return this.v1.networks; + } + /** + * @deprecated - Use v1.settingsUpdates instead + */ + get settingsUpdates() { + console.warn("settingsUpdates is deprecated. Use v1.settingsUpdates instead."); + return this.v1.settingsUpdates; + } + /** + * @deprecated - Use v1.networkAccessProfiles instead + */ + get networkAccessProfiles() { + console.warn("networkAccessProfiles is deprecated. Use v1.networkAccessProfiles instead."); + return this.v1.networkAccessProfiles; + } + /** + * @deprecated - Use v1.sims instead + */ + get sims() { + console.warn("sims is deprecated. Use v1.sims instead."); + return this.v1.sims; + } + /** + * @deprecated - Use v1.smsCommands instead + */ + get smsCommands() { + console.warn("smsCommands is deprecated. Use v1.smsCommands instead."); + return this.v1.smsCommands; + } + /** + * @deprecated - Use v1.usageRecords instead + */ + get usageRecords() { + console.warn("usageRecords is deprecated. Use v1.usageRecords instead."); + return this.v1.usageRecords; + } +} +module.exports = Supersim; diff --git a/node_modules/twilio/lib/rest/SupersimBase.d.ts b/node_modules/twilio/lib/rest/SupersimBase.d.ts new file mode 100644 index 00000000..fbb0fcf5 --- /dev/null +++ b/node_modules/twilio/lib/rest/SupersimBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./supersim/V1"; +declare class SupersimBase extends Domain { + _v1?: V1; + /** + * Initialize supersim domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = SupersimBase; diff --git a/node_modules/twilio/lib/rest/SupersimBase.js b/node_modules/twilio/lib/rest/SupersimBase.js new file mode 100644 index 00000000..c8af89c9 --- /dev/null +++ b/node_modules/twilio/lib/rest/SupersimBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./supersim/V1")); +class SupersimBase extends Domain_1.default { + /** + * Initialize supersim domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://supersim.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = SupersimBase; diff --git a/node_modules/twilio/lib/rest/Sync.d.ts b/node_modules/twilio/lib/rest/Sync.d.ts new file mode 100644 index 00000000..d0b75302 --- /dev/null +++ b/node_modules/twilio/lib/rest/Sync.d.ts @@ -0,0 +1,9 @@ +import { ServiceListInstance } from "./sync/v1/service"; +import SyncBase from "./SyncBase"; +declare class Sync extends SyncBase { + /** + * @deprecated - Use v1.services instead + */ + get services(): ServiceListInstance; +} +export = Sync; diff --git a/node_modules/twilio/lib/rest/Sync.js b/node_modules/twilio/lib/rest/Sync.js new file mode 100644 index 00000000..05cbe8af --- /dev/null +++ b/node_modules/twilio/lib/rest/Sync.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const SyncBase_1 = __importDefault(require("./SyncBase")); +class Sync extends SyncBase_1.default { + /** + * @deprecated - Use v1.services instead + */ + get services() { + console.warn("services is deprecated. Use v1.services instead."); + return this.v1.services; + } +} +module.exports = Sync; diff --git a/node_modules/twilio/lib/rest/SyncBase.d.ts b/node_modules/twilio/lib/rest/SyncBase.d.ts new file mode 100644 index 00000000..741bb903 --- /dev/null +++ b/node_modules/twilio/lib/rest/SyncBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./sync/V1"; +declare class SyncBase extends Domain { + _v1?: V1; + /** + * Initialize sync domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = SyncBase; diff --git a/node_modules/twilio/lib/rest/SyncBase.js b/node_modules/twilio/lib/rest/SyncBase.js new file mode 100644 index 00000000..60356ea0 --- /dev/null +++ b/node_modules/twilio/lib/rest/SyncBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./sync/V1")); +class SyncBase extends Domain_1.default { + /** + * Initialize sync domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://sync.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = SyncBase; diff --git a/node_modules/twilio/lib/rest/Taskrouter.d.ts b/node_modules/twilio/lib/rest/Taskrouter.d.ts new file mode 100644 index 00000000..6dbad964 --- /dev/null +++ b/node_modules/twilio/lib/rest/Taskrouter.d.ts @@ -0,0 +1,9 @@ +import { WorkspaceListInstance } from "./taskrouter/v1/workspace"; +import TaskrouterBase from "./TaskrouterBase"; +declare class Taskrouter extends TaskrouterBase { + /** + * @deprecated - Use v1.workspaces instead + */ + get workspaces(): WorkspaceListInstance; +} +export = Taskrouter; diff --git a/node_modules/twilio/lib/rest/Taskrouter.js b/node_modules/twilio/lib/rest/Taskrouter.js new file mode 100644 index 00000000..e088bea3 --- /dev/null +++ b/node_modules/twilio/lib/rest/Taskrouter.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const TaskrouterBase_1 = __importDefault(require("./TaskrouterBase")); +class Taskrouter extends TaskrouterBase_1.default { + /** + * @deprecated - Use v1.workspaces instead + */ + get workspaces() { + console.warn("workspaces is deprecated. Use v1.workspaces instead."); + return this.v1.workspaces; + } +} +module.exports = Taskrouter; diff --git a/node_modules/twilio/lib/rest/TaskrouterBase.d.ts b/node_modules/twilio/lib/rest/TaskrouterBase.d.ts new file mode 100644 index 00000000..90a42891 --- /dev/null +++ b/node_modules/twilio/lib/rest/TaskrouterBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./taskrouter/V1"; +declare class TaskrouterBase extends Domain { + _v1?: V1; + /** + * Initialize taskrouter domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = TaskrouterBase; diff --git a/node_modules/twilio/lib/rest/TaskrouterBase.js b/node_modules/twilio/lib/rest/TaskrouterBase.js new file mode 100644 index 00000000..ad6ec93a --- /dev/null +++ b/node_modules/twilio/lib/rest/TaskrouterBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./taskrouter/V1")); +class TaskrouterBase extends Domain_1.default { + /** + * Initialize taskrouter domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://taskrouter.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = TaskrouterBase; diff --git a/node_modules/twilio/lib/rest/Trunking.d.ts b/node_modules/twilio/lib/rest/Trunking.d.ts new file mode 100644 index 00000000..c1d08648 --- /dev/null +++ b/node_modules/twilio/lib/rest/Trunking.d.ts @@ -0,0 +1,9 @@ +import { TrunkListInstance } from "./trunking/v1/trunk"; +import TrunkingBase from "./TrunkingBase"; +declare class Trunking extends TrunkingBase { + /** + * @deprecated - Use v1.trunks instead + */ + get trunks(): TrunkListInstance; +} +export = Trunking; diff --git a/node_modules/twilio/lib/rest/Trunking.js b/node_modules/twilio/lib/rest/Trunking.js new file mode 100644 index 00000000..002b4b2c --- /dev/null +++ b/node_modules/twilio/lib/rest/Trunking.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const TrunkingBase_1 = __importDefault(require("./TrunkingBase")); +class Trunking extends TrunkingBase_1.default { + /** + * @deprecated - Use v1.trunks instead + */ + get trunks() { + console.warn("trunks is deprecated. Use v1.trunks instead."); + return this.v1.trunks; + } +} +module.exports = Trunking; diff --git a/node_modules/twilio/lib/rest/TrunkingBase.d.ts b/node_modules/twilio/lib/rest/TrunkingBase.d.ts new file mode 100644 index 00000000..9f85441b --- /dev/null +++ b/node_modules/twilio/lib/rest/TrunkingBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./trunking/V1"; +declare class TrunkingBase extends Domain { + _v1?: V1; + /** + * Initialize trunking domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = TrunkingBase; diff --git a/node_modules/twilio/lib/rest/TrunkingBase.js b/node_modules/twilio/lib/rest/TrunkingBase.js new file mode 100644 index 00000000..d45bca93 --- /dev/null +++ b/node_modules/twilio/lib/rest/TrunkingBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./trunking/V1")); +class TrunkingBase extends Domain_1.default { + /** + * Initialize trunking domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://trunking.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = TrunkingBase; diff --git a/node_modules/twilio/lib/rest/Trusthub.d.ts b/node_modules/twilio/lib/rest/Trusthub.d.ts new file mode 100644 index 00000000..b4ae530f --- /dev/null +++ b/node_modules/twilio/lib/rest/Trusthub.d.ts @@ -0,0 +1,39 @@ +import { CustomerProfilesListInstance } from "./trusthub/v1/customerProfiles"; +import { EndUserListInstance } from "./trusthub/v1/endUser"; +import { EndUserTypeListInstance } from "./trusthub/v1/endUserType"; +import { PoliciesListInstance } from "./trusthub/v1/policies"; +import { SupportingDocumentListInstance } from "./trusthub/v1/supportingDocument"; +import { SupportingDocumentTypeListInstance } from "./trusthub/v1/supportingDocumentType"; +import { TrustProductsListInstance } from "./trusthub/v1/trustProducts"; +import TrusthubBase from "./TrusthubBase"; +declare class Trusthub extends TrusthubBase { + /** + * @deprecated - Use v1.customerProfiles instead + */ + get customerProfiles(): CustomerProfilesListInstance; + /** + * @deprecated - Use v1.endUsers instead + */ + get endUsers(): EndUserListInstance; + /** + * @deprecated - Use v1.endUserTypes instead + */ + get endUserTypes(): EndUserTypeListInstance; + /** + * @deprecated - Use v1.policies instead + */ + get policies(): PoliciesListInstance; + /** + * @deprecated - Use v1.supportingDocuments instead + */ + get supportingDocuments(): SupportingDocumentListInstance; + /** + * @deprecated - Use v1.supportingDocumentTypes instead + */ + get supportingDocumentTypes(): SupportingDocumentTypeListInstance; + /** + * @deprecated - Use v1.trustProducts instead + */ + get trustProducts(): TrustProductsListInstance; +} +export = Trusthub; diff --git a/node_modules/twilio/lib/rest/Trusthub.js b/node_modules/twilio/lib/rest/Trusthub.js new file mode 100644 index 00000000..7f110e54 --- /dev/null +++ b/node_modules/twilio/lib/rest/Trusthub.js @@ -0,0 +1,57 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const TrusthubBase_1 = __importDefault(require("./TrusthubBase")); +class Trusthub extends TrusthubBase_1.default { + /** + * @deprecated - Use v1.customerProfiles instead + */ + get customerProfiles() { + console.warn("customerProfiles is deprecated. Use v1.customerProfiles instead."); + return this.v1.customerProfiles; + } + /** + * @deprecated - Use v1.endUsers instead + */ + get endUsers() { + console.warn("endUsers is deprecated. Use v1.endUsers instead."); + return this.v1.endUsers; + } + /** + * @deprecated - Use v1.endUserTypes instead + */ + get endUserTypes() { + console.warn("endUserTypes is deprecated. Use v1.endUserTypes instead."); + return this.v1.endUserTypes; + } + /** + * @deprecated - Use v1.policies instead + */ + get policies() { + console.warn("policies is deprecated. Use v1.policies instead."); + return this.v1.policies; + } + /** + * @deprecated - Use v1.supportingDocuments instead + */ + get supportingDocuments() { + console.warn("supportingDocuments is deprecated. Use v1.supportingDocuments instead."); + return this.v1.supportingDocuments; + } + /** + * @deprecated - Use v1.supportingDocumentTypes instead + */ + get supportingDocumentTypes() { + console.warn("supportingDocumentTypes is deprecated. Use v1.supportingDocumentTypes instead."); + return this.v1.supportingDocumentTypes; + } + /** + * @deprecated - Use v1.trustProducts instead + */ + get trustProducts() { + console.warn("trustProducts is deprecated. Use v1.trustProducts instead."); + return this.v1.trustProducts; + } +} +module.exports = Trusthub; diff --git a/node_modules/twilio/lib/rest/TrusthubBase.d.ts b/node_modules/twilio/lib/rest/TrusthubBase.d.ts new file mode 100644 index 00000000..a6fc265a --- /dev/null +++ b/node_modules/twilio/lib/rest/TrusthubBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./trusthub/V1"; +declare class TrusthubBase extends Domain { + _v1?: V1; + /** + * Initialize trusthub domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = TrusthubBase; diff --git a/node_modules/twilio/lib/rest/TrusthubBase.js b/node_modules/twilio/lib/rest/TrusthubBase.js new file mode 100644 index 00000000..f5a8d194 --- /dev/null +++ b/node_modules/twilio/lib/rest/TrusthubBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./trusthub/V1")); +class TrusthubBase extends Domain_1.default { + /** + * Initialize trusthub domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://trusthub.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = TrusthubBase; diff --git a/node_modules/twilio/lib/rest/Twilio.d.ts b/node_modules/twilio/lib/rest/Twilio.d.ts new file mode 100644 index 00000000..5fc10f8d --- /dev/null +++ b/node_modules/twilio/lib/rest/Twilio.d.ts @@ -0,0 +1,267 @@ +import { Client, ClientOpts, RequestOpts } from "../base/BaseTwilio"; +import Accounts from "./Accounts"; +import Api from "./Api"; +import Bulkexports from "./Bulkexports"; +import Chat from "./Chat"; +import Content from "./Content"; +import Conversations from "./Conversations"; +import Events from "./Events"; +import FlexApi from "./FlexApi"; +import FrontlineApi from "./FrontlineApi"; +import Insights from "./Insights"; +import Intelligence from "./Intelligence"; +import IpMessaging from "./IpMessaging"; +import Lookups from "./Lookups"; +import Media from "./Media"; +import Messaging from "./Messaging"; +import Microvisor from "./Microvisor"; +import Monitor from "./Monitor"; +import Notify from "./Notify"; +import Numbers from "./Numbers"; +import Preview from "./Preview"; +import Pricing from "./Pricing"; +import Proxy from "./Proxy"; +import Routes from "./Routes"; +import Serverless from "./Serverless"; +import Studio from "./Studio"; +import Supersim from "./Supersim"; +import Sync from "./Sync"; +import Taskrouter from "./Taskrouter"; +import Trunking from "./Trunking"; +import Trusthub from "./Trusthub"; +import Verify from "./Verify"; +import Video from "./Video"; +import Voice from "./Voice"; +import Wireless from "./Wireless"; +import { AddressListInstance } from "./api/v2010/account/address"; +import { ApplicationListInstance } from "./api/v2010/account/application"; +import { AuthorizedConnectAppListInstance } from "./api/v2010/account/authorizedConnectApp"; +import { AvailablePhoneNumberCountryListInstance } from "./api/v2010/account/availablePhoneNumberCountry"; +import { BalanceListInstance } from "./api/v2010/account/balance"; +import { CallListInstance } from "./api/v2010/account/call"; +import { ConferenceListInstance } from "./api/v2010/account/conference"; +import { ConnectAppListInstance } from "./api/v2010/account/connectApp"; +import { IncomingPhoneNumberListInstance } from "./api/v2010/account/incomingPhoneNumber"; +import { KeyListInstance } from "./api/v2010/account/key"; +import { MessageListInstance } from "./api/v2010/account/message"; +import { NewKeyListInstance } from "./api/v2010/account/newKey"; +import { NewSigningKeyListInstance } from "./api/v2010/account/newSigningKey"; +import { NotificationListInstance } from "./api/v2010/account/notification"; +import { OutgoingCallerIdListInstance } from "./api/v2010/account/outgoingCallerId"; +import { QueueListInstance } from "./api/v2010/account/queue"; +import { RecordingListInstance } from "./api/v2010/account/recording"; +import { ShortCodeListInstance } from "./api/v2010/account/shortCode"; +import { SigningKeyListInstance } from "./api/v2010/account/signingKey"; +import { SipListInstance } from "./api/v2010/account/sip"; +import { TokenListInstance } from "./api/v2010/account/token"; +import { TranscriptionListInstance } from "./api/v2010/account/transcription"; +import { UsageListInstance } from "./api/v2010/account/usage"; +import { ValidationRequestListInstance } from "./api/v2010/account/validationRequest"; +/** + * Twilio Client to interact with the Rest API + */ +declare class Twilio extends Client { + /** (Twilio.Accounts) - accounts domain */ + _accounts?: Accounts; + /** (Twilio.Api) - api domain */ + _api?: Api; + /** (Twilio.Bulkexports) - bulkexports domain */ + _bulkexports?: Bulkexports; + /** (Twilio.Chat) - chat domain */ + _chat?: Chat; + /** (Twilio.Content) - content domain */ + _content?: Content; + /** (Twilio.Conversations) - conversations domain */ + _conversations?: Conversations; + /** (Twilio.Events) - events domain */ + _events?: Events; + /** (Twilio.FlexApi) - flexApi domain */ + _flexApi?: FlexApi; + /** (Twilio.FrontlineApi) - frontlineApi domain */ + _frontlineApi?: FrontlineApi; + /** (Twilio.Insights) - insights domain */ + _insights?: Insights; + /** (Twilio.Intelligence) - intelligence domain */ + _intelligence?: Intelligence; + /** (Twilio.IpMessaging) - ipMessaging domain */ + _ipMessaging?: IpMessaging; + /** (Twilio.Lookups) - lookups domain */ + _lookups?: Lookups; + /** (Twilio.Media) - media domain */ + _media?: Media; + /** (Twilio.Messaging) - messaging domain */ + _messaging?: Messaging; + /** (Twilio.Microvisor) - microvisor domain */ + _microvisor?: Microvisor; + /** (Twilio.Monitor) - monitor domain */ + _monitor?: Monitor; + /** (Twilio.Notify) - notify domain */ + _notify?: Notify; + /** (Twilio.Numbers) - numbers domain */ + _numbers?: Numbers; + /** (Twilio.Preview) - preview domain */ + _preview?: Preview; + /** (Twilio.Pricing) - pricing domain */ + _pricing?: Pricing; + /** (Twilio.Proxy) - proxy domain */ + _proxy?: Proxy; + /** (Twilio.Routes) - routes domain */ + _routes?: Routes; + /** (Twilio.Serverless) - serverless domain */ + _serverless?: Serverless; + /** (Twilio.Studio) - studio domain */ + _studio?: Studio; + /** (Twilio.Supersim) - supersim domain */ + _supersim?: Supersim; + /** (Twilio.Sync) - sync domain */ + _sync?: Sync; + /** (Twilio.Taskrouter) - taskrouter domain */ + _taskrouter?: Taskrouter; + /** (Twilio.Trunking) - trunking domain */ + _trunking?: Trunking; + /** (Twilio.Trusthub) - trusthub domain */ + _trusthub?: Trusthub; + /** (Twilio.Verify) - verify domain */ + _verify?: Verify; + /** (Twilio.Video) - video domain */ + _video?: Video; + /** (Twilio.Voice) - voice domain */ + _voice?: Voice; + /** (Twilio.Wireless) - wireless domain */ + _wireless?: Wireless; + /** + * Creates a new instance of Twilio Client + * + * @param username - + * The username used for authentication. This is normally account sid, but if using key/secret auth will be the api key sid. + * @param password - + * The password used for authentication. This is normally auth token, but if using key/secret auth will be the secret. + * @param opts - The options argument + * + * @returns A new instance of Twilio client + */ + constructor(username?: string, password?: string, opts?: ClientOpts); + /** Getter for (Twilio.Accounts) domain */ + get accounts(): Accounts; + /** Getter for (Twilio.Api) domain */ + get api(): Api; + /** Getter for (Twilio.Bulkexports) domain */ + get bulkexports(): Bulkexports; + /** Getter for (Twilio.Chat) domain */ + get chat(): Chat; + /** Getter for (Twilio.Content) domain */ + get content(): Content; + /** Getter for (Twilio.Conversations) domain */ + get conversations(): Conversations; + /** Getter for (Twilio.Events) domain */ + get events(): Events; + /** Getter for (Twilio.FlexApi) domain */ + get flexApi(): FlexApi; + /** Getter for (Twilio.FrontlineApi) domain */ + get frontlineApi(): FrontlineApi; + /** Getter for (Twilio.Insights) domain */ + get insights(): Insights; + /** Getter for (Twilio.Intelligence) domain */ + get intelligence(): Intelligence; + /** Getter for (Twilio.IpMessaging) domain */ + get ipMessaging(): IpMessaging; + /** Getter for (Twilio.Lookups) domain */ + get lookups(): Lookups; + /** Getter for (Twilio.Media) domain */ + get media(): Media; + /** Getter for (Twilio.Messaging) domain */ + get messaging(): Messaging; + /** Getter for (Twilio.Microvisor) domain */ + get microvisor(): Microvisor; + /** Getter for (Twilio.Monitor) domain */ + get monitor(): Monitor; + /** Getter for (Twilio.Notify) domain */ + get notify(): Notify; + /** Getter for (Twilio.Numbers) domain */ + get numbers(): Numbers; + /** Getter for (Twilio.Preview) domain */ + get preview(): Preview; + /** Getter for (Twilio.Pricing) domain */ + get pricing(): Pricing; + /** Getter for (Twilio.Proxy) domain */ + get proxy(): Proxy; + /** Getter for (Twilio.Routes) domain */ + get routes(): Routes; + /** Getter for (Twilio.Serverless) domain */ + get serverless(): Serverless; + /** Getter for (Twilio.Studio) domain */ + get studio(): Studio; + /** Getter for (Twilio.Supersim) domain */ + get supersim(): Supersim; + /** Getter for (Twilio.Sync) domain */ + get sync(): Sync; + /** Getter for (Twilio.Taskrouter) domain */ + get taskrouter(): Taskrouter; + /** Getter for (Twilio.Trunking) domain */ + get trunking(): Trunking; + /** Getter for (Twilio.Trusthub) domain */ + get trusthub(): Trusthub; + /** Getter for (Twilio.Verify) domain */ + get verify(): Verify; + /** Getter for (Twilio.Video) domain */ + get video(): Video; + /** Getter for (Twilio.Voice) domain */ + get voice(): Voice; + /** Getter for (Twilio.Wireless) domain */ + get wireless(): Wireless; + /** Getter for (Twilio.Api.V2010.AccountContext.AddressListInstance) addresses resource */ + get addresses(): AddressListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.ApplicationListInstance) applications resource */ + get applications(): ApplicationListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.AuthorizedConnectAppListInstance) authorizedConnectApps resource */ + get authorizedConnectApps(): AuthorizedConnectAppListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.AvailablePhoneNumberCountryListInstance) availablePhoneNumbers resource */ + get availablePhoneNumbers(): AvailablePhoneNumberCountryListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.BalanceListInstance) balance resource */ + get balance(): BalanceListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.CallListInstance) calls resource */ + get calls(): CallListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.ConferenceListInstance) conferences resource */ + get conferences(): ConferenceListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.ConnectAppListInstance) connectApps resource */ + get connectApps(): ConnectAppListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.IncomingPhoneNumberListInstance) incomingPhoneNumbers resource */ + get incomingPhoneNumbers(): IncomingPhoneNumberListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.KeyListInstance) keys resource */ + get keys(): KeyListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.MessageListInstance) messages resource */ + get messages(): MessageListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.NewKeyListInstance) newKeys resource */ + get newKeys(): NewKeyListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.NewSigningKeyListInstance) newSigningKeys resource */ + get newSigningKeys(): NewSigningKeyListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.NotificationListInstance) notifications resource */ + get notifications(): NotificationListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.OutgoingCallerIdListInstance) outgoingCallerIds resource */ + get outgoingCallerIds(): OutgoingCallerIdListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.QueueListInstance) queues resource */ + get queues(): QueueListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.RecordingListInstance) recordings resource */ + get recordings(): RecordingListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.ShortCodeListInstance) shortCodes resource */ + get shortCodes(): ShortCodeListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.SigningKeyListInstance) signingKeys resource */ + get signingKeys(): SigningKeyListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.SipListInstance) sip resource */ + get sip(): SipListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.TokenListInstance) tokens resource */ + get tokens(): TokenListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.TranscriptionListInstance) transcriptions resource */ + get transcriptions(): TranscriptionListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.UsageListInstance) usage resource */ + get usage(): UsageListInstance; + /** Getter for (Twilio.Api.V2010.AccountContext.ValidationRequestListInstance) validationRequests resource */ + get validationRequests(): ValidationRequestListInstance; +} +declare namespace Twilio { + interface RequestClientOptions extends ClientOpts { + } + interface RequestOptions extends RequestOpts { + } +} +export = Twilio; diff --git a/node_modules/twilio/lib/rest/Twilio.js b/node_modules/twilio/lib/rest/Twilio.js new file mode 100644 index 00000000..70eb8031 --- /dev/null +++ b/node_modules/twilio/lib/rest/Twilio.js @@ -0,0 +1,313 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +const BaseTwilio_1 = require("../base/BaseTwilio"); +/* jshint ignore:start */ +/** + * Twilio Client to interact with the Rest API + */ +/* jshint ignore:end */ +class Twilio extends BaseTwilio_1.Client { + /* jshint ignore:start */ + /** + * Creates a new instance of Twilio Client + * + * @param username - + * The username used for authentication. This is normally account sid, but if using key/secret auth will be the api key sid. + * @param password - + * The password used for authentication. This is normally auth token, but if using key/secret auth will be the secret. + * @param opts - The options argument + * + * @returns A new instance of Twilio client + */ + /* jshint ignore:end */ + constructor(username, password, opts) { + super(username, password, opts); + if (this.opts?.lazyLoading === false) { + this.accounts; + this.api; + this.bulkexports; + this.chat; + this.content; + this.conversations; + this.events; + this.flexApi; + this.frontlineApi; + this.insights; + this.intelligence; + this.ipMessaging; + this.lookups; + this.media; + this.messaging; + this.microvisor; + this.monitor; + this.notify; + this.numbers; + this.preview; + this.pricing; + this.proxy; + this.routes; + this.serverless; + this.studio; + this.supersim; + this.sync; + this.taskrouter; + this.trunking; + this.trusthub; + this.verify; + this.video; + this.voice; + this.wireless; + } + } + //Domains + /** Getter for (Twilio.Accounts) domain */ + get accounts() { + return (this._accounts ?? (this._accounts = new (require("./Accounts"))(this))); + } + /** Getter for (Twilio.Api) domain */ + get api() { + return this._api ?? (this._api = new (require("./Api"))(this)); + } + /** Getter for (Twilio.Bulkexports) domain */ + get bulkexports() { + return (this._bulkexports ?? + (this._bulkexports = new (require("./Bulkexports"))(this))); + } + /** Getter for (Twilio.Chat) domain */ + get chat() { + return this._chat ?? (this._chat = new (require("./Chat"))(this)); + } + /** Getter for (Twilio.Content) domain */ + get content() { + return this._content ?? (this._content = new (require("./Content"))(this)); + } + /** Getter for (Twilio.Conversations) domain */ + get conversations() { + return (this._conversations ?? + (this._conversations = new (require("./Conversations"))(this))); + } + /** Getter for (Twilio.Events) domain */ + get events() { + return this._events ?? (this._events = new (require("./Events"))(this)); + } + /** Getter for (Twilio.FlexApi) domain */ + get flexApi() { + return this._flexApi ?? (this._flexApi = new (require("./FlexApi"))(this)); + } + /** Getter for (Twilio.FrontlineApi) domain */ + get frontlineApi() { + return (this._frontlineApi ?? + (this._frontlineApi = new (require("./FrontlineApi"))(this))); + } + /** Getter for (Twilio.Insights) domain */ + get insights() { + return (this._insights ?? (this._insights = new (require("./Insights"))(this))); + } + /** Getter for (Twilio.Intelligence) domain */ + get intelligence() { + return (this._intelligence ?? + (this._intelligence = new (require("./Intelligence"))(this))); + } + /** Getter for (Twilio.IpMessaging) domain */ + get ipMessaging() { + return (this._ipMessaging ?? + (this._ipMessaging = new (require("./IpMessaging"))(this))); + } + /** Getter for (Twilio.Lookups) domain */ + get lookups() { + return this._lookups ?? (this._lookups = new (require("./Lookups"))(this)); + } + /** Getter for (Twilio.Media) domain */ + get media() { + return this._media ?? (this._media = new (require("./Media"))(this)); + } + /** Getter for (Twilio.Messaging) domain */ + get messaging() { + return (this._messaging ?? (this._messaging = new (require("./Messaging"))(this))); + } + /** Getter for (Twilio.Microvisor) domain */ + get microvisor() { + return (this._microvisor ?? + (this._microvisor = new (require("./Microvisor"))(this))); + } + /** Getter for (Twilio.Monitor) domain */ + get monitor() { + return this._monitor ?? (this._monitor = new (require("./Monitor"))(this)); + } + /** Getter for (Twilio.Notify) domain */ + get notify() { + return this._notify ?? (this._notify = new (require("./Notify"))(this)); + } + /** Getter for (Twilio.Numbers) domain */ + get numbers() { + return this._numbers ?? (this._numbers = new (require("./Numbers"))(this)); + } + /** Getter for (Twilio.Preview) domain */ + get preview() { + return this._preview ?? (this._preview = new (require("./Preview"))(this)); + } + /** Getter for (Twilio.Pricing) domain */ + get pricing() { + return this._pricing ?? (this._pricing = new (require("./Pricing"))(this)); + } + /** Getter for (Twilio.Proxy) domain */ + get proxy() { + return this._proxy ?? (this._proxy = new (require("./Proxy"))(this)); + } + /** Getter for (Twilio.Routes) domain */ + get routes() { + return this._routes ?? (this._routes = new (require("./Routes"))(this)); + } + /** Getter for (Twilio.Serverless) domain */ + get serverless() { + return (this._serverless ?? + (this._serverless = new (require("./Serverless"))(this))); + } + /** Getter for (Twilio.Studio) domain */ + get studio() { + return this._studio ?? (this._studio = new (require("./Studio"))(this)); + } + /** Getter for (Twilio.Supersim) domain */ + get supersim() { + return (this._supersim ?? (this._supersim = new (require("./Supersim"))(this))); + } + /** Getter for (Twilio.Sync) domain */ + get sync() { + return this._sync ?? (this._sync = new (require("./Sync"))(this)); + } + /** Getter for (Twilio.Taskrouter) domain */ + get taskrouter() { + return (this._taskrouter ?? + (this._taskrouter = new (require("./Taskrouter"))(this))); + } + /** Getter for (Twilio.Trunking) domain */ + get trunking() { + return (this._trunking ?? (this._trunking = new (require("./Trunking"))(this))); + } + /** Getter for (Twilio.Trusthub) domain */ + get trusthub() { + return (this._trusthub ?? (this._trusthub = new (require("./Trusthub"))(this))); + } + /** Getter for (Twilio.Verify) domain */ + get verify() { + return this._verify ?? (this._verify = new (require("./Verify"))(this)); + } + /** Getter for (Twilio.Video) domain */ + get video() { + return this._video ?? (this._video = new (require("./Video"))(this)); + } + /** Getter for (Twilio.Voice) domain */ + get voice() { + return this._voice ?? (this._voice = new (require("./Voice"))(this)); + } + /** Getter for (Twilio.Wireless) domain */ + get wireless() { + return (this._wireless ?? (this._wireless = new (require("./Wireless"))(this))); + } + /** Getter for (Twilio.Api.V2010.AccountContext.AddressListInstance) addresses resource */ + get addresses() { + return this.api.v2010.account.addresses; + } + /** Getter for (Twilio.Api.V2010.AccountContext.ApplicationListInstance) applications resource */ + get applications() { + return this.api.v2010.account.applications; + } + /** Getter for (Twilio.Api.V2010.AccountContext.AuthorizedConnectAppListInstance) authorizedConnectApps resource */ + get authorizedConnectApps() { + return this.api.v2010.account.authorizedConnectApps; + } + /** Getter for (Twilio.Api.V2010.AccountContext.AvailablePhoneNumberCountryListInstance) availablePhoneNumbers resource */ + get availablePhoneNumbers() { + return this.api.v2010.account.availablePhoneNumbers; + } + /** Getter for (Twilio.Api.V2010.AccountContext.BalanceListInstance) balance resource */ + get balance() { + return this.api.v2010.account.balance; + } + /** Getter for (Twilio.Api.V2010.AccountContext.CallListInstance) calls resource */ + get calls() { + return this.api.v2010.account.calls; + } + /** Getter for (Twilio.Api.V2010.AccountContext.ConferenceListInstance) conferences resource */ + get conferences() { + return this.api.v2010.account.conferences; + } + /** Getter for (Twilio.Api.V2010.AccountContext.ConnectAppListInstance) connectApps resource */ + get connectApps() { + return this.api.v2010.account.connectApps; + } + /** Getter for (Twilio.Api.V2010.AccountContext.IncomingPhoneNumberListInstance) incomingPhoneNumbers resource */ + get incomingPhoneNumbers() { + return this.api.v2010.account.incomingPhoneNumbers; + } + /** Getter for (Twilio.Api.V2010.AccountContext.KeyListInstance) keys resource */ + get keys() { + return this.api.v2010.account.keys; + } + /** Getter for (Twilio.Api.V2010.AccountContext.MessageListInstance) messages resource */ + get messages() { + return this.api.v2010.account.messages; + } + /** Getter for (Twilio.Api.V2010.AccountContext.NewKeyListInstance) newKeys resource */ + get newKeys() { + return this.api.v2010.account.newKeys; + } + /** Getter for (Twilio.Api.V2010.AccountContext.NewSigningKeyListInstance) newSigningKeys resource */ + get newSigningKeys() { + return this.api.v2010.account.newSigningKeys; + } + /** Getter for (Twilio.Api.V2010.AccountContext.NotificationListInstance) notifications resource */ + get notifications() { + return this.api.v2010.account.notifications; + } + /** Getter for (Twilio.Api.V2010.AccountContext.OutgoingCallerIdListInstance) outgoingCallerIds resource */ + get outgoingCallerIds() { + return this.api.v2010.account.outgoingCallerIds; + } + /** Getter for (Twilio.Api.V2010.AccountContext.QueueListInstance) queues resource */ + get queues() { + return this.api.v2010.account.queues; + } + /** Getter for (Twilio.Api.V2010.AccountContext.RecordingListInstance) recordings resource */ + get recordings() { + return this.api.v2010.account.recordings; + } + /** Getter for (Twilio.Api.V2010.AccountContext.ShortCodeListInstance) shortCodes resource */ + get shortCodes() { + return this.api.v2010.account.shortCodes; + } + /** Getter for (Twilio.Api.V2010.AccountContext.SigningKeyListInstance) signingKeys resource */ + get signingKeys() { + return this.api.v2010.account.signingKeys; + } + /** Getter for (Twilio.Api.V2010.AccountContext.SipListInstance) sip resource */ + get sip() { + return this.api.v2010.account.sip; + } + /** Getter for (Twilio.Api.V2010.AccountContext.TokenListInstance) tokens resource */ + get tokens() { + return this.api.v2010.account.tokens; + } + /** Getter for (Twilio.Api.V2010.AccountContext.TranscriptionListInstance) transcriptions resource */ + get transcriptions() { + return this.api.v2010.account.transcriptions; + } + /** Getter for (Twilio.Api.V2010.AccountContext.UsageListInstance) usage resource */ + get usage() { + return this.api.v2010.account.usage; + } + /** Getter for (Twilio.Api.V2010.AccountContext.ValidationRequestListInstance) validationRequests resource */ + get validationRequests() { + return this.api.v2010.account.validationRequests; + } +} +module.exports = Twilio; diff --git a/node_modules/twilio/lib/rest/Verify.d.ts b/node_modules/twilio/lib/rest/Verify.d.ts new file mode 100644 index 00000000..f2015484 --- /dev/null +++ b/node_modules/twilio/lib/rest/Verify.d.ts @@ -0,0 +1,29 @@ +import { FormListInstance } from "./verify/v2/form"; +import { ServiceListInstance } from "./verify/v2/service"; +import { TemplateListInstance } from "./verify/v2/template"; +import { VerificationAttemptListInstance } from "./verify/v2/verificationAttempt"; +import { VerificationAttemptsSummaryListInstance } from "./verify/v2/verificationAttemptsSummary"; +import VerifyBase from "./VerifyBase"; +declare class Verify extends VerifyBase { + /** + * @deprecated - Use v2.forms instead + */ + get forms(): FormListInstance; + /** + * @deprecated - Use v2.services instead + */ + get services(): ServiceListInstance; + /** + * @deprecated - Use v2.verificationAttempts instead + */ + get verificationAttempts(): VerificationAttemptListInstance; + /** + * @deprecated - Use v2.verificationAttemptsSummary instead + */ + get verificationAttemptsSummary(): VerificationAttemptsSummaryListInstance; + /** + * @deprecated - Use v2.templates instead + */ + get templates(): TemplateListInstance; +} +export = Verify; diff --git a/node_modules/twilio/lib/rest/Verify.js b/node_modules/twilio/lib/rest/Verify.js new file mode 100644 index 00000000..7d8412c8 --- /dev/null +++ b/node_modules/twilio/lib/rest/Verify.js @@ -0,0 +1,43 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const VerifyBase_1 = __importDefault(require("./VerifyBase")); +class Verify extends VerifyBase_1.default { + /** + * @deprecated - Use v2.forms instead + */ + get forms() { + console.warn("forms is deprecated. Use v2.forms instead."); + return this.v2.forms; + } + /** + * @deprecated - Use v2.services instead + */ + get services() { + console.warn("services is deprecated. Use v2.services instead."); + return this.v2.services; + } + /** + * @deprecated - Use v2.verificationAttempts instead + */ + get verificationAttempts() { + console.warn("verificationAttempts is deprecated. Use v2.verificationAttempts instead."); + return this.v2.verificationAttempts; + } + /** + * @deprecated - Use v2.verificationAttemptsSummary instead + */ + get verificationAttemptsSummary() { + console.warn("verificationAttemptsSummary is deprecated. Use v2.verificationAttemptsSummary instead."); + return this.v2.verificationAttemptsSummary; + } + /** + * @deprecated - Use v2.templates instead + */ + get templates() { + console.warn("templates is deprecated. Use v2.templates instead."); + return this.v2.templates; + } +} +module.exports = Verify; diff --git a/node_modules/twilio/lib/rest/VerifyBase.d.ts b/node_modules/twilio/lib/rest/VerifyBase.d.ts new file mode 100644 index 00000000..d2817db8 --- /dev/null +++ b/node_modules/twilio/lib/rest/VerifyBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V2 from "./verify/V2"; +declare class VerifyBase extends Domain { + _v2?: V2; + /** + * Initialize verify domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v2(): V2; +} +export = VerifyBase; diff --git a/node_modules/twilio/lib/rest/VerifyBase.js b/node_modules/twilio/lib/rest/VerifyBase.js new file mode 100644 index 00000000..be503508 --- /dev/null +++ b/node_modules/twilio/lib/rest/VerifyBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V2_1 = __importDefault(require("./verify/V2")); +class VerifyBase extends Domain_1.default { + /** + * Initialize verify domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://verify.twilio.com"); + } + get v2() { + this._v2 = this._v2 || new V2_1.default(this); + return this._v2; + } +} +module.exports = VerifyBase; diff --git a/node_modules/twilio/lib/rest/Video.d.ts b/node_modules/twilio/lib/rest/Video.d.ts new file mode 100644 index 00000000..1da4d3db --- /dev/null +++ b/node_modules/twilio/lib/rest/Video.d.ts @@ -0,0 +1,34 @@ +import { CompositionListInstance } from "./video/v1/composition"; +import { CompositionHookListInstance } from "./video/v1/compositionHook"; +import { CompositionSettingsListInstance } from "./video/v1/compositionSettings"; +import { RecordingListInstance } from "./video/v1/recording"; +import { RecordingSettingsListInstance } from "./video/v1/recordingSettings"; +import { RoomListInstance } from "./video/v1/room"; +import VideoBase from "./VideoBase"; +declare class Video extends VideoBase { + /** + * @deprecated - Use v1.compositions instead + */ + get compositions(): CompositionListInstance; + /** + * @deprecated - Use v1.compositionHooks instead + */ + get compositionHooks(): CompositionHookListInstance; + /** + * @deprecated - Use v1.compositionSettings instead + */ + get compositionSettings(): CompositionSettingsListInstance; + /** + * @deprecated - Use v1.recordings instead + */ + get recordings(): RecordingListInstance; + /** + * @deprecated - Use v1.recordingSettings instead + */ + get recordingSettings(): RecordingSettingsListInstance; + /** + * @deprecated - Use v1.rooms instead + */ + get rooms(): RoomListInstance; +} +export = Video; diff --git a/node_modules/twilio/lib/rest/Video.js b/node_modules/twilio/lib/rest/Video.js new file mode 100644 index 00000000..48a3cb62 --- /dev/null +++ b/node_modules/twilio/lib/rest/Video.js @@ -0,0 +1,50 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const VideoBase_1 = __importDefault(require("./VideoBase")); +class Video extends VideoBase_1.default { + /** + * @deprecated - Use v1.compositions instead + */ + get compositions() { + console.warn("compositions is deprecated. Use v1.compositions instead."); + return this.v1.compositions; + } + /** + * @deprecated - Use v1.compositionHooks instead + */ + get compositionHooks() { + console.warn("compositionHooks is deprecated. Use v1.compositionHooks instead."); + return this.v1.compositionHooks; + } + /** + * @deprecated - Use v1.compositionSettings instead + */ + get compositionSettings() { + console.warn("compositionSettings is deprecated. Use v1.compositionSettings instead."); + return this.v1.compositionSettings; + } + /** + * @deprecated - Use v1.recordings instead + */ + get recordings() { + console.warn("recordings is deprecated. Use v1.recordings instead."); + return this.v1.recordings; + } + /** + * @deprecated - Use v1.recordingSettings instead + */ + get recordingSettings() { + console.warn("recordingSettings is deprecated. Use v1.recordingSettings instead."); + return this.v1.recordingSettings; + } + /** + * @deprecated - Use v1.rooms instead + */ + get rooms() { + console.warn("rooms is deprecated. Use v1.rooms instead."); + return this.v1.rooms; + } +} +module.exports = Video; diff --git a/node_modules/twilio/lib/rest/VideoBase.d.ts b/node_modules/twilio/lib/rest/VideoBase.d.ts new file mode 100644 index 00000000..acf4928f --- /dev/null +++ b/node_modules/twilio/lib/rest/VideoBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./video/V1"; +declare class VideoBase extends Domain { + _v1?: V1; + /** + * Initialize video domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = VideoBase; diff --git a/node_modules/twilio/lib/rest/VideoBase.js b/node_modules/twilio/lib/rest/VideoBase.js new file mode 100644 index 00000000..c96a7a98 --- /dev/null +++ b/node_modules/twilio/lib/rest/VideoBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./video/V1")); +class VideoBase extends Domain_1.default { + /** + * Initialize video domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://video.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = VideoBase; diff --git a/node_modules/twilio/lib/rest/Voice.d.ts b/node_modules/twilio/lib/rest/Voice.d.ts new file mode 100644 index 00000000..ccdaeb62 --- /dev/null +++ b/node_modules/twilio/lib/rest/Voice.d.ts @@ -0,0 +1,34 @@ +import { ArchivedCallListInstance } from "./voice/v1/archivedCall"; +import { ByocTrunkListInstance } from "./voice/v1/byocTrunk"; +import { ConnectionPolicyListInstance } from "./voice/v1/connectionPolicy"; +import { DialingPermissionsListInstance } from "./voice/v1/dialingPermissions"; +import { IpRecordListInstance } from "./voice/v1/ipRecord"; +import { SourceIpMappingListInstance } from "./voice/v1/sourceIpMapping"; +import VoiceBase from "./VoiceBase"; +declare class Voice extends VoiceBase { + /** + * @deprecated - Use v1.archivedCalls instead + */ + get archivedCalls(): ArchivedCallListInstance; + /** + * @deprecated - Use v1.byocTrunks instead + */ + get byocTrunks(): ByocTrunkListInstance; + /** + * @deprecated - Use v1.connectionPolicies instead + */ + get connectionPolicies(): ConnectionPolicyListInstance; + /** + * @deprecated - Use v1.dialingPermissions instead + */ + get dialingPermissions(): DialingPermissionsListInstance; + /** + * @deprecated - Use v1.ipRecords instead + */ + get ipRecords(): IpRecordListInstance; + /** + * @deprecated - Use v1.sourceIpMappings instead + */ + get sourceIpMappings(): SourceIpMappingListInstance; +} +export = Voice; diff --git a/node_modules/twilio/lib/rest/Voice.js b/node_modules/twilio/lib/rest/Voice.js new file mode 100644 index 00000000..9b094bad --- /dev/null +++ b/node_modules/twilio/lib/rest/Voice.js @@ -0,0 +1,50 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const VoiceBase_1 = __importDefault(require("./VoiceBase")); +class Voice extends VoiceBase_1.default { + /** + * @deprecated - Use v1.archivedCalls instead + */ + get archivedCalls() { + console.warn("archivedCalls is deprecated. Use v1.archivedCalls instead."); + return this.v1.archivedCalls; + } + /** + * @deprecated - Use v1.byocTrunks instead + */ + get byocTrunks() { + console.warn("byocTrunks is deprecated. Use v1.byocTrunks instead."); + return this.v1.byocTrunks; + } + /** + * @deprecated - Use v1.connectionPolicies instead + */ + get connectionPolicies() { + console.warn("connectionPolicies is deprecated. Use v1.connectionPolicies instead."); + return this.v1.connectionPolicies; + } + /** + * @deprecated - Use v1.dialingPermissions instead + */ + get dialingPermissions() { + console.warn("dialingPermissions is deprecated. Use v1.dialingPermissions instead."); + return this.v1.dialingPermissions; + } + /** + * @deprecated - Use v1.ipRecords instead + */ + get ipRecords() { + console.warn("ipRecords is deprecated. Use v1.ipRecords instead."); + return this.v1.ipRecords; + } + /** + * @deprecated - Use v1.sourceIpMappings instead + */ + get sourceIpMappings() { + console.warn("sourceIpMappings is deprecated. Use v1.sourceIpMappings instead."); + return this.v1.sourceIpMappings; + } +} +module.exports = Voice; diff --git a/node_modules/twilio/lib/rest/VoiceBase.d.ts b/node_modules/twilio/lib/rest/VoiceBase.d.ts new file mode 100644 index 00000000..31c8e099 --- /dev/null +++ b/node_modules/twilio/lib/rest/VoiceBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./voice/V1"; +declare class VoiceBase extends Domain { + _v1?: V1; + /** + * Initialize voice domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = VoiceBase; diff --git a/node_modules/twilio/lib/rest/VoiceBase.js b/node_modules/twilio/lib/rest/VoiceBase.js new file mode 100644 index 00000000..37bc63c5 --- /dev/null +++ b/node_modules/twilio/lib/rest/VoiceBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./voice/V1")); +class VoiceBase extends Domain_1.default { + /** + * Initialize voice domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://voice.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = VoiceBase; diff --git a/node_modules/twilio/lib/rest/Wireless.d.ts b/node_modules/twilio/lib/rest/Wireless.d.ts new file mode 100644 index 00000000..b99248a8 --- /dev/null +++ b/node_modules/twilio/lib/rest/Wireless.d.ts @@ -0,0 +1,24 @@ +import { CommandListInstance } from "./wireless/v1/command"; +import { RatePlanListInstance } from "./wireless/v1/ratePlan"; +import { SimListInstance } from "./wireless/v1/sim"; +import { UsageRecordListInstance } from "./wireless/v1/usageRecord"; +import WirelessBase from "./WirelessBase"; +declare class Wireless extends WirelessBase { + /** + * @deprecated - Use v1.usageRecords instead + */ + get usageRecords(): UsageRecordListInstance; + /** + * @deprecated - Use v1.commands instead + */ + get commands(): CommandListInstance; + /** + * @deprecated - Use v1.ratePlans instead + */ + get ratePlans(): RatePlanListInstance; + /** + * @deprecated - Use v1.sims instead + */ + get sims(): SimListInstance; +} +export = Wireless; diff --git a/node_modules/twilio/lib/rest/Wireless.js b/node_modules/twilio/lib/rest/Wireless.js new file mode 100644 index 00000000..cbeccbe4 --- /dev/null +++ b/node_modules/twilio/lib/rest/Wireless.js @@ -0,0 +1,36 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const WirelessBase_1 = __importDefault(require("./WirelessBase")); +class Wireless extends WirelessBase_1.default { + /** + * @deprecated - Use v1.usageRecords instead + */ + get usageRecords() { + console.warn("usageRecords is deprecated. Use v1.usageRecords instead."); + return this.v1.usageRecords; + } + /** + * @deprecated - Use v1.commands instead + */ + get commands() { + console.warn("commands is deprecated. Use v1.commands instead."); + return this.v1.commands; + } + /** + * @deprecated - Use v1.ratePlans instead + */ + get ratePlans() { + console.warn("ratePlans is deprecated. Use v1.ratePlans instead."); + return this.v1.ratePlans; + } + /** + * @deprecated - Use v1.sims instead + */ + get sims() { + console.warn("sims is deprecated. Use v1.sims instead."); + return this.v1.sims; + } +} +module.exports = Wireless; diff --git a/node_modules/twilio/lib/rest/WirelessBase.d.ts b/node_modules/twilio/lib/rest/WirelessBase.d.ts new file mode 100644 index 00000000..0e560abb --- /dev/null +++ b/node_modules/twilio/lib/rest/WirelessBase.d.ts @@ -0,0 +1,13 @@ +import Domain from "../base/Domain"; +import V1 from "./wireless/V1"; +declare class WirelessBase extends Domain { + _v1?: V1; + /** + * Initialize wireless domain + * + * @param twilio - The twilio client + */ + constructor(twilio: any); + get v1(): V1; +} +export = WirelessBase; diff --git a/node_modules/twilio/lib/rest/WirelessBase.js b/node_modules/twilio/lib/rest/WirelessBase.js new file mode 100644 index 00000000..f850016f --- /dev/null +++ b/node_modules/twilio/lib/rest/WirelessBase.js @@ -0,0 +1,31 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const Domain_1 = __importDefault(require("../base/Domain")); +const V1_1 = __importDefault(require("./wireless/V1")); +class WirelessBase extends Domain_1.default { + /** + * Initialize wireless domain + * + * @param twilio - The twilio client + */ + constructor(twilio) { + super(twilio, "https://wireless.twilio.com"); + } + get v1() { + this._v1 = this._v1 || new V1_1.default(this); + return this._v1; + } +} +module.exports = WirelessBase; diff --git a/node_modules/twilio/lib/rest/accounts/V1.d.ts b/node_modules/twilio/lib/rest/accounts/V1.d.ts new file mode 100644 index 00000000..5cb12910 --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/V1.d.ts @@ -0,0 +1,30 @@ +import AccountsBase from "../AccountsBase"; +import Version from "../../base/Version"; +import { AuthTokenPromotionListInstance } from "./v1/authTokenPromotion"; +import { CredentialListInstance } from "./v1/credential"; +import { SafelistListInstance } from "./v1/safelist"; +import { SecondaryAuthTokenListInstance } from "./v1/secondaryAuthToken"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Accounts + * + * @param domain - The Twilio (Twilio.Accounts) domain + */ + constructor(domain: AccountsBase); + /** authTokenPromotion - { Twilio.Accounts.V1.AuthTokenPromotionListInstance } resource */ + protected _authTokenPromotion?: AuthTokenPromotionListInstance; + /** credentials - { Twilio.Accounts.V1.CredentialListInstance } resource */ + protected _credentials?: CredentialListInstance; + /** safelist - { Twilio.Accounts.V1.SafelistListInstance } resource */ + protected _safelist?: SafelistListInstance; + /** secondaryAuthToken - { Twilio.Accounts.V1.SecondaryAuthTokenListInstance } resource */ + protected _secondaryAuthToken?: SecondaryAuthTokenListInstance; + /** Getter for authTokenPromotion resource */ + get authTokenPromotion(): AuthTokenPromotionListInstance; + /** Getter for credentials resource */ + get credentials(): CredentialListInstance; + /** Getter for safelist resource */ + get safelist(): SafelistListInstance; + /** Getter for secondaryAuthToken resource */ + get secondaryAuthToken(): SecondaryAuthTokenListInstance; +} diff --git a/node_modules/twilio/lib/rest/accounts/V1.js b/node_modules/twilio/lib/rest/accounts/V1.js new file mode 100644 index 00000000..4d05dd25 --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/V1.js @@ -0,0 +1,56 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Accounts + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const authTokenPromotion_1 = require("./v1/authTokenPromotion"); +const credential_1 = require("./v1/credential"); +const safelist_1 = require("./v1/safelist"); +const secondaryAuthToken_1 = require("./v1/secondaryAuthToken"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Accounts + * + * @param domain - The Twilio (Twilio.Accounts) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for authTokenPromotion resource */ + get authTokenPromotion() { + this._authTokenPromotion = + this._authTokenPromotion || (0, authTokenPromotion_1.AuthTokenPromotionListInstance)(this); + return this._authTokenPromotion; + } + /** Getter for credentials resource */ + get credentials() { + this._credentials = this._credentials || (0, credential_1.CredentialListInstance)(this); + return this._credentials; + } + /** Getter for safelist resource */ + get safelist() { + this._safelist = this._safelist || (0, safelist_1.SafelistListInstance)(this); + return this._safelist; + } + /** Getter for secondaryAuthToken resource */ + get secondaryAuthToken() { + this._secondaryAuthToken = + this._secondaryAuthToken || (0, secondaryAuthToken_1.SecondaryAuthTokenListInstance)(this); + return this._secondaryAuthToken; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/accounts/v1/authTokenPromotion.d.ts b/node_modules/twilio/lib/rest/accounts/v1/authTokenPromotion.d.ts new file mode 100644 index 00000000..13b07368 --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/authTokenPromotion.d.ts @@ -0,0 +1,105 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface AuthTokenPromotionContext { + /** + * Update a AuthTokenPromotionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthTokenPromotionInstance + */ + update(callback?: (error: Error | null, item?: AuthTokenPromotionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AuthTokenPromotionContextSolution { +} +export declare class AuthTokenPromotionContextImpl implements AuthTokenPromotionContext { + protected _version: V1; + protected _solution: AuthTokenPromotionContextSolution; + protected _uri: string; + constructor(_version: V1); + update(callback?: (error: Error | null, item?: AuthTokenPromotionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AuthTokenPromotionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AuthTokenPromotionResource { + account_sid: string; + auth_token: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class AuthTokenPromotionInstance { + protected _version: V1; + protected _solution: AuthTokenPromotionContextSolution; + protected _context?: AuthTokenPromotionContext; + constructor(_version: V1, payload: AuthTokenPromotionResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for. + */ + accountSid: string; + /** + * The promoted Auth Token that must be used to authenticate future API requests. + */ + authToken: string; + /** + * The date and time in UTC when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The URI for this resource, relative to `https://accounts.twilio.com` + */ + url: string; + private get _proxy(); + /** + * Update a AuthTokenPromotionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthTokenPromotionInstance + */ + update(callback?: (error: Error | null, item?: AuthTokenPromotionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + authToken: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AuthTokenPromotionSolution { +} +export interface AuthTokenPromotionListInstance { + _version: V1; + _solution: AuthTokenPromotionSolution; + _uri: string; + (): AuthTokenPromotionContext; + get(): AuthTokenPromotionContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthTokenPromotionListInstance(version: V1): AuthTokenPromotionListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/accounts/v1/authTokenPromotion.js b/node_modules/twilio/lib/rest/accounts/v1/authTokenPromotion.js new file mode 100644 index 00000000..587a8d0e --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/authTokenPromotion.js @@ -0,0 +1,109 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Accounts + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthTokenPromotionListInstance = exports.AuthTokenPromotionInstance = exports.AuthTokenPromotionContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class AuthTokenPromotionContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/AuthTokens/Promote`; + } + update(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + }); + operationPromise = operationPromise.then((payload) => new AuthTokenPromotionInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthTokenPromotionContextImpl = AuthTokenPromotionContextImpl; +class AuthTokenPromotionInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.authToken = payload.auth_token; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new AuthTokenPromotionContextImpl(this._version); + return this._context; + } + /** + * Update a AuthTokenPromotionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthTokenPromotionInstance + */ + update(callback) { + return this._proxy.update(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + authToken: this.authToken, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthTokenPromotionInstance = AuthTokenPromotionInstance; +function AuthTokenPromotionListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new AuthTokenPromotionContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthTokenPromotionListInstance = AuthTokenPromotionListInstance; diff --git a/node_modules/twilio/lib/rest/accounts/v1/credential.d.ts b/node_modules/twilio/lib/rest/accounts/v1/credential.d.ts new file mode 100644 index 00000000..f5077508 --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/credential.d.ts @@ -0,0 +1,22 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { AwsListInstance } from "./credential/aws"; +import { PublicKeyListInstance } from "./credential/publicKey"; +export interface CredentialSolution { +} +export interface CredentialListInstance { + _version: V1; + _solution: CredentialSolution; + _uri: string; + _aws?: AwsListInstance; + aws: AwsListInstance; + _publicKey?: PublicKeyListInstance; + publicKey: PublicKeyListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListInstance(version: V1): CredentialListInstance; diff --git a/node_modules/twilio/lib/rest/accounts/v1/credential.js b/node_modules/twilio/lib/rest/accounts/v1/credential.js new file mode 100644 index 00000000..86074533 --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/credential.js @@ -0,0 +1,51 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Accounts + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const aws_1 = require("./credential/aws"); +const publicKey_1 = require("./credential/publicKey"); +function CredentialListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials`; + Object.defineProperty(instance, "aws", { + get: function aws() { + if (!instance._aws) { + instance._aws = (0, aws_1.AwsListInstance)(instance._version); + } + return instance._aws; + }, + }); + Object.defineProperty(instance, "publicKey", { + get: function publicKey() { + if (!instance._publicKey) { + instance._publicKey = (0, publicKey_1.PublicKeyListInstance)(instance._version); + } + return instance._publicKey; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListInstance = CredentialListInstance; diff --git a/node_modules/twilio/lib/rest/accounts/v1/credential/aws.d.ts b/node_modules/twilio/lib/rest/accounts/v1/credential/aws.d.ts new file mode 100644 index 00000000..9abec1cb --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/credential/aws.d.ts @@ -0,0 +1,296 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a AwsInstance + */ +export interface AwsContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to create a AwsInstance + */ +export interface AwsListInstanceCreateOptions { + /** A string that contains the AWS access credentials in the format `:`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` */ + credentials: string; + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. */ + accountSid?: string; +} +/** + * Options to pass to each + */ +export interface AwsListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AwsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AwsListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AwsListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AwsContext { + /** + * Remove a AwsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AwsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AwsInstance + */ + fetch(callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + /** + * Update a AwsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AwsInstance + */ + update(callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + /** + * Update a AwsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AwsInstance + */ + update(params: AwsContextUpdateOptions, callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AwsContextSolution { + sid: string; +} +export declare class AwsContextImpl implements AwsContext { + protected _version: V1; + protected _solution: AwsContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + update(params?: AwsContextUpdateOptions | ((error: Error | null, item?: AwsInstance) => any), callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AwsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AwsPayload extends TwilioResponsePayload { + credentials: AwsResource[]; +} +interface AwsResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class AwsInstance { + protected _version: V1; + protected _solution: AwsContextSolution; + protected _context?: AwsContext; + constructor(_version: V1, payload: AwsResource, sid?: string); + /** + * The unique string that we created to identify the AWS resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AWS resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URI for this resource, relative to `https://accounts.twilio.com` + */ + url: string; + private get _proxy(); + /** + * Remove a AwsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AwsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AwsInstance + */ + fetch(callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + /** + * Update a AwsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AwsInstance + */ + update(callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + /** + * Update a AwsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AwsInstance + */ + update(params: AwsContextUpdateOptions, callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AwsSolution { +} +export interface AwsListInstance { + _version: V1; + _solution: AwsSolution; + _uri: string; + (sid: string): AwsContext; + get(sid: string): AwsContext; + /** + * Create a AwsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AwsInstance + */ + create(params: AwsListInstanceCreateOptions, callback?: (error: Error | null, item?: AwsInstance) => any): Promise; + /** + * Streams AwsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AwsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AwsInstance, done: (err?: Error) => void) => void): void; + each(params: AwsListInstanceEachOptions, callback?: (item: AwsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AwsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AwsPage) => any): Promise; + /** + * Lists AwsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AwsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AwsInstance[]) => any): Promise; + list(params: AwsListInstanceOptions, callback?: (error: Error | null, items: AwsInstance[]) => any): Promise; + /** + * Retrieve a single page of AwsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AwsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AwsPage) => any): Promise; + page(params: AwsListInstancePageOptions, callback?: (error: Error | null, items: AwsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AwsListInstance(version: V1): AwsListInstance; +export declare class AwsPage extends Page { + /** + * Initialize the AwsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AwsSolution); + /** + * Build an instance of AwsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AwsResource): AwsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/accounts/v1/credential/aws.js b/node_modules/twilio/lib/rest/accounts/v1/credential/aws.js new file mode 100644 index 00000000..44936c4d --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/credential/aws.js @@ -0,0 +1,251 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Accounts + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AwsPage = exports.AwsListInstance = exports.AwsInstance = exports.AwsContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class AwsContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Credentials/AWS/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AwsInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AwsInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AwsContextImpl = AwsContextImpl; +class AwsInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new AwsContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a AwsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AwsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AwsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AwsInstance = AwsInstance; +function AwsListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AwsContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials/AWS`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["credentials"] === null || params["credentials"] === undefined) { + throw new Error("Required parameter \"params['credentials']\" missing."); + } + let data = {}; + data["Credentials"] = params["credentials"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["accountSid"] !== undefined) + data["AccountSid"] = params["accountSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AwsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AwsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AwsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AwsListInstance = AwsListInstance; +class AwsPage extends Page_1.default { + /** + * Initialize the AwsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AwsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AwsInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AwsPage = AwsPage; diff --git a/node_modules/twilio/lib/rest/accounts/v1/credential/publicKey.d.ts b/node_modules/twilio/lib/rest/accounts/v1/credential/publicKey.d.ts new file mode 100644 index 00000000..e0a0f76a --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/credential/publicKey.d.ts @@ -0,0 +1,296 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a PublicKeyInstance + */ +export interface PublicKeyContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to create a PublicKeyInstance + */ +export interface PublicKeyListInstanceCreateOptions { + /** A URL encoded representation of the public key. For example, `-----BEGIN PUBLIC KEY-----MIIBIjANB.pa9xQIDAQAB-----END PUBLIC KEY-----` */ + publicKey: string; + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request */ + accountSid?: string; +} +/** + * Options to pass to each + */ +export interface PublicKeyListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: PublicKeyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface PublicKeyListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface PublicKeyListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface PublicKeyContext { + /** + * Remove a PublicKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PublicKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublicKeyInstance + */ + fetch(callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + /** + * Update a PublicKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublicKeyInstance + */ + update(callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + /** + * Update a PublicKeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublicKeyInstance + */ + update(params: PublicKeyContextUpdateOptions, callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PublicKeyContextSolution { + sid: string; +} +export declare class PublicKeyContextImpl implements PublicKeyContext { + protected _version: V1; + protected _solution: PublicKeyContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + update(params?: PublicKeyContextUpdateOptions | ((error: Error | null, item?: PublicKeyInstance) => any), callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PublicKeyContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PublicKeyPayload extends TwilioResponsePayload { + credentials: PublicKeyResource[]; +} +interface PublicKeyResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class PublicKeyInstance { + protected _version: V1; + protected _solution: PublicKeyContextSolution; + protected _context?: PublicKeyContext; + constructor(_version: V1, payload: PublicKeyResource, sid?: string); + /** + * The unique string that that we created to identify the PublicKey resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Credential that the PublicKey resource belongs to. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URI for this resource, relative to `https://accounts.twilio.com` + */ + url: string; + private get _proxy(); + /** + * Remove a PublicKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PublicKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublicKeyInstance + */ + fetch(callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + /** + * Update a PublicKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublicKeyInstance + */ + update(callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + /** + * Update a PublicKeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublicKeyInstance + */ + update(params: PublicKeyContextUpdateOptions, callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PublicKeySolution { +} +export interface PublicKeyListInstance { + _version: V1; + _solution: PublicKeySolution; + _uri: string; + (sid: string): PublicKeyContext; + get(sid: string): PublicKeyContext; + /** + * Create a PublicKeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublicKeyInstance + */ + create(params: PublicKeyListInstanceCreateOptions, callback?: (error: Error | null, item?: PublicKeyInstance) => any): Promise; + /** + * Streams PublicKeyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PublicKeyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: PublicKeyInstance, done: (err?: Error) => void) => void): void; + each(params: PublicKeyListInstanceEachOptions, callback?: (item: PublicKeyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of PublicKeyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: PublicKeyPage) => any): Promise; + /** + * Lists PublicKeyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PublicKeyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: PublicKeyInstance[]) => any): Promise; + list(params: PublicKeyListInstanceOptions, callback?: (error: Error | null, items: PublicKeyInstance[]) => any): Promise; + /** + * Retrieve a single page of PublicKeyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PublicKeyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: PublicKeyPage) => any): Promise; + page(params: PublicKeyListInstancePageOptions, callback?: (error: Error | null, items: PublicKeyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PublicKeyListInstance(version: V1): PublicKeyListInstance; +export declare class PublicKeyPage extends Page { + /** + * Initialize the PublicKeyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: PublicKeySolution); + /** + * Build an instance of PublicKeyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: PublicKeyResource): PublicKeyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/accounts/v1/credential/publicKey.js b/node_modules/twilio/lib/rest/accounts/v1/credential/publicKey.js new file mode 100644 index 00000000..dbaf1803 --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/credential/publicKey.js @@ -0,0 +1,252 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Accounts + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PublicKeyPage = exports.PublicKeyListInstance = exports.PublicKeyInstance = exports.PublicKeyContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PublicKeyContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Credentials/PublicKeys/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PublicKeyInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PublicKeyInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PublicKeyContextImpl = PublicKeyContextImpl; +class PublicKeyInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PublicKeyContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a PublicKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a PublicKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublicKeyInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PublicKeyInstance = PublicKeyInstance; +function PublicKeyListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PublicKeyContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials/PublicKeys`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["publicKey"] === null || params["publicKey"] === undefined) { + throw new Error("Required parameter \"params['publicKey']\" missing."); + } + let data = {}; + data["PublicKey"] = params["publicKey"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["accountSid"] !== undefined) + data["AccountSid"] = params["accountSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PublicKeyInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PublicKeyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new PublicKeyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PublicKeyListInstance = PublicKeyListInstance; +class PublicKeyPage extends Page_1.default { + /** + * Initialize the PublicKeyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of PublicKeyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new PublicKeyInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PublicKeyPage = PublicKeyPage; diff --git a/node_modules/twilio/lib/rest/accounts/v1/safelist.d.ts b/node_modules/twilio/lib/rest/accounts/v1/safelist.d.ts new file mode 100644 index 00000000..4549979d --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/safelist.d.ts @@ -0,0 +1,107 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to create a SafelistInstance + */ +export interface SafelistListInstanceCreateOptions { + /** The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ + phoneNumber: string; +} +/** + * Options to pass to remove a SafelistInstance + */ +export interface SafelistListInstanceRemoveOptions { + /** The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ + phoneNumber?: string; +} +/** + * Options to pass to fetch a SafelistInstance + */ +export interface SafelistListInstanceFetchOptions { + /** The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ + phoneNumber?: string; +} +export interface SafelistSolution { +} +export interface SafelistListInstance { + _version: V1; + _solution: SafelistSolution; + _uri: string; + /** + * Create a SafelistInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SafelistInstance + */ + create(params: SafelistListInstanceCreateOptions, callback?: (error: Error | null, item?: SafelistInstance) => any): Promise; + /** + * Remove a SafelistInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SafelistInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SafelistInstance + */ + remove(params: SafelistListInstanceRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SafelistInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SafelistInstance + */ + fetch(callback?: (error: Error | null, item?: SafelistInstance) => any): Promise; + /** + * Fetch a SafelistInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SafelistInstance + */ + fetch(params: SafelistListInstanceFetchOptions, callback?: (error: Error | null, item?: SafelistInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SafelistListInstance(version: V1): SafelistListInstance; +interface SafelistResource { + sid: string; + phone_number: string; +} +export declare class SafelistInstance { + protected _version: V1; + constructor(_version: V1, payload: SafelistResource); + /** + * The unique string that we created to identify the SafeList resource. + */ + sid: string; + /** + * The phone number in SafeList. + */ + phoneNumber: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + phoneNumber: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/accounts/v1/safelist.js b/node_modules/twilio/lib/rest/accounts/v1/safelist.js new file mode 100644 index 00000000..fced961c --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/safelist.js @@ -0,0 +1,119 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Accounts + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SafelistInstance = exports.SafelistListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function SafelistListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/SafeList/Numbers`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) { + throw new Error("Required parameter \"params['phoneNumber']\" missing."); + } + let data = {}; + data["PhoneNumber"] = params["phoneNumber"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SafelistInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.remove = function remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.fetch = function fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SafelistInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SafelistListInstance = SafelistListInstance; +class SafelistInstance { + constructor(_version, payload) { + this._version = _version; + this.sid = payload.sid; + this.phoneNumber = payload.phone_number; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + phoneNumber: this.phoneNumber, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SafelistInstance = SafelistInstance; diff --git a/node_modules/twilio/lib/rest/accounts/v1/secondaryAuthToken.d.ts b/node_modules/twilio/lib/rest/accounts/v1/secondaryAuthToken.d.ts new file mode 100644 index 00000000..4d66905f --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/secondaryAuthToken.d.ts @@ -0,0 +1,122 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface SecondaryAuthTokenContext { + /** + * Create a SecondaryAuthTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SecondaryAuthTokenInstance + */ + create(callback?: (error: Error | null, item?: SecondaryAuthTokenInstance) => any): Promise; + /** + * Remove a SecondaryAuthTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SecondaryAuthTokenContextSolution { +} +export declare class SecondaryAuthTokenContextImpl implements SecondaryAuthTokenContext { + protected _version: V1; + protected _solution: SecondaryAuthTokenContextSolution; + protected _uri: string; + constructor(_version: V1); + create(callback?: (error: Error | null, item?: SecondaryAuthTokenInstance) => any): Promise; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SecondaryAuthTokenContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SecondaryAuthTokenResource { + account_sid: string; + date_created: Date; + date_updated: Date; + secondary_auth_token: string; + url: string; +} +export declare class SecondaryAuthTokenInstance { + protected _version: V1; + protected _solution: SecondaryAuthTokenContextSolution; + protected _context?: SecondaryAuthTokenContext; + constructor(_version: V1, payload: SecondaryAuthTokenResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for. + */ + accountSid: string; + /** + * The date and time in UTC when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in UTC when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The generated secondary Auth Token that can be used to authenticate future API requests. + */ + secondaryAuthToken: string; + /** + * The URI for this resource, relative to `https://accounts.twilio.com` + */ + url: string; + private get _proxy(); + /** + * Create a SecondaryAuthTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SecondaryAuthTokenInstance + */ + create(callback?: (error: Error | null, item?: SecondaryAuthTokenInstance) => any): Promise; + /** + * Remove a SecondaryAuthTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + secondaryAuthToken: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SecondaryAuthTokenSolution { +} +export interface SecondaryAuthTokenListInstance { + _version: V1; + _solution: SecondaryAuthTokenSolution; + _uri: string; + (): SecondaryAuthTokenContext; + get(): SecondaryAuthTokenContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SecondaryAuthTokenListInstance(version: V1): SecondaryAuthTokenListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/accounts/v1/secondaryAuthToken.js b/node_modules/twilio/lib/rest/accounts/v1/secondaryAuthToken.js new file mode 100644 index 00000000..54e3e162 --- /dev/null +++ b/node_modules/twilio/lib/rest/accounts/v1/secondaryAuthToken.js @@ -0,0 +1,128 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Accounts + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SecondaryAuthTokenListInstance = exports.SecondaryAuthTokenInstance = exports.SecondaryAuthTokenContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class SecondaryAuthTokenContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/AuthTokens/Secondary`; + } + create(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + }); + operationPromise = operationPromise.then((payload) => new SecondaryAuthTokenInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SecondaryAuthTokenContextImpl = SecondaryAuthTokenContextImpl; +class SecondaryAuthTokenInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.secondaryAuthToken = payload.secondary_auth_token; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new SecondaryAuthTokenContextImpl(this._version); + return this._context; + } + /** + * Create a SecondaryAuthTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SecondaryAuthTokenInstance + */ + create(callback) { + return this._proxy.create(callback); + } + /** + * Remove a SecondaryAuthTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + secondaryAuthToken: this.secondaryAuthToken, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SecondaryAuthTokenInstance = SecondaryAuthTokenInstance; +function SecondaryAuthTokenListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new SecondaryAuthTokenContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SecondaryAuthTokenListInstance = SecondaryAuthTokenListInstance; diff --git a/node_modules/twilio/lib/rest/api/V2010.d.ts b/node_modules/twilio/lib/rest/api/V2010.d.ts new file mode 100644 index 00000000..7c3d3077 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/V2010.d.ts @@ -0,0 +1,20 @@ +import ApiBase from "../ApiBase"; +import Version from "../../base/Version"; +import { AccountListInstance } from "./v2010/account"; +import { AccountContext } from "./v2010/account"; +export default class V2010 extends Version { + /** + * Initialize the V2010 version of Api + * + * @param domain - The Twilio (Twilio.Api) domain + */ + constructor(domain: ApiBase); + /** accounts - { Twilio.Api.V2010.AccountListInstance } resource */ + protected _accounts?: AccountListInstance; + /** account - { Twilio.Api.V2010.AccountContext } resource */ + protected _account?: AccountContext; + /** Getter for accounts resource */ + get accounts(): AccountListInstance; + /** Getter for account resource */ + get account(): AccountContext; +} diff --git a/node_modules/twilio/lib/rest/api/V2010.js b/node_modules/twilio/lib/rest/api/V2010.js new file mode 100644 index 00000000..ace44b6e --- /dev/null +++ b/node_modules/twilio/lib/rest/api/V2010.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const account_1 = require("./v2010/account"); +class V2010 extends Version_1.default { + /** + * Initialize the V2010 version of Api + * + * @param domain - The Twilio (Twilio.Api) domain + */ + constructor(domain) { + super(domain, "2010-04-01"); + } + /** Getter for accounts resource */ + get accounts() { + this._accounts = this._accounts || (0, account_1.AccountListInstance)(this); + return this._accounts; + } + /** Getter for account resource */ + get account() { + this._account = + this._account || (0, account_1.AccountListInstance)(this)(this.domain.twilio.accountSid); + return this._account; + } +} +exports.default = V2010; diff --git a/node_modules/twilio/lib/rest/api/v2010/account.d.ts b/node_modules/twilio/lib/rest/api/v2010/account.d.ts new file mode 100644 index 00000000..f58c4640 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account.d.ts @@ -0,0 +1,509 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2010 from "../V2010"; +import { AddressListInstance } from "./account/address"; +import { ApplicationListInstance } from "./account/application"; +import { AuthorizedConnectAppListInstance } from "./account/authorizedConnectApp"; +import { AvailablePhoneNumberCountryListInstance } from "./account/availablePhoneNumberCountry"; +import { BalanceListInstance } from "./account/balance"; +import { CallListInstance } from "./account/call"; +import { ConferenceListInstance } from "./account/conference"; +import { ConnectAppListInstance } from "./account/connectApp"; +import { IncomingPhoneNumberListInstance } from "./account/incomingPhoneNumber"; +import { KeyListInstance } from "./account/key"; +import { MessageListInstance } from "./account/message"; +import { NewKeyListInstance } from "./account/newKey"; +import { NewSigningKeyListInstance } from "./account/newSigningKey"; +import { NotificationListInstance } from "./account/notification"; +import { OutgoingCallerIdListInstance } from "./account/outgoingCallerId"; +import { QueueListInstance } from "./account/queue"; +import { RecordingListInstance } from "./account/recording"; +import { ShortCodeListInstance } from "./account/shortCode"; +import { SigningKeyListInstance } from "./account/signingKey"; +import { SipListInstance } from "./account/sip"; +import { TokenListInstance } from "./account/token"; +import { TranscriptionListInstance } from "./account/transcription"; +import { UsageListInstance } from "./account/usage"; +import { ValidationRequestListInstance } from "./account/validationRequest"; +export type AccountStatus = "active" | "suspended" | "closed"; +export type AccountType = "Trial" | "Full"; +/** + * Options to pass to update a AccountInstance + */ +export interface AccountContextUpdateOptions { + /** Update the human-readable description of this Account */ + friendlyName?: string; + /** */ + status?: AccountStatus; +} +/** + * Options to pass to create a AccountInstance + */ +export interface AccountListInstanceCreateOptions { + /** A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface AccountListInstanceEachOptions { + /** Only return the Account resources with friendly names that exactly match this name. */ + friendlyName?: string; + /** Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. */ + status?: AccountStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AccountInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AccountListInstanceOptions { + /** Only return the Account resources with friendly names that exactly match this name. */ + friendlyName?: string; + /** Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. */ + status?: AccountStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AccountListInstancePageOptions { + /** Only return the Account resources with friendly names that exactly match this name. */ + friendlyName?: string; + /** Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. */ + status?: AccountStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AccountContext { + addresses: AddressListInstance; + applications: ApplicationListInstance; + authorizedConnectApps: AuthorizedConnectAppListInstance; + availablePhoneNumbers: AvailablePhoneNumberCountryListInstance; + balance: BalanceListInstance; + calls: CallListInstance; + conferences: ConferenceListInstance; + connectApps: ConnectAppListInstance; + incomingPhoneNumbers: IncomingPhoneNumberListInstance; + keys: KeyListInstance; + messages: MessageListInstance; + newKeys: NewKeyListInstance; + newSigningKeys: NewSigningKeyListInstance; + notifications: NotificationListInstance; + outgoingCallerIds: OutgoingCallerIdListInstance; + queues: QueueListInstance; + recordings: RecordingListInstance; + shortCodes: ShortCodeListInstance; + signingKeys: SigningKeyListInstance; + sip: SipListInstance; + tokens: TokenListInstance; + transcriptions: TranscriptionListInstance; + usage: UsageListInstance; + validationRequests: ValidationRequestListInstance; + /** + * Fetch a AccountInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + fetch(callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Update a AccountInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + update(callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Update a AccountInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + update(params: AccountContextUpdateOptions, callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AccountContextSolution { + sid: string; +} +export declare class AccountContextImpl implements AccountContext { + protected _version: V2010; + protected _solution: AccountContextSolution; + protected _uri: string; + protected _addresses?: AddressListInstance; + protected _applications?: ApplicationListInstance; + protected _authorizedConnectApps?: AuthorizedConnectAppListInstance; + protected _availablePhoneNumbers?: AvailablePhoneNumberCountryListInstance; + protected _balance?: BalanceListInstance; + protected _calls?: CallListInstance; + protected _conferences?: ConferenceListInstance; + protected _connectApps?: ConnectAppListInstance; + protected _incomingPhoneNumbers?: IncomingPhoneNumberListInstance; + protected _keys?: KeyListInstance; + protected _messages?: MessageListInstance; + protected _newKeys?: NewKeyListInstance; + protected _newSigningKeys?: NewSigningKeyListInstance; + protected _notifications?: NotificationListInstance; + protected _outgoingCallerIds?: OutgoingCallerIdListInstance; + protected _queues?: QueueListInstance; + protected _recordings?: RecordingListInstance; + protected _shortCodes?: ShortCodeListInstance; + protected _signingKeys?: SigningKeyListInstance; + protected _sip?: SipListInstance; + protected _tokens?: TokenListInstance; + protected _transcriptions?: TranscriptionListInstance; + protected _usage?: UsageListInstance; + protected _validationRequests?: ValidationRequestListInstance; + constructor(_version: V2010, sid: string); + get addresses(): AddressListInstance; + get applications(): ApplicationListInstance; + get authorizedConnectApps(): AuthorizedConnectAppListInstance; + get availablePhoneNumbers(): AvailablePhoneNumberCountryListInstance; + get balance(): BalanceListInstance; + get calls(): CallListInstance; + get conferences(): ConferenceListInstance; + get connectApps(): ConnectAppListInstance; + get incomingPhoneNumbers(): IncomingPhoneNumberListInstance; + get keys(): KeyListInstance; + get messages(): MessageListInstance; + get newKeys(): NewKeyListInstance; + get newSigningKeys(): NewSigningKeyListInstance; + get notifications(): NotificationListInstance; + get outgoingCallerIds(): OutgoingCallerIdListInstance; + get queues(): QueueListInstance; + get recordings(): RecordingListInstance; + get shortCodes(): ShortCodeListInstance; + get signingKeys(): SigningKeyListInstance; + get sip(): SipListInstance; + get tokens(): TokenListInstance; + get transcriptions(): TranscriptionListInstance; + get usage(): UsageListInstance; + get validationRequests(): ValidationRequestListInstance; + fetch(callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + update(params?: AccountContextUpdateOptions | ((error: Error | null, item?: AccountInstance) => any), callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AccountContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AccountPayload extends TwilioResponsePayload { + accounts: AccountResource[]; +} +interface AccountResource { + auth_token: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + owner_account_sid: string; + sid: string; + status: AccountStatus; + subresource_uris: Record; + type: AccountType; + uri: string; +} +export declare class AccountInstance { + protected _version: V2010; + protected _solution: AccountContextSolution; + protected _context?: AccountContext; + constructor(_version: V2010, payload: AccountResource, sid?: string); + /** + * The authorization token for this account. This token should be kept a secret, so no sharing. + */ + authToken: string; + /** + * The date that this account was created, in GMT in RFC 2822 format + */ + dateCreated: Date; + /** + * The date that this account was last updated, in GMT in RFC 2822 format. + */ + dateUpdated: Date; + /** + * A human readable description of this account, up to 64 characters long. By default the FriendlyName is your email address. + */ + friendlyName: string; + /** + * The unique 34 character id that represents the parent of this account. The OwnerAccountSid of a parent account is it\'s own sid. + */ + ownerAccountSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + status: AccountStatus; + /** + * A Map of various subresources available for the given Account Instance + */ + subresourceUris: Record; + type: AccountType; + /** + * The URI for this resource, relative to `https://api.twilio.com` + */ + uri: string; + private get _proxy(); + /** + * Fetch a AccountInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + fetch(callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Update a AccountInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + update(callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Update a AccountInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + update(params: AccountContextUpdateOptions, callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Access the addresses. + */ + addresses(): AddressListInstance; + /** + * Access the applications. + */ + applications(): ApplicationListInstance; + /** + * Access the authorizedConnectApps. + */ + authorizedConnectApps(): AuthorizedConnectAppListInstance; + /** + * Access the availablePhoneNumbers. + */ + availablePhoneNumbers(): AvailablePhoneNumberCountryListInstance; + /** + * Access the balance. + */ + balance(): BalanceListInstance; + /** + * Access the calls. + */ + calls(): CallListInstance; + /** + * Access the conferences. + */ + conferences(): ConferenceListInstance; + /** + * Access the connectApps. + */ + connectApps(): ConnectAppListInstance; + /** + * Access the incomingPhoneNumbers. + */ + incomingPhoneNumbers(): IncomingPhoneNumberListInstance; + /** + * Access the keys. + */ + keys(): KeyListInstance; + /** + * Access the messages. + */ + messages(): MessageListInstance; + /** + * Access the newKeys. + */ + newKeys(): NewKeyListInstance; + /** + * Access the newSigningKeys. + */ + newSigningKeys(): NewSigningKeyListInstance; + /** + * Access the notifications. + */ + notifications(): NotificationListInstance; + /** + * Access the outgoingCallerIds. + */ + outgoingCallerIds(): OutgoingCallerIdListInstance; + /** + * Access the queues. + */ + queues(): QueueListInstance; + /** + * Access the recordings. + */ + recordings(): RecordingListInstance; + /** + * Access the shortCodes. + */ + shortCodes(): ShortCodeListInstance; + /** + * Access the signingKeys. + */ + signingKeys(): SigningKeyListInstance; + /** + * Access the sip. + */ + sip(): SipListInstance; + /** + * Access the tokens. + */ + tokens(): TokenListInstance; + /** + * Access the transcriptions. + */ + transcriptions(): TranscriptionListInstance; + /** + * Access the usage. + */ + usage(): UsageListInstance; + /** + * Access the validationRequests. + */ + validationRequests(): ValidationRequestListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + authToken: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + ownerAccountSid: string; + sid: string; + status: AccountStatus; + subresourceUris: Record; + type: AccountType; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AccountSolution { +} +export interface AccountListInstance { + _version: V2010; + _solution: AccountSolution; + _uri: string; + (sid: string): AccountContext; + get(sid: string): AccountContext; + /** + * Create a AccountInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + create(callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Create a AccountInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + create(params: AccountListInstanceCreateOptions, callback?: (error: Error | null, item?: AccountInstance) => any): Promise; + /** + * Streams AccountInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AccountInstance, done: (err?: Error) => void) => void): void; + each(params: AccountListInstanceEachOptions, callback?: (item: AccountInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AccountInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AccountPage) => any): Promise; + /** + * Lists AccountInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AccountInstance[]) => any): Promise; + list(params: AccountListInstanceOptions, callback?: (error: Error | null, items: AccountInstance[]) => any): Promise; + /** + * Retrieve a single page of AccountInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AccountPage) => any): Promise; + page(params: AccountListInstancePageOptions, callback?: (error: Error | null, items: AccountPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AccountListInstance(version: V2010): AccountListInstance; +export declare class AccountPage extends Page { + /** + * Initialize the AccountPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AccountSolution); + /** + * Build an instance of AccountInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AccountResource): AccountInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account.js b/node_modules/twilio/lib/rest/api/v2010/account.js new file mode 100644 index 00000000..2ca2feae --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account.js @@ -0,0 +1,546 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AccountPage = exports.AccountListInstance = exports.AccountInstance = exports.AccountContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const address_1 = require("./account/address"); +const application_1 = require("./account/application"); +const authorizedConnectApp_1 = require("./account/authorizedConnectApp"); +const availablePhoneNumberCountry_1 = require("./account/availablePhoneNumberCountry"); +const balance_1 = require("./account/balance"); +const call_1 = require("./account/call"); +const conference_1 = require("./account/conference"); +const connectApp_1 = require("./account/connectApp"); +const incomingPhoneNumber_1 = require("./account/incomingPhoneNumber"); +const key_1 = require("./account/key"); +const message_1 = require("./account/message"); +const newKey_1 = require("./account/newKey"); +const newSigningKey_1 = require("./account/newSigningKey"); +const notification_1 = require("./account/notification"); +const outgoingCallerId_1 = require("./account/outgoingCallerId"); +const queue_1 = require("./account/queue"); +const recording_1 = require("./account/recording"); +const shortCode_1 = require("./account/shortCode"); +const signingKey_1 = require("./account/signingKey"); +const sip_1 = require("./account/sip"); +const token_1 = require("./account/token"); +const transcription_1 = require("./account/transcription"); +const usage_1 = require("./account/usage"); +const validationRequest_1 = require("./account/validationRequest"); +class AccountContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Accounts/${sid}.json`; + } + get addresses() { + this._addresses = + this._addresses || (0, address_1.AddressListInstance)(this._version, this._solution.sid); + return this._addresses; + } + get applications() { + this._applications = + this._applications || + (0, application_1.ApplicationListInstance)(this._version, this._solution.sid); + return this._applications; + } + get authorizedConnectApps() { + this._authorizedConnectApps = + this._authorizedConnectApps || + (0, authorizedConnectApp_1.AuthorizedConnectAppListInstance)(this._version, this._solution.sid); + return this._authorizedConnectApps; + } + get availablePhoneNumbers() { + this._availablePhoneNumbers = + this._availablePhoneNumbers || + (0, availablePhoneNumberCountry_1.AvailablePhoneNumberCountryListInstance)(this._version, this._solution.sid); + return this._availablePhoneNumbers; + } + get balance() { + this._balance = + this._balance || (0, balance_1.BalanceListInstance)(this._version, this._solution.sid); + return this._balance; + } + get calls() { + this._calls = + this._calls || (0, call_1.CallListInstance)(this._version, this._solution.sid); + return this._calls; + } + get conferences() { + this._conferences = + this._conferences || + (0, conference_1.ConferenceListInstance)(this._version, this._solution.sid); + return this._conferences; + } + get connectApps() { + this._connectApps = + this._connectApps || + (0, connectApp_1.ConnectAppListInstance)(this._version, this._solution.sid); + return this._connectApps; + } + get incomingPhoneNumbers() { + this._incomingPhoneNumbers = + this._incomingPhoneNumbers || + (0, incomingPhoneNumber_1.IncomingPhoneNumberListInstance)(this._version, this._solution.sid); + return this._incomingPhoneNumbers; + } + get keys() { + this._keys = + this._keys || (0, key_1.KeyListInstance)(this._version, this._solution.sid); + return this._keys; + } + get messages() { + this._messages = + this._messages || (0, message_1.MessageListInstance)(this._version, this._solution.sid); + return this._messages; + } + get newKeys() { + this._newKeys = + this._newKeys || (0, newKey_1.NewKeyListInstance)(this._version, this._solution.sid); + return this._newKeys; + } + get newSigningKeys() { + this._newSigningKeys = + this._newSigningKeys || + (0, newSigningKey_1.NewSigningKeyListInstance)(this._version, this._solution.sid); + return this._newSigningKeys; + } + get notifications() { + this._notifications = + this._notifications || + (0, notification_1.NotificationListInstance)(this._version, this._solution.sid); + return this._notifications; + } + get outgoingCallerIds() { + this._outgoingCallerIds = + this._outgoingCallerIds || + (0, outgoingCallerId_1.OutgoingCallerIdListInstance)(this._version, this._solution.sid); + return this._outgoingCallerIds; + } + get queues() { + this._queues = + this._queues || (0, queue_1.QueueListInstance)(this._version, this._solution.sid); + return this._queues; + } + get recordings() { + this._recordings = + this._recordings || + (0, recording_1.RecordingListInstance)(this._version, this._solution.sid); + return this._recordings; + } + get shortCodes() { + this._shortCodes = + this._shortCodes || + (0, shortCode_1.ShortCodeListInstance)(this._version, this._solution.sid); + return this._shortCodes; + } + get signingKeys() { + this._signingKeys = + this._signingKeys || + (0, signingKey_1.SigningKeyListInstance)(this._version, this._solution.sid); + return this._signingKeys; + } + get sip() { + this._sip = this._sip || (0, sip_1.SipListInstance)(this._version, this._solution.sid); + return this._sip; + } + get tokens() { + this._tokens = + this._tokens || (0, token_1.TokenListInstance)(this._version, this._solution.sid); + return this._tokens; + } + get transcriptions() { + this._transcriptions = + this._transcriptions || + (0, transcription_1.TranscriptionListInstance)(this._version, this._solution.sid); + return this._transcriptions; + } + get usage() { + this._usage = + this._usage || (0, usage_1.UsageListInstance)(this._version, this._solution.sid); + return this._usage; + } + get validationRequests() { + this._validationRequests = + this._validationRequests || + (0, validationRequest_1.ValidationRequestListInstance)(this._version, this._solution.sid); + return this._validationRequests; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AccountInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountContextImpl = AccountContextImpl; +class AccountInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.authToken = payload.auth_token; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.ownerAccountSid = payload.owner_account_sid; + this.sid = payload.sid; + this.status = payload.status; + this.subresourceUris = payload.subresource_uris; + this.type = payload.type; + this.uri = payload.uri; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AccountContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a AccountInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the addresses. + */ + addresses() { + return this._proxy.addresses; + } + /** + * Access the applications. + */ + applications() { + return this._proxy.applications; + } + /** + * Access the authorizedConnectApps. + */ + authorizedConnectApps() { + return this._proxy.authorizedConnectApps; + } + /** + * Access the availablePhoneNumbers. + */ + availablePhoneNumbers() { + return this._proxy.availablePhoneNumbers; + } + /** + * Access the balance. + */ + balance() { + return this._proxy.balance; + } + /** + * Access the calls. + */ + calls() { + return this._proxy.calls; + } + /** + * Access the conferences. + */ + conferences() { + return this._proxy.conferences; + } + /** + * Access the connectApps. + */ + connectApps() { + return this._proxy.connectApps; + } + /** + * Access the incomingPhoneNumbers. + */ + incomingPhoneNumbers() { + return this._proxy.incomingPhoneNumbers; + } + /** + * Access the keys. + */ + keys() { + return this._proxy.keys; + } + /** + * Access the messages. + */ + messages() { + return this._proxy.messages; + } + /** + * Access the newKeys. + */ + newKeys() { + return this._proxy.newKeys; + } + /** + * Access the newSigningKeys. + */ + newSigningKeys() { + return this._proxy.newSigningKeys; + } + /** + * Access the notifications. + */ + notifications() { + return this._proxy.notifications; + } + /** + * Access the outgoingCallerIds. + */ + outgoingCallerIds() { + return this._proxy.outgoingCallerIds; + } + /** + * Access the queues. + */ + queues() { + return this._proxy.queues; + } + /** + * Access the recordings. + */ + recordings() { + return this._proxy.recordings; + } + /** + * Access the shortCodes. + */ + shortCodes() { + return this._proxy.shortCodes; + } + /** + * Access the signingKeys. + */ + signingKeys() { + return this._proxy.signingKeys; + } + /** + * Access the sip. + */ + sip() { + return this._proxy.sip; + } + /** + * Access the tokens. + */ + tokens() { + return this._proxy.tokens; + } + /** + * Access the transcriptions. + */ + transcriptions() { + return this._proxy.transcriptions; + } + /** + * Access the usage. + */ + usage() { + return this._proxy.usage; + } + /** + * Access the validationRequests. + */ + validationRequests() { + return this._proxy.validationRequests; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + authToken: this.authToken, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + ownerAccountSid: this.ownerAccountSid, + sid: this.sid, + status: this.status, + subresourceUris: this.subresourceUris, + type: this.type, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountInstance = AccountInstance; +function AccountListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AccountContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Accounts.json`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AccountPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AccountListInstance = AccountListInstance; +class AccountPage extends Page_1.default { + /** + * Initialize the AccountPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AccountInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AccountInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountPage = AccountPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/address.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/address.d.ts new file mode 100644 index 00000000..ebd29735 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/address.d.ts @@ -0,0 +1,414 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +import { DependentPhoneNumberListInstance } from "./address/dependentPhoneNumber"; +/** + * Options to pass to update a AddressInstance + */ +export interface AddressContextUpdateOptions { + /** A descriptive string that you create to describe the address. It can be up to 64 characters long. */ + friendlyName?: string; + /** The name to associate with the address. */ + customerName?: string; + /** The number and street address of the address. */ + street?: string; + /** The city of the address. */ + city?: string; + /** The state or region of the address. */ + region?: string; + /** The postal code of the address. */ + postalCode?: string; + /** Whether to enable emergency calling on the address. Can be: `true` or `false`. */ + emergencyEnabled?: boolean; + /** Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won\\\'t alter the address you provide. */ + autoCorrectAddress?: boolean; + /** The additional number and street address of the address. */ + streetSecondary?: string; +} +/** + * Options to pass to create a AddressInstance + */ +export interface AddressListInstanceCreateOptions { + /** The name to associate with the new address. */ + customerName: string; + /** The number and street address of the new address. */ + street: string; + /** The city of the new address. */ + city: string; + /** The state or region of the new address. */ + region: string; + /** The postal code of the new address. */ + postalCode: string; + /** The ISO country code of the new address. */ + isoCountry: string; + /** A descriptive string that you create to describe the new address. It can be up to 64 characters long. */ + friendlyName?: string; + /** Whether to enable emergency calling on the new address. Can be: `true` or `false`. */ + emergencyEnabled?: boolean; + /** Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won\\\'t alter the address you provide. */ + autoCorrectAddress?: boolean; + /** The additional number and street address of the address. */ + streetSecondary?: string; +} +/** + * Options to pass to each + */ +export interface AddressListInstanceEachOptions { + /** The `customer_name` of the Address resources to read. */ + customerName?: string; + /** The string that identifies the Address resources to read. */ + friendlyName?: string; + /** The ISO country code of the Address resources to read. */ + isoCountry?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AddressInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AddressListInstanceOptions { + /** The `customer_name` of the Address resources to read. */ + customerName?: string; + /** The string that identifies the Address resources to read. */ + friendlyName?: string; + /** The ISO country code of the Address resources to read. */ + isoCountry?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AddressListInstancePageOptions { + /** The `customer_name` of the Address resources to read. */ + customerName?: string; + /** The string that identifies the Address resources to read. */ + friendlyName?: string; + /** The ISO country code of the Address resources to read. */ + isoCountry?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AddressContext { + dependentPhoneNumbers: DependentPhoneNumberListInstance; + /** + * Remove a AddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressInstance + */ + fetch(callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + /** + * Update a AddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressInstance + */ + update(callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + /** + * Update a AddressInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressInstance + */ + update(params: AddressContextUpdateOptions, callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AddressContextSolution { + accountSid: string; + sid: string; +} +export declare class AddressContextImpl implements AddressContext { + protected _version: V2010; + protected _solution: AddressContextSolution; + protected _uri: string; + protected _dependentPhoneNumbers?: DependentPhoneNumberListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get dependentPhoneNumbers(): DependentPhoneNumberListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + update(params?: AddressContextUpdateOptions | ((error: Error | null, item?: AddressInstance) => any), callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AddressContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AddressPayload extends TwilioResponsePayload { + addresses: AddressResource[]; +} +interface AddressResource { + account_sid: string; + city: string; + customer_name: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + iso_country: string; + postal_code: string; + region: string; + sid: string; + street: string; + uri: string; + emergency_enabled: boolean; + validated: boolean; + verified: boolean; + street_secondary: string; +} +export declare class AddressInstance { + protected _version: V2010; + protected _solution: AddressContextSolution; + protected _context?: AddressContext; + constructor(_version: V2010, payload: AddressResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource. + */ + accountSid: string; + /** + * The city in which the address is located. + */ + city: string; + /** + * The name associated with the address.This property has a maximum length of 16 4-byte characters, or 21 3-byte characters. + */ + customerName: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The ISO country code of the address. + */ + isoCountry: string; + /** + * The postal code of the address. + */ + postalCode: string; + /** + * The state or region of the address. + */ + region: string; + /** + * The unique string that that we created to identify the Address resource. + */ + sid: string; + /** + * The number and street address of the address. + */ + street: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * Whether emergency calling has been enabled on this number. + */ + emergencyEnabled: boolean; + /** + * Whether the address has been validated to comply with local regulation. In countries that require valid addresses, an invalid address will not be accepted. `true` indicates the Address has been validated. `false` indicate the country doesn\'t require validation or the Address is not valid. + */ + validated: boolean; + /** + * Whether the address has been verified to comply with regulation. In countries that require valid addresses, an invalid address will not be accepted. `true` indicates the Address has been verified. `false` indicate the country doesn\'t require verified or the Address is not valid. + */ + verified: boolean; + /** + * The additional number and street address of the address. + */ + streetSecondary: string; + private get _proxy(); + /** + * Remove a AddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressInstance + */ + fetch(callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + /** + * Update a AddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressInstance + */ + update(callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + /** + * Update a AddressInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressInstance + */ + update(params: AddressContextUpdateOptions, callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + /** + * Access the dependentPhoneNumbers. + */ + dependentPhoneNumbers(): DependentPhoneNumberListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + city: string; + customerName: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + isoCountry: string; + postalCode: string; + region: string; + sid: string; + street: string; + uri: string; + emergencyEnabled: boolean; + validated: boolean; + verified: boolean; + streetSecondary: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AddressSolution { + accountSid: string; +} +export interface AddressListInstance { + _version: V2010; + _solution: AddressSolution; + _uri: string; + (sid: string): AddressContext; + get(sid: string): AddressContext; + /** + * Create a AddressInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressInstance + */ + create(params: AddressListInstanceCreateOptions, callback?: (error: Error | null, item?: AddressInstance) => any): Promise; + /** + * Streams AddressInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddressListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AddressInstance, done: (err?: Error) => void) => void): void; + each(params: AddressListInstanceEachOptions, callback?: (item: AddressInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AddressInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AddressPage) => any): Promise; + /** + * Lists AddressInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddressListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AddressInstance[]) => any): Promise; + list(params: AddressListInstanceOptions, callback?: (error: Error | null, items: AddressInstance[]) => any): Promise; + /** + * Retrieve a single page of AddressInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddressListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AddressPage) => any): Promise; + page(params: AddressListInstancePageOptions, callback?: (error: Error | null, items: AddressPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AddressListInstance(version: V2010, accountSid: string): AddressListInstance; +export declare class AddressPage extends Page { + /** + * Initialize the AddressPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AddressSolution); + /** + * Build an instance of AddressInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AddressResource): AddressInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/address.js b/node_modules/twilio/lib/rest/api/v2010/account/address.js new file mode 100644 index 00000000..88918003 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/address.js @@ -0,0 +1,338 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AddressPage = exports.AddressListInstance = exports.AddressInstance = exports.AddressContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const dependentPhoneNumber_1 = require("./address/dependentPhoneNumber"); +class AddressContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Addresses/${sid}.json`; + } + get dependentPhoneNumbers() { + this._dependentPhoneNumbers = + this._dependentPhoneNumbers || + (0, dependentPhoneNumber_1.DependentPhoneNumberListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._dependentPhoneNumbers; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AddressInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["customerName"] !== undefined) + data["CustomerName"] = params["customerName"]; + if (params["street"] !== undefined) + data["Street"] = params["street"]; + if (params["city"] !== undefined) + data["City"] = params["city"]; + if (params["region"] !== undefined) + data["Region"] = params["region"]; + if (params["postalCode"] !== undefined) + data["PostalCode"] = params["postalCode"]; + if (params["emergencyEnabled"] !== undefined) + data["EmergencyEnabled"] = serialize.bool(params["emergencyEnabled"]); + if (params["autoCorrectAddress"] !== undefined) + data["AutoCorrectAddress"] = serialize.bool(params["autoCorrectAddress"]); + if (params["streetSecondary"] !== undefined) + data["StreetSecondary"] = params["streetSecondary"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AddressInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddressContextImpl = AddressContextImpl; +class AddressInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.city = payload.city; + this.customerName = payload.customer_name; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.isoCountry = payload.iso_country; + this.postalCode = payload.postal_code; + this.region = payload.region; + this.sid = payload.sid; + this.street = payload.street; + this.uri = payload.uri; + this.emergencyEnabled = payload.emergency_enabled; + this.validated = payload.validated; + this.verified = payload.verified; + this.streetSecondary = payload.street_secondary; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AddressContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a AddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the dependentPhoneNumbers. + */ + dependentPhoneNumbers() { + return this._proxy.dependentPhoneNumbers; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + city: this.city, + customerName: this.customerName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + isoCountry: this.isoCountry, + postalCode: this.postalCode, + region: this.region, + sid: this.sid, + street: this.street, + uri: this.uri, + emergencyEnabled: this.emergencyEnabled, + validated: this.validated, + verified: this.verified, + streetSecondary: this.streetSecondary, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddressInstance = AddressInstance; +function AddressListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AddressContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Addresses.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["customerName"] === null || + params["customerName"] === undefined) { + throw new Error("Required parameter \"params['customerName']\" missing."); + } + if (params["street"] === null || params["street"] === undefined) { + throw new Error("Required parameter \"params['street']\" missing."); + } + if (params["city"] === null || params["city"] === undefined) { + throw new Error("Required parameter \"params['city']\" missing."); + } + if (params["region"] === null || params["region"] === undefined) { + throw new Error("Required parameter \"params['region']\" missing."); + } + if (params["postalCode"] === null || params["postalCode"] === undefined) { + throw new Error("Required parameter \"params['postalCode']\" missing."); + } + if (params["isoCountry"] === null || params["isoCountry"] === undefined) { + throw new Error("Required parameter \"params['isoCountry']\" missing."); + } + let data = {}; + data["CustomerName"] = params["customerName"]; + data["Street"] = params["street"]; + data["City"] = params["city"]; + data["Region"] = params["region"]; + data["PostalCode"] = params["postalCode"]; + data["IsoCountry"] = params["isoCountry"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["emergencyEnabled"] !== undefined) + data["EmergencyEnabled"] = serialize.bool(params["emergencyEnabled"]); + if (params["autoCorrectAddress"] !== undefined) + data["AutoCorrectAddress"] = serialize.bool(params["autoCorrectAddress"]); + if (params["streetSecondary"] !== undefined) + data["StreetSecondary"] = params["streetSecondary"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AddressInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["customerName"] !== undefined) + data["CustomerName"] = params["customerName"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["isoCountry"] !== undefined) + data["IsoCountry"] = params["isoCountry"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AddressPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AddressPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AddressListInstance = AddressListInstance; +class AddressPage extends Page_1.default { + /** + * Initialize the AddressPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AddressInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AddressInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddressPage = AddressPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/address/dependentPhoneNumber.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/address/dependentPhoneNumber.d.ts new file mode 100644 index 00000000..864114fb --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/address/dependentPhoneNumber.d.ts @@ -0,0 +1,290 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +export type DependentPhoneNumberAddressRequirement = "none" | "any" | "local" | "foreign"; +export type DependentPhoneNumberEmergencyStatus = "Active" | "Inactive"; +/** + * Options to pass to each + */ +export interface DependentPhoneNumberListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DependentPhoneNumberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DependentPhoneNumberListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DependentPhoneNumberListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DependentPhoneNumberSolution { + accountSid: string; + addressSid: string; +} +export interface DependentPhoneNumberListInstance { + _version: V2010; + _solution: DependentPhoneNumberSolution; + _uri: string; + /** + * Streams DependentPhoneNumberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentPhoneNumberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DependentPhoneNumberInstance, done: (err?: Error) => void) => void): void; + each(params: DependentPhoneNumberListInstanceEachOptions, callback?: (item: DependentPhoneNumberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DependentPhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DependentPhoneNumberPage) => any): Promise; + /** + * Lists DependentPhoneNumberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentPhoneNumberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DependentPhoneNumberInstance[]) => any): Promise; + list(params: DependentPhoneNumberListInstanceOptions, callback?: (error: Error | null, items: DependentPhoneNumberInstance[]) => any): Promise; + /** + * Retrieve a single page of DependentPhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentPhoneNumberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DependentPhoneNumberPage) => any): Promise; + page(params: DependentPhoneNumberListInstancePageOptions, callback?: (error: Error | null, items: DependentPhoneNumberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DependentPhoneNumberListInstance(version: V2010, accountSid: string, addressSid: string): DependentPhoneNumberListInstance; +interface DependentPhoneNumberPayload extends TwilioResponsePayload { + dependent_phone_numbers: DependentPhoneNumberResource[]; +} +interface DependentPhoneNumberResource { + sid: string; + account_sid: string; + friendly_name: string; + phone_number: string; + voice_url: string; + voice_method: string; + voice_fallback_method: string; + voice_fallback_url: string; + voice_caller_id_lookup: boolean; + date_created: Date; + date_updated: Date; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + address_requirements: DependentPhoneNumberAddressRequirement; + capabilities: any; + status_callback: string; + status_callback_method: string; + api_version: string; + sms_application_sid: string; + voice_application_sid: string; + trunk_sid: string; + emergency_status: DependentPhoneNumberEmergencyStatus; + emergency_address_sid: string; + uri: string; +} +export declare class DependentPhoneNumberInstance { + protected _version: V2010; + constructor(_version: V2010, payload: DependentPhoneNumberResource, accountSid: string, addressSid: string); + /** + * The unique string that that we created to identify the DependentPhoneNumber resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the DependentPhoneNumber resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The URL we call when the phone number receives a call. The `voice_url` will not be used if a `voice_application_sid` or a `trunk_sid` is set. + */ + voiceUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`. + */ + voiceFallbackUrl: string; + /** + * Whether we look up the caller\'s caller-ID name from the CNAM database. Can be: `true` or `false`. Caller ID lookups can cost $0.01 each. + */ + voiceCallerIdLookup: boolean; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`. + */ + smsFallbackMethod: string; + /** + * The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`. + */ + smsFallbackUrl: string; + /** + * The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. + */ + smsMethod: string; + /** + * The URL we call when the phone number receives an incoming SMS message. + */ + smsUrl: string; + addressRequirements: DependentPhoneNumberAddressRequirement; + /** + * The set of Boolean properties that indicates whether a phone number can receive calls or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` or `false`. + */ + capabilities: any; + /** + * The URL we call using the `status_callback_method` to send status information to your application. + */ + statusCallback: string; + /** + * The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. + */ + statusCallbackMethod: string; + /** + * The API version used to start a new TwiML session. + */ + apiVersion: string; + /** + * The SID of the application that handles SMS messages sent to the phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + */ + smsApplicationSid: string; + /** + * The SID of the application that handles calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + */ + voiceApplicationSid: string; + /** + * The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + */ + trunkSid: string; + emergencyStatus: DependentPhoneNumberEmergencyStatus; + /** + * The SID of the emergency address configuration that we use for emergency calling from the phone number. + */ + emergencyAddressSid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + phoneNumber: string; + voiceUrl: string; + voiceMethod: string; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceCallerIdLookup: boolean; + dateCreated: Date; + dateUpdated: Date; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + addressRequirements: DependentPhoneNumberAddressRequirement; + capabilities: any; + statusCallback: string; + statusCallbackMethod: string; + apiVersion: string; + smsApplicationSid: string; + voiceApplicationSid: string; + trunkSid: string; + emergencyStatus: DependentPhoneNumberEmergencyStatus; + emergencyAddressSid: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class DependentPhoneNumberPage extends Page { + /** + * Initialize the DependentPhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: DependentPhoneNumberSolution); + /** + * Build an instance of DependentPhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DependentPhoneNumberResource): DependentPhoneNumberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/address/dependentPhoneNumber.js b/node_modules/twilio/lib/rest/api/v2010/account/address/dependentPhoneNumber.js new file mode 100644 index 00000000..c88d67ad --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/address/dependentPhoneNumber.js @@ -0,0 +1,175 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DependentPhoneNumberPage = exports.DependentPhoneNumberInstance = exports.DependentPhoneNumberListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function DependentPhoneNumberListInstance(version, accountSid, addressSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(addressSid)) { + throw new Error("Parameter 'addressSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, addressSid }; + instance._uri = `/Accounts/${accountSid}/Addresses/${addressSid}/DependentPhoneNumbers.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DependentPhoneNumberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DependentPhoneNumberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DependentPhoneNumberListInstance = DependentPhoneNumberListInstance; +class DependentPhoneNumberInstance { + constructor(_version, payload, accountSid, addressSid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.voiceUrl = payload.voice_url; + this.voiceMethod = payload.voice_method; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceCallerIdLookup = payload.voice_caller_id_lookup; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.addressRequirements = payload.address_requirements; + this.capabilities = payload.capabilities; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.apiVersion = payload.api_version; + this.smsApplicationSid = payload.sms_application_sid; + this.voiceApplicationSid = payload.voice_application_sid; + this.trunkSid = payload.trunk_sid; + this.emergencyStatus = payload.emergency_status; + this.emergencyAddressSid = payload.emergency_address_sid; + this.uri = payload.uri; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + voiceUrl: this.voiceUrl, + voiceMethod: this.voiceMethod, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceCallerIdLookup: this.voiceCallerIdLookup, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + addressRequirements: this.addressRequirements, + capabilities: this.capabilities, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + apiVersion: this.apiVersion, + smsApplicationSid: this.smsApplicationSid, + voiceApplicationSid: this.voiceApplicationSid, + trunkSid: this.trunkSid, + emergencyStatus: this.emergencyStatus, + emergencyAddressSid: this.emergencyAddressSid, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DependentPhoneNumberInstance = DependentPhoneNumberInstance; +class DependentPhoneNumberPage extends Page_1.default { + /** + * Initialize the DependentPhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DependentPhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DependentPhoneNumberInstance(this._version, payload, this._solution.accountSid, this._solution.addressSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DependentPhoneNumberPage = DependentPhoneNumberPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/application.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/application.d.ts new file mode 100644 index 00000000..e950f1b7 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/application.d.ts @@ -0,0 +1,458 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +/** + * Options to pass to update a ApplicationInstance + */ +export interface ApplicationContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account\\\'s default API version. */ + apiVersion?: string; + /** The URL we should call when the phone number assigned to this application receives a call. */ + voiceUrl?: string; + /** The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. */ + voiceMethod?: string; + /** The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. */ + voiceFallbackUrl?: string; + /** The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. */ + voiceFallbackMethod?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. */ + statusCallbackMethod?: string; + /** Whether we should look up the caller\\\'s caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. */ + voiceCallerIdLookup?: boolean; + /** The URL we should call when the phone number receives an incoming SMS message. */ + smsUrl?: string; + /** The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. */ + smsMethod?: string; + /** The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. */ + smsFallbackMethod?: string; + /** Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. */ + smsStatusCallback?: string; + /** The URL we should call using a POST method to send message status information to your application. */ + messageStatusCallback?: string; + /** Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. */ + publicApplicationConnectEnabled?: boolean; +} +/** + * Options to pass to create a ApplicationInstance + */ +export interface ApplicationListInstanceCreateOptions { + /** The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account\\\'s default API version. */ + apiVersion?: string; + /** The URL we should call when the phone number assigned to this application receives a call. */ + voiceUrl?: string; + /** The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. */ + voiceMethod?: string; + /** The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. */ + voiceFallbackUrl?: string; + /** The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. */ + voiceFallbackMethod?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. */ + statusCallbackMethod?: string; + /** Whether we should look up the caller\\\'s caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. */ + voiceCallerIdLookup?: boolean; + /** The URL we should call when the phone number receives an incoming SMS message. */ + smsUrl?: string; + /** The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. */ + smsMethod?: string; + /** The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. */ + smsFallbackMethod?: string; + /** The URL we should call using a POST method to send status information about SMS messages sent by the application. */ + smsStatusCallback?: string; + /** The URL we should call using a POST method to send message status information to your application. */ + messageStatusCallback?: string; + /** A descriptive string that you create to describe the new application. It can be up to 64 characters long. */ + friendlyName?: string; + /** Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. */ + publicApplicationConnectEnabled?: boolean; +} +/** + * Options to pass to each + */ +export interface ApplicationListInstanceEachOptions { + /** The string that identifies the Application resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ApplicationListInstanceOptions { + /** The string that identifies the Application resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ApplicationListInstancePageOptions { + /** The string that identifies the Application resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ApplicationContext { + /** + * Remove a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Update a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + update(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Update a ApplicationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + update(params: ApplicationContextUpdateOptions, callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ApplicationContextSolution { + accountSid: string; + sid: string; +} +export declare class ApplicationContextImpl implements ApplicationContext { + protected _version: V2010; + protected _solution: ApplicationContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + update(params?: ApplicationContextUpdateOptions | ((error: Error | null, item?: ApplicationInstance) => any), callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ApplicationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ApplicationPayload extends TwilioResponsePayload { + applications: ApplicationResource[]; +} +interface ApplicationResource { + account_sid: string; + api_version: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + message_status_callback: string; + sid: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_status_callback: string; + sms_url: string; + status_callback: string; + status_callback_method: string; + uri: string; + voice_caller_id_lookup: boolean; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_url: string; + public_application_connect_enabled: boolean; +} +export declare class ApplicationInstance { + protected _version: V2010; + protected _solution: ApplicationContextSolution; + protected _context?: ApplicationContext; + constructor(_version: V2010, payload: ApplicationResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resource. + */ + accountSid: string; + /** + * The API version used to start a new TwiML session. + */ + apiVersion: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The URL we call using a POST method to send message status information to your application. + */ + messageStatusCallback: string; + /** + * The unique string that that we created to identify the Application resource. + */ + sid: string; + /** + * The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`. + */ + smsFallbackMethod: string; + /** + * The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`. + */ + smsFallbackUrl: string; + /** + * The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. + */ + smsMethod: string; + /** + * The URL we call using a POST method to send status information to your application about SMS messages that refer to the application. + */ + smsStatusCallback: string; + /** + * The URL we call when the phone number receives an incoming SMS message. + */ + smsUrl: string; + /** + * The URL we call using the `status_callback_method` to send status information to your application. + */ + statusCallback: string; + /** + * The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. + */ + statusCallbackMethod: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * Whether we look up the caller\'s caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + */ + voiceCallerIdLookup: boolean; + /** + * The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`. + */ + voiceFallbackUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The URL we call when the phone number assigned to this application receives a call. + */ + voiceUrl: string; + /** + * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + */ + publicApplicationConnectEnabled: boolean; + private get _proxy(); + /** + * Remove a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Update a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + update(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Update a ApplicationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + update(params: ApplicationContextUpdateOptions, callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + messageStatusCallback: string; + sid: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsStatusCallback: string; + smsUrl: string; + statusCallback: string; + statusCallbackMethod: string; + uri: string; + voiceCallerIdLookup: boolean; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + publicApplicationConnectEnabled: boolean; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ApplicationSolution { + accountSid: string; +} +export interface ApplicationListInstance { + _version: V2010; + _solution: ApplicationSolution; + _uri: string; + (sid: string): ApplicationContext; + get(sid: string): ApplicationContext; + /** + * Create a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + create(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Create a ApplicationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + create(params: ApplicationListInstanceCreateOptions, callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise; + /** + * Streams ApplicationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ApplicationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void): void; + each(params: ApplicationListInstanceEachOptions, callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ApplicationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ApplicationPage) => any): Promise; + /** + * Lists ApplicationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ApplicationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ApplicationInstance[]) => any): Promise; + list(params: ApplicationListInstanceOptions, callback?: (error: Error | null, items: ApplicationInstance[]) => any): Promise; + /** + * Retrieve a single page of ApplicationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ApplicationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ApplicationPage) => any): Promise; + page(params: ApplicationListInstancePageOptions, callback?: (error: Error | null, items: ApplicationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ApplicationListInstance(version: V2010, accountSid: string): ApplicationListInstance; +export declare class ApplicationPage extends Page { + /** + * Initialize the ApplicationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: ApplicationSolution); + /** + * Build an instance of ApplicationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ApplicationResource): ApplicationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/application.js b/node_modules/twilio/lib/rest/api/v2010/account/application.js new file mode 100644 index 00000000..969e0c41 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/application.js @@ -0,0 +1,349 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApplicationPage = exports.ApplicationListInstance = exports.ApplicationInstance = exports.ApplicationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ApplicationContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Applications/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ApplicationInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["apiVersion"] !== undefined) + data["ApiVersion"] = params["apiVersion"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["voiceCallerIdLookup"] !== undefined) + data["VoiceCallerIdLookup"] = serialize.bool(params["voiceCallerIdLookup"]); + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsStatusCallback"] !== undefined) + data["SmsStatusCallback"] = params["smsStatusCallback"]; + if (params["messageStatusCallback"] !== undefined) + data["MessageStatusCallback"] = params["messageStatusCallback"]; + if (params["publicApplicationConnectEnabled"] !== undefined) + data["PublicApplicationConnectEnabled"] = serialize.bool(params["publicApplicationConnectEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ApplicationInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ApplicationContextImpl = ApplicationContextImpl; +class ApplicationInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.messageStatusCallback = payload.message_status_callback; + this.sid = payload.sid; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsStatusCallback = payload.sms_status_callback; + this.smsUrl = payload.sms_url; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.uri = payload.uri; + this.voiceCallerIdLookup = payload.voice_caller_id_lookup; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceUrl = payload.voice_url; + this.publicApplicationConnectEnabled = + payload.public_application_connect_enabled; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ApplicationContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ApplicationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApplicationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + messageStatusCallback: this.messageStatusCallback, + sid: this.sid, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsStatusCallback: this.smsStatusCallback, + smsUrl: this.smsUrl, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + uri: this.uri, + voiceCallerIdLookup: this.voiceCallerIdLookup, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceUrl: this.voiceUrl, + publicApplicationConnectEnabled: this.publicApplicationConnectEnabled, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ApplicationInstance = ApplicationInstance; +function ApplicationListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ApplicationContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Applications.json`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["apiVersion"] !== undefined) + data["ApiVersion"] = params["apiVersion"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["voiceCallerIdLookup"] !== undefined) + data["VoiceCallerIdLookup"] = serialize.bool(params["voiceCallerIdLookup"]); + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsStatusCallback"] !== undefined) + data["SmsStatusCallback"] = params["smsStatusCallback"]; + if (params["messageStatusCallback"] !== undefined) + data["MessageStatusCallback"] = params["messageStatusCallback"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["publicApplicationConnectEnabled"] !== undefined) + data["PublicApplicationConnectEnabled"] = serialize.bool(params["publicApplicationConnectEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ApplicationInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ApplicationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ApplicationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ApplicationListInstance = ApplicationListInstance; +class ApplicationPage extends Page_1.default { + /** + * Initialize the ApplicationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ApplicationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ApplicationInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ApplicationPage = ApplicationPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/authorizedConnectApp.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/authorizedConnectApp.d.ts new file mode 100644 index 00000000..55093332 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/authorizedConnectApp.d.ts @@ -0,0 +1,232 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +export type AuthorizedConnectAppPermission = "get-all" | "post-all"; +/** + * Options to pass to each + */ +export interface AuthorizedConnectAppListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AuthorizedConnectAppInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AuthorizedConnectAppListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AuthorizedConnectAppListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AuthorizedConnectAppContext { + /** + * Fetch a AuthorizedConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizedConnectAppInstance + */ + fetch(callback?: (error: Error | null, item?: AuthorizedConnectAppInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AuthorizedConnectAppContextSolution { + accountSid: string; + connectAppSid: string; +} +export declare class AuthorizedConnectAppContextImpl implements AuthorizedConnectAppContext { + protected _version: V2010; + protected _solution: AuthorizedConnectAppContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, connectAppSid: string); + fetch(callback?: (error: Error | null, item?: AuthorizedConnectAppInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AuthorizedConnectAppContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AuthorizedConnectAppPayload extends TwilioResponsePayload { + authorized_connect_apps: AuthorizedConnectAppResource[]; +} +interface AuthorizedConnectAppResource { + account_sid: string; + connect_app_company_name: string; + connect_app_description: string; + connect_app_friendly_name: string; + connect_app_homepage_url: string; + connect_app_sid: string; + permissions: Array; + uri: string; +} +export declare class AuthorizedConnectAppInstance { + protected _version: V2010; + protected _solution: AuthorizedConnectAppContextSolution; + protected _context?: AuthorizedConnectAppContext; + constructor(_version: V2010, payload: AuthorizedConnectAppResource, accountSid: string, connectAppSid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AuthorizedConnectApp resource. + */ + accountSid: string; + /** + * The company name set for the Connect App. + */ + connectAppCompanyName: string; + /** + * A detailed description of the Connect App. + */ + connectAppDescription: string; + /** + * The name of the Connect App. + */ + connectAppFriendlyName: string; + /** + * The public URL for the Connect App. + */ + connectAppHomepageUrl: string; + /** + * The SID that we assigned to the Connect App. + */ + connectAppSid: string; + /** + * The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`. + */ + permissions: Array; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Fetch a AuthorizedConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizedConnectAppInstance + */ + fetch(callback?: (error: Error | null, item?: AuthorizedConnectAppInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + connectAppCompanyName: string; + connectAppDescription: string; + connectAppFriendlyName: string; + connectAppHomepageUrl: string; + connectAppSid: string; + permissions: AuthorizedConnectAppPermission[]; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AuthorizedConnectAppSolution { + accountSid: string; +} +export interface AuthorizedConnectAppListInstance { + _version: V2010; + _solution: AuthorizedConnectAppSolution; + _uri: string; + (connectAppSid: string): AuthorizedConnectAppContext; + get(connectAppSid: string): AuthorizedConnectAppContext; + /** + * Streams AuthorizedConnectAppInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizedConnectAppListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AuthorizedConnectAppInstance, done: (err?: Error) => void) => void): void; + each(params: AuthorizedConnectAppListInstanceEachOptions, callback?: (item: AuthorizedConnectAppInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AuthorizedConnectAppInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AuthorizedConnectAppPage) => any): Promise; + /** + * Lists AuthorizedConnectAppInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizedConnectAppListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AuthorizedConnectAppInstance[]) => any): Promise; + list(params: AuthorizedConnectAppListInstanceOptions, callback?: (error: Error | null, items: AuthorizedConnectAppInstance[]) => any): Promise; + /** + * Retrieve a single page of AuthorizedConnectAppInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizedConnectAppListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AuthorizedConnectAppPage) => any): Promise; + page(params: AuthorizedConnectAppListInstancePageOptions, callback?: (error: Error | null, items: AuthorizedConnectAppPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthorizedConnectAppListInstance(version: V2010, accountSid: string): AuthorizedConnectAppListInstance; +export declare class AuthorizedConnectAppPage extends Page { + /** + * Initialize the AuthorizedConnectAppPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AuthorizedConnectAppSolution); + /** + * Build an instance of AuthorizedConnectAppInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AuthorizedConnectAppResource): AuthorizedConnectAppInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/authorizedConnectApp.js b/node_modules/twilio/lib/rest/api/v2010/account/authorizedConnectApp.js new file mode 100644 index 00000000..f4d1d44d --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/authorizedConnectApp.js @@ -0,0 +1,194 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthorizedConnectAppPage = exports.AuthorizedConnectAppListInstance = exports.AuthorizedConnectAppInstance = exports.AuthorizedConnectAppContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class AuthorizedConnectAppContextImpl { + constructor(_version, accountSid, connectAppSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(connectAppSid)) { + throw new Error("Parameter 'connectAppSid' is not valid."); + } + this._solution = { accountSid, connectAppSid }; + this._uri = `/Accounts/${accountSid}/AuthorizedConnectApps/${connectAppSid}.json`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AuthorizedConnectAppInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.connectAppSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizedConnectAppContextImpl = AuthorizedConnectAppContextImpl; +class AuthorizedConnectAppInstance { + constructor(_version, payload, accountSid, connectAppSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.connectAppCompanyName = payload.connect_app_company_name; + this.connectAppDescription = payload.connect_app_description; + this.connectAppFriendlyName = payload.connect_app_friendly_name; + this.connectAppHomepageUrl = payload.connect_app_homepage_url; + this.connectAppSid = payload.connect_app_sid; + this.permissions = payload.permissions; + this.uri = payload.uri; + this._solution = { + accountSid, + connectAppSid: connectAppSid || this.connectAppSid, + }; + } + get _proxy() { + this._context = + this._context || + new AuthorizedConnectAppContextImpl(this._version, this._solution.accountSid, this._solution.connectAppSid); + return this._context; + } + /** + * Fetch a AuthorizedConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizedConnectAppInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + connectAppCompanyName: this.connectAppCompanyName, + connectAppDescription: this.connectAppDescription, + connectAppFriendlyName: this.connectAppFriendlyName, + connectAppHomepageUrl: this.connectAppHomepageUrl, + connectAppSid: this.connectAppSid, + permissions: this.permissions, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizedConnectAppInstance = AuthorizedConnectAppInstance; +function AuthorizedConnectAppListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((connectAppSid) => instance.get(connectAppSid)); + instance.get = function get(connectAppSid) { + return new AuthorizedConnectAppContextImpl(version, accountSid, connectAppSid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/AuthorizedConnectApps.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthorizedConnectAppPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AuthorizedConnectAppPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthorizedConnectAppListInstance = AuthorizedConnectAppListInstance; +class AuthorizedConnectAppPage extends Page_1.default { + /** + * Initialize the AuthorizedConnectAppPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AuthorizedConnectAppInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AuthorizedConnectAppInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizedConnectAppPage = AuthorizedConnectAppPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry.d.ts new file mode 100644 index 00000000..057b5dc3 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry.d.ts @@ -0,0 +1,269 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +import { LocalListInstance } from "./availablePhoneNumberCountry/local"; +import { MachineToMachineListInstance } from "./availablePhoneNumberCountry/machineToMachine"; +import { MobileListInstance } from "./availablePhoneNumberCountry/mobile"; +import { NationalListInstance } from "./availablePhoneNumberCountry/national"; +import { SharedCostListInstance } from "./availablePhoneNumberCountry/sharedCost"; +import { TollFreeListInstance } from "./availablePhoneNumberCountry/tollFree"; +import { VoipListInstance } from "./availablePhoneNumberCountry/voip"; +/** + * Options to pass to each + */ +export interface AvailablePhoneNumberCountryListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AvailablePhoneNumberCountryInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AvailablePhoneNumberCountryListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AvailablePhoneNumberCountryListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AvailablePhoneNumberCountryContext { + local: LocalListInstance; + machineToMachine: MachineToMachineListInstance; + mobile: MobileListInstance; + national: NationalListInstance; + sharedCost: SharedCostListInstance; + tollFree: TollFreeListInstance; + voip: VoipListInstance; + /** + * Fetch a AvailablePhoneNumberCountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailablePhoneNumberCountryInstance + */ + fetch(callback?: (error: Error | null, item?: AvailablePhoneNumberCountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AvailablePhoneNumberCountryContextSolution { + accountSid: string; + countryCode: string; +} +export declare class AvailablePhoneNumberCountryContextImpl implements AvailablePhoneNumberCountryContext { + protected _version: V2010; + protected _solution: AvailablePhoneNumberCountryContextSolution; + protected _uri: string; + protected _local?: LocalListInstance; + protected _machineToMachine?: MachineToMachineListInstance; + protected _mobile?: MobileListInstance; + protected _national?: NationalListInstance; + protected _sharedCost?: SharedCostListInstance; + protected _tollFree?: TollFreeListInstance; + protected _voip?: VoipListInstance; + constructor(_version: V2010, accountSid: string, countryCode: string); + get local(): LocalListInstance; + get machineToMachine(): MachineToMachineListInstance; + get mobile(): MobileListInstance; + get national(): NationalListInstance; + get sharedCost(): SharedCostListInstance; + get tollFree(): TollFreeListInstance; + get voip(): VoipListInstance; + fetch(callback?: (error: Error | null, item?: AvailablePhoneNumberCountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AvailablePhoneNumberCountryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AvailablePhoneNumberCountryPayload extends TwilioResponsePayload { + countries: AvailablePhoneNumberCountryResource[]; +} +interface AvailablePhoneNumberCountryResource { + country_code: string; + country: string; + uri: string; + beta: boolean; + subresource_uris: Record; +} +export declare class AvailablePhoneNumberCountryInstance { + protected _version: V2010; + protected _solution: AvailablePhoneNumberCountryContextSolution; + protected _context?: AvailablePhoneNumberCountryContext; + constructor(_version: V2010, payload: AvailablePhoneNumberCountryResource, accountSid: string, countryCode?: string); + /** + * The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country. + */ + countryCode: string; + /** + * The name of the country. + */ + country: string; + /** + * The URI of the Country resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * Whether all phone numbers available in the country are new to the Twilio platform. `true` if they are and `false` if all numbers are not in the Twilio Phone Number Beta program. + */ + beta: boolean; + /** + * A list of related AvailablePhoneNumber resources identified by their URIs relative to `https://api.twilio.com`. + */ + subresourceUris: Record; + private get _proxy(); + /** + * Fetch a AvailablePhoneNumberCountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailablePhoneNumberCountryInstance + */ + fetch(callback?: (error: Error | null, item?: AvailablePhoneNumberCountryInstance) => any): Promise; + /** + * Access the local. + */ + local(): LocalListInstance; + /** + * Access the machineToMachine. + */ + machineToMachine(): MachineToMachineListInstance; + /** + * Access the mobile. + */ + mobile(): MobileListInstance; + /** + * Access the national. + */ + national(): NationalListInstance; + /** + * Access the sharedCost. + */ + sharedCost(): SharedCostListInstance; + /** + * Access the tollFree. + */ + tollFree(): TollFreeListInstance; + /** + * Access the voip. + */ + voip(): VoipListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + countryCode: string; + country: string; + uri: string; + beta: boolean; + subresourceUris: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AvailablePhoneNumberCountrySolution { + accountSid: string; +} +export interface AvailablePhoneNumberCountryListInstance { + _version: V2010; + _solution: AvailablePhoneNumberCountrySolution; + _uri: string; + (countryCode: string): AvailablePhoneNumberCountryContext; + get(countryCode: string): AvailablePhoneNumberCountryContext; + /** + * Streams AvailablePhoneNumberCountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailablePhoneNumberCountryListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AvailablePhoneNumberCountryInstance, done: (err?: Error) => void) => void): void; + each(params: AvailablePhoneNumberCountryListInstanceEachOptions, callback?: (item: AvailablePhoneNumberCountryInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AvailablePhoneNumberCountryInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AvailablePhoneNumberCountryPage) => any): Promise; + /** + * Lists AvailablePhoneNumberCountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailablePhoneNumberCountryListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AvailablePhoneNumberCountryInstance[]) => any): Promise; + list(params: AvailablePhoneNumberCountryListInstanceOptions, callback?: (error: Error | null, items: AvailablePhoneNumberCountryInstance[]) => any): Promise; + /** + * Retrieve a single page of AvailablePhoneNumberCountryInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailablePhoneNumberCountryListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AvailablePhoneNumberCountryPage) => any): Promise; + page(params: AvailablePhoneNumberCountryListInstancePageOptions, callback?: (error: Error | null, items: AvailablePhoneNumberCountryPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AvailablePhoneNumberCountryListInstance(version: V2010, accountSid: string): AvailablePhoneNumberCountryListInstance; +export declare class AvailablePhoneNumberCountryPage extends Page { + /** + * Initialize the AvailablePhoneNumberCountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AvailablePhoneNumberCountrySolution); + /** + * Build an instance of AvailablePhoneNumberCountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AvailablePhoneNumberCountryResource): AvailablePhoneNumberCountryInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry.js b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry.js new file mode 100644 index 00000000..19ac2a79 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry.js @@ -0,0 +1,279 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AvailablePhoneNumberCountryPage = exports.AvailablePhoneNumberCountryListInstance = exports.AvailablePhoneNumberCountryInstance = exports.AvailablePhoneNumberCountryContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const local_1 = require("./availablePhoneNumberCountry/local"); +const machineToMachine_1 = require("./availablePhoneNumberCountry/machineToMachine"); +const mobile_1 = require("./availablePhoneNumberCountry/mobile"); +const national_1 = require("./availablePhoneNumberCountry/national"); +const sharedCost_1 = require("./availablePhoneNumberCountry/sharedCost"); +const tollFree_1 = require("./availablePhoneNumberCountry/tollFree"); +const voip_1 = require("./availablePhoneNumberCountry/voip"); +class AvailablePhoneNumberCountryContextImpl { + constructor(_version, accountSid, countryCode) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(countryCode)) { + throw new Error("Parameter 'countryCode' is not valid."); + } + this._solution = { accountSid, countryCode }; + this._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}.json`; + } + get local() { + this._local = + this._local || + (0, local_1.LocalListInstance)(this._version, this._solution.accountSid, this._solution.countryCode); + return this._local; + } + get machineToMachine() { + this._machineToMachine = + this._machineToMachine || + (0, machineToMachine_1.MachineToMachineListInstance)(this._version, this._solution.accountSid, this._solution.countryCode); + return this._machineToMachine; + } + get mobile() { + this._mobile = + this._mobile || + (0, mobile_1.MobileListInstance)(this._version, this._solution.accountSid, this._solution.countryCode); + return this._mobile; + } + get national() { + this._national = + this._national || + (0, national_1.NationalListInstance)(this._version, this._solution.accountSid, this._solution.countryCode); + return this._national; + } + get sharedCost() { + this._sharedCost = + this._sharedCost || + (0, sharedCost_1.SharedCostListInstance)(this._version, this._solution.accountSid, this._solution.countryCode); + return this._sharedCost; + } + get tollFree() { + this._tollFree = + this._tollFree || + (0, tollFree_1.TollFreeListInstance)(this._version, this._solution.accountSid, this._solution.countryCode); + return this._tollFree; + } + get voip() { + this._voip = + this._voip || + (0, voip_1.VoipListInstance)(this._version, this._solution.accountSid, this._solution.countryCode); + return this._voip; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AvailablePhoneNumberCountryInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.countryCode)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailablePhoneNumberCountryContextImpl = AvailablePhoneNumberCountryContextImpl; +class AvailablePhoneNumberCountryInstance { + constructor(_version, payload, accountSid, countryCode) { + this._version = _version; + this.countryCode = payload.country_code; + this.country = payload.country; + this.uri = payload.uri; + this.beta = payload.beta; + this.subresourceUris = payload.subresource_uris; + this._solution = { + accountSid, + countryCode: countryCode || this.countryCode, + }; + } + get _proxy() { + this._context = + this._context || + new AvailablePhoneNumberCountryContextImpl(this._version, this._solution.accountSid, this._solution.countryCode); + return this._context; + } + /** + * Fetch a AvailablePhoneNumberCountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailablePhoneNumberCountryInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the local. + */ + local() { + return this._proxy.local; + } + /** + * Access the machineToMachine. + */ + machineToMachine() { + return this._proxy.machineToMachine; + } + /** + * Access the mobile. + */ + mobile() { + return this._proxy.mobile; + } + /** + * Access the national. + */ + national() { + return this._proxy.national; + } + /** + * Access the sharedCost. + */ + sharedCost() { + return this._proxy.sharedCost; + } + /** + * Access the tollFree. + */ + tollFree() { + return this._proxy.tollFree; + } + /** + * Access the voip. + */ + voip() { + return this._proxy.voip; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + countryCode: this.countryCode, + country: this.country, + uri: this.uri, + beta: this.beta, + subresourceUris: this.subresourceUris, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailablePhoneNumberCountryInstance = AvailablePhoneNumberCountryInstance; +function AvailablePhoneNumberCountryListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((countryCode) => instance.get(countryCode)); + instance.get = function get(countryCode) { + return new AvailablePhoneNumberCountryContextImpl(version, accountSid, countryCode); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AvailablePhoneNumberCountryPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AvailablePhoneNumberCountryPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AvailablePhoneNumberCountryListInstance = AvailablePhoneNumberCountryListInstance; +class AvailablePhoneNumberCountryPage extends Page_1.default { + /** + * Initialize the AvailablePhoneNumberCountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AvailablePhoneNumberCountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AvailablePhoneNumberCountryInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailablePhoneNumberCountryPage = AvailablePhoneNumberCountryPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.d.ts new file mode 100644 index 00000000..4e9f89de --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +/** + * Options to pass to each + */ +export interface LocalListInstanceEachOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: LocalInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface LocalListInstanceOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface LocalListInstancePageOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface LocalSolution { + accountSid: string; + countryCode: string; +} +export interface LocalListInstance { + _version: V2010; + _solution: LocalSolution; + _uri: string; + /** + * Streams LocalInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LocalListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: LocalInstance, done: (err?: Error) => void) => void): void; + each(params: LocalListInstanceEachOptions, callback?: (item: LocalInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of LocalInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: LocalPage) => any): Promise; + /** + * Lists LocalInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LocalListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: LocalInstance[]) => any): Promise; + list(params: LocalListInstanceOptions, callback?: (error: Error | null, items: LocalInstance[]) => any): Promise; + /** + * Retrieve a single page of LocalInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LocalListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: LocalPage) => any): Promise; + page(params: LocalListInstancePageOptions, callback?: (error: Error | null, items: LocalPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function LocalListInstance(version: V2010, accountSid: string, countryCode: string): LocalListInstance; +interface LocalPayload extends TwilioResponsePayload { + available_phone_numbers: LocalResource[]; +} +interface LocalResource { + friendly_name: string; + phone_number: string; + lata: string; + locality: string; + rate_center: string; + latitude: number; + longitude: number; + region: string; + postal_code: string; + iso_country: string; + address_requirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; +} +export declare class LocalInstance { + protected _version: V2010; + constructor(_version: V2010, payload: LocalResource, accountSid: string, countryCode: string); + /** + * A formatted version of the phone number. + */ + friendlyName: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this phone number. Available for only phone numbers from the US and Canada. + */ + lata: string; + /** + * The locality or city of this phone number\'s location. + */ + locality: string; + /** + * The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone number. Available for only phone numbers from the US and Canada. + */ + rateCenter: string; + /** + * The latitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + latitude: number; + /** + * The longitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + longitude: number; + /** + * The two-letter state or province abbreviation of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + region: string; + /** + * The postal or ZIP code of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + postalCode: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this phone number. + */ + isoCountry: string; + /** + * The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no address is required. `any` means an address is required, but it can be anywhere in the world. `local` means an address in the phone number\'s country is required. `foreign` means an address outside of the phone number\'s country is required. + */ + addressRequirements: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + friendlyName: string; + phoneNumber: string; + lata: string; + locality: string; + rateCenter: string; + latitude: number; + longitude: number; + region: string; + postalCode: string; + isoCountry: string; + addressRequirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class LocalPage extends Page { + /** + * Initialize the LocalPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: LocalSolution); + /** + * Build an instance of LocalInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: LocalResource): LocalInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.js b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.js new file mode 100644 index 00000000..8822e17b --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LocalPage = exports.LocalInstance = exports.LocalListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function LocalListInstance(version, accountSid, countryCode) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(countryCode)) { + throw new Error("Parameter 'countryCode' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, countryCode }; + instance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/Local.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["areaCode"] !== undefined) + data["AreaCode"] = params["areaCode"]; + if (params["contains"] !== undefined) + data["Contains"] = params["contains"]; + if (params["smsEnabled"] !== undefined) + data["SmsEnabled"] = serialize.bool(params["smsEnabled"]); + if (params["mmsEnabled"] !== undefined) + data["MmsEnabled"] = serialize.bool(params["mmsEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["excludeAllAddressRequired"] !== undefined) + data["ExcludeAllAddressRequired"] = serialize.bool(params["excludeAllAddressRequired"]); + if (params["excludeLocalAddressRequired"] !== undefined) + data["ExcludeLocalAddressRequired"] = serialize.bool(params["excludeLocalAddressRequired"]); + if (params["excludeForeignAddressRequired"] !== undefined) + data["ExcludeForeignAddressRequired"] = serialize.bool(params["excludeForeignAddressRequired"]); + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["nearNumber"] !== undefined) + data["NearNumber"] = params["nearNumber"]; + if (params["nearLatLong"] !== undefined) + data["NearLatLong"] = params["nearLatLong"]; + if (params["distance"] !== undefined) + data["Distance"] = params["distance"]; + if (params["inPostalCode"] !== undefined) + data["InPostalCode"] = params["inPostalCode"]; + if (params["inRegion"] !== undefined) + data["InRegion"] = params["inRegion"]; + if (params["inRateCenter"] !== undefined) + data["InRateCenter"] = params["inRateCenter"]; + if (params["inLata"] !== undefined) + data["InLata"] = params["inLata"]; + if (params["inLocality"] !== undefined) + data["InLocality"] = params["inLocality"]; + if (params["faxEnabled"] !== undefined) + data["FaxEnabled"] = serialize.bool(params["faxEnabled"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new LocalPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new LocalPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.LocalListInstance = LocalListInstance; +class LocalInstance { + constructor(_version, payload, accountSid, countryCode) { + this._version = _version; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.lata = payload.lata; + this.locality = payload.locality; + this.rateCenter = payload.rate_center; + this.latitude = payload.latitude; + this.longitude = payload.longitude; + this.region = payload.region; + this.postalCode = payload.postal_code; + this.isoCountry = payload.iso_country; + this.addressRequirements = payload.address_requirements; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + lata: this.lata, + locality: this.locality, + rateCenter: this.rateCenter, + latitude: this.latitude, + longitude: this.longitude, + region: this.region, + postalCode: this.postalCode, + isoCountry: this.isoCountry, + addressRequirements: this.addressRequirements, + beta: this.beta, + capabilities: this.capabilities, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LocalInstance = LocalInstance; +class LocalPage extends Page_1.default { + /** + * Initialize the LocalPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of LocalInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new LocalInstance(this._version, payload, this._solution.accountSid, this._solution.countryCode); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LocalPage = LocalPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.d.ts new file mode 100644 index 00000000..7187bb49 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +/** + * Options to pass to each + */ +export interface MachineToMachineListInstanceEachOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MachineToMachineInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MachineToMachineListInstanceOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MachineToMachineListInstancePageOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MachineToMachineSolution { + accountSid: string; + countryCode: string; +} +export interface MachineToMachineListInstance { + _version: V2010; + _solution: MachineToMachineSolution; + _uri: string; + /** + * Streams MachineToMachineInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MachineToMachineListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MachineToMachineInstance, done: (err?: Error) => void) => void): void; + each(params: MachineToMachineListInstanceEachOptions, callback?: (item: MachineToMachineInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MachineToMachineInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MachineToMachinePage) => any): Promise; + /** + * Lists MachineToMachineInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MachineToMachineListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MachineToMachineInstance[]) => any): Promise; + list(params: MachineToMachineListInstanceOptions, callback?: (error: Error | null, items: MachineToMachineInstance[]) => any): Promise; + /** + * Retrieve a single page of MachineToMachineInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MachineToMachineListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MachineToMachinePage) => any): Promise; + page(params: MachineToMachineListInstancePageOptions, callback?: (error: Error | null, items: MachineToMachinePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MachineToMachineListInstance(version: V2010, accountSid: string, countryCode: string): MachineToMachineListInstance; +interface MachineToMachinePayload extends TwilioResponsePayload { + available_phone_numbers: MachineToMachineResource[]; +} +interface MachineToMachineResource { + friendly_name: string; + phone_number: string; + lata: string; + locality: string; + rate_center: string; + latitude: number; + longitude: number; + region: string; + postal_code: string; + iso_country: string; + address_requirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; +} +export declare class MachineToMachineInstance { + protected _version: V2010; + constructor(_version: V2010, payload: MachineToMachineResource, accountSid: string, countryCode: string); + /** + * A formatted version of the phone number. + */ + friendlyName: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this phone number. Available for only phone numbers from the US and Canada. + */ + lata: string; + /** + * The locality or city of this phone number\'s location. + */ + locality: string; + /** + * The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone number. Available for only phone numbers from the US and Canada. + */ + rateCenter: string; + /** + * The latitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + latitude: number; + /** + * The longitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + longitude: number; + /** + * The two-letter state or province abbreviation of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + region: string; + /** + * The postal or ZIP code of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + postalCode: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this phone number. + */ + isoCountry: string; + /** + * The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no address is required. `any` means an address is required, but it can be anywhere in the world. `local` means an address in the phone number\'s country is required. `foreign` means an address outside of the phone number\'s country is required. + */ + addressRequirements: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + friendlyName: string; + phoneNumber: string; + lata: string; + locality: string; + rateCenter: string; + latitude: number; + longitude: number; + region: string; + postalCode: string; + isoCountry: string; + addressRequirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class MachineToMachinePage extends Page { + /** + * Initialize the MachineToMachinePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: MachineToMachineSolution); + /** + * Build an instance of MachineToMachineInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MachineToMachineResource): MachineToMachineInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.js b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.js new file mode 100644 index 00000000..c91f2514 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MachineToMachinePage = exports.MachineToMachineInstance = exports.MachineToMachineListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function MachineToMachineListInstance(version, accountSid, countryCode) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(countryCode)) { + throw new Error("Parameter 'countryCode' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, countryCode }; + instance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/MachineToMachine.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["areaCode"] !== undefined) + data["AreaCode"] = params["areaCode"]; + if (params["contains"] !== undefined) + data["Contains"] = params["contains"]; + if (params["smsEnabled"] !== undefined) + data["SmsEnabled"] = serialize.bool(params["smsEnabled"]); + if (params["mmsEnabled"] !== undefined) + data["MmsEnabled"] = serialize.bool(params["mmsEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["excludeAllAddressRequired"] !== undefined) + data["ExcludeAllAddressRequired"] = serialize.bool(params["excludeAllAddressRequired"]); + if (params["excludeLocalAddressRequired"] !== undefined) + data["ExcludeLocalAddressRequired"] = serialize.bool(params["excludeLocalAddressRequired"]); + if (params["excludeForeignAddressRequired"] !== undefined) + data["ExcludeForeignAddressRequired"] = serialize.bool(params["excludeForeignAddressRequired"]); + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["nearNumber"] !== undefined) + data["NearNumber"] = params["nearNumber"]; + if (params["nearLatLong"] !== undefined) + data["NearLatLong"] = params["nearLatLong"]; + if (params["distance"] !== undefined) + data["Distance"] = params["distance"]; + if (params["inPostalCode"] !== undefined) + data["InPostalCode"] = params["inPostalCode"]; + if (params["inRegion"] !== undefined) + data["InRegion"] = params["inRegion"]; + if (params["inRateCenter"] !== undefined) + data["InRateCenter"] = params["inRateCenter"]; + if (params["inLata"] !== undefined) + data["InLata"] = params["inLata"]; + if (params["inLocality"] !== undefined) + data["InLocality"] = params["inLocality"]; + if (params["faxEnabled"] !== undefined) + data["FaxEnabled"] = serialize.bool(params["faxEnabled"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MachineToMachinePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MachineToMachinePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MachineToMachineListInstance = MachineToMachineListInstance; +class MachineToMachineInstance { + constructor(_version, payload, accountSid, countryCode) { + this._version = _version; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.lata = payload.lata; + this.locality = payload.locality; + this.rateCenter = payload.rate_center; + this.latitude = payload.latitude; + this.longitude = payload.longitude; + this.region = payload.region; + this.postalCode = payload.postal_code; + this.isoCountry = payload.iso_country; + this.addressRequirements = payload.address_requirements; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + lata: this.lata, + locality: this.locality, + rateCenter: this.rateCenter, + latitude: this.latitude, + longitude: this.longitude, + region: this.region, + postalCode: this.postalCode, + isoCountry: this.isoCountry, + addressRequirements: this.addressRequirements, + beta: this.beta, + capabilities: this.capabilities, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MachineToMachineInstance = MachineToMachineInstance; +class MachineToMachinePage extends Page_1.default { + /** + * Initialize the MachineToMachinePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MachineToMachineInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MachineToMachineInstance(this._version, payload, this._solution.accountSid, this._solution.countryCode); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MachineToMachinePage = MachineToMachinePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.d.ts new file mode 100644 index 00000000..2d4a733b --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +/** + * Options to pass to each + */ +export interface MobileListInstanceEachOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MobileInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MobileListInstanceOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MobileListInstancePageOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MobileSolution { + accountSid: string; + countryCode: string; +} +export interface MobileListInstance { + _version: V2010; + _solution: MobileSolution; + _uri: string; + /** + * Streams MobileInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MobileListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MobileInstance, done: (err?: Error) => void) => void): void; + each(params: MobileListInstanceEachOptions, callback?: (item: MobileInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MobileInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MobilePage) => any): Promise; + /** + * Lists MobileInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MobileListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MobileInstance[]) => any): Promise; + list(params: MobileListInstanceOptions, callback?: (error: Error | null, items: MobileInstance[]) => any): Promise; + /** + * Retrieve a single page of MobileInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MobileListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MobilePage) => any): Promise; + page(params: MobileListInstancePageOptions, callback?: (error: Error | null, items: MobilePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MobileListInstance(version: V2010, accountSid: string, countryCode: string): MobileListInstance; +interface MobilePayload extends TwilioResponsePayload { + available_phone_numbers: MobileResource[]; +} +interface MobileResource { + friendly_name: string; + phone_number: string; + lata: string; + locality: string; + rate_center: string; + latitude: number; + longitude: number; + region: string; + postal_code: string; + iso_country: string; + address_requirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; +} +export declare class MobileInstance { + protected _version: V2010; + constructor(_version: V2010, payload: MobileResource, accountSid: string, countryCode: string); + /** + * A formatted version of the phone number. + */ + friendlyName: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this phone number. Available for only phone numbers from the US and Canada. + */ + lata: string; + /** + * The locality or city of this phone number\'s location. + */ + locality: string; + /** + * The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone number. Available for only phone numbers from the US and Canada. + */ + rateCenter: string; + /** + * The latitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + latitude: number; + /** + * The longitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + longitude: number; + /** + * The two-letter state or province abbreviation of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + region: string; + /** + * The postal or ZIP code of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + postalCode: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this phone number. + */ + isoCountry: string; + /** + * The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no address is required. `any` means an address is required, but it can be anywhere in the world. `local` means an address in the phone number\'s country is required. `foreign` means an address outside of the phone number\'s country is required. + */ + addressRequirements: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + friendlyName: string; + phoneNumber: string; + lata: string; + locality: string; + rateCenter: string; + latitude: number; + longitude: number; + region: string; + postalCode: string; + isoCountry: string; + addressRequirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class MobilePage extends Page { + /** + * Initialize the MobilePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: MobileSolution); + /** + * Build an instance of MobileInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MobileResource): MobileInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.js b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.js new file mode 100644 index 00000000..ef8f7e1c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MobilePage = exports.MobileInstance = exports.MobileListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function MobileListInstance(version, accountSid, countryCode) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(countryCode)) { + throw new Error("Parameter 'countryCode' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, countryCode }; + instance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/Mobile.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["areaCode"] !== undefined) + data["AreaCode"] = params["areaCode"]; + if (params["contains"] !== undefined) + data["Contains"] = params["contains"]; + if (params["smsEnabled"] !== undefined) + data["SmsEnabled"] = serialize.bool(params["smsEnabled"]); + if (params["mmsEnabled"] !== undefined) + data["MmsEnabled"] = serialize.bool(params["mmsEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["excludeAllAddressRequired"] !== undefined) + data["ExcludeAllAddressRequired"] = serialize.bool(params["excludeAllAddressRequired"]); + if (params["excludeLocalAddressRequired"] !== undefined) + data["ExcludeLocalAddressRequired"] = serialize.bool(params["excludeLocalAddressRequired"]); + if (params["excludeForeignAddressRequired"] !== undefined) + data["ExcludeForeignAddressRequired"] = serialize.bool(params["excludeForeignAddressRequired"]); + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["nearNumber"] !== undefined) + data["NearNumber"] = params["nearNumber"]; + if (params["nearLatLong"] !== undefined) + data["NearLatLong"] = params["nearLatLong"]; + if (params["distance"] !== undefined) + data["Distance"] = params["distance"]; + if (params["inPostalCode"] !== undefined) + data["InPostalCode"] = params["inPostalCode"]; + if (params["inRegion"] !== undefined) + data["InRegion"] = params["inRegion"]; + if (params["inRateCenter"] !== undefined) + data["InRateCenter"] = params["inRateCenter"]; + if (params["inLata"] !== undefined) + data["InLata"] = params["inLata"]; + if (params["inLocality"] !== undefined) + data["InLocality"] = params["inLocality"]; + if (params["faxEnabled"] !== undefined) + data["FaxEnabled"] = serialize.bool(params["faxEnabled"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MobilePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MobilePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MobileListInstance = MobileListInstance; +class MobileInstance { + constructor(_version, payload, accountSid, countryCode) { + this._version = _version; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.lata = payload.lata; + this.locality = payload.locality; + this.rateCenter = payload.rate_center; + this.latitude = payload.latitude; + this.longitude = payload.longitude; + this.region = payload.region; + this.postalCode = payload.postal_code; + this.isoCountry = payload.iso_country; + this.addressRequirements = payload.address_requirements; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + lata: this.lata, + locality: this.locality, + rateCenter: this.rateCenter, + latitude: this.latitude, + longitude: this.longitude, + region: this.region, + postalCode: this.postalCode, + isoCountry: this.isoCountry, + addressRequirements: this.addressRequirements, + beta: this.beta, + capabilities: this.capabilities, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MobileInstance = MobileInstance; +class MobilePage extends Page_1.default { + /** + * Initialize the MobilePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MobileInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MobileInstance(this._version, payload, this._solution.accountSid, this._solution.countryCode); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MobilePage = MobilePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.d.ts new file mode 100644 index 00000000..8a566901 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +/** + * Options to pass to each + */ +export interface NationalListInstanceEachOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: NationalInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface NationalListInstanceOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface NationalListInstancePageOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface NationalSolution { + accountSid: string; + countryCode: string; +} +export interface NationalListInstance { + _version: V2010; + _solution: NationalSolution; + _uri: string; + /** + * Streams NationalInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NationalListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: NationalInstance, done: (err?: Error) => void) => void): void; + each(params: NationalListInstanceEachOptions, callback?: (item: NationalInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of NationalInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: NationalPage) => any): Promise; + /** + * Lists NationalInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NationalListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: NationalInstance[]) => any): Promise; + list(params: NationalListInstanceOptions, callback?: (error: Error | null, items: NationalInstance[]) => any): Promise; + /** + * Retrieve a single page of NationalInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NationalListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: NationalPage) => any): Promise; + page(params: NationalListInstancePageOptions, callback?: (error: Error | null, items: NationalPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NationalListInstance(version: V2010, accountSid: string, countryCode: string): NationalListInstance; +interface NationalPayload extends TwilioResponsePayload { + available_phone_numbers: NationalResource[]; +} +interface NationalResource { + friendly_name: string; + phone_number: string; + lata: string; + locality: string; + rate_center: string; + latitude: number; + longitude: number; + region: string; + postal_code: string; + iso_country: string; + address_requirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; +} +export declare class NationalInstance { + protected _version: V2010; + constructor(_version: V2010, payload: NationalResource, accountSid: string, countryCode: string); + /** + * A formatted version of the phone number. + */ + friendlyName: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this phone number. Available for only phone numbers from the US and Canada. + */ + lata: string; + /** + * The locality or city of this phone number\'s location. + */ + locality: string; + /** + * The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone number. Available for only phone numbers from the US and Canada. + */ + rateCenter: string; + /** + * The latitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + latitude: number; + /** + * The longitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + longitude: number; + /** + * The two-letter state or province abbreviation of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + region: string; + /** + * The postal or ZIP code of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + postalCode: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this phone number. + */ + isoCountry: string; + /** + * The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no address is required. `any` means an address is required, but it can be anywhere in the world. `local` means an address in the phone number\'s country is required. `foreign` means an address outside of the phone number\'s country is required. + */ + addressRequirements: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + friendlyName: string; + phoneNumber: string; + lata: string; + locality: string; + rateCenter: string; + latitude: number; + longitude: number; + region: string; + postalCode: string; + isoCountry: string; + addressRequirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class NationalPage extends Page { + /** + * Initialize the NationalPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: NationalSolution); + /** + * Build an instance of NationalInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: NationalResource): NationalInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.js b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.js new file mode 100644 index 00000000..407ffa77 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NationalPage = exports.NationalInstance = exports.NationalListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function NationalListInstance(version, accountSid, countryCode) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(countryCode)) { + throw new Error("Parameter 'countryCode' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, countryCode }; + instance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/National.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["areaCode"] !== undefined) + data["AreaCode"] = params["areaCode"]; + if (params["contains"] !== undefined) + data["Contains"] = params["contains"]; + if (params["smsEnabled"] !== undefined) + data["SmsEnabled"] = serialize.bool(params["smsEnabled"]); + if (params["mmsEnabled"] !== undefined) + data["MmsEnabled"] = serialize.bool(params["mmsEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["excludeAllAddressRequired"] !== undefined) + data["ExcludeAllAddressRequired"] = serialize.bool(params["excludeAllAddressRequired"]); + if (params["excludeLocalAddressRequired"] !== undefined) + data["ExcludeLocalAddressRequired"] = serialize.bool(params["excludeLocalAddressRequired"]); + if (params["excludeForeignAddressRequired"] !== undefined) + data["ExcludeForeignAddressRequired"] = serialize.bool(params["excludeForeignAddressRequired"]); + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["nearNumber"] !== undefined) + data["NearNumber"] = params["nearNumber"]; + if (params["nearLatLong"] !== undefined) + data["NearLatLong"] = params["nearLatLong"]; + if (params["distance"] !== undefined) + data["Distance"] = params["distance"]; + if (params["inPostalCode"] !== undefined) + data["InPostalCode"] = params["inPostalCode"]; + if (params["inRegion"] !== undefined) + data["InRegion"] = params["inRegion"]; + if (params["inRateCenter"] !== undefined) + data["InRateCenter"] = params["inRateCenter"]; + if (params["inLata"] !== undefined) + data["InLata"] = params["inLata"]; + if (params["inLocality"] !== undefined) + data["InLocality"] = params["inLocality"]; + if (params["faxEnabled"] !== undefined) + data["FaxEnabled"] = serialize.bool(params["faxEnabled"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NationalPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new NationalPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NationalListInstance = NationalListInstance; +class NationalInstance { + constructor(_version, payload, accountSid, countryCode) { + this._version = _version; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.lata = payload.lata; + this.locality = payload.locality; + this.rateCenter = payload.rate_center; + this.latitude = payload.latitude; + this.longitude = payload.longitude; + this.region = payload.region; + this.postalCode = payload.postal_code; + this.isoCountry = payload.iso_country; + this.addressRequirements = payload.address_requirements; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + lata: this.lata, + locality: this.locality, + rateCenter: this.rateCenter, + latitude: this.latitude, + longitude: this.longitude, + region: this.region, + postalCode: this.postalCode, + isoCountry: this.isoCountry, + addressRequirements: this.addressRequirements, + beta: this.beta, + capabilities: this.capabilities, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NationalInstance = NationalInstance; +class NationalPage extends Page_1.default { + /** + * Initialize the NationalPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of NationalInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new NationalInstance(this._version, payload, this._solution.accountSid, this._solution.countryCode); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NationalPage = NationalPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.d.ts new file mode 100644 index 00000000..eedd41ce --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +/** + * Options to pass to each + */ +export interface SharedCostListInstanceEachOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SharedCostInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SharedCostListInstanceOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SharedCostListInstancePageOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SharedCostSolution { + accountSid: string; + countryCode: string; +} +export interface SharedCostListInstance { + _version: V2010; + _solution: SharedCostSolution; + _uri: string; + /** + * Streams SharedCostInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SharedCostListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SharedCostInstance, done: (err?: Error) => void) => void): void; + each(params: SharedCostListInstanceEachOptions, callback?: (item: SharedCostInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SharedCostInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SharedCostPage) => any): Promise; + /** + * Lists SharedCostInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SharedCostListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SharedCostInstance[]) => any): Promise; + list(params: SharedCostListInstanceOptions, callback?: (error: Error | null, items: SharedCostInstance[]) => any): Promise; + /** + * Retrieve a single page of SharedCostInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SharedCostListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SharedCostPage) => any): Promise; + page(params: SharedCostListInstancePageOptions, callback?: (error: Error | null, items: SharedCostPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SharedCostListInstance(version: V2010, accountSid: string, countryCode: string): SharedCostListInstance; +interface SharedCostPayload extends TwilioResponsePayload { + available_phone_numbers: SharedCostResource[]; +} +interface SharedCostResource { + friendly_name: string; + phone_number: string; + lata: string; + locality: string; + rate_center: string; + latitude: number; + longitude: number; + region: string; + postal_code: string; + iso_country: string; + address_requirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; +} +export declare class SharedCostInstance { + protected _version: V2010; + constructor(_version: V2010, payload: SharedCostResource, accountSid: string, countryCode: string); + /** + * A formatted version of the phone number. + */ + friendlyName: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this phone number. Available for only phone numbers from the US and Canada. + */ + lata: string; + /** + * The locality or city of this phone number\'s location. + */ + locality: string; + /** + * The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone number. Available for only phone numbers from the US and Canada. + */ + rateCenter: string; + /** + * The latitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + latitude: number; + /** + * The longitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + longitude: number; + /** + * The two-letter state or province abbreviation of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + region: string; + /** + * The postal or ZIP code of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + postalCode: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this phone number. + */ + isoCountry: string; + /** + * The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no address is required. `any` means an address is required, but it can be anywhere in the world. `local` means an address in the phone number\'s country is required. `foreign` means an address outside of the phone number\'s country is required. + */ + addressRequirements: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + friendlyName: string; + phoneNumber: string; + lata: string; + locality: string; + rateCenter: string; + latitude: number; + longitude: number; + region: string; + postalCode: string; + isoCountry: string; + addressRequirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class SharedCostPage extends Page { + /** + * Initialize the SharedCostPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: SharedCostSolution); + /** + * Build an instance of SharedCostInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SharedCostResource): SharedCostInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.js b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.js new file mode 100644 index 00000000..aac84f49 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SharedCostPage = exports.SharedCostInstance = exports.SharedCostListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function SharedCostListInstance(version, accountSid, countryCode) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(countryCode)) { + throw new Error("Parameter 'countryCode' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, countryCode }; + instance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/SharedCost.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["areaCode"] !== undefined) + data["AreaCode"] = params["areaCode"]; + if (params["contains"] !== undefined) + data["Contains"] = params["contains"]; + if (params["smsEnabled"] !== undefined) + data["SmsEnabled"] = serialize.bool(params["smsEnabled"]); + if (params["mmsEnabled"] !== undefined) + data["MmsEnabled"] = serialize.bool(params["mmsEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["excludeAllAddressRequired"] !== undefined) + data["ExcludeAllAddressRequired"] = serialize.bool(params["excludeAllAddressRequired"]); + if (params["excludeLocalAddressRequired"] !== undefined) + data["ExcludeLocalAddressRequired"] = serialize.bool(params["excludeLocalAddressRequired"]); + if (params["excludeForeignAddressRequired"] !== undefined) + data["ExcludeForeignAddressRequired"] = serialize.bool(params["excludeForeignAddressRequired"]); + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["nearNumber"] !== undefined) + data["NearNumber"] = params["nearNumber"]; + if (params["nearLatLong"] !== undefined) + data["NearLatLong"] = params["nearLatLong"]; + if (params["distance"] !== undefined) + data["Distance"] = params["distance"]; + if (params["inPostalCode"] !== undefined) + data["InPostalCode"] = params["inPostalCode"]; + if (params["inRegion"] !== undefined) + data["InRegion"] = params["inRegion"]; + if (params["inRateCenter"] !== undefined) + data["InRateCenter"] = params["inRateCenter"]; + if (params["inLata"] !== undefined) + data["InLata"] = params["inLata"]; + if (params["inLocality"] !== undefined) + data["InLocality"] = params["inLocality"]; + if (params["faxEnabled"] !== undefined) + data["FaxEnabled"] = serialize.bool(params["faxEnabled"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SharedCostPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SharedCostPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SharedCostListInstance = SharedCostListInstance; +class SharedCostInstance { + constructor(_version, payload, accountSid, countryCode) { + this._version = _version; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.lata = payload.lata; + this.locality = payload.locality; + this.rateCenter = payload.rate_center; + this.latitude = payload.latitude; + this.longitude = payload.longitude; + this.region = payload.region; + this.postalCode = payload.postal_code; + this.isoCountry = payload.iso_country; + this.addressRequirements = payload.address_requirements; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + lata: this.lata, + locality: this.locality, + rateCenter: this.rateCenter, + latitude: this.latitude, + longitude: this.longitude, + region: this.region, + postalCode: this.postalCode, + isoCountry: this.isoCountry, + addressRequirements: this.addressRequirements, + beta: this.beta, + capabilities: this.capabilities, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SharedCostInstance = SharedCostInstance; +class SharedCostPage extends Page_1.default { + /** + * Initialize the SharedCostPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SharedCostInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SharedCostInstance(this._version, payload, this._solution.accountSid, this._solution.countryCode); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SharedCostPage = SharedCostPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.d.ts new file mode 100644 index 00000000..b7ec3231 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +/** + * Options to pass to each + */ +export interface TollFreeListInstanceEachOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TollFreeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TollFreeListInstanceOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TollFreeListInstancePageOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TollFreeSolution { + accountSid: string; + countryCode: string; +} +export interface TollFreeListInstance { + _version: V2010; + _solution: TollFreeSolution; + _uri: string; + /** + * Streams TollFreeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollFreeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TollFreeInstance, done: (err?: Error) => void) => void): void; + each(params: TollFreeListInstanceEachOptions, callback?: (item: TollFreeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TollFreeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TollFreePage) => any): Promise; + /** + * Lists TollFreeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollFreeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TollFreeInstance[]) => any): Promise; + list(params: TollFreeListInstanceOptions, callback?: (error: Error | null, items: TollFreeInstance[]) => any): Promise; + /** + * Retrieve a single page of TollFreeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollFreeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TollFreePage) => any): Promise; + page(params: TollFreeListInstancePageOptions, callback?: (error: Error | null, items: TollFreePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TollFreeListInstance(version: V2010, accountSid: string, countryCode: string): TollFreeListInstance; +interface TollFreePayload extends TwilioResponsePayload { + available_phone_numbers: TollFreeResource[]; +} +interface TollFreeResource { + friendly_name: string; + phone_number: string; + lata: string; + locality: string; + rate_center: string; + latitude: number; + longitude: number; + region: string; + postal_code: string; + iso_country: string; + address_requirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; +} +export declare class TollFreeInstance { + protected _version: V2010; + constructor(_version: V2010, payload: TollFreeResource, accountSid: string, countryCode: string); + /** + * A formatted version of the phone number. + */ + friendlyName: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this phone number. Available for only phone numbers from the US and Canada. + */ + lata: string; + /** + * The locality or city of this phone number\'s location. + */ + locality: string; + /** + * The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone number. Available for only phone numbers from the US and Canada. + */ + rateCenter: string; + /** + * The latitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + latitude: number; + /** + * The longitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + longitude: number; + /** + * The two-letter state or province abbreviation of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + region: string; + /** + * The postal or ZIP code of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + postalCode: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this phone number. + */ + isoCountry: string; + /** + * The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no address is required. `any` means an address is required, but it can be anywhere in the world. `local` means an address in the phone number\'s country is required. `foreign` means an address outside of the phone number\'s country is required. + */ + addressRequirements: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + friendlyName: string; + phoneNumber: string; + lata: string; + locality: string; + rateCenter: string; + latitude: number; + longitude: number; + region: string; + postalCode: string; + isoCountry: string; + addressRequirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class TollFreePage extends Page { + /** + * Initialize the TollFreePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: TollFreeSolution); + /** + * Build an instance of TollFreeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TollFreeResource): TollFreeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.js b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.js new file mode 100644 index 00000000..9430fb27 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TollFreePage = exports.TollFreeInstance = exports.TollFreeListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function TollFreeListInstance(version, accountSid, countryCode) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(countryCode)) { + throw new Error("Parameter 'countryCode' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, countryCode }; + instance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/TollFree.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["areaCode"] !== undefined) + data["AreaCode"] = params["areaCode"]; + if (params["contains"] !== undefined) + data["Contains"] = params["contains"]; + if (params["smsEnabled"] !== undefined) + data["SmsEnabled"] = serialize.bool(params["smsEnabled"]); + if (params["mmsEnabled"] !== undefined) + data["MmsEnabled"] = serialize.bool(params["mmsEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["excludeAllAddressRequired"] !== undefined) + data["ExcludeAllAddressRequired"] = serialize.bool(params["excludeAllAddressRequired"]); + if (params["excludeLocalAddressRequired"] !== undefined) + data["ExcludeLocalAddressRequired"] = serialize.bool(params["excludeLocalAddressRequired"]); + if (params["excludeForeignAddressRequired"] !== undefined) + data["ExcludeForeignAddressRequired"] = serialize.bool(params["excludeForeignAddressRequired"]); + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["nearNumber"] !== undefined) + data["NearNumber"] = params["nearNumber"]; + if (params["nearLatLong"] !== undefined) + data["NearLatLong"] = params["nearLatLong"]; + if (params["distance"] !== undefined) + data["Distance"] = params["distance"]; + if (params["inPostalCode"] !== undefined) + data["InPostalCode"] = params["inPostalCode"]; + if (params["inRegion"] !== undefined) + data["InRegion"] = params["inRegion"]; + if (params["inRateCenter"] !== undefined) + data["InRateCenter"] = params["inRateCenter"]; + if (params["inLata"] !== undefined) + data["InLata"] = params["inLata"]; + if (params["inLocality"] !== undefined) + data["InLocality"] = params["inLocality"]; + if (params["faxEnabled"] !== undefined) + data["FaxEnabled"] = serialize.bool(params["faxEnabled"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TollFreePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TollFreePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TollFreeListInstance = TollFreeListInstance; +class TollFreeInstance { + constructor(_version, payload, accountSid, countryCode) { + this._version = _version; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.lata = payload.lata; + this.locality = payload.locality; + this.rateCenter = payload.rate_center; + this.latitude = payload.latitude; + this.longitude = payload.longitude; + this.region = payload.region; + this.postalCode = payload.postal_code; + this.isoCountry = payload.iso_country; + this.addressRequirements = payload.address_requirements; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + lata: this.lata, + locality: this.locality, + rateCenter: this.rateCenter, + latitude: this.latitude, + longitude: this.longitude, + region: this.region, + postalCode: this.postalCode, + isoCountry: this.isoCountry, + addressRequirements: this.addressRequirements, + beta: this.beta, + capabilities: this.capabilities, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TollFreeInstance = TollFreeInstance; +class TollFreePage extends Page_1.default { + /** + * Initialize the TollFreePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TollFreeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TollFreeInstance(this._version, payload, this._solution.accountSid, this._solution.countryCode); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TollFreePage = TollFreePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.d.ts new file mode 100644 index 00000000..fc818287 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +/** + * Options to pass to each + */ +export interface VoipListInstanceEachOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: VoipInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface VoipListInstanceOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface VoipListInstancePageOptions { + /** The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. */ + areaCode?: number; + /** The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. */ + contains?: string; + /** Whether the phone numbers can receive text messages. Can be: `true` or `false`. */ + smsEnabled?: boolean; + /** Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. */ + mmsEnabled?: boolean; + /** Whether the phone numbers can receive calls. Can be: `true` or `false`. */ + voiceEnabled?: boolean; + /** Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeAllAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeLocalAddressRequired?: boolean; + /** Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. */ + excludeForeignAddressRequired?: boolean; + /** Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. */ + nearNumber?: string; + /** Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. */ + nearLatLong?: string; + /** The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. */ + distance?: number; + /** Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. */ + inPostalCode?: string; + /** Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. */ + inRegion?: string; + /** Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. */ + inRateCenter?: string; + /** Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. */ + inLata?: string; + /** Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. */ + inLocality?: string; + /** Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ + faxEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface VoipSolution { + accountSid: string; + countryCode: string; +} +export interface VoipListInstance { + _version: V2010; + _solution: VoipSolution; + _uri: string; + /** + * Streams VoipInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VoipListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: VoipInstance, done: (err?: Error) => void) => void): void; + each(params: VoipListInstanceEachOptions, callback?: (item: VoipInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of VoipInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: VoipPage) => any): Promise; + /** + * Lists VoipInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VoipListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: VoipInstance[]) => any): Promise; + list(params: VoipListInstanceOptions, callback?: (error: Error | null, items: VoipInstance[]) => any): Promise; + /** + * Retrieve a single page of VoipInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VoipListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: VoipPage) => any): Promise; + page(params: VoipListInstancePageOptions, callback?: (error: Error | null, items: VoipPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function VoipListInstance(version: V2010, accountSid: string, countryCode: string): VoipListInstance; +interface VoipPayload extends TwilioResponsePayload { + available_phone_numbers: VoipResource[]; +} +interface VoipResource { + friendly_name: string; + phone_number: string; + lata: string; + locality: string; + rate_center: string; + latitude: number; + longitude: number; + region: string; + postal_code: string; + iso_country: string; + address_requirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; +} +export declare class VoipInstance { + protected _version: V2010; + constructor(_version: V2010, payload: VoipResource, accountSid: string, countryCode: string); + /** + * A formatted version of the phone number. + */ + friendlyName: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) of this phone number. Available for only phone numbers from the US and Canada. + */ + lata: string; + /** + * The locality or city of this phone number\'s location. + */ + locality: string; + /** + * The [rate center](https://en.wikipedia.org/wiki/Telephone_exchange) of this phone number. Available for only phone numbers from the US and Canada. + */ + rateCenter: string; + /** + * The latitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + latitude: number; + /** + * The longitude of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + longitude: number; + /** + * The two-letter state or province abbreviation of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + region: string; + /** + * The postal or ZIP code of this phone number\'s location. Available for only phone numbers from the US and Canada. + */ + postalCode: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of this phone number. + */ + isoCountry: string; + /** + * The type of [Address](https://www.twilio.com/docs/usage/api/address) resource the phone number requires. Can be: `none`, `any`, `local`, or `foreign`. `none` means no address is required. `any` means an address is required, but it can be anywhere in the world. `local` means an address in the phone number\'s country is required. `foreign` means an address outside of the phone number\'s country is required. + */ + addressRequirements: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + friendlyName: string; + phoneNumber: string; + lata: string; + locality: string; + rateCenter: string; + latitude: number; + longitude: number; + region: string; + postalCode: string; + isoCountry: string; + addressRequirements: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class VoipPage extends Page { + /** + * Initialize the VoipPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: VoipSolution); + /** + * Build an instance of VoipInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: VoipResource): VoipInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.js b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.js new file mode 100644 index 00000000..c70ea032 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VoipPage = exports.VoipInstance = exports.VoipListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function VoipListInstance(version, accountSid, countryCode) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(countryCode)) { + throw new Error("Parameter 'countryCode' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, countryCode }; + instance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/Voip.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["areaCode"] !== undefined) + data["AreaCode"] = params["areaCode"]; + if (params["contains"] !== undefined) + data["Contains"] = params["contains"]; + if (params["smsEnabled"] !== undefined) + data["SmsEnabled"] = serialize.bool(params["smsEnabled"]); + if (params["mmsEnabled"] !== undefined) + data["MmsEnabled"] = serialize.bool(params["mmsEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["excludeAllAddressRequired"] !== undefined) + data["ExcludeAllAddressRequired"] = serialize.bool(params["excludeAllAddressRequired"]); + if (params["excludeLocalAddressRequired"] !== undefined) + data["ExcludeLocalAddressRequired"] = serialize.bool(params["excludeLocalAddressRequired"]); + if (params["excludeForeignAddressRequired"] !== undefined) + data["ExcludeForeignAddressRequired"] = serialize.bool(params["excludeForeignAddressRequired"]); + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["nearNumber"] !== undefined) + data["NearNumber"] = params["nearNumber"]; + if (params["nearLatLong"] !== undefined) + data["NearLatLong"] = params["nearLatLong"]; + if (params["distance"] !== undefined) + data["Distance"] = params["distance"]; + if (params["inPostalCode"] !== undefined) + data["InPostalCode"] = params["inPostalCode"]; + if (params["inRegion"] !== undefined) + data["InRegion"] = params["inRegion"]; + if (params["inRateCenter"] !== undefined) + data["InRateCenter"] = params["inRateCenter"]; + if (params["inLata"] !== undefined) + data["InLata"] = params["inLata"]; + if (params["inLocality"] !== undefined) + data["InLocality"] = params["inLocality"]; + if (params["faxEnabled"] !== undefined) + data["FaxEnabled"] = serialize.bool(params["faxEnabled"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VoipPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new VoipPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.VoipListInstance = VoipListInstance; +class VoipInstance { + constructor(_version, payload, accountSid, countryCode) { + this._version = _version; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.lata = payload.lata; + this.locality = payload.locality; + this.rateCenter = payload.rate_center; + this.latitude = payload.latitude; + this.longitude = payload.longitude; + this.region = payload.region; + this.postalCode = payload.postal_code; + this.isoCountry = payload.iso_country; + this.addressRequirements = payload.address_requirements; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + lata: this.lata, + locality: this.locality, + rateCenter: this.rateCenter, + latitude: this.latitude, + longitude: this.longitude, + region: this.region, + postalCode: this.postalCode, + isoCountry: this.isoCountry, + addressRequirements: this.addressRequirements, + beta: this.beta, + capabilities: this.capabilities, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VoipInstance = VoipInstance; +class VoipPage extends Page_1.default { + /** + * Initialize the VoipPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of VoipInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new VoipInstance(this._version, payload, this._solution.accountSid, this._solution.countryCode); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VoipPage = VoipPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/balance.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/balance.d.ts new file mode 100644 index 00000000..921afe3c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/balance.d.ts @@ -0,0 +1,58 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../V2010"; +export interface BalanceSolution { + accountSid: string; +} +export interface BalanceListInstance { + _version: V2010; + _solution: BalanceSolution; + _uri: string; + /** + * Fetch a BalanceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BalanceInstance + */ + fetch(callback?: (error: Error | null, item?: BalanceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BalanceListInstance(version: V2010, accountSid: string): BalanceListInstance; +interface BalanceResource { + account_sid: string; + balance: string; + currency: string; +} +export declare class BalanceInstance { + protected _version: V2010; + constructor(_version: V2010, payload: BalanceResource, accountSid: string); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The balance of the Account, in units specified by the unit parameter. Balance changes may not be reflected immediately. Child accounts do not contain balance information + */ + balance: string; + /** + * The units of currency for the account balance + */ + currency: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + balance: string; + currency: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/balance.js b/node_modules/twilio/lib/rest/api/v2010/account/balance.js new file mode 100644 index 00000000..4460e4cd --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/balance.js @@ -0,0 +1,70 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BalanceInstance = exports.BalanceListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function BalanceListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Balance.json`; + instance.fetch = function fetch(callback) { + let operationVersion = version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BalanceInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BalanceListInstance = BalanceListInstance; +class BalanceInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.balance = payload.balance; + this.currency = payload.currency; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + balance: this.balance, + currency: this.currency, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BalanceInstance = BalanceInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call.d.ts new file mode 100644 index 00000000..91ddf8b9 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call.d.ts @@ -0,0 +1,633 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +import { EventListInstance } from "./call/event"; +import { FeedbackListInstance } from "./call/feedback"; +import { FeedbackSummaryListInstance } from "./call/feedbackSummary"; +import { NotificationListInstance } from "./call/notification"; +import { PaymentListInstance } from "./call/payment"; +import { RecordingListInstance } from "./call/recording"; +import { SiprecListInstance } from "./call/siprec"; +import { StreamListInstance } from "./call/stream"; +import { UserDefinedMessageListInstance } from "./call/userDefinedMessage"; +import { UserDefinedMessageSubscriptionListInstance } from "./call/userDefinedMessageSubscription"; +import TwiML from "../../../../twiml/TwiML"; +export type CallStatus = "queued" | "ringing" | "in-progress" | "completed" | "busy" | "failed" | "no-answer" | "canceled"; +export type CallUpdateStatus = "canceled" | "completed"; +/** + * Options to pass to update a CallInstance + */ +export interface CallContextUpdateOptions { + /** The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). */ + url?: string; + /** The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. */ + method?: string; + /** */ + status?: CallUpdateStatus; + /** The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. */ + fallbackUrl?: string; + /** The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. */ + fallbackMethod?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). */ + statusCallback?: string; + /** The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. */ + statusCallbackMethod?: string; + /** TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive */ + twiml?: TwiML | string; + /** The maximum duration of the call in seconds. Constraints depend on account and configuration. */ + timeLimit?: number; +} +/** + * Options to pass to create a CallInstance + */ +export interface CallListInstanceCreateOptions { + /** The phone number, SIP address, or client identifier to call. */ + to: string; + /** The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number. */ + from: string; + /** The HTTP method we should use when calling the `url` parameter\\\'s value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. */ + method?: string; + /** The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. */ + fallbackUrl?: string; + /** The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. */ + fallbackMethod?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). */ + statusCallback?: string; + /** The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. */ + statusCallbackEvent?: Array; + /** The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. */ + statusCallbackMethod?: string; + /** A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), \\\'`#`\\\', \\\'`*`\\\' and \\\'`w`\\\', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the \\\'`#`\\\' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. */ + sendDigits?: string; + /** The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. */ + timeout?: number; + /** Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. */ + record?: boolean; + /** The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. */ + recordingChannels?: string; + /** The URL that we call when the recording is available to be accessed. */ + recordingStatusCallback?: string; + /** The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. */ + recordingStatusCallbackMethod?: string; + /** The username used to authenticate the caller making a SIP call. */ + sipAuthUsername?: string; + /** The password required to authenticate the user account specified in `sip_auth_username`. */ + sipAuthPassword?: string; + /** Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). */ + machineDetection?: string; + /** The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. */ + machineDetectionTimeout?: number; + /** The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. */ + recordingStatusCallbackEvent?: Array; + /** Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. */ + trim?: string; + /** The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. */ + callerId?: string; + /** The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. */ + machineDetectionSpeechThreshold?: number; + /** The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. */ + machineDetectionSpeechEndThreshold?: number; + /** The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. */ + machineDetectionSilenceTimeout?: number; + /** Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. */ + asyncAmd?: string; + /** The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. */ + asyncAmdStatusCallback?: string; + /** The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. */ + asyncAmdStatusCallbackMethod?: string; + /** The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) */ + byoc?: string; + /** The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party\\\'s phone. (Branded Calls Beta) */ + callReason?: string; + /** A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call\\\'s call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. */ + callToken?: string; + /** The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. */ + recordingTrack?: string; + /** The maximum duration of the call in seconds. Constraints depend on account and configuration. */ + timeLimit?: number; + /** The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). */ + url?: string; + /** TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. */ + twiml?: TwiML | string; + /** The SID of the Application resource that will handle the call, if the call will be handled by an application. */ + applicationSid?: string; +} +/** + * Options to pass to each + */ +export interface CallListInstanceEachOptions { + /** Only show calls made to this phone number, SIP address, Client identifier or SIM SID. */ + to?: string; + /** Only include calls from this phone number, SIP address, Client identifier or SIM SID. */ + from?: string; + /** Only include calls spawned by calls with this SID. */ + parentCallSid?: string; + /** The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. */ + status?: CallStatus; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTime?: Date; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTimeBefore?: Date; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTimeAfter?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTime?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTimeBefore?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTimeAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CallInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CallListInstanceOptions { + /** Only show calls made to this phone number, SIP address, Client identifier or SIM SID. */ + to?: string; + /** Only include calls from this phone number, SIP address, Client identifier or SIM SID. */ + from?: string; + /** Only include calls spawned by calls with this SID. */ + parentCallSid?: string; + /** The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. */ + status?: CallStatus; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTime?: Date; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTimeBefore?: Date; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTimeAfter?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTime?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTimeBefore?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTimeAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CallListInstancePageOptions { + /** Only show calls made to this phone number, SIP address, Client identifier or SIM SID. */ + to?: string; + /** Only include calls from this phone number, SIP address, Client identifier or SIM SID. */ + from?: string; + /** Only include calls spawned by calls with this SID. */ + parentCallSid?: string; + /** The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. */ + status?: CallStatus; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTime?: Date; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTimeBefore?: Date; + /** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */ + startTimeAfter?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTime?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTimeBefore?: Date; + /** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ + endTimeAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CallContext { + events: EventListInstance; + feedback: FeedbackListInstance; + notifications: NotificationListInstance; + payments: PaymentListInstance; + recordings: RecordingListInstance; + siprec: SiprecListInstance; + streams: StreamListInstance; + userDefinedMessages: UserDefinedMessageListInstance; + userDefinedMessageSubscriptions: UserDefinedMessageSubscriptionListInstance; + /** + * Remove a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + fetch(callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Update a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + update(callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Update a CallInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + update(params: CallContextUpdateOptions, callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CallContextSolution { + accountSid: string; + sid: string; +} +export declare class CallContextImpl implements CallContext { + protected _version: V2010; + protected _solution: CallContextSolution; + protected _uri: string; + protected _events?: EventListInstance; + protected _feedback?: FeedbackListInstance; + protected _notifications?: NotificationListInstance; + protected _payments?: PaymentListInstance; + protected _recordings?: RecordingListInstance; + protected _siprec?: SiprecListInstance; + protected _streams?: StreamListInstance; + protected _userDefinedMessages?: UserDefinedMessageListInstance; + protected _userDefinedMessageSubscriptions?: UserDefinedMessageSubscriptionListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get events(): EventListInstance; + get feedback(): FeedbackListInstance; + get notifications(): NotificationListInstance; + get payments(): PaymentListInstance; + get recordings(): RecordingListInstance; + get siprec(): SiprecListInstance; + get streams(): StreamListInstance; + get userDefinedMessages(): UserDefinedMessageListInstance; + get userDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CallInstance) => any): Promise; + update(params?: CallContextUpdateOptions | ((error: Error | null, item?: CallInstance) => any), callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CallContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CallPayload extends TwilioResponsePayload { + calls: CallResource[]; +} +interface CallResource { + sid: string; + date_created: Date; + date_updated: Date; + parent_call_sid: string; + account_sid: string; + to: string; + to_formatted: string; + from: string; + from_formatted: string; + phone_number_sid: string; + status: CallStatus; + start_time: Date; + end_time: Date; + duration: string; + price: string; + price_unit: string; + direction: string; + answered_by: string; + api_version: string; + forwarded_from: string; + group_sid: string; + caller_name: string; + queue_time: string; + trunk_sid: string; + uri: string; + subresource_uris: Record; +} +export declare class CallInstance { + protected _version: V2010; + protected _solution: CallContextSolution; + protected _context?: CallContext; + constructor(_version: V2010, payload: CallResource, accountSid: string, sid?: string); + /** + * The unique string that we created to identify this Call resource. + */ + sid: string; + /** + * The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The SID that identifies the call that created this leg. + */ + parentCallSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Call resource. + */ + accountSid: string; + /** + * The phone number, SIP address, Client identifier or SIM SID that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. SIM SIDs are formatted as `sim:sid`. + */ + to: string; + /** + * The phone number, SIP address or Client identifier that received this call. Formatted for display. Non-North American phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750). + */ + toFormatted: string; + /** + * The phone number, SIP address, Client identifier or SIM SID that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. SIM SIDs are formatted as `sim:sid`. + */ + from: string; + /** + * The calling phone number, SIP address, or Client identifier formatted for display. Non-North American phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750). + */ + fromFormatted: string; + /** + * If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed. + */ + phoneNumberSid: string; + status: CallStatus; + /** + * The start time of the call, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call has not yet been dialed. + */ + startTime: Date; + /** + * The time the call ended, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call did not complete successfully. + */ + endTime: Date; + /** + * The length of the call in seconds. This value is empty for busy, failed, unanswered, or ongoing calls. + */ + duration: string; + /** + * The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. + */ + price: string; + /** + * The currency in which `Price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g., `USD`, `EUR`, `JPY`). Always capitalized for calls. + */ + priceUnit: string; + /** + * A string describing the direction of the call. Can be: `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `` verb. Using [Elastic SIP Trunking](https://www.twilio.com/docs/sip-trunking), the values can be [`trunking-terminating`](https://www.twilio.com/docs/sip-trunking#termination) for outgoing calls from your communications infrastructure to the PSTN or [`trunking-originating`](https://www.twilio.com/docs/sip-trunking#origination) for incoming calls to your communications infrastructure from the PSTN. + */ + direction: string; + /** + * Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise. + */ + answeredBy: string; + /** + * The API version used to create the call. + */ + apiVersion: string; + /** + * The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty. + */ + forwardedFrom: string; + /** + * The Group SID associated with this call. If no Group is associated with the call, the field is empty. + */ + groupSid: string; + /** + * The caller\'s name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty. + */ + callerName: string; + /** + * The wait time in milliseconds before the call is placed. + */ + queueTime: string; + /** + * The unique identifier of the trunk resource that was used for this call. The field is empty if the call was not made using a SIP trunk or if the call is not terminated. + */ + trunkSid: string; + /** + * The URI of this resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * A list of subresources available to this call, identified by their URIs relative to `https://api.twilio.com`. + */ + subresourceUris: Record; + private get _proxy(); + /** + * Remove a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + fetch(callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Update a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + update(callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Update a CallInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + update(params: CallContextUpdateOptions, callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Access the events. + */ + events(): EventListInstance; + /** + * Access the feedback. + */ + feedback(): FeedbackListInstance; + /** + * Access the notifications. + */ + notifications(): NotificationListInstance; + /** + * Access the payments. + */ + payments(): PaymentListInstance; + /** + * Access the recordings. + */ + recordings(): RecordingListInstance; + /** + * Access the siprec. + */ + siprec(): SiprecListInstance; + /** + * Access the streams. + */ + streams(): StreamListInstance; + /** + * Access the userDefinedMessages. + */ + userDefinedMessages(): UserDefinedMessageListInstance; + /** + * Access the userDefinedMessageSubscriptions. + */ + userDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + dateCreated: Date; + dateUpdated: Date; + parentCallSid: string; + accountSid: string; + to: string; + toFormatted: string; + from: string; + fromFormatted: string; + phoneNumberSid: string; + status: CallStatus; + startTime: Date; + endTime: Date; + duration: string; + price: string; + priceUnit: string; + direction: string; + answeredBy: string; + apiVersion: string; + forwardedFrom: string; + groupSid: string; + callerName: string; + queueTime: string; + trunkSid: string; + uri: string; + subresourceUris: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CallSolution { + accountSid: string; +} +export interface CallListInstance { + _version: V2010; + _solution: CallSolution; + _uri: string; + (sid: string): CallContext; + get(sid: string): CallContext; + _feedbackSummaries?: FeedbackSummaryListInstance; + feedbackSummaries: FeedbackSummaryListInstance; + /** + * Create a CallInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + create(params: CallListInstanceCreateOptions, callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Streams CallInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CallListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CallInstance, done: (err?: Error) => void) => void): void; + each(params: CallListInstanceEachOptions, callback?: (item: CallInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CallInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CallPage) => any): Promise; + /** + * Lists CallInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CallListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CallInstance[]) => any): Promise; + list(params: CallListInstanceOptions, callback?: (error: Error | null, items: CallInstance[]) => any): Promise; + /** + * Retrieve a single page of CallInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CallListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CallPage) => any): Promise; + page(params: CallListInstancePageOptions, callback?: (error: Error | null, items: CallPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CallListInstance(version: V2010, accountSid: string): CallListInstance; +export declare class CallPage extends Page { + /** + * Initialize the CallPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: CallSolution); + /** + * Build an instance of CallInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CallResource): CallInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call.js b/node_modules/twilio/lib/rest/api/v2010/account/call.js new file mode 100644 index 00000000..fa068800 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call.js @@ -0,0 +1,531 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallPage = exports.CallListInstance = exports.CallInstance = exports.CallContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const event_1 = require("./call/event"); +const feedback_1 = require("./call/feedback"); +const feedbackSummary_1 = require("./call/feedbackSummary"); +const notification_1 = require("./call/notification"); +const payment_1 = require("./call/payment"); +const recording_1 = require("./call/recording"); +const siprec_1 = require("./call/siprec"); +const stream_1 = require("./call/stream"); +const userDefinedMessage_1 = require("./call/userDefinedMessage"); +const userDefinedMessageSubscription_1 = require("./call/userDefinedMessageSubscription"); +class CallContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Calls/${sid}.json`; + } + get events() { + this._events = + this._events || + (0, event_1.EventListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._events; + } + get feedback() { + this._feedback = + this._feedback || + (0, feedback_1.FeedbackListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._feedback; + } + get notifications() { + this._notifications = + this._notifications || + (0, notification_1.NotificationListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._notifications; + } + get payments() { + this._payments = + this._payments || + (0, payment_1.PaymentListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._payments; + } + get recordings() { + this._recordings = + this._recordings || + (0, recording_1.RecordingListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._recordings; + } + get siprec() { + this._siprec = + this._siprec || + (0, siprec_1.SiprecListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._siprec; + } + get streams() { + this._streams = + this._streams || + (0, stream_1.StreamListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._streams; + } + get userDefinedMessages() { + this._userDefinedMessages = + this._userDefinedMessages || + (0, userDefinedMessage_1.UserDefinedMessageListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._userDefinedMessages; + } + get userDefinedMessageSubscriptions() { + this._userDefinedMessageSubscriptions = + this._userDefinedMessageSubscriptions || + (0, userDefinedMessageSubscription_1.UserDefinedMessageSubscriptionListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._userDefinedMessageSubscriptions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CallInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["url"] !== undefined) + data["Url"] = params["url"]; + if (params["method"] !== undefined) + data["Method"] = params["method"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["fallbackUrl"] !== undefined) + data["FallbackUrl"] = params["fallbackUrl"]; + if (params["fallbackMethod"] !== undefined) + data["FallbackMethod"] = params["fallbackMethod"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["twiml"] !== undefined) + data["Twiml"] = serialize.twiml(params["twiml"]); + if (params["timeLimit"] !== undefined) + data["TimeLimit"] = params["timeLimit"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CallInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallContextImpl = CallContextImpl; +class CallInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.parentCallSid = payload.parent_call_sid; + this.accountSid = payload.account_sid; + this.to = payload.to; + this.toFormatted = payload.to_formatted; + this.from = payload.from; + this.fromFormatted = payload.from_formatted; + this.phoneNumberSid = payload.phone_number_sid; + this.status = payload.status; + this.startTime = deserialize.rfc2822DateTime(payload.start_time); + this.endTime = deserialize.rfc2822DateTime(payload.end_time); + this.duration = payload.duration; + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.direction = payload.direction; + this.answeredBy = payload.answered_by; + this.apiVersion = payload.api_version; + this.forwardedFrom = payload.forwarded_from; + this.groupSid = payload.group_sid; + this.callerName = payload.caller_name; + this.queueTime = payload.queue_time; + this.trunkSid = payload.trunk_sid; + this.uri = payload.uri; + this.subresourceUris = payload.subresource_uris; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CallContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the events. + */ + events() { + return this._proxy.events; + } + /** + * Access the feedback. + */ + feedback() { + return this._proxy.feedback; + } + /** + * Access the notifications. + */ + notifications() { + return this._proxy.notifications; + } + /** + * Access the payments. + */ + payments() { + return this._proxy.payments; + } + /** + * Access the recordings. + */ + recordings() { + return this._proxy.recordings; + } + /** + * Access the siprec. + */ + siprec() { + return this._proxy.siprec; + } + /** + * Access the streams. + */ + streams() { + return this._proxy.streams; + } + /** + * Access the userDefinedMessages. + */ + userDefinedMessages() { + return this._proxy.userDefinedMessages; + } + /** + * Access the userDefinedMessageSubscriptions. + */ + userDefinedMessageSubscriptions() { + return this._proxy.userDefinedMessageSubscriptions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + parentCallSid: this.parentCallSid, + accountSid: this.accountSid, + to: this.to, + toFormatted: this.toFormatted, + from: this.from, + fromFormatted: this.fromFormatted, + phoneNumberSid: this.phoneNumberSid, + status: this.status, + startTime: this.startTime, + endTime: this.endTime, + duration: this.duration, + price: this.price, + priceUnit: this.priceUnit, + direction: this.direction, + answeredBy: this.answeredBy, + apiVersion: this.apiVersion, + forwardedFrom: this.forwardedFrom, + groupSid: this.groupSid, + callerName: this.callerName, + queueTime: this.queueTime, + trunkSid: this.trunkSid, + uri: this.uri, + subresourceUris: this.subresourceUris, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallInstance = CallInstance; +function CallListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CallContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Calls.json`; + Object.defineProperty(instance, "feedbackSummaries", { + get: function feedbackSummaries() { + if (!instance._feedbackSummaries) { + instance._feedbackSummaries = (0, feedbackSummary_1.FeedbackSummaryListInstance)(instance._version, instance._solution.accountSid); + } + return instance._feedbackSummaries; + }, + }); + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["to"] === null || params["to"] === undefined) { + throw new Error("Required parameter \"params['to']\" missing."); + } + if (params["from"] === null || params["from"] === undefined) { + throw new Error("Required parameter \"params['from']\" missing."); + } + let data = {}; + data["To"] = params["to"]; + data["From"] = params["from"]; + if (params["method"] !== undefined) + data["Method"] = params["method"]; + if (params["fallbackUrl"] !== undefined) + data["FallbackUrl"] = params["fallbackUrl"]; + if (params["fallbackMethod"] !== undefined) + data["FallbackMethod"] = params["fallbackMethod"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackEvent"] !== undefined) + data["StatusCallbackEvent"] = serialize.map(params["statusCallbackEvent"], (e) => e); + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["sendDigits"] !== undefined) + data["SendDigits"] = params["sendDigits"]; + if (params["timeout"] !== undefined) + data["Timeout"] = params["timeout"]; + if (params["record"] !== undefined) + data["Record"] = serialize.bool(params["record"]); + if (params["recordingChannels"] !== undefined) + data["RecordingChannels"] = params["recordingChannels"]; + if (params["recordingStatusCallback"] !== undefined) + data["RecordingStatusCallback"] = params["recordingStatusCallback"]; + if (params["recordingStatusCallbackMethod"] !== undefined) + data["RecordingStatusCallbackMethod"] = + params["recordingStatusCallbackMethod"]; + if (params["sipAuthUsername"] !== undefined) + data["SipAuthUsername"] = params["sipAuthUsername"]; + if (params["sipAuthPassword"] !== undefined) + data["SipAuthPassword"] = params["sipAuthPassword"]; + if (params["machineDetection"] !== undefined) + data["MachineDetection"] = params["machineDetection"]; + if (params["machineDetectionTimeout"] !== undefined) + data["MachineDetectionTimeout"] = params["machineDetectionTimeout"]; + if (params["recordingStatusCallbackEvent"] !== undefined) + data["RecordingStatusCallbackEvent"] = serialize.map(params["recordingStatusCallbackEvent"], (e) => e); + if (params["trim"] !== undefined) + data["Trim"] = params["trim"]; + if (params["callerId"] !== undefined) + data["CallerId"] = params["callerId"]; + if (params["machineDetectionSpeechThreshold"] !== undefined) + data["MachineDetectionSpeechThreshold"] = + params["machineDetectionSpeechThreshold"]; + if (params["machineDetectionSpeechEndThreshold"] !== undefined) + data["MachineDetectionSpeechEndThreshold"] = + params["machineDetectionSpeechEndThreshold"]; + if (params["machineDetectionSilenceTimeout"] !== undefined) + data["MachineDetectionSilenceTimeout"] = + params["machineDetectionSilenceTimeout"]; + if (params["asyncAmd"] !== undefined) + data["AsyncAmd"] = params["asyncAmd"]; + if (params["asyncAmdStatusCallback"] !== undefined) + data["AsyncAmdStatusCallback"] = params["asyncAmdStatusCallback"]; + if (params["asyncAmdStatusCallbackMethod"] !== undefined) + data["AsyncAmdStatusCallbackMethod"] = + params["asyncAmdStatusCallbackMethod"]; + if (params["byoc"] !== undefined) + data["Byoc"] = params["byoc"]; + if (params["callReason"] !== undefined) + data["CallReason"] = params["callReason"]; + if (params["callToken"] !== undefined) + data["CallToken"] = params["callToken"]; + if (params["recordingTrack"] !== undefined) + data["RecordingTrack"] = params["recordingTrack"]; + if (params["timeLimit"] !== undefined) + data["TimeLimit"] = params["timeLimit"]; + if (params["url"] !== undefined) + data["Url"] = params["url"]; + if (params["twiml"] !== undefined) + data["Twiml"] = serialize.twiml(params["twiml"]); + if (params["applicationSid"] !== undefined) + data["ApplicationSid"] = params["applicationSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CallInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["to"] !== undefined) + data["To"] = params["to"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["parentCallSid"] !== undefined) + data["ParentCallSid"] = params["parentCallSid"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["startTime"] !== undefined) + data["StartTime"] = serialize.iso8601DateTime(params["startTime"]); + if (params["startTimeBefore"] !== undefined) + data["StartTime<"] = serialize.iso8601DateTime(params["startTimeBefore"]); + if (params["startTimeAfter"] !== undefined) + data["StartTime>"] = serialize.iso8601DateTime(params["startTimeAfter"]); + if (params["endTime"] !== undefined) + data["EndTime"] = serialize.iso8601DateTime(params["endTime"]); + if (params["endTimeBefore"] !== undefined) + data["EndTime<"] = serialize.iso8601DateTime(params["endTimeBefore"]); + if (params["endTimeAfter"] !== undefined) + data["EndTime>"] = serialize.iso8601DateTime(params["endTimeAfter"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CallPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CallPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CallListInstance = CallListInstance; +class CallPage extends Page_1.default { + /** + * Initialize the CallPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CallInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CallInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallPage = CallPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/event.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/event.d.ts new file mode 100644 index 00000000..e3ab8827 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/event.d.ts @@ -0,0 +1,150 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +/** + * Options to pass to each + */ +export interface EventListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EventInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EventListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EventListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EventSolution { + accountSid: string; + callSid: string; +} +export interface EventListInstance { + _version: V2010; + _solution: EventSolution; + _uri: string; + /** + * Streams EventInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EventInstance, done: (err?: Error) => void) => void): void; + each(params: EventListInstanceEachOptions, callback?: (item: EventInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EventInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EventPage) => any): Promise; + /** + * Lists EventInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EventInstance[]) => any): Promise; + list(params: EventListInstanceOptions, callback?: (error: Error | null, items: EventInstance[]) => any): Promise; + /** + * Retrieve a single page of EventInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EventPage) => any): Promise; + page(params: EventListInstancePageOptions, callback?: (error: Error | null, items: EventPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EventListInstance(version: V2010, accountSid: string, callSid: string): EventListInstance; +interface EventPayload extends TwilioResponsePayload { + events: EventResource[]; +} +interface EventResource { + request: any; + response: any; +} +export declare class EventInstance { + protected _version: V2010; + constructor(_version: V2010, payload: EventResource, accountSid: string, callSid: string); + /** + * Contains a dictionary representing the request of the call. + */ + request: any; + /** + * Contains a dictionary representing the call response, including a list of the call events. + */ + response: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + request: any; + response: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class EventPage extends Page { + /** + * Initialize the EventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: EventSolution); + /** + * Build an instance of EventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EventResource): EventInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/event.js b/node_modules/twilio/lib/rest/api/v2010/account/call/event.js new file mode 100644 index 00000000..e6560907 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/event.js @@ -0,0 +1,127 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EventPage = exports.EventInstance = exports.EventListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function EventListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = `/Accounts/${accountSid}/Calls/${callSid}/Events.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EventPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EventPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EventListInstance = EventListInstance; +class EventInstance { + constructor(_version, payload, accountSid, callSid) { + this._version = _version; + this.request = payload.request; + this.response = payload.response; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + request: this.request, + response: this.response, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventInstance = EventInstance; +class EventPage extends Page_1.default { + /** + * Initialize the EventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EventInstance(this._version, payload, this._solution.accountSid, this._solution.callSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventPage = EventPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/feedback.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/feedback.d.ts new file mode 100644 index 00000000..09677f8a --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/feedback.d.ts @@ -0,0 +1,160 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../V2010"; +export type FeedbackIssues = "audio-latency" | "digits-not-captured" | "dropped-call" | "imperfect-audio" | "incorrect-caller-id" | "one-way-audio" | "post-dial-delay" | "unsolicited-call"; +/** + * Options to pass to update a FeedbackInstance + */ +export interface FeedbackContextUpdateOptions { + /** The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. */ + qualityScore?: number; + /** One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. */ + issue?: Array; +} +export interface FeedbackContext { + /** + * Fetch a FeedbackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + fetch(callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Update a FeedbackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + update(callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Update a FeedbackInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + update(params: FeedbackContextUpdateOptions, callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FeedbackContextSolution { + accountSid: string; + callSid: string; +} +export declare class FeedbackContextImpl implements FeedbackContext { + protected _version: V2010; + protected _solution: FeedbackContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, callSid: string); + fetch(callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + update(params?: FeedbackContextUpdateOptions | ((error: Error | null, item?: FeedbackInstance) => any), callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FeedbackContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FeedbackResource { + account_sid: string; + date_created: Date; + date_updated: Date; + issues: Array; + quality_score: number; + sid: string; +} +export declare class FeedbackInstance { + protected _version: V2010; + protected _solution: FeedbackContextSolution; + protected _context?: FeedbackContext; + constructor(_version: V2010, payload: FeedbackResource, accountSid: string, callSid: string); + /** + * The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. + */ + accountSid: string; + /** + * The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateCreated: Date; + /** + * The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateUpdated: Date; + /** + * A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. + */ + issues: Array; + /** + * `1` to `5` quality score where `1` represents imperfect experience and `5` represents a perfect call. + */ + qualityScore: number; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + private get _proxy(); + /** + * Fetch a FeedbackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + fetch(callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Update a FeedbackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + update(callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Update a FeedbackInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + update(params: FeedbackContextUpdateOptions, callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + issues: FeedbackIssues[]; + qualityScore: number; + sid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FeedbackSolution { + accountSid: string; + callSid: string; +} +export interface FeedbackListInstance { + _version: V2010; + _solution: FeedbackSolution; + _uri: string; + (): FeedbackContext; + get(): FeedbackContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FeedbackListInstance(version: V2010, accountSid: string, callSid: string): FeedbackListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/feedback.js b/node_modules/twilio/lib/rest/api/v2010/account/call/feedback.js new file mode 100644 index 00000000..feccb9d8 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/feedback.js @@ -0,0 +1,154 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FeedbackListInstance = exports.FeedbackInstance = exports.FeedbackContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class FeedbackContextImpl { + constructor(_version, accountSid, callSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + this._solution = { accountSid, callSid }; + this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Feedback.json`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FeedbackInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["qualityScore"] !== undefined) + data["QualityScore"] = params["qualityScore"]; + if (params["issue"] !== undefined) + data["Issue"] = serialize.map(params["issue"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FeedbackInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FeedbackContextImpl = FeedbackContextImpl; +class FeedbackInstance { + constructor(_version, payload, accountSid, callSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.issues = payload.issues; + this.qualityScore = deserialize.integer(payload.quality_score); + this.sid = payload.sid; + this._solution = { accountSid, callSid }; + } + get _proxy() { + this._context = + this._context || + new FeedbackContextImpl(this._version, this._solution.accountSid, this._solution.callSid); + return this._context; + } + /** + * Fetch a FeedbackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + issues: this.issues, + qualityScore: this.qualityScore, + sid: this.sid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FeedbackInstance = FeedbackInstance; +function FeedbackListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new FeedbackContextImpl(version, accountSid, callSid); + }; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FeedbackListInstance = FeedbackListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/feedbackSummary.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/feedbackSummary.d.ts new file mode 100644 index 00000000..28768178 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/feedbackSummary.d.ts @@ -0,0 +1,201 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../V2010"; +export type FeedbackSummaryStatus = "queued" | "in-progress" | "completed" | "failed"; +/** + * Options to pass to create a FeedbackSummaryInstance + */ +export interface FeedbackSummaryListInstanceCreateOptions { + /** Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. */ + startDate: Date; + /** Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. */ + endDate: Date; + /** Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. */ + includeSubaccounts?: boolean; + /** The URL that we will request when the feedback summary is complete. */ + statusCallback?: string; + /** The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. */ + statusCallbackMethod?: string; +} +export interface FeedbackSummaryContext { + /** + * Remove a FeedbackSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FeedbackSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackSummaryInstance + */ + fetch(callback?: (error: Error | null, item?: FeedbackSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FeedbackSummaryContextSolution { + accountSid: string; + sid: string; +} +export declare class FeedbackSummaryContextImpl implements FeedbackSummaryContext { + protected _version: V2010; + protected _solution: FeedbackSummaryContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: FeedbackSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FeedbackSummaryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FeedbackSummaryResource { + account_sid: string; + call_count: number; + call_feedback_count: number; + date_created: Date; + date_updated: Date; + end_date: Date; + include_subaccounts: boolean; + issues: Array; + quality_score_average: number; + quality_score_median: number; + quality_score_standard_deviation: number; + sid: string; + start_date: Date; + status: FeedbackSummaryStatus; +} +export declare class FeedbackSummaryInstance { + protected _version: V2010; + protected _solution: FeedbackSummaryContextSolution; + protected _context?: FeedbackSummaryContext; + constructor(_version: V2010, payload: FeedbackSummaryResource, accountSid: string, sid?: string); + /** + * The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. + */ + accountSid: string; + /** + * The total number of calls. + */ + callCount: number; + /** + * The total number of calls with a feedback entry. + */ + callFeedbackCount: number; + /** + * The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateCreated: Date; + /** + * The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateUpdated: Date; + /** + * The last date for which feedback entries are included in this Feedback Summary, formatted as `YYYY-MM-DD` and specified in UTC. + */ + endDate: Date; + /** + * Whether the feedback summary includes subaccounts; `true` if it does, otherwise `false`. + */ + includeSubaccounts: boolean; + /** + * A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, or `one-way-audio`. + */ + issues: Array; + /** + * The average QualityScore of the feedback entries. + */ + qualityScoreAverage: number; + /** + * The median QualityScore of the feedback entries. + */ + qualityScoreMedian: number; + /** + * The standard deviation of the quality scores. + */ + qualityScoreStandardDeviation: number; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The first date for which feedback entries are included in this feedback summary, formatted as `YYYY-MM-DD` and specified in UTC. + */ + startDate: Date; + status: FeedbackSummaryStatus; + private get _proxy(); + /** + * Remove a FeedbackSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FeedbackSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackSummaryInstance + */ + fetch(callback?: (error: Error | null, item?: FeedbackSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + callCount: number; + callFeedbackCount: number; + dateCreated: Date; + dateUpdated: Date; + endDate: Date; + includeSubaccounts: boolean; + issues: any[]; + qualityScoreAverage: number; + qualityScoreMedian: number; + qualityScoreStandardDeviation: number; + sid: string; + startDate: Date; + status: FeedbackSummaryStatus; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FeedbackSummarySolution { + accountSid: string; +} +export interface FeedbackSummaryListInstance { + _version: V2010; + _solution: FeedbackSummarySolution; + _uri: string; + (sid: string): FeedbackSummaryContext; + get(sid: string): FeedbackSummaryContext; + /** + * Create a FeedbackSummaryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackSummaryInstance + */ + create(params: FeedbackSummaryListInstanceCreateOptions, callback?: (error: Error | null, item?: FeedbackSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FeedbackSummaryListInstance(version: V2010, accountSid: string): FeedbackSummaryListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/feedbackSummary.js b/node_modules/twilio/lib/rest/api/v2010/account/call/feedbackSummary.js new file mode 100644 index 00000000..cb9de8f9 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/feedbackSummary.js @@ -0,0 +1,189 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FeedbackSummaryListInstance = exports.FeedbackSummaryInstance = exports.FeedbackSummaryContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class FeedbackSummaryContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Calls/FeedbackSummary/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FeedbackSummaryInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FeedbackSummaryContextImpl = FeedbackSummaryContextImpl; +class FeedbackSummaryInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.callCount = deserialize.integer(payload.call_count); + this.callFeedbackCount = deserialize.integer(payload.call_feedback_count); + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.endDate = deserialize.iso8601Date(payload.end_date); + this.includeSubaccounts = payload.include_subaccounts; + this.issues = payload.issues; + this.qualityScoreAverage = payload.quality_score_average; + this.qualityScoreMedian = payload.quality_score_median; + this.qualityScoreStandardDeviation = + payload.quality_score_standard_deviation; + this.sid = payload.sid; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.status = payload.status; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new FeedbackSummaryContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a FeedbackSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a FeedbackSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackSummaryInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + callCount: this.callCount, + callFeedbackCount: this.callFeedbackCount, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + endDate: this.endDate, + includeSubaccounts: this.includeSubaccounts, + issues: this.issues, + qualityScoreAverage: this.qualityScoreAverage, + qualityScoreMedian: this.qualityScoreMedian, + qualityScoreStandardDeviation: this.qualityScoreStandardDeviation, + sid: this.sid, + startDate: this.startDate, + status: this.status, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FeedbackSummaryInstance = FeedbackSummaryInstance; +function FeedbackSummaryListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FeedbackSummaryContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Calls/FeedbackSummary.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["startDate"] === null || params["startDate"] === undefined) { + throw new Error("Required parameter \"params['startDate']\" missing."); + } + if (params["endDate"] === null || params["endDate"] === undefined) { + throw new Error("Required parameter \"params['endDate']\" missing."); + } + let data = {}; + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FeedbackSummaryInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FeedbackSummaryListInstance = FeedbackSummaryListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/notification.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/notification.d.ts new file mode 100644 index 00000000..8b1125e9 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/notification.d.ts @@ -0,0 +1,311 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +/** + * Options to pass to each + */ +export interface NotificationListInstanceEachOptions { + /** Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. */ + log?: number; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDate?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateBefore?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: NotificationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface NotificationListInstanceOptions { + /** Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. */ + log?: number; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDate?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateBefore?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface NotificationListInstancePageOptions { + /** Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. */ + log?: number; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDate?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateBefore?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface NotificationContext { + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NotificationContextSolution { + accountSid: string; + callSid: string; + sid: string; +} +export declare class NotificationContextImpl implements NotificationContext { + protected _version: V2010; + protected _solution: NotificationContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, callSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NotificationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NotificationPayload extends TwilioResponsePayload { + notifications: NotificationResource[]; +} +interface NotificationResource { + account_sid: string; + api_version: string; + call_sid: string; + date_created: Date; + date_updated: Date; + error_code: string; + log: string; + message_date: Date; + message_text: string; + more_info: string; + request_method: string; + request_url: string; + request_variables: string; + response_body: string; + response_headers: string; + sid: string; + uri: string; +} +export declare class NotificationInstance { + protected _version: V2010; + protected _solution: NotificationContextSolution; + protected _context?: NotificationContext; + constructor(_version: V2010, payload: NotificationResource, accountSid: string, callSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resource. + */ + accountSid: string; + /** + * The API version used to create the Call Notification resource. + */ + apiVersion: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Call Notification resource is associated with. + */ + callSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * A unique error code for the error condition that is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). + */ + errorCode: string; + /** + * An integer log level that corresponds to the type of notification: `0` is ERROR, `1` is WARNING. + */ + log: string; + /** + * The date the notification was actually generated in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. Message buffering can cause this value to differ from `date_created`. + */ + messageDate: Date; + /** + * The text of the notification. + */ + messageText: string; + /** + * The URL for more information about the error condition. This value is a page in our [Error Dictionary](https://www.twilio.com/docs/api/errors). + */ + moreInfo: string; + /** + * The HTTP method used to generate the notification. If the notification was generated during a phone call, this is the HTTP Method used to request the resource on your server. If the notification was generated by your use of our REST API, this is the HTTP method used to call the resource on our servers. + */ + requestMethod: string; + /** + * The URL of the resource that generated the notification. If the notification was generated during a phone call, this is the URL of the resource on your server that caused the notification. If the notification was generated by your use of our REST API, this is the URL of the resource you called. + */ + requestUrl: string; + /** + * The HTTP GET or POST variables we sent to your server. However, if the notification was generated by our REST API, this contains the HTTP POST or PUT variables you sent to our API. + */ + requestVariables: string; + /** + * The HTTP body returned by your server. + */ + responseBody: string; + /** + * The HTTP headers returned by your server. + */ + responseHeaders: string; + /** + * The unique string that that we created to identify the Call Notification resource. + */ + sid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + callSid: string; + dateCreated: Date; + dateUpdated: Date; + errorCode: string; + log: string; + messageDate: Date; + messageText: string; + moreInfo: string; + requestMethod: string; + requestUrl: string; + requestVariables: string; + responseBody: string; + responseHeaders: string; + sid: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NotificationSolution { + accountSid: string; + callSid: string; +} +export interface NotificationListInstance { + _version: V2010; + _solution: NotificationSolution; + _uri: string; + (sid: string): NotificationContext; + get(sid: string): NotificationContext; + /** + * Streams NotificationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NotificationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: NotificationInstance, done: (err?: Error) => void) => void): void; + each(params: NotificationListInstanceEachOptions, callback?: (item: NotificationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of NotificationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: NotificationPage) => any): Promise; + /** + * Lists NotificationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NotificationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: NotificationInstance[]) => any): Promise; + list(params: NotificationListInstanceOptions, callback?: (error: Error | null, items: NotificationInstance[]) => any): Promise; + /** + * Retrieve a single page of NotificationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NotificationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: NotificationPage) => any): Promise; + page(params: NotificationListInstancePageOptions, callback?: (error: Error | null, items: NotificationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NotificationListInstance(version: V2010, accountSid: string, callSid: string): NotificationListInstance; +export declare class NotificationPage extends Page { + /** + * Initialize the NotificationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: NotificationSolution); + /** + * Build an instance of NotificationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: NotificationResource): NotificationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/notification.js b/node_modules/twilio/lib/rest/api/v2010/account/call/notification.js new file mode 100644 index 00000000..cda83f47 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/notification.js @@ -0,0 +1,223 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NotificationPage = exports.NotificationListInstance = exports.NotificationInstance = exports.NotificationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class NotificationContextImpl { + constructor(_version, accountSid, callSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, callSid, sid }; + this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Notifications/${sid}.json`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new NotificationInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationContextImpl = NotificationContextImpl; +class NotificationInstance { + constructor(_version, payload, accountSid, callSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.callSid = payload.call_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.errorCode = payload.error_code; + this.log = payload.log; + this.messageDate = deserialize.rfc2822DateTime(payload.message_date); + this.messageText = payload.message_text; + this.moreInfo = payload.more_info; + this.requestMethod = payload.request_method; + this.requestUrl = payload.request_url; + this.requestVariables = payload.request_variables; + this.responseBody = payload.response_body; + this.responseHeaders = payload.response_headers; + this.sid = payload.sid; + this.uri = payload.uri; + this._solution = { accountSid, callSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new NotificationContextImpl(this._version, this._solution.accountSid, this._solution.callSid, this._solution.sid); + return this._context; + } + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + callSid: this.callSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + errorCode: this.errorCode, + log: this.log, + messageDate: this.messageDate, + messageText: this.messageText, + moreInfo: this.moreInfo, + requestMethod: this.requestMethod, + requestUrl: this.requestUrl, + requestVariables: this.requestVariables, + responseBody: this.responseBody, + responseHeaders: this.responseHeaders, + sid: this.sid, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationInstance = NotificationInstance; +function NotificationListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new NotificationContextImpl(version, accountSid, callSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = `/Accounts/${accountSid}/Calls/${callSid}/Notifications.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["log"] !== undefined) + data["Log"] = params["log"]; + if (params["messageDate"] !== undefined) + data["MessageDate"] = serialize.iso8601Date(params["messageDate"]); + if (params["messageDateBefore"] !== undefined) + data["MessageDate<"] = serialize.iso8601Date(params["messageDateBefore"]); + if (params["messageDateAfter"] !== undefined) + data["MessageDate>"] = serialize.iso8601Date(params["messageDateAfter"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NotificationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new NotificationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NotificationListInstance = NotificationListInstance; +class NotificationPage extends Page_1.default { + /** + * Initialize the NotificationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of NotificationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new NotificationInstance(this._version, payload, this._solution.accountSid, this._solution.callSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationPage = NotificationPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/payment.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/payment.d.ts new file mode 100644 index 00000000..4c1336b7 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/payment.d.ts @@ -0,0 +1,182 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../V2010"; +export type PaymentBankAccountType = "consumer-checking" | "consumer-savings" | "commercial-checking"; +export type PaymentCapture = "payment-card-number" | "expiration-date" | "security-code" | "postal-code" | "bank-routing-number" | "bank-account-number"; +export type PaymentPaymentMethod = "credit-card" | "ach-debit"; +export type PaymentStatus = "complete" | "cancel"; +export type PaymentTokenType = "one-time" | "reusable"; +/** + * Options to pass to update a PaymentInstance + */ +export interface PaymentContextUpdateOptions { + /** A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. */ + idempotencyKey: string; + /** Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. */ + statusCallback: string; + /** */ + capture?: PaymentCapture; + /** */ + status?: PaymentStatus; +} +/** + * Options to pass to create a PaymentInstance + */ +export interface PaymentListInstanceCreateOptions { + /** A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. */ + idempotencyKey: string; + /** Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback) */ + statusCallback: string; + /** */ + bankAccountType?: PaymentBankAccountType; + /** A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. */ + chargeAmount?: number; + /** The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. */ + currency?: string; + /** The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. */ + description?: string; + /** A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. */ + input?: string; + /** A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. */ + minPostalCodeLength?: number; + /** A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). */ + parameter?: any; + /** This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. */ + paymentConnector?: string; + /** */ + paymentMethod?: PaymentPaymentMethod; + /** Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. */ + postalCode?: boolean; + /** Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. */ + securityCode?: boolean; + /** The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. */ + timeout?: number; + /** */ + tokenType?: PaymentTokenType; + /** Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` */ + validCardTypes?: string; +} +export interface PaymentContext { + /** + * Update a PaymentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PaymentInstance + */ + update(params: PaymentContextUpdateOptions, callback?: (error: Error | null, item?: PaymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PaymentContextSolution { + accountSid: string; + callSid: string; + sid: string; +} +export declare class PaymentContextImpl implements PaymentContext { + protected _version: V2010; + protected _solution: PaymentContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, callSid: string, sid: string); + update(params: PaymentContextUpdateOptions, callback?: (error: Error | null, item?: PaymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PaymentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PaymentResource { + account_sid: string; + call_sid: string; + sid: string; + date_created: Date; + date_updated: Date; + uri: string; +} +export declare class PaymentInstance { + protected _version: V2010; + protected _solution: PaymentContextSolution; + protected _context?: PaymentContext; + constructor(_version: V2010, payload: PaymentResource, accountSid: string, callSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + */ + accountSid: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Payments resource is associated with. This will refer to the call sid that is producing the payment card (credit/ACH) information thru DTMF. + */ + callSid: string; + /** + * The SID of the Payments resource. + */ + sid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Update a PaymentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PaymentInstance + */ + update(params: PaymentContextUpdateOptions, callback?: (error: Error | null, item?: PaymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + callSid: string; + sid: string; + dateCreated: Date; + dateUpdated: Date; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PaymentSolution { + accountSid: string; + callSid: string; +} +export interface PaymentListInstance { + _version: V2010; + _solution: PaymentSolution; + _uri: string; + (sid: string): PaymentContext; + get(sid: string): PaymentContext; + /** + * Create a PaymentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PaymentInstance + */ + create(params: PaymentListInstanceCreateOptions, callback?: (error: Error | null, item?: PaymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PaymentListInstance(version: V2010, accountSid: string, callSid: string): PaymentListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/payment.js b/node_modules/twilio/lib/rest/api/v2010/account/call/payment.js new file mode 100644 index 00000000..154e55ee --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/payment.js @@ -0,0 +1,198 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PaymentListInstance = exports.PaymentInstance = exports.PaymentContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class PaymentContextImpl { + constructor(_version, accountSid, callSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, callSid, sid }; + this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Payments/${sid}.json`; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["idempotencyKey"] === null || + params["idempotencyKey"] === undefined) { + throw new Error("Required parameter \"params['idempotencyKey']\" missing."); + } + if (params["statusCallback"] === null || + params["statusCallback"] === undefined) { + throw new Error("Required parameter \"params['statusCallback']\" missing."); + } + let data = {}; + data["IdempotencyKey"] = params["idempotencyKey"]; + data["StatusCallback"] = params["statusCallback"]; + if (params["capture"] !== undefined) + data["Capture"] = params["capture"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PaymentInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PaymentContextImpl = PaymentContextImpl; +class PaymentInstance { + constructor(_version, payload, accountSid, callSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.sid = payload.sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.uri = payload.uri; + this._solution = { accountSid, callSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PaymentContextImpl(this._version, this._solution.accountSid, this._solution.callSid, this._solution.sid); + return this._context; + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + callSid: this.callSid, + sid: this.sid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PaymentInstance = PaymentInstance; +function PaymentListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PaymentContextImpl(version, accountSid, callSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = `/Accounts/${accountSid}/Calls/${callSid}/Payments.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["idempotencyKey"] === null || + params["idempotencyKey"] === undefined) { + throw new Error("Required parameter \"params['idempotencyKey']\" missing."); + } + if (params["statusCallback"] === null || + params["statusCallback"] === undefined) { + throw new Error("Required parameter \"params['statusCallback']\" missing."); + } + let data = {}; + data["IdempotencyKey"] = params["idempotencyKey"]; + data["StatusCallback"] = params["statusCallback"]; + if (params["bankAccountType"] !== undefined) + data["BankAccountType"] = params["bankAccountType"]; + if (params["chargeAmount"] !== undefined) + data["ChargeAmount"] = params["chargeAmount"]; + if (params["currency"] !== undefined) + data["Currency"] = params["currency"]; + if (params["description"] !== undefined) + data["Description"] = params["description"]; + if (params["input"] !== undefined) + data["Input"] = params["input"]; + if (params["minPostalCodeLength"] !== undefined) + data["MinPostalCodeLength"] = params["minPostalCodeLength"]; + if (params["parameter"] !== undefined) + data["Parameter"] = serialize.object(params["parameter"]); + if (params["paymentConnector"] !== undefined) + data["PaymentConnector"] = params["paymentConnector"]; + if (params["paymentMethod"] !== undefined) + data["PaymentMethod"] = params["paymentMethod"]; + if (params["postalCode"] !== undefined) + data["PostalCode"] = serialize.bool(params["postalCode"]); + if (params["securityCode"] !== undefined) + data["SecurityCode"] = serialize.bool(params["securityCode"]); + if (params["timeout"] !== undefined) + data["Timeout"] = params["timeout"]; + if (params["tokenType"] !== undefined) + data["TokenType"] = params["tokenType"]; + if (params["validCardTypes"] !== undefined) + data["ValidCardTypes"] = params["validCardTypes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PaymentInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PaymentListInstance = PaymentListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/recording.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/recording.d.ts new file mode 100644 index 00000000..a3021a4c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/recording.d.ts @@ -0,0 +1,386 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +export type RecordingSource = "DialVerb" | "Conference" | "OutboundAPI" | "Trunking" | "RecordVerb" | "StartCallRecordingAPI" | "StartConferenceRecordingAPI"; +export type RecordingStatus = "in-progress" | "paused" | "stopped" | "processing" | "completed" | "absent"; +/** + * Options to pass to update a RecordingInstance + */ +export interface RecordingContextUpdateOptions { + /** */ + status: RecordingStatus; + /** Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. */ + pauseBehavior?: string; +} +/** + * Options to pass to create a RecordingInstance + */ +export interface RecordingListInstanceCreateOptions { + /** The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. */ + recordingStatusCallbackEvent?: Array; + /** The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). */ + recordingStatusCallback?: string; + /** The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. */ + recordingStatusCallbackMethod?: string; + /** Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. */ + trim?: string; + /** The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. */ + recordingChannels?: string; + /** The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. */ + recordingTrack?: string; +} +/** + * Options to pass to each + */ +export interface RecordingListInstanceEachOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RecordingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RecordingListInstanceOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RecordingListInstancePageOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RecordingContext { + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Update a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + update(params: RecordingContextUpdateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RecordingContextSolution { + accountSid: string; + callSid: string; + sid: string; +} +export declare class RecordingContextImpl implements RecordingContext { + protected _version: V2010; + protected _solution: RecordingContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, callSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + update(params: RecordingContextUpdateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RecordingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RecordingPayload extends TwilioResponsePayload { + recordings: RecordingResource[]; +} +interface RecordingResource { + account_sid: string; + api_version: string; + call_sid: string; + conference_sid: string; + date_created: Date; + date_updated: Date; + start_time: Date; + duration: string; + sid: string; + price: number; + uri: string; + encryption_details: any; + price_unit: string; + status: RecordingStatus; + channels: number; + source: RecordingSource; + error_code: number; + track: string; +} +export declare class RecordingInstance { + protected _version: V2010; + protected _solution: RecordingContextSolution; + protected _context?: RecordingContext; + constructor(_version: V2010, payload: RecordingResource, accountSid: string, callSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resource. + */ + accountSid: string; + /** + * The API version used to make the recording. + */ + apiVersion: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Recording resource is associated with. + */ + callSid: string; + /** + * The Conference SID that identifies the conference associated with the recording, if a conference recording. + */ + conferenceSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The start time of the recording in GMT and in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + startTime: Date; + /** + * The length of the recording in seconds. + */ + duration: string; + /** + * The unique string that that we created to identify the Recording resource. + */ + sid: string; + /** + * The one-time cost of creating the recording in the `price_unit` currency. + */ + price: number; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature. + */ + encryptionDetails: any; + /** + * The currency used in the `price` property. Example: `USD`. + */ + priceUnit: string; + status: RecordingStatus; + /** + * The number of channels in the final recording file. Can be: `1`, or `2`. Separating a two leg call into two separate channels of the recording file is supported in [Dial](https://www.twilio.com/docs/voice/twiml/dial#attributes-record) and [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls) record options. + */ + channels: number; + source: RecordingSource; + /** + * The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`. + */ + errorCode: number; + /** + * The recorded track. Can be: `inbound`, `outbound`, or `both`. + */ + track: string; + private get _proxy(); + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Update a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + update(params: RecordingContextUpdateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + callSid: string; + conferenceSid: string; + dateCreated: Date; + dateUpdated: Date; + startTime: Date; + duration: string; + sid: string; + price: number; + uri: string; + encryptionDetails: any; + priceUnit: string; + status: RecordingStatus; + channels: number; + source: RecordingSource; + errorCode: number; + track: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RecordingSolution { + accountSid: string; + callSid: string; +} +export interface RecordingListInstance { + _version: V2010; + _solution: RecordingSolution; + _uri: string; + (sid: string): RecordingContext; + get(sid: string): RecordingContext; + /** + * Create a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + create(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Create a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + create(params: RecordingListInstanceCreateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Streams RecordingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void; + each(params: RecordingListInstanceEachOptions, callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RecordingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RecordingPage) => any): Promise; + /** + * Lists RecordingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise; + list(params: RecordingListInstanceOptions, callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise; + /** + * Retrieve a single page of RecordingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RecordingPage) => any): Promise; + page(params: RecordingListInstancePageOptions, callback?: (error: Error | null, items: RecordingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RecordingListInstance(version: V2010, accountSid: string, callSid: string): RecordingListInstance; +export declare class RecordingPage extends Page { + /** + * Initialize the RecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: RecordingSolution); + /** + * Build an instance of RecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RecordingResource): RecordingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/recording.js b/node_modules/twilio/lib/rest/api/v2010/account/call/recording.js new file mode 100644 index 00000000..53648477 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/recording.js @@ -0,0 +1,303 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RecordingPage = exports.RecordingListInstance = exports.RecordingInstance = exports.RecordingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class RecordingContextImpl { + constructor(_version, accountSid, callSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, callSid, sid }; + this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Recordings/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + if (params["pauseBehavior"] !== undefined) + data["PauseBehavior"] = params["pauseBehavior"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingContextImpl = RecordingContextImpl; +class RecordingInstance { + constructor(_version, payload, accountSid, callSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.callSid = payload.call_sid; + this.conferenceSid = payload.conference_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.startTime = deserialize.rfc2822DateTime(payload.start_time); + this.duration = payload.duration; + this.sid = payload.sid; + this.price = payload.price; + this.uri = payload.uri; + this.encryptionDetails = payload.encryption_details; + this.priceUnit = payload.price_unit; + this.status = payload.status; + this.channels = deserialize.integer(payload.channels); + this.source = payload.source; + this.errorCode = deserialize.integer(payload.error_code); + this.track = payload.track; + this._solution = { accountSid, callSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RecordingContextImpl(this._version, this._solution.accountSid, this._solution.callSid, this._solution.sid); + return this._context; + } + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + callSid: this.callSid, + conferenceSid: this.conferenceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + startTime: this.startTime, + duration: this.duration, + sid: this.sid, + price: this.price, + uri: this.uri, + encryptionDetails: this.encryptionDetails, + priceUnit: this.priceUnit, + status: this.status, + channels: this.channels, + source: this.source, + errorCode: this.errorCode, + track: this.track, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingInstance = RecordingInstance; +function RecordingListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RecordingContextImpl(version, accountSid, callSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = `/Accounts/${accountSid}/Calls/${callSid}/Recordings.json`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["recordingStatusCallbackEvent"] !== undefined) + data["RecordingStatusCallbackEvent"] = serialize.map(params["recordingStatusCallbackEvent"], (e) => e); + if (params["recordingStatusCallback"] !== undefined) + data["RecordingStatusCallback"] = params["recordingStatusCallback"]; + if (params["recordingStatusCallbackMethod"] !== undefined) + data["RecordingStatusCallbackMethod"] = + params["recordingStatusCallbackMethod"]; + if (params["trim"] !== undefined) + data["Trim"] = params["trim"]; + if (params["recordingChannels"] !== undefined) + data["RecordingChannels"] = params["recordingChannels"]; + if (params["recordingTrack"] !== undefined) + data["RecordingTrack"] = params["recordingTrack"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601Date(params["dateCreated"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreated<"] = serialize.iso8601Date(params["dateCreatedBefore"]); + if (params["dateCreatedAfter"] !== undefined) + data["DateCreated>"] = serialize.iso8601Date(params["dateCreatedAfter"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RecordingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RecordingListInstance = RecordingListInstance; +class RecordingPage extends Page_1.default { + /** + * Initialize the RecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RecordingInstance(this._version, payload, this._solution.accountSid, this._solution.callSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingPage = RecordingPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/siprec.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/siprec.d.ts new file mode 100644 index 00000000..674f0b17 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/siprec.d.ts @@ -0,0 +1,559 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../V2010"; +export type SiprecStatus = "in-progress" | "stopped"; +export type SiprecTrack = "inbound_track" | "outbound_track" | "both_tracks"; +export type SiprecUpdateStatus = "stopped"; +/** + * Options to pass to update a SiprecInstance + */ +export interface SiprecContextUpdateOptions { + /** */ + status: SiprecUpdateStatus; +} +/** + * Options to pass to create a SiprecInstance + */ +export interface SiprecListInstanceCreateOptions { + /** The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. */ + name?: string; + /** Unique name used when configuring the connector via Marketplace Add-on. */ + connectorName?: string; + /** */ + track?: SiprecTrack; + /** Absolute URL of the status callback. */ + statusCallback?: string; + /** The http method for the status_callback (one of GET, POST). */ + statusCallbackMethod?: string; + /** Parameter name */ + "parameter1.name"?: string; + /** Parameter value */ + "parameter1.value"?: string; + /** Parameter name */ + "parameter2.name"?: string; + /** Parameter value */ + "parameter2.value"?: string; + /** Parameter name */ + "parameter3.name"?: string; + /** Parameter value */ + "parameter3.value"?: string; + /** Parameter name */ + "parameter4.name"?: string; + /** Parameter value */ + "parameter4.value"?: string; + /** Parameter name */ + "parameter5.name"?: string; + /** Parameter value */ + "parameter5.value"?: string; + /** Parameter name */ + "parameter6.name"?: string; + /** Parameter value */ + "parameter6.value"?: string; + /** Parameter name */ + "parameter7.name"?: string; + /** Parameter value */ + "parameter7.value"?: string; + /** Parameter name */ + "parameter8.name"?: string; + /** Parameter value */ + "parameter8.value"?: string; + /** Parameter name */ + "parameter9.name"?: string; + /** Parameter value */ + "parameter9.value"?: string; + /** Parameter name */ + "parameter10.name"?: string; + /** Parameter value */ + "parameter10.value"?: string; + /** Parameter name */ + "parameter11.name"?: string; + /** Parameter value */ + "parameter11.value"?: string; + /** Parameter name */ + "parameter12.name"?: string; + /** Parameter value */ + "parameter12.value"?: string; + /** Parameter name */ + "parameter13.name"?: string; + /** Parameter value */ + "parameter13.value"?: string; + /** Parameter name */ + "parameter14.name"?: string; + /** Parameter value */ + "parameter14.value"?: string; + /** Parameter name */ + "parameter15.name"?: string; + /** Parameter value */ + "parameter15.value"?: string; + /** Parameter name */ + "parameter16.name"?: string; + /** Parameter value */ + "parameter16.value"?: string; + /** Parameter name */ + "parameter17.name"?: string; + /** Parameter value */ + "parameter17.value"?: string; + /** Parameter name */ + "parameter18.name"?: string; + /** Parameter value */ + "parameter18.value"?: string; + /** Parameter name */ + "parameter19.name"?: string; + /** Parameter value */ + "parameter19.value"?: string; + /** Parameter name */ + "parameter20.name"?: string; + /** Parameter value */ + "parameter20.value"?: string; + /** Parameter name */ + "parameter21.name"?: string; + /** Parameter value */ + "parameter21.value"?: string; + /** Parameter name */ + "parameter22.name"?: string; + /** Parameter value */ + "parameter22.value"?: string; + /** Parameter name */ + "parameter23.name"?: string; + /** Parameter value */ + "parameter23.value"?: string; + /** Parameter name */ + "parameter24.name"?: string; + /** Parameter value */ + "parameter24.value"?: string; + /** Parameter name */ + "parameter25.name"?: string; + /** Parameter value */ + "parameter25.value"?: string; + /** Parameter name */ + "parameter26.name"?: string; + /** Parameter value */ + "parameter26.value"?: string; + /** Parameter name */ + "parameter27.name"?: string; + /** Parameter value */ + "parameter27.value"?: string; + /** Parameter name */ + "parameter28.name"?: string; + /** Parameter value */ + "parameter28.value"?: string; + /** Parameter name */ + "parameter29.name"?: string; + /** Parameter value */ + "parameter29.value"?: string; + /** Parameter name */ + "parameter30.name"?: string; + /** Parameter value */ + "parameter30.value"?: string; + /** Parameter name */ + "parameter31.name"?: string; + /** Parameter value */ + "parameter31.value"?: string; + /** Parameter name */ + "parameter32.name"?: string; + /** Parameter value */ + "parameter32.value"?: string; + /** Parameter name */ + "parameter33.name"?: string; + /** Parameter value */ + "parameter33.value"?: string; + /** Parameter name */ + "parameter34.name"?: string; + /** Parameter value */ + "parameter34.value"?: string; + /** Parameter name */ + "parameter35.name"?: string; + /** Parameter value */ + "parameter35.value"?: string; + /** Parameter name */ + "parameter36.name"?: string; + /** Parameter value */ + "parameter36.value"?: string; + /** Parameter name */ + "parameter37.name"?: string; + /** Parameter value */ + "parameter37.value"?: string; + /** Parameter name */ + "parameter38.name"?: string; + /** Parameter value */ + "parameter38.value"?: string; + /** Parameter name */ + "parameter39.name"?: string; + /** Parameter value */ + "parameter39.value"?: string; + /** Parameter name */ + "parameter40.name"?: string; + /** Parameter value */ + "parameter40.value"?: string; + /** Parameter name */ + "parameter41.name"?: string; + /** Parameter value */ + "parameter41.value"?: string; + /** Parameter name */ + "parameter42.name"?: string; + /** Parameter value */ + "parameter42.value"?: string; + /** Parameter name */ + "parameter43.name"?: string; + /** Parameter value */ + "parameter43.value"?: string; + /** Parameter name */ + "parameter44.name"?: string; + /** Parameter value */ + "parameter44.value"?: string; + /** Parameter name */ + "parameter45.name"?: string; + /** Parameter value */ + "parameter45.value"?: string; + /** Parameter name */ + "parameter46.name"?: string; + /** Parameter value */ + "parameter46.value"?: string; + /** Parameter name */ + "parameter47.name"?: string; + /** Parameter value */ + "parameter47.value"?: string; + /** Parameter name */ + "parameter48.name"?: string; + /** Parameter value */ + "parameter48.value"?: string; + /** Parameter name */ + "parameter49.name"?: string; + /** Parameter value */ + "parameter49.value"?: string; + /** Parameter name */ + "parameter50.name"?: string; + /** Parameter value */ + "parameter50.value"?: string; + /** Parameter name */ + "parameter51.name"?: string; + /** Parameter value */ + "parameter51.value"?: string; + /** Parameter name */ + "parameter52.name"?: string; + /** Parameter value */ + "parameter52.value"?: string; + /** Parameter name */ + "parameter53.name"?: string; + /** Parameter value */ + "parameter53.value"?: string; + /** Parameter name */ + "parameter54.name"?: string; + /** Parameter value */ + "parameter54.value"?: string; + /** Parameter name */ + "parameter55.name"?: string; + /** Parameter value */ + "parameter55.value"?: string; + /** Parameter name */ + "parameter56.name"?: string; + /** Parameter value */ + "parameter56.value"?: string; + /** Parameter name */ + "parameter57.name"?: string; + /** Parameter value */ + "parameter57.value"?: string; + /** Parameter name */ + "parameter58.name"?: string; + /** Parameter value */ + "parameter58.value"?: string; + /** Parameter name */ + "parameter59.name"?: string; + /** Parameter value */ + "parameter59.value"?: string; + /** Parameter name */ + "parameter60.name"?: string; + /** Parameter value */ + "parameter60.value"?: string; + /** Parameter name */ + "parameter61.name"?: string; + /** Parameter value */ + "parameter61.value"?: string; + /** Parameter name */ + "parameter62.name"?: string; + /** Parameter value */ + "parameter62.value"?: string; + /** Parameter name */ + "parameter63.name"?: string; + /** Parameter value */ + "parameter63.value"?: string; + /** Parameter name */ + "parameter64.name"?: string; + /** Parameter value */ + "parameter64.value"?: string; + /** Parameter name */ + "parameter65.name"?: string; + /** Parameter value */ + "parameter65.value"?: string; + /** Parameter name */ + "parameter66.name"?: string; + /** Parameter value */ + "parameter66.value"?: string; + /** Parameter name */ + "parameter67.name"?: string; + /** Parameter value */ + "parameter67.value"?: string; + /** Parameter name */ + "parameter68.name"?: string; + /** Parameter value */ + "parameter68.value"?: string; + /** Parameter name */ + "parameter69.name"?: string; + /** Parameter value */ + "parameter69.value"?: string; + /** Parameter name */ + "parameter70.name"?: string; + /** Parameter value */ + "parameter70.value"?: string; + /** Parameter name */ + "parameter71.name"?: string; + /** Parameter value */ + "parameter71.value"?: string; + /** Parameter name */ + "parameter72.name"?: string; + /** Parameter value */ + "parameter72.value"?: string; + /** Parameter name */ + "parameter73.name"?: string; + /** Parameter value */ + "parameter73.value"?: string; + /** Parameter name */ + "parameter74.name"?: string; + /** Parameter value */ + "parameter74.value"?: string; + /** Parameter name */ + "parameter75.name"?: string; + /** Parameter value */ + "parameter75.value"?: string; + /** Parameter name */ + "parameter76.name"?: string; + /** Parameter value */ + "parameter76.value"?: string; + /** Parameter name */ + "parameter77.name"?: string; + /** Parameter value */ + "parameter77.value"?: string; + /** Parameter name */ + "parameter78.name"?: string; + /** Parameter value */ + "parameter78.value"?: string; + /** Parameter name */ + "parameter79.name"?: string; + /** Parameter value */ + "parameter79.value"?: string; + /** Parameter name */ + "parameter80.name"?: string; + /** Parameter value */ + "parameter80.value"?: string; + /** Parameter name */ + "parameter81.name"?: string; + /** Parameter value */ + "parameter81.value"?: string; + /** Parameter name */ + "parameter82.name"?: string; + /** Parameter value */ + "parameter82.value"?: string; + /** Parameter name */ + "parameter83.name"?: string; + /** Parameter value */ + "parameter83.value"?: string; + /** Parameter name */ + "parameter84.name"?: string; + /** Parameter value */ + "parameter84.value"?: string; + /** Parameter name */ + "parameter85.name"?: string; + /** Parameter value */ + "parameter85.value"?: string; + /** Parameter name */ + "parameter86.name"?: string; + /** Parameter value */ + "parameter86.value"?: string; + /** Parameter name */ + "parameter87.name"?: string; + /** Parameter value */ + "parameter87.value"?: string; + /** Parameter name */ + "parameter88.name"?: string; + /** Parameter value */ + "parameter88.value"?: string; + /** Parameter name */ + "parameter89.name"?: string; + /** Parameter value */ + "parameter89.value"?: string; + /** Parameter name */ + "parameter90.name"?: string; + /** Parameter value */ + "parameter90.value"?: string; + /** Parameter name */ + "parameter91.name"?: string; + /** Parameter value */ + "parameter91.value"?: string; + /** Parameter name */ + "parameter92.name"?: string; + /** Parameter value */ + "parameter92.value"?: string; + /** Parameter name */ + "parameter93.name"?: string; + /** Parameter value */ + "parameter93.value"?: string; + /** Parameter name */ + "parameter94.name"?: string; + /** Parameter value */ + "parameter94.value"?: string; + /** Parameter name */ + "parameter95.name"?: string; + /** Parameter value */ + "parameter95.value"?: string; + /** Parameter name */ + "parameter96.name"?: string; + /** Parameter value */ + "parameter96.value"?: string; + /** Parameter name */ + "parameter97.name"?: string; + /** Parameter value */ + "parameter97.value"?: string; + /** Parameter name */ + "parameter98.name"?: string; + /** Parameter value */ + "parameter98.value"?: string; + /** Parameter name */ + "parameter99.name"?: string; + /** Parameter value */ + "parameter99.value"?: string; +} +export interface SiprecContext { + /** + * Update a SiprecInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SiprecInstance + */ + update(params: SiprecContextUpdateOptions, callback?: (error: Error | null, item?: SiprecInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SiprecContextSolution { + accountSid: string; + callSid: string; + sid: string; +} +export declare class SiprecContextImpl implements SiprecContext { + protected _version: V2010; + protected _solution: SiprecContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, callSid: string, sid: string); + update(params: SiprecContextUpdateOptions, callback?: (error: Error | null, item?: SiprecInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SiprecContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SiprecResource { + sid: string; + account_sid: string; + call_sid: string; + name: string; + status: SiprecStatus; + date_updated: Date; + uri: string; +} +export declare class SiprecInstance { + protected _version: V2010; + protected _solution: SiprecContextSolution; + protected _context?: SiprecContext; + constructor(_version: V2010, payload: SiprecResource, accountSid: string, callSid: string, sid?: string); + /** + * The SID of the Siprec resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Siprec resource. + */ + accountSid: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Siprec resource is associated with. + */ + callSid: string; + /** + * The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. + */ + name: string; + status: SiprecStatus; + /** + * The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Update a SiprecInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SiprecInstance + */ + update(params: SiprecContextUpdateOptions, callback?: (error: Error | null, item?: SiprecInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + callSid: string; + name: string; + status: SiprecStatus; + dateUpdated: Date; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SiprecSolution { + accountSid: string; + callSid: string; +} +export interface SiprecListInstance { + _version: V2010; + _solution: SiprecSolution; + _uri: string; + (sid: string): SiprecContext; + get(sid: string): SiprecContext; + /** + * Create a SiprecInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SiprecInstance + */ + create(callback?: (error: Error | null, item?: SiprecInstance) => any): Promise; + /** + * Create a SiprecInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SiprecInstance + */ + create(params: SiprecListInstanceCreateOptions, callback?: (error: Error | null, item?: SiprecInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SiprecListInstance(version: V2010, accountSid: string, callSid: string): SiprecListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/siprec.js b/node_modules/twilio/lib/rest/api/v2010/account/call/siprec.js new file mode 100644 index 00000000..79c34dc8 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/siprec.js @@ -0,0 +1,562 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SiprecListInstance = exports.SiprecInstance = exports.SiprecContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SiprecContextImpl { + constructor(_version, accountSid, callSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, callSid, sid }; + this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Siprec/${sid}.json`; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SiprecInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SiprecContextImpl = SiprecContextImpl; +class SiprecInstance { + constructor(_version, payload, accountSid, callSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.name = payload.name; + this.status = payload.status; + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.uri = payload.uri; + this._solution = { accountSid, callSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SiprecContextImpl(this._version, this._solution.accountSid, this._solution.callSid, this._solution.sid); + return this._context; + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + callSid: this.callSid, + name: this.name, + status: this.status, + dateUpdated: this.dateUpdated, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SiprecInstance = SiprecInstance; +function SiprecListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SiprecContextImpl(version, accountSid, callSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = `/Accounts/${accountSid}/Calls/${callSid}/Siprec.json`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["name"] !== undefined) + data["Name"] = params["name"]; + if (params["connectorName"] !== undefined) + data["ConnectorName"] = params["connectorName"]; + if (params["track"] !== undefined) + data["Track"] = params["track"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["parameter1.name"] !== undefined) + data["Parameter1.Name"] = params["parameter1.name"]; + if (params["parameter1.value"] !== undefined) + data["Parameter1.Value"] = params["parameter1.value"]; + if (params["parameter2.name"] !== undefined) + data["Parameter2.Name"] = params["parameter2.name"]; + if (params["parameter2.value"] !== undefined) + data["Parameter2.Value"] = params["parameter2.value"]; + if (params["parameter3.name"] !== undefined) + data["Parameter3.Name"] = params["parameter3.name"]; + if (params["parameter3.value"] !== undefined) + data["Parameter3.Value"] = params["parameter3.value"]; + if (params["parameter4.name"] !== undefined) + data["Parameter4.Name"] = params["parameter4.name"]; + if (params["parameter4.value"] !== undefined) + data["Parameter4.Value"] = params["parameter4.value"]; + if (params["parameter5.name"] !== undefined) + data["Parameter5.Name"] = params["parameter5.name"]; + if (params["parameter5.value"] !== undefined) + data["Parameter5.Value"] = params["parameter5.value"]; + if (params["parameter6.name"] !== undefined) + data["Parameter6.Name"] = params["parameter6.name"]; + if (params["parameter6.value"] !== undefined) + data["Parameter6.Value"] = params["parameter6.value"]; + if (params["parameter7.name"] !== undefined) + data["Parameter7.Name"] = params["parameter7.name"]; + if (params["parameter7.value"] !== undefined) + data["Parameter7.Value"] = params["parameter7.value"]; + if (params["parameter8.name"] !== undefined) + data["Parameter8.Name"] = params["parameter8.name"]; + if (params["parameter8.value"] !== undefined) + data["Parameter8.Value"] = params["parameter8.value"]; + if (params["parameter9.name"] !== undefined) + data["Parameter9.Name"] = params["parameter9.name"]; + if (params["parameter9.value"] !== undefined) + data["Parameter9.Value"] = params["parameter9.value"]; + if (params["parameter10.name"] !== undefined) + data["Parameter10.Name"] = params["parameter10.name"]; + if (params["parameter10.value"] !== undefined) + data["Parameter10.Value"] = params["parameter10.value"]; + if (params["parameter11.name"] !== undefined) + data["Parameter11.Name"] = params["parameter11.name"]; + if (params["parameter11.value"] !== undefined) + data["Parameter11.Value"] = params["parameter11.value"]; + if (params["parameter12.name"] !== undefined) + data["Parameter12.Name"] = params["parameter12.name"]; + if (params["parameter12.value"] !== undefined) + data["Parameter12.Value"] = params["parameter12.value"]; + if (params["parameter13.name"] !== undefined) + data["Parameter13.Name"] = params["parameter13.name"]; + if (params["parameter13.value"] !== undefined) + data["Parameter13.Value"] = params["parameter13.value"]; + if (params["parameter14.name"] !== undefined) + data["Parameter14.Name"] = params["parameter14.name"]; + if (params["parameter14.value"] !== undefined) + data["Parameter14.Value"] = params["parameter14.value"]; + if (params["parameter15.name"] !== undefined) + data["Parameter15.Name"] = params["parameter15.name"]; + if (params["parameter15.value"] !== undefined) + data["Parameter15.Value"] = params["parameter15.value"]; + if (params["parameter16.name"] !== undefined) + data["Parameter16.Name"] = params["parameter16.name"]; + if (params["parameter16.value"] !== undefined) + data["Parameter16.Value"] = params["parameter16.value"]; + if (params["parameter17.name"] !== undefined) + data["Parameter17.Name"] = params["parameter17.name"]; + if (params["parameter17.value"] !== undefined) + data["Parameter17.Value"] = params["parameter17.value"]; + if (params["parameter18.name"] !== undefined) + data["Parameter18.Name"] = params["parameter18.name"]; + if (params["parameter18.value"] !== undefined) + data["Parameter18.Value"] = params["parameter18.value"]; + if (params["parameter19.name"] !== undefined) + data["Parameter19.Name"] = params["parameter19.name"]; + if (params["parameter19.value"] !== undefined) + data["Parameter19.Value"] = params["parameter19.value"]; + if (params["parameter20.name"] !== undefined) + data["Parameter20.Name"] = params["parameter20.name"]; + if (params["parameter20.value"] !== undefined) + data["Parameter20.Value"] = params["parameter20.value"]; + if (params["parameter21.name"] !== undefined) + data["Parameter21.Name"] = params["parameter21.name"]; + if (params["parameter21.value"] !== undefined) + data["Parameter21.Value"] = params["parameter21.value"]; + if (params["parameter22.name"] !== undefined) + data["Parameter22.Name"] = params["parameter22.name"]; + if (params["parameter22.value"] !== undefined) + data["Parameter22.Value"] = params["parameter22.value"]; + if (params["parameter23.name"] !== undefined) + data["Parameter23.Name"] = params["parameter23.name"]; + if (params["parameter23.value"] !== undefined) + data["Parameter23.Value"] = params["parameter23.value"]; + if (params["parameter24.name"] !== undefined) + data["Parameter24.Name"] = params["parameter24.name"]; + if (params["parameter24.value"] !== undefined) + data["Parameter24.Value"] = params["parameter24.value"]; + if (params["parameter25.name"] !== undefined) + data["Parameter25.Name"] = params["parameter25.name"]; + if (params["parameter25.value"] !== undefined) + data["Parameter25.Value"] = params["parameter25.value"]; + if (params["parameter26.name"] !== undefined) + data["Parameter26.Name"] = params["parameter26.name"]; + if (params["parameter26.value"] !== undefined) + data["Parameter26.Value"] = params["parameter26.value"]; + if (params["parameter27.name"] !== undefined) + data["Parameter27.Name"] = params["parameter27.name"]; + if (params["parameter27.value"] !== undefined) + data["Parameter27.Value"] = params["parameter27.value"]; + if (params["parameter28.name"] !== undefined) + data["Parameter28.Name"] = params["parameter28.name"]; + if (params["parameter28.value"] !== undefined) + data["Parameter28.Value"] = params["parameter28.value"]; + if (params["parameter29.name"] !== undefined) + data["Parameter29.Name"] = params["parameter29.name"]; + if (params["parameter29.value"] !== undefined) + data["Parameter29.Value"] = params["parameter29.value"]; + if (params["parameter30.name"] !== undefined) + data["Parameter30.Name"] = params["parameter30.name"]; + if (params["parameter30.value"] !== undefined) + data["Parameter30.Value"] = params["parameter30.value"]; + if (params["parameter31.name"] !== undefined) + data["Parameter31.Name"] = params["parameter31.name"]; + if (params["parameter31.value"] !== undefined) + data["Parameter31.Value"] = params["parameter31.value"]; + if (params["parameter32.name"] !== undefined) + data["Parameter32.Name"] = params["parameter32.name"]; + if (params["parameter32.value"] !== undefined) + data["Parameter32.Value"] = params["parameter32.value"]; + if (params["parameter33.name"] !== undefined) + data["Parameter33.Name"] = params["parameter33.name"]; + if (params["parameter33.value"] !== undefined) + data["Parameter33.Value"] = params["parameter33.value"]; + if (params["parameter34.name"] !== undefined) + data["Parameter34.Name"] = params["parameter34.name"]; + if (params["parameter34.value"] !== undefined) + data["Parameter34.Value"] = params["parameter34.value"]; + if (params["parameter35.name"] !== undefined) + data["Parameter35.Name"] = params["parameter35.name"]; + if (params["parameter35.value"] !== undefined) + data["Parameter35.Value"] = params["parameter35.value"]; + if (params["parameter36.name"] !== undefined) + data["Parameter36.Name"] = params["parameter36.name"]; + if (params["parameter36.value"] !== undefined) + data["Parameter36.Value"] = params["parameter36.value"]; + if (params["parameter37.name"] !== undefined) + data["Parameter37.Name"] = params["parameter37.name"]; + if (params["parameter37.value"] !== undefined) + data["Parameter37.Value"] = params["parameter37.value"]; + if (params["parameter38.name"] !== undefined) + data["Parameter38.Name"] = params["parameter38.name"]; + if (params["parameter38.value"] !== undefined) + data["Parameter38.Value"] = params["parameter38.value"]; + if (params["parameter39.name"] !== undefined) + data["Parameter39.Name"] = params["parameter39.name"]; + if (params["parameter39.value"] !== undefined) + data["Parameter39.Value"] = params["parameter39.value"]; + if (params["parameter40.name"] !== undefined) + data["Parameter40.Name"] = params["parameter40.name"]; + if (params["parameter40.value"] !== undefined) + data["Parameter40.Value"] = params["parameter40.value"]; + if (params["parameter41.name"] !== undefined) + data["Parameter41.Name"] = params["parameter41.name"]; + if (params["parameter41.value"] !== undefined) + data["Parameter41.Value"] = params["parameter41.value"]; + if (params["parameter42.name"] !== undefined) + data["Parameter42.Name"] = params["parameter42.name"]; + if (params["parameter42.value"] !== undefined) + data["Parameter42.Value"] = params["parameter42.value"]; + if (params["parameter43.name"] !== undefined) + data["Parameter43.Name"] = params["parameter43.name"]; + if (params["parameter43.value"] !== undefined) + data["Parameter43.Value"] = params["parameter43.value"]; + if (params["parameter44.name"] !== undefined) + data["Parameter44.Name"] = params["parameter44.name"]; + if (params["parameter44.value"] !== undefined) + data["Parameter44.Value"] = params["parameter44.value"]; + if (params["parameter45.name"] !== undefined) + data["Parameter45.Name"] = params["parameter45.name"]; + if (params["parameter45.value"] !== undefined) + data["Parameter45.Value"] = params["parameter45.value"]; + if (params["parameter46.name"] !== undefined) + data["Parameter46.Name"] = params["parameter46.name"]; + if (params["parameter46.value"] !== undefined) + data["Parameter46.Value"] = params["parameter46.value"]; + if (params["parameter47.name"] !== undefined) + data["Parameter47.Name"] = params["parameter47.name"]; + if (params["parameter47.value"] !== undefined) + data["Parameter47.Value"] = params["parameter47.value"]; + if (params["parameter48.name"] !== undefined) + data["Parameter48.Name"] = params["parameter48.name"]; + if (params["parameter48.value"] !== undefined) + data["Parameter48.Value"] = params["parameter48.value"]; + if (params["parameter49.name"] !== undefined) + data["Parameter49.Name"] = params["parameter49.name"]; + if (params["parameter49.value"] !== undefined) + data["Parameter49.Value"] = params["parameter49.value"]; + if (params["parameter50.name"] !== undefined) + data["Parameter50.Name"] = params["parameter50.name"]; + if (params["parameter50.value"] !== undefined) + data["Parameter50.Value"] = params["parameter50.value"]; + if (params["parameter51.name"] !== undefined) + data["Parameter51.Name"] = params["parameter51.name"]; + if (params["parameter51.value"] !== undefined) + data["Parameter51.Value"] = params["parameter51.value"]; + if (params["parameter52.name"] !== undefined) + data["Parameter52.Name"] = params["parameter52.name"]; + if (params["parameter52.value"] !== undefined) + data["Parameter52.Value"] = params["parameter52.value"]; + if (params["parameter53.name"] !== undefined) + data["Parameter53.Name"] = params["parameter53.name"]; + if (params["parameter53.value"] !== undefined) + data["Parameter53.Value"] = params["parameter53.value"]; + if (params["parameter54.name"] !== undefined) + data["Parameter54.Name"] = params["parameter54.name"]; + if (params["parameter54.value"] !== undefined) + data["Parameter54.Value"] = params["parameter54.value"]; + if (params["parameter55.name"] !== undefined) + data["Parameter55.Name"] = params["parameter55.name"]; + if (params["parameter55.value"] !== undefined) + data["Parameter55.Value"] = params["parameter55.value"]; + if (params["parameter56.name"] !== undefined) + data["Parameter56.Name"] = params["parameter56.name"]; + if (params["parameter56.value"] !== undefined) + data["Parameter56.Value"] = params["parameter56.value"]; + if (params["parameter57.name"] !== undefined) + data["Parameter57.Name"] = params["parameter57.name"]; + if (params["parameter57.value"] !== undefined) + data["Parameter57.Value"] = params["parameter57.value"]; + if (params["parameter58.name"] !== undefined) + data["Parameter58.Name"] = params["parameter58.name"]; + if (params["parameter58.value"] !== undefined) + data["Parameter58.Value"] = params["parameter58.value"]; + if (params["parameter59.name"] !== undefined) + data["Parameter59.Name"] = params["parameter59.name"]; + if (params["parameter59.value"] !== undefined) + data["Parameter59.Value"] = params["parameter59.value"]; + if (params["parameter60.name"] !== undefined) + data["Parameter60.Name"] = params["parameter60.name"]; + if (params["parameter60.value"] !== undefined) + data["Parameter60.Value"] = params["parameter60.value"]; + if (params["parameter61.name"] !== undefined) + data["Parameter61.Name"] = params["parameter61.name"]; + if (params["parameter61.value"] !== undefined) + data["Parameter61.Value"] = params["parameter61.value"]; + if (params["parameter62.name"] !== undefined) + data["Parameter62.Name"] = params["parameter62.name"]; + if (params["parameter62.value"] !== undefined) + data["Parameter62.Value"] = params["parameter62.value"]; + if (params["parameter63.name"] !== undefined) + data["Parameter63.Name"] = params["parameter63.name"]; + if (params["parameter63.value"] !== undefined) + data["Parameter63.Value"] = params["parameter63.value"]; + if (params["parameter64.name"] !== undefined) + data["Parameter64.Name"] = params["parameter64.name"]; + if (params["parameter64.value"] !== undefined) + data["Parameter64.Value"] = params["parameter64.value"]; + if (params["parameter65.name"] !== undefined) + data["Parameter65.Name"] = params["parameter65.name"]; + if (params["parameter65.value"] !== undefined) + data["Parameter65.Value"] = params["parameter65.value"]; + if (params["parameter66.name"] !== undefined) + data["Parameter66.Name"] = params["parameter66.name"]; + if (params["parameter66.value"] !== undefined) + data["Parameter66.Value"] = params["parameter66.value"]; + if (params["parameter67.name"] !== undefined) + data["Parameter67.Name"] = params["parameter67.name"]; + if (params["parameter67.value"] !== undefined) + data["Parameter67.Value"] = params["parameter67.value"]; + if (params["parameter68.name"] !== undefined) + data["Parameter68.Name"] = params["parameter68.name"]; + if (params["parameter68.value"] !== undefined) + data["Parameter68.Value"] = params["parameter68.value"]; + if (params["parameter69.name"] !== undefined) + data["Parameter69.Name"] = params["parameter69.name"]; + if (params["parameter69.value"] !== undefined) + data["Parameter69.Value"] = params["parameter69.value"]; + if (params["parameter70.name"] !== undefined) + data["Parameter70.Name"] = params["parameter70.name"]; + if (params["parameter70.value"] !== undefined) + data["Parameter70.Value"] = params["parameter70.value"]; + if (params["parameter71.name"] !== undefined) + data["Parameter71.Name"] = params["parameter71.name"]; + if (params["parameter71.value"] !== undefined) + data["Parameter71.Value"] = params["parameter71.value"]; + if (params["parameter72.name"] !== undefined) + data["Parameter72.Name"] = params["parameter72.name"]; + if (params["parameter72.value"] !== undefined) + data["Parameter72.Value"] = params["parameter72.value"]; + if (params["parameter73.name"] !== undefined) + data["Parameter73.Name"] = params["parameter73.name"]; + if (params["parameter73.value"] !== undefined) + data["Parameter73.Value"] = params["parameter73.value"]; + if (params["parameter74.name"] !== undefined) + data["Parameter74.Name"] = params["parameter74.name"]; + if (params["parameter74.value"] !== undefined) + data["Parameter74.Value"] = params["parameter74.value"]; + if (params["parameter75.name"] !== undefined) + data["Parameter75.Name"] = params["parameter75.name"]; + if (params["parameter75.value"] !== undefined) + data["Parameter75.Value"] = params["parameter75.value"]; + if (params["parameter76.name"] !== undefined) + data["Parameter76.Name"] = params["parameter76.name"]; + if (params["parameter76.value"] !== undefined) + data["Parameter76.Value"] = params["parameter76.value"]; + if (params["parameter77.name"] !== undefined) + data["Parameter77.Name"] = params["parameter77.name"]; + if (params["parameter77.value"] !== undefined) + data["Parameter77.Value"] = params["parameter77.value"]; + if (params["parameter78.name"] !== undefined) + data["Parameter78.Name"] = params["parameter78.name"]; + if (params["parameter78.value"] !== undefined) + data["Parameter78.Value"] = params["parameter78.value"]; + if (params["parameter79.name"] !== undefined) + data["Parameter79.Name"] = params["parameter79.name"]; + if (params["parameter79.value"] !== undefined) + data["Parameter79.Value"] = params["parameter79.value"]; + if (params["parameter80.name"] !== undefined) + data["Parameter80.Name"] = params["parameter80.name"]; + if (params["parameter80.value"] !== undefined) + data["Parameter80.Value"] = params["parameter80.value"]; + if (params["parameter81.name"] !== undefined) + data["Parameter81.Name"] = params["parameter81.name"]; + if (params["parameter81.value"] !== undefined) + data["Parameter81.Value"] = params["parameter81.value"]; + if (params["parameter82.name"] !== undefined) + data["Parameter82.Name"] = params["parameter82.name"]; + if (params["parameter82.value"] !== undefined) + data["Parameter82.Value"] = params["parameter82.value"]; + if (params["parameter83.name"] !== undefined) + data["Parameter83.Name"] = params["parameter83.name"]; + if (params["parameter83.value"] !== undefined) + data["Parameter83.Value"] = params["parameter83.value"]; + if (params["parameter84.name"] !== undefined) + data["Parameter84.Name"] = params["parameter84.name"]; + if (params["parameter84.value"] !== undefined) + data["Parameter84.Value"] = params["parameter84.value"]; + if (params["parameter85.name"] !== undefined) + data["Parameter85.Name"] = params["parameter85.name"]; + if (params["parameter85.value"] !== undefined) + data["Parameter85.Value"] = params["parameter85.value"]; + if (params["parameter86.name"] !== undefined) + data["Parameter86.Name"] = params["parameter86.name"]; + if (params["parameter86.value"] !== undefined) + data["Parameter86.Value"] = params["parameter86.value"]; + if (params["parameter87.name"] !== undefined) + data["Parameter87.Name"] = params["parameter87.name"]; + if (params["parameter87.value"] !== undefined) + data["Parameter87.Value"] = params["parameter87.value"]; + if (params["parameter88.name"] !== undefined) + data["Parameter88.Name"] = params["parameter88.name"]; + if (params["parameter88.value"] !== undefined) + data["Parameter88.Value"] = params["parameter88.value"]; + if (params["parameter89.name"] !== undefined) + data["Parameter89.Name"] = params["parameter89.name"]; + if (params["parameter89.value"] !== undefined) + data["Parameter89.Value"] = params["parameter89.value"]; + if (params["parameter90.name"] !== undefined) + data["Parameter90.Name"] = params["parameter90.name"]; + if (params["parameter90.value"] !== undefined) + data["Parameter90.Value"] = params["parameter90.value"]; + if (params["parameter91.name"] !== undefined) + data["Parameter91.Name"] = params["parameter91.name"]; + if (params["parameter91.value"] !== undefined) + data["Parameter91.Value"] = params["parameter91.value"]; + if (params["parameter92.name"] !== undefined) + data["Parameter92.Name"] = params["parameter92.name"]; + if (params["parameter92.value"] !== undefined) + data["Parameter92.Value"] = params["parameter92.value"]; + if (params["parameter93.name"] !== undefined) + data["Parameter93.Name"] = params["parameter93.name"]; + if (params["parameter93.value"] !== undefined) + data["Parameter93.Value"] = params["parameter93.value"]; + if (params["parameter94.name"] !== undefined) + data["Parameter94.Name"] = params["parameter94.name"]; + if (params["parameter94.value"] !== undefined) + data["Parameter94.Value"] = params["parameter94.value"]; + if (params["parameter95.name"] !== undefined) + data["Parameter95.Name"] = params["parameter95.name"]; + if (params["parameter95.value"] !== undefined) + data["Parameter95.Value"] = params["parameter95.value"]; + if (params["parameter96.name"] !== undefined) + data["Parameter96.Name"] = params["parameter96.name"]; + if (params["parameter96.value"] !== undefined) + data["Parameter96.Value"] = params["parameter96.value"]; + if (params["parameter97.name"] !== undefined) + data["Parameter97.Name"] = params["parameter97.name"]; + if (params["parameter97.value"] !== undefined) + data["Parameter97.Value"] = params["parameter97.value"]; + if (params["parameter98.name"] !== undefined) + data["Parameter98.Name"] = params["parameter98.name"]; + if (params["parameter98.value"] !== undefined) + data["Parameter98.Value"] = params["parameter98.value"]; + if (params["parameter99.name"] !== undefined) + data["Parameter99.Name"] = params["parameter99.name"]; + if (params["parameter99.value"] !== undefined) + data["Parameter99.Value"] = params["parameter99.value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SiprecInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SiprecListInstance = SiprecListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/stream.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/stream.d.ts new file mode 100644 index 00000000..c984df8f --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/stream.d.ts @@ -0,0 +1,551 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../V2010"; +export type StreamStatus = "in-progress" | "stopped"; +export type StreamTrack = "inbound_track" | "outbound_track" | "both_tracks"; +export type StreamUpdateStatus = "stopped"; +/** + * Options to pass to update a StreamInstance + */ +export interface StreamContextUpdateOptions { + /** */ + status: StreamUpdateStatus; +} +/** + * Options to pass to create a StreamInstance + */ +export interface StreamListInstanceCreateOptions { + /** Relative or absolute url where WebSocket connection will be established. */ + url: string; + /** The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. */ + name?: string; + /** */ + track?: StreamTrack; + /** Absolute URL of the status callback. */ + statusCallback?: string; + /** The http method for the status_callback (one of GET, POST). */ + statusCallbackMethod?: string; + /** Parameter name */ + "parameter1.name"?: string; + /** Parameter value */ + "parameter1.value"?: string; + /** Parameter name */ + "parameter2.name"?: string; + /** Parameter value */ + "parameter2.value"?: string; + /** Parameter name */ + "parameter3.name"?: string; + /** Parameter value */ + "parameter3.value"?: string; + /** Parameter name */ + "parameter4.name"?: string; + /** Parameter value */ + "parameter4.value"?: string; + /** Parameter name */ + "parameter5.name"?: string; + /** Parameter value */ + "parameter5.value"?: string; + /** Parameter name */ + "parameter6.name"?: string; + /** Parameter value */ + "parameter6.value"?: string; + /** Parameter name */ + "parameter7.name"?: string; + /** Parameter value */ + "parameter7.value"?: string; + /** Parameter name */ + "parameter8.name"?: string; + /** Parameter value */ + "parameter8.value"?: string; + /** Parameter name */ + "parameter9.name"?: string; + /** Parameter value */ + "parameter9.value"?: string; + /** Parameter name */ + "parameter10.name"?: string; + /** Parameter value */ + "parameter10.value"?: string; + /** Parameter name */ + "parameter11.name"?: string; + /** Parameter value */ + "parameter11.value"?: string; + /** Parameter name */ + "parameter12.name"?: string; + /** Parameter value */ + "parameter12.value"?: string; + /** Parameter name */ + "parameter13.name"?: string; + /** Parameter value */ + "parameter13.value"?: string; + /** Parameter name */ + "parameter14.name"?: string; + /** Parameter value */ + "parameter14.value"?: string; + /** Parameter name */ + "parameter15.name"?: string; + /** Parameter value */ + "parameter15.value"?: string; + /** Parameter name */ + "parameter16.name"?: string; + /** Parameter value */ + "parameter16.value"?: string; + /** Parameter name */ + "parameter17.name"?: string; + /** Parameter value */ + "parameter17.value"?: string; + /** Parameter name */ + "parameter18.name"?: string; + /** Parameter value */ + "parameter18.value"?: string; + /** Parameter name */ + "parameter19.name"?: string; + /** Parameter value */ + "parameter19.value"?: string; + /** Parameter name */ + "parameter20.name"?: string; + /** Parameter value */ + "parameter20.value"?: string; + /** Parameter name */ + "parameter21.name"?: string; + /** Parameter value */ + "parameter21.value"?: string; + /** Parameter name */ + "parameter22.name"?: string; + /** Parameter value */ + "parameter22.value"?: string; + /** Parameter name */ + "parameter23.name"?: string; + /** Parameter value */ + "parameter23.value"?: string; + /** Parameter name */ + "parameter24.name"?: string; + /** Parameter value */ + "parameter24.value"?: string; + /** Parameter name */ + "parameter25.name"?: string; + /** Parameter value */ + "parameter25.value"?: string; + /** Parameter name */ + "parameter26.name"?: string; + /** Parameter value */ + "parameter26.value"?: string; + /** Parameter name */ + "parameter27.name"?: string; + /** Parameter value */ + "parameter27.value"?: string; + /** Parameter name */ + "parameter28.name"?: string; + /** Parameter value */ + "parameter28.value"?: string; + /** Parameter name */ + "parameter29.name"?: string; + /** Parameter value */ + "parameter29.value"?: string; + /** Parameter name */ + "parameter30.name"?: string; + /** Parameter value */ + "parameter30.value"?: string; + /** Parameter name */ + "parameter31.name"?: string; + /** Parameter value */ + "parameter31.value"?: string; + /** Parameter name */ + "parameter32.name"?: string; + /** Parameter value */ + "parameter32.value"?: string; + /** Parameter name */ + "parameter33.name"?: string; + /** Parameter value */ + "parameter33.value"?: string; + /** Parameter name */ + "parameter34.name"?: string; + /** Parameter value */ + "parameter34.value"?: string; + /** Parameter name */ + "parameter35.name"?: string; + /** Parameter value */ + "parameter35.value"?: string; + /** Parameter name */ + "parameter36.name"?: string; + /** Parameter value */ + "parameter36.value"?: string; + /** Parameter name */ + "parameter37.name"?: string; + /** Parameter value */ + "parameter37.value"?: string; + /** Parameter name */ + "parameter38.name"?: string; + /** Parameter value */ + "parameter38.value"?: string; + /** Parameter name */ + "parameter39.name"?: string; + /** Parameter value */ + "parameter39.value"?: string; + /** Parameter name */ + "parameter40.name"?: string; + /** Parameter value */ + "parameter40.value"?: string; + /** Parameter name */ + "parameter41.name"?: string; + /** Parameter value */ + "parameter41.value"?: string; + /** Parameter name */ + "parameter42.name"?: string; + /** Parameter value */ + "parameter42.value"?: string; + /** Parameter name */ + "parameter43.name"?: string; + /** Parameter value */ + "parameter43.value"?: string; + /** Parameter name */ + "parameter44.name"?: string; + /** Parameter value */ + "parameter44.value"?: string; + /** Parameter name */ + "parameter45.name"?: string; + /** Parameter value */ + "parameter45.value"?: string; + /** Parameter name */ + "parameter46.name"?: string; + /** Parameter value */ + "parameter46.value"?: string; + /** Parameter name */ + "parameter47.name"?: string; + /** Parameter value */ + "parameter47.value"?: string; + /** Parameter name */ + "parameter48.name"?: string; + /** Parameter value */ + "parameter48.value"?: string; + /** Parameter name */ + "parameter49.name"?: string; + /** Parameter value */ + "parameter49.value"?: string; + /** Parameter name */ + "parameter50.name"?: string; + /** Parameter value */ + "parameter50.value"?: string; + /** Parameter name */ + "parameter51.name"?: string; + /** Parameter value */ + "parameter51.value"?: string; + /** Parameter name */ + "parameter52.name"?: string; + /** Parameter value */ + "parameter52.value"?: string; + /** Parameter name */ + "parameter53.name"?: string; + /** Parameter value */ + "parameter53.value"?: string; + /** Parameter name */ + "parameter54.name"?: string; + /** Parameter value */ + "parameter54.value"?: string; + /** Parameter name */ + "parameter55.name"?: string; + /** Parameter value */ + "parameter55.value"?: string; + /** Parameter name */ + "parameter56.name"?: string; + /** Parameter value */ + "parameter56.value"?: string; + /** Parameter name */ + "parameter57.name"?: string; + /** Parameter value */ + "parameter57.value"?: string; + /** Parameter name */ + "parameter58.name"?: string; + /** Parameter value */ + "parameter58.value"?: string; + /** Parameter name */ + "parameter59.name"?: string; + /** Parameter value */ + "parameter59.value"?: string; + /** Parameter name */ + "parameter60.name"?: string; + /** Parameter value */ + "parameter60.value"?: string; + /** Parameter name */ + "parameter61.name"?: string; + /** Parameter value */ + "parameter61.value"?: string; + /** Parameter name */ + "parameter62.name"?: string; + /** Parameter value */ + "parameter62.value"?: string; + /** Parameter name */ + "parameter63.name"?: string; + /** Parameter value */ + "parameter63.value"?: string; + /** Parameter name */ + "parameter64.name"?: string; + /** Parameter value */ + "parameter64.value"?: string; + /** Parameter name */ + "parameter65.name"?: string; + /** Parameter value */ + "parameter65.value"?: string; + /** Parameter name */ + "parameter66.name"?: string; + /** Parameter value */ + "parameter66.value"?: string; + /** Parameter name */ + "parameter67.name"?: string; + /** Parameter value */ + "parameter67.value"?: string; + /** Parameter name */ + "parameter68.name"?: string; + /** Parameter value */ + "parameter68.value"?: string; + /** Parameter name */ + "parameter69.name"?: string; + /** Parameter value */ + "parameter69.value"?: string; + /** Parameter name */ + "parameter70.name"?: string; + /** Parameter value */ + "parameter70.value"?: string; + /** Parameter name */ + "parameter71.name"?: string; + /** Parameter value */ + "parameter71.value"?: string; + /** Parameter name */ + "parameter72.name"?: string; + /** Parameter value */ + "parameter72.value"?: string; + /** Parameter name */ + "parameter73.name"?: string; + /** Parameter value */ + "parameter73.value"?: string; + /** Parameter name */ + "parameter74.name"?: string; + /** Parameter value */ + "parameter74.value"?: string; + /** Parameter name */ + "parameter75.name"?: string; + /** Parameter value */ + "parameter75.value"?: string; + /** Parameter name */ + "parameter76.name"?: string; + /** Parameter value */ + "parameter76.value"?: string; + /** Parameter name */ + "parameter77.name"?: string; + /** Parameter value */ + "parameter77.value"?: string; + /** Parameter name */ + "parameter78.name"?: string; + /** Parameter value */ + "parameter78.value"?: string; + /** Parameter name */ + "parameter79.name"?: string; + /** Parameter value */ + "parameter79.value"?: string; + /** Parameter name */ + "parameter80.name"?: string; + /** Parameter value */ + "parameter80.value"?: string; + /** Parameter name */ + "parameter81.name"?: string; + /** Parameter value */ + "parameter81.value"?: string; + /** Parameter name */ + "parameter82.name"?: string; + /** Parameter value */ + "parameter82.value"?: string; + /** Parameter name */ + "parameter83.name"?: string; + /** Parameter value */ + "parameter83.value"?: string; + /** Parameter name */ + "parameter84.name"?: string; + /** Parameter value */ + "parameter84.value"?: string; + /** Parameter name */ + "parameter85.name"?: string; + /** Parameter value */ + "parameter85.value"?: string; + /** Parameter name */ + "parameter86.name"?: string; + /** Parameter value */ + "parameter86.value"?: string; + /** Parameter name */ + "parameter87.name"?: string; + /** Parameter value */ + "parameter87.value"?: string; + /** Parameter name */ + "parameter88.name"?: string; + /** Parameter value */ + "parameter88.value"?: string; + /** Parameter name */ + "parameter89.name"?: string; + /** Parameter value */ + "parameter89.value"?: string; + /** Parameter name */ + "parameter90.name"?: string; + /** Parameter value */ + "parameter90.value"?: string; + /** Parameter name */ + "parameter91.name"?: string; + /** Parameter value */ + "parameter91.value"?: string; + /** Parameter name */ + "parameter92.name"?: string; + /** Parameter value */ + "parameter92.value"?: string; + /** Parameter name */ + "parameter93.name"?: string; + /** Parameter value */ + "parameter93.value"?: string; + /** Parameter name */ + "parameter94.name"?: string; + /** Parameter value */ + "parameter94.value"?: string; + /** Parameter name */ + "parameter95.name"?: string; + /** Parameter value */ + "parameter95.value"?: string; + /** Parameter name */ + "parameter96.name"?: string; + /** Parameter value */ + "parameter96.value"?: string; + /** Parameter name */ + "parameter97.name"?: string; + /** Parameter value */ + "parameter97.value"?: string; + /** Parameter name */ + "parameter98.name"?: string; + /** Parameter value */ + "parameter98.value"?: string; + /** Parameter name */ + "parameter99.name"?: string; + /** Parameter value */ + "parameter99.value"?: string; +} +export interface StreamContext { + /** + * Update a StreamInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StreamInstance + */ + update(params: StreamContextUpdateOptions, callback?: (error: Error | null, item?: StreamInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface StreamContextSolution { + accountSid: string; + callSid: string; + sid: string; +} +export declare class StreamContextImpl implements StreamContext { + protected _version: V2010; + protected _solution: StreamContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, callSid: string, sid: string); + update(params: StreamContextUpdateOptions, callback?: (error: Error | null, item?: StreamInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): StreamContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface StreamResource { + sid: string; + account_sid: string; + call_sid: string; + name: string; + status: StreamStatus; + date_updated: Date; + uri: string; +} +export declare class StreamInstance { + protected _version: V2010; + protected _solution: StreamContextSolution; + protected _context?: StreamContext; + constructor(_version: V2010, payload: StreamResource, accountSid: string, callSid: string, sid?: string); + /** + * The SID of the Stream resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Stream resource. + */ + accountSid: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with. + */ + callSid: string; + /** + * The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. + */ + name: string; + status: StreamStatus; + /** + * The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Update a StreamInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StreamInstance + */ + update(params: StreamContextUpdateOptions, callback?: (error: Error | null, item?: StreamInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + callSid: string; + name: string; + status: StreamStatus; + dateUpdated: Date; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface StreamSolution { + accountSid: string; + callSid: string; +} +export interface StreamListInstance { + _version: V2010; + _solution: StreamSolution; + _uri: string; + (sid: string): StreamContext; + get(sid: string): StreamContext; + /** + * Create a StreamInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StreamInstance + */ + create(params: StreamListInstanceCreateOptions, callback?: (error: Error | null, item?: StreamInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function StreamListInstance(version: V2010, accountSid: string, callSid: string): StreamListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/stream.js b/node_modules/twilio/lib/rest/api/v2010/account/call/stream.js new file mode 100644 index 00000000..f9547b37 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/stream.js @@ -0,0 +1,560 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StreamListInstance = exports.StreamInstance = exports.StreamContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class StreamContextImpl { + constructor(_version, accountSid, callSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, callSid, sid }; + this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Streams/${sid}.json`; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new StreamInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.StreamContextImpl = StreamContextImpl; +class StreamInstance { + constructor(_version, payload, accountSid, callSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.name = payload.name; + this.status = payload.status; + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.uri = payload.uri; + this._solution = { accountSid, callSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new StreamContextImpl(this._version, this._solution.accountSid, this._solution.callSid, this._solution.sid); + return this._context; + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + callSid: this.callSid, + name: this.name, + status: this.status, + dateUpdated: this.dateUpdated, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.StreamInstance = StreamInstance; +function StreamListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new StreamContextImpl(version, accountSid, callSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = `/Accounts/${accountSid}/Calls/${callSid}/Streams.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["url"] === null || params["url"] === undefined) { + throw new Error("Required parameter \"params['url']\" missing."); + } + let data = {}; + data["Url"] = params["url"]; + if (params["name"] !== undefined) + data["Name"] = params["name"]; + if (params["track"] !== undefined) + data["Track"] = params["track"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["parameter1.name"] !== undefined) + data["Parameter1.Name"] = params["parameter1.name"]; + if (params["parameter1.value"] !== undefined) + data["Parameter1.Value"] = params["parameter1.value"]; + if (params["parameter2.name"] !== undefined) + data["Parameter2.Name"] = params["parameter2.name"]; + if (params["parameter2.value"] !== undefined) + data["Parameter2.Value"] = params["parameter2.value"]; + if (params["parameter3.name"] !== undefined) + data["Parameter3.Name"] = params["parameter3.name"]; + if (params["parameter3.value"] !== undefined) + data["Parameter3.Value"] = params["parameter3.value"]; + if (params["parameter4.name"] !== undefined) + data["Parameter4.Name"] = params["parameter4.name"]; + if (params["parameter4.value"] !== undefined) + data["Parameter4.Value"] = params["parameter4.value"]; + if (params["parameter5.name"] !== undefined) + data["Parameter5.Name"] = params["parameter5.name"]; + if (params["parameter5.value"] !== undefined) + data["Parameter5.Value"] = params["parameter5.value"]; + if (params["parameter6.name"] !== undefined) + data["Parameter6.Name"] = params["parameter6.name"]; + if (params["parameter6.value"] !== undefined) + data["Parameter6.Value"] = params["parameter6.value"]; + if (params["parameter7.name"] !== undefined) + data["Parameter7.Name"] = params["parameter7.name"]; + if (params["parameter7.value"] !== undefined) + data["Parameter7.Value"] = params["parameter7.value"]; + if (params["parameter8.name"] !== undefined) + data["Parameter8.Name"] = params["parameter8.name"]; + if (params["parameter8.value"] !== undefined) + data["Parameter8.Value"] = params["parameter8.value"]; + if (params["parameter9.name"] !== undefined) + data["Parameter9.Name"] = params["parameter9.name"]; + if (params["parameter9.value"] !== undefined) + data["Parameter9.Value"] = params["parameter9.value"]; + if (params["parameter10.name"] !== undefined) + data["Parameter10.Name"] = params["parameter10.name"]; + if (params["parameter10.value"] !== undefined) + data["Parameter10.Value"] = params["parameter10.value"]; + if (params["parameter11.name"] !== undefined) + data["Parameter11.Name"] = params["parameter11.name"]; + if (params["parameter11.value"] !== undefined) + data["Parameter11.Value"] = params["parameter11.value"]; + if (params["parameter12.name"] !== undefined) + data["Parameter12.Name"] = params["parameter12.name"]; + if (params["parameter12.value"] !== undefined) + data["Parameter12.Value"] = params["parameter12.value"]; + if (params["parameter13.name"] !== undefined) + data["Parameter13.Name"] = params["parameter13.name"]; + if (params["parameter13.value"] !== undefined) + data["Parameter13.Value"] = params["parameter13.value"]; + if (params["parameter14.name"] !== undefined) + data["Parameter14.Name"] = params["parameter14.name"]; + if (params["parameter14.value"] !== undefined) + data["Parameter14.Value"] = params["parameter14.value"]; + if (params["parameter15.name"] !== undefined) + data["Parameter15.Name"] = params["parameter15.name"]; + if (params["parameter15.value"] !== undefined) + data["Parameter15.Value"] = params["parameter15.value"]; + if (params["parameter16.name"] !== undefined) + data["Parameter16.Name"] = params["parameter16.name"]; + if (params["parameter16.value"] !== undefined) + data["Parameter16.Value"] = params["parameter16.value"]; + if (params["parameter17.name"] !== undefined) + data["Parameter17.Name"] = params["parameter17.name"]; + if (params["parameter17.value"] !== undefined) + data["Parameter17.Value"] = params["parameter17.value"]; + if (params["parameter18.name"] !== undefined) + data["Parameter18.Name"] = params["parameter18.name"]; + if (params["parameter18.value"] !== undefined) + data["Parameter18.Value"] = params["parameter18.value"]; + if (params["parameter19.name"] !== undefined) + data["Parameter19.Name"] = params["parameter19.name"]; + if (params["parameter19.value"] !== undefined) + data["Parameter19.Value"] = params["parameter19.value"]; + if (params["parameter20.name"] !== undefined) + data["Parameter20.Name"] = params["parameter20.name"]; + if (params["parameter20.value"] !== undefined) + data["Parameter20.Value"] = params["parameter20.value"]; + if (params["parameter21.name"] !== undefined) + data["Parameter21.Name"] = params["parameter21.name"]; + if (params["parameter21.value"] !== undefined) + data["Parameter21.Value"] = params["parameter21.value"]; + if (params["parameter22.name"] !== undefined) + data["Parameter22.Name"] = params["parameter22.name"]; + if (params["parameter22.value"] !== undefined) + data["Parameter22.Value"] = params["parameter22.value"]; + if (params["parameter23.name"] !== undefined) + data["Parameter23.Name"] = params["parameter23.name"]; + if (params["parameter23.value"] !== undefined) + data["Parameter23.Value"] = params["parameter23.value"]; + if (params["parameter24.name"] !== undefined) + data["Parameter24.Name"] = params["parameter24.name"]; + if (params["parameter24.value"] !== undefined) + data["Parameter24.Value"] = params["parameter24.value"]; + if (params["parameter25.name"] !== undefined) + data["Parameter25.Name"] = params["parameter25.name"]; + if (params["parameter25.value"] !== undefined) + data["Parameter25.Value"] = params["parameter25.value"]; + if (params["parameter26.name"] !== undefined) + data["Parameter26.Name"] = params["parameter26.name"]; + if (params["parameter26.value"] !== undefined) + data["Parameter26.Value"] = params["parameter26.value"]; + if (params["parameter27.name"] !== undefined) + data["Parameter27.Name"] = params["parameter27.name"]; + if (params["parameter27.value"] !== undefined) + data["Parameter27.Value"] = params["parameter27.value"]; + if (params["parameter28.name"] !== undefined) + data["Parameter28.Name"] = params["parameter28.name"]; + if (params["parameter28.value"] !== undefined) + data["Parameter28.Value"] = params["parameter28.value"]; + if (params["parameter29.name"] !== undefined) + data["Parameter29.Name"] = params["parameter29.name"]; + if (params["parameter29.value"] !== undefined) + data["Parameter29.Value"] = params["parameter29.value"]; + if (params["parameter30.name"] !== undefined) + data["Parameter30.Name"] = params["parameter30.name"]; + if (params["parameter30.value"] !== undefined) + data["Parameter30.Value"] = params["parameter30.value"]; + if (params["parameter31.name"] !== undefined) + data["Parameter31.Name"] = params["parameter31.name"]; + if (params["parameter31.value"] !== undefined) + data["Parameter31.Value"] = params["parameter31.value"]; + if (params["parameter32.name"] !== undefined) + data["Parameter32.Name"] = params["parameter32.name"]; + if (params["parameter32.value"] !== undefined) + data["Parameter32.Value"] = params["parameter32.value"]; + if (params["parameter33.name"] !== undefined) + data["Parameter33.Name"] = params["parameter33.name"]; + if (params["parameter33.value"] !== undefined) + data["Parameter33.Value"] = params["parameter33.value"]; + if (params["parameter34.name"] !== undefined) + data["Parameter34.Name"] = params["parameter34.name"]; + if (params["parameter34.value"] !== undefined) + data["Parameter34.Value"] = params["parameter34.value"]; + if (params["parameter35.name"] !== undefined) + data["Parameter35.Name"] = params["parameter35.name"]; + if (params["parameter35.value"] !== undefined) + data["Parameter35.Value"] = params["parameter35.value"]; + if (params["parameter36.name"] !== undefined) + data["Parameter36.Name"] = params["parameter36.name"]; + if (params["parameter36.value"] !== undefined) + data["Parameter36.Value"] = params["parameter36.value"]; + if (params["parameter37.name"] !== undefined) + data["Parameter37.Name"] = params["parameter37.name"]; + if (params["parameter37.value"] !== undefined) + data["Parameter37.Value"] = params["parameter37.value"]; + if (params["parameter38.name"] !== undefined) + data["Parameter38.Name"] = params["parameter38.name"]; + if (params["parameter38.value"] !== undefined) + data["Parameter38.Value"] = params["parameter38.value"]; + if (params["parameter39.name"] !== undefined) + data["Parameter39.Name"] = params["parameter39.name"]; + if (params["parameter39.value"] !== undefined) + data["Parameter39.Value"] = params["parameter39.value"]; + if (params["parameter40.name"] !== undefined) + data["Parameter40.Name"] = params["parameter40.name"]; + if (params["parameter40.value"] !== undefined) + data["Parameter40.Value"] = params["parameter40.value"]; + if (params["parameter41.name"] !== undefined) + data["Parameter41.Name"] = params["parameter41.name"]; + if (params["parameter41.value"] !== undefined) + data["Parameter41.Value"] = params["parameter41.value"]; + if (params["parameter42.name"] !== undefined) + data["Parameter42.Name"] = params["parameter42.name"]; + if (params["parameter42.value"] !== undefined) + data["Parameter42.Value"] = params["parameter42.value"]; + if (params["parameter43.name"] !== undefined) + data["Parameter43.Name"] = params["parameter43.name"]; + if (params["parameter43.value"] !== undefined) + data["Parameter43.Value"] = params["parameter43.value"]; + if (params["parameter44.name"] !== undefined) + data["Parameter44.Name"] = params["parameter44.name"]; + if (params["parameter44.value"] !== undefined) + data["Parameter44.Value"] = params["parameter44.value"]; + if (params["parameter45.name"] !== undefined) + data["Parameter45.Name"] = params["parameter45.name"]; + if (params["parameter45.value"] !== undefined) + data["Parameter45.Value"] = params["parameter45.value"]; + if (params["parameter46.name"] !== undefined) + data["Parameter46.Name"] = params["parameter46.name"]; + if (params["parameter46.value"] !== undefined) + data["Parameter46.Value"] = params["parameter46.value"]; + if (params["parameter47.name"] !== undefined) + data["Parameter47.Name"] = params["parameter47.name"]; + if (params["parameter47.value"] !== undefined) + data["Parameter47.Value"] = params["parameter47.value"]; + if (params["parameter48.name"] !== undefined) + data["Parameter48.Name"] = params["parameter48.name"]; + if (params["parameter48.value"] !== undefined) + data["Parameter48.Value"] = params["parameter48.value"]; + if (params["parameter49.name"] !== undefined) + data["Parameter49.Name"] = params["parameter49.name"]; + if (params["parameter49.value"] !== undefined) + data["Parameter49.Value"] = params["parameter49.value"]; + if (params["parameter50.name"] !== undefined) + data["Parameter50.Name"] = params["parameter50.name"]; + if (params["parameter50.value"] !== undefined) + data["Parameter50.Value"] = params["parameter50.value"]; + if (params["parameter51.name"] !== undefined) + data["Parameter51.Name"] = params["parameter51.name"]; + if (params["parameter51.value"] !== undefined) + data["Parameter51.Value"] = params["parameter51.value"]; + if (params["parameter52.name"] !== undefined) + data["Parameter52.Name"] = params["parameter52.name"]; + if (params["parameter52.value"] !== undefined) + data["Parameter52.Value"] = params["parameter52.value"]; + if (params["parameter53.name"] !== undefined) + data["Parameter53.Name"] = params["parameter53.name"]; + if (params["parameter53.value"] !== undefined) + data["Parameter53.Value"] = params["parameter53.value"]; + if (params["parameter54.name"] !== undefined) + data["Parameter54.Name"] = params["parameter54.name"]; + if (params["parameter54.value"] !== undefined) + data["Parameter54.Value"] = params["parameter54.value"]; + if (params["parameter55.name"] !== undefined) + data["Parameter55.Name"] = params["parameter55.name"]; + if (params["parameter55.value"] !== undefined) + data["Parameter55.Value"] = params["parameter55.value"]; + if (params["parameter56.name"] !== undefined) + data["Parameter56.Name"] = params["parameter56.name"]; + if (params["parameter56.value"] !== undefined) + data["Parameter56.Value"] = params["parameter56.value"]; + if (params["parameter57.name"] !== undefined) + data["Parameter57.Name"] = params["parameter57.name"]; + if (params["parameter57.value"] !== undefined) + data["Parameter57.Value"] = params["parameter57.value"]; + if (params["parameter58.name"] !== undefined) + data["Parameter58.Name"] = params["parameter58.name"]; + if (params["parameter58.value"] !== undefined) + data["Parameter58.Value"] = params["parameter58.value"]; + if (params["parameter59.name"] !== undefined) + data["Parameter59.Name"] = params["parameter59.name"]; + if (params["parameter59.value"] !== undefined) + data["Parameter59.Value"] = params["parameter59.value"]; + if (params["parameter60.name"] !== undefined) + data["Parameter60.Name"] = params["parameter60.name"]; + if (params["parameter60.value"] !== undefined) + data["Parameter60.Value"] = params["parameter60.value"]; + if (params["parameter61.name"] !== undefined) + data["Parameter61.Name"] = params["parameter61.name"]; + if (params["parameter61.value"] !== undefined) + data["Parameter61.Value"] = params["parameter61.value"]; + if (params["parameter62.name"] !== undefined) + data["Parameter62.Name"] = params["parameter62.name"]; + if (params["parameter62.value"] !== undefined) + data["Parameter62.Value"] = params["parameter62.value"]; + if (params["parameter63.name"] !== undefined) + data["Parameter63.Name"] = params["parameter63.name"]; + if (params["parameter63.value"] !== undefined) + data["Parameter63.Value"] = params["parameter63.value"]; + if (params["parameter64.name"] !== undefined) + data["Parameter64.Name"] = params["parameter64.name"]; + if (params["parameter64.value"] !== undefined) + data["Parameter64.Value"] = params["parameter64.value"]; + if (params["parameter65.name"] !== undefined) + data["Parameter65.Name"] = params["parameter65.name"]; + if (params["parameter65.value"] !== undefined) + data["Parameter65.Value"] = params["parameter65.value"]; + if (params["parameter66.name"] !== undefined) + data["Parameter66.Name"] = params["parameter66.name"]; + if (params["parameter66.value"] !== undefined) + data["Parameter66.Value"] = params["parameter66.value"]; + if (params["parameter67.name"] !== undefined) + data["Parameter67.Name"] = params["parameter67.name"]; + if (params["parameter67.value"] !== undefined) + data["Parameter67.Value"] = params["parameter67.value"]; + if (params["parameter68.name"] !== undefined) + data["Parameter68.Name"] = params["parameter68.name"]; + if (params["parameter68.value"] !== undefined) + data["Parameter68.Value"] = params["parameter68.value"]; + if (params["parameter69.name"] !== undefined) + data["Parameter69.Name"] = params["parameter69.name"]; + if (params["parameter69.value"] !== undefined) + data["Parameter69.Value"] = params["parameter69.value"]; + if (params["parameter70.name"] !== undefined) + data["Parameter70.Name"] = params["parameter70.name"]; + if (params["parameter70.value"] !== undefined) + data["Parameter70.Value"] = params["parameter70.value"]; + if (params["parameter71.name"] !== undefined) + data["Parameter71.Name"] = params["parameter71.name"]; + if (params["parameter71.value"] !== undefined) + data["Parameter71.Value"] = params["parameter71.value"]; + if (params["parameter72.name"] !== undefined) + data["Parameter72.Name"] = params["parameter72.name"]; + if (params["parameter72.value"] !== undefined) + data["Parameter72.Value"] = params["parameter72.value"]; + if (params["parameter73.name"] !== undefined) + data["Parameter73.Name"] = params["parameter73.name"]; + if (params["parameter73.value"] !== undefined) + data["Parameter73.Value"] = params["parameter73.value"]; + if (params["parameter74.name"] !== undefined) + data["Parameter74.Name"] = params["parameter74.name"]; + if (params["parameter74.value"] !== undefined) + data["Parameter74.Value"] = params["parameter74.value"]; + if (params["parameter75.name"] !== undefined) + data["Parameter75.Name"] = params["parameter75.name"]; + if (params["parameter75.value"] !== undefined) + data["Parameter75.Value"] = params["parameter75.value"]; + if (params["parameter76.name"] !== undefined) + data["Parameter76.Name"] = params["parameter76.name"]; + if (params["parameter76.value"] !== undefined) + data["Parameter76.Value"] = params["parameter76.value"]; + if (params["parameter77.name"] !== undefined) + data["Parameter77.Name"] = params["parameter77.name"]; + if (params["parameter77.value"] !== undefined) + data["Parameter77.Value"] = params["parameter77.value"]; + if (params["parameter78.name"] !== undefined) + data["Parameter78.Name"] = params["parameter78.name"]; + if (params["parameter78.value"] !== undefined) + data["Parameter78.Value"] = params["parameter78.value"]; + if (params["parameter79.name"] !== undefined) + data["Parameter79.Name"] = params["parameter79.name"]; + if (params["parameter79.value"] !== undefined) + data["Parameter79.Value"] = params["parameter79.value"]; + if (params["parameter80.name"] !== undefined) + data["Parameter80.Name"] = params["parameter80.name"]; + if (params["parameter80.value"] !== undefined) + data["Parameter80.Value"] = params["parameter80.value"]; + if (params["parameter81.name"] !== undefined) + data["Parameter81.Name"] = params["parameter81.name"]; + if (params["parameter81.value"] !== undefined) + data["Parameter81.Value"] = params["parameter81.value"]; + if (params["parameter82.name"] !== undefined) + data["Parameter82.Name"] = params["parameter82.name"]; + if (params["parameter82.value"] !== undefined) + data["Parameter82.Value"] = params["parameter82.value"]; + if (params["parameter83.name"] !== undefined) + data["Parameter83.Name"] = params["parameter83.name"]; + if (params["parameter83.value"] !== undefined) + data["Parameter83.Value"] = params["parameter83.value"]; + if (params["parameter84.name"] !== undefined) + data["Parameter84.Name"] = params["parameter84.name"]; + if (params["parameter84.value"] !== undefined) + data["Parameter84.Value"] = params["parameter84.value"]; + if (params["parameter85.name"] !== undefined) + data["Parameter85.Name"] = params["parameter85.name"]; + if (params["parameter85.value"] !== undefined) + data["Parameter85.Value"] = params["parameter85.value"]; + if (params["parameter86.name"] !== undefined) + data["Parameter86.Name"] = params["parameter86.name"]; + if (params["parameter86.value"] !== undefined) + data["Parameter86.Value"] = params["parameter86.value"]; + if (params["parameter87.name"] !== undefined) + data["Parameter87.Name"] = params["parameter87.name"]; + if (params["parameter87.value"] !== undefined) + data["Parameter87.Value"] = params["parameter87.value"]; + if (params["parameter88.name"] !== undefined) + data["Parameter88.Name"] = params["parameter88.name"]; + if (params["parameter88.value"] !== undefined) + data["Parameter88.Value"] = params["parameter88.value"]; + if (params["parameter89.name"] !== undefined) + data["Parameter89.Name"] = params["parameter89.name"]; + if (params["parameter89.value"] !== undefined) + data["Parameter89.Value"] = params["parameter89.value"]; + if (params["parameter90.name"] !== undefined) + data["Parameter90.Name"] = params["parameter90.name"]; + if (params["parameter90.value"] !== undefined) + data["Parameter90.Value"] = params["parameter90.value"]; + if (params["parameter91.name"] !== undefined) + data["Parameter91.Name"] = params["parameter91.name"]; + if (params["parameter91.value"] !== undefined) + data["Parameter91.Value"] = params["parameter91.value"]; + if (params["parameter92.name"] !== undefined) + data["Parameter92.Name"] = params["parameter92.name"]; + if (params["parameter92.value"] !== undefined) + data["Parameter92.Value"] = params["parameter92.value"]; + if (params["parameter93.name"] !== undefined) + data["Parameter93.Name"] = params["parameter93.name"]; + if (params["parameter93.value"] !== undefined) + data["Parameter93.Value"] = params["parameter93.value"]; + if (params["parameter94.name"] !== undefined) + data["Parameter94.Name"] = params["parameter94.name"]; + if (params["parameter94.value"] !== undefined) + data["Parameter94.Value"] = params["parameter94.value"]; + if (params["parameter95.name"] !== undefined) + data["Parameter95.Name"] = params["parameter95.name"]; + if (params["parameter95.value"] !== undefined) + data["Parameter95.Value"] = params["parameter95.value"]; + if (params["parameter96.name"] !== undefined) + data["Parameter96.Name"] = params["parameter96.name"]; + if (params["parameter96.value"] !== undefined) + data["Parameter96.Value"] = params["parameter96.value"]; + if (params["parameter97.name"] !== undefined) + data["Parameter97.Name"] = params["parameter97.name"]; + if (params["parameter97.value"] !== undefined) + data["Parameter97.Value"] = params["parameter97.value"]; + if (params["parameter98.name"] !== undefined) + data["Parameter98.Name"] = params["parameter98.name"]; + if (params["parameter98.value"] !== undefined) + data["Parameter98.Value"] = params["parameter98.value"]; + if (params["parameter99.name"] !== undefined) + data["Parameter99.Name"] = params["parameter99.name"]; + if (params["parameter99.value"] !== undefined) + data["Parameter99.Value"] = params["parameter99.value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new StreamInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.StreamListInstance = StreamListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessage.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessage.d.ts new file mode 100644 index 00000000..2f8b1fd9 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessage.d.ts @@ -0,0 +1,75 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../V2010"; +/** + * Options to pass to create a UserDefinedMessageInstance + */ +export interface UserDefinedMessageListInstanceCreateOptions { + /** The User Defined Message in the form of URL-encoded JSON string. */ + content: string; + /** A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. */ + idempotencyKey?: string; +} +export interface UserDefinedMessageSolution { + accountSid: string; + callSid: string; +} +export interface UserDefinedMessageListInstance { + _version: V2010; + _solution: UserDefinedMessageSolution; + _uri: string; + /** + * Create a UserDefinedMessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserDefinedMessageInstance + */ + create(params: UserDefinedMessageListInstanceCreateOptions, callback?: (error: Error | null, item?: UserDefinedMessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserDefinedMessageListInstance(version: V2010, accountSid: string, callSid: string): UserDefinedMessageListInstance; +interface UserDefinedMessageResource { + account_sid: string; + call_sid: string; + sid: string; + date_created: Date; +} +export declare class UserDefinedMessageInstance { + protected _version: V2010; + constructor(_version: V2010, payload: UserDefinedMessageResource, accountSid: string, callSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created User Defined Message. + */ + accountSid: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message is associated with. + */ + callSid: string; + /** + * The SID that uniquely identifies this User Defined Message. + */ + sid: string; + /** + * The date that this User Defined Message was created, given in RFC 2822 format. + */ + dateCreated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + callSid: string; + sid: string; + dateCreated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessage.js b/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessage.js new file mode 100644 index 00000000..99d3e9e7 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessage.js @@ -0,0 +1,89 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserDefinedMessageInstance = exports.UserDefinedMessageListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function UserDefinedMessageListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = `/Accounts/${accountSid}/Calls/${callSid}/UserDefinedMessages.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["content"] === null || params["content"] === undefined) { + throw new Error("Required parameter \"params['content']\" missing."); + } + let data = {}; + data["Content"] = params["content"]; + if (params["idempotencyKey"] !== undefined) + data["IdempotencyKey"] = params["idempotencyKey"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserDefinedMessageInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserDefinedMessageListInstance = UserDefinedMessageListInstance; +class UserDefinedMessageInstance { + constructor(_version, payload, accountSid, callSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.sid = payload.sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + callSid: this.callSid, + sid: this.sid, + dateCreated: this.dateCreated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserDefinedMessageInstance = UserDefinedMessageInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts new file mode 100644 index 00000000..7a5eae5a --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts @@ -0,0 +1,130 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../V2010"; +/** + * Options to pass to create a UserDefinedMessageSubscriptionInstance + */ +export interface UserDefinedMessageSubscriptionListInstanceCreateOptions { + /** The URL we should call using the `method` to send user defined events to your application. URLs must contain a valid hostname (underscores are not permitted). */ + callback: string; + /** A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. */ + idempotencyKey?: string; + /** The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. */ + method?: string; +} +export interface UserDefinedMessageSubscriptionContext { + /** + * Remove a UserDefinedMessageSubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserDefinedMessageSubscriptionContextSolution { + accountSid: string; + callSid: string; + sid: string; +} +export declare class UserDefinedMessageSubscriptionContextImpl implements UserDefinedMessageSubscriptionContext { + protected _version: V2010; + protected _solution: UserDefinedMessageSubscriptionContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, callSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserDefinedMessageSubscriptionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserDefinedMessageSubscriptionResource { + account_sid: string; + call_sid: string; + sid: string; + date_created: Date; + uri: string; +} +export declare class UserDefinedMessageSubscriptionInstance { + protected _version: V2010; + protected _solution: UserDefinedMessageSubscriptionContextSolution; + protected _context?: UserDefinedMessageSubscriptionContext; + constructor(_version: V2010, payload: UserDefinedMessageSubscriptionResource, accountSid: string, callSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. + */ + accountSid: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message Subscription is associated with. This refers to the Call SID that is producing the User Defined Messages. + */ + callSid: string; + /** + * The SID that uniquely identifies this User Defined Message Subscription. + */ + sid: string; + /** + * The date that this User Defined Message Subscription was created, given in RFC 2822 format. + */ + dateCreated: Date; + /** + * The URI of the User Defined Message Subscription Resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a UserDefinedMessageSubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + callSid: string; + sid: string; + dateCreated: Date; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserDefinedMessageSubscriptionSolution { + accountSid: string; + callSid: string; +} +export interface UserDefinedMessageSubscriptionListInstance { + _version: V2010; + _solution: UserDefinedMessageSubscriptionSolution; + _uri: string; + (sid: string): UserDefinedMessageSubscriptionContext; + get(sid: string): UserDefinedMessageSubscriptionContext; + /** + * Create a UserDefinedMessageSubscriptionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserDefinedMessageSubscriptionInstance + */ + create(params: UserDefinedMessageSubscriptionListInstanceCreateOptions, callback?: (error: Error | null, item?: UserDefinedMessageSubscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserDefinedMessageSubscriptionListInstance(version: V2010, accountSid: string, callSid: string): UserDefinedMessageSubscriptionListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js b/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js new file mode 100644 index 00000000..7e521b05 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js @@ -0,0 +1,150 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserDefinedMessageSubscriptionListInstance = exports.UserDefinedMessageSubscriptionInstance = exports.UserDefinedMessageSubscriptionContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class UserDefinedMessageSubscriptionContextImpl { + constructor(_version, accountSid, callSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, callSid, sid }; + this._uri = `/Accounts/${accountSid}/Calls/${callSid}/UserDefinedMessageSubscriptions/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserDefinedMessageSubscriptionContextImpl = UserDefinedMessageSubscriptionContextImpl; +class UserDefinedMessageSubscriptionInstance { + constructor(_version, payload, accountSid, callSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.sid = payload.sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.uri = payload.uri; + this._solution = { accountSid, callSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UserDefinedMessageSubscriptionContextImpl(this._version, this._solution.accountSid, this._solution.callSid, this._solution.sid); + return this._context; + } + /** + * Remove a UserDefinedMessageSubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + callSid: this.callSid, + sid: this.sid, + dateCreated: this.dateCreated, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserDefinedMessageSubscriptionInstance = UserDefinedMessageSubscriptionInstance; +function UserDefinedMessageSubscriptionListInstance(version, accountSid, callSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserDefinedMessageSubscriptionContextImpl(version, accountSid, callSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, callSid }; + instance._uri = `/Accounts/${accountSid}/Calls/${callSid}/UserDefinedMessageSubscriptions.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["callback"] === null || params["callback"] === undefined) { + throw new Error("Required parameter \"params['callback']\" missing."); + } + let data = {}; + data["Callback"] = params["callback"]; + if (params["idempotencyKey"] !== undefined) + data["IdempotencyKey"] = params["idempotencyKey"]; + if (params["method"] !== undefined) + data["Method"] = params["method"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserDefinedMessageSubscriptionInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserDefinedMessageSubscriptionListInstance = UserDefinedMessageSubscriptionListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/conference.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/conference.d.ts new file mode 100644 index 00000000..0a94004e --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/conference.d.ts @@ -0,0 +1,362 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +import { ParticipantListInstance } from "./conference/participant"; +import { RecordingListInstance } from "./conference/recording"; +export type ConferenceReasonConferenceEnded = "conference-ended-via-api" | "participant-with-end-conference-on-exit-left" | "participant-with-end-conference-on-exit-kicked" | "last-participant-kicked" | "last-participant-left"; +export type ConferenceStatus = "init" | "in-progress" | "completed"; +export type ConferenceUpdateStatus = "completed"; +/** + * Options to pass to update a ConferenceInstance + */ +export interface ConferenceContextUpdateOptions { + /** */ + status?: ConferenceUpdateStatus; + /** The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. */ + announceUrl?: string; + /** The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` */ + announceMethod?: string; +} +/** + * Options to pass to each + */ +export interface ConferenceListInstanceEachOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedAfter?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdated?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedBefore?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedAfter?: Date; + /** The string that identifies the Conference resources to read. */ + friendlyName?: string; + /** The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. */ + status?: ConferenceStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ConferenceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ConferenceListInstanceOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedAfter?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdated?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedBefore?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedAfter?: Date; + /** The string that identifies the Conference resources to read. */ + friendlyName?: string; + /** The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. */ + status?: ConferenceStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ConferenceListInstancePageOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. */ + dateCreatedAfter?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdated?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedBefore?: Date; + /** The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. */ + dateUpdatedAfter?: Date; + /** The string that identifies the Conference resources to read. */ + friendlyName?: string; + /** The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. */ + status?: ConferenceStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ConferenceContext { + participants: ParticipantListInstance; + recordings: RecordingListInstance; + /** + * Fetch a ConferenceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + fetch(callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Update a ConferenceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + update(callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Update a ConferenceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + update(params: ConferenceContextUpdateOptions, callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConferenceContextSolution { + accountSid: string; + sid: string; +} +export declare class ConferenceContextImpl implements ConferenceContext { + protected _version: V2010; + protected _solution: ConferenceContextSolution; + protected _uri: string; + protected _participants?: ParticipantListInstance; + protected _recordings?: RecordingListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get participants(): ParticipantListInstance; + get recordings(): RecordingListInstance; + fetch(callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + update(params?: ConferenceContextUpdateOptions | ((error: Error | null, item?: ConferenceInstance) => any), callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConferenceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConferencePayload extends TwilioResponsePayload { + conferences: ConferenceResource[]; +} +interface ConferenceResource { + account_sid: string; + date_created: Date; + date_updated: Date; + api_version: string; + friendly_name: string; + region: string; + sid: string; + status: ConferenceStatus; + uri: string; + subresource_uris: Record; + reason_conference_ended: ConferenceReasonConferenceEnded; + call_sid_ending_conference: string; +} +export declare class ConferenceInstance { + protected _version: V2010; + protected _solution: ConferenceContextSolution; + protected _context?: ConferenceContext; + constructor(_version: V2010, payload: ConferenceResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Conference resource. + */ + accountSid: string; + /** + * The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The API version used to create this conference. + */ + apiVersion: string; + /** + * A string that you assigned to describe this conference room. Maxiumum length is 128 characters. + */ + friendlyName: string; + /** + * A string that represents the Twilio Region where the conference audio was mixed. May be `us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants. + */ + region: string; + /** + * The unique string that that we created to identify this Conference resource. + */ + sid: string; + status: ConferenceStatus; + /** + * The URI of this resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * A list of related resources identified by their URIs relative to `https://api.twilio.com`. + */ + subresourceUris: Record; + reasonConferenceEnded: ConferenceReasonConferenceEnded; + /** + * The call SID that caused the conference to end. + */ + callSidEndingConference: string; + private get _proxy(); + /** + * Fetch a ConferenceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + fetch(callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Update a ConferenceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + update(callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Update a ConferenceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + update(params: ConferenceContextUpdateOptions, callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Access the participants. + */ + participants(): ParticipantListInstance; + /** + * Access the recordings. + */ + recordings(): RecordingListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + apiVersion: string; + friendlyName: string; + region: string; + sid: string; + status: ConferenceStatus; + uri: string; + subresourceUris: Record; + reasonConferenceEnded: ConferenceReasonConferenceEnded; + callSidEndingConference: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConferenceSolution { + accountSid: string; +} +export interface ConferenceListInstance { + _version: V2010; + _solution: ConferenceSolution; + _uri: string; + (sid: string): ConferenceContext; + get(sid: string): ConferenceContext; + /** + * Streams ConferenceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ConferenceInstance, done: (err?: Error) => void) => void): void; + each(params: ConferenceListInstanceEachOptions, callback?: (item: ConferenceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ConferenceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ConferencePage) => any): Promise; + /** + * Lists ConferenceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ConferenceInstance[]) => any): Promise; + list(params: ConferenceListInstanceOptions, callback?: (error: Error | null, items: ConferenceInstance[]) => any): Promise; + /** + * Retrieve a single page of ConferenceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ConferencePage) => any): Promise; + page(params: ConferenceListInstancePageOptions, callback?: (error: Error | null, items: ConferencePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConferenceListInstance(version: V2010, accountSid: string): ConferenceListInstance; +export declare class ConferencePage extends Page { + /** + * Initialize the ConferencePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: ConferenceSolution); + /** + * Build an instance of ConferenceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ConferenceResource): ConferenceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/conference.js b/node_modules/twilio/lib/rest/api/v2010/account/conference.js new file mode 100644 index 00000000..afcba0cb --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/conference.js @@ -0,0 +1,272 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConferencePage = exports.ConferenceListInstance = exports.ConferenceInstance = exports.ConferenceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const participant_1 = require("./conference/participant"); +const recording_1 = require("./conference/recording"); +class ConferenceContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Conferences/${sid}.json`; + } + get participants() { + this._participants = + this._participants || + (0, participant_1.ParticipantListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._participants; + } + get recordings() { + this._recordings = + this._recordings || + (0, recording_1.RecordingListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._recordings; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConferenceInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["announceUrl"] !== undefined) + data["AnnounceUrl"] = params["announceUrl"]; + if (params["announceMethod"] !== undefined) + data["AnnounceMethod"] = params["announceMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConferenceInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferenceContextImpl = ConferenceContextImpl; +class ConferenceInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.apiVersion = payload.api_version; + this.friendlyName = payload.friendly_name; + this.region = payload.region; + this.sid = payload.sid; + this.status = payload.status; + this.uri = payload.uri; + this.subresourceUris = payload.subresource_uris; + this.reasonConferenceEnded = payload.reason_conference_ended; + this.callSidEndingConference = payload.call_sid_ending_conference; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ConferenceContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Fetch a ConferenceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the participants. + */ + participants() { + return this._proxy.participants; + } + /** + * Access the recordings. + */ + recordings() { + return this._proxy.recordings; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + apiVersion: this.apiVersion, + friendlyName: this.friendlyName, + region: this.region, + sid: this.sid, + status: this.status, + uri: this.uri, + subresourceUris: this.subresourceUris, + reasonConferenceEnded: this.reasonConferenceEnded, + callSidEndingConference: this.callSidEndingConference, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferenceInstance = ConferenceInstance; +function ConferenceListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ConferenceContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Conferences.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601Date(params["dateCreated"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreated<"] = serialize.iso8601Date(params["dateCreatedBefore"]); + if (params["dateCreatedAfter"] !== undefined) + data["DateCreated>"] = serialize.iso8601Date(params["dateCreatedAfter"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601Date(params["dateUpdated"]); + if (params["dateUpdatedBefore"] !== undefined) + data["DateUpdated<"] = serialize.iso8601Date(params["dateUpdatedBefore"]); + if (params["dateUpdatedAfter"] !== undefined) + data["DateUpdated>"] = serialize.iso8601Date(params["dateUpdatedAfter"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConferencePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ConferencePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConferenceListInstance = ConferenceListInstance; +class ConferencePage extends Page_1.default { + /** + * Initialize the ConferencePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ConferenceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ConferenceInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferencePage = ConferencePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/conference/participant.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/conference/participant.d.ts new file mode 100644 index 00000000..fa54087d --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/conference/participant.d.ts @@ -0,0 +1,476 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +export type ParticipantStatus = "queued" | "connecting" | "ringing" | "connected" | "complete" | "failed"; +/** + * Options to pass to update a ParticipantInstance + */ +export interface ParticipantContextUpdateOptions { + /** Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. */ + muted?: boolean; + /** Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. */ + hold?: boolean; + /** The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. */ + holdUrl?: string; + /** The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. */ + holdMethod?: string; + /** The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. */ + announceUrl?: string; + /** The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + announceMethod?: string; + /** The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). */ + waitUrl?: string; + /** The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. */ + waitMethod?: string; + /** Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. */ + beepOnExit?: boolean; + /** Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. */ + endConferenceOnExit?: boolean; + /** Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. */ + coaching?: boolean; + /** The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. */ + callSidToCoach?: string; +} +/** + * Options to pass to create a ParticipantInstance + */ +export interface ParticipantListInstanceCreateOptions { + /** The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `from` must also be a phone number. If `to` is sip address, this value of `from` should be a username portion to be used to populate the P-Asserted-Identity header that is passed to the SIP endpoint. */ + from: string; + /** The phone number, SIP address, or Client identifier that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `sip:name@company.com`. Client identifiers are formatted `client:name`. [Custom parameters](https://www.twilio.com/docs/voice/api/conference-participant-resource#custom-parameters) may also be specified. */ + to: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. */ + statusCallbackMethod?: string; + /** The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. */ + statusCallbackEvent?: Array; + /** A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. */ + label?: string; + /** The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. */ + timeout?: number; + /** Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. */ + record?: boolean; + /** Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. */ + muted?: boolean; + /** Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. */ + beep?: string; + /** Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. */ + startConferenceOnEnter?: boolean; + /** Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. */ + endConferenceOnExit?: boolean; + /** The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). */ + waitUrl?: string; + /** The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. */ + waitMethod?: string; + /** Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. */ + earlyMedia?: boolean; + /** The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. */ + maxParticipants?: number; + /** Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. */ + conferenceRecord?: string; + /** Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. */ + conferenceTrim?: string; + /** The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. */ + conferenceStatusCallback?: string; + /** The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + conferenceStatusCallbackMethod?: string; + /** The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. */ + conferenceStatusCallbackEvent?: Array; + /** The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. */ + recordingChannels?: string; + /** The URL that we should call using the `recording_status_callback_method` when the recording status changes. */ + recordingStatusCallback?: string; + /** The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + recordingStatusCallbackMethod?: string; + /** The SIP username used for authentication. */ + sipAuthUsername?: string; + /** The SIP password for authentication. */ + sipAuthPassword?: string; + /** The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. */ + region?: string; + /** The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. */ + conferenceRecordingStatusCallback?: string; + /** The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + conferenceRecordingStatusCallbackMethod?: string; + /** The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `\\\'in-progress completed failed\\\'`. */ + recordingStatusCallbackEvent?: Array; + /** The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `\\\'in-progress completed failed\\\'` */ + conferenceRecordingStatusCallbackEvent?: Array; + /** Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. */ + coaching?: boolean; + /** The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. */ + callSidToCoach?: string; + /** Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant\\\'s audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. */ + jitterBufferSize?: string; + /** The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) */ + byoc?: string; + /** The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. */ + callerId?: string; + /** The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party\\\'s phone. (Branded Calls Beta) */ + callReason?: string; + /** The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. */ + recordingTrack?: string; + /** The maximum duration of the call in seconds. Constraints depend on account and configuration. */ + timeLimit?: number; + /** Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). */ + machineDetection?: string; + /** The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. */ + machineDetectionTimeout?: number; + /** The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. */ + machineDetectionSpeechThreshold?: number; + /** The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. */ + machineDetectionSpeechEndThreshold?: number; + /** The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. */ + machineDetectionSilenceTimeout?: number; + /** The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. */ + amdStatusCallback?: string; + /** The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. */ + amdStatusCallbackMethod?: string; + /** Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. */ + trim?: string; + /** A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call\\\'s call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. */ + callToken?: string; +} +/** + * Options to pass to each + */ +export interface ParticipantListInstanceEachOptions { + /** Whether to return only participants that are muted. Can be: `true` or `false`. */ + muted?: boolean; + /** Whether to return only participants that are on hold. Can be: `true` or `false`. */ + hold?: boolean; + /** Whether to return only participants who are coaching another call. Can be: `true` or `false`. */ + coaching?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ParticipantListInstanceOptions { + /** Whether to return only participants that are muted. Can be: `true` or `false`. */ + muted?: boolean; + /** Whether to return only participants that are on hold. Can be: `true` or `false`. */ + hold?: boolean; + /** Whether to return only participants who are coaching another call. Can be: `true` or `false`. */ + coaching?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ParticipantListInstancePageOptions { + /** Whether to return only participants that are muted. Can be: `true` or `false`. */ + muted?: boolean; + /** Whether to return only participants that are on hold. Can be: `true` or `false`. */ + hold?: boolean; + /** Whether to return only participants who are coaching another call. Can be: `true` or `false`. */ + coaching?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ParticipantContext { + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ParticipantContextSolution { + accountSid: string; + conferenceSid: string; + callSid: string; +} +export declare class ParticipantContextImpl implements ParticipantContext { + protected _version: V2010; + protected _solution: ParticipantContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, conferenceSid: string, callSid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + update(params?: ParticipantContextUpdateOptions | ((error: Error | null, item?: ParticipantInstance) => any), callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ParticipantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ParticipantPayload extends TwilioResponsePayload { + participants: ParticipantResource[]; +} +interface ParticipantResource { + account_sid: string; + call_sid: string; + label: string; + call_sid_to_coach: string; + coaching: boolean; + conference_sid: string; + date_created: Date; + date_updated: Date; + end_conference_on_exit: boolean; + muted: boolean; + hold: boolean; + start_conference_on_enter: boolean; + status: ParticipantStatus; + uri: string; +} +export declare class ParticipantInstance { + protected _version: V2010; + protected _solution: ParticipantContextSolution; + protected _context?: ParticipantContext; + constructor(_version: V2010, payload: ParticipantResource, accountSid: string, conferenceSid: string, callSid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Participant resource. + */ + accountSid: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Participant resource is associated with. + */ + callSid: string; + /** + * The user-specified label of this participant, if one was given when the participant was created. This may be used to fetch, update or delete the participant. + */ + label: string; + /** + * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + */ + callSidToCoach: string; + /** + * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + */ + coaching: boolean; + /** + * The SID of the conference the participant is in. + */ + conferenceSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * Whether the conference ends when the participant leaves. Can be: `true` or `false` and the default is `false`. If `true`, the conference ends and all other participants drop out when the participant leaves. + */ + endConferenceOnExit: boolean; + /** + * Whether the participant is muted. Can be `true` or `false`. + */ + muted: boolean; + /** + * Whether the participant is on hold. Can be `true` or `false`. + */ + hold: boolean; + /** + * Whether the conference starts when the participant joins the conference, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + */ + startConferenceOnEnter: boolean; + status: ParticipantStatus; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + callSid: string; + label: string; + callSidToCoach: string; + coaching: boolean; + conferenceSid: string; + dateCreated: Date; + dateUpdated: Date; + endConferenceOnExit: boolean; + muted: boolean; + hold: boolean; + startConferenceOnEnter: boolean; + status: ParticipantStatus; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ParticipantSolution { + accountSid: string; + conferenceSid: string; +} +export interface ParticipantListInstance { + _version: V2010; + _solution: ParticipantSolution; + _uri: string; + (callSid: string): ParticipantContext; + get(callSid: string): ParticipantContext; + /** + * Create a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + create(params: ParticipantListInstanceCreateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Streams ParticipantInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + each(params: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Lists ParticipantInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + list(params: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + /** + * Retrieve a single page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + page(params: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ParticipantListInstance(version: V2010, accountSid: string, conferenceSid: string): ParticipantListInstance; +export declare class ParticipantPage extends Page { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: ParticipantSolution); + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ParticipantResource): ParticipantInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/conference/participant.js b/node_modules/twilio/lib/rest/api/v2010/account/conference/participant.js new file mode 100644 index 00000000..de7b95f9 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/conference/participant.js @@ -0,0 +1,411 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParticipantPage = exports.ParticipantListInstance = exports.ParticipantInstance = exports.ParticipantContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class ParticipantContextImpl { + constructor(_version, accountSid, conferenceSid, callSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conferenceSid)) { + throw new Error("Parameter 'conferenceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + this._solution = { accountSid, conferenceSid, callSid }; + this._uri = `/Accounts/${accountSid}/Conferences/${conferenceSid}/Participants/${callSid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.conferenceSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["muted"] !== undefined) + data["Muted"] = serialize.bool(params["muted"]); + if (params["hold"] !== undefined) + data["Hold"] = serialize.bool(params["hold"]); + if (params["holdUrl"] !== undefined) + data["HoldUrl"] = params["holdUrl"]; + if (params["holdMethod"] !== undefined) + data["HoldMethod"] = params["holdMethod"]; + if (params["announceUrl"] !== undefined) + data["AnnounceUrl"] = params["announceUrl"]; + if (params["announceMethod"] !== undefined) + data["AnnounceMethod"] = params["announceMethod"]; + if (params["waitUrl"] !== undefined) + data["WaitUrl"] = params["waitUrl"]; + if (params["waitMethod"] !== undefined) + data["WaitMethod"] = params["waitMethod"]; + if (params["beepOnExit"] !== undefined) + data["BeepOnExit"] = serialize.bool(params["beepOnExit"]); + if (params["endConferenceOnExit"] !== undefined) + data["EndConferenceOnExit"] = serialize.bool(params["endConferenceOnExit"]); + if (params["coaching"] !== undefined) + data["Coaching"] = serialize.bool(params["coaching"]); + if (params["callSidToCoach"] !== undefined) + data["CallSidToCoach"] = params["callSidToCoach"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.conferenceSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantContextImpl = ParticipantContextImpl; +class ParticipantInstance { + constructor(_version, payload, accountSid, conferenceSid, callSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.label = payload.label; + this.callSidToCoach = payload.call_sid_to_coach; + this.coaching = payload.coaching; + this.conferenceSid = payload.conference_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.endConferenceOnExit = payload.end_conference_on_exit; + this.muted = payload.muted; + this.hold = payload.hold; + this.startConferenceOnEnter = payload.start_conference_on_enter; + this.status = payload.status; + this.uri = payload.uri; + this._solution = { + accountSid, + conferenceSid, + callSid: callSid || this.callSid, + }; + } + get _proxy() { + this._context = + this._context || + new ParticipantContextImpl(this._version, this._solution.accountSid, this._solution.conferenceSid, this._solution.callSid); + return this._context; + } + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + callSid: this.callSid, + label: this.label, + callSidToCoach: this.callSidToCoach, + coaching: this.coaching, + conferenceSid: this.conferenceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + endConferenceOnExit: this.endConferenceOnExit, + muted: this.muted, + hold: this.hold, + startConferenceOnEnter: this.startConferenceOnEnter, + status: this.status, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantInstance = ParticipantInstance; +function ParticipantListInstance(version, accountSid, conferenceSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conferenceSid)) { + throw new Error("Parameter 'conferenceSid' is not valid."); + } + const instance = ((callSid) => instance.get(callSid)); + instance.get = function get(callSid) { + return new ParticipantContextImpl(version, accountSid, conferenceSid, callSid); + }; + instance._version = version; + instance._solution = { accountSid, conferenceSid }; + instance._uri = `/Accounts/${accountSid}/Conferences/${conferenceSid}/Participants.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["from"] === null || params["from"] === undefined) { + throw new Error("Required parameter \"params['from']\" missing."); + } + if (params["to"] === null || params["to"] === undefined) { + throw new Error("Required parameter \"params['to']\" missing."); + } + let data = {}; + data["From"] = params["from"]; + data["To"] = params["to"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["statusCallbackEvent"] !== undefined) + data["StatusCallbackEvent"] = serialize.map(params["statusCallbackEvent"], (e) => e); + if (params["label"] !== undefined) + data["Label"] = params["label"]; + if (params["timeout"] !== undefined) + data["Timeout"] = params["timeout"]; + if (params["record"] !== undefined) + data["Record"] = serialize.bool(params["record"]); + if (params["muted"] !== undefined) + data["Muted"] = serialize.bool(params["muted"]); + if (params["beep"] !== undefined) + data["Beep"] = params["beep"]; + if (params["startConferenceOnEnter"] !== undefined) + data["StartConferenceOnEnter"] = serialize.bool(params["startConferenceOnEnter"]); + if (params["endConferenceOnExit"] !== undefined) + data["EndConferenceOnExit"] = serialize.bool(params["endConferenceOnExit"]); + if (params["waitUrl"] !== undefined) + data["WaitUrl"] = params["waitUrl"]; + if (params["waitMethod"] !== undefined) + data["WaitMethod"] = params["waitMethod"]; + if (params["earlyMedia"] !== undefined) + data["EarlyMedia"] = serialize.bool(params["earlyMedia"]); + if (params["maxParticipants"] !== undefined) + data["MaxParticipants"] = params["maxParticipants"]; + if (params["conferenceRecord"] !== undefined) + data["ConferenceRecord"] = params["conferenceRecord"]; + if (params["conferenceTrim"] !== undefined) + data["ConferenceTrim"] = params["conferenceTrim"]; + if (params["conferenceStatusCallback"] !== undefined) + data["ConferenceStatusCallback"] = params["conferenceStatusCallback"]; + if (params["conferenceStatusCallbackMethod"] !== undefined) + data["ConferenceStatusCallbackMethod"] = + params["conferenceStatusCallbackMethod"]; + if (params["conferenceStatusCallbackEvent"] !== undefined) + data["ConferenceStatusCallbackEvent"] = serialize.map(params["conferenceStatusCallbackEvent"], (e) => e); + if (params["recordingChannels"] !== undefined) + data["RecordingChannels"] = params["recordingChannels"]; + if (params["recordingStatusCallback"] !== undefined) + data["RecordingStatusCallback"] = params["recordingStatusCallback"]; + if (params["recordingStatusCallbackMethod"] !== undefined) + data["RecordingStatusCallbackMethod"] = + params["recordingStatusCallbackMethod"]; + if (params["sipAuthUsername"] !== undefined) + data["SipAuthUsername"] = params["sipAuthUsername"]; + if (params["sipAuthPassword"] !== undefined) + data["SipAuthPassword"] = params["sipAuthPassword"]; + if (params["region"] !== undefined) + data["Region"] = params["region"]; + if (params["conferenceRecordingStatusCallback"] !== undefined) + data["ConferenceRecordingStatusCallback"] = + params["conferenceRecordingStatusCallback"]; + if (params["conferenceRecordingStatusCallbackMethod"] !== undefined) + data["ConferenceRecordingStatusCallbackMethod"] = + params["conferenceRecordingStatusCallbackMethod"]; + if (params["recordingStatusCallbackEvent"] !== undefined) + data["RecordingStatusCallbackEvent"] = serialize.map(params["recordingStatusCallbackEvent"], (e) => e); + if (params["conferenceRecordingStatusCallbackEvent"] !== undefined) + data["ConferenceRecordingStatusCallbackEvent"] = serialize.map(params["conferenceRecordingStatusCallbackEvent"], (e) => e); + if (params["coaching"] !== undefined) + data["Coaching"] = serialize.bool(params["coaching"]); + if (params["callSidToCoach"] !== undefined) + data["CallSidToCoach"] = params["callSidToCoach"]; + if (params["jitterBufferSize"] !== undefined) + data["JitterBufferSize"] = params["jitterBufferSize"]; + if (params["byoc"] !== undefined) + data["Byoc"] = params["byoc"]; + if (params["callerId"] !== undefined) + data["CallerId"] = params["callerId"]; + if (params["callReason"] !== undefined) + data["CallReason"] = params["callReason"]; + if (params["recordingTrack"] !== undefined) + data["RecordingTrack"] = params["recordingTrack"]; + if (params["timeLimit"] !== undefined) + data["TimeLimit"] = params["timeLimit"]; + if (params["machineDetection"] !== undefined) + data["MachineDetection"] = params["machineDetection"]; + if (params["machineDetectionTimeout"] !== undefined) + data["MachineDetectionTimeout"] = params["machineDetectionTimeout"]; + if (params["machineDetectionSpeechThreshold"] !== undefined) + data["MachineDetectionSpeechThreshold"] = + params["machineDetectionSpeechThreshold"]; + if (params["machineDetectionSpeechEndThreshold"] !== undefined) + data["MachineDetectionSpeechEndThreshold"] = + params["machineDetectionSpeechEndThreshold"]; + if (params["machineDetectionSilenceTimeout"] !== undefined) + data["MachineDetectionSilenceTimeout"] = + params["machineDetectionSilenceTimeout"]; + if (params["amdStatusCallback"] !== undefined) + data["AmdStatusCallback"] = params["amdStatusCallback"]; + if (params["amdStatusCallbackMethod"] !== undefined) + data["AmdStatusCallbackMethod"] = params["amdStatusCallbackMethod"]; + if (params["trim"] !== undefined) + data["Trim"] = params["trim"]; + if (params["callToken"] !== undefined) + data["CallToken"] = params["callToken"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.conferenceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["muted"] !== undefined) + data["Muted"] = serialize.bool(params["muted"]); + if (params["hold"] !== undefined) + data["Hold"] = serialize.bool(params["hold"]); + if (params["coaching"] !== undefined) + data["Coaching"] = serialize.bool(params["coaching"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ParticipantPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ParticipantListInstance = ParticipantListInstance; +class ParticipantPage extends Page_1.default { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ParticipantInstance(this._version, payload, this._solution.accountSid, this._solution.conferenceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantPage = ParticipantPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/conference/recording.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/conference/recording.d.ts new file mode 100644 index 00000000..a96bd1fb --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/conference/recording.d.ts @@ -0,0 +1,346 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +export type RecordingSource = "DialVerb" | "Conference" | "OutboundAPI" | "Trunking" | "RecordVerb" | "StartCallRecordingAPI" | "StartConferenceRecordingAPI"; +export type RecordingStatus = "in-progress" | "paused" | "stopped" | "processing" | "completed" | "absent"; +/** + * Options to pass to update a RecordingInstance + */ +export interface RecordingContextUpdateOptions { + /** */ + status: RecordingStatus; + /** Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. */ + pauseBehavior?: string; +} +/** + * Options to pass to each + */ +export interface RecordingListInstanceEachOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RecordingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RecordingListInstanceOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RecordingListInstancePageOptions { + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreated?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedBefore?: Date; + /** The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RecordingContext { + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Update a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + update(params: RecordingContextUpdateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RecordingContextSolution { + accountSid: string; + conferenceSid: string; + sid: string; +} +export declare class RecordingContextImpl implements RecordingContext { + protected _version: V2010; + protected _solution: RecordingContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, conferenceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + update(params: RecordingContextUpdateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RecordingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RecordingPayload extends TwilioResponsePayload { + recordings: RecordingResource[]; +} +interface RecordingResource { + account_sid: string; + api_version: string; + call_sid: string; + conference_sid: string; + date_created: Date; + date_updated: Date; + start_time: Date; + duration: string; + sid: string; + price: string; + price_unit: string; + status: RecordingStatus; + channels: number; + source: RecordingSource; + error_code: number; + encryption_details: any; + uri: string; +} +export declare class RecordingInstance { + protected _version: V2010; + protected _solution: RecordingContextSolution; + protected _context?: RecordingContext; + constructor(_version: V2010, payload: RecordingResource, accountSid: string, conferenceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resource. + */ + accountSid: string; + /** + * The API version used to create the recording. + */ + apiVersion: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Conference Recording resource is associated with. + */ + callSid: string; + /** + * The Conference SID that identifies the conference associated with the recording. + */ + conferenceSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The start time of the recording in GMT and in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + startTime: Date; + /** + * The length of the recording in seconds. + */ + duration: string; + /** + * The unique string that that we created to identify the Conference Recording resource. + */ + sid: string; + /** + * The one-time cost of creating the recording in the `price_unit` currency. + */ + price: string; + /** + * The currency used in the `price` property. Example: `USD`. + */ + priceUnit: string; + status: RecordingStatus; + /** + * The number of channels in the final recording file. Can be: `1`, or `2`. Separating a two leg call into two separate channels of the recording file is supported in [Dial](https://www.twilio.com/docs/voice/twiml/dial#attributes-record) and [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls) record options. + */ + channels: number; + source: RecordingSource; + /** + * The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`. + */ + errorCode: number; + /** + * How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature. + */ + encryptionDetails: any; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Update a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + update(params: RecordingContextUpdateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + callSid: string; + conferenceSid: string; + dateCreated: Date; + dateUpdated: Date; + startTime: Date; + duration: string; + sid: string; + price: string; + priceUnit: string; + status: RecordingStatus; + channels: number; + source: RecordingSource; + errorCode: number; + encryptionDetails: any; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RecordingSolution { + accountSid: string; + conferenceSid: string; +} +export interface RecordingListInstance { + _version: V2010; + _solution: RecordingSolution; + _uri: string; + (sid: string): RecordingContext; + get(sid: string): RecordingContext; + /** + * Streams RecordingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void; + each(params: RecordingListInstanceEachOptions, callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RecordingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RecordingPage) => any): Promise; + /** + * Lists RecordingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise; + list(params: RecordingListInstanceOptions, callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise; + /** + * Retrieve a single page of RecordingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RecordingPage) => any): Promise; + page(params: RecordingListInstancePageOptions, callback?: (error: Error | null, items: RecordingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RecordingListInstance(version: V2010, accountSid: string, conferenceSid: string): RecordingListInstance; +export declare class RecordingPage extends Page { + /** + * Initialize the RecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: RecordingSolution); + /** + * Build an instance of RecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RecordingResource): RecordingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/conference/recording.js b/node_modules/twilio/lib/rest/api/v2010/account/conference/recording.js new file mode 100644 index 00000000..4f24cb7c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/conference/recording.js @@ -0,0 +1,267 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RecordingPage = exports.RecordingListInstance = exports.RecordingInstance = exports.RecordingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class RecordingContextImpl { + constructor(_version, accountSid, conferenceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conferenceSid)) { + throw new Error("Parameter 'conferenceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, conferenceSid, sid }; + this._uri = `/Accounts/${accountSid}/Conferences/${conferenceSid}/Recordings/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.conferenceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + if (params["pauseBehavior"] !== undefined) + data["PauseBehavior"] = params["pauseBehavior"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.conferenceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingContextImpl = RecordingContextImpl; +class RecordingInstance { + constructor(_version, payload, accountSid, conferenceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.callSid = payload.call_sid; + this.conferenceSid = payload.conference_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.startTime = deserialize.rfc2822DateTime(payload.start_time); + this.duration = payload.duration; + this.sid = payload.sid; + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.status = payload.status; + this.channels = deserialize.integer(payload.channels); + this.source = payload.source; + this.errorCode = deserialize.integer(payload.error_code); + this.encryptionDetails = payload.encryption_details; + this.uri = payload.uri; + this._solution = { accountSid, conferenceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RecordingContextImpl(this._version, this._solution.accountSid, this._solution.conferenceSid, this._solution.sid); + return this._context; + } + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + callSid: this.callSid, + conferenceSid: this.conferenceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + startTime: this.startTime, + duration: this.duration, + sid: this.sid, + price: this.price, + priceUnit: this.priceUnit, + status: this.status, + channels: this.channels, + source: this.source, + errorCode: this.errorCode, + encryptionDetails: this.encryptionDetails, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingInstance = RecordingInstance; +function RecordingListInstance(version, accountSid, conferenceSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conferenceSid)) { + throw new Error("Parameter 'conferenceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RecordingContextImpl(version, accountSid, conferenceSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, conferenceSid }; + instance._uri = `/Accounts/${accountSid}/Conferences/${conferenceSid}/Recordings.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601Date(params["dateCreated"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreated<"] = serialize.iso8601Date(params["dateCreatedBefore"]); + if (params["dateCreatedAfter"] !== undefined) + data["DateCreated>"] = serialize.iso8601Date(params["dateCreatedAfter"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RecordingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RecordingListInstance = RecordingListInstance; +class RecordingPage extends Page_1.default { + /** + * Initialize the RecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RecordingInstance(this._version, payload, this._solution.accountSid, this._solution.conferenceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingPage = RecordingPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/connectApp.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/connectApp.d.ts new file mode 100644 index 00000000..de99a071 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/connectApp.d.ts @@ -0,0 +1,323 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +export type ConnectAppPermission = "get-all" | "post-all"; +/** + * Options to pass to update a ConnectAppInstance + */ +export interface ConnectAppContextUpdateOptions { + /** The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. */ + authorizeRedirectUrl?: string; + /** The company name to set for the Connect App. */ + companyName?: string; + /** The HTTP method to use when calling `deauthorize_callback_url`. */ + deauthorizeCallbackMethod?: string; + /** The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. */ + deauthorizeCallbackUrl?: string; + /** A description of the Connect App. */ + description?: string; + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** A public URL where users can obtain more information about this Connect App. */ + homepageUrl?: string; + /** A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. */ + permissions?: Array; +} +/** + * Options to pass to each + */ +export interface ConnectAppListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ConnectAppInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ConnectAppListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ConnectAppListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ConnectAppContext { + /** + * Remove a ConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectAppInstance + */ + fetch(callback?: (error: Error | null, item?: ConnectAppInstance) => any): Promise; + /** + * Update a ConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectAppInstance + */ + update(callback?: (error: Error | null, item?: ConnectAppInstance) => any): Promise; + /** + * Update a ConnectAppInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectAppInstance + */ + update(params: ConnectAppContextUpdateOptions, callback?: (error: Error | null, item?: ConnectAppInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConnectAppContextSolution { + accountSid: string; + sid: string; +} +export declare class ConnectAppContextImpl implements ConnectAppContext { + protected _version: V2010; + protected _solution: ConnectAppContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ConnectAppInstance) => any): Promise; + update(params?: ConnectAppContextUpdateOptions | ((error: Error | null, item?: ConnectAppInstance) => any), callback?: (error: Error | null, item?: ConnectAppInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConnectAppContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConnectAppPayload extends TwilioResponsePayload { + connect_apps: ConnectAppResource[]; +} +interface ConnectAppResource { + account_sid: string; + authorize_redirect_url: string; + company_name: string; + deauthorize_callback_method: string; + deauthorize_callback_url: string; + description: string; + friendly_name: string; + homepage_url: string; + permissions: Array; + sid: string; + uri: string; +} +export declare class ConnectAppInstance { + protected _version: V2010; + protected _solution: ConnectAppContextSolution; + protected _context?: ConnectAppContext; + constructor(_version: V2010, payload: ConnectAppResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resource. + */ + accountSid: string; + /** + * The URL we redirect the user to after we authenticate the user and obtain authorization to access the Connect App. + */ + authorizeRedirectUrl: string; + /** + * The company name set for the Connect App. + */ + companyName: string; + /** + * The HTTP method we use to call `deauthorize_callback_url`. + */ + deauthorizeCallbackMethod: string; + /** + * The URL we call using the `deauthorize_callback_method` to de-authorize the Connect App. + */ + deauthorizeCallbackUrl: string; + /** + * The description of the Connect App. + */ + description: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The public URL where users can obtain more information about this Connect App. + */ + homepageUrl: string; + /** + * The set of permissions that your ConnectApp requests. + */ + permissions: Array; + /** + * The unique string that that we created to identify the ConnectApp resource. + */ + sid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a ConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectAppInstance + */ + fetch(callback?: (error: Error | null, item?: ConnectAppInstance) => any): Promise; + /** + * Update a ConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectAppInstance + */ + update(callback?: (error: Error | null, item?: ConnectAppInstance) => any): Promise; + /** + * Update a ConnectAppInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectAppInstance + */ + update(params: ConnectAppContextUpdateOptions, callback?: (error: Error | null, item?: ConnectAppInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + authorizeRedirectUrl: string; + companyName: string; + deauthorizeCallbackMethod: string; + deauthorizeCallbackUrl: string; + description: string; + friendlyName: string; + homepageUrl: string; + permissions: ConnectAppPermission[]; + sid: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConnectAppSolution { + accountSid: string; +} +export interface ConnectAppListInstance { + _version: V2010; + _solution: ConnectAppSolution; + _uri: string; + (sid: string): ConnectAppContext; + get(sid: string): ConnectAppContext; + /** + * Streams ConnectAppInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectAppListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ConnectAppInstance, done: (err?: Error) => void) => void): void; + each(params: ConnectAppListInstanceEachOptions, callback?: (item: ConnectAppInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ConnectAppInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ConnectAppPage) => any): Promise; + /** + * Lists ConnectAppInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectAppListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ConnectAppInstance[]) => any): Promise; + list(params: ConnectAppListInstanceOptions, callback?: (error: Error | null, items: ConnectAppInstance[]) => any): Promise; + /** + * Retrieve a single page of ConnectAppInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectAppListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ConnectAppPage) => any): Promise; + page(params: ConnectAppListInstancePageOptions, callback?: (error: Error | null, items: ConnectAppPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConnectAppListInstance(version: V2010, accountSid: string): ConnectAppListInstance; +export declare class ConnectAppPage extends Page { + /** + * Initialize the ConnectAppPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: ConnectAppSolution); + /** + * Build an instance of ConnectAppInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ConnectAppResource): ConnectAppInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/connectApp.js b/node_modules/twilio/lib/rest/api/v2010/account/connectApp.js new file mode 100644 index 00000000..787fe0bb --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/connectApp.js @@ -0,0 +1,257 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectAppPage = exports.ConnectAppListInstance = exports.ConnectAppInstance = exports.ConnectAppContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ConnectAppContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/ConnectApps/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConnectAppInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["authorizeRedirectUrl"] !== undefined) + data["AuthorizeRedirectUrl"] = params["authorizeRedirectUrl"]; + if (params["companyName"] !== undefined) + data["CompanyName"] = params["companyName"]; + if (params["deauthorizeCallbackMethod"] !== undefined) + data["DeauthorizeCallbackMethod"] = params["deauthorizeCallbackMethod"]; + if (params["deauthorizeCallbackUrl"] !== undefined) + data["DeauthorizeCallbackUrl"] = params["deauthorizeCallbackUrl"]; + if (params["description"] !== undefined) + data["Description"] = params["description"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["homepageUrl"] !== undefined) + data["HomepageUrl"] = params["homepageUrl"]; + if (params["permissions"] !== undefined) + data["Permissions"] = serialize.map(params["permissions"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConnectAppInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectAppContextImpl = ConnectAppContextImpl; +class ConnectAppInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.authorizeRedirectUrl = payload.authorize_redirect_url; + this.companyName = payload.company_name; + this.deauthorizeCallbackMethod = payload.deauthorize_callback_method; + this.deauthorizeCallbackUrl = payload.deauthorize_callback_url; + this.description = payload.description; + this.friendlyName = payload.friendly_name; + this.homepageUrl = payload.homepage_url; + this.permissions = payload.permissions; + this.sid = payload.sid; + this.uri = payload.uri; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ConnectAppContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a ConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ConnectAppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectAppInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + authorizeRedirectUrl: this.authorizeRedirectUrl, + companyName: this.companyName, + deauthorizeCallbackMethod: this.deauthorizeCallbackMethod, + deauthorizeCallbackUrl: this.deauthorizeCallbackUrl, + description: this.description, + friendlyName: this.friendlyName, + homepageUrl: this.homepageUrl, + permissions: this.permissions, + sid: this.sid, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectAppInstance = ConnectAppInstance; +function ConnectAppListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ConnectAppContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/ConnectApps.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConnectAppPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ConnectAppPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConnectAppListInstance = ConnectAppListInstance; +class ConnectAppPage extends Page_1.default { + /** + * Initialize the ConnectAppPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ConnectAppInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ConnectAppInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectAppPage = ConnectAppPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts new file mode 100644 index 00000000..d253e472 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts @@ -0,0 +1,588 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +import { AssignedAddOnListInstance } from "./incomingPhoneNumber/assignedAddOn"; +import { LocalListInstance } from "./incomingPhoneNumber/local"; +import { MobileListInstance } from "./incomingPhoneNumber/mobile"; +import { TollFreeListInstance } from "./incomingPhoneNumber/tollFree"; +import { PhoneNumberCapabilities } from "../../../../interfaces"; +export type IncomingPhoneNumberAddressRequirement = "none" | "any" | "local" | "foreign"; +export type IncomingPhoneNumberEmergencyAddressStatus = "registered" | "unregistered" | "pending-registration" | "registration-failure" | "pending-unregistration" | "unregistration-failure"; +export type IncomingPhoneNumberEmergencyStatus = "Active" | "Inactive"; +export type IncomingPhoneNumberVoiceReceiveMode = "voice" | "fax"; +/** + * Options to pass to update a IncomingPhoneNumberInstance + */ +export interface IncomingPhoneNumberContextUpdateOptions { + /** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). */ + accountSid?: string; + /** The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. */ + apiVersion?: string; + /** A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. */ + friendlyName?: string; + /** The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. */ + smsApplicationSid?: string; + /** The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsFallbackMethod?: string; + /** The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsMethod?: string; + /** The URL we should call when the phone number receives an incoming SMS message. */ + smsUrl?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + statusCallbackMethod?: string; + /** The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. */ + voiceApplicationSid?: string; + /** Whether to lookup the caller\\\'s name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. */ + voiceCallerIdLookup?: boolean; + /** The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. */ + voiceFallbackUrl?: string; + /** The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceMethod?: string; + /** The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. */ + voiceUrl?: string; + /** */ + emergencyStatus?: IncomingPhoneNumberEmergencyStatus; + /** The SID of the emergency address configuration to use for emergency calling from this phone number. */ + emergencyAddressSid?: string; + /** The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. */ + trunkSid?: string; + /** */ + voiceReceiveMode?: IncomingPhoneNumberVoiceReceiveMode; + /** The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. */ + identitySid?: string; + /** The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. */ + addressSid?: string; + /** The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ + bundleSid?: string; +} +/** + * Options to pass to create a IncomingPhoneNumberInstance + */ +export interface IncomingPhoneNumberListInstanceCreateOptions { + /** The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. */ + apiVersion?: string; + /** A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. */ + friendlyName?: string; + /** The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. */ + smsApplicationSid?: string; + /** The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsFallbackMethod?: string; + /** The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsMethod?: string; + /** The URL we should call when the new phone number receives an incoming SMS message. */ + smsUrl?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + statusCallbackMethod?: string; + /** The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. */ + voiceApplicationSid?: string; + /** Whether to lookup the caller\\\'s name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. */ + voiceCallerIdLookup?: boolean; + /** The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. */ + voiceFallbackUrl?: string; + /** The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceMethod?: string; + /** The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. */ + voiceUrl?: string; + /** */ + emergencyStatus?: IncomingPhoneNumberEmergencyStatus; + /** The SID of the emergency address configuration to use for emergency calling from the new phone number. */ + emergencyAddressSid?: string; + /** The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. */ + trunkSid?: string; + /** The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. */ + identitySid?: string; + /** The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. */ + addressSid?: string; + /** */ + voiceReceiveMode?: IncomingPhoneNumberVoiceReceiveMode; + /** The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ + bundleSid?: string; + /** The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. */ + phoneNumber?: string; + /** The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). */ + areaCode?: string; +} +/** + * Options to pass to each + */ +export interface IncomingPhoneNumberListInstanceEachOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the IncomingPhoneNumber resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: IncomingPhoneNumberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface IncomingPhoneNumberListInstanceOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the IncomingPhoneNumber resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface IncomingPhoneNumberListInstancePageOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the IncomingPhoneNumber resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface IncomingPhoneNumberContext { + assignedAddOns: AssignedAddOnListInstance; + /** + * Remove a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Update a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + update(callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Update a IncomingPhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + update(params: IncomingPhoneNumberContextUpdateOptions, callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface IncomingPhoneNumberContextSolution { + accountSid: string; + sid: string; +} +export declare class IncomingPhoneNumberContextImpl implements IncomingPhoneNumberContext { + protected _version: V2010; + protected _solution: IncomingPhoneNumberContextSolution; + protected _uri: string; + protected _assignedAddOns?: AssignedAddOnListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get assignedAddOns(): AssignedAddOnListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + update(params?: IncomingPhoneNumberContextUpdateOptions | ((error: Error | null, item?: IncomingPhoneNumberInstance) => any), callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): IncomingPhoneNumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface IncomingPhoneNumberPayload extends TwilioResponsePayload { + incoming_phone_numbers: IncomingPhoneNumberResource[]; +} +interface IncomingPhoneNumberResource { + account_sid: string; + address_sid: string; + address_requirements: IncomingPhoneNumberAddressRequirement; + api_version: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + date_created: Date; + date_updated: Date; + friendly_name: string; + identity_sid: string; + phone_number: string; + origin: string; + sid: string; + sms_application_sid: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + status_callback: string; + status_callback_method: string; + trunk_sid: string; + uri: string; + voice_receive_mode: IncomingPhoneNumberVoiceReceiveMode; + voice_application_sid: string; + voice_caller_id_lookup: boolean; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_url: string; + emergency_status: IncomingPhoneNumberEmergencyStatus; + emergency_address_sid: string; + emergency_address_status: IncomingPhoneNumberEmergencyAddressStatus; + bundle_sid: string; + status: string; +} +export declare class IncomingPhoneNumberInstance { + protected _version: V2010; + protected _solution: IncomingPhoneNumberContextSolution; + protected _context?: IncomingPhoneNumberContext; + constructor(_version: V2010, payload: IncomingPhoneNumberResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this IncomingPhoneNumber resource. + */ + accountSid: string; + /** + * The SID of the Address resource associated with the phone number. + */ + addressSid: string; + addressRequirements: IncomingPhoneNumberAddressRequirement; + /** + * The API version used to start a new TwiML session. + */ + apiVersion: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SID of the Identity resource that we associate with the phone number. Some regions require an Identity to meet local regulations. + */ + identitySid: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The phone number\'s origin. `twilio` identifies Twilio-owned phone numbers and `hosted` identifies hosted phone numbers. + */ + origin: string; + /** + * The unique string that that we created to identify this IncomingPhoneNumber resource. + */ + sid: string; + /** + * The SID of the application that handles SMS messages sent to the phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + */ + smsApplicationSid: string; + /** + * The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`. + */ + smsFallbackMethod: string; + /** + * The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`. + */ + smsFallbackUrl: string; + /** + * The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. + */ + smsMethod: string; + /** + * The URL we call when the phone number receives an incoming SMS message. + */ + smsUrl: string; + /** + * The URL we call using the `status_callback_method` to send status information to your application. + */ + statusCallback: string; + /** + * The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. + */ + statusCallbackMethod: string; + /** + * The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + */ + trunkSid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + voiceReceiveMode: IncomingPhoneNumberVoiceReceiveMode; + /** + * The SID of the application that handles calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + */ + voiceApplicationSid: string; + /** + * Whether we look up the caller\'s caller-ID name from the CNAM database ($0.01 per look up). Can be: `true` or `false`. + */ + voiceCallerIdLookup: boolean; + /** + * The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`. + */ + voiceFallbackUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The URL we call when the phone number receives a call. The `voice_url` will not be used if a `voice_application_sid` or a `trunk_sid` is set. + */ + voiceUrl: string; + emergencyStatus: IncomingPhoneNumberEmergencyStatus; + /** + * The SID of the emergency address configuration that we use for emergency calling from this phone number. + */ + emergencyAddressSid: string; + emergencyAddressStatus: IncomingPhoneNumberEmergencyAddressStatus; + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + */ + bundleSid: string; + status: string; + private get _proxy(); + /** + * Remove a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Update a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + update(callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Update a IncomingPhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + update(params: IncomingPhoneNumberContextUpdateOptions, callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Access the assignedAddOns. + */ + assignedAddOns(): AssignedAddOnListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + addressSid: string; + addressRequirements: IncomingPhoneNumberAddressRequirement; + apiVersion: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + identitySid: string; + phoneNumber: string; + origin: string; + sid: string; + smsApplicationSid: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + statusCallback: string; + statusCallbackMethod: string; + trunkSid: string; + uri: string; + voiceReceiveMode: IncomingPhoneNumberVoiceReceiveMode; + voiceApplicationSid: string; + voiceCallerIdLookup: boolean; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + emergencyStatus: IncomingPhoneNumberEmergencyStatus; + emergencyAddressSid: string; + emergencyAddressStatus: IncomingPhoneNumberEmergencyAddressStatus; + bundleSid: string; + status: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface IncomingPhoneNumberSolution { + accountSid: string; +} +export interface IncomingPhoneNumberListInstance { + _version: V2010; + _solution: IncomingPhoneNumberSolution; + _uri: string; + (sid: string): IncomingPhoneNumberContext; + get(sid: string): IncomingPhoneNumberContext; + _local?: LocalListInstance; + local: LocalListInstance; + _mobile?: MobileListInstance; + mobile: MobileListInstance; + _tollFree?: TollFreeListInstance; + tollFree: TollFreeListInstance; + /** + * Create a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + create(callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Create a IncomingPhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + create(params: IncomingPhoneNumberListInstanceCreateOptions, callback?: (error: Error | null, item?: IncomingPhoneNumberInstance) => any): Promise; + /** + * Streams IncomingPhoneNumberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IncomingPhoneNumberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: IncomingPhoneNumberInstance, done: (err?: Error) => void) => void): void; + each(params: IncomingPhoneNumberListInstanceEachOptions, callback?: (item: IncomingPhoneNumberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of IncomingPhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: IncomingPhoneNumberPage) => any): Promise; + /** + * Lists IncomingPhoneNumberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IncomingPhoneNumberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: IncomingPhoneNumberInstance[]) => any): Promise; + list(params: IncomingPhoneNumberListInstanceOptions, callback?: (error: Error | null, items: IncomingPhoneNumberInstance[]) => any): Promise; + /** + * Retrieve a single page of IncomingPhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IncomingPhoneNumberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: IncomingPhoneNumberPage) => any): Promise; + page(params: IncomingPhoneNumberListInstancePageOptions, callback?: (error: Error | null, items: IncomingPhoneNumberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function IncomingPhoneNumberListInstance(version: V2010, accountSid: string): IncomingPhoneNumberListInstance; +export declare class IncomingPhoneNumberPage extends Page { + /** + * Initialize the IncomingPhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: IncomingPhoneNumberSolution); + /** + * Build an instance of IncomingPhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: IncomingPhoneNumberResource): IncomingPhoneNumberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber.js b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber.js new file mode 100644 index 00000000..bd6fb193 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber.js @@ -0,0 +1,450 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IncomingPhoneNumberPage = exports.IncomingPhoneNumberListInstance = exports.IncomingPhoneNumberInstance = exports.IncomingPhoneNumberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const assignedAddOn_1 = require("./incomingPhoneNumber/assignedAddOn"); +const local_1 = require("./incomingPhoneNumber/local"); +const mobile_1 = require("./incomingPhoneNumber/mobile"); +const tollFree_1 = require("./incomingPhoneNumber/tollFree"); +class IncomingPhoneNumberContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers/${sid}.json`; + } + get assignedAddOns() { + this._assignedAddOns = + this._assignedAddOns || + (0, assignedAddOn_1.AssignedAddOnListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._assignedAddOns; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new IncomingPhoneNumberInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["accountSid"] !== undefined) + data["AccountSid"] = params["accountSid"]; + if (params["apiVersion"] !== undefined) + data["ApiVersion"] = params["apiVersion"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["smsApplicationSid"] !== undefined) + data["SmsApplicationSid"] = params["smsApplicationSid"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["voiceApplicationSid"] !== undefined) + data["VoiceApplicationSid"] = params["voiceApplicationSid"]; + if (params["voiceCallerIdLookup"] !== undefined) + data["VoiceCallerIdLookup"] = serialize.bool(params["voiceCallerIdLookup"]); + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["emergencyStatus"] !== undefined) + data["EmergencyStatus"] = params["emergencyStatus"]; + if (params["emergencyAddressSid"] !== undefined) + data["EmergencyAddressSid"] = params["emergencyAddressSid"]; + if (params["trunkSid"] !== undefined) + data["TrunkSid"] = params["trunkSid"]; + if (params["voiceReceiveMode"] !== undefined) + data["VoiceReceiveMode"] = params["voiceReceiveMode"]; + if (params["identitySid"] !== undefined) + data["IdentitySid"] = params["identitySid"]; + if (params["addressSid"] !== undefined) + data["AddressSid"] = params["addressSid"]; + if (params["bundleSid"] !== undefined) + data["BundleSid"] = params["bundleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IncomingPhoneNumberInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IncomingPhoneNumberContextImpl = IncomingPhoneNumberContextImpl; +class IncomingPhoneNumberInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.addressSid = payload.address_sid; + this.addressRequirements = payload.address_requirements; + this.apiVersion = payload.api_version; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.identitySid = payload.identity_sid; + this.phoneNumber = payload.phone_number; + this.origin = payload.origin; + this.sid = payload.sid; + this.smsApplicationSid = payload.sms_application_sid; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.trunkSid = payload.trunk_sid; + this.uri = payload.uri; + this.voiceReceiveMode = payload.voice_receive_mode; + this.voiceApplicationSid = payload.voice_application_sid; + this.voiceCallerIdLookup = payload.voice_caller_id_lookup; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceUrl = payload.voice_url; + this.emergencyStatus = payload.emergency_status; + this.emergencyAddressSid = payload.emergency_address_sid; + this.emergencyAddressStatus = payload.emergency_address_status; + this.bundleSid = payload.bundle_sid; + this.status = payload.status; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new IncomingPhoneNumberContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a IncomingPhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IncomingPhoneNumberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the assignedAddOns. + */ + assignedAddOns() { + return this._proxy.assignedAddOns; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + addressSid: this.addressSid, + addressRequirements: this.addressRequirements, + apiVersion: this.apiVersion, + beta: this.beta, + capabilities: this.capabilities, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + identitySid: this.identitySid, + phoneNumber: this.phoneNumber, + origin: this.origin, + sid: this.sid, + smsApplicationSid: this.smsApplicationSid, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + trunkSid: this.trunkSid, + uri: this.uri, + voiceReceiveMode: this.voiceReceiveMode, + voiceApplicationSid: this.voiceApplicationSid, + voiceCallerIdLookup: this.voiceCallerIdLookup, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceUrl: this.voiceUrl, + emergencyStatus: this.emergencyStatus, + emergencyAddressSid: this.emergencyAddressSid, + emergencyAddressStatus: this.emergencyAddressStatus, + bundleSid: this.bundleSid, + status: this.status, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IncomingPhoneNumberInstance = IncomingPhoneNumberInstance; +function IncomingPhoneNumberListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new IncomingPhoneNumberContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers.json`; + Object.defineProperty(instance, "local", { + get: function local() { + if (!instance._local) { + instance._local = (0, local_1.LocalListInstance)(instance._version, instance._solution.accountSid); + } + return instance._local; + }, + }); + Object.defineProperty(instance, "mobile", { + get: function mobile() { + if (!instance._mobile) { + instance._mobile = (0, mobile_1.MobileListInstance)(instance._version, instance._solution.accountSid); + } + return instance._mobile; + }, + }); + Object.defineProperty(instance, "tollFree", { + get: function tollFree() { + if (!instance._tollFree) { + instance._tollFree = (0, tollFree_1.TollFreeListInstance)(instance._version, instance._solution.accountSid); + } + return instance._tollFree; + }, + }); + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["apiVersion"] !== undefined) + data["ApiVersion"] = params["apiVersion"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["smsApplicationSid"] !== undefined) + data["SmsApplicationSid"] = params["smsApplicationSid"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["voiceApplicationSid"] !== undefined) + data["VoiceApplicationSid"] = params["voiceApplicationSid"]; + if (params["voiceCallerIdLookup"] !== undefined) + data["VoiceCallerIdLookup"] = serialize.bool(params["voiceCallerIdLookup"]); + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["emergencyStatus"] !== undefined) + data["EmergencyStatus"] = params["emergencyStatus"]; + if (params["emergencyAddressSid"] !== undefined) + data["EmergencyAddressSid"] = params["emergencyAddressSid"]; + if (params["trunkSid"] !== undefined) + data["TrunkSid"] = params["trunkSid"]; + if (params["identitySid"] !== undefined) + data["IdentitySid"] = params["identitySid"]; + if (params["addressSid"] !== undefined) + data["AddressSid"] = params["addressSid"]; + if (params["voiceReceiveMode"] !== undefined) + data["VoiceReceiveMode"] = params["voiceReceiveMode"]; + if (params["bundleSid"] !== undefined) + data["BundleSid"] = params["bundleSid"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["areaCode"] !== undefined) + data["AreaCode"] = params["areaCode"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IncomingPhoneNumberInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["origin"] !== undefined) + data["Origin"] = params["origin"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IncomingPhoneNumberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new IncomingPhoneNumberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.IncomingPhoneNumberListInstance = IncomingPhoneNumberListInstance; +class IncomingPhoneNumberPage extends Page_1.default { + /** + * Initialize the IncomingPhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of IncomingPhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new IncomingPhoneNumberInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IncomingPhoneNumberPage = IncomingPhoneNumberPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.d.ts new file mode 100644 index 00000000..7aec5ccf --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.d.ts @@ -0,0 +1,292 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { AssignedAddOnExtensionListInstance } from "./assignedAddOn/assignedAddOnExtension"; +/** + * Options to pass to create a AssignedAddOnInstance + */ +export interface AssignedAddOnListInstanceCreateOptions { + /** The SID that identifies the Add-on installation. */ + installedAddOnSid: string; +} +/** + * Options to pass to each + */ +export interface AssignedAddOnListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AssignedAddOnInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AssignedAddOnListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AssignedAddOnListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AssignedAddOnContext { + extensions: AssignedAddOnExtensionListInstance; + /** + * Remove a AssignedAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AssignedAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssignedAddOnInstance + */ + fetch(callback?: (error: Error | null, item?: AssignedAddOnInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AssignedAddOnContextSolution { + accountSid: string; + resourceSid: string; + sid: string; +} +export declare class AssignedAddOnContextImpl implements AssignedAddOnContext { + protected _version: V2010; + protected _solution: AssignedAddOnContextSolution; + protected _uri: string; + protected _extensions?: AssignedAddOnExtensionListInstance; + constructor(_version: V2010, accountSid: string, resourceSid: string, sid: string); + get extensions(): AssignedAddOnExtensionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AssignedAddOnInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AssignedAddOnContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AssignedAddOnPayload extends TwilioResponsePayload { + assigned_add_ons: AssignedAddOnResource[]; +} +interface AssignedAddOnResource { + sid: string; + account_sid: string; + resource_sid: string; + friendly_name: string; + description: string; + configuration: any; + unique_name: string; + date_created: Date; + date_updated: Date; + uri: string; + subresource_uris: Record; +} +export declare class AssignedAddOnInstance { + protected _version: V2010; + protected _solution: AssignedAddOnContextSolution; + protected _context?: AssignedAddOnContext; + constructor(_version: V2010, payload: AssignedAddOnResource, accountSid: string, resourceSid: string, sid?: string); + /** + * The unique string that that we created to identify the resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. + */ + accountSid: string; + /** + * The SID of the Phone Number to which the Add-on is assigned. + */ + resourceSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * A short description of the functionality that the Add-on provides. + */ + description: string; + /** + * A JSON string that represents the current configuration of this Add-on installation. + */ + configuration: any; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * A list of related resources identified by their relative URIs. + */ + subresourceUris: Record; + private get _proxy(); + /** + * Remove a AssignedAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AssignedAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssignedAddOnInstance + */ + fetch(callback?: (error: Error | null, item?: AssignedAddOnInstance) => any): Promise; + /** + * Access the extensions. + */ + extensions(): AssignedAddOnExtensionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + resourceSid: string; + friendlyName: string; + description: string; + configuration: any; + uniqueName: string; + dateCreated: Date; + dateUpdated: Date; + uri: string; + subresourceUris: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AssignedAddOnSolution { + accountSid: string; + resourceSid: string; +} +export interface AssignedAddOnListInstance { + _version: V2010; + _solution: AssignedAddOnSolution; + _uri: string; + (sid: string): AssignedAddOnContext; + get(sid: string): AssignedAddOnContext; + /** + * Create a AssignedAddOnInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssignedAddOnInstance + */ + create(params: AssignedAddOnListInstanceCreateOptions, callback?: (error: Error | null, item?: AssignedAddOnInstance) => any): Promise; + /** + * Streams AssignedAddOnInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssignedAddOnListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AssignedAddOnInstance, done: (err?: Error) => void) => void): void; + each(params: AssignedAddOnListInstanceEachOptions, callback?: (item: AssignedAddOnInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AssignedAddOnInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AssignedAddOnPage) => any): Promise; + /** + * Lists AssignedAddOnInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssignedAddOnListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AssignedAddOnInstance[]) => any): Promise; + list(params: AssignedAddOnListInstanceOptions, callback?: (error: Error | null, items: AssignedAddOnInstance[]) => any): Promise; + /** + * Retrieve a single page of AssignedAddOnInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssignedAddOnListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AssignedAddOnPage) => any): Promise; + page(params: AssignedAddOnListInstancePageOptions, callback?: (error: Error | null, items: AssignedAddOnPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AssignedAddOnListInstance(version: V2010, accountSid: string, resourceSid: string): AssignedAddOnListInstance; +export declare class AssignedAddOnPage extends Page { + /** + * Initialize the AssignedAddOnPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AssignedAddOnSolution); + /** + * Build an instance of AssignedAddOnInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AssignedAddOnResource): AssignedAddOnInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js new file mode 100644 index 00000000..3993cd31 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js @@ -0,0 +1,257 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssignedAddOnPage = exports.AssignedAddOnListInstance = exports.AssignedAddOnInstance = exports.AssignedAddOnContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const assignedAddOnExtension_1 = require("./assignedAddOn/assignedAddOnExtension"); +class AssignedAddOnContextImpl { + constructor(_version, accountSid, resourceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(resourceSid)) { + throw new Error("Parameter 'resourceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, resourceSid, sid }; + this._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers/${resourceSid}/AssignedAddOns/${sid}.json`; + } + get extensions() { + this._extensions = + this._extensions || + (0, assignedAddOnExtension_1.AssignedAddOnExtensionListInstance)(this._version, this._solution.accountSid, this._solution.resourceSid, this._solution.sid); + return this._extensions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AssignedAddOnInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.resourceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssignedAddOnContextImpl = AssignedAddOnContextImpl; +class AssignedAddOnInstance { + constructor(_version, payload, accountSid, resourceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.resourceSid = payload.resource_sid; + this.friendlyName = payload.friendly_name; + this.description = payload.description; + this.configuration = payload.configuration; + this.uniqueName = payload.unique_name; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.uri = payload.uri; + this.subresourceUris = payload.subresource_uris; + this._solution = { accountSid, resourceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AssignedAddOnContextImpl(this._version, this._solution.accountSid, this._solution.resourceSid, this._solution.sid); + return this._context; + } + /** + * Remove a AssignedAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AssignedAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssignedAddOnInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the extensions. + */ + extensions() { + return this._proxy.extensions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + resourceSid: this.resourceSid, + friendlyName: this.friendlyName, + description: this.description, + configuration: this.configuration, + uniqueName: this.uniqueName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + uri: this.uri, + subresourceUris: this.subresourceUris, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssignedAddOnInstance = AssignedAddOnInstance; +function AssignedAddOnListInstance(version, accountSid, resourceSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(resourceSid)) { + throw new Error("Parameter 'resourceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AssignedAddOnContextImpl(version, accountSid, resourceSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, resourceSid }; + instance._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers/${resourceSid}/AssignedAddOns.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["installedAddOnSid"] === null || + params["installedAddOnSid"] === undefined) { + throw new Error("Required parameter \"params['installedAddOnSid']\" missing."); + } + let data = {}; + data["InstalledAddOnSid"] = params["installedAddOnSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssignedAddOnInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.resourceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssignedAddOnPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AssignedAddOnPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AssignedAddOnListInstance = AssignedAddOnListInstance; +class AssignedAddOnPage extends Page_1.default { + /** + * Initialize the AssignedAddOnPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AssignedAddOnInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AssignedAddOnInstance(this._version, payload, this._solution.accountSid, this._solution.resourceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssignedAddOnPage = AssignedAddOnPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.d.ts new file mode 100644 index 00000000..08ce6709 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.d.ts @@ -0,0 +1,241 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +/** + * Options to pass to each + */ +export interface AssignedAddOnExtensionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AssignedAddOnExtensionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AssignedAddOnExtensionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AssignedAddOnExtensionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AssignedAddOnExtensionContext { + /** + * Fetch a AssignedAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssignedAddOnExtensionInstance + */ + fetch(callback?: (error: Error | null, item?: AssignedAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AssignedAddOnExtensionContextSolution { + accountSid: string; + resourceSid: string; + assignedAddOnSid: string; + sid: string; +} +export declare class AssignedAddOnExtensionContextImpl implements AssignedAddOnExtensionContext { + protected _version: V2010; + protected _solution: AssignedAddOnExtensionContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, resourceSid: string, assignedAddOnSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: AssignedAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AssignedAddOnExtensionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AssignedAddOnExtensionPayload extends TwilioResponsePayload { + extensions: AssignedAddOnExtensionResource[]; +} +interface AssignedAddOnExtensionResource { + sid: string; + account_sid: string; + resource_sid: string; + assigned_add_on_sid: string; + friendly_name: string; + product_name: string; + unique_name: string; + uri: string; + enabled: boolean; +} +export declare class AssignedAddOnExtensionInstance { + protected _version: V2010; + protected _solution: AssignedAddOnExtensionContextSolution; + protected _context?: AssignedAddOnExtensionContext; + constructor(_version: V2010, payload: AssignedAddOnExtensionResource, accountSid: string, resourceSid: string, assignedAddOnSid: string, sid?: string); + /** + * The unique string that that we created to identify the resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. + */ + accountSid: string; + /** + * The SID of the Phone Number to which the Add-on is assigned. + */ + resourceSid: string; + /** + * The SID that uniquely identifies the assigned Add-on installation. + */ + assignedAddOnSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * A string that you assigned to describe the Product this Extension is used within. + */ + productName: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * Whether the Extension will be invoked. + */ + enabled: boolean; + private get _proxy(); + /** + * Fetch a AssignedAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssignedAddOnExtensionInstance + */ + fetch(callback?: (error: Error | null, item?: AssignedAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + resourceSid: string; + assignedAddOnSid: string; + friendlyName: string; + productName: string; + uniqueName: string; + uri: string; + enabled: boolean; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AssignedAddOnExtensionSolution { + accountSid: string; + resourceSid: string; + assignedAddOnSid: string; +} +export interface AssignedAddOnExtensionListInstance { + _version: V2010; + _solution: AssignedAddOnExtensionSolution; + _uri: string; + (sid: string): AssignedAddOnExtensionContext; + get(sid: string): AssignedAddOnExtensionContext; + /** + * Streams AssignedAddOnExtensionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssignedAddOnExtensionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AssignedAddOnExtensionInstance, done: (err?: Error) => void) => void): void; + each(params: AssignedAddOnExtensionListInstanceEachOptions, callback?: (item: AssignedAddOnExtensionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AssignedAddOnExtensionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AssignedAddOnExtensionPage) => any): Promise; + /** + * Lists AssignedAddOnExtensionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssignedAddOnExtensionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AssignedAddOnExtensionInstance[]) => any): Promise; + list(params: AssignedAddOnExtensionListInstanceOptions, callback?: (error: Error | null, items: AssignedAddOnExtensionInstance[]) => any): Promise; + /** + * Retrieve a single page of AssignedAddOnExtensionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssignedAddOnExtensionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AssignedAddOnExtensionPage) => any): Promise; + page(params: AssignedAddOnExtensionListInstancePageOptions, callback?: (error: Error | null, items: AssignedAddOnExtensionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AssignedAddOnExtensionListInstance(version: V2010, accountSid: string, resourceSid: string, assignedAddOnSid: string): AssignedAddOnExtensionListInstance; +export declare class AssignedAddOnExtensionPage extends Page { + /** + * Initialize the AssignedAddOnExtensionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AssignedAddOnExtensionSolution); + /** + * Build an instance of AssignedAddOnExtensionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AssignedAddOnExtensionResource): AssignedAddOnExtensionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js new file mode 100644 index 00000000..0b6f1b59 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js @@ -0,0 +1,210 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssignedAddOnExtensionPage = exports.AssignedAddOnExtensionListInstance = exports.AssignedAddOnExtensionInstance = exports.AssignedAddOnExtensionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class AssignedAddOnExtensionContextImpl { + constructor(_version, accountSid, resourceSid, assignedAddOnSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(resourceSid)) { + throw new Error("Parameter 'resourceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(assignedAddOnSid)) { + throw new Error("Parameter 'assignedAddOnSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, resourceSid, assignedAddOnSid, sid }; + this._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers/${resourceSid}/AssignedAddOns/${assignedAddOnSid}/Extensions/${sid}.json`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AssignedAddOnExtensionInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.resourceSid, instance._solution.assignedAddOnSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssignedAddOnExtensionContextImpl = AssignedAddOnExtensionContextImpl; +class AssignedAddOnExtensionInstance { + constructor(_version, payload, accountSid, resourceSid, assignedAddOnSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.resourceSid = payload.resource_sid; + this.assignedAddOnSid = payload.assigned_add_on_sid; + this.friendlyName = payload.friendly_name; + this.productName = payload.product_name; + this.uniqueName = payload.unique_name; + this.uri = payload.uri; + this.enabled = payload.enabled; + this._solution = { + accountSid, + resourceSid, + assignedAddOnSid, + sid: sid || this.sid, + }; + } + get _proxy() { + this._context = + this._context || + new AssignedAddOnExtensionContextImpl(this._version, this._solution.accountSid, this._solution.resourceSid, this._solution.assignedAddOnSid, this._solution.sid); + return this._context; + } + /** + * Fetch a AssignedAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssignedAddOnExtensionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + resourceSid: this.resourceSid, + assignedAddOnSid: this.assignedAddOnSid, + friendlyName: this.friendlyName, + productName: this.productName, + uniqueName: this.uniqueName, + uri: this.uri, + enabled: this.enabled, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssignedAddOnExtensionInstance = AssignedAddOnExtensionInstance; +function AssignedAddOnExtensionListInstance(version, accountSid, resourceSid, assignedAddOnSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(resourceSid)) { + throw new Error("Parameter 'resourceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(assignedAddOnSid)) { + throw new Error("Parameter 'assignedAddOnSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AssignedAddOnExtensionContextImpl(version, accountSid, resourceSid, assignedAddOnSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, resourceSid, assignedAddOnSid }; + instance._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers/${resourceSid}/AssignedAddOns/${assignedAddOnSid}/Extensions.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssignedAddOnExtensionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AssignedAddOnExtensionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AssignedAddOnExtensionListInstance = AssignedAddOnExtensionListInstance; +class AssignedAddOnExtensionPage extends Page_1.default { + /** + * Initialize the AssignedAddOnExtensionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AssignedAddOnExtensionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AssignedAddOnExtensionInstance(this._version, payload, this._solution.accountSid, this._solution.resourceSid, this._solution.assignedAddOnSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssignedAddOnExtensionPage = AssignedAddOnExtensionPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts new file mode 100644 index 00000000..d494bd70 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts @@ -0,0 +1,412 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +export type LocalAddressRequirement = "none" | "any" | "local" | "foreign"; +export type LocalEmergencyAddressStatus = "registered" | "unregistered" | "pending-registration" | "registration-failure" | "pending-unregistration" | "unregistration-failure"; +export type LocalEmergencyStatus = "Active" | "Inactive"; +export type LocalVoiceReceiveMode = "voice" | "fax"; +/** + * Options to pass to create a LocalInstance + */ +export interface LocalListInstanceCreateOptions { + /** The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. */ + phoneNumber: string; + /** The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. */ + apiVersion?: string; + /** A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. */ + friendlyName?: string; + /** The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. */ + smsApplicationSid?: string; + /** The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsFallbackMethod?: string; + /** The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsMethod?: string; + /** The URL we should call when the new phone number receives an incoming SMS message. */ + smsUrl?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + statusCallbackMethod?: string; + /** The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. */ + voiceApplicationSid?: string; + /** Whether to lookup the caller\\\'s name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. */ + voiceCallerIdLookup?: boolean; + /** The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. */ + voiceFallbackUrl?: string; + /** The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceMethod?: string; + /** The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. */ + voiceUrl?: string; + /** The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. */ + identitySid?: string; + /** The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. */ + addressSid?: string; + /** */ + emergencyStatus?: LocalEmergencyStatus; + /** The SID of the emergency address configuration to use for emergency calling from the new phone number. */ + emergencyAddressSid?: string; + /** The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. */ + trunkSid?: string; + /** */ + voiceReceiveMode?: LocalVoiceReceiveMode; + /** The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ + bundleSid?: string; +} +/** + * Options to pass to each + */ +export interface LocalListInstanceEachOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: LocalInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface LocalListInstanceOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface LocalListInstancePageOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface LocalSolution { + accountSid: string; +} +export interface LocalListInstance { + _version: V2010; + _solution: LocalSolution; + _uri: string; + /** + * Create a LocalInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LocalInstance + */ + create(params: LocalListInstanceCreateOptions, callback?: (error: Error | null, item?: LocalInstance) => any): Promise; + /** + * Streams LocalInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LocalListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: LocalInstance, done: (err?: Error) => void) => void): void; + each(params: LocalListInstanceEachOptions, callback?: (item: LocalInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of LocalInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: LocalPage) => any): Promise; + /** + * Lists LocalInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LocalListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: LocalInstance[]) => any): Promise; + list(params: LocalListInstanceOptions, callback?: (error: Error | null, items: LocalInstance[]) => any): Promise; + /** + * Retrieve a single page of LocalInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LocalListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: LocalPage) => any): Promise; + page(params: LocalListInstancePageOptions, callback?: (error: Error | null, items: LocalPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function LocalListInstance(version: V2010, accountSid: string): LocalListInstance; +interface LocalPayload extends TwilioResponsePayload { + incoming_phone_numbers: LocalResource[]; +} +interface LocalResource { + account_sid: string; + address_sid: string; + address_requirements: LocalAddressRequirement; + api_version: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + date_created: Date; + date_updated: Date; + friendly_name: string; + identity_sid: string; + phone_number: string; + origin: string; + sid: string; + sms_application_sid: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + status_callback: string; + status_callback_method: string; + trunk_sid: string; + uri: string; + voice_receive_mode: LocalVoiceReceiveMode; + voice_application_sid: string; + voice_caller_id_lookup: boolean; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_url: string; + emergency_status: LocalEmergencyStatus; + emergency_address_sid: string; + emergency_address_status: LocalEmergencyAddressStatus; + bundle_sid: string; + status: string; +} +export declare class LocalInstance { + protected _version: V2010; + constructor(_version: V2010, payload: LocalResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. + */ + accountSid: string; + /** + * The SID of the Address resource associated with the phone number. + */ + addressSid: string; + addressRequirements: LocalAddressRequirement; + /** + * The API version used to start a new TwiML session. + */ + apiVersion: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SID of the Identity resource that we associate with the phone number. Some regions require an Identity to meet local regulations. + */ + identitySid: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The phone number\'s origin. `twilio` identifies Twilio-owned phone numbers and `hosted` identifies hosted phone numbers. + */ + origin: string; + /** + * The unique string that that we created to identify the resource. + */ + sid: string; + /** + * The SID of the application that handles SMS messages sent to the phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + */ + smsApplicationSid: string; + /** + * The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`. + */ + smsFallbackMethod: string; + /** + * The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`. + */ + smsFallbackUrl: string; + /** + * The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. + */ + smsMethod: string; + /** + * The URL we call when the phone number receives an incoming SMS message. + */ + smsUrl: string; + /** + * The URL we call using the `status_callback_method` to send status information to your application. + */ + statusCallback: string; + /** + * The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. + */ + statusCallbackMethod: string; + /** + * The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + */ + trunkSid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + voiceReceiveMode: LocalVoiceReceiveMode; + /** + * The SID of the application that handles calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + */ + voiceApplicationSid: string; + /** + * Whether we look up the caller\'s caller-ID name from the CNAM database ($0.01 per look up). Can be: `true` or `false`. + */ + voiceCallerIdLookup: boolean; + /** + * The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`. + */ + voiceFallbackUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The URL we call when this phone number receives a call. The `voice_url` will not be used if a `voice_application_sid` or a `trunk_sid` is set. + */ + voiceUrl: string; + emergencyStatus: LocalEmergencyStatus; + /** + * The SID of the emergency address configuration that we use for emergency calling from this phone number. + */ + emergencyAddressSid: string; + emergencyAddressStatus: LocalEmergencyAddressStatus; + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + */ + bundleSid: string; + status: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + addressSid: string; + addressRequirements: LocalAddressRequirement; + apiVersion: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + identitySid: string; + phoneNumber: string; + origin: string; + sid: string; + smsApplicationSid: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + statusCallback: string; + statusCallbackMethod: string; + trunkSid: string; + uri: string; + voiceReceiveMode: LocalVoiceReceiveMode; + voiceApplicationSid: string; + voiceCallerIdLookup: boolean; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + emergencyStatus: LocalEmergencyStatus; + emergencyAddressSid: string; + emergencyAddressStatus: LocalEmergencyAddressStatus; + bundleSid: string; + status: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class LocalPage extends Page { + /** + * Initialize the LocalPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: LocalSolution); + /** + * Build an instance of LocalInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: LocalResource): LocalInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/local.js b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/local.js new file mode 100644 index 00000000..242e3b9d --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/local.js @@ -0,0 +1,261 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LocalPage = exports.LocalInstance = exports.LocalListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function LocalListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers/Local.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) { + throw new Error("Required parameter \"params['phoneNumber']\" missing."); + } + let data = {}; + data["PhoneNumber"] = params["phoneNumber"]; + if (params["apiVersion"] !== undefined) + data["ApiVersion"] = params["apiVersion"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["smsApplicationSid"] !== undefined) + data["SmsApplicationSid"] = params["smsApplicationSid"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["voiceApplicationSid"] !== undefined) + data["VoiceApplicationSid"] = params["voiceApplicationSid"]; + if (params["voiceCallerIdLookup"] !== undefined) + data["VoiceCallerIdLookup"] = serialize.bool(params["voiceCallerIdLookup"]); + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["identitySid"] !== undefined) + data["IdentitySid"] = params["identitySid"]; + if (params["addressSid"] !== undefined) + data["AddressSid"] = params["addressSid"]; + if (params["emergencyStatus"] !== undefined) + data["EmergencyStatus"] = params["emergencyStatus"]; + if (params["emergencyAddressSid"] !== undefined) + data["EmergencyAddressSid"] = params["emergencyAddressSid"]; + if (params["trunkSid"] !== undefined) + data["TrunkSid"] = params["trunkSid"]; + if (params["voiceReceiveMode"] !== undefined) + data["VoiceReceiveMode"] = params["voiceReceiveMode"]; + if (params["bundleSid"] !== undefined) + data["BundleSid"] = params["bundleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new LocalInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["origin"] !== undefined) + data["Origin"] = params["origin"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new LocalPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new LocalPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.LocalListInstance = LocalListInstance; +class LocalInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.addressSid = payload.address_sid; + this.addressRequirements = payload.address_requirements; + this.apiVersion = payload.api_version; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.identitySid = payload.identity_sid; + this.phoneNumber = payload.phone_number; + this.origin = payload.origin; + this.sid = payload.sid; + this.smsApplicationSid = payload.sms_application_sid; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.trunkSid = payload.trunk_sid; + this.uri = payload.uri; + this.voiceReceiveMode = payload.voice_receive_mode; + this.voiceApplicationSid = payload.voice_application_sid; + this.voiceCallerIdLookup = payload.voice_caller_id_lookup; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceUrl = payload.voice_url; + this.emergencyStatus = payload.emergency_status; + this.emergencyAddressSid = payload.emergency_address_sid; + this.emergencyAddressStatus = payload.emergency_address_status; + this.bundleSid = payload.bundle_sid; + this.status = payload.status; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + addressSid: this.addressSid, + addressRequirements: this.addressRequirements, + apiVersion: this.apiVersion, + beta: this.beta, + capabilities: this.capabilities, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + identitySid: this.identitySid, + phoneNumber: this.phoneNumber, + origin: this.origin, + sid: this.sid, + smsApplicationSid: this.smsApplicationSid, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + trunkSid: this.trunkSid, + uri: this.uri, + voiceReceiveMode: this.voiceReceiveMode, + voiceApplicationSid: this.voiceApplicationSid, + voiceCallerIdLookup: this.voiceCallerIdLookup, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceUrl: this.voiceUrl, + emergencyStatus: this.emergencyStatus, + emergencyAddressSid: this.emergencyAddressSid, + emergencyAddressStatus: this.emergencyAddressStatus, + bundleSid: this.bundleSid, + status: this.status, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LocalInstance = LocalInstance; +class LocalPage extends Page_1.default { + /** + * Initialize the LocalPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of LocalInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new LocalInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LocalPage = LocalPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts new file mode 100644 index 00000000..bcc73dfd --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts @@ -0,0 +1,412 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +export type MobileAddressRequirement = "none" | "any" | "local" | "foreign"; +export type MobileEmergencyAddressStatus = "registered" | "unregistered" | "pending-registration" | "registration-failure" | "pending-unregistration" | "unregistration-failure"; +export type MobileEmergencyStatus = "Active" | "Inactive"; +export type MobileVoiceReceiveMode = "voice" | "fax"; +/** + * Options to pass to create a MobileInstance + */ +export interface MobileListInstanceCreateOptions { + /** The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. */ + phoneNumber: string; + /** The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. */ + apiVersion?: string; + /** A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. */ + friendlyName?: string; + /** The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. */ + smsApplicationSid?: string; + /** The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsFallbackMethod?: string; + /** The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsMethod?: string; + /** The URL we should call when the new phone number receives an incoming SMS message. */ + smsUrl?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + statusCallbackMethod?: string; + /** The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. */ + voiceApplicationSid?: string; + /** Whether to lookup the caller\\\'s name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. */ + voiceCallerIdLookup?: boolean; + /** The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. */ + voiceFallbackUrl?: string; + /** The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceMethod?: string; + /** The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. */ + voiceUrl?: string; + /** The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. */ + identitySid?: string; + /** The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. */ + addressSid?: string; + /** */ + emergencyStatus?: MobileEmergencyStatus; + /** The SID of the emergency address configuration to use for emergency calling from the new phone number. */ + emergencyAddressSid?: string; + /** The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. */ + trunkSid?: string; + /** */ + voiceReceiveMode?: MobileVoiceReceiveMode; + /** The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ + bundleSid?: string; +} +/** + * Options to pass to each + */ +export interface MobileListInstanceEachOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MobileInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MobileListInstanceOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MobileListInstancePageOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MobileSolution { + accountSid: string; +} +export interface MobileListInstance { + _version: V2010; + _solution: MobileSolution; + _uri: string; + /** + * Create a MobileInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MobileInstance + */ + create(params: MobileListInstanceCreateOptions, callback?: (error: Error | null, item?: MobileInstance) => any): Promise; + /** + * Streams MobileInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MobileListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MobileInstance, done: (err?: Error) => void) => void): void; + each(params: MobileListInstanceEachOptions, callback?: (item: MobileInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MobileInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MobilePage) => any): Promise; + /** + * Lists MobileInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MobileListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MobileInstance[]) => any): Promise; + list(params: MobileListInstanceOptions, callback?: (error: Error | null, items: MobileInstance[]) => any): Promise; + /** + * Retrieve a single page of MobileInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MobileListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MobilePage) => any): Promise; + page(params: MobileListInstancePageOptions, callback?: (error: Error | null, items: MobilePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MobileListInstance(version: V2010, accountSid: string): MobileListInstance; +interface MobilePayload extends TwilioResponsePayload { + incoming_phone_numbers: MobileResource[]; +} +interface MobileResource { + account_sid: string; + address_sid: string; + address_requirements: MobileAddressRequirement; + api_version: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + date_created: Date; + date_updated: Date; + friendly_name: string; + identity_sid: string; + phone_number: string; + origin: string; + sid: string; + sms_application_sid: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + status_callback: string; + status_callback_method: string; + trunk_sid: string; + uri: string; + voice_receive_mode: MobileVoiceReceiveMode; + voice_application_sid: string; + voice_caller_id_lookup: boolean; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_url: string; + emergency_status: MobileEmergencyStatus; + emergency_address_sid: string; + emergency_address_status: MobileEmergencyAddressStatus; + bundle_sid: string; + status: string; +} +export declare class MobileInstance { + protected _version: V2010; + constructor(_version: V2010, payload: MobileResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. + */ + accountSid: string; + /** + * The SID of the Address resource associated with the phone number. + */ + addressSid: string; + addressRequirements: MobileAddressRequirement; + /** + * The API version used to start a new TwiML session. + */ + apiVersion: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SID of the Identity resource that we associate with the phone number. Some regions require an Identity to meet local regulations. + */ + identitySid: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The phone number\'s origin. `twilio` identifies Twilio-owned phone numbers and `hosted` identifies hosted phone numbers. + */ + origin: string; + /** + * The unique string that that we created to identify the resource. + */ + sid: string; + /** + * The SID of the application that handles SMS messages sent to the phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + */ + smsApplicationSid: string; + /** + * The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`. + */ + smsFallbackMethod: string; + /** + * The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`. + */ + smsFallbackUrl: string; + /** + * The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. + */ + smsMethod: string; + /** + * The URL we call when the phone number receives an incoming SMS message. + */ + smsUrl: string; + /** + * The URL we call using the `status_callback_method` to send status information to your application. + */ + statusCallback: string; + /** + * The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. + */ + statusCallbackMethod: string; + /** + * The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + */ + trunkSid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + voiceReceiveMode: MobileVoiceReceiveMode; + /** + * The SID of the application that handles calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + */ + voiceApplicationSid: string; + /** + * Whether we look up the caller\'s caller-ID name from the CNAM database ($0.01 per look up). Can be: `true` or `false`. + */ + voiceCallerIdLookup: boolean; + /** + * The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`. + */ + voiceFallbackUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The URL we call when the phone number receives a call. The `voice_url` will not be used if a `voice_application_sid` or a `trunk_sid` is set. + */ + voiceUrl: string; + emergencyStatus: MobileEmergencyStatus; + /** + * The SID of the emergency address configuration that we use for emergency calling from this phone number. + */ + emergencyAddressSid: string; + emergencyAddressStatus: MobileEmergencyAddressStatus; + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + */ + bundleSid: string; + status: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + addressSid: string; + addressRequirements: MobileAddressRequirement; + apiVersion: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + identitySid: string; + phoneNumber: string; + origin: string; + sid: string; + smsApplicationSid: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + statusCallback: string; + statusCallbackMethod: string; + trunkSid: string; + uri: string; + voiceReceiveMode: MobileVoiceReceiveMode; + voiceApplicationSid: string; + voiceCallerIdLookup: boolean; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + emergencyStatus: MobileEmergencyStatus; + emergencyAddressSid: string; + emergencyAddressStatus: MobileEmergencyAddressStatus; + bundleSid: string; + status: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class MobilePage extends Page { + /** + * Initialize the MobilePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: MobileSolution); + /** + * Build an instance of MobileInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MobileResource): MobileInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js new file mode 100644 index 00000000..4795b041 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js @@ -0,0 +1,261 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MobilePage = exports.MobileInstance = exports.MobileListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function MobileListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers/Mobile.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) { + throw new Error("Required parameter \"params['phoneNumber']\" missing."); + } + let data = {}; + data["PhoneNumber"] = params["phoneNumber"]; + if (params["apiVersion"] !== undefined) + data["ApiVersion"] = params["apiVersion"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["smsApplicationSid"] !== undefined) + data["SmsApplicationSid"] = params["smsApplicationSid"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["voiceApplicationSid"] !== undefined) + data["VoiceApplicationSid"] = params["voiceApplicationSid"]; + if (params["voiceCallerIdLookup"] !== undefined) + data["VoiceCallerIdLookup"] = serialize.bool(params["voiceCallerIdLookup"]); + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["identitySid"] !== undefined) + data["IdentitySid"] = params["identitySid"]; + if (params["addressSid"] !== undefined) + data["AddressSid"] = params["addressSid"]; + if (params["emergencyStatus"] !== undefined) + data["EmergencyStatus"] = params["emergencyStatus"]; + if (params["emergencyAddressSid"] !== undefined) + data["EmergencyAddressSid"] = params["emergencyAddressSid"]; + if (params["trunkSid"] !== undefined) + data["TrunkSid"] = params["trunkSid"]; + if (params["voiceReceiveMode"] !== undefined) + data["VoiceReceiveMode"] = params["voiceReceiveMode"]; + if (params["bundleSid"] !== undefined) + data["BundleSid"] = params["bundleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MobileInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["origin"] !== undefined) + data["Origin"] = params["origin"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MobilePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MobilePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MobileListInstance = MobileListInstance; +class MobileInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.addressSid = payload.address_sid; + this.addressRequirements = payload.address_requirements; + this.apiVersion = payload.api_version; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.identitySid = payload.identity_sid; + this.phoneNumber = payload.phone_number; + this.origin = payload.origin; + this.sid = payload.sid; + this.smsApplicationSid = payload.sms_application_sid; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.trunkSid = payload.trunk_sid; + this.uri = payload.uri; + this.voiceReceiveMode = payload.voice_receive_mode; + this.voiceApplicationSid = payload.voice_application_sid; + this.voiceCallerIdLookup = payload.voice_caller_id_lookup; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceUrl = payload.voice_url; + this.emergencyStatus = payload.emergency_status; + this.emergencyAddressSid = payload.emergency_address_sid; + this.emergencyAddressStatus = payload.emergency_address_status; + this.bundleSid = payload.bundle_sid; + this.status = payload.status; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + addressSid: this.addressSid, + addressRequirements: this.addressRequirements, + apiVersion: this.apiVersion, + beta: this.beta, + capabilities: this.capabilities, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + identitySid: this.identitySid, + phoneNumber: this.phoneNumber, + origin: this.origin, + sid: this.sid, + smsApplicationSid: this.smsApplicationSid, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + trunkSid: this.trunkSid, + uri: this.uri, + voiceReceiveMode: this.voiceReceiveMode, + voiceApplicationSid: this.voiceApplicationSid, + voiceCallerIdLookup: this.voiceCallerIdLookup, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceUrl: this.voiceUrl, + emergencyStatus: this.emergencyStatus, + emergencyAddressSid: this.emergencyAddressSid, + emergencyAddressStatus: this.emergencyAddressStatus, + bundleSid: this.bundleSid, + status: this.status, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MobileInstance = MobileInstance; +class MobilePage extends Page_1.default { + /** + * Initialize the MobilePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MobileInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MobileInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MobilePage = MobilePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts new file mode 100644 index 00000000..9ebd7eed --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts @@ -0,0 +1,412 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PhoneNumberCapabilities } from "../../../../../interfaces"; +export type TollFreeAddressRequirement = "none" | "any" | "local" | "foreign"; +export type TollFreeEmergencyAddressStatus = "registered" | "unregistered" | "pending-registration" | "registration-failure" | "pending-unregistration" | "unregistration-failure"; +export type TollFreeEmergencyStatus = "Active" | "Inactive"; +export type TollFreeVoiceReceiveMode = "voice" | "fax"; +/** + * Options to pass to create a TollFreeInstance + */ +export interface TollFreeListInstanceCreateOptions { + /** The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. */ + phoneNumber: string; + /** The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. */ + apiVersion?: string; + /** A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. */ + friendlyName?: string; + /** The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. */ + smsApplicationSid?: string; + /** The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsFallbackMethod?: string; + /** The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + smsMethod?: string; + /** The URL we should call when the new phone number receives an incoming SMS message. */ + smsUrl?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + statusCallbackMethod?: string; + /** The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. */ + voiceApplicationSid?: string; + /** Whether to lookup the caller\\\'s name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. */ + voiceCallerIdLookup?: boolean; + /** The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. */ + voiceFallbackUrl?: string; + /** The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. */ + voiceMethod?: string; + /** The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. */ + voiceUrl?: string; + /** The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. */ + identitySid?: string; + /** The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. */ + addressSid?: string; + /** */ + emergencyStatus?: TollFreeEmergencyStatus; + /** The SID of the emergency address configuration to use for emergency calling from the new phone number. */ + emergencyAddressSid?: string; + /** The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. */ + trunkSid?: string; + /** */ + voiceReceiveMode?: TollFreeVoiceReceiveMode; + /** The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ + bundleSid?: string; +} +/** + * Options to pass to each + */ +export interface TollFreeListInstanceEachOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TollFreeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TollFreeListInstanceOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TollFreeListInstancePageOptions { + /** Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. */ + beta?: boolean; + /** A string that identifies the resources to read. */ + friendlyName?: string; + /** The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + phoneNumber?: string; + /** Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ + origin?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TollFreeSolution { + accountSid: string; +} +export interface TollFreeListInstance { + _version: V2010; + _solution: TollFreeSolution; + _uri: string; + /** + * Create a TollFreeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollFreeInstance + */ + create(params: TollFreeListInstanceCreateOptions, callback?: (error: Error | null, item?: TollFreeInstance) => any): Promise; + /** + * Streams TollFreeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollFreeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TollFreeInstance, done: (err?: Error) => void) => void): void; + each(params: TollFreeListInstanceEachOptions, callback?: (item: TollFreeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TollFreeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TollFreePage) => any): Promise; + /** + * Lists TollFreeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollFreeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TollFreeInstance[]) => any): Promise; + list(params: TollFreeListInstanceOptions, callback?: (error: Error | null, items: TollFreeInstance[]) => any): Promise; + /** + * Retrieve a single page of TollFreeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollFreeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TollFreePage) => any): Promise; + page(params: TollFreeListInstancePageOptions, callback?: (error: Error | null, items: TollFreePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TollFreeListInstance(version: V2010, accountSid: string): TollFreeListInstance; +interface TollFreePayload extends TwilioResponsePayload { + incoming_phone_numbers: TollFreeResource[]; +} +interface TollFreeResource { + account_sid: string; + address_sid: string; + address_requirements: TollFreeAddressRequirement; + api_version: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + date_created: Date; + date_updated: Date; + friendly_name: string; + identity_sid: string; + phone_number: string; + origin: string; + sid: string; + sms_application_sid: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + status_callback: string; + status_callback_method: string; + trunk_sid: string; + uri: string; + voice_receive_mode: TollFreeVoiceReceiveMode; + voice_application_sid: string; + voice_caller_id_lookup: boolean; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_url: string; + emergency_status: TollFreeEmergencyStatus; + emergency_address_sid: string; + emergency_address_status: TollFreeEmergencyAddressStatus; + bundle_sid: string; + status: string; +} +export declare class TollFreeInstance { + protected _version: V2010; + constructor(_version: V2010, payload: TollFreeResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. + */ + accountSid: string; + /** + * The SID of the Address resource associated with the phone number. + */ + addressSid: string; + addressRequirements: TollFreeAddressRequirement; + /** + * The API version used to start a new TwiML session. + */ + apiVersion: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + capabilities: PhoneNumberCapabilities; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SID of the Identity resource that we associate with the phone number. Some regions require an Identity to meet local regulations. + */ + identitySid: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The phone number\'s origin. `twilio` identifies Twilio-owned phone numbers and `hosted` identifies hosted phone numbers. + */ + origin: string; + /** + * The unique string that that we created to identify the resource. + */ + sid: string; + /** + * The SID of the application that handles SMS messages sent to the phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + */ + smsApplicationSid: string; + /** + * The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`. + */ + smsFallbackMethod: string; + /** + * The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`. + */ + smsFallbackUrl: string; + /** + * The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. + */ + smsMethod: string; + /** + * The URL we call when the phone number receives an incoming SMS message. + */ + smsUrl: string; + /** + * The URL we call using the `status_callback_method` to send status information to your application. + */ + statusCallback: string; + /** + * The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. + */ + statusCallbackMethod: string; + /** + * The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + */ + trunkSid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + voiceReceiveMode: TollFreeVoiceReceiveMode; + /** + * The SID of the application that handles calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + */ + voiceApplicationSid: string; + /** + * Whether we look up the caller\'s caller-ID name from the CNAM database ($0.01 per look up). Can be: `true` or `false`. + */ + voiceCallerIdLookup: boolean; + /** + * The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`. + */ + voiceFallbackUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The URL we call when the phone number receives a call. The `voice_url` will not be used if a `voice_application_sid` or a `trunk_sid` is set. + */ + voiceUrl: string; + emergencyStatus: TollFreeEmergencyStatus; + /** + * The SID of the emergency address configuration that we use for emergency calling from this phone number. + */ + emergencyAddressSid: string; + emergencyAddressStatus: TollFreeEmergencyAddressStatus; + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + */ + bundleSid: string; + status: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + addressSid: string; + addressRequirements: TollFreeAddressRequirement; + apiVersion: string; + beta: boolean; + capabilities: PhoneNumberCapabilities; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + identitySid: string; + phoneNumber: string; + origin: string; + sid: string; + smsApplicationSid: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + statusCallback: string; + statusCallbackMethod: string; + trunkSid: string; + uri: string; + voiceReceiveMode: TollFreeVoiceReceiveMode; + voiceApplicationSid: string; + voiceCallerIdLookup: boolean; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + emergencyStatus: TollFreeEmergencyStatus; + emergencyAddressSid: string; + emergencyAddressStatus: TollFreeEmergencyAddressStatus; + bundleSid: string; + status: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class TollFreePage extends Page { + /** + * Initialize the TollFreePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: TollFreeSolution); + /** + * Build an instance of TollFreeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TollFreeResource): TollFreeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js new file mode 100644 index 00000000..83ad0b3f --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js @@ -0,0 +1,261 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TollFreePage = exports.TollFreeInstance = exports.TollFreeListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function TollFreeListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/IncomingPhoneNumbers/TollFree.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) { + throw new Error("Required parameter \"params['phoneNumber']\" missing."); + } + let data = {}; + data["PhoneNumber"] = params["phoneNumber"]; + if (params["apiVersion"] !== undefined) + data["ApiVersion"] = params["apiVersion"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["smsApplicationSid"] !== undefined) + data["SmsApplicationSid"] = params["smsApplicationSid"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["voiceApplicationSid"] !== undefined) + data["VoiceApplicationSid"] = params["voiceApplicationSid"]; + if (params["voiceCallerIdLookup"] !== undefined) + data["VoiceCallerIdLookup"] = serialize.bool(params["voiceCallerIdLookup"]); + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["identitySid"] !== undefined) + data["IdentitySid"] = params["identitySid"]; + if (params["addressSid"] !== undefined) + data["AddressSid"] = params["addressSid"]; + if (params["emergencyStatus"] !== undefined) + data["EmergencyStatus"] = params["emergencyStatus"]; + if (params["emergencyAddressSid"] !== undefined) + data["EmergencyAddressSid"] = params["emergencyAddressSid"]; + if (params["trunkSid"] !== undefined) + data["TrunkSid"] = params["trunkSid"]; + if (params["voiceReceiveMode"] !== undefined) + data["VoiceReceiveMode"] = params["voiceReceiveMode"]; + if (params["bundleSid"] !== undefined) + data["BundleSid"] = params["bundleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TollFreeInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["beta"] !== undefined) + data["Beta"] = serialize.bool(params["beta"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["origin"] !== undefined) + data["Origin"] = params["origin"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TollFreePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TollFreePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TollFreeListInstance = TollFreeListInstance; +class TollFreeInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.addressSid = payload.address_sid; + this.addressRequirements = payload.address_requirements; + this.apiVersion = payload.api_version; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.identitySid = payload.identity_sid; + this.phoneNumber = payload.phone_number; + this.origin = payload.origin; + this.sid = payload.sid; + this.smsApplicationSid = payload.sms_application_sid; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.trunkSid = payload.trunk_sid; + this.uri = payload.uri; + this.voiceReceiveMode = payload.voice_receive_mode; + this.voiceApplicationSid = payload.voice_application_sid; + this.voiceCallerIdLookup = payload.voice_caller_id_lookup; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceUrl = payload.voice_url; + this.emergencyStatus = payload.emergency_status; + this.emergencyAddressSid = payload.emergency_address_sid; + this.emergencyAddressStatus = payload.emergency_address_status; + this.bundleSid = payload.bundle_sid; + this.status = payload.status; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + addressSid: this.addressSid, + addressRequirements: this.addressRequirements, + apiVersion: this.apiVersion, + beta: this.beta, + capabilities: this.capabilities, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + identitySid: this.identitySid, + phoneNumber: this.phoneNumber, + origin: this.origin, + sid: this.sid, + smsApplicationSid: this.smsApplicationSid, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + trunkSid: this.trunkSid, + uri: this.uri, + voiceReceiveMode: this.voiceReceiveMode, + voiceApplicationSid: this.voiceApplicationSid, + voiceCallerIdLookup: this.voiceCallerIdLookup, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceUrl: this.voiceUrl, + emergencyStatus: this.emergencyStatus, + emergencyAddressSid: this.emergencyAddressSid, + emergencyAddressStatus: this.emergencyAddressStatus, + bundleSid: this.bundleSid, + status: this.status, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TollFreeInstance = TollFreeInstance; +class TollFreePage extends Page_1.default { + /** + * Initialize the TollFreePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TollFreeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TollFreeInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TollFreePage = TollFreePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/key.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/key.d.ts new file mode 100644 index 00000000..0dcf35bc --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/key.d.ts @@ -0,0 +1,266 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +/** + * Options to pass to update a KeyInstance + */ +export interface KeyContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface KeyListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: KeyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface KeyListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface KeyListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface KeyContext { + /** + * Remove a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + fetch(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Update a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + update(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Update a KeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + update(params: KeyContextUpdateOptions, callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface KeyContextSolution { + accountSid: string; + sid: string; +} +export declare class KeyContextImpl implements KeyContext { + protected _version: V2010; + protected _solution: KeyContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + update(params?: KeyContextUpdateOptions | ((error: Error | null, item?: KeyInstance) => any), callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): KeyContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface KeyPayload extends TwilioResponsePayload { + keys: KeyResource[]; +} +interface KeyResource { + sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; +} +export declare class KeyInstance { + protected _version: V2010; + protected _solution: KeyContextSolution; + protected _context?: KeyContext; + constructor(_version: V2010, payload: KeyResource, accountSid: string, sid?: string); + /** + * The unique string that that we created to identify the Key resource. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + fetch(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Update a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + update(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Update a KeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + update(params: KeyContextUpdateOptions, callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface KeySolution { + accountSid: string; +} +export interface KeyListInstance { + _version: V2010; + _solution: KeySolution; + _uri: string; + (sid: string): KeyContext; + get(sid: string): KeyContext; + /** + * Streams KeyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { KeyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: KeyInstance, done: (err?: Error) => void) => void): void; + each(params: KeyListInstanceEachOptions, callback?: (item: KeyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of KeyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: KeyPage) => any): Promise; + /** + * Lists KeyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { KeyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: KeyInstance[]) => any): Promise; + list(params: KeyListInstanceOptions, callback?: (error: Error | null, items: KeyInstance[]) => any): Promise; + /** + * Retrieve a single page of KeyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { KeyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: KeyPage) => any): Promise; + page(params: KeyListInstancePageOptions, callback?: (error: Error | null, items: KeyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function KeyListInstance(version: V2010, accountSid: string): KeyListInstance; +export declare class KeyPage extends Page { + /** + * Initialize the KeyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: KeySolution); + /** + * Build an instance of KeyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: KeyResource): KeyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/key.js b/node_modules/twilio/lib/rest/api/v2010/account/key.js new file mode 100644 index 00000000..667bd522 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/key.js @@ -0,0 +1,229 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KeyPage = exports.KeyListInstance = exports.KeyInstance = exports.KeyContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class KeyContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Keys/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new KeyInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new KeyInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.KeyContextImpl = KeyContextImpl; +class KeyInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new KeyContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.KeyInstance = KeyInstance; +function KeyListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new KeyContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Keys.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new KeyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new KeyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.KeyListInstance = KeyListInstance; +class KeyPage extends Page_1.default { + /** + * Initialize the KeyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of KeyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new KeyInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.KeyPage = KeyPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/message.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/message.d.ts new file mode 100644 index 00000000..3a78b343 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/message.d.ts @@ -0,0 +1,471 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +import { FeedbackListInstance } from "./message/feedback"; +import { MediaListInstance } from "./message/media"; +export type MessageAddressRetention = "retain" | "obfuscate"; +export type MessageContentRetention = "retain" | "discard"; +export type MessageDirection = "inbound" | "outbound-api" | "outbound-call" | "outbound-reply"; +export type MessageRiskCheck = "enable" | "disable"; +export type MessageScheduleType = "fixed"; +export type MessageStatus = "queued" | "sending" | "sent" | "failed" | "delivered" | "undelivered" | "receiving" | "received" | "accepted" | "scheduled" | "read" | "partially_delivered" | "canceled"; +export type MessageUpdateStatus = "canceled"; +/** + * Options to pass to update a MessageInstance + */ +export interface MessageContextUpdateOptions { + /** The new `body` of the Message resource. To redact the text content of a Message, this parameter\\\'s value must be an empty string */ + body?: string; + /** */ + status?: MessageUpdateStatus; +} +/** + * Options to pass to create a MessageInstance + */ +export interface MessageListInstanceCreateOptions { + /** The recipient\\\'s phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. */ + to: string; + /** The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). */ + statusCallback?: string; + /** The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App\\\'s `message_status_callback` URL. */ + applicationSid?: string; + /** The maximum price in US dollars that you are willing to pay for this Message\\\'s delivery. The value can have up to four decimal places. When the `max_price` parameter is provided, the cost of a message is checked before it is sent. If the cost exceeds `max_price`, the message is not sent and the Message `status` is `failed`. */ + maxPrice?: number; + /** Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. */ + provideFeedback?: boolean; + /** Total number of attempts made (including this request) to send the message regardless of the provider used */ + attempt?: number; + /** The maximum length in seconds that the Message can remain in Twilio\\\'s outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) */ + validityPeriod?: number; + /** Reserved */ + forceDelivery?: boolean; + /** */ + contentRetention?: MessageContentRetention; + /** */ + addressRetention?: MessageAddressRetention; + /** Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. */ + smartEncoded?: boolean; + /** Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). */ + persistentAction?: Array; + /** For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. */ + shortenUrls?: boolean; + /** */ + scheduleType?: MessageScheduleType; + /** The time that Twilio will send the message. Must be in ISO 8601 format. */ + sendAt?: Date; + /** If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. */ + sendAsMms?: boolean; + /** For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template\\\'s default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. */ + contentVariables?: string; + /** */ + riskCheck?: MessageRiskCheck; + /** The sender\\\'s Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service\\\'s Sender Pool) or you can provide a specific sender from your Sender Pool. */ + from?: string; + /** The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service\\\'s Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. */ + messagingServiceSid?: string; + /** The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). */ + body?: string; + /** The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. */ + mediaUrl?: Array; + /** For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio\\\'s response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). */ + contentSid?: string; +} +/** + * Options to pass to each + */ +export interface MessageListInstanceEachOptions { + /** Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` */ + to?: string; + /** Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` */ + from?: string; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSent?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentBefore?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessageInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessageListInstanceOptions { + /** Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` */ + to?: string; + /** Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` */ + from?: string; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSent?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentBefore?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessageListInstancePageOptions { + /** Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` */ + to?: string; + /** Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` */ + from?: string; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSent?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentBefore?: Date; + /** Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ + dateSentAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessageContext { + feedback: FeedbackListInstance; + media: MediaListInstance; + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessageContextSolution { + accountSid: string; + sid: string; +} +export declare class MessageContextImpl implements MessageContext { + protected _version: V2010; + protected _solution: MessageContextSolution; + protected _uri: string; + protected _feedback?: FeedbackListInstance; + protected _media?: MediaListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get feedback(): FeedbackListInstance; + get media(): MediaListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + update(params?: MessageContextUpdateOptions | ((error: Error | null, item?: MessageInstance) => any), callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessageContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessagePayload extends TwilioResponsePayload { + messages: MessageResource[]; +} +interface MessageResource { + body: string; + num_segments: string; + direction: MessageDirection; + from: string; + to: string; + date_updated: Date; + price: string; + error_message: string; + uri: string; + account_sid: string; + num_media: string; + status: MessageStatus; + messaging_service_sid: string; + sid: string; + date_sent: Date; + date_created: Date; + error_code: number; + price_unit: string; + api_version: string; + subresource_uris: Record; +} +export declare class MessageInstance { + protected _version: V2010; + protected _solution: MessageContextSolution; + protected _context?: MessageContext; + constructor(_version: V2010, payload: MessageResource, accountSid: string, sid?: string); + /** + * The text content of the message + */ + body: string; + /** + * The number of segments that make up the complete message. SMS message bodies that exceed the [character limit](https://www.twilio.com/docs/glossary/what-sms-character-limit) are segmented and charged as multiple messages. Note: For messages sent via a Messaging Service, `num_segments` is initially `0`, since a sender hasn\'t yet been assigned. + */ + numSegments: string; + direction: MessageDirection; + /** + * The sender\'s phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent. + */ + from: string; + /** + * The recipient\'s phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format) or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g. `whatsapp:+15552229999`) + */ + to: string; + /** + * The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message resource was last updated + */ + dateUpdated: Date; + /** + * The amount billed for the message in the currency specified by `price_unit`. The `price` is populated after the message has been sent/received, and may not be immediately availalble. View the [Pricing page](https://www.twilio.com/en-us/pricing) for more details. + */ + price: string; + /** + * The description of the `error_code` if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. + */ + errorMessage: string; + /** + * The URI of the Message resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message resource + */ + accountSid: string; + /** + * The number of media files associated with the Message resource. + */ + numMedia: string; + status: MessageStatus; + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource. The value is `null` if a Messaging Service was not used. + */ + messagingServiceSid: string; + /** + * The unique, Twilio-provided string that identifies the Message resource. + */ + sid: string; + /** + * The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message was sent. For an outgoing message, this is when Twilio sent the message. For an incoming message, this is when Twilio sent the HTTP request to your incoming message webhook URL. + */ + dateSent: Date; + /** + * The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message resource was created + */ + dateCreated: Date; + /** + * The [error code](https://www.twilio.com/docs/api/errors) returned if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. + */ + errorCode: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The API version used to process the Message + */ + apiVersion: string; + /** + * A list of related resources identified by their URIs relative to `https://api.twilio.com` + */ + subresourceUris: Record; + private get _proxy(); + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Access the feedback. + */ + feedback(): FeedbackListInstance; + /** + * Access the media. + */ + media(): MediaListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + body: string; + numSegments: string; + direction: MessageDirection; + from: string; + to: string; + dateUpdated: Date; + price: string; + errorMessage: string; + uri: string; + accountSid: string; + numMedia: string; + status: MessageStatus; + messagingServiceSid: string; + sid: string; + dateSent: Date; + dateCreated: Date; + errorCode: number; + priceUnit: string; + apiVersion: string; + subresourceUris: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessageSolution { + accountSid: string; +} +export interface MessageListInstance { + _version: V2010; + _solution: MessageSolution; + _uri: string; + (sid: string): MessageContext; + get(sid: string): MessageContext; + /** + * Create a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(params: MessageListInstanceCreateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Streams MessageInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + each(params: MessageListInstanceEachOptions, callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Lists MessageInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + list(params: MessageListInstanceOptions, callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + /** + * Retrieve a single page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessagePage) => any): Promise; + page(params: MessageListInstancePageOptions, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessageListInstance(version: V2010, accountSid: string): MessageListInstance; +export declare class MessagePage extends Page { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: MessageSolution); + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessageResource): MessageInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/message.js b/node_modules/twilio/lib/rest/api/v2010/account/message.js new file mode 100644 index 00000000..4fcaeca7 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/message.js @@ -0,0 +1,364 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagePage = exports.MessageListInstance = exports.MessageInstance = exports.MessageContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const feedback_1 = require("./message/feedback"); +const media_1 = require("./message/media"); +class MessageContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Messages/${sid}.json`; + } + get feedback() { + this._feedback = + this._feedback || + (0, feedback_1.FeedbackListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._feedback; + } + get media() { + this._media = + this._media || + (0, media_1.MediaListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._media; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageContextImpl = MessageContextImpl; +class MessageInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.body = payload.body; + this.numSegments = payload.num_segments; + this.direction = payload.direction; + this.from = payload.from; + this.to = payload.to; + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.price = payload.price; + this.errorMessage = payload.error_message; + this.uri = payload.uri; + this.accountSid = payload.account_sid; + this.numMedia = payload.num_media; + this.status = payload.status; + this.messagingServiceSid = payload.messaging_service_sid; + this.sid = payload.sid; + this.dateSent = deserialize.rfc2822DateTime(payload.date_sent); + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.errorCode = deserialize.integer(payload.error_code); + this.priceUnit = payload.price_unit; + this.apiVersion = payload.api_version; + this.subresourceUris = payload.subresource_uris; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MessageContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the feedback. + */ + feedback() { + return this._proxy.feedback; + } + /** + * Access the media. + */ + media() { + return this._proxy.media; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + body: this.body, + numSegments: this.numSegments, + direction: this.direction, + from: this.from, + to: this.to, + dateUpdated: this.dateUpdated, + price: this.price, + errorMessage: this.errorMessage, + uri: this.uri, + accountSid: this.accountSid, + numMedia: this.numMedia, + status: this.status, + messagingServiceSid: this.messagingServiceSid, + sid: this.sid, + dateSent: this.dateSent, + dateCreated: this.dateCreated, + errorCode: this.errorCode, + priceUnit: this.priceUnit, + apiVersion: this.apiVersion, + subresourceUris: this.subresourceUris, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInstance = MessageInstance; +function MessageListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MessageContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Messages.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["to"] === null || params["to"] === undefined) { + throw new Error("Required parameter \"params['to']\" missing."); + } + let data = {}; + data["To"] = params["to"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["applicationSid"] !== undefined) + data["ApplicationSid"] = params["applicationSid"]; + if (params["maxPrice"] !== undefined) + data["MaxPrice"] = params["maxPrice"]; + if (params["provideFeedback"] !== undefined) + data["ProvideFeedback"] = serialize.bool(params["provideFeedback"]); + if (params["attempt"] !== undefined) + data["Attempt"] = params["attempt"]; + if (params["validityPeriod"] !== undefined) + data["ValidityPeriod"] = params["validityPeriod"]; + if (params["forceDelivery"] !== undefined) + data["ForceDelivery"] = serialize.bool(params["forceDelivery"]); + if (params["contentRetention"] !== undefined) + data["ContentRetention"] = params["contentRetention"]; + if (params["addressRetention"] !== undefined) + data["AddressRetention"] = params["addressRetention"]; + if (params["smartEncoded"] !== undefined) + data["SmartEncoded"] = serialize.bool(params["smartEncoded"]); + if (params["persistentAction"] !== undefined) + data["PersistentAction"] = serialize.map(params["persistentAction"], (e) => e); + if (params["shortenUrls"] !== undefined) + data["ShortenUrls"] = serialize.bool(params["shortenUrls"]); + if (params["scheduleType"] !== undefined) + data["ScheduleType"] = params["scheduleType"]; + if (params["sendAt"] !== undefined) + data["SendAt"] = serialize.iso8601DateTime(params["sendAt"]); + if (params["sendAsMms"] !== undefined) + data["SendAsMms"] = serialize.bool(params["sendAsMms"]); + if (params["contentVariables"] !== undefined) + data["ContentVariables"] = params["contentVariables"]; + if (params["riskCheck"] !== undefined) + data["RiskCheck"] = params["riskCheck"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["messagingServiceSid"] !== undefined) + data["MessagingServiceSid"] = params["messagingServiceSid"]; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["mediaUrl"] !== undefined) + data["MediaUrl"] = serialize.map(params["mediaUrl"], (e) => e); + if (params["contentSid"] !== undefined) + data["ContentSid"] = params["contentSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["to"] !== undefined) + data["To"] = params["to"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["dateSent"] !== undefined) + data["DateSent"] = serialize.iso8601DateTime(params["dateSent"]); + if (params["dateSentBefore"] !== undefined) + data["DateSent<"] = serialize.iso8601DateTime(params["dateSentBefore"]); + if (params["dateSentAfter"] !== undefined) + data["DateSent>"] = serialize.iso8601DateTime(params["dateSentAfter"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessagePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessageListInstance = MessageListInstance; +class MessagePage extends Page_1.default { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessageInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagePage = MessagePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/message/feedback.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/message/feedback.d.ts new file mode 100644 index 00000000..f337bbe2 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/message/feedback.d.ts @@ -0,0 +1,91 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../V2010"; +export type FeedbackOutcome = "confirmed" | "unconfirmed"; +/** + * Options to pass to create a FeedbackInstance + */ +export interface FeedbackListInstanceCreateOptions { + /** */ + outcome?: FeedbackOutcome; +} +export interface FeedbackSolution { + accountSid: string; + messageSid: string; +} +export interface FeedbackListInstance { + _version: V2010; + _solution: FeedbackSolution; + _uri: string; + /** + * Create a FeedbackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + create(callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Create a FeedbackInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FeedbackInstance + */ + create(params: FeedbackListInstanceCreateOptions, callback?: (error: Error | null, item?: FeedbackInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FeedbackListInstance(version: V2010, accountSid: string, messageSid: string): FeedbackListInstance; +interface FeedbackResource { + account_sid: string; + message_sid: string; + outcome: FeedbackOutcome; + date_created: Date; + date_updated: Date; + uri: string; +} +export declare class FeedbackInstance { + protected _version: V2010; + constructor(_version: V2010, payload: FeedbackResource, accountSid: string, messageSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with this MessageFeedback resource. + */ + accountSid: string; + /** + * The SID of the Message resource associated with this MessageFeedback resource. + */ + messageSid: string; + outcome: FeedbackOutcome; + /** + * The date and time in GMT when this MessageFeedback resource was created, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when this MessageFeedback resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + messageSid: string; + outcome: FeedbackOutcome; + dateCreated: Date; + dateUpdated: Date; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/message/feedback.js b/node_modules/twilio/lib/rest/api/v2010/account/message/feedback.js new file mode 100644 index 00000000..11dff9c1 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/message/feedback.js @@ -0,0 +1,93 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FeedbackInstance = exports.FeedbackListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function FeedbackListInstance(version, accountSid, messageSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(messageSid)) { + throw new Error("Parameter 'messageSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, messageSid }; + instance._uri = `/Accounts/${accountSid}/Messages/${messageSid}/Feedback.json`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["outcome"] !== undefined) + data["Outcome"] = params["outcome"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FeedbackInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.messageSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FeedbackListInstance = FeedbackListInstance; +class FeedbackInstance { + constructor(_version, payload, accountSid, messageSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.messageSid = payload.message_sid; + this.outcome = payload.outcome; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.uri = payload.uri; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + messageSid: this.messageSid, + outcome: this.outcome, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FeedbackInstance = FeedbackInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/message/media.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/message/media.d.ts new file mode 100644 index 00000000..f527d9ba --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/message/media.d.ts @@ -0,0 +1,262 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +/** + * Options to pass to each + */ +export interface MediaListInstanceEachOptions { + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreated?: Date; + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreatedBefore?: Date; + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MediaInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MediaListInstanceOptions { + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreated?: Date; + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreatedBefore?: Date; + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MediaListInstancePageOptions { + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreated?: Date; + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreatedBefore?: Date; + /** Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ + dateCreatedAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MediaContext { + /** + * Remove a MediaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MediaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaInstance + */ + fetch(callback?: (error: Error | null, item?: MediaInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MediaContextSolution { + accountSid: string; + messageSid: string; + sid: string; +} +export declare class MediaContextImpl implements MediaContext { + protected _version: V2010; + protected _solution: MediaContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, messageSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MediaInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MediaContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MediaPayload extends TwilioResponsePayload { + media_list: MediaResource[]; +} +interface MediaResource { + account_sid: string; + content_type: string; + date_created: Date; + date_updated: Date; + parent_sid: string; + sid: string; + uri: string; +} +export declare class MediaInstance { + protected _version: V2010; + protected _solution: MediaContextSolution; + protected _context?: MediaContext; + constructor(_version: V2010, payload: MediaResource, accountSid: string, messageSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with this Media resource. + */ + accountSid: string; + /** + * The default [MIME type](https://en.wikipedia.org/wiki/Internet_media_type) of the media, for example `image/jpeg`, `image/png`, or `image/gif`. + */ + contentType: string; + /** + * The date and time in GMT when this Media resource was created, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when this Media resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The SID of the Message resource that is associated with this Media resource. + */ + parentSid: string; + /** + * The unique string that identifies this Media resource. + */ + sid: string; + /** + * The URI of this Media resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a MediaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MediaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaInstance + */ + fetch(callback?: (error: Error | null, item?: MediaInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + contentType: string; + dateCreated: Date; + dateUpdated: Date; + parentSid: string; + sid: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MediaSolution { + accountSid: string; + messageSid: string; +} +export interface MediaListInstance { + _version: V2010; + _solution: MediaSolution; + _uri: string; + (sid: string): MediaContext; + get(sid: string): MediaContext; + /** + * Streams MediaInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MediaInstance, done: (err?: Error) => void) => void): void; + each(params: MediaListInstanceEachOptions, callback?: (item: MediaInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MediaInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MediaPage) => any): Promise; + /** + * Lists MediaInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MediaInstance[]) => any): Promise; + list(params: MediaListInstanceOptions, callback?: (error: Error | null, items: MediaInstance[]) => any): Promise; + /** + * Retrieve a single page of MediaInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MediaPage) => any): Promise; + page(params: MediaListInstancePageOptions, callback?: (error: Error | null, items: MediaPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MediaListInstance(version: V2010, accountSid: string, messageSid: string): MediaListInstance; +export declare class MediaPage extends Page { + /** + * Initialize the MediaPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: MediaSolution); + /** + * Build an instance of MediaInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MediaResource): MediaInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/message/media.js b/node_modules/twilio/lib/rest/api/v2010/account/message/media.js new file mode 100644 index 00000000..612022d7 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/message/media.js @@ -0,0 +1,220 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MediaPage = exports.MediaListInstance = exports.MediaInstance = exports.MediaContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MediaContextImpl { + constructor(_version, accountSid, messageSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(messageSid)) { + throw new Error("Parameter 'messageSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, messageSid, sid }; + this._uri = `/Accounts/${accountSid}/Messages/${messageSid}/Media/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MediaInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.messageSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaContextImpl = MediaContextImpl; +class MediaInstance { + constructor(_version, payload, accountSid, messageSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.contentType = payload.content_type; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.parentSid = payload.parent_sid; + this.sid = payload.sid; + this.uri = payload.uri; + this._solution = { accountSid, messageSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MediaContextImpl(this._version, this._solution.accountSid, this._solution.messageSid, this._solution.sid); + return this._context; + } + /** + * Remove a MediaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a MediaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + contentType: this.contentType, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + parentSid: this.parentSid, + sid: this.sid, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaInstance = MediaInstance; +function MediaListInstance(version, accountSid, messageSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(messageSid)) { + throw new Error("Parameter 'messageSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MediaContextImpl(version, accountSid, messageSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, messageSid }; + instance._uri = `/Accounts/${accountSid}/Messages/${messageSid}/Media.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreated<"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["dateCreatedAfter"] !== undefined) + data["DateCreated>"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MediaPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MediaPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MediaListInstance = MediaListInstance; +class MediaPage extends Page_1.default { + /** + * Initialize the MediaPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MediaInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MediaInstance(this._version, payload, this._solution.accountSid, this._solution.messageSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaPage = MediaPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/newKey.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/newKey.d.ts new file mode 100644 index 00000000..8e43914a --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/newKey.d.ts @@ -0,0 +1,86 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../V2010"; +/** + * Options to pass to create a NewKeyInstance + */ +export interface NewKeyListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; +} +export interface NewKeySolution { + accountSid: string; +} +export interface NewKeyListInstance { + _version: V2010; + _solution: NewKeySolution; + _uri: string; + /** + * Create a NewKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NewKeyInstance + */ + create(callback?: (error: Error | null, item?: NewKeyInstance) => any): Promise; + /** + * Create a NewKeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NewKeyInstance + */ + create(params: NewKeyListInstanceCreateOptions, callback?: (error: Error | null, item?: NewKeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NewKeyListInstance(version: V2010, accountSid: string): NewKeyListInstance; +interface NewKeyResource { + sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + secret: string; +} +export declare class NewKeyInstance { + protected _version: V2010; + constructor(_version: V2010, payload: NewKeyResource, accountSid: string); + /** + * The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`). **Note that for security reasons, this field is ONLY returned when the API Key is first created.** + */ + secret: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + secret: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/newKey.js b/node_modules/twilio/lib/rest/api/v2010/account/newKey.js new file mode 100644 index 00000000..5ef39799 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/newKey.js @@ -0,0 +1,88 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NewKeyInstance = exports.NewKeyListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function NewKeyListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Keys.json`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NewKeyInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NewKeyListInstance = NewKeyListInstance; +class NewKeyInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.secret = payload.secret; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + secret: this.secret, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NewKeyInstance = NewKeyInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/newSigningKey.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/newSigningKey.d.ts new file mode 100644 index 00000000..bf0c9a69 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/newSigningKey.d.ts @@ -0,0 +1,86 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../V2010"; +/** + * Options to pass to create a NewSigningKeyInstance + */ +export interface NewSigningKeyListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; +} +export interface NewSigningKeySolution { + accountSid: string; +} +export interface NewSigningKeyListInstance { + _version: V2010; + _solution: NewSigningKeySolution; + _uri: string; + /** + * Create a NewSigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NewSigningKeyInstance + */ + create(callback?: (error: Error | null, item?: NewSigningKeyInstance) => any): Promise; + /** + * Create a NewSigningKeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NewSigningKeyInstance + */ + create(params: NewSigningKeyListInstanceCreateOptions, callback?: (error: Error | null, item?: NewSigningKeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NewSigningKeyListInstance(version: V2010, accountSid: string): NewSigningKeyListInstance; +interface NewSigningKeyResource { + sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + secret: string; +} +export declare class NewSigningKeyInstance { + protected _version: V2010; + constructor(_version: V2010, payload: NewSigningKeyResource, accountSid: string); + /** + * The unique string that that we created to identify the NewSigningKey resource. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`). **Note that for security reasons, this field is ONLY returned when the API Key is first created.** + */ + secret: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + secret: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/newSigningKey.js b/node_modules/twilio/lib/rest/api/v2010/account/newSigningKey.js new file mode 100644 index 00000000..5c5ec666 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/newSigningKey.js @@ -0,0 +1,88 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NewSigningKeyInstance = exports.NewSigningKeyListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function NewSigningKeyListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/SigningKeys.json`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NewSigningKeyInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NewSigningKeyListInstance = NewSigningKeyListInstance; +class NewSigningKeyInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.secret = payload.secret; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + secret: this.secret, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NewSigningKeyInstance = NewSigningKeyInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/notification.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/notification.d.ts new file mode 100644 index 00000000..c7875a05 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/notification.d.ts @@ -0,0 +1,309 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +/** + * Options to pass to each + */ +export interface NotificationListInstanceEachOptions { + /** Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. */ + log?: number; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDate?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateBefore?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: NotificationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface NotificationListInstanceOptions { + /** Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. */ + log?: number; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDate?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateBefore?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface NotificationListInstancePageOptions { + /** Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. */ + log?: number; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDate?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateBefore?: Date; + /** Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ + messageDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface NotificationContext { + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NotificationContextSolution { + accountSid: string; + sid: string; +} +export declare class NotificationContextImpl implements NotificationContext { + protected _version: V2010; + protected _solution: NotificationContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NotificationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NotificationPayload extends TwilioResponsePayload { + notifications: NotificationResource[]; +} +interface NotificationResource { + account_sid: string; + api_version: string; + call_sid: string; + date_created: Date; + date_updated: Date; + error_code: string; + log: string; + message_date: Date; + message_text: string; + more_info: string; + request_method: string; + request_url: string; + request_variables: string; + response_body: string; + response_headers: string; + sid: string; + uri: string; +} +export declare class NotificationInstance { + protected _version: V2010; + protected _solution: NotificationContextSolution; + protected _context?: NotificationContext; + constructor(_version: V2010, payload: NotificationResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource. + */ + accountSid: string; + /** + * The API version used to generate the notification. Can be empty for events that don\'t have a specific API version, such as incoming phone calls. + */ + apiVersion: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Notification resource is associated with. + */ + callSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * A unique error code for the error condition that is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). + */ + errorCode: string; + /** + * An integer log level that corresponds to the type of notification: `0` is ERROR, `1` is WARNING. + */ + log: string; + /** + * The date the notification was actually generated in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. Message buffering can cause this value to differ from `date_created`. + */ + messageDate: Date; + /** + * The text of the notification. + */ + messageText: string; + /** + * The URL for more information about the error condition. This value is a page in our [Error Dictionary](https://www.twilio.com/docs/api/errors). + */ + moreInfo: string; + /** + * The HTTP method used to generate the notification. If the notification was generated during a phone call, this is the HTTP Method used to request the resource on your server. If the notification was generated by your use of our REST API, this is the HTTP method used to call the resource on our servers. + */ + requestMethod: string; + /** + * The URL of the resource that generated the notification. If the notification was generated during a phone call, this is the URL of the resource on your server that caused the notification. If the notification was generated by your use of our REST API, this is the URL of the resource you called. + */ + requestUrl: string; + /** + * The HTTP GET or POST variables we sent to your server. However, if the notification was generated by our REST API, this contains the HTTP POST or PUT variables you sent to our API. + */ + requestVariables: string; + /** + * The HTTP body returned by your server. + */ + responseBody: string; + /** + * The HTTP headers returned by your server. + */ + responseHeaders: string; + /** + * The unique string that that we created to identify the Notification resource. + */ + sid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + callSid: string; + dateCreated: Date; + dateUpdated: Date; + errorCode: string; + log: string; + messageDate: Date; + messageText: string; + moreInfo: string; + requestMethod: string; + requestUrl: string; + requestVariables: string; + responseBody: string; + responseHeaders: string; + sid: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NotificationSolution { + accountSid: string; +} +export interface NotificationListInstance { + _version: V2010; + _solution: NotificationSolution; + _uri: string; + (sid: string): NotificationContext; + get(sid: string): NotificationContext; + /** + * Streams NotificationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NotificationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: NotificationInstance, done: (err?: Error) => void) => void): void; + each(params: NotificationListInstanceEachOptions, callback?: (item: NotificationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of NotificationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: NotificationPage) => any): Promise; + /** + * Lists NotificationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NotificationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: NotificationInstance[]) => any): Promise; + list(params: NotificationListInstanceOptions, callback?: (error: Error | null, items: NotificationInstance[]) => any): Promise; + /** + * Retrieve a single page of NotificationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NotificationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: NotificationPage) => any): Promise; + page(params: NotificationListInstancePageOptions, callback?: (error: Error | null, items: NotificationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NotificationListInstance(version: V2010, accountSid: string): NotificationListInstance; +export declare class NotificationPage extends Page { + /** + * Initialize the NotificationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: NotificationSolution); + /** + * Build an instance of NotificationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: NotificationResource): NotificationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/notification.js b/node_modules/twilio/lib/rest/api/v2010/account/notification.js new file mode 100644 index 00000000..958a0585 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/notification.js @@ -0,0 +1,217 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NotificationPage = exports.NotificationListInstance = exports.NotificationInstance = exports.NotificationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class NotificationContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Notifications/${sid}.json`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new NotificationInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationContextImpl = NotificationContextImpl; +class NotificationInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.callSid = payload.call_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.errorCode = payload.error_code; + this.log = payload.log; + this.messageDate = deserialize.rfc2822DateTime(payload.message_date); + this.messageText = payload.message_text; + this.moreInfo = payload.more_info; + this.requestMethod = payload.request_method; + this.requestUrl = payload.request_url; + this.requestVariables = payload.request_variables; + this.responseBody = payload.response_body; + this.responseHeaders = payload.response_headers; + this.sid = payload.sid; + this.uri = payload.uri; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new NotificationContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + callSid: this.callSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + errorCode: this.errorCode, + log: this.log, + messageDate: this.messageDate, + messageText: this.messageText, + moreInfo: this.moreInfo, + requestMethod: this.requestMethod, + requestUrl: this.requestUrl, + requestVariables: this.requestVariables, + responseBody: this.responseBody, + responseHeaders: this.responseHeaders, + sid: this.sid, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationInstance = NotificationInstance; +function NotificationListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new NotificationContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Notifications.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["log"] !== undefined) + data["Log"] = params["log"]; + if (params["messageDate"] !== undefined) + data["MessageDate"] = serialize.iso8601Date(params["messageDate"]); + if (params["messageDateBefore"] !== undefined) + data["MessageDate<"] = serialize.iso8601Date(params["messageDateBefore"]); + if (params["messageDateAfter"] !== undefined) + data["MessageDate>"] = serialize.iso8601Date(params["messageDateAfter"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NotificationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new NotificationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NotificationListInstance = NotificationListInstance; +class NotificationPage extends Page_1.default { + /** + * Initialize the NotificationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of NotificationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new NotificationInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationPage = NotificationPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/outgoingCallerId.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/outgoingCallerId.d.ts new file mode 100644 index 00000000..8111de8b --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/outgoingCallerId.d.ts @@ -0,0 +1,296 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +/** + * Options to pass to update a OutgoingCallerIdInstance + */ +export interface OutgoingCallerIdContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface OutgoingCallerIdListInstanceEachOptions { + /** The phone number of the OutgoingCallerId resources to read. */ + phoneNumber?: string; + /** The string that identifies the OutgoingCallerId resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: OutgoingCallerIdInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface OutgoingCallerIdListInstanceOptions { + /** The phone number of the OutgoingCallerId resources to read. */ + phoneNumber?: string; + /** The string that identifies the OutgoingCallerId resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface OutgoingCallerIdListInstancePageOptions { + /** The phone number of the OutgoingCallerId resources to read. */ + phoneNumber?: string; + /** The string that identifies the OutgoingCallerId resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface OutgoingCallerIdContext { + /** + * Remove a OutgoingCallerIdInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a OutgoingCallerIdInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OutgoingCallerIdInstance + */ + fetch(callback?: (error: Error | null, item?: OutgoingCallerIdInstance) => any): Promise; + /** + * Update a OutgoingCallerIdInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OutgoingCallerIdInstance + */ + update(callback?: (error: Error | null, item?: OutgoingCallerIdInstance) => any): Promise; + /** + * Update a OutgoingCallerIdInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OutgoingCallerIdInstance + */ + update(params: OutgoingCallerIdContextUpdateOptions, callback?: (error: Error | null, item?: OutgoingCallerIdInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface OutgoingCallerIdContextSolution { + accountSid: string; + sid: string; +} +export declare class OutgoingCallerIdContextImpl implements OutgoingCallerIdContext { + protected _version: V2010; + protected _solution: OutgoingCallerIdContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: OutgoingCallerIdInstance) => any): Promise; + update(params?: OutgoingCallerIdContextUpdateOptions | ((error: Error | null, item?: OutgoingCallerIdInstance) => any), callback?: (error: Error | null, item?: OutgoingCallerIdInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): OutgoingCallerIdContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface OutgoingCallerIdPayload extends TwilioResponsePayload { + outgoing_caller_ids: OutgoingCallerIdResource[]; +} +interface OutgoingCallerIdResource { + sid: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + account_sid: string; + phone_number: string; + uri: string; +} +export declare class OutgoingCallerIdInstance { + protected _version: V2010; + protected _solution: OutgoingCallerIdContextSolution; + protected _context?: OutgoingCallerIdContext; + constructor(_version: V2010, payload: OutgoingCallerIdResource, accountSid: string, sid?: string); + /** + * The unique string that that we created to identify the OutgoingCallerId resource. + */ + sid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resource. + */ + accountSid: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a OutgoingCallerIdInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a OutgoingCallerIdInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OutgoingCallerIdInstance + */ + fetch(callback?: (error: Error | null, item?: OutgoingCallerIdInstance) => any): Promise; + /** + * Update a OutgoingCallerIdInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OutgoingCallerIdInstance + */ + update(callback?: (error: Error | null, item?: OutgoingCallerIdInstance) => any): Promise; + /** + * Update a OutgoingCallerIdInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OutgoingCallerIdInstance + */ + update(params: OutgoingCallerIdContextUpdateOptions, callback?: (error: Error | null, item?: OutgoingCallerIdInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + accountSid: string; + phoneNumber: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface OutgoingCallerIdSolution { + accountSid: string; +} +export interface OutgoingCallerIdListInstance { + _version: V2010; + _solution: OutgoingCallerIdSolution; + _uri: string; + (sid: string): OutgoingCallerIdContext; + get(sid: string): OutgoingCallerIdContext; + /** + * Streams OutgoingCallerIdInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OutgoingCallerIdListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: OutgoingCallerIdInstance, done: (err?: Error) => void) => void): void; + each(params: OutgoingCallerIdListInstanceEachOptions, callback?: (item: OutgoingCallerIdInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of OutgoingCallerIdInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: OutgoingCallerIdPage) => any): Promise; + /** + * Lists OutgoingCallerIdInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OutgoingCallerIdListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: OutgoingCallerIdInstance[]) => any): Promise; + list(params: OutgoingCallerIdListInstanceOptions, callback?: (error: Error | null, items: OutgoingCallerIdInstance[]) => any): Promise; + /** + * Retrieve a single page of OutgoingCallerIdInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OutgoingCallerIdListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: OutgoingCallerIdPage) => any): Promise; + page(params: OutgoingCallerIdListInstancePageOptions, callback?: (error: Error | null, items: OutgoingCallerIdPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function OutgoingCallerIdListInstance(version: V2010, accountSid: string): OutgoingCallerIdListInstance; +export declare class OutgoingCallerIdPage extends Page { + /** + * Initialize the OutgoingCallerIdPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: OutgoingCallerIdSolution); + /** + * Build an instance of OutgoingCallerIdInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: OutgoingCallerIdResource): OutgoingCallerIdInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/outgoingCallerId.js b/node_modules/twilio/lib/rest/api/v2010/account/outgoingCallerId.js new file mode 100644 index 00000000..43fe213a --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/outgoingCallerId.js @@ -0,0 +1,239 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OutgoingCallerIdPage = exports.OutgoingCallerIdListInstance = exports.OutgoingCallerIdInstance = exports.OutgoingCallerIdContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class OutgoingCallerIdContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/OutgoingCallerIds/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new OutgoingCallerIdInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new OutgoingCallerIdInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OutgoingCallerIdContextImpl = OutgoingCallerIdContextImpl; +class OutgoingCallerIdInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.accountSid = payload.account_sid; + this.phoneNumber = payload.phone_number; + this.uri = payload.uri; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new OutgoingCallerIdContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a OutgoingCallerIdInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a OutgoingCallerIdInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OutgoingCallerIdInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + accountSid: this.accountSid, + phoneNumber: this.phoneNumber, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OutgoingCallerIdInstance = OutgoingCallerIdInstance; +function OutgoingCallerIdListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new OutgoingCallerIdContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/OutgoingCallerIds.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new OutgoingCallerIdPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new OutgoingCallerIdPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.OutgoingCallerIdListInstance = OutgoingCallerIdListInstance; +class OutgoingCallerIdPage extends Page_1.default { + /** + * Initialize the OutgoingCallerIdPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of OutgoingCallerIdInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new OutgoingCallerIdInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OutgoingCallerIdPage = OutgoingCallerIdPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/queue.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/queue.d.ts new file mode 100644 index 00000000..625aeb60 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/queue.d.ts @@ -0,0 +1,324 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +import { MemberListInstance } from "./queue/member"; +/** + * Options to pass to update a QueueInstance + */ +export interface QueueContextUpdateOptions { + /** A descriptive string that you created to describe this resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. */ + maxSize?: number; +} +/** + * Options to pass to create a QueueInstance + */ +export interface QueueListInstanceCreateOptions { + /** A descriptive string that you created to describe this resource. It can be up to 64 characters long. */ + friendlyName: string; + /** The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. */ + maxSize?: number; +} +/** + * Options to pass to each + */ +export interface QueueListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: QueueInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface QueueListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface QueueListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface QueueContext { + members: MemberListInstance; + /** + * Remove a QueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a QueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed QueueInstance + */ + fetch(callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + /** + * Update a QueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed QueueInstance + */ + update(callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + /** + * Update a QueueInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed QueueInstance + */ + update(params: QueueContextUpdateOptions, callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface QueueContextSolution { + accountSid: string; + sid: string; +} +export declare class QueueContextImpl implements QueueContext { + protected _version: V2010; + protected _solution: QueueContextSolution; + protected _uri: string; + protected _members?: MemberListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get members(): MemberListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + update(params?: QueueContextUpdateOptions | ((error: Error | null, item?: QueueInstance) => any), callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): QueueContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface QueuePayload extends TwilioResponsePayload { + queues: QueueResource[]; +} +interface QueueResource { + date_updated: Date; + current_size: number; + friendly_name: string; + uri: string; + account_sid: string; + average_wait_time: number; + sid: string; + date_created: Date; + max_size: number; +} +export declare class QueueInstance { + protected _version: V2010; + protected _solution: QueueContextSolution; + protected _context?: QueueContext; + constructor(_version: V2010, payload: QueueResource, accountSid: string, sid?: string); + /** + * The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The number of calls currently in the queue. + */ + currentSize: number; + /** + * A string that you assigned to describe this resource. + */ + friendlyName: string; + /** + * The URI of this resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Queue resource. + */ + accountSid: string; + /** + * The average wait time in seconds of the members in this queue. This is calculated at the time of the request. + */ + averageWaitTime: number; + /** + * The unique string that that we created to identify this Queue resource. + */ + sid: string; + /** + * The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The maximum number of calls that can be in the queue. The default is 1000 and the maximum is 5000. + */ + maxSize: number; + private get _proxy(); + /** + * Remove a QueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a QueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed QueueInstance + */ + fetch(callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + /** + * Update a QueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed QueueInstance + */ + update(callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + /** + * Update a QueueInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed QueueInstance + */ + update(params: QueueContextUpdateOptions, callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + /** + * Access the members. + */ + members(): MemberListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + dateUpdated: Date; + currentSize: number; + friendlyName: string; + uri: string; + accountSid: string; + averageWaitTime: number; + sid: string; + dateCreated: Date; + maxSize: number; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface QueueSolution { + accountSid: string; +} +export interface QueueListInstance { + _version: V2010; + _solution: QueueSolution; + _uri: string; + (sid: string): QueueContext; + get(sid: string): QueueContext; + /** + * Create a QueueInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed QueueInstance + */ + create(params: QueueListInstanceCreateOptions, callback?: (error: Error | null, item?: QueueInstance) => any): Promise; + /** + * Streams QueueInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { QueueListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: QueueInstance, done: (err?: Error) => void) => void): void; + each(params: QueueListInstanceEachOptions, callback?: (item: QueueInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of QueueInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: QueuePage) => any): Promise; + /** + * Lists QueueInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { QueueListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: QueueInstance[]) => any): Promise; + list(params: QueueListInstanceOptions, callback?: (error: Error | null, items: QueueInstance[]) => any): Promise; + /** + * Retrieve a single page of QueueInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { QueueListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: QueuePage) => any): Promise; + page(params: QueueListInstancePageOptions, callback?: (error: Error | null, items: QueuePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function QueueListInstance(version: V2010, accountSid: string): QueueListInstance; +export declare class QueuePage extends Page { + /** + * Initialize the QueuePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: QueueSolution); + /** + * Build an instance of QueueInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: QueueResource): QueueInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/queue.js b/node_modules/twilio/lib/rest/api/v2010/account/queue.js new file mode 100644 index 00000000..651573ac --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/queue.js @@ -0,0 +1,278 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.QueuePage = exports.QueueListInstance = exports.QueueInstance = exports.QueueContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const member_1 = require("./queue/member"); +class QueueContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Queues/${sid}.json`; + } + get members() { + this._members = + this._members || + (0, member_1.MemberListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._members; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new QueueInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["maxSize"] !== undefined) + data["MaxSize"] = params["maxSize"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new QueueInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.QueueContextImpl = QueueContextImpl; +class QueueInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.currentSize = deserialize.integer(payload.current_size); + this.friendlyName = payload.friendly_name; + this.uri = payload.uri; + this.accountSid = payload.account_sid; + this.averageWaitTime = deserialize.integer(payload.average_wait_time); + this.sid = payload.sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.maxSize = deserialize.integer(payload.max_size); + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new QueueContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a QueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a QueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed QueueInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the members. + */ + members() { + return this._proxy.members; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + dateUpdated: this.dateUpdated, + currentSize: this.currentSize, + friendlyName: this.friendlyName, + uri: this.uri, + accountSid: this.accountSid, + averageWaitTime: this.averageWaitTime, + sid: this.sid, + dateCreated: this.dateCreated, + maxSize: this.maxSize, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.QueueInstance = QueueInstance; +function QueueListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new QueueContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Queues.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["maxSize"] !== undefined) + data["MaxSize"] = params["maxSize"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new QueueInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new QueuePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new QueuePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.QueueListInstance = QueueListInstance; +class QueuePage extends Page_1.default { + /** + * Initialize the QueuePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of QueueInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new QueueInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.QueuePage = QueuePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/queue/member.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/queue/member.d.ts new file mode 100644 index 00000000..d033ebcd --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/queue/member.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +/** + * Options to pass to update a MemberInstance + */ +export interface MemberContextUpdateOptions { + /** The absolute URL of the Queue resource. */ + url: string; + /** How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. */ + method?: string; +} +/** + * Options to pass to each + */ +export interface MemberListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MemberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MemberListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MemberListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MemberContext { + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MemberContextSolution { + accountSid: string; + queueSid: string; + callSid: string; +} +export declare class MemberContextImpl implements MemberContext { + protected _version: V2010; + protected _solution: MemberContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, queueSid: string, callSid: string); + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MemberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MemberPayload extends TwilioResponsePayload { + queue_members: MemberResource[]; +} +interface MemberResource { + call_sid: string; + date_enqueued: Date; + position: number; + uri: string; + wait_time: number; + queue_sid: string; +} +export declare class MemberInstance { + protected _version: V2010; + protected _solution: MemberContextSolution; + protected _context?: MemberContext; + constructor(_version: V2010, payload: MemberResource, accountSid: string, queueSid: string, callSid?: string); + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Member resource is associated with. + */ + callSid: string; + /** + * The date that the member was enqueued, given in RFC 2822 format. + */ + dateEnqueued: Date; + /** + * This member\'s current position in the queue. + */ + position: number; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The number of seconds the member has been in the queue. + */ + waitTime: number; + /** + * The SID of the Queue the member is in. + */ + queueSid: string; + private get _proxy(); + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + callSid: string; + dateEnqueued: Date; + position: number; + uri: string; + waitTime: number; + queueSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MemberSolution { + accountSid: string; + queueSid: string; +} +export interface MemberListInstance { + _version: V2010; + _solution: MemberSolution; + _uri: string; + (callSid: string): MemberContext; + get(callSid: string): MemberContext; + /** + * Streams MemberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + each(params: MemberListInstanceEachOptions, callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Lists MemberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + list(params: MemberListInstanceOptions, callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + /** + * Retrieve a single page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MemberPage) => any): Promise; + page(params: MemberListInstancePageOptions, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MemberListInstance(version: V2010, accountSid: string, queueSid: string): MemberListInstance; +export declare class MemberPage extends Page { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: MemberSolution); + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MemberResource): MemberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/queue/member.js b/node_modules/twilio/lib/rest/api/v2010/account/queue/member.js new file mode 100644 index 00000000..86a17470 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/queue/member.js @@ -0,0 +1,220 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MemberPage = exports.MemberListInstance = exports.MemberInstance = exports.MemberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MemberContextImpl { + constructor(_version, accountSid, queueSid, callSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(queueSid)) { + throw new Error("Parameter 'queueSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + this._solution = { accountSid, queueSid, callSid }; + this._uri = `/Accounts/${accountSid}/Queues/${queueSid}/Members/${callSid}.json`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.queueSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["url"] === null || params["url"] === undefined) { + throw new Error("Required parameter \"params['url']\" missing."); + } + let data = {}; + data["Url"] = params["url"]; + if (params["method"] !== undefined) + data["Method"] = params["method"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.queueSid, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberContextImpl = MemberContextImpl; +class MemberInstance { + constructor(_version, payload, accountSid, queueSid, callSid) { + this._version = _version; + this.callSid = payload.call_sid; + this.dateEnqueued = deserialize.rfc2822DateTime(payload.date_enqueued); + this.position = deserialize.integer(payload.position); + this.uri = payload.uri; + this.waitTime = deserialize.integer(payload.wait_time); + this.queueSid = payload.queue_sid; + this._solution = { accountSid, queueSid, callSid: callSid || this.callSid }; + } + get _proxy() { + this._context = + this._context || + new MemberContextImpl(this._version, this._solution.accountSid, this._solution.queueSid, this._solution.callSid); + return this._context; + } + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + callSid: this.callSid, + dateEnqueued: this.dateEnqueued, + position: this.position, + uri: this.uri, + waitTime: this.waitTime, + queueSid: this.queueSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberInstance = MemberInstance; +function MemberListInstance(version, accountSid, queueSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(queueSid)) { + throw new Error("Parameter 'queueSid' is not valid."); + } + const instance = ((callSid) => instance.get(callSid)); + instance.get = function get(callSid) { + return new MemberContextImpl(version, accountSid, queueSid, callSid); + }; + instance._version = version; + instance._solution = { accountSid, queueSid }; + instance._uri = `/Accounts/${accountSid}/Queues/${queueSid}/Members.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MemberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MemberListInstance = MemberListInstance; +class MemberPage extends Page_1.default { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MemberInstance(this._version, payload, this._solution.accountSid, this._solution.queueSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberPage = MemberPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/recording.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/recording.d.ts new file mode 100644 index 00000000..d7af1274 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/recording.d.ts @@ -0,0 +1,387 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +import { AddOnResultListInstance } from "./recording/addOnResult"; +import { TranscriptionListInstance } from "./recording/transcription"; +export type RecordingSource = "DialVerb" | "Conference" | "OutboundAPI" | "Trunking" | "RecordVerb" | "StartCallRecordingAPI" | "StartConferenceRecordingAPI"; +export type RecordingStatus = "in-progress" | "paused" | "stopped" | "processing" | "completed" | "absent" | "deleted"; +/** + * Options to pass to fetch a RecordingInstance + */ +export interface RecordingContextFetchOptions { + /** A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. */ + includeSoftDeleted?: boolean; +} +/** + * Options to pass to each + */ +export interface RecordingListInstanceEachOptions { + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreated?: Date; + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreatedBefore?: Date; + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreatedAfter?: Date; + /** The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. */ + callSid?: string; + /** The Conference SID that identifies the conference associated with the recording to read. */ + conferenceSid?: string; + /** A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. */ + includeSoftDeleted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RecordingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RecordingListInstanceOptions { + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreated?: Date; + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreatedBefore?: Date; + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreatedAfter?: Date; + /** The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. */ + callSid?: string; + /** The Conference SID that identifies the conference associated with the recording to read. */ + conferenceSid?: string; + /** A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. */ + includeSoftDeleted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RecordingListInstancePageOptions { + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreated?: Date; + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreatedBefore?: Date; + /** Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. */ + dateCreatedAfter?: Date; + /** The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. */ + callSid?: string; + /** The Conference SID that identifies the conference associated with the recording to read. */ + conferenceSid?: string; + /** A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. */ + includeSoftDeleted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RecordingContext { + addOnResults: AddOnResultListInstance; + transcriptions: TranscriptionListInstance; + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(params: RecordingContextFetchOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RecordingContextSolution { + accountSid: string; + sid: string; +} +export declare class RecordingContextImpl implements RecordingContext { + protected _version: V2010; + protected _solution: RecordingContextSolution; + protected _uri: string; + protected _addOnResults?: AddOnResultListInstance; + protected _transcriptions?: TranscriptionListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get addOnResults(): AddOnResultListInstance; + get transcriptions(): TranscriptionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(params?: RecordingContextFetchOptions | ((error: Error | null, item?: RecordingInstance) => any), callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RecordingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RecordingPayload extends TwilioResponsePayload { + recordings: RecordingResource[]; +} +interface RecordingResource { + account_sid: string; + api_version: string; + call_sid: string; + conference_sid: string; + date_created: Date; + date_updated: Date; + start_time: Date; + duration: string; + sid: string; + price: string; + price_unit: string; + status: RecordingStatus; + channels: number; + source: RecordingSource; + error_code: number; + uri: string; + encryption_details: any; + subresource_uris: Record; + media_url: string; +} +export declare class RecordingInstance { + protected _version: V2010; + protected _solution: RecordingContextSolution; + protected _context?: RecordingContext; + constructor(_version: V2010, payload: RecordingResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resource. + */ + accountSid: string; + /** + * The API version used during the recording. + */ + apiVersion: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Recording resource is associated with. This will always refer to the parent leg of a two-leg call. + */ + callSid: string; + /** + * The Conference SID that identifies the conference associated with the recording, if a conference recording. + */ + conferenceSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The start time of the recording in GMT and in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + startTime: Date; + /** + * The length of the recording in seconds. + */ + duration: string; + /** + * The unique string that that we created to identify the Recording resource. + */ + sid: string; + /** + * The one-time cost of creating the recording in the `price_unit` currency. + */ + price: string; + /** + * The currency used in the `price` property. Example: `USD`. + */ + priceUnit: string; + status: RecordingStatus; + /** + * The number of channels in the final recording file. Can be: `1` or `2`. You can split a call with two legs into two separate recording channels if you record using [TwiML Dial](https://www.twilio.com/docs/voice/twiml/dial#record) or the [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls#manage-your-outbound-call). + */ + channels: number; + source: RecordingSource; + /** + * The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`. + */ + errorCode: number; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature. + */ + encryptionDetails: any; + /** + * A list of related resources identified by their relative URIs. + */ + subresourceUris: Record; + /** + * The URL of the media file associated with this recording resource. When stored externally, this is the full URL location of the media file. + */ + mediaUrl: string; + private get _proxy(); + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(params: RecordingContextFetchOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Access the addOnResults. + */ + addOnResults(): AddOnResultListInstance; + /** + * Access the transcriptions. + */ + transcriptions(): TranscriptionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + callSid: string; + conferenceSid: string; + dateCreated: Date; + dateUpdated: Date; + startTime: Date; + duration: string; + sid: string; + price: string; + priceUnit: string; + status: RecordingStatus; + channels: number; + source: RecordingSource; + errorCode: number; + uri: string; + encryptionDetails: any; + subresourceUris: Record; + mediaUrl: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RecordingSolution { + accountSid: string; +} +export interface RecordingListInstance { + _version: V2010; + _solution: RecordingSolution; + _uri: string; + (sid: string): RecordingContext; + get(sid: string): RecordingContext; + /** + * Streams RecordingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void; + each(params: RecordingListInstanceEachOptions, callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RecordingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RecordingPage) => any): Promise; + /** + * Lists RecordingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise; + list(params: RecordingListInstanceOptions, callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise; + /** + * Retrieve a single page of RecordingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RecordingPage) => any): Promise; + page(params: RecordingListInstancePageOptions, callback?: (error: Error | null, items: RecordingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RecordingListInstance(version: V2010, accountSid: string): RecordingListInstance; +export declare class RecordingPage extends Page { + /** + * Initialize the RecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: RecordingSolution); + /** + * Build an instance of RecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RecordingResource): RecordingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/recording.js b/node_modules/twilio/lib/rest/api/v2010/account/recording.js new file mode 100644 index 00000000..86ffa737 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/recording.js @@ -0,0 +1,276 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RecordingPage = exports.RecordingListInstance = exports.RecordingInstance = exports.RecordingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const addOnResult_1 = require("./recording/addOnResult"); +const transcription_1 = require("./recording/transcription"); +class RecordingContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Recordings/${sid}.json`; + } + get addOnResults() { + this._addOnResults = + this._addOnResults || + (0, addOnResult_1.AddOnResultListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._addOnResults; + } + get transcriptions() { + this._transcriptions = + this._transcriptions || + (0, transcription_1.TranscriptionListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._transcriptions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["includeSoftDeleted"] !== undefined) + data["IncludeSoftDeleted"] = serialize.bool(params["includeSoftDeleted"]); + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingContextImpl = RecordingContextImpl; +class RecordingInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.callSid = payload.call_sid; + this.conferenceSid = payload.conference_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.startTime = deserialize.rfc2822DateTime(payload.start_time); + this.duration = payload.duration; + this.sid = payload.sid; + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.status = payload.status; + this.channels = deserialize.integer(payload.channels); + this.source = payload.source; + this.errorCode = deserialize.integer(payload.error_code); + this.uri = payload.uri; + this.encryptionDetails = payload.encryption_details; + this.subresourceUris = payload.subresource_uris; + this.mediaUrl = payload.media_url; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RecordingContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Access the addOnResults. + */ + addOnResults() { + return this._proxy.addOnResults; + } + /** + * Access the transcriptions. + */ + transcriptions() { + return this._proxy.transcriptions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + callSid: this.callSid, + conferenceSid: this.conferenceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + startTime: this.startTime, + duration: this.duration, + sid: this.sid, + price: this.price, + priceUnit: this.priceUnit, + status: this.status, + channels: this.channels, + source: this.source, + errorCode: this.errorCode, + uri: this.uri, + encryptionDetails: this.encryptionDetails, + subresourceUris: this.subresourceUris, + mediaUrl: this.mediaUrl, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingInstance = RecordingInstance; +function RecordingListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RecordingContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Recordings.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreated<"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["dateCreatedAfter"] !== undefined) + data["DateCreated>"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["callSid"] !== undefined) + data["CallSid"] = params["callSid"]; + if (params["conferenceSid"] !== undefined) + data["ConferenceSid"] = params["conferenceSid"]; + if (params["includeSoftDeleted"] !== undefined) + data["IncludeSoftDeleted"] = serialize.bool(params["includeSoftDeleted"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RecordingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RecordingListInstance = RecordingListInstance; +class RecordingPage extends Page_1.default { + /** + * Initialize the RecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RecordingInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingPage = RecordingPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult.d.ts new file mode 100644 index 00000000..662680e7 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult.d.ts @@ -0,0 +1,268 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { PayloadListInstance } from "./addOnResult/payload"; +export type AddOnResultStatus = "canceled" | "completed" | "deleted" | "failed" | "in-progress" | "init" | "processing" | "queued"; +/** + * Options to pass to each + */ +export interface AddOnResultListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AddOnResultInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AddOnResultListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AddOnResultListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AddOnResultContext { + payloads: PayloadListInstance; + /** + * Remove a AddOnResultInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AddOnResultInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddOnResultInstance + */ + fetch(callback?: (error: Error | null, item?: AddOnResultInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AddOnResultContextSolution { + accountSid: string; + referenceSid: string; + sid: string; +} +export declare class AddOnResultContextImpl implements AddOnResultContext { + protected _version: V2010; + protected _solution: AddOnResultContextSolution; + protected _uri: string; + protected _payloads?: PayloadListInstance; + constructor(_version: V2010, accountSid: string, referenceSid: string, sid: string); + get payloads(): PayloadListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AddOnResultInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AddOnResultContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AddOnResultPayload extends TwilioResponsePayload { + add_on_results: AddOnResultResource[]; +} +interface AddOnResultResource { + sid: string; + account_sid: string; + status: AddOnResultStatus; + add_on_sid: string; + add_on_configuration_sid: string; + date_created: Date; + date_updated: Date; + date_completed: Date; + reference_sid: string; + subresource_uris: Record; +} +export declare class AddOnResultInstance { + protected _version: V2010; + protected _solution: AddOnResultContextSolution; + protected _context?: AddOnResultContext; + constructor(_version: V2010, payload: AddOnResultResource, accountSid: string, referenceSid: string, sid?: string); + /** + * The unique string that that we created to identify the Recording AddOnResult resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resource. + */ + accountSid: string; + status: AddOnResultStatus; + /** + * The SID of the Add-on to which the result belongs. + */ + addOnSid: string; + /** + * The SID of the Add-on configuration. + */ + addOnConfigurationSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The date and time in GMT that the result was completed specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCompleted: Date; + /** + * The SID of the recording to which the AddOnResult resource belongs. + */ + referenceSid: string; + /** + * A list of related resources identified by their relative URIs. + */ + subresourceUris: Record; + private get _proxy(); + /** + * Remove a AddOnResultInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AddOnResultInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddOnResultInstance + */ + fetch(callback?: (error: Error | null, item?: AddOnResultInstance) => any): Promise; + /** + * Access the payloads. + */ + payloads(): PayloadListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + status: AddOnResultStatus; + addOnSid: string; + addOnConfigurationSid: string; + dateCreated: Date; + dateUpdated: Date; + dateCompleted: Date; + referenceSid: string; + subresourceUris: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AddOnResultSolution { + accountSid: string; + referenceSid: string; +} +export interface AddOnResultListInstance { + _version: V2010; + _solution: AddOnResultSolution; + _uri: string; + (sid: string): AddOnResultContext; + get(sid: string): AddOnResultContext; + /** + * Streams AddOnResultInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddOnResultListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AddOnResultInstance, done: (err?: Error) => void) => void): void; + each(params: AddOnResultListInstanceEachOptions, callback?: (item: AddOnResultInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AddOnResultInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AddOnResultPage) => any): Promise; + /** + * Lists AddOnResultInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddOnResultListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AddOnResultInstance[]) => any): Promise; + list(params: AddOnResultListInstanceOptions, callback?: (error: Error | null, items: AddOnResultInstance[]) => any): Promise; + /** + * Retrieve a single page of AddOnResultInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddOnResultListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AddOnResultPage) => any): Promise; + page(params: AddOnResultListInstancePageOptions, callback?: (error: Error | null, items: AddOnResultPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AddOnResultListInstance(version: V2010, accountSid: string, referenceSid: string): AddOnResultListInstance; +export declare class AddOnResultPage extends Page { + /** + * Initialize the AddOnResultPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AddOnResultSolution); + /** + * Build an instance of AddOnResultInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AddOnResultResource): AddOnResultInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult.js b/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult.js new file mode 100644 index 00000000..6273a6b8 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult.js @@ -0,0 +1,233 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AddOnResultPage = exports.AddOnResultListInstance = exports.AddOnResultInstance = exports.AddOnResultContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const payload_1 = require("./addOnResult/payload"); +class AddOnResultContextImpl { + constructor(_version, accountSid, referenceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(referenceSid)) { + throw new Error("Parameter 'referenceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, referenceSid, sid }; + this._uri = `/Accounts/${accountSid}/Recordings/${referenceSid}/AddOnResults/${sid}.json`; + } + get payloads() { + this._payloads = + this._payloads || + (0, payload_1.PayloadListInstance)(this._version, this._solution.accountSid, this._solution.referenceSid, this._solution.sid); + return this._payloads; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AddOnResultInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.referenceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddOnResultContextImpl = AddOnResultContextImpl; +class AddOnResultInstance { + constructor(_version, payload, accountSid, referenceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.status = payload.status; + this.addOnSid = payload.add_on_sid; + this.addOnConfigurationSid = payload.add_on_configuration_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.dateCompleted = deserialize.rfc2822DateTime(payload.date_completed); + this.referenceSid = payload.reference_sid; + this.subresourceUris = payload.subresource_uris; + this._solution = { accountSid, referenceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AddOnResultContextImpl(this._version, this._solution.accountSid, this._solution.referenceSid, this._solution.sid); + return this._context; + } + /** + * Remove a AddOnResultInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AddOnResultInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddOnResultInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the payloads. + */ + payloads() { + return this._proxy.payloads; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + status: this.status, + addOnSid: this.addOnSid, + addOnConfigurationSid: this.addOnConfigurationSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + dateCompleted: this.dateCompleted, + referenceSid: this.referenceSid, + subresourceUris: this.subresourceUris, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddOnResultInstance = AddOnResultInstance; +function AddOnResultListInstance(version, accountSid, referenceSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(referenceSid)) { + throw new Error("Parameter 'referenceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AddOnResultContextImpl(version, accountSid, referenceSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, referenceSid }; + instance._uri = `/Accounts/${accountSid}/Recordings/${referenceSid}/AddOnResults.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AddOnResultPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AddOnResultPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AddOnResultListInstance = AddOnResultListInstance; +class AddOnResultPage extends Page_1.default { + /** + * Initialize the AddOnResultPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AddOnResultInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AddOnResultInstance(this._version, payload, this._solution.accountSid, this._solution.referenceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddOnResultPage = AddOnResultPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult/payload.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult/payload.d.ts new file mode 100644 index 00000000..0ae5433a --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult/payload.d.ts @@ -0,0 +1,270 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +/** + * Options to pass to each + */ +export interface PayloadListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: PayloadInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface PayloadListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface PayloadListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface PayloadContext { + /** + * Remove a PayloadInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PayloadInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PayloadInstance + */ + fetch(callback?: (error: Error | null, item?: PayloadInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PayloadContextSolution { + accountSid: string; + referenceSid: string; + addOnResultSid: string; + sid: string; +} +export declare class PayloadContextImpl implements PayloadContext { + protected _version: V2010; + protected _solution: PayloadContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, referenceSid: string, addOnResultSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: PayloadInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PayloadContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PayloadPayload extends TwilioResponsePayload { + payloads: PayloadResource[]; +} +interface PayloadResource { + sid: string; + add_on_result_sid: string; + account_sid: string; + label: string; + add_on_sid: string; + add_on_configuration_sid: string; + content_type: string; + date_created: Date; + date_updated: Date; + reference_sid: string; + subresource_uris: Record; +} +export declare class PayloadInstance { + protected _version: V2010; + protected _solution: PayloadContextSolution; + protected _context?: PayloadContext; + constructor(_version: V2010, payload: PayloadResource, accountSid: string, referenceSid: string, addOnResultSid: string, sid?: string); + /** + * The unique string that that we created to identify the Recording AddOnResult Payload resource. + */ + sid: string; + /** + * The SID of the AddOnResult to which the payload belongs. + */ + addOnResultSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resource. + */ + accountSid: string; + /** + * The string provided by the vendor that describes the payload. + */ + label: string; + /** + * The SID of the Add-on to which the result belongs. + */ + addOnSid: string; + /** + * The SID of the Add-on configuration. + */ + addOnConfigurationSid: string; + /** + * The MIME type of the payload. + */ + contentType: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The SID of the recording to which the AddOnResult resource that contains the payload belongs. + */ + referenceSid: string; + /** + * A list of related resources identified by their relative URIs. + */ + subresourceUris: Record; + private get _proxy(); + /** + * Remove a PayloadInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PayloadInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PayloadInstance + */ + fetch(callback?: (error: Error | null, item?: PayloadInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + addOnResultSid: string; + accountSid: string; + label: string; + addOnSid: string; + addOnConfigurationSid: string; + contentType: string; + dateCreated: Date; + dateUpdated: Date; + referenceSid: string; + subresourceUris: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PayloadSolution { + accountSid: string; + referenceSid: string; + addOnResultSid: string; +} +export interface PayloadListInstance { + _version: V2010; + _solution: PayloadSolution; + _uri: string; + (sid: string): PayloadContext; + get(sid: string): PayloadContext; + /** + * Streams PayloadInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PayloadListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: PayloadInstance, done: (err?: Error) => void) => void): void; + each(params: PayloadListInstanceEachOptions, callback?: (item: PayloadInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of PayloadInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: PayloadPage) => any): Promise; + /** + * Lists PayloadInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PayloadListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: PayloadInstance[]) => any): Promise; + list(params: PayloadListInstanceOptions, callback?: (error: Error | null, items: PayloadInstance[]) => any): Promise; + /** + * Retrieve a single page of PayloadInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PayloadListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: PayloadPage) => any): Promise; + page(params: PayloadListInstancePageOptions, callback?: (error: Error | null, items: PayloadPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PayloadListInstance(version: V2010, accountSid: string, referenceSid: string, addOnResultSid: string): PayloadListInstance; +export declare class PayloadPage extends Page { + /** + * Initialize the PayloadPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: PayloadSolution); + /** + * Build an instance of PayloadInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: PayloadResource): PayloadInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult/payload.js b/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult/payload.js new file mode 100644 index 00000000..c60a7a89 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/recording/addOnResult/payload.js @@ -0,0 +1,233 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PayloadPage = exports.PayloadListInstance = exports.PayloadInstance = exports.PayloadContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class PayloadContextImpl { + constructor(_version, accountSid, referenceSid, addOnResultSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(referenceSid)) { + throw new Error("Parameter 'referenceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(addOnResultSid)) { + throw new Error("Parameter 'addOnResultSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, referenceSid, addOnResultSid, sid }; + this._uri = `/Accounts/${accountSid}/Recordings/${referenceSid}/AddOnResults/${addOnResultSid}/Payloads/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PayloadInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.referenceSid, instance._solution.addOnResultSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PayloadContextImpl = PayloadContextImpl; +class PayloadInstance { + constructor(_version, payload, accountSid, referenceSid, addOnResultSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.addOnResultSid = payload.add_on_result_sid; + this.accountSid = payload.account_sid; + this.label = payload.label; + this.addOnSid = payload.add_on_sid; + this.addOnConfigurationSid = payload.add_on_configuration_sid; + this.contentType = payload.content_type; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.referenceSid = payload.reference_sid; + this.subresourceUris = payload.subresource_uris; + this._solution = { + accountSid, + referenceSid, + addOnResultSid, + sid: sid || this.sid, + }; + } + get _proxy() { + this._context = + this._context || + new PayloadContextImpl(this._version, this._solution.accountSid, this._solution.referenceSid, this._solution.addOnResultSid, this._solution.sid); + return this._context; + } + /** + * Remove a PayloadInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a PayloadInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PayloadInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + addOnResultSid: this.addOnResultSid, + accountSid: this.accountSid, + label: this.label, + addOnSid: this.addOnSid, + addOnConfigurationSid: this.addOnConfigurationSid, + contentType: this.contentType, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + referenceSid: this.referenceSid, + subresourceUris: this.subresourceUris, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PayloadInstance = PayloadInstance; +function PayloadListInstance(version, accountSid, referenceSid, addOnResultSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(referenceSid)) { + throw new Error("Parameter 'referenceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(addOnResultSid)) { + throw new Error("Parameter 'addOnResultSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PayloadContextImpl(version, accountSid, referenceSid, addOnResultSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, referenceSid, addOnResultSid }; + instance._uri = `/Accounts/${accountSid}/Recordings/${referenceSid}/AddOnResults/${addOnResultSid}/Payloads.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PayloadPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new PayloadPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PayloadListInstance = PayloadListInstance; +class PayloadPage extends Page_1.default { + /** + * Initialize the PayloadPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of PayloadInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new PayloadInstance(this._version, payload, this._solution.accountSid, this._solution.referenceSid, this._solution.addOnResultSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PayloadPage = PayloadPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/recording/transcription.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/recording/transcription.d.ts new file mode 100644 index 00000000..f0471cdb --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/recording/transcription.d.ts @@ -0,0 +1,278 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +export type TranscriptionStatus = "in-progress" | "completed" | "failed"; +/** + * Options to pass to each + */ +export interface TranscriptionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TranscriptionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TranscriptionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TranscriptionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TranscriptionContext { + /** + * Remove a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptionInstance + */ + fetch(callback?: (error: Error | null, item?: TranscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TranscriptionContextSolution { + accountSid: string; + recordingSid: string; + sid: string; +} +export declare class TranscriptionContextImpl implements TranscriptionContext { + protected _version: V2010; + protected _solution: TranscriptionContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, recordingSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TranscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TranscriptionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TranscriptionPayload extends TwilioResponsePayload { + transcriptions: TranscriptionResource[]; +} +interface TranscriptionResource { + account_sid: string; + api_version: string; + date_created: Date; + date_updated: Date; + duration: string; + price: number; + price_unit: string; + recording_sid: string; + sid: string; + status: TranscriptionStatus; + transcription_text: string; + type: string; + uri: string; +} +export declare class TranscriptionInstance { + protected _version: V2010; + protected _solution: TranscriptionContextSolution; + protected _context?: TranscriptionContext; + constructor(_version: V2010, payload: TranscriptionResource, accountSid: string, recordingSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resource. + */ + accountSid: string; + /** + * The API version used to create the transcription. + */ + apiVersion: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The duration of the transcribed audio in seconds. + */ + duration: string; + /** + * The charge for the transcript in the currency associated with the account. This value is populated after the transcript is complete so it may not be available immediately. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) from which the transcription was created. + */ + recordingSid: string; + /** + * The unique string that that we created to identify the Transcription resource. + */ + sid: string; + status: TranscriptionStatus; + /** + * The text content of the transcription. + */ + transcriptionText: string; + /** + * The transcription type. + */ + type: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptionInstance + */ + fetch(callback?: (error: Error | null, item?: TranscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + dateCreated: Date; + dateUpdated: Date; + duration: string; + price: number; + priceUnit: string; + recordingSid: string; + sid: string; + status: TranscriptionStatus; + transcriptionText: string; + type: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TranscriptionSolution { + accountSid: string; + recordingSid: string; +} +export interface TranscriptionListInstance { + _version: V2010; + _solution: TranscriptionSolution; + _uri: string; + (sid: string): TranscriptionContext; + get(sid: string): TranscriptionContext; + /** + * Streams TranscriptionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TranscriptionInstance, done: (err?: Error) => void) => void): void; + each(params: TranscriptionListInstanceEachOptions, callback?: (item: TranscriptionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TranscriptionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TranscriptionPage) => any): Promise; + /** + * Lists TranscriptionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TranscriptionInstance[]) => any): Promise; + list(params: TranscriptionListInstanceOptions, callback?: (error: Error | null, items: TranscriptionInstance[]) => any): Promise; + /** + * Retrieve a single page of TranscriptionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TranscriptionPage) => any): Promise; + page(params: TranscriptionListInstancePageOptions, callback?: (error: Error | null, items: TranscriptionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TranscriptionListInstance(version: V2010, accountSid: string, recordingSid: string): TranscriptionListInstance; +export declare class TranscriptionPage extends Page { + /** + * Initialize the TranscriptionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: TranscriptionSolution); + /** + * Build an instance of TranscriptionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TranscriptionResource): TranscriptionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/recording/transcription.js b/node_modules/twilio/lib/rest/api/v2010/account/recording/transcription.js new file mode 100644 index 00000000..7bc73513 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/recording/transcription.js @@ -0,0 +1,226 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TranscriptionPage = exports.TranscriptionListInstance = exports.TranscriptionInstance = exports.TranscriptionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class TranscriptionContextImpl { + constructor(_version, accountSid, recordingSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(recordingSid)) { + throw new Error("Parameter 'recordingSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, recordingSid, sid }; + this._uri = `/Accounts/${accountSid}/Recordings/${recordingSid}/Transcriptions/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TranscriptionInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.recordingSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptionContextImpl = TranscriptionContextImpl; +class TranscriptionInstance { + constructor(_version, payload, accountSid, recordingSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.duration = payload.duration; + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.recordingSid = payload.recording_sid; + this.sid = payload.sid; + this.status = payload.status; + this.transcriptionText = payload.transcription_text; + this.type = payload.type; + this.uri = payload.uri; + this._solution = { accountSid, recordingSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TranscriptionContextImpl(this._version, this._solution.accountSid, this._solution.recordingSid, this._solution.sid); + return this._context; + } + /** + * Remove a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + duration: this.duration, + price: this.price, + priceUnit: this.priceUnit, + recordingSid: this.recordingSid, + sid: this.sid, + status: this.status, + transcriptionText: this.transcriptionText, + type: this.type, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptionInstance = TranscriptionInstance; +function TranscriptionListInstance(version, accountSid, recordingSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(recordingSid)) { + throw new Error("Parameter 'recordingSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TranscriptionContextImpl(version, accountSid, recordingSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, recordingSid }; + instance._uri = `/Accounts/${accountSid}/Recordings/${recordingSid}/Transcriptions.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TranscriptionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TranscriptionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TranscriptionListInstance = TranscriptionListInstance; +class TranscriptionPage extends Page_1.default { + /** + * Initialize the TranscriptionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TranscriptionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TranscriptionInstance(this._version, payload, this._solution.accountSid, this._solution.recordingSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptionPage = TranscriptionPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/shortCode.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/shortCode.d.ts new file mode 100644 index 00000000..ef98588e --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/shortCode.d.ts @@ -0,0 +1,319 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +/** + * Options to pass to update a ShortCodeInstance + */ +export interface ShortCodeContextUpdateOptions { + /** A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. */ + friendlyName?: string; + /** The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. */ + apiVersion?: string; + /** The URL we should call when receiving an incoming SMS message to this short code. */ + smsUrl?: string; + /** The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. */ + smsMethod?: string; + /** The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. */ + smsFallbackMethod?: string; +} +/** + * Options to pass to each + */ +export interface ShortCodeListInstanceEachOptions { + /** The string that identifies the ShortCode resources to read. */ + friendlyName?: string; + /** Only show the ShortCode resources that match this pattern. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + shortCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ShortCodeListInstanceOptions { + /** The string that identifies the ShortCode resources to read. */ + friendlyName?: string; + /** Only show the ShortCode resources that match this pattern. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + shortCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ShortCodeListInstancePageOptions { + /** The string that identifies the ShortCode resources to read. */ + friendlyName?: string; + /** Only show the ShortCode resources that match this pattern. You can specify partial numbers and use \'*\' as a wildcard for any digit. */ + shortCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ShortCodeContext { + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Update a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + update(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Update a ShortCodeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + update(params: ShortCodeContextUpdateOptions, callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ShortCodeContextSolution { + accountSid: string; + sid: string; +} +export declare class ShortCodeContextImpl implements ShortCodeContext { + protected _version: V2010; + protected _solution: ShortCodeContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + update(params?: ShortCodeContextUpdateOptions | ((error: Error | null, item?: ShortCodeInstance) => any), callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ShortCodeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ShortCodePayload extends TwilioResponsePayload { + short_codes: ShortCodeResource[]; +} +interface ShortCodeResource { + account_sid: string; + api_version: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + short_code: string; + sid: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + uri: string; +} +export declare class ShortCodeInstance { + protected _version: V2010; + protected _solution: ShortCodeContextSolution; + protected _context?: ShortCodeContext; + constructor(_version: V2010, payload: ShortCodeResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this ShortCode resource. + */ + accountSid: string; + /** + * The API version used to start a new TwiML session when an SMS message is sent to this short code. + */ + apiVersion: string; + /** + * The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * A string that you assigned to describe this resource. By default, the `FriendlyName` is the short code. + */ + friendlyName: string; + /** + * The short code. e.g., 894546. + */ + shortCode: string; + /** + * The unique string that that we created to identify this ShortCode resource. + */ + sid: string; + /** + * The HTTP method we use to call the `sms_fallback_url`. Can be: `GET` or `POST`. + */ + smsFallbackMethod: string; + /** + * The URL that we call if an error occurs while retrieving or executing the TwiML from `sms_url`. + */ + smsFallbackUrl: string; + /** + * The HTTP method we use to call the `sms_url`. Can be: `GET` or `POST`. + */ + smsMethod: string; + /** + * The URL we call when receiving an incoming SMS message to this short code. + */ + smsUrl: string; + /** + * The URI of this resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Update a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + update(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Update a ShortCodeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + update(params: ShortCodeContextUpdateOptions, callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + shortCode: string; + sid: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ShortCodeSolution { + accountSid: string; +} +export interface ShortCodeListInstance { + _version: V2010; + _solution: ShortCodeSolution; + _uri: string; + (sid: string): ShortCodeContext; + get(sid: string): ShortCodeContext; + /** + * Streams ShortCodeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void): void; + each(params: ShortCodeListInstanceEachOptions, callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ShortCodeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + /** + * Lists ShortCodeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ShortCodeInstance[]) => any): Promise; + list(params: ShortCodeListInstanceOptions, callback?: (error: Error | null, items: ShortCodeInstance[]) => any): Promise; + /** + * Retrieve a single page of ShortCodeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + page(params: ShortCodeListInstancePageOptions, callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ShortCodeListInstance(version: V2010, accountSid: string): ShortCodeListInstance; +export declare class ShortCodePage extends Page { + /** + * Initialize the ShortCodePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: ShortCodeSolution); + /** + * Build an instance of ShortCodeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ShortCodeResource): ShortCodeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/shortCode.js b/node_modules/twilio/lib/rest/api/v2010/account/shortCode.js new file mode 100644 index 00000000..f2a54880 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/shortCode.js @@ -0,0 +1,240 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ShortCodePage = exports.ShortCodeListInstance = exports.ShortCodeInstance = exports.ShortCodeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ShortCodeContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/SMS/ShortCodes/${sid}.json`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ShortCodeInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["apiVersion"] !== undefined) + data["ApiVersion"] = params["apiVersion"]; + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ShortCodeInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodeContextImpl = ShortCodeContextImpl; +class ShortCodeInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.shortCode = payload.short_code; + this.sid = payload.sid; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.uri = payload.uri; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ShortCodeContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + shortCode: this.shortCode, + sid: this.sid, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodeInstance = ShortCodeInstance; +function ShortCodeListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ShortCodeContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/SMS/ShortCodes.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["shortCode"] !== undefined) + data["ShortCode"] = params["shortCode"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ShortCodePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ShortCodePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ShortCodeListInstance = ShortCodeListInstance; +class ShortCodePage extends Page_1.default { + /** + * Initialize the ShortCodePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ShortCodeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ShortCodeInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodePage = ShortCodePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/signingKey.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/signingKey.d.ts new file mode 100644 index 00000000..6fd0654d --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/signingKey.d.ts @@ -0,0 +1,254 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +/** + * Options to pass to update a SigningKeyInstance + */ +export interface SigningKeyContextUpdateOptions { + /** */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface SigningKeyListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SigningKeyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SigningKeyListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SigningKeyListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SigningKeyContext { + /** + * Remove a SigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SigningKeyInstance + */ + fetch(callback?: (error: Error | null, item?: SigningKeyInstance) => any): Promise; + /** + * Update a SigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SigningKeyInstance + */ + update(callback?: (error: Error | null, item?: SigningKeyInstance) => any): Promise; + /** + * Update a SigningKeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SigningKeyInstance + */ + update(params: SigningKeyContextUpdateOptions, callback?: (error: Error | null, item?: SigningKeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SigningKeyContextSolution { + accountSid: string; + sid: string; +} +export declare class SigningKeyContextImpl implements SigningKeyContext { + protected _version: V2010; + protected _solution: SigningKeyContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SigningKeyInstance) => any): Promise; + update(params?: SigningKeyContextUpdateOptions | ((error: Error | null, item?: SigningKeyInstance) => any), callback?: (error: Error | null, item?: SigningKeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SigningKeyContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SigningKeyPayload extends TwilioResponsePayload { + signing_keys: SigningKeyResource[]; +} +interface SigningKeyResource { + sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; +} +export declare class SigningKeyInstance { + protected _version: V2010; + protected _solution: SigningKeyContextSolution; + protected _context?: SigningKeyContext; + constructor(_version: V2010, payload: SigningKeyResource, accountSid: string, sid?: string); + sid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + private get _proxy(); + /** + * Remove a SigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SigningKeyInstance + */ + fetch(callback?: (error: Error | null, item?: SigningKeyInstance) => any): Promise; + /** + * Update a SigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SigningKeyInstance + */ + update(callback?: (error: Error | null, item?: SigningKeyInstance) => any): Promise; + /** + * Update a SigningKeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SigningKeyInstance + */ + update(params: SigningKeyContextUpdateOptions, callback?: (error: Error | null, item?: SigningKeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SigningKeySolution { + accountSid: string; +} +export interface SigningKeyListInstance { + _version: V2010; + _solution: SigningKeySolution; + _uri: string; + (sid: string): SigningKeyContext; + get(sid: string): SigningKeyContext; + /** + * Streams SigningKeyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SigningKeyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SigningKeyInstance, done: (err?: Error) => void) => void): void; + each(params: SigningKeyListInstanceEachOptions, callback?: (item: SigningKeyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SigningKeyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SigningKeyPage) => any): Promise; + /** + * Lists SigningKeyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SigningKeyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SigningKeyInstance[]) => any): Promise; + list(params: SigningKeyListInstanceOptions, callback?: (error: Error | null, items: SigningKeyInstance[]) => any): Promise; + /** + * Retrieve a single page of SigningKeyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SigningKeyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SigningKeyPage) => any): Promise; + page(params: SigningKeyListInstancePageOptions, callback?: (error: Error | null, items: SigningKeyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SigningKeyListInstance(version: V2010, accountSid: string): SigningKeyListInstance; +export declare class SigningKeyPage extends Page { + /** + * Initialize the SigningKeyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: SigningKeySolution); + /** + * Build an instance of SigningKeyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SigningKeyResource): SigningKeyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/signingKey.js b/node_modules/twilio/lib/rest/api/v2010/account/signingKey.js new file mode 100644 index 00000000..f9653c0e --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/signingKey.js @@ -0,0 +1,229 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SigningKeyPage = exports.SigningKeyListInstance = exports.SigningKeyInstance = exports.SigningKeyContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class SigningKeyContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/SigningKeys/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SigningKeyInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SigningKeyInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SigningKeyContextImpl = SigningKeyContextImpl; +class SigningKeyInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SigningKeyContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a SigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SigningKeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SigningKeyInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SigningKeyInstance = SigningKeyInstance; +function SigningKeyListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SigningKeyContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/SigningKeys.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SigningKeyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SigningKeyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SigningKeyListInstance = SigningKeyListInstance; +class SigningKeyPage extends Page_1.default { + /** + * Initialize the SigningKeyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SigningKeyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SigningKeyInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SigningKeyPage = SigningKeyPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip.d.ts new file mode 100644 index 00000000..7568f709 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip.d.ts @@ -0,0 +1,26 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../V2010"; +import { CredentialListListInstance } from "./sip/credentialList"; +import { DomainListInstance } from "./sip/domain"; +import { IpAccessControlListListInstance } from "./sip/ipAccessControlList"; +export interface SipSolution { + accountSid: string; +} +export interface SipListInstance { + _version: V2010; + _solution: SipSolution; + _uri: string; + _credentialLists?: CredentialListListInstance; + credentialLists: CredentialListListInstance; + _domains?: DomainListInstance; + domains: DomainListInstance; + _ipAccessControlLists?: IpAccessControlListListInstance; + ipAccessControlLists: IpAccessControlListListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SipListInstance(version: V2010, accountSid: string): SipListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip.js b/node_modules/twilio/lib/rest/api/v2010/account/sip.js new file mode 100644 index 00000000..5ad39a3a --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip.js @@ -0,0 +1,64 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SipListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const credentialList_1 = require("./sip/credentialList"); +const domain_1 = require("./sip/domain"); +const ipAccessControlList_1 = require("./sip/ipAccessControlList"); +function SipListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/SIP.json`; + Object.defineProperty(instance, "credentialLists", { + get: function credentialLists() { + if (!instance._credentialLists) { + instance._credentialLists = (0, credentialList_1.CredentialListListInstance)(instance._version, instance._solution.accountSid); + } + return instance._credentialLists; + }, + }); + Object.defineProperty(instance, "domains", { + get: function domains() { + if (!instance._domains) { + instance._domains = (0, domain_1.DomainListInstance)(instance._version, instance._solution.accountSid); + } + return instance._domains; + }, + }); + Object.defineProperty(instance, "ipAccessControlLists", { + get: function ipAccessControlLists() { + if (!instance._ipAccessControlLists) { + instance._ipAccessControlLists = (0, ipAccessControlList_1.IpAccessControlListListInstance)(instance._version, instance._solution.accountSid); + } + return instance._ipAccessControlLists; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SipListInstance = SipListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList.d.ts new file mode 100644 index 00000000..d7dc28ae --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList.d.ts @@ -0,0 +1,292 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { CredentialListInstance as CredentialListInstanceImport } from "./credentialList/credential"; +/** + * Options to pass to update a CredentialListInstance + */ +export interface CredentialListContextUpdateOptions { + /** A human readable descriptive text for a CredentialList, up to 64 characters long. */ + friendlyName: string; +} +/** + * Options to pass to create a CredentialListInstance + */ +export interface CredentialListListInstanceCreateOptions { + /** A human readable descriptive text that describes the CredentialList, up to 64 characters long. */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface CredentialListListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialListInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialListContext { + credentials: CredentialListInstanceImport; + /** + * Remove a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Update a CredentialListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + update(params: CredentialListContextUpdateOptions, callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialListContextSolution { + accountSid: string; + sid: string; +} +export declare class CredentialListContextImpl implements CredentialListContext { + protected _version: V2010; + protected _solution: CredentialListContextSolution; + protected _uri: string; + protected _credentials?: CredentialListInstanceImport; + constructor(_version: V2010, accountSid: string, sid: string); + get credentials(): CredentialListInstanceImport; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + update(params: CredentialListContextUpdateOptions, callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialListContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialListPayload extends TwilioResponsePayload { + credential_lists: CredentialListResource[]; +} +interface CredentialListResource { + account_sid: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + sid: string; + subresource_uris: Record; + uri: string; +} +export declare class CredentialListInstance { + protected _version: V2010; + protected _solution: CredentialListContextSolution; + protected _context?: CredentialListContext; + constructor(_version: V2010, payload: CredentialListResource, accountSid: string, sid?: string); + /** + * The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) that owns this resource. + */ + accountSid: string; + /** + * The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateCreated: Date; + /** + * The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateUpdated: Date; + /** + * A human readable descriptive text that describes the CredentialList, up to 64 characters long. + */ + friendlyName: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * A list of credentials associated with this credential list. + */ + subresourceUris: Record; + /** + * The URI for this resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Update a CredentialListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + update(params: CredentialListContextUpdateOptions, callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Access the credentials. + */ + credentials(): CredentialListInstanceImport; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + sid: string; + subresourceUris: Record; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialListSolution { + accountSid: string; +} +export interface CredentialListListInstance { + _version: V2010; + _solution: CredentialListSolution; + _uri: string; + (sid: string): CredentialListContext; + get(sid: string): CredentialListContext; + /** + * Create a CredentialListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + create(params: CredentialListListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Streams CredentialListInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialListInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListListInstanceEachOptions, callback?: (item: CredentialListInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialListInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialListPage) => any): Promise; + /** + * Lists CredentialListInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialListInstance[]) => any): Promise; + list(params: CredentialListListInstanceOptions, callback?: (error: Error | null, items: CredentialListInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialListInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialListPage) => any): Promise; + page(params: CredentialListListInstancePageOptions, callback?: (error: Error | null, items: CredentialListPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListListInstance(version: V2010, accountSid: string): CredentialListListInstance; +export declare class CredentialListPage extends Page { + /** + * Initialize the CredentialListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: CredentialListSolution); + /** + * Build an instance of CredentialListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialListResource): CredentialListInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList.js new file mode 100644 index 00000000..a4a169c1 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList.js @@ -0,0 +1,269 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialListPage = exports.CredentialListListInstance = exports.CredentialListInstance = exports.CredentialListContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const credential_1 = require("./credentialList/credential"); +class CredentialListContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/CredentialLists/${sid}.json`; + } + get credentials() { + this._credentials = + this._credentials || + (0, credential_1.CredentialListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._credentials; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialListInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialListInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListContextImpl = CredentialListContextImpl; +class CredentialListInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialListContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the credentials. + */ + credentials() { + return this._proxy.credentials; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + sid: this.sid, + subresourceUris: this.subresourceUris, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListInstance = CredentialListInstance; +function CredentialListListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialListContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/SIP/CredentialLists.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialListInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialListPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialListPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListListInstance = CredentialListListInstance; +class CredentialListPage extends Page_1.default { + /** + * Initialize the CredentialListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialListInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListPage = CredentialListPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList/credential.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList/credential.d.ts new file mode 100644 index 00000000..786aade9 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList/credential.d.ts @@ -0,0 +1,304 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +/** + * Options to pass to update a CredentialInstance + */ +export interface CredentialContextUpdateOptions { + /** The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) */ + password?: string; +} +/** + * Options to pass to create a CredentialInstance + */ +export interface CredentialListInstanceCreateOptions { + /** The username that will be passed when authenticating SIP requests. The username should be sent in response to Twilio\\\'s challenge of the initial INVITE. It can be up to 32 characters long. */ + username: string; + /** The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) */ + password: string; +} +/** + * Options to pass to each + */ +export interface CredentialListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialContext { + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialContextSolution { + accountSid: string; + credentialListSid: string; + sid: string; +} +export declare class CredentialContextImpl implements CredentialContext { + protected _version: V2010; + protected _solution: CredentialContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, credentialListSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + update(params?: CredentialContextUpdateOptions | ((error: Error | null, item?: CredentialInstance) => any), callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialPayload extends TwilioResponsePayload { + credentials: CredentialResource[]; +} +interface CredentialResource { + sid: string; + account_sid: string; + credential_list_sid: string; + username: string; + date_created: Date; + date_updated: Date; + uri: string; +} +export declare class CredentialInstance { + protected _version: V2010; + protected _solution: CredentialContextSolution; + protected _context?: CredentialContext; + constructor(_version: V2010, payload: CredentialResource, accountSid: string, credentialListSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The unique id of the Account that is responsible for this resource. + */ + accountSid: string; + /** + * The unique id that identifies the credential list that includes this credential. + */ + credentialListSid: string; + /** + * The username for this credential. + */ + username: string; + /** + * The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateCreated: Date; + /** + * The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateUpdated: Date; + /** + * The URI for this resource, relative to `https://api.twilio.com` + */ + uri: string; + private get _proxy(); + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + credentialListSid: string; + username: string; + dateCreated: Date; + dateUpdated: Date; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialSolution { + accountSid: string; + credentialListSid: string; +} +export interface CredentialListInstance { + _version: V2010; + _solution: CredentialSolution; + _uri: string; + (sid: string): CredentialContext; + get(sid: string): CredentialContext; + /** + * Create a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + create(params: CredentialListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Streams CredentialInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListInstanceEachOptions, callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Lists CredentialInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + list(params: CredentialListInstanceOptions, callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialPage) => any): Promise; + page(params: CredentialListInstancePageOptions, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListInstance(version: V2010, accountSid: string, credentialListSid: string): CredentialListInstance; +export declare class CredentialPage extends Page { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: CredentialSolution); + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialResource): CredentialInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList/credential.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList/credential.js new file mode 100644 index 00000000..1e97b92c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/credentialList/credential.js @@ -0,0 +1,266 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialPage = exports.CredentialListInstance = exports.CredentialInstance = exports.CredentialContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class CredentialContextImpl { + constructor(_version, accountSid, credentialListSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(credentialListSid)) { + throw new Error("Parameter 'credentialListSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, credentialListSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/CredentialLists/${credentialListSid}/Credentials/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.credentialListSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["password"] !== undefined) + data["Password"] = params["password"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.credentialListSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialContextImpl = CredentialContextImpl; +class CredentialInstance { + constructor(_version, payload, accountSid, credentialListSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.credentialListSid = payload.credential_list_sid; + this.username = payload.username; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.uri = payload.uri; + this._solution = { accountSid, credentialListSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialContextImpl(this._version, this._solution.accountSid, this._solution.credentialListSid, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + credentialListSid: this.credentialListSid, + username: this.username, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialInstance = CredentialInstance; +function CredentialListInstance(version, accountSid, credentialListSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(credentialListSid)) { + throw new Error("Parameter 'credentialListSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialContextImpl(version, accountSid, credentialListSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, credentialListSid }; + instance._uri = `/Accounts/${accountSid}/SIP/CredentialLists/${credentialListSid}/Credentials.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["username"] === null || params["username"] === undefined) { + throw new Error("Required parameter \"params['username']\" missing."); + } + if (params["password"] === null || params["password"] === undefined) { + throw new Error("Required parameter \"params['password']\" missing."); + } + let data = {}; + data["Username"] = params["username"]; + data["Password"] = params["password"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.credentialListSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListInstance = CredentialListInstance; +class CredentialPage extends Page_1.default { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialInstance(this._version, payload, this._solution.accountSid, this._solution.credentialListSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialPage = CredentialPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain.d.ts new file mode 100644 index 00000000..aed2dfa1 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain.d.ts @@ -0,0 +1,456 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { AuthTypesListInstance } from "./domain/authTypes"; +import { CredentialListMappingListInstance } from "./domain/credentialListMapping"; +import { IpAccessControlListMappingListInstance } from "./domain/ipAccessControlListMapping"; +/** + * Options to pass to update a DomainInstance + */ +export interface DomainContextUpdateOptions { + /** A descriptive string that you created to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. */ + voiceFallbackUrl?: string; + /** The HTTP method we should use to call `voice_url` */ + voiceMethod?: string; + /** The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. */ + voiceStatusCallbackMethod?: string; + /** The URL that we should call to pass status parameters (such as call ended) to your application. */ + voiceStatusCallbackUrl?: string; + /** The URL we should call when the domain receives a call. */ + voiceUrl?: string; + /** Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. */ + sipRegistration?: boolean; + /** The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. */ + domainName?: string; + /** Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. */ + emergencyCallingEnabled?: boolean; + /** Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. */ + secure?: boolean; + /** The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. */ + byocTrunkSid?: string; + /** Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. */ + emergencyCallerSid?: string; +} +/** + * Options to pass to create a DomainInstance + */ +export interface DomainListInstanceCreateOptions { + /** The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. */ + domainName: string; + /** A descriptive string that you created to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The URL we should when the domain receives a call. */ + voiceUrl?: string; + /** The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. */ + voiceMethod?: string; + /** The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. */ + voiceFallbackUrl?: string; + /** The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call to pass status parameters (such as call ended) to your application. */ + voiceStatusCallbackUrl?: string; + /** The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. */ + voiceStatusCallbackMethod?: string; + /** Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. */ + sipRegistration?: boolean; + /** Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. */ + emergencyCallingEnabled?: boolean; + /** Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. */ + secure?: boolean; + /** The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. */ + byocTrunkSid?: string; + /** Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. */ + emergencyCallerSid?: string; +} +/** + * Options to pass to each + */ +export interface DomainListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DomainInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DomainListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DomainListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DomainContext { + auth: AuthTypesListInstance; + credentialListMappings: CredentialListMappingListInstance; + ipAccessControlListMappings: IpAccessControlListMappingListInstance; + /** + * Remove a DomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainInstance + */ + fetch(callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + /** + * Update a DomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainInstance + */ + update(callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + /** + * Update a DomainInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainInstance + */ + update(params: DomainContextUpdateOptions, callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DomainContextSolution { + accountSid: string; + sid: string; +} +export declare class DomainContextImpl implements DomainContext { + protected _version: V2010; + protected _solution: DomainContextSolution; + protected _uri: string; + protected _auth?: AuthTypesListInstance; + protected _credentialListMappings?: CredentialListMappingListInstance; + protected _ipAccessControlListMappings?: IpAccessControlListMappingListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get auth(): AuthTypesListInstance; + get credentialListMappings(): CredentialListMappingListInstance; + get ipAccessControlListMappings(): IpAccessControlListMappingListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + update(params?: DomainContextUpdateOptions | ((error: Error | null, item?: DomainInstance) => any), callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DomainContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DomainPayload extends TwilioResponsePayload { + domains: DomainResource[]; +} +interface DomainResource { + account_sid: string; + api_version: string; + auth_type: string; + date_created: Date; + date_updated: Date; + domain_name: string; + friendly_name: string; + sid: string; + uri: string; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_status_callback_method: string; + voice_status_callback_url: string; + voice_url: string; + subresource_uris: Record; + sip_registration: boolean; + emergency_calling_enabled: boolean; + secure: boolean; + byoc_trunk_sid: string; + emergency_caller_sid: string; +} +export declare class DomainInstance { + protected _version: V2010; + protected _solution: DomainContextSolution; + protected _context?: DomainContext; + constructor(_version: V2010, payload: DomainResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resource. + */ + accountSid: string; + /** + * The API version used to process the call. + */ + apiVersion: string; + /** + * The types of authentication you have mapped to your domain. Can be: `IP_ACL` and `CREDENTIAL_LIST`. If you have both defined for your domain, both will be returned in a comma delimited string. If `auth_type` is not defined, the domain will not be able to receive any traffic. + */ + authType: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \"-\" and must end with `sip.twilio.com`. + */ + domainName: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The unique string that that we created to identify the SipDomain resource. + */ + sid: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call when an error occurs while retrieving or executing the TwiML requested from `voice_url`. + */ + voiceFallbackUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The HTTP method we use to call `voice_status_callback_url`. Either `GET` or `POST`. + */ + voiceStatusCallbackMethod: string; + /** + * The URL that we call to pass status parameters (such as call ended) to your application. + */ + voiceStatusCallbackUrl: string; + /** + * The URL we call using the `voice_method` when the domain receives a call. + */ + voiceUrl: string; + /** + * A list of mapping resources associated with the SIP Domain resource identified by their relative URIs. + */ + subresourceUris: Record; + /** + * Whether to allow SIP Endpoints to register with the domain to receive calls. + */ + sipRegistration: boolean; + /** + * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + */ + emergencyCallingEnabled: boolean; + /** + * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + */ + secure: boolean; + /** + * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + */ + byocTrunkSid: string; + /** + * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + */ + emergencyCallerSid: string; + private get _proxy(); + /** + * Remove a DomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainInstance + */ + fetch(callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + /** + * Update a DomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainInstance + */ + update(callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + /** + * Update a DomainInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainInstance + */ + update(params: DomainContextUpdateOptions, callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + /** + * Access the auth. + */ + auth(): AuthTypesListInstance; + /** + * Access the credentialListMappings. + */ + credentialListMappings(): CredentialListMappingListInstance; + /** + * Access the ipAccessControlListMappings. + */ + ipAccessControlListMappings(): IpAccessControlListMappingListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + authType: string; + dateCreated: Date; + dateUpdated: Date; + domainName: string; + friendlyName: string; + sid: string; + uri: string; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceStatusCallbackMethod: string; + voiceStatusCallbackUrl: string; + voiceUrl: string; + subresourceUris: Record; + sipRegistration: boolean; + emergencyCallingEnabled: boolean; + secure: boolean; + byocTrunkSid: string; + emergencyCallerSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DomainSolution { + accountSid: string; +} +export interface DomainListInstance { + _version: V2010; + _solution: DomainSolution; + _uri: string; + (sid: string): DomainContext; + get(sid: string): DomainContext; + /** + * Create a DomainInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainInstance + */ + create(params: DomainListInstanceCreateOptions, callback?: (error: Error | null, item?: DomainInstance) => any): Promise; + /** + * Streams DomainInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DomainListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DomainInstance, done: (err?: Error) => void) => void): void; + each(params: DomainListInstanceEachOptions, callback?: (item: DomainInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DomainInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DomainPage) => any): Promise; + /** + * Lists DomainInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DomainListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DomainInstance[]) => any): Promise; + list(params: DomainListInstanceOptions, callback?: (error: Error | null, items: DomainInstance[]) => any): Promise; + /** + * Retrieve a single page of DomainInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DomainListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DomainPage) => any): Promise; + page(params: DomainListInstancePageOptions, callback?: (error: Error | null, items: DomainPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DomainListInstance(version: V2010, accountSid: string): DomainListInstance; +export declare class DomainPage extends Page { + /** + * Initialize the DomainPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: DomainSolution); + /** + * Build an instance of DomainInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DomainResource): DomainInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain.js new file mode 100644 index 00000000..8c361c1c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain.js @@ -0,0 +1,371 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DomainPage = exports.DomainListInstance = exports.DomainInstance = exports.DomainContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const authTypes_1 = require("./domain/authTypes"); +const credentialListMapping_1 = require("./domain/credentialListMapping"); +const ipAccessControlListMapping_1 = require("./domain/ipAccessControlListMapping"); +class DomainContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/Domains/${sid}.json`; + } + get auth() { + this._auth = + this._auth || + (0, authTypes_1.AuthTypesListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._auth; + } + get credentialListMappings() { + this._credentialListMappings = + this._credentialListMappings || + (0, credentialListMapping_1.CredentialListMappingListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._credentialListMappings; + } + get ipAccessControlListMappings() { + this._ipAccessControlListMappings = + this._ipAccessControlListMappings || + (0, ipAccessControlListMapping_1.IpAccessControlListMappingListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._ipAccessControlListMappings; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DomainInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceStatusCallbackMethod"] !== undefined) + data["VoiceStatusCallbackMethod"] = params["voiceStatusCallbackMethod"]; + if (params["voiceStatusCallbackUrl"] !== undefined) + data["VoiceStatusCallbackUrl"] = params["voiceStatusCallbackUrl"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["sipRegistration"] !== undefined) + data["SipRegistration"] = serialize.bool(params["sipRegistration"]); + if (params["domainName"] !== undefined) + data["DomainName"] = params["domainName"]; + if (params["emergencyCallingEnabled"] !== undefined) + data["EmergencyCallingEnabled"] = serialize.bool(params["emergencyCallingEnabled"]); + if (params["secure"] !== undefined) + data["Secure"] = serialize.bool(params["secure"]); + if (params["byocTrunkSid"] !== undefined) + data["ByocTrunkSid"] = params["byocTrunkSid"]; + if (params["emergencyCallerSid"] !== undefined) + data["EmergencyCallerSid"] = params["emergencyCallerSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DomainInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainContextImpl = DomainContextImpl; +class DomainInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.authType = payload.auth_type; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.domainName = payload.domain_name; + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this.uri = payload.uri; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceStatusCallbackMethod = payload.voice_status_callback_method; + this.voiceStatusCallbackUrl = payload.voice_status_callback_url; + this.voiceUrl = payload.voice_url; + this.subresourceUris = payload.subresource_uris; + this.sipRegistration = payload.sip_registration; + this.emergencyCallingEnabled = payload.emergency_calling_enabled; + this.secure = payload.secure; + this.byocTrunkSid = payload.byoc_trunk_sid; + this.emergencyCallerSid = payload.emergency_caller_sid; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new DomainContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a DomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the auth. + */ + auth() { + return this._proxy.auth; + } + /** + * Access the credentialListMappings. + */ + credentialListMappings() { + return this._proxy.credentialListMappings; + } + /** + * Access the ipAccessControlListMappings. + */ + ipAccessControlListMappings() { + return this._proxy.ipAccessControlListMappings; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + authType: this.authType, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + domainName: this.domainName, + friendlyName: this.friendlyName, + sid: this.sid, + uri: this.uri, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceStatusCallbackMethod: this.voiceStatusCallbackMethod, + voiceStatusCallbackUrl: this.voiceStatusCallbackUrl, + voiceUrl: this.voiceUrl, + subresourceUris: this.subresourceUris, + sipRegistration: this.sipRegistration, + emergencyCallingEnabled: this.emergencyCallingEnabled, + secure: this.secure, + byocTrunkSid: this.byocTrunkSid, + emergencyCallerSid: this.emergencyCallerSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainInstance = DomainInstance; +function DomainListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DomainContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["domainName"] === null || params["domainName"] === undefined) { + throw new Error("Required parameter \"params['domainName']\" missing."); + } + let data = {}; + data["DomainName"] = params["domainName"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceStatusCallbackUrl"] !== undefined) + data["VoiceStatusCallbackUrl"] = params["voiceStatusCallbackUrl"]; + if (params["voiceStatusCallbackMethod"] !== undefined) + data["VoiceStatusCallbackMethod"] = params["voiceStatusCallbackMethod"]; + if (params["sipRegistration"] !== undefined) + data["SipRegistration"] = serialize.bool(params["sipRegistration"]); + if (params["emergencyCallingEnabled"] !== undefined) + data["EmergencyCallingEnabled"] = serialize.bool(params["emergencyCallingEnabled"]); + if (params["secure"] !== undefined) + data["Secure"] = serialize.bool(params["secure"]); + if (params["byocTrunkSid"] !== undefined) + data["ByocTrunkSid"] = params["byocTrunkSid"]; + if (params["emergencyCallerSid"] !== undefined) + data["EmergencyCallerSid"] = params["emergencyCallerSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DomainInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DomainPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DomainPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DomainListInstance = DomainListInstance; +class DomainPage extends Page_1.default { + /** + * Initialize the DomainPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DomainInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DomainInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainPage = DomainPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes.d.ts new file mode 100644 index 00000000..ecdad468 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes.d.ts @@ -0,0 +1,24 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../../V2010"; +import { AuthTypeCallsListInstance } from "./authTypes/authTypeCalls"; +import { AuthTypeRegistrationsListInstance } from "./authTypes/authTypeRegistrations"; +export interface AuthTypesSolution { + accountSid: string; + domainSid: string; +} +export interface AuthTypesListInstance { + _version: V2010; + _solution: AuthTypesSolution; + _uri: string; + _calls?: AuthTypeCallsListInstance; + calls: AuthTypeCallsListInstance; + _registrations?: AuthTypeRegistrationsListInstance; + registrations: AuthTypeRegistrationsListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthTypesListInstance(version: V2010, accountSid: string, domainSid: string): AuthTypesListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes.js new file mode 100644 index 00000000..79e46e0f --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes.js @@ -0,0 +1,58 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthTypesListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +const authTypeCalls_1 = require("./authTypes/authTypeCalls"); +const authTypeRegistrations_1 = require("./authTypes/authTypeRegistrations"); +function AuthTypesListInstance(version, accountSid, domainSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, domainSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth.json`; + Object.defineProperty(instance, "calls", { + get: function calls() { + if (!instance._calls) { + instance._calls = (0, authTypeCalls_1.AuthTypeCallsListInstance)(instance._version, instance._solution.accountSid, instance._solution.domainSid); + } + return instance._calls; + }, + }); + Object.defineProperty(instance, "registrations", { + get: function registrations() { + if (!instance._registrations) { + instance._registrations = (0, authTypeRegistrations_1.AuthTypeRegistrationsListInstance)(instance._version, instance._solution.accountSid, instance._solution.domainSid); + } + return instance._registrations; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthTypesListInstance = AuthTypesListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls.d.ts new file mode 100644 index 00000000..931266cc --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls.d.ts @@ -0,0 +1,24 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../../../V2010"; +import { AuthCallsCredentialListMappingListInstance } from "./authTypeCalls/authCallsCredentialListMapping"; +import { AuthCallsIpAccessControlListMappingListInstance } from "./authTypeCalls/authCallsIpAccessControlListMapping"; +export interface AuthTypeCallsSolution { + accountSid: string; + domainSid: string; +} +export interface AuthTypeCallsListInstance { + _version: V2010; + _solution: AuthTypeCallsSolution; + _uri: string; + _credentialListMappings?: AuthCallsCredentialListMappingListInstance; + credentialListMappings: AuthCallsCredentialListMappingListInstance; + _ipAccessControlListMappings?: AuthCallsIpAccessControlListMappingListInstance; + ipAccessControlListMappings: AuthCallsIpAccessControlListMappingListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthTypeCallsListInstance(version: V2010, accountSid: string, domainSid: string): AuthTypeCallsListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls.js new file mode 100644 index 00000000..0e4790c2 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls.js @@ -0,0 +1,60 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthTypeCallsListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../../../base/deserialize"); +const serialize = require("../../../../../../../base/serialize"); +const utility_1 = require("../../../../../../../base/utility"); +const authCallsCredentialListMapping_1 = require("./authTypeCalls/authCallsCredentialListMapping"); +const authCallsIpAccessControlListMapping_1 = require("./authTypeCalls/authCallsIpAccessControlListMapping"); +function AuthTypeCallsListInstance(version, accountSid, domainSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, domainSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth/Calls.json`; + Object.defineProperty(instance, "credentialListMappings", { + get: function credentialListMappings() { + if (!instance._credentialListMappings) { + instance._credentialListMappings = + (0, authCallsCredentialListMapping_1.AuthCallsCredentialListMappingListInstance)(instance._version, instance._solution.accountSid, instance._solution.domainSid); + } + return instance._credentialListMappings; + }, + }); + Object.defineProperty(instance, "ipAccessControlListMappings", { + get: function ipAccessControlListMappings() { + if (!instance._ipAccessControlListMappings) { + instance._ipAccessControlListMappings = + (0, authCallsIpAccessControlListMapping_1.AuthCallsIpAccessControlListMappingListInstance)(instance._version, instance._solution.accountSid, instance._solution.domainSid); + } + return instance._ipAccessControlListMappings; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthTypeCallsListInstance = AuthTypeCallsListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsCredentialListMapping.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsCredentialListMapping.d.ts new file mode 100644 index 00000000..8cf8f16b --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsCredentialListMapping.d.ts @@ -0,0 +1,248 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../../../base/Page"; +import Response from "../../../../../../../../http/response"; +import V2010 from "../../../../../../V2010"; +/** + * Options to pass to create a AuthCallsCredentialListMappingInstance + */ +export interface AuthCallsCredentialListMappingListInstanceCreateOptions { + /** The SID of the CredentialList resource to map to the SIP domain. */ + credentialListSid: string; +} +/** + * Options to pass to each + */ +export interface AuthCallsCredentialListMappingListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AuthCallsCredentialListMappingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AuthCallsCredentialListMappingListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AuthCallsCredentialListMappingListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AuthCallsCredentialListMappingContext { + /** + * Remove a AuthCallsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AuthCallsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthCallsCredentialListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: AuthCallsCredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AuthCallsCredentialListMappingContextSolution { + accountSid: string; + domainSid: string; + sid: string; +} +export declare class AuthCallsCredentialListMappingContextImpl implements AuthCallsCredentialListMappingContext { + protected _version: V2010; + protected _solution: AuthCallsCredentialListMappingContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, domainSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AuthCallsCredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AuthCallsCredentialListMappingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AuthCallsCredentialListMappingPayload extends TwilioResponsePayload { + contents: AuthCallsCredentialListMappingResource[]; +} +interface AuthCallsCredentialListMappingResource { + account_sid: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + sid: string; +} +export declare class AuthCallsCredentialListMappingInstance { + protected _version: V2010; + protected _solution: AuthCallsCredentialListMappingContextSolution; + protected _context?: AuthCallsCredentialListMappingContext; + constructor(_version: V2010, payload: AuthCallsCredentialListMappingResource, accountSid: string, domainSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource. + */ + accountSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The unique string that that we created to identify the CredentialListMapping resource. + */ + sid: string; + private get _proxy(); + /** + * Remove a AuthCallsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AuthCallsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthCallsCredentialListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: AuthCallsCredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + sid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AuthCallsCredentialListMappingSolution { + accountSid: string; + domainSid: string; +} +export interface AuthCallsCredentialListMappingListInstance { + _version: V2010; + _solution: AuthCallsCredentialListMappingSolution; + _uri: string; + (sid: string): AuthCallsCredentialListMappingContext; + get(sid: string): AuthCallsCredentialListMappingContext; + /** + * Create a AuthCallsCredentialListMappingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthCallsCredentialListMappingInstance + */ + create(params: AuthCallsCredentialListMappingListInstanceCreateOptions, callback?: (error: Error | null, item?: AuthCallsCredentialListMappingInstance) => any): Promise; + /** + * Streams AuthCallsCredentialListMappingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthCallsCredentialListMappingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AuthCallsCredentialListMappingInstance, done: (err?: Error) => void) => void): void; + each(params: AuthCallsCredentialListMappingListInstanceEachOptions, callback?: (item: AuthCallsCredentialListMappingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AuthCallsCredentialListMappingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AuthCallsCredentialListMappingPage) => any): Promise; + /** + * Lists AuthCallsCredentialListMappingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthCallsCredentialListMappingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AuthCallsCredentialListMappingInstance[]) => any): Promise; + list(params: AuthCallsCredentialListMappingListInstanceOptions, callback?: (error: Error | null, items: AuthCallsCredentialListMappingInstance[]) => any): Promise; + /** + * Retrieve a single page of AuthCallsCredentialListMappingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthCallsCredentialListMappingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AuthCallsCredentialListMappingPage) => any): Promise; + page(params: AuthCallsCredentialListMappingListInstancePageOptions, callback?: (error: Error | null, items: AuthCallsCredentialListMappingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthCallsCredentialListMappingListInstance(version: V2010, accountSid: string, domainSid: string): AuthCallsCredentialListMappingListInstance; +export declare class AuthCallsCredentialListMappingPage extends Page { + /** + * Initialize the AuthCallsCredentialListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AuthCallsCredentialListMappingSolution); + /** + * Build an instance of AuthCallsCredentialListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AuthCallsCredentialListMappingResource): AuthCallsCredentialListMappingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsCredentialListMapping.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsCredentialListMapping.js new file mode 100644 index 00000000..d6bb6ccd --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsCredentialListMapping.js @@ -0,0 +1,232 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthCallsCredentialListMappingPage = exports.AuthCallsCredentialListMappingListInstance = exports.AuthCallsCredentialListMappingInstance = exports.AuthCallsCredentialListMappingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../../../base/Page")); +const deserialize = require("../../../../../../../../base/deserialize"); +const serialize = require("../../../../../../../../base/serialize"); +const utility_1 = require("../../../../../../../../base/utility"); +class AuthCallsCredentialListMappingContextImpl { + constructor(_version, accountSid, domainSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, domainSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth/Calls/CredentialListMappings/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AuthCallsCredentialListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthCallsCredentialListMappingContextImpl = AuthCallsCredentialListMappingContextImpl; +class AuthCallsCredentialListMappingInstance { + constructor(_version, payload, accountSid, domainSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this._solution = { accountSid, domainSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AuthCallsCredentialListMappingContextImpl(this._version, this._solution.accountSid, this._solution.domainSid, this._solution.sid); + return this._context; + } + /** + * Remove a AuthCallsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AuthCallsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthCallsCredentialListMappingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + sid: this.sid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthCallsCredentialListMappingInstance = AuthCallsCredentialListMappingInstance; +function AuthCallsCredentialListMappingListInstance(version, accountSid, domainSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AuthCallsCredentialListMappingContextImpl(version, accountSid, domainSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, domainSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth/Calls/CredentialListMappings.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["credentialListSid"] === null || + params["credentialListSid"] === undefined) { + throw new Error("Required parameter \"params['credentialListSid']\" missing."); + } + let data = {}; + data["CredentialListSid"] = params["credentialListSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthCallsCredentialListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthCallsCredentialListMappingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AuthCallsCredentialListMappingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthCallsCredentialListMappingListInstance = AuthCallsCredentialListMappingListInstance; +class AuthCallsCredentialListMappingPage extends Page_1.default { + /** + * Initialize the AuthCallsCredentialListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AuthCallsCredentialListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AuthCallsCredentialListMappingInstance(this._version, payload, this._solution.accountSid, this._solution.domainSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthCallsCredentialListMappingPage = AuthCallsCredentialListMappingPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsIpAccessControlListMapping.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsIpAccessControlListMapping.d.ts new file mode 100644 index 00000000..d9b2f775 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsIpAccessControlListMapping.d.ts @@ -0,0 +1,248 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../../../base/Page"; +import Response from "../../../../../../../../http/response"; +import V2010 from "../../../../../../V2010"; +/** + * Options to pass to create a AuthCallsIpAccessControlListMappingInstance + */ +export interface AuthCallsIpAccessControlListMappingListInstanceCreateOptions { + /** The SID of the IpAccessControlList resource to map to the SIP domain. */ + ipAccessControlListSid: string; +} +/** + * Options to pass to each + */ +export interface AuthCallsIpAccessControlListMappingListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AuthCallsIpAccessControlListMappingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AuthCallsIpAccessControlListMappingListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AuthCallsIpAccessControlListMappingListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AuthCallsIpAccessControlListMappingContext { + /** + * Remove a AuthCallsIpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AuthCallsIpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthCallsIpAccessControlListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: AuthCallsIpAccessControlListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AuthCallsIpAccessControlListMappingContextSolution { + accountSid: string; + domainSid: string; + sid: string; +} +export declare class AuthCallsIpAccessControlListMappingContextImpl implements AuthCallsIpAccessControlListMappingContext { + protected _version: V2010; + protected _solution: AuthCallsIpAccessControlListMappingContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, domainSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AuthCallsIpAccessControlListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AuthCallsIpAccessControlListMappingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AuthCallsIpAccessControlListMappingPayload extends TwilioResponsePayload { + contents: AuthCallsIpAccessControlListMappingResource[]; +} +interface AuthCallsIpAccessControlListMappingResource { + account_sid: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + sid: string; +} +export declare class AuthCallsIpAccessControlListMappingInstance { + protected _version: V2010; + protected _solution: AuthCallsIpAccessControlListMappingContextSolution; + protected _context?: AuthCallsIpAccessControlListMappingContext; + constructor(_version: V2010, payload: AuthCallsIpAccessControlListMappingResource, accountSid: string, domainSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlListMapping resource. + */ + accountSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The unique string that that we created to identify the IpAccessControlListMapping resource. + */ + sid: string; + private get _proxy(); + /** + * Remove a AuthCallsIpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AuthCallsIpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthCallsIpAccessControlListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: AuthCallsIpAccessControlListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + sid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AuthCallsIpAccessControlListMappingSolution { + accountSid: string; + domainSid: string; +} +export interface AuthCallsIpAccessControlListMappingListInstance { + _version: V2010; + _solution: AuthCallsIpAccessControlListMappingSolution; + _uri: string; + (sid: string): AuthCallsIpAccessControlListMappingContext; + get(sid: string): AuthCallsIpAccessControlListMappingContext; + /** + * Create a AuthCallsIpAccessControlListMappingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthCallsIpAccessControlListMappingInstance + */ + create(params: AuthCallsIpAccessControlListMappingListInstanceCreateOptions, callback?: (error: Error | null, item?: AuthCallsIpAccessControlListMappingInstance) => any): Promise; + /** + * Streams AuthCallsIpAccessControlListMappingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthCallsIpAccessControlListMappingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AuthCallsIpAccessControlListMappingInstance, done: (err?: Error) => void) => void): void; + each(params: AuthCallsIpAccessControlListMappingListInstanceEachOptions, callback?: (item: AuthCallsIpAccessControlListMappingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AuthCallsIpAccessControlListMappingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AuthCallsIpAccessControlListMappingPage) => any): Promise; + /** + * Lists AuthCallsIpAccessControlListMappingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthCallsIpAccessControlListMappingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AuthCallsIpAccessControlListMappingInstance[]) => any): Promise; + list(params: AuthCallsIpAccessControlListMappingListInstanceOptions, callback?: (error: Error | null, items: AuthCallsIpAccessControlListMappingInstance[]) => any): Promise; + /** + * Retrieve a single page of AuthCallsIpAccessControlListMappingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthCallsIpAccessControlListMappingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AuthCallsIpAccessControlListMappingPage) => any): Promise; + page(params: AuthCallsIpAccessControlListMappingListInstancePageOptions, callback?: (error: Error | null, items: AuthCallsIpAccessControlListMappingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthCallsIpAccessControlListMappingListInstance(version: V2010, accountSid: string, domainSid: string): AuthCallsIpAccessControlListMappingListInstance; +export declare class AuthCallsIpAccessControlListMappingPage extends Page { + /** + * Initialize the AuthCallsIpAccessControlListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AuthCallsIpAccessControlListMappingSolution); + /** + * Build an instance of AuthCallsIpAccessControlListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AuthCallsIpAccessControlListMappingResource): AuthCallsIpAccessControlListMappingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsIpAccessControlListMapping.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsIpAccessControlListMapping.js new file mode 100644 index 00000000..4e0bf176 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeCalls/authCallsIpAccessControlListMapping.js @@ -0,0 +1,232 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthCallsIpAccessControlListMappingPage = exports.AuthCallsIpAccessControlListMappingListInstance = exports.AuthCallsIpAccessControlListMappingInstance = exports.AuthCallsIpAccessControlListMappingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../../../base/Page")); +const deserialize = require("../../../../../../../../base/deserialize"); +const serialize = require("../../../../../../../../base/serialize"); +const utility_1 = require("../../../../../../../../base/utility"); +class AuthCallsIpAccessControlListMappingContextImpl { + constructor(_version, accountSid, domainSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, domainSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth/Calls/IpAccessControlListMappings/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AuthCallsIpAccessControlListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthCallsIpAccessControlListMappingContextImpl = AuthCallsIpAccessControlListMappingContextImpl; +class AuthCallsIpAccessControlListMappingInstance { + constructor(_version, payload, accountSid, domainSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this._solution = { accountSid, domainSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AuthCallsIpAccessControlListMappingContextImpl(this._version, this._solution.accountSid, this._solution.domainSid, this._solution.sid); + return this._context; + } + /** + * Remove a AuthCallsIpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AuthCallsIpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthCallsIpAccessControlListMappingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + sid: this.sid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthCallsIpAccessControlListMappingInstance = AuthCallsIpAccessControlListMappingInstance; +function AuthCallsIpAccessControlListMappingListInstance(version, accountSid, domainSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AuthCallsIpAccessControlListMappingContextImpl(version, accountSid, domainSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, domainSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth/Calls/IpAccessControlListMappings.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["ipAccessControlListSid"] === null || + params["ipAccessControlListSid"] === undefined) { + throw new Error("Required parameter \"params['ipAccessControlListSid']\" missing."); + } + let data = {}; + data["IpAccessControlListSid"] = params["ipAccessControlListSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthCallsIpAccessControlListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthCallsIpAccessControlListMappingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AuthCallsIpAccessControlListMappingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthCallsIpAccessControlListMappingListInstance = AuthCallsIpAccessControlListMappingListInstance; +class AuthCallsIpAccessControlListMappingPage extends Page_1.default { + /** + * Initialize the AuthCallsIpAccessControlListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AuthCallsIpAccessControlListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AuthCallsIpAccessControlListMappingInstance(this._version, payload, this._solution.accountSid, this._solution.domainSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthCallsIpAccessControlListMappingPage = AuthCallsIpAccessControlListMappingPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations.d.ts new file mode 100644 index 00000000..e8c73e33 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations.d.ts @@ -0,0 +1,21 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../../../../V2010"; +import { AuthRegistrationsCredentialListMappingListInstance } from "./authTypeRegistrations/authRegistrationsCredentialListMapping"; +export interface AuthTypeRegistrationsSolution { + accountSid: string; + domainSid: string; +} +export interface AuthTypeRegistrationsListInstance { + _version: V2010; + _solution: AuthTypeRegistrationsSolution; + _uri: string; + _credentialListMappings?: AuthRegistrationsCredentialListMappingListInstance; + credentialListMappings: AuthRegistrationsCredentialListMappingListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthTypeRegistrationsListInstance(version: V2010, accountSid: string, domainSid: string): AuthTypeRegistrationsListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations.js new file mode 100644 index 00000000..4ac5f64d --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations.js @@ -0,0 +1,50 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthTypeRegistrationsListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../../../base/deserialize"); +const serialize = require("../../../../../../../base/serialize"); +const utility_1 = require("../../../../../../../base/utility"); +const authRegistrationsCredentialListMapping_1 = require("./authTypeRegistrations/authRegistrationsCredentialListMapping"); +function AuthTypeRegistrationsListInstance(version, accountSid, domainSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid, domainSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth/Registrations.json`; + Object.defineProperty(instance, "credentialListMappings", { + get: function credentialListMappings() { + if (!instance._credentialListMappings) { + instance._credentialListMappings = + (0, authRegistrationsCredentialListMapping_1.AuthRegistrationsCredentialListMappingListInstance)(instance._version, instance._solution.accountSid, instance._solution.domainSid); + } + return instance._credentialListMappings; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthTypeRegistrationsListInstance = AuthTypeRegistrationsListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations/authRegistrationsCredentialListMapping.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations/authRegistrationsCredentialListMapping.d.ts new file mode 100644 index 00000000..04ea54ad --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations/authRegistrationsCredentialListMapping.d.ts @@ -0,0 +1,248 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../../../base/Page"; +import Response from "../../../../../../../../http/response"; +import V2010 from "../../../../../../V2010"; +/** + * Options to pass to create a AuthRegistrationsCredentialListMappingInstance + */ +export interface AuthRegistrationsCredentialListMappingListInstanceCreateOptions { + /** The SID of the CredentialList resource to map to the SIP domain. */ + credentialListSid: string; +} +/** + * Options to pass to each + */ +export interface AuthRegistrationsCredentialListMappingListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AuthRegistrationsCredentialListMappingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AuthRegistrationsCredentialListMappingListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AuthRegistrationsCredentialListMappingListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AuthRegistrationsCredentialListMappingContext { + /** + * Remove a AuthRegistrationsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AuthRegistrationsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthRegistrationsCredentialListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: AuthRegistrationsCredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AuthRegistrationsCredentialListMappingContextSolution { + accountSid: string; + domainSid: string; + sid: string; +} +export declare class AuthRegistrationsCredentialListMappingContextImpl implements AuthRegistrationsCredentialListMappingContext { + protected _version: V2010; + protected _solution: AuthRegistrationsCredentialListMappingContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, domainSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AuthRegistrationsCredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AuthRegistrationsCredentialListMappingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AuthRegistrationsCredentialListMappingPayload extends TwilioResponsePayload { + contents: AuthRegistrationsCredentialListMappingResource[]; +} +interface AuthRegistrationsCredentialListMappingResource { + account_sid: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + sid: string; +} +export declare class AuthRegistrationsCredentialListMappingInstance { + protected _version: V2010; + protected _solution: AuthRegistrationsCredentialListMappingContextSolution; + protected _context?: AuthRegistrationsCredentialListMappingContext; + constructor(_version: V2010, payload: AuthRegistrationsCredentialListMappingResource, accountSid: string, domainSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource. + */ + accountSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The unique string that that we created to identify the CredentialListMapping resource. + */ + sid: string; + private get _proxy(); + /** + * Remove a AuthRegistrationsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AuthRegistrationsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthRegistrationsCredentialListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: AuthRegistrationsCredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + sid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AuthRegistrationsCredentialListMappingSolution { + accountSid: string; + domainSid: string; +} +export interface AuthRegistrationsCredentialListMappingListInstance { + _version: V2010; + _solution: AuthRegistrationsCredentialListMappingSolution; + _uri: string; + (sid: string): AuthRegistrationsCredentialListMappingContext; + get(sid: string): AuthRegistrationsCredentialListMappingContext; + /** + * Create a AuthRegistrationsCredentialListMappingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthRegistrationsCredentialListMappingInstance + */ + create(params: AuthRegistrationsCredentialListMappingListInstanceCreateOptions, callback?: (error: Error | null, item?: AuthRegistrationsCredentialListMappingInstance) => any): Promise; + /** + * Streams AuthRegistrationsCredentialListMappingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthRegistrationsCredentialListMappingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AuthRegistrationsCredentialListMappingInstance, done: (err?: Error) => void) => void): void; + each(params: AuthRegistrationsCredentialListMappingListInstanceEachOptions, callback?: (item: AuthRegistrationsCredentialListMappingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AuthRegistrationsCredentialListMappingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AuthRegistrationsCredentialListMappingPage) => any): Promise; + /** + * Lists AuthRegistrationsCredentialListMappingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthRegistrationsCredentialListMappingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AuthRegistrationsCredentialListMappingInstance[]) => any): Promise; + list(params: AuthRegistrationsCredentialListMappingListInstanceOptions, callback?: (error: Error | null, items: AuthRegistrationsCredentialListMappingInstance[]) => any): Promise; + /** + * Retrieve a single page of AuthRegistrationsCredentialListMappingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthRegistrationsCredentialListMappingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AuthRegistrationsCredentialListMappingPage) => any): Promise; + page(params: AuthRegistrationsCredentialListMappingListInstancePageOptions, callback?: (error: Error | null, items: AuthRegistrationsCredentialListMappingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthRegistrationsCredentialListMappingListInstance(version: V2010, accountSid: string, domainSid: string): AuthRegistrationsCredentialListMappingListInstance; +export declare class AuthRegistrationsCredentialListMappingPage extends Page { + /** + * Initialize the AuthRegistrationsCredentialListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AuthRegistrationsCredentialListMappingSolution); + /** + * Build an instance of AuthRegistrationsCredentialListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AuthRegistrationsCredentialListMappingResource): AuthRegistrationsCredentialListMappingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations/authRegistrationsCredentialListMapping.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations/authRegistrationsCredentialListMapping.js new file mode 100644 index 00000000..6ab18fbe --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/authTypes/authTypeRegistrations/authRegistrationsCredentialListMapping.js @@ -0,0 +1,232 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthRegistrationsCredentialListMappingPage = exports.AuthRegistrationsCredentialListMappingListInstance = exports.AuthRegistrationsCredentialListMappingInstance = exports.AuthRegistrationsCredentialListMappingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../../../base/Page")); +const deserialize = require("../../../../../../../../base/deserialize"); +const serialize = require("../../../../../../../../base/serialize"); +const utility_1 = require("../../../../../../../../base/utility"); +class AuthRegistrationsCredentialListMappingContextImpl { + constructor(_version, accountSid, domainSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, domainSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth/Registrations/CredentialListMappings/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AuthRegistrationsCredentialListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthRegistrationsCredentialListMappingContextImpl = AuthRegistrationsCredentialListMappingContextImpl; +class AuthRegistrationsCredentialListMappingInstance { + constructor(_version, payload, accountSid, domainSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this._solution = { accountSid, domainSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AuthRegistrationsCredentialListMappingContextImpl(this._version, this._solution.accountSid, this._solution.domainSid, this._solution.sid); + return this._context; + } + /** + * Remove a AuthRegistrationsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AuthRegistrationsCredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthRegistrationsCredentialListMappingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + sid: this.sid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthRegistrationsCredentialListMappingInstance = AuthRegistrationsCredentialListMappingInstance; +function AuthRegistrationsCredentialListMappingListInstance(version, accountSid, domainSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AuthRegistrationsCredentialListMappingContextImpl(version, accountSid, domainSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, domainSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/Auth/Registrations/CredentialListMappings.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["credentialListSid"] === null || + params["credentialListSid"] === undefined) { + throw new Error("Required parameter \"params['credentialListSid']\" missing."); + } + let data = {}; + data["CredentialListSid"] = params["credentialListSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthRegistrationsCredentialListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthRegistrationsCredentialListMappingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AuthRegistrationsCredentialListMappingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthRegistrationsCredentialListMappingListInstance = AuthRegistrationsCredentialListMappingListInstance; +class AuthRegistrationsCredentialListMappingPage extends Page_1.default { + /** + * Initialize the AuthRegistrationsCredentialListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AuthRegistrationsCredentialListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AuthRegistrationsCredentialListMappingInstance(this._version, payload, this._solution.accountSid, this._solution.domainSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthRegistrationsCredentialListMappingPage = AuthRegistrationsCredentialListMappingPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/credentialListMapping.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/credentialListMapping.d.ts new file mode 100644 index 00000000..5b6910dc --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/credentialListMapping.d.ts @@ -0,0 +1,260 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +/** + * Options to pass to create a CredentialListMappingInstance + */ +export interface CredentialListMappingListInstanceCreateOptions { + /** A 34 character string that uniquely identifies the CredentialList resource to map to the SIP domain. */ + credentialListSid: string; +} +/** + * Options to pass to each + */ +export interface CredentialListMappingListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialListMappingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListMappingListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListMappingListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialListMappingContext { + /** + * Remove a CredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialListMappingContextSolution { + accountSid: string; + domainSid: string; + sid: string; +} +export declare class CredentialListMappingContextImpl implements CredentialListMappingContext { + protected _version: V2010; + protected _solution: CredentialListMappingContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, domainSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialListMappingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialListMappingPayload extends TwilioResponsePayload { + credential_list_mappings: CredentialListMappingResource[]; +} +interface CredentialListMappingResource { + account_sid: string; + date_created: Date; + date_updated: Date; + domain_sid: string; + friendly_name: string; + sid: string; + uri: string; +} +export declare class CredentialListMappingInstance { + protected _version: V2010; + protected _solution: CredentialListMappingContextSolution; + protected _context?: CredentialListMappingContext; + constructor(_version: V2010, payload: CredentialListMappingResource, accountSid: string, domainSid: string, sid?: string); + /** + * The unique id of the Account that is responsible for this resource. + */ + accountSid: string; + /** + * The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateCreated: Date; + /** + * The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateUpdated: Date; + /** + * The unique string that is created to identify the SipDomain resource. + */ + domainSid: string; + /** + * A human readable descriptive text for this resource, up to 64 characters long. + */ + friendlyName: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The URI for this resource, relative to `https://api.twilio.com` + */ + uri: string; + private get _proxy(); + /** + * Remove a CredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + domainSid: string; + friendlyName: string; + sid: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialListMappingSolution { + accountSid: string; + domainSid: string; +} +export interface CredentialListMappingListInstance { + _version: V2010; + _solution: CredentialListMappingSolution; + _uri: string; + (sid: string): CredentialListMappingContext; + get(sid: string): CredentialListMappingContext; + /** + * Create a CredentialListMappingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListMappingInstance + */ + create(params: CredentialListMappingListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialListMappingInstance) => any): Promise; + /** + * Streams CredentialListMappingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListMappingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialListMappingInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListMappingListInstanceEachOptions, callback?: (item: CredentialListMappingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialListMappingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialListMappingPage) => any): Promise; + /** + * Lists CredentialListMappingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListMappingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialListMappingInstance[]) => any): Promise; + list(params: CredentialListMappingListInstanceOptions, callback?: (error: Error | null, items: CredentialListMappingInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialListMappingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListMappingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialListMappingPage) => any): Promise; + page(params: CredentialListMappingListInstancePageOptions, callback?: (error: Error | null, items: CredentialListMappingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListMappingListInstance(version: V2010, accountSid: string, domainSid: string): CredentialListMappingListInstance; +export declare class CredentialListMappingPage extends Page { + /** + * Initialize the CredentialListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: CredentialListMappingSolution); + /** + * Build an instance of CredentialListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialListMappingResource): CredentialListMappingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js new file mode 100644 index 00000000..649186f4 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js @@ -0,0 +1,236 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialListMappingPage = exports.CredentialListMappingListInstance = exports.CredentialListMappingInstance = exports.CredentialListMappingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class CredentialListMappingContextImpl { + constructor(_version, accountSid, domainSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, domainSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/CredentialListMappings/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListMappingContextImpl = CredentialListMappingContextImpl; +class CredentialListMappingInstance { + constructor(_version, payload, accountSid, domainSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.domainSid = payload.domain_sid; + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this.uri = payload.uri; + this._solution = { accountSid, domainSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialListMappingContextImpl(this._version, this._solution.accountSid, this._solution.domainSid, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListMappingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + domainSid: this.domainSid, + friendlyName: this.friendlyName, + sid: this.sid, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListMappingInstance = CredentialListMappingInstance; +function CredentialListMappingListInstance(version, accountSid, domainSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialListMappingContextImpl(version, accountSid, domainSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, domainSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/CredentialListMappings.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["credentialListSid"] === null || + params["credentialListSid"] === undefined) { + throw new Error("Required parameter \"params['credentialListSid']\" missing."); + } + let data = {}; + data["CredentialListSid"] = params["credentialListSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialListMappingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialListMappingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListMappingListInstance = CredentialListMappingListInstance; +class CredentialListMappingPage extends Page_1.default { + /** + * Initialize the CredentialListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialListMappingInstance(this._version, payload, this._solution.accountSid, this._solution.domainSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListMappingPage = CredentialListMappingPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.d.ts new file mode 100644 index 00000000..bbb013c5 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.d.ts @@ -0,0 +1,260 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +/** + * Options to pass to create a IpAccessControlListMappingInstance + */ +export interface IpAccessControlListMappingListInstanceCreateOptions { + /** The unique id of the IP access control list to map to the SIP domain. */ + ipAccessControlListSid: string; +} +/** + * Options to pass to each + */ +export interface IpAccessControlListMappingListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: IpAccessControlListMappingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface IpAccessControlListMappingListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface IpAccessControlListMappingListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface IpAccessControlListMappingContext { + /** + * Remove a IpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: IpAccessControlListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface IpAccessControlListMappingContextSolution { + accountSid: string; + domainSid: string; + sid: string; +} +export declare class IpAccessControlListMappingContextImpl implements IpAccessControlListMappingContext { + protected _version: V2010; + protected _solution: IpAccessControlListMappingContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, domainSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: IpAccessControlListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): IpAccessControlListMappingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface IpAccessControlListMappingPayload extends TwilioResponsePayload { + ip_access_control_list_mappings: IpAccessControlListMappingResource[]; +} +interface IpAccessControlListMappingResource { + account_sid: string; + date_created: Date; + date_updated: Date; + domain_sid: string; + friendly_name: string; + sid: string; + uri: string; +} +export declare class IpAccessControlListMappingInstance { + protected _version: V2010; + protected _solution: IpAccessControlListMappingContextSolution; + protected _context?: IpAccessControlListMappingContext; + constructor(_version: V2010, payload: IpAccessControlListMappingResource, accountSid: string, domainSid: string, sid?: string); + /** + * The unique id of the Account that is responsible for this resource. + */ + accountSid: string; + /** + * The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateCreated: Date; + /** + * The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateUpdated: Date; + /** + * The unique string that is created to identify the SipDomain resource. + */ + domainSid: string; + /** + * A human readable descriptive text for this resource, up to 64 characters long. + */ + friendlyName: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The URI for this resource, relative to `https://api.twilio.com` + */ + uri: string; + private get _proxy(); + /** + * Remove a IpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListMappingInstance + */ + fetch(callback?: (error: Error | null, item?: IpAccessControlListMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + domainSid: string; + friendlyName: string; + sid: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface IpAccessControlListMappingSolution { + accountSid: string; + domainSid: string; +} +export interface IpAccessControlListMappingListInstance { + _version: V2010; + _solution: IpAccessControlListMappingSolution; + _uri: string; + (sid: string): IpAccessControlListMappingContext; + get(sid: string): IpAccessControlListMappingContext; + /** + * Create a IpAccessControlListMappingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListMappingInstance + */ + create(params: IpAccessControlListMappingListInstanceCreateOptions, callback?: (error: Error | null, item?: IpAccessControlListMappingInstance) => any): Promise; + /** + * Streams IpAccessControlListMappingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListMappingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: IpAccessControlListMappingInstance, done: (err?: Error) => void) => void): void; + each(params: IpAccessControlListMappingListInstanceEachOptions, callback?: (item: IpAccessControlListMappingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of IpAccessControlListMappingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: IpAccessControlListMappingPage) => any): Promise; + /** + * Lists IpAccessControlListMappingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListMappingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: IpAccessControlListMappingInstance[]) => any): Promise; + list(params: IpAccessControlListMappingListInstanceOptions, callback?: (error: Error | null, items: IpAccessControlListMappingInstance[]) => any): Promise; + /** + * Retrieve a single page of IpAccessControlListMappingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListMappingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: IpAccessControlListMappingPage) => any): Promise; + page(params: IpAccessControlListMappingListInstancePageOptions, callback?: (error: Error | null, items: IpAccessControlListMappingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function IpAccessControlListMappingListInstance(version: V2010, accountSid: string, domainSid: string): IpAccessControlListMappingListInstance; +export declare class IpAccessControlListMappingPage extends Page { + /** + * Initialize the IpAccessControlListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: IpAccessControlListMappingSolution); + /** + * Build an instance of IpAccessControlListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: IpAccessControlListMappingResource): IpAccessControlListMappingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js new file mode 100644 index 00000000..55302e16 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js @@ -0,0 +1,236 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IpAccessControlListMappingPage = exports.IpAccessControlListMappingListInstance = exports.IpAccessControlListMappingInstance = exports.IpAccessControlListMappingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class IpAccessControlListMappingContextImpl { + constructor(_version, accountSid, domainSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, domainSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/IpAccessControlListMappings/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListMappingContextImpl = IpAccessControlListMappingContextImpl; +class IpAccessControlListMappingInstance { + constructor(_version, payload, accountSid, domainSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.domainSid = payload.domain_sid; + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this.uri = payload.uri; + this._solution = { accountSid, domainSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new IpAccessControlListMappingContextImpl(this._version, this._solution.accountSid, this._solution.domainSid, this._solution.sid); + return this._context; + } + /** + * Remove a IpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a IpAccessControlListMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListMappingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + domainSid: this.domainSid, + friendlyName: this.friendlyName, + sid: this.sid, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListMappingInstance = IpAccessControlListMappingInstance; +function IpAccessControlListMappingListInstance(version, accountSid, domainSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new IpAccessControlListMappingContextImpl(version, accountSid, domainSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, domainSid }; + instance._uri = `/Accounts/${accountSid}/SIP/Domains/${domainSid}/IpAccessControlListMappings.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["ipAccessControlListSid"] === null || + params["ipAccessControlListSid"] === undefined) { + throw new Error("Required parameter \"params['ipAccessControlListSid']\" missing."); + } + let data = {}; + data["IpAccessControlListSid"] = params["ipAccessControlListSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListMappingInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListMappingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new IpAccessControlListMappingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.IpAccessControlListMappingListInstance = IpAccessControlListMappingListInstance; +class IpAccessControlListMappingPage extends Page_1.default { + /** + * Initialize the IpAccessControlListMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of IpAccessControlListMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new IpAccessControlListMappingInstance(this._version, payload, this._solution.accountSid, this._solution.domainSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListMappingPage = IpAccessControlListMappingPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList.d.ts new file mode 100644 index 00000000..c6344fa0 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList.d.ts @@ -0,0 +1,292 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { IpAddressListInstance } from "./ipAccessControlList/ipAddress"; +/** + * Options to pass to update a IpAccessControlListInstance + */ +export interface IpAccessControlListContextUpdateOptions { + /** A human readable descriptive text, up to 255 characters long. */ + friendlyName: string; +} +/** + * Options to pass to create a IpAccessControlListInstance + */ +export interface IpAccessControlListListInstanceCreateOptions { + /** A human readable descriptive text that describes the IpAccessControlList, up to 255 characters long. */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface IpAccessControlListListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: IpAccessControlListInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface IpAccessControlListListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface IpAccessControlListListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface IpAccessControlListContext { + ipAddresses: IpAddressListInstance; + /** + * Remove a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + fetch(callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Update a IpAccessControlListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + update(params: IpAccessControlListContextUpdateOptions, callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface IpAccessControlListContextSolution { + accountSid: string; + sid: string; +} +export declare class IpAccessControlListContextImpl implements IpAccessControlListContext { + protected _version: V2010; + protected _solution: IpAccessControlListContextSolution; + protected _uri: string; + protected _ipAddresses?: IpAddressListInstance; + constructor(_version: V2010, accountSid: string, sid: string); + get ipAddresses(): IpAddressListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + update(params: IpAccessControlListContextUpdateOptions, callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): IpAccessControlListContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface IpAccessControlListPayload extends TwilioResponsePayload { + ip_access_control_lists: IpAccessControlListResource[]; +} +interface IpAccessControlListResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + subresource_uris: Record; + uri: string; +} +export declare class IpAccessControlListInstance { + protected _version: V2010; + protected _solution: IpAccessControlListContextSolution; + protected _context?: IpAccessControlListContext; + constructor(_version: V2010, payload: IpAccessControlListResource, accountSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) that owns this resource. + */ + accountSid: string; + /** + * A human readable descriptive text, up to 255 characters long. + */ + friendlyName: string; + /** + * The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateCreated: Date; + /** + * The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateUpdated: Date; + /** + * A list of the IpAddress resources associated with this IP access control list resource. + */ + subresourceUris: Record; + /** + * The URI for this resource, relative to `https://api.twilio.com` + */ + uri: string; + private get _proxy(); + /** + * Remove a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + fetch(callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Update a IpAccessControlListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + update(params: IpAccessControlListContextUpdateOptions, callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Access the ipAddresses. + */ + ipAddresses(): IpAddressListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + subresourceUris: Record; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface IpAccessControlListSolution { + accountSid: string; +} +export interface IpAccessControlListListInstance { + _version: V2010; + _solution: IpAccessControlListSolution; + _uri: string; + (sid: string): IpAccessControlListContext; + get(sid: string): IpAccessControlListContext; + /** + * Create a IpAccessControlListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + create(params: IpAccessControlListListInstanceCreateOptions, callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Streams IpAccessControlListInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: IpAccessControlListInstance, done: (err?: Error) => void) => void): void; + each(params: IpAccessControlListListInstanceEachOptions, callback?: (item: IpAccessControlListInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of IpAccessControlListInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: IpAccessControlListPage) => any): Promise; + /** + * Lists IpAccessControlListInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: IpAccessControlListInstance[]) => any): Promise; + list(params: IpAccessControlListListInstanceOptions, callback?: (error: Error | null, items: IpAccessControlListInstance[]) => any): Promise; + /** + * Retrieve a single page of IpAccessControlListInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: IpAccessControlListPage) => any): Promise; + page(params: IpAccessControlListListInstancePageOptions, callback?: (error: Error | null, items: IpAccessControlListPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function IpAccessControlListListInstance(version: V2010, accountSid: string): IpAccessControlListListInstance; +export declare class IpAccessControlListPage extends Page { + /** + * Initialize the IpAccessControlListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: IpAccessControlListSolution); + /** + * Build an instance of IpAccessControlListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: IpAccessControlListResource): IpAccessControlListInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList.js new file mode 100644 index 00000000..f30bb02b --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList.js @@ -0,0 +1,269 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IpAccessControlListPage = exports.IpAccessControlListListInstance = exports.IpAccessControlListInstance = exports.IpAccessControlListContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const ipAddress_1 = require("./ipAccessControlList/ipAddress"); +class IpAccessControlListContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/IpAccessControlLists/${sid}.json`; + } + get ipAddresses() { + this._ipAddresses = + this._ipAddresses || + (0, ipAddress_1.IpAddressListInstance)(this._version, this._solution.accountSid, this._solution.sid); + return this._ipAddresses; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListContextImpl = IpAccessControlListContextImpl; +class IpAccessControlListInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new IpAccessControlListContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the ipAddresses. + */ + ipAddresses() { + return this._proxy.ipAddresses; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + subresourceUris: this.subresourceUris, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListInstance = IpAccessControlListInstance; +function IpAccessControlListListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new IpAccessControlListContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/SIP/IpAccessControlLists.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new IpAccessControlListPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.IpAccessControlListListInstance = IpAccessControlListListInstance; +class IpAccessControlListPage extends Page_1.default { + /** + * Initialize the IpAccessControlListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of IpAccessControlListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new IpAccessControlListInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListPage = IpAccessControlListPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.d.ts new file mode 100644 index 00000000..4bc0d397 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +/** + * Options to pass to update a IpAddressInstance + */ +export interface IpAddressContextUpdateOptions { + /** An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. */ + ipAddress?: string; + /** A human readable descriptive text for this resource, up to 255 characters long. */ + friendlyName?: string; + /** An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. */ + cidrPrefixLength?: number; +} +/** + * Options to pass to create a IpAddressInstance + */ +export interface IpAddressListInstanceCreateOptions { + /** A human readable descriptive text for this resource, up to 255 characters long. */ + friendlyName: string; + /** An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. */ + ipAddress: string; + /** An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. */ + cidrPrefixLength?: number; +} +/** + * Options to pass to each + */ +export interface IpAddressListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: IpAddressInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface IpAddressListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface IpAddressListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface IpAddressContext { + /** + * Remove a IpAddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpAddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAddressInstance + */ + fetch(callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + /** + * Update a IpAddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAddressInstance + */ + update(callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + /** + * Update a IpAddressInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAddressInstance + */ + update(params: IpAddressContextUpdateOptions, callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface IpAddressContextSolution { + accountSid: string; + ipAccessControlListSid: string; + sid: string; +} +export declare class IpAddressContextImpl implements IpAddressContext { + protected _version: V2010; + protected _solution: IpAddressContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, ipAccessControlListSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + update(params?: IpAddressContextUpdateOptions | ((error: Error | null, item?: IpAddressInstance) => any), callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): IpAddressContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface IpAddressPayload extends TwilioResponsePayload { + ip_addresses: IpAddressResource[]; +} +interface IpAddressResource { + sid: string; + account_sid: string; + friendly_name: string; + ip_address: string; + cidr_prefix_length: number; + ip_access_control_list_sid: string; + date_created: Date; + date_updated: Date; + uri: string; +} +export declare class IpAddressInstance { + protected _version: V2010; + protected _solution: IpAddressContextSolution; + protected _context?: IpAddressContext; + constructor(_version: V2010, payload: IpAddressResource, accountSid: string, ipAccessControlListSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The unique id of the Account that is responsible for this resource. + */ + accountSid: string; + /** + * A human readable descriptive text for this resource, up to 255 characters long. + */ + friendlyName: string; + /** + * An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + */ + ipAddress: string; + /** + * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + */ + cidrPrefixLength: number; + /** + * The unique id of the IpAccessControlList resource that includes this resource. + */ + ipAccessControlListSid: string; + /** + * The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateCreated: Date; + /** + * The date that this resource was last updated, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. + */ + dateUpdated: Date; + /** + * The URI for this resource, relative to `https://api.twilio.com` + */ + uri: string; + private get _proxy(); + /** + * Remove a IpAddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpAddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAddressInstance + */ + fetch(callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + /** + * Update a IpAddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAddressInstance + */ + update(callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + /** + * Update a IpAddressInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAddressInstance + */ + update(params: IpAddressContextUpdateOptions, callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + ipAddress: string; + cidrPrefixLength: number; + ipAccessControlListSid: string; + dateCreated: Date; + dateUpdated: Date; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface IpAddressSolution { + accountSid: string; + ipAccessControlListSid: string; +} +export interface IpAddressListInstance { + _version: V2010; + _solution: IpAddressSolution; + _uri: string; + (sid: string): IpAddressContext; + get(sid: string): IpAddressContext; + /** + * Create a IpAddressInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAddressInstance + */ + create(params: IpAddressListInstanceCreateOptions, callback?: (error: Error | null, item?: IpAddressInstance) => any): Promise; + /** + * Streams IpAddressInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAddressListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: IpAddressInstance, done: (err?: Error) => void) => void): void; + each(params: IpAddressListInstanceEachOptions, callback?: (item: IpAddressInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of IpAddressInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: IpAddressPage) => any): Promise; + /** + * Lists IpAddressInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAddressListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: IpAddressInstance[]) => any): Promise; + list(params: IpAddressListInstanceOptions, callback?: (error: Error | null, items: IpAddressInstance[]) => any): Promise; + /** + * Retrieve a single page of IpAddressInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAddressListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: IpAddressPage) => any): Promise; + page(params: IpAddressListInstancePageOptions, callback?: (error: Error | null, items: IpAddressPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function IpAddressListInstance(version: V2010, accountSid: string, ipAccessControlListSid: string): IpAddressListInstance; +export declare class IpAddressPage extends Page { + /** + * Initialize the IpAddressPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: IpAddressSolution); + /** + * Build an instance of IpAddressInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: IpAddressResource): IpAddressInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js b/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js new file mode 100644 index 00000000..1e74839e --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js @@ -0,0 +1,281 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IpAddressPage = exports.IpAddressListInstance = exports.IpAddressInstance = exports.IpAddressContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class IpAddressContextImpl { + constructor(_version, accountSid, ipAccessControlListSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(ipAccessControlListSid)) { + throw new Error("Parameter 'ipAccessControlListSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, ipAccessControlListSid, sid }; + this._uri = `/Accounts/${accountSid}/SIP/IpAccessControlLists/${ipAccessControlListSid}/IpAddresses/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new IpAddressInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.ipAccessControlListSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["ipAddress"] !== undefined) + data["IpAddress"] = params["ipAddress"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["cidrPrefixLength"] !== undefined) + data["CidrPrefixLength"] = params["cidrPrefixLength"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAddressInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.ipAccessControlListSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAddressContextImpl = IpAddressContextImpl; +class IpAddressInstance { + constructor(_version, payload, accountSid, ipAccessControlListSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.ipAddress = payload.ip_address; + this.cidrPrefixLength = deserialize.integer(payload.cidr_prefix_length); + this.ipAccessControlListSid = payload.ip_access_control_list_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.uri = payload.uri; + this._solution = { + accountSid, + ipAccessControlListSid, + sid: sid || this.sid, + }; + } + get _proxy() { + this._context = + this._context || + new IpAddressContextImpl(this._version, this._solution.accountSid, this._solution.ipAccessControlListSid, this._solution.sid); + return this._context; + } + /** + * Remove a IpAddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a IpAddressInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAddressInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + ipAddress: this.ipAddress, + cidrPrefixLength: this.cidrPrefixLength, + ipAccessControlListSid: this.ipAccessControlListSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAddressInstance = IpAddressInstance; +function IpAddressListInstance(version, accountSid, ipAccessControlListSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(ipAccessControlListSid)) { + throw new Error("Parameter 'ipAccessControlListSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new IpAddressContextImpl(version, accountSid, ipAccessControlListSid, sid); + }; + instance._version = version; + instance._solution = { accountSid, ipAccessControlListSid }; + instance._uri = `/Accounts/${accountSid}/SIP/IpAccessControlLists/${ipAccessControlListSid}/IpAddresses.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["ipAddress"] === null || params["ipAddress"] === undefined) { + throw new Error("Required parameter \"params['ipAddress']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["IpAddress"] = params["ipAddress"]; + if (params["cidrPrefixLength"] !== undefined) + data["CidrPrefixLength"] = params["cidrPrefixLength"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAddressInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.ipAccessControlListSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAddressPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new IpAddressPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.IpAddressListInstance = IpAddressListInstance; +class IpAddressPage extends Page_1.default { + /** + * Initialize the IpAddressPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of IpAddressInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new IpAddressInstance(this._version, payload, this._solution.accountSid, this._solution.ipAccessControlListSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAddressPage = IpAddressPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/token.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/token.d.ts new file mode 100644 index 00000000..1498255c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/token.d.ts @@ -0,0 +1,104 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../V2010"; +export declare class ApiV2010AccountTokenIceServers { + "credential"?: string; + "username"?: string; + "url"?: string; + "urls"?: string; +} +/** + * Options to pass to create a TokenInstance + */ +export interface TokenListInstanceCreateOptions { + /** The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). */ + ttl?: number; +} +export interface TokenSolution { + accountSid: string; +} +export interface TokenListInstance { + _version: V2010; + _solution: TokenSolution; + _uri: string; + /** + * Create a TokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TokenInstance + */ + create(callback?: (error: Error | null, item?: TokenInstance) => any): Promise; + /** + * Create a TokenInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TokenInstance + */ + create(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: TokenInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TokenListInstance(version: V2010, accountSid: string): TokenListInstance; +interface TokenResource { + account_sid: string; + date_created: Date; + date_updated: Date; + ice_servers: Array; + password: string; + ttl: string; + username: string; +} +export declare class TokenInstance { + protected _version: V2010; + constructor(_version: V2010, payload: TokenResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Token resource. + */ + accountSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * An array representing the ephemeral credentials and the STUN and TURN server URIs. + */ + iceServers: Array; + /** + * The temporary password that the username will use when authenticating with Twilio. + */ + password: string; + /** + * The duration in seconds for which the username and password are valid. + */ + ttl: string; + /** + * The temporary username that uniquely identifies a Token. + */ + username: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + iceServers: ApiV2010AccountTokenIceServers[]; + password: string; + ttl: string; + username: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/token.js b/node_modules/twilio/lib/rest/api/v2010/account/token.js new file mode 100644 index 00000000..5973d958 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/token.js @@ -0,0 +1,95 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TokenInstance = exports.TokenListInstance = exports.ApiV2010AccountTokenIceServers = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ApiV2010AccountTokenIceServers { +} +exports.ApiV2010AccountTokenIceServers = ApiV2010AccountTokenIceServers; +function TokenListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Tokens.json`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TokenInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TokenListInstance = TokenListInstance; +class TokenInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.iceServers = payload.ice_servers; + this.password = payload.password; + this.ttl = payload.ttl; + this.username = payload.username; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + iceServers: this.iceServers, + password: this.password, + ttl: this.ttl, + username: this.username, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TokenInstance = TokenInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/transcription.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/transcription.d.ts new file mode 100644 index 00000000..ba1c28dc --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/transcription.d.ts @@ -0,0 +1,276 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2010 from "../../V2010"; +export type TranscriptionStatus = "in-progress" | "completed" | "failed"; +/** + * Options to pass to each + */ +export interface TranscriptionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TranscriptionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TranscriptionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TranscriptionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TranscriptionContext { + /** + * Remove a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptionInstance + */ + fetch(callback?: (error: Error | null, item?: TranscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TranscriptionContextSolution { + accountSid: string; + sid: string; +} +export declare class TranscriptionContextImpl implements TranscriptionContext { + protected _version: V2010; + protected _solution: TranscriptionContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TranscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TranscriptionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TranscriptionPayload extends TwilioResponsePayload { + transcriptions: TranscriptionResource[]; +} +interface TranscriptionResource { + account_sid: string; + api_version: string; + date_created: Date; + date_updated: Date; + duration: string; + price: number; + price_unit: string; + recording_sid: string; + sid: string; + status: TranscriptionStatus; + transcription_text: string; + type: string; + uri: string; +} +export declare class TranscriptionInstance { + protected _version: V2010; + protected _solution: TranscriptionContextSolution; + protected _context?: TranscriptionContext; + constructor(_version: V2010, payload: TranscriptionResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resource. + */ + accountSid: string; + /** + * The API version used to create the transcription. + */ + apiVersion: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The duration of the transcribed audio in seconds. + */ + duration: string; + /** + * The charge for the transcript in the currency associated with the account. This value is populated after the transcript is complete so it may not be available immediately. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) from which the transcription was created. + */ + recordingSid: string; + /** + * The unique string that that we created to identify the Transcription resource. + */ + sid: string; + status: TranscriptionStatus; + /** + * The text content of the transcription. + */ + transcriptionText: string; + /** + * The transcription type. Can only be: `fast`. + */ + type: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + private get _proxy(); + /** + * Remove a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptionInstance + */ + fetch(callback?: (error: Error | null, item?: TranscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + dateCreated: Date; + dateUpdated: Date; + duration: string; + price: number; + priceUnit: string; + recordingSid: string; + sid: string; + status: TranscriptionStatus; + transcriptionText: string; + type: string; + uri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TranscriptionSolution { + accountSid: string; +} +export interface TranscriptionListInstance { + _version: V2010; + _solution: TranscriptionSolution; + _uri: string; + (sid: string): TranscriptionContext; + get(sid: string): TranscriptionContext; + /** + * Streams TranscriptionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TranscriptionInstance, done: (err?: Error) => void) => void): void; + each(params: TranscriptionListInstanceEachOptions, callback?: (item: TranscriptionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TranscriptionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TranscriptionPage) => any): Promise; + /** + * Lists TranscriptionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TranscriptionInstance[]) => any): Promise; + list(params: TranscriptionListInstanceOptions, callback?: (error: Error | null, items: TranscriptionInstance[]) => any): Promise; + /** + * Retrieve a single page of TranscriptionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TranscriptionPage) => any): Promise; + page(params: TranscriptionListInstancePageOptions, callback?: (error: Error | null, items: TranscriptionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TranscriptionListInstance(version: V2010, accountSid: string): TranscriptionListInstance; +export declare class TranscriptionPage extends Page { + /** + * Initialize the TranscriptionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: TranscriptionSolution); + /** + * Build an instance of TranscriptionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TranscriptionResource): TranscriptionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/transcription.js b/node_modules/twilio/lib/rest/api/v2010/account/transcription.js new file mode 100644 index 00000000..5445b3b2 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/transcription.js @@ -0,0 +1,220 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TranscriptionPage = exports.TranscriptionListInstance = exports.TranscriptionInstance = exports.TranscriptionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class TranscriptionContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Transcriptions/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TranscriptionInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptionContextImpl = TranscriptionContextImpl; +class TranscriptionInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.duration = payload.duration; + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.recordingSid = payload.recording_sid; + this.sid = payload.sid; + this.status = payload.status; + this.transcriptionText = payload.transcription_text; + this.type = payload.type; + this.uri = payload.uri; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TranscriptionContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TranscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + duration: this.duration, + price: this.price, + priceUnit: this.priceUnit, + recordingSid: this.recordingSid, + sid: this.sid, + status: this.status, + transcriptionText: this.transcriptionText, + type: this.type, + uri: this.uri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptionInstance = TranscriptionInstance; +function TranscriptionListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TranscriptionContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Transcriptions.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TranscriptionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TranscriptionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TranscriptionListInstance = TranscriptionListInstance; +class TranscriptionPage extends Page_1.default { + /** + * Initialize the TranscriptionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TranscriptionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TranscriptionInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptionPage = TranscriptionPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage.d.ts new file mode 100644 index 00000000..1cfa3ed4 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage.d.ts @@ -0,0 +1,24 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../V2010"; +import { RecordListInstance } from "./usage/record"; +import { TriggerListInstance } from "./usage/trigger"; +export type UsageCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +export interface UsageSolution { + accountSid: string; +} +export interface UsageListInstance { + _version: V2010; + _solution: UsageSolution; + _uri: string; + _records?: RecordListInstance; + records: RecordListInstance; + _triggers?: TriggerListInstance; + triggers: TriggerListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UsageListInstance(version: V2010, accountSid: string): UsageListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage.js b/node_modules/twilio/lib/rest/api/v2010/account/usage.js new file mode 100644 index 00000000..41317319 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage.js @@ -0,0 +1,55 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsageListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const record_1 = require("./usage/record"); +const trigger_1 = require("./usage/trigger"); +function UsageListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage.json`; + Object.defineProperty(instance, "records", { + get: function records() { + if (!instance._records) { + instance._records = (0, record_1.RecordListInstance)(instance._version, instance._solution.accountSid); + } + return instance._records; + }, + }); + Object.defineProperty(instance, "triggers", { + get: function triggers() { + if (!instance._triggers) { + instance._triggers = (0, trigger_1.TriggerListInstance)(instance._version, instance._solution.accountSid); + } + return instance._triggers; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UsageListInstance = UsageListInstance; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record.d.ts new file mode 100644 index 00000000..c453a221 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record.d.ts @@ -0,0 +1,273 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +import { AllTimeListInstance } from "./record/allTime"; +import { DailyListInstance } from "./record/daily"; +import { LastMonthListInstance } from "./record/lastMonth"; +import { MonthlyListInstance } from "./record/monthly"; +import { ThisMonthListInstance } from "./record/thisMonth"; +import { TodayListInstance } from "./record/today"; +import { YearlyListInstance } from "./record/yearly"; +import { YesterdayListInstance } from "./record/yesterday"; +export type RecordCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface RecordListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: RecordCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RecordInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RecordListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: RecordCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RecordListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: RecordCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RecordSolution { + accountSid: string; +} +export interface RecordListInstance { + _version: V2010; + _solution: RecordSolution; + _uri: string; + _allTime?: AllTimeListInstance; + allTime: AllTimeListInstance; + _daily?: DailyListInstance; + daily: DailyListInstance; + _lastMonth?: LastMonthListInstance; + lastMonth: LastMonthListInstance; + _monthly?: MonthlyListInstance; + monthly: MonthlyListInstance; + _thisMonth?: ThisMonthListInstance; + thisMonth: ThisMonthListInstance; + _today?: TodayListInstance; + today: TodayListInstance; + _yearly?: YearlyListInstance; + yearly: YearlyListInstance; + _yesterday?: YesterdayListInstance; + yesterday: YesterdayListInstance; + /** + * Streams RecordInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RecordInstance, done: (err?: Error) => void) => void): void; + each(params: RecordListInstanceEachOptions, callback?: (item: RecordInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RecordInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RecordPage) => any): Promise; + /** + * Lists RecordInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RecordInstance[]) => any): Promise; + list(params: RecordListInstanceOptions, callback?: (error: Error | null, items: RecordInstance[]) => any): Promise; + /** + * Retrieve a single page of RecordInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RecordPage) => any): Promise; + page(params: RecordListInstancePageOptions, callback?: (error: Error | null, items: RecordPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RecordListInstance(version: V2010, accountSid: string): RecordListInstance; +interface RecordPayload extends TwilioResponsePayload { + usage_records: RecordResource[]; +} +interface RecordResource { + account_sid: string; + api_version: string; + as_of: string; + category: RecordCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class RecordInstance { + protected _version: V2010; + constructor(_version: V2010, payload: RecordResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: RecordCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: RecordCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class RecordPage extends Page { + /** + * Initialize the RecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: RecordSolution); + /** + * Build an instance of RecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RecordResource): RecordInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record.js new file mode 100644 index 00000000..3f39db1d --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record.js @@ -0,0 +1,230 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RecordPage = exports.RecordInstance = exports.RecordListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const allTime_1 = require("./record/allTime"); +const daily_1 = require("./record/daily"); +const lastMonth_1 = require("./record/lastMonth"); +const monthly_1 = require("./record/monthly"); +const thisMonth_1 = require("./record/thisMonth"); +const today_1 = require("./record/today"); +const yearly_1 = require("./record/yearly"); +const yesterday_1 = require("./record/yesterday"); +function RecordListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records.json`; + Object.defineProperty(instance, "allTime", { + get: function allTime() { + if (!instance._allTime) { + instance._allTime = (0, allTime_1.AllTimeListInstance)(instance._version, instance._solution.accountSid); + } + return instance._allTime; + }, + }); + Object.defineProperty(instance, "daily", { + get: function daily() { + if (!instance._daily) { + instance._daily = (0, daily_1.DailyListInstance)(instance._version, instance._solution.accountSid); + } + return instance._daily; + }, + }); + Object.defineProperty(instance, "lastMonth", { + get: function lastMonth() { + if (!instance._lastMonth) { + instance._lastMonth = (0, lastMonth_1.LastMonthListInstance)(instance._version, instance._solution.accountSid); + } + return instance._lastMonth; + }, + }); + Object.defineProperty(instance, "monthly", { + get: function monthly() { + if (!instance._monthly) { + instance._monthly = (0, monthly_1.MonthlyListInstance)(instance._version, instance._solution.accountSid); + } + return instance._monthly; + }, + }); + Object.defineProperty(instance, "thisMonth", { + get: function thisMonth() { + if (!instance._thisMonth) { + instance._thisMonth = (0, thisMonth_1.ThisMonthListInstance)(instance._version, instance._solution.accountSid); + } + return instance._thisMonth; + }, + }); + Object.defineProperty(instance, "today", { + get: function today() { + if (!instance._today) { + instance._today = (0, today_1.TodayListInstance)(instance._version, instance._solution.accountSid); + } + return instance._today; + }, + }); + Object.defineProperty(instance, "yearly", { + get: function yearly() { + if (!instance._yearly) { + instance._yearly = (0, yearly_1.YearlyListInstance)(instance._version, instance._solution.accountSid); + } + return instance._yearly; + }, + }); + Object.defineProperty(instance, "yesterday", { + get: function yesterday() { + if (!instance._yesterday) { + instance._yesterday = (0, yesterday_1.YesterdayListInstance)(instance._version, instance._solution.accountSid); + } + return instance._yesterday; + }, + }); + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RecordPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RecordListInstance = RecordListInstance; +class RecordInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordInstance = RecordInstance; +class RecordPage extends Page_1.default { + /** + * Initialize the RecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RecordInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordPage = RecordPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/allTime.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/allTime.d.ts new file mode 100644 index 00000000..db6ccdba --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/allTime.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +export type AllTimeCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface AllTimeListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: AllTimeCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AllTimeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AllTimeListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: AllTimeCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AllTimeListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: AllTimeCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AllTimeSolution { + accountSid: string; +} +export interface AllTimeListInstance { + _version: V2010; + _solution: AllTimeSolution; + _uri: string; + /** + * Streams AllTimeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AllTimeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AllTimeInstance, done: (err?: Error) => void) => void): void; + each(params: AllTimeListInstanceEachOptions, callback?: (item: AllTimeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AllTimeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AllTimePage) => any): Promise; + /** + * Lists AllTimeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AllTimeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AllTimeInstance[]) => any): Promise; + list(params: AllTimeListInstanceOptions, callback?: (error: Error | null, items: AllTimeInstance[]) => any): Promise; + /** + * Retrieve a single page of AllTimeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AllTimeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AllTimePage) => any): Promise; + page(params: AllTimeListInstancePageOptions, callback?: (error: Error | null, items: AllTimePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AllTimeListInstance(version: V2010, accountSid: string): AllTimeListInstance; +interface AllTimePayload extends TwilioResponsePayload { + usage_records: AllTimeResource[]; +} +interface AllTimeResource { + account_sid: string; + api_version: string; + as_of: string; + category: AllTimeCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class AllTimeInstance { + protected _version: V2010; + constructor(_version: V2010, payload: AllTimeResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: AllTimeCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: AllTimeCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class AllTimePage extends Page { + /** + * Initialize the AllTimePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: AllTimeSolution); + /** + * Build an instance of AllTimeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AllTimeResource): AllTimeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/allTime.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/allTime.js new file mode 100644 index 00000000..939a0a73 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/allTime.js @@ -0,0 +1,158 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AllTimePage = exports.AllTimeInstance = exports.AllTimeListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function AllTimeListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records/AllTime.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AllTimePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AllTimePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AllTimeListInstance = AllTimeListInstance; +class AllTimeInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AllTimeInstance = AllTimeInstance; +class AllTimePage extends Page_1.default { + /** + * Initialize the AllTimePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AllTimeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AllTimeInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AllTimePage = AllTimePage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/daily.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/daily.d.ts new file mode 100644 index 00000000..beb357fd --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/daily.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +export type DailyCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface DailyListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: DailyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DailyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DailyListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: DailyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DailyListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: DailyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DailySolution { + accountSid: string; +} +export interface DailyListInstance { + _version: V2010; + _solution: DailySolution; + _uri: string; + /** + * Streams DailyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DailyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DailyInstance, done: (err?: Error) => void) => void): void; + each(params: DailyListInstanceEachOptions, callback?: (item: DailyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DailyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DailyPage) => any): Promise; + /** + * Lists DailyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DailyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DailyInstance[]) => any): Promise; + list(params: DailyListInstanceOptions, callback?: (error: Error | null, items: DailyInstance[]) => any): Promise; + /** + * Retrieve a single page of DailyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DailyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DailyPage) => any): Promise; + page(params: DailyListInstancePageOptions, callback?: (error: Error | null, items: DailyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DailyListInstance(version: V2010, accountSid: string): DailyListInstance; +interface DailyPayload extends TwilioResponsePayload { + usage_records: DailyResource[]; +} +interface DailyResource { + account_sid: string; + api_version: string; + as_of: string; + category: DailyCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class DailyInstance { + protected _version: V2010; + constructor(_version: V2010, payload: DailyResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: DailyCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: DailyCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class DailyPage extends Page { + /** + * Initialize the DailyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: DailySolution); + /** + * Build an instance of DailyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DailyResource): DailyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/daily.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/daily.js new file mode 100644 index 00000000..a9357f52 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/daily.js @@ -0,0 +1,158 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DailyPage = exports.DailyInstance = exports.DailyListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function DailyListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records/Daily.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DailyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DailyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DailyListInstance = DailyListInstance; +class DailyInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DailyInstance = DailyInstance; +class DailyPage extends Page_1.default { + /** + * Initialize the DailyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DailyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DailyInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DailyPage = DailyPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts new file mode 100644 index 00000000..4cb30272 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +export type LastMonthCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface LastMonthListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: LastMonthCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: LastMonthInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface LastMonthListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: LastMonthCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface LastMonthListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: LastMonthCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface LastMonthSolution { + accountSid: string; +} +export interface LastMonthListInstance { + _version: V2010; + _solution: LastMonthSolution; + _uri: string; + /** + * Streams LastMonthInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LastMonthListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: LastMonthInstance, done: (err?: Error) => void) => void): void; + each(params: LastMonthListInstanceEachOptions, callback?: (item: LastMonthInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of LastMonthInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: LastMonthPage) => any): Promise; + /** + * Lists LastMonthInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LastMonthListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: LastMonthInstance[]) => any): Promise; + list(params: LastMonthListInstanceOptions, callback?: (error: Error | null, items: LastMonthInstance[]) => any): Promise; + /** + * Retrieve a single page of LastMonthInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LastMonthListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: LastMonthPage) => any): Promise; + page(params: LastMonthListInstancePageOptions, callback?: (error: Error | null, items: LastMonthPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function LastMonthListInstance(version: V2010, accountSid: string): LastMonthListInstance; +interface LastMonthPayload extends TwilioResponsePayload { + usage_records: LastMonthResource[]; +} +interface LastMonthResource { + account_sid: string; + api_version: string; + as_of: string; + category: LastMonthCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class LastMonthInstance { + protected _version: V2010; + constructor(_version: V2010, payload: LastMonthResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: LastMonthCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: LastMonthCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class LastMonthPage extends Page { + /** + * Initialize the LastMonthPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: LastMonthSolution); + /** + * Build an instance of LastMonthInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: LastMonthResource): LastMonthInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/lastMonth.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/lastMonth.js new file mode 100644 index 00000000..cee6333c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/lastMonth.js @@ -0,0 +1,158 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LastMonthPage = exports.LastMonthInstance = exports.LastMonthListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function LastMonthListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records/LastMonth.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new LastMonthPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new LastMonthPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.LastMonthListInstance = LastMonthListInstance; +class LastMonthInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LastMonthInstance = LastMonthInstance; +class LastMonthPage extends Page_1.default { + /** + * Initialize the LastMonthPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of LastMonthInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new LastMonthInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LastMonthPage = LastMonthPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/monthly.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/monthly.d.ts new file mode 100644 index 00000000..76051b41 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/monthly.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +export type MonthlyCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface MonthlyListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: MonthlyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MonthlyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MonthlyListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: MonthlyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MonthlyListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: MonthlyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MonthlySolution { + accountSid: string; +} +export interface MonthlyListInstance { + _version: V2010; + _solution: MonthlySolution; + _uri: string; + /** + * Streams MonthlyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MonthlyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MonthlyInstance, done: (err?: Error) => void) => void): void; + each(params: MonthlyListInstanceEachOptions, callback?: (item: MonthlyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MonthlyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MonthlyPage) => any): Promise; + /** + * Lists MonthlyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MonthlyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MonthlyInstance[]) => any): Promise; + list(params: MonthlyListInstanceOptions, callback?: (error: Error | null, items: MonthlyInstance[]) => any): Promise; + /** + * Retrieve a single page of MonthlyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MonthlyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MonthlyPage) => any): Promise; + page(params: MonthlyListInstancePageOptions, callback?: (error: Error | null, items: MonthlyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MonthlyListInstance(version: V2010, accountSid: string): MonthlyListInstance; +interface MonthlyPayload extends TwilioResponsePayload { + usage_records: MonthlyResource[]; +} +interface MonthlyResource { + account_sid: string; + api_version: string; + as_of: string; + category: MonthlyCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class MonthlyInstance { + protected _version: V2010; + constructor(_version: V2010, payload: MonthlyResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: MonthlyCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: MonthlyCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class MonthlyPage extends Page { + /** + * Initialize the MonthlyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: MonthlySolution); + /** + * Build an instance of MonthlyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MonthlyResource): MonthlyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/monthly.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/monthly.js new file mode 100644 index 00000000..b76bac2e --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/monthly.js @@ -0,0 +1,158 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MonthlyPage = exports.MonthlyInstance = exports.MonthlyListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function MonthlyListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records/Monthly.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MonthlyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MonthlyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MonthlyListInstance = MonthlyListInstance; +class MonthlyInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MonthlyInstance = MonthlyInstance; +class MonthlyPage extends Page_1.default { + /** + * Initialize the MonthlyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MonthlyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MonthlyInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MonthlyPage = MonthlyPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts new file mode 100644 index 00000000..7b914191 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +export type ThisMonthCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface ThisMonthListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: ThisMonthCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ThisMonthInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ThisMonthListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: ThisMonthCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ThisMonthListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: ThisMonthCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ThisMonthSolution { + accountSid: string; +} +export interface ThisMonthListInstance { + _version: V2010; + _solution: ThisMonthSolution; + _uri: string; + /** + * Streams ThisMonthInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ThisMonthListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ThisMonthInstance, done: (err?: Error) => void) => void): void; + each(params: ThisMonthListInstanceEachOptions, callback?: (item: ThisMonthInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ThisMonthInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ThisMonthPage) => any): Promise; + /** + * Lists ThisMonthInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ThisMonthListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ThisMonthInstance[]) => any): Promise; + list(params: ThisMonthListInstanceOptions, callback?: (error: Error | null, items: ThisMonthInstance[]) => any): Promise; + /** + * Retrieve a single page of ThisMonthInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ThisMonthListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ThisMonthPage) => any): Promise; + page(params: ThisMonthListInstancePageOptions, callback?: (error: Error | null, items: ThisMonthPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ThisMonthListInstance(version: V2010, accountSid: string): ThisMonthListInstance; +interface ThisMonthPayload extends TwilioResponsePayload { + usage_records: ThisMonthResource[]; +} +interface ThisMonthResource { + account_sid: string; + api_version: string; + as_of: string; + category: ThisMonthCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class ThisMonthInstance { + protected _version: V2010; + constructor(_version: V2010, payload: ThisMonthResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: ThisMonthCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: ThisMonthCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class ThisMonthPage extends Page { + /** + * Initialize the ThisMonthPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: ThisMonthSolution); + /** + * Build an instance of ThisMonthInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ThisMonthResource): ThisMonthInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/thisMonth.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/thisMonth.js new file mode 100644 index 00000000..84d1054c --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/thisMonth.js @@ -0,0 +1,158 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ThisMonthPage = exports.ThisMonthInstance = exports.ThisMonthListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function ThisMonthListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records/ThisMonth.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ThisMonthPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ThisMonthPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ThisMonthListInstance = ThisMonthListInstance; +class ThisMonthInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ThisMonthInstance = ThisMonthInstance; +class ThisMonthPage extends Page_1.default { + /** + * Initialize the ThisMonthPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ThisMonthInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ThisMonthInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ThisMonthPage = ThisMonthPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/today.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/today.d.ts new file mode 100644 index 00000000..73f1c52f --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/today.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +export type TodayCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface TodayListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: TodayCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TodayInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TodayListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: TodayCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TodayListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: TodayCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TodaySolution { + accountSid: string; +} +export interface TodayListInstance { + _version: V2010; + _solution: TodaySolution; + _uri: string; + /** + * Streams TodayInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TodayListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TodayInstance, done: (err?: Error) => void) => void): void; + each(params: TodayListInstanceEachOptions, callback?: (item: TodayInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TodayInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TodayPage) => any): Promise; + /** + * Lists TodayInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TodayListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TodayInstance[]) => any): Promise; + list(params: TodayListInstanceOptions, callback?: (error: Error | null, items: TodayInstance[]) => any): Promise; + /** + * Retrieve a single page of TodayInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TodayListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TodayPage) => any): Promise; + page(params: TodayListInstancePageOptions, callback?: (error: Error | null, items: TodayPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TodayListInstance(version: V2010, accountSid: string): TodayListInstance; +interface TodayPayload extends TwilioResponsePayload { + usage_records: TodayResource[]; +} +interface TodayResource { + account_sid: string; + api_version: string; + as_of: string; + category: TodayCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class TodayInstance { + protected _version: V2010; + constructor(_version: V2010, payload: TodayResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: TodayCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: TodayCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class TodayPage extends Page { + /** + * Initialize the TodayPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: TodaySolution); + /** + * Build an instance of TodayInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TodayResource): TodayInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/today.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/today.js new file mode 100644 index 00000000..f116f1ca --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/today.js @@ -0,0 +1,158 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TodayPage = exports.TodayInstance = exports.TodayListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function TodayListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records/Today.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TodayPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TodayPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TodayListInstance = TodayListInstance; +class TodayInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TodayInstance = TodayInstance; +class TodayPage extends Page_1.default { + /** + * Initialize the TodayPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TodayInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TodayInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TodayPage = TodayPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yearly.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yearly.d.ts new file mode 100644 index 00000000..8c311191 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yearly.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +export type YearlyCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface YearlyListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: YearlyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: YearlyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface YearlyListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: YearlyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface YearlyListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: YearlyCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface YearlySolution { + accountSid: string; +} +export interface YearlyListInstance { + _version: V2010; + _solution: YearlySolution; + _uri: string; + /** + * Streams YearlyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { YearlyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: YearlyInstance, done: (err?: Error) => void) => void): void; + each(params: YearlyListInstanceEachOptions, callback?: (item: YearlyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of YearlyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: YearlyPage) => any): Promise; + /** + * Lists YearlyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { YearlyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: YearlyInstance[]) => any): Promise; + list(params: YearlyListInstanceOptions, callback?: (error: Error | null, items: YearlyInstance[]) => any): Promise; + /** + * Retrieve a single page of YearlyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { YearlyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: YearlyPage) => any): Promise; + page(params: YearlyListInstancePageOptions, callback?: (error: Error | null, items: YearlyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function YearlyListInstance(version: V2010, accountSid: string): YearlyListInstance; +interface YearlyPayload extends TwilioResponsePayload { + usage_records: YearlyResource[]; +} +interface YearlyResource { + account_sid: string; + api_version: string; + as_of: string; + category: YearlyCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class YearlyInstance { + protected _version: V2010; + constructor(_version: V2010, payload: YearlyResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: YearlyCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: YearlyCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class YearlyPage extends Page { + /** + * Initialize the YearlyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: YearlySolution); + /** + * Build an instance of YearlyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: YearlyResource): YearlyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yearly.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yearly.js new file mode 100644 index 00000000..24be4461 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yearly.js @@ -0,0 +1,158 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.YearlyPage = exports.YearlyInstance = exports.YearlyListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function YearlyListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records/Yearly.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new YearlyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new YearlyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.YearlyListInstance = YearlyListInstance; +class YearlyInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.YearlyInstance = YearlyInstance; +class YearlyPage extends Page_1.default { + /** + * Initialize the YearlyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of YearlyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new YearlyInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.YearlyPage = YearlyPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yesterday.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yesterday.d.ts new file mode 100644 index 00000000..be6c39aa --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yesterday.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V2010 from "../../../../V2010"; +export type YesterdayCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to each + */ +export interface YesterdayListInstanceEachOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: YesterdayCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: YesterdayInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface YesterdayListInstanceOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: YesterdayCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface YesterdayListInstancePageOptions { + /** The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. */ + category?: YesterdayCategory; + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. */ + endDate?: Date; + /** Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ + includeSubaccounts?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface YesterdaySolution { + accountSid: string; +} +export interface YesterdayListInstance { + _version: V2010; + _solution: YesterdaySolution; + _uri: string; + /** + * Streams YesterdayInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { YesterdayListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: YesterdayInstance, done: (err?: Error) => void) => void): void; + each(params: YesterdayListInstanceEachOptions, callback?: (item: YesterdayInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of YesterdayInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: YesterdayPage) => any): Promise; + /** + * Lists YesterdayInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { YesterdayListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: YesterdayInstance[]) => any): Promise; + list(params: YesterdayListInstanceOptions, callback?: (error: Error | null, items: YesterdayInstance[]) => any): Promise; + /** + * Retrieve a single page of YesterdayInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { YesterdayListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: YesterdayPage) => any): Promise; + page(params: YesterdayListInstancePageOptions, callback?: (error: Error | null, items: YesterdayPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function YesterdayListInstance(version: V2010, accountSid: string): YesterdayListInstance; +interface YesterdayPayload extends TwilioResponsePayload { + usage_records: YesterdayResource[]; +} +interface YesterdayResource { + account_sid: string; + api_version: string; + as_of: string; + category: YesterdayCategory; + count: string; + count_unit: string; + description: string; + end_date: Date; + price: number; + price_unit: string; + start_date: Date; + subresource_uris: Record; + uri: string; + usage: string; + usage_unit: string; +} +export declare class YesterdayInstance { + protected _version: V2010; + constructor(_version: V2010, payload: YesterdayResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * Usage records up to date as of this timestamp, formatted as YYYY-MM-DDTHH:MM:SS+00:00. All timestamps are in GMT + */ + asOf: string; + category: YesterdayCategory; + /** + * The number of usage events, such as the number of calls. + */ + count: string; + /** + * The units in which `count` is measured, such as `calls` for calls or `messages` for SMS. + */ + countUnit: string; + /** + * A plain-language description of the usage category. + */ + description: string; + /** + * The last date for which usage is included in the UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + endDate: Date; + /** + * The total price of the usage in the currency specified in `price_unit` and associated with the account. + */ + price: number; + /** + * The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format, such as `usd`, `eur`, and `jpy`. + */ + priceUnit: string; + /** + * The first date for which usage is included in this UsageRecord. The date is specified in GMT and formatted as `YYYY-MM-DD`. + */ + startDate: Date; + /** + * A list of related resources identified by their URIs. For more information, see [List Subresources](https://www.twilio.com/docs/usage/api/usage-record#list-subresources). + */ + subresourceUris: Record; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + /** + * The amount used to bill usage and measured in units described in `usage_unit`. + */ + usage: string; + /** + * The units in which `usage` is measured, such as `minutes` for calls or `messages` for SMS. + */ + usageUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + asOf: string; + category: YesterdayCategory; + count: string; + countUnit: string; + description: string; + endDate: Date; + price: number; + priceUnit: string; + startDate: Date; + subresourceUris: Record; + uri: string; + usage: string; + usageUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class YesterdayPage extends Page { + /** + * Initialize the YesterdayPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: YesterdaySolution); + /** + * Build an instance of YesterdayInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: YesterdayResource): YesterdayInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yesterday.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yesterday.js new file mode 100644 index 00000000..ddb121a7 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/record/yesterday.js @@ -0,0 +1,158 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.YesterdayPage = exports.YesterdayInstance = exports.YesterdayListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function YesterdayListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Records/Yesterday.json`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["category"] !== undefined) + data["Category"] = params["category"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["includeSubaccounts"] !== undefined) + data["IncludeSubaccounts"] = serialize.bool(params["includeSubaccounts"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new YesterdayPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new YesterdayPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.YesterdayListInstance = YesterdayListInstance; +class YesterdayInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.asOf = payload.as_of; + this.category = payload.category; + this.count = payload.count; + this.countUnit = payload.count_unit; + this.description = payload.description; + this.endDate = deserialize.iso8601Date(payload.end_date); + this.price = payload.price; + this.priceUnit = payload.price_unit; + this.startDate = deserialize.iso8601Date(payload.start_date); + this.subresourceUris = payload.subresource_uris; + this.uri = payload.uri; + this.usage = payload.usage; + this.usageUnit = payload.usage_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + asOf: this.asOf, + category: this.category, + count: this.count, + countUnit: this.countUnit, + description: this.description, + endDate: this.endDate, + price: this.price, + priceUnit: this.priceUnit, + startDate: this.startDate, + subresourceUris: this.subresourceUris, + uri: this.uri, + usage: this.usage, + usageUnit: this.usageUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.YesterdayInstance = YesterdayInstance; +class YesterdayPage extends Page_1.default { + /** + * Initialize the YesterdayPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of YesterdayInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new YesterdayInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.YesterdayPage = YesterdayPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/trigger.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/usage/trigger.d.ts new file mode 100644 index 00000000..04edb88a --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/trigger.d.ts @@ -0,0 +1,382 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2010 from "../../../V2010"; +export type TriggerRecurring = "daily" | "monthly" | "yearly" | "alltime"; +export type TriggerTriggerField = "count" | "usage" | "price"; +export type TriggerUsageCategory = "a2p-registration-fees" | "agent-conference" | "amazon-polly" | "answering-machine-detection" | "authy-authentications" | "authy-calls-outbound" | "authy-monthly-fees" | "authy-phone-intelligence" | "authy-phone-verifications" | "authy-sms-outbound" | "call-progess-events" | "calleridlookups" | "calls" | "calls-client" | "calls-globalconference" | "calls-inbound" | "calls-inbound-local" | "calls-inbound-mobile" | "calls-inbound-tollfree" | "calls-outbound" | "calls-pay-verb-transactions" | "calls-recordings" | "calls-sip" | "calls-sip-inbound" | "calls-sip-outbound" | "calls-transfers" | "carrier-lookups" | "conversations" | "conversations-api-requests" | "conversations-conversation-events" | "conversations-endpoint-connectivity" | "conversations-events" | "conversations-participant-events" | "conversations-participants" | "cps" | "flex-usage" | "fraud-lookups" | "group-rooms" | "group-rooms-data-track" | "group-rooms-encrypted-media-recorded" | "group-rooms-media-downloaded" | "group-rooms-media-recorded" | "group-rooms-media-routed" | "group-rooms-media-stored" | "group-rooms-participant-minutes" | "group-rooms-recorded-minutes" | "imp-v1-usage" | "lookups" | "marketplace" | "marketplace-algorithmia-named-entity-recognition" | "marketplace-cadence-transcription" | "marketplace-cadence-translation" | "marketplace-capio-speech-to-text" | "marketplace-convriza-ababa" | "marketplace-deepgram-phrase-detector" | "marketplace-digital-segment-business-info" | "marketplace-facebook-offline-conversions" | "marketplace-google-speech-to-text" | "marketplace-ibm-watson-message-insights" | "marketplace-ibm-watson-message-sentiment" | "marketplace-ibm-watson-recording-analysis" | "marketplace-ibm-watson-tone-analyzer" | "marketplace-icehook-systems-scout" | "marketplace-infogroup-dataaxle-bizinfo" | "marketplace-keen-io-contact-center-analytics" | "marketplace-marchex-cleancall" | "marketplace-marchex-sentiment-analysis-for-sms" | "marketplace-marketplace-nextcaller-social-id" | "marketplace-mobile-commons-opt-out-classifier" | "marketplace-nexiwave-voicemail-to-text" | "marketplace-nextcaller-advanced-caller-identification" | "marketplace-nomorobo-spam-score" | "marketplace-payfone-tcpa-compliance" | "marketplace-remeeting-automatic-speech-recognition" | "marketplace-tcpa-defense-solutions-blacklist-feed" | "marketplace-telo-opencnam" | "marketplace-truecnam-true-spam" | "marketplace-twilio-caller-name-lookup-us" | "marketplace-twilio-carrier-information-lookup" | "marketplace-voicebase-pci" | "marketplace-voicebase-transcription" | "marketplace-voicebase-transcription-custom-vocabulary" | "marketplace-whitepages-pro-caller-identification" | "marketplace-whitepages-pro-phone-intelligence" | "marketplace-whitepages-pro-phone-reputation" | "marketplace-wolfarm-spoken-results" | "marketplace-wolfram-short-answer" | "marketplace-ytica-contact-center-reporting-analytics" | "mediastorage" | "mms" | "mms-inbound" | "mms-inbound-longcode" | "mms-inbound-shortcode" | "mms-messages-carrierfees" | "mms-outbound" | "mms-outbound-longcode" | "mms-outbound-shortcode" | "monitor-reads" | "monitor-storage" | "monitor-writes" | "notify" | "notify-actions-attempts" | "notify-channels" | "number-format-lookups" | "pchat" | "pchat-users" | "peer-to-peer-rooms-participant-minutes" | "pfax" | "pfax-minutes" | "pfax-minutes-inbound" | "pfax-minutes-outbound" | "pfax-pages" | "phonenumbers" | "phonenumbers-cps" | "phonenumbers-emergency" | "phonenumbers-local" | "phonenumbers-mobile" | "phonenumbers-setups" | "phonenumbers-tollfree" | "premiumsupport" | "proxy" | "proxy-active-sessions" | "pstnconnectivity" | "pv" | "pv-composition-media-downloaded" | "pv-composition-media-encrypted" | "pv-composition-media-stored" | "pv-composition-minutes" | "pv-recording-compositions" | "pv-room-participants" | "pv-room-participants-au1" | "pv-room-participants-br1" | "pv-room-participants-ie1" | "pv-room-participants-jp1" | "pv-room-participants-sg1" | "pv-room-participants-us1" | "pv-room-participants-us2" | "pv-rooms" | "pv-sip-endpoint-registrations" | "recordings" | "recordingstorage" | "rooms-group-bandwidth" | "rooms-group-minutes" | "rooms-peer-to-peer-minutes" | "shortcodes" | "shortcodes-customerowned" | "shortcodes-mms-enablement" | "shortcodes-mps" | "shortcodes-random" | "shortcodes-uk" | "shortcodes-vanity" | "small-group-rooms" | "small-group-rooms-data-track" | "small-group-rooms-participant-minutes" | "sms" | "sms-inbound" | "sms-inbound-longcode" | "sms-inbound-shortcode" | "sms-messages-carrierfees" | "sms-messages-features" | "sms-messages-features-senderid" | "sms-outbound" | "sms-outbound-content-inspection" | "sms-outbound-longcode" | "sms-outbound-shortcode" | "speech-recognition" | "studio-engagements" | "sync" | "sync-actions" | "sync-endpoint-hours" | "sync-endpoint-hours-above-daily-cap" | "taskrouter-tasks" | "totalprice" | "transcriptions" | "trunking-cps" | "trunking-emergency-calls" | "trunking-origination" | "trunking-origination-local" | "trunking-origination-mobile" | "trunking-origination-tollfree" | "trunking-recordings" | "trunking-secure" | "trunking-termination" | "tts-google" | "turnmegabytes" | "turnmegabytes-australia" | "turnmegabytes-brasil" | "turnmegabytes-germany" | "turnmegabytes-india" | "turnmegabytes-ireland" | "turnmegabytes-japan" | "turnmegabytes-singapore" | "turnmegabytes-useast" | "turnmegabytes-uswest" | "twilio-interconnect" | "verify-push" | "verify-totp" | "verify-whatsapp-conversations-business-initiated" | "video-recordings" | "virtual-agent" | "voice-insights" | "voice-insights-client-insights-on-demand-minute" | "voice-insights-ptsn-insights-on-demand-minute" | "voice-insights-sip-interface-insights-on-demand-minute" | "voice-insights-sip-trunking-insights-on-demand-minute" | "voice-intelligence" | "voice-intelligence-transcription" | "voice-intelligence-operators" | "wireless" | "wireless-orders" | "wireless-orders-artwork" | "wireless-orders-bulk" | "wireless-orders-esim" | "wireless-orders-starter" | "wireless-usage" | "wireless-usage-commands" | "wireless-usage-commands-africa" | "wireless-usage-commands-asia" | "wireless-usage-commands-centralandsouthamerica" | "wireless-usage-commands-europe" | "wireless-usage-commands-home" | "wireless-usage-commands-northamerica" | "wireless-usage-commands-oceania" | "wireless-usage-commands-roaming" | "wireless-usage-data" | "wireless-usage-data-africa" | "wireless-usage-data-asia" | "wireless-usage-data-centralandsouthamerica" | "wireless-usage-data-custom-additionalmb" | "wireless-usage-data-custom-first5mb" | "wireless-usage-data-domestic-roaming" | "wireless-usage-data-europe" | "wireless-usage-data-individual-additionalgb" | "wireless-usage-data-individual-firstgb" | "wireless-usage-data-international-roaming-canada" | "wireless-usage-data-international-roaming-india" | "wireless-usage-data-international-roaming-mexico" | "wireless-usage-data-northamerica" | "wireless-usage-data-oceania" | "wireless-usage-data-pooled" | "wireless-usage-data-pooled-downlink" | "wireless-usage-data-pooled-uplink" | "wireless-usage-mrc" | "wireless-usage-mrc-custom" | "wireless-usage-mrc-individual" | "wireless-usage-mrc-pooled" | "wireless-usage-mrc-suspended" | "wireless-usage-sms" | "wireless-usage-voice"; +/** + * Options to pass to update a TriggerInstance + */ +export interface TriggerContextUpdateOptions { + /** The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. */ + callbackMethod?: string; + /** The URL we should call using `callback_method` when the trigger fires. */ + callbackUrl?: string; + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to create a TriggerInstance + */ +export interface TriggerListInstanceCreateOptions { + /** The URL we should call using `callback_method` when the trigger fires. */ + callbackUrl: string; + /** The usage value at which the trigger should fire. For convenience, you can use an offset value such as `+30` to specify a trigger_value that is 30 units more than the current usage value. Be sure to urlencode a `+` as `%2B`. */ + triggerValue: string; + /** */ + usageCategory: TriggerUsageCategory; + /** The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. */ + callbackMethod?: string; + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** */ + recurring?: TriggerRecurring; + /** */ + triggerBy?: TriggerTriggerField; +} +/** + * Options to pass to each + */ +export interface TriggerListInstanceEachOptions { + /** The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. */ + recurring?: TriggerRecurring; + /** The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). */ + triggerBy?: TriggerTriggerField; + /** The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). */ + usageCategory?: TriggerUsageCategory; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TriggerInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TriggerListInstanceOptions { + /** The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. */ + recurring?: TriggerRecurring; + /** The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). */ + triggerBy?: TriggerTriggerField; + /** The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). */ + usageCategory?: TriggerUsageCategory; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TriggerListInstancePageOptions { + /** The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. */ + recurring?: TriggerRecurring; + /** The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). */ + triggerBy?: TriggerTriggerField; + /** The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). */ + usageCategory?: TriggerUsageCategory; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TriggerContext { + /** + * Remove a TriggerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TriggerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TriggerInstance + */ + fetch(callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + /** + * Update a TriggerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TriggerInstance + */ + update(callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + /** + * Update a TriggerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TriggerInstance + */ + update(params: TriggerContextUpdateOptions, callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TriggerContextSolution { + accountSid: string; + sid: string; +} +export declare class TriggerContextImpl implements TriggerContext { + protected _version: V2010; + protected _solution: TriggerContextSolution; + protected _uri: string; + constructor(_version: V2010, accountSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + update(params?: TriggerContextUpdateOptions | ((error: Error | null, item?: TriggerInstance) => any), callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TriggerContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TriggerPayload extends TwilioResponsePayload { + usage_triggers: TriggerResource[]; +} +interface TriggerResource { + account_sid: string; + api_version: string; + callback_method: string; + callback_url: string; + current_value: string; + date_created: Date; + date_fired: Date; + date_updated: Date; + friendly_name: string; + recurring: TriggerRecurring; + sid: string; + trigger_by: TriggerTriggerField; + trigger_value: string; + uri: string; + usage_category: TriggerUsageCategory; + usage_record_uri: string; +} +export declare class TriggerInstance { + protected _version: V2010; + protected _solution: TriggerContextSolution; + protected _context?: TriggerContext; + constructor(_version: V2010, payload: TriggerResource, accountSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the trigger monitors. + */ + accountSid: string; + /** + * The API version used to create the resource. + */ + apiVersion: string; + /** + * The HTTP method we use to call `callback_url`. Can be: `GET` or `POST`. + */ + callbackMethod: string; + /** + * The URL we call using the `callback_method` when the trigger fires. + */ + callbackUrl: string; + /** + * The current value of the field the trigger is watching. + */ + currentValue: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the trigger was last fired specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateFired: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the trigger. + */ + friendlyName: string; + recurring: TriggerRecurring; + /** + * The unique string that that we created to identify the UsageTrigger resource. + */ + sid: string; + triggerBy: TriggerTriggerField; + /** + * The value at which the trigger will fire. Must be a positive, numeric value. + */ + triggerValue: string; + /** + * The URI of the resource, relative to `https://api.twilio.com`. + */ + uri: string; + usageCategory: TriggerUsageCategory; + /** + * The URI of the [UsageRecord](https://www.twilio.com/docs/usage/api/usage-record) resource this trigger watches, relative to `https://api.twilio.com`. + */ + usageRecordUri: string; + private get _proxy(); + /** + * Remove a TriggerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TriggerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TriggerInstance + */ + fetch(callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + /** + * Update a TriggerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TriggerInstance + */ + update(callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + /** + * Update a TriggerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TriggerInstance + */ + update(params: TriggerContextUpdateOptions, callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + apiVersion: string; + callbackMethod: string; + callbackUrl: string; + currentValue: string; + dateCreated: Date; + dateFired: Date; + dateUpdated: Date; + friendlyName: string; + recurring: TriggerRecurring; + sid: string; + triggerBy: TriggerTriggerField; + triggerValue: string; + uri: string; + usageCategory: TriggerUsageCategory; + usageRecordUri: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TriggerSolution { + accountSid: string; +} +export interface TriggerListInstance { + _version: V2010; + _solution: TriggerSolution; + _uri: string; + (sid: string): TriggerContext; + get(sid: string): TriggerContext; + /** + * Create a TriggerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TriggerInstance + */ + create(params: TriggerListInstanceCreateOptions, callback?: (error: Error | null, item?: TriggerInstance) => any): Promise; + /** + * Streams TriggerInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TriggerListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TriggerInstance, done: (err?: Error) => void) => void): void; + each(params: TriggerListInstanceEachOptions, callback?: (item: TriggerInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TriggerInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TriggerPage) => any): Promise; + /** + * Lists TriggerInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TriggerListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TriggerInstance[]) => any): Promise; + list(params: TriggerListInstanceOptions, callback?: (error: Error | null, items: TriggerInstance[]) => any): Promise; + /** + * Retrieve a single page of TriggerInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TriggerListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TriggerPage) => any): Promise; + page(params: TriggerListInstancePageOptions, callback?: (error: Error | null, items: TriggerPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TriggerListInstance(version: V2010, accountSid: string): TriggerListInstance; +export declare class TriggerPage extends Page { + /** + * Initialize the TriggerPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2010, response: Response, solution: TriggerSolution); + /** + * Build an instance of TriggerInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TriggerResource): TriggerInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/usage/trigger.js b/node_modules/twilio/lib/rest/api/v2010/account/usage/trigger.js new file mode 100644 index 00000000..9eea2720 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/usage/trigger.js @@ -0,0 +1,302 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TriggerPage = exports.TriggerListInstance = exports.TriggerInstance = exports.TriggerContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class TriggerContextImpl { + constructor(_version, accountSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { accountSid, sid }; + this._uri = `/Accounts/${accountSid}/Usage/Triggers/${sid}.json`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TriggerInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TriggerInstance(operationVersion, payload, instance._solution.accountSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TriggerContextImpl = TriggerContextImpl; +class TriggerInstance { + constructor(_version, payload, accountSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.apiVersion = payload.api_version; + this.callbackMethod = payload.callback_method; + this.callbackUrl = payload.callback_url; + this.currentValue = payload.current_value; + this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); + this.dateFired = deserialize.rfc2822DateTime(payload.date_fired); + this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.recurring = payload.recurring; + this.sid = payload.sid; + this.triggerBy = payload.trigger_by; + this.triggerValue = payload.trigger_value; + this.uri = payload.uri; + this.usageCategory = payload.usage_category; + this.usageRecordUri = payload.usage_record_uri; + this._solution = { accountSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TriggerContextImpl(this._version, this._solution.accountSid, this._solution.sid); + return this._context; + } + /** + * Remove a TriggerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TriggerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TriggerInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + apiVersion: this.apiVersion, + callbackMethod: this.callbackMethod, + callbackUrl: this.callbackUrl, + currentValue: this.currentValue, + dateCreated: this.dateCreated, + dateFired: this.dateFired, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + recurring: this.recurring, + sid: this.sid, + triggerBy: this.triggerBy, + triggerValue: this.triggerValue, + uri: this.uri, + usageCategory: this.usageCategory, + usageRecordUri: this.usageRecordUri, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TriggerInstance = TriggerInstance; +function TriggerListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TriggerContextImpl(version, accountSid, sid); + }; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/Usage/Triggers.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["callbackUrl"] === null || params["callbackUrl"] === undefined) { + throw new Error("Required parameter \"params['callbackUrl']\" missing."); + } + if (params["triggerValue"] === null || + params["triggerValue"] === undefined) { + throw new Error("Required parameter \"params['triggerValue']\" missing."); + } + if (params["usageCategory"] === null || + params["usageCategory"] === undefined) { + throw new Error("Required parameter \"params['usageCategory']\" missing."); + } + let data = {}; + data["CallbackUrl"] = params["callbackUrl"]; + data["TriggerValue"] = params["triggerValue"]; + data["UsageCategory"] = params["usageCategory"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["recurring"] !== undefined) + data["Recurring"] = params["recurring"]; + if (params["triggerBy"] !== undefined) + data["TriggerBy"] = params["triggerBy"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TriggerInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["recurring"] !== undefined) + data["Recurring"] = params["recurring"]; + if (params["triggerBy"] !== undefined) + data["TriggerBy"] = params["triggerBy"]; + if (params["usageCategory"] !== undefined) + data["UsageCategory"] = params["usageCategory"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TriggerPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TriggerPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TriggerListInstance = TriggerListInstance; +class TriggerPage extends Page_1.default { + /** + * Initialize the TriggerPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TriggerInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TriggerInstance(this._version, payload, this._solution.accountSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TriggerPage = TriggerPage; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/validationRequest.d.ts b/node_modules/twilio/lib/rest/api/v2010/account/validationRequest.d.ts new file mode 100644 index 00000000..7c572de3 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/validationRequest.d.ts @@ -0,0 +1,88 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2010 from "../../V2010"; +/** + * Options to pass to create a ValidationRequestInstance + */ +export interface ValidationRequestListInstanceCreateOptions { + /** The phone number to verify in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. */ + phoneNumber: string; + /** A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. */ + friendlyName?: string; + /** The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. */ + callDelay?: number; + /** The digits to dial after connecting the verification call. */ + extension?: string; + /** The URL we should call using the `status_callback_method` to send status information about the verification process to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. */ + statusCallbackMethod?: string; +} +export interface ValidationRequestSolution { + accountSid: string; +} +export interface ValidationRequestListInstance { + _version: V2010; + _solution: ValidationRequestSolution; + _uri: string; + /** + * Create a ValidationRequestInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ValidationRequestInstance + */ + create(params: ValidationRequestListInstanceCreateOptions, callback?: (error: Error | null, item?: ValidationRequestInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ValidationRequestListInstance(version: V2010, accountSid: string): ValidationRequestListInstance; +interface ValidationRequestResource { + account_sid: string; + call_sid: string; + friendly_name: string; + phone_number: string; + validation_code: string; +} +export declare class ValidationRequestInstance { + protected _version: V2010; + constructor(_version: V2010, payload: ValidationRequestResource, accountSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for the Caller ID. + */ + accountSid: string; + /** + * The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Caller ID is associated with. + */ + callSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The phone number to verify in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The 6 digit validation code that someone must enter to validate the Caller ID when `phone_number` is called. + */ + validationCode: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + callSid: string; + friendlyName: string; + phoneNumber: string; + validationCode: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/api/v2010/account/validationRequest.js b/node_modules/twilio/lib/rest/api/v2010/account/validationRequest.js new file mode 100644 index 00000000..cc15dee2 --- /dev/null +++ b/node_modules/twilio/lib/rest/api/v2010/account/validationRequest.js @@ -0,0 +1,96 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Api + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValidationRequestInstance = exports.ValidationRequestListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function ValidationRequestListInstance(version, accountSid) { + if (!(0, utility_1.isValidPathParam)(accountSid)) { + throw new Error("Parameter 'accountSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { accountSid }; + instance._uri = `/Accounts/${accountSid}/OutgoingCallerIds.json`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) { + throw new Error("Required parameter \"params['phoneNumber']\" missing."); + } + let data = {}; + data["PhoneNumber"] = params["phoneNumber"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["callDelay"] !== undefined) + data["CallDelay"] = params["callDelay"]; + if (params["extension"] !== undefined) + data["Extension"] = params["extension"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ValidationRequestInstance(operationVersion, payload, instance._solution.accountSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ValidationRequestListInstance = ValidationRequestListInstance; +class ValidationRequestInstance { + constructor(_version, payload, accountSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.friendlyName = payload.friendly_name; + this.phoneNumber = payload.phone_number; + this.validationCode = payload.validation_code; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + callSid: this.callSid, + friendlyName: this.friendlyName, + phoneNumber: this.phoneNumber, + validationCode: this.validationCode, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ValidationRequestInstance = ValidationRequestInstance; diff --git a/node_modules/twilio/lib/rest/bulkexports/V1.d.ts b/node_modules/twilio/lib/rest/bulkexports/V1.d.ts new file mode 100644 index 00000000..44a5d096 --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/V1.d.ts @@ -0,0 +1,20 @@ +import BulkexportsBase from "../BulkexportsBase"; +import Version from "../../base/Version"; +import { ExportListInstance } from "./v1/export"; +import { ExportConfigurationListInstance } from "./v1/exportConfiguration"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Bulkexports + * + * @param domain - The Twilio (Twilio.Bulkexports) domain + */ + constructor(domain: BulkexportsBase); + /** exports - { Twilio.Bulkexports.V1.ExportListInstance } resource */ + protected _exports?: ExportListInstance; + /** exportConfiguration - { Twilio.Bulkexports.V1.ExportConfigurationListInstance } resource */ + protected _exportConfiguration?: ExportConfigurationListInstance; + /** Getter for exports resource */ + get exports(): ExportListInstance; + /** Getter for exportConfiguration resource */ + get exportConfiguration(): ExportConfigurationListInstance; +} diff --git a/node_modules/twilio/lib/rest/bulkexports/V1.js b/node_modules/twilio/lib/rest/bulkexports/V1.js new file mode 100644 index 00000000..7e4124f2 --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/V1.js @@ -0,0 +1,43 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Bulkexports + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const export_1 = require("./v1/export"); +const exportConfiguration_1 = require("./v1/exportConfiguration"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Bulkexports + * + * @param domain - The Twilio (Twilio.Bulkexports) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for exports resource */ + get exports() { + this._exports = this._exports || (0, export_1.ExportListInstance)(this); + return this._exports; + } + /** Getter for exportConfiguration resource */ + get exportConfiguration() { + this._exportConfiguration = + this._exportConfiguration || (0, exportConfiguration_1.ExportConfigurationListInstance)(this); + return this._exportConfiguration; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/export.d.ts b/node_modules/twilio/lib/rest/bulkexports/v1/export.d.ts new file mode 100644 index 00000000..b50e8cb8 --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/export.d.ts @@ -0,0 +1,113 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { DayListInstance } from "./export/day"; +import { ExportCustomJobListInstance } from "./export/exportCustomJob"; +import { JobListInstance } from "./export/job"; +export interface ExportContext { + days: DayListInstance; + exportCustomJobs: ExportCustomJobListInstance; + /** + * Fetch a ExportInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportInstance + */ + fetch(callback?: (error: Error | null, item?: ExportInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExportContextSolution { + resourceType: string; +} +export declare class ExportContextImpl implements ExportContext { + protected _version: V1; + protected _solution: ExportContextSolution; + protected _uri: string; + protected _days?: DayListInstance; + protected _exportCustomJobs?: ExportCustomJobListInstance; + constructor(_version: V1, resourceType: string); + get days(): DayListInstance; + get exportCustomJobs(): ExportCustomJobListInstance; + fetch(callback?: (error: Error | null, item?: ExportInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExportContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExportResource { + resource_type: string; + url: string; + links: Record; +} +export declare class ExportInstance { + protected _version: V1; + protected _solution: ExportContextSolution; + protected _context?: ExportContext; + constructor(_version: V1, payload: ExportResource, resourceType?: string); + /** + * The type of communication – Messages, Calls, Conferences, and Participants + */ + resourceType: string; + /** + * The URL of this resource. + */ + url: string; + /** + * Contains a dictionary of URL links to nested resources of this Export. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ExportInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportInstance + */ + fetch(callback?: (error: Error | null, item?: ExportInstance) => any): Promise; + /** + * Access the days. + */ + days(): DayListInstance; + /** + * Access the exportCustomJobs. + */ + exportCustomJobs(): ExportCustomJobListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + resourceType: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExportSolution { +} +export interface ExportListInstance { + _version: V1; + _solution: ExportSolution; + _uri: string; + (resourceType: string): ExportContext; + get(resourceType: string): ExportContext; + _jobs?: JobListInstance; + jobs: JobListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExportListInstance(version: V1): ExportListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/export.js b/node_modules/twilio/lib/rest/bulkexports/v1/export.js new file mode 100644 index 00000000..6b4574cf --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/export.js @@ -0,0 +1,144 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Bulkexports + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExportListInstance = exports.ExportInstance = exports.ExportContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const day_1 = require("./export/day"); +const exportCustomJob_1 = require("./export/exportCustomJob"); +const job_1 = require("./export/job"); +class ExportContextImpl { + constructor(_version, resourceType) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(resourceType)) { + throw new Error("Parameter 'resourceType' is not valid."); + } + this._solution = { resourceType }; + this._uri = `/Exports/${resourceType}`; + } + get days() { + this._days = + this._days || (0, day_1.DayListInstance)(this._version, this._solution.resourceType); + return this._days; + } + get exportCustomJobs() { + this._exportCustomJobs = + this._exportCustomJobs || + (0, exportCustomJob_1.ExportCustomJobListInstance)(this._version, this._solution.resourceType); + return this._exportCustomJobs; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExportInstance(operationVersion, payload, instance._solution.resourceType)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExportContextImpl = ExportContextImpl; +class ExportInstance { + constructor(_version, payload, resourceType) { + this._version = _version; + this.resourceType = payload.resource_type; + this.url = payload.url; + this.links = payload.links; + this._solution = { resourceType: resourceType || this.resourceType }; + } + get _proxy() { + this._context = + this._context || + new ExportContextImpl(this._version, this._solution.resourceType); + return this._context; + } + /** + * Fetch a ExportInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the days. + */ + days() { + return this._proxy.days; + } + /** + * Access the exportCustomJobs. + */ + exportCustomJobs() { + return this._proxy.exportCustomJobs; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + resourceType: this.resourceType, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExportInstance = ExportInstance; +function ExportListInstance(version) { + const instance = ((resourceType) => instance.get(resourceType)); + instance.get = function get(resourceType) { + return new ExportContextImpl(version, resourceType); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Exports`; + Object.defineProperty(instance, "jobs", { + get: function jobs() { + if (!instance._jobs) { + instance._jobs = (0, job_1.JobListInstance)(instance._version); + } + return instance._jobs; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExportListInstance = ExportListInstance; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/export/day.d.ts b/node_modules/twilio/lib/rest/bulkexports/v1/export/day.d.ts new file mode 100644 index 00000000..a70db9f1 --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/export/day.d.ts @@ -0,0 +1,216 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to each + */ +export interface DayListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DayInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DayListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DayListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DayContext { + /** + * Fetch a DayInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DayInstance + */ + fetch(callback?: (error: Error | null, item?: DayInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DayContextSolution { + resourceType: string; + day: string; +} +export declare class DayContextImpl implements DayContext { + protected _version: V1; + protected _solution: DayContextSolution; + protected _uri: string; + constructor(_version: V1, resourceType: string, day: string); + fetch(callback?: (error: Error | null, item?: DayInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DayContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DayPayload extends TwilioResponsePayload { + days: DayResource[]; +} +interface DayResource { + redirect_to: string; + day: string; + size: number; + create_date: string; + friendly_name: string; + resource_type: string; +} +export declare class DayInstance { + protected _version: V1; + protected _solution: DayContextSolution; + protected _context?: DayContext; + constructor(_version: V1, payload: DayResource, resourceType: string, day?: string); + redirectTo: string; + /** + * The ISO 8601 format date of the resources in the file, for a UTC day + */ + day: string; + /** + * The size of the day\'s data file in bytes + */ + size: number; + /** + * The ISO 8601 format date when resources is created + */ + createDate: string; + /** + * The friendly name specified when creating the job + */ + friendlyName: string; + /** + * The type of communication – Messages, Calls, Conferences, and Participants + */ + resourceType: string; + private get _proxy(); + /** + * Fetch a DayInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DayInstance + */ + fetch(callback?: (error: Error | null, item?: DayInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + redirectTo: string; + day: string; + size: number; + createDate: string; + friendlyName: string; + resourceType: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DaySolution { + resourceType: string; +} +export interface DayListInstance { + _version: V1; + _solution: DaySolution; + _uri: string; + (day: string): DayContext; + get(day: string): DayContext; + /** + * Streams DayInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DayListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DayInstance, done: (err?: Error) => void) => void): void; + each(params: DayListInstanceEachOptions, callback?: (item: DayInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DayInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DayPage) => any): Promise; + /** + * Lists DayInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DayListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DayInstance[]) => any): Promise; + list(params: DayListInstanceOptions, callback?: (error: Error | null, items: DayInstance[]) => any): Promise; + /** + * Retrieve a single page of DayInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DayListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DayPage) => any): Promise; + page(params: DayListInstancePageOptions, callback?: (error: Error | null, items: DayPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DayListInstance(version: V1, resourceType: string): DayListInstance; +export declare class DayPage extends Page { + /** + * Initialize the DayPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DaySolution); + /** + * Build an instance of DayInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DayResource): DayInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/export/day.js b/node_modules/twilio/lib/rest/bulkexports/v1/export/day.js new file mode 100644 index 00000000..a51dfe4c --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/export/day.js @@ -0,0 +1,187 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Bulkexports + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DayPage = exports.DayListInstance = exports.DayInstance = exports.DayContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class DayContextImpl { + constructor(_version, resourceType, day) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(resourceType)) { + throw new Error("Parameter 'resourceType' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(day)) { + throw new Error("Parameter 'day' is not valid."); + } + this._solution = { resourceType, day }; + this._uri = `/Exports/${resourceType}/Days/${day}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DayInstance(operationVersion, payload, instance._solution.resourceType, instance._solution.day)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DayContextImpl = DayContextImpl; +class DayInstance { + constructor(_version, payload, resourceType, day) { + this._version = _version; + this.redirectTo = payload.redirect_to; + this.day = payload.day; + this.size = deserialize.integer(payload.size); + this.createDate = payload.create_date; + this.friendlyName = payload.friendly_name; + this.resourceType = payload.resource_type; + this._solution = { resourceType, day: day || this.day }; + } + get _proxy() { + this._context = + this._context || + new DayContextImpl(this._version, this._solution.resourceType, this._solution.day); + return this._context; + } + /** + * Fetch a DayInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DayInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + redirectTo: this.redirectTo, + day: this.day, + size: this.size, + createDate: this.createDate, + friendlyName: this.friendlyName, + resourceType: this.resourceType, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DayInstance = DayInstance; +function DayListInstance(version, resourceType) { + if (!(0, utility_1.isValidPathParam)(resourceType)) { + throw new Error("Parameter 'resourceType' is not valid."); + } + const instance = ((day) => instance.get(day)); + instance.get = function get(day) { + return new DayContextImpl(version, resourceType, day); + }; + instance._version = version; + instance._solution = { resourceType }; + instance._uri = `/Exports/${resourceType}/Days`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DayPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DayPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DayListInstance = DayListInstance; +class DayPage extends Page_1.default { + /** + * Initialize the DayPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DayInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DayInstance(this._version, payload, this._solution.resourceType); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DayPage = DayPage; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/export/exportCustomJob.d.ts b/node_modules/twilio/lib/rest/bulkexports/v1/export/exportCustomJob.d.ts new file mode 100644 index 00000000..d0bee6cd --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/export/exportCustomJob.d.ts @@ -0,0 +1,229 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a ExportCustomJobInstance + */ +export interface ExportCustomJobListInstanceCreateOptions { + /** The start day for the custom export specified as a string in the format of yyyy-mm-dd */ + startDay: string; + /** The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day is inclusive and must be 2 days earlier than the current UTC day. */ + endDay: string; + /** The friendly name specified when creating the job */ + friendlyName: string; + /** The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job\\\'s status manually. */ + webhookUrl?: string; + /** This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. */ + webhookMethod?: string; + /** The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job\\\'s status. */ + email?: string; +} +/** + * Options to pass to each + */ +export interface ExportCustomJobListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ExportCustomJobInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ExportCustomJobListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ExportCustomJobListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ExportCustomJobSolution { + resourceType: string; +} +export interface ExportCustomJobListInstance { + _version: V1; + _solution: ExportCustomJobSolution; + _uri: string; + /** + * Create a ExportCustomJobInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportCustomJobInstance + */ + create(params: ExportCustomJobListInstanceCreateOptions, callback?: (error: Error | null, item?: ExportCustomJobInstance) => any): Promise; + /** + * Streams ExportCustomJobInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExportCustomJobListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ExportCustomJobInstance, done: (err?: Error) => void) => void): void; + each(params: ExportCustomJobListInstanceEachOptions, callback?: (item: ExportCustomJobInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ExportCustomJobInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ExportCustomJobPage) => any): Promise; + /** + * Lists ExportCustomJobInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExportCustomJobListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ExportCustomJobInstance[]) => any): Promise; + list(params: ExportCustomJobListInstanceOptions, callback?: (error: Error | null, items: ExportCustomJobInstance[]) => any): Promise; + /** + * Retrieve a single page of ExportCustomJobInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExportCustomJobListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ExportCustomJobPage) => any): Promise; + page(params: ExportCustomJobListInstancePageOptions, callback?: (error: Error | null, items: ExportCustomJobPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExportCustomJobListInstance(version: V1, resourceType: string): ExportCustomJobListInstance; +interface ExportCustomJobPayload extends TwilioResponsePayload { + jobs: ExportCustomJobResource[]; +} +interface ExportCustomJobResource { + friendly_name: string; + resource_type: string; + start_day: string; + end_day: string; + webhook_url: string; + webhook_method: string; + email: string; + job_sid: string; + details: any; + job_queue_position: string; + estimated_completion_time: string; +} +export declare class ExportCustomJobInstance { + protected _version: V1; + constructor(_version: V1, payload: ExportCustomJobResource, resourceType: string); + /** + * The friendly name specified when creating the job + */ + friendlyName: string; + /** + * The type of communication – Messages, Calls, Conferences, and Participants + */ + resourceType: string; + /** + * The start day for the custom export specified when creating the job + */ + startDay: string; + /** + * The end day for the export specified when creating the job + */ + endDay: string; + /** + * The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. + */ + webhookUrl: string; + /** + * This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. + */ + webhookMethod: string; + /** + * The optional email to send the completion notification to + */ + email: string; + /** + * The unique job_sid returned when the custom export was created + */ + jobSid: string; + /** + * The details of a job which is an object that contains an array of status grouped by `status` state. Each `status` object has a `status` string, a count which is the number of days in that `status`, and list of days in that `status`. The day strings are in the format yyyy-MM-dd. As an example, a currently running job may have a status object for COMPLETED and a `status` object for SUBMITTED each with its own count and list of days. + */ + details: any; + /** + * This is the job position from the 1st in line. Your queue position will never increase. As jobs ahead of yours in the queue are processed, the queue position number will decrease + */ + jobQueuePosition: string; + /** + * this is the time estimated until your job is complete. This is calculated each time you request the job list. The time is calculated based on the current rate of job completion (which may vary) and your job queue position + */ + estimatedCompletionTime: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + friendlyName: string; + resourceType: string; + startDay: string; + endDay: string; + webhookUrl: string; + webhookMethod: string; + email: string; + jobSid: string; + details: any; + jobQueuePosition: string; + estimatedCompletionTime: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class ExportCustomJobPage extends Page { + /** + * Initialize the ExportCustomJobPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ExportCustomJobSolution); + /** + * Build an instance of ExportCustomJobInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ExportCustomJobResource): ExportCustomJobInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/export/exportCustomJob.js b/node_modules/twilio/lib/rest/bulkexports/v1/export/exportCustomJob.js new file mode 100644 index 00000000..c6391a66 --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/export/exportCustomJob.js @@ -0,0 +1,178 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Bulkexports + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExportCustomJobPage = exports.ExportCustomJobInstance = exports.ExportCustomJobListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function ExportCustomJobListInstance(version, resourceType) { + if (!(0, utility_1.isValidPathParam)(resourceType)) { + throw new Error("Parameter 'resourceType' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { resourceType }; + instance._uri = `/Exports/${resourceType}/Jobs`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["startDay"] === null || params["startDay"] === undefined) { + throw new Error("Required parameter \"params['startDay']\" missing."); + } + if (params["endDay"] === null || params["endDay"] === undefined) { + throw new Error("Required parameter \"params['endDay']\" missing."); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["StartDay"] = params["startDay"]; + data["EndDay"] = params["endDay"]; + data["FriendlyName"] = params["friendlyName"]; + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["webhookMethod"] !== undefined) + data["WebhookMethod"] = params["webhookMethod"]; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExportCustomJobInstance(operationVersion, payload, instance._solution.resourceType)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExportCustomJobPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ExportCustomJobPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExportCustomJobListInstance = ExportCustomJobListInstance; +class ExportCustomJobInstance { + constructor(_version, payload, resourceType) { + this._version = _version; + this.friendlyName = payload.friendly_name; + this.resourceType = payload.resource_type; + this.startDay = payload.start_day; + this.endDay = payload.end_day; + this.webhookUrl = payload.webhook_url; + this.webhookMethod = payload.webhook_method; + this.email = payload.email; + this.jobSid = payload.job_sid; + this.details = payload.details; + this.jobQueuePosition = payload.job_queue_position; + this.estimatedCompletionTime = payload.estimated_completion_time; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + friendlyName: this.friendlyName, + resourceType: this.resourceType, + startDay: this.startDay, + endDay: this.endDay, + webhookUrl: this.webhookUrl, + webhookMethod: this.webhookMethod, + email: this.email, + jobSid: this.jobSid, + details: this.details, + jobQueuePosition: this.jobQueuePosition, + estimatedCompletionTime: this.estimatedCompletionTime, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExportCustomJobInstance = ExportCustomJobInstance; +class ExportCustomJobPage extends Page_1.default { + /** + * Initialize the ExportCustomJobPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ExportCustomJobInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ExportCustomJobInstance(this._version, payload, this._solution.resourceType); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExportCustomJobPage = ExportCustomJobPage; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/export/job.d.ts b/node_modules/twilio/lib/rest/bulkexports/v1/export/job.d.ts new file mode 100644 index 00000000..faeef646 --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/export/job.d.ts @@ -0,0 +1,162 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export interface JobContext { + /** + * Remove a JobInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a JobInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed JobInstance + */ + fetch(callback?: (error: Error | null, item?: JobInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface JobContextSolution { + jobSid: string; +} +export declare class JobContextImpl implements JobContext { + protected _version: V1; + protected _solution: JobContextSolution; + protected _uri: string; + constructor(_version: V1, jobSid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: JobInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): JobContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface JobResource { + resource_type: string; + friendly_name: string; + details: any; + start_day: string; + end_day: string; + job_sid: string; + webhook_url: string; + webhook_method: string; + email: string; + url: string; + job_queue_position: string; + estimated_completion_time: string; +} +export declare class JobInstance { + protected _version: V1; + protected _solution: JobContextSolution; + protected _context?: JobContext; + constructor(_version: V1, payload: JobResource, jobSid?: string); + /** + * The type of communication – Messages, Calls, Conferences, and Participants + */ + resourceType: string; + /** + * The friendly name specified when creating the job + */ + friendlyName: string; + /** + * The details of a job which is an object that contains an array of status grouped by `status` state. Each `status` object has a `status` string, a count which is the number of days in that `status`, and list of days in that `status`. The day strings are in the format yyyy-MM-dd. As an example, a currently running job may have a status object for COMPLETED and a `status` object for SUBMITTED each with its own count and list of days. + */ + details: any; + /** + * The start time for the export specified when creating the job + */ + startDay: string; + /** + * The end time for the export specified when creating the job + */ + endDay: string; + /** + * The job_sid returned when the export was created + */ + jobSid: string; + /** + * The optional webhook url called on completion + */ + webhookUrl: string; + /** + * This is the method used to call the webhook + */ + webhookMethod: string; + /** + * The optional email to send the completion notification to + */ + email: string; + url: string; + /** + * This is the job position from the 1st in line. Your queue position will never increase. As jobs ahead of yours in the queue are processed, the queue position number will decrease + */ + jobQueuePosition: string; + /** + * this is the time estimated until your job is complete. This is calculated each time you request the job list. The time is calculated based on the current rate of job completion (which may vary) and your job queue position + */ + estimatedCompletionTime: string; + private get _proxy(); + /** + * Remove a JobInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a JobInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed JobInstance + */ + fetch(callback?: (error: Error | null, item?: JobInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + resourceType: string; + friendlyName: string; + details: any; + startDay: string; + endDay: string; + jobSid: string; + webhookUrl: string; + webhookMethod: string; + email: string; + url: string; + jobQueuePosition: string; + estimatedCompletionTime: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface JobSolution { +} +export interface JobListInstance { + _version: V1; + _solution: JobSolution; + _uri: string; + (jobSid: string): JobContext; + get(jobSid: string): JobContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function JobListInstance(version: V1): JobListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/export/job.js b/node_modules/twilio/lib/rest/bulkexports/v1/export/job.js new file mode 100644 index 00000000..404efb39 --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/export/job.js @@ -0,0 +1,146 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Bulkexports + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JobListInstance = exports.JobInstance = exports.JobContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class JobContextImpl { + constructor(_version, jobSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(jobSid)) { + throw new Error("Parameter 'jobSid' is not valid."); + } + this._solution = { jobSid }; + this._uri = `/Exports/Jobs/${jobSid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new JobInstance(operationVersion, payload, instance._solution.jobSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.JobContextImpl = JobContextImpl; +class JobInstance { + constructor(_version, payload, jobSid) { + this._version = _version; + this.resourceType = payload.resource_type; + this.friendlyName = payload.friendly_name; + this.details = payload.details; + this.startDay = payload.start_day; + this.endDay = payload.end_day; + this.jobSid = payload.job_sid; + this.webhookUrl = payload.webhook_url; + this.webhookMethod = payload.webhook_method; + this.email = payload.email; + this.url = payload.url; + this.jobQueuePosition = payload.job_queue_position; + this.estimatedCompletionTime = payload.estimated_completion_time; + this._solution = { jobSid: jobSid || this.jobSid }; + } + get _proxy() { + this._context = + this._context || new JobContextImpl(this._version, this._solution.jobSid); + return this._context; + } + /** + * Remove a JobInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a JobInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed JobInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + resourceType: this.resourceType, + friendlyName: this.friendlyName, + details: this.details, + startDay: this.startDay, + endDay: this.endDay, + jobSid: this.jobSid, + webhookUrl: this.webhookUrl, + webhookMethod: this.webhookMethod, + email: this.email, + url: this.url, + jobQueuePosition: this.jobQueuePosition, + estimatedCompletionTime: this.estimatedCompletionTime, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.JobInstance = JobInstance; +function JobListInstance(version) { + const instance = ((jobSid) => instance.get(jobSid)); + instance.get = function get(jobSid) { + return new JobContextImpl(version, jobSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.JobListInstance = JobListInstance; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/exportConfiguration.d.ts b/node_modules/twilio/lib/rest/bulkexports/v1/exportConfiguration.d.ts new file mode 100644 index 00000000..642116e6 --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/exportConfiguration.d.ts @@ -0,0 +1,152 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to update a ExportConfigurationInstance + */ +export interface ExportConfigurationContextUpdateOptions { + /** If true, Twilio will automatically generate every day\\\'s file when the day is over. */ + enabled?: boolean; + /** Stores the URL destination for the method specified in webhook_method. */ + webhookUrl?: string; + /** Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url */ + webhookMethod?: string; +} +export interface ExportConfigurationContext { + /** + * Fetch a ExportConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: ExportConfigurationInstance) => any): Promise; + /** + * Update a ExportConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportConfigurationInstance + */ + update(callback?: (error: Error | null, item?: ExportConfigurationInstance) => any): Promise; + /** + * Update a ExportConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportConfigurationInstance + */ + update(params: ExportConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: ExportConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExportConfigurationContextSolution { + resourceType: string; +} +export declare class ExportConfigurationContextImpl implements ExportConfigurationContext { + protected _version: V1; + protected _solution: ExportConfigurationContextSolution; + protected _uri: string; + constructor(_version: V1, resourceType: string); + fetch(callback?: (error: Error | null, item?: ExportConfigurationInstance) => any): Promise; + update(params?: ExportConfigurationContextUpdateOptions | ((error: Error | null, item?: ExportConfigurationInstance) => any), callback?: (error: Error | null, item?: ExportConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExportConfigurationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExportConfigurationResource { + enabled: boolean; + webhook_url: string; + webhook_method: string; + resource_type: string; + url: string; +} +export declare class ExportConfigurationInstance { + protected _version: V1; + protected _solution: ExportConfigurationContextSolution; + protected _context?: ExportConfigurationContext; + constructor(_version: V1, payload: ExportConfigurationResource, resourceType?: string); + /** + * If true, Twilio will automatically generate every day\'s file when the day is over. + */ + enabled: boolean; + /** + * Stores the URL destination for the method specified in webhook_method. + */ + webhookUrl: string; + /** + * Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url + */ + webhookMethod: string; + /** + * The type of communication – Messages, Calls, Conferences, and Participants + */ + resourceType: string; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ExportConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: ExportConfigurationInstance) => any): Promise; + /** + * Update a ExportConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportConfigurationInstance + */ + update(callback?: (error: Error | null, item?: ExportConfigurationInstance) => any): Promise; + /** + * Update a ExportConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportConfigurationInstance + */ + update(params: ExportConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: ExportConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + enabled: boolean; + webhookUrl: string; + webhookMethod: string; + resourceType: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExportConfigurationSolution { +} +export interface ExportConfigurationListInstance { + _version: V1; + _solution: ExportConfigurationSolution; + _uri: string; + (resourceType: string): ExportConfigurationContext; + get(resourceType: string): ExportConfigurationContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExportConfigurationListInstance(version: V1): ExportConfigurationListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/bulkexports/v1/exportConfiguration.js b/node_modules/twilio/lib/rest/bulkexports/v1/exportConfiguration.js new file mode 100644 index 00000000..e71f93fa --- /dev/null +++ b/node_modules/twilio/lib/rest/bulkexports/v1/exportConfiguration.js @@ -0,0 +1,145 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Bulkexports + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExportConfigurationListInstance = exports.ExportConfigurationInstance = exports.ExportConfigurationContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class ExportConfigurationContextImpl { + constructor(_version, resourceType) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(resourceType)) { + throw new Error("Parameter 'resourceType' is not valid."); + } + this._solution = { resourceType }; + this._uri = `/Exports/${resourceType}/Configuration`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExportConfigurationInstance(operationVersion, payload, instance._solution.resourceType)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["webhookMethod"] !== undefined) + data["WebhookMethod"] = params["webhookMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExportConfigurationInstance(operationVersion, payload, instance._solution.resourceType)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExportConfigurationContextImpl = ExportConfigurationContextImpl; +class ExportConfigurationInstance { + constructor(_version, payload, resourceType) { + this._version = _version; + this.enabled = payload.enabled; + this.webhookUrl = payload.webhook_url; + this.webhookMethod = payload.webhook_method; + this.resourceType = payload.resource_type; + this.url = payload.url; + this._solution = { resourceType: resourceType || this.resourceType }; + } + get _proxy() { + this._context = + this._context || + new ExportConfigurationContextImpl(this._version, this._solution.resourceType); + return this._context; + } + /** + * Fetch a ExportConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExportConfigurationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + enabled: this.enabled, + webhookUrl: this.webhookUrl, + webhookMethod: this.webhookMethod, + resourceType: this.resourceType, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExportConfigurationInstance = ExportConfigurationInstance; +function ExportConfigurationListInstance(version) { + const instance = ((resourceType) => instance.get(resourceType)); + instance.get = function get(resourceType) { + return new ExportConfigurationContextImpl(version, resourceType); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExportConfigurationListInstance = ExportConfigurationListInstance; diff --git a/node_modules/twilio/lib/rest/chat/V1.d.ts b/node_modules/twilio/lib/rest/chat/V1.d.ts new file mode 100644 index 00000000..b42133f6 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/V1.d.ts @@ -0,0 +1,20 @@ +import ChatBase from "../ChatBase"; +import Version from "../../base/Version"; +import { CredentialListInstance } from "./v1/credential"; +import { ServiceListInstance } from "./v1/service"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Chat + * + * @param domain - The Twilio (Twilio.Chat) domain + */ + constructor(domain: ChatBase); + /** credentials - { Twilio.Chat.V1.CredentialListInstance } resource */ + protected _credentials?: CredentialListInstance; + /** services - { Twilio.Chat.V1.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for credentials resource */ + get credentials(): CredentialListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/chat/V1.js b/node_modules/twilio/lib/rest/chat/V1.js new file mode 100644 index 00000000..ba50cdec --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/V1.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const credential_1 = require("./v1/credential"); +const service_1 = require("./v1/service"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Chat + * + * @param domain - The Twilio (Twilio.Chat) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for credentials resource */ + get credentials() { + this._credentials = this._credentials || (0, credential_1.CredentialListInstance)(this); + return this._credentials; + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/chat/V2.d.ts b/node_modules/twilio/lib/rest/chat/V2.d.ts new file mode 100644 index 00000000..4b9e11ab --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/V2.d.ts @@ -0,0 +1,20 @@ +import ChatBase from "../ChatBase"; +import Version from "../../base/Version"; +import { CredentialListInstance } from "./v2/credential"; +import { ServiceListInstance } from "./v2/service"; +export default class V2 extends Version { + /** + * Initialize the V2 version of Chat + * + * @param domain - The Twilio (Twilio.Chat) domain + */ + constructor(domain: ChatBase); + /** credentials - { Twilio.Chat.V2.CredentialListInstance } resource */ + protected _credentials?: CredentialListInstance; + /** services - { Twilio.Chat.V2.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for credentials resource */ + get credentials(): CredentialListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/chat/V2.js b/node_modules/twilio/lib/rest/chat/V2.js new file mode 100644 index 00000000..f5021b83 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/V2.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const credential_1 = require("./v2/credential"); +const service_1 = require("./v2/service"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of Chat + * + * @param domain - The Twilio (Twilio.Chat) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for credentials resource */ + get credentials() { + this._credentials = this._credentials || (0, credential_1.CredentialListInstance)(this); + return this._credentials; + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/chat/V3.d.ts b/node_modules/twilio/lib/rest/chat/V3.d.ts new file mode 100644 index 00000000..3f670ea0 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/V3.d.ts @@ -0,0 +1,15 @@ +import ChatBase from "../ChatBase"; +import Version from "../../base/Version"; +import { ChannelListInstance } from "./v3/channel"; +export default class V3 extends Version { + /** + * Initialize the V3 version of Chat + * + * @param domain - The Twilio (Twilio.Chat) domain + */ + constructor(domain: ChatBase); + /** channels - { Twilio.Chat.V3.ChannelListInstance } resource */ + protected _channels?: ChannelListInstance; + /** Getter for channels resource */ + get channels(): ChannelListInstance; +} diff --git a/node_modules/twilio/lib/rest/chat/V3.js b/node_modules/twilio/lib/rest/chat/V3.js new file mode 100644 index 00000000..5dbd3123 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/V3.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const channel_1 = require("./v3/channel"); +class V3 extends Version_1.default { + /** + * Initialize the V3 version of Chat + * + * @param domain - The Twilio (Twilio.Chat) domain + */ + constructor(domain) { + super(domain, "v3"); + } + /** Getter for channels resource */ + get channels() { + this._channels = this._channels || (0, channel_1.ChannelListInstance)(this); + return this._channels; + } +} +exports.default = V3; diff --git a/node_modules/twilio/lib/rest/chat/v1/credential.d.ts b/node_modules/twilio/lib/rest/chat/v1/credential.d.ts new file mode 100644 index 00000000..7e598632 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/credential.d.ts @@ -0,0 +1,324 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type CredentialPushService = "gcm" | "apn" | "fcm"; +/** + * Options to pass to update a CredentialInstance + */ +export interface CredentialContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` */ + certificate?: string; + /** [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` */ + privateKey?: string; + /** [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. */ + sandbox?: boolean; + /** [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. */ + apiKey?: string; + /** [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ + secret?: string; +} +/** + * Options to pass to create a CredentialInstance + */ +export interface CredentialListInstanceCreateOptions { + /** */ + type: CredentialPushService; + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` */ + certificate?: string; + /** [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` */ + privateKey?: string; + /** [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. */ + sandbox?: boolean; + /** [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. */ + apiKey?: string; + /** [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ + secret?: string; +} +/** + * Options to pass to each + */ +export interface CredentialListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialContext { + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialContextSolution { + sid: string; +} +export declare class CredentialContextImpl implements CredentialContext { + protected _version: V1; + protected _solution: CredentialContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + update(params?: CredentialContextUpdateOptions | ((error: Error | null, item?: CredentialInstance) => any), callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialPayload extends TwilioResponsePayload { + credentials: CredentialResource[]; +} +interface CredentialResource { + sid: string; + account_sid: string; + friendly_name: string; + type: CredentialPushService; + sandbox: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CredentialInstance { + protected _version: V1; + protected _solution: CredentialContextSolution; + protected _context?: CredentialContext; + constructor(_version: V1, payload: CredentialResource, sid?: string); + /** + * The unique string that we created to identify the Credential resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Credential resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + type: CredentialPushService; + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + */ + sandbox: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Credential resource. + */ + url: string; + private get _proxy(); + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + type: CredentialPushService; + sandbox: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialSolution { +} +export interface CredentialListInstance { + _version: V1; + _solution: CredentialSolution; + _uri: string; + (sid: string): CredentialContext; + get(sid: string): CredentialContext; + /** + * Create a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + create(params: CredentialListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Streams CredentialInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListInstanceEachOptions, callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Lists CredentialInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + list(params: CredentialListInstanceOptions, callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialPage) => any): Promise; + page(params: CredentialListInstancePageOptions, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListInstance(version: V1): CredentialListInstance; +export declare class CredentialPage extends Page { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CredentialSolution); + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialResource): CredentialInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/credential.js b/node_modules/twilio/lib/rest/chat/v1/credential.js new file mode 100644 index 00000000..9aebd9a3 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/credential.js @@ -0,0 +1,274 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialPage = exports.CredentialListInstance = exports.CredentialInstance = exports.CredentialContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CredentialContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Credentials/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialContextImpl = CredentialContextImpl; +class CredentialInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.sandbox = payload.sandbox; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + type: this.type, + sandbox: this.sandbox, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialInstance = CredentialInstance; +function CredentialListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListInstance = CredentialListInstance; +class CredentialPage extends Page_1.default { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialPage = CredentialPage; diff --git a/node_modules/twilio/lib/rest/chat/v1/service.d.ts b/node_modules/twilio/lib/rest/chat/v1/service.d.ts new file mode 100644 index 00000000..e19aca1e --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service.d.ts @@ -0,0 +1,512 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { ChannelListInstance } from "./service/channel"; +import { RoleListInstance } from "./service/role"; +import { UserListInstance } from "./service/user"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. */ + defaultServiceRoleSid?: string; + /** The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. */ + defaultChannelRoleSid?: string; + /** The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. */ + defaultChannelCreatorRoleSid?: string; + /** Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. */ + readStatusEnabled?: boolean; + /** Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. */ + reachabilityEnabled?: boolean; + /** How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. */ + typingIndicatorTimeout?: number; + /** DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. */ + consumptionReportInterval?: number; + /** Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. */ + "notifications.newMessage.enabled"?: boolean; + /** The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. */ + "notifications.newMessage.template"?: string; + /** Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. */ + "notifications.addedToChannel.enabled"?: boolean; + /** The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. */ + "notifications.addedToChannel.template"?: string; + /** Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. */ + "notifications.removedFromChannel.enabled"?: boolean; + /** The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. */ + "notifications.removedFromChannel.template"?: string; + /** Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. */ + "notifications.invitedToChannel.enabled"?: boolean; + /** The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. */ + "notifications.invitedToChannel.template"?: string; + /** The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. */ + preWebhookUrl?: string; + /** The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. */ + postWebhookUrl?: string; + /** The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. */ + webhookMethod?: string; + /** The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. */ + webhookFilters?: Array; + /** The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. */ + "webhooks.onMessageSend.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_message_send.url`. */ + "webhooks.onMessageSend.method"?: string; + /** The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. */ + "webhooks.onMessageUpdate.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_message_update.url`. */ + "webhooks.onMessageUpdate.method"?: string; + /** The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. */ + "webhooks.onMessageRemove.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_message_remove.url`. */ + "webhooks.onMessageRemove.method"?: string; + /** The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. */ + "webhooks.onChannelAdd.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_channel_add.url`. */ + "webhooks.onChannelAdd.method"?: string; + /** The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. */ + "webhooks.onChannelDestroy.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. */ + "webhooks.onChannelDestroy.method"?: string; + /** The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. */ + "webhooks.onChannelUpdate.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_channel_update.url`. */ + "webhooks.onChannelUpdate.method"?: string; + /** The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. */ + "webhooks.onMemberAdd.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_member_add.url`. */ + "webhooks.onMemberAdd.method"?: string; + /** The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. */ + "webhooks.onMemberRemove.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_member_remove.url`. */ + "webhooks.onMemberRemove.method"?: string; + /** The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. */ + "webhooks.onMessageSent.url"?: string; + /** The URL of the webhook to call in response to the `on_message_sent` event`. */ + "webhooks.onMessageSent.method"?: string; + /** The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. */ + "webhooks.onMessageUpdated.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_message_updated.url`. */ + "webhooks.onMessageUpdated.method"?: string; + /** The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. */ + "webhooks.onMessageRemoved.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_message_removed.url`. */ + "webhooks.onMessageRemoved.method"?: string; + /** The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. */ + "webhooks.onChannelAdded.url"?: string; + /** The URL of the webhook to call in response to the `on_channel_added` event`. */ + "webhooks.onChannelAdded.method"?: string; + /** The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. */ + "webhooks.onChannelDestroyed.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. */ + "webhooks.onChannelDestroyed.method"?: string; + /** The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. */ + "webhooks.onChannelUpdated.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_channel_updated.url`. */ + "webhooks.onChannelUpdated.method"?: string; + /** The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. */ + "webhooks.onMemberAdded.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_channel_updated.url`. */ + "webhooks.onMemberAdded.method"?: string; + /** The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. */ + "webhooks.onMemberRemoved.url"?: string; + /** The HTTP method to use when calling the `webhooks.on_member_removed.url`. */ + "webhooks.onMemberRemoved.method"?: string; + /** The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. */ + "limits.channelMembers"?: number; + /** The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. */ + "limits.userChannels"?: number; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + channels: ChannelListInstance; + roles: RoleListInstance; + users: UserListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _channels?: ChannelListInstance; + protected _roles?: RoleListInstance; + protected _users?: UserListInstance; + constructor(_version: V1, sid: string); + get channels(): ChannelListInstance; + get roles(): RoleListInstance; + get users(): UserListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + default_service_role_sid: string; + default_channel_role_sid: string; + default_channel_creator_role_sid: string; + read_status_enabled: boolean; + reachability_enabled: boolean; + typing_indicator_timeout: number; + consumption_report_interval: number; + limits: any; + webhooks: any; + pre_webhook_url: string; + post_webhook_url: string; + webhook_method: string; + webhook_filters: Array; + notifications: any; + url: string; + links: Record; +} +export declare class ServiceInstance { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V1, payload: ServiceResource, sid?: string); + /** + * The unique string that we created to identify the Service resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Service resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + */ + defaultServiceRoleSid: string; + /** + * The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + */ + defaultChannelRoleSid: string; + /** + * The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + */ + defaultChannelCreatorRoleSid: string; + /** + * Whether the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature is enabled. The default is `true`. + */ + readStatusEnabled: boolean; + /** + * Whether the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) is enabled for this Service instance. The default is `false`. + */ + reachabilityEnabled: boolean; + /** + * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + */ + typingIndicatorTimeout: number; + /** + * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + */ + consumptionReportInterval: number; + /** + * An object that describes the limits of the service instance. The `limits` object contains `channel_members` to describe the members/channel limit and `user_channels` to describe the channels/user limit. `channel_members` can be 1,000 or less, with a default of 250. `user_channels` can be 1,000 or less, with a default value of 100. + */ + limits: any; + /** + * An object that contains information about the webhooks configured for this service. + */ + webhooks: any; + /** + * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + */ + preWebhookUrl: string; + /** + * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + */ + postWebhookUrl: string; + /** + * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + */ + webhookMethod: string; + /** + * The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + */ + webhookFilters: Array; + /** + * The notification configuration for the Service instance. See [Push Notification Configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more information. + */ + notifications: any; + /** + * The absolute URL of the Service resource. + */ + url: string; + /** + * The absolute URLs of the Service\'s [Channels](https://www.twilio.com/docs/chat/api/channels), [Roles](https://www.twilio.com/docs/chat/api/roles), and [Users](https://www.twilio.com/docs/chat/api/users). + */ + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the channels. + */ + channels(): ChannelListInstance; + /** + * Access the roles. + */ + roles(): RoleListInstance; + /** + * Access the users. + */ + users(): UserListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + defaultServiceRoleSid: string; + defaultChannelRoleSid: string; + defaultChannelCreatorRoleSid: string; + readStatusEnabled: boolean; + reachabilityEnabled: boolean; + typingIndicatorTimeout: number; + consumptionReportInterval: number; + limits: any; + webhooks: any; + preWebhookUrl: string; + postWebhookUrl: string; + webhookMethod: string; + webhookFilters: string[]; + notifications: any; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V1; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V1): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/service.js b/node_modules/twilio/lib/rest/chat/v1/service.js new file mode 100644 index 00000000..8ebbd6ce --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service.js @@ -0,0 +1,454 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const channel_1 = require("./service/channel"); +const role_1 = require("./service/role"); +const user_1 = require("./service/user"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get channels() { + this._channels = + this._channels || (0, channel_1.ChannelListInstance)(this._version, this._solution.sid); + return this._channels; + } + get roles() { + this._roles = + this._roles || (0, role_1.RoleListInstance)(this._version, this._solution.sid); + return this._roles; + } + get users() { + this._users = + this._users || (0, user_1.UserListInstance)(this._version, this._solution.sid); + return this._users; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["defaultServiceRoleSid"] !== undefined) + data["DefaultServiceRoleSid"] = params["defaultServiceRoleSid"]; + if (params["defaultChannelRoleSid"] !== undefined) + data["DefaultChannelRoleSid"] = params["defaultChannelRoleSid"]; + if (params["defaultChannelCreatorRoleSid"] !== undefined) + data["DefaultChannelCreatorRoleSid"] = + params["defaultChannelCreatorRoleSid"]; + if (params["readStatusEnabled"] !== undefined) + data["ReadStatusEnabled"] = serialize.bool(params["readStatusEnabled"]); + if (params["reachabilityEnabled"] !== undefined) + data["ReachabilityEnabled"] = serialize.bool(params["reachabilityEnabled"]); + if (params["typingIndicatorTimeout"] !== undefined) + data["TypingIndicatorTimeout"] = params["typingIndicatorTimeout"]; + if (params["consumptionReportInterval"] !== undefined) + data["ConsumptionReportInterval"] = params["consumptionReportInterval"]; + if (params["notifications.newMessage.enabled"] !== undefined) + data["Notifications.NewMessage.Enabled"] = serialize.bool(params["notifications.newMessage.enabled"]); + if (params["notifications.newMessage.template"] !== undefined) + data["Notifications.NewMessage.Template"] = + params["notifications.newMessage.template"]; + if (params["notifications.addedToChannel.enabled"] !== undefined) + data["Notifications.AddedToChannel.Enabled"] = serialize.bool(params["notifications.addedToChannel.enabled"]); + if (params["notifications.addedToChannel.template"] !== undefined) + data["Notifications.AddedToChannel.Template"] = + params["notifications.addedToChannel.template"]; + if (params["notifications.removedFromChannel.enabled"] !== undefined) + data["Notifications.RemovedFromChannel.Enabled"] = serialize.bool(params["notifications.removedFromChannel.enabled"]); + if (params["notifications.removedFromChannel.template"] !== undefined) + data["Notifications.RemovedFromChannel.Template"] = + params["notifications.removedFromChannel.template"]; + if (params["notifications.invitedToChannel.enabled"] !== undefined) + data["Notifications.InvitedToChannel.Enabled"] = serialize.bool(params["notifications.invitedToChannel.enabled"]); + if (params["notifications.invitedToChannel.template"] !== undefined) + data["Notifications.InvitedToChannel.Template"] = + params["notifications.invitedToChannel.template"]; + if (params["preWebhookUrl"] !== undefined) + data["PreWebhookUrl"] = params["preWebhookUrl"]; + if (params["postWebhookUrl"] !== undefined) + data["PostWebhookUrl"] = params["postWebhookUrl"]; + if (params["webhookMethod"] !== undefined) + data["WebhookMethod"] = params["webhookMethod"]; + if (params["webhookFilters"] !== undefined) + data["WebhookFilters"] = serialize.map(params["webhookFilters"], (e) => e); + if (params["webhooks.onMessageSend.url"] !== undefined) + data["Webhooks.OnMessageSend.Url"] = params["webhooks.onMessageSend.url"]; + if (params["webhooks.onMessageSend.method"] !== undefined) + data["Webhooks.OnMessageSend.Method"] = + params["webhooks.onMessageSend.method"]; + if (params["webhooks.onMessageUpdate.url"] !== undefined) + data["Webhooks.OnMessageUpdate.Url"] = + params["webhooks.onMessageUpdate.url"]; + if (params["webhooks.onMessageUpdate.method"] !== undefined) + data["Webhooks.OnMessageUpdate.Method"] = + params["webhooks.onMessageUpdate.method"]; + if (params["webhooks.onMessageRemove.url"] !== undefined) + data["Webhooks.OnMessageRemove.Url"] = + params["webhooks.onMessageRemove.url"]; + if (params["webhooks.onMessageRemove.method"] !== undefined) + data["Webhooks.OnMessageRemove.Method"] = + params["webhooks.onMessageRemove.method"]; + if (params["webhooks.onChannelAdd.url"] !== undefined) + data["Webhooks.OnChannelAdd.Url"] = params["webhooks.onChannelAdd.url"]; + if (params["webhooks.onChannelAdd.method"] !== undefined) + data["Webhooks.OnChannelAdd.Method"] = + params["webhooks.onChannelAdd.method"]; + if (params["webhooks.onChannelDestroy.url"] !== undefined) + data["Webhooks.OnChannelDestroy.Url"] = + params["webhooks.onChannelDestroy.url"]; + if (params["webhooks.onChannelDestroy.method"] !== undefined) + data["Webhooks.OnChannelDestroy.Method"] = + params["webhooks.onChannelDestroy.method"]; + if (params["webhooks.onChannelUpdate.url"] !== undefined) + data["Webhooks.OnChannelUpdate.Url"] = + params["webhooks.onChannelUpdate.url"]; + if (params["webhooks.onChannelUpdate.method"] !== undefined) + data["Webhooks.OnChannelUpdate.Method"] = + params["webhooks.onChannelUpdate.method"]; + if (params["webhooks.onMemberAdd.url"] !== undefined) + data["Webhooks.OnMemberAdd.Url"] = params["webhooks.onMemberAdd.url"]; + if (params["webhooks.onMemberAdd.method"] !== undefined) + data["Webhooks.OnMemberAdd.Method"] = + params["webhooks.onMemberAdd.method"]; + if (params["webhooks.onMemberRemove.url"] !== undefined) + data["Webhooks.OnMemberRemove.Url"] = + params["webhooks.onMemberRemove.url"]; + if (params["webhooks.onMemberRemove.method"] !== undefined) + data["Webhooks.OnMemberRemove.Method"] = + params["webhooks.onMemberRemove.method"]; + if (params["webhooks.onMessageSent.url"] !== undefined) + data["Webhooks.OnMessageSent.Url"] = params["webhooks.onMessageSent.url"]; + if (params["webhooks.onMessageSent.method"] !== undefined) + data["Webhooks.OnMessageSent.Method"] = + params["webhooks.onMessageSent.method"]; + if (params["webhooks.onMessageUpdated.url"] !== undefined) + data["Webhooks.OnMessageUpdated.Url"] = + params["webhooks.onMessageUpdated.url"]; + if (params["webhooks.onMessageUpdated.method"] !== undefined) + data["Webhooks.OnMessageUpdated.Method"] = + params["webhooks.onMessageUpdated.method"]; + if (params["webhooks.onMessageRemoved.url"] !== undefined) + data["Webhooks.OnMessageRemoved.Url"] = + params["webhooks.onMessageRemoved.url"]; + if (params["webhooks.onMessageRemoved.method"] !== undefined) + data["Webhooks.OnMessageRemoved.Method"] = + params["webhooks.onMessageRemoved.method"]; + if (params["webhooks.onChannelAdded.url"] !== undefined) + data["Webhooks.OnChannelAdded.Url"] = + params["webhooks.onChannelAdded.url"]; + if (params["webhooks.onChannelAdded.method"] !== undefined) + data["Webhooks.OnChannelAdded.Method"] = + params["webhooks.onChannelAdded.method"]; + if (params["webhooks.onChannelDestroyed.url"] !== undefined) + data["Webhooks.OnChannelDestroyed.Url"] = + params["webhooks.onChannelDestroyed.url"]; + if (params["webhooks.onChannelDestroyed.method"] !== undefined) + data["Webhooks.OnChannelDestroyed.Method"] = + params["webhooks.onChannelDestroyed.method"]; + if (params["webhooks.onChannelUpdated.url"] !== undefined) + data["Webhooks.OnChannelUpdated.Url"] = + params["webhooks.onChannelUpdated.url"]; + if (params["webhooks.onChannelUpdated.method"] !== undefined) + data["Webhooks.OnChannelUpdated.Method"] = + params["webhooks.onChannelUpdated.method"]; + if (params["webhooks.onMemberAdded.url"] !== undefined) + data["Webhooks.OnMemberAdded.Url"] = params["webhooks.onMemberAdded.url"]; + if (params["webhooks.onMemberAdded.method"] !== undefined) + data["Webhooks.OnMemberAdded.Method"] = + params["webhooks.onMemberAdded.method"]; + if (params["webhooks.onMemberRemoved.url"] !== undefined) + data["Webhooks.OnMemberRemoved.Url"] = + params["webhooks.onMemberRemoved.url"]; + if (params["webhooks.onMemberRemoved.method"] !== undefined) + data["Webhooks.OnMemberRemoved.Method"] = + params["webhooks.onMemberRemoved.method"]; + if (params["limits.channelMembers"] !== undefined) + data["Limits.ChannelMembers"] = params["limits.channelMembers"]; + if (params["limits.userChannels"] !== undefined) + data["Limits.UserChannels"] = params["limits.userChannels"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.defaultServiceRoleSid = payload.default_service_role_sid; + this.defaultChannelRoleSid = payload.default_channel_role_sid; + this.defaultChannelCreatorRoleSid = + payload.default_channel_creator_role_sid; + this.readStatusEnabled = payload.read_status_enabled; + this.reachabilityEnabled = payload.reachability_enabled; + this.typingIndicatorTimeout = deserialize.integer(payload.typing_indicator_timeout); + this.consumptionReportInterval = deserialize.integer(payload.consumption_report_interval); + this.limits = payload.limits; + this.webhooks = payload.webhooks; + this.preWebhookUrl = payload.pre_webhook_url; + this.postWebhookUrl = payload.post_webhook_url; + this.webhookMethod = payload.webhook_method; + this.webhookFilters = payload.webhook_filters; + this.notifications = payload.notifications; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the channels. + */ + channels() { + return this._proxy.channels; + } + /** + * Access the roles. + */ + roles() { + return this._proxy.roles; + } + /** + * Access the users. + */ + users() { + return this._proxy.users; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + defaultServiceRoleSid: this.defaultServiceRoleSid, + defaultChannelRoleSid: this.defaultChannelRoleSid, + defaultChannelCreatorRoleSid: this.defaultChannelCreatorRoleSid, + readStatusEnabled: this.readStatusEnabled, + reachabilityEnabled: this.reachabilityEnabled, + typingIndicatorTimeout: this.typingIndicatorTimeout, + consumptionReportInterval: this.consumptionReportInterval, + limits: this.limits, + webhooks: this.webhooks, + preWebhookUrl: this.preWebhookUrl, + postWebhookUrl: this.postWebhookUrl, + webhookMethod: this.webhookMethod, + webhookFilters: this.webhookFilters, + notifications: this.notifications, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/channel.d.ts b/node_modules/twilio/lib/rest/chat/v1/service/channel.d.ts new file mode 100644 index 00000000..52a191bd --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/channel.d.ts @@ -0,0 +1,388 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { InviteListInstance } from "./channel/invite"; +import { MemberListInstance } from "./channel/member"; +import { MessageListInstance } from "./channel/message"; +export type ChannelChannelType = "public" | "private"; +/** + * Options to pass to update a ChannelInstance + */ +export interface ChannelContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\\\'s `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. */ + uniqueName?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; +} +/** + * Options to pass to create a ChannelInstance + */ +export interface ChannelListInstanceCreateOptions { + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\\\'s `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. */ + uniqueName?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** */ + type?: ChannelChannelType; +} +/** + * Options to pass to each + */ +export interface ChannelListInstanceEachOptions { + /** The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ChannelListInstanceOptions { + /** The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ChannelListInstancePageOptions { + /** The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ChannelContext { + invites: InviteListInstance; + members: MemberListInstance; + messages: MessageListInstance; + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ChannelContextSolution { + serviceSid: string; + sid: string; +} +export declare class ChannelContextImpl implements ChannelContext { + protected _version: V1; + protected _solution: ChannelContextSolution; + protected _uri: string; + protected _invites?: InviteListInstance; + protected _members?: MemberListInstance; + protected _messages?: MessageListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get invites(): InviteListInstance; + get members(): MemberListInstance; + get messages(): MessageListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + update(params?: ChannelContextUpdateOptions | ((error: Error | null, item?: ChannelInstance) => any), callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ChannelPayload extends TwilioResponsePayload { + channels: ChannelResource[]; +} +interface ChannelResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + unique_name: string; + attributes: string; + type: ChannelChannelType; + date_created: Date; + date_updated: Date; + created_by: string; + members_count: number; + messages_count: number; + url: string; + links: Record; +} +export declare class ChannelInstance { + protected _version: V1; + protected _solution: ChannelContextSolution; + protected _context?: ChannelContext; + constructor(_version: V1, payload: ChannelResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Channel resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Channel resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is associated with. + */ + serviceSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\'s `sid` in the URL. + */ + uniqueName: string; + /** + * The JSON string that stores application-specific data. **Note** If this property has been assigned a value, it\'s only displayed in a FETCH action that returns a single resource; otherwise, it\'s null. If the attributes have not been set, `{}` is returned. + */ + attributes: string; + type: ChannelChannelType; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The `identity` of the User that created the channel. If the Channel was created by using the API, the value is `system`. + */ + createdBy: string; + /** + * The number of Members in the Channel. + */ + membersCount: number; + /** + * The number of Messages in the Channel. + */ + messagesCount: number; + /** + * The absolute URL of the Channel resource. + */ + url: string; + /** + * The absolute URLs of the [Members](https://www.twilio.com/docs/chat/api/members), [Messages](https://www.twilio.com/docs/chat/api/messages) , [Invites](https://www.twilio.com/docs/chat/api/invites) and, if it exists, the last [Message](https://www.twilio.com/docs/chat/api/messages) for the Channel. + */ + links: Record; + private get _proxy(); + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Access the invites. + */ + invites(): InviteListInstance; + /** + * Access the members. + */ + members(): MemberListInstance; + /** + * Access the messages. + */ + messages(): MessageListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + type: ChannelChannelType; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + membersCount: number; + messagesCount: number; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ChannelSolution { + serviceSid: string; +} +export interface ChannelListInstance { + _version: V1; + _solution: ChannelSolution; + _uri: string; + (sid: string): ChannelContext; + get(sid: string): ChannelContext; + /** + * Create a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Create a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(params: ChannelListInstanceCreateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Streams ChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + each(params: ChannelListInstanceEachOptions, callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Lists ChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + list(params: ChannelListInstanceOptions, callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ChannelPage) => any): Promise; + page(params: ChannelListInstancePageOptions, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ChannelListInstance(version: V1, serviceSid: string): ChannelListInstance; +export declare class ChannelPage extends Page { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ChannelSolution); + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ChannelResource): ChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/channel.js b/node_modules/twilio/lib/rest/chat/v1/service/channel.js new file mode 100644 index 00000000..dfa4a07c --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/channel.js @@ -0,0 +1,323 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChannelPage = exports.ChannelListInstance = exports.ChannelInstance = exports.ChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const invite_1 = require("./channel/invite"); +const member_1 = require("./channel/member"); +const message_1 = require("./channel/message"); +class ChannelContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${sid}`; + } + get invites() { + this._invites = + this._invites || + (0, invite_1.InviteListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._invites; + } + get members() { + this._members = + this._members || + (0, member_1.MemberListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._members; + } + get messages() { + this._messages = + this._messages || + (0, message_1.MessageListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._messages; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelContextImpl = ChannelContextImpl; +class ChannelInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.attributes = payload.attributes; + this.type = payload.type; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this.membersCount = deserialize.integer(payload.members_count); + this.messagesCount = deserialize.integer(payload.messages_count); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ChannelContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the invites. + */ + invites() { + return this._proxy.invites; + } + /** + * Access the members. + */ + members() { + return this._proxy.members; + } + /** + * Access the messages. + */ + messages() { + return this._proxy.messages; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + attributes: this.attributes, + type: this.type, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + membersCount: this.membersCount, + messagesCount: this.messagesCount, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelInstance = ChannelInstance; +function ChannelListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ChannelContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Channels`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["type"] !== undefined) + data["Type"] = params["type"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["type"] !== undefined) + data["Type"] = serialize.map(params["type"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ChannelListInstance = ChannelListInstance; +class ChannelPage extends Page_1.default { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ChannelInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelPage = ChannelPage; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/channel/invite.d.ts b/node_modules/twilio/lib/rest/chat/v1/service/channel/invite.d.ts new file mode 100644 index 00000000..8f9abe91 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/channel/invite.d.ts @@ -0,0 +1,286 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to create a InviteInstance + */ +export interface InviteListInstanceCreateOptions { + /** The `identity` value that uniquely identifies the new resource\\\'s [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more info. */ + identity: string; + /** The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface InviteListInstanceEachOptions { + /** The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InviteInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InviteListInstanceOptions { + /** The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InviteListInstancePageOptions { + /** The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InviteContext { + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InviteContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class InviteContextImpl implements InviteContext { + protected _version: V1; + protected _solution: InviteContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InviteContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InvitePayload extends TwilioResponsePayload { + invites: InviteResource[]; +} +interface InviteResource { + sid: string; + account_sid: string; + channel_sid: string; + service_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + role_sid: string; + created_by: string; + url: string; +} +export declare class InviteInstance { + protected _version: V1; + protected _solution: InviteContextSolution; + protected _context?: InviteContext; + constructor(_version: V1, payload: InviteResource, serviceSid: string, channelSid: string, sid?: string); + /** + * The unique string that we created to identify the Invite resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Invite resource. + */ + accountSid: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the resource belongs to. + */ + channelSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is associated with. + */ + serviceSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s [User](https://www.twilio.com/docs/api/chat/rest/users) within the [Service](https://www.twilio.com/docs/api/chat/rest/services). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more info. + */ + identity: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the resource. + */ + roleSid: string; + /** + * The `identity` of the User that created the invite. + */ + createdBy: string; + /** + * The absolute URL of the Invite resource. + */ + url: string; + private get _proxy(); + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + createdBy: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InviteSolution { + serviceSid: string; + channelSid: string; +} +export interface InviteListInstance { + _version: V1; + _solution: InviteSolution; + _uri: string; + (sid: string): InviteContext; + get(sid: string): InviteContext; + /** + * Create a InviteInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + create(params: InviteListInstanceCreateOptions, callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Streams InviteInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InviteInstance, done: (err?: Error) => void) => void): void; + each(params: InviteListInstanceEachOptions, callback?: (item: InviteInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InviteInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InvitePage) => any): Promise; + /** + * Lists InviteInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InviteInstance[]) => any): Promise; + list(params: InviteListInstanceOptions, callback?: (error: Error | null, items: InviteInstance[]) => any): Promise; + /** + * Retrieve a single page of InviteInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InvitePage) => any): Promise; + page(params: InviteListInstancePageOptions, callback?: (error: Error | null, items: InvitePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InviteListInstance(version: V1, serviceSid: string, channelSid: string): InviteListInstance; +export declare class InvitePage extends Page { + /** + * Initialize the InvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InviteSolution); + /** + * Build an instance of InviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InviteResource): InviteInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/channel/invite.js b/node_modules/twilio/lib/rest/chat/v1/service/channel/invite.js new file mode 100644 index 00000000..13900089 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/channel/invite.js @@ -0,0 +1,245 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvitePage = exports.InviteListInstance = exports.InviteInstance = exports.InviteContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class InviteContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Invites/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InviteInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InviteContextImpl = InviteContextImpl; +class InviteInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.channelSid = payload.channel_sid; + this.serviceSid = payload.service_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.roleSid = payload.role_sid; + this.createdBy = payload.created_by; + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InviteContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + channelSid: this.channelSid, + serviceSid: this.serviceSid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + roleSid: this.roleSid, + createdBy: this.createdBy, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InviteInstance = InviteInstance; +function InviteListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InviteContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Invites`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InviteInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InvitePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InvitePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InviteListInstance = InviteListInstance; +class InvitePage extends Page_1.default { + /** + * Initialize the InvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InviteInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InvitePage = InvitePage; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/channel/member.d.ts b/node_modules/twilio/lib/rest/chat/v1/service/channel/member.d.ts new file mode 100644 index 00000000..effe18be --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/channel/member.d.ts @@ -0,0 +1,336 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to update a MemberInstance + */ +export interface MemberContextUpdateOptions { + /** The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). */ + roleSid?: string; + /** The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). */ + lastConsumedMessageIndex?: number; +} +/** + * Options to pass to create a MemberInstance + */ +export interface MemberListInstanceCreateOptions { + /** The `identity` value that uniquely identifies the new resource\\\'s [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/services). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ + identity: string; + /** The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface MemberListInstanceEachOptions { + /** The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MemberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MemberListInstanceOptions { + /** The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MemberListInstancePageOptions { + /** The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MemberContext { + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MemberContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class MemberContextImpl implements MemberContext { + protected _version: V1; + protected _solution: MemberContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + update(params?: MemberContextUpdateOptions | ((error: Error | null, item?: MemberInstance) => any), callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MemberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MemberPayload extends TwilioResponsePayload { + members: MemberResource[]; +} +interface MemberResource { + sid: string; + account_sid: string; + channel_sid: string; + service_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + role_sid: string; + last_consumed_message_index: number; + last_consumption_timestamp: Date; + url: string; +} +export declare class MemberInstance { + protected _version: V1; + protected _solution: MemberContextSolution; + protected _context?: MemberContext; + constructor(_version: V1, payload: MemberResource, serviceSid: string, channelSid: string, sid?: string); + /** + * The unique string that we created to identify the Member resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Member resource. + */ + accountSid: string; + /** + * The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) for the member. + */ + channelSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is associated with. + */ + serviceSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s [User](https://www.twilio.com/docs/api/chat/rest/users) within the [Service](https://www.twilio.com/docs/api/chat/rest/services). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more info. + */ + identity: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the member. + */ + roleSid: string; + /** + * The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) in the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) that the Member has read. + */ + lastConsumedMessageIndex: number; + /** + * The ISO 8601 timestamp string that represents the date-time of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) read event for the Member within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). + */ + lastConsumptionTimestamp: Date; + /** + * The absolute URL of the Member resource. + */ + url: string; + private get _proxy(); + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + lastConsumedMessageIndex: number; + lastConsumptionTimestamp: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MemberSolution { + serviceSid: string; + channelSid: string; +} +export interface MemberListInstance { + _version: V1; + _solution: MemberSolution; + _uri: string; + (sid: string): MemberContext; + get(sid: string): MemberContext; + /** + * Create a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + create(params: MemberListInstanceCreateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Streams MemberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + each(params: MemberListInstanceEachOptions, callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Lists MemberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + list(params: MemberListInstanceOptions, callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + /** + * Retrieve a single page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MemberPage) => any): Promise; + page(params: MemberListInstancePageOptions, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MemberListInstance(version: V1, serviceSid: string, channelSid: string): MemberListInstance; +export declare class MemberPage extends Page { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MemberSolution); + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MemberResource): MemberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/channel/member.js b/node_modules/twilio/lib/rest/chat/v1/service/channel/member.js new file mode 100644 index 00000000..e3807dc0 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/channel/member.js @@ -0,0 +1,276 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MemberPage = exports.MemberListInstance = exports.MemberInstance = exports.MemberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MemberContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Members/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["lastConsumedMessageIndex"] !== undefined) + data["LastConsumedMessageIndex"] = params["lastConsumedMessageIndex"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberContextImpl = MemberContextImpl; +class MemberInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.channelSid = payload.channel_sid; + this.serviceSid = payload.service_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.roleSid = payload.role_sid; + this.lastConsumedMessageIndex = deserialize.integer(payload.last_consumed_message_index); + this.lastConsumptionTimestamp = deserialize.iso8601DateTime(payload.last_consumption_timestamp); + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MemberContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + channelSid: this.channelSid, + serviceSid: this.serviceSid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + roleSid: this.roleSid, + lastConsumedMessageIndex: this.lastConsumedMessageIndex, + lastConsumptionTimestamp: this.lastConsumptionTimestamp, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberInstance = MemberInstance; +function MemberListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MemberContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Members`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MemberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MemberListInstance = MemberListInstance; +class MemberPage extends Page_1.default { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MemberInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberPage = MemberPage; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/channel/message.d.ts b/node_modules/twilio/lib/rest/chat/v1/service/channel/message.d.ts new file mode 100644 index 00000000..45902d02 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/channel/message.d.ts @@ -0,0 +1,351 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type MessageOrderType = "asc" | "desc"; +/** + * Options to pass to update a MessageInstance + */ +export interface MessageContextUpdateOptions { + /** The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. */ + body?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; +} +/** + * Options to pass to create a MessageInstance + */ +export interface MessageListInstanceCreateOptions { + /** The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. */ + body: string; + /** The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message\\\'s author. The default value is `system`. */ + from?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; +} +/** + * Options to pass to each + */ +export interface MessageListInstanceEachOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessageInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessageListInstanceOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessageListInstancePageOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessageContext { + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessageContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class MessageContextImpl implements MessageContext { + protected _version: V1; + protected _solution: MessageContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + update(params?: MessageContextUpdateOptions | ((error: Error | null, item?: MessageInstance) => any), callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessageContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessagePayload extends TwilioResponsePayload { + messages: MessageResource[]; +} +interface MessageResource { + sid: string; + account_sid: string; + attributes: string; + service_sid: string; + to: string; + channel_sid: string; + date_created: Date; + date_updated: Date; + was_edited: boolean; + from: string; + body: string; + index: number; + url: string; +} +export declare class MessageInstance { + protected _version: V1; + protected _solution: MessageContextSolution; + protected _context?: MessageContext; + constructor(_version: V1, payload: MessageResource, serviceSid: string, channelSid: string, sid?: string); + /** + * The unique string that we created to identify the Message resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Message resource. + */ + accountSid: string; + /** + * The JSON string that stores application-specific data. **Note** If this property has been assigned a value, it\'s only displayed in a FETCH action that returns a single resource; otherwise, it\'s null. If the attributes have not been set, `{}` is returned. + */ + attributes: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/chat/api/channels) that the message was sent to. + */ + to: string; + /** + * The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the Message resource belongs to. + */ + channelSid: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * Whether the message has been edited since it was created. + */ + wasEdited: boolean; + /** + * The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the message\'s author. The default value is `system`. + */ + from: string; + /** + * The content of the message. + */ + body: string; + /** + * The index of the message within the [Channel](https://www.twilio.com/docs/chat/api/channels). + */ + index: number; + /** + * The absolute URL of the Message resource. + */ + url: string; + private get _proxy(); + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + attributes: string; + serviceSid: string; + to: string; + channelSid: string; + dateCreated: Date; + dateUpdated: Date; + wasEdited: boolean; + from: string; + body: string; + index: number; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessageSolution { + serviceSid: string; + channelSid: string; +} +export interface MessageListInstance { + _version: V1; + _solution: MessageSolution; + _uri: string; + (sid: string): MessageContext; + get(sid: string): MessageContext; + /** + * Create a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(params: MessageListInstanceCreateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Streams MessageInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + each(params: MessageListInstanceEachOptions, callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Lists MessageInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + list(params: MessageListInstanceOptions, callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + /** + * Retrieve a single page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessagePage) => any): Promise; + page(params: MessageListInstancePageOptions, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessageListInstance(version: V1, serviceSid: string, channelSid: string): MessageListInstance; +export declare class MessagePage extends Page { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MessageSolution); + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessageResource): MessageInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/channel/message.js b/node_modules/twilio/lib/rest/chat/v1/service/channel/message.js new file mode 100644 index 00000000..f21b915e --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/channel/message.js @@ -0,0 +1,282 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagePage = exports.MessageListInstance = exports.MessageInstance = exports.MessageContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MessageContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Messages/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageContextImpl = MessageContextImpl; +class MessageInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.attributes = payload.attributes; + this.serviceSid = payload.service_sid; + this.to = payload.to; + this.channelSid = payload.channel_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.wasEdited = payload.was_edited; + this.from = payload.from; + this.body = payload.body; + this.index = deserialize.integer(payload.index); + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MessageContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + attributes: this.attributes, + serviceSid: this.serviceSid, + to: this.to, + channelSid: this.channelSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + wasEdited: this.wasEdited, + from: this.from, + body: this.body, + index: this.index, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInstance = MessageInstance; +function MessageListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MessageContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Messages`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["body"] === null || params["body"] === undefined) { + throw new Error("Required parameter \"params['body']\" missing."); + } + let data = {}; + data["Body"] = params["body"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessagePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessageListInstance = MessageListInstance; +class MessagePage extends Page_1.default { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessageInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagePage = MessagePage; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/role.d.ts b/node_modules/twilio/lib/rest/chat/v1/service/role.d.ts new file mode 100644 index 00000000..42ceef8d --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/role.d.ts @@ -0,0 +1,298 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type RoleRoleType = "channel" | "deployment"; +/** + * Options to pass to update a RoleInstance + */ +export interface RoleContextUpdateOptions { + /** A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role\\\'s `type` and are described in the documentation. */ + permission: Array; +} +/** + * Options to pass to create a RoleInstance + */ +export interface RoleListInstanceCreateOptions { + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName: string; + /** */ + type: RoleRoleType; + /** A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role\\\'s `type` and are described in the documentation. */ + permission: Array; +} +/** + * Options to pass to each + */ +export interface RoleListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoleInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoleListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoleListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoleContext { + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoleContextSolution { + serviceSid: string; + sid: string; +} +export declare class RoleContextImpl implements RoleContext { + protected _version: V1; + protected _solution: RoleContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoleContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RolePayload extends TwilioResponsePayload { + roles: RoleResource[]; +} +interface RoleResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + type: RoleRoleType; + permissions: Array; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class RoleInstance { + protected _version: V1; + protected _solution: RoleContextSolution; + protected _context?: RoleContext; + constructor(_version: V1, payload: RoleResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Role resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Role resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is associated with. + */ + serviceSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + type: RoleRoleType; + /** + * An array of the permissions the role has been granted, formatted as a JSON string. + */ + permissions: Array; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Role resource. + */ + url: string; + private get _proxy(); + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + type: RoleRoleType; + permissions: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoleSolution { + serviceSid: string; +} +export interface RoleListInstance { + _version: V1; + _solution: RoleSolution; + _uri: string; + (sid: string): RoleContext; + get(sid: string): RoleContext; + /** + * Create a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + create(params: RoleListInstanceCreateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Streams RoleInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + each(params: RoleListInstanceEachOptions, callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Lists RoleInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + list(params: RoleListInstanceOptions, callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + /** + * Retrieve a single page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RolePage) => any): Promise; + page(params: RoleListInstancePageOptions, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoleListInstance(version: V1, serviceSid: string): RoleListInstance; +export declare class RolePage extends Page { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RoleSolution); + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoleResource): RoleInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/role.js b/node_modules/twilio/lib/rest/chat/v1/service/role.js new file mode 100644 index 00000000..0159a2be --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/role.js @@ -0,0 +1,267 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RolePage = exports.RoleListInstance = exports.RoleInstance = exports.RoleContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class RoleContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Roles/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleContextImpl = RoleContextImpl; +class RoleInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.permissions = payload.permissions; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RoleContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + type: this.type, + permissions: this.permissions, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleInstance = RoleInstance; +function RoleListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RoleContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Roles`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RolePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RolePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoleListInstance = RoleListInstance; +class RolePage extends Page_1.default { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoleInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RolePage = RolePage; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/user.d.ts b/node_modules/twilio/lib/rest/chat/v1/service/user.d.ts new file mode 100644 index 00000000..e7f12658 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/user.d.ts @@ -0,0 +1,360 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { UserChannelListInstance } from "./user/userChannel"; +/** + * Options to pass to update a UserInstance + */ +export interface UserContextUpdateOptions { + /** The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. */ + roleSid?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** A descriptive string that you create to describe the resource. It is often used for display purposes. */ + friendlyName?: string; +} +/** + * Options to pass to create a UserInstance + */ +export interface UserListInstanceCreateOptions { + /** The `identity` value that uniquely identifies the new resource\\\'s [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). This value is often a username or email address. See the Identity documentation for more details. */ + identity: string; + /** The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. */ + roleSid?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** A descriptive string that you create to describe the new resource. This value is often used for display purposes. */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface UserListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserContext { + userChannels: UserChannelListInstance; + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserContextSolution { + serviceSid: string; + sid: string; +} +export declare class UserContextImpl implements UserContext { + protected _version: V1; + protected _solution: UserContextSolution; + protected _uri: string; + protected _userChannels?: UserChannelListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get userChannels(): UserChannelListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + update(params?: UserContextUpdateOptions | ((error: Error | null, item?: UserInstance) => any), callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserPayload extends TwilioResponsePayload { + users: UserResource[]; +} +interface UserResource { + sid: string; + account_sid: string; + service_sid: string; + attributes: string; + friendly_name: string; + role_sid: string; + identity: string; + is_online: boolean; + is_notifiable: boolean; + date_created: Date; + date_updated: Date; + joined_channels_count: number; + links: Record; + url: string; +} +export declare class UserInstance { + protected _version: V1; + protected _solution: UserContextSolution; + protected _context?: UserContext; + constructor(_version: V1, payload: UserResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the User resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the User resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is associated with. + */ + serviceSid: string; + /** + * The JSON string that stores application-specific data. **Note** If this property has been assigned a value, it\'s only displayed in a FETCH action that returns a single resource; otherwise, it\'s null. If the attributes have not been set, `{}` is returned. + */ + attributes: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the user. + */ + roleSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s User within the [Service](https://www.twilio.com/docs/api/chat/rest/services). This value is often a username or an email address. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more info. + */ + identity: string; + /** + * Whether the User is actively connected to the Service instance and online. This value is only returned by Fetch actions that return a single resource and `null` is always returned by a Read action. This value is `null` if the Service\'s `reachability_enabled` is `false`, if the User has never been online for the Service instance, even if the Service\'s `reachability_enabled` is `true`. + */ + isOnline: boolean; + /** + * Whether the User has a potentially valid Push Notification registration (APN or GCM) for the Service instance. If at least one registration exists, `true`; otherwise `false`. This value is only returned by Fetch actions that return a single resource and `null` is always returned by a Read action. This value is `null` if the Service\'s `reachability_enabled` is `false`, and if the User has never had a notification registration, even if the Service\'s `reachability_enabled` is `true`. + */ + isNotifiable: boolean; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The number of Channels this User is a Member of. + */ + joinedChannelsCount: number; + /** + * The absolute URLs of the [Channel](https://www.twilio.com/docs/chat/api/channels) and [Binding](https://www.twilio.com/docs/chat/rest/bindings-resource) resources related to the user. + */ + links: Record; + /** + * The absolute URL of the User resource. + */ + url: string; + private get _proxy(); + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Access the userChannels. + */ + userChannels(): UserChannelListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + attributes: string; + friendlyName: string; + roleSid: string; + identity: string; + isOnline: boolean; + isNotifiable: boolean; + dateCreated: Date; + dateUpdated: Date; + joinedChannelsCount: number; + links: Record; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserSolution { + serviceSid: string; +} +export interface UserListInstance { + _version: V1; + _solution: UserSolution; + _uri: string; + (sid: string): UserContext; + get(sid: string): UserContext; + /** + * Create a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + create(params: UserListInstanceCreateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Streams UserInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + each(params: UserListInstanceEachOptions, callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Lists UserInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + list(params: UserListInstanceOptions, callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + /** + * Retrieve a single page of UserInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserPage) => any): Promise; + page(params: UserListInstancePageOptions, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserListInstance(version: V1, serviceSid: string): UserListInstance; +export declare class UserPage extends Page { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UserSolution); + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserResource): UserInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/user.js b/node_modules/twilio/lib/rest/chat/v1/service/user.js new file mode 100644 index 00000000..ef2b6cc1 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/user.js @@ -0,0 +1,293 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserPage = exports.UserListInstance = exports.UserInstance = exports.UserContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const userChannel_1 = require("./user/userChannel"); +class UserContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Users/${sid}`; + } + get userChannels() { + this._userChannels = + this._userChannels || + (0, userChannel_1.UserChannelListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._userChannels; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserContextImpl = UserContextImpl; +class UserInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.attributes = payload.attributes; + this.friendlyName = payload.friendly_name; + this.roleSid = payload.role_sid; + this.identity = payload.identity; + this.isOnline = payload.is_online; + this.isNotifiable = payload.is_notifiable; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.joinedChannelsCount = deserialize.integer(payload.joined_channels_count); + this.links = payload.links; + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UserContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the userChannels. + */ + userChannels() { + return this._proxy.userChannels; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + attributes: this.attributes, + friendlyName: this.friendlyName, + roleSid: this.roleSid, + identity: this.identity, + isOnline: this.isOnline, + isNotifiable: this.isNotifiable, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + joinedChannelsCount: this.joinedChannelsCount, + links: this.links, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserInstance = UserInstance; +function UserListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Users`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserListInstance = UserListInstance; +class UserPage extends Page_1.default { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserPage = UserPage; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/user/userChannel.d.ts b/node_modules/twilio/lib/rest/chat/v1/service/user/userChannel.d.ts new file mode 100644 index 00000000..b2f64591 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/user/userChannel.d.ts @@ -0,0 +1,184 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type UserChannelChannelStatus = "joined" | "invited" | "not_participating"; +/** + * Options to pass to each + */ +export interface UserChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserChannelSolution { + serviceSid: string; + userSid: string; +} +export interface UserChannelListInstance { + _version: V1; + _solution: UserChannelSolution; + _uri: string; + /** + * Streams UserChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + each(params: UserChannelListInstanceEachOptions, callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + /** + * Lists UserChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserChannelInstance[]) => any): Promise; + list(params: UserChannelListInstanceOptions, callback?: (error: Error | null, items: UserChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of UserChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + page(params: UserChannelListInstancePageOptions, callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserChannelListInstance(version: V1, serviceSid: string, userSid: string): UserChannelListInstance; +interface UserChannelPayload extends TwilioResponsePayload { + channels: UserChannelResource[]; +} +interface UserChannelResource { + account_sid: string; + service_sid: string; + channel_sid: string; + member_sid: string; + status: UserChannelChannelStatus; + last_consumed_message_index: number; + unread_messages_count: number; + links: Record; +} +export declare class UserChannelInstance { + protected _version: V1; + constructor(_version: V1, payload: UserChannelResource, serviceSid: string, userSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the User Channel resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the resource belongs to. + */ + channelSid: string; + /** + * The SID of a [Member](https://www.twilio.com/docs/api/chat/rest/members) that represents the User on the Channel. + */ + memberSid: string; + status: UserChannelChannelStatus; + /** + * The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) in the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) that the Member has read. + */ + lastConsumedMessageIndex: number; + /** + * The number of unread Messages in the Channel for the User. Note that retrieving messages on a client endpoint does not mean that messages are consumed or read. See [Consumption Horizon feature](/docs/api/chat/guides/consumption-horizon) to learn how to mark messages as consumed. + */ + unreadMessagesCount: number; + /** + * The absolute URLs of the [Members](https://www.twilio.com/docs/chat/api/members), [Messages](https://www.twilio.com/docs/chat/api/messages) , [Invites](https://www.twilio.com/docs/chat/api/invites) and, if it exists, the last [Message](https://www.twilio.com/docs/chat/api/messages) for the Channel. + */ + links: Record; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + channelSid: string; + memberSid: string; + status: UserChannelChannelStatus; + lastConsumedMessageIndex: number; + unreadMessagesCount: number; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class UserChannelPage extends Page { + /** + * Initialize the UserChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UserChannelSolution); + /** + * Build an instance of UserChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserChannelResource): UserChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v1/service/user/userChannel.js b/node_modules/twilio/lib/rest/chat/v1/service/user/userChannel.js new file mode 100644 index 00000000..134ed6c6 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v1/service/user/userChannel.js @@ -0,0 +1,139 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserChannelPage = exports.UserChannelInstance = exports.UserChannelListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function UserChannelListInstance(version, serviceSid, userSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { serviceSid, userSid }; + instance._uri = `/Services/${serviceSid}/Users/${userSid}/Channels`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserChannelListInstance = UserChannelListInstance; +class UserChannelInstance { + constructor(_version, payload, serviceSid, userSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.channelSid = payload.channel_sid; + this.memberSid = payload.member_sid; + this.status = payload.status; + this.lastConsumedMessageIndex = deserialize.integer(payload.last_consumed_message_index); + this.unreadMessagesCount = deserialize.integer(payload.unread_messages_count); + this.links = payload.links; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + channelSid: this.channelSid, + memberSid: this.memberSid, + status: this.status, + lastConsumedMessageIndex: this.lastConsumedMessageIndex, + unreadMessagesCount: this.unreadMessagesCount, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelInstance = UserChannelInstance; +class UserChannelPage extends Page_1.default { + /** + * Initialize the UserChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserChannelInstance(this._version, payload, this._solution.serviceSid, this._solution.userSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelPage = UserChannelPage; diff --git a/node_modules/twilio/lib/rest/chat/v2/credential.d.ts b/node_modules/twilio/lib/rest/chat/v2/credential.d.ts new file mode 100644 index 00000000..7106d77a --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/credential.d.ts @@ -0,0 +1,324 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +export type CredentialPushService = "gcm" | "apn" | "fcm"; +/** + * Options to pass to update a CredentialInstance + */ +export interface CredentialContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` */ + certificate?: string; + /** [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` */ + privateKey?: string; + /** [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. */ + sandbox?: boolean; + /** [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. */ + apiKey?: string; + /** [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ + secret?: string; +} +/** + * Options to pass to create a CredentialInstance + */ +export interface CredentialListInstanceCreateOptions { + /** */ + type: CredentialPushService; + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` */ + certificate?: string; + /** [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` */ + privateKey?: string; + /** [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. */ + sandbox?: boolean; + /** [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. */ + apiKey?: string; + /** [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ + secret?: string; +} +/** + * Options to pass to each + */ +export interface CredentialListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialContext { + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialContextSolution { + sid: string; +} +export declare class CredentialContextImpl implements CredentialContext { + protected _version: V2; + protected _solution: CredentialContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + update(params?: CredentialContextUpdateOptions | ((error: Error | null, item?: CredentialInstance) => any), callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialPayload extends TwilioResponsePayload { + credentials: CredentialResource[]; +} +interface CredentialResource { + sid: string; + account_sid: string; + friendly_name: string; + type: CredentialPushService; + sandbox: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CredentialInstance { + protected _version: V2; + protected _solution: CredentialContextSolution; + protected _context?: CredentialContext; + constructor(_version: V2, payload: CredentialResource, sid?: string); + /** + * The unique string that we created to identify the Credential resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Credential resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + type: CredentialPushService; + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + */ + sandbox: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Credential resource. + */ + url: string; + private get _proxy(); + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + type: CredentialPushService; + sandbox: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialSolution { +} +export interface CredentialListInstance { + _version: V2; + _solution: CredentialSolution; + _uri: string; + (sid: string): CredentialContext; + get(sid: string): CredentialContext; + /** + * Create a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + create(params: CredentialListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Streams CredentialInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListInstanceEachOptions, callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Lists CredentialInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + list(params: CredentialListInstanceOptions, callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialPage) => any): Promise; + page(params: CredentialListInstancePageOptions, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListInstance(version: V2): CredentialListInstance; +export declare class CredentialPage extends Page { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: CredentialSolution); + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialResource): CredentialInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/credential.js b/node_modules/twilio/lib/rest/chat/v2/credential.js new file mode 100644 index 00000000..9aebd9a3 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/credential.js @@ -0,0 +1,274 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialPage = exports.CredentialListInstance = exports.CredentialInstance = exports.CredentialContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CredentialContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Credentials/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialContextImpl = CredentialContextImpl; +class CredentialInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.sandbox = payload.sandbox; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + type: this.type, + sandbox: this.sandbox, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialInstance = CredentialInstance; +function CredentialListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListInstance = CredentialListInstance; +class CredentialPage extends Page_1.default { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialPage = CredentialPage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service.d.ts b/node_modules/twilio/lib/rest/chat/v2/service.d.ts new file mode 100644 index 00000000..684413a2 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service.d.ts @@ -0,0 +1,486 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +import { BindingListInstance } from "./service/binding"; +import { ChannelListInstance } from "./service/channel"; +import { RoleListInstance } from "./service/role"; +import { UserListInstance } from "./service/user"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** A descriptive string that you create to describe the resource. */ + friendlyName?: string; + /** The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. */ + defaultServiceRoleSid?: string; + /** The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. */ + defaultChannelRoleSid?: string; + /** The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. */ + defaultChannelCreatorRoleSid?: string; + /** Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. */ + readStatusEnabled?: boolean; + /** Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. */ + reachabilityEnabled?: boolean; + /** How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. */ + typingIndicatorTimeout?: number; + /** DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. */ + consumptionReportInterval?: number; + /** Whether to send a notification when a new message is added to a channel. The default is `false`. */ + "notifications.newMessage.enabled"?: boolean; + /** The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. */ + "notifications.newMessage.template"?: string; + /** The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. */ + "notifications.newMessage.sound"?: string; + /** Whether the new message badge is enabled. The default is `false`. */ + "notifications.newMessage.badgeCountEnabled"?: boolean; + /** Whether to send a notification when a member is added to a channel. The default is `false`. */ + "notifications.addedToChannel.enabled"?: boolean; + /** The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. */ + "notifications.addedToChannel.template"?: string; + /** The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. */ + "notifications.addedToChannel.sound"?: string; + /** Whether to send a notification to a user when they are removed from a channel. The default is `false`. */ + "notifications.removedFromChannel.enabled"?: boolean; + /** The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. */ + "notifications.removedFromChannel.template"?: string; + /** The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. */ + "notifications.removedFromChannel.sound"?: string; + /** Whether to send a notification when a user is invited to a channel. The default is `false`. */ + "notifications.invitedToChannel.enabled"?: boolean; + /** The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. */ + "notifications.invitedToChannel.template"?: string; + /** The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. */ + "notifications.invitedToChannel.sound"?: string; + /** The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. */ + preWebhookUrl?: string; + /** The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. */ + postWebhookUrl?: string; + /** The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. */ + webhookMethod?: string; + /** The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. */ + webhookFilters?: Array; + /** The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. */ + "limits.channelMembers"?: number; + /** The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. */ + "limits.userChannels"?: number; + /** The message to send when a media message has no text. Can be used as placeholder message. */ + "media.compatibilityMessage"?: string; + /** The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won\\\'t be retried. */ + preWebhookRetryCount?: number; + /** The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won\\\'t be retried. */ + postWebhookRetryCount?: number; + /** Whether to log notifications. The default is `false`. */ + "notifications.logEnabled"?: boolean; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** A descriptive string that you create to describe the new resource. */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + bindings: BindingListInstance; + channels: ChannelListInstance; + roles: RoleListInstance; + users: UserListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V2; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _bindings?: BindingListInstance; + protected _channels?: ChannelListInstance; + protected _roles?: RoleListInstance; + protected _users?: UserListInstance; + constructor(_version: V2, sid: string); + get bindings(): BindingListInstance; + get channels(): ChannelListInstance; + get roles(): RoleListInstance; + get users(): UserListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + default_service_role_sid: string; + default_channel_role_sid: string; + default_channel_creator_role_sid: string; + read_status_enabled: boolean; + reachability_enabled: boolean; + typing_indicator_timeout: number; + consumption_report_interval: number; + limits: any; + pre_webhook_url: string; + post_webhook_url: string; + webhook_method: string; + webhook_filters: Array; + pre_webhook_retry_count: number; + post_webhook_retry_count: number; + notifications: any; + media: any; + url: string; + links: Record; +} +export declare class ServiceInstance { + protected _version: V2; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V2, payload: ServiceResource, sid?: string); + /** + * The unique string that we created to identify the Service resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + */ + defaultServiceRoleSid: string; + /** + * The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + */ + defaultChannelRoleSid: string; + /** + * The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + */ + defaultChannelCreatorRoleSid: string; + /** + * Whether the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature is enabled. The default is `true`. + */ + readStatusEnabled: boolean; + /** + * Whether the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) is enabled for this Service instance. The default is `false`. + */ + reachabilityEnabled: boolean; + /** + * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + */ + typingIndicatorTimeout: number; + /** + * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + */ + consumptionReportInterval: number; + /** + * An object that describes the limits of the service instance. The `limits` object contains `channel_members` to describe the members/channel limit and `user_channels` to describe the channels/user limit. `channel_members` can be 1,000 or less, with a default of 250. `user_channels` can be 1,000 or less, with a default value of 100. + */ + limits: any; + /** + * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + */ + preWebhookUrl: string; + /** + * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + */ + postWebhookUrl: string; + /** + * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + */ + webhookMethod: string; + /** + * The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + */ + webhookFilters: Array; + /** + * The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won\'t be retried. + */ + preWebhookRetryCount: number; + /** + * The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won\'t be retried. + */ + postWebhookRetryCount: number; + /** + * The notification configuration for the Service instance. See [Push Notification Configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + */ + notifications: any; + /** + * An object that describes the properties of media that the service supports. The object contains the `size_limit_mb` property, which describes the size of the largest media file in MB; and the `compatibility_message` property, which contains the message text to send when a media message does not have any text. + */ + media: any; + /** + * The absolute URL of the Service resource. + */ + url: string; + /** + * The absolute URLs of the Service\'s [Channels](https://www.twilio.com/docs/chat/channels), [Roles](https://www.twilio.com/docs/chat/rest/role-resource), [Bindings](https://www.twilio.com/docs/chat/rest/binding-resource), and [Users](https://www.twilio.com/docs/chat/rest/user-resource). + */ + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the bindings. + */ + bindings(): BindingListInstance; + /** + * Access the channels. + */ + channels(): ChannelListInstance; + /** + * Access the roles. + */ + roles(): RoleListInstance; + /** + * Access the users. + */ + users(): UserListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + defaultServiceRoleSid: string; + defaultChannelRoleSid: string; + defaultChannelCreatorRoleSid: string; + readStatusEnabled: boolean; + reachabilityEnabled: boolean; + typingIndicatorTimeout: number; + consumptionReportInterval: number; + limits: any; + preWebhookUrl: string; + postWebhookUrl: string; + webhookMethod: string; + webhookFilters: string[]; + preWebhookRetryCount: number; + postWebhookRetryCount: number; + notifications: any; + media: any; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V2; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V2): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service.js b/node_modules/twilio/lib/rest/chat/v2/service.js new file mode 100644 index 00000000..1af40715 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service.js @@ -0,0 +1,401 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const binding_1 = require("./service/binding"); +const channel_1 = require("./service/channel"); +const role_1 = require("./service/role"); +const user_1 = require("./service/user"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get bindings() { + this._bindings = + this._bindings || (0, binding_1.BindingListInstance)(this._version, this._solution.sid); + return this._bindings; + } + get channels() { + this._channels = + this._channels || (0, channel_1.ChannelListInstance)(this._version, this._solution.sid); + return this._channels; + } + get roles() { + this._roles = + this._roles || (0, role_1.RoleListInstance)(this._version, this._solution.sid); + return this._roles; + } + get users() { + this._users = + this._users || (0, user_1.UserListInstance)(this._version, this._solution.sid); + return this._users; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["defaultServiceRoleSid"] !== undefined) + data["DefaultServiceRoleSid"] = params["defaultServiceRoleSid"]; + if (params["defaultChannelRoleSid"] !== undefined) + data["DefaultChannelRoleSid"] = params["defaultChannelRoleSid"]; + if (params["defaultChannelCreatorRoleSid"] !== undefined) + data["DefaultChannelCreatorRoleSid"] = + params["defaultChannelCreatorRoleSid"]; + if (params["readStatusEnabled"] !== undefined) + data["ReadStatusEnabled"] = serialize.bool(params["readStatusEnabled"]); + if (params["reachabilityEnabled"] !== undefined) + data["ReachabilityEnabled"] = serialize.bool(params["reachabilityEnabled"]); + if (params["typingIndicatorTimeout"] !== undefined) + data["TypingIndicatorTimeout"] = params["typingIndicatorTimeout"]; + if (params["consumptionReportInterval"] !== undefined) + data["ConsumptionReportInterval"] = params["consumptionReportInterval"]; + if (params["notifications.newMessage.enabled"] !== undefined) + data["Notifications.NewMessage.Enabled"] = serialize.bool(params["notifications.newMessage.enabled"]); + if (params["notifications.newMessage.template"] !== undefined) + data["Notifications.NewMessage.Template"] = + params["notifications.newMessage.template"]; + if (params["notifications.newMessage.sound"] !== undefined) + data["Notifications.NewMessage.Sound"] = + params["notifications.newMessage.sound"]; + if (params["notifications.newMessage.badgeCountEnabled"] !== undefined) + data["Notifications.NewMessage.BadgeCountEnabled"] = serialize.bool(params["notifications.newMessage.badgeCountEnabled"]); + if (params["notifications.addedToChannel.enabled"] !== undefined) + data["Notifications.AddedToChannel.Enabled"] = serialize.bool(params["notifications.addedToChannel.enabled"]); + if (params["notifications.addedToChannel.template"] !== undefined) + data["Notifications.AddedToChannel.Template"] = + params["notifications.addedToChannel.template"]; + if (params["notifications.addedToChannel.sound"] !== undefined) + data["Notifications.AddedToChannel.Sound"] = + params["notifications.addedToChannel.sound"]; + if (params["notifications.removedFromChannel.enabled"] !== undefined) + data["Notifications.RemovedFromChannel.Enabled"] = serialize.bool(params["notifications.removedFromChannel.enabled"]); + if (params["notifications.removedFromChannel.template"] !== undefined) + data["Notifications.RemovedFromChannel.Template"] = + params["notifications.removedFromChannel.template"]; + if (params["notifications.removedFromChannel.sound"] !== undefined) + data["Notifications.RemovedFromChannel.Sound"] = + params["notifications.removedFromChannel.sound"]; + if (params["notifications.invitedToChannel.enabled"] !== undefined) + data["Notifications.InvitedToChannel.Enabled"] = serialize.bool(params["notifications.invitedToChannel.enabled"]); + if (params["notifications.invitedToChannel.template"] !== undefined) + data["Notifications.InvitedToChannel.Template"] = + params["notifications.invitedToChannel.template"]; + if (params["notifications.invitedToChannel.sound"] !== undefined) + data["Notifications.InvitedToChannel.Sound"] = + params["notifications.invitedToChannel.sound"]; + if (params["preWebhookUrl"] !== undefined) + data["PreWebhookUrl"] = params["preWebhookUrl"]; + if (params["postWebhookUrl"] !== undefined) + data["PostWebhookUrl"] = params["postWebhookUrl"]; + if (params["webhookMethod"] !== undefined) + data["WebhookMethod"] = params["webhookMethod"]; + if (params["webhookFilters"] !== undefined) + data["WebhookFilters"] = serialize.map(params["webhookFilters"], (e) => e); + if (params["limits.channelMembers"] !== undefined) + data["Limits.ChannelMembers"] = params["limits.channelMembers"]; + if (params["limits.userChannels"] !== undefined) + data["Limits.UserChannels"] = params["limits.userChannels"]; + if (params["media.compatibilityMessage"] !== undefined) + data["Media.CompatibilityMessage"] = params["media.compatibilityMessage"]; + if (params["preWebhookRetryCount"] !== undefined) + data["PreWebhookRetryCount"] = params["preWebhookRetryCount"]; + if (params["postWebhookRetryCount"] !== undefined) + data["PostWebhookRetryCount"] = params["postWebhookRetryCount"]; + if (params["notifications.logEnabled"] !== undefined) + data["Notifications.LogEnabled"] = serialize.bool(params["notifications.logEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.defaultServiceRoleSid = payload.default_service_role_sid; + this.defaultChannelRoleSid = payload.default_channel_role_sid; + this.defaultChannelCreatorRoleSid = + payload.default_channel_creator_role_sid; + this.readStatusEnabled = payload.read_status_enabled; + this.reachabilityEnabled = payload.reachability_enabled; + this.typingIndicatorTimeout = deserialize.integer(payload.typing_indicator_timeout); + this.consumptionReportInterval = deserialize.integer(payload.consumption_report_interval); + this.limits = payload.limits; + this.preWebhookUrl = payload.pre_webhook_url; + this.postWebhookUrl = payload.post_webhook_url; + this.webhookMethod = payload.webhook_method; + this.webhookFilters = payload.webhook_filters; + this.preWebhookRetryCount = deserialize.integer(payload.pre_webhook_retry_count); + this.postWebhookRetryCount = deserialize.integer(payload.post_webhook_retry_count); + this.notifications = payload.notifications; + this.media = payload.media; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the bindings. + */ + bindings() { + return this._proxy.bindings; + } + /** + * Access the channels. + */ + channels() { + return this._proxy.channels; + } + /** + * Access the roles. + */ + roles() { + return this._proxy.roles; + } + /** + * Access the users. + */ + users() { + return this._proxy.users; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + defaultServiceRoleSid: this.defaultServiceRoleSid, + defaultChannelRoleSid: this.defaultChannelRoleSid, + defaultChannelCreatorRoleSid: this.defaultChannelCreatorRoleSid, + readStatusEnabled: this.readStatusEnabled, + reachabilityEnabled: this.reachabilityEnabled, + typingIndicatorTimeout: this.typingIndicatorTimeout, + consumptionReportInterval: this.consumptionReportInterval, + limits: this.limits, + preWebhookUrl: this.preWebhookUrl, + postWebhookUrl: this.postWebhookUrl, + webhookMethod: this.webhookMethod, + webhookFilters: this.webhookFilters, + preWebhookRetryCount: this.preWebhookRetryCount, + postWebhookRetryCount: this.postWebhookRetryCount, + notifications: this.notifications, + media: this.media, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/binding.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/binding.d.ts new file mode 100644 index 00000000..3abcaf56 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/binding.d.ts @@ -0,0 +1,282 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type BindingBindingType = "gcm" | "apn" | "fcm"; +/** + * Options to pass to each + */ +export interface BindingListInstanceEachOptions { + /** The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BindingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BindingListInstanceOptions { + /** The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BindingListInstancePageOptions { + /** The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BindingContext { + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BindingContextSolution { + serviceSid: string; + sid: string; +} +export declare class BindingContextImpl implements BindingContext { + protected _version: V2; + protected _solution: BindingContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BindingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BindingPayload extends TwilioResponsePayload { + bindings: BindingResource[]; +} +interface BindingResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + endpoint: string; + identity: string; + credential_sid: string; + binding_type: BindingBindingType; + message_types: Array; + url: string; + links: Record; +} +export declare class BindingInstance { + protected _version: V2; + protected _solution: BindingContextSolution; + protected _context?: BindingContext; + constructor(_version: V2, payload: BindingResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Binding resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Binding resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Binding resource is associated with. + */ + serviceSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The unique endpoint identifier for the Binding. The format of this value depends on the `binding_type`. + */ + endpoint: string; + /** + * The application-defined string that uniquely identifies the resource\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + */ + identity: string; + /** + * The SID of the [Credential](https://www.twilio.com/docs/chat/rest/credential-resource) for the binding. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + */ + credentialSid: string; + bindingType: BindingBindingType; + /** + * The [Programmable Chat message types](https://www.twilio.com/docs/chat/push-notification-configuration#push-types) the binding is subscribed to. + */ + messageTypes: Array; + /** + * The absolute URL of the Binding resource. + */ + url: string; + /** + * The absolute URLs of the Binding\'s [User](https://www.twilio.com/docs/chat/rest/user-resource). + */ + links: Record; + private get _proxy(); + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + endpoint: string; + identity: string; + credentialSid: string; + bindingType: BindingBindingType; + messageTypes: string[]; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BindingSolution { + serviceSid: string; +} +export interface BindingListInstance { + _version: V2; + _solution: BindingSolution; + _uri: string; + (sid: string): BindingContext; + get(sid: string): BindingContext; + /** + * Streams BindingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BindingInstance, done: (err?: Error) => void) => void): void; + each(params: BindingListInstanceEachOptions, callback?: (item: BindingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BindingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BindingPage) => any): Promise; + /** + * Lists BindingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BindingInstance[]) => any): Promise; + list(params: BindingListInstanceOptions, callback?: (error: Error | null, items: BindingInstance[]) => any): Promise; + /** + * Retrieve a single page of BindingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BindingPage) => any): Promise; + page(params: BindingListInstancePageOptions, callback?: (error: Error | null, items: BindingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BindingListInstance(version: V2, serviceSid: string): BindingListInstance; +export declare class BindingPage extends Page { + /** + * Initialize the BindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: BindingSolution); + /** + * Build an instance of BindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BindingResource): BindingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/binding.js b/node_modules/twilio/lib/rest/chat/v2/service/binding.js new file mode 100644 index 00000000..7be18d8c --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/binding.js @@ -0,0 +1,222 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BindingPage = exports.BindingListInstance = exports.BindingInstance = exports.BindingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class BindingContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Bindings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BindingInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingContextImpl = BindingContextImpl; +class BindingInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.endpoint = payload.endpoint; + this.identity = payload.identity; + this.credentialSid = payload.credential_sid; + this.bindingType = payload.binding_type; + this.messageTypes = payload.message_types; + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new BindingContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + endpoint: this.endpoint, + identity: this.identity, + credentialSid: this.credentialSid, + bindingType: this.bindingType, + messageTypes: this.messageTypes, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingInstance = BindingInstance; +function BindingListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new BindingContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Bindings`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["bindingType"] !== undefined) + data["BindingType"] = serialize.map(params["bindingType"], (e) => e); + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BindingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BindingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BindingListInstance = BindingListInstance; +class BindingPage extends Page_1.default { + /** + * Initialize the BindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BindingInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingPage = BindingPage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/channel.d.ts new file mode 100644 index 00000000..5d3a9c20 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel.d.ts @@ -0,0 +1,438 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { InviteListInstance } from "./channel/invite"; +import { MemberListInstance } from "./channel/member"; +import { MessageListInstance } from "./channel/message"; +import { WebhookListInstance } from "./channel/webhook"; +export type ChannelChannelType = "public" | "private"; +export type ChannelWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a ChannelInstance + */ +export interface ChannelContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ChannelWebhookEnabledType; +} +/** + * Options to pass to update a ChannelInstance + */ +export interface ChannelContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ChannelWebhookEnabledType; + /** A descriptive string that you create to describe the resource. It can be up to 256 characters long. */ + friendlyName?: string; + /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\\\'s `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. */ + uniqueName?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. */ + dateCreated?: Date; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. */ + dateUpdated?: Date; + /** The `identity` of the User that created the channel. Default is: `system`. */ + createdBy?: string; +} +/** + * Options to pass to create a ChannelInstance + */ +export interface ChannelListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ChannelWebhookEnabledType; + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource\\\'s `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. */ + uniqueName?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** */ + type?: ChannelChannelType; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. */ + dateCreated?: Date; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. */ + dateUpdated?: Date; + /** The `identity` of the User that created the channel. Default is: `system`. */ + createdBy?: string; +} +/** + * Options to pass to each + */ +export interface ChannelListInstanceEachOptions { + /** The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ChannelListInstanceOptions { + /** The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ChannelListInstancePageOptions { + /** The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ChannelContext { + invites: InviteListInstance; + members: MemberListInstance; + messages: MessageListInstance; + webhooks: WebhookListInstance; + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + remove(params: ChannelContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ChannelContextSolution { + serviceSid: string; + sid: string; +} +export declare class ChannelContextImpl implements ChannelContext { + protected _version: V2; + protected _solution: ChannelContextSolution; + protected _uri: string; + protected _invites?: InviteListInstance; + protected _members?: MemberListInstance; + protected _messages?: MessageListInstance; + protected _webhooks?: WebhookListInstance; + constructor(_version: V2, serviceSid: string, sid: string); + get invites(): InviteListInstance; + get members(): MemberListInstance; + get messages(): MessageListInstance; + get webhooks(): WebhookListInstance; + remove(params?: ChannelContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + update(params?: ChannelContextUpdateOptions | ((error: Error | null, item?: ChannelInstance) => any), callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ChannelPayload extends TwilioResponsePayload { + channels: ChannelResource[]; +} +interface ChannelResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + unique_name: string; + attributes: string; + type: ChannelChannelType; + date_created: Date; + date_updated: Date; + created_by: string; + members_count: number; + messages_count: number; + url: string; + links: Record; +} +export declare class ChannelInstance { + protected _version: V2; + protected _solution: ChannelContextSolution; + protected _context?: ChannelContext; + constructor(_version: V2, payload: ChannelResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Channel resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Channel resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Channel resource is associated with. + */ + serviceSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\'s `sid` in the URL. + */ + uniqueName: string; + /** + * The JSON string that stores application-specific data. If attributes have not been set, `{}` is returned. + */ + attributes: string; + type: ChannelChannelType; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The `identity` of the User that created the channel. If the Channel was created by using the API, the value is `system`. + */ + createdBy: string; + /** + * The number of Members in the Channel. + */ + membersCount: number; + /** + * The number of Messages that have been passed in the Channel. + */ + messagesCount: number; + /** + * The absolute URL of the Channel resource. + */ + url: string; + /** + * The absolute URLs of the [Members](https://www.twilio.com/docs/chat/rest/member-resource), [Messages](https://www.twilio.com/docs/chat/rest/message-resource), [Invites](https://www.twilio.com/docs/chat/rest/invite-resource), Webhooks and, if it exists, the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) for the Channel. + */ + links: Record; + private get _proxy(); + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + remove(params: ChannelContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Access the invites. + */ + invites(): InviteListInstance; + /** + * Access the members. + */ + members(): MemberListInstance; + /** + * Access the messages. + */ + messages(): MessageListInstance; + /** + * Access the webhooks. + */ + webhooks(): WebhookListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + type: ChannelChannelType; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + membersCount: number; + messagesCount: number; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ChannelSolution { + serviceSid: string; +} +export interface ChannelListInstance { + _version: V2; + _solution: ChannelSolution; + _uri: string; + (sid: string): ChannelContext; + get(sid: string): ChannelContext; + /** + * Create a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Create a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(params: ChannelListInstanceCreateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Streams ChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + each(params: ChannelListInstanceEachOptions, callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Lists ChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + list(params: ChannelListInstanceOptions, callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ChannelPage) => any): Promise; + page(params: ChannelListInstancePageOptions, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ChannelListInstance(version: V2, serviceSid: string): ChannelListInstance; +export declare class ChannelPage extends Page { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ChannelSolution); + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ChannelResource): ChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel.js b/node_modules/twilio/lib/rest/chat/v2/service/channel.js new file mode 100644 index 00000000..3f4134b8 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel.js @@ -0,0 +1,358 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChannelPage = exports.ChannelListInstance = exports.ChannelInstance = exports.ChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const invite_1 = require("./channel/invite"); +const member_1 = require("./channel/member"); +const message_1 = require("./channel/message"); +const webhook_1 = require("./channel/webhook"); +class ChannelContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${sid}`; + } + get invites() { + this._invites = + this._invites || + (0, invite_1.InviteListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._invites; + } + get members() { + this._members = + this._members || + (0, member_1.MemberListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._members; + } + get messages() { + this._messages = + this._messages || + (0, message_1.MessageListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._messages; + } + get webhooks() { + this._webhooks = + this._webhooks || + (0, webhook_1.WebhookListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._webhooks; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["createdBy"] !== undefined) + data["CreatedBy"] = params["createdBy"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelContextImpl = ChannelContextImpl; +class ChannelInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.attributes = payload.attributes; + this.type = payload.type; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this.membersCount = deserialize.integer(payload.members_count); + this.messagesCount = deserialize.integer(payload.messages_count); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ChannelContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the invites. + */ + invites() { + return this._proxy.invites; + } + /** + * Access the members. + */ + members() { + return this._proxy.members; + } + /** + * Access the messages. + */ + messages() { + return this._proxy.messages; + } + /** + * Access the webhooks. + */ + webhooks() { + return this._proxy.webhooks; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + attributes: this.attributes, + type: this.type, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + membersCount: this.membersCount, + messagesCount: this.messagesCount, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelInstance = ChannelInstance; +function ChannelListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ChannelContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Channels`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["type"] !== undefined) + data["Type"] = params["type"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["createdBy"] !== undefined) + data["CreatedBy"] = params["createdBy"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["type"] !== undefined) + data["Type"] = serialize.map(params["type"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ChannelListInstance = ChannelListInstance; +class ChannelPage extends Page_1.default { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ChannelInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelPage = ChannelPage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel/invite.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/channel/invite.d.ts new file mode 100644 index 00000000..5e51c44d --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel/invite.d.ts @@ -0,0 +1,286 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +/** + * Options to pass to create a InviteInstance + */ +export interface InviteListInstanceCreateOptions { + /** The `identity` value that uniquely identifies the new resource\\\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. */ + identity: string; + /** The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface InviteListInstanceEachOptions { + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InviteInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InviteListInstanceOptions { + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InviteListInstancePageOptions { + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InviteContext { + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InviteContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class InviteContextImpl implements InviteContext { + protected _version: V2; + protected _solution: InviteContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InviteContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InvitePayload extends TwilioResponsePayload { + invites: InviteResource[]; +} +interface InviteResource { + sid: string; + account_sid: string; + channel_sid: string; + service_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + role_sid: string; + created_by: string; + url: string; +} +export declare class InviteInstance { + protected _version: V2; + protected _solution: InviteContextSolution; + protected _context?: InviteContext; + constructor(_version: V2, payload: InviteResource, serviceSid: string, channelSid: string, sid?: string); + /** + * The unique string that we created to identify the Invite resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Invite resource. + */ + accountSid: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the Invite resource belongs to. + */ + channelSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Invite resource is associated with. + */ + serviceSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + */ + identity: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the resource. + */ + roleSid: string; + /** + * The `identity` of the User that created the invite. + */ + createdBy: string; + /** + * The absolute URL of the Invite resource. + */ + url: string; + private get _proxy(); + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + createdBy: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InviteSolution { + serviceSid: string; + channelSid: string; +} +export interface InviteListInstance { + _version: V2; + _solution: InviteSolution; + _uri: string; + (sid: string): InviteContext; + get(sid: string): InviteContext; + /** + * Create a InviteInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + create(params: InviteListInstanceCreateOptions, callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Streams InviteInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InviteInstance, done: (err?: Error) => void) => void): void; + each(params: InviteListInstanceEachOptions, callback?: (item: InviteInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InviteInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InvitePage) => any): Promise; + /** + * Lists InviteInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InviteInstance[]) => any): Promise; + list(params: InviteListInstanceOptions, callback?: (error: Error | null, items: InviteInstance[]) => any): Promise; + /** + * Retrieve a single page of InviteInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InvitePage) => any): Promise; + page(params: InviteListInstancePageOptions, callback?: (error: Error | null, items: InvitePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InviteListInstance(version: V2, serviceSid: string, channelSid: string): InviteListInstance; +export declare class InvitePage extends Page { + /** + * Initialize the InvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: InviteSolution); + /** + * Build an instance of InviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InviteResource): InviteInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel/invite.js b/node_modules/twilio/lib/rest/chat/v2/service/channel/invite.js new file mode 100644 index 00000000..13900089 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel/invite.js @@ -0,0 +1,245 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvitePage = exports.InviteListInstance = exports.InviteInstance = exports.InviteContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class InviteContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Invites/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InviteInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InviteContextImpl = InviteContextImpl; +class InviteInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.channelSid = payload.channel_sid; + this.serviceSid = payload.service_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.roleSid = payload.role_sid; + this.createdBy = payload.created_by; + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InviteContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + channelSid: this.channelSid, + serviceSid: this.serviceSid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + roleSid: this.roleSid, + createdBy: this.createdBy, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InviteInstance = InviteInstance; +function InviteListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InviteContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Invites`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InviteInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InvitePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InvitePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InviteListInstance = InviteListInstance; +class InvitePage extends Page_1.default { + /** + * Initialize the InvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InviteInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InvitePage = InvitePage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel/member.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/channel/member.d.ts new file mode 100644 index 00000000..a1362b2a --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel/member.d.ts @@ -0,0 +1,390 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type MemberWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a MemberInstance + */ +export interface MemberContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MemberWebhookEnabledType; +} +/** + * Options to pass to update a MemberInstance + */ +export interface MemberContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MemberWebhookEnabledType; + /** The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). */ + roleSid?: string; + /** The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). */ + lastConsumedMessageIndex?: number; + /** The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). */ + lastConsumptionTimestamp?: Date; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. */ + dateCreated?: Date; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. */ + dateUpdated?: Date; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; +} +/** + * Options to pass to create a MemberInstance + */ +export interface MemberListInstanceCreateOptions { + /** The `identity` value that uniquely identifies the new resource\\\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. */ + identity: string; + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MemberWebhookEnabledType; + /** The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). */ + roleSid?: string; + /** The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. */ + lastConsumedMessageIndex?: number; + /** The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). */ + lastConsumptionTimestamp?: Date; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. */ + dateCreated?: Date; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. */ + dateUpdated?: Date; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; +} +/** + * Options to pass to each + */ +export interface MemberListInstanceEachOptions { + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MemberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MemberListInstanceOptions { + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MemberListInstancePageOptions { + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MemberContext { + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + remove(params: MemberContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MemberContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class MemberContextImpl implements MemberContext { + protected _version: V2; + protected _solution: MemberContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, channelSid: string, sid: string); + remove(params?: MemberContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + update(params?: MemberContextUpdateOptions | ((error: Error | null, item?: MemberInstance) => any), callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MemberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MemberPayload extends TwilioResponsePayload { + members: MemberResource[]; +} +interface MemberResource { + sid: string; + account_sid: string; + channel_sid: string; + service_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + role_sid: string; + last_consumed_message_index: number; + last_consumption_timestamp: Date; + url: string; + attributes: string; +} +export declare class MemberInstance { + protected _version: V2; + protected _solution: MemberContextSolution; + protected _context?: MemberContext; + constructor(_version: V2, payload: MemberResource, serviceSid: string, channelSid: string, sid?: string); + /** + * The unique string that we created to identify the Member resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource. + */ + accountSid: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the Member resource belongs to. + */ + channelSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Member resource is associated with. + */ + serviceSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + */ + identity: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the member. + */ + roleSid: string; + /** + * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. + */ + lastConsumedMessageIndex: number; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + */ + lastConsumptionTimestamp: Date; + /** + * The absolute URL of the Member resource. + */ + url: string; + /** + * The JSON string that stores application-specific data. If attributes have not been set, `{}` is returned. + */ + attributes: string; + private get _proxy(); + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + remove(params: MemberContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + lastConsumedMessageIndex: number; + lastConsumptionTimestamp: Date; + url: string; + attributes: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MemberSolution { + serviceSid: string; + channelSid: string; +} +export interface MemberListInstance { + _version: V2; + _solution: MemberSolution; + _uri: string; + (sid: string): MemberContext; + get(sid: string): MemberContext; + /** + * Create a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + create(params: MemberListInstanceCreateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Streams MemberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + each(params: MemberListInstanceEachOptions, callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Lists MemberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + list(params: MemberListInstanceOptions, callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + /** + * Retrieve a single page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MemberPage) => any): Promise; + page(params: MemberListInstancePageOptions, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MemberListInstance(version: V2, serviceSid: string, channelSid: string): MemberListInstance; +export declare class MemberPage extends Page { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: MemberSolution); + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MemberResource): MemberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel/member.js b/node_modules/twilio/lib/rest/chat/v2/service/channel/member.js new file mode 100644 index 00000000..010c32a5 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel/member.js @@ -0,0 +1,306 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MemberPage = exports.MemberListInstance = exports.MemberInstance = exports.MemberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MemberContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Members/${sid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["lastConsumedMessageIndex"] !== undefined) + data["LastConsumedMessageIndex"] = params["lastConsumedMessageIndex"]; + if (params["lastConsumptionTimestamp"] !== undefined) + data["LastConsumptionTimestamp"] = serialize.iso8601DateTime(params["lastConsumptionTimestamp"]); + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberContextImpl = MemberContextImpl; +class MemberInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.channelSid = payload.channel_sid; + this.serviceSid = payload.service_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.roleSid = payload.role_sid; + this.lastConsumedMessageIndex = deserialize.integer(payload.last_consumed_message_index); + this.lastConsumptionTimestamp = deserialize.iso8601DateTime(payload.last_consumption_timestamp); + this.url = payload.url; + this.attributes = payload.attributes; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MemberContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + channelSid: this.channelSid, + serviceSid: this.serviceSid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + roleSid: this.roleSid, + lastConsumedMessageIndex: this.lastConsumedMessageIndex, + lastConsumptionTimestamp: this.lastConsumptionTimestamp, + url: this.url, + attributes: this.attributes, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberInstance = MemberInstance; +function MemberListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MemberContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Members`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["lastConsumedMessageIndex"] !== undefined) + data["LastConsumedMessageIndex"] = params["lastConsumedMessageIndex"]; + if (params["lastConsumptionTimestamp"] !== undefined) + data["LastConsumptionTimestamp"] = serialize.iso8601DateTime(params["lastConsumptionTimestamp"]); + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MemberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MemberListInstance = MemberListInstance; +class MemberPage extends Page_1.default { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MemberInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberPage = MemberPage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel/message.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/channel/message.d.ts new file mode 100644 index 00000000..2921e4ca --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel/message.d.ts @@ -0,0 +1,423 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type MessageOrderType = "asc" | "desc"; +export type MessageWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a MessageInstance + */ +export interface MessageContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; +} +/** + * Options to pass to update a MessageInstance + */ +export interface MessageContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; + /** The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. */ + body?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat\\\'s history is being recreated from a backup/separate source. */ + dateCreated?: Date; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. */ + dateUpdated?: Date; + /** The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. */ + lastUpdatedBy?: string; + /** The [Identity](https://www.twilio.com/docs/chat/identity) of the message\\\'s author. */ + from?: string; +} +/** + * Options to pass to create a MessageInstance + */ +export interface MessageListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; + /** The [Identity](https://www.twilio.com/docs/chat/identity) of the new message\\\'s author. The default value is `system`. */ + from?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat\\\'s history is being recreated from a backup/separate source. */ + dateCreated?: Date; + /** The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. */ + dateUpdated?: Date; + /** The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. */ + lastUpdatedBy?: string; + /** The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. */ + body?: string; + /** The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. */ + mediaSid?: string; +} +/** + * Options to pass to each + */ +export interface MessageListInstanceEachOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessageInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessageListInstanceOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessageListInstancePageOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessageContext { + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + remove(params: MessageContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessageContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class MessageContextImpl implements MessageContext { + protected _version: V2; + protected _solution: MessageContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, channelSid: string, sid: string); + remove(params?: MessageContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + update(params?: MessageContextUpdateOptions | ((error: Error | null, item?: MessageInstance) => any), callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessageContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessagePayload extends TwilioResponsePayload { + messages: MessageResource[]; +} +interface MessageResource { + sid: string; + account_sid: string; + attributes: string; + service_sid: string; + to: string; + channel_sid: string; + date_created: Date; + date_updated: Date; + last_updated_by: string; + was_edited: boolean; + from: string; + body: string; + index: number; + type: string; + media: any; + url: string; +} +export declare class MessageInstance { + protected _version: V2; + protected _solution: MessageContextSolution; + protected _context?: MessageContext; + constructor(_version: V2, payload: MessageResource, serviceSid: string, channelSid: string, sid?: string); + /** + * The unique string that we created to identify the Message resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Message resource. + */ + accountSid: string; + /** + * The JSON string that stores application-specific data. If attributes have not been set, `{}` is returned. + */ + attributes: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Message resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/chat/channels) that the message was sent to. + */ + to: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the Message resource belongs to. + */ + channelSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + */ + lastUpdatedBy: string; + /** + * Whether the message has been edited since it was created. + */ + wasEdited: boolean; + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the message\'s author. The default value is `system`. + */ + from: string; + /** + * The content of the message. + */ + body: string; + /** + * The index of the message within the [Channel](https://www.twilio.com/docs/chat/channels). Indices may skip numbers, but will always be in order of when the message was received. + */ + index: number; + /** + * The Message type. Can be: `text` or `media`. + */ + type: string; + /** + * An object that describes the Message\'s media, if the message contains media. The object contains these fields: `content_type` with the MIME type of the media, `filename` with the name of the media, `sid` with the SID of the Media resource, and `size` with the media object\'s file size in bytes. If the Message has no media, this value is `null`. + */ + media: any; + /** + * The absolute URL of the Message resource. + */ + url: string; + private get _proxy(); + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + remove(params: MessageContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + attributes: string; + serviceSid: string; + to: string; + channelSid: string; + dateCreated: Date; + dateUpdated: Date; + lastUpdatedBy: string; + wasEdited: boolean; + from: string; + body: string; + index: number; + type: string; + media: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessageSolution { + serviceSid: string; + channelSid: string; +} +export interface MessageListInstance { + _version: V2; + _solution: MessageSolution; + _uri: string; + (sid: string): MessageContext; + get(sid: string): MessageContext; + /** + * Create a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Create a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(params: MessageListInstanceCreateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Streams MessageInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + each(params: MessageListInstanceEachOptions, callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Lists MessageInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + list(params: MessageListInstanceOptions, callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + /** + * Retrieve a single page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessagePage) => any): Promise; + page(params: MessageListInstancePageOptions, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessageListInstance(version: V2, serviceSid: string, channelSid: string): MessageListInstance; +export declare class MessagePage extends Page { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: MessageSolution); + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessageResource): MessageInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel/message.js b/node_modules/twilio/lib/rest/chat/v2/service/channel/message.js new file mode 100644 index 00000000..5432e436 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel/message.js @@ -0,0 +1,316 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagePage = exports.MessageListInstance = exports.MessageInstance = exports.MessageContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MessageContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Messages/${sid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["lastUpdatedBy"] !== undefined) + data["LastUpdatedBy"] = params["lastUpdatedBy"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageContextImpl = MessageContextImpl; +class MessageInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.attributes = payload.attributes; + this.serviceSid = payload.service_sid; + this.to = payload.to; + this.channelSid = payload.channel_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.lastUpdatedBy = payload.last_updated_by; + this.wasEdited = payload.was_edited; + this.from = payload.from; + this.body = payload.body; + this.index = deserialize.integer(payload.index); + this.type = payload.type; + this.media = payload.media; + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MessageContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + attributes: this.attributes, + serviceSid: this.serviceSid, + to: this.to, + channelSid: this.channelSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + lastUpdatedBy: this.lastUpdatedBy, + wasEdited: this.wasEdited, + from: this.from, + body: this.body, + index: this.index, + type: this.type, + media: this.media, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInstance = MessageInstance; +function MessageListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MessageContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Messages`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["lastUpdatedBy"] !== undefined) + data["LastUpdatedBy"] = params["lastUpdatedBy"]; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["mediaSid"] !== undefined) + data["MediaSid"] = params["mediaSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessagePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessageListInstance = MessageListInstance; +class MessagePage extends Page_1.default { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessageInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagePage = MessagePage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel/webhook.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/channel/webhook.d.ts new file mode 100644 index 00000000..68c5ad37 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel/webhook.d.ts @@ -0,0 +1,338 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type WebhookMethod = "GET" | "POST"; +export type WebhookType = "webhook" | "trigger" | "studio"; +/** + * Options to pass to update a WebhookInstance + */ +export interface WebhookContextUpdateOptions { + /** The URL of the webhook to call using the `configuration.method`. */ + "configuration.url"?: string; + /** */ + "configuration.method"?: WebhookMethod; + /** The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). */ + "configuration.filters"?: Array; + /** A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. */ + "configuration.triggers"?: Array; + /** The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. */ + "configuration.flowSid"?: string; + /** The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. */ + "configuration.retryCount"?: number; +} +/** + * Options to pass to create a WebhookInstance + */ +export interface WebhookListInstanceCreateOptions { + /** */ + type: WebhookType; + /** The URL of the webhook to call using the `configuration.method`. */ + "configuration.url"?: string; + /** */ + "configuration.method"?: WebhookMethod; + /** The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). */ + "configuration.filters"?: Array; + /** A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. */ + "configuration.triggers"?: Array; + /** The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. */ + "configuration.flowSid"?: string; + /** The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. */ + "configuration.retryCount"?: number; +} +/** + * Options to pass to each + */ +export interface WebhookListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WebhookInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WebhookListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WebhookListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WebhookContext { + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WebhookContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class WebhookContextImpl implements WebhookContext { + protected _version: V2; + protected _solution: WebhookContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + update(params?: WebhookContextUpdateOptions | ((error: Error | null, item?: WebhookInstance) => any), callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WebhookContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WebhookPayload extends TwilioResponsePayload { + webhooks: WebhookResource[]; +} +interface WebhookResource { + sid: string; + account_sid: string; + service_sid: string; + channel_sid: string; + type: string; + url: string; + configuration: any; + date_created: Date; + date_updated: Date; +} +export declare class WebhookInstance { + protected _version: V2; + protected _solution: WebhookContextSolution; + protected _context?: WebhookContext; + constructor(_version: V2, payload: WebhookResource, serviceSid: string, channelSid: string, sid?: string); + /** + * The unique string that we created to identify the Channel Webhook resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Channel Webhook resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Channel Webhook resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the Channel Webhook resource belongs to. + */ + channelSid: string; + /** + * The type of webhook. Can be: `webhook`, `studio`, or `trigger`. + */ + type: string; + /** + * The absolute URL of the Channel Webhook resource. + */ + url: string; + /** + * The JSON string that describes how the channel webhook is configured. The configuration object contains the `url`, `method`, `filters`, and `retry_count` values that are configured by the create and update actions. + */ + configuration: any; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + channelSid: string; + type: string; + url: string; + configuration: any; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WebhookSolution { + serviceSid: string; + channelSid: string; +} +export interface WebhookListInstance { + _version: V2; + _solution: WebhookSolution; + _uri: string; + (sid: string): WebhookContext; + get(sid: string): WebhookContext; + /** + * Create a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + create(params: WebhookListInstanceCreateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Streams WebhookInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + each(params: WebhookListInstanceEachOptions, callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Lists WebhookInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + list(params: WebhookListInstanceOptions, callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + /** + * Retrieve a single page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WebhookPage) => any): Promise; + page(params: WebhookListInstancePageOptions, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebhookListInstance(version: V2, serviceSid: string, channelSid: string): WebhookListInstance; +export declare class WebhookPage extends Page { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: WebhookSolution); + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WebhookResource): WebhookInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/channel/webhook.js b/node_modules/twilio/lib/rest/chat/v2/service/channel/webhook.js new file mode 100644 index 00000000..b0585ed0 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/channel/webhook.js @@ -0,0 +1,288 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebhookPage = exports.WebhookListInstance = exports.WebhookInstance = exports.WebhookContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WebhookContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Webhooks/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["configuration.url"] !== undefined) + data["Configuration.Url"] = params["configuration.url"]; + if (params["configuration.method"] !== undefined) + data["Configuration.Method"] = params["configuration.method"]; + if (params["configuration.filters"] !== undefined) + data["Configuration.Filters"] = serialize.map(params["configuration.filters"], (e) => e); + if (params["configuration.triggers"] !== undefined) + data["Configuration.Triggers"] = serialize.map(params["configuration.triggers"], (e) => e); + if (params["configuration.flowSid"] !== undefined) + data["Configuration.FlowSid"] = params["configuration.flowSid"]; + if (params["configuration.retryCount"] !== undefined) + data["Configuration.RetryCount"] = params["configuration.retryCount"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookContextImpl = WebhookContextImpl; +class WebhookInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.channelSid = payload.channel_sid; + this.type = payload.type; + this.url = payload.url; + this.configuration = payload.configuration; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WebhookContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + channelSid: this.channelSid, + type: this.type, + url: this.url, + configuration: this.configuration, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookInstance = WebhookInstance; +function WebhookListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WebhookContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Webhooks`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["configuration.url"] !== undefined) + data["Configuration.Url"] = params["configuration.url"]; + if (params["configuration.method"] !== undefined) + data["Configuration.Method"] = params["configuration.method"]; + if (params["configuration.filters"] !== undefined) + data["Configuration.Filters"] = serialize.map(params["configuration.filters"], (e) => e); + if (params["configuration.triggers"] !== undefined) + data["Configuration.Triggers"] = serialize.map(params["configuration.triggers"], (e) => e); + if (params["configuration.flowSid"] !== undefined) + data["Configuration.FlowSid"] = params["configuration.flowSid"]; + if (params["configuration.retryCount"] !== undefined) + data["Configuration.RetryCount"] = params["configuration.retryCount"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WebhookPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebhookListInstance = WebhookListInstance; +class WebhookPage extends Page_1.default { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WebhookInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookPage = WebhookPage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/role.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/role.d.ts new file mode 100644 index 00000000..bb9cdc85 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/role.d.ts @@ -0,0 +1,298 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type RoleRoleType = "channel" | "deployment"; +/** + * Options to pass to update a RoleInstance + */ +export interface RoleContextUpdateOptions { + /** A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role\\\'s `type`. */ + permission: Array; +} +/** + * Options to pass to create a RoleInstance + */ +export interface RoleListInstanceCreateOptions { + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName: string; + /** */ + type: RoleRoleType; + /** A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role\\\'s `type`. */ + permission: Array; +} +/** + * Options to pass to each + */ +export interface RoleListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoleInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoleListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoleListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoleContext { + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoleContextSolution { + serviceSid: string; + sid: string; +} +export declare class RoleContextImpl implements RoleContext { + protected _version: V2; + protected _solution: RoleContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoleContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RolePayload extends TwilioResponsePayload { + roles: RoleResource[]; +} +interface RoleResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + type: RoleRoleType; + permissions: Array; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class RoleInstance { + protected _version: V2; + protected _solution: RoleContextSolution; + protected _context?: RoleContext; + constructor(_version: V2, payload: RoleResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Role resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Role resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Role resource is associated with. + */ + serviceSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + type: RoleRoleType; + /** + * An array of the permissions the role has been granted. + */ + permissions: Array; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Role resource. + */ + url: string; + private get _proxy(); + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + type: RoleRoleType; + permissions: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoleSolution { + serviceSid: string; +} +export interface RoleListInstance { + _version: V2; + _solution: RoleSolution; + _uri: string; + (sid: string): RoleContext; + get(sid: string): RoleContext; + /** + * Create a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + create(params: RoleListInstanceCreateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Streams RoleInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + each(params: RoleListInstanceEachOptions, callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Lists RoleInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + list(params: RoleListInstanceOptions, callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + /** + * Retrieve a single page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RolePage) => any): Promise; + page(params: RoleListInstancePageOptions, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoleListInstance(version: V2, serviceSid: string): RoleListInstance; +export declare class RolePage extends Page { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: RoleSolution); + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoleResource): RoleInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/role.js b/node_modules/twilio/lib/rest/chat/v2/service/role.js new file mode 100644 index 00000000..0159a2be --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/role.js @@ -0,0 +1,267 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RolePage = exports.RoleListInstance = exports.RoleInstance = exports.RoleContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class RoleContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Roles/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleContextImpl = RoleContextImpl; +class RoleInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.permissions = payload.permissions; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RoleContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + type: this.type, + permissions: this.permissions, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleInstance = RoleInstance; +function RoleListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RoleContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Roles`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RolePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RolePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoleListInstance = RoleListInstance; +class RolePage extends Page_1.default { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoleInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RolePage = RolePage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/user.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/user.d.ts new file mode 100644 index 00000000..46b5820d --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/user.d.ts @@ -0,0 +1,373 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { UserBindingListInstance } from "./user/userBinding"; +import { UserChannelListInstance } from "./user/userChannel"; +export type UserWebhookEnabledType = "true" | "false"; +/** + * Options to pass to update a UserInstance + */ +export interface UserContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; + /** The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. */ + roleSid?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** A descriptive string that you create to describe the resource. It is often used for display purposes. */ + friendlyName?: string; +} +/** + * Options to pass to create a UserInstance + */ +export interface UserListInstanceCreateOptions { + /** The `identity` value that uniquely identifies the new resource\\\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). This value is often a username or email address. See the Identity documentation for more info. */ + identity: string; + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; + /** The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. */ + roleSid?: string; + /** A valid JSON string that contains application-specific data. */ + attributes?: string; + /** A descriptive string that you create to describe the new resource. This value is often used for display purposes. */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface UserListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserContext { + userBindings: UserBindingListInstance; + userChannels: UserChannelListInstance; + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserContextSolution { + serviceSid: string; + sid: string; +} +export declare class UserContextImpl implements UserContext { + protected _version: V2; + protected _solution: UserContextSolution; + protected _uri: string; + protected _userBindings?: UserBindingListInstance; + protected _userChannels?: UserChannelListInstance; + constructor(_version: V2, serviceSid: string, sid: string); + get userBindings(): UserBindingListInstance; + get userChannels(): UserChannelListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + update(params?: UserContextUpdateOptions | ((error: Error | null, item?: UserInstance) => any), callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserPayload extends TwilioResponsePayload { + users: UserResource[]; +} +interface UserResource { + sid: string; + account_sid: string; + service_sid: string; + attributes: string; + friendly_name: string; + role_sid: string; + identity: string; + is_online: boolean; + is_notifiable: boolean; + date_created: Date; + date_updated: Date; + joined_channels_count: number; + links: Record; + url: string; +} +export declare class UserInstance { + protected _version: V2; + protected _solution: UserContextSolution; + protected _context?: UserContext; + constructor(_version: V2, payload: UserResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the User resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the User resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User resource is associated with. + */ + serviceSid: string; + /** + * The JSON string that stores application-specific data. If attributes have not been set, `{}` is returned. + */ + attributes: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the user. + */ + roleSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s User within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). This value is often a username or an email address, and is case-sensitive. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + */ + identity: string; + /** + * Whether the User is actively connected to the Service instance and online. This value is only returned by Fetch actions that return a single resource and `null` is always returned by a Read action. This value is `null` if the Service\'s `reachability_enabled` is `false`, if the User has never been online for the Service instance, even if the Service\'s `reachability_enabled` is `true`. + */ + isOnline: boolean; + /** + * Whether the User has a potentially valid Push Notification registration (APN or GCM) for the Service instance. If at least one registration exists, `true`; otherwise `false`. This value is only returned by Fetch actions that return a single resource and `null` is always returned by a Read action. This value is `null` if the Service\'s `reachability_enabled` is `false`, and if the User has never had a notification registration, even if the Service\'s `reachability_enabled` is `true`. + */ + isNotifiable: boolean; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The number of Channels the User is a Member of. + */ + joinedChannelsCount: number; + /** + * The absolute URLs of the [Channel](https://www.twilio.com/docs/chat/channels) and [Binding](https://www.twilio.com/docs/chat/rest/binding-resource) resources related to the user. + */ + links: Record; + /** + * The absolute URL of the User resource. + */ + url: string; + private get _proxy(); + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Access the userBindings. + */ + userBindings(): UserBindingListInstance; + /** + * Access the userChannels. + */ + userChannels(): UserChannelListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + attributes: string; + friendlyName: string; + roleSid: string; + identity: string; + isOnline: boolean; + isNotifiable: boolean; + dateCreated: Date; + dateUpdated: Date; + joinedChannelsCount: number; + links: Record; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserSolution { + serviceSid: string; +} +export interface UserListInstance { + _version: V2; + _solution: UserSolution; + _uri: string; + (sid: string): UserContext; + get(sid: string): UserContext; + /** + * Create a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + create(params: UserListInstanceCreateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Streams UserInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + each(params: UserListInstanceEachOptions, callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Lists UserInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + list(params: UserListInstanceOptions, callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + /** + * Retrieve a single page of UserInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserPage) => any): Promise; + page(params: UserListInstancePageOptions, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserListInstance(version: V2, serviceSid: string): UserListInstance; +export declare class UserPage extends Page { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: UserSolution); + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserResource): UserInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/user.js b/node_modules/twilio/lib/rest/chat/v2/service/user.js new file mode 100644 index 00000000..7a0b1c42 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/user.js @@ -0,0 +1,310 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserPage = exports.UserListInstance = exports.UserInstance = exports.UserContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const userBinding_1 = require("./user/userBinding"); +const userChannel_1 = require("./user/userChannel"); +class UserContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Users/${sid}`; + } + get userBindings() { + this._userBindings = + this._userBindings || + (0, userBinding_1.UserBindingListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._userBindings; + } + get userChannels() { + this._userChannels = + this._userChannels || + (0, userChannel_1.UserChannelListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._userChannels; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserContextImpl = UserContextImpl; +class UserInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.attributes = payload.attributes; + this.friendlyName = payload.friendly_name; + this.roleSid = payload.role_sid; + this.identity = payload.identity; + this.isOnline = payload.is_online; + this.isNotifiable = payload.is_notifiable; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.joinedChannelsCount = deserialize.integer(payload.joined_channels_count); + this.links = payload.links; + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UserContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the userBindings. + */ + userBindings() { + return this._proxy.userBindings; + } + /** + * Access the userChannels. + */ + userChannels() { + return this._proxy.userChannels; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + attributes: this.attributes, + friendlyName: this.friendlyName, + roleSid: this.roleSid, + identity: this.identity, + isOnline: this.isOnline, + isNotifiable: this.isNotifiable, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + joinedChannelsCount: this.joinedChannelsCount, + links: this.links, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserInstance = UserInstance; +function UserListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Users`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserListInstance = UserListInstance; +class UserPage extends Page_1.default { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserPage = UserPage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/user/userBinding.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/user/userBinding.d.ts new file mode 100644 index 00000000..12120860 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/user/userBinding.d.ts @@ -0,0 +1,278 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type UserBindingBindingType = "gcm" | "apn" | "fcm"; +/** + * Options to pass to each + */ +export interface UserBindingListInstanceEachOptions { + /** The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserBindingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserBindingListInstanceOptions { + /** The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserBindingListInstancePageOptions { + /** The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserBindingContext { + /** + * Remove a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserBindingInstance + */ + fetch(callback?: (error: Error | null, item?: UserBindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserBindingContextSolution { + serviceSid: string; + userSid: string; + sid: string; +} +export declare class UserBindingContextImpl implements UserBindingContext { + protected _version: V2; + protected _solution: UserBindingContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, userSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserBindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserBindingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserBindingPayload extends TwilioResponsePayload { + bindings: UserBindingResource[]; +} +interface UserBindingResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + endpoint: string; + identity: string; + user_sid: string; + credential_sid: string; + binding_type: UserBindingBindingType; + message_types: Array; + url: string; +} +export declare class UserBindingInstance { + protected _version: V2; + protected _solution: UserBindingContextSolution; + protected _context?: UserBindingContext; + constructor(_version: V2, payload: UserBindingResource, serviceSid: string, userSid: string, sid?: string); + /** + * The unique string that we created to identify the User Binding resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the User Binding resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User Binding resource is associated with. + */ + serviceSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The unique endpoint identifier for the User Binding. The format of the value depends on the `binding_type`. + */ + endpoint: string; + /** + * The application-defined string that uniquely identifies the resource\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + */ + identity: string; + /** + * The SID of the [User](https://www.twilio.com/docs/chat/rest/user-resource) with the User Binding resource. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + */ + userSid: string; + /** + * The SID of the [Credential](https://www.twilio.com/docs/chat/rest/credential-resource) for the binding. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + */ + credentialSid: string; + bindingType: UserBindingBindingType; + /** + * The [Programmable Chat message types](https://www.twilio.com/docs/chat/push-notification-configuration#push-types) the binding is subscribed to. + */ + messageTypes: Array; + /** + * The absolute URL of the User Binding resource. + */ + url: string; + private get _proxy(); + /** + * Remove a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserBindingInstance + */ + fetch(callback?: (error: Error | null, item?: UserBindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + endpoint: string; + identity: string; + userSid: string; + credentialSid: string; + bindingType: UserBindingBindingType; + messageTypes: string[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserBindingSolution { + serviceSid: string; + userSid: string; +} +export interface UserBindingListInstance { + _version: V2; + _solution: UserBindingSolution; + _uri: string; + (sid: string): UserBindingContext; + get(sid: string): UserBindingContext; + /** + * Streams UserBindingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserBindingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserBindingInstance, done: (err?: Error) => void) => void): void; + each(params: UserBindingListInstanceEachOptions, callback?: (item: UserBindingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserBindingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserBindingPage) => any): Promise; + /** + * Lists UserBindingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserBindingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserBindingInstance[]) => any): Promise; + list(params: UserBindingListInstanceOptions, callback?: (error: Error | null, items: UserBindingInstance[]) => any): Promise; + /** + * Retrieve a single page of UserBindingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserBindingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserBindingPage) => any): Promise; + page(params: UserBindingListInstancePageOptions, callback?: (error: Error | null, items: UserBindingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserBindingListInstance(version: V2, serviceSid: string, userSid: string): UserBindingListInstance; +export declare class UserBindingPage extends Page { + /** + * Initialize the UserBindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: UserBindingSolution); + /** + * Build an instance of UserBindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserBindingResource): UserBindingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/user/userBinding.js b/node_modules/twilio/lib/rest/chat/v2/service/user/userBinding.js new file mode 100644 index 00000000..174d239d --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/user/userBinding.js @@ -0,0 +1,226 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserBindingPage = exports.UserBindingListInstance = exports.UserBindingInstance = exports.UserBindingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class UserBindingContextImpl { + constructor(_version, serviceSid, userSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, userSid, sid }; + this._uri = `/Services/${serviceSid}/Users/${userSid}/Bindings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserBindingInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.userSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserBindingContextImpl = UserBindingContextImpl; +class UserBindingInstance { + constructor(_version, payload, serviceSid, userSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.endpoint = payload.endpoint; + this.identity = payload.identity; + this.userSid = payload.user_sid; + this.credentialSid = payload.credential_sid; + this.bindingType = payload.binding_type; + this.messageTypes = payload.message_types; + this.url = payload.url; + this._solution = { serviceSid, userSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UserBindingContextImpl(this._version, this._solution.serviceSid, this._solution.userSid, this._solution.sid); + return this._context; + } + /** + * Remove a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserBindingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + endpoint: this.endpoint, + identity: this.identity, + userSid: this.userSid, + credentialSid: this.credentialSid, + bindingType: this.bindingType, + messageTypes: this.messageTypes, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserBindingInstance = UserBindingInstance; +function UserBindingListInstance(version, serviceSid, userSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserBindingContextImpl(version, serviceSid, userSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, userSid }; + instance._uri = `/Services/${serviceSid}/Users/${userSid}/Bindings`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["bindingType"] !== undefined) + data["BindingType"] = serialize.map(params["bindingType"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserBindingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserBindingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserBindingListInstance = UserBindingListInstance; +class UserBindingPage extends Page_1.default { + /** + * Initialize the UserBindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserBindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserBindingInstance(this._version, payload, this._solution.serviceSid, this._solution.userSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserBindingPage = UserBindingPage; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/user/userChannel.d.ts b/node_modules/twilio/lib/rest/chat/v2/service/user/userChannel.d.ts new file mode 100644 index 00000000..f6f99893 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/user/userChannel.d.ts @@ -0,0 +1,336 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type UserChannelChannelStatus = "joined" | "invited" | "not_participating"; +export type UserChannelNotificationLevel = "default" | "muted"; +export type UserChannelWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a UserChannelInstance + */ +export interface UserChannelContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserChannelWebhookEnabledType; +} +/** + * Options to pass to update a UserChannelInstance + */ +export interface UserChannelContextUpdateOptions { + /** */ + notificationLevel?: UserChannelNotificationLevel; + /** The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. */ + lastConsumedMessageIndex?: number; + /** The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). */ + lastConsumptionTimestamp?: Date; +} +/** + * Options to pass to each + */ +export interface UserChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserChannelContext { + /** + * Remove a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a UserChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + remove(params: UserChannelContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + fetch(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Update a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + update(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Update a UserChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + update(params: UserChannelContextUpdateOptions, callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserChannelContextSolution { + serviceSid: string; + userSid: string; + channelSid: string; +} +export declare class UserChannelContextImpl implements UserChannelContext { + protected _version: V2; + protected _solution: UserChannelContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, userSid: string, channelSid: string); + remove(params?: UserChannelContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + update(params?: UserChannelContextUpdateOptions | ((error: Error | null, item?: UserChannelInstance) => any), callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserChannelPayload extends TwilioResponsePayload { + channels: UserChannelResource[]; +} +interface UserChannelResource { + account_sid: string; + service_sid: string; + channel_sid: string; + user_sid: string; + member_sid: string; + status: UserChannelChannelStatus; + last_consumed_message_index: number; + unread_messages_count: number; + links: Record; + url: string; + notification_level: UserChannelNotificationLevel; +} +export declare class UserChannelInstance { + protected _version: V2; + protected _solution: UserChannelContextSolution; + protected _context?: UserChannelContext; + constructor(_version: V2, payload: UserChannelResource, serviceSid: string, userSid: string, channelSid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the User Channel resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User Channel resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the User Channel resource belongs to. + */ + channelSid: string; + /** + * The SID of the [User](https://www.twilio.com/docs/chat/rest/user-resource) the User Channel belongs to. + */ + userSid: string; + /** + * The SID of a [Member](https://www.twilio.com/docs/chat/rest/member-resource) that represents the User on the Channel. + */ + memberSid: string; + status: UserChannelChannelStatus; + /** + * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. + */ + lastConsumedMessageIndex: number; + /** + * The number of unread Messages in the Channel for the User. Note that retrieving messages on a client endpoint does not mean that messages are consumed or read. See [Consumption Horizon feature](https://www.twilio.com/docs/chat/consumption-horizon) to learn how to mark messages as consumed. + */ + unreadMessagesCount: number; + /** + * The absolute URLs of the [Members](https://www.twilio.com/docs/chat/rest/member-resource), [Messages](https://www.twilio.com/docs/chat/rest/message-resource) , [Invites](https://www.twilio.com/docs/chat/rest/invite-resource) and, if it exists, the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) for the Channel. + */ + links: Record; + /** + * The absolute URL of the User Channel resource. + */ + url: string; + notificationLevel: UserChannelNotificationLevel; + private get _proxy(); + /** + * Remove a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a UserChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + remove(params: UserChannelContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + fetch(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Update a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + update(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Update a UserChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + update(params: UserChannelContextUpdateOptions, callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + channelSid: string; + userSid: string; + memberSid: string; + status: UserChannelChannelStatus; + lastConsumedMessageIndex: number; + unreadMessagesCount: number; + links: Record; + url: string; + notificationLevel: UserChannelNotificationLevel; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserChannelSolution { + serviceSid: string; + userSid: string; +} +export interface UserChannelListInstance { + _version: V2; + _solution: UserChannelSolution; + _uri: string; + (channelSid: string): UserChannelContext; + get(channelSid: string): UserChannelContext; + /** + * Streams UserChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + each(params: UserChannelListInstanceEachOptions, callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + /** + * Lists UserChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserChannelInstance[]) => any): Promise; + list(params: UserChannelListInstanceOptions, callback?: (error: Error | null, items: UserChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of UserChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + page(params: UserChannelListInstancePageOptions, callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserChannelListInstance(version: V2, serviceSid: string, userSid: string): UserChannelListInstance; +export declare class UserChannelPage extends Page { + /** + * Initialize the UserChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: UserChannelSolution); + /** + * Build an instance of UserChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserChannelResource): UserChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v2/service/user/userChannel.js b/node_modules/twilio/lib/rest/chat/v2/service/user/userChannel.js new file mode 100644 index 00000000..5e6026a3 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v2/service/user/userChannel.js @@ -0,0 +1,263 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserChannelPage = exports.UserChannelListInstance = exports.UserChannelInstance = exports.UserChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class UserChannelContextImpl { + constructor(_version, serviceSid, userSid, channelSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + this._solution = { serviceSid, userSid, channelSid }; + this._uri = `/Services/${serviceSid}/Users/${userSid}/Channels/${channelSid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.userSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["notificationLevel"] !== undefined) + data["NotificationLevel"] = params["notificationLevel"]; + if (params["lastConsumedMessageIndex"] !== undefined) + data["LastConsumedMessageIndex"] = params["lastConsumedMessageIndex"]; + if (params["lastConsumptionTimestamp"] !== undefined) + data["LastConsumptionTimestamp"] = serialize.iso8601DateTime(params["lastConsumptionTimestamp"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.userSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelContextImpl = UserChannelContextImpl; +class UserChannelInstance { + constructor(_version, payload, serviceSid, userSid, channelSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.channelSid = payload.channel_sid; + this.userSid = payload.user_sid; + this.memberSid = payload.member_sid; + this.status = payload.status; + this.lastConsumedMessageIndex = deserialize.integer(payload.last_consumed_message_index); + this.unreadMessagesCount = deserialize.integer(payload.unread_messages_count); + this.links = payload.links; + this.url = payload.url; + this.notificationLevel = payload.notification_level; + this._solution = { + serviceSid, + userSid, + channelSid: channelSid || this.channelSid, + }; + } + get _proxy() { + this._context = + this._context || + new UserChannelContextImpl(this._version, this._solution.serviceSid, this._solution.userSid, this._solution.channelSid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + channelSid: this.channelSid, + userSid: this.userSid, + memberSid: this.memberSid, + status: this.status, + lastConsumedMessageIndex: this.lastConsumedMessageIndex, + unreadMessagesCount: this.unreadMessagesCount, + links: this.links, + url: this.url, + notificationLevel: this.notificationLevel, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelInstance = UserChannelInstance; +function UserChannelListInstance(version, serviceSid, userSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + const instance = ((channelSid) => instance.get(channelSid)); + instance.get = function get(channelSid) { + return new UserChannelContextImpl(version, serviceSid, userSid, channelSid); + }; + instance._version = version; + instance._solution = { serviceSid, userSid }; + instance._uri = `/Services/${serviceSid}/Users/${userSid}/Channels`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserChannelListInstance = UserChannelListInstance; +class UserChannelPage extends Page_1.default { + /** + * Initialize the UserChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserChannelInstance(this._version, payload, this._solution.serviceSid, this._solution.userSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelPage = UserChannelPage; diff --git a/node_modules/twilio/lib/rest/chat/v3/channel.d.ts b/node_modules/twilio/lib/rest/chat/v3/channel.d.ts new file mode 100644 index 00000000..ff97ad4f --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v3/channel.d.ts @@ -0,0 +1,189 @@ +/// +import { inspect, InspectOptions } from "util"; +import V3 from "../V3"; +export type ChannelChannelType = "public" | "private"; +export type ChannelWebhookEnabledType = "true" | "false"; +/** + * Options to pass to update a ChannelInstance + */ +export interface ChannelContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ChannelWebhookEnabledType; + /** */ + type?: ChannelChannelType; + /** The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. */ + messagingServiceSid?: string; +} +export interface ChannelContext { + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ChannelContextSolution { + serviceSid: string; + sid: string; +} +export declare class ChannelContextImpl implements ChannelContext { + protected _version: V3; + protected _solution: ChannelContextSolution; + protected _uri: string; + constructor(_version: V3, serviceSid: string, sid: string); + update(params?: ChannelContextUpdateOptions | ((error: Error | null, item?: ChannelInstance) => any), callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ChannelResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + unique_name: string; + attributes: string; + type: ChannelChannelType; + date_created: Date; + date_updated: Date; + created_by: string; + members_count: number; + messages_count: number; + messaging_service_sid: string; + url: string; +} +export declare class ChannelInstance { + protected _version: V3; + protected _solution: ChannelContextSolution; + protected _context?: ChannelContext; + constructor(_version: V3, payload: ChannelResource, serviceSid?: string, sid?: string); + /** + * The unique string that we created to identify the Channel resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Channel resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Channel resource is associated with. + */ + serviceSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\'s `sid` in the URL. + */ + uniqueName: string; + /** + * The JSON string that stores application-specific data. If attributes have not been set, `{}` is returned. + */ + attributes: string; + type: ChannelChannelType; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The `identity` of the User that created the channel. If the Channel was created by using the API, the value is `system`. + */ + createdBy: string; + /** + * The number of Members in the Channel. + */ + membersCount: number; + /** + * The number of Messages that have been passed in the Channel. + */ + messagesCount: number; + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. + */ + messagingServiceSid: string; + /** + * The absolute URL of the Channel resource. + */ + url: string; + private get _proxy(); + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + type: ChannelChannelType; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + membersCount: number; + messagesCount: number; + messagingServiceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ChannelSolution { +} +export interface ChannelListInstance { + _version: V3; + _solution: ChannelSolution; + _uri: string; + (serviceSid: string, sid: string): ChannelContext; + get(serviceSid: string, sid: string): ChannelContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ChannelListInstance(version: V3): ChannelListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/chat/v3/channel.js b/node_modules/twilio/lib/rest/chat/v3/channel.js new file mode 100644 index 00000000..d2398112 --- /dev/null +++ b/node_modules/twilio/lib/rest/chat/v3/channel.js @@ -0,0 +1,149 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Chat + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChannelListInstance = exports.ChannelInstance = exports.ChannelContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class ChannelContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${sid}`; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["type"] !== undefined) + data["Type"] = params["type"]; + if (params["messagingServiceSid"] !== undefined) + data["MessagingServiceSid"] = params["messagingServiceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelContextImpl = ChannelContextImpl; +class ChannelInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.attributes = payload.attributes; + this.type = payload.type; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this.membersCount = deserialize.integer(payload.members_count); + this.messagesCount = deserialize.integer(payload.messages_count); + this.messagingServiceSid = payload.messaging_service_sid; + this.url = payload.url; + this._solution = { + serviceSid: serviceSid || this.serviceSid, + sid: sid || this.sid, + }; + } + get _proxy() { + this._context = + this._context || + new ChannelContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + attributes: this.attributes, + type: this.type, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + membersCount: this.membersCount, + messagesCount: this.messagesCount, + messagingServiceSid: this.messagingServiceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelInstance = ChannelInstance; +function ChannelListInstance(version) { + const instance = ((serviceSid, sid) => instance.get(serviceSid, sid)); + instance.get = function get(serviceSid, sid) { + return new ChannelContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ChannelListInstance = ChannelListInstance; diff --git a/node_modules/twilio/lib/rest/content/V1.d.ts b/node_modules/twilio/lib/rest/content/V1.d.ts new file mode 100644 index 00000000..293f69e4 --- /dev/null +++ b/node_modules/twilio/lib/rest/content/V1.d.ts @@ -0,0 +1,25 @@ +import ContentBase from "../ContentBase"; +import Version from "../../base/Version"; +import { ContentListInstance } from "./v1/content"; +import { ContentAndApprovalsListInstance } from "./v1/contentAndApprovals"; +import { LegacyContentListInstance } from "./v1/legacyContent"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Content + * + * @param domain - The Twilio (Twilio.Content) domain + */ + constructor(domain: ContentBase); + /** contents - { Twilio.Content.V1.ContentListInstance } resource */ + protected _contents?: ContentListInstance; + /** contentAndApprovals - { Twilio.Content.V1.ContentAndApprovalsListInstance } resource */ + protected _contentAndApprovals?: ContentAndApprovalsListInstance; + /** legacyContents - { Twilio.Content.V1.LegacyContentListInstance } resource */ + protected _legacyContents?: LegacyContentListInstance; + /** Getter for contents resource */ + get contents(): ContentListInstance; + /** Getter for contentAndApprovals resource */ + get contentAndApprovals(): ContentAndApprovalsListInstance; + /** Getter for legacyContents resource */ + get legacyContents(): LegacyContentListInstance; +} diff --git a/node_modules/twilio/lib/rest/content/V1.js b/node_modules/twilio/lib/rest/content/V1.js new file mode 100644 index 00000000..d94593bd --- /dev/null +++ b/node_modules/twilio/lib/rest/content/V1.js @@ -0,0 +1,50 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Content + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const content_1 = require("./v1/content"); +const contentAndApprovals_1 = require("./v1/contentAndApprovals"); +const legacyContent_1 = require("./v1/legacyContent"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Content + * + * @param domain - The Twilio (Twilio.Content) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for contents resource */ + get contents() { + this._contents = this._contents || (0, content_1.ContentListInstance)(this); + return this._contents; + } + /** Getter for contentAndApprovals resource */ + get contentAndApprovals() { + this._contentAndApprovals = + this._contentAndApprovals || (0, contentAndApprovals_1.ContentAndApprovalsListInstance)(this); + return this._contentAndApprovals; + } + /** Getter for legacyContents resource */ + get legacyContents() { + this._legacyContents = + this._legacyContents || (0, legacyContent_1.LegacyContentListInstance)(this); + return this._legacyContents; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/content/v1/content.d.ts b/node_modules/twilio/lib/rest/content/v1/content.d.ts new file mode 100644 index 00000000..f68c7d84 --- /dev/null +++ b/node_modules/twilio/lib/rest/content/v1/content.d.ts @@ -0,0 +1,266 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { ApprovalFetchListInstance } from "./content/approvalFetch"; +/** + * Options to pass to each + */ +export interface ContentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ContentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ContentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ContentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ContentContext { + approvalFetch: ApprovalFetchListInstance; + /** + * Remove a ContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ContentInstance + */ + fetch(callback?: (error: Error | null, item?: ContentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ContentContextSolution { + sid: string; +} +export declare class ContentContextImpl implements ContentContext { + protected _version: V1; + protected _solution: ContentContextSolution; + protected _uri: string; + protected _approvalFetch?: ApprovalFetchListInstance; + constructor(_version: V1, sid: string); + get approvalFetch(): ApprovalFetchListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ContentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ContentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ContentPayload extends TwilioResponsePayload { + contents: ContentResource[]; +} +interface ContentResource { + date_created: Date; + date_updated: Date; + sid: string; + account_sid: string; + friendly_name: string; + language: string; + variables: any; + types: any; + url: string; + links: Record; +} +export declare class ContentInstance { + protected _version: V1; + protected _solution: ContentContextSolution; + protected _context?: ContentContext; + constructor(_version: V1, payload: ContentResource, sid?: string); + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The unique string that that we created to identify the Content resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. + */ + accountSid: string; + /** + * A string name used to describe the Content resource. Not visible to the end recipient. + */ + friendlyName: string; + /** + * Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. + */ + language: string; + /** + * Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. + */ + variables: any; + /** + * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + */ + types: any; + /** + * The URL of the resource, relative to `https://content.twilio.com`. + */ + url: string; + /** + * A list of links related to the Content resource, such as approval_fetch and approval_create + */ + links: Record; + private get _proxy(); + /** + * Remove a ContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ContentInstance + */ + fetch(callback?: (error: Error | null, item?: ContentInstance) => any): Promise; + /** + * Access the approvalFetch. + */ + approvalFetch(): ApprovalFetchListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + dateCreated: Date; + dateUpdated: Date; + sid: string; + accountSid: string; + friendlyName: string; + language: string; + variables: any; + types: any; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ContentSolution { +} +export interface ContentListInstance { + _version: V1; + _solution: ContentSolution; + _uri: string; + (sid: string): ContentContext; + get(sid: string): ContentContext; + /** + * Streams ContentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ContentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ContentInstance, done: (err?: Error) => void) => void): void; + each(params: ContentListInstanceEachOptions, callback?: (item: ContentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ContentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ContentPage) => any): Promise; + /** + * Lists ContentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ContentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ContentInstance[]) => any): Promise; + list(params: ContentListInstanceOptions, callback?: (error: Error | null, items: ContentInstance[]) => any): Promise; + /** + * Retrieve a single page of ContentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ContentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ContentPage) => any): Promise; + page(params: ContentListInstancePageOptions, callback?: (error: Error | null, items: ContentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ContentListInstance(version: V1): ContentListInstance; +export declare class ContentPage extends Page { + /** + * Initialize the ContentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ContentSolution); + /** + * Build an instance of ContentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ContentResource): ContentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/content/v1/content.js b/node_modules/twilio/lib/rest/content/v1/content.js new file mode 100644 index 00000000..4d479e1b --- /dev/null +++ b/node_modules/twilio/lib/rest/content/v1/content.js @@ -0,0 +1,221 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Content + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ContentPage = exports.ContentListInstance = exports.ContentInstance = exports.ContentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const approvalFetch_1 = require("./content/approvalFetch"); +class ContentContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Content/${sid}`; + } + get approvalFetch() { + this._approvalFetch = + this._approvalFetch || + (0, approvalFetch_1.ApprovalFetchListInstance)(this._version, this._solution.sid); + return this._approvalFetch; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ContentInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ContentContextImpl = ContentContextImpl; +class ContentInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.language = payload.language; + this.variables = payload.variables; + this.types = payload.types; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ContentContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ContentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the approvalFetch. + */ + approvalFetch() { + return this._proxy.approvalFetch; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + language: this.language, + variables: this.variables, + types: this.types, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ContentInstance = ContentInstance; +function ContentListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ContentContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Content`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ContentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ContentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ContentListInstance = ContentListInstance; +class ContentPage extends Page_1.default { + /** + * Initialize the ContentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ContentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ContentInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ContentPage = ContentPage; diff --git a/node_modules/twilio/lib/rest/content/v1/content/approvalFetch.d.ts b/node_modules/twilio/lib/rest/content/v1/content/approvalFetch.d.ts new file mode 100644 index 00000000..4b04717e --- /dev/null +++ b/node_modules/twilio/lib/rest/content/v1/content/approvalFetch.d.ts @@ -0,0 +1,101 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export interface ApprovalFetchContext { + /** + * Fetch a ApprovalFetchInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApprovalFetchInstance + */ + fetch(callback?: (error: Error | null, item?: ApprovalFetchInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ApprovalFetchContextSolution { + sid: string; +} +export declare class ApprovalFetchContextImpl implements ApprovalFetchContext { + protected _version: V1; + protected _solution: ApprovalFetchContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: ApprovalFetchInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ApprovalFetchContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ApprovalFetchResource { + sid: string; + account_sid: string; + whatsapp: any; + url: string; +} +export declare class ApprovalFetchInstance { + protected _version: V1; + protected _solution: ApprovalFetchContextSolution; + protected _context?: ApprovalFetchContext; + constructor(_version: V1, payload: ApprovalFetchResource, sid: string); + /** + * The unique string that that we created to identify the Content resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. + */ + accountSid: string; + /** + * Contains the whatsapp approval information for the Content resource, with fields such as approval status, rejection reason, and category, amongst others. + */ + whatsapp: any; + /** + * The URL of the resource, relative to `https://content.twilio.com`. + */ + url: string; + private get _proxy(); + /** + * Fetch a ApprovalFetchInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApprovalFetchInstance + */ + fetch(callback?: (error: Error | null, item?: ApprovalFetchInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + whatsapp: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ApprovalFetchSolution { + sid: string; +} +export interface ApprovalFetchListInstance { + _version: V1; + _solution: ApprovalFetchSolution; + _uri: string; + (): ApprovalFetchContext; + get(): ApprovalFetchContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ApprovalFetchListInstance(version: V1, sid: string): ApprovalFetchListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/content/v1/content/approvalFetch.js b/node_modules/twilio/lib/rest/content/v1/content/approvalFetch.js new file mode 100644 index 00000000..ecc8aabc --- /dev/null +++ b/node_modules/twilio/lib/rest/content/v1/content/approvalFetch.js @@ -0,0 +1,115 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Content + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApprovalFetchListInstance = exports.ApprovalFetchInstance = exports.ApprovalFetchContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ApprovalFetchContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Content/${sid}/ApprovalRequests`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ApprovalFetchInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ApprovalFetchContextImpl = ApprovalFetchContextImpl; +class ApprovalFetchInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.whatsapp = payload.whatsapp; + this.url = payload.url; + this._solution = { sid }; + } + get _proxy() { + this._context = + this._context || + new ApprovalFetchContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a ApprovalFetchInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ApprovalFetchInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + whatsapp: this.whatsapp, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ApprovalFetchInstance = ApprovalFetchInstance; +function ApprovalFetchListInstance(version, sid) { + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new ApprovalFetchContextImpl(version, sid); + }; + instance._version = version; + instance._solution = { sid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ApprovalFetchListInstance = ApprovalFetchListInstance; diff --git a/node_modules/twilio/lib/rest/content/v1/contentAndApprovals.d.ts b/node_modules/twilio/lib/rest/content/v1/contentAndApprovals.d.ts new file mode 100644 index 00000000..b2b82da9 --- /dev/null +++ b/node_modules/twilio/lib/rest/content/v1/contentAndApprovals.d.ts @@ -0,0 +1,190 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface ContentAndApprovalsListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ContentAndApprovalsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ContentAndApprovalsListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ContentAndApprovalsListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ContentAndApprovalsSolution { +} +export interface ContentAndApprovalsListInstance { + _version: V1; + _solution: ContentAndApprovalsSolution; + _uri: string; + /** + * Streams ContentAndApprovalsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ContentAndApprovalsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ContentAndApprovalsInstance, done: (err?: Error) => void) => void): void; + each(params: ContentAndApprovalsListInstanceEachOptions, callback?: (item: ContentAndApprovalsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ContentAndApprovalsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ContentAndApprovalsPage) => any): Promise; + /** + * Lists ContentAndApprovalsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ContentAndApprovalsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ContentAndApprovalsInstance[]) => any): Promise; + list(params: ContentAndApprovalsListInstanceOptions, callback?: (error: Error | null, items: ContentAndApprovalsInstance[]) => any): Promise; + /** + * Retrieve a single page of ContentAndApprovalsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ContentAndApprovalsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ContentAndApprovalsPage) => any): Promise; + page(params: ContentAndApprovalsListInstancePageOptions, callback?: (error: Error | null, items: ContentAndApprovalsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ContentAndApprovalsListInstance(version: V1): ContentAndApprovalsListInstance; +interface ContentAndApprovalsPayload extends TwilioResponsePayload { + contents: ContentAndApprovalsResource[]; +} +interface ContentAndApprovalsResource { + date_created: Date; + date_updated: Date; + sid: string; + account_sid: string; + friendly_name: string; + language: string; + variables: any; + types: any; + approval_requests: any; +} +export declare class ContentAndApprovalsInstance { + protected _version: V1; + constructor(_version: V1, payload: ContentAndApprovalsResource); + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The unique string that that we created to identify the Content resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. + */ + accountSid: string; + /** + * A string name used to describe the Content resource. Not visible to the end recipient. + */ + friendlyName: string; + /** + * Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. + */ + language: string; + /** + * Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. + */ + variables: any; + /** + * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + */ + types: any; + /** + * The submitted information and approval request status of the Content resource. + */ + approvalRequests: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + dateCreated: Date; + dateUpdated: Date; + sid: string; + accountSid: string; + friendlyName: string; + language: string; + variables: any; + types: any; + approvalRequests: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class ContentAndApprovalsPage extends Page { + /** + * Initialize the ContentAndApprovalsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ContentAndApprovalsSolution); + /** + * Build an instance of ContentAndApprovalsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ContentAndApprovalsResource): ContentAndApprovalsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/content/v1/contentAndApprovals.js b/node_modules/twilio/lib/rest/content/v1/contentAndApprovals.js new file mode 100644 index 00000000..ceda7d81 --- /dev/null +++ b/node_modules/twilio/lib/rest/content/v1/contentAndApprovals.js @@ -0,0 +1,134 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Content + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ContentAndApprovalsPage = exports.ContentAndApprovalsInstance = exports.ContentAndApprovalsListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function ContentAndApprovalsListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/ContentAndApprovals`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ContentAndApprovalsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ContentAndApprovalsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ContentAndApprovalsListInstance = ContentAndApprovalsListInstance; +class ContentAndApprovalsInstance { + constructor(_version, payload) { + this._version = _version; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.language = payload.language; + this.variables = payload.variables; + this.types = payload.types; + this.approvalRequests = payload.approval_requests; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + language: this.language, + variables: this.variables, + types: this.types, + approvalRequests: this.approvalRequests, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ContentAndApprovalsInstance = ContentAndApprovalsInstance; +class ContentAndApprovalsPage extends Page_1.default { + /** + * Initialize the ContentAndApprovalsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ContentAndApprovalsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ContentAndApprovalsInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ContentAndApprovalsPage = ContentAndApprovalsPage; diff --git a/node_modules/twilio/lib/rest/content/v1/legacyContent.d.ts b/node_modules/twilio/lib/rest/content/v1/legacyContent.d.ts new file mode 100644 index 00000000..54f8015c --- /dev/null +++ b/node_modules/twilio/lib/rest/content/v1/legacyContent.d.ts @@ -0,0 +1,202 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface LegacyContentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: LegacyContentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface LegacyContentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface LegacyContentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface LegacyContentSolution { +} +export interface LegacyContentListInstance { + _version: V1; + _solution: LegacyContentSolution; + _uri: string; + /** + * Streams LegacyContentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LegacyContentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: LegacyContentInstance, done: (err?: Error) => void) => void): void; + each(params: LegacyContentListInstanceEachOptions, callback?: (item: LegacyContentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of LegacyContentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: LegacyContentPage) => any): Promise; + /** + * Lists LegacyContentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LegacyContentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: LegacyContentInstance[]) => any): Promise; + list(params: LegacyContentListInstanceOptions, callback?: (error: Error | null, items: LegacyContentInstance[]) => any): Promise; + /** + * Retrieve a single page of LegacyContentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LegacyContentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: LegacyContentPage) => any): Promise; + page(params: LegacyContentListInstancePageOptions, callback?: (error: Error | null, items: LegacyContentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function LegacyContentListInstance(version: V1): LegacyContentListInstance; +interface LegacyContentPayload extends TwilioResponsePayload { + contents: LegacyContentResource[]; +} +interface LegacyContentResource { + date_created: Date; + date_updated: Date; + sid: string; + account_sid: string; + friendly_name: string; + language: string; + variables: any; + types: any; + legacy_template_name: string; + legacy_body: string; + url: string; +} +export declare class LegacyContentInstance { + protected _version: V1; + constructor(_version: V1, payload: LegacyContentResource); + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The unique string that that we created to identify the Content resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. + */ + accountSid: string; + /** + * A string name used to describe the Content resource. Not visible to the end recipient. + */ + friendlyName: string; + /** + * Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. + */ + language: string; + /** + * Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. + */ + variables: any; + /** + * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + */ + types: any; + /** + * The string name of the legacy content template associated with this Content resource, unique across all template names for its account. Only lowercase letters, numbers and underscores are allowed + */ + legacyTemplateName: string; + /** + * The string body field of the legacy content template associated with this Content resource + */ + legacyBody: string; + /** + * The URL of the resource, relative to `https://content.twilio.com`. + */ + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + dateCreated: Date; + dateUpdated: Date; + sid: string; + accountSid: string; + friendlyName: string; + language: string; + variables: any; + types: any; + legacyTemplateName: string; + legacyBody: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class LegacyContentPage extends Page { + /** + * Initialize the LegacyContentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: LegacyContentSolution); + /** + * Build an instance of LegacyContentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: LegacyContentResource): LegacyContentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/content/v1/legacyContent.js b/node_modules/twilio/lib/rest/content/v1/legacyContent.js new file mode 100644 index 00000000..8e5e3a85 --- /dev/null +++ b/node_modules/twilio/lib/rest/content/v1/legacyContent.js @@ -0,0 +1,138 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Content + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LegacyContentPage = exports.LegacyContentInstance = exports.LegacyContentListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function LegacyContentListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/LegacyContent`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new LegacyContentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new LegacyContentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.LegacyContentListInstance = LegacyContentListInstance; +class LegacyContentInstance { + constructor(_version, payload) { + this._version = _version; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.language = payload.language; + this.variables = payload.variables; + this.types = payload.types; + this.legacyTemplateName = payload.legacy_template_name; + this.legacyBody = payload.legacy_body; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + language: this.language, + variables: this.variables, + types: this.types, + legacyTemplateName: this.legacyTemplateName, + legacyBody: this.legacyBody, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LegacyContentInstance = LegacyContentInstance; +class LegacyContentPage extends Page_1.default { + /** + * Initialize the LegacyContentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of LegacyContentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new LegacyContentInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LegacyContentPage = LegacyContentPage; diff --git a/node_modules/twilio/lib/rest/conversations/V1.d.ts b/node_modules/twilio/lib/rest/conversations/V1.d.ts new file mode 100644 index 00000000..35451a21 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/V1.d.ts @@ -0,0 +1,50 @@ +import ConversationsBase from "../ConversationsBase"; +import Version from "../../base/Version"; +import { AddressConfigurationListInstance } from "./v1/addressConfiguration"; +import { ConfigurationListInstance } from "./v1/configuration"; +import { ConversationListInstance } from "./v1/conversation"; +import { CredentialListInstance } from "./v1/credential"; +import { ParticipantConversationListInstance } from "./v1/participantConversation"; +import { RoleListInstance } from "./v1/role"; +import { ServiceListInstance } from "./v1/service"; +import { UserListInstance } from "./v1/user"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Conversations + * + * @param domain - The Twilio (Twilio.Conversations) domain + */ + constructor(domain: ConversationsBase); + /** addressConfigurations - { Twilio.Conversations.V1.AddressConfigurationListInstance } resource */ + protected _addressConfigurations?: AddressConfigurationListInstance; + /** configuration - { Twilio.Conversations.V1.ConfigurationListInstance } resource */ + protected _configuration?: ConfigurationListInstance; + /** conversations - { Twilio.Conversations.V1.ConversationListInstance } resource */ + protected _conversations?: ConversationListInstance; + /** credentials - { Twilio.Conversations.V1.CredentialListInstance } resource */ + protected _credentials?: CredentialListInstance; + /** participantConversations - { Twilio.Conversations.V1.ParticipantConversationListInstance } resource */ + protected _participantConversations?: ParticipantConversationListInstance; + /** roles - { Twilio.Conversations.V1.RoleListInstance } resource */ + protected _roles?: RoleListInstance; + /** services - { Twilio.Conversations.V1.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** users - { Twilio.Conversations.V1.UserListInstance } resource */ + protected _users?: UserListInstance; + /** Getter for addressConfigurations resource */ + get addressConfigurations(): AddressConfigurationListInstance; + /** Getter for configuration resource */ + get configuration(): ConfigurationListInstance; + /** Getter for conversations resource */ + get conversations(): ConversationListInstance; + /** Getter for credentials resource */ + get credentials(): CredentialListInstance; + /** Getter for participantConversations resource */ + get participantConversations(): ParticipantConversationListInstance; + /** Getter for roles resource */ + get roles(): RoleListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; + /** Getter for users resource */ + get users(): UserListInstance; +} diff --git a/node_modules/twilio/lib/rest/conversations/V1.js b/node_modules/twilio/lib/rest/conversations/V1.js new file mode 100644 index 00000000..28d693f7 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/V1.js @@ -0,0 +1,82 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const addressConfiguration_1 = require("./v1/addressConfiguration"); +const configuration_1 = require("./v1/configuration"); +const conversation_1 = require("./v1/conversation"); +const credential_1 = require("./v1/credential"); +const participantConversation_1 = require("./v1/participantConversation"); +const role_1 = require("./v1/role"); +const service_1 = require("./v1/service"); +const user_1 = require("./v1/user"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Conversations + * + * @param domain - The Twilio (Twilio.Conversations) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for addressConfigurations resource */ + get addressConfigurations() { + this._addressConfigurations = + this._addressConfigurations || (0, addressConfiguration_1.AddressConfigurationListInstance)(this); + return this._addressConfigurations; + } + /** Getter for configuration resource */ + get configuration() { + this._configuration = + this._configuration || (0, configuration_1.ConfigurationListInstance)(this); + return this._configuration; + } + /** Getter for conversations resource */ + get conversations() { + this._conversations = this._conversations || (0, conversation_1.ConversationListInstance)(this); + return this._conversations; + } + /** Getter for credentials resource */ + get credentials() { + this._credentials = this._credentials || (0, credential_1.CredentialListInstance)(this); + return this._credentials; + } + /** Getter for participantConversations resource */ + get participantConversations() { + this._participantConversations = + this._participantConversations || + (0, participantConversation_1.ParticipantConversationListInstance)(this); + return this._participantConversations; + } + /** Getter for roles resource */ + get roles() { + this._roles = this._roles || (0, role_1.RoleListInstance)(this); + return this._roles; + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } + /** Getter for users resource */ + get users() { + this._users = this._users || (0, user_1.UserListInstance)(this); + return this._users; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/conversations/v1/addressConfiguration.d.ts b/node_modules/twilio/lib/rest/conversations/v1/addressConfiguration.d.ts new file mode 100644 index 00000000..0e08b562 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/addressConfiguration.d.ts @@ -0,0 +1,363 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type AddressConfigurationAutoCreationType = "webhook" | "studio" | "default"; +export type AddressConfigurationMethod = "GET" | "POST"; +export type AddressConfigurationType = "sms" | "whatsapp" | "messenger" | "gbm" | "email"; +/** + * Options to pass to update a AddressConfigurationInstance + */ +export interface AddressConfigurationContextUpdateOptions { + /** The human-readable name of this configuration, limited to 256 characters. Optional. */ + friendlyName?: string; + /** Enable/Disable auto-creating conversations for messages to this address */ + "autoCreation.enabled"?: boolean; + /** */ + "autoCreation.type"?: AddressConfigurationAutoCreationType; + /** Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. */ + "autoCreation.conversationServiceSid"?: string; + /** For type `webhook`, the url for the webhook request. */ + "autoCreation.webhookUrl"?: string; + /** */ + "autoCreation.webhookMethod"?: AddressConfigurationMethod; + /** The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` */ + "autoCreation.webhookFilters"?: Array; + /** For type `studio`, the studio flow SID where the webhook should be sent to. */ + "autoCreation.studioFlowSid"?: string; + /** For type `studio`, number of times to retry the webhook request */ + "autoCreation.studioRetryCount"?: number; +} +/** + * Options to pass to create a AddressConfigurationInstance + */ +export interface AddressConfigurationListInstanceCreateOptions { + /** */ + type: AddressConfigurationType; + /** The unique address to be configured. The address can be a whatsapp address or phone number */ + address: string; + /** The human-readable name of this configuration, limited to 256 characters. Optional. */ + friendlyName?: string; + /** Enable/Disable auto-creating conversations for messages to this address */ + "autoCreation.enabled"?: boolean; + /** */ + "autoCreation.type"?: AddressConfigurationAutoCreationType; + /** Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. */ + "autoCreation.conversationServiceSid"?: string; + /** For type `webhook`, the url for the webhook request. */ + "autoCreation.webhookUrl"?: string; + /** */ + "autoCreation.webhookMethod"?: AddressConfigurationMethod; + /** The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` */ + "autoCreation.webhookFilters"?: Array; + /** For type `studio`, the studio flow SID where the webhook should be sent to. */ + "autoCreation.studioFlowSid"?: string; + /** For type `studio`, number of times to retry the webhook request */ + "autoCreation.studioRetryCount"?: number; + /** An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. */ + addressCountry?: string; +} +/** + * Options to pass to each + */ +export interface AddressConfigurationListInstanceEachOptions { + /** Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. */ + type?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AddressConfigurationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AddressConfigurationListInstanceOptions { + /** Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. */ + type?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AddressConfigurationListInstancePageOptions { + /** Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. */ + type?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AddressConfigurationContext { + /** + * Remove a AddressConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AddressConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + /** + * Update a AddressConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressConfigurationInstance + */ + update(callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + /** + * Update a AddressConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressConfigurationInstance + */ + update(params: AddressConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AddressConfigurationContextSolution { + sid: string; +} +export declare class AddressConfigurationContextImpl implements AddressConfigurationContext { + protected _version: V1; + protected _solution: AddressConfigurationContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + update(params?: AddressConfigurationContextUpdateOptions | ((error: Error | null, item?: AddressConfigurationInstance) => any), callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AddressConfigurationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AddressConfigurationPayload extends TwilioResponsePayload { + address_configurations: AddressConfigurationResource[]; +} +interface AddressConfigurationResource { + sid: string; + account_sid: string; + type: string; + address: string; + friendly_name: string; + auto_creation: any; + date_created: Date; + date_updated: Date; + url: string; + address_country: string; +} +export declare class AddressConfigurationInstance { + protected _version: V1; + protected _solution: AddressConfigurationContextSolution; + protected _context?: AddressConfigurationContext; + constructor(_version: V1, payload: AddressConfigurationResource, sid?: string); + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) the address belongs to + */ + accountSid: string; + /** + * Type of Address, value can be `whatsapp` or `sms`. + */ + type: string; + /** + * The unique address to be configured. The address can be a whatsapp address or phone number + */ + address: string; + /** + * The human-readable name of this configuration, limited to 256 characters. Optional. + */ + friendlyName: string; + /** + * Auto Creation configuration for the address. + */ + autoCreation: any; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this address configuration. + */ + url: string; + /** + * An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. + */ + addressCountry: string; + private get _proxy(); + /** + * Remove a AddressConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AddressConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + /** + * Update a AddressConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressConfigurationInstance + */ + update(callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + /** + * Update a AddressConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressConfigurationInstance + */ + update(params: AddressConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + type: string; + address: string; + friendlyName: string; + autoCreation: any; + dateCreated: Date; + dateUpdated: Date; + url: string; + addressCountry: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AddressConfigurationSolution { +} +export interface AddressConfigurationListInstance { + _version: V1; + _solution: AddressConfigurationSolution; + _uri: string; + (sid: string): AddressConfigurationContext; + get(sid: string): AddressConfigurationContext; + /** + * Create a AddressConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressConfigurationInstance + */ + create(params: AddressConfigurationListInstanceCreateOptions, callback?: (error: Error | null, item?: AddressConfigurationInstance) => any): Promise; + /** + * Streams AddressConfigurationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddressConfigurationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AddressConfigurationInstance, done: (err?: Error) => void) => void): void; + each(params: AddressConfigurationListInstanceEachOptions, callback?: (item: AddressConfigurationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AddressConfigurationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AddressConfigurationPage) => any): Promise; + /** + * Lists AddressConfigurationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddressConfigurationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AddressConfigurationInstance[]) => any): Promise; + list(params: AddressConfigurationListInstanceOptions, callback?: (error: Error | null, items: AddressConfigurationInstance[]) => any): Promise; + /** + * Retrieve a single page of AddressConfigurationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AddressConfigurationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AddressConfigurationPage) => any): Promise; + page(params: AddressConfigurationListInstancePageOptions, callback?: (error: Error | null, items: AddressConfigurationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AddressConfigurationListInstance(version: V1): AddressConfigurationListInstance; +export declare class AddressConfigurationPage extends Page { + /** + * Initialize the AddressConfigurationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AddressConfigurationSolution); + /** + * Build an instance of AddressConfigurationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AddressConfigurationResource): AddressConfigurationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/addressConfiguration.js b/node_modules/twilio/lib/rest/conversations/v1/addressConfiguration.js new file mode 100644 index 00000000..32f1b64a --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/addressConfiguration.js @@ -0,0 +1,302 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AddressConfigurationPage = exports.AddressConfigurationListInstance = exports.AddressConfigurationInstance = exports.AddressConfigurationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class AddressConfigurationContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Configuration/Addresses/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AddressConfigurationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["autoCreation.enabled"] !== undefined) + data["AutoCreation.Enabled"] = serialize.bool(params["autoCreation.enabled"]); + if (params["autoCreation.type"] !== undefined) + data["AutoCreation.Type"] = params["autoCreation.type"]; + if (params["autoCreation.conversationServiceSid"] !== undefined) + data["AutoCreation.ConversationServiceSid"] = + params["autoCreation.conversationServiceSid"]; + if (params["autoCreation.webhookUrl"] !== undefined) + data["AutoCreation.WebhookUrl"] = params["autoCreation.webhookUrl"]; + if (params["autoCreation.webhookMethod"] !== undefined) + data["AutoCreation.WebhookMethod"] = params["autoCreation.webhookMethod"]; + if (params["autoCreation.webhookFilters"] !== undefined) + data["AutoCreation.WebhookFilters"] = serialize.map(params["autoCreation.webhookFilters"], (e) => e); + if (params["autoCreation.studioFlowSid"] !== undefined) + data["AutoCreation.StudioFlowSid"] = params["autoCreation.studioFlowSid"]; + if (params["autoCreation.studioRetryCount"] !== undefined) + data["AutoCreation.StudioRetryCount"] = + params["autoCreation.studioRetryCount"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AddressConfigurationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddressConfigurationContextImpl = AddressConfigurationContextImpl; +class AddressConfigurationInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.type = payload.type; + this.address = payload.address; + this.friendlyName = payload.friendly_name; + this.autoCreation = payload.auto_creation; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.addressCountry = payload.address_country; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AddressConfigurationContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a AddressConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AddressConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AddressConfigurationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + type: this.type, + address: this.address, + friendlyName: this.friendlyName, + autoCreation: this.autoCreation, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + addressCountry: this.addressCountry, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddressConfigurationInstance = AddressConfigurationInstance; +function AddressConfigurationListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AddressConfigurationContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Configuration/Addresses`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + if (params["address"] === null || params["address"] === undefined) { + throw new Error("Required parameter \"params['address']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + data["Address"] = params["address"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["autoCreation.enabled"] !== undefined) + data["AutoCreation.Enabled"] = serialize.bool(params["autoCreation.enabled"]); + if (params["autoCreation.type"] !== undefined) + data["AutoCreation.Type"] = params["autoCreation.type"]; + if (params["autoCreation.conversationServiceSid"] !== undefined) + data["AutoCreation.ConversationServiceSid"] = + params["autoCreation.conversationServiceSid"]; + if (params["autoCreation.webhookUrl"] !== undefined) + data["AutoCreation.WebhookUrl"] = params["autoCreation.webhookUrl"]; + if (params["autoCreation.webhookMethod"] !== undefined) + data["AutoCreation.WebhookMethod"] = params["autoCreation.webhookMethod"]; + if (params["autoCreation.webhookFilters"] !== undefined) + data["AutoCreation.WebhookFilters"] = serialize.map(params["autoCreation.webhookFilters"], (e) => e); + if (params["autoCreation.studioFlowSid"] !== undefined) + data["AutoCreation.StudioFlowSid"] = params["autoCreation.studioFlowSid"]; + if (params["autoCreation.studioRetryCount"] !== undefined) + data["AutoCreation.StudioRetryCount"] = + params["autoCreation.studioRetryCount"]; + if (params["addressCountry"] !== undefined) + data["AddressCountry"] = params["addressCountry"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AddressConfigurationInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["type"] !== undefined) + data["Type"] = params["type"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AddressConfigurationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AddressConfigurationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AddressConfigurationListInstance = AddressConfigurationListInstance; +class AddressConfigurationPage extends Page_1.default { + /** + * Initialize the AddressConfigurationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AddressConfigurationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AddressConfigurationInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AddressConfigurationPage = AddressConfigurationPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/configuration.d.ts b/node_modules/twilio/lib/rest/conversations/v1/configuration.d.ts new file mode 100644 index 00000000..c2b838cf --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/configuration.d.ts @@ -0,0 +1,168 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { WebhookListInstance } from "./configuration/webhook"; +/** + * Options to pass to update a ConfigurationInstance + */ +export interface ConfigurationContextUpdateOptions { + /** The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. */ + defaultChatServiceSid?: string; + /** The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. */ + defaultMessagingServiceSid?: string; + /** Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. */ + defaultInactiveTimer?: string; + /** Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. */ + defaultClosedTimer?: string; +} +export interface ConfigurationContext { + /** + * Fetch a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Update a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + update(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Update a ConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + update(params: ConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConfigurationContextSolution { +} +export declare class ConfigurationContextImpl implements ConfigurationContext { + protected _version: V1; + protected _solution: ConfigurationContextSolution; + protected _uri: string; + constructor(_version: V1); + fetch(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + update(params?: ConfigurationContextUpdateOptions | ((error: Error | null, item?: ConfigurationInstance) => any), callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConfigurationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConfigurationResource { + account_sid: string; + default_chat_service_sid: string; + default_messaging_service_sid: string; + default_inactive_timer: string; + default_closed_timer: string; + url: string; + links: Record; +} +export declare class ConfigurationInstance { + protected _version: V1; + protected _solution: ConfigurationContextSolution; + protected _context?: ConfigurationContext; + constructor(_version: V1, payload: ConfigurationResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this configuration. + */ + accountSid: string; + /** + * The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) used when creating a conversation. + */ + defaultChatServiceSid: string; + /** + * The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) used when creating a conversation. + */ + defaultMessagingServiceSid: string; + /** + * Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + */ + defaultInactiveTimer: string; + /** + * Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + */ + defaultClosedTimer: string; + /** + * An absolute API resource URL for this global configuration. + */ + url: string; + /** + * Contains absolute API resource URLs to access the webhook and default service configurations. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Update a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + update(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Update a ConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + update(params: ConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + defaultChatServiceSid: string; + defaultMessagingServiceSid: string; + defaultInactiveTimer: string; + defaultClosedTimer: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConfigurationSolution { +} +export interface ConfigurationListInstance { + _version: V1; + _solution: ConfigurationSolution; + _uri: string; + (): ConfigurationContext; + get(): ConfigurationContext; + _webhooks?: WebhookListInstance; + webhooks: WebhookListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConfigurationListInstance(version: V1): ConfigurationListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/configuration.js b/node_modules/twilio/lib/rest/conversations/v1/configuration.js new file mode 100644 index 00000000..c795e36d --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/configuration.js @@ -0,0 +1,155 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConfigurationListInstance = exports.ConfigurationInstance = exports.ConfigurationContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const webhook_1 = require("./configuration/webhook"); +class ConfigurationContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Configuration`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["defaultChatServiceSid"] !== undefined) + data["DefaultChatServiceSid"] = params["defaultChatServiceSid"]; + if (params["defaultMessagingServiceSid"] !== undefined) + data["DefaultMessagingServiceSid"] = params["defaultMessagingServiceSid"]; + if (params["defaultInactiveTimer"] !== undefined) + data["DefaultInactiveTimer"] = params["defaultInactiveTimer"]; + if (params["defaultClosedTimer"] !== undefined) + data["DefaultClosedTimer"] = params["defaultClosedTimer"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConfigurationContextImpl = ConfigurationContextImpl; +class ConfigurationInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.defaultChatServiceSid = payload.default_chat_service_sid; + this.defaultMessagingServiceSid = payload.default_messaging_service_sid; + this.defaultInactiveTimer = payload.default_inactive_timer; + this.defaultClosedTimer = payload.default_closed_timer; + this.url = payload.url; + this.links = payload.links; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new ConfigurationContextImpl(this._version); + return this._context; + } + /** + * Fetch a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + defaultChatServiceSid: this.defaultChatServiceSid, + defaultMessagingServiceSid: this.defaultMessagingServiceSid, + defaultInactiveTimer: this.defaultInactiveTimer, + defaultClosedTimer: this.defaultClosedTimer, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConfigurationInstance = ConfigurationInstance; +function ConfigurationListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new ConfigurationContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + Object.defineProperty(instance, "webhooks", { + get: function webhooks() { + if (!instance._webhooks) { + instance._webhooks = (0, webhook_1.WebhookListInstance)(instance._version); + } + return instance._webhooks; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConfigurationListInstance = ConfigurationListInstance; diff --git a/node_modules/twilio/lib/rest/conversations/v1/configuration/webhook.d.ts b/node_modules/twilio/lib/rest/conversations/v1/configuration/webhook.d.ts new file mode 100644 index 00000000..3a7e949c --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/configuration/webhook.d.ts @@ -0,0 +1,163 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export type WebhookMethod = "GET" | "POST"; +export type WebhookTarget = "webhook" | "flex"; +/** + * Options to pass to update a WebhookInstance + */ +export interface WebhookContextUpdateOptions { + /** The HTTP method to be used when sending a webhook request. */ + method?: string; + /** The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` */ + filters?: Array; + /** The absolute url the pre-event webhook request should be sent to. */ + preWebhookUrl?: string; + /** The absolute url the post-event webhook request should be sent to. */ + postWebhookUrl?: string; + /** */ + target?: WebhookTarget; +} +export interface WebhookContext { + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WebhookContextSolution { +} +export declare class WebhookContextImpl implements WebhookContext { + protected _version: V1; + protected _solution: WebhookContextSolution; + protected _uri: string; + constructor(_version: V1); + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + update(params?: WebhookContextUpdateOptions | ((error: Error | null, item?: WebhookInstance) => any), callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WebhookContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WebhookResource { + account_sid: string; + method: WebhookMethod; + filters: Array; + pre_webhook_url: string; + post_webhook_url: string; + target: WebhookTarget; + url: string; +} +export declare class WebhookInstance { + protected _version: V1; + protected _solution: WebhookContextSolution; + protected _context?: WebhookContext; + constructor(_version: V1, payload: WebhookResource); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + method: WebhookMethod; + /** + * The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + */ + filters: Array; + /** + * The absolute url the pre-event webhook request should be sent to. + */ + preWebhookUrl: string; + /** + * The absolute url the post-event webhook request should be sent to. + */ + postWebhookUrl: string; + target: WebhookTarget; + /** + * An absolute API resource API resource URL for this webhook. + */ + url: string; + private get _proxy(); + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + method: WebhookMethod; + filters: string[]; + preWebhookUrl: string; + postWebhookUrl: string; + target: WebhookTarget; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WebhookSolution { +} +export interface WebhookListInstance { + _version: V1; + _solution: WebhookSolution; + _uri: string; + (): WebhookContext; + get(): WebhookContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebhookListInstance(version: V1): WebhookListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/configuration/webhook.js b/node_modules/twilio/lib/rest/conversations/v1/configuration/webhook.js new file mode 100644 index 00000000..be73ecd4 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/configuration/webhook.js @@ -0,0 +1,147 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebhookListInstance = exports.WebhookInstance = exports.WebhookContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +class WebhookContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Configuration/Webhooks`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["method"] !== undefined) + data["Method"] = params["method"]; + if (params["filters"] !== undefined) + data["Filters"] = serialize.map(params["filters"], (e) => e); + if (params["preWebhookUrl"] !== undefined) + data["PreWebhookUrl"] = params["preWebhookUrl"]; + if (params["postWebhookUrl"] !== undefined) + data["PostWebhookUrl"] = params["postWebhookUrl"]; + if (params["target"] !== undefined) + data["Target"] = params["target"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookContextImpl = WebhookContextImpl; +class WebhookInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.method = payload.method; + this.filters = payload.filters; + this.preWebhookUrl = payload.pre_webhook_url; + this.postWebhookUrl = payload.post_webhook_url; + this.target = payload.target; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = this._context || new WebhookContextImpl(this._version); + return this._context; + } + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + method: this.method, + filters: this.filters, + preWebhookUrl: this.preWebhookUrl, + postWebhookUrl: this.postWebhookUrl, + target: this.target, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookInstance = WebhookInstance; +function WebhookListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new WebhookContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebhookListInstance = WebhookListInstance; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation.d.ts b/node_modules/twilio/lib/rest/conversations/v1/conversation.d.ts new file mode 100644 index 00000000..c0e901e5 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation.d.ts @@ -0,0 +1,455 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { MessageListInstance } from "./conversation/message"; +import { ParticipantListInstance } from "./conversation/participant"; +import { WebhookListInstance } from "./conversation/webhook"; +export type ConversationState = "inactive" | "active" | "closed"; +export type ConversationWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a ConversationInstance + */ +export interface ConversationContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ConversationWebhookEnabledType; +} +/** + * Options to pass to update a ConversationInstance + */ +export interface ConversationContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ConversationWebhookEnabledType; + /** The human-readable name of this conversation, limited to 256 characters. Optional. */ + friendlyName?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. */ + dateUpdated?: Date; + /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. */ + messagingServiceSid?: string; + /** */ + state?: ConversationState; + /** ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. */ + "timers.inactive"?: string; + /** ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. */ + "timers.closed"?: string; + /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\\\'s `sid` in the URL. */ + uniqueName?: string; + /** The default email address that will be used when sending outbound emails in this conversation. */ + "bindings.email.address"?: string; + /** The default name that will be used when sending outbound emails in this conversation. */ + "bindings.email.name"?: string; +} +/** + * Options to pass to create a ConversationInstance + */ +export interface ConversationListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ConversationWebhookEnabledType; + /** The human-readable name of this conversation, limited to 256 characters. Optional. */ + friendlyName?: string; + /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\\\'s `sid` in the URL. */ + uniqueName?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. */ + dateUpdated?: Date; + /** The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. */ + messagingServiceSid?: string; + /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** */ + state?: ConversationState; + /** ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. */ + "timers.inactive"?: string; + /** ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. */ + "timers.closed"?: string; + /** The default email address that will be used when sending outbound emails in this conversation. */ + "bindings.email.address"?: string; + /** The default name that will be used when sending outbound emails in this conversation. */ + "bindings.email.name"?: string; +} +/** + * Options to pass to each + */ +export interface ConversationListInstanceEachOptions { + /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */ + startDate?: string; + /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */ + endDate?: string; + /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ + state?: ConversationState; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ConversationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ConversationListInstanceOptions { + /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */ + startDate?: string; + /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */ + endDate?: string; + /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ + state?: ConversationState; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ConversationListInstancePageOptions { + /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */ + startDate?: string; + /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */ + endDate?: string; + /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ + state?: ConversationState; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ConversationContext { + messages: MessageListInstance; + participants: ParticipantListInstance; + webhooks: WebhookListInstance; + /** + * Remove a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + remove(params: ConversationContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + fetch(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Update a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + update(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Update a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + update(params: ConversationContextUpdateOptions, callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConversationContextSolution { + sid: string; +} +export declare class ConversationContextImpl implements ConversationContext { + protected _version: V1; + protected _solution: ConversationContextSolution; + protected _uri: string; + protected _messages?: MessageListInstance; + protected _participants?: ParticipantListInstance; + protected _webhooks?: WebhookListInstance; + constructor(_version: V1, sid: string); + get messages(): MessageListInstance; + get participants(): ParticipantListInstance; + get webhooks(): WebhookListInstance; + remove(params?: ConversationContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + update(params?: ConversationContextUpdateOptions | ((error: Error | null, item?: ConversationInstance) => any), callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConversationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConversationPayload extends TwilioResponsePayload { + conversations: ConversationResource[]; +} +interface ConversationResource { + account_sid: string; + chat_service_sid: string; + messaging_service_sid: string; + sid: string; + friendly_name: string; + unique_name: string; + attributes: string; + state: ConversationState; + date_created: Date; + date_updated: Date; + timers: any; + url: string; + links: Record; + bindings: any; +} +export declare class ConversationInstance { + protected _version: V1; + protected _solution: ConversationContextSolution; + protected _context?: ConversationContext; + constructor(_version: V1, payload: ConversationResource, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + /** + * The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + */ + chatServiceSid: string; + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + */ + messagingServiceSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + */ + friendlyName: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\'s `sid` in the URL. + */ + uniqueName: string; + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + attributes: string; + state: ConversationState; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + /** + * Timer date values representing state update for this conversation. + */ + timers: any; + /** + * An absolute API resource URL for this conversation. + */ + url: string; + /** + * Contains absolute URLs to access the [participants](https://www.twilio.com/docs/conversations/api/conversation-participant-resource), [messages](https://www.twilio.com/docs/conversations/api/conversation-message-resource) and [webhooks](https://www.twilio.com/docs/conversations/api/conversation-scoped-webhook-resource) of this conversation. + */ + links: Record; + bindings: any; + private get _proxy(); + /** + * Remove a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + remove(params: ConversationContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + fetch(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Update a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + update(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Update a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + update(params: ConversationContextUpdateOptions, callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Access the messages. + */ + messages(): MessageListInstance; + /** + * Access the participants. + */ + participants(): ParticipantListInstance; + /** + * Access the webhooks. + */ + webhooks(): WebhookListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + messagingServiceSid: string; + sid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + state: ConversationState; + dateCreated: Date; + dateUpdated: Date; + timers: any; + url: string; + links: Record; + bindings: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConversationSolution { +} +export interface ConversationListInstance { + _version: V1; + _solution: ConversationSolution; + _uri: string; + (sid: string): ConversationContext; + get(sid: string): ConversationContext; + /** + * Create a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + create(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Create a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + create(params: ConversationListInstanceCreateOptions, callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Streams ConversationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConversationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ConversationInstance, done: (err?: Error) => void) => void): void; + each(params: ConversationListInstanceEachOptions, callback?: (item: ConversationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ConversationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ConversationPage) => any): Promise; + /** + * Lists ConversationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConversationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ConversationInstance[]) => any): Promise; + list(params: ConversationListInstanceOptions, callback?: (error: Error | null, items: ConversationInstance[]) => any): Promise; + /** + * Retrieve a single page of ConversationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConversationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ConversationPage) => any): Promise; + page(params: ConversationListInstancePageOptions, callback?: (error: Error | null, items: ConversationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConversationListInstance(version: V1): ConversationListInstance; +export declare class ConversationPage extends Page { + /** + * Initialize the ConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ConversationSolution); + /** + * Build an instance of ConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ConversationResource): ConversationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation.js b/node_modules/twilio/lib/rest/conversations/v1/conversation.js new file mode 100644 index 00000000..9fe04bfc --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation.js @@ -0,0 +1,359 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConversationPage = exports.ConversationListInstance = exports.ConversationInstance = exports.ConversationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const message_1 = require("./conversation/message"); +const participant_1 = require("./conversation/participant"); +const webhook_1 = require("./conversation/webhook"); +class ConversationContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Conversations/${sid}`; + } + get messages() { + this._messages = + this._messages || (0, message_1.MessageListInstance)(this._version, this._solution.sid); + return this._messages; + } + get participants() { + this._participants = + this._participants || + (0, participant_1.ParticipantListInstance)(this._version, this._solution.sid); + return this._participants; + } + get webhooks() { + this._webhooks = + this._webhooks || (0, webhook_1.WebhookListInstance)(this._version, this._solution.sid); + return this._webhooks; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConversationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["messagingServiceSid"] !== undefined) + data["MessagingServiceSid"] = params["messagingServiceSid"]; + if (params["state"] !== undefined) + data["State"] = params["state"]; + if (params["timers.inactive"] !== undefined) + data["Timers.Inactive"] = params["timers.inactive"]; + if (params["timers.closed"] !== undefined) + data["Timers.Closed"] = params["timers.closed"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["bindings.email.address"] !== undefined) + data["Bindings.Email.Address"] = params["bindings.email.address"]; + if (params["bindings.email.name"] !== undefined) + data["Bindings.Email.Name"] = params["bindings.email.name"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConversationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConversationContextImpl = ConversationContextImpl; +class ConversationInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.messagingServiceSid = payload.messaging_service_sid; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.attributes = payload.attributes; + this.state = payload.state; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.timers = payload.timers; + this.url = payload.url; + this.links = payload.links; + this.bindings = payload.bindings; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ConversationContextImpl(this._version, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the messages. + */ + messages() { + return this._proxy.messages; + } + /** + * Access the participants. + */ + participants() { + return this._proxy.participants; + } + /** + * Access the webhooks. + */ + webhooks() { + return this._proxy.webhooks; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + messagingServiceSid: this.messagingServiceSid, + sid: this.sid, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + attributes: this.attributes, + state: this.state, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + timers: this.timers, + url: this.url, + links: this.links, + bindings: this.bindings, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConversationInstance = ConversationInstance; +function ConversationListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ConversationContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Conversations`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["messagingServiceSid"] !== undefined) + data["MessagingServiceSid"] = params["messagingServiceSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["state"] !== undefined) + data["State"] = params["state"]; + if (params["timers.inactive"] !== undefined) + data["Timers.Inactive"] = params["timers.inactive"]; + if (params["timers.closed"] !== undefined) + data["Timers.Closed"] = params["timers.closed"]; + if (params["bindings.email.address"] !== undefined) + data["Bindings.Email.Address"] = params["bindings.email.address"]; + if (params["bindings.email.name"] !== undefined) + data["Bindings.Email.Name"] = params["bindings.email.name"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConversationInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["startDate"] !== undefined) + data["StartDate"] = params["startDate"]; + if (params["endDate"] !== undefined) + data["EndDate"] = params["endDate"]; + if (params["state"] !== undefined) + data["State"] = params["state"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConversationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ConversationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConversationListInstance = ConversationListInstance; +class ConversationPage extends Page_1.default { + /** + * Initialize the ConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ConversationInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConversationPage = ConversationPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation/message.d.ts b/node_modules/twilio/lib/rest/conversations/v1/conversation/message.d.ts new file mode 100644 index 00000000..6bd31e2e --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation/message.d.ts @@ -0,0 +1,427 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { DeliveryReceiptListInstance } from "./message/deliveryReceipt"; +export type MessageOrderType = "asc" | "desc"; +export type MessageWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a MessageInstance + */ +export interface MessageContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; +} +/** + * Options to pass to update a MessageInstance + */ +export interface MessageContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; + /** The channel specific identifier of the message\\\'s author. Defaults to `system`. */ + author?: string; + /** The content of the message, can be up to 1,600 characters long. */ + body?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. `null` if the message has not been edited. */ + dateUpdated?: Date; + /** A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The subject of the message, can be up to 256 characters long. */ + subject?: string; +} +/** + * Options to pass to create a MessageInstance + */ +export interface MessageListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; + /** The channel specific identifier of the message\\\'s author. Defaults to `system`. */ + author?: string; + /** The content of the message, can be up to 1,600 characters long. */ + body?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. `null` if the message has not been edited. */ + dateUpdated?: Date; + /** A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The Media SID to be attached to the new Message. */ + mediaSid?: string; + /** The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. */ + contentSid?: string; + /** A structurally valid JSON string that contains values to resolve Rich Content template variables. */ + contentVariables?: string; + /** The subject of the message, can be up to 256 characters long. */ + subject?: string; +} +/** + * Options to pass to each + */ +export interface MessageListInstanceEachOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessageInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessageListInstanceOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessageListInstancePageOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessageContext { + deliveryReceipts: DeliveryReceiptListInstance; + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + remove(params: MessageContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessageContextSolution { + conversationSid: string; + sid: string; +} +export declare class MessageContextImpl implements MessageContext { + protected _version: V1; + protected _solution: MessageContextSolution; + protected _uri: string; + protected _deliveryReceipts?: DeliveryReceiptListInstance; + constructor(_version: V1, conversationSid: string, sid: string); + get deliveryReceipts(): DeliveryReceiptListInstance; + remove(params?: MessageContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + update(params?: MessageContextUpdateOptions | ((error: Error | null, item?: MessageInstance) => any), callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessageContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessagePayload extends TwilioResponsePayload { + messages: MessageResource[]; +} +interface MessageResource { + account_sid: string; + conversation_sid: string; + sid: string; + index: number; + author: string; + body: string; + media: Array; + attributes: string; + participant_sid: string; + date_created: Date; + date_updated: Date; + url: string; + delivery: any; + links: Record; + content_sid: string; +} +export declare class MessageInstance { + protected _version: V1; + protected _solution: MessageContextSolution; + protected _context?: MessageContext; + constructor(_version: V1, payload: MessageResource, conversationSid: string, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this message. + */ + accountSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. + */ + conversationSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The index of the message within the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource). Indices may skip numbers, but will always be in order of when the message was received. + */ + index: number; + /** + * The channel specific identifier of the message\'s author. Defaults to `system`. + */ + author: string; + /** + * The content of the message, can be up to 1,600 characters long. + */ + body: string; + /** + * An array of objects that describe the Message\'s media, if the message contains media. Each object contains these fields: `content_type` with the MIME type of the media, `filename` with the name of the media, `sid` with the SID of the Media resource, and `size` with the media object\'s file size in bytes. If the Message has no media, this value is `null`. + */ + media: Array; + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + attributes: string; + /** + * The unique ID of messages\'s author participant. Null in case of `system` sent message. + */ + participantSid: string; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. `null` if the message has not been edited. + */ + dateUpdated: Date; + /** + * An absolute API resource API URL for this message. + */ + url: string; + /** + * An object that contains the summary of delivery statuses for the message to non-chat participants. + */ + delivery: any; + /** + * Contains an absolute API resource URL to access the delivery & read receipts of this message. + */ + links: Record; + /** + * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. + */ + contentSid: string; + private get _proxy(); + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + remove(params: MessageContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Access the deliveryReceipts. + */ + deliveryReceipts(): DeliveryReceiptListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + conversationSid: string; + sid: string; + index: number; + author: string; + body: string; + media: any[]; + attributes: string; + participantSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + delivery: any; + links: Record; + contentSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessageSolution { + conversationSid: string; +} +export interface MessageListInstance { + _version: V1; + _solution: MessageSolution; + _uri: string; + (sid: string): MessageContext; + get(sid: string): MessageContext; + /** + * Create a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Create a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(params: MessageListInstanceCreateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Streams MessageInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + each(params: MessageListInstanceEachOptions, callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Lists MessageInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + list(params: MessageListInstanceOptions, callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + /** + * Retrieve a single page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessagePage) => any): Promise; + page(params: MessageListInstancePageOptions, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessageListInstance(version: V1, conversationSid: string): MessageListInstance; +export declare class MessagePage extends Page { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MessageSolution); + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessageResource): MessageInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation/message.js b/node_modules/twilio/lib/rest/conversations/v1/conversation/message.js new file mode 100644 index 00000000..9f02b8ac --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation/message.js @@ -0,0 +1,325 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagePage = exports.MessageListInstance = exports.MessageInstance = exports.MessageContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const deliveryReceipt_1 = require("./message/deliveryReceipt"); +class MessageContextImpl { + constructor(_version, conversationSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { conversationSid, sid }; + this._uri = `/Conversations/${conversationSid}/Messages/${sid}`; + } + get deliveryReceipts() { + this._deliveryReceipts = + this._deliveryReceipts || + (0, deliveryReceipt_1.DeliveryReceiptListInstance)(this._version, this._solution.conversationSid, this._solution.sid); + return this._deliveryReceipts; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["author"] !== undefined) + data["Author"] = params["author"]; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["subject"] !== undefined) + data["Subject"] = params["subject"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageContextImpl = MessageContextImpl; +class MessageInstance { + constructor(_version, payload, conversationSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.conversationSid = payload.conversation_sid; + this.sid = payload.sid; + this.index = deserialize.integer(payload.index); + this.author = payload.author; + this.body = payload.body; + this.media = payload.media; + this.attributes = payload.attributes; + this.participantSid = payload.participant_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.delivery = payload.delivery; + this.links = payload.links; + this.contentSid = payload.content_sid; + this._solution = { conversationSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MessageContextImpl(this._version, this._solution.conversationSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the deliveryReceipts. + */ + deliveryReceipts() { + return this._proxy.deliveryReceipts; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + conversationSid: this.conversationSid, + sid: this.sid, + index: this.index, + author: this.author, + body: this.body, + media: this.media, + attributes: this.attributes, + participantSid: this.participantSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + delivery: this.delivery, + links: this.links, + contentSid: this.contentSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInstance = MessageInstance; +function MessageListInstance(version, conversationSid) { + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MessageContextImpl(version, conversationSid, sid); + }; + instance._version = version; + instance._solution = { conversationSid }; + instance._uri = `/Conversations/${conversationSid}/Messages`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["author"] !== undefined) + data["Author"] = params["author"]; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["mediaSid"] !== undefined) + data["MediaSid"] = params["mediaSid"]; + if (params["contentSid"] !== undefined) + data["ContentSid"] = params["contentSid"]; + if (params["contentVariables"] !== undefined) + data["ContentVariables"] = params["contentVariables"]; + if (params["subject"] !== undefined) + data["Subject"] = params["subject"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessagePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessageListInstance = MessageListInstance; +class MessagePage extends Page_1.default { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessageInstance(this._version, payload, this._solution.conversationSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagePage = MessagePage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation/message/deliveryReceipt.d.ts b/node_modules/twilio/lib/rest/conversations/v1/conversation/message/deliveryReceipt.d.ts new file mode 100644 index 00000000..1286914b --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation/message/deliveryReceipt.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type DeliveryReceiptDeliveryStatus = "read" | "failed" | "delivered" | "undelivered" | "sent"; +/** + * Options to pass to each + */ +export interface DeliveryReceiptListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DeliveryReceiptInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DeliveryReceiptListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DeliveryReceiptListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DeliveryReceiptContext { + /** + * Fetch a DeliveryReceiptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeliveryReceiptInstance + */ + fetch(callback?: (error: Error | null, item?: DeliveryReceiptInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeliveryReceiptContextSolution { + conversationSid: string; + messageSid: string; + sid: string; +} +export declare class DeliveryReceiptContextImpl implements DeliveryReceiptContext { + protected _version: V1; + protected _solution: DeliveryReceiptContextSolution; + protected _uri: string; + constructor(_version: V1, conversationSid: string, messageSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: DeliveryReceiptInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeliveryReceiptContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DeliveryReceiptPayload extends TwilioResponsePayload { + delivery_receipts: DeliveryReceiptResource[]; +} +interface DeliveryReceiptResource { + account_sid: string; + conversation_sid: string; + sid: string; + message_sid: string; + channel_message_sid: string; + participant_sid: string; + status: DeliveryReceiptDeliveryStatus; + error_code: number; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class DeliveryReceiptInstance { + protected _version: V1; + protected _solution: DeliveryReceiptContextSolution; + protected _context?: DeliveryReceiptContext; + constructor(_version: V1, payload: DeliveryReceiptResource, conversationSid: string, messageSid: string, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this participant. + */ + accountSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. + */ + conversationSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The SID of the message within a [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to + */ + messageSid: string; + /** + * A messaging channel-specific identifier for the message delivered to participant e.g. `SMxx` for SMS, `WAxx` for Whatsapp etc. + */ + channelMessageSid: string; + /** + * The unique ID of the participant the delivery receipt belongs to. + */ + participantSid: string; + status: DeliveryReceiptDeliveryStatus; + /** + * The message [delivery error code](https://www.twilio.com/docs/sms/api/message-resource#delivery-related-errors) for a `failed` status, + */ + errorCode: number; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. `null` if the delivery receipt has not been updated. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this delivery receipt. + */ + url: string; + private get _proxy(); + /** + * Fetch a DeliveryReceiptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeliveryReceiptInstance + */ + fetch(callback?: (error: Error | null, item?: DeliveryReceiptInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + conversationSid: string; + sid: string; + messageSid: string; + channelMessageSid: string; + participantSid: string; + status: DeliveryReceiptDeliveryStatus; + errorCode: number; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeliveryReceiptSolution { + conversationSid: string; + messageSid: string; +} +export interface DeliveryReceiptListInstance { + _version: V1; + _solution: DeliveryReceiptSolution; + _uri: string; + (sid: string): DeliveryReceiptContext; + get(sid: string): DeliveryReceiptContext; + /** + * Streams DeliveryReceiptInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeliveryReceiptListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DeliveryReceiptInstance, done: (err?: Error) => void) => void): void; + each(params: DeliveryReceiptListInstanceEachOptions, callback?: (item: DeliveryReceiptInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DeliveryReceiptInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DeliveryReceiptPage) => any): Promise; + /** + * Lists DeliveryReceiptInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeliveryReceiptListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DeliveryReceiptInstance[]) => any): Promise; + list(params: DeliveryReceiptListInstanceOptions, callback?: (error: Error | null, items: DeliveryReceiptInstance[]) => any): Promise; + /** + * Retrieve a single page of DeliveryReceiptInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeliveryReceiptListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DeliveryReceiptPage) => any): Promise; + page(params: DeliveryReceiptListInstancePageOptions, callback?: (error: Error | null, items: DeliveryReceiptPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeliveryReceiptListInstance(version: V1, conversationSid: string, messageSid: string): DeliveryReceiptListInstance; +export declare class DeliveryReceiptPage extends Page { + /** + * Initialize the DeliveryReceiptPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DeliveryReceiptSolution); + /** + * Build an instance of DeliveryReceiptInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DeliveryReceiptResource): DeliveryReceiptInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation/message/deliveryReceipt.js b/node_modules/twilio/lib/rest/conversations/v1/conversation/message/deliveryReceipt.js new file mode 100644 index 00000000..e72c148c --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation/message/deliveryReceipt.js @@ -0,0 +1,203 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeliveryReceiptPage = exports.DeliveryReceiptListInstance = exports.DeliveryReceiptInstance = exports.DeliveryReceiptContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class DeliveryReceiptContextImpl { + constructor(_version, conversationSid, messageSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(messageSid)) { + throw new Error("Parameter 'messageSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { conversationSid, messageSid, sid }; + this._uri = `/Conversations/${conversationSid}/Messages/${messageSid}/Receipts/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DeliveryReceiptInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.messageSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeliveryReceiptContextImpl = DeliveryReceiptContextImpl; +class DeliveryReceiptInstance { + constructor(_version, payload, conversationSid, messageSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.conversationSid = payload.conversation_sid; + this.sid = payload.sid; + this.messageSid = payload.message_sid; + this.channelMessageSid = payload.channel_message_sid; + this.participantSid = payload.participant_sid; + this.status = payload.status; + this.errorCode = deserialize.integer(payload.error_code); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { conversationSid, messageSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new DeliveryReceiptContextImpl(this._version, this._solution.conversationSid, this._solution.messageSid, this._solution.sid); + return this._context; + } + /** + * Fetch a DeliveryReceiptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeliveryReceiptInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + conversationSid: this.conversationSid, + sid: this.sid, + messageSid: this.messageSid, + channelMessageSid: this.channelMessageSid, + participantSid: this.participantSid, + status: this.status, + errorCode: this.errorCode, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeliveryReceiptInstance = DeliveryReceiptInstance; +function DeliveryReceiptListInstance(version, conversationSid, messageSid) { + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(messageSid)) { + throw new Error("Parameter 'messageSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DeliveryReceiptContextImpl(version, conversationSid, messageSid, sid); + }; + instance._version = version; + instance._solution = { conversationSid, messageSid }; + instance._uri = `/Conversations/${conversationSid}/Messages/${messageSid}/Receipts`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeliveryReceiptPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DeliveryReceiptPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeliveryReceiptListInstance = DeliveryReceiptListInstance; +class DeliveryReceiptPage extends Page_1.default { + /** + * Initialize the DeliveryReceiptPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DeliveryReceiptInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DeliveryReceiptInstance(this._version, payload, this._solution.conversationSid, this._solution.messageSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeliveryReceiptPage = DeliveryReceiptPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation/participant.d.ts b/node_modules/twilio/lib/rest/conversations/v1/conversation/participant.d.ts new file mode 100644 index 00000000..19d63a47 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation/participant.d.ts @@ -0,0 +1,398 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type ParticipantWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a ParticipantInstance + */ +export interface ParticipantContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ParticipantWebhookEnabledType; +} +/** + * Options to pass to update a ParticipantInstance + */ +export interface ParticipantContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ParticipantWebhookEnabledType; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. */ + dateUpdated?: Date; + /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. */ + roleSid?: string; + /** The address of the Twilio phone number that the participant is in contact with. \\\'null\\\' value will remove it. */ + "messagingBinding.proxyAddress"?: string; + /** The address of the Twilio phone number that is used in Group MMS. \\\'null\\\' value will remove it. */ + "messagingBinding.projectedAddress"?: string; + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */ + identity?: string; + /** Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. */ + lastReadMessageIndex?: number; + /** Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. */ + lastReadTimestamp?: string; +} +/** + * Options to pass to create a ParticipantInstance + */ +export interface ParticipantListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ParticipantWebhookEnabledType; + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */ + identity?: string; + /** The address of the participant\\\'s device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the \\\'identity\\\' field). */ + "messagingBinding.address"?: string; + /** The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the \\\'identity\\\' field). */ + "messagingBinding.proxyAddress"?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. */ + dateUpdated?: Date; + /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. */ + "messagingBinding.projectedAddress"?: string; + /** The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface ParticipantListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ParticipantListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ParticipantListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ParticipantContext { + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + remove(params: ParticipantContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ParticipantContextSolution { + conversationSid: string; + sid: string; +} +export declare class ParticipantContextImpl implements ParticipantContext { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _uri: string; + constructor(_version: V1, conversationSid: string, sid: string); + remove(params?: ParticipantContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + update(params?: ParticipantContextUpdateOptions | ((error: Error | null, item?: ParticipantInstance) => any), callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ParticipantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ParticipantPayload extends TwilioResponsePayload { + participants: ParticipantResource[]; +} +interface ParticipantResource { + account_sid: string; + conversation_sid: string; + sid: string; + identity: string; + attributes: string; + messaging_binding: any; + role_sid: string; + date_created: Date; + date_updated: Date; + url: string; + last_read_message_index: number; + last_read_timestamp: string; +} +export declare class ParticipantInstance { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _context?: ParticipantContext; + constructor(_version: V1, payload: ParticipantResource, conversationSid: string, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this participant. + */ + accountSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant. + */ + conversationSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + */ + identity: string; + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + attributes: string; + /** + * Information about how this participant exchanges messages with the conversation. A JSON parameter consisting of type and address fields of the participant. + */ + messagingBinding: any; + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + */ + roleSid: string; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this participant. + */ + url: string; + /** + * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + */ + lastReadMessageIndex: number; + /** + * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + */ + lastReadTimestamp: string; + private get _proxy(); + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + remove(params: ParticipantContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + conversationSid: string; + sid: string; + identity: string; + attributes: string; + messagingBinding: any; + roleSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + lastReadMessageIndex: number; + lastReadTimestamp: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ParticipantSolution { + conversationSid: string; +} +export interface ParticipantListInstance { + _version: V1; + _solution: ParticipantSolution; + _uri: string; + (sid: string): ParticipantContext; + get(sid: string): ParticipantContext; + /** + * Create a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + create(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Create a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + create(params: ParticipantListInstanceCreateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Streams ParticipantInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + each(params: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Lists ParticipantInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + list(params: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + /** + * Retrieve a single page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + page(params: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ParticipantListInstance(version: V1, conversationSid: string): ParticipantListInstance; +export declare class ParticipantPage extends Page { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ParticipantSolution); + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ParticipantResource): ParticipantInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation/participant.js b/node_modules/twilio/lib/rest/conversations/v1/conversation/participant.js new file mode 100644 index 00000000..03942607 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation/participant.js @@ -0,0 +1,312 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParticipantPage = exports.ParticipantListInstance = exports.ParticipantInstance = exports.ParticipantContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ParticipantContextImpl { + constructor(_version, conversationSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { conversationSid, sid }; + this._uri = `/Conversations/${conversationSid}/Participants/${sid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["messagingBinding.proxyAddress"] !== undefined) + data["MessagingBinding.ProxyAddress"] = + params["messagingBinding.proxyAddress"]; + if (params["messagingBinding.projectedAddress"] !== undefined) + data["MessagingBinding.ProjectedAddress"] = + params["messagingBinding.projectedAddress"]; + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["lastReadMessageIndex"] !== undefined) + data["LastReadMessageIndex"] = params["lastReadMessageIndex"]; + if (params["lastReadTimestamp"] !== undefined) + data["LastReadTimestamp"] = params["lastReadTimestamp"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantContextImpl = ParticipantContextImpl; +class ParticipantInstance { + constructor(_version, payload, conversationSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.conversationSid = payload.conversation_sid; + this.sid = payload.sid; + this.identity = payload.identity; + this.attributes = payload.attributes; + this.messagingBinding = payload.messaging_binding; + this.roleSid = payload.role_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.lastReadMessageIndex = deserialize.integer(payload.last_read_message_index); + this.lastReadTimestamp = payload.last_read_timestamp; + this._solution = { conversationSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ParticipantContextImpl(this._version, this._solution.conversationSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + conversationSid: this.conversationSid, + sid: this.sid, + identity: this.identity, + attributes: this.attributes, + messagingBinding: this.messagingBinding, + roleSid: this.roleSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + lastReadMessageIndex: this.lastReadMessageIndex, + lastReadTimestamp: this.lastReadTimestamp, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantInstance = ParticipantInstance; +function ParticipantListInstance(version, conversationSid) { + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ParticipantContextImpl(version, conversationSid, sid); + }; + instance._version = version; + instance._solution = { conversationSid }; + instance._uri = `/Conversations/${conversationSid}/Participants`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["messagingBinding.address"] !== undefined) + data["MessagingBinding.Address"] = params["messagingBinding.address"]; + if (params["messagingBinding.proxyAddress"] !== undefined) + data["MessagingBinding.ProxyAddress"] = + params["messagingBinding.proxyAddress"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["messagingBinding.projectedAddress"] !== undefined) + data["MessagingBinding.ProjectedAddress"] = + params["messagingBinding.projectedAddress"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ParticipantPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ParticipantListInstance = ParticipantListInstance; +class ParticipantPage extends Page_1.default { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ParticipantInstance(this._version, payload, this._solution.conversationSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantPage = ParticipantPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation/webhook.d.ts b/node_modules/twilio/lib/rest/conversations/v1/conversation/webhook.d.ts new file mode 100644 index 00000000..628aba63 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation/webhook.d.ts @@ -0,0 +1,328 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type WebhookMethod = "GET" | "POST"; +export type WebhookTarget = "webhook" | "trigger" | "studio"; +/** + * Options to pass to update a WebhookInstance + */ +export interface WebhookContextUpdateOptions { + /** The absolute url the webhook request should be sent to. */ + "configuration.url"?: string; + /** */ + "configuration.method"?: WebhookMethod; + /** The list of events, firing webhook event for this Conversation. */ + "configuration.filters"?: Array; + /** The list of keywords, firing webhook event for this Conversation. */ + "configuration.triggers"?: Array; + /** The studio flow SID, where the webhook should be sent to. */ + "configuration.flowSid"?: string; +} +/** + * Options to pass to create a WebhookInstance + */ +export interface WebhookListInstanceCreateOptions { + /** */ + target: WebhookTarget; + /** The absolute url the webhook request should be sent to. */ + "configuration.url"?: string; + /** */ + "configuration.method"?: WebhookMethod; + /** The list of events, firing webhook event for this Conversation. */ + "configuration.filters"?: Array; + /** The list of keywords, firing webhook event for this Conversation. */ + "configuration.triggers"?: Array; + /** The studio flow SID, where the webhook should be sent to. */ + "configuration.flowSid"?: string; + /** The message index for which and it\\\'s successors the webhook will be replayed. Not set by default */ + "configuration.replayAfter"?: number; +} +/** + * Options to pass to each + */ +export interface WebhookListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WebhookInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WebhookListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WebhookListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WebhookContext { + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WebhookContextSolution { + conversationSid: string; + sid: string; +} +export declare class WebhookContextImpl implements WebhookContext { + protected _version: V1; + protected _solution: WebhookContextSolution; + protected _uri: string; + constructor(_version: V1, conversationSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + update(params?: WebhookContextUpdateOptions | ((error: Error | null, item?: WebhookInstance) => any), callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WebhookContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WebhookPayload extends TwilioResponsePayload { + webhooks: WebhookResource[]; +} +interface WebhookResource { + sid: string; + account_sid: string; + conversation_sid: string; + target: string; + url: string; + configuration: any; + date_created: Date; + date_updated: Date; +} +export declare class WebhookInstance { + protected _version: V1; + protected _solution: WebhookContextSolution; + protected _context?: WebhookContext; + constructor(_version: V1, payload: WebhookResource, conversationSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook. + */ + conversationSid: string; + /** + * The target of this webhook: `webhook`, `studio`, `trigger` + */ + target: string; + /** + * An absolute API resource URL for this webhook. + */ + url: string; + /** + * The configuration of this webhook. Is defined based on target. + */ + configuration: any; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + conversationSid: string; + target: string; + url: string; + configuration: any; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WebhookSolution { + conversationSid: string; +} +export interface WebhookListInstance { + _version: V1; + _solution: WebhookSolution; + _uri: string; + (sid: string): WebhookContext; + get(sid: string): WebhookContext; + /** + * Create a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + create(params: WebhookListInstanceCreateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Streams WebhookInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + each(params: WebhookListInstanceEachOptions, callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Lists WebhookInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + list(params: WebhookListInstanceOptions, callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + /** + * Retrieve a single page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WebhookPage) => any): Promise; + page(params: WebhookListInstancePageOptions, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebhookListInstance(version: V1, conversationSid: string): WebhookListInstance; +export declare class WebhookPage extends Page { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: WebhookSolution); + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WebhookResource): WebhookInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/conversation/webhook.js b/node_modules/twilio/lib/rest/conversations/v1/conversation/webhook.js new file mode 100644 index 00000000..7cec23c2 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/conversation/webhook.js @@ -0,0 +1,278 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebhookPage = exports.WebhookListInstance = exports.WebhookInstance = exports.WebhookContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class WebhookContextImpl { + constructor(_version, conversationSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { conversationSid, sid }; + this._uri = `/Conversations/${conversationSid}/Webhooks/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["configuration.url"] !== undefined) + data["Configuration.Url"] = params["configuration.url"]; + if (params["configuration.method"] !== undefined) + data["Configuration.Method"] = params["configuration.method"]; + if (params["configuration.filters"] !== undefined) + data["Configuration.Filters"] = serialize.map(params["configuration.filters"], (e) => e); + if (params["configuration.triggers"] !== undefined) + data["Configuration.Triggers"] = serialize.map(params["configuration.triggers"], (e) => e); + if (params["configuration.flowSid"] !== undefined) + data["Configuration.FlowSid"] = params["configuration.flowSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookContextImpl = WebhookContextImpl; +class WebhookInstance { + constructor(_version, payload, conversationSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.conversationSid = payload.conversation_sid; + this.target = payload.target; + this.url = payload.url; + this.configuration = payload.configuration; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { conversationSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WebhookContextImpl(this._version, this._solution.conversationSid, this._solution.sid); + return this._context; + } + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + conversationSid: this.conversationSid, + target: this.target, + url: this.url, + configuration: this.configuration, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookInstance = WebhookInstance; +function WebhookListInstance(version, conversationSid) { + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WebhookContextImpl(version, conversationSid, sid); + }; + instance._version = version; + instance._solution = { conversationSid }; + instance._uri = `/Conversations/${conversationSid}/Webhooks`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["target"] === null || params["target"] === undefined) { + throw new Error("Required parameter \"params['target']\" missing."); + } + let data = {}; + data["Target"] = params["target"]; + if (params["configuration.url"] !== undefined) + data["Configuration.Url"] = params["configuration.url"]; + if (params["configuration.method"] !== undefined) + data["Configuration.Method"] = params["configuration.method"]; + if (params["configuration.filters"] !== undefined) + data["Configuration.Filters"] = serialize.map(params["configuration.filters"], (e) => e); + if (params["configuration.triggers"] !== undefined) + data["Configuration.Triggers"] = serialize.map(params["configuration.triggers"], (e) => e); + if (params["configuration.flowSid"] !== undefined) + data["Configuration.FlowSid"] = params["configuration.flowSid"]; + if (params["configuration.replayAfter"] !== undefined) + data["Configuration.ReplayAfter"] = params["configuration.replayAfter"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WebhookPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebhookListInstance = WebhookListInstance; +class WebhookPage extends Page_1.default { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WebhookInstance(this._version, payload, this._solution.conversationSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookPage = WebhookPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/credential.d.ts b/node_modules/twilio/lib/rest/conversations/v1/credential.d.ts new file mode 100644 index 00000000..452a488b --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/credential.d.ts @@ -0,0 +1,326 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type CredentialPushType = "apn" | "gcm" | "fcm"; +/** + * Options to pass to update a CredentialInstance + */ +export interface CredentialContextUpdateOptions { + /** */ + type?: CredentialPushType; + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. */ + certificate?: string; + /** [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. */ + privateKey?: string; + /** [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. */ + sandbox?: boolean; + /** [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. */ + apiKey?: string; + /** [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ + secret?: string; +} +/** + * Options to pass to create a CredentialInstance + */ +export interface CredentialListInstanceCreateOptions { + /** */ + type: CredentialPushType; + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. */ + certificate?: string; + /** [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. */ + privateKey?: string; + /** [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. */ + sandbox?: boolean; + /** [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. */ + apiKey?: string; + /** [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ + secret?: string; +} +/** + * Options to pass to each + */ +export interface CredentialListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialContext { + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialContextSolution { + sid: string; +} +export declare class CredentialContextImpl implements CredentialContext { + protected _version: V1; + protected _solution: CredentialContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + update(params?: CredentialContextUpdateOptions | ((error: Error | null, item?: CredentialInstance) => any), callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialPayload extends TwilioResponsePayload { + credentials: CredentialResource[]; +} +interface CredentialResource { + sid: string; + account_sid: string; + friendly_name: string; + type: CredentialPushType; + sandbox: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CredentialInstance { + protected _version: V1; + protected _solution: CredentialContextSolution; + protected _context?: CredentialContext; + constructor(_version: V1, payload: CredentialResource, sid?: string); + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this credential. + */ + accountSid: string; + /** + * The human-readable name of this credential, limited to 64 characters. Optional. + */ + friendlyName: string; + type: CredentialPushType; + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + */ + sandbox: string; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this credential. + */ + url: string; + private get _proxy(); + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + type: CredentialPushType; + sandbox: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialSolution { +} +export interface CredentialListInstance { + _version: V1; + _solution: CredentialSolution; + _uri: string; + (sid: string): CredentialContext; + get(sid: string): CredentialContext; + /** + * Create a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + create(params: CredentialListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Streams CredentialInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListInstanceEachOptions, callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Lists CredentialInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + list(params: CredentialListInstanceOptions, callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialPage) => any): Promise; + page(params: CredentialListInstancePageOptions, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListInstance(version: V1): CredentialListInstance; +export declare class CredentialPage extends Page { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CredentialSolution); + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialResource): CredentialInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/credential.js b/node_modules/twilio/lib/rest/conversations/v1/credential.js new file mode 100644 index 00000000..ad0e65da --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/credential.js @@ -0,0 +1,276 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialPage = exports.CredentialListInstance = exports.CredentialInstance = exports.CredentialContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CredentialContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Credentials/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["type"] !== undefined) + data["Type"] = params["type"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialContextImpl = CredentialContextImpl; +class CredentialInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.sandbox = payload.sandbox; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + type: this.type, + sandbox: this.sandbox, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialInstance = CredentialInstance; +function CredentialListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListInstance = CredentialListInstance; +class CredentialPage extends Page_1.default { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialPage = CredentialPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/participantConversation.d.ts b/node_modules/twilio/lib/rest/conversations/v1/participantConversation.d.ts new file mode 100644 index 00000000..d83bb904 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/participantConversation.d.ts @@ -0,0 +1,242 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type ParticipantConversationState = "inactive" | "active" | "closed"; +/** + * Options to pass to each + */ +export interface ParticipantConversationListInstanceEachOptions { + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */ + identity?: string; + /** A unique string identifier for the conversation participant who\'s not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. */ + address?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ParticipantConversationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ParticipantConversationListInstanceOptions { + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */ + identity?: string; + /** A unique string identifier for the conversation participant who\'s not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. */ + address?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ParticipantConversationListInstancePageOptions { + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */ + identity?: string; + /** A unique string identifier for the conversation participant who\'s not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. */ + address?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ParticipantConversationSolution { +} +export interface ParticipantConversationListInstance { + _version: V1; + _solution: ParticipantConversationSolution; + _uri: string; + /** + * Streams ParticipantConversationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantConversationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ParticipantConversationInstance, done: (err?: Error) => void) => void): void; + each(params: ParticipantConversationListInstanceEachOptions, callback?: (item: ParticipantConversationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ParticipantConversationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantConversationPage) => any): Promise; + /** + * Lists ParticipantConversationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantConversationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ParticipantConversationInstance[]) => any): Promise; + list(params: ParticipantConversationListInstanceOptions, callback?: (error: Error | null, items: ParticipantConversationInstance[]) => any): Promise; + /** + * Retrieve a single page of ParticipantConversationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantConversationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ParticipantConversationPage) => any): Promise; + page(params: ParticipantConversationListInstancePageOptions, callback?: (error: Error | null, items: ParticipantConversationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ParticipantConversationListInstance(version: V1): ParticipantConversationListInstance; +interface ParticipantConversationPayload extends TwilioResponsePayload { + conversations: ParticipantConversationResource[]; +} +interface ParticipantConversationResource { + account_sid: string; + chat_service_sid: string; + participant_sid: string; + participant_user_sid: string; + participant_identity: string; + participant_messaging_binding: any; + conversation_sid: string; + conversation_unique_name: string; + conversation_friendly_name: string; + conversation_attributes: string; + conversation_date_created: Date; + conversation_date_updated: Date; + conversation_created_by: string; + conversation_state: ParticipantConversationState; + conversation_timers: any; + links: Record; +} +export declare class ParticipantConversationInstance { + protected _version: V1; + constructor(_version: V1, payload: ParticipantConversationResource); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + /** + * The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + */ + chatServiceSid: string; + /** + * The unique ID of the [Participant](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). + */ + participantSid: string; + /** + * The unique string that identifies the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). + */ + participantUserSid: string; + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + */ + participantIdentity: string; + /** + * Information about how this participant exchanges messages with the conversation. A JSON parameter consisting of type and address fields of the participant. + */ + participantMessagingBinding: any; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) this Participant belongs to. + */ + conversationSid: string; + /** + * An application-defined string that uniquely identifies the Conversation resource. + */ + conversationUniqueName: string; + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + */ + conversationFriendlyName: string; + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + conversationAttributes: string; + /** + * The date that this conversation was created, given in ISO 8601 format. + */ + conversationDateCreated: Date; + /** + * The date that this conversation was last updated, given in ISO 8601 format. + */ + conversationDateUpdated: Date; + /** + * Identity of the creator of this Conversation. + */ + conversationCreatedBy: string; + conversationState: ParticipantConversationState; + /** + * Timer date values representing state update for this conversation. + */ + conversationTimers: any; + /** + * Contains absolute URLs to access the [participant](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) and [conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) of this conversation. + */ + links: Record; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + participantSid: string; + participantUserSid: string; + participantIdentity: string; + participantMessagingBinding: any; + conversationSid: string; + conversationUniqueName: string; + conversationFriendlyName: string; + conversationAttributes: string; + conversationDateCreated: Date; + conversationDateUpdated: Date; + conversationCreatedBy: string; + conversationState: ParticipantConversationState; + conversationTimers: any; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class ParticipantConversationPage extends Page { + /** + * Initialize the ParticipantConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ParticipantConversationSolution); + /** + * Build an instance of ParticipantConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ParticipantConversationResource): ParticipantConversationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/participantConversation.js b/node_modules/twilio/lib/rest/conversations/v1/participantConversation.js new file mode 100644 index 00000000..8f3c1ea6 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/participantConversation.js @@ -0,0 +1,152 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParticipantConversationPage = exports.ParticipantConversationInstance = exports.ParticipantConversationListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function ParticipantConversationListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/ParticipantConversations`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["address"] !== undefined) + data["Address"] = params["address"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantConversationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ParticipantConversationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ParticipantConversationListInstance = ParticipantConversationListInstance; +class ParticipantConversationInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.participantSid = payload.participant_sid; + this.participantUserSid = payload.participant_user_sid; + this.participantIdentity = payload.participant_identity; + this.participantMessagingBinding = payload.participant_messaging_binding; + this.conversationSid = payload.conversation_sid; + this.conversationUniqueName = payload.conversation_unique_name; + this.conversationFriendlyName = payload.conversation_friendly_name; + this.conversationAttributes = payload.conversation_attributes; + this.conversationDateCreated = deserialize.iso8601DateTime(payload.conversation_date_created); + this.conversationDateUpdated = deserialize.iso8601DateTime(payload.conversation_date_updated); + this.conversationCreatedBy = payload.conversation_created_by; + this.conversationState = payload.conversation_state; + this.conversationTimers = payload.conversation_timers; + this.links = payload.links; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + participantSid: this.participantSid, + participantUserSid: this.participantUserSid, + participantIdentity: this.participantIdentity, + participantMessagingBinding: this.participantMessagingBinding, + conversationSid: this.conversationSid, + conversationUniqueName: this.conversationUniqueName, + conversationFriendlyName: this.conversationFriendlyName, + conversationAttributes: this.conversationAttributes, + conversationDateCreated: this.conversationDateCreated, + conversationDateUpdated: this.conversationDateUpdated, + conversationCreatedBy: this.conversationCreatedBy, + conversationState: this.conversationState, + conversationTimers: this.conversationTimers, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantConversationInstance = ParticipantConversationInstance; +class ParticipantConversationPage extends Page_1.default { + /** + * Initialize the ParticipantConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ParticipantConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ParticipantConversationInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantConversationPage = ParticipantConversationPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/role.d.ts b/node_modules/twilio/lib/rest/conversations/v1/role.d.ts new file mode 100644 index 00000000..be3060f0 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/role.d.ts @@ -0,0 +1,296 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type RoleRoleType = "conversation" | "service"; +/** + * Options to pass to update a RoleInstance + */ +export interface RoleContextUpdateOptions { + /** A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role\\\'s `type`. */ + permission: Array; +} +/** + * Options to pass to create a RoleInstance + */ +export interface RoleListInstanceCreateOptions { + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName: string; + /** */ + type: RoleRoleType; + /** A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role\\\'s `type`. */ + permission: Array; +} +/** + * Options to pass to each + */ +export interface RoleListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoleInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoleListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoleListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoleContext { + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoleContextSolution { + sid: string; +} +export declare class RoleContextImpl implements RoleContext { + protected _version: V1; + protected _solution: RoleContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoleContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RolePayload extends TwilioResponsePayload { + roles: RoleResource[]; +} +interface RoleResource { + sid: string; + account_sid: string; + chat_service_sid: string; + friendly_name: string; + type: RoleRoleType; + permissions: Array; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class RoleInstance { + protected _version: V1; + protected _solution: RoleContextSolution; + protected _context?: RoleContext; + constructor(_version: V1, payload: RoleResource, sid?: string); + /** + * The unique string that we created to identify the Role resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Role resource. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Role resource is associated with. + */ + chatServiceSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + type: RoleRoleType; + /** + * An array of the permissions the role has been granted. + */ + permissions: Array; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this user role. + */ + url: string; + private get _proxy(); + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + chatServiceSid: string; + friendlyName: string; + type: RoleRoleType; + permissions: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoleSolution { +} +export interface RoleListInstance { + _version: V1; + _solution: RoleSolution; + _uri: string; + (sid: string): RoleContext; + get(sid: string): RoleContext; + /** + * Create a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + create(params: RoleListInstanceCreateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Streams RoleInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + each(params: RoleListInstanceEachOptions, callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Lists RoleInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + list(params: RoleListInstanceOptions, callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + /** + * Retrieve a single page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RolePage) => any): Promise; + page(params: RoleListInstancePageOptions, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoleListInstance(version: V1): RoleListInstance; +export declare class RolePage extends Page { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RoleSolution); + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoleResource): RoleInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/role.js b/node_modules/twilio/lib/rest/conversations/v1/role.js new file mode 100644 index 00000000..84ef8976 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/role.js @@ -0,0 +1,260 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RolePage = exports.RoleListInstance = exports.RoleInstance = exports.RoleContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class RoleContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Roles/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleContextImpl = RoleContextImpl; +class RoleInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.permissions = payload.permissions; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new RoleContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + friendlyName: this.friendlyName, + type: this.type, + permissions: this.permissions, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleInstance = RoleInstance; +function RoleListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RoleContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Roles`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RolePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RolePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoleListInstance = RoleListInstance; +class RolePage extends Page_1.default { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoleInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RolePage = RolePage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service.d.ts new file mode 100644 index 00000000..7d362835 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service.d.ts @@ -0,0 +1,304 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { BindingListInstance } from "./service/binding"; +import { ConfigurationListInstance } from "./service/configuration"; +import { ConversationListInstance } from "./service/conversation"; +import { ParticipantConversationListInstance } from "./service/participantConversation"; +import { RoleListInstance } from "./service/role"; +import { UserListInstance } from "./service/user"; +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** The human-readable name of this service, limited to 256 characters. Optional. */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + bindings: BindingListInstance; + configuration: ConfigurationListInstance; + conversations: ConversationListInstance; + participantConversations: ParticipantConversationListInstance; + roles: RoleListInstance; + users: UserListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _bindings?: BindingListInstance; + protected _configuration?: ConfigurationListInstance; + protected _conversations?: ConversationListInstance; + protected _participantConversations?: ParticipantConversationListInstance; + protected _roles?: RoleListInstance; + protected _users?: UserListInstance; + constructor(_version: V1, sid: string); + get bindings(): BindingListInstance; + get configuration(): ConfigurationListInstance; + get conversations(): ConversationListInstance; + get participantConversations(): ParticipantConversationListInstance; + get roles(): RoleListInstance; + get users(): UserListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + account_sid: string; + sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ServiceInstance { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V1, payload: ServiceResource, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this service. + */ + accountSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The human-readable name of this service, limited to 256 characters. Optional. + */ + friendlyName: string; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this service. + */ + url: string; + /** + * Contains absolute API resource URLs to access conversations, users, roles, bindings and configuration of this service. + */ + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the bindings. + */ + bindings(): BindingListInstance; + /** + * Access the configuration. + */ + configuration(): ConfigurationListInstance; + /** + * Access the conversations. + */ + conversations(): ConversationListInstance; + /** + * Access the participantConversations. + */ + participantConversations(): ParticipantConversationListInstance; + /** + * Access the roles. + */ + roles(): RoleListInstance; + /** + * Access the users. + */ + users(): UserListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V1; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V1): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service.js b/node_modules/twilio/lib/rest/conversations/v1/service.js new file mode 100644 index 00000000..9ed63774 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service.js @@ -0,0 +1,299 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const binding_1 = require("./service/binding"); +const configuration_1 = require("./service/configuration"); +const conversation_1 = require("./service/conversation"); +const participantConversation_1 = require("./service/participantConversation"); +const role_1 = require("./service/role"); +const user_1 = require("./service/user"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get bindings() { + this._bindings = + this._bindings || (0, binding_1.BindingListInstance)(this._version, this._solution.sid); + return this._bindings; + } + get configuration() { + this._configuration = + this._configuration || + (0, configuration_1.ConfigurationListInstance)(this._version, this._solution.sid); + return this._configuration; + } + get conversations() { + this._conversations = + this._conversations || + (0, conversation_1.ConversationListInstance)(this._version, this._solution.sid); + return this._conversations; + } + get participantConversations() { + this._participantConversations = + this._participantConversations || + (0, participantConversation_1.ParticipantConversationListInstance)(this._version, this._solution.sid); + return this._participantConversations; + } + get roles() { + this._roles = + this._roles || (0, role_1.RoleListInstance)(this._version, this._solution.sid); + return this._roles; + } + get users() { + this._users = + this._users || (0, user_1.UserListInstance)(this._version, this._solution.sid); + return this._users; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the bindings. + */ + bindings() { + return this._proxy.bindings; + } + /** + * Access the configuration. + */ + configuration() { + return this._proxy.configuration; + } + /** + * Access the conversations. + */ + conversations() { + return this._proxy.conversations; + } + /** + * Access the participantConversations. + */ + participantConversations() { + return this._proxy.participantConversations; + } + /** + * Access the roles. + */ + roles() { + return this._proxy.roles; + } + /** + * Access the users. + */ + users() { + return this._proxy.users; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/binding.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/binding.d.ts new file mode 100644 index 00000000..836fac57 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/binding.d.ts @@ -0,0 +1,276 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type BindingBindingType = "apn" | "gcm" | "fcm"; +/** + * Options to pass to each + */ +export interface BindingListInstanceEachOptions { + /** The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BindingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BindingListInstanceOptions { + /** The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BindingListInstancePageOptions { + /** The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ + bindingType?: Array; + /** The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BindingContext { + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BindingContextSolution { + chatServiceSid: string; + sid: string; +} +export declare class BindingContextImpl implements BindingContext { + protected _version: V1; + protected _solution: BindingContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BindingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BindingPayload extends TwilioResponsePayload { + bindings: BindingResource[]; +} +interface BindingResource { + sid: string; + account_sid: string; + chat_service_sid: string; + credential_sid: string; + date_created: Date; + date_updated: Date; + endpoint: string; + identity: string; + binding_type: BindingBindingType; + message_types: Array; + url: string; +} +export declare class BindingInstance { + protected _version: V1; + protected _solution: BindingContextSolution; + protected _context?: BindingContext; + constructor(_version: V1, payload: BindingResource, chatServiceSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this binding. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Binding resource is associated with. + */ + chatServiceSid: string; + /** + * The SID of the [Credential](https://www.twilio.com/docs/conversations/api/credential-resource) for the binding. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + */ + credentialSid: string; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + /** + * The unique endpoint identifier for the Binding. The format of this value depends on the `binding_type`. + */ + endpoint: string; + /** + * The application-defined string that uniquely identifies the [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more info. + */ + identity: string; + bindingType: BindingBindingType; + /** + * The [Conversation message types](https://www.twilio.com/docs/chat/push-notification-configuration#push-types) the binding is subscribed to. + */ + messageTypes: Array; + /** + * An absolute API resource URL for this binding. + */ + url: string; + private get _proxy(); + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + chatServiceSid: string; + credentialSid: string; + dateCreated: Date; + dateUpdated: Date; + endpoint: string; + identity: string; + bindingType: BindingBindingType; + messageTypes: string[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BindingSolution { + chatServiceSid: string; +} +export interface BindingListInstance { + _version: V1; + _solution: BindingSolution; + _uri: string; + (sid: string): BindingContext; + get(sid: string): BindingContext; + /** + * Streams BindingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BindingInstance, done: (err?: Error) => void) => void): void; + each(params: BindingListInstanceEachOptions, callback?: (item: BindingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BindingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BindingPage) => any): Promise; + /** + * Lists BindingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BindingInstance[]) => any): Promise; + list(params: BindingListInstanceOptions, callback?: (error: Error | null, items: BindingInstance[]) => any): Promise; + /** + * Retrieve a single page of BindingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BindingPage) => any): Promise; + page(params: BindingListInstancePageOptions, callback?: (error: Error | null, items: BindingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BindingListInstance(version: V1, chatServiceSid: string): BindingListInstance; +export declare class BindingPage extends Page { + /** + * Initialize the BindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: BindingSolution); + /** + * Build an instance of BindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BindingResource): BindingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/binding.js b/node_modules/twilio/lib/rest/conversations/v1/service/binding.js new file mode 100644 index 00000000..a72ac071 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/binding.js @@ -0,0 +1,220 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BindingPage = exports.BindingListInstance = exports.BindingInstance = exports.BindingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class BindingContextImpl { + constructor(_version, chatServiceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { chatServiceSid, sid }; + this._uri = `/Services/${chatServiceSid}/Bindings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BindingInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingContextImpl = BindingContextImpl; +class BindingInstance { + constructor(_version, payload, chatServiceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.credentialSid = payload.credential_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.endpoint = payload.endpoint; + this.identity = payload.identity; + this.bindingType = payload.binding_type; + this.messageTypes = payload.message_types; + this.url = payload.url; + this._solution = { chatServiceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new BindingContextImpl(this._version, this._solution.chatServiceSid, this._solution.sid); + return this._context; + } + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + credentialSid: this.credentialSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + endpoint: this.endpoint, + identity: this.identity, + bindingType: this.bindingType, + messageTypes: this.messageTypes, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingInstance = BindingInstance; +function BindingListInstance(version, chatServiceSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new BindingContextImpl(version, chatServiceSid, sid); + }; + instance._version = version; + instance._solution = { chatServiceSid }; + instance._uri = `/Services/${chatServiceSid}/Bindings`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["bindingType"] !== undefined) + data["BindingType"] = serialize.map(params["bindingType"], (e) => e); + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BindingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BindingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BindingListInstance = BindingListInstance; +class BindingPage extends Page_1.default { + /** + * Initialize the BindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BindingInstance(this._version, payload, this._solution.chatServiceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingPage = BindingPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/configuration.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/configuration.d.ts new file mode 100644 index 00000000..cc4b4065 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/configuration.d.ts @@ -0,0 +1,173 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +import { NotificationListInstance } from "./configuration/notification"; +import { WebhookListInstance } from "./configuration/webhook"; +/** + * Options to pass to update a ConfigurationInstance + */ +export interface ConfigurationContextUpdateOptions { + /** The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. */ + defaultConversationCreatorRoleSid?: string; + /** The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. */ + defaultConversationRoleSid?: string; + /** The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. */ + defaultChatServiceRoleSid?: string; + /** Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. */ + reachabilityEnabled?: boolean; +} +export interface ConfigurationContext { + /** + * Fetch a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Update a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + update(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Update a ConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + update(params: ConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConfigurationContextSolution { + chatServiceSid: string; +} +export declare class ConfigurationContextImpl implements ConfigurationContext { + protected _version: V1; + protected _solution: ConfigurationContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string); + fetch(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + update(params?: ConfigurationContextUpdateOptions | ((error: Error | null, item?: ConfigurationInstance) => any), callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConfigurationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConfigurationResource { + chat_service_sid: string; + default_conversation_creator_role_sid: string; + default_conversation_role_sid: string; + default_chat_service_role_sid: string; + url: string; + links: Record; + reachability_enabled: boolean; +} +export declare class ConfigurationInstance { + protected _version: V1; + protected _solution: ConfigurationContextSolution; + protected _context?: ConfigurationContext; + constructor(_version: V1, payload: ConfigurationResource, chatServiceSid: string); + /** + * The unique string that we created to identify the Service configuration resource. + */ + chatServiceSid: string; + /** + * The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + */ + defaultConversationCreatorRoleSid: string; + /** + * The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + */ + defaultConversationRoleSid: string; + /** + * The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + */ + defaultChatServiceRoleSid: string; + /** + * An absolute API resource URL for this service configuration. + */ + url: string; + /** + * Contains an absolute API resource URL to access the push notifications configuration of this service. + */ + links: Record; + /** + * Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. + */ + reachabilityEnabled: boolean; + private get _proxy(); + /** + * Fetch a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Update a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + update(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Update a ConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + update(params: ConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + chatServiceSid: string; + defaultConversationCreatorRoleSid: string; + defaultConversationRoleSid: string; + defaultChatServiceRoleSid: string; + url: string; + links: Record; + reachabilityEnabled: boolean; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConfigurationSolution { + chatServiceSid: string; +} +export interface ConfigurationListInstance { + _version: V1; + _solution: ConfigurationSolution; + _uri: string; + (): ConfigurationContext; + get(): ConfigurationContext; + _notifications?: NotificationListInstance; + notifications: NotificationListInstance; + _webhooks?: WebhookListInstance; + webhooks: WebhookListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConfigurationListInstance(version: V1, chatServiceSid: string): ConfigurationListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/configuration.js b/node_modules/twilio/lib/rest/conversations/v1/service/configuration.js new file mode 100644 index 00000000..78f2938d --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/configuration.js @@ -0,0 +1,174 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConfigurationListInstance = exports.ConfigurationInstance = exports.ConfigurationContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const notification_1 = require("./configuration/notification"); +const webhook_1 = require("./configuration/webhook"); +class ConfigurationContextImpl { + constructor(_version, chatServiceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + this._solution = { chatServiceSid }; + this._uri = `/Services/${chatServiceSid}/Configuration`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["defaultConversationCreatorRoleSid"] !== undefined) + data["DefaultConversationCreatorRoleSid"] = + params["defaultConversationCreatorRoleSid"]; + if (params["defaultConversationRoleSid"] !== undefined) + data["DefaultConversationRoleSid"] = params["defaultConversationRoleSid"]; + if (params["defaultChatServiceRoleSid"] !== undefined) + data["DefaultChatServiceRoleSid"] = params["defaultChatServiceRoleSid"]; + if (params["reachabilityEnabled"] !== undefined) + data["ReachabilityEnabled"] = serialize.bool(params["reachabilityEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConfigurationContextImpl = ConfigurationContextImpl; +class ConfigurationInstance { + constructor(_version, payload, chatServiceSid) { + this._version = _version; + this.chatServiceSid = payload.chat_service_sid; + this.defaultConversationCreatorRoleSid = + payload.default_conversation_creator_role_sid; + this.defaultConversationRoleSid = payload.default_conversation_role_sid; + this.defaultChatServiceRoleSid = payload.default_chat_service_role_sid; + this.url = payload.url; + this.links = payload.links; + this.reachabilityEnabled = payload.reachability_enabled; + this._solution = { chatServiceSid }; + } + get _proxy() { + this._context = + this._context || + new ConfigurationContextImpl(this._version, this._solution.chatServiceSid); + return this._context; + } + /** + * Fetch a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + chatServiceSid: this.chatServiceSid, + defaultConversationCreatorRoleSid: this.defaultConversationCreatorRoleSid, + defaultConversationRoleSid: this.defaultConversationRoleSid, + defaultChatServiceRoleSid: this.defaultChatServiceRoleSid, + url: this.url, + links: this.links, + reachabilityEnabled: this.reachabilityEnabled, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConfigurationInstance = ConfigurationInstance; +function ConfigurationListInstance(version, chatServiceSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new ConfigurationContextImpl(version, chatServiceSid); + }; + instance._version = version; + instance._solution = { chatServiceSid }; + instance._uri = ``; + Object.defineProperty(instance, "notifications", { + get: function notifications() { + if (!instance._notifications) { + instance._notifications = (0, notification_1.NotificationListInstance)(instance._version, instance._solution.chatServiceSid); + } + return instance._notifications; + }, + }); + Object.defineProperty(instance, "webhooks", { + get: function webhooks() { + if (!instance._webhooks) { + instance._webhooks = (0, webhook_1.WebhookListInstance)(instance._version, instance._solution.chatServiceSid); + } + return instance._webhooks; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConfigurationListInstance = ConfigurationListInstance; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/configuration/notification.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/configuration/notification.d.ts new file mode 100644 index 00000000..236da3bf --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/configuration/notification.d.ts @@ -0,0 +1,185 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to update a NotificationInstance + */ +export interface NotificationContextUpdateOptions { + /** Weather the notification logging is enabled. */ + logEnabled?: boolean; + /** Whether to send a notification when a new message is added to a conversation. The default is `false`. */ + "newMessage.enabled"?: boolean; + /** The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. */ + "newMessage.template"?: string; + /** The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. */ + "newMessage.sound"?: string; + /** Whether the new message badge is enabled. The default is `false`. */ + "newMessage.badgeCountEnabled"?: boolean; + /** Whether to send a notification when a participant is added to a conversation. The default is `false`. */ + "addedToConversation.enabled"?: boolean; + /** The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. */ + "addedToConversation.template"?: string; + /** The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. */ + "addedToConversation.sound"?: string; + /** Whether to send a notification to a user when they are removed from a conversation. The default is `false`. */ + "removedFromConversation.enabled"?: boolean; + /** The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. */ + "removedFromConversation.template"?: string; + /** The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. */ + "removedFromConversation.sound"?: string; + /** Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. */ + "newMessage.withMedia.enabled"?: boolean; + /** The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. */ + "newMessage.withMedia.template"?: string; +} +export interface NotificationContext { + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Update a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + update(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Update a NotificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + update(params: NotificationContextUpdateOptions, callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NotificationContextSolution { + chatServiceSid: string; +} +export declare class NotificationContextImpl implements NotificationContext { + protected _version: V1; + protected _solution: NotificationContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string); + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + update(params?: NotificationContextUpdateOptions | ((error: Error | null, item?: NotificationInstance) => any), callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NotificationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NotificationResource { + account_sid: string; + chat_service_sid: string; + new_message: any; + added_to_conversation: any; + removed_from_conversation: any; + log_enabled: boolean; + url: string; +} +export declare class NotificationInstance { + protected _version: V1; + protected _solution: NotificationContextSolution; + protected _context?: NotificationContext; + constructor(_version: V1, payload: NotificationResource, chatServiceSid: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this configuration. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to. + */ + chatServiceSid: string; + /** + * The Push Notification configuration for New Messages. + */ + newMessage: any; + /** + * The Push Notification configuration for being added to a Conversation. + */ + addedToConversation: any; + /** + * The Push Notification configuration for being removed from a Conversation. + */ + removedFromConversation: any; + /** + * Weather the notification logging is enabled. + */ + logEnabled: boolean; + /** + * An absolute API resource URL for this configuration. + */ + url: string; + private get _proxy(); + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Update a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + update(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Update a NotificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + update(params: NotificationContextUpdateOptions, callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + newMessage: any; + addedToConversation: any; + removedFromConversation: any; + logEnabled: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NotificationSolution { + chatServiceSid: string; +} +export interface NotificationListInstance { + _version: V1; + _solution: NotificationSolution; + _uri: string; + (): NotificationContext; + get(): NotificationContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NotificationListInstance(version: V1, chatServiceSid: string): NotificationListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/configuration/notification.js b/node_modules/twilio/lib/rest/conversations/v1/service/configuration/notification.js new file mode 100644 index 00000000..f89855ee --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/configuration/notification.js @@ -0,0 +1,176 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NotificationListInstance = exports.NotificationInstance = exports.NotificationContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class NotificationContextImpl { + constructor(_version, chatServiceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + this._solution = { chatServiceSid }; + this._uri = `/Services/${chatServiceSid}/Configuration/Notifications`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new NotificationInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["logEnabled"] !== undefined) + data["LogEnabled"] = serialize.bool(params["logEnabled"]); + if (params["newMessage.enabled"] !== undefined) + data["NewMessage.Enabled"] = serialize.bool(params["newMessage.enabled"]); + if (params["newMessage.template"] !== undefined) + data["NewMessage.Template"] = params["newMessage.template"]; + if (params["newMessage.sound"] !== undefined) + data["NewMessage.Sound"] = params["newMessage.sound"]; + if (params["newMessage.badgeCountEnabled"] !== undefined) + data["NewMessage.BadgeCountEnabled"] = serialize.bool(params["newMessage.badgeCountEnabled"]); + if (params["addedToConversation.enabled"] !== undefined) + data["AddedToConversation.Enabled"] = serialize.bool(params["addedToConversation.enabled"]); + if (params["addedToConversation.template"] !== undefined) + data["AddedToConversation.Template"] = + params["addedToConversation.template"]; + if (params["addedToConversation.sound"] !== undefined) + data["AddedToConversation.Sound"] = params["addedToConversation.sound"]; + if (params["removedFromConversation.enabled"] !== undefined) + data["RemovedFromConversation.Enabled"] = serialize.bool(params["removedFromConversation.enabled"]); + if (params["removedFromConversation.template"] !== undefined) + data["RemovedFromConversation.Template"] = + params["removedFromConversation.template"]; + if (params["removedFromConversation.sound"] !== undefined) + data["RemovedFromConversation.Sound"] = + params["removedFromConversation.sound"]; + if (params["newMessage.withMedia.enabled"] !== undefined) + data["NewMessage.WithMedia.Enabled"] = serialize.bool(params["newMessage.withMedia.enabled"]); + if (params["newMessage.withMedia.template"] !== undefined) + data["NewMessage.WithMedia.Template"] = + params["newMessage.withMedia.template"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NotificationInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationContextImpl = NotificationContextImpl; +class NotificationInstance { + constructor(_version, payload, chatServiceSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.newMessage = payload.new_message; + this.addedToConversation = payload.added_to_conversation; + this.removedFromConversation = payload.removed_from_conversation; + this.logEnabled = payload.log_enabled; + this.url = payload.url; + this._solution = { chatServiceSid }; + } + get _proxy() { + this._context = + this._context || + new NotificationContextImpl(this._version, this._solution.chatServiceSid); + return this._context; + } + /** + * Fetch a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + newMessage: this.newMessage, + addedToConversation: this.addedToConversation, + removedFromConversation: this.removedFromConversation, + logEnabled: this.logEnabled, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationInstance = NotificationInstance; +function NotificationListInstance(version, chatServiceSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new NotificationContextImpl(version, chatServiceSid); + }; + instance._version = version; + instance._solution = { chatServiceSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NotificationListInstance = NotificationListInstance; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/configuration/webhook.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/configuration/webhook.d.ts new file mode 100644 index 00000000..1278ff09 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/configuration/webhook.d.ts @@ -0,0 +1,165 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +export type WebhookMethod = "GET" | "POST"; +/** + * Options to pass to update a WebhookInstance + */ +export interface WebhookContextUpdateOptions { + /** The absolute url the pre-event webhook request should be sent to. */ + preWebhookUrl?: string; + /** The absolute url the post-event webhook request should be sent to. */ + postWebhookUrl?: string; + /** The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. */ + filters?: Array; + /** The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. */ + method?: string; +} +export interface WebhookContext { + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WebhookContextSolution { + chatServiceSid: string; +} +export declare class WebhookContextImpl implements WebhookContext { + protected _version: V1; + protected _solution: WebhookContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string); + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + update(params?: WebhookContextUpdateOptions | ((error: Error | null, item?: WebhookInstance) => any), callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WebhookContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WebhookResource { + account_sid: string; + chat_service_sid: string; + pre_webhook_url: string; + post_webhook_url: string; + filters: Array; + method: WebhookMethod; + url: string; +} +export declare class WebhookInstance { + protected _version: V1; + protected _solution: WebhookContextSolution; + protected _context?: WebhookContext; + constructor(_version: V1, payload: WebhookResource, chatServiceSid: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this service. + */ + accountSid: string; + /** + * The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + */ + chatServiceSid: string; + /** + * The absolute url the pre-event webhook request should be sent to. + */ + preWebhookUrl: string; + /** + * The absolute url the post-event webhook request should be sent to. + */ + postWebhookUrl: string; + /** + * The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. + */ + filters: Array; + method: WebhookMethod; + /** + * An absolute API resource URL for this webhook. + */ + url: string; + private get _proxy(); + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + preWebhookUrl: string; + postWebhookUrl: string; + filters: string[]; + method: WebhookMethod; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WebhookSolution { + chatServiceSid: string; +} +export interface WebhookListInstance { + _version: V1; + _solution: WebhookSolution; + _uri: string; + (): WebhookContext; + get(): WebhookContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebhookListInstance(version: V1, chatServiceSid: string): WebhookListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/configuration/webhook.js b/node_modules/twilio/lib/rest/conversations/v1/service/configuration/webhook.js new file mode 100644 index 00000000..b730eae3 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/configuration/webhook.js @@ -0,0 +1,154 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebhookListInstance = exports.WebhookInstance = exports.WebhookContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WebhookContextImpl { + constructor(_version, chatServiceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + this._solution = { chatServiceSid }; + this._uri = `/Services/${chatServiceSid}/Configuration/Webhooks`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["preWebhookUrl"] !== undefined) + data["PreWebhookUrl"] = params["preWebhookUrl"]; + if (params["postWebhookUrl"] !== undefined) + data["PostWebhookUrl"] = params["postWebhookUrl"]; + if (params["filters"] !== undefined) + data["Filters"] = serialize.map(params["filters"], (e) => e); + if (params["method"] !== undefined) + data["Method"] = params["method"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookContextImpl = WebhookContextImpl; +class WebhookInstance { + constructor(_version, payload, chatServiceSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.preWebhookUrl = payload.pre_webhook_url; + this.postWebhookUrl = payload.post_webhook_url; + this.filters = payload.filters; + this.method = payload.method; + this.url = payload.url; + this._solution = { chatServiceSid }; + } + get _proxy() { + this._context = + this._context || + new WebhookContextImpl(this._version, this._solution.chatServiceSid); + return this._context; + } + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + preWebhookUrl: this.preWebhookUrl, + postWebhookUrl: this.postWebhookUrl, + filters: this.filters, + method: this.method, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookInstance = WebhookInstance; +function WebhookListInstance(version, chatServiceSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WebhookContextImpl(version, chatServiceSid); + }; + instance._version = version; + instance._solution = { chatServiceSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebhookListInstance = WebhookListInstance; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/conversation.d.ts new file mode 100644 index 00000000..63ccb7a0 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation.d.ts @@ -0,0 +1,457 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { MessageListInstance } from "./conversation/message"; +import { ParticipantListInstance } from "./conversation/participant"; +import { WebhookListInstance } from "./conversation/webhook"; +export type ConversationState = "inactive" | "active" | "closed"; +export type ConversationWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a ConversationInstance + */ +export interface ConversationContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ConversationWebhookEnabledType; +} +/** + * Options to pass to update a ConversationInstance + */ +export interface ConversationContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ConversationWebhookEnabledType; + /** The human-readable name of this conversation, limited to 256 characters. Optional. */ + friendlyName?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. */ + dateUpdated?: Date; + /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. */ + messagingServiceSid?: string; + /** */ + state?: ConversationState; + /** ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. */ + "timers.inactive"?: string; + /** ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. */ + "timers.closed"?: string; + /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\\\'s `sid` in the URL. */ + uniqueName?: string; + /** The default email address that will be used when sending outbound emails in this conversation. */ + "bindings.email.address"?: string; + /** The default name that will be used when sending outbound emails in this conversation. */ + "bindings.email.name"?: string; +} +/** + * Options to pass to create a ConversationInstance + */ +export interface ConversationListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ConversationWebhookEnabledType; + /** The human-readable name of this conversation, limited to 256 characters. Optional. */ + friendlyName?: string; + /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\\\'s `sid` in the URL. */ + uniqueName?: string; + /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. */ + messagingServiceSid?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. */ + dateUpdated?: Date; + /** */ + state?: ConversationState; + /** ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. */ + "timers.inactive"?: string; + /** ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. */ + "timers.closed"?: string; + /** The default email address that will be used when sending outbound emails in this conversation. */ + "bindings.email.address"?: string; + /** The default name that will be used when sending outbound emails in this conversation. */ + "bindings.email.name"?: string; +} +/** + * Options to pass to each + */ +export interface ConversationListInstanceEachOptions { + /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */ + startDate?: string; + /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */ + endDate?: string; + /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ + state?: ConversationState; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ConversationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ConversationListInstanceOptions { + /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */ + startDate?: string; + /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */ + endDate?: string; + /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ + state?: ConversationState; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ConversationListInstancePageOptions { + /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */ + startDate?: string; + /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */ + endDate?: string; + /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ + state?: ConversationState; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ConversationContext { + messages: MessageListInstance; + participants: ParticipantListInstance; + webhooks: WebhookListInstance; + /** + * Remove a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + remove(params: ConversationContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + fetch(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Update a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + update(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Update a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + update(params: ConversationContextUpdateOptions, callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConversationContextSolution { + chatServiceSid: string; + sid: string; +} +export declare class ConversationContextImpl implements ConversationContext { + protected _version: V1; + protected _solution: ConversationContextSolution; + protected _uri: string; + protected _messages?: MessageListInstance; + protected _participants?: ParticipantListInstance; + protected _webhooks?: WebhookListInstance; + constructor(_version: V1, chatServiceSid: string, sid: string); + get messages(): MessageListInstance; + get participants(): ParticipantListInstance; + get webhooks(): WebhookListInstance; + remove(params?: ConversationContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + update(params?: ConversationContextUpdateOptions | ((error: Error | null, item?: ConversationInstance) => any), callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConversationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConversationPayload extends TwilioResponsePayload { + conversations: ConversationResource[]; +} +interface ConversationResource { + account_sid: string; + chat_service_sid: string; + messaging_service_sid: string; + sid: string; + friendly_name: string; + unique_name: string; + attributes: string; + state: ConversationState; + date_created: Date; + date_updated: Date; + timers: any; + url: string; + links: Record; + bindings: any; +} +export declare class ConversationInstance { + protected _version: V1; + protected _solution: ConversationContextSolution; + protected _context?: ConversationContext; + constructor(_version: V1, payload: ConversationResource, chatServiceSid: string, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + /** + * The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + */ + chatServiceSid: string; + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + */ + messagingServiceSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + */ + friendlyName: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\'s `sid` in the URL. + */ + uniqueName: string; + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + attributes: string; + state: ConversationState; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + /** + * Timer date values representing state update for this conversation. + */ + timers: any; + /** + * An absolute API resource URL for this conversation. + */ + url: string; + /** + * Contains absolute URLs to access the [participants](https://www.twilio.com/docs/conversations/api/conversation-participant-resource), [messages](https://www.twilio.com/docs/conversations/api/conversation-message-resource) and [webhooks](https://www.twilio.com/docs/conversations/api/conversation-scoped-webhook-resource) of this conversation. + */ + links: Record; + bindings: any; + private get _proxy(); + /** + * Remove a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + remove(params: ConversationContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + fetch(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Update a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + update(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Update a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + update(params: ConversationContextUpdateOptions, callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Access the messages. + */ + messages(): MessageListInstance; + /** + * Access the participants. + */ + participants(): ParticipantListInstance; + /** + * Access the webhooks. + */ + webhooks(): WebhookListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + messagingServiceSid: string; + sid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + state: ConversationState; + dateCreated: Date; + dateUpdated: Date; + timers: any; + url: string; + links: Record; + bindings: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConversationSolution { + chatServiceSid: string; +} +export interface ConversationListInstance { + _version: V1; + _solution: ConversationSolution; + _uri: string; + (sid: string): ConversationContext; + get(sid: string): ConversationContext; + /** + * Create a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + create(callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Create a ConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + create(params: ConversationListInstanceCreateOptions, callback?: (error: Error | null, item?: ConversationInstance) => any): Promise; + /** + * Streams ConversationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConversationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ConversationInstance, done: (err?: Error) => void) => void): void; + each(params: ConversationListInstanceEachOptions, callback?: (item: ConversationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ConversationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ConversationPage) => any): Promise; + /** + * Lists ConversationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConversationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ConversationInstance[]) => any): Promise; + list(params: ConversationListInstanceOptions, callback?: (error: Error | null, items: ConversationInstance[]) => any): Promise; + /** + * Retrieve a single page of ConversationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConversationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ConversationPage) => any): Promise; + page(params: ConversationListInstancePageOptions, callback?: (error: Error | null, items: ConversationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConversationListInstance(version: V1, chatServiceSid: string): ConversationListInstance; +export declare class ConversationPage extends Page { + /** + * Initialize the ConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ConversationSolution); + /** + * Build an instance of ConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ConversationResource): ConversationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation.js b/node_modules/twilio/lib/rest/conversations/v1/service/conversation.js new file mode 100644 index 00000000..aea01aba --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation.js @@ -0,0 +1,367 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConversationPage = exports.ConversationListInstance = exports.ConversationInstance = exports.ConversationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const message_1 = require("./conversation/message"); +const participant_1 = require("./conversation/participant"); +const webhook_1 = require("./conversation/webhook"); +class ConversationContextImpl { + constructor(_version, chatServiceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { chatServiceSid, sid }; + this._uri = `/Services/${chatServiceSid}/Conversations/${sid}`; + } + get messages() { + this._messages = + this._messages || + (0, message_1.MessageListInstance)(this._version, this._solution.chatServiceSid, this._solution.sid); + return this._messages; + } + get participants() { + this._participants = + this._participants || + (0, participant_1.ParticipantListInstance)(this._version, this._solution.chatServiceSid, this._solution.sid); + return this._participants; + } + get webhooks() { + this._webhooks = + this._webhooks || + (0, webhook_1.WebhookListInstance)(this._version, this._solution.chatServiceSid, this._solution.sid); + return this._webhooks; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConversationInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["messagingServiceSid"] !== undefined) + data["MessagingServiceSid"] = params["messagingServiceSid"]; + if (params["state"] !== undefined) + data["State"] = params["state"]; + if (params["timers.inactive"] !== undefined) + data["Timers.Inactive"] = params["timers.inactive"]; + if (params["timers.closed"] !== undefined) + data["Timers.Closed"] = params["timers.closed"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["bindings.email.address"] !== undefined) + data["Bindings.Email.Address"] = params["bindings.email.address"]; + if (params["bindings.email.name"] !== undefined) + data["Bindings.Email.Name"] = params["bindings.email.name"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConversationInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConversationContextImpl = ConversationContextImpl; +class ConversationInstance { + constructor(_version, payload, chatServiceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.messagingServiceSid = payload.messaging_service_sid; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.attributes = payload.attributes; + this.state = payload.state; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.timers = payload.timers; + this.url = payload.url; + this.links = payload.links; + this.bindings = payload.bindings; + this._solution = { chatServiceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ConversationContextImpl(this._version, this._solution.chatServiceSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a ConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConversationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the messages. + */ + messages() { + return this._proxy.messages; + } + /** + * Access the participants. + */ + participants() { + return this._proxy.participants; + } + /** + * Access the webhooks. + */ + webhooks() { + return this._proxy.webhooks; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + messagingServiceSid: this.messagingServiceSid, + sid: this.sid, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + attributes: this.attributes, + state: this.state, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + timers: this.timers, + url: this.url, + links: this.links, + bindings: this.bindings, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConversationInstance = ConversationInstance; +function ConversationListInstance(version, chatServiceSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ConversationContextImpl(version, chatServiceSid, sid); + }; + instance._version = version; + instance._solution = { chatServiceSid }; + instance._uri = `/Services/${chatServiceSid}/Conversations`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["messagingServiceSid"] !== undefined) + data["MessagingServiceSid"] = params["messagingServiceSid"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["state"] !== undefined) + data["State"] = params["state"]; + if (params["timers.inactive"] !== undefined) + data["Timers.Inactive"] = params["timers.inactive"]; + if (params["timers.closed"] !== undefined) + data["Timers.Closed"] = params["timers.closed"]; + if (params["bindings.email.address"] !== undefined) + data["Bindings.Email.Address"] = params["bindings.email.address"]; + if (params["bindings.email.name"] !== undefined) + data["Bindings.Email.Name"] = params["bindings.email.name"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConversationInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["startDate"] !== undefined) + data["StartDate"] = params["startDate"]; + if (params["endDate"] !== undefined) + data["EndDate"] = params["endDate"]; + if (params["state"] !== undefined) + data["State"] = params["state"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConversationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ConversationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConversationListInstance = ConversationListInstance; +class ConversationPage extends Page_1.default { + /** + * Initialize the ConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ConversationInstance(this._version, payload, this._solution.chatServiceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConversationPage = ConversationPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message.d.ts new file mode 100644 index 00000000..ad538b92 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message.d.ts @@ -0,0 +1,435 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +import { DeliveryReceiptListInstance } from "./message/deliveryReceipt"; +export type MessageOrderType = "asc" | "desc"; +export type MessageWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a MessageInstance + */ +export interface MessageContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; +} +/** + * Options to pass to update a MessageInstance + */ +export interface MessageContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; + /** The channel specific identifier of the message\\\'s author. Defaults to `system`. */ + author?: string; + /** The content of the message, can be up to 1,600 characters long. */ + body?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. `null` if the message has not been edited. */ + dateUpdated?: Date; + /** A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The subject of the message, can be up to 256 characters long. */ + subject?: string; +} +/** + * Options to pass to create a MessageInstance + */ +export interface MessageListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; + /** The channel specific identifier of the message\\\'s author. Defaults to `system`. */ + author?: string; + /** The content of the message, can be up to 1,600 characters long. */ + body?: string; + /** The date that this resource was created. */ + dateCreated?: Date; + /** The date that this resource was last updated. `null` if the message has not been edited. */ + dateUpdated?: Date; + /** A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */ + attributes?: string; + /** The Media SID to be attached to the new Message. */ + mediaSid?: string; + /** The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. */ + contentSid?: string; + /** A structurally valid JSON string that contains values to resolve Rich Content template variables. */ + contentVariables?: string; + /** The subject of the message, can be up to 256 characters long. */ + subject?: string; +} +/** + * Options to pass to each + */ +export interface MessageListInstanceEachOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessageInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessageListInstanceOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessageListInstancePageOptions { + /** The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessageContext { + deliveryReceipts: DeliveryReceiptListInstance; + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + remove(params: MessageContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessageContextSolution { + chatServiceSid: string; + conversationSid: string; + sid: string; +} +export declare class MessageContextImpl implements MessageContext { + protected _version: V1; + protected _solution: MessageContextSolution; + protected _uri: string; + protected _deliveryReceipts?: DeliveryReceiptListInstance; + constructor(_version: V1, chatServiceSid: string, conversationSid: string, sid: string); + get deliveryReceipts(): DeliveryReceiptListInstance; + remove(params?: MessageContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + update(params?: MessageContextUpdateOptions | ((error: Error | null, item?: MessageInstance) => any), callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessageContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessagePayload extends TwilioResponsePayload { + messages: MessageResource[]; +} +interface MessageResource { + account_sid: string; + chat_service_sid: string; + conversation_sid: string; + sid: string; + index: number; + author: string; + body: string; + media: Array; + attributes: string; + participant_sid: string; + date_created: Date; + date_updated: Date; + delivery: any; + url: string; + links: Record; + content_sid: string; +} +export declare class MessageInstance { + protected _version: V1; + protected _solution: MessageContextSolution; + protected _context?: MessageContext; + constructor(_version: V1, payload: MessageResource, chatServiceSid: string, conversationSid: string, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this message. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. + */ + chatServiceSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. + */ + conversationSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The index of the message within the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource). + */ + index: number; + /** + * The channel specific identifier of the message\'s author. Defaults to `system`. + */ + author: string; + /** + * The content of the message, can be up to 1,600 characters long. + */ + body: string; + /** + * An array of objects that describe the Message\'s media, if the message contains media. Each object contains these fields: `content_type` with the MIME type of the media, `filename` with the name of the media, `sid` with the SID of the Media resource, and `size` with the media object\'s file size in bytes. If the Message has no media, this value is `null`. + */ + media: Array; + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + attributes: string; + /** + * The unique ID of messages\'s author participant. Null in case of `system` sent message. + */ + participantSid: string; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. `null` if the message has not been edited. + */ + dateUpdated: Date; + /** + * An object that contains the summary of delivery statuses for the message to non-chat participants. + */ + delivery: any; + /** + * An absolute API resource URL for this message. + */ + url: string; + /** + * Contains an absolute API resource URL to access the delivery & read receipts of this message. + */ + links: Record; + /** + * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. + */ + contentSid: string; + private get _proxy(); + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + remove(params: MessageContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Access the deliveryReceipts. + */ + deliveryReceipts(): DeliveryReceiptListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + conversationSid: string; + sid: string; + index: number; + author: string; + body: string; + media: any[]; + attributes: string; + participantSid: string; + dateCreated: Date; + dateUpdated: Date; + delivery: any; + url: string; + links: Record; + contentSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessageSolution { + chatServiceSid: string; + conversationSid: string; +} +export interface MessageListInstance { + _version: V1; + _solution: MessageSolution; + _uri: string; + (sid: string): MessageContext; + get(sid: string): MessageContext; + /** + * Create a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Create a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(params: MessageListInstanceCreateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Streams MessageInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + each(params: MessageListInstanceEachOptions, callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Lists MessageInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + list(params: MessageListInstanceOptions, callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + /** + * Retrieve a single page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessagePage) => any): Promise; + page(params: MessageListInstancePageOptions, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessageListInstance(version: V1, chatServiceSid: string, conversationSid: string): MessageListInstance; +export declare class MessagePage extends Page { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MessageSolution); + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessageResource): MessageInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message.js b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message.js new file mode 100644 index 00000000..542f33ad --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message.js @@ -0,0 +1,333 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagePage = exports.MessageListInstance = exports.MessageInstance = exports.MessageContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const deliveryReceipt_1 = require("./message/deliveryReceipt"); +class MessageContextImpl { + constructor(_version, chatServiceSid, conversationSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { chatServiceSid, conversationSid, sid }; + this._uri = `/Services/${chatServiceSid}/Conversations/${conversationSid}/Messages/${sid}`; + } + get deliveryReceipts() { + this._deliveryReceipts = + this._deliveryReceipts || + (0, deliveryReceipt_1.DeliveryReceiptListInstance)(this._version, this._solution.chatServiceSid, this._solution.conversationSid, this._solution.sid); + return this._deliveryReceipts; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["author"] !== undefined) + data["Author"] = params["author"]; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["subject"] !== undefined) + data["Subject"] = params["subject"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageContextImpl = MessageContextImpl; +class MessageInstance { + constructor(_version, payload, chatServiceSid, conversationSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.conversationSid = payload.conversation_sid; + this.sid = payload.sid; + this.index = deserialize.integer(payload.index); + this.author = payload.author; + this.body = payload.body; + this.media = payload.media; + this.attributes = payload.attributes; + this.participantSid = payload.participant_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.delivery = payload.delivery; + this.url = payload.url; + this.links = payload.links; + this.contentSid = payload.content_sid; + this._solution = { chatServiceSid, conversationSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MessageContextImpl(this._version, this._solution.chatServiceSid, this._solution.conversationSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the deliveryReceipts. + */ + deliveryReceipts() { + return this._proxy.deliveryReceipts; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + conversationSid: this.conversationSid, + sid: this.sid, + index: this.index, + author: this.author, + body: this.body, + media: this.media, + attributes: this.attributes, + participantSid: this.participantSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + delivery: this.delivery, + url: this.url, + links: this.links, + contentSid: this.contentSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInstance = MessageInstance; +function MessageListInstance(version, chatServiceSid, conversationSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MessageContextImpl(version, chatServiceSid, conversationSid, sid); + }; + instance._version = version; + instance._solution = { chatServiceSid, conversationSid }; + instance._uri = `/Services/${chatServiceSid}/Conversations/${conversationSid}/Messages`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["author"] !== undefined) + data["Author"] = params["author"]; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["mediaSid"] !== undefined) + data["MediaSid"] = params["mediaSid"]; + if (params["contentSid"] !== undefined) + data["ContentSid"] = params["contentSid"]; + if (params["contentVariables"] !== undefined) + data["ContentVariables"] = params["contentVariables"]; + if (params["subject"] !== undefined) + data["Subject"] = params["subject"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessagePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessageListInstance = MessageListInstance; +class MessagePage extends Page_1.default { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessageInstance(this._version, payload, this._solution.chatServiceSid, this._solution.conversationSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagePage = MessagePage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.d.ts new file mode 100644 index 00000000..4ff8774e --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.d.ts @@ -0,0 +1,257 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V1 from "../../../../V1"; +export type DeliveryReceiptDeliveryStatus = "read" | "failed" | "delivered" | "undelivered" | "sent"; +/** + * Options to pass to each + */ +export interface DeliveryReceiptListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DeliveryReceiptInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DeliveryReceiptListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DeliveryReceiptListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DeliveryReceiptContext { + /** + * Fetch a DeliveryReceiptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeliveryReceiptInstance + */ + fetch(callback?: (error: Error | null, item?: DeliveryReceiptInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeliveryReceiptContextSolution { + chatServiceSid: string; + conversationSid: string; + messageSid: string; + sid: string; +} +export declare class DeliveryReceiptContextImpl implements DeliveryReceiptContext { + protected _version: V1; + protected _solution: DeliveryReceiptContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string, conversationSid: string, messageSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: DeliveryReceiptInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeliveryReceiptContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DeliveryReceiptPayload extends TwilioResponsePayload { + delivery_receipts: DeliveryReceiptResource[]; +} +interface DeliveryReceiptResource { + account_sid: string; + chat_service_sid: string; + conversation_sid: string; + message_sid: string; + sid: string; + channel_message_sid: string; + participant_sid: string; + status: DeliveryReceiptDeliveryStatus; + error_code: number; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class DeliveryReceiptInstance { + protected _version: V1; + protected _solution: DeliveryReceiptContextSolution; + protected _context?: DeliveryReceiptContext; + constructor(_version: V1, payload: DeliveryReceiptResource, chatServiceSid: string, conversationSid: string, messageSid: string, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this participant. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Message resource is associated with. + */ + chatServiceSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. + */ + conversationSid: string; + /** + * The SID of the message within a [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to + */ + messageSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * A messaging channel-specific identifier for the message delivered to participant e.g. `SMxx` for SMS, `WAxx` for Whatsapp etc. + */ + channelMessageSid: string; + /** + * The unique ID of the participant the delivery receipt belongs to. + */ + participantSid: string; + status: DeliveryReceiptDeliveryStatus; + /** + * The message [delivery error code](https://www.twilio.com/docs/sms/api/message-resource#delivery-related-errors) for a `failed` status, + */ + errorCode: number; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. `null` if the delivery receipt has not been updated. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this delivery receipt. + */ + url: string; + private get _proxy(); + /** + * Fetch a DeliveryReceiptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeliveryReceiptInstance + */ + fetch(callback?: (error: Error | null, item?: DeliveryReceiptInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + conversationSid: string; + messageSid: string; + sid: string; + channelMessageSid: string; + participantSid: string; + status: DeliveryReceiptDeliveryStatus; + errorCode: number; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeliveryReceiptSolution { + chatServiceSid: string; + conversationSid: string; + messageSid: string; +} +export interface DeliveryReceiptListInstance { + _version: V1; + _solution: DeliveryReceiptSolution; + _uri: string; + (sid: string): DeliveryReceiptContext; + get(sid: string): DeliveryReceiptContext; + /** + * Streams DeliveryReceiptInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeliveryReceiptListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DeliveryReceiptInstance, done: (err?: Error) => void) => void): void; + each(params: DeliveryReceiptListInstanceEachOptions, callback?: (item: DeliveryReceiptInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DeliveryReceiptInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DeliveryReceiptPage) => any): Promise; + /** + * Lists DeliveryReceiptInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeliveryReceiptListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DeliveryReceiptInstance[]) => any): Promise; + list(params: DeliveryReceiptListInstanceOptions, callback?: (error: Error | null, items: DeliveryReceiptInstance[]) => any): Promise; + /** + * Retrieve a single page of DeliveryReceiptInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeliveryReceiptListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DeliveryReceiptPage) => any): Promise; + page(params: DeliveryReceiptListInstancePageOptions, callback?: (error: Error | null, items: DeliveryReceiptPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeliveryReceiptListInstance(version: V1, chatServiceSid: string, conversationSid: string, messageSid: string): DeliveryReceiptListInstance; +export declare class DeliveryReceiptPage extends Page { + /** + * Initialize the DeliveryReceiptPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DeliveryReceiptSolution); + /** + * Build an instance of DeliveryReceiptInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DeliveryReceiptResource): DeliveryReceiptInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.js b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.js new file mode 100644 index 00000000..6827e48e --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.js @@ -0,0 +1,216 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeliveryReceiptPage = exports.DeliveryReceiptListInstance = exports.DeliveryReceiptInstance = exports.DeliveryReceiptContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class DeliveryReceiptContextImpl { + constructor(_version, chatServiceSid, conversationSid, messageSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(messageSid)) { + throw new Error("Parameter 'messageSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { chatServiceSid, conversationSid, messageSid, sid }; + this._uri = `/Services/${chatServiceSid}/Conversations/${conversationSid}/Messages/${messageSid}/Receipts/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DeliveryReceiptInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid, instance._solution.messageSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeliveryReceiptContextImpl = DeliveryReceiptContextImpl; +class DeliveryReceiptInstance { + constructor(_version, payload, chatServiceSid, conversationSid, messageSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.conversationSid = payload.conversation_sid; + this.messageSid = payload.message_sid; + this.sid = payload.sid; + this.channelMessageSid = payload.channel_message_sid; + this.participantSid = payload.participant_sid; + this.status = payload.status; + this.errorCode = deserialize.integer(payload.error_code); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { + chatServiceSid, + conversationSid, + messageSid, + sid: sid || this.sid, + }; + } + get _proxy() { + this._context = + this._context || + new DeliveryReceiptContextImpl(this._version, this._solution.chatServiceSid, this._solution.conversationSid, this._solution.messageSid, this._solution.sid); + return this._context; + } + /** + * Fetch a DeliveryReceiptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeliveryReceiptInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + conversationSid: this.conversationSid, + messageSid: this.messageSid, + sid: this.sid, + channelMessageSid: this.channelMessageSid, + participantSid: this.participantSid, + status: this.status, + errorCode: this.errorCode, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeliveryReceiptInstance = DeliveryReceiptInstance; +function DeliveryReceiptListInstance(version, chatServiceSid, conversationSid, messageSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(messageSid)) { + throw new Error("Parameter 'messageSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DeliveryReceiptContextImpl(version, chatServiceSid, conversationSid, messageSid, sid); + }; + instance._version = version; + instance._solution = { chatServiceSid, conversationSid, messageSid }; + instance._uri = `/Services/${chatServiceSid}/Conversations/${conversationSid}/Messages/${messageSid}/Receipts`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeliveryReceiptPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DeliveryReceiptPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeliveryReceiptListInstance = DeliveryReceiptListInstance; +class DeliveryReceiptPage extends Page_1.default { + /** + * Initialize the DeliveryReceiptPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DeliveryReceiptInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DeliveryReceiptInstance(this._version, payload, this._solution.chatServiceSid, this._solution.conversationSid, this._solution.messageSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeliveryReceiptPage = DeliveryReceiptPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation/participant.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/participant.d.ts new file mode 100644 index 00000000..d8f422b8 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/participant.d.ts @@ -0,0 +1,406 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type ParticipantWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a ParticipantInstance + */ +export interface ParticipantContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ParticipantWebhookEnabledType; +} +/** + * Options to pass to update a ParticipantInstance + */ +export interface ParticipantContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ParticipantWebhookEnabledType; + /** The date on which this resource was created. */ + dateCreated?: Date; + /** The date on which this resource was last updated. */ + dateUpdated?: Date; + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. */ + identity?: string; + /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. */ + attributes?: string; + /** The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. */ + roleSid?: string; + /** The address of the Twilio phone number that the participant is in contact with. \\\'null\\\' value will remove it. */ + "messagingBinding.proxyAddress"?: string; + /** The address of the Twilio phone number that is used in Group MMS. \\\'null\\\' value will remove it. */ + "messagingBinding.projectedAddress"?: string; + /** Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. */ + lastReadMessageIndex?: number; + /** Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. */ + lastReadTimestamp?: string; +} +/** + * Options to pass to create a ParticipantInstance + */ +export interface ParticipantListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ParticipantWebhookEnabledType; + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. */ + identity?: string; + /** The address of the participant\\\'s device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). */ + "messagingBinding.address"?: string; + /** The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). */ + "messagingBinding.proxyAddress"?: string; + /** The date on which this resource was created. */ + dateCreated?: Date; + /** The date on which this resource was last updated. */ + dateUpdated?: Date; + /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. */ + attributes?: string; + /** The address of the Twilio phone number that is used in Group MMS. */ + "messagingBinding.projectedAddress"?: string; + /** The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface ParticipantListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ParticipantListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ParticipantListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ParticipantContext { + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + remove(params: ParticipantContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ParticipantContextSolution { + chatServiceSid: string; + conversationSid: string; + sid: string; +} +export declare class ParticipantContextImpl implements ParticipantContext { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string, conversationSid: string, sid: string); + remove(params?: ParticipantContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + update(params?: ParticipantContextUpdateOptions | ((error: Error | null, item?: ParticipantInstance) => any), callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ParticipantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ParticipantPayload extends TwilioResponsePayload { + participants: ParticipantResource[]; +} +interface ParticipantResource { + account_sid: string; + chat_service_sid: string; + conversation_sid: string; + sid: string; + identity: string; + attributes: string; + messaging_binding: any; + role_sid: string; + date_created: Date; + date_updated: Date; + url: string; + last_read_message_index: number; + last_read_timestamp: string; +} +export declare class ParticipantInstance { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _context?: ParticipantContext; + constructor(_version: V1, payload: ParticipantResource, chatServiceSid: string, conversationSid: string, sid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this participant. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. + */ + chatServiceSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant. + */ + conversationSid: string; + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. + */ + identity: string; + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. + */ + attributes: string; + /** + * Information about how this participant exchanges messages with the conversation. A JSON parameter consisting of type and address fields of the participant. + */ + messagingBinding: any; + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + */ + roleSid: string; + /** + * The date on which this resource was created. + */ + dateCreated: Date; + /** + * The date on which this resource was last updated. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this participant. + */ + url: string; + /** + * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + */ + lastReadMessageIndex: number; + /** + * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + */ + lastReadTimestamp: string; + private get _proxy(); + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + remove(params: ParticipantContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + conversationSid: string; + sid: string; + identity: string; + attributes: string; + messagingBinding: any; + roleSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + lastReadMessageIndex: number; + lastReadTimestamp: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ParticipantSolution { + chatServiceSid: string; + conversationSid: string; +} +export interface ParticipantListInstance { + _version: V1; + _solution: ParticipantSolution; + _uri: string; + (sid: string): ParticipantContext; + get(sid: string): ParticipantContext; + /** + * Create a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + create(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Create a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + create(params: ParticipantListInstanceCreateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Streams ParticipantInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + each(params: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Lists ParticipantInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + list(params: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + /** + * Retrieve a single page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + page(params: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ParticipantListInstance(version: V1, chatServiceSid: string, conversationSid: string): ParticipantListInstance; +export declare class ParticipantPage extends Page { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ParticipantSolution); + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ParticipantResource): ParticipantInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation/participant.js b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/participant.js new file mode 100644 index 00000000..12a00863 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/participant.js @@ -0,0 +1,320 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParticipantPage = exports.ParticipantListInstance = exports.ParticipantInstance = exports.ParticipantContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class ParticipantContextImpl { + constructor(_version, chatServiceSid, conversationSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { chatServiceSid, conversationSid, sid }; + this._uri = `/Services/${chatServiceSid}/Conversations/${conversationSid}/Participants/${sid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["messagingBinding.proxyAddress"] !== undefined) + data["MessagingBinding.ProxyAddress"] = + params["messagingBinding.proxyAddress"]; + if (params["messagingBinding.projectedAddress"] !== undefined) + data["MessagingBinding.ProjectedAddress"] = + params["messagingBinding.projectedAddress"]; + if (params["lastReadMessageIndex"] !== undefined) + data["LastReadMessageIndex"] = params["lastReadMessageIndex"]; + if (params["lastReadTimestamp"] !== undefined) + data["LastReadTimestamp"] = params["lastReadTimestamp"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantContextImpl = ParticipantContextImpl; +class ParticipantInstance { + constructor(_version, payload, chatServiceSid, conversationSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.conversationSid = payload.conversation_sid; + this.sid = payload.sid; + this.identity = payload.identity; + this.attributes = payload.attributes; + this.messagingBinding = payload.messaging_binding; + this.roleSid = payload.role_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.lastReadMessageIndex = deserialize.integer(payload.last_read_message_index); + this.lastReadTimestamp = payload.last_read_timestamp; + this._solution = { chatServiceSid, conversationSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ParticipantContextImpl(this._version, this._solution.chatServiceSid, this._solution.conversationSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + conversationSid: this.conversationSid, + sid: this.sid, + identity: this.identity, + attributes: this.attributes, + messagingBinding: this.messagingBinding, + roleSid: this.roleSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + lastReadMessageIndex: this.lastReadMessageIndex, + lastReadTimestamp: this.lastReadTimestamp, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantInstance = ParticipantInstance; +function ParticipantListInstance(version, chatServiceSid, conversationSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ParticipantContextImpl(version, chatServiceSid, conversationSid, sid); + }; + instance._version = version; + instance._solution = { chatServiceSid, conversationSid }; + instance._uri = `/Services/${chatServiceSid}/Conversations/${conversationSid}/Participants`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["messagingBinding.address"] !== undefined) + data["MessagingBinding.Address"] = params["messagingBinding.address"]; + if (params["messagingBinding.proxyAddress"] !== undefined) + data["MessagingBinding.ProxyAddress"] = + params["messagingBinding.proxyAddress"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["messagingBinding.projectedAddress"] !== undefined) + data["MessagingBinding.ProjectedAddress"] = + params["messagingBinding.projectedAddress"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ParticipantPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ParticipantListInstance = ParticipantListInstance; +class ParticipantPage extends Page_1.default { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ParticipantInstance(this._version, payload, this._solution.chatServiceSid, this._solution.conversationSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantPage = ParticipantPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation/webhook.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/webhook.d.ts new file mode 100644 index 00000000..0a63686f --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/webhook.d.ts @@ -0,0 +1,336 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type WebhookMethod = "GET" | "POST"; +export type WebhookTarget = "webhook" | "trigger" | "studio"; +/** + * Options to pass to update a WebhookInstance + */ +export interface WebhookContextUpdateOptions { + /** The absolute url the webhook request should be sent to. */ + "configuration.url"?: string; + /** */ + "configuration.method"?: WebhookMethod; + /** The list of events, firing webhook event for this Conversation. */ + "configuration.filters"?: Array; + /** The list of keywords, firing webhook event for this Conversation. */ + "configuration.triggers"?: Array; + /** The studio flow SID, where the webhook should be sent to. */ + "configuration.flowSid"?: string; +} +/** + * Options to pass to create a WebhookInstance + */ +export interface WebhookListInstanceCreateOptions { + /** */ + target: WebhookTarget; + /** The absolute url the webhook request should be sent to. */ + "configuration.url"?: string; + /** */ + "configuration.method"?: WebhookMethod; + /** The list of events, firing webhook event for this Conversation. */ + "configuration.filters"?: Array; + /** The list of keywords, firing webhook event for this Conversation. */ + "configuration.triggers"?: Array; + /** The studio flow SID, where the webhook should be sent to. */ + "configuration.flowSid"?: string; + /** The message index for which and it\\\'s successors the webhook will be replayed. Not set by default */ + "configuration.replayAfter"?: number; +} +/** + * Options to pass to each + */ +export interface WebhookListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WebhookInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WebhookListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WebhookListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WebhookContext { + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WebhookContextSolution { + chatServiceSid: string; + conversationSid: string; + sid: string; +} +export declare class WebhookContextImpl implements WebhookContext { + protected _version: V1; + protected _solution: WebhookContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string, conversationSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + update(params?: WebhookContextUpdateOptions | ((error: Error | null, item?: WebhookInstance) => any), callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WebhookContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WebhookPayload extends TwilioResponsePayload { + webhooks: WebhookResource[]; +} +interface WebhookResource { + sid: string; + account_sid: string; + chat_service_sid: string; + conversation_sid: string; + target: string; + url: string; + configuration: any; + date_created: Date; + date_updated: Date; +} +export declare class WebhookInstance { + protected _version: V1; + protected _solution: WebhookContextSolution; + protected _context?: WebhookContext; + constructor(_version: V1, payload: WebhookResource, chatServiceSid: string, conversationSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this resource. + */ + sid: string; + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. + */ + chatServiceSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook. + */ + conversationSid: string; + /** + * The target of this webhook: `webhook`, `studio`, `trigger` + */ + target: string; + /** + * An absolute API resource URL for this webhook. + */ + url: string; + /** + * The configuration of this webhook. Is defined based on target. + */ + configuration: any; + /** + * The date that this resource was created. + */ + dateCreated: Date; + /** + * The date that this resource was last updated. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + chatServiceSid: string; + conversationSid: string; + target: string; + url: string; + configuration: any; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WebhookSolution { + chatServiceSid: string; + conversationSid: string; +} +export interface WebhookListInstance { + _version: V1; + _solution: WebhookSolution; + _uri: string; + (sid: string): WebhookContext; + get(sid: string): WebhookContext; + /** + * Create a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + create(params: WebhookListInstanceCreateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Streams WebhookInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + each(params: WebhookListInstanceEachOptions, callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Lists WebhookInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + list(params: WebhookListInstanceOptions, callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + /** + * Retrieve a single page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WebhookPage) => any): Promise; + page(params: WebhookListInstancePageOptions, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebhookListInstance(version: V1, chatServiceSid: string, conversationSid: string): WebhookListInstance; +export declare class WebhookPage extends Page { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: WebhookSolution); + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WebhookResource): WebhookInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/conversation/webhook.js b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/webhook.js new file mode 100644 index 00000000..5305dc71 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/conversation/webhook.js @@ -0,0 +1,286 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebhookPage = exports.WebhookListInstance = exports.WebhookInstance = exports.WebhookContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WebhookContextImpl { + constructor(_version, chatServiceSid, conversationSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { chatServiceSid, conversationSid, sid }; + this._uri = `/Services/${chatServiceSid}/Conversations/${conversationSid}/Webhooks/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["configuration.url"] !== undefined) + data["Configuration.Url"] = params["configuration.url"]; + if (params["configuration.method"] !== undefined) + data["Configuration.Method"] = params["configuration.method"]; + if (params["configuration.filters"] !== undefined) + data["Configuration.Filters"] = serialize.map(params["configuration.filters"], (e) => e); + if (params["configuration.triggers"] !== undefined) + data["Configuration.Triggers"] = serialize.map(params["configuration.triggers"], (e) => e); + if (params["configuration.flowSid"] !== undefined) + data["Configuration.FlowSid"] = params["configuration.flowSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookContextImpl = WebhookContextImpl; +class WebhookInstance { + constructor(_version, payload, chatServiceSid, conversationSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.conversationSid = payload.conversation_sid; + this.target = payload.target; + this.url = payload.url; + this.configuration = payload.configuration; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { chatServiceSid, conversationSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WebhookContextImpl(this._version, this._solution.chatServiceSid, this._solution.conversationSid, this._solution.sid); + return this._context; + } + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + conversationSid: this.conversationSid, + target: this.target, + url: this.url, + configuration: this.configuration, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookInstance = WebhookInstance; +function WebhookListInstance(version, chatServiceSid, conversationSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WebhookContextImpl(version, chatServiceSid, conversationSid, sid); + }; + instance._version = version; + instance._solution = { chatServiceSid, conversationSid }; + instance._uri = `/Services/${chatServiceSid}/Conversations/${conversationSid}/Webhooks`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["target"] === null || params["target"] === undefined) { + throw new Error("Required parameter \"params['target']\" missing."); + } + let data = {}; + data["Target"] = params["target"]; + if (params["configuration.url"] !== undefined) + data["Configuration.Url"] = params["configuration.url"]; + if (params["configuration.method"] !== undefined) + data["Configuration.Method"] = params["configuration.method"]; + if (params["configuration.filters"] !== undefined) + data["Configuration.Filters"] = serialize.map(params["configuration.filters"], (e) => e); + if (params["configuration.triggers"] !== undefined) + data["Configuration.Triggers"] = serialize.map(params["configuration.triggers"], (e) => e); + if (params["configuration.flowSid"] !== undefined) + data["Configuration.FlowSid"] = params["configuration.flowSid"]; + if (params["configuration.replayAfter"] !== undefined) + data["Configuration.ReplayAfter"] = params["configuration.replayAfter"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WebhookPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebhookListInstance = WebhookListInstance; +class WebhookPage extends Page_1.default { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WebhookInstance(this._version, payload, this._solution.chatServiceSid, this._solution.conversationSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookPage = WebhookPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/participantConversation.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/participantConversation.d.ts new file mode 100644 index 00000000..da7a78cd --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/participantConversation.d.ts @@ -0,0 +1,243 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type ParticipantConversationState = "inactive" | "active" | "closed"; +/** + * Options to pass to each + */ +export interface ParticipantConversationListInstanceEachOptions { + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */ + identity?: string; + /** A unique string identifier for the conversation participant who\'s not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. */ + address?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ParticipantConversationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ParticipantConversationListInstanceOptions { + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */ + identity?: string; + /** A unique string identifier for the conversation participant who\'s not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. */ + address?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ParticipantConversationListInstancePageOptions { + /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */ + identity?: string; + /** A unique string identifier for the conversation participant who\'s not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. */ + address?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ParticipantConversationSolution { + chatServiceSid: string; +} +export interface ParticipantConversationListInstance { + _version: V1; + _solution: ParticipantConversationSolution; + _uri: string; + /** + * Streams ParticipantConversationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantConversationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ParticipantConversationInstance, done: (err?: Error) => void) => void): void; + each(params: ParticipantConversationListInstanceEachOptions, callback?: (item: ParticipantConversationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ParticipantConversationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantConversationPage) => any): Promise; + /** + * Lists ParticipantConversationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantConversationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ParticipantConversationInstance[]) => any): Promise; + list(params: ParticipantConversationListInstanceOptions, callback?: (error: Error | null, items: ParticipantConversationInstance[]) => any): Promise; + /** + * Retrieve a single page of ParticipantConversationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantConversationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ParticipantConversationPage) => any): Promise; + page(params: ParticipantConversationListInstancePageOptions, callback?: (error: Error | null, items: ParticipantConversationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ParticipantConversationListInstance(version: V1, chatServiceSid: string): ParticipantConversationListInstance; +interface ParticipantConversationPayload extends TwilioResponsePayload { + conversations: ParticipantConversationResource[]; +} +interface ParticipantConversationResource { + account_sid: string; + chat_service_sid: string; + participant_sid: string; + participant_user_sid: string; + participant_identity: string; + participant_messaging_binding: any; + conversation_sid: string; + conversation_unique_name: string; + conversation_friendly_name: string; + conversation_attributes: string; + conversation_date_created: Date; + conversation_date_updated: Date; + conversation_created_by: string; + conversation_state: ParticipantConversationState; + conversation_timers: any; + links: Record; +} +export declare class ParticipantConversationInstance { + protected _version: V1; + constructor(_version: V1, payload: ParticipantConversationResource, chatServiceSid: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + /** + * The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + */ + chatServiceSid: string; + /** + * The unique ID of the [Participant](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). + */ + participantSid: string; + /** + * The unique string that identifies the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). + */ + participantUserSid: string; + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + */ + participantIdentity: string; + /** + * Information about how this participant exchanges messages with the conversation. A JSON parameter consisting of type and address fields of the participant. + */ + participantMessagingBinding: any; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) this Participant belongs to. + */ + conversationSid: string; + /** + * An application-defined string that uniquely identifies the Conversation resource. + */ + conversationUniqueName: string; + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + */ + conversationFriendlyName: string; + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + conversationAttributes: string; + /** + * The date that this conversation was created, given in ISO 8601 format. + */ + conversationDateCreated: Date; + /** + * The date that this conversation was last updated, given in ISO 8601 format. + */ + conversationDateUpdated: Date; + /** + * Identity of the creator of this Conversation. + */ + conversationCreatedBy: string; + conversationState: ParticipantConversationState; + /** + * Timer date values representing state update for this conversation. + */ + conversationTimers: any; + /** + * Contains absolute URLs to access the [participant](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) and [conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) of this conversation. + */ + links: Record; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + participantSid: string; + participantUserSid: string; + participantIdentity: string; + participantMessagingBinding: any; + conversationSid: string; + conversationUniqueName: string; + conversationFriendlyName: string; + conversationAttributes: string; + conversationDateCreated: Date; + conversationDateUpdated: Date; + conversationCreatedBy: string; + conversationState: ParticipantConversationState; + conversationTimers: any; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class ParticipantConversationPage extends Page { + /** + * Initialize the ParticipantConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ParticipantConversationSolution); + /** + * Build an instance of ParticipantConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ParticipantConversationResource): ParticipantConversationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/participantConversation.js b/node_modules/twilio/lib/rest/conversations/v1/service/participantConversation.js new file mode 100644 index 00000000..47272b8b --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/participantConversation.js @@ -0,0 +1,156 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParticipantConversationPage = exports.ParticipantConversationInstance = exports.ParticipantConversationListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function ParticipantConversationListInstance(version, chatServiceSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { chatServiceSid }; + instance._uri = `/Services/${chatServiceSid}/ParticipantConversations`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["address"] !== undefined) + data["Address"] = params["address"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantConversationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ParticipantConversationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ParticipantConversationListInstance = ParticipantConversationListInstance; +class ParticipantConversationInstance { + constructor(_version, payload, chatServiceSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.participantSid = payload.participant_sid; + this.participantUserSid = payload.participant_user_sid; + this.participantIdentity = payload.participant_identity; + this.participantMessagingBinding = payload.participant_messaging_binding; + this.conversationSid = payload.conversation_sid; + this.conversationUniqueName = payload.conversation_unique_name; + this.conversationFriendlyName = payload.conversation_friendly_name; + this.conversationAttributes = payload.conversation_attributes; + this.conversationDateCreated = deserialize.iso8601DateTime(payload.conversation_date_created); + this.conversationDateUpdated = deserialize.iso8601DateTime(payload.conversation_date_updated); + this.conversationCreatedBy = payload.conversation_created_by; + this.conversationState = payload.conversation_state; + this.conversationTimers = payload.conversation_timers; + this.links = payload.links; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + participantSid: this.participantSid, + participantUserSid: this.participantUserSid, + participantIdentity: this.participantIdentity, + participantMessagingBinding: this.participantMessagingBinding, + conversationSid: this.conversationSid, + conversationUniqueName: this.conversationUniqueName, + conversationFriendlyName: this.conversationFriendlyName, + conversationAttributes: this.conversationAttributes, + conversationDateCreated: this.conversationDateCreated, + conversationDateUpdated: this.conversationDateUpdated, + conversationCreatedBy: this.conversationCreatedBy, + conversationState: this.conversationState, + conversationTimers: this.conversationTimers, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantConversationInstance = ParticipantConversationInstance; +class ParticipantConversationPage extends Page_1.default { + /** + * Initialize the ParticipantConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ParticipantConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ParticipantConversationInstance(this._version, payload, this._solution.chatServiceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantConversationPage = ParticipantConversationPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/role.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/role.d.ts new file mode 100644 index 00000000..dae38ade --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/role.d.ts @@ -0,0 +1,298 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type RoleRoleType = "conversation" | "service"; +/** + * Options to pass to update a RoleInstance + */ +export interface RoleContextUpdateOptions { + /** A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role\\\'s `type`. */ + permission: Array; +} +/** + * Options to pass to create a RoleInstance + */ +export interface RoleListInstanceCreateOptions { + /** A descriptive string that you create to describe the new resource. It can be up to 64 characters long. */ + friendlyName: string; + /** */ + type: RoleRoleType; + /** A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role\\\'s `type`. */ + permission: Array; +} +/** + * Options to pass to each + */ +export interface RoleListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoleInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoleListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoleListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoleContext { + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoleContextSolution { + chatServiceSid: string; + sid: string; +} +export declare class RoleContextImpl implements RoleContext { + protected _version: V1; + protected _solution: RoleContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoleContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RolePayload extends TwilioResponsePayload { + roles: RoleResource[]; +} +interface RoleResource { + sid: string; + account_sid: string; + chat_service_sid: string; + friendly_name: string; + type: RoleRoleType; + permissions: Array; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class RoleInstance { + protected _version: V1; + protected _solution: RoleContextSolution; + protected _context?: RoleContext; + constructor(_version: V1, payload: RoleResource, chatServiceSid: string, sid?: string); + /** + * The unique string that we created to identify the Role resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Role resource. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Role resource is associated with. + */ + chatServiceSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + type: RoleRoleType; + /** + * An array of the permissions the role has been granted. + */ + permissions: Array; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this user role. + */ + url: string; + private get _proxy(); + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + chatServiceSid: string; + friendlyName: string; + type: RoleRoleType; + permissions: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoleSolution { + chatServiceSid: string; +} +export interface RoleListInstance { + _version: V1; + _solution: RoleSolution; + _uri: string; + (sid: string): RoleContext; + get(sid: string): RoleContext; + /** + * Create a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + create(params: RoleListInstanceCreateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Streams RoleInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + each(params: RoleListInstanceEachOptions, callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Lists RoleInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + list(params: RoleListInstanceOptions, callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + /** + * Retrieve a single page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RolePage) => any): Promise; + page(params: RoleListInstancePageOptions, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoleListInstance(version: V1, chatServiceSid: string): RoleListInstance; +export declare class RolePage extends Page { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RoleSolution); + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoleResource): RoleInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/role.js b/node_modules/twilio/lib/rest/conversations/v1/service/role.js new file mode 100644 index 00000000..b4195fb9 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/role.js @@ -0,0 +1,267 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RolePage = exports.RoleListInstance = exports.RoleInstance = exports.RoleContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class RoleContextImpl { + constructor(_version, chatServiceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { chatServiceSid, sid }; + this._uri = `/Services/${chatServiceSid}/Roles/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleContextImpl = RoleContextImpl; +class RoleInstance { + constructor(_version, payload, chatServiceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.permissions = payload.permissions; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { chatServiceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RoleContextImpl(this._version, this._solution.chatServiceSid, this._solution.sid); + return this._context; + } + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + friendlyName: this.friendlyName, + type: this.type, + permissions: this.permissions, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleInstance = RoleInstance; +function RoleListInstance(version, chatServiceSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RoleContextImpl(version, chatServiceSid, sid); + }; + instance._version = version; + instance._solution = { chatServiceSid }; + instance._uri = `/Services/${chatServiceSid}/Roles`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RolePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RolePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoleListInstance = RoleListInstance; +class RolePage extends Page_1.default { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoleInstance(this._version, payload, this._solution.chatServiceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RolePage = RolePage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/user.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/user.d.ts new file mode 100644 index 00000000..7a11ae1b --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/user.d.ts @@ -0,0 +1,381 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { UserConversationListInstance } from "./user/userConversation"; +export type UserWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a UserInstance + */ +export interface UserContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; +} +/** + * Options to pass to update a UserInstance + */ +export interface UserContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. */ + attributes?: string; + /** The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. */ + roleSid?: string; +} +/** + * Options to pass to create a UserInstance + */ +export interface UserListInstanceCreateOptions { + /** The application-defined string that uniquely identifies the resource\\\'s User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. */ + identity: string; + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. */ + attributes?: string; + /** The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface UserListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserContext { + userConversations: UserConversationListInstance; + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + remove(params: UserContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserContextSolution { + chatServiceSid: string; + sid: string; +} +export declare class UserContextImpl implements UserContext { + protected _version: V1; + protected _solution: UserContextSolution; + protected _uri: string; + protected _userConversations?: UserConversationListInstance; + constructor(_version: V1, chatServiceSid: string, sid: string); + get userConversations(): UserConversationListInstance; + remove(params?: UserContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + update(params?: UserContextUpdateOptions | ((error: Error | null, item?: UserInstance) => any), callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserPayload extends TwilioResponsePayload { + users: UserResource[]; +} +interface UserResource { + sid: string; + account_sid: string; + chat_service_sid: string; + role_sid: string; + identity: string; + friendly_name: string; + attributes: string; + is_online: boolean; + is_notifiable: boolean; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class UserInstance { + protected _version: V1; + protected _solution: UserContextSolution; + protected _context?: UserContext; + constructor(_version: V1, payload: UserResource, chatServiceSid: string, sid?: string); + /** + * The unique string that we created to identify the User resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the User resource. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the User resource is associated with. + */ + chatServiceSid: string; + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) assigned to the user. + */ + roleSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. + */ + identity: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + */ + attributes: string; + /** + * Whether the User is actively connected to this Conversations Service and online. This value is only returned by Fetch actions that return a single resource and `null` is always returned by a Read action. This value is `null` if the Service\'s `reachability_enabled` is `false`, if the User has never been online for this Conversations Service, even if the Service\'s `reachability_enabled` is `true`. + */ + isOnline: boolean; + /** + * Whether the User has a potentially valid Push Notification registration (APN or GCM) for this Conversations Service. If at least one registration exists, `true`; otherwise `false`. This value is only returned by Fetch actions that return a single resource and `null` is always returned by a Read action. This value is `null` if the Service\'s `reachability_enabled` is `false`, and if the User has never had a notification registration, even if the Service\'s `reachability_enabled` is `true`. + */ + isNotifiable: boolean; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this user. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + remove(params: UserContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Access the userConversations. + */ + userConversations(): UserConversationListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + chatServiceSid: string; + roleSid: string; + identity: string; + friendlyName: string; + attributes: string; + isOnline: boolean; + isNotifiable: boolean; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserSolution { + chatServiceSid: string; +} +export interface UserListInstance { + _version: V1; + _solution: UserSolution; + _uri: string; + (sid: string): UserContext; + get(sid: string): UserContext; + /** + * Create a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + create(params: UserListInstanceCreateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Streams UserInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + each(params: UserListInstanceEachOptions, callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Lists UserInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + list(params: UserListInstanceOptions, callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + /** + * Retrieve a single page of UserInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserPage) => any): Promise; + page(params: UserListInstancePageOptions, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserListInstance(version: V1, chatServiceSid: string): UserListInstance; +export declare class UserPage extends Page { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UserSolution); + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserResource): UserInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/user.js b/node_modules/twilio/lib/rest/conversations/v1/service/user.js new file mode 100644 index 00000000..de7a1e52 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/user.js @@ -0,0 +1,301 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserPage = exports.UserListInstance = exports.UserInstance = exports.UserContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const userConversation_1 = require("./user/userConversation"); +class UserContextImpl { + constructor(_version, chatServiceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { chatServiceSid, sid }; + this._uri = `/Services/${chatServiceSid}/Users/${sid}`; + } + get userConversations() { + this._userConversations = + this._userConversations || + (0, userConversation_1.UserConversationListInstance)(this._version, this._solution.chatServiceSid, this._solution.sid); + return this._userConversations; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserContextImpl = UserContextImpl; +class UserInstance { + constructor(_version, payload, chatServiceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.roleSid = payload.role_sid; + this.identity = payload.identity; + this.friendlyName = payload.friendly_name; + this.attributes = payload.attributes; + this.isOnline = payload.is_online; + this.isNotifiable = payload.is_notifiable; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { chatServiceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UserContextImpl(this._version, this._solution.chatServiceSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the userConversations. + */ + userConversations() { + return this._proxy.userConversations; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + roleSid: this.roleSid, + identity: this.identity, + friendlyName: this.friendlyName, + attributes: this.attributes, + isOnline: this.isOnline, + isNotifiable: this.isNotifiable, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserInstance = UserInstance; +function UserListInstance(version, chatServiceSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserContextImpl(version, chatServiceSid, sid); + }; + instance._version = version; + instance._solution = { chatServiceSid }; + instance._uri = `/Services/${chatServiceSid}/Users`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.chatServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserListInstance = UserListInstance; +class UserPage extends Page_1.default { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserInstance(this._version, payload, this._solution.chatServiceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserPage = UserPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/user/userConversation.d.ts b/node_modules/twilio/lib/rest/conversations/v1/service/user/userConversation.d.ts new file mode 100644 index 00000000..150d4221 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/user/userConversation.d.ts @@ -0,0 +1,349 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type UserConversationNotificationLevel = "default" | "muted"; +export type UserConversationState = "inactive" | "active" | "closed"; +/** + * Options to pass to update a UserConversationInstance + */ +export interface UserConversationContextUpdateOptions { + /** */ + notificationLevel?: UserConversationNotificationLevel; + /** The date of the last message read in conversation by the user, given in ISO 8601 format. */ + lastReadTimestamp?: Date; + /** The index of the last Message in the Conversation that the Participant has read. */ + lastReadMessageIndex?: number; +} +/** + * Options to pass to each + */ +export interface UserConversationListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserConversationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserConversationListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserConversationListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserConversationContext { + /** + * Remove a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + fetch(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Update a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + update(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Update a UserConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + update(params: UserConversationContextUpdateOptions, callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserConversationContextSolution { + chatServiceSid: string; + userSid: string; + conversationSid: string; +} +export declare class UserConversationContextImpl implements UserConversationContext { + protected _version: V1; + protected _solution: UserConversationContextSolution; + protected _uri: string; + constructor(_version: V1, chatServiceSid: string, userSid: string, conversationSid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + update(params?: UserConversationContextUpdateOptions | ((error: Error | null, item?: UserConversationInstance) => any), callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserConversationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserConversationPayload extends TwilioResponsePayload { + conversations: UserConversationResource[]; +} +interface UserConversationResource { + account_sid: string; + chat_service_sid: string; + conversation_sid: string; + unread_messages_count: number; + last_read_message_index: number; + participant_sid: string; + user_sid: string; + friendly_name: string; + conversation_state: UserConversationState; + timers: any; + attributes: string; + date_created: Date; + date_updated: Date; + created_by: string; + notification_level: UserConversationNotificationLevel; + unique_name: string; + url: string; + links: Record; +} +export declare class UserConversationInstance { + protected _version: V1; + protected _solution: UserConversationContextSolution; + protected _context?: UserConversationContext; + constructor(_version: V1, payload: UserConversationResource, chatServiceSid: string, userSid: string, conversationSid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + /** + * The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + */ + chatServiceSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this User Conversation. + */ + conversationSid: string; + /** + * The number of unread Messages in the Conversation for the Participant. + */ + unreadMessagesCount: number; + /** + * The index of the last Message in the Conversation that the Participant has read. + */ + lastReadMessageIndex: number; + /** + * The unique ID of the [participant](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) the user conversation belongs to. + */ + participantSid: string; + /** + * The unique string that identifies the [User resource](https://www.twilio.com/docs/conversations/api/user-resource). + */ + userSid: string; + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + */ + friendlyName: string; + conversationState: UserConversationState; + /** + * Timer date values representing state update for this conversation. + */ + timers: any; + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + attributes: string; + /** + * The date that this conversation was created, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that this conversation was last updated, given in ISO 8601 format. + */ + dateUpdated: Date; + /** + * Identity of the creator of this Conversation. + */ + createdBy: string; + notificationLevel: UserConversationNotificationLevel; + /** + * An application-defined string that uniquely identifies the Conversation resource. It can be used to address the resource in place of the resource\'s `conversation_sid` in the URL. + */ + uniqueName: string; + url: string; + /** + * Contains absolute URLs to access the [participant](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) and [conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) of this conversation. + */ + links: Record; + private get _proxy(); + /** + * Remove a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + fetch(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Update a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + update(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Update a UserConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + update(params: UserConversationContextUpdateOptions, callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + conversationSid: string; + unreadMessagesCount: number; + lastReadMessageIndex: number; + participantSid: string; + userSid: string; + friendlyName: string; + conversationState: UserConversationState; + timers: any; + attributes: string; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + notificationLevel: UserConversationNotificationLevel; + uniqueName: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserConversationSolution { + chatServiceSid: string; + userSid: string; +} +export interface UserConversationListInstance { + _version: V1; + _solution: UserConversationSolution; + _uri: string; + (conversationSid: string): UserConversationContext; + get(conversationSid: string): UserConversationContext; + /** + * Streams UserConversationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserConversationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserConversationInstance, done: (err?: Error) => void) => void): void; + each(params: UserConversationListInstanceEachOptions, callback?: (item: UserConversationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserConversationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserConversationPage) => any): Promise; + /** + * Lists UserConversationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserConversationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserConversationInstance[]) => any): Promise; + list(params: UserConversationListInstanceOptions, callback?: (error: Error | null, items: UserConversationInstance[]) => any): Promise; + /** + * Retrieve a single page of UserConversationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserConversationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserConversationPage) => any): Promise; + page(params: UserConversationListInstancePageOptions, callback?: (error: Error | null, items: UserConversationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserConversationListInstance(version: V1, chatServiceSid: string, userSid: string): UserConversationListInstance; +export declare class UserConversationPage extends Page { + /** + * Initialize the UserConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UserConversationSolution); + /** + * Build an instance of UserConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserConversationResource): UserConversationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/service/user/userConversation.js b/node_modules/twilio/lib/rest/conversations/v1/service/user/userConversation.js new file mode 100644 index 00000000..1332c5d3 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/service/user/userConversation.js @@ -0,0 +1,271 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserConversationPage = exports.UserConversationListInstance = exports.UserConversationInstance = exports.UserConversationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class UserConversationContextImpl { + constructor(_version, chatServiceSid, userSid, conversationSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + this._solution = { chatServiceSid, userSid, conversationSid }; + this._uri = `/Services/${chatServiceSid}/Users/${userSid}/Conversations/${conversationSid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserConversationInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.userSid, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["notificationLevel"] !== undefined) + data["NotificationLevel"] = params["notificationLevel"]; + if (params["lastReadTimestamp"] !== undefined) + data["LastReadTimestamp"] = serialize.iso8601DateTime(params["lastReadTimestamp"]); + if (params["lastReadMessageIndex"] !== undefined) + data["LastReadMessageIndex"] = params["lastReadMessageIndex"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserConversationInstance(operationVersion, payload, instance._solution.chatServiceSid, instance._solution.userSid, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserConversationContextImpl = UserConversationContextImpl; +class UserConversationInstance { + constructor(_version, payload, chatServiceSid, userSid, conversationSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.conversationSid = payload.conversation_sid; + this.unreadMessagesCount = deserialize.integer(payload.unread_messages_count); + this.lastReadMessageIndex = deserialize.integer(payload.last_read_message_index); + this.participantSid = payload.participant_sid; + this.userSid = payload.user_sid; + this.friendlyName = payload.friendly_name; + this.conversationState = payload.conversation_state; + this.timers = payload.timers; + this.attributes = payload.attributes; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this.notificationLevel = payload.notification_level; + this.uniqueName = payload.unique_name; + this.url = payload.url; + this.links = payload.links; + this._solution = { + chatServiceSid, + userSid, + conversationSid: conversationSid || this.conversationSid, + }; + } + get _proxy() { + this._context = + this._context || + new UserConversationContextImpl(this._version, this._solution.chatServiceSid, this._solution.userSid, this._solution.conversationSid); + return this._context; + } + /** + * Remove a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + conversationSid: this.conversationSid, + unreadMessagesCount: this.unreadMessagesCount, + lastReadMessageIndex: this.lastReadMessageIndex, + participantSid: this.participantSid, + userSid: this.userSid, + friendlyName: this.friendlyName, + conversationState: this.conversationState, + timers: this.timers, + attributes: this.attributes, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + notificationLevel: this.notificationLevel, + uniqueName: this.uniqueName, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserConversationInstance = UserConversationInstance; +function UserConversationListInstance(version, chatServiceSid, userSid) { + if (!(0, utility_1.isValidPathParam)(chatServiceSid)) { + throw new Error("Parameter 'chatServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + const instance = ((conversationSid) => instance.get(conversationSid)); + instance.get = function get(conversationSid) { + return new UserConversationContextImpl(version, chatServiceSid, userSid, conversationSid); + }; + instance._version = version; + instance._solution = { chatServiceSid, userSid }; + instance._uri = `/Services/${chatServiceSid}/Users/${userSid}/Conversations`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserConversationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserConversationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserConversationListInstance = UserConversationListInstance; +class UserConversationPage extends Page_1.default { + /** + * Initialize the UserConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserConversationInstance(this._version, payload, this._solution.chatServiceSid, this._solution.userSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserConversationPage = UserConversationPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/user.d.ts b/node_modules/twilio/lib/rest/conversations/v1/user.d.ts new file mode 100644 index 00000000..468229d4 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/user.d.ts @@ -0,0 +1,379 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { UserConversationListInstance } from "./user/userConversation"; +export type UserWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a UserInstance + */ +export interface UserContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; +} +/** + * Options to pass to update a UserInstance + */ +export interface UserContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. */ + attributes?: string; + /** The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. */ + roleSid?: string; +} +/** + * Options to pass to create a UserInstance + */ +export interface UserListInstanceCreateOptions { + /** The application-defined string that uniquely identifies the resource\\\'s User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. */ + identity: string; + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. */ + attributes?: string; + /** The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface UserListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserContext { + userConversations: UserConversationListInstance; + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + remove(params: UserContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserContextSolution { + sid: string; +} +export declare class UserContextImpl implements UserContext { + protected _version: V1; + protected _solution: UserContextSolution; + protected _uri: string; + protected _userConversations?: UserConversationListInstance; + constructor(_version: V1, sid: string); + get userConversations(): UserConversationListInstance; + remove(params?: UserContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + update(params?: UserContextUpdateOptions | ((error: Error | null, item?: UserInstance) => any), callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserPayload extends TwilioResponsePayload { + users: UserResource[]; +} +interface UserResource { + sid: string; + account_sid: string; + chat_service_sid: string; + role_sid: string; + identity: string; + friendly_name: string; + attributes: string; + is_online: boolean; + is_notifiable: boolean; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class UserInstance { + protected _version: V1; + protected _solution: UserContextSolution; + protected _context?: UserContext; + constructor(_version: V1, payload: UserResource, sid?: string); + /** + * The unique string that we created to identify the User resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the User resource. + */ + accountSid: string; + /** + * The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the User resource is associated with. + */ + chatServiceSid: string; + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) assigned to the user. + */ + roleSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. + */ + identity: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + */ + attributes: string; + /** + * Whether the User is actively connected to this Conversations Service and online. This value is only returned by Fetch actions that return a single resource and `null` is always returned by a Read action. This value is `null` if the Service\'s `reachability_enabled` is `false`, if the User has never been online for this Conversations Service, even if the Service\'s `reachability_enabled` is `true`. + */ + isOnline: boolean; + /** + * Whether the User has a potentially valid Push Notification registration (APN or GCM) for this Conversations Service. If at least one registration exists, `true`; otherwise `false`. This value is only returned by Fetch actions that return a single resource and `null` is always returned by a Read action. This value is `null` if the Service\'s `reachability_enabled` is `false`, and if the User has never had a notification registration, even if the Service\'s `reachability_enabled` is `true`. + */ + isNotifiable: boolean; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * An absolute API resource URL for this user. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + remove(params: UserContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Access the userConversations. + */ + userConversations(): UserConversationListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + chatServiceSid: string; + roleSid: string; + identity: string; + friendlyName: string; + attributes: string; + isOnline: boolean; + isNotifiable: boolean; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserSolution { +} +export interface UserListInstance { + _version: V1; + _solution: UserSolution; + _uri: string; + (sid: string): UserContext; + get(sid: string): UserContext; + /** + * Create a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + create(params: UserListInstanceCreateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Streams UserInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + each(params: UserListInstanceEachOptions, callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Lists UserInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + list(params: UserListInstanceOptions, callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + /** + * Retrieve a single page of UserInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserPage) => any): Promise; + page(params: UserListInstancePageOptions, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserListInstance(version: V1): UserListInstance; +export declare class UserPage extends Page { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UserSolution); + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserResource): UserInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/user.js b/node_modules/twilio/lib/rest/conversations/v1/user.js new file mode 100644 index 00000000..c7eebadf --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/user.js @@ -0,0 +1,294 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserPage = exports.UserListInstance = exports.UserInstance = exports.UserContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const userConversation_1 = require("./user/userConversation"); +class UserContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Users/${sid}`; + } + get userConversations() { + this._userConversations = + this._userConversations || + (0, userConversation_1.UserConversationListInstance)(this._version, this._solution.sid); + return this._userConversations; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserContextImpl = UserContextImpl; +class UserInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.roleSid = payload.role_sid; + this.identity = payload.identity; + this.friendlyName = payload.friendly_name; + this.attributes = payload.attributes; + this.isOnline = payload.is_online; + this.isNotifiable = payload.is_notifiable; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new UserContextImpl(this._version, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the userConversations. + */ + userConversations() { + return this._proxy.userConversations; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + roleSid: this.roleSid, + identity: this.identity, + friendlyName: this.friendlyName, + attributes: this.attributes, + isOnline: this.isOnline, + isNotifiable: this.isNotifiable, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserInstance = UserInstance; +function UserListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Users`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserListInstance = UserListInstance; +class UserPage extends Page_1.default { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserPage = UserPage; diff --git a/node_modules/twilio/lib/rest/conversations/v1/user/userConversation.d.ts b/node_modules/twilio/lib/rest/conversations/v1/user/userConversation.d.ts new file mode 100644 index 00000000..3bfbe889 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/user/userConversation.d.ts @@ -0,0 +1,347 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type UserConversationNotificationLevel = "default" | "muted"; +export type UserConversationState = "inactive" | "active" | "closed"; +/** + * Options to pass to update a UserConversationInstance + */ +export interface UserConversationContextUpdateOptions { + /** */ + notificationLevel?: UserConversationNotificationLevel; + /** The date of the last message read in conversation by the user, given in ISO 8601 format. */ + lastReadTimestamp?: Date; + /** The index of the last Message in the Conversation that the Participant has read. */ + lastReadMessageIndex?: number; +} +/** + * Options to pass to each + */ +export interface UserConversationListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserConversationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserConversationListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserConversationListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserConversationContext { + /** + * Remove a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + fetch(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Update a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + update(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Update a UserConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + update(params: UserConversationContextUpdateOptions, callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserConversationContextSolution { + userSid: string; + conversationSid: string; +} +export declare class UserConversationContextImpl implements UserConversationContext { + protected _version: V1; + protected _solution: UserConversationContextSolution; + protected _uri: string; + constructor(_version: V1, userSid: string, conversationSid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + update(params?: UserConversationContextUpdateOptions | ((error: Error | null, item?: UserConversationInstance) => any), callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserConversationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserConversationPayload extends TwilioResponsePayload { + conversations: UserConversationResource[]; +} +interface UserConversationResource { + account_sid: string; + chat_service_sid: string; + conversation_sid: string; + unread_messages_count: number; + last_read_message_index: number; + participant_sid: string; + user_sid: string; + friendly_name: string; + conversation_state: UserConversationState; + timers: any; + attributes: string; + date_created: Date; + date_updated: Date; + created_by: string; + notification_level: UserConversationNotificationLevel; + unique_name: string; + url: string; + links: Record; +} +export declare class UserConversationInstance { + protected _version: V1; + protected _solution: UserConversationContextSolution; + protected _context?: UserConversationContext; + constructor(_version: V1, payload: UserConversationResource, userSid: string, conversationSid?: string); + /** + * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + */ + accountSid: string; + /** + * The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + */ + chatServiceSid: string; + /** + * The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this User Conversation. + */ + conversationSid: string; + /** + * The number of unread Messages in the Conversation for the Participant. + */ + unreadMessagesCount: number; + /** + * The index of the last Message in the Conversation that the Participant has read. + */ + lastReadMessageIndex: number; + /** + * The unique ID of the [participant](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) the user conversation belongs to. + */ + participantSid: string; + /** + * The unique string that identifies the [User resource](https://www.twilio.com/docs/conversations/api/user-resource). + */ + userSid: string; + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + */ + friendlyName: string; + conversationState: UserConversationState; + /** + * Timer date values representing state update for this conversation. + */ + timers: any; + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + */ + attributes: string; + /** + * The date that this conversation was created, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that this conversation was last updated, given in ISO 8601 format. + */ + dateUpdated: Date; + /** + * Identity of the creator of this Conversation. + */ + createdBy: string; + notificationLevel: UserConversationNotificationLevel; + /** + * An application-defined string that uniquely identifies the Conversation resource. It can be used to address the resource in place of the resource\'s `conversation_sid` in the URL. + */ + uniqueName: string; + url: string; + /** + * Contains absolute URLs to access the [participant](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) and [conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) of this conversation. + */ + links: Record; + private get _proxy(); + /** + * Remove a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + fetch(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Update a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + update(callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Update a UserConversationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + update(params: UserConversationContextUpdateOptions, callback?: (error: Error | null, item?: UserConversationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + chatServiceSid: string; + conversationSid: string; + unreadMessagesCount: number; + lastReadMessageIndex: number; + participantSid: string; + userSid: string; + friendlyName: string; + conversationState: UserConversationState; + timers: any; + attributes: string; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + notificationLevel: UserConversationNotificationLevel; + uniqueName: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserConversationSolution { + userSid: string; +} +export interface UserConversationListInstance { + _version: V1; + _solution: UserConversationSolution; + _uri: string; + (conversationSid: string): UserConversationContext; + get(conversationSid: string): UserConversationContext; + /** + * Streams UserConversationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserConversationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserConversationInstance, done: (err?: Error) => void) => void): void; + each(params: UserConversationListInstanceEachOptions, callback?: (item: UserConversationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserConversationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserConversationPage) => any): Promise; + /** + * Lists UserConversationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserConversationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserConversationInstance[]) => any): Promise; + list(params: UserConversationListInstanceOptions, callback?: (error: Error | null, items: UserConversationInstance[]) => any): Promise; + /** + * Retrieve a single page of UserConversationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserConversationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserConversationPage) => any): Promise; + page(params: UserConversationListInstancePageOptions, callback?: (error: Error | null, items: UserConversationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserConversationListInstance(version: V1, userSid: string): UserConversationListInstance; +export declare class UserConversationPage extends Page { + /** + * Initialize the UserConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UserConversationSolution); + /** + * Build an instance of UserConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserConversationResource): UserConversationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/conversations/v1/user/userConversation.js b/node_modules/twilio/lib/rest/conversations/v1/user/userConversation.js new file mode 100644 index 00000000..4031a232 --- /dev/null +++ b/node_modules/twilio/lib/rest/conversations/v1/user/userConversation.js @@ -0,0 +1,264 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Conversations + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserConversationPage = exports.UserConversationListInstance = exports.UserConversationInstance = exports.UserConversationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class UserConversationContextImpl { + constructor(_version, userSid, conversationSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(conversationSid)) { + throw new Error("Parameter 'conversationSid' is not valid."); + } + this._solution = { userSid, conversationSid }; + this._uri = `/Users/${userSid}/Conversations/${conversationSid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserConversationInstance(operationVersion, payload, instance._solution.userSid, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["notificationLevel"] !== undefined) + data["NotificationLevel"] = params["notificationLevel"]; + if (params["lastReadTimestamp"] !== undefined) + data["LastReadTimestamp"] = serialize.iso8601DateTime(params["lastReadTimestamp"]); + if (params["lastReadMessageIndex"] !== undefined) + data["LastReadMessageIndex"] = params["lastReadMessageIndex"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserConversationInstance(operationVersion, payload, instance._solution.userSid, instance._solution.conversationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserConversationContextImpl = UserConversationContextImpl; +class UserConversationInstance { + constructor(_version, payload, userSid, conversationSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.chatServiceSid = payload.chat_service_sid; + this.conversationSid = payload.conversation_sid; + this.unreadMessagesCount = deserialize.integer(payload.unread_messages_count); + this.lastReadMessageIndex = deserialize.integer(payload.last_read_message_index); + this.participantSid = payload.participant_sid; + this.userSid = payload.user_sid; + this.friendlyName = payload.friendly_name; + this.conversationState = payload.conversation_state; + this.timers = payload.timers; + this.attributes = payload.attributes; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this.notificationLevel = payload.notification_level; + this.uniqueName = payload.unique_name; + this.url = payload.url; + this.links = payload.links; + this._solution = { + userSid, + conversationSid: conversationSid || this.conversationSid, + }; + } + get _proxy() { + this._context = + this._context || + new UserConversationContextImpl(this._version, this._solution.userSid, this._solution.conversationSid); + return this._context; + } + /** + * Remove a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserConversationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserConversationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + chatServiceSid: this.chatServiceSid, + conversationSid: this.conversationSid, + unreadMessagesCount: this.unreadMessagesCount, + lastReadMessageIndex: this.lastReadMessageIndex, + participantSid: this.participantSid, + userSid: this.userSid, + friendlyName: this.friendlyName, + conversationState: this.conversationState, + timers: this.timers, + attributes: this.attributes, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + notificationLevel: this.notificationLevel, + uniqueName: this.uniqueName, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserConversationInstance = UserConversationInstance; +function UserConversationListInstance(version, userSid) { + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + const instance = ((conversationSid) => instance.get(conversationSid)); + instance.get = function get(conversationSid) { + return new UserConversationContextImpl(version, userSid, conversationSid); + }; + instance._version = version; + instance._solution = { userSid }; + instance._uri = `/Users/${userSid}/Conversations`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserConversationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserConversationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserConversationListInstance = UserConversationListInstance; +class UserConversationPage extends Page_1.default { + /** + * Initialize the UserConversationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserConversationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserConversationInstance(this._version, payload, this._solution.userSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserConversationPage = UserConversationPage; diff --git a/node_modules/twilio/lib/rest/events/V1.d.ts b/node_modules/twilio/lib/rest/events/V1.d.ts new file mode 100644 index 00000000..a4a7cf2f --- /dev/null +++ b/node_modules/twilio/lib/rest/events/V1.d.ts @@ -0,0 +1,30 @@ +import EventsBase from "../EventsBase"; +import Version from "../../base/Version"; +import { EventTypeListInstance } from "./v1/eventType"; +import { SchemaListInstance } from "./v1/schema"; +import { SinkListInstance } from "./v1/sink"; +import { SubscriptionListInstance } from "./v1/subscription"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Events + * + * @param domain - The Twilio (Twilio.Events) domain + */ + constructor(domain: EventsBase); + /** eventTypes - { Twilio.Events.V1.EventTypeListInstance } resource */ + protected _eventTypes?: EventTypeListInstance; + /** schemas - { Twilio.Events.V1.SchemaListInstance } resource */ + protected _schemas?: SchemaListInstance; + /** sinks - { Twilio.Events.V1.SinkListInstance } resource */ + protected _sinks?: SinkListInstance; + /** subscriptions - { Twilio.Events.V1.SubscriptionListInstance } resource */ + protected _subscriptions?: SubscriptionListInstance; + /** Getter for eventTypes resource */ + get eventTypes(): EventTypeListInstance; + /** Getter for schemas resource */ + get schemas(): SchemaListInstance; + /** Getter for sinks resource */ + get sinks(): SinkListInstance; + /** Getter for subscriptions resource */ + get subscriptions(): SubscriptionListInstance; +} diff --git a/node_modules/twilio/lib/rest/events/V1.js b/node_modules/twilio/lib/rest/events/V1.js new file mode 100644 index 00000000..88e68f89 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/V1.js @@ -0,0 +1,54 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const eventType_1 = require("./v1/eventType"); +const schema_1 = require("./v1/schema"); +const sink_1 = require("./v1/sink"); +const subscription_1 = require("./v1/subscription"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Events + * + * @param domain - The Twilio (Twilio.Events) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for eventTypes resource */ + get eventTypes() { + this._eventTypes = this._eventTypes || (0, eventType_1.EventTypeListInstance)(this); + return this._eventTypes; + } + /** Getter for schemas resource */ + get schemas() { + this._schemas = this._schemas || (0, schema_1.SchemaListInstance)(this); + return this._schemas; + } + /** Getter for sinks resource */ + get sinks() { + this._sinks = this._sinks || (0, sink_1.SinkListInstance)(this); + return this._sinks; + } + /** Getter for subscriptions resource */ + get subscriptions() { + this._subscriptions = this._subscriptions || (0, subscription_1.SubscriptionListInstance)(this); + return this._subscriptions; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/events/v1/eventType.d.ts b/node_modules/twilio/lib/rest/events/v1/eventType.d.ts new file mode 100644 index 00000000..3869d10c --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/eventType.d.ts @@ -0,0 +1,226 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface EventTypeListInstanceEachOptions { + /** A string parameter filtering the results to return only the Event Types using a given schema. */ + schemaId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EventTypeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EventTypeListInstanceOptions { + /** A string parameter filtering the results to return only the Event Types using a given schema. */ + schemaId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EventTypeListInstancePageOptions { + /** A string parameter filtering the results to return only the Event Types using a given schema. */ + schemaId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EventTypeContext { + /** + * Fetch a EventTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventTypeInstance + */ + fetch(callback?: (error: Error | null, item?: EventTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EventTypeContextSolution { + type: string; +} +export declare class EventTypeContextImpl implements EventTypeContext { + protected _version: V1; + protected _solution: EventTypeContextSolution; + protected _uri: string; + constructor(_version: V1, type: string); + fetch(callback?: (error: Error | null, item?: EventTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EventTypeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EventTypePayload extends TwilioResponsePayload { + types: EventTypeResource[]; +} +interface EventTypeResource { + type: string; + schema_id: string; + date_created: Date; + date_updated: Date; + description: string; + url: string; + links: Record; +} +export declare class EventTypeInstance { + protected _version: V1; + protected _solution: EventTypeContextSolution; + protected _context?: EventTypeContext; + constructor(_version: V1, payload: EventTypeResource, type?: string); + /** + * A string that uniquely identifies this Event Type. + */ + type: string; + /** + * A string that uniquely identifies the Schema this Event Type adheres to. + */ + schemaId: string; + /** + * The date that this Event Type was created, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that this Event Type was updated, given in ISO 8601 format. + */ + dateUpdated: Date; + /** + * A human readable description for this Event Type. + */ + description: string; + /** + * The URL of this resource. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Fetch a EventTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventTypeInstance + */ + fetch(callback?: (error: Error | null, item?: EventTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + type: string; + schemaId: string; + dateCreated: Date; + dateUpdated: Date; + description: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EventTypeSolution { +} +export interface EventTypeListInstance { + _version: V1; + _solution: EventTypeSolution; + _uri: string; + (type: string): EventTypeContext; + get(type: string): EventTypeContext; + /** + * Streams EventTypeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventTypeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EventTypeInstance, done: (err?: Error) => void) => void): void; + each(params: EventTypeListInstanceEachOptions, callback?: (item: EventTypeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EventTypeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EventTypePage) => any): Promise; + /** + * Lists EventTypeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventTypeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EventTypeInstance[]) => any): Promise; + list(params: EventTypeListInstanceOptions, callback?: (error: Error | null, items: EventTypeInstance[]) => any): Promise; + /** + * Retrieve a single page of EventTypeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventTypeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EventTypePage) => any): Promise; + page(params: EventTypeListInstancePageOptions, callback?: (error: Error | null, items: EventTypePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EventTypeListInstance(version: V1): EventTypeListInstance; +export declare class EventTypePage extends Page { + /** + * Initialize the EventTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EventTypeSolution); + /** + * Build an instance of EventTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EventTypeResource): EventTypeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/events/v1/eventType.js b/node_modules/twilio/lib/rest/events/v1/eventType.js new file mode 100644 index 00000000..3f617f54 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/eventType.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EventTypePage = exports.EventTypeListInstance = exports.EventTypeInstance = exports.EventTypeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class EventTypeContextImpl { + constructor(_version, type) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(type)) { + throw new Error("Parameter 'type' is not valid."); + } + this._solution = { type }; + this._uri = `/Types/${type}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EventTypeInstance(operationVersion, payload, instance._solution.type)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventTypeContextImpl = EventTypeContextImpl; +class EventTypeInstance { + constructor(_version, payload, type) { + this._version = _version; + this.type = payload.type; + this.schemaId = payload.schema_id; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.description = payload.description; + this.url = payload.url; + this.links = payload.links; + this._solution = { type: type || this.type }; + } + get _proxy() { + this._context = + this._context || + new EventTypeContextImpl(this._version, this._solution.type); + return this._context; + } + /** + * Fetch a EventTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventTypeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + type: this.type, + schemaId: this.schemaId, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + description: this.description, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventTypeInstance = EventTypeInstance; +function EventTypeListInstance(version) { + const instance = ((type) => instance.get(type)); + instance.get = function get(type) { + return new EventTypeContextImpl(version, type); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Types`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["schemaId"] !== undefined) + data["SchemaId"] = params["schemaId"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EventTypePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EventTypePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EventTypeListInstance = EventTypeListInstance; +class EventTypePage extends Page_1.default { + /** + * Initialize the EventTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EventTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EventTypeInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventTypePage = EventTypePage; diff --git a/node_modules/twilio/lib/rest/events/v1/schema.d.ts b/node_modules/twilio/lib/rest/events/v1/schema.d.ts new file mode 100644 index 00000000..996c6ff2 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/schema.d.ts @@ -0,0 +1,114 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { SchemaVersionListInstance } from "./schema/schemaVersion"; +export interface SchemaContext { + versions: SchemaVersionListInstance; + /** + * Fetch a SchemaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SchemaInstance + */ + fetch(callback?: (error: Error | null, item?: SchemaInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SchemaContextSolution { + id: string; +} +export declare class SchemaContextImpl implements SchemaContext { + protected _version: V1; + protected _solution: SchemaContextSolution; + protected _uri: string; + protected _versions?: SchemaVersionListInstance; + constructor(_version: V1, id: string); + get versions(): SchemaVersionListInstance; + fetch(callback?: (error: Error | null, item?: SchemaInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SchemaContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SchemaResource { + id: string; + url: string; + links: Record; + latest_version_date_created: Date; + latest_version: number; +} +export declare class SchemaInstance { + protected _version: V1; + protected _solution: SchemaContextSolution; + protected _context?: SchemaContext; + constructor(_version: V1, payload: SchemaResource, id?: string); + /** + * The unique identifier of the schema. Each schema can have multiple versions, that share the same id. + */ + id: string; + /** + * The URL of this resource. + */ + url: string; + /** + * Contains a dictionary of URL links to nested resources of this schema. + */ + links: Record; + /** + * The date that the latest schema version was created, given in ISO 8601 format. + */ + latestVersionDateCreated: Date; + /** + * The latest version published of this schema. + */ + latestVersion: number; + private get _proxy(); + /** + * Fetch a SchemaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SchemaInstance + */ + fetch(callback?: (error: Error | null, item?: SchemaInstance) => any): Promise; + /** + * Access the versions. + */ + versions(): SchemaVersionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + id: string; + url: string; + links: Record; + latestVersionDateCreated: Date; + latestVersion: number; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SchemaSolution { +} +export interface SchemaListInstance { + _version: V1; + _solution: SchemaSolution; + _uri: string; + (id: string): SchemaContext; + get(id: string): SchemaContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SchemaListInstance(version: V1): SchemaListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/events/v1/schema.js b/node_modules/twilio/lib/rest/events/v1/schema.js new file mode 100644 index 00000000..23c2bfa7 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/schema.js @@ -0,0 +1,126 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchemaListInstance = exports.SchemaInstance = exports.SchemaContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const schemaVersion_1 = require("./schema/schemaVersion"); +class SchemaContextImpl { + constructor(_version, id) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(id)) { + throw new Error("Parameter 'id' is not valid."); + } + this._solution = { id }; + this._uri = `/Schemas/${id}`; + } + get versions() { + this._versions = + this._versions || + (0, schemaVersion_1.SchemaVersionListInstance)(this._version, this._solution.id); + return this._versions; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SchemaInstance(operationVersion, payload, instance._solution.id)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SchemaContextImpl = SchemaContextImpl; +class SchemaInstance { + constructor(_version, payload, id) { + this._version = _version; + this.id = payload.id; + this.url = payload.url; + this.links = payload.links; + this.latestVersionDateCreated = deserialize.iso8601DateTime(payload.latest_version_date_created); + this.latestVersion = deserialize.integer(payload.latest_version); + this._solution = { id: id || this.id }; + } + get _proxy() { + this._context = + this._context || new SchemaContextImpl(this._version, this._solution.id); + return this._context; + } + /** + * Fetch a SchemaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SchemaInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the versions. + */ + versions() { + return this._proxy.versions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + id: this.id, + url: this.url, + links: this.links, + latestVersionDateCreated: this.latestVersionDateCreated, + latestVersion: this.latestVersion, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SchemaInstance = SchemaInstance; +function SchemaListInstance(version) { + const instance = ((id) => instance.get(id)); + instance.get = function get(id) { + return new SchemaContextImpl(version, id); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SchemaListInstance = SchemaListInstance; diff --git a/node_modules/twilio/lib/rest/events/v1/schema/schemaVersion.d.ts b/node_modules/twilio/lib/rest/events/v1/schema/schemaVersion.d.ts new file mode 100644 index 00000000..eb93b872 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/schema/schemaVersion.d.ts @@ -0,0 +1,210 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to each + */ +export interface SchemaVersionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SchemaVersionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SchemaVersionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SchemaVersionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SchemaVersionContext { + /** + * Fetch a SchemaVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SchemaVersionInstance + */ + fetch(callback?: (error: Error | null, item?: SchemaVersionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SchemaVersionContextSolution { + id: string; + schemaVersion: number; +} +export declare class SchemaVersionContextImpl implements SchemaVersionContext { + protected _version: V1; + protected _solution: SchemaVersionContextSolution; + protected _uri: string; + constructor(_version: V1, id: string, schemaVersion: number); + fetch(callback?: (error: Error | null, item?: SchemaVersionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SchemaVersionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SchemaVersionPayload extends TwilioResponsePayload { + schema_versions: SchemaVersionResource[]; +} +interface SchemaVersionResource { + id: string; + schema_version: number; + date_created: Date; + url: string; + raw: string; +} +export declare class SchemaVersionInstance { + protected _version: V1; + protected _solution: SchemaVersionContextSolution; + protected _context?: SchemaVersionContext; + constructor(_version: V1, payload: SchemaVersionResource, id: string, schemaVersion?: number); + /** + * The unique identifier of the schema. Each schema can have multiple versions, that share the same id. + */ + id: string; + /** + * The version of this schema. + */ + schemaVersion: number; + /** + * The date the schema version was created, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The URL of this resource. + */ + url: string; + raw: string; + private get _proxy(); + /** + * Fetch a SchemaVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SchemaVersionInstance + */ + fetch(callback?: (error: Error | null, item?: SchemaVersionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + id: string; + schemaVersion: number; + dateCreated: Date; + url: string; + raw: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SchemaVersionSolution { + id: string; +} +export interface SchemaVersionListInstance { + _version: V1; + _solution: SchemaVersionSolution; + _uri: string; + (schemaVersion: number): SchemaVersionContext; + get(schemaVersion: number): SchemaVersionContext; + /** + * Streams SchemaVersionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SchemaVersionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SchemaVersionInstance, done: (err?: Error) => void) => void): void; + each(params: SchemaVersionListInstanceEachOptions, callback?: (item: SchemaVersionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SchemaVersionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SchemaVersionPage) => any): Promise; + /** + * Lists SchemaVersionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SchemaVersionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SchemaVersionInstance[]) => any): Promise; + list(params: SchemaVersionListInstanceOptions, callback?: (error: Error | null, items: SchemaVersionInstance[]) => any): Promise; + /** + * Retrieve a single page of SchemaVersionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SchemaVersionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SchemaVersionPage) => any): Promise; + page(params: SchemaVersionListInstancePageOptions, callback?: (error: Error | null, items: SchemaVersionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SchemaVersionListInstance(version: V1, id: string): SchemaVersionListInstance; +export declare class SchemaVersionPage extends Page { + /** + * Initialize the SchemaVersionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SchemaVersionSolution); + /** + * Build an instance of SchemaVersionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SchemaVersionResource): SchemaVersionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/events/v1/schema/schemaVersion.js b/node_modules/twilio/lib/rest/events/v1/schema/schemaVersion.js new file mode 100644 index 00000000..5654bb83 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/schema/schemaVersion.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchemaVersionPage = exports.SchemaVersionListInstance = exports.SchemaVersionInstance = exports.SchemaVersionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class SchemaVersionContextImpl { + constructor(_version, id, schemaVersion) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(id)) { + throw new Error("Parameter 'id' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(schemaVersion)) { + throw new Error("Parameter 'schemaVersion' is not valid."); + } + this._solution = { id, schemaVersion }; + this._uri = `/Schemas/${id}/Versions/${schemaVersion}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SchemaVersionInstance(operationVersion, payload, instance._solution.id, instance._solution.schemaVersion)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SchemaVersionContextImpl = SchemaVersionContextImpl; +class SchemaVersionInstance { + constructor(_version, payload, id, schemaVersion) { + this._version = _version; + this.id = payload.id; + this.schemaVersion = deserialize.integer(payload.schema_version); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this.raw = payload.raw; + this._solution = { id, schemaVersion: schemaVersion || this.schemaVersion }; + } + get _proxy() { + this._context = + this._context || + new SchemaVersionContextImpl(this._version, this._solution.id, this._solution.schemaVersion); + return this._context; + } + /** + * Fetch a SchemaVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SchemaVersionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + id: this.id, + schemaVersion: this.schemaVersion, + dateCreated: this.dateCreated, + url: this.url, + raw: this.raw, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SchemaVersionInstance = SchemaVersionInstance; +function SchemaVersionListInstance(version, id) { + if (!(0, utility_1.isValidPathParam)(id)) { + throw new Error("Parameter 'id' is not valid."); + } + const instance = ((schemaVersion) => instance.get(schemaVersion)); + instance.get = function get(schemaVersion) { + return new SchemaVersionContextImpl(version, id, schemaVersion); + }; + instance._version = version; + instance._solution = { id }; + instance._uri = `/Schemas/${id}/Versions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SchemaVersionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SchemaVersionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SchemaVersionListInstance = SchemaVersionListInstance; +class SchemaVersionPage extends Page_1.default { + /** + * Initialize the SchemaVersionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SchemaVersionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SchemaVersionInstance(this._version, payload, this._solution.id); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SchemaVersionPage = SchemaVersionPage; diff --git a/node_modules/twilio/lib/rest/events/v1/sink.d.ts b/node_modules/twilio/lib/rest/events/v1/sink.d.ts new file mode 100644 index 00000000..3961b714 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/sink.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { SinkTestListInstance } from "./sink/sinkTest"; +import { SinkValidateListInstance } from "./sink/sinkValidate"; +export type SinkSinkType = "kinesis" | "webhook" | "segment"; +export type SinkStatus = "initialized" | "validating" | "active" | "failed"; +/** + * Options to pass to update a SinkInstance + */ +export interface SinkContextUpdateOptions { + /** A human readable description for the Sink **This value should not contain PII.** */ + description: string; +} +/** + * Options to pass to create a SinkInstance + */ +export interface SinkListInstanceCreateOptions { + /** A human readable description for the Sink **This value should not contain PII.** */ + description: string; + /** The information required for Twilio to connect to the provided Sink encoded as JSON. */ + sinkConfiguration: any; + /** */ + sinkType: SinkSinkType; +} +/** + * Options to pass to each + */ +export interface SinkListInstanceEachOptions { + /** A boolean query parameter filtering the results to return sinks used/not used by a subscription. */ + inUse?: boolean; + /** A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. */ + status?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SinkInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SinkListInstanceOptions { + /** A boolean query parameter filtering the results to return sinks used/not used by a subscription. */ + inUse?: boolean; + /** A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. */ + status?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SinkListInstancePageOptions { + /** A boolean query parameter filtering the results to return sinks used/not used by a subscription. */ + inUse?: boolean; + /** A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. */ + status?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SinkContext { + sinkTest: SinkTestListInstance; + sinkValidate: SinkValidateListInstance; + /** + * Remove a SinkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SinkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SinkInstance + */ + fetch(callback?: (error: Error | null, item?: SinkInstance) => any): Promise; + /** + * Update a SinkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SinkInstance + */ + update(params: SinkContextUpdateOptions, callback?: (error: Error | null, item?: SinkInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SinkContextSolution { + sid: string; +} +export declare class SinkContextImpl implements SinkContext { + protected _version: V1; + protected _solution: SinkContextSolution; + protected _uri: string; + protected _sinkTest?: SinkTestListInstance; + protected _sinkValidate?: SinkValidateListInstance; + constructor(_version: V1, sid: string); + get sinkTest(): SinkTestListInstance; + get sinkValidate(): SinkValidateListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SinkInstance) => any): Promise; + update(params: SinkContextUpdateOptions, callback?: (error: Error | null, item?: SinkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SinkContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SinkPayload extends TwilioResponsePayload { + sinks: SinkResource[]; +} +interface SinkResource { + date_created: Date; + date_updated: Date; + description: string; + sid: string; + sink_configuration: any; + sink_type: SinkSinkType; + status: SinkStatus; + url: string; + links: Record; +} +export declare class SinkInstance { + protected _version: V1; + protected _solution: SinkContextSolution; + protected _context?: SinkContext; + constructor(_version: V1, payload: SinkResource, sid?: string); + /** + * The date that this Sink was created, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that this Sink was updated, given in ISO 8601 format. + */ + dateUpdated: Date; + /** + * A human readable description for the Sink + */ + description: string; + /** + * A 34 character string that uniquely identifies this Sink. + */ + sid: string; + /** + * The information required for Twilio to connect to the provided Sink encoded as JSON. + */ + sinkConfiguration: any; + sinkType: SinkSinkType; + status: SinkStatus; + /** + * The URL of this resource. + */ + url: string; + /** + * Contains a dictionary of URL links to nested resources of this Sink. + */ + links: Record; + private get _proxy(); + /** + * Remove a SinkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SinkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SinkInstance + */ + fetch(callback?: (error: Error | null, item?: SinkInstance) => any): Promise; + /** + * Update a SinkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SinkInstance + */ + update(params: SinkContextUpdateOptions, callback?: (error: Error | null, item?: SinkInstance) => any): Promise; + /** + * Access the sinkTest. + */ + sinkTest(): SinkTestListInstance; + /** + * Access the sinkValidate. + */ + sinkValidate(): SinkValidateListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + dateCreated: Date; + dateUpdated: Date; + description: string; + sid: string; + sinkConfiguration: any; + sinkType: SinkSinkType; + status: SinkStatus; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SinkSolution { +} +export interface SinkListInstance { + _version: V1; + _solution: SinkSolution; + _uri: string; + (sid: string): SinkContext; + get(sid: string): SinkContext; + /** + * Create a SinkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SinkInstance + */ + create(params: SinkListInstanceCreateOptions, callback?: (error: Error | null, item?: SinkInstance) => any): Promise; + /** + * Streams SinkInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SinkListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SinkInstance, done: (err?: Error) => void) => void): void; + each(params: SinkListInstanceEachOptions, callback?: (item: SinkInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SinkInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SinkPage) => any): Promise; + /** + * Lists SinkInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SinkListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SinkInstance[]) => any): Promise; + list(params: SinkListInstanceOptions, callback?: (error: Error | null, items: SinkInstance[]) => any): Promise; + /** + * Retrieve a single page of SinkInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SinkListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SinkPage) => any): Promise; + page(params: SinkListInstancePageOptions, callback?: (error: Error | null, items: SinkPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SinkListInstance(version: V1): SinkListInstance; +export declare class SinkPage extends Page { + /** + * Initialize the SinkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SinkSolution); + /** + * Build an instance of SinkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SinkResource): SinkInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/events/v1/sink.js b/node_modules/twilio/lib/rest/events/v1/sink.js new file mode 100644 index 00000000..581a6927 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/sink.js @@ -0,0 +1,289 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SinkPage = exports.SinkListInstance = exports.SinkInstance = exports.SinkContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const sinkTest_1 = require("./sink/sinkTest"); +const sinkValidate_1 = require("./sink/sinkValidate"); +class SinkContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Sinks/${sid}`; + } + get sinkTest() { + this._sinkTest = + this._sinkTest || (0, sinkTest_1.SinkTestListInstance)(this._version, this._solution.sid); + return this._sinkTest; + } + get sinkValidate() { + this._sinkValidate = + this._sinkValidate || + (0, sinkValidate_1.SinkValidateListInstance)(this._version, this._solution.sid); + return this._sinkValidate; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SinkInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["description"] === null || params["description"] === undefined) { + throw new Error("Required parameter \"params['description']\" missing."); + } + let data = {}; + data["Description"] = params["description"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SinkInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SinkContextImpl = SinkContextImpl; +class SinkInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.description = payload.description; + this.sid = payload.sid; + this.sinkConfiguration = payload.sink_configuration; + this.sinkType = payload.sink_type; + this.status = payload.status; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new SinkContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a SinkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SinkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SinkInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the sinkTest. + */ + sinkTest() { + return this._proxy.sinkTest; + } + /** + * Access the sinkValidate. + */ + sinkValidate() { + return this._proxy.sinkValidate; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + description: this.description, + sid: this.sid, + sinkConfiguration: this.sinkConfiguration, + sinkType: this.sinkType, + status: this.status, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SinkInstance = SinkInstance; +function SinkListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SinkContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Sinks`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["description"] === null || params["description"] === undefined) { + throw new Error("Required parameter \"params['description']\" missing."); + } + if (params["sinkConfiguration"] === null || + params["sinkConfiguration"] === undefined) { + throw new Error("Required parameter \"params['sinkConfiguration']\" missing."); + } + if (params["sinkType"] === null || params["sinkType"] === undefined) { + throw new Error("Required parameter \"params['sinkType']\" missing."); + } + let data = {}; + data["Description"] = params["description"]; + data["SinkConfiguration"] = serialize.object(params["sinkConfiguration"]); + data["SinkType"] = params["sinkType"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SinkInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["inUse"] !== undefined) + data["InUse"] = serialize.bool(params["inUse"]); + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SinkPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SinkPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SinkListInstance = SinkListInstance; +class SinkPage extends Page_1.default { + /** + * Initialize the SinkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SinkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SinkInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SinkPage = SinkPage; diff --git a/node_modules/twilio/lib/rest/events/v1/sink/sinkTest.d.ts b/node_modules/twilio/lib/rest/events/v1/sink/sinkTest.d.ts new file mode 100644 index 00000000..c0dc5764 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/sink/sinkTest.d.ts @@ -0,0 +1,46 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export interface SinkTestSolution { + sid: string; +} +export interface SinkTestListInstance { + _version: V1; + _solution: SinkTestSolution; + _uri: string; + /** + * Create a SinkTestInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SinkTestInstance + */ + create(callback?: (error: Error | null, item?: SinkTestInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SinkTestListInstance(version: V1, sid: string): SinkTestListInstance; +interface SinkTestResource { + result: string; +} +export declare class SinkTestInstance { + protected _version: V1; + constructor(_version: V1, payload: SinkTestResource, sid: string); + /** + * Feedback indicating whether the test event was generated. + */ + result: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + result: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/events/v1/sink/sinkTest.js b/node_modules/twilio/lib/rest/events/v1/sink/sinkTest.js new file mode 100644 index 00000000..5c9c3bcc --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/sink/sinkTest.js @@ -0,0 +1,66 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SinkTestInstance = exports.SinkTestListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function SinkTestListInstance(version, sid) { + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { sid }; + instance._uri = `/Sinks/${sid}/Test`; + instance.create = function create(callback) { + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + }); + operationPromise = operationPromise.then((payload) => new SinkTestInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SinkTestListInstance = SinkTestListInstance; +class SinkTestInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.result = payload.result; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + result: this.result, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SinkTestInstance = SinkTestInstance; diff --git a/node_modules/twilio/lib/rest/events/v1/sink/sinkValidate.d.ts b/node_modules/twilio/lib/rest/events/v1/sink/sinkValidate.d.ts new file mode 100644 index 00000000..ba55a26e --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/sink/sinkValidate.d.ts @@ -0,0 +1,54 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * Options to pass to create a SinkValidateInstance + */ +export interface SinkValidateListInstanceCreateOptions { + /** A 34 character string that uniquely identifies the test event for a Sink being validated. */ + testId: string; +} +export interface SinkValidateSolution { + sid: string; +} +export interface SinkValidateListInstance { + _version: V1; + _solution: SinkValidateSolution; + _uri: string; + /** + * Create a SinkValidateInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SinkValidateInstance + */ + create(params: SinkValidateListInstanceCreateOptions, callback?: (error: Error | null, item?: SinkValidateInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SinkValidateListInstance(version: V1, sid: string): SinkValidateListInstance; +interface SinkValidateResource { + result: string; +} +export declare class SinkValidateInstance { + protected _version: V1; + constructor(_version: V1, payload: SinkValidateResource, sid: string); + /** + * Feedback indicating whether the given Sink was validated. + */ + result: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + result: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/events/v1/sink/sinkValidate.js b/node_modules/twilio/lib/rest/events/v1/sink/sinkValidate.js new file mode 100644 index 00000000..bdfd8820 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/sink/sinkValidate.js @@ -0,0 +1,78 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SinkValidateInstance = exports.SinkValidateListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function SinkValidateListInstance(version, sid) { + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { sid }; + instance._uri = `/Sinks/${sid}/Validate`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["testId"] === null || params["testId"] === undefined) { + throw new Error("Required parameter \"params['testId']\" missing."); + } + let data = {}; + data["TestId"] = params["testId"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SinkValidateInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SinkValidateListInstance = SinkValidateListInstance; +class SinkValidateInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.result = payload.result; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + result: this.result, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SinkValidateInstance = SinkValidateInstance; diff --git a/node_modules/twilio/lib/rest/events/v1/subscription.d.ts b/node_modules/twilio/lib/rest/events/v1/subscription.d.ts new file mode 100644 index 00000000..c981456d --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/subscription.d.ts @@ -0,0 +1,324 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { SubscribedEventListInstance } from "./subscription/subscribedEvent"; +/** + * Options to pass to update a SubscriptionInstance + */ +export interface SubscriptionContextUpdateOptions { + /** A human readable description for the Subscription. */ + description?: string; + /** The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. */ + sinkSid?: string; +} +/** + * Options to pass to create a SubscriptionInstance + */ +export interface SubscriptionListInstanceCreateOptions { + /** A human readable description for the Subscription **This value should not contain PII.** */ + description: string; + /** The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. */ + sinkSid: string; + /** An array of objects containing the subscribed Event Types */ + types: Array; +} +/** + * Options to pass to each + */ +export interface SubscriptionListInstanceEachOptions { + /** The SID of the sink that the list of Subscriptions should be filtered by. */ + sinkSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SubscriptionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SubscriptionListInstanceOptions { + /** The SID of the sink that the list of Subscriptions should be filtered by. */ + sinkSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SubscriptionListInstancePageOptions { + /** The SID of the sink that the list of Subscriptions should be filtered by. */ + sinkSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SubscriptionContext { + subscribedEvents: SubscribedEventListInstance; + /** + * Remove a SubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscriptionInstance + */ + fetch(callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + /** + * Update a SubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscriptionInstance + */ + update(callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + /** + * Update a SubscriptionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscriptionInstance + */ + update(params: SubscriptionContextUpdateOptions, callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SubscriptionContextSolution { + sid: string; +} +export declare class SubscriptionContextImpl implements SubscriptionContext { + protected _version: V1; + protected _solution: SubscriptionContextSolution; + protected _uri: string; + protected _subscribedEvents?: SubscribedEventListInstance; + constructor(_version: V1, sid: string); + get subscribedEvents(): SubscribedEventListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + update(params?: SubscriptionContextUpdateOptions | ((error: Error | null, item?: SubscriptionInstance) => any), callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SubscriptionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SubscriptionPayload extends TwilioResponsePayload { + subscriptions: SubscriptionResource[]; +} +interface SubscriptionResource { + account_sid: string; + sid: string; + date_created: Date; + date_updated: Date; + description: string; + sink_sid: string; + url: string; + links: Record; +} +export declare class SubscriptionInstance { + protected _version: V1; + protected _solution: SubscriptionContextSolution; + protected _context?: SubscriptionContext; + constructor(_version: V1, payload: SubscriptionResource, sid?: string); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * A 34 character string that uniquely identifies this Subscription. + */ + sid: string; + /** + * The date that this Subscription was created, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that this Subscription was updated, given in ISO 8601 format. + */ + dateUpdated: Date; + /** + * A human readable description for the Subscription + */ + description: string; + /** + * The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + */ + sinkSid: string; + /** + * The URL of this resource. + */ + url: string; + /** + * Contains a dictionary of URL links to nested resources of this Subscription. + */ + links: Record; + private get _proxy(); + /** + * Remove a SubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscriptionInstance + */ + fetch(callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + /** + * Update a SubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscriptionInstance + */ + update(callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + /** + * Update a SubscriptionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscriptionInstance + */ + update(params: SubscriptionContextUpdateOptions, callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + /** + * Access the subscribedEvents. + */ + subscribedEvents(): SubscribedEventListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + dateCreated: Date; + dateUpdated: Date; + description: string; + sinkSid: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SubscriptionSolution { +} +export interface SubscriptionListInstance { + _version: V1; + _solution: SubscriptionSolution; + _uri: string; + (sid: string): SubscriptionContext; + get(sid: string): SubscriptionContext; + /** + * Create a SubscriptionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscriptionInstance + */ + create(params: SubscriptionListInstanceCreateOptions, callback?: (error: Error | null, item?: SubscriptionInstance) => any): Promise; + /** + * Streams SubscriptionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscriptionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SubscriptionInstance, done: (err?: Error) => void) => void): void; + each(params: SubscriptionListInstanceEachOptions, callback?: (item: SubscriptionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SubscriptionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SubscriptionPage) => any): Promise; + /** + * Lists SubscriptionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscriptionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SubscriptionInstance[]) => any): Promise; + list(params: SubscriptionListInstanceOptions, callback?: (error: Error | null, items: SubscriptionInstance[]) => any): Promise; + /** + * Retrieve a single page of SubscriptionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscriptionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SubscriptionPage) => any): Promise; + page(params: SubscriptionListInstancePageOptions, callback?: (error: Error | null, items: SubscriptionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SubscriptionListInstance(version: V1): SubscriptionListInstance; +export declare class SubscriptionPage extends Page { + /** + * Initialize the SubscriptionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SubscriptionSolution); + /** + * Build an instance of SubscriptionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SubscriptionResource): SubscriptionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/events/v1/subscription.js b/node_modules/twilio/lib/rest/events/v1/subscription.js new file mode 100644 index 00000000..ad5b3f86 --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/subscription.js @@ -0,0 +1,277 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SubscriptionPage = exports.SubscriptionListInstance = exports.SubscriptionInstance = exports.SubscriptionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const subscribedEvent_1 = require("./subscription/subscribedEvent"); +class SubscriptionContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Subscriptions/${sid}`; + } + get subscribedEvents() { + this._subscribedEvents = + this._subscribedEvents || + (0, subscribedEvent_1.SubscribedEventListInstance)(this._version, this._solution.sid); + return this._subscribedEvents; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SubscriptionInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["description"] !== undefined) + data["Description"] = params["description"]; + if (params["sinkSid"] !== undefined) + data["SinkSid"] = params["sinkSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SubscriptionInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscriptionContextImpl = SubscriptionContextImpl; +class SubscriptionInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.description = payload.description; + this.sinkSid = payload.sink_sid; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SubscriptionContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a SubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SubscriptionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscriptionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the subscribedEvents. + */ + subscribedEvents() { + return this._proxy.subscribedEvents; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + description: this.description, + sinkSid: this.sinkSid, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscriptionInstance = SubscriptionInstance; +function SubscriptionListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SubscriptionContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Subscriptions`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["description"] === null || params["description"] === undefined) { + throw new Error("Required parameter \"params['description']\" missing."); + } + if (params["sinkSid"] === null || params["sinkSid"] === undefined) { + throw new Error("Required parameter \"params['sinkSid']\" missing."); + } + if (params["types"] === null || params["types"] === undefined) { + throw new Error("Required parameter \"params['types']\" missing."); + } + let data = {}; + data["Description"] = params["description"]; + data["SinkSid"] = params["sinkSid"]; + data["Types"] = serialize.map(params["types"], (e) => serialize.object(e)); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SubscriptionInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["sinkSid"] !== undefined) + data["SinkSid"] = params["sinkSid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SubscriptionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SubscriptionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SubscriptionListInstance = SubscriptionListInstance; +class SubscriptionPage extends Page_1.default { + /** + * Initialize the SubscriptionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SubscriptionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SubscriptionInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscriptionPage = SubscriptionPage; diff --git a/node_modules/twilio/lib/rest/events/v1/subscription/subscribedEvent.d.ts b/node_modules/twilio/lib/rest/events/v1/subscription/subscribedEvent.d.ts new file mode 100644 index 00000000..3624a53f --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/subscription/subscribedEvent.d.ts @@ -0,0 +1,290 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a SubscribedEventInstance + */ +export interface SubscribedEventContextUpdateOptions { + /** The schema version that the Subscription should use. */ + schemaVersion?: number; +} +/** + * Options to pass to create a SubscribedEventInstance + */ +export interface SubscribedEventListInstanceCreateOptions { + /** Type of event being subscribed to. */ + type: string; + /** The schema version that the Subscription should use. */ + schemaVersion?: number; +} +/** + * Options to pass to each + */ +export interface SubscribedEventListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SubscribedEventInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SubscribedEventListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SubscribedEventListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SubscribedEventContext { + /** + * Remove a SubscribedEventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SubscribedEventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedEventInstance + */ + fetch(callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + /** + * Update a SubscribedEventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedEventInstance + */ + update(callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + /** + * Update a SubscribedEventInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedEventInstance + */ + update(params: SubscribedEventContextUpdateOptions, callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SubscribedEventContextSolution { + subscriptionSid: string; + type: string; +} +export declare class SubscribedEventContextImpl implements SubscribedEventContext { + protected _version: V1; + protected _solution: SubscribedEventContextSolution; + protected _uri: string; + constructor(_version: V1, subscriptionSid: string, type: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + update(params?: SubscribedEventContextUpdateOptions | ((error: Error | null, item?: SubscribedEventInstance) => any), callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SubscribedEventContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SubscribedEventPayload extends TwilioResponsePayload { + types: SubscribedEventResource[]; +} +interface SubscribedEventResource { + account_sid: string; + type: string; + schema_version: number; + subscription_sid: string; + url: string; +} +export declare class SubscribedEventInstance { + protected _version: V1; + protected _solution: SubscribedEventContextSolution; + protected _context?: SubscribedEventContext; + constructor(_version: V1, payload: SubscribedEventResource, subscriptionSid: string, type?: string); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * Type of event being subscribed to. + */ + type: string; + /** + * The schema version that the Subscription should use. + */ + schemaVersion: number; + /** + * The unique SID identifier of the Subscription. + */ + subscriptionSid: string; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Remove a SubscribedEventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SubscribedEventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedEventInstance + */ + fetch(callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + /** + * Update a SubscribedEventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedEventInstance + */ + update(callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + /** + * Update a SubscribedEventInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedEventInstance + */ + update(params: SubscribedEventContextUpdateOptions, callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + type: string; + schemaVersion: number; + subscriptionSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SubscribedEventSolution { + subscriptionSid: string; +} +export interface SubscribedEventListInstance { + _version: V1; + _solution: SubscribedEventSolution; + _uri: string; + (type: string): SubscribedEventContext; + get(type: string): SubscribedEventContext; + /** + * Create a SubscribedEventInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedEventInstance + */ + create(params: SubscribedEventListInstanceCreateOptions, callback?: (error: Error | null, item?: SubscribedEventInstance) => any): Promise; + /** + * Streams SubscribedEventInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscribedEventListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SubscribedEventInstance, done: (err?: Error) => void) => void): void; + each(params: SubscribedEventListInstanceEachOptions, callback?: (item: SubscribedEventInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SubscribedEventInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SubscribedEventPage) => any): Promise; + /** + * Lists SubscribedEventInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscribedEventListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SubscribedEventInstance[]) => any): Promise; + list(params: SubscribedEventListInstanceOptions, callback?: (error: Error | null, items: SubscribedEventInstance[]) => any): Promise; + /** + * Retrieve a single page of SubscribedEventInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscribedEventListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SubscribedEventPage) => any): Promise; + page(params: SubscribedEventListInstancePageOptions, callback?: (error: Error | null, items: SubscribedEventPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SubscribedEventListInstance(version: V1, subscriptionSid: string): SubscribedEventListInstance; +export declare class SubscribedEventPage extends Page { + /** + * Initialize the SubscribedEventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SubscribedEventSolution); + /** + * Build an instance of SubscribedEventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SubscribedEventResource): SubscribedEventInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/events/v1/subscription/subscribedEvent.js b/node_modules/twilio/lib/rest/events/v1/subscription/subscribedEvent.js new file mode 100644 index 00000000..a6de0d3a --- /dev/null +++ b/node_modules/twilio/lib/rest/events/v1/subscription/subscribedEvent.js @@ -0,0 +1,254 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Events + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SubscribedEventPage = exports.SubscribedEventListInstance = exports.SubscribedEventInstance = exports.SubscribedEventContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class SubscribedEventContextImpl { + constructor(_version, subscriptionSid, type) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(subscriptionSid)) { + throw new Error("Parameter 'subscriptionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(type)) { + throw new Error("Parameter 'type' is not valid."); + } + this._solution = { subscriptionSid, type }; + this._uri = `/Subscriptions/${subscriptionSid}/SubscribedEvents/${type}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SubscribedEventInstance(operationVersion, payload, instance._solution.subscriptionSid, instance._solution.type)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["schemaVersion"] !== undefined) + data["SchemaVersion"] = params["schemaVersion"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SubscribedEventInstance(operationVersion, payload, instance._solution.subscriptionSid, instance._solution.type)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscribedEventContextImpl = SubscribedEventContextImpl; +class SubscribedEventInstance { + constructor(_version, payload, subscriptionSid, type) { + this._version = _version; + this.accountSid = payload.account_sid; + this.type = payload.type; + this.schemaVersion = deserialize.integer(payload.schema_version); + this.subscriptionSid = payload.subscription_sid; + this.url = payload.url; + this._solution = { subscriptionSid, type: type || this.type }; + } + get _proxy() { + this._context = + this._context || + new SubscribedEventContextImpl(this._version, this._solution.subscriptionSid, this._solution.type); + return this._context; + } + /** + * Remove a SubscribedEventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SubscribedEventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedEventInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + type: this.type, + schemaVersion: this.schemaVersion, + subscriptionSid: this.subscriptionSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscribedEventInstance = SubscribedEventInstance; +function SubscribedEventListInstance(version, subscriptionSid) { + if (!(0, utility_1.isValidPathParam)(subscriptionSid)) { + throw new Error("Parameter 'subscriptionSid' is not valid."); + } + const instance = ((type) => instance.get(type)); + instance.get = function get(type) { + return new SubscribedEventContextImpl(version, subscriptionSid, type); + }; + instance._version = version; + instance._solution = { subscriptionSid }; + instance._uri = `/Subscriptions/${subscriptionSid}/SubscribedEvents`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["schemaVersion"] !== undefined) + data["SchemaVersion"] = params["schemaVersion"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SubscribedEventInstance(operationVersion, payload, instance._solution.subscriptionSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SubscribedEventPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SubscribedEventPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SubscribedEventListInstance = SubscribedEventListInstance; +class SubscribedEventPage extends Page_1.default { + /** + * Initialize the SubscribedEventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SubscribedEventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SubscribedEventInstance(this._version, payload, this._solution.subscriptionSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscribedEventPage = SubscribedEventPage; diff --git a/node_modules/twilio/lib/rest/flexApi/V1.d.ts b/node_modules/twilio/lib/rest/flexApi/V1.d.ts new file mode 100644 index 00000000..71ee7156 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/V1.d.ts @@ -0,0 +1,105 @@ +import FlexApiBase from "../FlexApiBase"; +import Version from "../../base/Version"; +import { AssessmentsListInstance } from "./v1/assessments"; +import { ChannelListInstance } from "./v1/channel"; +import { ConfigurationListInstance } from "./v1/configuration"; +import { FlexFlowListInstance } from "./v1/flexFlow"; +import { InsightsAssessmentsCommentListInstance } from "./v1/insightsAssessmentsComment"; +import { InsightsConversationalAiListInstance } from "./v1/insightsConversationalAi"; +import { InsightsConversationalAiReportInsightsListInstance } from "./v1/insightsConversationalAiReportInsights"; +import { InsightsConversationsListInstance } from "./v1/insightsConversations"; +import { InsightsQuestionnairesListInstance } from "./v1/insightsQuestionnaires"; +import { InsightsQuestionnairesCategoryListInstance } from "./v1/insightsQuestionnairesCategory"; +import { InsightsQuestionnairesQuestionListInstance } from "./v1/insightsQuestionnairesQuestion"; +import { InsightsSegmentsListInstance } from "./v1/insightsSegments"; +import { InsightsSessionListInstance } from "./v1/insightsSession"; +import { InsightsSettingsAnswerSetsListInstance } from "./v1/insightsSettingsAnswerSets"; +import { InsightsSettingsCommentListInstance } from "./v1/insightsSettingsComment"; +import { InsightsUserRolesListInstance } from "./v1/insightsUserRoles"; +import { InteractionListInstance } from "./v1/interaction"; +import { ProvisioningStatusListInstance } from "./v1/provisioningStatus"; +import { WebChannelListInstance } from "./v1/webChannel"; +export default class V1 extends Version { + /** + * Initialize the V1 version of FlexApi + * + * @param domain - The Twilio (Twilio.FlexApi) domain + */ + constructor(domain: FlexApiBase); + /** assessments - { Twilio.FlexApi.V1.AssessmentsListInstance } resource */ + protected _assessments?: AssessmentsListInstance; + /** channel - { Twilio.FlexApi.V1.ChannelListInstance } resource */ + protected _channel?: ChannelListInstance; + /** configuration - { Twilio.FlexApi.V1.ConfigurationListInstance } resource */ + protected _configuration?: ConfigurationListInstance; + /** flexFlow - { Twilio.FlexApi.V1.FlexFlowListInstance } resource */ + protected _flexFlow?: FlexFlowListInstance; + /** insightsAssessmentsComment - { Twilio.FlexApi.V1.InsightsAssessmentsCommentListInstance } resource */ + protected _insightsAssessmentsComment?: InsightsAssessmentsCommentListInstance; + /** insightsConversationalAi - { Twilio.FlexApi.V1.InsightsConversationalAiListInstance } resource */ + protected _insightsConversationalAi?: InsightsConversationalAiListInstance; + /** insightsConversationalAiReportInsights - { Twilio.FlexApi.V1.InsightsConversationalAiReportInsightsListInstance } resource */ + protected _insightsConversationalAiReportInsights?: InsightsConversationalAiReportInsightsListInstance; + /** insightsConversations - { Twilio.FlexApi.V1.InsightsConversationsListInstance } resource */ + protected _insightsConversations?: InsightsConversationsListInstance; + /** insightsQuestionnaires - { Twilio.FlexApi.V1.InsightsQuestionnairesListInstance } resource */ + protected _insightsQuestionnaires?: InsightsQuestionnairesListInstance; + /** insightsQuestionnairesCategory - { Twilio.FlexApi.V1.InsightsQuestionnairesCategoryListInstance } resource */ + protected _insightsQuestionnairesCategory?: InsightsQuestionnairesCategoryListInstance; + /** insightsQuestionnairesQuestion - { Twilio.FlexApi.V1.InsightsQuestionnairesQuestionListInstance } resource */ + protected _insightsQuestionnairesQuestion?: InsightsQuestionnairesQuestionListInstance; + /** insightsSegments - { Twilio.FlexApi.V1.InsightsSegmentsListInstance } resource */ + protected _insightsSegments?: InsightsSegmentsListInstance; + /** insightsSession - { Twilio.FlexApi.V1.InsightsSessionListInstance } resource */ + protected _insightsSession?: InsightsSessionListInstance; + /** insightsSettingsAnswerSets - { Twilio.FlexApi.V1.InsightsSettingsAnswerSetsListInstance } resource */ + protected _insightsSettingsAnswerSets?: InsightsSettingsAnswerSetsListInstance; + /** insightsSettingsComment - { Twilio.FlexApi.V1.InsightsSettingsCommentListInstance } resource */ + protected _insightsSettingsComment?: InsightsSettingsCommentListInstance; + /** insightsUserRoles - { Twilio.FlexApi.V1.InsightsUserRolesListInstance } resource */ + protected _insightsUserRoles?: InsightsUserRolesListInstance; + /** interaction - { Twilio.FlexApi.V1.InteractionListInstance } resource */ + protected _interaction?: InteractionListInstance; + /** provisioningStatus - { Twilio.FlexApi.V1.ProvisioningStatusListInstance } resource */ + protected _provisioningStatus?: ProvisioningStatusListInstance; + /** webChannel - { Twilio.FlexApi.V1.WebChannelListInstance } resource */ + protected _webChannel?: WebChannelListInstance; + /** Getter for assessments resource */ + get assessments(): AssessmentsListInstance; + /** Getter for channel resource */ + get channel(): ChannelListInstance; + /** Getter for configuration resource */ + get configuration(): ConfigurationListInstance; + /** Getter for flexFlow resource */ + get flexFlow(): FlexFlowListInstance; + /** Getter for insightsAssessmentsComment resource */ + get insightsAssessmentsComment(): InsightsAssessmentsCommentListInstance; + /** Getter for insightsConversationalAi resource */ + get insightsConversationalAi(): InsightsConversationalAiListInstance; + /** Getter for insightsConversationalAiReportInsights resource */ + get insightsConversationalAiReportInsights(): InsightsConversationalAiReportInsightsListInstance; + /** Getter for insightsConversations resource */ + get insightsConversations(): InsightsConversationsListInstance; + /** Getter for insightsQuestionnaires resource */ + get insightsQuestionnaires(): InsightsQuestionnairesListInstance; + /** Getter for insightsQuestionnairesCategory resource */ + get insightsQuestionnairesCategory(): InsightsQuestionnairesCategoryListInstance; + /** Getter for insightsQuestionnairesQuestion resource */ + get insightsQuestionnairesQuestion(): InsightsQuestionnairesQuestionListInstance; + /** Getter for insightsSegments resource */ + get insightsSegments(): InsightsSegmentsListInstance; + /** Getter for insightsSession resource */ + get insightsSession(): InsightsSessionListInstance; + /** Getter for insightsSettingsAnswerSets resource */ + get insightsSettingsAnswerSets(): InsightsSettingsAnswerSetsListInstance; + /** Getter for insightsSettingsComment resource */ + get insightsSettingsComment(): InsightsSettingsCommentListInstance; + /** Getter for insightsUserRoles resource */ + get insightsUserRoles(): InsightsUserRolesListInstance; + /** Getter for interaction resource */ + get interaction(): InteractionListInstance; + /** Getter for provisioningStatus resource */ + get provisioningStatus(): ProvisioningStatusListInstance; + /** Getter for webChannel resource */ + get webChannel(): WebChannelListInstance; +} diff --git a/node_modules/twilio/lib/rest/flexApi/V1.js b/node_modules/twilio/lib/rest/flexApi/V1.js new file mode 100644 index 00000000..2b7afd9e --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/V1.js @@ -0,0 +1,165 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const assessments_1 = require("./v1/assessments"); +const channel_1 = require("./v1/channel"); +const configuration_1 = require("./v1/configuration"); +const flexFlow_1 = require("./v1/flexFlow"); +const insightsAssessmentsComment_1 = require("./v1/insightsAssessmentsComment"); +const insightsConversationalAi_1 = require("./v1/insightsConversationalAi"); +const insightsConversationalAiReportInsights_1 = require("./v1/insightsConversationalAiReportInsights"); +const insightsConversations_1 = require("./v1/insightsConversations"); +const insightsQuestionnaires_1 = require("./v1/insightsQuestionnaires"); +const insightsQuestionnairesCategory_1 = require("./v1/insightsQuestionnairesCategory"); +const insightsQuestionnairesQuestion_1 = require("./v1/insightsQuestionnairesQuestion"); +const insightsSegments_1 = require("./v1/insightsSegments"); +const insightsSession_1 = require("./v1/insightsSession"); +const insightsSettingsAnswerSets_1 = require("./v1/insightsSettingsAnswerSets"); +const insightsSettingsComment_1 = require("./v1/insightsSettingsComment"); +const insightsUserRoles_1 = require("./v1/insightsUserRoles"); +const interaction_1 = require("./v1/interaction"); +const provisioningStatus_1 = require("./v1/provisioningStatus"); +const webChannel_1 = require("./v1/webChannel"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of FlexApi + * + * @param domain - The Twilio (Twilio.FlexApi) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for assessments resource */ + get assessments() { + this._assessments = this._assessments || (0, assessments_1.AssessmentsListInstance)(this); + return this._assessments; + } + /** Getter for channel resource */ + get channel() { + this._channel = this._channel || (0, channel_1.ChannelListInstance)(this); + return this._channel; + } + /** Getter for configuration resource */ + get configuration() { + this._configuration = + this._configuration || (0, configuration_1.ConfigurationListInstance)(this); + return this._configuration; + } + /** Getter for flexFlow resource */ + get flexFlow() { + this._flexFlow = this._flexFlow || (0, flexFlow_1.FlexFlowListInstance)(this); + return this._flexFlow; + } + /** Getter for insightsAssessmentsComment resource */ + get insightsAssessmentsComment() { + this._insightsAssessmentsComment = + this._insightsAssessmentsComment || + (0, insightsAssessmentsComment_1.InsightsAssessmentsCommentListInstance)(this); + return this._insightsAssessmentsComment; + } + /** Getter for insightsConversationalAi resource */ + get insightsConversationalAi() { + this._insightsConversationalAi = + this._insightsConversationalAi || + (0, insightsConversationalAi_1.InsightsConversationalAiListInstance)(this); + return this._insightsConversationalAi; + } + /** Getter for insightsConversationalAiReportInsights resource */ + get insightsConversationalAiReportInsights() { + this._insightsConversationalAiReportInsights = + this._insightsConversationalAiReportInsights || + (0, insightsConversationalAiReportInsights_1.InsightsConversationalAiReportInsightsListInstance)(this); + return this._insightsConversationalAiReportInsights; + } + /** Getter for insightsConversations resource */ + get insightsConversations() { + this._insightsConversations = + this._insightsConversations || (0, insightsConversations_1.InsightsConversationsListInstance)(this); + return this._insightsConversations; + } + /** Getter for insightsQuestionnaires resource */ + get insightsQuestionnaires() { + this._insightsQuestionnaires = + this._insightsQuestionnaires || (0, insightsQuestionnaires_1.InsightsQuestionnairesListInstance)(this); + return this._insightsQuestionnaires; + } + /** Getter for insightsQuestionnairesCategory resource */ + get insightsQuestionnairesCategory() { + this._insightsQuestionnairesCategory = + this._insightsQuestionnairesCategory || + (0, insightsQuestionnairesCategory_1.InsightsQuestionnairesCategoryListInstance)(this); + return this._insightsQuestionnairesCategory; + } + /** Getter for insightsQuestionnairesQuestion resource */ + get insightsQuestionnairesQuestion() { + this._insightsQuestionnairesQuestion = + this._insightsQuestionnairesQuestion || + (0, insightsQuestionnairesQuestion_1.InsightsQuestionnairesQuestionListInstance)(this); + return this._insightsQuestionnairesQuestion; + } + /** Getter for insightsSegments resource */ + get insightsSegments() { + this._insightsSegments = + this._insightsSegments || (0, insightsSegments_1.InsightsSegmentsListInstance)(this); + return this._insightsSegments; + } + /** Getter for insightsSession resource */ + get insightsSession() { + this._insightsSession = + this._insightsSession || (0, insightsSession_1.InsightsSessionListInstance)(this); + return this._insightsSession; + } + /** Getter for insightsSettingsAnswerSets resource */ + get insightsSettingsAnswerSets() { + this._insightsSettingsAnswerSets = + this._insightsSettingsAnswerSets || + (0, insightsSettingsAnswerSets_1.InsightsSettingsAnswerSetsListInstance)(this); + return this._insightsSettingsAnswerSets; + } + /** Getter for insightsSettingsComment resource */ + get insightsSettingsComment() { + this._insightsSettingsComment = + this._insightsSettingsComment || + (0, insightsSettingsComment_1.InsightsSettingsCommentListInstance)(this); + return this._insightsSettingsComment; + } + /** Getter for insightsUserRoles resource */ + get insightsUserRoles() { + this._insightsUserRoles = + this._insightsUserRoles || (0, insightsUserRoles_1.InsightsUserRolesListInstance)(this); + return this._insightsUserRoles; + } + /** Getter for interaction resource */ + get interaction() { + this._interaction = this._interaction || (0, interaction_1.InteractionListInstance)(this); + return this._interaction; + } + /** Getter for provisioningStatus resource */ + get provisioningStatus() { + this._provisioningStatus = + this._provisioningStatus || (0, provisioningStatus_1.ProvisioningStatusListInstance)(this); + return this._provisioningStatus; + } + /** Getter for webChannel resource */ + get webChannel() { + this._webChannel = this._webChannel || (0, webChannel_1.WebChannelListInstance)(this); + return this._webChannel; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/flexApi/V2.d.ts b/node_modules/twilio/lib/rest/flexApi/V2.d.ts new file mode 100644 index 00000000..78f60e3e --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/V2.d.ts @@ -0,0 +1,15 @@ +import FlexApiBase from "../FlexApiBase"; +import Version from "../../base/Version"; +import { WebChannelsListInstance } from "./v2/webChannels"; +export default class V2 extends Version { + /** + * Initialize the V2 version of FlexApi + * + * @param domain - The Twilio (Twilio.FlexApi) domain + */ + constructor(domain: FlexApiBase); + /** webChannels - { Twilio.FlexApi.V2.WebChannelsListInstance } resource */ + protected _webChannels?: WebChannelsListInstance; + /** Getter for webChannels resource */ + get webChannels(): WebChannelsListInstance; +} diff --git a/node_modules/twilio/lib/rest/flexApi/V2.js b/node_modules/twilio/lib/rest/flexApi/V2.js new file mode 100644 index 00000000..2e505558 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/V2.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const webChannels_1 = require("./v2/webChannels"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of FlexApi + * + * @param domain - The Twilio (Twilio.FlexApi) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for webChannels resource */ + get webChannels() { + this._webChannels = this._webChannels || (0, webChannels_1.WebChannelsListInstance)(this); + return this._webChannels; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/assessments.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/assessments.d.ts new file mode 100644 index 00000000..a00b5133 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/assessments.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to update a AssessmentsInstance + */ +export interface AssessmentsContextUpdateOptions { + /** The offset of the conversation */ + offset: number; + /** The answer text selected by user */ + answerText: string; + /** The id of the answer selected by user */ + answerId: string; + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to create a AssessmentsInstance + */ +export interface AssessmentsListInstanceCreateOptions { + /** The SID of the category */ + categorySid: string; + /** The name of the category */ + categoryName: string; + /** Segment Id of the conversation */ + segmentId: string; + /** The id of the Agent */ + agentId: string; + /** The offset of the conversation. */ + offset: number; + /** The question SID selected for assessment */ + metricId: string; + /** The question name of the assessment */ + metricName: string; + /** The answer text selected by user */ + answerText: string; + /** The id of the answer selected by user */ + answerId: string; + /** Questionnaire SID of the associated question */ + questionnaireSid: string; + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to each + */ +export interface AssessmentsListInstanceEachOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The id of the segment. */ + segmentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AssessmentsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AssessmentsListInstanceOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The id of the segment. */ + segmentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AssessmentsListInstancePageOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The id of the segment. */ + segmentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AssessmentsContext { + /** + * Update a AssessmentsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssessmentsInstance + */ + update(params: AssessmentsContextUpdateOptions, callback?: (error: Error | null, item?: AssessmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AssessmentsContextSolution { + assessmentSid: string; +} +export declare class AssessmentsContextImpl implements AssessmentsContext { + protected _version: V1; + protected _solution: AssessmentsContextSolution; + protected _uri: string; + constructor(_version: V1, assessmentSid: string); + update(params: AssessmentsContextUpdateOptions, callback?: (error: Error | null, item?: AssessmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AssessmentsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AssessmentsPayload extends TwilioResponsePayload { + assessments: AssessmentsResource[]; +} +interface AssessmentsResource { + account_sid: string; + assessment_sid: string; + offset: number; + report: boolean; + weight: number; + agent_id: string; + segment_id: string; + user_name: string; + user_email: string; + answer_text: string; + answer_id: string; + assessment: any; + timestamp: number; + url: string; +} +export declare class AssessmentsInstance { + protected _version: V1; + protected _solution: AssessmentsContextSolution; + protected _context?: AssessmentsContext; + constructor(_version: V1, payload: AssessmentsResource, assessmentSid?: string); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The SID of the assessment + */ + assessmentSid: string; + /** + * Offset of the conversation + */ + offset: number; + /** + * The flag indicating if this assessment is part of report + */ + report: boolean; + /** + * The weightage given to this comment + */ + weight: number; + /** + * The id of the Agent + */ + agentId: string; + /** + * Segment Id of conversation + */ + segmentId: string; + /** + * The name of the user. + */ + userName: string; + /** + * The email id of the user. + */ + userEmail: string; + /** + * The answer text selected by user + */ + answerText: string; + /** + * The id of the answer selected by user + */ + answerId: string; + /** + * Assessment Details associated with an assessment + */ + assessment: any; + timestamp: number; + url: string; + private get _proxy(); + /** + * Update a AssessmentsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssessmentsInstance + */ + update(params: AssessmentsContextUpdateOptions, callback?: (error: Error | null, item?: AssessmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + assessmentSid: string; + offset: number; + report: boolean; + weight: number; + agentId: string; + segmentId: string; + userName: string; + userEmail: string; + answerText: string; + answerId: string; + assessment: any; + timestamp: number; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AssessmentsSolution { +} +export interface AssessmentsListInstance { + _version: V1; + _solution: AssessmentsSolution; + _uri: string; + (assessmentSid: string): AssessmentsContext; + get(assessmentSid: string): AssessmentsContext; + /** + * Create a AssessmentsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssessmentsInstance + */ + create(params: AssessmentsListInstanceCreateOptions, callback?: (error: Error | null, item?: AssessmentsInstance) => any): Promise; + /** + * Streams AssessmentsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssessmentsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AssessmentsInstance, done: (err?: Error) => void) => void): void; + each(params: AssessmentsListInstanceEachOptions, callback?: (item: AssessmentsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AssessmentsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AssessmentsPage) => any): Promise; + /** + * Lists AssessmentsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssessmentsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AssessmentsInstance[]) => any): Promise; + list(params: AssessmentsListInstanceOptions, callback?: (error: Error | null, items: AssessmentsInstance[]) => any): Promise; + /** + * Retrieve a single page of AssessmentsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssessmentsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AssessmentsPage) => any): Promise; + page(params: AssessmentsListInstancePageOptions, callback?: (error: Error | null, items: AssessmentsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AssessmentsListInstance(version: V1): AssessmentsListInstance; +export declare class AssessmentsPage extends Page { + /** + * Initialize the AssessmentsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AssessmentsSolution); + /** + * Build an instance of AssessmentsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AssessmentsResource): AssessmentsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/assessments.js b/node_modules/twilio/lib/rest/flexApi/v1/assessments.js new file mode 100644 index 00000000..2466fb73 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/assessments.js @@ -0,0 +1,277 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssessmentsPage = exports.AssessmentsListInstance = exports.AssessmentsInstance = exports.AssessmentsContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class AssessmentsContextImpl { + constructor(_version, assessmentSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(assessmentSid)) { + throw new Error("Parameter 'assessmentSid' is not valid."); + } + this._solution = { assessmentSid }; + this._uri = `/Insights/QualityManagement/Assessments/${assessmentSid}`; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["offset"] === null || params["offset"] === undefined) { + throw new Error("Required parameter \"params['offset']\" missing."); + } + if (params["answerText"] === null || params["answerText"] === undefined) { + throw new Error("Required parameter \"params['answerText']\" missing."); + } + if (params["answerId"] === null || params["answerId"] === undefined) { + throw new Error("Required parameter \"params['answerId']\" missing."); + } + let data = {}; + data["Offset"] = params["offset"]; + data["AnswerText"] = params["answerText"]; + data["AnswerId"] = params["answerId"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssessmentsInstance(operationVersion, payload, instance._solution.assessmentSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssessmentsContextImpl = AssessmentsContextImpl; +class AssessmentsInstance { + constructor(_version, payload, assessmentSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.assessmentSid = payload.assessment_sid; + this.offset = payload.offset; + this.report = payload.report; + this.weight = payload.weight; + this.agentId = payload.agent_id; + this.segmentId = payload.segment_id; + this.userName = payload.user_name; + this.userEmail = payload.user_email; + this.answerText = payload.answer_text; + this.answerId = payload.answer_id; + this.assessment = payload.assessment; + this.timestamp = payload.timestamp; + this.url = payload.url; + this._solution = { assessmentSid: assessmentSid || this.assessmentSid }; + } + get _proxy() { + this._context = + this._context || + new AssessmentsContextImpl(this._version, this._solution.assessmentSid); + return this._context; + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + assessmentSid: this.assessmentSid, + offset: this.offset, + report: this.report, + weight: this.weight, + agentId: this.agentId, + segmentId: this.segmentId, + userName: this.userName, + userEmail: this.userEmail, + answerText: this.answerText, + answerId: this.answerId, + assessment: this.assessment, + timestamp: this.timestamp, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssessmentsInstance = AssessmentsInstance; +function AssessmentsListInstance(version) { + const instance = ((assessmentSid) => instance.get(assessmentSid)); + instance.get = function get(assessmentSid) { + return new AssessmentsContextImpl(version, assessmentSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/QualityManagement/Assessments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["categorySid"] === null || params["categorySid"] === undefined) { + throw new Error("Required parameter \"params['categorySid']\" missing."); + } + if (params["categoryName"] === null || + params["categoryName"] === undefined) { + throw new Error("Required parameter \"params['categoryName']\" missing."); + } + if (params["segmentId"] === null || params["segmentId"] === undefined) { + throw new Error("Required parameter \"params['segmentId']\" missing."); + } + if (params["agentId"] === null || params["agentId"] === undefined) { + throw new Error("Required parameter \"params['agentId']\" missing."); + } + if (params["offset"] === null || params["offset"] === undefined) { + throw new Error("Required parameter \"params['offset']\" missing."); + } + if (params["metricId"] === null || params["metricId"] === undefined) { + throw new Error("Required parameter \"params['metricId']\" missing."); + } + if (params["metricName"] === null || params["metricName"] === undefined) { + throw new Error("Required parameter \"params['metricName']\" missing."); + } + if (params["answerText"] === null || params["answerText"] === undefined) { + throw new Error("Required parameter \"params['answerText']\" missing."); + } + if (params["answerId"] === null || params["answerId"] === undefined) { + throw new Error("Required parameter \"params['answerId']\" missing."); + } + if (params["questionnaireSid"] === null || + params["questionnaireSid"] === undefined) { + throw new Error("Required parameter \"params['questionnaireSid']\" missing."); + } + let data = {}; + data["CategorySid"] = params["categorySid"]; + data["CategoryName"] = params["categoryName"]; + data["SegmentId"] = params["segmentId"]; + data["AgentId"] = params["agentId"]; + data["Offset"] = params["offset"]; + data["MetricId"] = params["metricId"]; + data["MetricName"] = params["metricName"]; + data["AnswerText"] = params["answerText"]; + data["AnswerId"] = params["answerId"]; + data["QuestionnaireSid"] = params["questionnaireSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssessmentsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["segmentId"] !== undefined) + data["SegmentId"] = params["segmentId"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssessmentsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AssessmentsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AssessmentsListInstance = AssessmentsListInstance; +class AssessmentsPage extends Page_1.default { + /** + * Initialize the AssessmentsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AssessmentsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AssessmentsInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssessmentsPage = AssessmentsPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/channel.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/channel.d.ts new file mode 100644 index 00000000..d1872395 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/channel.d.ts @@ -0,0 +1,280 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to create a ChannelInstance + */ +export interface ChannelListInstanceCreateOptions { + /** The SID of the Flex Flow. */ + flexFlowSid: string; + /** The `identity` value that uniquely identifies the new resource\\\'s chat User. */ + identity: string; + /** The chat participant\\\'s friendly name. */ + chatUserFriendlyName: string; + /** The chat channel\\\'s friendly name. */ + chatFriendlyName: string; + /** The Target Contact Identity, for example the phone number of an SMS. */ + target?: string; + /** The chat channel\\\'s unique name. */ + chatUniqueName?: string; + /** The pre-engagement data. */ + preEngagementData?: string; + /** The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external` */ + taskSid?: string; + /** The Task attributes to be added for the TaskRouter Task. */ + taskAttributes?: string; + /** Whether to create the channel as long-lived. */ + longLived?: boolean; +} +/** + * Options to pass to each + */ +export interface ChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ChannelContext { + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ChannelContextSolution { + sid: string; +} +export declare class ChannelContextImpl implements ChannelContext { + protected _version: V1; + protected _solution: ChannelContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ChannelPayload extends TwilioResponsePayload { + flex_chat_channels: ChannelResource[]; +} +interface ChannelResource { + account_sid: string; + flex_flow_sid: string; + sid: string; + user_sid: string; + task_sid: string; + url: string; + date_created: Date; + date_updated: Date; +} +export declare class ChannelInstance { + protected _version: V1; + protected _solution: ChannelContextSolution; + protected _context?: ChannelContext; + constructor(_version: V1, payload: ChannelResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Channel resource and owns this Workflow. + */ + accountSid: string; + /** + * The SID of the Flex Flow. + */ + flexFlowSid: string; + /** + * The unique string that we created to identify the Channel resource. + */ + sid: string; + /** + * The SID of the chat user. + */ + userSid: string; + /** + * The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external` + */ + taskSid: string; + /** + * The absolute URL of the Flex chat channel resource. + */ + url: string; + /** + * The date and time in GMT when the Flex chat channel was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Flex chat channel was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + flexFlowSid: string; + sid: string; + userSid: string; + taskSid: string; + url: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ChannelSolution { +} +export interface ChannelListInstance { + _version: V1; + _solution: ChannelSolution; + _uri: string; + (sid: string): ChannelContext; + get(sid: string): ChannelContext; + /** + * Create a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(params: ChannelListInstanceCreateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Streams ChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + each(params: ChannelListInstanceEachOptions, callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Lists ChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + list(params: ChannelListInstanceOptions, callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ChannelPage) => any): Promise; + page(params: ChannelListInstancePageOptions, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ChannelListInstance(version: V1): ChannelListInstance; +export declare class ChannelPage extends Page { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ChannelSolution); + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ChannelResource): ChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/channel.js b/node_modules/twilio/lib/rest/flexApi/v1/channel.js new file mode 100644 index 00000000..32c72e1f --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/channel.js @@ -0,0 +1,251 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChannelPage = exports.ChannelListInstance = exports.ChannelInstance = exports.ChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class ChannelContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Channels/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelContextImpl = ChannelContextImpl; +class ChannelInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.flexFlowSid = payload.flex_flow_sid; + this.sid = payload.sid; + this.userSid = payload.user_sid; + this.taskSid = payload.task_sid; + this.url = payload.url; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ChannelContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + flexFlowSid: this.flexFlowSid, + sid: this.sid, + userSid: this.userSid, + taskSid: this.taskSid, + url: this.url, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelInstance = ChannelInstance; +function ChannelListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ChannelContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Channels`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["flexFlowSid"] === null || params["flexFlowSid"] === undefined) { + throw new Error("Required parameter \"params['flexFlowSid']\" missing."); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + if (params["chatUserFriendlyName"] === null || + params["chatUserFriendlyName"] === undefined) { + throw new Error("Required parameter \"params['chatUserFriendlyName']\" missing."); + } + if (params["chatFriendlyName"] === null || + params["chatFriendlyName"] === undefined) { + throw new Error("Required parameter \"params['chatFriendlyName']\" missing."); + } + let data = {}; + data["FlexFlowSid"] = params["flexFlowSid"]; + data["Identity"] = params["identity"]; + data["ChatUserFriendlyName"] = params["chatUserFriendlyName"]; + data["ChatFriendlyName"] = params["chatFriendlyName"]; + if (params["target"] !== undefined) + data["Target"] = params["target"]; + if (params["chatUniqueName"] !== undefined) + data["ChatUniqueName"] = params["chatUniqueName"]; + if (params["preEngagementData"] !== undefined) + data["PreEngagementData"] = params["preEngagementData"]; + if (params["taskSid"] !== undefined) + data["TaskSid"] = params["taskSid"]; + if (params["taskAttributes"] !== undefined) + data["TaskAttributes"] = params["taskAttributes"]; + if (params["longLived"] !== undefined) + data["LongLived"] = serialize.bool(params["longLived"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ChannelListInstance = ChannelListInstance; +class ChannelPage extends Page_1.default { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ChannelInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelPage = ChannelPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/configuration.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/configuration.d.ts new file mode 100644 index 00000000..0bf8ee9e --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/configuration.d.ts @@ -0,0 +1,392 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export type ConfigurationStatus = "ok" | "inprogress" | "notstarted"; +/** + * Options to pass to fetch a ConfigurationInstance + */ +export interface ConfigurationContextFetchOptions { + /** The Pinned UI version of the Configuration resource to fetch. */ + uiVersion?: string; +} +export interface ConfigurationContext { + /** + * Fetch a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Fetch a ConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(params: ConfigurationContextFetchOptions, callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConfigurationContextSolution { +} +export declare class ConfigurationContextImpl implements ConfigurationContext { + protected _version: V1; + protected _solution: ConfigurationContextSolution; + protected _uri: string; + constructor(_version: V1); + fetch(params?: ConfigurationContextFetchOptions | ((error: Error | null, item?: ConfigurationInstance) => any), callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConfigurationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConfigurationResource { + account_sid: string; + date_created: Date; + date_updated: Date; + attributes: any; + status: ConfigurationStatus; + taskrouter_workspace_sid: string; + taskrouter_target_workflow_sid: string; + taskrouter_target_taskqueue_sid: string; + taskrouter_taskqueues: Array; + taskrouter_skills: Array; + taskrouter_worker_channels: any; + taskrouter_worker_attributes: any; + taskrouter_offline_activity_sid: string; + runtime_domain: string; + messaging_service_instance_sid: string; + chat_service_instance_sid: string; + flex_service_instance_sid: string; + flex_instance_sid: string; + ui_language: string; + ui_attributes: any; + ui_dependencies: any; + ui_version: string; + service_version: string; + call_recording_enabled: boolean; + call_recording_webhook_url: string; + crm_enabled: boolean; + crm_type: string; + crm_callback_url: string; + crm_fallback_url: string; + crm_attributes: any; + public_attributes: any; + plugin_service_enabled: boolean; + plugin_service_attributes: any; + integrations: Array; + outbound_call_flows: any; + serverless_service_sids: Array; + queue_stats_configuration: any; + notifications: any; + markdown: any; + url: string; + flex_insights_hr: any; + flex_insights_drilldown: boolean; + flex_url: string; + channel_configs: Array; + debugger_integration: any; + flex_ui_status_report: any; + agent_conv_end_methods: any; + citrix_voice_vdi: any; + offline_config: any; +} +export declare class ConfigurationInstance { + protected _version: V1; + protected _solution: ConfigurationContextSolution; + protected _context?: ConfigurationContext; + constructor(_version: V1, payload: ConfigurationResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Configuration resource. + */ + accountSid: string; + /** + * The date and time in GMT when the Configuration resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Configuration resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * An object that contains application-specific data. + */ + attributes: any; + status: ConfigurationStatus; + /** + * The SID of the TaskRouter Workspace. + */ + taskrouterWorkspaceSid: string; + /** + * The SID of the TaskRouter target Workflow. + */ + taskrouterTargetWorkflowSid: string; + /** + * The SID of the TaskRouter Target TaskQueue. + */ + taskrouterTargetTaskqueueSid: string; + /** + * The list of TaskRouter TaskQueues. + */ + taskrouterTaskqueues: Array; + /** + * The Skill description for TaskRouter workers. + */ + taskrouterSkills: Array; + /** + * The TaskRouter default channel capacities and availability for workers. + */ + taskrouterWorkerChannels: any; + /** + * The TaskRouter Worker attributes. + */ + taskrouterWorkerAttributes: any; + /** + * The TaskRouter SID of the offline activity. + */ + taskrouterOfflineActivitySid: string; + /** + * The URL where the Flex instance is hosted. + */ + runtimeDomain: string; + /** + * The SID of the Messaging service instance. + */ + messagingServiceInstanceSid: string; + /** + * The SID of the chat service this user belongs to. + */ + chatServiceInstanceSid: string; + /** + * The SID of the Flex service instance. + */ + flexServiceInstanceSid: string; + /** + * The SID of the Flex instance. + */ + flexInstanceSid: string; + /** + * The primary language of the Flex UI. + */ + uiLanguage: string; + /** + * The object that describes Flex UI characteristics and settings. + */ + uiAttributes: any; + /** + * The object that defines the NPM packages and versions to be used in Hosted Flex. + */ + uiDependencies: any; + /** + * The Pinned UI version. + */ + uiVersion: string; + /** + * The Flex Service version. + */ + serviceVersion: string; + /** + * Whether call recording is enabled. + */ + callRecordingEnabled: boolean; + /** + * The call recording webhook URL. + */ + callRecordingWebhookUrl: string; + /** + * Whether CRM is present for Flex. + */ + crmEnabled: boolean; + /** + * The CRM type. + */ + crmType: string; + /** + * The CRM Callback URL. + */ + crmCallbackUrl: string; + /** + * The CRM Fallback URL. + */ + crmFallbackUrl: string; + /** + * An object that contains the CRM attributes. + */ + crmAttributes: any; + /** + * The list of public attributes, which are visible to unauthenticated clients. + */ + publicAttributes: any; + /** + * Whether the plugin service enabled. + */ + pluginServiceEnabled: boolean; + /** + * The plugin service attributes. + */ + pluginServiceAttributes: any; + /** + * A list of objects that contain the configurations for the Integrations supported in this configuration. + */ + integrations: Array; + /** + * The list of outbound call flows. + */ + outboundCallFlows: any; + /** + * The list of serverless service SIDs. + */ + serverlessServiceSids: Array; + /** + * Configurable parameters for Queues Statistics. + */ + queueStatsConfiguration: any; + /** + * Configurable parameters for Notifications. + */ + notifications: any; + /** + * Configurable parameters for Markdown. + */ + markdown: any; + /** + * The absolute URL of the Configuration resource. + */ + url: string; + /** + * Object with enabled/disabled flag with list of workspaces. + */ + flexInsightsHr: any; + /** + * Setting this to true will redirect Flex UI to the URL set in flex_url + */ + flexInsightsDrilldown: boolean; + /** + * URL to redirect to in case drilldown is enabled. + */ + flexUrl: string; + /** + * Settings for different limits for Flex Conversations channels attachments. + */ + channelConfigs: Array; + /** + * Configurable parameters for Debugger Integration. + */ + debuggerIntegration: any; + /** + * Configurable parameters for Flex UI Status report. + */ + flexUiStatusReport: any; + /** + * Agent conversation end methods. + */ + agentConvEndMethods: any; + /** + * Citrix voice vdi configuration and settings. + */ + citrixVoiceVdi: any; + /** + * Presence and presence ttl configuration + */ + offlineConfig: any; + private get _proxy(); + /** + * Fetch a ConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Fetch a ConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConfigurationInstance + */ + fetch(params: ConfigurationContextFetchOptions, callback?: (error: Error | null, item?: ConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + attributes: any; + status: ConfigurationStatus; + taskrouterWorkspaceSid: string; + taskrouterTargetWorkflowSid: string; + taskrouterTargetTaskqueueSid: string; + taskrouterTaskqueues: any[]; + taskrouterSkills: any[]; + taskrouterWorkerChannels: any; + taskrouterWorkerAttributes: any; + taskrouterOfflineActivitySid: string; + runtimeDomain: string; + messagingServiceInstanceSid: string; + chatServiceInstanceSid: string; + flexServiceInstanceSid: string; + flexInstanceSid: string; + uiLanguage: string; + uiAttributes: any; + uiDependencies: any; + uiVersion: string; + serviceVersion: string; + callRecordingEnabled: boolean; + callRecordingWebhookUrl: string; + crmEnabled: boolean; + crmType: string; + crmCallbackUrl: string; + crmFallbackUrl: string; + crmAttributes: any; + publicAttributes: any; + pluginServiceEnabled: boolean; + pluginServiceAttributes: any; + integrations: any[]; + outboundCallFlows: any; + serverlessServiceSids: string[]; + queueStatsConfiguration: any; + notifications: any; + markdown: any; + url: string; + flexInsightsHr: any; + flexInsightsDrilldown: boolean; + flexUrl: string; + channelConfigs: any[]; + debuggerIntegration: any; + flexUiStatusReport: any; + agentConvEndMethods: any; + citrixVoiceVdi: any; + offlineConfig: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConfigurationSolution { +} +export interface ConfigurationListInstance { + _version: V1; + _solution: ConfigurationSolution; + _uri: string; + (): ConfigurationContext; + get(): ConfigurationContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConfigurationListInstance(version: V1): ConfigurationListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/configuration.js b/node_modules/twilio/lib/rest/flexApi/v1/configuration.js new file mode 100644 index 00000000..49f06a0b --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/configuration.js @@ -0,0 +1,203 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConfigurationListInstance = exports.ConfigurationInstance = exports.ConfigurationContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class ConfigurationContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Configuration`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uiVersion"] !== undefined) + data["UiVersion"] = params["uiVersion"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConfigurationContextImpl = ConfigurationContextImpl; +class ConfigurationInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.attributes = payload.attributes; + this.status = payload.status; + this.taskrouterWorkspaceSid = payload.taskrouter_workspace_sid; + this.taskrouterTargetWorkflowSid = payload.taskrouter_target_workflow_sid; + this.taskrouterTargetTaskqueueSid = payload.taskrouter_target_taskqueue_sid; + this.taskrouterTaskqueues = payload.taskrouter_taskqueues; + this.taskrouterSkills = payload.taskrouter_skills; + this.taskrouterWorkerChannels = payload.taskrouter_worker_channels; + this.taskrouterWorkerAttributes = payload.taskrouter_worker_attributes; + this.taskrouterOfflineActivitySid = payload.taskrouter_offline_activity_sid; + this.runtimeDomain = payload.runtime_domain; + this.messagingServiceInstanceSid = payload.messaging_service_instance_sid; + this.chatServiceInstanceSid = payload.chat_service_instance_sid; + this.flexServiceInstanceSid = payload.flex_service_instance_sid; + this.flexInstanceSid = payload.flex_instance_sid; + this.uiLanguage = payload.ui_language; + this.uiAttributes = payload.ui_attributes; + this.uiDependencies = payload.ui_dependencies; + this.uiVersion = payload.ui_version; + this.serviceVersion = payload.service_version; + this.callRecordingEnabled = payload.call_recording_enabled; + this.callRecordingWebhookUrl = payload.call_recording_webhook_url; + this.crmEnabled = payload.crm_enabled; + this.crmType = payload.crm_type; + this.crmCallbackUrl = payload.crm_callback_url; + this.crmFallbackUrl = payload.crm_fallback_url; + this.crmAttributes = payload.crm_attributes; + this.publicAttributes = payload.public_attributes; + this.pluginServiceEnabled = payload.plugin_service_enabled; + this.pluginServiceAttributes = payload.plugin_service_attributes; + this.integrations = payload.integrations; + this.outboundCallFlows = payload.outbound_call_flows; + this.serverlessServiceSids = payload.serverless_service_sids; + this.queueStatsConfiguration = payload.queue_stats_configuration; + this.notifications = payload.notifications; + this.markdown = payload.markdown; + this.url = payload.url; + this.flexInsightsHr = payload.flex_insights_hr; + this.flexInsightsDrilldown = payload.flex_insights_drilldown; + this.flexUrl = payload.flex_url; + this.channelConfigs = payload.channel_configs; + this.debuggerIntegration = payload.debugger_integration; + this.flexUiStatusReport = payload.flex_ui_status_report; + this.agentConvEndMethods = payload.agent_conv_end_methods; + this.citrixVoiceVdi = payload.citrix_voice_vdi; + this.offlineConfig = payload.offline_config; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new ConfigurationContextImpl(this._version); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + attributes: this.attributes, + status: this.status, + taskrouterWorkspaceSid: this.taskrouterWorkspaceSid, + taskrouterTargetWorkflowSid: this.taskrouterTargetWorkflowSid, + taskrouterTargetTaskqueueSid: this.taskrouterTargetTaskqueueSid, + taskrouterTaskqueues: this.taskrouterTaskqueues, + taskrouterSkills: this.taskrouterSkills, + taskrouterWorkerChannels: this.taskrouterWorkerChannels, + taskrouterWorkerAttributes: this.taskrouterWorkerAttributes, + taskrouterOfflineActivitySid: this.taskrouterOfflineActivitySid, + runtimeDomain: this.runtimeDomain, + messagingServiceInstanceSid: this.messagingServiceInstanceSid, + chatServiceInstanceSid: this.chatServiceInstanceSid, + flexServiceInstanceSid: this.flexServiceInstanceSid, + flexInstanceSid: this.flexInstanceSid, + uiLanguage: this.uiLanguage, + uiAttributes: this.uiAttributes, + uiDependencies: this.uiDependencies, + uiVersion: this.uiVersion, + serviceVersion: this.serviceVersion, + callRecordingEnabled: this.callRecordingEnabled, + callRecordingWebhookUrl: this.callRecordingWebhookUrl, + crmEnabled: this.crmEnabled, + crmType: this.crmType, + crmCallbackUrl: this.crmCallbackUrl, + crmFallbackUrl: this.crmFallbackUrl, + crmAttributes: this.crmAttributes, + publicAttributes: this.publicAttributes, + pluginServiceEnabled: this.pluginServiceEnabled, + pluginServiceAttributes: this.pluginServiceAttributes, + integrations: this.integrations, + outboundCallFlows: this.outboundCallFlows, + serverlessServiceSids: this.serverlessServiceSids, + queueStatsConfiguration: this.queueStatsConfiguration, + notifications: this.notifications, + markdown: this.markdown, + url: this.url, + flexInsightsHr: this.flexInsightsHr, + flexInsightsDrilldown: this.flexInsightsDrilldown, + flexUrl: this.flexUrl, + channelConfigs: this.channelConfigs, + debuggerIntegration: this.debuggerIntegration, + flexUiStatusReport: this.flexUiStatusReport, + agentConvEndMethods: this.agentConvEndMethods, + citrixVoiceVdi: this.citrixVoiceVdi, + offlineConfig: this.offlineConfig, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConfigurationInstance = ConfigurationInstance; +function ConfigurationListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new ConfigurationContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConfigurationListInstance = ConfigurationListInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/flexFlow.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/flexFlow.d.ts new file mode 100644 index 00000000..830699be --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/flexFlow.d.ts @@ -0,0 +1,406 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type FlexFlowChannelType = "web" | "sms" | "facebook" | "whatsapp" | "line" | "custom"; +export type FlexFlowIntegrationType = "studio" | "external" | "task"; +/** + * Options to pass to update a FlexFlowInstance + */ +export interface FlexFlowContextUpdateOptions { + /** A descriptive string that you create to describe the Flex Flow resource. */ + friendlyName?: string; + /** The SID of the chat service. */ + chatServiceSid?: string; + /** */ + channelType?: FlexFlowChannelType; + /** The channel contact\\\'s Identity. */ + contactIdentity?: string; + /** Whether the new Flex Flow is enabled. */ + enabled?: boolean; + /** */ + integrationType?: FlexFlowIntegrationType; + /** The SID of the Studio Flow. Required when `integrationType` is `studio`. */ + "integration.flowSid"?: string; + /** The URL of the external webhook. Required when `integrationType` is `external`. */ + "integration.url"?: string; + /** The Workspace SID for a new Task. Required when `integrationType` is `task`. */ + "integration.workspaceSid"?: string; + /** The Workflow SID for a new Task. Required when `integrationType` is `task`. */ + "integration.workflowSid"?: string; + /** The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. */ + "integration.channel"?: string; + /** The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. */ + "integration.timeout"?: number; + /** The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. */ + "integration.priority"?: number; + /** In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. */ + "integration.creationOnMessage"?: boolean; + /** When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. */ + longLived?: boolean; + /** When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. */ + janitorEnabled?: boolean; + /** The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. */ + "integration.retryCount"?: number; +} +/** + * Options to pass to create a FlexFlowInstance + */ +export interface FlexFlowListInstanceCreateOptions { + /** A descriptive string that you create to describe the Flex Flow resource. */ + friendlyName: string; + /** The SID of the chat service. */ + chatServiceSid: string; + /** */ + channelType: FlexFlowChannelType; + /** The channel contact\\\'s Identity. */ + contactIdentity?: string; + /** Whether the new Flex Flow is enabled. */ + enabled?: boolean; + /** */ + integrationType?: FlexFlowIntegrationType; + /** The SID of the Studio Flow. Required when `integrationType` is `studio`. */ + "integration.flowSid"?: string; + /** The URL of the external webhook. Required when `integrationType` is `external`. */ + "integration.url"?: string; + /** The Workspace SID for a new Task. Required when `integrationType` is `task`. */ + "integration.workspaceSid"?: string; + /** The Workflow SID for a new Task. Required when `integrationType` is `task`. */ + "integration.workflowSid"?: string; + /** The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. */ + "integration.channel"?: string; + /** The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. */ + "integration.timeout"?: number; + /** The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. */ + "integration.priority"?: number; + /** In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. */ + "integration.creationOnMessage"?: boolean; + /** When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. */ + longLived?: boolean; + /** When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. */ + janitorEnabled?: boolean; + /** The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. */ + "integration.retryCount"?: number; +} +/** + * Options to pass to each + */ +export interface FlexFlowListInstanceEachOptions { + /** The `friendly_name` of the Flex Flow resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FlexFlowInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FlexFlowListInstanceOptions { + /** The `friendly_name` of the Flex Flow resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FlexFlowListInstancePageOptions { + /** The `friendly_name` of the Flex Flow resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FlexFlowContext { + /** + * Remove a FlexFlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FlexFlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlexFlowInstance + */ + fetch(callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + /** + * Update a FlexFlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlexFlowInstance + */ + update(callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + /** + * Update a FlexFlowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlexFlowInstance + */ + update(params: FlexFlowContextUpdateOptions, callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FlexFlowContextSolution { + sid: string; +} +export declare class FlexFlowContextImpl implements FlexFlowContext { + protected _version: V1; + protected _solution: FlexFlowContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + update(params?: FlexFlowContextUpdateOptions | ((error: Error | null, item?: FlexFlowInstance) => any), callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FlexFlowContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FlexFlowPayload extends TwilioResponsePayload { + flex_flows: FlexFlowResource[]; +} +interface FlexFlowResource { + account_sid: string; + date_created: Date; + date_updated: Date; + sid: string; + friendly_name: string; + chat_service_sid: string; + channel_type: FlexFlowChannelType; + contact_identity: string; + enabled: boolean; + integration_type: FlexFlowIntegrationType; + integration: any; + long_lived: boolean; + janitor_enabled: boolean; + url: string; +} +export declare class FlexFlowInstance { + protected _version: V1; + protected _solution: FlexFlowContextSolution; + protected _context?: FlexFlowContext; + constructor(_version: V1, payload: FlexFlowResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Flow resource and owns this Workflow. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The unique string that we created to identify the Flex Flow resource. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SID of the chat service. + */ + chatServiceSid: string; + channelType: FlexFlowChannelType; + /** + * The channel contact\'s Identity. + */ + contactIdentity: string; + /** + * Whether the Flex Flow is enabled. + */ + enabled: boolean; + integrationType: FlexFlowIntegrationType; + /** + * An object that contains specific parameters for the integration. + */ + integration: any; + /** + * When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + */ + longLived: boolean; + /** + * When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + */ + janitorEnabled: boolean; + /** + * The absolute URL of the Flex Flow resource. + */ + url: string; + private get _proxy(); + /** + * Remove a FlexFlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FlexFlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlexFlowInstance + */ + fetch(callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + /** + * Update a FlexFlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlexFlowInstance + */ + update(callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + /** + * Update a FlexFlowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlexFlowInstance + */ + update(params: FlexFlowContextUpdateOptions, callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + sid: string; + friendlyName: string; + chatServiceSid: string; + channelType: FlexFlowChannelType; + contactIdentity: string; + enabled: boolean; + integrationType: FlexFlowIntegrationType; + integration: any; + longLived: boolean; + janitorEnabled: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FlexFlowSolution { +} +export interface FlexFlowListInstance { + _version: V1; + _solution: FlexFlowSolution; + _uri: string; + (sid: string): FlexFlowContext; + get(sid: string): FlexFlowContext; + /** + * Create a FlexFlowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlexFlowInstance + */ + create(params: FlexFlowListInstanceCreateOptions, callback?: (error: Error | null, item?: FlexFlowInstance) => any): Promise; + /** + * Streams FlexFlowInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlexFlowListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FlexFlowInstance, done: (err?: Error) => void) => void): void; + each(params: FlexFlowListInstanceEachOptions, callback?: (item: FlexFlowInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FlexFlowInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FlexFlowPage) => any): Promise; + /** + * Lists FlexFlowInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlexFlowListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FlexFlowInstance[]) => any): Promise; + list(params: FlexFlowListInstanceOptions, callback?: (error: Error | null, items: FlexFlowInstance[]) => any): Promise; + /** + * Retrieve a single page of FlexFlowInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlexFlowListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FlexFlowPage) => any): Promise; + page(params: FlexFlowListInstancePageOptions, callback?: (error: Error | null, items: FlexFlowPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FlexFlowListInstance(version: V1): FlexFlowListInstance; +export declare class FlexFlowPage extends Page { + /** + * Initialize the FlexFlowPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: FlexFlowSolution); + /** + * Build an instance of FlexFlowInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FlexFlowResource): FlexFlowInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/flexFlow.js b/node_modules/twilio/lib/rest/flexApi/v1/flexFlow.js new file mode 100644 index 00000000..d3a898b4 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/flexFlow.js @@ -0,0 +1,336 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FlexFlowPage = exports.FlexFlowListInstance = exports.FlexFlowInstance = exports.FlexFlowContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class FlexFlowContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/FlexFlows/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FlexFlowInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["chatServiceSid"] !== undefined) + data["ChatServiceSid"] = params["chatServiceSid"]; + if (params["channelType"] !== undefined) + data["ChannelType"] = params["channelType"]; + if (params["contactIdentity"] !== undefined) + data["ContactIdentity"] = params["contactIdentity"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + if (params["integrationType"] !== undefined) + data["IntegrationType"] = params["integrationType"]; + if (params["integration.flowSid"] !== undefined) + data["Integration.FlowSid"] = params["integration.flowSid"]; + if (params["integration.url"] !== undefined) + data["Integration.Url"] = params["integration.url"]; + if (params["integration.workspaceSid"] !== undefined) + data["Integration.WorkspaceSid"] = params["integration.workspaceSid"]; + if (params["integration.workflowSid"] !== undefined) + data["Integration.WorkflowSid"] = params["integration.workflowSid"]; + if (params["integration.channel"] !== undefined) + data["Integration.Channel"] = params["integration.channel"]; + if (params["integration.timeout"] !== undefined) + data["Integration.Timeout"] = params["integration.timeout"]; + if (params["integration.priority"] !== undefined) + data["Integration.Priority"] = params["integration.priority"]; + if (params["integration.creationOnMessage"] !== undefined) + data["Integration.CreationOnMessage"] = serialize.bool(params["integration.creationOnMessage"]); + if (params["longLived"] !== undefined) + data["LongLived"] = serialize.bool(params["longLived"]); + if (params["janitorEnabled"] !== undefined) + data["JanitorEnabled"] = serialize.bool(params["janitorEnabled"]); + if (params["integration.retryCount"] !== undefined) + data["Integration.RetryCount"] = params["integration.retryCount"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlexFlowInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlexFlowContextImpl = FlexFlowContextImpl; +class FlexFlowInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.chatServiceSid = payload.chat_service_sid; + this.channelType = payload.channel_type; + this.contactIdentity = payload.contact_identity; + this.enabled = payload.enabled; + this.integrationType = payload.integration_type; + this.integration = payload.integration; + this.longLived = payload.long_lived; + this.janitorEnabled = payload.janitor_enabled; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new FlexFlowContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a FlexFlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a FlexFlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlexFlowInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + sid: this.sid, + friendlyName: this.friendlyName, + chatServiceSid: this.chatServiceSid, + channelType: this.channelType, + contactIdentity: this.contactIdentity, + enabled: this.enabled, + integrationType: this.integrationType, + integration: this.integration, + longLived: this.longLived, + janitorEnabled: this.janitorEnabled, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlexFlowInstance = FlexFlowInstance; +function FlexFlowListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FlexFlowContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/FlexFlows`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["chatServiceSid"] === null || + params["chatServiceSid"] === undefined) { + throw new Error("Required parameter \"params['chatServiceSid']\" missing."); + } + if (params["channelType"] === null || params["channelType"] === undefined) { + throw new Error("Required parameter \"params['channelType']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["ChatServiceSid"] = params["chatServiceSid"]; + data["ChannelType"] = params["channelType"]; + if (params["contactIdentity"] !== undefined) + data["ContactIdentity"] = params["contactIdentity"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + if (params["integrationType"] !== undefined) + data["IntegrationType"] = params["integrationType"]; + if (params["integration.flowSid"] !== undefined) + data["Integration.FlowSid"] = params["integration.flowSid"]; + if (params["integration.url"] !== undefined) + data["Integration.Url"] = params["integration.url"]; + if (params["integration.workspaceSid"] !== undefined) + data["Integration.WorkspaceSid"] = params["integration.workspaceSid"]; + if (params["integration.workflowSid"] !== undefined) + data["Integration.WorkflowSid"] = params["integration.workflowSid"]; + if (params["integration.channel"] !== undefined) + data["Integration.Channel"] = params["integration.channel"]; + if (params["integration.timeout"] !== undefined) + data["Integration.Timeout"] = params["integration.timeout"]; + if (params["integration.priority"] !== undefined) + data["Integration.Priority"] = params["integration.priority"]; + if (params["integration.creationOnMessage"] !== undefined) + data["Integration.CreationOnMessage"] = serialize.bool(params["integration.creationOnMessage"]); + if (params["longLived"] !== undefined) + data["LongLived"] = serialize.bool(params["longLived"]); + if (params["janitorEnabled"] !== undefined) + data["JanitorEnabled"] = serialize.bool(params["janitorEnabled"]); + if (params["integration.retryCount"] !== undefined) + data["Integration.RetryCount"] = params["integration.retryCount"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlexFlowInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlexFlowPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FlexFlowPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FlexFlowListInstance = FlexFlowListInstance; +class FlexFlowPage extends Page_1.default { + /** + * Initialize the FlexFlowPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FlexFlowInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FlexFlowInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlexFlowPage = FlexFlowPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts new file mode 100644 index 00000000..12ac8f74 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts @@ -0,0 +1,251 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to create a InsightsAssessmentsCommentInstance + */ +export interface InsightsAssessmentsCommentListInstanceCreateOptions { + /** The ID of the category */ + categoryId: string; + /** The name of the category */ + categoryName: string; + /** The Assessment comment. */ + comment: string; + /** The id of the segment. */ + segmentId: string; + /** The id of the agent. */ + agentId: string; + /** The offset */ + offset: number; + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to each + */ +export interface InsightsAssessmentsCommentListInstanceEachOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The id of the segment. */ + segmentId?: string; + /** The id of the agent. */ + agentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InsightsAssessmentsCommentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InsightsAssessmentsCommentListInstanceOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The id of the segment. */ + segmentId?: string; + /** The id of the agent. */ + agentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InsightsAssessmentsCommentListInstancePageOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The id of the segment. */ + segmentId?: string; + /** The id of the agent. */ + agentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InsightsAssessmentsCommentSolution { +} +export interface InsightsAssessmentsCommentListInstance { + _version: V1; + _solution: InsightsAssessmentsCommentSolution; + _uri: string; + /** + * Create a InsightsAssessmentsCommentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsAssessmentsCommentInstance + */ + create(params: InsightsAssessmentsCommentListInstanceCreateOptions, callback?: (error: Error | null, item?: InsightsAssessmentsCommentInstance) => any): Promise; + /** + * Streams InsightsAssessmentsCommentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsAssessmentsCommentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InsightsAssessmentsCommentInstance, done: (err?: Error) => void) => void): void; + each(params: InsightsAssessmentsCommentListInstanceEachOptions, callback?: (item: InsightsAssessmentsCommentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InsightsAssessmentsCommentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsAssessmentsCommentPage) => any): Promise; + /** + * Lists InsightsAssessmentsCommentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsAssessmentsCommentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InsightsAssessmentsCommentInstance[]) => any): Promise; + list(params: InsightsAssessmentsCommentListInstanceOptions, callback?: (error: Error | null, items: InsightsAssessmentsCommentInstance[]) => any): Promise; + /** + * Retrieve a single page of InsightsAssessmentsCommentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsAssessmentsCommentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InsightsAssessmentsCommentPage) => any): Promise; + page(params: InsightsAssessmentsCommentListInstancePageOptions, callback?: (error: Error | null, items: InsightsAssessmentsCommentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsAssessmentsCommentListInstance(version: V1): InsightsAssessmentsCommentListInstance; +interface InsightsAssessmentsCommentPayload extends TwilioResponsePayload { + comments: InsightsAssessmentsCommentResource[]; +} +interface InsightsAssessmentsCommentResource { + account_sid: string; + assessment_sid: string; + comment: any; + offset: number; + report: boolean; + weight: number; + agent_id: string; + segment_id: string; + user_name: string; + user_email: string; + timestamp: number; + url: string; +} +export declare class InsightsAssessmentsCommentInstance { + protected _version: V1; + constructor(_version: V1, payload: InsightsAssessmentsCommentResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. + */ + accountSid: string; + /** + * The SID of the assessment. + */ + assessmentSid: string; + /** + * The comment added for assessment. + */ + comment: any; + /** + * The offset + */ + offset: number; + /** + * The flag indicating if this assessment is part of report + */ + report: boolean; + /** + * The weightage given to this comment + */ + weight: number; + /** + * The id of the agent. + */ + agentId: string; + /** + * The id of the segment. + */ + segmentId: string; + /** + * The name of the user. + */ + userName: string; + /** + * The email id of the user. + */ + userEmail: string; + /** + * The timestamp when the record is inserted + */ + timestamp: number; + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + assessmentSid: string; + comment: any; + offset: number; + report: boolean; + weight: number; + agentId: string; + segmentId: string; + userName: string; + userEmail: string; + timestamp: number; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class InsightsAssessmentsCommentPage extends Page { + /** + * Initialize the InsightsAssessmentsCommentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InsightsAssessmentsCommentSolution); + /** + * Build an instance of InsightsAssessmentsCommentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InsightsAssessmentsCommentResource): InsightsAssessmentsCommentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsAssessmentsComment.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsAssessmentsComment.js new file mode 100644 index 00000000..a738bad6 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsAssessmentsComment.js @@ -0,0 +1,190 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsAssessmentsCommentPage = exports.InsightsAssessmentsCommentInstance = exports.InsightsAssessmentsCommentListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function InsightsAssessmentsCommentListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/QualityManagement/Assessments/Comments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["categoryId"] === null || params["categoryId"] === undefined) { + throw new Error("Required parameter \"params['categoryId']\" missing."); + } + if (params["categoryName"] === null || + params["categoryName"] === undefined) { + throw new Error("Required parameter \"params['categoryName']\" missing."); + } + if (params["comment"] === null || params["comment"] === undefined) { + throw new Error("Required parameter \"params['comment']\" missing."); + } + if (params["segmentId"] === null || params["segmentId"] === undefined) { + throw new Error("Required parameter \"params['segmentId']\" missing."); + } + if (params["agentId"] === null || params["agentId"] === undefined) { + throw new Error("Required parameter \"params['agentId']\" missing."); + } + if (params["offset"] === null || params["offset"] === undefined) { + throw new Error("Required parameter \"params['offset']\" missing."); + } + let data = {}; + data["CategoryId"] = params["categoryId"]; + data["CategoryName"] = params["categoryName"]; + data["Comment"] = params["comment"]; + data["SegmentId"] = params["segmentId"]; + data["AgentId"] = params["agentId"]; + data["Offset"] = params["offset"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsAssessmentsCommentInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["segmentId"] !== undefined) + data["SegmentId"] = params["segmentId"]; + if (params["agentId"] !== undefined) + data["AgentId"] = params["agentId"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsAssessmentsCommentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InsightsAssessmentsCommentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsAssessmentsCommentListInstance = InsightsAssessmentsCommentListInstance; +class InsightsAssessmentsCommentInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.assessmentSid = payload.assessment_sid; + this.comment = payload.comment; + this.offset = payload.offset; + this.report = payload.report; + this.weight = payload.weight; + this.agentId = payload.agent_id; + this.segmentId = payload.segment_id; + this.userName = payload.user_name; + this.userEmail = payload.user_email; + this.timestamp = payload.timestamp; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + assessmentSid: this.assessmentSid, + comment: this.comment, + offset: this.offset, + report: this.report, + weight: this.weight, + agentId: this.agentId, + segmentId: this.segmentId, + userName: this.userName, + userEmail: this.userEmail, + timestamp: this.timestamp, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsAssessmentsCommentInstance = InsightsAssessmentsCommentInstance; +class InsightsAssessmentsCommentPage extends Page_1.default { + /** + * Initialize the InsightsAssessmentsCommentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InsightsAssessmentsCommentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InsightsAssessmentsCommentInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsAssessmentsCommentPage = InsightsAssessmentsCommentPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAi.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAi.d.ts new file mode 100644 index 00000000..a1d81f5a --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAi.d.ts @@ -0,0 +1,165 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export type InsightsConversationalAiGranularity = "days" | "weeks" | "months" | "quarters" | "years"; +/** + * Options to pass to fetch a InsightsConversationalAiInstance + */ +export interface InsightsConversationalAiContextFetchOptions { + /** Maximum number of rows to return */ + maxRows?: number; + /** The type of report required to fetch.Like gauge,channel-metrics,queue-metrics */ + reportId?: string; + /** The time period for which report is needed */ + granularity?: InsightsConversationalAiGranularity; + /** A reference date that should be included in the returned period */ + includeDate?: Date; +} +export interface InsightsConversationalAiContext { + /** + * Fetch a InsightsConversationalAiInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsConversationalAiInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsConversationalAiInstance) => any): Promise; + /** + * Fetch a InsightsConversationalAiInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsConversationalAiInstance + */ + fetch(params: InsightsConversationalAiContextFetchOptions, callback?: (error: Error | null, item?: InsightsConversationalAiInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InsightsConversationalAiContextSolution { + instanceSid: string; +} +export declare class InsightsConversationalAiContextImpl implements InsightsConversationalAiContext { + protected _version: V1; + protected _solution: InsightsConversationalAiContextSolution; + protected _uri: string; + constructor(_version: V1, instanceSid: string); + fetch(params?: InsightsConversationalAiContextFetchOptions | ((error: Error | null, item?: InsightsConversationalAiInstance) => any), callback?: (error: Error | null, item?: InsightsConversationalAiInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InsightsConversationalAiContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InsightsConversationalAiResource { + instance_sid: string; + report_id: string; + granularity: InsightsConversationalAiGranularity; + period_start: Date; + period_end: Date; + updated: Date; + total_pages: number; + page: number; + rows: Array; + url: string; +} +export declare class InsightsConversationalAiInstance { + protected _version: V1; + protected _solution: InsightsConversationalAiContextSolution; + protected _context?: InsightsConversationalAiContext; + constructor(_version: V1, payload: InsightsConversationalAiResource, instanceSid?: string); + /** + * Sid of Flex Service Instance + */ + instanceSid: string; + /** + * The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + */ + reportId: string; + granularity: InsightsConversationalAiGranularity; + /** + * The start date from which report data is included + */ + periodStart: Date; + /** + * The end date till report data is included + */ + periodEnd: Date; + /** + * Updated time of the report + */ + updated: Date; + /** + * Represents total number of pages fetched report has + */ + totalPages: number; + /** + * Page offset required for pagination + */ + page: number; + /** + * List of report breakdown + */ + rows: Array; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a InsightsConversationalAiInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsConversationalAiInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsConversationalAiInstance) => any): Promise; + /** + * Fetch a InsightsConversationalAiInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsConversationalAiInstance + */ + fetch(params: InsightsConversationalAiContextFetchOptions, callback?: (error: Error | null, item?: InsightsConversationalAiInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + instanceSid: string; + reportId: string; + granularity: InsightsConversationalAiGranularity; + periodStart: Date; + periodEnd: Date; + updated: Date; + totalPages: number; + page: number; + rows: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InsightsConversationalAiSolution { +} +export interface InsightsConversationalAiListInstance { + _version: V1; + _solution: InsightsConversationalAiSolution; + _uri: string; + (instanceSid: string): InsightsConversationalAiContext; + get(instanceSid: string): InsightsConversationalAiContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsConversationalAiListInstance(version: V1): InsightsConversationalAiListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAi.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAi.js new file mode 100644 index 00000000..a08a31c2 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAi.js @@ -0,0 +1,136 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsConversationalAiListInstance = exports.InsightsConversationalAiInstance = exports.InsightsConversationalAiContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class InsightsConversationalAiContextImpl { + constructor(_version, instanceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(instanceSid)) { + throw new Error("Parameter 'instanceSid' is not valid."); + } + this._solution = { instanceSid }; + this._uri = `/Insights/Instances/${instanceSid}/AI/Reports`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["maxRows"] !== undefined) + data["MaxRows"] = params["maxRows"]; + if (params["reportId"] !== undefined) + data["ReportId"] = params["reportId"]; + if (params["granularity"] !== undefined) + data["Granularity"] = params["granularity"]; + if (params["includeDate"] !== undefined) + data["IncludeDate"] = serialize.iso8601DateTime(params["includeDate"]); + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsConversationalAiInstance(operationVersion, payload, instance._solution.instanceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsConversationalAiContextImpl = InsightsConversationalAiContextImpl; +class InsightsConversationalAiInstance { + constructor(_version, payload, instanceSid) { + this._version = _version; + this.instanceSid = payload.instance_sid; + this.reportId = payload.report_id; + this.granularity = payload.granularity; + this.periodStart = deserialize.iso8601DateTime(payload.period_start); + this.periodEnd = deserialize.iso8601DateTime(payload.period_end); + this.updated = deserialize.iso8601DateTime(payload.updated); + this.totalPages = deserialize.integer(payload.total_pages); + this.page = deserialize.integer(payload.page); + this.rows = payload.rows; + this.url = payload.url; + this._solution = { instanceSid: instanceSid || this.instanceSid }; + } + get _proxy() { + this._context = + this._context || + new InsightsConversationalAiContextImpl(this._version, this._solution.instanceSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + instanceSid: this.instanceSid, + reportId: this.reportId, + granularity: this.granularity, + periodStart: this.periodStart, + periodEnd: this.periodEnd, + updated: this.updated, + totalPages: this.totalPages, + page: this.page, + rows: this.rows, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsConversationalAiInstance = InsightsConversationalAiInstance; +function InsightsConversationalAiListInstance(version) { + const instance = ((instanceSid) => instance.get(instanceSid)); + instance.get = function get(instanceSid) { + return new InsightsConversationalAiContextImpl(version, instanceSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsConversationalAiListInstance = InsightsConversationalAiListInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAiReportInsights.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAiReportInsights.d.ts new file mode 100644 index 00000000..dcdd4fd7 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAiReportInsights.d.ts @@ -0,0 +1,149 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to fetch a InsightsConversationalAiReportInsightsInstance + */ +export interface InsightsConversationalAiReportInsightsContextFetchOptions { + /** Maximum number of rows to return */ + maxRows?: number; + /** The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics */ + reportId?: string; + /** The time period for which report insights is needed */ + granularity?: string; + /** A reference date that should be included in the returned period */ + includeDate?: Date; +} +export interface InsightsConversationalAiReportInsightsContext { + /** + * Fetch a InsightsConversationalAiReportInsightsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsConversationalAiReportInsightsInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsConversationalAiReportInsightsInstance) => any): Promise; + /** + * Fetch a InsightsConversationalAiReportInsightsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsConversationalAiReportInsightsInstance + */ + fetch(params: InsightsConversationalAiReportInsightsContextFetchOptions, callback?: (error: Error | null, item?: InsightsConversationalAiReportInsightsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InsightsConversationalAiReportInsightsContextSolution { + instanceSid: string; +} +export declare class InsightsConversationalAiReportInsightsContextImpl implements InsightsConversationalAiReportInsightsContext { + protected _version: V1; + protected _solution: InsightsConversationalAiReportInsightsContextSolution; + protected _uri: string; + constructor(_version: V1, instanceSid: string); + fetch(params?: InsightsConversationalAiReportInsightsContextFetchOptions | ((error: Error | null, item?: InsightsConversationalAiReportInsightsInstance) => any), callback?: (error: Error | null, item?: InsightsConversationalAiReportInsightsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InsightsConversationalAiReportInsightsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InsightsConversationalAiReportInsightsResource { + instance_sid: string; + report_id: string; + period_start: Date; + period_end: Date; + updated: Date; + insights: Array; + url: string; +} +export declare class InsightsConversationalAiReportInsightsInstance { + protected _version: V1; + protected _solution: InsightsConversationalAiReportInsightsContextSolution; + protected _context?: InsightsConversationalAiReportInsightsContext; + constructor(_version: V1, payload: InsightsConversationalAiReportInsightsResource, instanceSid?: string); + /** + * The Instance SID of the instance for which report insights is fetched + */ + instanceSid: string; + /** + * The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + */ + reportId: string; + /** + * The start date from which report insights data is included + */ + periodStart: Date; + /** + * The end date till report insights data is included + */ + periodEnd: Date; + /** + * Updated time of the report insights + */ + updated: Date; + /** + * List of report insights breakdown + */ + insights: Array; + /** + * The URL of this resource + */ + url: string; + private get _proxy(); + /** + * Fetch a InsightsConversationalAiReportInsightsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsConversationalAiReportInsightsInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsConversationalAiReportInsightsInstance) => any): Promise; + /** + * Fetch a InsightsConversationalAiReportInsightsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsConversationalAiReportInsightsInstance + */ + fetch(params: InsightsConversationalAiReportInsightsContextFetchOptions, callback?: (error: Error | null, item?: InsightsConversationalAiReportInsightsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + instanceSid: string; + reportId: string; + periodStart: Date; + periodEnd: Date; + updated: Date; + insights: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InsightsConversationalAiReportInsightsSolution { +} +export interface InsightsConversationalAiReportInsightsListInstance { + _version: V1; + _solution: InsightsConversationalAiReportInsightsSolution; + _uri: string; + (instanceSid: string): InsightsConversationalAiReportInsightsContext; + get(instanceSid: string): InsightsConversationalAiReportInsightsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsConversationalAiReportInsightsListInstance(version: V1): InsightsConversationalAiReportInsightsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAiReportInsights.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAiReportInsights.js new file mode 100644 index 00000000..bfb87a5f --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversationalAiReportInsights.js @@ -0,0 +1,130 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsConversationalAiReportInsightsListInstance = exports.InsightsConversationalAiReportInsightsInstance = exports.InsightsConversationalAiReportInsightsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class InsightsConversationalAiReportInsightsContextImpl { + constructor(_version, instanceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(instanceSid)) { + throw new Error("Parameter 'instanceSid' is not valid."); + } + this._solution = { instanceSid }; + this._uri = `/Insights/Instances/${instanceSid}/AI/ReportInsights`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["maxRows"] !== undefined) + data["MaxRows"] = params["maxRows"]; + if (params["reportId"] !== undefined) + data["ReportId"] = params["reportId"]; + if (params["granularity"] !== undefined) + data["Granularity"] = params["granularity"]; + if (params["includeDate"] !== undefined) + data["IncludeDate"] = serialize.iso8601DateTime(params["includeDate"]); + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsConversationalAiReportInsightsInstance(operationVersion, payload, instance._solution.instanceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsConversationalAiReportInsightsContextImpl = InsightsConversationalAiReportInsightsContextImpl; +class InsightsConversationalAiReportInsightsInstance { + constructor(_version, payload, instanceSid) { + this._version = _version; + this.instanceSid = payload.instance_sid; + this.reportId = payload.report_id; + this.periodStart = deserialize.iso8601DateTime(payload.period_start); + this.periodEnd = deserialize.iso8601DateTime(payload.period_end); + this.updated = deserialize.iso8601DateTime(payload.updated); + this.insights = payload.insights; + this.url = payload.url; + this._solution = { instanceSid: instanceSid || this.instanceSid }; + } + get _proxy() { + this._context = + this._context || + new InsightsConversationalAiReportInsightsContextImpl(this._version, this._solution.instanceSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + instanceSid: this.instanceSid, + reportId: this.reportId, + periodStart: this.periodStart, + periodEnd: this.periodEnd, + updated: this.updated, + insights: this.insights, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsConversationalAiReportInsightsInstance = InsightsConversationalAiReportInsightsInstance; +function InsightsConversationalAiReportInsightsListInstance(version) { + const instance = ((instanceSid) => instance.get(instanceSid)); + instance.get = function get(instanceSid) { + return new InsightsConversationalAiReportInsightsContextImpl(version, instanceSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsConversationalAiReportInsightsListInstance = InsightsConversationalAiReportInsightsListInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsConversations.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversations.d.ts new file mode 100644 index 00000000..34c76953 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversations.d.ts @@ -0,0 +1,172 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface InsightsConversationsListInstanceEachOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** Unique Id of the segment for which conversation details needs to be fetched */ + segmentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InsightsConversationsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InsightsConversationsListInstanceOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** Unique Id of the segment for which conversation details needs to be fetched */ + segmentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InsightsConversationsListInstancePageOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** Unique Id of the segment for which conversation details needs to be fetched */ + segmentId?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InsightsConversationsSolution { +} +export interface InsightsConversationsListInstance { + _version: V1; + _solution: InsightsConversationsSolution; + _uri: string; + /** + * Streams InsightsConversationsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsConversationsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InsightsConversationsInstance, done: (err?: Error) => void) => void): void; + each(params: InsightsConversationsListInstanceEachOptions, callback?: (item: InsightsConversationsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InsightsConversationsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsConversationsPage) => any): Promise; + /** + * Lists InsightsConversationsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsConversationsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InsightsConversationsInstance[]) => any): Promise; + list(params: InsightsConversationsListInstanceOptions, callback?: (error: Error | null, items: InsightsConversationsInstance[]) => any): Promise; + /** + * Retrieve a single page of InsightsConversationsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsConversationsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InsightsConversationsPage) => any): Promise; + page(params: InsightsConversationsListInstancePageOptions, callback?: (error: Error | null, items: InsightsConversationsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsConversationsListInstance(version: V1): InsightsConversationsListInstance; +interface InsightsConversationsPayload extends TwilioResponsePayload { + conversations: InsightsConversationsResource[]; +} +interface InsightsConversationsResource { + account_id: string; + conversation_id: string; + segment_count: number; + segments: Array; +} +export declare class InsightsConversationsInstance { + protected _version: V1; + constructor(_version: V1, payload: InsightsConversationsResource); + /** + * The id of the account. + */ + accountId: string; + /** + * The unique id of the conversation + */ + conversationId: string; + /** + * The count of segments for a conversation + */ + segmentCount: number; + /** + * The Segments of a conversation + */ + segments: Array; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountId: string; + conversationId: string; + segmentCount: number; + segments: any[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class InsightsConversationsPage extends Page { + /** + * Initialize the InsightsConversationsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InsightsConversationsSolution); + /** + * Build an instance of InsightsConversationsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InsightsConversationsResource): InsightsConversationsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsConversations.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversations.js new file mode 100644 index 00000000..f2bf3466 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsConversations.js @@ -0,0 +1,128 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsConversationsPage = exports.InsightsConversationsInstance = exports.InsightsConversationsListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function InsightsConversationsListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/Conversations`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["segmentId"] !== undefined) + data["SegmentId"] = params["segmentId"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsConversationsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InsightsConversationsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsConversationsListInstance = InsightsConversationsListInstance; +class InsightsConversationsInstance { + constructor(_version, payload) { + this._version = _version; + this.accountId = payload.account_id; + this.conversationId = payload.conversation_id; + this.segmentCount = deserialize.integer(payload.segment_count); + this.segments = payload.segments; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountId: this.accountId, + conversationId: this.conversationId, + segmentCount: this.segmentCount, + segments: this.segments, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsConversationsInstance = InsightsConversationsInstance; +class InsightsConversationsPage extends Page_1.default { + /** + * Initialize the InsightsConversationsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InsightsConversationsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InsightsConversationsInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsConversationsPage = InsightsConversationsPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts new file mode 100644 index 00000000..beb0f9bd --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts @@ -0,0 +1,357 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to remove a InsightsQuestionnairesInstance + */ +export interface InsightsQuestionnairesContextRemoveOptions { + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to fetch a InsightsQuestionnairesInstance + */ +export interface InsightsQuestionnairesContextFetchOptions { + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to update a InsightsQuestionnairesInstance + */ +export interface InsightsQuestionnairesContextUpdateOptions { + /** The flag to enable or disable questionnaire */ + active: boolean; + /** The Authorization HTTP request header */ + authorization?: string; + /** The name of this questionnaire */ + name?: string; + /** The description of this questionnaire */ + description?: string; + /** The list of questions sids under a questionnaire */ + questionSids?: Array; +} +/** + * Options to pass to create a InsightsQuestionnairesInstance + */ +export interface InsightsQuestionnairesListInstanceCreateOptions { + /** The name of this questionnaire */ + name: string; + /** The Authorization HTTP request header */ + authorization?: string; + /** The description of this questionnaire */ + description?: string; + /** The flag to enable or disable questionnaire */ + active?: boolean; + /** The list of questions sids under a questionnaire */ + questionSids?: Array; +} +/** + * Options to pass to each + */ +export interface InsightsQuestionnairesListInstanceEachOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** Flag indicating whether to include inactive questionnaires or not */ + includeInactive?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InsightsQuestionnairesInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InsightsQuestionnairesListInstanceOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** Flag indicating whether to include inactive questionnaires or not */ + includeInactive?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InsightsQuestionnairesListInstancePageOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** Flag indicating whether to include inactive questionnaires or not */ + includeInactive?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InsightsQuestionnairesContext { + /** + * Remove a InsightsQuestionnairesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a InsightsQuestionnairesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + remove(params: InsightsQuestionnairesContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InsightsQuestionnairesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + /** + * Fetch a InsightsQuestionnairesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + fetch(params: InsightsQuestionnairesContextFetchOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + /** + * Update a InsightsQuestionnairesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + update(params: InsightsQuestionnairesContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InsightsQuestionnairesContextSolution { + questionnaireSid: string; +} +export declare class InsightsQuestionnairesContextImpl implements InsightsQuestionnairesContext { + protected _version: V1; + protected _solution: InsightsQuestionnairesContextSolution; + protected _uri: string; + constructor(_version: V1, questionnaireSid: string); + remove(params?: InsightsQuestionnairesContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(params?: InsightsQuestionnairesContextFetchOptions | ((error: Error | null, item?: InsightsQuestionnairesInstance) => any), callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + update(params: InsightsQuestionnairesContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InsightsQuestionnairesContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InsightsQuestionnairesPayload extends TwilioResponsePayload { + questionnaires: InsightsQuestionnairesResource[]; +} +interface InsightsQuestionnairesResource { + account_sid: string; + questionnaire_sid: string; + name: string; + description: string; + active: boolean; + questions: Array; + url: string; +} +export declare class InsightsQuestionnairesInstance { + protected _version: V1; + protected _solution: InsightsQuestionnairesContextSolution; + protected _context?: InsightsQuestionnairesContext; + constructor(_version: V1, payload: InsightsQuestionnairesResource, questionnaireSid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. + */ + accountSid: string; + /** + * The sid of this questionnaire + */ + questionnaireSid: string; + /** + * The name of this category. + */ + name: string; + /** + * The description of this questionnaire + */ + description: string; + /** + * The flag to enable or disable questionnaire + */ + active: boolean; + /** + * The list of questions with category for a questionnaire + */ + questions: Array; + url: string; + private get _proxy(); + /** + * Remove a InsightsQuestionnairesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a InsightsQuestionnairesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + remove(params: InsightsQuestionnairesContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InsightsQuestionnairesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + /** + * Fetch a InsightsQuestionnairesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + fetch(params: InsightsQuestionnairesContextFetchOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + /** + * Update a InsightsQuestionnairesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + update(params: InsightsQuestionnairesContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + questionnaireSid: string; + name: string; + description: string; + active: boolean; + questions: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InsightsQuestionnairesSolution { +} +export interface InsightsQuestionnairesListInstance { + _version: V1; + _solution: InsightsQuestionnairesSolution; + _uri: string; + (questionnaireSid: string): InsightsQuestionnairesContext; + get(questionnaireSid: string): InsightsQuestionnairesContext; + /** + * Create a InsightsQuestionnairesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesInstance + */ + create(params: InsightsQuestionnairesListInstanceCreateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise; + /** + * Streams InsightsQuestionnairesInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InsightsQuestionnairesInstance, done: (err?: Error) => void) => void): void; + each(params: InsightsQuestionnairesListInstanceEachOptions, callback?: (item: InsightsQuestionnairesInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InsightsQuestionnairesInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsQuestionnairesPage) => any): Promise; + /** + * Lists InsightsQuestionnairesInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InsightsQuestionnairesInstance[]) => any): Promise; + list(params: InsightsQuestionnairesListInstanceOptions, callback?: (error: Error | null, items: InsightsQuestionnairesInstance[]) => any): Promise; + /** + * Retrieve a single page of InsightsQuestionnairesInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InsightsQuestionnairesPage) => any): Promise; + page(params: InsightsQuestionnairesListInstancePageOptions, callback?: (error: Error | null, items: InsightsQuestionnairesPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsQuestionnairesListInstance(version: V1): InsightsQuestionnairesListInstance; +export declare class InsightsQuestionnairesPage extends Page { + /** + * Initialize the InsightsQuestionnairesPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InsightsQuestionnairesSolution); + /** + * Build an instance of InsightsQuestionnairesInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InsightsQuestionnairesResource): InsightsQuestionnairesInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnaires.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnaires.js new file mode 100644 index 00000000..3234ac23 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnaires.js @@ -0,0 +1,282 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsQuestionnairesPage = exports.InsightsQuestionnairesListInstance = exports.InsightsQuestionnairesInstance = exports.InsightsQuestionnairesContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class InsightsQuestionnairesContextImpl { + constructor(_version, questionnaireSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(questionnaireSid)) { + throw new Error("Parameter 'questionnaireSid' is not valid."); + } + this._solution = { questionnaireSid }; + this._uri = `/Insights/QualityManagement/Questionnaires/${questionnaireSid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesInstance(operationVersion, payload, instance._solution.questionnaireSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["active"] === null || params["active"] === undefined) { + throw new Error("Required parameter \"params['active']\" missing."); + } + let data = {}; + data["Active"] = serialize.bool(params["active"]); + if (params["name"] !== undefined) + data["Name"] = params["name"]; + if (params["description"] !== undefined) + data["Description"] = params["description"]; + if (params["questionSids"] !== undefined) + data["QuestionSids"] = serialize.map(params["questionSids"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesInstance(operationVersion, payload, instance._solution.questionnaireSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesContextImpl = InsightsQuestionnairesContextImpl; +class InsightsQuestionnairesInstance { + constructor(_version, payload, questionnaireSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.questionnaireSid = payload.questionnaire_sid; + this.name = payload.name; + this.description = payload.description; + this.active = payload.active; + this.questions = payload.questions; + this.url = payload.url; + this._solution = { + questionnaireSid: questionnaireSid || this.questionnaireSid, + }; + } + get _proxy() { + this._context = + this._context || + new InsightsQuestionnairesContextImpl(this._version, this._solution.questionnaireSid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + questionnaireSid: this.questionnaireSid, + name: this.name, + description: this.description, + active: this.active, + questions: this.questions, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesInstance = InsightsQuestionnairesInstance; +function InsightsQuestionnairesListInstance(version) { + const instance = ((questionnaireSid) => instance.get(questionnaireSid)); + instance.get = function get(questionnaireSid) { + return new InsightsQuestionnairesContextImpl(version, questionnaireSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/QualityManagement/Questionnaires`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["name"] === null || params["name"] === undefined) { + throw new Error("Required parameter \"params['name']\" missing."); + } + let data = {}; + data["Name"] = params["name"]; + if (params["description"] !== undefined) + data["Description"] = params["description"]; + if (params["active"] !== undefined) + data["Active"] = serialize.bool(params["active"]); + if (params["questionSids"] !== undefined) + data["QuestionSids"] = serialize.map(params["questionSids"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["includeInactive"] !== undefined) + data["IncludeInactive"] = serialize.bool(params["includeInactive"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InsightsQuestionnairesPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsQuestionnairesListInstance = InsightsQuestionnairesListInstance; +class InsightsQuestionnairesPage extends Page_1.default { + /** + * Initialize the InsightsQuestionnairesPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InsightsQuestionnairesInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InsightsQuestionnairesInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesPage = InsightsQuestionnairesPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts new file mode 100644 index 00000000..8308f95d --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts @@ -0,0 +1,279 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to remove a InsightsQuestionnairesCategoryInstance + */ +export interface InsightsQuestionnairesCategoryContextRemoveOptions { + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to update a InsightsQuestionnairesCategoryInstance + */ +export interface InsightsQuestionnairesCategoryContextUpdateOptions { + /** The name of this category. */ + name: string; + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to create a InsightsQuestionnairesCategoryInstance + */ +export interface InsightsQuestionnairesCategoryListInstanceCreateOptions { + /** The name of this category. */ + name: string; + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to each + */ +export interface InsightsQuestionnairesCategoryListInstanceEachOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InsightsQuestionnairesCategoryInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InsightsQuestionnairesCategoryListInstanceOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InsightsQuestionnairesCategoryListInstancePageOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InsightsQuestionnairesCategoryContext { + /** + * Remove a InsightsQuestionnairesCategoryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a InsightsQuestionnairesCategoryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesCategoryInstance + */ + remove(params: InsightsQuestionnairesCategoryContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Update a InsightsQuestionnairesCategoryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesCategoryInstance + */ + update(params: InsightsQuestionnairesCategoryContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesCategoryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InsightsQuestionnairesCategoryContextSolution { + categorySid: string; +} +export declare class InsightsQuestionnairesCategoryContextImpl implements InsightsQuestionnairesCategoryContext { + protected _version: V1; + protected _solution: InsightsQuestionnairesCategoryContextSolution; + protected _uri: string; + constructor(_version: V1, categorySid: string); + remove(params?: InsightsQuestionnairesCategoryContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + update(params: InsightsQuestionnairesCategoryContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesCategoryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InsightsQuestionnairesCategoryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InsightsQuestionnairesCategoryPayload extends TwilioResponsePayload { + categories: InsightsQuestionnairesCategoryResource[]; +} +interface InsightsQuestionnairesCategoryResource { + account_sid: string; + category_sid: string; + name: string; + url: string; +} +export declare class InsightsQuestionnairesCategoryInstance { + protected _version: V1; + protected _solution: InsightsQuestionnairesCategoryContextSolution; + protected _context?: InsightsQuestionnairesCategoryContext; + constructor(_version: V1, payload: InsightsQuestionnairesCategoryResource, categorySid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. + */ + accountSid: string; + /** + * The SID of the category + */ + categorySid: string; + /** + * The name of this category. + */ + name: string; + url: string; + private get _proxy(); + /** + * Remove a InsightsQuestionnairesCategoryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a InsightsQuestionnairesCategoryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesCategoryInstance + */ + remove(params: InsightsQuestionnairesCategoryContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Update a InsightsQuestionnairesCategoryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesCategoryInstance + */ + update(params: InsightsQuestionnairesCategoryContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesCategoryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + categorySid: string; + name: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InsightsQuestionnairesCategorySolution { +} +export interface InsightsQuestionnairesCategoryListInstance { + _version: V1; + _solution: InsightsQuestionnairesCategorySolution; + _uri: string; + (categorySid: string): InsightsQuestionnairesCategoryContext; + get(categorySid: string): InsightsQuestionnairesCategoryContext; + /** + * Create a InsightsQuestionnairesCategoryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesCategoryInstance + */ + create(params: InsightsQuestionnairesCategoryListInstanceCreateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesCategoryInstance) => any): Promise; + /** + * Streams InsightsQuestionnairesCategoryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesCategoryListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InsightsQuestionnairesCategoryInstance, done: (err?: Error) => void) => void): void; + each(params: InsightsQuestionnairesCategoryListInstanceEachOptions, callback?: (item: InsightsQuestionnairesCategoryInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InsightsQuestionnairesCategoryInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsQuestionnairesCategoryPage) => any): Promise; + /** + * Lists InsightsQuestionnairesCategoryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesCategoryListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InsightsQuestionnairesCategoryInstance[]) => any): Promise; + list(params: InsightsQuestionnairesCategoryListInstanceOptions, callback?: (error: Error | null, items: InsightsQuestionnairesCategoryInstance[]) => any): Promise; + /** + * Retrieve a single page of InsightsQuestionnairesCategoryInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesCategoryListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InsightsQuestionnairesCategoryPage) => any): Promise; + page(params: InsightsQuestionnairesCategoryListInstancePageOptions, callback?: (error: Error | null, items: InsightsQuestionnairesCategoryPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsQuestionnairesCategoryListInstance(version: V1): InsightsQuestionnairesCategoryListInstance; +export declare class InsightsQuestionnairesCategoryPage extends Page { + /** + * Initialize the InsightsQuestionnairesCategoryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InsightsQuestionnairesCategorySolution); + /** + * Build an instance of InsightsQuestionnairesCategoryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InsightsQuestionnairesCategoryResource): InsightsQuestionnairesCategoryInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js new file mode 100644 index 00000000..c8462831 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js @@ -0,0 +1,234 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsQuestionnairesCategoryPage = exports.InsightsQuestionnairesCategoryListInstance = exports.InsightsQuestionnairesCategoryInstance = exports.InsightsQuestionnairesCategoryContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class InsightsQuestionnairesCategoryContextImpl { + constructor(_version, categorySid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(categorySid)) { + throw new Error("Parameter 'categorySid' is not valid."); + } + this._solution = { categorySid }; + this._uri = `/Insights/QualityManagement/Categories/${categorySid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["name"] === null || params["name"] === undefined) { + throw new Error("Required parameter \"params['name']\" missing."); + } + let data = {}; + data["Name"] = params["name"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesCategoryInstance(operationVersion, payload, instance._solution.categorySid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesCategoryContextImpl = InsightsQuestionnairesCategoryContextImpl; +class InsightsQuestionnairesCategoryInstance { + constructor(_version, payload, categorySid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.categorySid = payload.category_sid; + this.name = payload.name; + this.url = payload.url; + this._solution = { categorySid: categorySid || this.categorySid }; + } + get _proxy() { + this._context = + this._context || + new InsightsQuestionnairesCategoryContextImpl(this._version, this._solution.categorySid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + categorySid: this.categorySid, + name: this.name, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesCategoryInstance = InsightsQuestionnairesCategoryInstance; +function InsightsQuestionnairesCategoryListInstance(version) { + const instance = ((categorySid) => instance.get(categorySid)); + instance.get = function get(categorySid) { + return new InsightsQuestionnairesCategoryContextImpl(version, categorySid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/QualityManagement/Categories`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["name"] === null || params["name"] === undefined) { + throw new Error("Required parameter \"params['name']\" missing."); + } + let data = {}; + data["Name"] = params["name"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesCategoryInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesCategoryPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InsightsQuestionnairesCategoryPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsQuestionnairesCategoryListInstance = InsightsQuestionnairesCategoryListInstance; +class InsightsQuestionnairesCategoryPage extends Page_1.default { + /** + * Initialize the InsightsQuestionnairesCategoryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InsightsQuestionnairesCategoryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InsightsQuestionnairesCategoryInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesCategoryPage = InsightsQuestionnairesCategoryPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts new file mode 100644 index 00000000..6d5a950e --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts @@ -0,0 +1,337 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to remove a InsightsQuestionnairesQuestionInstance + */ +export interface InsightsQuestionnairesQuestionContextRemoveOptions { + /** The Authorization HTTP request header */ + authorization?: string; +} +/** + * Options to pass to update a InsightsQuestionnairesQuestionInstance + */ +export interface InsightsQuestionnairesQuestionContextUpdateOptions { + /** The flag to enable for disable NA for answer. */ + allowNa: boolean; + /** The Authorization HTTP request header */ + authorization?: string; + /** The SID of the category */ + categorySid?: string; + /** The question. */ + question?: string; + /** The description for the question. */ + description?: string; + /** The answer_set for the question. */ + answerSetId?: string; +} +/** + * Options to pass to create a InsightsQuestionnairesQuestionInstance + */ +export interface InsightsQuestionnairesQuestionListInstanceCreateOptions { + /** The SID of the category */ + categorySid: string; + /** The question. */ + question: string; + /** The answer_set for the question. */ + answerSetId: string; + /** The flag to enable for disable NA for answer. */ + allowNa: boolean; + /** The Authorization HTTP request header */ + authorization?: string; + /** The description for the question. */ + description?: string; +} +/** + * Options to pass to each + */ +export interface InsightsQuestionnairesQuestionListInstanceEachOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The list of category SIDs */ + categorySid?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InsightsQuestionnairesQuestionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InsightsQuestionnairesQuestionListInstanceOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The list of category SIDs */ + categorySid?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InsightsQuestionnairesQuestionListInstancePageOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** The list of category SIDs */ + categorySid?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InsightsQuestionnairesQuestionContext { + /** + * Remove a InsightsQuestionnairesQuestionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a InsightsQuestionnairesQuestionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesQuestionInstance + */ + remove(params: InsightsQuestionnairesQuestionContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Update a InsightsQuestionnairesQuestionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesQuestionInstance + */ + update(params: InsightsQuestionnairesQuestionContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesQuestionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InsightsQuestionnairesQuestionContextSolution { + questionSid: string; +} +export declare class InsightsQuestionnairesQuestionContextImpl implements InsightsQuestionnairesQuestionContext { + protected _version: V1; + protected _solution: InsightsQuestionnairesQuestionContextSolution; + protected _uri: string; + constructor(_version: V1, questionSid: string); + remove(params?: InsightsQuestionnairesQuestionContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + update(params: InsightsQuestionnairesQuestionContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesQuestionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InsightsQuestionnairesQuestionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InsightsQuestionnairesQuestionPayload extends TwilioResponsePayload { + questions: InsightsQuestionnairesQuestionResource[]; +} +interface InsightsQuestionnairesQuestionResource { + account_sid: string; + question_sid: string; + question: string; + description: string; + category: any; + answer_set_id: string; + allow_na: boolean; + usage: number; + answer_set: any; + url: string; +} +export declare class InsightsQuestionnairesQuestionInstance { + protected _version: V1; + protected _solution: InsightsQuestionnairesQuestionContextSolution; + protected _context?: InsightsQuestionnairesQuestionContext; + constructor(_version: V1, payload: InsightsQuestionnairesQuestionResource, questionSid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. + */ + accountSid: string; + /** + * The SID of the question + */ + questionSid: string; + /** + * The question. + */ + question: string; + /** + * The description for the question. + */ + description: string; + /** + * The Category for the question. + */ + category: any; + /** + * The answer_set for the question. + */ + answerSetId: string; + /** + * The flag to enable for disable NA for answer. + */ + allowNa: boolean; + /** + * Integer value that tells a particular question is used by how many questionnaires + */ + usage: number; + /** + * Set of answers for the question + */ + answerSet: any; + url: string; + private get _proxy(); + /** + * Remove a InsightsQuestionnairesQuestionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a InsightsQuestionnairesQuestionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesQuestionInstance + */ + remove(params: InsightsQuestionnairesQuestionContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Update a InsightsQuestionnairesQuestionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesQuestionInstance + */ + update(params: InsightsQuestionnairesQuestionContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesQuestionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + questionSid: string; + question: string; + description: string; + category: any; + answerSetId: string; + allowNa: boolean; + usage: number; + answerSet: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InsightsQuestionnairesQuestionSolution { +} +export interface InsightsQuestionnairesQuestionListInstance { + _version: V1; + _solution: InsightsQuestionnairesQuestionSolution; + _uri: string; + (questionSid: string): InsightsQuestionnairesQuestionContext; + get(questionSid: string): InsightsQuestionnairesQuestionContext; + /** + * Create a InsightsQuestionnairesQuestionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsQuestionnairesQuestionInstance + */ + create(params: InsightsQuestionnairesQuestionListInstanceCreateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesQuestionInstance) => any): Promise; + /** + * Streams InsightsQuestionnairesQuestionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesQuestionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InsightsQuestionnairesQuestionInstance, done: (err?: Error) => void) => void): void; + each(params: InsightsQuestionnairesQuestionListInstanceEachOptions, callback?: (item: InsightsQuestionnairesQuestionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InsightsQuestionnairesQuestionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise; + /** + * Lists InsightsQuestionnairesQuestionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesQuestionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InsightsQuestionnairesQuestionInstance[]) => any): Promise; + list(params: InsightsQuestionnairesQuestionListInstanceOptions, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionInstance[]) => any): Promise; + /** + * Retrieve a single page of InsightsQuestionnairesQuestionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsQuestionnairesQuestionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise; + page(params: InsightsQuestionnairesQuestionListInstancePageOptions, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsQuestionnairesQuestionListInstance(version: V1): InsightsQuestionnairesQuestionListInstance; +export declare class InsightsQuestionnairesQuestionPage extends Page { + /** + * Initialize the InsightsQuestionnairesQuestionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InsightsQuestionnairesQuestionSolution); + /** + * Build an instance of InsightsQuestionnairesQuestionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InsightsQuestionnairesQuestionResource): InsightsQuestionnairesQuestionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js new file mode 100644 index 00000000..5e036f19 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js @@ -0,0 +1,270 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsQuestionnairesQuestionPage = exports.InsightsQuestionnairesQuestionListInstance = exports.InsightsQuestionnairesQuestionInstance = exports.InsightsQuestionnairesQuestionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class InsightsQuestionnairesQuestionContextImpl { + constructor(_version, questionSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(questionSid)) { + throw new Error("Parameter 'questionSid' is not valid."); + } + this._solution = { questionSid }; + this._uri = `/Insights/QualityManagement/Questions/${questionSid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["allowNa"] === null || params["allowNa"] === undefined) { + throw new Error("Required parameter \"params['allowNa']\" missing."); + } + let data = {}; + data["AllowNa"] = serialize.bool(params["allowNa"]); + if (params["categorySid"] !== undefined) + data["CategorySid"] = params["categorySid"]; + if (params["question"] !== undefined) + data["Question"] = params["question"]; + if (params["description"] !== undefined) + data["Description"] = params["description"]; + if (params["answerSetId"] !== undefined) + data["AnswerSetId"] = params["answerSetId"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionInstance(operationVersion, payload, instance._solution.questionSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesQuestionContextImpl = InsightsQuestionnairesQuestionContextImpl; +class InsightsQuestionnairesQuestionInstance { + constructor(_version, payload, questionSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.questionSid = payload.question_sid; + this.question = payload.question; + this.description = payload.description; + this.category = payload.category; + this.answerSetId = payload.answer_set_id; + this.allowNa = payload.allow_na; + this.usage = deserialize.integer(payload.usage); + this.answerSet = payload.answer_set; + this.url = payload.url; + this._solution = { questionSid: questionSid || this.questionSid }; + } + get _proxy() { + this._context = + this._context || + new InsightsQuestionnairesQuestionContextImpl(this._version, this._solution.questionSid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + questionSid: this.questionSid, + question: this.question, + description: this.description, + category: this.category, + answerSetId: this.answerSetId, + allowNa: this.allowNa, + usage: this.usage, + answerSet: this.answerSet, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesQuestionInstance = InsightsQuestionnairesQuestionInstance; +function InsightsQuestionnairesQuestionListInstance(version) { + const instance = ((questionSid) => instance.get(questionSid)); + instance.get = function get(questionSid) { + return new InsightsQuestionnairesQuestionContextImpl(version, questionSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/QualityManagement/Questions`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["categorySid"] === null || params["categorySid"] === undefined) { + throw new Error("Required parameter \"params['categorySid']\" missing."); + } + if (params["question"] === null || params["question"] === undefined) { + throw new Error("Required parameter \"params['question']\" missing."); + } + if (params["answerSetId"] === null || params["answerSetId"] === undefined) { + throw new Error("Required parameter \"params['answerSetId']\" missing."); + } + if (params["allowNa"] === null || params["allowNa"] === undefined) { + throw new Error("Required parameter \"params['allowNa']\" missing."); + } + let data = {}; + data["CategorySid"] = params["categorySid"]; + data["Question"] = params["question"]; + data["AnswerSetId"] = params["answerSetId"]; + data["AllowNa"] = serialize.bool(params["allowNa"]); + if (params["description"] !== undefined) + data["Description"] = params["description"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["categorySid"] !== undefined) + data["CategorySid"] = serialize.map(params["categorySid"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsQuestionnairesQuestionListInstance = InsightsQuestionnairesQuestionListInstance; +class InsightsQuestionnairesQuestionPage extends Page_1.default { + /** + * Initialize the InsightsQuestionnairesQuestionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InsightsQuestionnairesQuestionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InsightsQuestionnairesQuestionInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsQuestionnairesQuestionPage = InsightsQuestionnairesQuestionPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsSegments.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsSegments.d.ts new file mode 100644 index 00000000..407b25d5 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsSegments.d.ts @@ -0,0 +1,277 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface InsightsSegmentsListInstanceEachOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** To unique id of the segment */ + segmentId?: string; + /** The list of reservation Ids */ + reservationId?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InsightsSegmentsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InsightsSegmentsListInstanceOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** To unique id of the segment */ + segmentId?: string; + /** The list of reservation Ids */ + reservationId?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InsightsSegmentsListInstancePageOptions { + /** The Authorization HTTP request header */ + authorization?: string; + /** To unique id of the segment */ + segmentId?: string; + /** The list of reservation Ids */ + reservationId?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InsightsSegmentsSolution { +} +export interface InsightsSegmentsListInstance { + _version: V1; + _solution: InsightsSegmentsSolution; + _uri: string; + /** + * Streams InsightsSegmentsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsSegmentsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InsightsSegmentsInstance, done: (err?: Error) => void) => void): void; + each(params: InsightsSegmentsListInstanceEachOptions, callback?: (item: InsightsSegmentsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InsightsSegmentsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise; + /** + * Lists InsightsSegmentsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsSegmentsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InsightsSegmentsInstance[]) => any): Promise; + list(params: InsightsSegmentsListInstanceOptions, callback?: (error: Error | null, items: InsightsSegmentsInstance[]) => any): Promise; + /** + * Retrieve a single page of InsightsSegmentsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InsightsSegmentsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise; + page(params: InsightsSegmentsListInstancePageOptions, callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsSegmentsListInstance(version: V1): InsightsSegmentsListInstance; +interface InsightsSegmentsPayload extends TwilioResponsePayload { + segments: InsightsSegmentsResource[]; +} +interface InsightsSegmentsResource { + segment_id: string; + external_id: string; + queue: string; + external_contact: string; + external_segment_link_id: string; + date: string; + account_id: string; + external_segment_link: string; + agent_id: string; + agent_phone: string; + agent_name: string; + agent_team_name: string; + agent_team_name_in_hierarchy: string; + agent_link: string; + customer_phone: string; + customer_name: string; + customer_link: string; + segment_recording_offset: string; + media: any; + assessment_type: any; + assessment_percentage: any; + url: string; +} +export declare class InsightsSegmentsInstance { + protected _version: V1; + constructor(_version: V1, payload: InsightsSegmentsResource); + /** + * To unique id of the segment + */ + segmentId: string; + /** + * The unique id for the conversation. + */ + externalId: string; + queue: string; + externalContact: string; + /** + * The uuid for the external_segment_link. + */ + externalSegmentLinkId: string; + /** + * The date of the conversation. + */ + date: string; + /** + * The unique id for the account. + */ + accountId: string; + /** + * The hyperlink to recording of the task event. + */ + externalSegmentLink: string; + /** + * The unique id for the agent. + */ + agentId: string; + /** + * The phone number of the agent. + */ + agentPhone: string; + /** + * The name of the agent. + */ + agentName: string; + /** + * The team name to which agent belongs. + */ + agentTeamName: string; + /** + * he team name to which agent belongs. + */ + agentTeamNameInHierarchy: string; + /** + * The link to the agent conversation. + */ + agentLink: string; + /** + * The phone number of the customer. + */ + customerPhone: string; + /** + * The name of the customer. + */ + customerName: string; + /** + * The link to the customer conversation. + */ + customerLink: string; + /** + * The offset value for the recording. + */ + segmentRecordingOffset: string; + /** + * The media identifiers of the conversation. + */ + media: any; + /** + * The type of the assessment. + */ + assessmentType: any; + /** + * The percentage scored on the Assessments. + */ + assessmentPercentage: any; + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + segmentId: string; + externalId: string; + queue: string; + externalContact: string; + externalSegmentLinkId: string; + date: string; + accountId: string; + externalSegmentLink: string; + agentId: string; + agentPhone: string; + agentName: string; + agentTeamName: string; + agentTeamNameInHierarchy: string; + agentLink: string; + customerPhone: string; + customerName: string; + customerLink: string; + segmentRecordingOffset: string; + media: any; + assessmentType: any; + assessmentPercentage: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class InsightsSegmentsPage extends Page { + /** + * Initialize the InsightsSegmentsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InsightsSegmentsSolution); + /** + * Build an instance of InsightsSegmentsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InsightsSegmentsResource): InsightsSegmentsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsSegments.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsSegments.js new file mode 100644 index 00000000..cd3da143 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsSegments.js @@ -0,0 +1,166 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsSegmentsPage = exports.InsightsSegmentsInstance = exports.InsightsSegmentsListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function InsightsSegmentsListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/Segments`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["segmentId"] !== undefined) + data["SegmentId"] = params["segmentId"]; + if (params["reservationId"] !== undefined) + data["ReservationId"] = serialize.map(params["reservationId"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsSegmentsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InsightsSegmentsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsSegmentsListInstance = InsightsSegmentsListInstance; +class InsightsSegmentsInstance { + constructor(_version, payload) { + this._version = _version; + this.segmentId = payload.segment_id; + this.externalId = payload.external_id; + this.queue = payload.queue; + this.externalContact = payload.external_contact; + this.externalSegmentLinkId = payload.external_segment_link_id; + this.date = payload.date; + this.accountId = payload.account_id; + this.externalSegmentLink = payload.external_segment_link; + this.agentId = payload.agent_id; + this.agentPhone = payload.agent_phone; + this.agentName = payload.agent_name; + this.agentTeamName = payload.agent_team_name; + this.agentTeamNameInHierarchy = payload.agent_team_name_in_hierarchy; + this.agentLink = payload.agent_link; + this.customerPhone = payload.customer_phone; + this.customerName = payload.customer_name; + this.customerLink = payload.customer_link; + this.segmentRecordingOffset = payload.segment_recording_offset; + this.media = payload.media; + this.assessmentType = payload.assessment_type; + this.assessmentPercentage = payload.assessment_percentage; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + segmentId: this.segmentId, + externalId: this.externalId, + queue: this.queue, + externalContact: this.externalContact, + externalSegmentLinkId: this.externalSegmentLinkId, + date: this.date, + accountId: this.accountId, + externalSegmentLink: this.externalSegmentLink, + agentId: this.agentId, + agentPhone: this.agentPhone, + agentName: this.agentName, + agentTeamName: this.agentTeamName, + agentTeamNameInHierarchy: this.agentTeamNameInHierarchy, + agentLink: this.agentLink, + customerPhone: this.customerPhone, + customerName: this.customerName, + customerLink: this.customerLink, + segmentRecordingOffset: this.segmentRecordingOffset, + media: this.media, + assessmentType: this.assessmentType, + assessmentPercentage: this.assessmentPercentage, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsSegmentsInstance = InsightsSegmentsInstance; +class InsightsSegmentsPage extends Page_1.default { + /** + * Initialize the InsightsSegmentsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InsightsSegmentsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InsightsSegmentsInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsSegmentsPage = InsightsSegmentsPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsSession.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsSession.d.ts new file mode 100644 index 00000000..447cd834 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsSession.d.ts @@ -0,0 +1,130 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to create a InsightsSessionInstance + */ +export interface InsightsSessionContextCreateOptions { + /** The Authorization HTTP request header */ + authorization?: string; +} +export interface InsightsSessionContext { + /** + * Create a InsightsSessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsSessionInstance + */ + create(callback?: (error: Error | null, item?: InsightsSessionInstance) => any): Promise; + /** + * Create a InsightsSessionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsSessionInstance + */ + create(params: InsightsSessionContextCreateOptions, callback?: (error: Error | null, item?: InsightsSessionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InsightsSessionContextSolution { +} +export declare class InsightsSessionContextImpl implements InsightsSessionContext { + protected _version: V1; + protected _solution: InsightsSessionContextSolution; + protected _uri: string; + constructor(_version: V1); + create(params?: InsightsSessionContextCreateOptions | ((error: Error | null, item?: InsightsSessionInstance) => any), callback?: (error: Error | null, item?: InsightsSessionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InsightsSessionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InsightsSessionResource { + workspace_id: string; + session_expiry: string; + session_id: string; + base_url: string; + url: string; +} +export declare class InsightsSessionInstance { + protected _version: V1; + protected _solution: InsightsSessionContextSolution; + protected _context?: InsightsSessionContext; + constructor(_version: V1, payload: InsightsSessionResource); + /** + * Unique ID to identify the user\'s workspace + */ + workspaceId: string; + /** + * The session expiry date and time, given in ISO 8601 format. + */ + sessionExpiry: string; + /** + * The unique ID for the session + */ + sessionId: string; + /** + * The base URL to fetch reports and dashboards + */ + baseUrl: string; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Create a InsightsSessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsSessionInstance + */ + create(callback?: (error: Error | null, item?: InsightsSessionInstance) => any): Promise; + /** + * Create a InsightsSessionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsSessionInstance + */ + create(params: InsightsSessionContextCreateOptions, callback?: (error: Error | null, item?: InsightsSessionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + workspaceId: string; + sessionExpiry: string; + sessionId: string; + baseUrl: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InsightsSessionSolution { +} +export interface InsightsSessionListInstance { + _version: V1; + _solution: InsightsSessionSolution; + _uri: string; + (): InsightsSessionContext; + get(): InsightsSessionContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsSessionListInstance(version: V1): InsightsSessionListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsSession.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsSession.js new file mode 100644 index 00000000..5bd9da5d --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsSession.js @@ -0,0 +1,115 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsSessionListInstance = exports.InsightsSessionInstance = exports.InsightsSessionContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class InsightsSessionContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Insights/Session`; + } + create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsSessionInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsSessionContextImpl = InsightsSessionContextImpl; +class InsightsSessionInstance { + constructor(_version, payload) { + this._version = _version; + this.workspaceId = payload.workspace_id; + this.sessionExpiry = payload.session_expiry; + this.sessionId = payload.session_id; + this.baseUrl = payload.base_url; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new InsightsSessionContextImpl(this._version); + return this._context; + } + create(params, callback) { + return this._proxy.create(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + workspaceId: this.workspaceId, + sessionExpiry: this.sessionExpiry, + sessionId: this.sessionId, + baseUrl: this.baseUrl, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsSessionInstance = InsightsSessionInstance; +function InsightsSessionListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new InsightsSessionContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsSessionListInstance = InsightsSessionListInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsAnswerSets.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsAnswerSets.d.ts new file mode 100644 index 00000000..ee4b024d --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsAnswerSets.d.ts @@ -0,0 +1,82 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to fetch a InsightsSettingsAnswerSetsInstance + */ +export interface InsightsSettingsAnswerSetsListInstanceFetchOptions { + /** The Authorization HTTP request header */ + authorization?: string; +} +export interface InsightsSettingsAnswerSetsSolution { +} +export interface InsightsSettingsAnswerSetsListInstance { + _version: V1; + _solution: InsightsSettingsAnswerSetsSolution; + _uri: string; + /** + * Fetch a InsightsSettingsAnswerSetsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsSettingsAnswerSetsInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsSettingsAnswerSetsInstance) => any): Promise; + /** + * Fetch a InsightsSettingsAnswerSetsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsSettingsAnswerSetsInstance + */ + fetch(params: InsightsSettingsAnswerSetsListInstanceFetchOptions, callback?: (error: Error | null, item?: InsightsSettingsAnswerSetsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsSettingsAnswerSetsListInstance(version: V1): InsightsSettingsAnswerSetsListInstance; +interface InsightsSettingsAnswerSetsResource { + account_sid: string; + answer_sets: any; + answer_set_categories: any; + not_applicable: any; + url: string; +} +export declare class InsightsSettingsAnswerSetsInstance { + protected _version: V1; + constructor(_version: V1, payload: InsightsSettingsAnswerSetsResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. + */ + accountSid: string; + /** + * The lis of answer sets + */ + answerSets: any; + /** + * The list of answer set categories + */ + answerSetCategories: any; + /** + * The details for not applicable answer set + */ + notApplicable: any; + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + answerSets: any; + answerSetCategories: any; + notApplicable: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsAnswerSets.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsAnswerSets.js new file mode 100644 index 00000000..bde4879e --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsAnswerSets.js @@ -0,0 +1,83 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsSettingsAnswerSetsInstance = exports.InsightsSettingsAnswerSetsListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function InsightsSettingsAnswerSetsListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/QualityManagement/Settings/AnswerSets`; + instance.fetch = function fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsSettingsAnswerSetsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsSettingsAnswerSetsListInstance = InsightsSettingsAnswerSetsListInstance; +class InsightsSettingsAnswerSetsInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.answerSets = payload.answer_sets; + this.answerSetCategories = payload.answer_set_categories; + this.notApplicable = payload.not_applicable; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + answerSets: this.answerSets, + answerSetCategories: this.answerSetCategories, + notApplicable: this.notApplicable, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsSettingsAnswerSetsInstance = InsightsSettingsAnswerSetsInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsComment.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsComment.d.ts new file mode 100644 index 00000000..3500eada --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsComment.d.ts @@ -0,0 +1,67 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to fetch a InsightsSettingsCommentInstance + */ +export interface InsightsSettingsCommentListInstanceFetchOptions { + /** The Authorization HTTP request header */ + authorization?: string; +} +export interface InsightsSettingsCommentSolution { +} +export interface InsightsSettingsCommentListInstance { + _version: V1; + _solution: InsightsSettingsCommentSolution; + _uri: string; + /** + * Fetch a InsightsSettingsCommentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsSettingsCommentInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsSettingsCommentInstance) => any): Promise; + /** + * Fetch a InsightsSettingsCommentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsSettingsCommentInstance + */ + fetch(params: InsightsSettingsCommentListInstanceFetchOptions, callback?: (error: Error | null, item?: InsightsSettingsCommentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsSettingsCommentListInstance(version: V1): InsightsSettingsCommentListInstance; +interface InsightsSettingsCommentResource { + account_sid: string; + comments: any; + url: string; +} +export declare class InsightsSettingsCommentInstance { + protected _version: V1; + constructor(_version: V1, payload: InsightsSettingsCommentResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. + */ + accountSid: string; + comments: any; + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + comments: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsComment.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsComment.js new file mode 100644 index 00000000..9d9f23d8 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsSettingsComment.js @@ -0,0 +1,79 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsSettingsCommentInstance = exports.InsightsSettingsCommentListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function InsightsSettingsCommentListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Insights/QualityManagement/Settings/CommentTags`; + instance.fetch = function fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + let operationVersion = version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsSettingsCommentInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsSettingsCommentListInstance = InsightsSettingsCommentListInstance; +class InsightsSettingsCommentInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.comments = payload.comments; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + comments: this.comments, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsSettingsCommentInstance = InsightsSettingsCommentInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsUserRoles.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/insightsUserRoles.d.ts new file mode 100644 index 00000000..6674d1de --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsUserRoles.d.ts @@ -0,0 +1,109 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to fetch a InsightsUserRolesInstance + */ +export interface InsightsUserRolesContextFetchOptions { + /** The Authorization HTTP request header */ + authorization?: string; +} +export interface InsightsUserRolesContext { + /** + * Fetch a InsightsUserRolesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsUserRolesInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsUserRolesInstance) => any): Promise; + /** + * Fetch a InsightsUserRolesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsUserRolesInstance + */ + fetch(params: InsightsUserRolesContextFetchOptions, callback?: (error: Error | null, item?: InsightsUserRolesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InsightsUserRolesContextSolution { +} +export declare class InsightsUserRolesContextImpl implements InsightsUserRolesContext { + protected _version: V1; + protected _solution: InsightsUserRolesContextSolution; + protected _uri: string; + constructor(_version: V1); + fetch(params?: InsightsUserRolesContextFetchOptions | ((error: Error | null, item?: InsightsUserRolesInstance) => any), callback?: (error: Error | null, item?: InsightsUserRolesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InsightsUserRolesContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InsightsUserRolesResource { + roles: Array; + url: string; +} +export declare class InsightsUserRolesInstance { + protected _version: V1; + protected _solution: InsightsUserRolesContextSolution; + protected _context?: InsightsUserRolesContext; + constructor(_version: V1, payload: InsightsUserRolesResource); + /** + * Flex Insights roles for the user + */ + roles: Array; + url: string; + private get _proxy(); + /** + * Fetch a InsightsUserRolesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsUserRolesInstance + */ + fetch(callback?: (error: Error | null, item?: InsightsUserRolesInstance) => any): Promise; + /** + * Fetch a InsightsUserRolesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InsightsUserRolesInstance + */ + fetch(params: InsightsUserRolesContextFetchOptions, callback?: (error: Error | null, item?: InsightsUserRolesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + roles: string[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InsightsUserRolesSolution { +} +export interface InsightsUserRolesListInstance { + _version: V1; + _solution: InsightsUserRolesSolution; + _uri: string; + (): InsightsUserRolesContext; + get(): InsightsUserRolesContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InsightsUserRolesListInstance(version: V1): InsightsUserRolesListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/insightsUserRoles.js b/node_modules/twilio/lib/rest/flexApi/v1/insightsUserRoles.js new file mode 100644 index 00000000..338f090b --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/insightsUserRoles.js @@ -0,0 +1,109 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsightsUserRolesListInstance = exports.InsightsUserRolesInstance = exports.InsightsUserRolesContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class InsightsUserRolesContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Insights/UserRoles`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["authorization"] !== undefined) + headers["Authorization"] = params["authorization"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InsightsUserRolesInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsUserRolesContextImpl = InsightsUserRolesContextImpl; +class InsightsUserRolesInstance { + constructor(_version, payload) { + this._version = _version; + this.roles = payload.roles; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new InsightsUserRolesContextImpl(this._version); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + roles: this.roles, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InsightsUserRolesInstance = InsightsUserRolesInstance; +function InsightsUserRolesListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new InsightsUserRolesContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InsightsUserRolesListInstance = InsightsUserRolesListInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/interaction.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/interaction.d.ts new file mode 100644 index 00000000..d1fc202b --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/interaction.d.ts @@ -0,0 +1,131 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { InteractionChannelListInstance } from "./interaction/interactionChannel"; +/** + * Options to pass to create a InteractionInstance + */ +export interface InteractionListInstanceCreateOptions { + /** The Interaction\\\'s channel. */ + channel: any; + /** The Interaction\\\'s routing logic. */ + routing: any; + /** The Interaction context sid is used for adding a context lookup sid */ + interactionContextSid?: string; +} +export interface InteractionContext { + channels: InteractionChannelListInstance; + /** + * Fetch a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionInstance + */ + fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InteractionContextSolution { + sid: string; +} +export declare class InteractionContextImpl implements InteractionContext { + protected _version: V1; + protected _solution: InteractionContextSolution; + protected _uri: string; + protected _channels?: InteractionChannelListInstance; + constructor(_version: V1, sid: string); + get channels(): InteractionChannelListInstance; + fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InteractionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InteractionResource { + sid: string; + channel: any; + routing: any; + url: string; + links: Record; + interaction_context_sid: string; +} +export declare class InteractionInstance { + protected _version: V1; + protected _solution: InteractionContextSolution; + protected _context?: InteractionContext; + constructor(_version: V1, payload: InteractionResource, sid?: string); + /** + * The unique string created by Twilio to identify an Interaction resource, prefixed with KD. + */ + sid: string; + /** + * A JSON object that defines the Interaction’s communication channel and includes details about the channel. See the [Outbound SMS](https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#agent-initiated-outbound-interactions) and [inbound (API-initiated)](https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#api-initiated-contact) Channel object examples. + */ + channel: any; + /** + * A JSON Object representing the routing rules for the Interaction Channel. See [Outbound SMS Example](https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#agent-initiated-outbound-interactions) for an example Routing object. The Interactions resource uses TaskRouter for all routing functionality. All attributes in the Routing object on your Interaction request body are added “as is” to the task. For a list of known attributes consumed by the Flex UI and/or Flex Insights, see [Known Task Attributes](https://www.twilio.com/docs/flex/developer/conversations/interactions-api#task-attributes). + */ + routing: any; + url: string; + links: Record; + interactionContextSid: string; + private get _proxy(); + /** + * Fetch a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionInstance + */ + fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise; + /** + * Access the channels. + */ + channels(): InteractionChannelListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + channel: any; + routing: any; + url: string; + links: Record; + interactionContextSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InteractionSolution { +} +export interface InteractionListInstance { + _version: V1; + _solution: InteractionSolution; + _uri: string; + (sid: string): InteractionContext; + get(sid: string): InteractionContext; + /** + * Create a InteractionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionInstance + */ + create(params: InteractionListInstanceCreateOptions, callback?: (error: Error | null, item?: InteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InteractionListInstance(version: V1): InteractionListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/interaction.js b/node_modules/twilio/lib/rest/flexApi/v1/interaction.js new file mode 100644 index 00000000..68df98e2 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/interaction.js @@ -0,0 +1,156 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InteractionListInstance = exports.InteractionInstance = exports.InteractionContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const interactionChannel_1 = require("./interaction/interactionChannel"); +class InteractionContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Interactions/${sid}`; + } + get channels() { + this._channels = + this._channels || + (0, interactionChannel_1.InteractionChannelListInstance)(this._version, this._solution.sid); + return this._channels; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InteractionInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionContextImpl = InteractionContextImpl; +class InteractionInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.channel = payload.channel; + this.routing = payload.routing; + this.url = payload.url; + this.links = payload.links; + this.interactionContextSid = payload.interaction_context_sid; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InteractionContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the channels. + */ + channels() { + return this._proxy.channels; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + channel: this.channel, + routing: this.routing, + url: this.url, + links: this.links, + interactionContextSid: this.interactionContextSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionInstance = InteractionInstance; +function InteractionListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InteractionContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Interactions`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["channel"] === null || params["channel"] === undefined) { + throw new Error("Required parameter \"params['channel']\" missing."); + } + if (params["routing"] === null || params["routing"] === undefined) { + throw new Error("Required parameter \"params['routing']\" missing."); + } + let data = {}; + data["Channel"] = serialize.object(params["channel"]); + data["Routing"] = serialize.object(params["routing"]); + if (params["interactionContextSid"] !== undefined) + data["InteractionContextSid"] = params["interactionContextSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InteractionListInstance = InteractionListInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts new file mode 100644 index 00000000..0bef32d9 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts @@ -0,0 +1,266 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { InteractionChannelInviteListInstance } from "./interactionChannel/interactionChannelInvite"; +import { InteractionChannelParticipantListInstance } from "./interactionChannel/interactionChannelParticipant"; +export type InteractionChannelChannelStatus = "setup" | "active" | "failed" | "closed" | "inactive"; +export type InteractionChannelType = "voice" | "sms" | "email" | "web" | "whatsapp" | "chat" | "messenger" | "gbm"; +export type InteractionChannelUpdateChannelStatus = "closed" | "inactive"; +/** + * Options to pass to update a InteractionChannelInstance + */ +export interface InteractionChannelContextUpdateOptions { + /** */ + status: InteractionChannelUpdateChannelStatus; + /** It changes the state of associated tasks. Routing status is required, When the channel status is set to `inactive`. Allowed Value for routing status is `closed`. Otherwise Optional, if not specified, all tasks will be set to `wrapping`. */ + routing?: any; +} +/** + * Options to pass to each + */ +export interface InteractionChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InteractionChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InteractionChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InteractionChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InteractionChannelContext { + invites: InteractionChannelInviteListInstance; + participants: InteractionChannelParticipantListInstance; + /** + * Fetch a InteractionChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelInstance + */ + fetch(callback?: (error: Error | null, item?: InteractionChannelInstance) => any): Promise; + /** + * Update a InteractionChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelInstance + */ + update(params: InteractionChannelContextUpdateOptions, callback?: (error: Error | null, item?: InteractionChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InteractionChannelContextSolution { + interactionSid: string; + sid: string; +} +export declare class InteractionChannelContextImpl implements InteractionChannelContext { + protected _version: V1; + protected _solution: InteractionChannelContextSolution; + protected _uri: string; + protected _invites?: InteractionChannelInviteListInstance; + protected _participants?: InteractionChannelParticipantListInstance; + constructor(_version: V1, interactionSid: string, sid: string); + get invites(): InteractionChannelInviteListInstance; + get participants(): InteractionChannelParticipantListInstance; + fetch(callback?: (error: Error | null, item?: InteractionChannelInstance) => any): Promise; + update(params: InteractionChannelContextUpdateOptions, callback?: (error: Error | null, item?: InteractionChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InteractionChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InteractionChannelPayload extends TwilioResponsePayload { + channels: InteractionChannelResource[]; +} +interface InteractionChannelResource { + sid: string; + interaction_sid: string; + type: InteractionChannelType; + status: InteractionChannelChannelStatus; + error_code: number; + error_message: string; + url: string; + links: Record; +} +export declare class InteractionChannelInstance { + protected _version: V1; + protected _solution: InteractionChannelContextSolution; + protected _context?: InteractionChannelContext; + constructor(_version: V1, payload: InteractionChannelResource, interactionSid: string, sid?: string); + /** + * The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO. + */ + sid: string; + /** + * The unique string created by Twilio to identify an Interaction resource, prefixed with KD. + */ + interactionSid: string; + type: InteractionChannelType; + status: InteractionChannelChannelStatus; + /** + * The Twilio error code for a failed channel. + */ + errorCode: number; + /** + * The error message for a failed channel. + */ + errorMessage: string; + url: string; + links: Record; + private get _proxy(); + /** + * Fetch a InteractionChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelInstance + */ + fetch(callback?: (error: Error | null, item?: InteractionChannelInstance) => any): Promise; + /** + * Update a InteractionChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelInstance + */ + update(params: InteractionChannelContextUpdateOptions, callback?: (error: Error | null, item?: InteractionChannelInstance) => any): Promise; + /** + * Access the invites. + */ + invites(): InteractionChannelInviteListInstance; + /** + * Access the participants. + */ + participants(): InteractionChannelParticipantListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + interactionSid: string; + type: InteractionChannelType; + status: InteractionChannelChannelStatus; + errorCode: number; + errorMessage: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InteractionChannelSolution { + interactionSid: string; +} +export interface InteractionChannelListInstance { + _version: V1; + _solution: InteractionChannelSolution; + _uri: string; + (sid: string): InteractionChannelContext; + get(sid: string): InteractionChannelContext; + /** + * Streams InteractionChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InteractionChannelInstance, done: (err?: Error) => void) => void): void; + each(params: InteractionChannelListInstanceEachOptions, callback?: (item: InteractionChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InteractionChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InteractionChannelPage) => any): Promise; + /** + * Lists InteractionChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InteractionChannelInstance[]) => any): Promise; + list(params: InteractionChannelListInstanceOptions, callback?: (error: Error | null, items: InteractionChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of InteractionChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InteractionChannelPage) => any): Promise; + page(params: InteractionChannelListInstancePageOptions, callback?: (error: Error | null, items: InteractionChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InteractionChannelListInstance(version: V1, interactionSid: string): InteractionChannelListInstance; +export declare class InteractionChannelPage extends Page { + /** + * Initialize the InteractionChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InteractionChannelSolution); + /** + * Build an instance of InteractionChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InteractionChannelResource): InteractionChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel.js b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel.js new file mode 100644 index 00000000..e3d317e1 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel.js @@ -0,0 +1,244 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InteractionChannelPage = exports.InteractionChannelListInstance = exports.InteractionChannelInstance = exports.InteractionChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const interactionChannelInvite_1 = require("./interactionChannel/interactionChannelInvite"); +const interactionChannelParticipant_1 = require("./interactionChannel/interactionChannelParticipant"); +class InteractionChannelContextImpl { + constructor(_version, interactionSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(interactionSid)) { + throw new Error("Parameter 'interactionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { interactionSid, sid }; + this._uri = `/Interactions/${interactionSid}/Channels/${sid}`; + } + get invites() { + this._invites = + this._invites || + (0, interactionChannelInvite_1.InteractionChannelInviteListInstance)(this._version, this._solution.interactionSid, this._solution.sid); + return this._invites; + } + get participants() { + this._participants = + this._participants || + (0, interactionChannelParticipant_1.InteractionChannelParticipantListInstance)(this._version, this._solution.interactionSid, this._solution.sid); + return this._participants; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InteractionChannelInstance(operationVersion, payload, instance._solution.interactionSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + if (params["routing"] !== undefined) + data["Routing"] = serialize.object(params["routing"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionChannelInstance(operationVersion, payload, instance._solution.interactionSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionChannelContextImpl = InteractionChannelContextImpl; +class InteractionChannelInstance { + constructor(_version, payload, interactionSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.interactionSid = payload.interaction_sid; + this.type = payload.type; + this.status = payload.status; + this.errorCode = deserialize.integer(payload.error_code); + this.errorMessage = payload.error_message; + this.url = payload.url; + this.links = payload.links; + this._solution = { interactionSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InteractionChannelContextImpl(this._version, this._solution.interactionSid, this._solution.sid); + return this._context; + } + /** + * Fetch a InteractionChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the invites. + */ + invites() { + return this._proxy.invites; + } + /** + * Access the participants. + */ + participants() { + return this._proxy.participants; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + interactionSid: this.interactionSid, + type: this.type, + status: this.status, + errorCode: this.errorCode, + errorMessage: this.errorMessage, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionChannelInstance = InteractionChannelInstance; +function InteractionChannelListInstance(version, interactionSid) { + if (!(0, utility_1.isValidPathParam)(interactionSid)) { + throw new Error("Parameter 'interactionSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InteractionChannelContextImpl(version, interactionSid, sid); + }; + instance._version = version; + instance._solution = { interactionSid }; + instance._uri = `/Interactions/${interactionSid}/Channels`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InteractionChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InteractionChannelListInstance = InteractionChannelListInstance; +class InteractionChannelPage extends Page_1.default { + /** + * Initialize the InteractionChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InteractionChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InteractionChannelInstance(this._version, payload, this._solution.interactionSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionChannelPage = InteractionChannelPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.d.ts new file mode 100644 index 00000000..f6f1dae8 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.d.ts @@ -0,0 +1,181 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to create a InteractionChannelInviteInstance + */ +export interface InteractionChannelInviteListInstanceCreateOptions { + /** The Interaction\\\'s routing logic. */ + routing: any; +} +/** + * Options to pass to each + */ +export interface InteractionChannelInviteListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InteractionChannelInviteInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InteractionChannelInviteListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InteractionChannelInviteListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InteractionChannelInviteSolution { + interactionSid: string; + channelSid: string; +} +export interface InteractionChannelInviteListInstance { + _version: V1; + _solution: InteractionChannelInviteSolution; + _uri: string; + /** + * Create a InteractionChannelInviteInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelInviteInstance + */ + create(params: InteractionChannelInviteListInstanceCreateOptions, callback?: (error: Error | null, item?: InteractionChannelInviteInstance) => any): Promise; + /** + * Streams InteractionChannelInviteInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelInviteListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InteractionChannelInviteInstance, done: (err?: Error) => void) => void): void; + each(params: InteractionChannelInviteListInstanceEachOptions, callback?: (item: InteractionChannelInviteInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InteractionChannelInviteInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InteractionChannelInvitePage) => any): Promise; + /** + * Lists InteractionChannelInviteInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelInviteListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InteractionChannelInviteInstance[]) => any): Promise; + list(params: InteractionChannelInviteListInstanceOptions, callback?: (error: Error | null, items: InteractionChannelInviteInstance[]) => any): Promise; + /** + * Retrieve a single page of InteractionChannelInviteInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelInviteListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InteractionChannelInvitePage) => any): Promise; + page(params: InteractionChannelInviteListInstancePageOptions, callback?: (error: Error | null, items: InteractionChannelInvitePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InteractionChannelInviteListInstance(version: V1, interactionSid: string, channelSid: string): InteractionChannelInviteListInstance; +interface InteractionChannelInvitePayload extends TwilioResponsePayload { + invites: InteractionChannelInviteResource[]; +} +interface InteractionChannelInviteResource { + sid: string; + interaction_sid: string; + channel_sid: string; + routing: any; + url: string; +} +export declare class InteractionChannelInviteInstance { + protected _version: V1; + constructor(_version: V1, payload: InteractionChannelInviteResource, interactionSid: string, channelSid: string); + /** + * The unique string created by Twilio to identify an Interaction Channel Invite resource. + */ + sid: string; + /** + * The Interaction SID for this Channel. + */ + interactionSid: string; + /** + * The Channel SID for this Invite. + */ + channelSid: string; + /** + * A JSON object representing the routing rules for the Interaction Channel. See [Outbound SMS Example](https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#agent-initiated-outbound-interactions) for an example Routing object. The Interactions resource uses TaskRouter for all routing functionality. All attributes in the Routing object on your Interaction request body are added “as is” to the task. For a list of known attributes consumed by the Flex UI and/or Flex Insights, see [Known Task Attributes](https://www.twilio.com/docs/flex/developer/conversations/interactions-api#task-attributes). + */ + routing: any; + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + interactionSid: string; + channelSid: string; + routing: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class InteractionChannelInvitePage extends Page { + /** + * Initialize the InteractionChannelInvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InteractionChannelInviteSolution); + /** + * Build an instance of InteractionChannelInviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InteractionChannelInviteResource): InteractionChannelInviteInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.js b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.js new file mode 100644 index 00000000..5a6ec96d --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.js @@ -0,0 +1,154 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InteractionChannelInvitePage = exports.InteractionChannelInviteInstance = exports.InteractionChannelInviteListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function InteractionChannelInviteListInstance(version, interactionSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(interactionSid)) { + throw new Error("Parameter 'interactionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { interactionSid, channelSid }; + instance._uri = `/Interactions/${interactionSid}/Channels/${channelSid}/Invites`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["routing"] === null || params["routing"] === undefined) { + throw new Error("Required parameter \"params['routing']\" missing."); + } + let data = {}; + data["Routing"] = serialize.object(params["routing"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionChannelInviteInstance(operationVersion, payload, instance._solution.interactionSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionChannelInvitePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InteractionChannelInvitePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InteractionChannelInviteListInstance = InteractionChannelInviteListInstance; +class InteractionChannelInviteInstance { + constructor(_version, payload, interactionSid, channelSid) { + this._version = _version; + this.sid = payload.sid; + this.interactionSid = payload.interaction_sid; + this.channelSid = payload.channel_sid; + this.routing = payload.routing; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + interactionSid: this.interactionSid, + channelSid: this.channelSid, + routing: this.routing, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionChannelInviteInstance = InteractionChannelInviteInstance; +class InteractionChannelInvitePage extends Page_1.default { + /** + * Initialize the InteractionChannelInvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InteractionChannelInviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InteractionChannelInviteInstance(this._version, payload, this._solution.interactionSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionChannelInvitePage = InteractionChannelInvitePage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts new file mode 100644 index 00000000..6cd6e5e0 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts @@ -0,0 +1,238 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type InteractionChannelParticipantStatus = "closed" | "wrapup"; +export type InteractionChannelParticipantType = "supervisor" | "customer" | "external" | "agent" | "unknown"; +/** + * Options to pass to update a InteractionChannelParticipantInstance + */ +export interface InteractionChannelParticipantContextUpdateOptions { + /** */ + status: InteractionChannelParticipantStatus; +} +/** + * Options to pass to create a InteractionChannelParticipantInstance + */ +export interface InteractionChannelParticipantListInstanceCreateOptions { + /** */ + type: InteractionChannelParticipantType; + /** JSON representing the Media Properties for the new Participant. */ + mediaProperties: any; +} +/** + * Options to pass to each + */ +export interface InteractionChannelParticipantListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InteractionChannelParticipantInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InteractionChannelParticipantListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InteractionChannelParticipantListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InteractionChannelParticipantContext { + /** + * Update a InteractionChannelParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelParticipantInstance + */ + update(params: InteractionChannelParticipantContextUpdateOptions, callback?: (error: Error | null, item?: InteractionChannelParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InteractionChannelParticipantContextSolution { + interactionSid: string; + channelSid: string; + sid: string; +} +export declare class InteractionChannelParticipantContextImpl implements InteractionChannelParticipantContext { + protected _version: V1; + protected _solution: InteractionChannelParticipantContextSolution; + protected _uri: string; + constructor(_version: V1, interactionSid: string, channelSid: string, sid: string); + update(params: InteractionChannelParticipantContextUpdateOptions, callback?: (error: Error | null, item?: InteractionChannelParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InteractionChannelParticipantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InteractionChannelParticipantPayload extends TwilioResponsePayload { + participants: InteractionChannelParticipantResource[]; +} +interface InteractionChannelParticipantResource { + sid: string; + type: InteractionChannelParticipantType; + interaction_sid: string; + channel_sid: string; + url: string; +} +export declare class InteractionChannelParticipantInstance { + protected _version: V1; + protected _solution: InteractionChannelParticipantContextSolution; + protected _context?: InteractionChannelParticipantContext; + constructor(_version: V1, payload: InteractionChannelParticipantResource, interactionSid: string, channelSid: string, sid?: string); + /** + * The unique string created by Twilio to identify an Interaction Channel Participant resource. + */ + sid: string; + type: InteractionChannelParticipantType; + /** + * The Interaction Sid for this channel. + */ + interactionSid: string; + /** + * The Channel Sid for this Participant. + */ + channelSid: string; + url: string; + private get _proxy(); + /** + * Update a InteractionChannelParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelParticipantInstance + */ + update(params: InteractionChannelParticipantContextUpdateOptions, callback?: (error: Error | null, item?: InteractionChannelParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + type: InteractionChannelParticipantType; + interactionSid: string; + channelSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InteractionChannelParticipantSolution { + interactionSid: string; + channelSid: string; +} +export interface InteractionChannelParticipantListInstance { + _version: V1; + _solution: InteractionChannelParticipantSolution; + _uri: string; + (sid: string): InteractionChannelParticipantContext; + get(sid: string): InteractionChannelParticipantContext; + /** + * Create a InteractionChannelParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionChannelParticipantInstance + */ + create(params: InteractionChannelParticipantListInstanceCreateOptions, callback?: (error: Error | null, item?: InteractionChannelParticipantInstance) => any): Promise; + /** + * Streams InteractionChannelParticipantInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelParticipantListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InteractionChannelParticipantInstance, done: (err?: Error) => void) => void): void; + each(params: InteractionChannelParticipantListInstanceEachOptions, callback?: (item: InteractionChannelParticipantInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InteractionChannelParticipantInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InteractionChannelParticipantPage) => any): Promise; + /** + * Lists InteractionChannelParticipantInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelParticipantListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InteractionChannelParticipantInstance[]) => any): Promise; + list(params: InteractionChannelParticipantListInstanceOptions, callback?: (error: Error | null, items: InteractionChannelParticipantInstance[]) => any): Promise; + /** + * Retrieve a single page of InteractionChannelParticipantInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionChannelParticipantListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InteractionChannelParticipantPage) => any): Promise; + page(params: InteractionChannelParticipantListInstancePageOptions, callback?: (error: Error | null, items: InteractionChannelParticipantPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InteractionChannelParticipantListInstance(version: V1, interactionSid: string, channelSid: string): InteractionChannelParticipantListInstance; +export declare class InteractionChannelParticipantPage extends Page { + /** + * Initialize the InteractionChannelParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InteractionChannelParticipantSolution); + /** + * Build an instance of InteractionChannelParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InteractionChannelParticipantResource): InteractionChannelParticipantInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.js b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.js new file mode 100644 index 00000000..5e8e1c78 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.js @@ -0,0 +1,222 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InteractionChannelParticipantPage = exports.InteractionChannelParticipantListInstance = exports.InteractionChannelParticipantInstance = exports.InteractionChannelParticipantContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class InteractionChannelParticipantContextImpl { + constructor(_version, interactionSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(interactionSid)) { + throw new Error("Parameter 'interactionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { interactionSid, channelSid, sid }; + this._uri = `/Interactions/${interactionSid}/Channels/${channelSid}/Participants/${sid}`; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionChannelParticipantInstance(operationVersion, payload, instance._solution.interactionSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionChannelParticipantContextImpl = InteractionChannelParticipantContextImpl; +class InteractionChannelParticipantInstance { + constructor(_version, payload, interactionSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.type = payload.type; + this.interactionSid = payload.interaction_sid; + this.channelSid = payload.channel_sid; + this.url = payload.url; + this._solution = { interactionSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InteractionChannelParticipantContextImpl(this._version, this._solution.interactionSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + type: this.type, + interactionSid: this.interactionSid, + channelSid: this.channelSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionChannelParticipantInstance = InteractionChannelParticipantInstance; +function InteractionChannelParticipantListInstance(version, interactionSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(interactionSid)) { + throw new Error("Parameter 'interactionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InteractionChannelParticipantContextImpl(version, interactionSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { interactionSid, channelSid }; + instance._uri = `/Interactions/${interactionSid}/Channels/${channelSid}/Participants`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + if (params["mediaProperties"] === null || + params["mediaProperties"] === undefined) { + throw new Error("Required parameter \"params['mediaProperties']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + data["MediaProperties"] = serialize.object(params["mediaProperties"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionChannelParticipantInstance(operationVersion, payload, instance._solution.interactionSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionChannelParticipantPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InteractionChannelParticipantPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InteractionChannelParticipantListInstance = InteractionChannelParticipantListInstance; +class InteractionChannelParticipantPage extends Page_1.default { + /** + * Initialize the InteractionChannelParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InteractionChannelParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InteractionChannelParticipantInstance(this._version, payload, this._solution.interactionSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionChannelParticipantPage = InteractionChannelParticipantPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/provisioningStatus.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/provisioningStatus.d.ts new file mode 100644 index 00000000..7faf8b2d --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/provisioningStatus.d.ts @@ -0,0 +1,85 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export type ProvisioningStatusStatus = "active" | "in-progress" | "not-configured" | "failed"; +export interface ProvisioningStatusContext { + /** + * Fetch a ProvisioningStatusInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ProvisioningStatusInstance + */ + fetch(callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ProvisioningStatusContextSolution { +} +export declare class ProvisioningStatusContextImpl implements ProvisioningStatusContext { + protected _version: V1; + protected _solution: ProvisioningStatusContextSolution; + protected _uri: string; + constructor(_version: V1); + fetch(callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ProvisioningStatusContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ProvisioningStatusResource { + status: ProvisioningStatusStatus; + url: string; +} +export declare class ProvisioningStatusInstance { + protected _version: V1; + protected _solution: ProvisioningStatusContextSolution; + protected _context?: ProvisioningStatusContext; + constructor(_version: V1, payload: ProvisioningStatusResource); + status: ProvisioningStatusStatus; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ProvisioningStatusInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ProvisioningStatusInstance + */ + fetch(callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + status: ProvisioningStatusStatus; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ProvisioningStatusSolution { +} +export interface ProvisioningStatusListInstance { + _version: V1; + _solution: ProvisioningStatusSolution; + _uri: string; + (): ProvisioningStatusContext; + get(): ProvisioningStatusContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ProvisioningStatusListInstance(version: V1): ProvisioningStatusListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/provisioningStatus.js b/node_modules/twilio/lib/rest/flexApi/v1/provisioningStatus.js new file mode 100644 index 00000000..2df1e766 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/provisioningStatus.js @@ -0,0 +1,103 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProvisioningStatusListInstance = exports.ProvisioningStatusInstance = exports.ProvisioningStatusContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class ProvisioningStatusContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/account/provision/status`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ProvisioningStatusInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ProvisioningStatusContextImpl = ProvisioningStatusContextImpl; +class ProvisioningStatusInstance { + constructor(_version, payload) { + this._version = _version; + this.status = payload.status; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new ProvisioningStatusContextImpl(this._version); + return this._context; + } + /** + * Fetch a ProvisioningStatusInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ProvisioningStatusInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + status: this.status, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ProvisioningStatusInstance = ProvisioningStatusInstance; +function ProvisioningStatusListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new ProvisioningStatusContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ProvisioningStatusListInstance = ProvisioningStatusListInstance; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/webChannel.d.ts b/node_modules/twilio/lib/rest/flexApi/v1/webChannel.d.ts new file mode 100644 index 00000000..77fa242c --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/webChannel.d.ts @@ -0,0 +1,305 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type WebChannelChatStatus = "inactive"; +/** + * Options to pass to update a WebChannelInstance + */ +export interface WebChannelContextUpdateOptions { + /** */ + chatStatus?: WebChannelChatStatus; + /** The post-engagement data. */ + postEngagementData?: string; +} +/** + * Options to pass to create a WebChannelInstance + */ +export interface WebChannelListInstanceCreateOptions { + /** The SID of the Flex Flow. */ + flexFlowSid: string; + /** The chat identity. */ + identity: string; + /** The chat participant\\\'s friendly name. */ + customerFriendlyName: string; + /** The chat channel\\\'s friendly name. */ + chatFriendlyName: string; + /** The chat channel\\\'s unique name. */ + chatUniqueName?: string; + /** The pre-engagement data. */ + preEngagementData?: string; +} +/** + * Options to pass to each + */ +export interface WebChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WebChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WebChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WebChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WebChannelContext { + /** + * Remove a WebChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelInstance + */ + fetch(callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + /** + * Update a WebChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelInstance + */ + update(callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + /** + * Update a WebChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelInstance + */ + update(params: WebChannelContextUpdateOptions, callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WebChannelContextSolution { + sid: string; +} +export declare class WebChannelContextImpl implements WebChannelContext { + protected _version: V1; + protected _solution: WebChannelContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + update(params?: WebChannelContextUpdateOptions | ((error: Error | null, item?: WebChannelInstance) => any), callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WebChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WebChannelPayload extends TwilioResponsePayload { + flex_chat_channels: WebChannelResource[]; +} +interface WebChannelResource { + account_sid: string; + flex_flow_sid: string; + sid: string; + url: string; + date_created: Date; + date_updated: Date; +} +export declare class WebChannelInstance { + protected _version: V1; + protected _solution: WebChannelContextSolution; + protected _context?: WebChannelContext; + constructor(_version: V1, payload: WebChannelResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the WebChannel resource and owns this Workflow. + */ + accountSid: string; + /** + * The SID of the Flex Flow. + */ + flexFlowSid: string; + /** + * The unique string that we created to identify the WebChannel resource. + */ + sid: string; + /** + * The absolute URL of the WebChannel resource. + */ + url: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a WebChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelInstance + */ + fetch(callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + /** + * Update a WebChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelInstance + */ + update(callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + /** + * Update a WebChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelInstance + */ + update(params: WebChannelContextUpdateOptions, callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + flexFlowSid: string; + sid: string; + url: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WebChannelSolution { +} +export interface WebChannelListInstance { + _version: V1; + _solution: WebChannelSolution; + _uri: string; + (sid: string): WebChannelContext; + get(sid: string): WebChannelContext; + /** + * Create a WebChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelInstance + */ + create(params: WebChannelListInstanceCreateOptions, callback?: (error: Error | null, item?: WebChannelInstance) => any): Promise; + /** + * Streams WebChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WebChannelInstance, done: (err?: Error) => void) => void): void; + each(params: WebChannelListInstanceEachOptions, callback?: (item: WebChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WebChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WebChannelPage) => any): Promise; + /** + * Lists WebChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WebChannelInstance[]) => any): Promise; + list(params: WebChannelListInstanceOptions, callback?: (error: Error | null, items: WebChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of WebChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WebChannelPage) => any): Promise; + page(params: WebChannelListInstancePageOptions, callback?: (error: Error | null, items: WebChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebChannelListInstance(version: V1): WebChannelListInstance; +export declare class WebChannelPage extends Page { + /** + * Initialize the WebChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: WebChannelSolution); + /** + * Build an instance of WebChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WebChannelResource): WebChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v1/webChannel.js b/node_modules/twilio/lib/rest/flexApi/v1/webChannel.js new file mode 100644 index 00000000..954f2d49 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v1/webChannel.js @@ -0,0 +1,268 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebChannelPage = exports.WebChannelListInstance = exports.WebChannelInstance = exports.WebChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class WebChannelContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/WebChannels/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WebChannelInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["chatStatus"] !== undefined) + data["ChatStatus"] = params["chatStatus"]; + if (params["postEngagementData"] !== undefined) + data["PostEngagementData"] = params["postEngagementData"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebChannelInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebChannelContextImpl = WebChannelContextImpl; +class WebChannelInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.flexFlowSid = payload.flex_flow_sid; + this.sid = payload.sid; + this.url = payload.url; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WebChannelContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a WebChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a WebChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + flexFlowSid: this.flexFlowSid, + sid: this.sid, + url: this.url, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebChannelInstance = WebChannelInstance; +function WebChannelListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WebChannelContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/WebChannels`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["flexFlowSid"] === null || params["flexFlowSid"] === undefined) { + throw new Error("Required parameter \"params['flexFlowSid']\" missing."); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + if (params["customerFriendlyName"] === null || + params["customerFriendlyName"] === undefined) { + throw new Error("Required parameter \"params['customerFriendlyName']\" missing."); + } + if (params["chatFriendlyName"] === null || + params["chatFriendlyName"] === undefined) { + throw new Error("Required parameter \"params['chatFriendlyName']\" missing."); + } + let data = {}; + data["FlexFlowSid"] = params["flexFlowSid"]; + data["Identity"] = params["identity"]; + data["CustomerFriendlyName"] = params["customerFriendlyName"]; + data["ChatFriendlyName"] = params["chatFriendlyName"]; + if (params["chatUniqueName"] !== undefined) + data["ChatUniqueName"] = params["chatUniqueName"]; + if (params["preEngagementData"] !== undefined) + data["PreEngagementData"] = params["preEngagementData"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebChannelInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WebChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebChannelListInstance = WebChannelListInstance; +class WebChannelPage extends Page_1.default { + /** + * Initialize the WebChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WebChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WebChannelInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebChannelPage = WebChannelPage; diff --git a/node_modules/twilio/lib/rest/flexApi/v2/webChannels.d.ts b/node_modules/twilio/lib/rest/flexApi/v2/webChannels.d.ts new file mode 100644 index 00000000..7551dd2a --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v2/webChannels.d.ts @@ -0,0 +1,65 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +/** + * Options to pass to create a WebChannelsInstance + */ +export interface WebChannelsListInstanceCreateOptions { + /** The SID of the Conversations Address. See [Address Configuration Resource](https://www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration. */ + addressSid: string; + /** The Conversation\\\'s friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. */ + chatFriendlyName?: string; + /** The Conversation participant\\\'s friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. */ + customerFriendlyName?: string; + /** The pre-engagement data. */ + preEngagementData?: string; +} +export interface WebChannelsSolution { +} +export interface WebChannelsListInstance { + _version: V2; + _solution: WebChannelsSolution; + _uri: string; + /** + * Create a WebChannelsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebChannelsInstance + */ + create(params: WebChannelsListInstanceCreateOptions, callback?: (error: Error | null, item?: WebChannelsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebChannelsListInstance(version: V2): WebChannelsListInstance; +interface WebChannelsResource { + conversation_sid: string; + identity: string; +} +export declare class WebChannelsInstance { + protected _version: V2; + constructor(_version: V2, payload: WebChannelsResource); + /** + * The unique string representing the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) created. + */ + conversationSid: string; + /** + * The unique string representing the User created and should be authorized to participate in the Conversation. For more details, see [User Identity & Access Tokens](https://www.twilio.com/docs/conversations/identity). + */ + identity: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + conversationSid: string; + identity: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/flexApi/v2/webChannels.js b/node_modules/twilio/lib/rest/flexApi/v2/webChannels.js new file mode 100644 index 00000000..247a8049 --- /dev/null +++ b/node_modules/twilio/lib/rest/flexApi/v2/webChannels.js @@ -0,0 +1,82 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Flex + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebChannelsInstance = exports.WebChannelsListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function WebChannelsListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/WebChats`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["addressSid"] === null || params["addressSid"] === undefined) { + throw new Error("Required parameter \"params['addressSid']\" missing."); + } + let data = {}; + data["AddressSid"] = params["addressSid"]; + if (params["chatFriendlyName"] !== undefined) + data["ChatFriendlyName"] = params["chatFriendlyName"]; + if (params["customerFriendlyName"] !== undefined) + data["CustomerFriendlyName"] = params["customerFriendlyName"]; + if (params["preEngagementData"] !== undefined) + data["PreEngagementData"] = params["preEngagementData"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebChannelsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebChannelsListInstance = WebChannelsListInstance; +class WebChannelsInstance { + constructor(_version, payload) { + this._version = _version; + this.conversationSid = payload.conversation_sid; + this.identity = payload.identity; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + conversationSid: this.conversationSid, + identity: this.identity, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebChannelsInstance = WebChannelsInstance; diff --git a/node_modules/twilio/lib/rest/frontlineApi/V1.d.ts b/node_modules/twilio/lib/rest/frontlineApi/V1.d.ts new file mode 100644 index 00000000..387395dc --- /dev/null +++ b/node_modules/twilio/lib/rest/frontlineApi/V1.d.ts @@ -0,0 +1,15 @@ +import FrontlineApiBase from "../FrontlineApiBase"; +import Version from "../../base/Version"; +import { UserListInstance } from "./v1/user"; +export default class V1 extends Version { + /** + * Initialize the V1 version of FrontlineApi + * + * @param domain - The Twilio (Twilio.FrontlineApi) domain + */ + constructor(domain: FrontlineApiBase); + /** users - { Twilio.FrontlineApi.V1.UserListInstance } resource */ + protected _users?: UserListInstance; + /** Getter for users resource */ + get users(): UserListInstance; +} diff --git a/node_modules/twilio/lib/rest/frontlineApi/V1.js b/node_modules/twilio/lib/rest/frontlineApi/V1.js new file mode 100644 index 00000000..abfa93a3 --- /dev/null +++ b/node_modules/twilio/lib/rest/frontlineApi/V1.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Frontline + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const user_1 = require("./v1/user"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of FrontlineApi + * + * @param domain - The Twilio (Twilio.FrontlineApi) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for users resource */ + get users() { + this._users = this._users || (0, user_1.UserListInstance)(this); + return this._users; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/frontlineApi/v1/user.d.ts b/node_modules/twilio/lib/rest/frontlineApi/v1/user.d.ts new file mode 100644 index 00000000..87fcc110 --- /dev/null +++ b/node_modules/twilio/lib/rest/frontlineApi/v1/user.d.ts @@ -0,0 +1,164 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export type UserStateType = "active" | "deactivated"; +/** + * Options to pass to update a UserInstance + */ +export interface UserContextUpdateOptions { + /** The string that you assigned to describe the User. */ + friendlyName?: string; + /** The avatar URL which will be shown in Frontline application. */ + avatar?: string; + /** */ + state?: UserStateType; + /** Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). */ + isAvailable?: boolean; +} +export interface UserContext { + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserContextSolution { + sid: string; +} +export declare class UserContextImpl implements UserContext { + protected _version: V1; + protected _solution: UserContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + update(params?: UserContextUpdateOptions | ((error: Error | null, item?: UserInstance) => any), callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserResource { + sid: string; + identity: string; + friendly_name: string; + avatar: string; + state: UserStateType; + is_available: boolean; + url: string; +} +export declare class UserInstance { + protected _version: V1; + protected _solution: UserContextSolution; + protected _context?: UserContext; + constructor(_version: V1, payload: UserResource, sid?: string); + /** + * The unique string that we created to identify the User resource. + */ + sid: string; + /** + * The application-defined string that uniquely identifies the resource\'s User. This value is often a username or an email address, and is case-sensitive. + */ + identity: string; + /** + * The string that you assigned to describe the User. + */ + friendlyName: string; + /** + * The avatar URL which will be shown in Frontline application. + */ + avatar: string; + state: UserStateType; + /** + * Whether the User is available for new conversations. Defaults to `false` for new users. + */ + isAvailable: boolean; + /** + * An absolute API resource URL for this user. + */ + url: string; + private get _proxy(); + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + identity: string; + friendlyName: string; + avatar: string; + state: UserStateType; + isAvailable: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserSolution { +} +export interface UserListInstance { + _version: V1; + _solution: UserSolution; + _uri: string; + (sid: string): UserContext; + get(sid: string): UserContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserListInstance(version: V1): UserListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/frontlineApi/v1/user.js b/node_modules/twilio/lib/rest/frontlineApi/v1/user.js new file mode 100644 index 00000000..47ab7fd6 --- /dev/null +++ b/node_modules/twilio/lib/rest/frontlineApi/v1/user.js @@ -0,0 +1,150 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Frontline + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserListInstance = exports.UserInstance = exports.UserContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class UserContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Users/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["avatar"] !== undefined) + data["Avatar"] = params["avatar"]; + if (params["state"] !== undefined) + data["State"] = params["state"]; + if (params["isAvailable"] !== undefined) + data["IsAvailable"] = serialize.bool(params["isAvailable"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserContextImpl = UserContextImpl; +class UserInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.identity = payload.identity; + this.friendlyName = payload.friendly_name; + this.avatar = payload.avatar; + this.state = payload.state; + this.isAvailable = payload.is_available; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new UserContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + identity: this.identity, + friendlyName: this.friendlyName, + avatar: this.avatar, + state: this.state, + isAvailable: this.isAvailable, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserInstance = UserInstance; +function UserListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserListInstance = UserListInstance; diff --git a/node_modules/twilio/lib/rest/insights/V1.d.ts b/node_modules/twilio/lib/rest/insights/V1.d.ts new file mode 100644 index 00000000..ceadf451 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/V1.d.ts @@ -0,0 +1,35 @@ +import InsightsBase from "../InsightsBase"; +import Version from "../../base/Version"; +import { CallListInstance } from "./v1/call"; +import { CallSummariesListInstance } from "./v1/callSummaries"; +import { ConferenceListInstance } from "./v1/conference"; +import { RoomListInstance } from "./v1/room"; +import { SettingListInstance } from "./v1/setting"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Insights + * + * @param domain - The Twilio (Twilio.Insights) domain + */ + constructor(domain: InsightsBase); + /** calls - { Twilio.Insights.V1.CallListInstance } resource */ + protected _calls?: CallListInstance; + /** callSummaries - { Twilio.Insights.V1.CallSummariesListInstance } resource */ + protected _callSummaries?: CallSummariesListInstance; + /** conferences - { Twilio.Insights.V1.ConferenceListInstance } resource */ + protected _conferences?: ConferenceListInstance; + /** rooms - { Twilio.Insights.V1.RoomListInstance } resource */ + protected _rooms?: RoomListInstance; + /** settings - { Twilio.Insights.V1.SettingListInstance } resource */ + protected _settings?: SettingListInstance; + /** Getter for calls resource */ + get calls(): CallListInstance; + /** Getter for callSummaries resource */ + get callSummaries(): CallSummariesListInstance; + /** Getter for conferences resource */ + get conferences(): ConferenceListInstance; + /** Getter for rooms resource */ + get rooms(): RoomListInstance; + /** Getter for settings resource */ + get settings(): SettingListInstance; +} diff --git a/node_modules/twilio/lib/rest/insights/V1.js b/node_modules/twilio/lib/rest/insights/V1.js new file mode 100644 index 00000000..7e9fa9f8 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/V1.js @@ -0,0 +1,61 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const call_1 = require("./v1/call"); +const callSummaries_1 = require("./v1/callSummaries"); +const conference_1 = require("./v1/conference"); +const room_1 = require("./v1/room"); +const setting_1 = require("./v1/setting"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Insights + * + * @param domain - The Twilio (Twilio.Insights) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for calls resource */ + get calls() { + this._calls = this._calls || (0, call_1.CallListInstance)(this); + return this._calls; + } + /** Getter for callSummaries resource */ + get callSummaries() { + this._callSummaries = + this._callSummaries || (0, callSummaries_1.CallSummariesListInstance)(this); + return this._callSummaries; + } + /** Getter for conferences resource */ + get conferences() { + this._conferences = this._conferences || (0, conference_1.ConferenceListInstance)(this); + return this._conferences; + } + /** Getter for rooms resource */ + get rooms() { + this._rooms = this._rooms || (0, room_1.RoomListInstance)(this); + return this._rooms; + } + /** Getter for settings resource */ + get settings() { + this._settings = this._settings || (0, setting_1.SettingListInstance)(this); + return this._settings; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/insights/v1/call.d.ts b/node_modules/twilio/lib/rest/insights/v1/call.d.ts new file mode 100644 index 00000000..33849df9 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call.d.ts @@ -0,0 +1,117 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { AnnotationListInstance } from "./call/annotation"; +import { CallSummaryListInstance } from "./call/callSummary"; +import { EventListInstance } from "./call/event"; +import { MetricListInstance } from "./call/metric"; +export interface CallContext { + annotation: AnnotationListInstance; + summary: CallSummaryListInstance; + events: EventListInstance; + metrics: MetricListInstance; + /** + * Fetch a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + fetch(callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CallContextSolution { + sid: string; +} +export declare class CallContextImpl implements CallContext { + protected _version: V1; + protected _solution: CallContextSolution; + protected _uri: string; + protected _annotation?: AnnotationListInstance; + protected _summary?: CallSummaryListInstance; + protected _events?: EventListInstance; + protected _metrics?: MetricListInstance; + constructor(_version: V1, sid: string); + get annotation(): AnnotationListInstance; + get summary(): CallSummaryListInstance; + get events(): EventListInstance; + get metrics(): MetricListInstance; + fetch(callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CallContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CallResource { + sid: string; + url: string; + links: Record; +} +export declare class CallInstance { + protected _version: V1; + protected _solution: CallContextSolution; + protected _context?: CallContext; + constructor(_version: V1, payload: CallResource, sid?: string); + sid: string; + url: string; + links: Record; + private get _proxy(); + /** + * Fetch a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + fetch(callback?: (error: Error | null, item?: CallInstance) => any): Promise; + /** + * Access the annotation. + */ + annotation(): AnnotationListInstance; + /** + * Access the summary. + */ + summary(): CallSummaryListInstance; + /** + * Access the events. + */ + events(): EventListInstance; + /** + * Access the metrics. + */ + metrics(): MetricListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CallSolution { +} +export interface CallListInstance { + _version: V1; + _solution: CallSolution; + _uri: string; + (sid: string): CallContext; + get(sid: string): CallContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CallListInstance(version: V1): CallListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/call.js b/node_modules/twilio/lib/rest/insights/v1/call.js new file mode 100644 index 00000000..83aac83d --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call.js @@ -0,0 +1,159 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallListInstance = exports.CallInstance = exports.CallContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const annotation_1 = require("./call/annotation"); +const callSummary_1 = require("./call/callSummary"); +const event_1 = require("./call/event"); +const metric_1 = require("./call/metric"); +class CallContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Voice/${sid}`; + } + get annotation() { + this._annotation = + this._annotation || + (0, annotation_1.AnnotationListInstance)(this._version, this._solution.sid); + return this._annotation; + } + get summary() { + this._summary = + this._summary || + (0, callSummary_1.CallSummaryListInstance)(this._version, this._solution.sid); + return this._summary; + } + get events() { + this._events = + this._events || (0, event_1.EventListInstance)(this._version, this._solution.sid); + return this._events; + } + get metrics() { + this._metrics = + this._metrics || (0, metric_1.MetricListInstance)(this._version, this._solution.sid); + return this._metrics; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CallInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallContextImpl = CallContextImpl; +class CallInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new CallContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a CallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the annotation. + */ + annotation() { + return this._proxy.annotation; + } + /** + * Access the summary. + */ + summary() { + return this._proxy.summary; + } + /** + * Access the events. + */ + events() { + return this._proxy.events; + } + /** + * Access the metrics. + */ + metrics() { + return this._proxy.metrics; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallInstance = CallInstance; +function CallListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CallContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CallListInstance = CallListInstance; diff --git a/node_modules/twilio/lib/rest/insights/v1/call/annotation.d.ts b/node_modules/twilio/lib/rest/insights/v1/call/annotation.d.ts new file mode 100644 index 00000000..a455622c --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call/annotation.d.ts @@ -0,0 +1,184 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export type AnnotationAnsweredBy = "unknown_answered_by" | "human" | "machine"; +export type AnnotationConnectivityIssue = "unknown_connectivity_issue" | "no_connectivity_issue" | "invalid_number" | "caller_id" | "dropped_call" | "number_reachability"; +/** + * Options to pass to update a AnnotationInstance + */ +export interface AnnotationContextUpdateOptions { + /** */ + answeredBy?: AnnotationAnsweredBy; + /** */ + connectivityIssue?: AnnotationConnectivityIssue; + /** Specify if the call had any subjective quality issues. Possible values, one or more of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. Use comma separated values to indicate multiple quality issues for the same call. */ + qualityIssues?: string; + /** A boolean flag to indicate if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Use `true` if the call was a spam call. */ + spam?: boolean; + /** Specify the call score. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. */ + callScore?: number; + /** Specify any comments pertaining to the call. `comment` has a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in the `comment`. */ + comment?: string; + /** Associate this call with an incident or support ticket. The `incident` parameter is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`. */ + incident?: string; +} +export interface AnnotationContext { + /** + * Fetch a AnnotationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnnotationInstance + */ + fetch(callback?: (error: Error | null, item?: AnnotationInstance) => any): Promise; + /** + * Update a AnnotationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnnotationInstance + */ + update(callback?: (error: Error | null, item?: AnnotationInstance) => any): Promise; + /** + * Update a AnnotationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnnotationInstance + */ + update(params: AnnotationContextUpdateOptions, callback?: (error: Error | null, item?: AnnotationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AnnotationContextSolution { + callSid: string; +} +export declare class AnnotationContextImpl implements AnnotationContext { + protected _version: V1; + protected _solution: AnnotationContextSolution; + protected _uri: string; + constructor(_version: V1, callSid: string); + fetch(callback?: (error: Error | null, item?: AnnotationInstance) => any): Promise; + update(params?: AnnotationContextUpdateOptions | ((error: Error | null, item?: AnnotationInstance) => any), callback?: (error: Error | null, item?: AnnotationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AnnotationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AnnotationResource { + call_sid: string; + account_sid: string; + answered_by: AnnotationAnsweredBy; + connectivity_issue: AnnotationConnectivityIssue; + quality_issues: Array; + spam: boolean; + call_score: number; + comment: string; + incident: string; + url: string; +} +export declare class AnnotationInstance { + protected _version: V1; + protected _solution: AnnotationContextSolution; + protected _context?: AnnotationContext; + constructor(_version: V1, payload: AnnotationResource, callSid: string); + /** + * The unique SID identifier of the Call. + */ + callSid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + answeredBy: AnnotationAnsweredBy; + connectivityIssue: AnnotationConnectivityIssue; + /** + * Specifies if the call had any subjective quality issues. Possible values are one or more of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, or `static_noise`. + */ + qualityIssues: Array; + /** + * Specifies if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Is of type Boolean: true, false. Use true if the call was a spam call. + */ + spam: boolean; + /** + * Specifies the Call Score, if available. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + */ + callScore: number; + /** + * Specifies any comments pertaining to the call. Twilio does not treat this field as PII, so no PII should be included in comments. + */ + comment: string; + /** + * Incident or support ticket associated with this call. The `incident` property is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`. + */ + incident: string; + url: string; + private get _proxy(); + /** + * Fetch a AnnotationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnnotationInstance + */ + fetch(callback?: (error: Error | null, item?: AnnotationInstance) => any): Promise; + /** + * Update a AnnotationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnnotationInstance + */ + update(callback?: (error: Error | null, item?: AnnotationInstance) => any): Promise; + /** + * Update a AnnotationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnnotationInstance + */ + update(params: AnnotationContextUpdateOptions, callback?: (error: Error | null, item?: AnnotationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + callSid: string; + accountSid: string; + answeredBy: AnnotationAnsweredBy; + connectivityIssue: AnnotationConnectivityIssue; + qualityIssues: string[]; + spam: boolean; + callScore: number; + comment: string; + incident: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AnnotationSolution { + callSid: string; +} +export interface AnnotationListInstance { + _version: V1; + _solution: AnnotationSolution; + _uri: string; + (): AnnotationContext; + get(): AnnotationContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AnnotationListInstance(version: V1, callSid: string): AnnotationListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/call/annotation.js b/node_modules/twilio/lib/rest/insights/v1/call/annotation.js new file mode 100644 index 00000000..d9b6e377 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call/annotation.js @@ -0,0 +1,166 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnnotationListInstance = exports.AnnotationInstance = exports.AnnotationContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class AnnotationContextImpl { + constructor(_version, callSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + this._solution = { callSid }; + this._uri = `/Voice/${callSid}/Annotation`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AnnotationInstance(operationVersion, payload, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["answeredBy"] !== undefined) + data["AnsweredBy"] = params["answeredBy"]; + if (params["connectivityIssue"] !== undefined) + data["ConnectivityIssue"] = params["connectivityIssue"]; + if (params["qualityIssues"] !== undefined) + data["QualityIssues"] = params["qualityIssues"]; + if (params["spam"] !== undefined) + data["Spam"] = serialize.bool(params["spam"]); + if (params["callScore"] !== undefined) + data["CallScore"] = params["callScore"]; + if (params["comment"] !== undefined) + data["Comment"] = params["comment"]; + if (params["incident"] !== undefined) + data["Incident"] = params["incident"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AnnotationInstance(operationVersion, payload, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AnnotationContextImpl = AnnotationContextImpl; +class AnnotationInstance { + constructor(_version, payload, callSid) { + this._version = _version; + this.callSid = payload.call_sid; + this.accountSid = payload.account_sid; + this.answeredBy = payload.answered_by; + this.connectivityIssue = payload.connectivity_issue; + this.qualityIssues = payload.quality_issues; + this.spam = payload.spam; + this.callScore = deserialize.integer(payload.call_score); + this.comment = payload.comment; + this.incident = payload.incident; + this.url = payload.url; + this._solution = { callSid }; + } + get _proxy() { + this._context = + this._context || + new AnnotationContextImpl(this._version, this._solution.callSid); + return this._context; + } + /** + * Fetch a AnnotationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnnotationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + callSid: this.callSid, + accountSid: this.accountSid, + answeredBy: this.answeredBy, + connectivityIssue: this.connectivityIssue, + qualityIssues: this.qualityIssues, + spam: this.spam, + callScore: this.callScore, + comment: this.comment, + incident: this.incident, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AnnotationInstance = AnnotationInstance; +function AnnotationListInstance(version, callSid) { + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new AnnotationContextImpl(version, callSid); + }; + instance._version = version; + instance._solution = { callSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AnnotationListInstance = AnnotationListInstance; diff --git a/node_modules/twilio/lib/rest/insights/v1/call/callSummary.d.ts b/node_modules/twilio/lib/rest/insights/v1/call/callSummary.d.ts new file mode 100644 index 00000000..aaad95ec --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call/callSummary.d.ts @@ -0,0 +1,232 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export type CallSummaryAnsweredBy = "unknown" | "machine_start" | "machine_end_beep" | "machine_end_silence" | "machine_end_other" | "human" | "fax"; +export type CallSummaryCallState = "ringing" | "completed" | "busy" | "fail" | "noanswer" | "canceled" | "answered" | "undialed"; +export type CallSummaryCallType = "carrier" | "sip" | "trunking" | "client"; +export type CallSummaryProcessingState = "complete" | "partial"; +/** + * Options to pass to fetch a CallSummaryInstance + */ +export interface CallSummaryContextFetchOptions { + /** The Processing State of this Call Summary. One of `complete`, `partial` or `all`. */ + processingState?: CallSummaryProcessingState; +} +export interface CallSummaryContext { + /** + * Fetch a CallSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallSummaryInstance + */ + fetch(callback?: (error: Error | null, item?: CallSummaryInstance) => any): Promise; + /** + * Fetch a CallSummaryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallSummaryInstance + */ + fetch(params: CallSummaryContextFetchOptions, callback?: (error: Error | null, item?: CallSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CallSummaryContextSolution { + callSid: string; +} +export declare class CallSummaryContextImpl implements CallSummaryContext { + protected _version: V1; + protected _solution: CallSummaryContextSolution; + protected _uri: string; + constructor(_version: V1, callSid: string); + fetch(params?: CallSummaryContextFetchOptions | ((error: Error | null, item?: CallSummaryInstance) => any), callback?: (error: Error | null, item?: CallSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CallSummaryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CallSummaryResource { + account_sid: string; + call_sid: string; + call_type: CallSummaryCallType; + call_state: CallSummaryCallState; + answered_by: CallSummaryAnsweredBy; + processing_state: CallSummaryProcessingState; + created_time: Date; + start_time: Date; + end_time: Date; + duration: number; + connect_duration: number; + from: any; + to: any; + carrier_edge: any; + client_edge: any; + sdk_edge: any; + sip_edge: any; + tags: Array; + url: string; + attributes: any; + properties: any; + trust: any; + annotation: any; +} +export declare class CallSummaryInstance { + protected _version: V1; + protected _solution: CallSummaryContextSolution; + protected _context?: CallSummaryContext; + constructor(_version: V1, payload: CallSummaryResource, callSid: string); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Call. + */ + callSid: string; + callType: CallSummaryCallType; + callState: CallSummaryCallState; + answeredBy: CallSummaryAnsweredBy; + processingState: CallSummaryProcessingState; + /** + * The time at which the Call was created, given in ISO 8601 format. Can be different from `start_time` in the event of queueing due to CPS + */ + createdTime: Date; + /** + * The time at which the Call was started, given in ISO 8601 format. + */ + startTime: Date; + /** + * The time at which the Call was ended, given in ISO 8601 format. + */ + endTime: Date; + /** + * Duration between when the call was initiated and the call was ended + */ + duration: number; + /** + * Duration between when the call was answered and when it ended + */ + connectDuration: number; + /** + * The calling party. + */ + from: any; + /** + * The called party. + */ + to: any; + /** + * Contains metrics and properties for the Twilio media gateway of a PSTN call. + */ + carrierEdge: any; + /** + * Contains metrics and properties for the Twilio media gateway of a Client call. + */ + clientEdge: any; + /** + * Contains metrics and properties for the SDK sensor library for Client calls. + */ + sdkEdge: any; + /** + * Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. + */ + sipEdge: any; + /** + * Tags applied to calls by Voice Insights analysis indicating a condition that could result in subjective degradation of the call quality. + */ + tags: Array; + /** + * The URL of this resource. + */ + url: string; + /** + * Attributes capturing call-flow-specific details. + */ + attributes: any; + /** + * Contains edge-agnostic call-level details. + */ + properties: any; + /** + * Contains trusted communications details including Branded Call and verified caller ID. + */ + trust: any; + /** + * Programmatically labeled annotations for the Call. Developers can update the Call Summary records with Annotation during or after a Call. Annotations can be updated as long as the Call Summary record is addressable via the API. + */ + annotation: any; + private get _proxy(); + /** + * Fetch a CallSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallSummaryInstance + */ + fetch(callback?: (error: Error | null, item?: CallSummaryInstance) => any): Promise; + /** + * Fetch a CallSummaryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CallSummaryInstance + */ + fetch(params: CallSummaryContextFetchOptions, callback?: (error: Error | null, item?: CallSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + callSid: string; + callType: CallSummaryCallType; + callState: CallSummaryCallState; + answeredBy: CallSummaryAnsweredBy; + processingState: CallSummaryProcessingState; + createdTime: Date; + startTime: Date; + endTime: Date; + duration: number; + connectDuration: number; + from: any; + to: any; + carrierEdge: any; + clientEdge: any; + sdkEdge: any; + sipEdge: any; + tags: string[]; + url: string; + attributes: any; + properties: any; + trust: any; + annotation: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CallSummarySolution { + callSid: string; +} +export interface CallSummaryListInstance { + _version: V1; + _solution: CallSummarySolution; + _uri: string; + (): CallSummaryContext; + get(): CallSummaryContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CallSummaryListInstance(version: V1, callSid: string): CallSummaryListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/call/callSummary.js b/node_modules/twilio/lib/rest/insights/v1/call/callSummary.js new file mode 100644 index 00000000..cda082f1 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call/callSummary.js @@ -0,0 +1,159 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallSummaryListInstance = exports.CallSummaryInstance = exports.CallSummaryContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class CallSummaryContextImpl { + constructor(_version, callSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + this._solution = { callSid }; + this._uri = `/Voice/${callSid}/Summary`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["processingState"] !== undefined) + data["ProcessingState"] = params["processingState"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CallSummaryInstance(operationVersion, payload, instance._solution.callSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallSummaryContextImpl = CallSummaryContextImpl; +class CallSummaryInstance { + constructor(_version, payload, callSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.callType = payload.call_type; + this.callState = payload.call_state; + this.answeredBy = payload.answered_by; + this.processingState = payload.processing_state; + this.createdTime = deserialize.iso8601DateTime(payload.created_time); + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.duration = deserialize.integer(payload.duration); + this.connectDuration = deserialize.integer(payload.connect_duration); + this.from = payload.from; + this.to = payload.to; + this.carrierEdge = payload.carrier_edge; + this.clientEdge = payload.client_edge; + this.sdkEdge = payload.sdk_edge; + this.sipEdge = payload.sip_edge; + this.tags = payload.tags; + this.url = payload.url; + this.attributes = payload.attributes; + this.properties = payload.properties; + this.trust = payload.trust; + this.annotation = payload.annotation; + this._solution = { callSid }; + } + get _proxy() { + this._context = + this._context || + new CallSummaryContextImpl(this._version, this._solution.callSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + callSid: this.callSid, + callType: this.callType, + callState: this.callState, + answeredBy: this.answeredBy, + processingState: this.processingState, + createdTime: this.createdTime, + startTime: this.startTime, + endTime: this.endTime, + duration: this.duration, + connectDuration: this.connectDuration, + from: this.from, + to: this.to, + carrierEdge: this.carrierEdge, + clientEdge: this.clientEdge, + sdkEdge: this.sdkEdge, + sipEdge: this.sipEdge, + tags: this.tags, + url: this.url, + attributes: this.attributes, + properties: this.properties, + trust: this.trust, + annotation: this.annotation, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallSummaryInstance = CallSummaryInstance; +function CallSummaryListInstance(version, callSid) { + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new CallSummaryContextImpl(version, callSid); + }; + instance._version = version; + instance._solution = { callSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CallSummaryListInstance = CallSummaryListInstance; diff --git a/node_modules/twilio/lib/rest/insights/v1/call/event.d.ts b/node_modules/twilio/lib/rest/insights/v1/call/event.d.ts new file mode 100644 index 00000000..34b316fc --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call/event.d.ts @@ -0,0 +1,205 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type EventLevel = "UNKNOWN" | "DEBUG" | "INFO" | "WARNING" | "ERROR"; +export type EventTwilioEdge = "unknown_edge" | "carrier_edge" | "sip_edge" | "sdk_edge" | "client_edge"; +/** + * Options to pass to each + */ +export interface EventListInstanceEachOptions { + /** The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. */ + edge?: EventTwilioEdge; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EventInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EventListInstanceOptions { + /** The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. */ + edge?: EventTwilioEdge; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EventListInstancePageOptions { + /** The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. */ + edge?: EventTwilioEdge; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EventSolution { + callSid: string; +} +export interface EventListInstance { + _version: V1; + _solution: EventSolution; + _uri: string; + /** + * Streams EventInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EventInstance, done: (err?: Error) => void) => void): void; + each(params: EventListInstanceEachOptions, callback?: (item: EventInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EventInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EventPage) => any): Promise; + /** + * Lists EventInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EventInstance[]) => any): Promise; + list(params: EventListInstanceOptions, callback?: (error: Error | null, items: EventInstance[]) => any): Promise; + /** + * Retrieve a single page of EventInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EventPage) => any): Promise; + page(params: EventListInstancePageOptions, callback?: (error: Error | null, items: EventPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EventListInstance(version: V1, callSid: string): EventListInstance; +interface EventPayload extends TwilioResponsePayload { + events: EventResource[]; +} +interface EventResource { + timestamp: string; + call_sid: string; + account_sid: string; + edge: EventTwilioEdge; + group: string; + level: EventLevel; + name: string; + carrier_edge: any; + sip_edge: any; + sdk_edge: any; + client_edge: any; +} +export declare class EventInstance { + protected _version: V1; + constructor(_version: V1, payload: EventResource, callSid: string); + /** + * Event time. + */ + timestamp: string; + /** + * The unique SID identifier of the Call. + */ + callSid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + edge: EventTwilioEdge; + /** + * Event group. + */ + group: string; + level: EventLevel; + /** + * Event name. + */ + name: string; + /** + * Represents the connection between Twilio and our immediate carrier partners. The events here describe the call lifecycle as reported by Twilio\'s carrier media gateways. + */ + carrierEdge: any; + /** + * Represents the Twilio media gateway for SIP interface and SIP trunking calls. The events here describe the call lifecycle as reported by Twilio\'s public media gateways. + */ + sipEdge: any; + /** + * Represents the Voice SDK running locally in the browser or in the Android/iOS application. The events here are emitted by the Voice SDK in response to certain call progress events, network changes, or call quality conditions. + */ + sdkEdge: any; + /** + * Represents the Twilio media gateway for Client calls. The events here describe the call lifecycle as reported by Twilio\'s Voice SDK media gateways. + */ + clientEdge: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + timestamp: string; + callSid: string; + accountSid: string; + edge: EventTwilioEdge; + group: string; + level: EventLevel; + name: string; + carrierEdge: any; + sipEdge: any; + sdkEdge: any; + clientEdge: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class EventPage extends Page { + /** + * Initialize the EventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EventSolution); + /** + * Build an instance of EventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EventResource): EventInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/call/event.js b/node_modules/twilio/lib/rest/insights/v1/call/event.js new file mode 100644 index 00000000..99dca007 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call/event.js @@ -0,0 +1,144 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EventPage = exports.EventInstance = exports.EventListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function EventListInstance(version, callSid) { + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { callSid }; + instance._uri = `/Voice/${callSid}/Events`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["edge"] !== undefined) + data["Edge"] = params["edge"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EventPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EventPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EventListInstance = EventListInstance; +class EventInstance { + constructor(_version, payload, callSid) { + this._version = _version; + this.timestamp = payload.timestamp; + this.callSid = payload.call_sid; + this.accountSid = payload.account_sid; + this.edge = payload.edge; + this.group = payload.group; + this.level = payload.level; + this.name = payload.name; + this.carrierEdge = payload.carrier_edge; + this.sipEdge = payload.sip_edge; + this.sdkEdge = payload.sdk_edge; + this.clientEdge = payload.client_edge; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + timestamp: this.timestamp, + callSid: this.callSid, + accountSid: this.accountSid, + edge: this.edge, + group: this.group, + level: this.level, + name: this.name, + carrierEdge: this.carrierEdge, + sipEdge: this.sipEdge, + sdkEdge: this.sdkEdge, + clientEdge: this.clientEdge, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventInstance = EventInstance; +class EventPage extends Page_1.default { + /** + * Initialize the EventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EventInstance(this._version, payload, this._solution.callSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventPage = EventPage; diff --git a/node_modules/twilio/lib/rest/insights/v1/call/metric.d.ts b/node_modules/twilio/lib/rest/insights/v1/call/metric.d.ts new file mode 100644 index 00000000..7cb239ef --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call/metric.d.ts @@ -0,0 +1,199 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type MetricStreamDirection = "unknown" | "inbound" | "outbound" | "both"; +export type MetricTwilioEdge = "unknown_edge" | "carrier_edge" | "sip_edge" | "sdk_edge" | "client_edge"; +/** + * Options to pass to each + */ +export interface MetricListInstanceEachOptions { + /** The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. */ + edge?: MetricTwilioEdge; + /** The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`. */ + direction?: MetricStreamDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MetricInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MetricListInstanceOptions { + /** The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. */ + edge?: MetricTwilioEdge; + /** The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`. */ + direction?: MetricStreamDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MetricListInstancePageOptions { + /** The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. */ + edge?: MetricTwilioEdge; + /** The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`. */ + direction?: MetricStreamDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MetricSolution { + callSid: string; +} +export interface MetricListInstance { + _version: V1; + _solution: MetricSolution; + _uri: string; + /** + * Streams MetricInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MetricListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MetricInstance, done: (err?: Error) => void) => void): void; + each(params: MetricListInstanceEachOptions, callback?: (item: MetricInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MetricInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MetricPage) => any): Promise; + /** + * Lists MetricInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MetricListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MetricInstance[]) => any): Promise; + list(params: MetricListInstanceOptions, callback?: (error: Error | null, items: MetricInstance[]) => any): Promise; + /** + * Retrieve a single page of MetricInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MetricListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MetricPage) => any): Promise; + page(params: MetricListInstancePageOptions, callback?: (error: Error | null, items: MetricPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MetricListInstance(version: V1, callSid: string): MetricListInstance; +interface MetricPayload extends TwilioResponsePayload { + metrics: MetricResource[]; +} +interface MetricResource { + timestamp: string; + call_sid: string; + account_sid: string; + edge: MetricTwilioEdge; + direction: MetricStreamDirection; + carrier_edge: any; + sip_edge: any; + sdk_edge: any; + client_edge: any; +} +export declare class MetricInstance { + protected _version: V1; + constructor(_version: V1, payload: MetricResource, callSid: string); + /** + * Timestamp of metric sample. Samples are taken every 10 seconds and contain the metrics for the previous 10 seconds. + */ + timestamp: string; + /** + * The unique SID identifier of the Call. + */ + callSid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + edge: MetricTwilioEdge; + direction: MetricStreamDirection; + /** + * Contains metrics and properties for the Twilio media gateway of a PSTN call. + */ + carrierEdge: any; + /** + * Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. + */ + sipEdge: any; + /** + * Contains metrics and properties for the SDK sensor library for Client calls. + */ + sdkEdge: any; + /** + * Contains metrics and properties for the Twilio media gateway of a Client call. + */ + clientEdge: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + timestamp: string; + callSid: string; + accountSid: string; + edge: MetricTwilioEdge; + direction: MetricStreamDirection; + carrierEdge: any; + sipEdge: any; + sdkEdge: any; + clientEdge: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class MetricPage extends Page { + /** + * Initialize the MetricPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MetricSolution); + /** + * Build an instance of MetricInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MetricResource): MetricInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/call/metric.js b/node_modules/twilio/lib/rest/insights/v1/call/metric.js new file mode 100644 index 00000000..a093c313 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/call/metric.js @@ -0,0 +1,142 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MetricPage = exports.MetricInstance = exports.MetricListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function MetricListInstance(version, callSid) { + if (!(0, utility_1.isValidPathParam)(callSid)) { + throw new Error("Parameter 'callSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { callSid }; + instance._uri = `/Voice/${callSid}/Metrics`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["edge"] !== undefined) + data["Edge"] = params["edge"]; + if (params["direction"] !== undefined) + data["Direction"] = params["direction"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MetricPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MetricPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MetricListInstance = MetricListInstance; +class MetricInstance { + constructor(_version, payload, callSid) { + this._version = _version; + this.timestamp = payload.timestamp; + this.callSid = payload.call_sid; + this.accountSid = payload.account_sid; + this.edge = payload.edge; + this.direction = payload.direction; + this.carrierEdge = payload.carrier_edge; + this.sipEdge = payload.sip_edge; + this.sdkEdge = payload.sdk_edge; + this.clientEdge = payload.client_edge; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + timestamp: this.timestamp, + callSid: this.callSid, + accountSid: this.accountSid, + edge: this.edge, + direction: this.direction, + carrierEdge: this.carrierEdge, + sipEdge: this.sipEdge, + sdkEdge: this.sdkEdge, + clientEdge: this.clientEdge, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MetricInstance = MetricInstance; +class MetricPage extends Page_1.default { + /** + * Initialize the MetricPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MetricInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MetricInstance(this._version, payload, this._solution.callSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MetricPage = MetricPage; diff --git a/node_modules/twilio/lib/rest/insights/v1/callSummaries.d.ts b/node_modules/twilio/lib/rest/insights/v1/callSummaries.d.ts new file mode 100644 index 00000000..c83525de --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/callSummaries.d.ts @@ -0,0 +1,409 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type CallSummariesAnsweredBy = "unknown" | "machine_start" | "machine_end_beep" | "machine_end_silence" | "machine_end_other" | "human" | "fax"; +export type CallSummariesCallState = "ringing" | "completed" | "busy" | "fail" | "noanswer" | "canceled" | "answered" | "undialed"; +export type CallSummariesCallType = "carrier" | "sip" | "trunking" | "client"; +export type CallSummariesProcessingState = "complete" | "partial"; +export type CallSummariesProcessingStateRequest = "completed" | "started" | "partial" | "all"; +export type CallSummariesSortBy = "start_time" | "end_time"; +/** + * Options to pass to each + */ +export interface CallSummariesListInstanceEachOptions { + /** A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. */ + from?: string; + /** A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. */ + to?: string; + /** An origination carrier. */ + fromCarrier?: string; + /** A destination carrier. */ + toCarrier?: string; + /** A source country code based on phone number in From. */ + fromCountryCode?: string; + /** A destination country code. Based on phone number in To. */ + toCountryCode?: string; + /** A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. */ + branded?: boolean; + /** A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. */ + verifiedCaller?: boolean; + /** A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). */ + hasTag?: boolean; + /** A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. */ + startTime?: string; + /** An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. */ + endTime?: string; + /** A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`. */ + callType?: string; + /** A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`. */ + callState?: string; + /** A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`. */ + direction?: string; + /** A Processing State of the Call Summaries. One of `completed`, `partial` or `all`. */ + processingState?: CallSummariesProcessingStateRequest; + /** A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`. */ + sortBy?: CallSummariesSortBy; + /** A unique SID identifier of a Subaccount. */ + subaccount?: string; + /** A boolean flag indicating an abnormal session where the last SIP response was not 200 OK. */ + abnormalSession?: boolean; + /** An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`. */ + answeredBy?: CallSummariesAnsweredBy; + /** Either machine or human. */ + answeredByAnnotation?: string; + /** A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`. */ + connectivityIssueAnnotation?: string; + /** A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. */ + qualityIssueAnnotation?: string; + /** A boolean flag indicating spam calls. */ + spamAnnotation?: boolean; + /** A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. */ + callScoreAnnotation?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CallSummariesInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CallSummariesListInstanceOptions { + /** A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. */ + from?: string; + /** A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. */ + to?: string; + /** An origination carrier. */ + fromCarrier?: string; + /** A destination carrier. */ + toCarrier?: string; + /** A source country code based on phone number in From. */ + fromCountryCode?: string; + /** A destination country code. Based on phone number in To. */ + toCountryCode?: string; + /** A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. */ + branded?: boolean; + /** A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. */ + verifiedCaller?: boolean; + /** A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). */ + hasTag?: boolean; + /** A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. */ + startTime?: string; + /** An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. */ + endTime?: string; + /** A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`. */ + callType?: string; + /** A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`. */ + callState?: string; + /** A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`. */ + direction?: string; + /** A Processing State of the Call Summaries. One of `completed`, `partial` or `all`. */ + processingState?: CallSummariesProcessingStateRequest; + /** A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`. */ + sortBy?: CallSummariesSortBy; + /** A unique SID identifier of a Subaccount. */ + subaccount?: string; + /** A boolean flag indicating an abnormal session where the last SIP response was not 200 OK. */ + abnormalSession?: boolean; + /** An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`. */ + answeredBy?: CallSummariesAnsweredBy; + /** Either machine or human. */ + answeredByAnnotation?: string; + /** A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`. */ + connectivityIssueAnnotation?: string; + /** A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. */ + qualityIssueAnnotation?: string; + /** A boolean flag indicating spam calls. */ + spamAnnotation?: boolean; + /** A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. */ + callScoreAnnotation?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CallSummariesListInstancePageOptions { + /** A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. */ + from?: string; + /** A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. */ + to?: string; + /** An origination carrier. */ + fromCarrier?: string; + /** A destination carrier. */ + toCarrier?: string; + /** A source country code based on phone number in From. */ + fromCountryCode?: string; + /** A destination country code. Based on phone number in To. */ + toCountryCode?: string; + /** A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. */ + branded?: boolean; + /** A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. */ + verifiedCaller?: boolean; + /** A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). */ + hasTag?: boolean; + /** A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. */ + startTime?: string; + /** An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. */ + endTime?: string; + /** A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`. */ + callType?: string; + /** A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`. */ + callState?: string; + /** A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`. */ + direction?: string; + /** A Processing State of the Call Summaries. One of `completed`, `partial` or `all`. */ + processingState?: CallSummariesProcessingStateRequest; + /** A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`. */ + sortBy?: CallSummariesSortBy; + /** A unique SID identifier of a Subaccount. */ + subaccount?: string; + /** A boolean flag indicating an abnormal session where the last SIP response was not 200 OK. */ + abnormalSession?: boolean; + /** An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`. */ + answeredBy?: CallSummariesAnsweredBy; + /** Either machine or human. */ + answeredByAnnotation?: string; + /** A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`. */ + connectivityIssueAnnotation?: string; + /** A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. */ + qualityIssueAnnotation?: string; + /** A boolean flag indicating spam calls. */ + spamAnnotation?: boolean; + /** A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. */ + callScoreAnnotation?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CallSummariesSolution { +} +export interface CallSummariesListInstance { + _version: V1; + _solution: CallSummariesSolution; + _uri: string; + /** + * Streams CallSummariesInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CallSummariesListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CallSummariesInstance, done: (err?: Error) => void) => void): void; + each(params: CallSummariesListInstanceEachOptions, callback?: (item: CallSummariesInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CallSummariesInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CallSummariesPage) => any): Promise; + /** + * Lists CallSummariesInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CallSummariesListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CallSummariesInstance[]) => any): Promise; + list(params: CallSummariesListInstanceOptions, callback?: (error: Error | null, items: CallSummariesInstance[]) => any): Promise; + /** + * Retrieve a single page of CallSummariesInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CallSummariesListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CallSummariesPage) => any): Promise; + page(params: CallSummariesListInstancePageOptions, callback?: (error: Error | null, items: CallSummariesPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CallSummariesListInstance(version: V1): CallSummariesListInstance; +interface CallSummariesPayload extends TwilioResponsePayload { + call_summaries: CallSummariesResource[]; +} +interface CallSummariesResource { + account_sid: string; + call_sid: string; + answered_by: CallSummariesAnsweredBy; + call_type: CallSummariesCallType; + call_state: CallSummariesCallState; + processing_state: CallSummariesProcessingState; + created_time: Date; + start_time: Date; + end_time: Date; + duration: number; + connect_duration: number; + from: any; + to: any; + carrier_edge: any; + client_edge: any; + sdk_edge: any; + sip_edge: any; + tags: Array; + url: string; + attributes: any; + properties: any; + trust: any; + annotation: any; +} +export declare class CallSummariesInstance { + protected _version: V1; + constructor(_version: V1, payload: CallSummariesResource); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Call. + */ + callSid: string; + answeredBy: CallSummariesAnsweredBy; + callType: CallSummariesCallType; + callState: CallSummariesCallState; + processingState: CallSummariesProcessingState; + /** + * The time at which the Call was created, given in ISO 8601 format. Can be different from `start_time` in the event of queueing due to CPS + */ + createdTime: Date; + /** + * The time at which the Call was started, given in ISO 8601 format. + */ + startTime: Date; + /** + * The time at which the Call was ended, given in ISO 8601 format. + */ + endTime: Date; + /** + * Duration between when the call was initiated and the call was ended + */ + duration: number; + /** + * Duration between when the call was answered and when it ended + */ + connectDuration: number; + /** + * The calling party. + */ + from: any; + /** + * The called party. + */ + to: any; + /** + * Contains metrics and properties for the Twilio media gateway of a PSTN call. + */ + carrierEdge: any; + /** + * Contains metrics and properties for the Twilio media gateway of a Client call. + */ + clientEdge: any; + /** + * Contains metrics and properties for the SDK sensor library for Client calls. + */ + sdkEdge: any; + /** + * Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. + */ + sipEdge: any; + /** + * Tags applied to calls by Voice Insights analysis indicating a condition that could result in subjective degradation of the call quality. + */ + tags: Array; + /** + * The URL of this resource. + */ + url: string; + /** + * Attributes capturing call-flow-specific details. + */ + attributes: any; + /** + * Contains edge-agnostic call-level details. + */ + properties: any; + /** + * Contains trusted communications details including Branded Call and verified caller ID. + */ + trust: any; + annotation: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + callSid: string; + answeredBy: CallSummariesAnsweredBy; + callType: CallSummariesCallType; + callState: CallSummariesCallState; + processingState: CallSummariesProcessingState; + createdTime: Date; + startTime: Date; + endTime: Date; + duration: number; + connectDuration: number; + from: any; + to: any; + carrierEdge: any; + clientEdge: any; + sdkEdge: any; + sipEdge: any; + tags: string[]; + url: string; + attributes: any; + properties: any; + trust: any; + annotation: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class CallSummariesPage extends Page { + /** + * Initialize the CallSummariesPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CallSummariesSolution); + /** + * Build an instance of CallSummariesInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CallSummariesResource): CallSummariesInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/callSummaries.js b/node_modules/twilio/lib/rest/insights/v1/callSummaries.js new file mode 100644 index 00000000..e42afe51 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/callSummaries.js @@ -0,0 +1,211 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallSummariesPage = exports.CallSummariesInstance = exports.CallSummariesListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function CallSummariesListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Voice/Summaries`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["to"] !== undefined) + data["To"] = params["to"]; + if (params["fromCarrier"] !== undefined) + data["FromCarrier"] = params["fromCarrier"]; + if (params["toCarrier"] !== undefined) + data["ToCarrier"] = params["toCarrier"]; + if (params["fromCountryCode"] !== undefined) + data["FromCountryCode"] = params["fromCountryCode"]; + if (params["toCountryCode"] !== undefined) + data["ToCountryCode"] = params["toCountryCode"]; + if (params["branded"] !== undefined) + data["Branded"] = serialize.bool(params["branded"]); + if (params["verifiedCaller"] !== undefined) + data["VerifiedCaller"] = serialize.bool(params["verifiedCaller"]); + if (params["hasTag"] !== undefined) + data["HasTag"] = serialize.bool(params["hasTag"]); + if (params["startTime"] !== undefined) + data["StartTime"] = params["startTime"]; + if (params["endTime"] !== undefined) + data["EndTime"] = params["endTime"]; + if (params["callType"] !== undefined) + data["CallType"] = params["callType"]; + if (params["callState"] !== undefined) + data["CallState"] = params["callState"]; + if (params["direction"] !== undefined) + data["Direction"] = params["direction"]; + if (params["processingState"] !== undefined) + data["ProcessingState"] = params["processingState"]; + if (params["sortBy"] !== undefined) + data["SortBy"] = params["sortBy"]; + if (params["subaccount"] !== undefined) + data["Subaccount"] = params["subaccount"]; + if (params["abnormalSession"] !== undefined) + data["AbnormalSession"] = serialize.bool(params["abnormalSession"]); + if (params["answeredBy"] !== undefined) + data["AnsweredBy"] = params["answeredBy"]; + if (params["answeredByAnnotation"] !== undefined) + data["AnsweredByAnnotation"] = params["answeredByAnnotation"]; + if (params["connectivityIssueAnnotation"] !== undefined) + data["ConnectivityIssueAnnotation"] = + params["connectivityIssueAnnotation"]; + if (params["qualityIssueAnnotation"] !== undefined) + data["QualityIssueAnnotation"] = params["qualityIssueAnnotation"]; + if (params["spamAnnotation"] !== undefined) + data["SpamAnnotation"] = serialize.bool(params["spamAnnotation"]); + if (params["callScoreAnnotation"] !== undefined) + data["CallScoreAnnotation"] = params["callScoreAnnotation"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CallSummariesPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CallSummariesPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CallSummariesListInstance = CallSummariesListInstance; +class CallSummariesInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.callSid = payload.call_sid; + this.answeredBy = payload.answered_by; + this.callType = payload.call_type; + this.callState = payload.call_state; + this.processingState = payload.processing_state; + this.createdTime = deserialize.iso8601DateTime(payload.created_time); + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.duration = deserialize.integer(payload.duration); + this.connectDuration = deserialize.integer(payload.connect_duration); + this.from = payload.from; + this.to = payload.to; + this.carrierEdge = payload.carrier_edge; + this.clientEdge = payload.client_edge; + this.sdkEdge = payload.sdk_edge; + this.sipEdge = payload.sip_edge; + this.tags = payload.tags; + this.url = payload.url; + this.attributes = payload.attributes; + this.properties = payload.properties; + this.trust = payload.trust; + this.annotation = payload.annotation; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + callSid: this.callSid, + answeredBy: this.answeredBy, + callType: this.callType, + callState: this.callState, + processingState: this.processingState, + createdTime: this.createdTime, + startTime: this.startTime, + endTime: this.endTime, + duration: this.duration, + connectDuration: this.connectDuration, + from: this.from, + to: this.to, + carrierEdge: this.carrierEdge, + clientEdge: this.clientEdge, + sdkEdge: this.sdkEdge, + sipEdge: this.sipEdge, + tags: this.tags, + url: this.url, + attributes: this.attributes, + properties: this.properties, + trust: this.trust, + annotation: this.annotation, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallSummariesInstance = CallSummariesInstance; +class CallSummariesPage extends Page_1.default { + /** + * Initialize the CallSummariesPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CallSummariesInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CallSummariesInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CallSummariesPage = CallSummariesPage; diff --git a/node_modules/twilio/lib/rest/insights/v1/conference.d.ts b/node_modules/twilio/lib/rest/insights/v1/conference.d.ts new file mode 100644 index 00000000..29d05cd1 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/conference.d.ts @@ -0,0 +1,377 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { ConferenceParticipantListInstance } from "./conference/conferenceParticipant"; +export type ConferenceConferenceEndReason = "last_participant_left" | "conference_ended_via_api" | "participant_with_end_conference_on_exit_left" | "last_participant_kicked" | "participant_with_end_conference_on_exit_kicked"; +export type ConferenceConferenceStatus = "in_progress" | "not_started" | "completed" | "summary_timeout"; +export type ConferenceProcessingState = "complete" | "in_progress" | "timeout"; +export type ConferenceRegion = "us1" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "de1"; +export type ConferenceTag = "invalid_requested_region" | "duplicate_identity" | "start_failure" | "region_configuration_issues" | "quality_warnings" | "participant_behavior_issues" | "high_packet_loss" | "high_jitter" | "high_latency" | "low_mos" | "detected_silence"; +/** + * Options to pass to each + */ +export interface ConferenceListInstanceEachOptions { + /** The SID of the conference. */ + conferenceSid?: string; + /** Custom label for the conference resource, up to 64 characters. */ + friendlyName?: string; + /** Conference status. */ + status?: string; + /** Conferences created after the provided timestamp specified in ISO 8601 format */ + createdAfter?: string; + /** Conferences created before the provided timestamp specified in ISO 8601 format. */ + createdBefore?: string; + /** Twilio region where the conference media was mixed. */ + mixerRegion?: string; + /** Tags applied by Twilio for common potential configuration, quality, or performance issues. */ + tags?: string; + /** Account SID for the subaccount whose resources you wish to retrieve. */ + subaccount?: string; + /** Potential configuration, behavior, or performance issues detected during the conference. */ + detectedIssues?: string; + /** Conference end reason; e.g. last participant left, modified by API, etc. */ + endReason?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ConferenceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ConferenceListInstanceOptions { + /** The SID of the conference. */ + conferenceSid?: string; + /** Custom label for the conference resource, up to 64 characters. */ + friendlyName?: string; + /** Conference status. */ + status?: string; + /** Conferences created after the provided timestamp specified in ISO 8601 format */ + createdAfter?: string; + /** Conferences created before the provided timestamp specified in ISO 8601 format. */ + createdBefore?: string; + /** Twilio region where the conference media was mixed. */ + mixerRegion?: string; + /** Tags applied by Twilio for common potential configuration, quality, or performance issues. */ + tags?: string; + /** Account SID for the subaccount whose resources you wish to retrieve. */ + subaccount?: string; + /** Potential configuration, behavior, or performance issues detected during the conference. */ + detectedIssues?: string; + /** Conference end reason; e.g. last participant left, modified by API, etc. */ + endReason?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ConferenceListInstancePageOptions { + /** The SID of the conference. */ + conferenceSid?: string; + /** Custom label for the conference resource, up to 64 characters. */ + friendlyName?: string; + /** Conference status. */ + status?: string; + /** Conferences created after the provided timestamp specified in ISO 8601 format */ + createdAfter?: string; + /** Conferences created before the provided timestamp specified in ISO 8601 format. */ + createdBefore?: string; + /** Twilio region where the conference media was mixed. */ + mixerRegion?: string; + /** Tags applied by Twilio for common potential configuration, quality, or performance issues. */ + tags?: string; + /** Account SID for the subaccount whose resources you wish to retrieve. */ + subaccount?: string; + /** Potential configuration, behavior, or performance issues detected during the conference. */ + detectedIssues?: string; + /** Conference end reason; e.g. last participant left, modified by API, etc. */ + endReason?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ConferenceContext { + conferenceParticipants: ConferenceParticipantListInstance; + /** + * Fetch a ConferenceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + fetch(callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConferenceContextSolution { + conferenceSid: string; +} +export declare class ConferenceContextImpl implements ConferenceContext { + protected _version: V1; + protected _solution: ConferenceContextSolution; + protected _uri: string; + protected _conferenceParticipants?: ConferenceParticipantListInstance; + constructor(_version: V1, conferenceSid: string); + get conferenceParticipants(): ConferenceParticipantListInstance; + fetch(callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConferenceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConferencePayload extends TwilioResponsePayload { + conferences: ConferenceResource[]; +} +interface ConferenceResource { + conference_sid: string; + account_sid: string; + friendly_name: string; + create_time: Date; + start_time: Date; + end_time: Date; + duration_seconds: number; + connect_duration_seconds: number; + status: ConferenceConferenceStatus; + max_participants: number; + max_concurrent_participants: number; + unique_participants: number; + end_reason: ConferenceConferenceEndReason; + ended_by: string; + mixer_region: ConferenceRegion; + mixer_region_requested: ConferenceRegion; + recording_enabled: boolean; + detected_issues: any; + tags: Array; + tag_info: any; + processing_state: ConferenceProcessingState; + url: string; + links: Record; +} +export declare class ConferenceInstance { + protected _version: V1; + protected _solution: ConferenceContextSolution; + protected _context?: ConferenceContext; + constructor(_version: V1, payload: ConferenceResource, conferenceSid?: string); + /** + * The unique SID identifier of the Conference. + */ + conferenceSid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * Custom label for the conference resource, up to 64 characters. + */ + friendlyName: string; + /** + * Conference creation date and time in ISO 8601 format. + */ + createTime: Date; + /** + * Timestamp in ISO 8601 format when the conference started. Conferences do not start until at least two participants join, at least one of whom has startConferenceOnEnter=true. + */ + startTime: Date; + /** + * Conference end date and time in ISO 8601 format. + */ + endTime: Date; + /** + * Conference duration in seconds. + */ + durationSeconds: number; + /** + * Duration of the between conference start event and conference end event in seconds. + */ + connectDurationSeconds: number; + status: ConferenceConferenceStatus; + /** + * Maximum number of concurrent participants as specified by the configuration. + */ + maxParticipants: number; + /** + * Actual maximum number of concurrent participants in the conference. + */ + maxConcurrentParticipants: number; + /** + * Unique conference participants based on caller ID. + */ + uniqueParticipants: number; + endReason: ConferenceConferenceEndReason; + /** + * Call SID of the participant whose actions ended the conference. + */ + endedBy: string; + mixerRegion: ConferenceRegion; + mixerRegionRequested: ConferenceRegion; + /** + * Boolean. Indicates whether recording was enabled at the conference mixer. + */ + recordingEnabled: boolean; + /** + * Potential issues detected by Twilio during the conference. + */ + detectedIssues: any; + /** + * Tags for detected conference conditions and participant behaviors which may be of interest. + */ + tags: Array; + /** + * Object. Contains details about conference tags including severity. + */ + tagInfo: any; + processingState: ConferenceProcessingState; + /** + * The URL of this resource. + */ + url: string; + /** + * Contains a dictionary of URL links to nested resources of this Conference. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ConferenceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + fetch(callback?: (error: Error | null, item?: ConferenceInstance) => any): Promise; + /** + * Access the conferenceParticipants. + */ + conferenceParticipants(): ConferenceParticipantListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + conferenceSid: string; + accountSid: string; + friendlyName: string; + createTime: Date; + startTime: Date; + endTime: Date; + durationSeconds: number; + connectDurationSeconds: number; + status: ConferenceConferenceStatus; + maxParticipants: number; + maxConcurrentParticipants: number; + uniqueParticipants: number; + endReason: ConferenceConferenceEndReason; + endedBy: string; + mixerRegion: ConferenceRegion; + mixerRegionRequested: ConferenceRegion; + recordingEnabled: boolean; + detectedIssues: any; + tags: ConferenceTag[]; + tagInfo: any; + processingState: ConferenceProcessingState; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConferenceSolution { +} +export interface ConferenceListInstance { + _version: V1; + _solution: ConferenceSolution; + _uri: string; + (conferenceSid: string): ConferenceContext; + get(conferenceSid: string): ConferenceContext; + /** + * Streams ConferenceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ConferenceInstance, done: (err?: Error) => void) => void): void; + each(params: ConferenceListInstanceEachOptions, callback?: (item: ConferenceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ConferenceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ConferencePage) => any): Promise; + /** + * Lists ConferenceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ConferenceInstance[]) => any): Promise; + list(params: ConferenceListInstanceOptions, callback?: (error: Error | null, items: ConferenceInstance[]) => any): Promise; + /** + * Retrieve a single page of ConferenceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ConferencePage) => any): Promise; + page(params: ConferenceListInstancePageOptions, callback?: (error: Error | null, items: ConferencePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConferenceListInstance(version: V1): ConferenceListInstance; +export declare class ConferencePage extends Page { + /** + * Initialize the ConferencePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ConferenceSolution); + /** + * Build an instance of ConferenceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ConferenceResource): ConferenceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/conference.js b/node_modules/twilio/lib/rest/insights/v1/conference.js new file mode 100644 index 00000000..c277af34 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/conference.js @@ -0,0 +1,248 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConferencePage = exports.ConferenceListInstance = exports.ConferenceInstance = exports.ConferenceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const conferenceParticipant_1 = require("./conference/conferenceParticipant"); +class ConferenceContextImpl { + constructor(_version, conferenceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(conferenceSid)) { + throw new Error("Parameter 'conferenceSid' is not valid."); + } + this._solution = { conferenceSid }; + this._uri = `/Conferences/${conferenceSid}`; + } + get conferenceParticipants() { + this._conferenceParticipants = + this._conferenceParticipants || + (0, conferenceParticipant_1.ConferenceParticipantListInstance)(this._version, this._solution.conferenceSid); + return this._conferenceParticipants; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConferenceInstance(operationVersion, payload, instance._solution.conferenceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferenceContextImpl = ConferenceContextImpl; +class ConferenceInstance { + constructor(_version, payload, conferenceSid) { + this._version = _version; + this.conferenceSid = payload.conference_sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.createTime = deserialize.iso8601DateTime(payload.create_time); + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.durationSeconds = deserialize.integer(payload.duration_seconds); + this.connectDurationSeconds = deserialize.integer(payload.connect_duration_seconds); + this.status = payload.status; + this.maxParticipants = deserialize.integer(payload.max_participants); + this.maxConcurrentParticipants = deserialize.integer(payload.max_concurrent_participants); + this.uniqueParticipants = deserialize.integer(payload.unique_participants); + this.endReason = payload.end_reason; + this.endedBy = payload.ended_by; + this.mixerRegion = payload.mixer_region; + this.mixerRegionRequested = payload.mixer_region_requested; + this.recordingEnabled = payload.recording_enabled; + this.detectedIssues = payload.detected_issues; + this.tags = payload.tags; + this.tagInfo = payload.tag_info; + this.processingState = payload.processing_state; + this.url = payload.url; + this.links = payload.links; + this._solution = { conferenceSid: conferenceSid || this.conferenceSid }; + } + get _proxy() { + this._context = + this._context || + new ConferenceContextImpl(this._version, this._solution.conferenceSid); + return this._context; + } + /** + * Fetch a ConferenceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the conferenceParticipants. + */ + conferenceParticipants() { + return this._proxy.conferenceParticipants; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + conferenceSid: this.conferenceSid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + createTime: this.createTime, + startTime: this.startTime, + endTime: this.endTime, + durationSeconds: this.durationSeconds, + connectDurationSeconds: this.connectDurationSeconds, + status: this.status, + maxParticipants: this.maxParticipants, + maxConcurrentParticipants: this.maxConcurrentParticipants, + uniqueParticipants: this.uniqueParticipants, + endReason: this.endReason, + endedBy: this.endedBy, + mixerRegion: this.mixerRegion, + mixerRegionRequested: this.mixerRegionRequested, + recordingEnabled: this.recordingEnabled, + detectedIssues: this.detectedIssues, + tags: this.tags, + tagInfo: this.tagInfo, + processingState: this.processingState, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferenceInstance = ConferenceInstance; +function ConferenceListInstance(version) { + const instance = ((conferenceSid) => instance.get(conferenceSid)); + instance.get = function get(conferenceSid) { + return new ConferenceContextImpl(version, conferenceSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Conferences`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["conferenceSid"] !== undefined) + data["ConferenceSid"] = params["conferenceSid"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["createdAfter"] !== undefined) + data["CreatedAfter"] = params["createdAfter"]; + if (params["createdBefore"] !== undefined) + data["CreatedBefore"] = params["createdBefore"]; + if (params["mixerRegion"] !== undefined) + data["MixerRegion"] = params["mixerRegion"]; + if (params["tags"] !== undefined) + data["Tags"] = params["tags"]; + if (params["subaccount"] !== undefined) + data["Subaccount"] = params["subaccount"]; + if (params["detectedIssues"] !== undefined) + data["DetectedIssues"] = params["detectedIssues"]; + if (params["endReason"] !== undefined) + data["EndReason"] = params["endReason"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConferencePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ConferencePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConferenceListInstance = ConferenceListInstance; +class ConferencePage extends Page_1.default { + /** + * Initialize the ConferencePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ConferenceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ConferenceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferencePage = ConferencePage; diff --git a/node_modules/twilio/lib/rest/insights/v1/conference/conferenceParticipant.d.ts b/node_modules/twilio/lib/rest/insights/v1/conference/conferenceParticipant.d.ts new file mode 100644 index 00000000..cef3310f --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/conference/conferenceParticipant.d.ts @@ -0,0 +1,375 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type ConferenceParticipantCallDirection = "inbound" | "outbound"; +export type ConferenceParticipantCallStatus = "answered" | "completed" | "busy" | "fail" | "noanswer" | "ringing" | "canceled"; +export type ConferenceParticipantCallType = "carrier" | "client" | "sip"; +export type ConferenceParticipantJitterBufferSize = "large" | "small" | "medium" | "off"; +export type ConferenceParticipantProcessingState = "complete" | "in_progress" | "timeout"; +export type ConferenceParticipantRegion = "us1" | "us2" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "de1"; +/** + * Options to pass to fetch a ConferenceParticipantInstance + */ +export interface ConferenceParticipantContextFetchOptions { + /** Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. */ + events?: string; + /** Object. Contains participant call quality metrics. */ + metrics?: string; +} +/** + * Options to pass to each + */ +export interface ConferenceParticipantListInstanceEachOptions { + /** The unique SID identifier of the Participant. */ + participantSid?: string; + /** User-specified label for a participant. */ + label?: string; + /** Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. */ + events?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ConferenceParticipantInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ConferenceParticipantListInstanceOptions { + /** The unique SID identifier of the Participant. */ + participantSid?: string; + /** User-specified label for a participant. */ + label?: string; + /** Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. */ + events?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ConferenceParticipantListInstancePageOptions { + /** The unique SID identifier of the Participant. */ + participantSid?: string; + /** User-specified label for a participant. */ + label?: string; + /** Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. */ + events?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ConferenceParticipantContext { + /** + * Fetch a ConferenceParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ConferenceParticipantInstance) => any): Promise; + /** + * Fetch a ConferenceParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceParticipantInstance + */ + fetch(params: ConferenceParticipantContextFetchOptions, callback?: (error: Error | null, item?: ConferenceParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConferenceParticipantContextSolution { + conferenceSid: string; + participantSid: string; +} +export declare class ConferenceParticipantContextImpl implements ConferenceParticipantContext { + protected _version: V1; + protected _solution: ConferenceParticipantContextSolution; + protected _uri: string; + constructor(_version: V1, conferenceSid: string, participantSid: string); + fetch(params?: ConferenceParticipantContextFetchOptions | ((error: Error | null, item?: ConferenceParticipantInstance) => any), callback?: (error: Error | null, item?: ConferenceParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConferenceParticipantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConferenceParticipantPayload extends TwilioResponsePayload { + participants: ConferenceParticipantResource[]; +} +interface ConferenceParticipantResource { + participant_sid: string; + label: string; + conference_sid: string; + call_sid: string; + account_sid: string; + call_direction: ConferenceParticipantCallDirection; + from: string; + to: string; + call_status: ConferenceParticipantCallStatus; + country_code: string; + is_moderator: boolean; + join_time: Date; + leave_time: Date; + duration_seconds: number; + outbound_queue_length: number; + outbound_time_in_queue: number; + jitter_buffer_size: ConferenceParticipantJitterBufferSize; + is_coach: boolean; + coached_participants: Array; + participant_region: ConferenceParticipantRegion; + conference_region: ConferenceParticipantRegion; + call_type: ConferenceParticipantCallType; + processing_state: ConferenceParticipantProcessingState; + properties: any; + events: any; + metrics: any; + url: string; +} +export declare class ConferenceParticipantInstance { + protected _version: V1; + protected _solution: ConferenceParticipantContextSolution; + protected _context?: ConferenceParticipantContext; + constructor(_version: V1, payload: ConferenceParticipantResource, conferenceSid: string, participantSid?: string); + /** + * SID for this participant. + */ + participantSid: string; + /** + * The user-specified label of this participant. + */ + label: string; + /** + * The unique SID identifier of the Conference. + */ + conferenceSid: string; + /** + * Unique SID identifier of the call that generated the Participant resource. + */ + callSid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + callDirection: ConferenceParticipantCallDirection; + /** + * Caller ID of the calling party. + */ + from: string; + /** + * Called party. + */ + to: string; + callStatus: ConferenceParticipantCallStatus; + /** + * ISO alpha-2 country code of the participant based on caller ID or called number. + */ + countryCode: string; + /** + * Boolean. Indicates whether participant had startConferenceOnEnter=true or endConferenceOnExit=true. + */ + isModerator: boolean; + /** + * ISO 8601 timestamp of participant join event. + */ + joinTime: Date; + /** + * ISO 8601 timestamp of participant leave event. + */ + leaveTime: Date; + /** + * Participant durations in seconds. + */ + durationSeconds: number; + /** + * Add Participant API only. Estimated time in queue at call creation. + */ + outboundQueueLength: number; + /** + * Add Participant API only. Actual time in queue in seconds. + */ + outboundTimeInQueue: number; + jitterBufferSize: ConferenceParticipantJitterBufferSize; + /** + * Boolean. Indicated whether participant was a coach. + */ + isCoach: boolean; + /** + * Call SIDs coached by this participant. + */ + coachedParticipants: Array; + participantRegion: ConferenceParticipantRegion; + conferenceRegion: ConferenceParticipantRegion; + callType: ConferenceParticipantCallType; + processingState: ConferenceParticipantProcessingState; + /** + * Participant properties and metadata. + */ + properties: any; + /** + * Object containing information of actions taken by participants. Contains a dictionary of URL links to nested resources of this Conference Participant. + */ + events: any; + /** + * Object. Contains participant call quality metrics. + */ + metrics: any; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ConferenceParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ConferenceParticipantInstance) => any): Promise; + /** + * Fetch a ConferenceParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConferenceParticipantInstance + */ + fetch(params: ConferenceParticipantContextFetchOptions, callback?: (error: Error | null, item?: ConferenceParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + participantSid: string; + label: string; + conferenceSid: string; + callSid: string; + accountSid: string; + callDirection: ConferenceParticipantCallDirection; + from: string; + to: string; + callStatus: ConferenceParticipantCallStatus; + countryCode: string; + isModerator: boolean; + joinTime: Date; + leaveTime: Date; + durationSeconds: number; + outboundQueueLength: number; + outboundTimeInQueue: number; + jitterBufferSize: ConferenceParticipantJitterBufferSize; + isCoach: boolean; + coachedParticipants: string[]; + participantRegion: ConferenceParticipantRegion; + conferenceRegion: ConferenceParticipantRegion; + callType: ConferenceParticipantCallType; + processingState: ConferenceParticipantProcessingState; + properties: any; + events: any; + metrics: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConferenceParticipantSolution { + conferenceSid: string; +} +export interface ConferenceParticipantListInstance { + _version: V1; + _solution: ConferenceParticipantSolution; + _uri: string; + (participantSid: string): ConferenceParticipantContext; + get(participantSid: string): ConferenceParticipantContext; + /** + * Streams ConferenceParticipantInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceParticipantListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ConferenceParticipantInstance, done: (err?: Error) => void) => void): void; + each(params: ConferenceParticipantListInstanceEachOptions, callback?: (item: ConferenceParticipantInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ConferenceParticipantInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ConferenceParticipantPage) => any): Promise; + /** + * Lists ConferenceParticipantInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceParticipantListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ConferenceParticipantInstance[]) => any): Promise; + list(params: ConferenceParticipantListInstanceOptions, callback?: (error: Error | null, items: ConferenceParticipantInstance[]) => any): Promise; + /** + * Retrieve a single page of ConferenceParticipantInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConferenceParticipantListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ConferenceParticipantPage) => any): Promise; + page(params: ConferenceParticipantListInstancePageOptions, callback?: (error: Error | null, items: ConferenceParticipantPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConferenceParticipantListInstance(version: V1, conferenceSid: string): ConferenceParticipantListInstance; +export declare class ConferenceParticipantPage extends Page { + /** + * Initialize the ConferenceParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ConferenceParticipantSolution); + /** + * Build an instance of ConferenceParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ConferenceParticipantResource): ConferenceParticipantInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/conference/conferenceParticipant.js b/node_modules/twilio/lib/rest/insights/v1/conference/conferenceParticipant.js new file mode 100644 index 00000000..dffdae55 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/conference/conferenceParticipant.js @@ -0,0 +1,246 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConferenceParticipantPage = exports.ConferenceParticipantListInstance = exports.ConferenceParticipantInstance = exports.ConferenceParticipantContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ConferenceParticipantContextImpl { + constructor(_version, conferenceSid, participantSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(conferenceSid)) { + throw new Error("Parameter 'conferenceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + this._solution = { conferenceSid, participantSid }; + this._uri = `/Conferences/${conferenceSid}/Participants/${participantSid}`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["events"] !== undefined) + data["Events"] = params["events"]; + if (params["metrics"] !== undefined) + data["Metrics"] = params["metrics"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConferenceParticipantInstance(operationVersion, payload, instance._solution.conferenceSid, instance._solution.participantSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferenceParticipantContextImpl = ConferenceParticipantContextImpl; +class ConferenceParticipantInstance { + constructor(_version, payload, conferenceSid, participantSid) { + this._version = _version; + this.participantSid = payload.participant_sid; + this.label = payload.label; + this.conferenceSid = payload.conference_sid; + this.callSid = payload.call_sid; + this.accountSid = payload.account_sid; + this.callDirection = payload.call_direction; + this.from = payload.from; + this.to = payload.to; + this.callStatus = payload.call_status; + this.countryCode = payload.country_code; + this.isModerator = payload.is_moderator; + this.joinTime = deserialize.iso8601DateTime(payload.join_time); + this.leaveTime = deserialize.iso8601DateTime(payload.leave_time); + this.durationSeconds = deserialize.integer(payload.duration_seconds); + this.outboundQueueLength = deserialize.integer(payload.outbound_queue_length); + this.outboundTimeInQueue = deserialize.integer(payload.outbound_time_in_queue); + this.jitterBufferSize = payload.jitter_buffer_size; + this.isCoach = payload.is_coach; + this.coachedParticipants = payload.coached_participants; + this.participantRegion = payload.participant_region; + this.conferenceRegion = payload.conference_region; + this.callType = payload.call_type; + this.processingState = payload.processing_state; + this.properties = payload.properties; + this.events = payload.events; + this.metrics = payload.metrics; + this.url = payload.url; + this._solution = { + conferenceSid, + participantSid: participantSid || this.participantSid, + }; + } + get _proxy() { + this._context = + this._context || + new ConferenceParticipantContextImpl(this._version, this._solution.conferenceSid, this._solution.participantSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + participantSid: this.participantSid, + label: this.label, + conferenceSid: this.conferenceSid, + callSid: this.callSid, + accountSid: this.accountSid, + callDirection: this.callDirection, + from: this.from, + to: this.to, + callStatus: this.callStatus, + countryCode: this.countryCode, + isModerator: this.isModerator, + joinTime: this.joinTime, + leaveTime: this.leaveTime, + durationSeconds: this.durationSeconds, + outboundQueueLength: this.outboundQueueLength, + outboundTimeInQueue: this.outboundTimeInQueue, + jitterBufferSize: this.jitterBufferSize, + isCoach: this.isCoach, + coachedParticipants: this.coachedParticipants, + participantRegion: this.participantRegion, + conferenceRegion: this.conferenceRegion, + callType: this.callType, + processingState: this.processingState, + properties: this.properties, + events: this.events, + metrics: this.metrics, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferenceParticipantInstance = ConferenceParticipantInstance; +function ConferenceParticipantListInstance(version, conferenceSid) { + if (!(0, utility_1.isValidPathParam)(conferenceSid)) { + throw new Error("Parameter 'conferenceSid' is not valid."); + } + const instance = ((participantSid) => instance.get(participantSid)); + instance.get = function get(participantSid) { + return new ConferenceParticipantContextImpl(version, conferenceSid, participantSid); + }; + instance._version = version; + instance._solution = { conferenceSid }; + instance._uri = `/Conferences/${conferenceSid}/Participants`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["participantSid"] !== undefined) + data["ParticipantSid"] = params["participantSid"]; + if (params["label"] !== undefined) + data["Label"] = params["label"]; + if (params["events"] !== undefined) + data["Events"] = params["events"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConferenceParticipantPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ConferenceParticipantPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConferenceParticipantListInstance = ConferenceParticipantListInstance; +class ConferenceParticipantPage extends Page_1.default { + /** + * Initialize the ConferenceParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ConferenceParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ConferenceParticipantInstance(this._version, payload, this._solution.conferenceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConferenceParticipantPage = ConferenceParticipantPage; diff --git a/node_modules/twilio/lib/rest/insights/v1/room.d.ts b/node_modules/twilio/lib/rest/insights/v1/room.d.ts new file mode 100644 index 00000000..7dc19fc0 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/room.d.ts @@ -0,0 +1,362 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { ParticipantListInstance } from "./room/participant"; +export type RoomCodec = "VP8" | "H264" | "VP9"; +export type RoomCreatedMethod = "sdk" | "ad_hoc" | "api"; +export type RoomEdgeLocation = "ashburn" | "dublin" | "frankfurt" | "singapore" | "sydney" | "sao_paulo" | "roaming" | "umatilla" | "tokyo"; +export type RoomEndReason = "room_ended_via_api" | "timeout"; +export type RoomProcessingState = "complete" | "in_progress"; +export type RoomRoomStatus = "in_progress" | "completed"; +export type RoomRoomType = "go" | "peer_to_peer" | "group" | "group_small"; +export type RoomTwilioRealm = "us1" | "us2" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "in1" | "de1" | "gll"; +/** + * Options to pass to each + */ +export interface RoomListInstanceEachOptions { + /** Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. */ + roomType?: Array; + /** Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. */ + codec?: Array; + /** Room friendly name. */ + roomName?: string; + /** Only read rooms that started on or after this ISO 8601 timestamp. */ + createdAfter?: Date; + /** Only read rooms that started before this ISO 8601 timestamp. */ + createdBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoomInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoomListInstanceOptions { + /** Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. */ + roomType?: Array; + /** Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. */ + codec?: Array; + /** Room friendly name. */ + roomName?: string; + /** Only read rooms that started on or after this ISO 8601 timestamp. */ + createdAfter?: Date; + /** Only read rooms that started before this ISO 8601 timestamp. */ + createdBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoomListInstancePageOptions { + /** Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. */ + roomType?: Array; + /** Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. */ + codec?: Array; + /** Room friendly name. */ + roomName?: string; + /** Only read rooms that started on or after this ISO 8601 timestamp. */ + createdAfter?: Date; + /** Only read rooms that started before this ISO 8601 timestamp. */ + createdBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoomContext { + participants: ParticipantListInstance; + /** + * Fetch a RoomInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoomContextSolution { + roomSid: string; +} +export declare class RoomContextImpl implements RoomContext { + protected _version: V1; + protected _solution: RoomContextSolution; + protected _uri: string; + protected _participants?: ParticipantListInstance; + constructor(_version: V1, roomSid: string); + get participants(): ParticipantListInstance; + fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoomContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RoomPayload extends TwilioResponsePayload { + rooms: RoomResource[]; +} +interface RoomResource { + account_sid: string; + room_sid: string; + room_name: string; + create_time: Date; + end_time: Date; + room_type: RoomRoomType; + room_status: RoomRoomStatus; + status_callback: string; + status_callback_method: string; + created_method: RoomCreatedMethod; + end_reason: RoomEndReason; + max_participants: number; + unique_participants: number; + unique_participant_identities: number; + concurrent_participants: number; + max_concurrent_participants: number; + codecs: Array; + media_region: RoomTwilioRealm; + duration_sec: number; + total_participant_duration_sec: number; + total_recording_duration_sec: number; + processing_state: RoomProcessingState; + recording_enabled: boolean; + edge_location: RoomEdgeLocation; + url: string; + links: Record; +} +export declare class RoomInstance { + protected _version: V1; + protected _solution: RoomContextSolution; + protected _context?: RoomContext; + constructor(_version: V1, payload: RoomResource, roomSid?: string); + /** + * Account SID associated with this room. + */ + accountSid: string; + /** + * Unique identifier for the room. + */ + roomSid: string; + /** + * Room friendly name. + */ + roomName: string; + /** + * Creation time of the room. + */ + createTime: Date; + /** + * End time for the room. + */ + endTime: Date; + roomType: RoomRoomType; + roomStatus: RoomRoomStatus; + /** + * Webhook provided for status callbacks. + */ + statusCallback: string; + /** + * HTTP method provided for status callback URL. + */ + statusCallbackMethod: string; + createdMethod: RoomCreatedMethod; + endReason: RoomEndReason; + /** + * Max number of total participants allowed by the application settings. + */ + maxParticipants: number; + /** + * Number of participants. May include duplicate identities for participants who left and rejoined. + */ + uniqueParticipants: number; + /** + * Unique number of participant identities. + */ + uniqueParticipantIdentities: number; + /** + * Actual number of concurrent participants. + */ + concurrentParticipants: number; + /** + * Maximum number of participants allowed in the room at the same time allowed by the application settings. + */ + maxConcurrentParticipants: number; + /** + * Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. + */ + codecs: Array; + mediaRegion: RoomTwilioRealm; + /** + * Total room duration from create time to end time. + */ + durationSec: number; + /** + * Combined amount of participant time in the room. + */ + totalParticipantDurationSec: number; + /** + * Combined amount of recorded seconds for participants in the room. + */ + totalRecordingDurationSec: number; + processingState: RoomProcessingState; + /** + * Boolean indicating if recording is enabled for the room. + */ + recordingEnabled: boolean; + edgeLocation: RoomEdgeLocation; + /** + * URL for the room resource. + */ + url: string; + /** + * Room subresources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a RoomInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Access the participants. + */ + participants(): ParticipantListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + roomSid: string; + roomName: string; + createTime: Date; + endTime: Date; + roomType: RoomRoomType; + roomStatus: RoomRoomStatus; + statusCallback: string; + statusCallbackMethod: string; + createdMethod: RoomCreatedMethod; + endReason: RoomEndReason; + maxParticipants: number; + uniqueParticipants: number; + uniqueParticipantIdentities: number; + concurrentParticipants: number; + maxConcurrentParticipants: number; + codecs: RoomCodec[]; + mediaRegion: RoomTwilioRealm; + durationSec: number; + totalParticipantDurationSec: number; + totalRecordingDurationSec: number; + processingState: RoomProcessingState; + recordingEnabled: boolean; + edgeLocation: RoomEdgeLocation; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoomSolution { +} +export interface RoomListInstance { + _version: V1; + _solution: RoomSolution; + _uri: string; + (roomSid: string): RoomContext; + get(roomSid: string): RoomContext; + /** + * Streams RoomInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoomInstance, done: (err?: Error) => void) => void): void; + each(params: RoomListInstanceEachOptions, callback?: (item: RoomInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoomInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RoomPage) => any): Promise; + /** + * Lists RoomInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoomInstance[]) => any): Promise; + list(params: RoomListInstanceOptions, callback?: (error: Error | null, items: RoomInstance[]) => any): Promise; + /** + * Retrieve a single page of RoomInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RoomPage) => any): Promise; + page(params: RoomListInstancePageOptions, callback?: (error: Error | null, items: RoomPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoomListInstance(version: V1): RoomListInstance; +export declare class RoomPage extends Page { + /** + * Initialize the RoomPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RoomSolution); + /** + * Build an instance of RoomInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoomResource): RoomInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/room.js b/node_modules/twilio/lib/rest/insights/v1/room.js new file mode 100644 index 00000000..f4705c81 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/room.js @@ -0,0 +1,244 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RoomPage = exports.RoomListInstance = exports.RoomInstance = exports.RoomContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const participant_1 = require("./room/participant"); +class RoomContextImpl { + constructor(_version, roomSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + this._solution = { roomSid }; + this._uri = `/Video/Rooms/${roomSid}`; + } + get participants() { + this._participants = + this._participants || + (0, participant_1.ParticipantListInstance)(this._version, this._solution.roomSid); + return this._participants; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoomInstance(operationVersion, payload, instance._solution.roomSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomContextImpl = RoomContextImpl; +class RoomInstance { + constructor(_version, payload, roomSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.roomSid = payload.room_sid; + this.roomName = payload.room_name; + this.createTime = deserialize.iso8601DateTime(payload.create_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.roomType = payload.room_type; + this.roomStatus = payload.room_status; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.createdMethod = payload.created_method; + this.endReason = payload.end_reason; + this.maxParticipants = deserialize.integer(payload.max_participants); + this.uniqueParticipants = deserialize.integer(payload.unique_participants); + this.uniqueParticipantIdentities = deserialize.integer(payload.unique_participant_identities); + this.concurrentParticipants = deserialize.integer(payload.concurrent_participants); + this.maxConcurrentParticipants = deserialize.integer(payload.max_concurrent_participants); + this.codecs = payload.codecs; + this.mediaRegion = payload.media_region; + this.durationSec = payload.duration_sec; + this.totalParticipantDurationSec = payload.total_participant_duration_sec; + this.totalRecordingDurationSec = payload.total_recording_duration_sec; + this.processingState = payload.processing_state; + this.recordingEnabled = payload.recording_enabled; + this.edgeLocation = payload.edge_location; + this.url = payload.url; + this.links = payload.links; + this._solution = { roomSid: roomSid || this.roomSid }; + } + get _proxy() { + this._context = + this._context || + new RoomContextImpl(this._version, this._solution.roomSid); + return this._context; + } + /** + * Fetch a RoomInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the participants. + */ + participants() { + return this._proxy.participants; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + roomSid: this.roomSid, + roomName: this.roomName, + createTime: this.createTime, + endTime: this.endTime, + roomType: this.roomType, + roomStatus: this.roomStatus, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + createdMethod: this.createdMethod, + endReason: this.endReason, + maxParticipants: this.maxParticipants, + uniqueParticipants: this.uniqueParticipants, + uniqueParticipantIdentities: this.uniqueParticipantIdentities, + concurrentParticipants: this.concurrentParticipants, + maxConcurrentParticipants: this.maxConcurrentParticipants, + codecs: this.codecs, + mediaRegion: this.mediaRegion, + durationSec: this.durationSec, + totalParticipantDurationSec: this.totalParticipantDurationSec, + totalRecordingDurationSec: this.totalRecordingDurationSec, + processingState: this.processingState, + recordingEnabled: this.recordingEnabled, + edgeLocation: this.edgeLocation, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomInstance = RoomInstance; +function RoomListInstance(version) { + const instance = ((roomSid) => instance.get(roomSid)); + instance.get = function get(roomSid) { + return new RoomContextImpl(version, roomSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Video/Rooms`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roomType"] !== undefined) + data["RoomType"] = serialize.map(params["roomType"], (e) => e); + if (params["codec"] !== undefined) + data["Codec"] = serialize.map(params["codec"], (e) => e); + if (params["roomName"] !== undefined) + data["RoomName"] = params["roomName"]; + if (params["createdAfter"] !== undefined) + data["CreatedAfter"] = serialize.iso8601DateTime(params["createdAfter"]); + if (params["createdBefore"] !== undefined) + data["CreatedBefore"] = serialize.iso8601DateTime(params["createdBefore"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoomPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RoomPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoomListInstance = RoomListInstance; +class RoomPage extends Page_1.default { + /** + * Initialize the RoomPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoomInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoomInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomPage = RoomPage; diff --git a/node_modules/twilio/lib/rest/insights/v1/room/participant.d.ts b/node_modules/twilio/lib/rest/insights/v1/room/participant.d.ts new file mode 100644 index 00000000..0762a003 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/room/participant.d.ts @@ -0,0 +1,280 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type ParticipantCodec = "VP8" | "H264" | "VP9"; +export type ParticipantEdgeLocation = "ashburn" | "dublin" | "frankfurt" | "singapore" | "sydney" | "sao_paulo" | "roaming" | "umatilla" | "tokyo"; +export type ParticipantRoomStatus = "in_progress" | "completed"; +export type ParticipantTwilioRealm = "us1" | "us2" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "in1" | "de1" | "gll"; +/** + * Options to pass to each + */ +export interface ParticipantListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ParticipantListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ParticipantListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ParticipantContext { + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ParticipantContextSolution { + roomSid: string; + participantSid: string; +} +export declare class ParticipantContextImpl implements ParticipantContext { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _uri: string; + constructor(_version: V1, roomSid: string, participantSid: string); + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ParticipantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ParticipantPayload extends TwilioResponsePayload { + participants: ParticipantResource[]; +} +interface ParticipantResource { + participant_sid: string; + participant_identity: string; + join_time: Date; + leave_time: Date; + duration_sec: number; + account_sid: string; + room_sid: string; + status: ParticipantRoomStatus; + codecs: Array; + end_reason: string; + error_code: number; + error_code_url: string; + media_region: ParticipantTwilioRealm; + properties: any; + edge_location: ParticipantEdgeLocation; + publisher_info: any; + url: string; +} +export declare class ParticipantInstance { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _context?: ParticipantContext; + constructor(_version: V1, payload: ParticipantResource, roomSid: string, participantSid?: string); + /** + * Unique identifier for the participant. + */ + participantSid: string; + /** + * The application-defined string that uniquely identifies the participant within a Room. + */ + participantIdentity: string; + /** + * When the participant joined the room. + */ + joinTime: Date; + /** + * When the participant left the room. + */ + leaveTime: Date; + /** + * Amount of time in seconds the participant was in the room. + */ + durationSec: number; + /** + * Account SID associated with the room. + */ + accountSid: string; + /** + * Unique identifier for the room. + */ + roomSid: string; + status: ParticipantRoomStatus; + /** + * Codecs detected from the participant. Can be `VP8`, `H264`, or `VP9`. + */ + codecs: Array; + /** + * Reason the participant left the room. See [the list of possible values here](https://www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#end_reason). + */ + endReason: string; + /** + * Errors encountered by the participant. + */ + errorCode: number; + /** + * Twilio error code dictionary link. + */ + errorCodeUrl: string; + mediaRegion: ParticipantTwilioRealm; + /** + * Object containing information about the participant\'s data from the room. See [below](https://www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#properties) for more information. + */ + properties: any; + edgeLocation: ParticipantEdgeLocation; + /** + * Object containing information about the SDK name and version. See [below](https://www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#publisher_info) for more information. + */ + publisherInfo: any; + /** + * URL of the participant resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + participantSid: string; + participantIdentity: string; + joinTime: Date; + leaveTime: Date; + durationSec: number; + accountSid: string; + roomSid: string; + status: ParticipantRoomStatus; + codecs: ParticipantCodec[]; + endReason: string; + errorCode: number; + errorCodeUrl: string; + mediaRegion: ParticipantTwilioRealm; + properties: any; + edgeLocation: ParticipantEdgeLocation; + publisherInfo: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ParticipantSolution { + roomSid: string; +} +export interface ParticipantListInstance { + _version: V1; + _solution: ParticipantSolution; + _uri: string; + (participantSid: string): ParticipantContext; + get(participantSid: string): ParticipantContext; + /** + * Streams ParticipantInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + each(params: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Lists ParticipantInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + list(params: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + /** + * Retrieve a single page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + page(params: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ParticipantListInstance(version: V1, roomSid: string): ParticipantListInstance; +export declare class ParticipantPage extends Page { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ParticipantSolution); + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ParticipantResource): ParticipantInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/room/participant.js b/node_modules/twilio/lib/rest/insights/v1/room/participant.js new file mode 100644 index 00000000..ad799e8a --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/room/participant.js @@ -0,0 +1,212 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParticipantPage = exports.ParticipantListInstance = exports.ParticipantInstance = exports.ParticipantContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ParticipantContextImpl { + constructor(_version, roomSid, participantSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + this._solution = { roomSid, participantSid }; + this._uri = `/Video/Rooms/${roomSid}/Participants/${participantSid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantContextImpl = ParticipantContextImpl; +class ParticipantInstance { + constructor(_version, payload, roomSid, participantSid) { + this._version = _version; + this.participantSid = payload.participant_sid; + this.participantIdentity = payload.participant_identity; + this.joinTime = deserialize.iso8601DateTime(payload.join_time); + this.leaveTime = deserialize.iso8601DateTime(payload.leave_time); + this.durationSec = payload.duration_sec; + this.accountSid = payload.account_sid; + this.roomSid = payload.room_sid; + this.status = payload.status; + this.codecs = payload.codecs; + this.endReason = payload.end_reason; + this.errorCode = deserialize.integer(payload.error_code); + this.errorCodeUrl = payload.error_code_url; + this.mediaRegion = payload.media_region; + this.properties = payload.properties; + this.edgeLocation = payload.edge_location; + this.publisherInfo = payload.publisher_info; + this.url = payload.url; + this._solution = { + roomSid, + participantSid: participantSid || this.participantSid, + }; + } + get _proxy() { + this._context = + this._context || + new ParticipantContextImpl(this._version, this._solution.roomSid, this._solution.participantSid); + return this._context; + } + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + participantSid: this.participantSid, + participantIdentity: this.participantIdentity, + joinTime: this.joinTime, + leaveTime: this.leaveTime, + durationSec: this.durationSec, + accountSid: this.accountSid, + roomSid: this.roomSid, + status: this.status, + codecs: this.codecs, + endReason: this.endReason, + errorCode: this.errorCode, + errorCodeUrl: this.errorCodeUrl, + mediaRegion: this.mediaRegion, + properties: this.properties, + edgeLocation: this.edgeLocation, + publisherInfo: this.publisherInfo, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantInstance = ParticipantInstance; +function ParticipantListInstance(version, roomSid) { + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + const instance = ((participantSid) => instance.get(participantSid)); + instance.get = function get(participantSid) { + return new ParticipantContextImpl(version, roomSid, participantSid); + }; + instance._version = version; + instance._solution = { roomSid }; + instance._uri = `/Video/Rooms/${roomSid}/Participants`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ParticipantPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ParticipantListInstance = ParticipantListInstance; +class ParticipantPage extends Page_1.default { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ParticipantInstance(this._version, payload, this._solution.roomSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantPage = ParticipantPage; diff --git a/node_modules/twilio/lib/rest/insights/v1/setting.d.ts b/node_modules/twilio/lib/rest/insights/v1/setting.d.ts new file mode 100644 index 00000000..38360742 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/setting.d.ts @@ -0,0 +1,170 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to fetch a SettingInstance + */ +export interface SettingContextFetchOptions { + /** The unique SID identifier of the Subaccount. */ + subaccountSid?: string; +} +/** + * Options to pass to update a SettingInstance + */ +export interface SettingContextUpdateOptions { + /** A boolean flag to enable Advanced Features for Voice Insights. */ + advancedFeatures?: boolean; + /** A boolean flag to enable Voice Trace. */ + voiceTrace?: boolean; + /** The unique SID identifier of the Subaccount. */ + subaccountSid?: string; +} +export interface SettingContext { + /** + * Fetch a SettingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingInstance + */ + fetch(callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Fetch a SettingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingInstance + */ + fetch(params: SettingContextFetchOptions, callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Update a SettingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingInstance + */ + update(callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Update a SettingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingInstance + */ + update(params: SettingContextUpdateOptions, callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SettingContextSolution { +} +export declare class SettingContextImpl implements SettingContext { + protected _version: V1; + protected _solution: SettingContextSolution; + protected _uri: string; + constructor(_version: V1); + fetch(params?: SettingContextFetchOptions | ((error: Error | null, item?: SettingInstance) => any), callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + update(params?: SettingContextUpdateOptions | ((error: Error | null, item?: SettingInstance) => any), callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SettingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SettingResource { + account_sid: string; + advanced_features: boolean; + voice_trace: boolean; + url: string; +} +export declare class SettingInstance { + protected _version: V1; + protected _solution: SettingContextSolution; + protected _context?: SettingContext; + constructor(_version: V1, payload: SettingResource); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * A boolean flag indicating whether Advanced Features for Voice Insights are enabled. + */ + advancedFeatures: boolean; + /** + * A boolean flag indicating whether Voice Trace is enabled. + */ + voiceTrace: boolean; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a SettingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingInstance + */ + fetch(callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Fetch a SettingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingInstance + */ + fetch(params: SettingContextFetchOptions, callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Update a SettingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingInstance + */ + update(callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Update a SettingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingInstance + */ + update(params: SettingContextUpdateOptions, callback?: (error: Error | null, item?: SettingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + advancedFeatures: boolean; + voiceTrace: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SettingSolution { +} +export interface SettingListInstance { + _version: V1; + _solution: SettingSolution; + _uri: string; + (): SettingContext; + get(): SettingContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SettingListInstance(version: V1): SettingListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/insights/v1/setting.js b/node_modules/twilio/lib/rest/insights/v1/setting.js new file mode 100644 index 00000000..602ad6e4 --- /dev/null +++ b/node_modules/twilio/lib/rest/insights/v1/setting.js @@ -0,0 +1,143 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Insights + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SettingListInstance = exports.SettingInstance = exports.SettingContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class SettingContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Voice/Settings`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["subaccountSid"] !== undefined) + data["SubaccountSid"] = params["subaccountSid"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SettingInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["advancedFeatures"] !== undefined) + data["AdvancedFeatures"] = serialize.bool(params["advancedFeatures"]); + if (params["voiceTrace"] !== undefined) + data["VoiceTrace"] = serialize.bool(params["voiceTrace"]); + if (params["subaccountSid"] !== undefined) + data["SubaccountSid"] = params["subaccountSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SettingInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SettingContextImpl = SettingContextImpl; +class SettingInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.advancedFeatures = payload.advanced_features; + this.voiceTrace = payload.voice_trace; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = this._context || new SettingContextImpl(this._version); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + advancedFeatures: this.advancedFeatures, + voiceTrace: this.voiceTrace, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SettingInstance = SettingInstance; +function SettingListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new SettingContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SettingListInstance = SettingListInstance; diff --git a/node_modules/twilio/lib/rest/intelligence/V2.d.ts b/node_modules/twilio/lib/rest/intelligence/V2.d.ts new file mode 100644 index 00000000..678924de --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/V2.d.ts @@ -0,0 +1,20 @@ +import IntelligenceBase from "../IntelligenceBase"; +import Version from "../../base/Version"; +import { ServiceListInstance } from "./v2/service"; +import { TranscriptListInstance } from "./v2/transcript"; +export default class V2 extends Version { + /** + * Initialize the V2 version of Intelligence + * + * @param domain - The Twilio (Twilio.Intelligence) domain + */ + constructor(domain: IntelligenceBase); + /** services - { Twilio.Intelligence.V2.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** transcripts - { Twilio.Intelligence.V2.TranscriptListInstance } resource */ + protected _transcripts?: TranscriptListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; + /** Getter for transcripts resource */ + get transcripts(): TranscriptListInstance; +} diff --git a/node_modules/twilio/lib/rest/intelligence/V2.js b/node_modules/twilio/lib/rest/intelligence/V2.js new file mode 100644 index 00000000..109d295f --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/V2.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Intelligence + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const service_1 = require("./v2/service"); +const transcript_1 = require("./v2/transcript"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of Intelligence + * + * @param domain - The Twilio (Twilio.Intelligence) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } + /** Getter for transcripts resource */ + get transcripts() { + this._transcripts = this._transcripts || (0, transcript_1.TranscriptListInstance)(this); + return this._transcripts; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/service.d.ts b/node_modules/twilio/lib/rest/intelligence/v2/service.d.ts new file mode 100644 index 00000000..3b6361ef --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/service.d.ts @@ -0,0 +1,378 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +export type ServiceHttpMethod = "GET" | "POST" | "NULL"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** The If-Match HTTP request header */ + ifMatch?: string; + /** Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. */ + autoTranscribe?: boolean; + /** Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. */ + dataLogging?: boolean; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; + /** The default language code of the audio. */ + languageCode?: string; + /** Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. */ + autoRedaction?: boolean; + /** Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. */ + mediaRedaction?: boolean; + /** The URL Twilio will request when executing the Webhook. */ + webhookUrl?: string; + /** */ + webhookHttpMethod?: ServiceHttpMethod; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName: string; + /** Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. */ + autoTranscribe?: boolean; + /** Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. */ + dataLogging?: boolean; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; + /** The default language code of the audio. */ + languageCode?: string; + /** Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. */ + autoRedaction?: boolean; + /** Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. */ + mediaRedaction?: boolean; + /** The URL Twilio will request when executing the Webhook. */ + webhookUrl?: string; + /** */ + webhookHttpMethod?: ServiceHttpMethod; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V2; + protected _solution: ServiceContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + account_sid: string; + auto_redaction: boolean; + media_redaction: boolean; + auto_transcribe: boolean; + data_logging: boolean; + date_created: Date; + date_updated: Date; + friendly_name: string; + language_code: string; + sid: string; + unique_name: string; + url: string; + webhook_url: string; + webhook_http_method: ServiceHttpMethod; + version: number; +} +export declare class ServiceInstance { + protected _version: V2; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V2, payload: ServiceResource, sid?: string); + /** + * The unique SID identifier of the Account the Service belongs to. + */ + accountSid: string; + /** + * Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. + */ + autoRedaction: boolean; + /** + * Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. + */ + mediaRedaction: boolean; + /** + * Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. + */ + autoTranscribe: boolean; + /** + * Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + */ + dataLogging: boolean; + /** + * The date that this Service was created, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that this Service was updated, given in ISO 8601 format. + */ + dateUpdated: Date; + /** + * A human readable description of this resource, up to 64 characters. + */ + friendlyName: string; + /** + * The default language code of the audio. + */ + languageCode: string; + /** + * A 34 character string that uniquely identifies this Service. + */ + sid: string; + /** + * Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. + */ + uniqueName: string; + /** + * The URL of this resource. + */ + url: string; + /** + * The URL Twilio will request when executing the Webhook. + */ + webhookUrl: string; + webhookHttpMethod: ServiceHttpMethod; + /** + * The version number of this Service. + */ + version: number; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + autoRedaction: boolean; + mediaRedaction: boolean; + autoTranscribe: boolean; + dataLogging: boolean; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + languageCode: string; + sid: string; + uniqueName: string; + url: string; + webhookUrl: string; + webhookHttpMethod: ServiceHttpMethod; + version: number; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V2; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V2): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/service.js b/node_modules/twilio/lib/rest/intelligence/v2/service.js new file mode 100644 index 00000000..4bd0d3db --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/service.js @@ -0,0 +1,300 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Intelligence + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["autoTranscribe"] !== undefined) + data["AutoTranscribe"] = serialize.bool(params["autoTranscribe"]); + if (params["dataLogging"] !== undefined) + data["DataLogging"] = serialize.bool(params["dataLogging"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["languageCode"] !== undefined) + data["LanguageCode"] = params["languageCode"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["autoRedaction"] !== undefined) + data["AutoRedaction"] = serialize.bool(params["autoRedaction"]); + if (params["mediaRedaction"] !== undefined) + data["MediaRedaction"] = serialize.bool(params["mediaRedaction"]); + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["webhookHttpMethod"] !== undefined) + data["WebhookHttpMethod"] = params["webhookHttpMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.autoRedaction = payload.auto_redaction; + this.mediaRedaction = payload.media_redaction; + this.autoTranscribe = payload.auto_transcribe; + this.dataLogging = payload.data_logging; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.languageCode = payload.language_code; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.url = payload.url; + this.webhookUrl = payload.webhook_url; + this.webhookHttpMethod = payload.webhook_http_method; + this.version = deserialize.integer(payload.version); + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + autoRedaction: this.autoRedaction, + mediaRedaction: this.mediaRedaction, + autoTranscribe: this.autoTranscribe, + dataLogging: this.dataLogging, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + languageCode: this.languageCode, + sid: this.sid, + uniqueName: this.uniqueName, + url: this.url, + webhookUrl: this.webhookUrl, + webhookHttpMethod: this.webhookHttpMethod, + version: this.version, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["uniqueName"] === null || params["uniqueName"] === undefined) { + throw new Error("Required parameter \"params['uniqueName']\" missing."); + } + let data = {}; + data["UniqueName"] = params["uniqueName"]; + if (params["autoTranscribe"] !== undefined) + data["AutoTranscribe"] = serialize.bool(params["autoTranscribe"]); + if (params["dataLogging"] !== undefined) + data["DataLogging"] = serialize.bool(params["dataLogging"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["languageCode"] !== undefined) + data["LanguageCode"] = params["languageCode"]; + if (params["autoRedaction"] !== undefined) + data["AutoRedaction"] = serialize.bool(params["autoRedaction"]); + if (params["mediaRedaction"] !== undefined) + data["MediaRedaction"] = serialize.bool(params["mediaRedaction"]); + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["webhookHttpMethod"] !== undefined) + data["WebhookHttpMethod"] = params["webhookHttpMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/transcript.d.ts b/node_modules/twilio/lib/rest/intelligence/v2/transcript.d.ts new file mode 100644 index 00000000..e8a07e70 --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/transcript.d.ts @@ -0,0 +1,374 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +import { MediaListInstance } from "./transcript/media"; +import { OperatorResultListInstance } from "./transcript/operatorResult"; +import { SentenceListInstance } from "./transcript/sentence"; +export type TranscriptStatus = "queued" | "in-progress" | "completed" | "failed" | "canceled"; +/** + * Options to pass to create a TranscriptInstance + */ +export interface TranscriptListInstanceCreateOptions { + /** The unique SID identifier of the Service. */ + serviceSid: string; + /** JSON object describing Media Channel including Source and Participants */ + channel: any; + /** Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. */ + customerKey?: string; + /** The date that this Transcript\\\'s media was started, given in ISO 8601 format. */ + mediaStartTime?: Date; +} +/** + * Options to pass to each + */ +export interface TranscriptListInstanceEachOptions { + /** The unique SID identifier of the Service. */ + serviceSid?: string; + /** Filter by before StartTime. */ + beforeStartTime?: string; + /** Filter by after StartTime. */ + afterStartTime?: string; + /** Filter by before DateCreated. */ + beforeDateCreated?: string; + /** Filter by after DateCreated. */ + afterDateCreated?: string; + /** Filter by status. */ + status?: string; + /** Filter by Language Code. */ + languageCode?: string; + /** Filter by SourceSid. */ + sourceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TranscriptInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TranscriptListInstanceOptions { + /** The unique SID identifier of the Service. */ + serviceSid?: string; + /** Filter by before StartTime. */ + beforeStartTime?: string; + /** Filter by after StartTime. */ + afterStartTime?: string; + /** Filter by before DateCreated. */ + beforeDateCreated?: string; + /** Filter by after DateCreated. */ + afterDateCreated?: string; + /** Filter by status. */ + status?: string; + /** Filter by Language Code. */ + languageCode?: string; + /** Filter by SourceSid. */ + sourceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TranscriptListInstancePageOptions { + /** The unique SID identifier of the Service. */ + serviceSid?: string; + /** Filter by before StartTime. */ + beforeStartTime?: string; + /** Filter by after StartTime. */ + afterStartTime?: string; + /** Filter by before DateCreated. */ + beforeDateCreated?: string; + /** Filter by after DateCreated. */ + afterDateCreated?: string; + /** Filter by status. */ + status?: string; + /** Filter by Language Code. */ + languageCode?: string; + /** Filter by SourceSid. */ + sourceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TranscriptContext { + media: MediaListInstance; + operatorResults: OperatorResultListInstance; + sentences: SentenceListInstance; + /** + * Remove a TranscriptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TranscriptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptInstance + */ + fetch(callback?: (error: Error | null, item?: TranscriptInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TranscriptContextSolution { + sid: string; +} +export declare class TranscriptContextImpl implements TranscriptContext { + protected _version: V2; + protected _solution: TranscriptContextSolution; + protected _uri: string; + protected _media?: MediaListInstance; + protected _operatorResults?: OperatorResultListInstance; + protected _sentences?: SentenceListInstance; + constructor(_version: V2, sid: string); + get media(): MediaListInstance; + get operatorResults(): OperatorResultListInstance; + get sentences(): SentenceListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TranscriptInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TranscriptContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TranscriptPayload extends TwilioResponsePayload { + transcripts: TranscriptResource[]; +} +interface TranscriptResource { + account_sid: string; + service_sid: string; + sid: string; + date_created: Date; + date_updated: Date; + status: TranscriptStatus; + channel: any; + data_logging: boolean; + language_code: string; + customer_key: string; + media_start_time: Date; + duration: number; + url: string; + redaction: boolean; + links: Record; +} +export declare class TranscriptInstance { + protected _version: V2; + protected _solution: TranscriptContextSolution; + protected _context?: TranscriptContext; + constructor(_version: V2, payload: TranscriptResource, sid?: string); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Service. + */ + serviceSid: string; + /** + * A 34 character string that uniquely identifies this Transcript. + */ + sid: string; + /** + * The date that this Transcript was created, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that this Transcript was updated, given in ISO 8601 format. + */ + dateUpdated: Date; + status: TranscriptStatus; + /** + * Media Channel describing Transcript Source and Participant Mapping + */ + channel: any; + /** + * Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + */ + dataLogging: boolean; + /** + * The default language code of the audio. + */ + languageCode: string; + customerKey: string; + /** + * The date that this Transcript\'s media was started, given in ISO 8601 format. + */ + mediaStartTime: Date; + /** + * The duration of this Transcript\'s source + */ + duration: number; + /** + * The URL of this resource. + */ + url: string; + /** + * If the transcript has been redacted, a redacted alternative of the transcript will be available. + */ + redaction: boolean; + links: Record; + private get _proxy(); + /** + * Remove a TranscriptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TranscriptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptInstance + */ + fetch(callback?: (error: Error | null, item?: TranscriptInstance) => any): Promise; + /** + * Access the media. + */ + media(): MediaListInstance; + /** + * Access the operatorResults. + */ + operatorResults(): OperatorResultListInstance; + /** + * Access the sentences. + */ + sentences(): SentenceListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + sid: string; + dateCreated: Date; + dateUpdated: Date; + status: TranscriptStatus; + channel: any; + dataLogging: boolean; + languageCode: string; + customerKey: string; + mediaStartTime: Date; + duration: number; + url: string; + redaction: boolean; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TranscriptSolution { +} +export interface TranscriptListInstance { + _version: V2; + _solution: TranscriptSolution; + _uri: string; + (sid: string): TranscriptContext; + get(sid: string): TranscriptContext; + /** + * Create a TranscriptInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptInstance + */ + create(params: TranscriptListInstanceCreateOptions, callback?: (error: Error | null, item?: TranscriptInstance) => any): Promise; + /** + * Streams TranscriptInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TranscriptInstance, done: (err?: Error) => void) => void): void; + each(params: TranscriptListInstanceEachOptions, callback?: (item: TranscriptInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TranscriptInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TranscriptPage) => any): Promise; + /** + * Lists TranscriptInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TranscriptInstance[]) => any): Promise; + list(params: TranscriptListInstanceOptions, callback?: (error: Error | null, items: TranscriptInstance[]) => any): Promise; + /** + * Retrieve a single page of TranscriptInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TranscriptListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TranscriptPage) => any): Promise; + page(params: TranscriptListInstancePageOptions, callback?: (error: Error | null, items: TranscriptPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TranscriptListInstance(version: V2): TranscriptListInstance; +export declare class TranscriptPage extends Page { + /** + * Initialize the TranscriptPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: TranscriptSolution); + /** + * Build an instance of TranscriptInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TranscriptResource): TranscriptInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/transcript.js b/node_modules/twilio/lib/rest/intelligence/v2/transcript.js new file mode 100644 index 00000000..72464701 --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/transcript.js @@ -0,0 +1,301 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Intelligence + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TranscriptPage = exports.TranscriptListInstance = exports.TranscriptInstance = exports.TranscriptContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const media_1 = require("./transcript/media"); +const operatorResult_1 = require("./transcript/operatorResult"); +const sentence_1 = require("./transcript/sentence"); +class TranscriptContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Transcripts/${sid}`; + } + get media() { + this._media = + this._media || (0, media_1.MediaListInstance)(this._version, this._solution.sid); + return this._media; + } + get operatorResults() { + this._operatorResults = + this._operatorResults || + (0, operatorResult_1.OperatorResultListInstance)(this._version, this._solution.sid); + return this._operatorResults; + } + get sentences() { + this._sentences = + this._sentences || + (0, sentence_1.SentenceListInstance)(this._version, this._solution.sid); + return this._sentences; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TranscriptInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptContextImpl = TranscriptContextImpl; +class TranscriptInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.sid = payload.sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.status = payload.status; + this.channel = payload.channel; + this.dataLogging = payload.data_logging; + this.languageCode = payload.language_code; + this.customerKey = payload.customer_key; + this.mediaStartTime = deserialize.iso8601DateTime(payload.media_start_time); + this.duration = deserialize.integer(payload.duration); + this.url = payload.url; + this.redaction = payload.redaction; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TranscriptContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a TranscriptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TranscriptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TranscriptInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the media. + */ + media() { + return this._proxy.media; + } + /** + * Access the operatorResults. + */ + operatorResults() { + return this._proxy.operatorResults; + } + /** + * Access the sentences. + */ + sentences() { + return this._proxy.sentences; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + sid: this.sid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + status: this.status, + channel: this.channel, + dataLogging: this.dataLogging, + languageCode: this.languageCode, + customerKey: this.customerKey, + mediaStartTime: this.mediaStartTime, + duration: this.duration, + url: this.url, + redaction: this.redaction, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptInstance = TranscriptInstance; +function TranscriptListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TranscriptContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Transcripts`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["serviceSid"] === null || params["serviceSid"] === undefined) { + throw new Error("Required parameter \"params['serviceSid']\" missing."); + } + if (params["channel"] === null || params["channel"] === undefined) { + throw new Error("Required parameter \"params['channel']\" missing."); + } + let data = {}; + data["ServiceSid"] = params["serviceSid"]; + data["Channel"] = serialize.object(params["channel"]); + if (params["customerKey"] !== undefined) + data["CustomerKey"] = params["customerKey"]; + if (params["mediaStartTime"] !== undefined) + data["MediaStartTime"] = serialize.iso8601DateTime(params["mediaStartTime"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TranscriptInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["serviceSid"] !== undefined) + data["ServiceSid"] = params["serviceSid"]; + if (params["beforeStartTime"] !== undefined) + data["BeforeStartTime"] = params["beforeStartTime"]; + if (params["afterStartTime"] !== undefined) + data["AfterStartTime"] = params["afterStartTime"]; + if (params["beforeDateCreated"] !== undefined) + data["BeforeDateCreated"] = params["beforeDateCreated"]; + if (params["afterDateCreated"] !== undefined) + data["AfterDateCreated"] = params["afterDateCreated"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["languageCode"] !== undefined) + data["LanguageCode"] = params["languageCode"]; + if (params["sourceSid"] !== undefined) + data["SourceSid"] = params["sourceSid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TranscriptPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TranscriptPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TranscriptListInstance = TranscriptListInstance; +class TranscriptPage extends Page_1.default { + /** + * Initialize the TranscriptPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TranscriptInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TranscriptInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TranscriptPage = TranscriptPage; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/transcript/media.d.ts b/node_modules/twilio/lib/rest/intelligence/v2/transcript/media.d.ts new file mode 100644 index 00000000..2f7fda6c --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/transcript/media.d.ts @@ -0,0 +1,132 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../V2"; +/** + * Options to pass to fetch a MediaInstance + */ +export interface MediaContextFetchOptions { + /** Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. */ + redacted?: boolean; +} +export interface MediaContext { + /** + * Fetch a MediaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaInstance + */ + fetch(callback?: (error: Error | null, item?: MediaInstance) => any): Promise; + /** + * Fetch a MediaInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaInstance + */ + fetch(params: MediaContextFetchOptions, callback?: (error: Error | null, item?: MediaInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MediaContextSolution { + sid: string; +} +export declare class MediaContextImpl implements MediaContext { + protected _version: V2; + protected _solution: MediaContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + fetch(params?: MediaContextFetchOptions | ((error: Error | null, item?: MediaInstance) => any), callback?: (error: Error | null, item?: MediaInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MediaContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MediaResource { + account_sid: string; + media_url: string; + service_sid: string; + sid: string; + url: string; +} +export declare class MediaInstance { + protected _version: V2; + protected _solution: MediaContextSolution; + protected _context?: MediaContext; + constructor(_version: V2, payload: MediaResource, sid: string); + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * Downloadable URL for media, if stored in Twilio AI. + */ + mediaUrl: string; + /** + * The unique SID identifier of the Service. + */ + serviceSid: string; + /** + * The unique SID identifier of the Transcript. + */ + sid: string; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a MediaInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaInstance + */ + fetch(callback?: (error: Error | null, item?: MediaInstance) => any): Promise; + /** + * Fetch a MediaInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaInstance + */ + fetch(params: MediaContextFetchOptions, callback?: (error: Error | null, item?: MediaInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + mediaUrl: string; + serviceSid: string; + sid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MediaSolution { + sid: string; +} +export interface MediaListInstance { + _version: V2; + _solution: MediaSolution; + _uri: string; + (): MediaContext; + get(): MediaContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MediaListInstance(version: V2, sid: string): MediaListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/transcript/media.js b/node_modules/twilio/lib/rest/intelligence/v2/transcript/media.js new file mode 100644 index 00000000..f3ef2b40 --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/transcript/media.js @@ -0,0 +1,122 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Intelligence + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MediaListInstance = exports.MediaInstance = exports.MediaContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class MediaContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Transcripts/${sid}/Media`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["redacted"] !== undefined) + data["Redacted"] = serialize.bool(params["redacted"]); + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MediaInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaContextImpl = MediaContextImpl; +class MediaInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.mediaUrl = payload.media_url; + this.serviceSid = payload.service_sid; + this.sid = payload.sid; + this.url = payload.url; + this._solution = { sid }; + } + get _proxy() { + this._context = + this._context || new MediaContextImpl(this._version, this._solution.sid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + mediaUrl: this.mediaUrl, + serviceSid: this.serviceSid, + sid: this.sid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaInstance = MediaInstance; +function MediaListInstance(version, sid) { + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new MediaContextImpl(version, sid); + }; + instance._version = version; + instance._solution = { sid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MediaListInstance = MediaListInstance; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/transcript/operatorResult.d.ts b/node_modules/twilio/lib/rest/intelligence/v2/transcript/operatorResult.d.ts new file mode 100644 index 00000000..aaefbc95 --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/transcript/operatorResult.d.ts @@ -0,0 +1,302 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type OperatorResultOperatorType = "conversation_classify" | "utterance_classify" | "extract" | "extract_normalize" | "pii_extract"; +/** + * Options to pass to fetch a OperatorResultInstance + */ +export interface OperatorResultContextFetchOptions { + /** Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. */ + redacted?: boolean; +} +/** + * Options to pass to each + */ +export interface OperatorResultListInstanceEachOptions { + /** Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. */ + redacted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: OperatorResultInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface OperatorResultListInstanceOptions { + /** Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. */ + redacted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface OperatorResultListInstancePageOptions { + /** Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. */ + redacted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface OperatorResultContext { + /** + * Fetch a OperatorResultInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OperatorResultInstance + */ + fetch(callback?: (error: Error | null, item?: OperatorResultInstance) => any): Promise; + /** + * Fetch a OperatorResultInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OperatorResultInstance + */ + fetch(params: OperatorResultContextFetchOptions, callback?: (error: Error | null, item?: OperatorResultInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface OperatorResultContextSolution { + transcriptSid: string; + operatorSid: string; +} +export declare class OperatorResultContextImpl implements OperatorResultContext { + protected _version: V2; + protected _solution: OperatorResultContextSolution; + protected _uri: string; + constructor(_version: V2, transcriptSid: string, operatorSid: string); + fetch(params?: OperatorResultContextFetchOptions | ((error: Error | null, item?: OperatorResultInstance) => any), callback?: (error: Error | null, item?: OperatorResultInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): OperatorResultContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface OperatorResultPayload extends TwilioResponsePayload { + operator_results: OperatorResultResource[]; +} +interface OperatorResultResource { + operator_type: OperatorResultOperatorType; + name: string; + operator_sid: string; + extract_match: boolean; + match_probability: number; + normalized_result: string; + utterance_results: Array; + utterance_match: boolean; + predicted_label: string; + predicted_probability: number; + label_probabilities: any; + extract_results: any; + text_generation_results: any; + transcript_sid: string; + url: string; +} +export declare class OperatorResultInstance { + protected _version: V2; + protected _solution: OperatorResultContextSolution; + protected _context?: OperatorResultContext; + constructor(_version: V2, payload: OperatorResultResource, transcriptSid: string, operatorSid?: string); + operatorType: OperatorResultOperatorType; + /** + * The name of the applied Language Understanding. + */ + name: string; + /** + * A 34 character string that identifies this Language Understanding operator sid. + */ + operatorSid: string; + /** + * Boolean to tell if extract Language Understanding Processing model matches results. + */ + extractMatch: boolean; + /** + * Percentage of \'matching\' class needed to consider a sentence matches + */ + matchProbability: number; + /** + * Normalized output of extraction stage which matches Label. + */ + normalizedResult: string; + /** + * List of mapped utterance object which matches sentences. + */ + utteranceResults: Array; + /** + * Boolean to tell if Utterance matches results. + */ + utteranceMatch: boolean; + /** + * The \'matching\' class. This might be available on conversation classify model outputs. + */ + predictedLabel: string; + /** + * Percentage of \'matching\' class needed to consider a sentence matches. + */ + predictedProbability: number; + /** + * The labels probabilities. This might be available on conversation classify model outputs. + */ + labelProbabilities: any; + /** + * List of text extraction results. This might be available on classify-extract model outputs. + */ + extractResults: any; + /** + * Output of a text generation operator for example Conversation Sumamary. + */ + textGenerationResults: any; + /** + * A 34 character string that uniquely identifies this Transcript. + */ + transcriptSid: string; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a OperatorResultInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OperatorResultInstance + */ + fetch(callback?: (error: Error | null, item?: OperatorResultInstance) => any): Promise; + /** + * Fetch a OperatorResultInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OperatorResultInstance + */ + fetch(params: OperatorResultContextFetchOptions, callback?: (error: Error | null, item?: OperatorResultInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + operatorType: OperatorResultOperatorType; + name: string; + operatorSid: string; + extractMatch: boolean; + matchProbability: number; + normalizedResult: string; + utteranceResults: any[]; + utteranceMatch: boolean; + predictedLabel: string; + predictedProbability: number; + labelProbabilities: any; + extractResults: any; + textGenerationResults: any; + transcriptSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface OperatorResultSolution { + transcriptSid: string; +} +export interface OperatorResultListInstance { + _version: V2; + _solution: OperatorResultSolution; + _uri: string; + (operatorSid: string): OperatorResultContext; + get(operatorSid: string): OperatorResultContext; + /** + * Streams OperatorResultInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OperatorResultListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: OperatorResultInstance, done: (err?: Error) => void) => void): void; + each(params: OperatorResultListInstanceEachOptions, callback?: (item: OperatorResultInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of OperatorResultInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: OperatorResultPage) => any): Promise; + /** + * Lists OperatorResultInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OperatorResultListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: OperatorResultInstance[]) => any): Promise; + list(params: OperatorResultListInstanceOptions, callback?: (error: Error | null, items: OperatorResultInstance[]) => any): Promise; + /** + * Retrieve a single page of OperatorResultInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OperatorResultListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: OperatorResultPage) => any): Promise; + page(params: OperatorResultListInstancePageOptions, callback?: (error: Error | null, items: OperatorResultPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function OperatorResultListInstance(version: V2, transcriptSid: string): OperatorResultListInstance; +export declare class OperatorResultPage extends Page { + /** + * Initialize the OperatorResultPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: OperatorResultSolution); + /** + * Build an instance of OperatorResultInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: OperatorResultResource): OperatorResultInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/transcript/operatorResult.js b/node_modules/twilio/lib/rest/intelligence/v2/transcript/operatorResult.js new file mode 100644 index 00000000..646c7352 --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/transcript/operatorResult.js @@ -0,0 +1,216 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Intelligence + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OperatorResultPage = exports.OperatorResultListInstance = exports.OperatorResultInstance = exports.OperatorResultContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class OperatorResultContextImpl { + constructor(_version, transcriptSid, operatorSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(transcriptSid)) { + throw new Error("Parameter 'transcriptSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(operatorSid)) { + throw new Error("Parameter 'operatorSid' is not valid."); + } + this._solution = { transcriptSid, operatorSid }; + this._uri = `/Transcripts/${transcriptSid}/OperatorResults/${operatorSid}`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["redacted"] !== undefined) + data["Redacted"] = serialize.bool(params["redacted"]); + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new OperatorResultInstance(operationVersion, payload, instance._solution.transcriptSid, instance._solution.operatorSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OperatorResultContextImpl = OperatorResultContextImpl; +class OperatorResultInstance { + constructor(_version, payload, transcriptSid, operatorSid) { + this._version = _version; + this.operatorType = payload.operator_type; + this.name = payload.name; + this.operatorSid = payload.operator_sid; + this.extractMatch = payload.extract_match; + this.matchProbability = payload.match_probability; + this.normalizedResult = payload.normalized_result; + this.utteranceResults = payload.utterance_results; + this.utteranceMatch = payload.utterance_match; + this.predictedLabel = payload.predicted_label; + this.predictedProbability = payload.predicted_probability; + this.labelProbabilities = payload.label_probabilities; + this.extractResults = payload.extract_results; + this.textGenerationResults = payload.text_generation_results; + this.transcriptSid = payload.transcript_sid; + this.url = payload.url; + this._solution = { + transcriptSid, + operatorSid: operatorSid || this.operatorSid, + }; + } + get _proxy() { + this._context = + this._context || + new OperatorResultContextImpl(this._version, this._solution.transcriptSid, this._solution.operatorSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + operatorType: this.operatorType, + name: this.name, + operatorSid: this.operatorSid, + extractMatch: this.extractMatch, + matchProbability: this.matchProbability, + normalizedResult: this.normalizedResult, + utteranceResults: this.utteranceResults, + utteranceMatch: this.utteranceMatch, + predictedLabel: this.predictedLabel, + predictedProbability: this.predictedProbability, + labelProbabilities: this.labelProbabilities, + extractResults: this.extractResults, + textGenerationResults: this.textGenerationResults, + transcriptSid: this.transcriptSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OperatorResultInstance = OperatorResultInstance; +function OperatorResultListInstance(version, transcriptSid) { + if (!(0, utility_1.isValidPathParam)(transcriptSid)) { + throw new Error("Parameter 'transcriptSid' is not valid."); + } + const instance = ((operatorSid) => instance.get(operatorSid)); + instance.get = function get(operatorSid) { + return new OperatorResultContextImpl(version, transcriptSid, operatorSid); + }; + instance._version = version; + instance._solution = { transcriptSid }; + instance._uri = `/Transcripts/${transcriptSid}/OperatorResults`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["redacted"] !== undefined) + data["Redacted"] = serialize.bool(params["redacted"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new OperatorResultPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new OperatorResultPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.OperatorResultListInstance = OperatorResultListInstance; +class OperatorResultPage extends Page_1.default { + /** + * Initialize the OperatorResultPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of OperatorResultInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new OperatorResultInstance(this._version, payload, this._solution.transcriptSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OperatorResultPage = OperatorResultPage; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/transcript/sentence.d.ts b/node_modules/twilio/lib/rest/intelligence/v2/transcript/sentence.d.ts new file mode 100644 index 00000000..224e189f --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/transcript/sentence.d.ts @@ -0,0 +1,182 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +/** + * Options to pass to each + */ +export interface SentenceListInstanceEachOptions { + /** Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. */ + redacted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SentenceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SentenceListInstanceOptions { + /** Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. */ + redacted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SentenceListInstancePageOptions { + /** Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. */ + redacted?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SentenceSolution { + transcriptSid: string; +} +export interface SentenceListInstance { + _version: V2; + _solution: SentenceSolution; + _uri: string; + /** + * Streams SentenceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SentenceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SentenceInstance, done: (err?: Error) => void) => void): void; + each(params: SentenceListInstanceEachOptions, callback?: (item: SentenceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SentenceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SentencePage) => any): Promise; + /** + * Lists SentenceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SentenceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SentenceInstance[]) => any): Promise; + list(params: SentenceListInstanceOptions, callback?: (error: Error | null, items: SentenceInstance[]) => any): Promise; + /** + * Retrieve a single page of SentenceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SentenceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SentencePage) => any): Promise; + page(params: SentenceListInstancePageOptions, callback?: (error: Error | null, items: SentencePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SentenceListInstance(version: V2, transcriptSid: string): SentenceListInstance; +interface SentencePayload extends TwilioResponsePayload { + sentences: SentenceResource[]; +} +interface SentenceResource { + media_channel: number; + sentence_index: number; + start_time: number; + end_time: number; + transcript: string; + sid: string; + confidence: number; +} +export declare class SentenceInstance { + protected _version: V2; + constructor(_version: V2, payload: SentenceResource, transcriptSid: string); + /** + * The channel number. + */ + mediaChannel: number; + /** + * The index of the sentence in the transcript. + */ + sentenceIndex: number; + /** + * Offset from the beginning of the transcript when this sentence starts. + */ + startTime: number; + /** + * Offset from the beginning of the transcript when this sentence ends. + */ + endTime: number; + /** + * Transcript text. + */ + transcript: string; + /** + * A 34 character string that uniquely identifies this Sentence. + */ + sid: string; + confidence: number; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + mediaChannel: number; + sentenceIndex: number; + startTime: number; + endTime: number; + transcript: string; + sid: string; + confidence: number; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class SentencePage extends Page { + /** + * Initialize the SentencePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: SentenceSolution); + /** + * Build an instance of SentenceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SentenceResource): SentenceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/intelligence/v2/transcript/sentence.js b/node_modules/twilio/lib/rest/intelligence/v2/transcript/sentence.js new file mode 100644 index 00000000..5df8ff41 --- /dev/null +++ b/node_modules/twilio/lib/rest/intelligence/v2/transcript/sentence.js @@ -0,0 +1,136 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Intelligence + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SentencePage = exports.SentenceInstance = exports.SentenceListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function SentenceListInstance(version, transcriptSid) { + if (!(0, utility_1.isValidPathParam)(transcriptSid)) { + throw new Error("Parameter 'transcriptSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { transcriptSid }; + instance._uri = `/Transcripts/${transcriptSid}/Sentences`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["redacted"] !== undefined) + data["Redacted"] = serialize.bool(params["redacted"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SentencePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SentencePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SentenceListInstance = SentenceListInstance; +class SentenceInstance { + constructor(_version, payload, transcriptSid) { + this._version = _version; + this.mediaChannel = deserialize.integer(payload.media_channel); + this.sentenceIndex = deserialize.integer(payload.sentence_index); + this.startTime = payload.start_time; + this.endTime = payload.end_time; + this.transcript = payload.transcript; + this.sid = payload.sid; + this.confidence = payload.confidence; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + mediaChannel: this.mediaChannel, + sentenceIndex: this.sentenceIndex, + startTime: this.startTime, + endTime: this.endTime, + transcript: this.transcript, + sid: this.sid, + confidence: this.confidence, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SentenceInstance = SentenceInstance; +class SentencePage extends Page_1.default { + /** + * Initialize the SentencePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SentenceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SentenceInstance(this._version, payload, this._solution.transcriptSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SentencePage = SentencePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/V1.d.ts b/node_modules/twilio/lib/rest/ipMessaging/V1.d.ts new file mode 100644 index 00000000..d13c2836 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/V1.d.ts @@ -0,0 +1,20 @@ +import IpMessagingBase from "../IpMessagingBase"; +import Version from "../../base/Version"; +import { CredentialListInstance } from "./v1/credential"; +import { ServiceListInstance } from "./v1/service"; +export default class V1 extends Version { + /** + * Initialize the V1 version of IpMessaging + * + * @param domain - The Twilio (Twilio.IpMessaging) domain + */ + constructor(domain: IpMessagingBase); + /** credentials - { Twilio.IpMessaging.V1.CredentialListInstance } resource */ + protected _credentials?: CredentialListInstance; + /** services - { Twilio.IpMessaging.V1.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for credentials resource */ + get credentials(): CredentialListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/ipMessaging/V1.js b/node_modules/twilio/lib/rest/ipMessaging/V1.js new file mode 100644 index 00000000..d8d4e8ec --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/V1.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const credential_1 = require("./v1/credential"); +const service_1 = require("./v1/service"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of IpMessaging + * + * @param domain - The Twilio (Twilio.IpMessaging) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for credentials resource */ + get credentials() { + this._credentials = this._credentials || (0, credential_1.CredentialListInstance)(this); + return this._credentials; + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/ipMessaging/V2.d.ts b/node_modules/twilio/lib/rest/ipMessaging/V2.d.ts new file mode 100644 index 00000000..0e920842 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/V2.d.ts @@ -0,0 +1,20 @@ +import IpMessagingBase from "../IpMessagingBase"; +import Version from "../../base/Version"; +import { CredentialListInstance } from "./v2/credential"; +import { ServiceListInstance } from "./v2/service"; +export default class V2 extends Version { + /** + * Initialize the V2 version of IpMessaging + * + * @param domain - The Twilio (Twilio.IpMessaging) domain + */ + constructor(domain: IpMessagingBase); + /** credentials - { Twilio.IpMessaging.V2.CredentialListInstance } resource */ + protected _credentials?: CredentialListInstance; + /** services - { Twilio.IpMessaging.V2.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for credentials resource */ + get credentials(): CredentialListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/ipMessaging/V2.js b/node_modules/twilio/lib/rest/ipMessaging/V2.js new file mode 100644 index 00000000..0816f8af --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/V2.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const credential_1 = require("./v2/credential"); +const service_1 = require("./v2/service"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of IpMessaging + * + * @param domain - The Twilio (Twilio.IpMessaging) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for credentials resource */ + get credentials() { + this._credentials = this._credentials || (0, credential_1.CredentialListInstance)(this); + return this._credentials; + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/credential.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/credential.d.ts new file mode 100644 index 00000000..48147e2a --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/credential.d.ts @@ -0,0 +1,303 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type CredentialPushService = "gcm" | "apn" | "fcm"; +/** + * Options to pass to update a CredentialInstance + */ +export interface CredentialContextUpdateOptions { + /** */ + friendlyName?: string; + /** */ + certificate?: string; + /** */ + privateKey?: string; + /** */ + sandbox?: boolean; + /** */ + apiKey?: string; + /** */ + secret?: string; +} +/** + * Options to pass to create a CredentialInstance + */ +export interface CredentialListInstanceCreateOptions { + /** */ + type: CredentialPushService; + /** */ + friendlyName?: string; + /** */ + certificate?: string; + /** */ + privateKey?: string; + /** */ + sandbox?: boolean; + /** */ + apiKey?: string; + /** */ + secret?: string; +} +/** + * Options to pass to each + */ +export interface CredentialListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialContext { + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialContextSolution { + sid: string; +} +export declare class CredentialContextImpl implements CredentialContext { + protected _version: V1; + protected _solution: CredentialContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + update(params?: CredentialContextUpdateOptions | ((error: Error | null, item?: CredentialInstance) => any), callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialPayload extends TwilioResponsePayload { + credentials: CredentialResource[]; +} +interface CredentialResource { + sid: string; + account_sid: string; + friendly_name: string; + type: CredentialPushService; + sandbox: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CredentialInstance { + protected _version: V1; + protected _solution: CredentialContextSolution; + protected _context?: CredentialContext; + constructor(_version: V1, payload: CredentialResource, sid?: string); + sid: string; + accountSid: string; + friendlyName: string; + type: CredentialPushService; + sandbox: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + private get _proxy(); + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + type: CredentialPushService; + sandbox: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialSolution { +} +export interface CredentialListInstance { + _version: V1; + _solution: CredentialSolution; + _uri: string; + (sid: string): CredentialContext; + get(sid: string): CredentialContext; + /** + * Create a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + create(params: CredentialListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Streams CredentialInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListInstanceEachOptions, callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Lists CredentialInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + list(params: CredentialListInstanceOptions, callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialPage) => any): Promise; + page(params: CredentialListInstancePageOptions, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListInstance(version: V1): CredentialListInstance; +export declare class CredentialPage extends Page { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CredentialSolution); + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialResource): CredentialInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/credential.js b/node_modules/twilio/lib/rest/ipMessaging/v1/credential.js new file mode 100644 index 00000000..463a636c --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/credential.js @@ -0,0 +1,274 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialPage = exports.CredentialListInstance = exports.CredentialInstance = exports.CredentialContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CredentialContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Credentials/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialContextImpl = CredentialContextImpl; +class CredentialInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.sandbox = payload.sandbox; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + type: this.type, + sandbox: this.sandbox, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialInstance = CredentialInstance; +function CredentialListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListInstance = CredentialListInstance; +class CredentialPage extends Page_1.default { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialPage = CredentialPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/service.d.ts new file mode 100644 index 00000000..809aa3d6 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service.d.ts @@ -0,0 +1,449 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { ChannelListInstance } from "./service/channel"; +import { RoleListInstance } from "./service/role"; +import { UserListInstance } from "./service/user"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** */ + friendlyName?: string; + /** */ + defaultServiceRoleSid?: string; + /** */ + defaultChannelRoleSid?: string; + /** */ + defaultChannelCreatorRoleSid?: string; + /** */ + readStatusEnabled?: boolean; + /** */ + reachabilityEnabled?: boolean; + /** */ + typingIndicatorTimeout?: number; + /** */ + consumptionReportInterval?: number; + /** */ + "notifications.newMessage.enabled"?: boolean; + /** */ + "notifications.newMessage.template"?: string; + /** */ + "notifications.addedToChannel.enabled"?: boolean; + /** */ + "notifications.addedToChannel.template"?: string; + /** */ + "notifications.removedFromChannel.enabled"?: boolean; + /** */ + "notifications.removedFromChannel.template"?: string; + /** */ + "notifications.invitedToChannel.enabled"?: boolean; + /** */ + "notifications.invitedToChannel.template"?: string; + /** */ + preWebhookUrl?: string; + /** */ + postWebhookUrl?: string; + /** */ + webhookMethod?: string; + /** */ + webhookFilters?: Array; + /** */ + "webhooks.onMessageSend.url"?: string; + /** */ + "webhooks.onMessageSend.method"?: string; + /** */ + "webhooks.onMessageUpdate.url"?: string; + /** */ + "webhooks.onMessageUpdate.method"?: string; + /** */ + "webhooks.onMessageRemove.url"?: string; + /** */ + "webhooks.onMessageRemove.method"?: string; + /** */ + "webhooks.onChannelAdd.url"?: string; + /** */ + "webhooks.onChannelAdd.method"?: string; + /** */ + "webhooks.onChannelDestroy.url"?: string; + /** */ + "webhooks.onChannelDestroy.method"?: string; + /** */ + "webhooks.onChannelUpdate.url"?: string; + /** */ + "webhooks.onChannelUpdate.method"?: string; + /** */ + "webhooks.onMemberAdd.url"?: string; + /** */ + "webhooks.onMemberAdd.method"?: string; + /** */ + "webhooks.onMemberRemove.url"?: string; + /** */ + "webhooks.onMemberRemove.method"?: string; + /** */ + "webhooks.onMessageSent.url"?: string; + /** */ + "webhooks.onMessageSent.method"?: string; + /** */ + "webhooks.onMessageUpdated.url"?: string; + /** */ + "webhooks.onMessageUpdated.method"?: string; + /** */ + "webhooks.onMessageRemoved.url"?: string; + /** */ + "webhooks.onMessageRemoved.method"?: string; + /** */ + "webhooks.onChannelAdded.url"?: string; + /** */ + "webhooks.onChannelAdded.method"?: string; + /** */ + "webhooks.onChannelDestroyed.url"?: string; + /** */ + "webhooks.onChannelDestroyed.method"?: string; + /** */ + "webhooks.onChannelUpdated.url"?: string; + /** */ + "webhooks.onChannelUpdated.method"?: string; + /** */ + "webhooks.onMemberAdded.url"?: string; + /** */ + "webhooks.onMemberAdded.method"?: string; + /** */ + "webhooks.onMemberRemoved.url"?: string; + /** */ + "webhooks.onMemberRemoved.method"?: string; + /** */ + "limits.channelMembers"?: number; + /** */ + "limits.userChannels"?: number; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + channels: ChannelListInstance; + roles: RoleListInstance; + users: UserListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _channels?: ChannelListInstance; + protected _roles?: RoleListInstance; + protected _users?: UserListInstance; + constructor(_version: V1, sid: string); + get channels(): ChannelListInstance; + get roles(): RoleListInstance; + get users(): UserListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + default_service_role_sid: string; + default_channel_role_sid: string; + default_channel_creator_role_sid: string; + read_status_enabled: boolean; + reachability_enabled: boolean; + typing_indicator_timeout: number; + consumption_report_interval: number; + limits: any; + webhooks: any; + pre_webhook_url: string; + post_webhook_url: string; + webhook_method: string; + webhook_filters: Array; + notifications: any; + url: string; + links: Record; +} +export declare class ServiceInstance { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V1, payload: ServiceResource, sid?: string); + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + defaultServiceRoleSid: string; + defaultChannelRoleSid: string; + defaultChannelCreatorRoleSid: string; + readStatusEnabled: boolean; + reachabilityEnabled: boolean; + typingIndicatorTimeout: number; + consumptionReportInterval: number; + limits: any; + webhooks: any; + preWebhookUrl: string; + postWebhookUrl: string; + webhookMethod: string; + webhookFilters: Array; + notifications: any; + url: string; + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the channels. + */ + channels(): ChannelListInstance; + /** + * Access the roles. + */ + roles(): RoleListInstance; + /** + * Access the users. + */ + users(): UserListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + defaultServiceRoleSid: string; + defaultChannelRoleSid: string; + defaultChannelCreatorRoleSid: string; + readStatusEnabled: boolean; + reachabilityEnabled: boolean; + typingIndicatorTimeout: number; + consumptionReportInterval: number; + limits: any; + webhooks: any; + preWebhookUrl: string; + postWebhookUrl: string; + webhookMethod: string; + webhookFilters: string[]; + notifications: any; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V1; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V1): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service.js b/node_modules/twilio/lib/rest/ipMessaging/v1/service.js new file mode 100644 index 00000000..1491ec6a --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service.js @@ -0,0 +1,454 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const channel_1 = require("./service/channel"); +const role_1 = require("./service/role"); +const user_1 = require("./service/user"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get channels() { + this._channels = + this._channels || (0, channel_1.ChannelListInstance)(this._version, this._solution.sid); + return this._channels; + } + get roles() { + this._roles = + this._roles || (0, role_1.RoleListInstance)(this._version, this._solution.sid); + return this._roles; + } + get users() { + this._users = + this._users || (0, user_1.UserListInstance)(this._version, this._solution.sid); + return this._users; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["defaultServiceRoleSid"] !== undefined) + data["DefaultServiceRoleSid"] = params["defaultServiceRoleSid"]; + if (params["defaultChannelRoleSid"] !== undefined) + data["DefaultChannelRoleSid"] = params["defaultChannelRoleSid"]; + if (params["defaultChannelCreatorRoleSid"] !== undefined) + data["DefaultChannelCreatorRoleSid"] = + params["defaultChannelCreatorRoleSid"]; + if (params["readStatusEnabled"] !== undefined) + data["ReadStatusEnabled"] = serialize.bool(params["readStatusEnabled"]); + if (params["reachabilityEnabled"] !== undefined) + data["ReachabilityEnabled"] = serialize.bool(params["reachabilityEnabled"]); + if (params["typingIndicatorTimeout"] !== undefined) + data["TypingIndicatorTimeout"] = params["typingIndicatorTimeout"]; + if (params["consumptionReportInterval"] !== undefined) + data["ConsumptionReportInterval"] = params["consumptionReportInterval"]; + if (params["notifications.newMessage.enabled"] !== undefined) + data["Notifications.NewMessage.Enabled"] = serialize.bool(params["notifications.newMessage.enabled"]); + if (params["notifications.newMessage.template"] !== undefined) + data["Notifications.NewMessage.Template"] = + params["notifications.newMessage.template"]; + if (params["notifications.addedToChannel.enabled"] !== undefined) + data["Notifications.AddedToChannel.Enabled"] = serialize.bool(params["notifications.addedToChannel.enabled"]); + if (params["notifications.addedToChannel.template"] !== undefined) + data["Notifications.AddedToChannel.Template"] = + params["notifications.addedToChannel.template"]; + if (params["notifications.removedFromChannel.enabled"] !== undefined) + data["Notifications.RemovedFromChannel.Enabled"] = serialize.bool(params["notifications.removedFromChannel.enabled"]); + if (params["notifications.removedFromChannel.template"] !== undefined) + data["Notifications.RemovedFromChannel.Template"] = + params["notifications.removedFromChannel.template"]; + if (params["notifications.invitedToChannel.enabled"] !== undefined) + data["Notifications.InvitedToChannel.Enabled"] = serialize.bool(params["notifications.invitedToChannel.enabled"]); + if (params["notifications.invitedToChannel.template"] !== undefined) + data["Notifications.InvitedToChannel.Template"] = + params["notifications.invitedToChannel.template"]; + if (params["preWebhookUrl"] !== undefined) + data["PreWebhookUrl"] = params["preWebhookUrl"]; + if (params["postWebhookUrl"] !== undefined) + data["PostWebhookUrl"] = params["postWebhookUrl"]; + if (params["webhookMethod"] !== undefined) + data["WebhookMethod"] = params["webhookMethod"]; + if (params["webhookFilters"] !== undefined) + data["WebhookFilters"] = serialize.map(params["webhookFilters"], (e) => e); + if (params["webhooks.onMessageSend.url"] !== undefined) + data["Webhooks.OnMessageSend.Url"] = params["webhooks.onMessageSend.url"]; + if (params["webhooks.onMessageSend.method"] !== undefined) + data["Webhooks.OnMessageSend.Method"] = + params["webhooks.onMessageSend.method"]; + if (params["webhooks.onMessageUpdate.url"] !== undefined) + data["Webhooks.OnMessageUpdate.Url"] = + params["webhooks.onMessageUpdate.url"]; + if (params["webhooks.onMessageUpdate.method"] !== undefined) + data["Webhooks.OnMessageUpdate.Method"] = + params["webhooks.onMessageUpdate.method"]; + if (params["webhooks.onMessageRemove.url"] !== undefined) + data["Webhooks.OnMessageRemove.Url"] = + params["webhooks.onMessageRemove.url"]; + if (params["webhooks.onMessageRemove.method"] !== undefined) + data["Webhooks.OnMessageRemove.Method"] = + params["webhooks.onMessageRemove.method"]; + if (params["webhooks.onChannelAdd.url"] !== undefined) + data["Webhooks.OnChannelAdd.Url"] = params["webhooks.onChannelAdd.url"]; + if (params["webhooks.onChannelAdd.method"] !== undefined) + data["Webhooks.OnChannelAdd.Method"] = + params["webhooks.onChannelAdd.method"]; + if (params["webhooks.onChannelDestroy.url"] !== undefined) + data["Webhooks.OnChannelDestroy.Url"] = + params["webhooks.onChannelDestroy.url"]; + if (params["webhooks.onChannelDestroy.method"] !== undefined) + data["Webhooks.OnChannelDestroy.Method"] = + params["webhooks.onChannelDestroy.method"]; + if (params["webhooks.onChannelUpdate.url"] !== undefined) + data["Webhooks.OnChannelUpdate.Url"] = + params["webhooks.onChannelUpdate.url"]; + if (params["webhooks.onChannelUpdate.method"] !== undefined) + data["Webhooks.OnChannelUpdate.Method"] = + params["webhooks.onChannelUpdate.method"]; + if (params["webhooks.onMemberAdd.url"] !== undefined) + data["Webhooks.OnMemberAdd.Url"] = params["webhooks.onMemberAdd.url"]; + if (params["webhooks.onMemberAdd.method"] !== undefined) + data["Webhooks.OnMemberAdd.Method"] = + params["webhooks.onMemberAdd.method"]; + if (params["webhooks.onMemberRemove.url"] !== undefined) + data["Webhooks.OnMemberRemove.Url"] = + params["webhooks.onMemberRemove.url"]; + if (params["webhooks.onMemberRemove.method"] !== undefined) + data["Webhooks.OnMemberRemove.Method"] = + params["webhooks.onMemberRemove.method"]; + if (params["webhooks.onMessageSent.url"] !== undefined) + data["Webhooks.OnMessageSent.Url"] = params["webhooks.onMessageSent.url"]; + if (params["webhooks.onMessageSent.method"] !== undefined) + data["Webhooks.OnMessageSent.Method"] = + params["webhooks.onMessageSent.method"]; + if (params["webhooks.onMessageUpdated.url"] !== undefined) + data["Webhooks.OnMessageUpdated.Url"] = + params["webhooks.onMessageUpdated.url"]; + if (params["webhooks.onMessageUpdated.method"] !== undefined) + data["Webhooks.OnMessageUpdated.Method"] = + params["webhooks.onMessageUpdated.method"]; + if (params["webhooks.onMessageRemoved.url"] !== undefined) + data["Webhooks.OnMessageRemoved.Url"] = + params["webhooks.onMessageRemoved.url"]; + if (params["webhooks.onMessageRemoved.method"] !== undefined) + data["Webhooks.OnMessageRemoved.Method"] = + params["webhooks.onMessageRemoved.method"]; + if (params["webhooks.onChannelAdded.url"] !== undefined) + data["Webhooks.OnChannelAdded.Url"] = + params["webhooks.onChannelAdded.url"]; + if (params["webhooks.onChannelAdded.method"] !== undefined) + data["Webhooks.OnChannelAdded.Method"] = + params["webhooks.onChannelAdded.method"]; + if (params["webhooks.onChannelDestroyed.url"] !== undefined) + data["Webhooks.OnChannelDestroyed.Url"] = + params["webhooks.onChannelDestroyed.url"]; + if (params["webhooks.onChannelDestroyed.method"] !== undefined) + data["Webhooks.OnChannelDestroyed.Method"] = + params["webhooks.onChannelDestroyed.method"]; + if (params["webhooks.onChannelUpdated.url"] !== undefined) + data["Webhooks.OnChannelUpdated.Url"] = + params["webhooks.onChannelUpdated.url"]; + if (params["webhooks.onChannelUpdated.method"] !== undefined) + data["Webhooks.OnChannelUpdated.Method"] = + params["webhooks.onChannelUpdated.method"]; + if (params["webhooks.onMemberAdded.url"] !== undefined) + data["Webhooks.OnMemberAdded.Url"] = params["webhooks.onMemberAdded.url"]; + if (params["webhooks.onMemberAdded.method"] !== undefined) + data["Webhooks.OnMemberAdded.Method"] = + params["webhooks.onMemberAdded.method"]; + if (params["webhooks.onMemberRemoved.url"] !== undefined) + data["Webhooks.OnMemberRemoved.Url"] = + params["webhooks.onMemberRemoved.url"]; + if (params["webhooks.onMemberRemoved.method"] !== undefined) + data["Webhooks.OnMemberRemoved.Method"] = + params["webhooks.onMemberRemoved.method"]; + if (params["limits.channelMembers"] !== undefined) + data["Limits.ChannelMembers"] = params["limits.channelMembers"]; + if (params["limits.userChannels"] !== undefined) + data["Limits.UserChannels"] = params["limits.userChannels"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.defaultServiceRoleSid = payload.default_service_role_sid; + this.defaultChannelRoleSid = payload.default_channel_role_sid; + this.defaultChannelCreatorRoleSid = + payload.default_channel_creator_role_sid; + this.readStatusEnabled = payload.read_status_enabled; + this.reachabilityEnabled = payload.reachability_enabled; + this.typingIndicatorTimeout = deserialize.integer(payload.typing_indicator_timeout); + this.consumptionReportInterval = deserialize.integer(payload.consumption_report_interval); + this.limits = payload.limits; + this.webhooks = payload.webhooks; + this.preWebhookUrl = payload.pre_webhook_url; + this.postWebhookUrl = payload.post_webhook_url; + this.webhookMethod = payload.webhook_method; + this.webhookFilters = payload.webhook_filters; + this.notifications = payload.notifications; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the channels. + */ + channels() { + return this._proxy.channels; + } + /** + * Access the roles. + */ + roles() { + return this._proxy.roles; + } + /** + * Access the users. + */ + users() { + return this._proxy.users; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + defaultServiceRoleSid: this.defaultServiceRoleSid, + defaultChannelRoleSid: this.defaultChannelRoleSid, + defaultChannelCreatorRoleSid: this.defaultChannelCreatorRoleSid, + readStatusEnabled: this.readStatusEnabled, + reachabilityEnabled: this.reachabilityEnabled, + typingIndicatorTimeout: this.typingIndicatorTimeout, + consumptionReportInterval: this.consumptionReportInterval, + limits: this.limits, + webhooks: this.webhooks, + preWebhookUrl: this.preWebhookUrl, + postWebhookUrl: this.postWebhookUrl, + webhookMethod: this.webhookMethod, + webhookFilters: this.webhookFilters, + notifications: this.notifications, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel.d.ts new file mode 100644 index 00000000..fbacd676 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel.d.ts @@ -0,0 +1,349 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { InviteListInstance } from "./channel/invite"; +import { MemberListInstance } from "./channel/member"; +import { MessageListInstance } from "./channel/message"; +export type ChannelChannelType = "public" | "private"; +/** + * Options to pass to update a ChannelInstance + */ +export interface ChannelContextUpdateOptions { + /** */ + friendlyName?: string; + /** */ + uniqueName?: string; + /** */ + attributes?: string; +} +/** + * Options to pass to create a ChannelInstance + */ +export interface ChannelListInstanceCreateOptions { + /** */ + friendlyName?: string; + /** */ + uniqueName?: string; + /** */ + attributes?: string; + /** */ + type?: ChannelChannelType; +} +/** + * Options to pass to each + */ +export interface ChannelListInstanceEachOptions { + /** */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ChannelListInstanceOptions { + /** */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ChannelListInstancePageOptions { + /** */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ChannelContext { + invites: InviteListInstance; + members: MemberListInstance; + messages: MessageListInstance; + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ChannelContextSolution { + serviceSid: string; + sid: string; +} +export declare class ChannelContextImpl implements ChannelContext { + protected _version: V1; + protected _solution: ChannelContextSolution; + protected _uri: string; + protected _invites?: InviteListInstance; + protected _members?: MemberListInstance; + protected _messages?: MessageListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get invites(): InviteListInstance; + get members(): MemberListInstance; + get messages(): MessageListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + update(params?: ChannelContextUpdateOptions | ((error: Error | null, item?: ChannelInstance) => any), callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ChannelPayload extends TwilioResponsePayload { + channels: ChannelResource[]; +} +interface ChannelResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + unique_name: string; + attributes: string; + type: ChannelChannelType; + date_created: Date; + date_updated: Date; + created_by: string; + members_count: number; + messages_count: number; + url: string; + links: Record; +} +export declare class ChannelInstance { + protected _version: V1; + protected _solution: ChannelContextSolution; + protected _context?: ChannelContext; + constructor(_version: V1, payload: ChannelResource, serviceSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + type: ChannelChannelType; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + membersCount: number; + messagesCount: number; + url: string; + links: Record; + private get _proxy(); + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Access the invites. + */ + invites(): InviteListInstance; + /** + * Access the members. + */ + members(): MemberListInstance; + /** + * Access the messages. + */ + messages(): MessageListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + type: ChannelChannelType; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + membersCount: number; + messagesCount: number; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ChannelSolution { + serviceSid: string; +} +export interface ChannelListInstance { + _version: V1; + _solution: ChannelSolution; + _uri: string; + (sid: string): ChannelContext; + get(sid: string): ChannelContext; + /** + * Create a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Create a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(params: ChannelListInstanceCreateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Streams ChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + each(params: ChannelListInstanceEachOptions, callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Lists ChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + list(params: ChannelListInstanceOptions, callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ChannelPage) => any): Promise; + page(params: ChannelListInstancePageOptions, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ChannelListInstance(version: V1, serviceSid: string): ChannelListInstance; +export declare class ChannelPage extends Page { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ChannelSolution); + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ChannelResource): ChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel.js b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel.js new file mode 100644 index 00000000..79b94eb9 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel.js @@ -0,0 +1,323 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChannelPage = exports.ChannelListInstance = exports.ChannelInstance = exports.ChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const invite_1 = require("./channel/invite"); +const member_1 = require("./channel/member"); +const message_1 = require("./channel/message"); +class ChannelContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${sid}`; + } + get invites() { + this._invites = + this._invites || + (0, invite_1.InviteListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._invites; + } + get members() { + this._members = + this._members || + (0, member_1.MemberListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._members; + } + get messages() { + this._messages = + this._messages || + (0, message_1.MessageListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._messages; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelContextImpl = ChannelContextImpl; +class ChannelInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.attributes = payload.attributes; + this.type = payload.type; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this.membersCount = deserialize.integer(payload.members_count); + this.messagesCount = deserialize.integer(payload.messages_count); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ChannelContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the invites. + */ + invites() { + return this._proxy.invites; + } + /** + * Access the members. + */ + members() { + return this._proxy.members; + } + /** + * Access the messages. + */ + messages() { + return this._proxy.messages; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + attributes: this.attributes, + type: this.type, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + membersCount: this.membersCount, + messagesCount: this.messagesCount, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelInstance = ChannelInstance; +function ChannelListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ChannelContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Channels`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["type"] !== undefined) + data["Type"] = params["type"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["type"] !== undefined) + data["Type"] = serialize.map(params["type"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ChannelListInstance = ChannelListInstance; +class ChannelPage extends Page_1.default { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ChannelInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelPage = ChannelPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/invite.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/invite.d.ts new file mode 100644 index 00000000..1cb3f4ea --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/invite.d.ts @@ -0,0 +1,256 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to create a InviteInstance + */ +export interface InviteListInstanceCreateOptions { + /** */ + identity: string; + /** */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface InviteListInstanceEachOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InviteInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InviteListInstanceOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InviteListInstancePageOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InviteContext { + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InviteContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class InviteContextImpl implements InviteContext { + protected _version: V1; + protected _solution: InviteContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InviteContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InvitePayload extends TwilioResponsePayload { + invites: InviteResource[]; +} +interface InviteResource { + sid: string; + account_sid: string; + channel_sid: string; + service_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + role_sid: string; + created_by: string; + url: string; +} +export declare class InviteInstance { + protected _version: V1; + protected _solution: InviteContextSolution; + protected _context?: InviteContext; + constructor(_version: V1, payload: InviteResource, serviceSid: string, channelSid: string, sid?: string); + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + createdBy: string; + url: string; + private get _proxy(); + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + createdBy: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InviteSolution { + serviceSid: string; + channelSid: string; +} +export interface InviteListInstance { + _version: V1; + _solution: InviteSolution; + _uri: string; + (sid: string): InviteContext; + get(sid: string): InviteContext; + /** + * Create a InviteInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + create(params: InviteListInstanceCreateOptions, callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Streams InviteInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InviteInstance, done: (err?: Error) => void) => void): void; + each(params: InviteListInstanceEachOptions, callback?: (item: InviteInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InviteInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InvitePage) => any): Promise; + /** + * Lists InviteInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InviteInstance[]) => any): Promise; + list(params: InviteListInstanceOptions, callback?: (error: Error | null, items: InviteInstance[]) => any): Promise; + /** + * Retrieve a single page of InviteInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InvitePage) => any): Promise; + page(params: InviteListInstancePageOptions, callback?: (error: Error | null, items: InvitePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InviteListInstance(version: V1, serviceSid: string, channelSid: string): InviteListInstance; +export declare class InvitePage extends Page { + /** + * Initialize the InvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InviteSolution); + /** + * Build an instance of InviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InviteResource): InviteInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/invite.js b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/invite.js new file mode 100644 index 00000000..d47f953f --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/invite.js @@ -0,0 +1,245 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvitePage = exports.InviteListInstance = exports.InviteInstance = exports.InviteContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class InviteContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Invites/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InviteInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InviteContextImpl = InviteContextImpl; +class InviteInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.channelSid = payload.channel_sid; + this.serviceSid = payload.service_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.roleSid = payload.role_sid; + this.createdBy = payload.created_by; + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InviteContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + channelSid: this.channelSid, + serviceSid: this.serviceSid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + roleSid: this.roleSid, + createdBy: this.createdBy, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InviteInstance = InviteInstance; +function InviteListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InviteContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Invites`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InviteInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InvitePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InvitePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InviteListInstance = InviteListInstance; +class InvitePage extends Page_1.default { + /** + * Initialize the InvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InviteInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InvitePage = InvitePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/member.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/member.d.ts new file mode 100644 index 00000000..ef4aee63 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/member.d.ts @@ -0,0 +1,303 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to update a MemberInstance + */ +export interface MemberContextUpdateOptions { + /** */ + roleSid?: string; + /** */ + lastConsumedMessageIndex?: number; +} +/** + * Options to pass to create a MemberInstance + */ +export interface MemberListInstanceCreateOptions { + /** */ + identity: string; + /** */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface MemberListInstanceEachOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MemberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MemberListInstanceOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MemberListInstancePageOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MemberContext { + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MemberContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class MemberContextImpl implements MemberContext { + protected _version: V1; + protected _solution: MemberContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + update(params?: MemberContextUpdateOptions | ((error: Error | null, item?: MemberInstance) => any), callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MemberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MemberPayload extends TwilioResponsePayload { + members: MemberResource[]; +} +interface MemberResource { + sid: string; + account_sid: string; + channel_sid: string; + service_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + role_sid: string; + last_consumed_message_index: number; + last_consumption_timestamp: Date; + url: string; +} +export declare class MemberInstance { + protected _version: V1; + protected _solution: MemberContextSolution; + protected _context?: MemberContext; + constructor(_version: V1, payload: MemberResource, serviceSid: string, channelSid: string, sid?: string); + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + lastConsumedMessageIndex: number; + lastConsumptionTimestamp: Date; + url: string; + private get _proxy(); + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + lastConsumedMessageIndex: number; + lastConsumptionTimestamp: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MemberSolution { + serviceSid: string; + channelSid: string; +} +export interface MemberListInstance { + _version: V1; + _solution: MemberSolution; + _uri: string; + (sid: string): MemberContext; + get(sid: string): MemberContext; + /** + * Create a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + create(params: MemberListInstanceCreateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Streams MemberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + each(params: MemberListInstanceEachOptions, callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Lists MemberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + list(params: MemberListInstanceOptions, callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + /** + * Retrieve a single page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MemberPage) => any): Promise; + page(params: MemberListInstancePageOptions, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MemberListInstance(version: V1, serviceSid: string, channelSid: string): MemberListInstance; +export declare class MemberPage extends Page { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MemberSolution); + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MemberResource): MemberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/member.js b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/member.js new file mode 100644 index 00000000..60dc72c3 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/member.js @@ -0,0 +1,276 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MemberPage = exports.MemberListInstance = exports.MemberInstance = exports.MemberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MemberContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Members/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["lastConsumedMessageIndex"] !== undefined) + data["LastConsumedMessageIndex"] = params["lastConsumedMessageIndex"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberContextImpl = MemberContextImpl; +class MemberInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.channelSid = payload.channel_sid; + this.serviceSid = payload.service_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.roleSid = payload.role_sid; + this.lastConsumedMessageIndex = deserialize.integer(payload.last_consumed_message_index); + this.lastConsumptionTimestamp = deserialize.iso8601DateTime(payload.last_consumption_timestamp); + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MemberContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + channelSid: this.channelSid, + serviceSid: this.serviceSid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + roleSid: this.roleSid, + lastConsumedMessageIndex: this.lastConsumedMessageIndex, + lastConsumptionTimestamp: this.lastConsumptionTimestamp, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberInstance = MemberInstance; +function MemberListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MemberContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Members`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MemberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MemberListInstance = MemberListInstance; +class MemberPage extends Page_1.default { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MemberInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberPage = MemberPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/message.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/message.d.ts new file mode 100644 index 00000000..da5e70e6 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/message.d.ts @@ -0,0 +1,312 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type MessageOrderType = "asc" | "desc"; +/** + * Options to pass to update a MessageInstance + */ +export interface MessageContextUpdateOptions { + /** */ + body?: string; + /** */ + attributes?: string; +} +/** + * Options to pass to create a MessageInstance + */ +export interface MessageListInstanceCreateOptions { + /** */ + body: string; + /** */ + from?: string; + /** */ + attributes?: string; +} +/** + * Options to pass to each + */ +export interface MessageListInstanceEachOptions { + /** */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessageInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessageListInstanceOptions { + /** */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessageListInstancePageOptions { + /** */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessageContext { + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessageContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class MessageContextImpl implements MessageContext { + protected _version: V1; + protected _solution: MessageContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + update(params?: MessageContextUpdateOptions | ((error: Error | null, item?: MessageInstance) => any), callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessageContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessagePayload extends TwilioResponsePayload { + messages: MessageResource[]; +} +interface MessageResource { + sid: string; + account_sid: string; + attributes: string; + service_sid: string; + to: string; + channel_sid: string; + date_created: Date; + date_updated: Date; + was_edited: boolean; + from: string; + body: string; + index: number; + url: string; +} +export declare class MessageInstance { + protected _version: V1; + protected _solution: MessageContextSolution; + protected _context?: MessageContext; + constructor(_version: V1, payload: MessageResource, serviceSid: string, channelSid: string, sid?: string); + sid: string; + accountSid: string; + attributes: string; + serviceSid: string; + to: string; + channelSid: string; + dateCreated: Date; + dateUpdated: Date; + wasEdited: boolean; + from: string; + body: string; + index: number; + url: string; + private get _proxy(); + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + attributes: string; + serviceSid: string; + to: string; + channelSid: string; + dateCreated: Date; + dateUpdated: Date; + wasEdited: boolean; + from: string; + body: string; + index: number; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessageSolution { + serviceSid: string; + channelSid: string; +} +export interface MessageListInstance { + _version: V1; + _solution: MessageSolution; + _uri: string; + (sid: string): MessageContext; + get(sid: string): MessageContext; + /** + * Create a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(params: MessageListInstanceCreateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Streams MessageInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + each(params: MessageListInstanceEachOptions, callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Lists MessageInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + list(params: MessageListInstanceOptions, callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + /** + * Retrieve a single page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessagePage) => any): Promise; + page(params: MessageListInstancePageOptions, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessageListInstance(version: V1, serviceSid: string, channelSid: string): MessageListInstance; +export declare class MessagePage extends Page { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MessageSolution); + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessageResource): MessageInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/message.js b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/message.js new file mode 100644 index 00000000..85e375c3 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/channel/message.js @@ -0,0 +1,282 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagePage = exports.MessageListInstance = exports.MessageInstance = exports.MessageContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MessageContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Messages/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageContextImpl = MessageContextImpl; +class MessageInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.attributes = payload.attributes; + this.serviceSid = payload.service_sid; + this.to = payload.to; + this.channelSid = payload.channel_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.wasEdited = payload.was_edited; + this.from = payload.from; + this.body = payload.body; + this.index = deserialize.integer(payload.index); + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MessageContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + attributes: this.attributes, + serviceSid: this.serviceSid, + to: this.to, + channelSid: this.channelSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + wasEdited: this.wasEdited, + from: this.from, + body: this.body, + index: this.index, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInstance = MessageInstance; +function MessageListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MessageContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Messages`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["body"] === null || params["body"] === undefined) { + throw new Error("Required parameter \"params['body']\" missing."); + } + let data = {}; + data["Body"] = params["body"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessagePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessageListInstance = MessageListInstance; +class MessagePage extends Page_1.default { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessageInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagePage = MessagePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/role.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/service/role.d.ts new file mode 100644 index 00000000..64ae07df --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/role.d.ts @@ -0,0 +1,274 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type RoleRoleType = "channel" | "deployment"; +/** + * Options to pass to update a RoleInstance + */ +export interface RoleContextUpdateOptions { + /** */ + permission: Array; +} +/** + * Options to pass to create a RoleInstance + */ +export interface RoleListInstanceCreateOptions { + /** */ + friendlyName: string; + /** */ + type: RoleRoleType; + /** */ + permission: Array; +} +/** + * Options to pass to each + */ +export interface RoleListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoleInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoleListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoleListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoleContext { + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoleContextSolution { + serviceSid: string; + sid: string; +} +export declare class RoleContextImpl implements RoleContext { + protected _version: V1; + protected _solution: RoleContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoleContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RolePayload extends TwilioResponsePayload { + roles: RoleResource[]; +} +interface RoleResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + type: RoleRoleType; + permissions: Array; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class RoleInstance { + protected _version: V1; + protected _solution: RoleContextSolution; + protected _context?: RoleContext; + constructor(_version: V1, payload: RoleResource, serviceSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + type: RoleRoleType; + permissions: Array; + dateCreated: Date; + dateUpdated: Date; + url: string; + private get _proxy(); + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + type: RoleRoleType; + permissions: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoleSolution { + serviceSid: string; +} +export interface RoleListInstance { + _version: V1; + _solution: RoleSolution; + _uri: string; + (sid: string): RoleContext; + get(sid: string): RoleContext; + /** + * Create a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + create(params: RoleListInstanceCreateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Streams RoleInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + each(params: RoleListInstanceEachOptions, callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Lists RoleInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + list(params: RoleListInstanceOptions, callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + /** + * Retrieve a single page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RolePage) => any): Promise; + page(params: RoleListInstancePageOptions, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoleListInstance(version: V1, serviceSid: string): RoleListInstance; +export declare class RolePage extends Page { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RoleSolution); + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoleResource): RoleInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/role.js b/node_modules/twilio/lib/rest/ipMessaging/v1/service/role.js new file mode 100644 index 00000000..be47e2c1 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/role.js @@ -0,0 +1,267 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RolePage = exports.RoleListInstance = exports.RoleInstance = exports.RoleContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class RoleContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Roles/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleContextImpl = RoleContextImpl; +class RoleInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.permissions = payload.permissions; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RoleContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + type: this.type, + permissions: this.permissions, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleInstance = RoleInstance; +function RoleListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RoleContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Roles`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RolePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RolePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoleListInstance = RoleListInstance; +class RolePage extends Page_1.default { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoleInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RolePage = RolePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/user.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/service/user.d.ts new file mode 100644 index 00000000..61c87b65 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/user.d.ts @@ -0,0 +1,318 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { UserChannelListInstance } from "./user/userChannel"; +/** + * Options to pass to update a UserInstance + */ +export interface UserContextUpdateOptions { + /** */ + roleSid?: string; + /** */ + attributes?: string; + /** */ + friendlyName?: string; +} +/** + * Options to pass to create a UserInstance + */ +export interface UserListInstanceCreateOptions { + /** */ + identity: string; + /** */ + roleSid?: string; + /** */ + attributes?: string; + /** */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface UserListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserContext { + userChannels: UserChannelListInstance; + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserContextSolution { + serviceSid: string; + sid: string; +} +export declare class UserContextImpl implements UserContext { + protected _version: V1; + protected _solution: UserContextSolution; + protected _uri: string; + protected _userChannels?: UserChannelListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get userChannels(): UserChannelListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + update(params?: UserContextUpdateOptions | ((error: Error | null, item?: UserInstance) => any), callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserPayload extends TwilioResponsePayload { + users: UserResource[]; +} +interface UserResource { + sid: string; + account_sid: string; + service_sid: string; + attributes: string; + friendly_name: string; + role_sid: string; + identity: string; + is_online: boolean; + is_notifiable: boolean; + date_created: Date; + date_updated: Date; + joined_channels_count: number; + links: Record; + url: string; +} +export declare class UserInstance { + protected _version: V1; + protected _solution: UserContextSolution; + protected _context?: UserContext; + constructor(_version: V1, payload: UserResource, serviceSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + attributes: string; + friendlyName: string; + roleSid: string; + identity: string; + isOnline: boolean; + isNotifiable: boolean; + dateCreated: Date; + dateUpdated: Date; + joinedChannelsCount: number; + links: Record; + url: string; + private get _proxy(); + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Access the userChannels. + */ + userChannels(): UserChannelListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + attributes: string; + friendlyName: string; + roleSid: string; + identity: string; + isOnline: boolean; + isNotifiable: boolean; + dateCreated: Date; + dateUpdated: Date; + joinedChannelsCount: number; + links: Record; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserSolution { + serviceSid: string; +} +export interface UserListInstance { + _version: V1; + _solution: UserSolution; + _uri: string; + (sid: string): UserContext; + get(sid: string): UserContext; + /** + * Create a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + create(params: UserListInstanceCreateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Streams UserInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + each(params: UserListInstanceEachOptions, callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Lists UserInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + list(params: UserListInstanceOptions, callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + /** + * Retrieve a single page of UserInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserPage) => any): Promise; + page(params: UserListInstancePageOptions, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserListInstance(version: V1, serviceSid: string): UserListInstance; +export declare class UserPage extends Page { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UserSolution); + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserResource): UserInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/user.js b/node_modules/twilio/lib/rest/ipMessaging/v1/service/user.js new file mode 100644 index 00000000..59230b93 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/user.js @@ -0,0 +1,293 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserPage = exports.UserListInstance = exports.UserInstance = exports.UserContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const userChannel_1 = require("./user/userChannel"); +class UserContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Users/${sid}`; + } + get userChannels() { + this._userChannels = + this._userChannels || + (0, userChannel_1.UserChannelListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._userChannels; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserContextImpl = UserContextImpl; +class UserInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.attributes = payload.attributes; + this.friendlyName = payload.friendly_name; + this.roleSid = payload.role_sid; + this.identity = payload.identity; + this.isOnline = payload.is_online; + this.isNotifiable = payload.is_notifiable; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.joinedChannelsCount = deserialize.integer(payload.joined_channels_count); + this.links = payload.links; + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UserContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the userChannels. + */ + userChannels() { + return this._proxy.userChannels; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + attributes: this.attributes, + friendlyName: this.friendlyName, + roleSid: this.roleSid, + identity: this.identity, + isOnline: this.isOnline, + isNotifiable: this.isNotifiable, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + joinedChannelsCount: this.joinedChannelsCount, + links: this.links, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserInstance = UserInstance; +function UserListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Users`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserListInstance = UserListInstance; +class UserPage extends Page_1.default { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserPage = UserPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/user/userChannel.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v1/service/user/userChannel.d.ts new file mode 100644 index 00000000..c03bd314 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/user/userChannel.d.ts @@ -0,0 +1,163 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type UserChannelChannelStatus = "joined" | "invited" | "not_participating"; +/** + * Options to pass to each + */ +export interface UserChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserChannelSolution { + serviceSid: string; + userSid: string; +} +export interface UserChannelListInstance { + _version: V1; + _solution: UserChannelSolution; + _uri: string; + /** + * Streams UserChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + each(params: UserChannelListInstanceEachOptions, callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + /** + * Lists UserChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserChannelInstance[]) => any): Promise; + list(params: UserChannelListInstanceOptions, callback?: (error: Error | null, items: UserChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of UserChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + page(params: UserChannelListInstancePageOptions, callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserChannelListInstance(version: V1, serviceSid: string, userSid: string): UserChannelListInstance; +interface UserChannelPayload extends TwilioResponsePayload { + channels: UserChannelResource[]; +} +interface UserChannelResource { + account_sid: string; + service_sid: string; + channel_sid: string; + member_sid: string; + status: UserChannelChannelStatus; + last_consumed_message_index: number; + unread_messages_count: number; + links: Record; +} +export declare class UserChannelInstance { + protected _version: V1; + constructor(_version: V1, payload: UserChannelResource, serviceSid: string, userSid: string); + accountSid: string; + serviceSid: string; + channelSid: string; + memberSid: string; + status: UserChannelChannelStatus; + lastConsumedMessageIndex: number; + unreadMessagesCount: number; + links: Record; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + channelSid: string; + memberSid: string; + status: UserChannelChannelStatus; + lastConsumedMessageIndex: number; + unreadMessagesCount: number; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class UserChannelPage extends Page { + /** + * Initialize the UserChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UserChannelSolution); + /** + * Build an instance of UserChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserChannelResource): UserChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v1/service/user/userChannel.js b/node_modules/twilio/lib/rest/ipMessaging/v1/service/user/userChannel.js new file mode 100644 index 00000000..73541a8e --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v1/service/user/userChannel.js @@ -0,0 +1,139 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserChannelPage = exports.UserChannelInstance = exports.UserChannelListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function UserChannelListInstance(version, serviceSid, userSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { serviceSid, userSid }; + instance._uri = `/Services/${serviceSid}/Users/${userSid}/Channels`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserChannelListInstance = UserChannelListInstance; +class UserChannelInstance { + constructor(_version, payload, serviceSid, userSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.channelSid = payload.channel_sid; + this.memberSid = payload.member_sid; + this.status = payload.status; + this.lastConsumedMessageIndex = deserialize.integer(payload.last_consumed_message_index); + this.unreadMessagesCount = deserialize.integer(payload.unread_messages_count); + this.links = payload.links; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + channelSid: this.channelSid, + memberSid: this.memberSid, + status: this.status, + lastConsumedMessageIndex: this.lastConsumedMessageIndex, + unreadMessagesCount: this.unreadMessagesCount, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelInstance = UserChannelInstance; +class UserChannelPage extends Page_1.default { + /** + * Initialize the UserChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserChannelInstance(this._version, payload, this._solution.serviceSid, this._solution.userSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelPage = UserChannelPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/credential.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/credential.d.ts new file mode 100644 index 00000000..035f9b11 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/credential.d.ts @@ -0,0 +1,303 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +export type CredentialPushService = "gcm" | "apn" | "fcm"; +/** + * Options to pass to update a CredentialInstance + */ +export interface CredentialContextUpdateOptions { + /** */ + friendlyName?: string; + /** */ + certificate?: string; + /** */ + privateKey?: string; + /** */ + sandbox?: boolean; + /** */ + apiKey?: string; + /** */ + secret?: string; +} +/** + * Options to pass to create a CredentialInstance + */ +export interface CredentialListInstanceCreateOptions { + /** */ + type: CredentialPushService; + /** */ + friendlyName?: string; + /** */ + certificate?: string; + /** */ + privateKey?: string; + /** */ + sandbox?: boolean; + /** */ + apiKey?: string; + /** */ + secret?: string; +} +/** + * Options to pass to each + */ +export interface CredentialListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialContext { + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialContextSolution { + sid: string; +} +export declare class CredentialContextImpl implements CredentialContext { + protected _version: V2; + protected _solution: CredentialContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + update(params?: CredentialContextUpdateOptions | ((error: Error | null, item?: CredentialInstance) => any), callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialPayload extends TwilioResponsePayload { + credentials: CredentialResource[]; +} +interface CredentialResource { + sid: string; + account_sid: string; + friendly_name: string; + type: CredentialPushService; + sandbox: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CredentialInstance { + protected _version: V2; + protected _solution: CredentialContextSolution; + protected _context?: CredentialContext; + constructor(_version: V2, payload: CredentialResource, sid?: string); + sid: string; + accountSid: string; + friendlyName: string; + type: CredentialPushService; + sandbox: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + private get _proxy(); + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + type: CredentialPushService; + sandbox: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialSolution { +} +export interface CredentialListInstance { + _version: V2; + _solution: CredentialSolution; + _uri: string; + (sid: string): CredentialContext; + get(sid: string): CredentialContext; + /** + * Create a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + create(params: CredentialListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Streams CredentialInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListInstanceEachOptions, callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Lists CredentialInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + list(params: CredentialListInstanceOptions, callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialPage) => any): Promise; + page(params: CredentialListInstancePageOptions, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListInstance(version: V2): CredentialListInstance; +export declare class CredentialPage extends Page { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: CredentialSolution); + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialResource): CredentialInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/credential.js b/node_modules/twilio/lib/rest/ipMessaging/v2/credential.js new file mode 100644 index 00000000..463a636c --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/credential.js @@ -0,0 +1,274 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialPage = exports.CredentialListInstance = exports.CredentialInstance = exports.CredentialContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CredentialContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Credentials/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialContextImpl = CredentialContextImpl; +class CredentialInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.sandbox = payload.sandbox; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + type: this.type, + sandbox: this.sandbox, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialInstance = CredentialInstance; +function CredentialListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListInstance = CredentialListInstance; +class CredentialPage extends Page_1.default { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialPage = CredentialPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service.d.ts new file mode 100644 index 00000000..853f6288 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service.d.ts @@ -0,0 +1,417 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +import { BindingListInstance } from "./service/binding"; +import { ChannelListInstance } from "./service/channel"; +import { RoleListInstance } from "./service/role"; +import { UserListInstance } from "./service/user"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** */ + friendlyName?: string; + /** */ + defaultServiceRoleSid?: string; + /** */ + defaultChannelRoleSid?: string; + /** */ + defaultChannelCreatorRoleSid?: string; + /** */ + readStatusEnabled?: boolean; + /** */ + reachabilityEnabled?: boolean; + /** */ + typingIndicatorTimeout?: number; + /** */ + consumptionReportInterval?: number; + /** */ + "notifications.newMessage.enabled"?: boolean; + /** */ + "notifications.newMessage.template"?: string; + /** */ + "notifications.newMessage.sound"?: string; + /** */ + "notifications.newMessage.badgeCountEnabled"?: boolean; + /** */ + "notifications.addedToChannel.enabled"?: boolean; + /** */ + "notifications.addedToChannel.template"?: string; + /** */ + "notifications.addedToChannel.sound"?: string; + /** */ + "notifications.removedFromChannel.enabled"?: boolean; + /** */ + "notifications.removedFromChannel.template"?: string; + /** */ + "notifications.removedFromChannel.sound"?: string; + /** */ + "notifications.invitedToChannel.enabled"?: boolean; + /** */ + "notifications.invitedToChannel.template"?: string; + /** */ + "notifications.invitedToChannel.sound"?: string; + /** */ + preWebhookUrl?: string; + /** */ + postWebhookUrl?: string; + /** */ + webhookMethod?: string; + /** */ + webhookFilters?: Array; + /** */ + "limits.channelMembers"?: number; + /** */ + "limits.userChannels"?: number; + /** */ + "media.compatibilityMessage"?: string; + /** */ + preWebhookRetryCount?: number; + /** */ + postWebhookRetryCount?: number; + /** */ + "notifications.logEnabled"?: boolean; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + bindings: BindingListInstance; + channels: ChannelListInstance; + roles: RoleListInstance; + users: UserListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V2; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _bindings?: BindingListInstance; + protected _channels?: ChannelListInstance; + protected _roles?: RoleListInstance; + protected _users?: UserListInstance; + constructor(_version: V2, sid: string); + get bindings(): BindingListInstance; + get channels(): ChannelListInstance; + get roles(): RoleListInstance; + get users(): UserListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + default_service_role_sid: string; + default_channel_role_sid: string; + default_channel_creator_role_sid: string; + read_status_enabled: boolean; + reachability_enabled: boolean; + typing_indicator_timeout: number; + consumption_report_interval: number; + limits: any; + pre_webhook_url: string; + post_webhook_url: string; + webhook_method: string; + webhook_filters: Array; + pre_webhook_retry_count: number; + post_webhook_retry_count: number; + notifications: any; + media: any; + url: string; + links: Record; +} +export declare class ServiceInstance { + protected _version: V2; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V2, payload: ServiceResource, sid?: string); + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + defaultServiceRoleSid: string; + defaultChannelRoleSid: string; + defaultChannelCreatorRoleSid: string; + readStatusEnabled: boolean; + reachabilityEnabled: boolean; + typingIndicatorTimeout: number; + consumptionReportInterval: number; + limits: any; + preWebhookUrl: string; + postWebhookUrl: string; + webhookMethod: string; + webhookFilters: Array; + preWebhookRetryCount: number; + postWebhookRetryCount: number; + notifications: any; + media: any; + url: string; + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the bindings. + */ + bindings(): BindingListInstance; + /** + * Access the channels. + */ + channels(): ChannelListInstance; + /** + * Access the roles. + */ + roles(): RoleListInstance; + /** + * Access the users. + */ + users(): UserListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + defaultServiceRoleSid: string; + defaultChannelRoleSid: string; + defaultChannelCreatorRoleSid: string; + readStatusEnabled: boolean; + reachabilityEnabled: boolean; + typingIndicatorTimeout: number; + consumptionReportInterval: number; + limits: any; + preWebhookUrl: string; + postWebhookUrl: string; + webhookMethod: string; + webhookFilters: string[]; + preWebhookRetryCount: number; + postWebhookRetryCount: number; + notifications: any; + media: any; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V2; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V2): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service.js new file mode 100644 index 00000000..a4cb52b3 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service.js @@ -0,0 +1,401 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const binding_1 = require("./service/binding"); +const channel_1 = require("./service/channel"); +const role_1 = require("./service/role"); +const user_1 = require("./service/user"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get bindings() { + this._bindings = + this._bindings || (0, binding_1.BindingListInstance)(this._version, this._solution.sid); + return this._bindings; + } + get channels() { + this._channels = + this._channels || (0, channel_1.ChannelListInstance)(this._version, this._solution.sid); + return this._channels; + } + get roles() { + this._roles = + this._roles || (0, role_1.RoleListInstance)(this._version, this._solution.sid); + return this._roles; + } + get users() { + this._users = + this._users || (0, user_1.UserListInstance)(this._version, this._solution.sid); + return this._users; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["defaultServiceRoleSid"] !== undefined) + data["DefaultServiceRoleSid"] = params["defaultServiceRoleSid"]; + if (params["defaultChannelRoleSid"] !== undefined) + data["DefaultChannelRoleSid"] = params["defaultChannelRoleSid"]; + if (params["defaultChannelCreatorRoleSid"] !== undefined) + data["DefaultChannelCreatorRoleSid"] = + params["defaultChannelCreatorRoleSid"]; + if (params["readStatusEnabled"] !== undefined) + data["ReadStatusEnabled"] = serialize.bool(params["readStatusEnabled"]); + if (params["reachabilityEnabled"] !== undefined) + data["ReachabilityEnabled"] = serialize.bool(params["reachabilityEnabled"]); + if (params["typingIndicatorTimeout"] !== undefined) + data["TypingIndicatorTimeout"] = params["typingIndicatorTimeout"]; + if (params["consumptionReportInterval"] !== undefined) + data["ConsumptionReportInterval"] = params["consumptionReportInterval"]; + if (params["notifications.newMessage.enabled"] !== undefined) + data["Notifications.NewMessage.Enabled"] = serialize.bool(params["notifications.newMessage.enabled"]); + if (params["notifications.newMessage.template"] !== undefined) + data["Notifications.NewMessage.Template"] = + params["notifications.newMessage.template"]; + if (params["notifications.newMessage.sound"] !== undefined) + data["Notifications.NewMessage.Sound"] = + params["notifications.newMessage.sound"]; + if (params["notifications.newMessage.badgeCountEnabled"] !== undefined) + data["Notifications.NewMessage.BadgeCountEnabled"] = serialize.bool(params["notifications.newMessage.badgeCountEnabled"]); + if (params["notifications.addedToChannel.enabled"] !== undefined) + data["Notifications.AddedToChannel.Enabled"] = serialize.bool(params["notifications.addedToChannel.enabled"]); + if (params["notifications.addedToChannel.template"] !== undefined) + data["Notifications.AddedToChannel.Template"] = + params["notifications.addedToChannel.template"]; + if (params["notifications.addedToChannel.sound"] !== undefined) + data["Notifications.AddedToChannel.Sound"] = + params["notifications.addedToChannel.sound"]; + if (params["notifications.removedFromChannel.enabled"] !== undefined) + data["Notifications.RemovedFromChannel.Enabled"] = serialize.bool(params["notifications.removedFromChannel.enabled"]); + if (params["notifications.removedFromChannel.template"] !== undefined) + data["Notifications.RemovedFromChannel.Template"] = + params["notifications.removedFromChannel.template"]; + if (params["notifications.removedFromChannel.sound"] !== undefined) + data["Notifications.RemovedFromChannel.Sound"] = + params["notifications.removedFromChannel.sound"]; + if (params["notifications.invitedToChannel.enabled"] !== undefined) + data["Notifications.InvitedToChannel.Enabled"] = serialize.bool(params["notifications.invitedToChannel.enabled"]); + if (params["notifications.invitedToChannel.template"] !== undefined) + data["Notifications.InvitedToChannel.Template"] = + params["notifications.invitedToChannel.template"]; + if (params["notifications.invitedToChannel.sound"] !== undefined) + data["Notifications.InvitedToChannel.Sound"] = + params["notifications.invitedToChannel.sound"]; + if (params["preWebhookUrl"] !== undefined) + data["PreWebhookUrl"] = params["preWebhookUrl"]; + if (params["postWebhookUrl"] !== undefined) + data["PostWebhookUrl"] = params["postWebhookUrl"]; + if (params["webhookMethod"] !== undefined) + data["WebhookMethod"] = params["webhookMethod"]; + if (params["webhookFilters"] !== undefined) + data["WebhookFilters"] = serialize.map(params["webhookFilters"], (e) => e); + if (params["limits.channelMembers"] !== undefined) + data["Limits.ChannelMembers"] = params["limits.channelMembers"]; + if (params["limits.userChannels"] !== undefined) + data["Limits.UserChannels"] = params["limits.userChannels"]; + if (params["media.compatibilityMessage"] !== undefined) + data["Media.CompatibilityMessage"] = params["media.compatibilityMessage"]; + if (params["preWebhookRetryCount"] !== undefined) + data["PreWebhookRetryCount"] = params["preWebhookRetryCount"]; + if (params["postWebhookRetryCount"] !== undefined) + data["PostWebhookRetryCount"] = params["postWebhookRetryCount"]; + if (params["notifications.logEnabled"] !== undefined) + data["Notifications.LogEnabled"] = serialize.bool(params["notifications.logEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.defaultServiceRoleSid = payload.default_service_role_sid; + this.defaultChannelRoleSid = payload.default_channel_role_sid; + this.defaultChannelCreatorRoleSid = + payload.default_channel_creator_role_sid; + this.readStatusEnabled = payload.read_status_enabled; + this.reachabilityEnabled = payload.reachability_enabled; + this.typingIndicatorTimeout = deserialize.integer(payload.typing_indicator_timeout); + this.consumptionReportInterval = deserialize.integer(payload.consumption_report_interval); + this.limits = payload.limits; + this.preWebhookUrl = payload.pre_webhook_url; + this.postWebhookUrl = payload.post_webhook_url; + this.webhookMethod = payload.webhook_method; + this.webhookFilters = payload.webhook_filters; + this.preWebhookRetryCount = deserialize.integer(payload.pre_webhook_retry_count); + this.postWebhookRetryCount = deserialize.integer(payload.post_webhook_retry_count); + this.notifications = payload.notifications; + this.media = payload.media; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the bindings. + */ + bindings() { + return this._proxy.bindings; + } + /** + * Access the channels. + */ + channels() { + return this._proxy.channels; + } + /** + * Access the roles. + */ + roles() { + return this._proxy.roles; + } + /** + * Access the users. + */ + users() { + return this._proxy.users; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + defaultServiceRoleSid: this.defaultServiceRoleSid, + defaultChannelRoleSid: this.defaultChannelRoleSid, + defaultChannelCreatorRoleSid: this.defaultChannelCreatorRoleSid, + readStatusEnabled: this.readStatusEnabled, + reachabilityEnabled: this.reachabilityEnabled, + typingIndicatorTimeout: this.typingIndicatorTimeout, + consumptionReportInterval: this.consumptionReportInterval, + limits: this.limits, + preWebhookUrl: this.preWebhookUrl, + postWebhookUrl: this.postWebhookUrl, + webhookMethod: this.webhookMethod, + webhookFilters: this.webhookFilters, + preWebhookRetryCount: this.preWebhookRetryCount, + postWebhookRetryCount: this.postWebhookRetryCount, + notifications: this.notifications, + media: this.media, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/binding.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/binding.d.ts new file mode 100644 index 00000000..37d99df6 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/binding.d.ts @@ -0,0 +1,249 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type BindingBindingType = "gcm" | "apn" | "fcm"; +/** + * Options to pass to each + */ +export interface BindingListInstanceEachOptions { + /** */ + bindingType?: Array; + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BindingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BindingListInstanceOptions { + /** */ + bindingType?: Array; + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BindingListInstancePageOptions { + /** */ + bindingType?: Array; + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BindingContext { + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BindingContextSolution { + serviceSid: string; + sid: string; +} +export declare class BindingContextImpl implements BindingContext { + protected _version: V2; + protected _solution: BindingContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BindingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BindingPayload extends TwilioResponsePayload { + bindings: BindingResource[]; +} +interface BindingResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + endpoint: string; + identity: string; + credential_sid: string; + binding_type: BindingBindingType; + message_types: Array; + url: string; + links: Record; +} +export declare class BindingInstance { + protected _version: V2; + protected _solution: BindingContextSolution; + protected _context?: BindingContext; + constructor(_version: V2, payload: BindingResource, serviceSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + endpoint: string; + identity: string; + credentialSid: string; + bindingType: BindingBindingType; + messageTypes: Array; + url: string; + links: Record; + private get _proxy(); + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + endpoint: string; + identity: string; + credentialSid: string; + bindingType: BindingBindingType; + messageTypes: string[]; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BindingSolution { + serviceSid: string; +} +export interface BindingListInstance { + _version: V2; + _solution: BindingSolution; + _uri: string; + (sid: string): BindingContext; + get(sid: string): BindingContext; + /** + * Streams BindingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BindingInstance, done: (err?: Error) => void) => void): void; + each(params: BindingListInstanceEachOptions, callback?: (item: BindingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BindingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BindingPage) => any): Promise; + /** + * Lists BindingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BindingInstance[]) => any): Promise; + list(params: BindingListInstanceOptions, callback?: (error: Error | null, items: BindingInstance[]) => any): Promise; + /** + * Retrieve a single page of BindingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BindingPage) => any): Promise; + page(params: BindingListInstancePageOptions, callback?: (error: Error | null, items: BindingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BindingListInstance(version: V2, serviceSid: string): BindingListInstance; +export declare class BindingPage extends Page { + /** + * Initialize the BindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: BindingSolution); + /** + * Build an instance of BindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BindingResource): BindingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/binding.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/binding.js new file mode 100644 index 00000000..d5b2cf44 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/binding.js @@ -0,0 +1,222 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BindingPage = exports.BindingListInstance = exports.BindingInstance = exports.BindingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class BindingContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Bindings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BindingInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingContextImpl = BindingContextImpl; +class BindingInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.endpoint = payload.endpoint; + this.identity = payload.identity; + this.credentialSid = payload.credential_sid; + this.bindingType = payload.binding_type; + this.messageTypes = payload.message_types; + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new BindingContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + endpoint: this.endpoint, + identity: this.identity, + credentialSid: this.credentialSid, + bindingType: this.bindingType, + messageTypes: this.messageTypes, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingInstance = BindingInstance; +function BindingListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new BindingContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Bindings`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["bindingType"] !== undefined) + data["BindingType"] = serialize.map(params["bindingType"], (e) => e); + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BindingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BindingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BindingListInstance = BindingListInstance; +class BindingPage extends Page_1.default { + /** + * Initialize the BindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BindingInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingPage = BindingPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel.d.ts new file mode 100644 index 00000000..8eaa29f7 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel.d.ts @@ -0,0 +1,399 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { InviteListInstance } from "./channel/invite"; +import { MemberListInstance } from "./channel/member"; +import { MessageListInstance } from "./channel/message"; +import { WebhookListInstance } from "./channel/webhook"; +export type ChannelChannelType = "public" | "private"; +export type ChannelWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a ChannelInstance + */ +export interface ChannelContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ChannelWebhookEnabledType; +} +/** + * Options to pass to update a ChannelInstance + */ +export interface ChannelContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ChannelWebhookEnabledType; + /** */ + friendlyName?: string; + /** */ + uniqueName?: string; + /** */ + attributes?: string; + /** */ + dateCreated?: Date; + /** */ + dateUpdated?: Date; + /** */ + createdBy?: string; +} +/** + * Options to pass to create a ChannelInstance + */ +export interface ChannelListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: ChannelWebhookEnabledType; + /** */ + friendlyName?: string; + /** */ + uniqueName?: string; + /** */ + attributes?: string; + /** */ + type?: ChannelChannelType; + /** */ + dateCreated?: Date; + /** */ + dateUpdated?: Date; + /** */ + createdBy?: string; +} +/** + * Options to pass to each + */ +export interface ChannelListInstanceEachOptions { + /** */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ChannelListInstanceOptions { + /** */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ChannelListInstancePageOptions { + /** */ + type?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ChannelContext { + invites: InviteListInstance; + members: MemberListInstance; + messages: MessageListInstance; + webhooks: WebhookListInstance; + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + remove(params: ChannelContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ChannelContextSolution { + serviceSid: string; + sid: string; +} +export declare class ChannelContextImpl implements ChannelContext { + protected _version: V2; + protected _solution: ChannelContextSolution; + protected _uri: string; + protected _invites?: InviteListInstance; + protected _members?: MemberListInstance; + protected _messages?: MessageListInstance; + protected _webhooks?: WebhookListInstance; + constructor(_version: V2, serviceSid: string, sid: string); + get invites(): InviteListInstance; + get members(): MemberListInstance; + get messages(): MessageListInstance; + get webhooks(): WebhookListInstance; + remove(params?: ChannelContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + update(params?: ChannelContextUpdateOptions | ((error: Error | null, item?: ChannelInstance) => any), callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ChannelPayload extends TwilioResponsePayload { + channels: ChannelResource[]; +} +interface ChannelResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + unique_name: string; + attributes: string; + type: ChannelChannelType; + date_created: Date; + date_updated: Date; + created_by: string; + members_count: number; + messages_count: number; + url: string; + links: Record; +} +export declare class ChannelInstance { + protected _version: V2; + protected _solution: ChannelContextSolution; + protected _context?: ChannelContext; + constructor(_version: V2, payload: ChannelResource, serviceSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + type: ChannelChannelType; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + membersCount: number; + messagesCount: number; + url: string; + links: Record; + private get _proxy(); + /** + * Remove a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + remove(params: ChannelContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Update a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + update(params: ChannelContextUpdateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Access the invites. + */ + invites(): InviteListInstance; + /** + * Access the members. + */ + members(): MemberListInstance; + /** + * Access the messages. + */ + messages(): MessageListInstance; + /** + * Access the webhooks. + */ + webhooks(): WebhookListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + uniqueName: string; + attributes: string; + type: ChannelChannelType; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + membersCount: number; + messagesCount: number; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ChannelSolution { + serviceSid: string; +} +export interface ChannelListInstance { + _version: V2; + _solution: ChannelSolution; + _uri: string; + (sid: string): ChannelContext; + get(sid: string): ChannelContext; + /** + * Create a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Create a ChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + create(params: ChannelListInstanceCreateOptions, callback?: (error: Error | null, item?: ChannelInstance) => any): Promise; + /** + * Streams ChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + each(params: ChannelListInstanceEachOptions, callback?: (item: ChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Lists ChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + list(params: ChannelListInstanceOptions, callback?: (error: Error | null, items: ChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of ChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ChannelPage) => any): Promise; + page(params: ChannelListInstancePageOptions, callback?: (error: Error | null, items: ChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ChannelListInstance(version: V2, serviceSid: string): ChannelListInstance; +export declare class ChannelPage extends Page { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ChannelSolution); + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ChannelResource): ChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel.js new file mode 100644 index 00000000..39cc0765 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel.js @@ -0,0 +1,358 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChannelPage = exports.ChannelListInstance = exports.ChannelInstance = exports.ChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const invite_1 = require("./channel/invite"); +const member_1 = require("./channel/member"); +const message_1 = require("./channel/message"); +const webhook_1 = require("./channel/webhook"); +class ChannelContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${sid}`; + } + get invites() { + this._invites = + this._invites || + (0, invite_1.InviteListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._invites; + } + get members() { + this._members = + this._members || + (0, member_1.MemberListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._members; + } + get messages() { + this._messages = + this._messages || + (0, message_1.MessageListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._messages; + } + get webhooks() { + this._webhooks = + this._webhooks || + (0, webhook_1.WebhookListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._webhooks; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["createdBy"] !== undefined) + data["CreatedBy"] = params["createdBy"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelContextImpl = ChannelContextImpl; +class ChannelInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.attributes = payload.attributes; + this.type = payload.type; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this.membersCount = deserialize.integer(payload.members_count); + this.messagesCount = deserialize.integer(payload.messages_count); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ChannelContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a ChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the invites. + */ + invites() { + return this._proxy.invites; + } + /** + * Access the members. + */ + members() { + return this._proxy.members; + } + /** + * Access the messages. + */ + messages() { + return this._proxy.messages; + } + /** + * Access the webhooks. + */ + webhooks() { + return this._proxy.webhooks; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + attributes: this.attributes, + type: this.type, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + membersCount: this.membersCount, + messagesCount: this.messagesCount, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelInstance = ChannelInstance; +function ChannelListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ChannelContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Channels`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["type"] !== undefined) + data["Type"] = params["type"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["createdBy"] !== undefined) + data["CreatedBy"] = params["createdBy"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["type"] !== undefined) + data["Type"] = serialize.map(params["type"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ChannelListInstance = ChannelListInstance; +class ChannelPage extends Page_1.default { + /** + * Initialize the ChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ChannelInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelPage = ChannelPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/invite.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/invite.d.ts new file mode 100644 index 00000000..d9532080 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/invite.d.ts @@ -0,0 +1,256 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +/** + * Options to pass to create a InviteInstance + */ +export interface InviteListInstanceCreateOptions { + /** */ + identity: string; + /** */ + roleSid?: string; +} +/** + * Options to pass to each + */ +export interface InviteListInstanceEachOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InviteInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InviteListInstanceOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InviteListInstancePageOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InviteContext { + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InviteContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class InviteContextImpl implements InviteContext { + protected _version: V2; + protected _solution: InviteContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InviteContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InvitePayload extends TwilioResponsePayload { + invites: InviteResource[]; +} +interface InviteResource { + sid: string; + account_sid: string; + channel_sid: string; + service_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + role_sid: string; + created_by: string; + url: string; +} +export declare class InviteInstance { + protected _version: V2; + protected _solution: InviteContextSolution; + protected _context?: InviteContext; + constructor(_version: V2, payload: InviteResource, serviceSid: string, channelSid: string, sid?: string); + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + createdBy: string; + url: string; + private get _proxy(); + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + createdBy: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InviteSolution { + serviceSid: string; + channelSid: string; +} +export interface InviteListInstance { + _version: V2; + _solution: InviteSolution; + _uri: string; + (sid: string): InviteContext; + get(sid: string): InviteContext; + /** + * Create a InviteInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + create(params: InviteListInstanceCreateOptions, callback?: (error: Error | null, item?: InviteInstance) => any): Promise; + /** + * Streams InviteInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InviteInstance, done: (err?: Error) => void) => void): void; + each(params: InviteListInstanceEachOptions, callback?: (item: InviteInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InviteInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InvitePage) => any): Promise; + /** + * Lists InviteInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InviteInstance[]) => any): Promise; + list(params: InviteListInstanceOptions, callback?: (error: Error | null, items: InviteInstance[]) => any): Promise; + /** + * Retrieve a single page of InviteInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InviteListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InvitePage) => any): Promise; + page(params: InviteListInstancePageOptions, callback?: (error: Error | null, items: InvitePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InviteListInstance(version: V2, serviceSid: string, channelSid: string): InviteListInstance; +export declare class InvitePage extends Page { + /** + * Initialize the InvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: InviteSolution); + /** + * Build an instance of InviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InviteResource): InviteInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/invite.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/invite.js new file mode 100644 index 00000000..d47f953f --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/invite.js @@ -0,0 +1,245 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvitePage = exports.InviteListInstance = exports.InviteInstance = exports.InviteContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class InviteContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Invites/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InviteInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InviteContextImpl = InviteContextImpl; +class InviteInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.channelSid = payload.channel_sid; + this.serviceSid = payload.service_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.roleSid = payload.role_sid; + this.createdBy = payload.created_by; + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InviteContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a InviteInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InviteInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + channelSid: this.channelSid, + serviceSid: this.serviceSid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + roleSid: this.roleSid, + createdBy: this.createdBy, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InviteInstance = InviteInstance; +function InviteListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InviteContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Invites`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InviteInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InvitePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InvitePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InviteListInstance = InviteListInstance; +class InvitePage extends Page_1.default { + /** + * Initialize the InvitePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InviteInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InviteInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InvitePage = InvitePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/member.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/member.d.ts new file mode 100644 index 00000000..b0e228fc --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/member.d.ts @@ -0,0 +1,354 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type MemberWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a MemberInstance + */ +export interface MemberContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MemberWebhookEnabledType; +} +/** + * Options to pass to update a MemberInstance + */ +export interface MemberContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MemberWebhookEnabledType; + /** */ + roleSid?: string; + /** */ + lastConsumedMessageIndex?: number; + /** */ + lastConsumptionTimestamp?: Date; + /** */ + dateCreated?: Date; + /** */ + dateUpdated?: Date; + /** */ + attributes?: string; +} +/** + * Options to pass to create a MemberInstance + */ +export interface MemberListInstanceCreateOptions { + /** */ + identity: string; + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MemberWebhookEnabledType; + /** */ + roleSid?: string; + /** */ + lastConsumedMessageIndex?: number; + /** */ + lastConsumptionTimestamp?: Date; + /** */ + dateCreated?: Date; + /** */ + dateUpdated?: Date; + /** */ + attributes?: string; +} +/** + * Options to pass to each + */ +export interface MemberListInstanceEachOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MemberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MemberListInstanceOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MemberListInstancePageOptions { + /** */ + identity?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MemberContext { + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + remove(params: MemberContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MemberContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class MemberContextImpl implements MemberContext { + protected _version: V2; + protected _solution: MemberContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, channelSid: string, sid: string); + remove(params?: MemberContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + update(params?: MemberContextUpdateOptions | ((error: Error | null, item?: MemberInstance) => any), callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MemberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MemberPayload extends TwilioResponsePayload { + members: MemberResource[]; +} +interface MemberResource { + sid: string; + account_sid: string; + channel_sid: string; + service_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + role_sid: string; + last_consumed_message_index: number; + last_consumption_timestamp: Date; + url: string; + attributes: string; +} +export declare class MemberInstance { + protected _version: V2; + protected _solution: MemberContextSolution; + protected _context?: MemberContext; + constructor(_version: V2, payload: MemberResource, serviceSid: string, channelSid: string, sid?: string); + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + lastConsumedMessageIndex: number; + lastConsumptionTimestamp: Date; + url: string; + attributes: string; + private get _proxy(); + /** + * Remove a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + remove(params: MemberContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Update a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + update(params: MemberContextUpdateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + channelSid: string; + serviceSid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + roleSid: string; + lastConsumedMessageIndex: number; + lastConsumptionTimestamp: Date; + url: string; + attributes: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MemberSolution { + serviceSid: string; + channelSid: string; +} +export interface MemberListInstance { + _version: V2; + _solution: MemberSolution; + _uri: string; + (sid: string): MemberContext; + get(sid: string): MemberContext; + /** + * Create a MemberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + create(params: MemberListInstanceCreateOptions, callback?: (error: Error | null, item?: MemberInstance) => any): Promise; + /** + * Streams MemberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + each(params: MemberListInstanceEachOptions, callback?: (item: MemberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Lists MemberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + list(params: MemberListInstanceOptions, callback?: (error: Error | null, items: MemberInstance[]) => any): Promise; + /** + * Retrieve a single page of MemberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MemberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MemberPage) => any): Promise; + page(params: MemberListInstancePageOptions, callback?: (error: Error | null, items: MemberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MemberListInstance(version: V2, serviceSid: string, channelSid: string): MemberListInstance; +export declare class MemberPage extends Page { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: MemberSolution); + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MemberResource): MemberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/member.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/member.js new file mode 100644 index 00000000..799d68f6 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/member.js @@ -0,0 +1,306 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MemberPage = exports.MemberListInstance = exports.MemberInstance = exports.MemberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MemberContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Members/${sid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["lastConsumedMessageIndex"] !== undefined) + data["LastConsumedMessageIndex"] = params["lastConsumedMessageIndex"]; + if (params["lastConsumptionTimestamp"] !== undefined) + data["LastConsumptionTimestamp"] = serialize.iso8601DateTime(params["lastConsumptionTimestamp"]); + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberContextImpl = MemberContextImpl; +class MemberInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.channelSid = payload.channel_sid; + this.serviceSid = payload.service_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.roleSid = payload.role_sid; + this.lastConsumedMessageIndex = deserialize.integer(payload.last_consumed_message_index); + this.lastConsumptionTimestamp = deserialize.iso8601DateTime(payload.last_consumption_timestamp); + this.url = payload.url; + this.attributes = payload.attributes; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MemberContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a MemberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MemberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + channelSid: this.channelSid, + serviceSid: this.serviceSid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + roleSid: this.roleSid, + lastConsumedMessageIndex: this.lastConsumedMessageIndex, + lastConsumptionTimestamp: this.lastConsumptionTimestamp, + url: this.url, + attributes: this.attributes, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberInstance = MemberInstance; +function MemberListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MemberContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Members`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["lastConsumedMessageIndex"] !== undefined) + data["LastConsumedMessageIndex"] = params["lastConsumedMessageIndex"]; + if (params["lastConsumptionTimestamp"] !== undefined) + data["LastConsumptionTimestamp"] = serialize.iso8601DateTime(params["lastConsumptionTimestamp"]); + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MemberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MemberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MemberListInstance = MemberListInstance; +class MemberPage extends Page_1.default { + /** + * Initialize the MemberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MemberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MemberInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MemberPage = MemberPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/message.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/message.d.ts new file mode 100644 index 00000000..5b3bdd1a --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/message.d.ts @@ -0,0 +1,375 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type MessageOrderType = "asc" | "desc"; +export type MessageWebhookEnabledType = "true" | "false"; +/** + * Options to pass to remove a MessageInstance + */ +export interface MessageContextRemoveOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; +} +/** + * Options to pass to update a MessageInstance + */ +export interface MessageContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; + /** */ + body?: string; + /** */ + attributes?: string; + /** */ + dateCreated?: Date; + /** */ + dateUpdated?: Date; + /** */ + lastUpdatedBy?: string; + /** */ + from?: string; +} +/** + * Options to pass to create a MessageInstance + */ +export interface MessageListInstanceCreateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: MessageWebhookEnabledType; + /** */ + from?: string; + /** */ + attributes?: string; + /** */ + dateCreated?: Date; + /** */ + dateUpdated?: Date; + /** */ + lastUpdatedBy?: string; + /** */ + body?: string; + /** */ + mediaSid?: string; +} +/** + * Options to pass to each + */ +export interface MessageListInstanceEachOptions { + /** */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessageInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessageListInstanceOptions { + /** */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessageListInstancePageOptions { + /** */ + order?: MessageOrderType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessageContext { + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + remove(params: MessageContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessageContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class MessageContextImpl implements MessageContext { + protected _version: V2; + protected _solution: MessageContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, channelSid: string, sid: string); + remove(params?: MessageContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + update(params?: MessageContextUpdateOptions | ((error: Error | null, item?: MessageInstance) => any), callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessageContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessagePayload extends TwilioResponsePayload { + messages: MessageResource[]; +} +interface MessageResource { + sid: string; + account_sid: string; + attributes: string; + service_sid: string; + to: string; + channel_sid: string; + date_created: Date; + date_updated: Date; + last_updated_by: string; + was_edited: boolean; + from: string; + body: string; + index: number; + type: string; + media: any; + url: string; +} +export declare class MessageInstance { + protected _version: V2; + protected _solution: MessageContextSolution; + protected _context?: MessageContext; + constructor(_version: V2, payload: MessageResource, serviceSid: string, channelSid: string, sid?: string); + sid: string; + accountSid: string; + attributes: string; + serviceSid: string; + to: string; + channelSid: string; + dateCreated: Date; + dateUpdated: Date; + lastUpdatedBy: string; + wasEdited: boolean; + from: string; + body: string; + index: number; + type: string; + media: any; + url: string; + private get _proxy(); + /** + * Remove a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + remove(params: MessageContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Update a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + update(params: MessageContextUpdateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + attributes: string; + serviceSid: string; + to: string; + channelSid: string; + dateCreated: Date; + dateUpdated: Date; + lastUpdatedBy: string; + wasEdited: boolean; + from: string; + body: string; + index: number; + type: string; + media: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessageSolution { + serviceSid: string; + channelSid: string; +} +export interface MessageListInstance { + _version: V2; + _solution: MessageSolution; + _uri: string; + (sid: string): MessageContext; + get(sid: string): MessageContext; + /** + * Create a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Create a MessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + create(params: MessageListInstanceCreateOptions, callback?: (error: Error | null, item?: MessageInstance) => any): Promise; + /** + * Streams MessageInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + each(params: MessageListInstanceEachOptions, callback?: (item: MessageInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Lists MessageInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + list(params: MessageListInstanceOptions, callback?: (error: Error | null, items: MessageInstance[]) => any): Promise; + /** + * Retrieve a single page of MessageInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessagePage) => any): Promise; + page(params: MessageListInstancePageOptions, callback?: (error: Error | null, items: MessagePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessageListInstance(version: V2, serviceSid: string, channelSid: string): MessageListInstance; +export declare class MessagePage extends Page { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: MessageSolution); + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessageResource): MessageInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/message.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/message.js new file mode 100644 index 00000000..c2ed7ae7 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/message.js @@ -0,0 +1,316 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagePage = exports.MessageListInstance = exports.MessageInstance = exports.MessageContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class MessageContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Messages/${sid}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["lastUpdatedBy"] !== undefined) + data["LastUpdatedBy"] = params["lastUpdatedBy"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageContextImpl = MessageContextImpl; +class MessageInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.attributes = payload.attributes; + this.serviceSid = payload.service_sid; + this.to = payload.to; + this.channelSid = payload.channel_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.lastUpdatedBy = payload.last_updated_by; + this.wasEdited = payload.was_edited; + this.from = payload.from; + this.body = payload.body; + this.index = deserialize.integer(payload.index); + this.type = payload.type; + this.media = payload.media; + this.url = payload.url; + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MessageContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a MessageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + attributes: this.attributes, + serviceSid: this.serviceSid, + to: this.to, + channelSid: this.channelSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + lastUpdatedBy: this.lastUpdatedBy, + wasEdited: this.wasEdited, + from: this.from, + body: this.body, + index: this.index, + type: this.type, + media: this.media, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInstance = MessageInstance; +function MessageListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MessageContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Messages`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["dateCreated"] !== undefined) + data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]); + if (params["dateUpdated"] !== undefined) + data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]); + if (params["lastUpdatedBy"] !== undefined) + data["LastUpdatedBy"] = params["lastUpdatedBy"]; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["mediaSid"] !== undefined) + data["MediaSid"] = params["mediaSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessagePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessageListInstance = MessageListInstance; +class MessagePage extends Page_1.default { + /** + * Initialize the MessagePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessageInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessageInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagePage = MessagePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/webhook.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/webhook.d.ts new file mode 100644 index 00000000..61b87c71 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/webhook.d.ts @@ -0,0 +1,311 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type WebhookMethod = "GET" | "POST"; +export type WebhookType = "webhook" | "trigger" | "studio"; +/** + * Options to pass to update a WebhookInstance + */ +export interface WebhookContextUpdateOptions { + /** */ + "configuration.url"?: string; + /** */ + "configuration.method"?: WebhookMethod; + /** */ + "configuration.filters"?: Array; + /** */ + "configuration.triggers"?: Array; + /** */ + "configuration.flowSid"?: string; + /** */ + "configuration.retryCount"?: number; +} +/** + * Options to pass to create a WebhookInstance + */ +export interface WebhookListInstanceCreateOptions { + /** */ + type: WebhookType; + /** */ + "configuration.url"?: string; + /** */ + "configuration.method"?: WebhookMethod; + /** */ + "configuration.filters"?: Array; + /** */ + "configuration.triggers"?: Array; + /** */ + "configuration.flowSid"?: string; + /** */ + "configuration.retryCount"?: number; +} +/** + * Options to pass to each + */ +export interface WebhookListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WebhookInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WebhookListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WebhookListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WebhookContext { + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WebhookContextSolution { + serviceSid: string; + channelSid: string; + sid: string; +} +export declare class WebhookContextImpl implements WebhookContext { + protected _version: V2; + protected _solution: WebhookContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, channelSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + update(params?: WebhookContextUpdateOptions | ((error: Error | null, item?: WebhookInstance) => any), callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WebhookContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WebhookPayload extends TwilioResponsePayload { + webhooks: WebhookResource[]; +} +interface WebhookResource { + sid: string; + account_sid: string; + service_sid: string; + channel_sid: string; + type: string; + url: string; + configuration: any; + date_created: Date; + date_updated: Date; +} +export declare class WebhookInstance { + protected _version: V2; + protected _solution: WebhookContextSolution; + protected _context?: WebhookContext; + constructor(_version: V2, payload: WebhookResource, serviceSid: string, channelSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + channelSid: string; + type: string; + url: string; + configuration: any; + dateCreated: Date; + dateUpdated: Date; + private get _proxy(); + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + channelSid: string; + type: string; + url: string; + configuration: any; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WebhookSolution { + serviceSid: string; + channelSid: string; +} +export interface WebhookListInstance { + _version: V2; + _solution: WebhookSolution; + _uri: string; + (sid: string): WebhookContext; + get(sid: string): WebhookContext; + /** + * Create a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + create(params: WebhookListInstanceCreateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Streams WebhookInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + each(params: WebhookListInstanceEachOptions, callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Lists WebhookInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + list(params: WebhookListInstanceOptions, callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + /** + * Retrieve a single page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WebhookPage) => any): Promise; + page(params: WebhookListInstancePageOptions, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebhookListInstance(version: V2, serviceSid: string, channelSid: string): WebhookListInstance; +export declare class WebhookPage extends Page { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: WebhookSolution); + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WebhookResource): WebhookInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/webhook.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/webhook.js new file mode 100644 index 00000000..f6e628a7 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/channel/webhook.js @@ -0,0 +1,288 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebhookPage = exports.WebhookListInstance = exports.WebhookInstance = exports.WebhookContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WebhookContextImpl { + constructor(_version, serviceSid, channelSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, channelSid, sid }; + this._uri = `/Services/${serviceSid}/Channels/${channelSid}/Webhooks/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["configuration.url"] !== undefined) + data["Configuration.Url"] = params["configuration.url"]; + if (params["configuration.method"] !== undefined) + data["Configuration.Method"] = params["configuration.method"]; + if (params["configuration.filters"] !== undefined) + data["Configuration.Filters"] = serialize.map(params["configuration.filters"], (e) => e); + if (params["configuration.triggers"] !== undefined) + data["Configuration.Triggers"] = serialize.map(params["configuration.triggers"], (e) => e); + if (params["configuration.flowSid"] !== undefined) + data["Configuration.FlowSid"] = params["configuration.flowSid"]; + if (params["configuration.retryCount"] !== undefined) + data["Configuration.RetryCount"] = params["configuration.retryCount"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookContextImpl = WebhookContextImpl; +class WebhookInstance { + constructor(_version, payload, serviceSid, channelSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.channelSid = payload.channel_sid; + this.type = payload.type; + this.url = payload.url; + this.configuration = payload.configuration; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { serviceSid, channelSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WebhookContextImpl(this._version, this._solution.serviceSid, this._solution.channelSid, this._solution.sid); + return this._context; + } + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + channelSid: this.channelSid, + type: this.type, + url: this.url, + configuration: this.configuration, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookInstance = WebhookInstance; +function WebhookListInstance(version, serviceSid, channelSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WebhookContextImpl(version, serviceSid, channelSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, channelSid }; + instance._uri = `/Services/${serviceSid}/Channels/${channelSid}/Webhooks`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["configuration.url"] !== undefined) + data["Configuration.Url"] = params["configuration.url"]; + if (params["configuration.method"] !== undefined) + data["Configuration.Method"] = params["configuration.method"]; + if (params["configuration.filters"] !== undefined) + data["Configuration.Filters"] = serialize.map(params["configuration.filters"], (e) => e); + if (params["configuration.triggers"] !== undefined) + data["Configuration.Triggers"] = serialize.map(params["configuration.triggers"], (e) => e); + if (params["configuration.flowSid"] !== undefined) + data["Configuration.FlowSid"] = params["configuration.flowSid"]; + if (params["configuration.retryCount"] !== undefined) + data["Configuration.RetryCount"] = params["configuration.retryCount"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WebhookPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebhookListInstance = WebhookListInstance; +class WebhookPage extends Page_1.default { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WebhookInstance(this._version, payload, this._solution.serviceSid, this._solution.channelSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookPage = WebhookPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/role.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/role.d.ts new file mode 100644 index 00000000..25bd41db --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/role.d.ts @@ -0,0 +1,274 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type RoleRoleType = "channel" | "deployment"; +/** + * Options to pass to update a RoleInstance + */ +export interface RoleContextUpdateOptions { + /** */ + permission: Array; +} +/** + * Options to pass to create a RoleInstance + */ +export interface RoleListInstanceCreateOptions { + /** */ + friendlyName: string; + /** */ + type: RoleRoleType; + /** */ + permission: Array; +} +/** + * Options to pass to each + */ +export interface RoleListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoleInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoleListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoleListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoleContext { + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoleContextSolution { + serviceSid: string; + sid: string; +} +export declare class RoleContextImpl implements RoleContext { + protected _version: V2; + protected _solution: RoleContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoleContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RolePayload extends TwilioResponsePayload { + roles: RoleResource[]; +} +interface RoleResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + type: RoleRoleType; + permissions: Array; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class RoleInstance { + protected _version: V2; + protected _solution: RoleContextSolution; + protected _context?: RoleContext; + constructor(_version: V2, payload: RoleResource, serviceSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + type: RoleRoleType; + permissions: Array; + dateCreated: Date; + dateUpdated: Date; + url: string; + private get _proxy(); + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Update a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + update(params: RoleContextUpdateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + type: RoleRoleType; + permissions: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoleSolution { + serviceSid: string; +} +export interface RoleListInstance { + _version: V2; + _solution: RoleSolution; + _uri: string; + (sid: string): RoleContext; + get(sid: string): RoleContext; + /** + * Create a RoleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + create(params: RoleListInstanceCreateOptions, callback?: (error: Error | null, item?: RoleInstance) => any): Promise; + /** + * Streams RoleInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + each(params: RoleListInstanceEachOptions, callback?: (item: RoleInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Lists RoleInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + list(params: RoleListInstanceOptions, callback?: (error: Error | null, items: RoleInstance[]) => any): Promise; + /** + * Retrieve a single page of RoleInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoleListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RolePage) => any): Promise; + page(params: RoleListInstancePageOptions, callback?: (error: Error | null, items: RolePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoleListInstance(version: V2, serviceSid: string): RoleListInstance; +export declare class RolePage extends Page { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: RoleSolution); + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoleResource): RoleInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/role.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/role.js new file mode 100644 index 00000000..be47e2c1 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/role.js @@ -0,0 +1,267 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RolePage = exports.RoleListInstance = exports.RoleInstance = exports.RoleContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class RoleContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Roles/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleContextImpl = RoleContextImpl; +class RoleInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.permissions = payload.permissions; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RoleContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RoleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoleInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + type: this.type, + permissions: this.permissions, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoleInstance = RoleInstance; +function RoleListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RoleContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Roles`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + if (params["permission"] === null || params["permission"] === undefined) { + throw new Error("Required parameter \"params['permission']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + data["Permission"] = serialize.map(params["permission"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoleInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RolePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RolePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoleListInstance = RoleListInstance; +class RolePage extends Page_1.default { + /** + * Initialize the RolePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoleInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RolePage = RolePage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/user.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user.d.ts new file mode 100644 index 00000000..1d4a713c --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user.d.ts @@ -0,0 +1,331 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { UserBindingListInstance } from "./user/userBinding"; +import { UserChannelListInstance } from "./user/userChannel"; +export type UserWebhookEnabledType = "true" | "false"; +/** + * Options to pass to update a UserInstance + */ +export interface UserContextUpdateOptions { + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; + /** */ + roleSid?: string; + /** */ + attributes?: string; + /** */ + friendlyName?: string; +} +/** + * Options to pass to create a UserInstance + */ +export interface UserListInstanceCreateOptions { + /** */ + identity: string; + /** The X-Twilio-Webhook-Enabled HTTP request header */ + xTwilioWebhookEnabled?: UserWebhookEnabledType; + /** */ + roleSid?: string; + /** */ + attributes?: string; + /** */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface UserListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserContext { + userBindings: UserBindingListInstance; + userChannels: UserChannelListInstance; + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserContextSolution { + serviceSid: string; + sid: string; +} +export declare class UserContextImpl implements UserContext { + protected _version: V2; + protected _solution: UserContextSolution; + protected _uri: string; + protected _userBindings?: UserBindingListInstance; + protected _userChannels?: UserChannelListInstance; + constructor(_version: V2, serviceSid: string, sid: string); + get userBindings(): UserBindingListInstance; + get userChannels(): UserChannelListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + update(params?: UserContextUpdateOptions | ((error: Error | null, item?: UserInstance) => any), callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserPayload extends TwilioResponsePayload { + users: UserResource[]; +} +interface UserResource { + sid: string; + account_sid: string; + service_sid: string; + attributes: string; + friendly_name: string; + role_sid: string; + identity: string; + is_online: boolean; + is_notifiable: boolean; + date_created: Date; + date_updated: Date; + joined_channels_count: number; + links: Record; + url: string; +} +export declare class UserInstance { + protected _version: V2; + protected _solution: UserContextSolution; + protected _context?: UserContext; + constructor(_version: V2, payload: UserResource, serviceSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + attributes: string; + friendlyName: string; + roleSid: string; + identity: string; + isOnline: boolean; + isNotifiable: boolean; + dateCreated: Date; + dateUpdated: Date; + joinedChannelsCount: number; + links: Record; + url: string; + private get _proxy(); + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Update a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Access the userBindings. + */ + userBindings(): UserBindingListInstance; + /** + * Access the userChannels. + */ + userChannels(): UserChannelListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + attributes: string; + friendlyName: string; + roleSid: string; + identity: string; + isOnline: boolean; + isNotifiable: boolean; + dateCreated: Date; + dateUpdated: Date; + joinedChannelsCount: number; + links: Record; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserSolution { + serviceSid: string; +} +export interface UserListInstance { + _version: V2; + _solution: UserSolution; + _uri: string; + (sid: string): UserContext; + get(sid: string): UserContext; + /** + * Create a UserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + create(params: UserListInstanceCreateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise; + /** + * Streams UserInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + each(params: UserListInstanceEachOptions, callback?: (item: UserInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Lists UserInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + list(params: UserListInstanceOptions, callback?: (error: Error | null, items: UserInstance[]) => any): Promise; + /** + * Retrieve a single page of UserInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserPage) => any): Promise; + page(params: UserListInstancePageOptions, callback?: (error: Error | null, items: UserPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserListInstance(version: V2, serviceSid: string): UserListInstance; +export declare class UserPage extends Page { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: UserSolution); + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserResource): UserInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/user.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user.js new file mode 100644 index 00000000..0e9b1ae2 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user.js @@ -0,0 +1,310 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserPage = exports.UserListInstance = exports.UserInstance = exports.UserContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const userBinding_1 = require("./user/userBinding"); +const userChannel_1 = require("./user/userChannel"); +class UserContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Users/${sid}`; + } + get userBindings() { + this._userBindings = + this._userBindings || + (0, userBinding_1.UserBindingListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._userBindings; + } + get userChannels() { + this._userChannels = + this._userChannels || + (0, userChannel_1.UserChannelListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._userChannels; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserContextImpl = UserContextImpl; +class UserInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.attributes = payload.attributes; + this.friendlyName = payload.friendly_name; + this.roleSid = payload.role_sid; + this.identity = payload.identity; + this.isOnline = payload.is_online; + this.isNotifiable = payload.is_notifiable; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.joinedChannelsCount = deserialize.integer(payload.joined_channels_count); + this.links = payload.links; + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UserContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the userBindings. + */ + userBindings() { + return this._proxy.userBindings; + } + /** + * Access the userChannels. + */ + userChannels() { + return this._proxy.userChannels; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + attributes: this.attributes, + friendlyName: this.friendlyName, + roleSid: this.roleSid, + identity: this.identity, + isOnline: this.isOnline, + isNotifiable: this.isNotifiable, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + joinedChannelsCount: this.joinedChannelsCount, + links: this.links, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserInstance = UserInstance; +function UserListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Users`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + if (params["roleSid"] !== undefined) + data["RoleSid"] = params["roleSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["xTwilioWebhookEnabled"] !== undefined) + headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"]; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserListInstance = UserListInstance; +class UserPage extends Page_1.default { + /** + * Initialize the UserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserPage = UserPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userBinding.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userBinding.d.ts new file mode 100644 index 00000000..a278d318 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userBinding.d.ts @@ -0,0 +1,245 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type UserBindingBindingType = "gcm" | "apn" | "fcm"; +/** + * Options to pass to each + */ +export interface UserBindingListInstanceEachOptions { + /** */ + bindingType?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserBindingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserBindingListInstanceOptions { + /** */ + bindingType?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserBindingListInstancePageOptions { + /** */ + bindingType?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserBindingContext { + /** + * Remove a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserBindingInstance + */ + fetch(callback?: (error: Error | null, item?: UserBindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserBindingContextSolution { + serviceSid: string; + userSid: string; + sid: string; +} +export declare class UserBindingContextImpl implements UserBindingContext { + protected _version: V2; + protected _solution: UserBindingContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, userSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserBindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserBindingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserBindingPayload extends TwilioResponsePayload { + bindings: UserBindingResource[]; +} +interface UserBindingResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + endpoint: string; + identity: string; + user_sid: string; + credential_sid: string; + binding_type: UserBindingBindingType; + message_types: Array; + url: string; +} +export declare class UserBindingInstance { + protected _version: V2; + protected _solution: UserBindingContextSolution; + protected _context?: UserBindingContext; + constructor(_version: V2, payload: UserBindingResource, serviceSid: string, userSid: string, sid?: string); + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + endpoint: string; + identity: string; + userSid: string; + credentialSid: string; + bindingType: UserBindingBindingType; + messageTypes: Array; + url: string; + private get _proxy(); + /** + * Remove a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserBindingInstance + */ + fetch(callback?: (error: Error | null, item?: UserBindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + endpoint: string; + identity: string; + userSid: string; + credentialSid: string; + bindingType: UserBindingBindingType; + messageTypes: string[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserBindingSolution { + serviceSid: string; + userSid: string; +} +export interface UserBindingListInstance { + _version: V2; + _solution: UserBindingSolution; + _uri: string; + (sid: string): UserBindingContext; + get(sid: string): UserBindingContext; + /** + * Streams UserBindingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserBindingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserBindingInstance, done: (err?: Error) => void) => void): void; + each(params: UserBindingListInstanceEachOptions, callback?: (item: UserBindingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserBindingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserBindingPage) => any): Promise; + /** + * Lists UserBindingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserBindingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserBindingInstance[]) => any): Promise; + list(params: UserBindingListInstanceOptions, callback?: (error: Error | null, items: UserBindingInstance[]) => any): Promise; + /** + * Retrieve a single page of UserBindingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserBindingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserBindingPage) => any): Promise; + page(params: UserBindingListInstancePageOptions, callback?: (error: Error | null, items: UserBindingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserBindingListInstance(version: V2, serviceSid: string, userSid: string): UserBindingListInstance; +export declare class UserBindingPage extends Page { + /** + * Initialize the UserBindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: UserBindingSolution); + /** + * Build an instance of UserBindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserBindingResource): UserBindingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userBinding.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userBinding.js new file mode 100644 index 00000000..b50e93c2 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userBinding.js @@ -0,0 +1,226 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserBindingPage = exports.UserBindingListInstance = exports.UserBindingInstance = exports.UserBindingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class UserBindingContextImpl { + constructor(_version, serviceSid, userSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, userSid, sid }; + this._uri = `/Services/${serviceSid}/Users/${userSid}/Bindings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserBindingInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.userSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserBindingContextImpl = UserBindingContextImpl; +class UserBindingInstance { + constructor(_version, payload, serviceSid, userSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.endpoint = payload.endpoint; + this.identity = payload.identity; + this.userSid = payload.user_sid; + this.credentialSid = payload.credential_sid; + this.bindingType = payload.binding_type; + this.messageTypes = payload.message_types; + this.url = payload.url; + this._solution = { serviceSid, userSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UserBindingContextImpl(this._version, this._solution.serviceSid, this._solution.userSid, this._solution.sid); + return this._context; + } + /** + * Remove a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserBindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserBindingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + endpoint: this.endpoint, + identity: this.identity, + userSid: this.userSid, + credentialSid: this.credentialSid, + bindingType: this.bindingType, + messageTypes: this.messageTypes, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserBindingInstance = UserBindingInstance; +function UserBindingListInstance(version, serviceSid, userSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UserBindingContextImpl(version, serviceSid, userSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, userSid }; + instance._uri = `/Services/${serviceSid}/Users/${userSid}/Bindings`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["bindingType"] !== undefined) + data["BindingType"] = serialize.map(params["bindingType"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserBindingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserBindingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserBindingListInstance = UserBindingListInstance; +class UserBindingPage extends Page_1.default { + /** + * Initialize the UserBindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserBindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserBindingInstance(this._version, payload, this._solution.serviceSid, this._solution.userSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserBindingPage = UserBindingPage; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts new file mode 100644 index 00000000..cb0c2e54 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts @@ -0,0 +1,283 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type UserChannelChannelStatus = "joined" | "invited" | "not_participating"; +export type UserChannelNotificationLevel = "default" | "muted"; +/** + * Options to pass to update a UserChannelInstance + */ +export interface UserChannelContextUpdateOptions { + /** */ + notificationLevel?: UserChannelNotificationLevel; + /** */ + lastConsumedMessageIndex?: number; + /** */ + lastConsumptionTimestamp?: Date; +} +/** + * Options to pass to each + */ +export interface UserChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UserChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UserChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UserChannelContext { + /** + * Remove a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + fetch(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Update a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + update(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Update a UserChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + update(params: UserChannelContextUpdateOptions, callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UserChannelContextSolution { + serviceSid: string; + userSid: string; + channelSid: string; +} +export declare class UserChannelContextImpl implements UserChannelContext { + protected _version: V2; + protected _solution: UserChannelContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, userSid: string, channelSid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + update(params?: UserChannelContextUpdateOptions | ((error: Error | null, item?: UserChannelInstance) => any), callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UserChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UserChannelPayload extends TwilioResponsePayload { + channels: UserChannelResource[]; +} +interface UserChannelResource { + account_sid: string; + service_sid: string; + channel_sid: string; + user_sid: string; + member_sid: string; + status: UserChannelChannelStatus; + last_consumed_message_index: number; + unread_messages_count: number; + links: Record; + url: string; + notification_level: UserChannelNotificationLevel; +} +export declare class UserChannelInstance { + protected _version: V2; + protected _solution: UserChannelContextSolution; + protected _context?: UserChannelContext; + constructor(_version: V2, payload: UserChannelResource, serviceSid: string, userSid: string, channelSid?: string); + accountSid: string; + serviceSid: string; + channelSid: string; + userSid: string; + memberSid: string; + status: UserChannelChannelStatus; + lastConsumedMessageIndex: number; + unreadMessagesCount: number; + links: Record; + url: string; + notificationLevel: UserChannelNotificationLevel; + private get _proxy(); + /** + * Remove a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + fetch(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Update a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + update(callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Update a UserChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + update(params: UserChannelContextUpdateOptions, callback?: (error: Error | null, item?: UserChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + channelSid: string; + userSid: string; + memberSid: string; + status: UserChannelChannelStatus; + lastConsumedMessageIndex: number; + unreadMessagesCount: number; + links: Record; + url: string; + notificationLevel: UserChannelNotificationLevel; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UserChannelSolution { + serviceSid: string; + userSid: string; +} +export interface UserChannelListInstance { + _version: V2; + _solution: UserChannelSolution; + _uri: string; + (channelSid: string): UserChannelContext; + get(channelSid: string): UserChannelContext; + /** + * Streams UserChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + each(params: UserChannelListInstanceEachOptions, callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UserChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + /** + * Lists UserChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UserChannelInstance[]) => any): Promise; + list(params: UserChannelListInstanceOptions, callback?: (error: Error | null, items: UserChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of UserChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UserChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + page(params: UserChannelListInstancePageOptions, callback?: (error: Error | null, items: UserChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UserChannelListInstance(version: V2, serviceSid: string, userSid: string): UserChannelListInstance; +export declare class UserChannelPage extends Page { + /** + * Initialize the UserChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: UserChannelSolution); + /** + * Build an instance of UserChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UserChannelResource): UserChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userChannel.js b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userChannel.js new file mode 100644 index 00000000..444f1262 --- /dev/null +++ b/node_modules/twilio/lib/rest/ipMessaging/v2/service/user/userChannel.js @@ -0,0 +1,257 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Ip_messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UserChannelPage = exports.UserChannelListInstance = exports.UserChannelInstance = exports.UserChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class UserChannelContextImpl { + constructor(_version, serviceSid, userSid, channelSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(channelSid)) { + throw new Error("Parameter 'channelSid' is not valid."); + } + this._solution = { serviceSid, userSid, channelSid }; + this._uri = `/Services/${serviceSid}/Users/${userSid}/Channels/${channelSid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UserChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.userSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["notificationLevel"] !== undefined) + data["NotificationLevel"] = params["notificationLevel"]; + if (params["lastConsumedMessageIndex"] !== undefined) + data["LastConsumedMessageIndex"] = params["lastConsumedMessageIndex"]; + if (params["lastConsumptionTimestamp"] !== undefined) + data["LastConsumptionTimestamp"] = serialize.iso8601DateTime(params["lastConsumptionTimestamp"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserChannelInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.userSid, instance._solution.channelSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelContextImpl = UserChannelContextImpl; +class UserChannelInstance { + constructor(_version, payload, serviceSid, userSid, channelSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.channelSid = payload.channel_sid; + this.userSid = payload.user_sid; + this.memberSid = payload.member_sid; + this.status = payload.status; + this.lastConsumedMessageIndex = deserialize.integer(payload.last_consumed_message_index); + this.unreadMessagesCount = deserialize.integer(payload.unread_messages_count); + this.links = payload.links; + this.url = payload.url; + this.notificationLevel = payload.notification_level; + this._solution = { + serviceSid, + userSid, + channelSid: channelSid || this.channelSid, + }; + } + get _proxy() { + this._context = + this._context || + new UserChannelContextImpl(this._version, this._solution.serviceSid, this._solution.userSid, this._solution.channelSid); + return this._context; + } + /** + * Remove a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UserChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + channelSid: this.channelSid, + userSid: this.userSid, + memberSid: this.memberSid, + status: this.status, + lastConsumedMessageIndex: this.lastConsumedMessageIndex, + unreadMessagesCount: this.unreadMessagesCount, + links: this.links, + url: this.url, + notificationLevel: this.notificationLevel, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelInstance = UserChannelInstance; +function UserChannelListInstance(version, serviceSid, userSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(userSid)) { + throw new Error("Parameter 'userSid' is not valid."); + } + const instance = ((channelSid) => instance.get(channelSid)); + instance.get = function get(channelSid) { + return new UserChannelContextImpl(version, serviceSid, userSid, channelSid); + }; + instance._version = version; + instance._solution = { serviceSid, userSid }; + instance._uri = `/Services/${serviceSid}/Users/${userSid}/Channels`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UserChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UserChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UserChannelListInstance = UserChannelListInstance; +class UserChannelPage extends Page_1.default { + /** + * Initialize the UserChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UserChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UserChannelInstance(this._version, payload, this._solution.serviceSid, this._solution.userSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UserChannelPage = UserChannelPage; diff --git a/node_modules/twilio/lib/rest/lookups/V1.d.ts b/node_modules/twilio/lib/rest/lookups/V1.d.ts new file mode 100644 index 00000000..84a1c4a4 --- /dev/null +++ b/node_modules/twilio/lib/rest/lookups/V1.d.ts @@ -0,0 +1,15 @@ +import LookupsBase from "../LookupsBase"; +import Version from "../../base/Version"; +import { PhoneNumberListInstance } from "./v1/phoneNumber"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Lookups + * + * @param domain - The Twilio (Twilio.Lookups) domain + */ + constructor(domain: LookupsBase); + /** phoneNumbers - { Twilio.Lookups.V1.PhoneNumberListInstance } resource */ + protected _phoneNumbers?: PhoneNumberListInstance; + /** Getter for phoneNumbers resource */ + get phoneNumbers(): PhoneNumberListInstance; +} diff --git a/node_modules/twilio/lib/rest/lookups/V1.js b/node_modules/twilio/lib/rest/lookups/V1.js new file mode 100644 index 00000000..48088b32 --- /dev/null +++ b/node_modules/twilio/lib/rest/lookups/V1.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Lookups + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const phoneNumber_1 = require("./v1/phoneNumber"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Lookups + * + * @param domain - The Twilio (Twilio.Lookups) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for phoneNumbers resource */ + get phoneNumbers() { + this._phoneNumbers = this._phoneNumbers || (0, phoneNumber_1.PhoneNumberListInstance)(this); + return this._phoneNumbers; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/lookups/V2.d.ts b/node_modules/twilio/lib/rest/lookups/V2.d.ts new file mode 100644 index 00000000..fee948bf --- /dev/null +++ b/node_modules/twilio/lib/rest/lookups/V2.d.ts @@ -0,0 +1,15 @@ +import LookupsBase from "../LookupsBase"; +import Version from "../../base/Version"; +import { PhoneNumberListInstance } from "./v2/phoneNumber"; +export default class V2 extends Version { + /** + * Initialize the V2 version of Lookups + * + * @param domain - The Twilio (Twilio.Lookups) domain + */ + constructor(domain: LookupsBase); + /** phoneNumbers - { Twilio.Lookups.V2.PhoneNumberListInstance } resource */ + protected _phoneNumbers?: PhoneNumberListInstance; + /** Getter for phoneNumbers resource */ + get phoneNumbers(): PhoneNumberListInstance; +} diff --git a/node_modules/twilio/lib/rest/lookups/V2.js b/node_modules/twilio/lib/rest/lookups/V2.js new file mode 100644 index 00000000..31ec5f3f --- /dev/null +++ b/node_modules/twilio/lib/rest/lookups/V2.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Lookups + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const phoneNumber_1 = require("./v2/phoneNumber"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of Lookups + * + * @param domain - The Twilio (Twilio.Lookups) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for phoneNumbers resource */ + get phoneNumbers() { + this._phoneNumbers = this._phoneNumbers || (0, phoneNumber_1.PhoneNumberListInstance)(this); + return this._phoneNumbers; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/lookups/v1/phoneNumber.d.ts b/node_modules/twilio/lib/rest/lookups/v1/phoneNumber.d.ts new file mode 100644 index 00000000..ad03799d --- /dev/null +++ b/node_modules/twilio/lib/rest/lookups/v1/phoneNumber.d.ts @@ -0,0 +1,149 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to fetch a PhoneNumberInstance + */ +export interface PhoneNumberContextFetchOptions { + /** The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. */ + countryCode?: string; + /** The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. */ + type?: Array; + /** The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). */ + addOns?: Array; + /** Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. */ + addOnsData?: Record; +} +export interface PhoneNumberContext { + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(params: PhoneNumberContextFetchOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PhoneNumberContextSolution { + phoneNumber: string; +} +export declare class PhoneNumberContextImpl implements PhoneNumberContext { + protected _version: V1; + protected _solution: PhoneNumberContextSolution; + protected _uri: string; + constructor(_version: V1, phoneNumber: string); + fetch(params?: PhoneNumberContextFetchOptions | ((error: Error | null, item?: PhoneNumberInstance) => any), callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PhoneNumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PhoneNumberResource { + caller_name: any; + country_code: string; + phone_number: string; + national_format: string; + carrier: any; + add_ons: any; + url: string; +} +export declare class PhoneNumberInstance { + protected _version: V1; + protected _solution: PhoneNumberContextSolution; + protected _context?: PhoneNumberContext; + constructor(_version: V1, payload: PhoneNumberResource, phoneNumber?: string); + /** + * The name of the phone number\'s owner. If `null`, that information was not available. + */ + callerName: any; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) for the phone number. + */ + countryCode: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The phone number, in national format. + */ + nationalFormat: string; + /** + * The telecom company that provides the phone number. + */ + carrier: any; + /** + * A JSON string with the results of the Add-ons you specified in the `add_ons` parameters. For the format of the object, see [Using Add-ons](https://www.twilio.com/docs/add-ons). + */ + addOns: any; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(params: PhoneNumberContextFetchOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + callerName: any; + countryCode: string; + phoneNumber: string; + nationalFormat: string; + carrier: any; + addOns: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PhoneNumberSolution { +} +export interface PhoneNumberListInstance { + _version: V1; + _solution: PhoneNumberSolution; + _uri: string; + (phoneNumber: string): PhoneNumberContext; + get(phoneNumber: string): PhoneNumberContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PhoneNumberListInstance(version: V1): PhoneNumberListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/lookups/v1/phoneNumber.js b/node_modules/twilio/lib/rest/lookups/v1/phoneNumber.js new file mode 100644 index 00000000..284e8171 --- /dev/null +++ b/node_modules/twilio/lib/rest/lookups/v1/phoneNumber.js @@ -0,0 +1,133 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Lookups + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PhoneNumberListInstance = exports.PhoneNumberInstance = exports.PhoneNumberContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PhoneNumberContextImpl { + constructor(_version, phoneNumber) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(phoneNumber)) { + throw new Error("Parameter 'phoneNumber' is not valid."); + } + this._solution = { phoneNumber }; + this._uri = `/PhoneNumbers/${phoneNumber}`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["countryCode"] !== undefined) + data["CountryCode"] = params["countryCode"]; + if (params["type"] !== undefined) + data["Type"] = serialize.map(params["type"], (e) => e); + if (params["addOns"] !== undefined) + data["AddOns"] = serialize.map(params["addOns"], (e) => e); + if (params["addOnsData"] !== undefined) + data = { + ...data, + ...serialize.prefixedCollapsibleMap(params["addOnsData"], "AddOns"), + }; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.phoneNumber)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberContextImpl = PhoneNumberContextImpl; +class PhoneNumberInstance { + constructor(_version, payload, phoneNumber) { + this._version = _version; + this.callerName = payload.caller_name; + this.countryCode = payload.country_code; + this.phoneNumber = payload.phone_number; + this.nationalFormat = payload.national_format; + this.carrier = payload.carrier; + this.addOns = payload.add_ons; + this.url = payload.url; + this._solution = { phoneNumber: phoneNumber || this.phoneNumber }; + } + get _proxy() { + this._context = + this._context || + new PhoneNumberContextImpl(this._version, this._solution.phoneNumber); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + callerName: this.callerName, + countryCode: this.countryCode, + phoneNumber: this.phoneNumber, + nationalFormat: this.nationalFormat, + carrier: this.carrier, + addOns: this.addOns, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberInstance = PhoneNumberInstance; +function PhoneNumberListInstance(version) { + const instance = ((phoneNumber) => instance.get(phoneNumber)); + instance.get = function get(phoneNumber) { + return new PhoneNumberContextImpl(version, phoneNumber); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PhoneNumberListInstance = PhoneNumberListInstance; diff --git a/node_modules/twilio/lib/rest/lookups/v2/phoneNumber.d.ts b/node_modules/twilio/lib/rest/lookups/v2/phoneNumber.d.ts new file mode 100644 index 00000000..e9d8e57f --- /dev/null +++ b/node_modules/twilio/lib/rest/lookups/v2/phoneNumber.d.ts @@ -0,0 +1,222 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +export type PhoneNumberValidationError = "TOO_SHORT" | "TOO_LONG" | "INVALID_BUT_POSSIBLE" | "INVALID_COUNTRY_CODE" | "INVALID_LENGTH" | "NOT_A_NUMBER"; +/** + * Options to pass to fetch a PhoneNumberInstance + */ +export interface PhoneNumberContextFetchOptions { + /** A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. */ + fields?: string; + /** The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. */ + countryCode?: string; + /** User’s first name. This query parameter is only used (optionally) for identity_match package requests. */ + firstName?: string; + /** User’s last name. This query parameter is only used (optionally) for identity_match package requests. */ + lastName?: string; + /** User’s first address line. This query parameter is only used (optionally) for identity_match package requests. */ + addressLine1?: string; + /** User’s second address line. This query parameter is only used (optionally) for identity_match package requests. */ + addressLine2?: string; + /** User’s city. This query parameter is only used (optionally) for identity_match package requests. */ + city?: string; + /** User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. */ + state?: string; + /** User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. */ + postalCode?: string; + /** User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. */ + addressCountryCode?: string; + /** User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. */ + nationalId?: string; + /** User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. */ + dateOfBirth?: string; + /** The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. */ + lastVerifiedDate?: string; +} +export interface PhoneNumberContext { + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(params: PhoneNumberContextFetchOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PhoneNumberContextSolution { + phoneNumber: string; +} +export declare class PhoneNumberContextImpl implements PhoneNumberContext { + protected _version: V2; + protected _solution: PhoneNumberContextSolution; + protected _uri: string; + constructor(_version: V2, phoneNumber: string); + fetch(params?: PhoneNumberContextFetchOptions | ((error: Error | null, item?: PhoneNumberInstance) => any), callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PhoneNumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PhoneNumberResource { + calling_country_code: string; + country_code: string; + phone_number: string; + national_format: string; + valid: boolean; + validation_errors: Array; + caller_name: any; + sim_swap: any; + call_forwarding: any; + live_activity: any; + line_type_intelligence: any; + identity_match: any; + reassigned_number: any; + sms_pumping_risk: any; + phone_number_quality_score: any; + url: string; +} +export declare class PhoneNumberInstance { + protected _version: V2; + protected _solution: PhoneNumberContextSolution; + protected _context?: PhoneNumberContext; + constructor(_version: V2, payload: PhoneNumberResource, phoneNumber?: string); + /** + * International dialing prefix of the phone number defined in the E.164 standard. + */ + callingCountryCode: string; + /** + * The phone number\'s [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + */ + countryCode: string; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The phone number in [national format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers). + */ + nationalFormat: string; + /** + * Boolean which indicates if the phone number is in a valid range that can be freely assigned by a carrier to a user. + */ + valid: boolean; + /** + * Contains reasons why a phone number is invalid. Possible values: TOO_SHORT, TOO_LONG, INVALID_BUT_POSSIBLE, INVALID_COUNTRY_CODE, INVALID_LENGTH, NOT_A_NUMBER. + */ + validationErrors: Array; + /** + * An object that contains caller name information based on [CNAM](https://support.twilio.com/hc/en-us/articles/360051670533-Getting-Started-with-CNAM-Caller-ID). + */ + callerName: any; + /** + * An object that contains information on the last date the subscriber identity module (SIM) was changed for a mobile phone number. + */ + simSwap: any; + /** + * An object that contains information on the unconditional call forwarding status of mobile phone number. + */ + callForwarding: any; + /** + * An object that contains live activity information for a mobile phone number. + */ + liveActivity: any; + /** + * An object that contains line type information including the carrier name, mobile country code, and mobile network code. + */ + lineTypeIntelligence: any; + /** + * An object that contains identity match information. The result of comparing user-provided information including name, address, date of birth, national ID, against authoritative phone-based data sources + */ + identityMatch: any; + /** + * An object that contains reassigned number information. Reassigned Numbers will return a phone number\'s reassignment status given a phone number and date + */ + reassignedNumber: any; + /** + * An object that contains information on if a phone number has been currently or previously blocked by Verify Fraud Guard for receiving malicious SMS pumping traffic as well as other signals associated with risky carriers and low conversion rates. + */ + smsPumpingRisk: any; + /** + * An object that contains information of a mobile phone number quality score. Quality score will return a risk score about the phone number. + */ + phoneNumberQualityScore: any; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(params: PhoneNumberContextFetchOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + callingCountryCode: string; + countryCode: string; + phoneNumber: string; + nationalFormat: string; + valid: boolean; + validationErrors: PhoneNumberValidationError[]; + callerName: any; + simSwap: any; + callForwarding: any; + liveActivity: any; + lineTypeIntelligence: any; + identityMatch: any; + reassignedNumber: any; + smsPumpingRisk: any; + phoneNumberQualityScore: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PhoneNumberSolution { +} +export interface PhoneNumberListInstance { + _version: V2; + _solution: PhoneNumberSolution; + _uri: string; + (phoneNumber: string): PhoneNumberContext; + get(phoneNumber: string): PhoneNumberContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PhoneNumberListInstance(version: V2): PhoneNumberListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/lookups/v2/phoneNumber.js b/node_modules/twilio/lib/rest/lookups/v2/phoneNumber.js new file mode 100644 index 00000000..6f68ee6d --- /dev/null +++ b/node_modules/twilio/lib/rest/lookups/v2/phoneNumber.js @@ -0,0 +1,166 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Lookups + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PhoneNumberListInstance = exports.PhoneNumberInstance = exports.PhoneNumberContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PhoneNumberContextImpl { + constructor(_version, phoneNumber) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(phoneNumber)) { + throw new Error("Parameter 'phoneNumber' is not valid."); + } + this._solution = { phoneNumber }; + this._uri = `/PhoneNumbers/${phoneNumber}`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["fields"] !== undefined) + data["Fields"] = params["fields"]; + if (params["countryCode"] !== undefined) + data["CountryCode"] = params["countryCode"]; + if (params["firstName"] !== undefined) + data["FirstName"] = params["firstName"]; + if (params["lastName"] !== undefined) + data["LastName"] = params["lastName"]; + if (params["addressLine1"] !== undefined) + data["AddressLine1"] = params["addressLine1"]; + if (params["addressLine2"] !== undefined) + data["AddressLine2"] = params["addressLine2"]; + if (params["city"] !== undefined) + data["City"] = params["city"]; + if (params["state"] !== undefined) + data["State"] = params["state"]; + if (params["postalCode"] !== undefined) + data["PostalCode"] = params["postalCode"]; + if (params["addressCountryCode"] !== undefined) + data["AddressCountryCode"] = params["addressCountryCode"]; + if (params["nationalId"] !== undefined) + data["NationalId"] = params["nationalId"]; + if (params["dateOfBirth"] !== undefined) + data["DateOfBirth"] = params["dateOfBirth"]; + if (params["lastVerifiedDate"] !== undefined) + data["LastVerifiedDate"] = params["lastVerifiedDate"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.phoneNumber)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberContextImpl = PhoneNumberContextImpl; +class PhoneNumberInstance { + constructor(_version, payload, phoneNumber) { + this._version = _version; + this.callingCountryCode = payload.calling_country_code; + this.countryCode = payload.country_code; + this.phoneNumber = payload.phone_number; + this.nationalFormat = payload.national_format; + this.valid = payload.valid; + this.validationErrors = payload.validation_errors; + this.callerName = payload.caller_name; + this.simSwap = payload.sim_swap; + this.callForwarding = payload.call_forwarding; + this.liveActivity = payload.live_activity; + this.lineTypeIntelligence = payload.line_type_intelligence; + this.identityMatch = payload.identity_match; + this.reassignedNumber = payload.reassigned_number; + this.smsPumpingRisk = payload.sms_pumping_risk; + this.phoneNumberQualityScore = payload.phone_number_quality_score; + this.url = payload.url; + this._solution = { phoneNumber: phoneNumber || this.phoneNumber }; + } + get _proxy() { + this._context = + this._context || + new PhoneNumberContextImpl(this._version, this._solution.phoneNumber); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + callingCountryCode: this.callingCountryCode, + countryCode: this.countryCode, + phoneNumber: this.phoneNumber, + nationalFormat: this.nationalFormat, + valid: this.valid, + validationErrors: this.validationErrors, + callerName: this.callerName, + simSwap: this.simSwap, + callForwarding: this.callForwarding, + liveActivity: this.liveActivity, + lineTypeIntelligence: this.lineTypeIntelligence, + identityMatch: this.identityMatch, + reassignedNumber: this.reassignedNumber, + smsPumpingRisk: this.smsPumpingRisk, + phoneNumberQualityScore: this.phoneNumberQualityScore, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberInstance = PhoneNumberInstance; +function PhoneNumberListInstance(version) { + const instance = ((phoneNumber) => instance.get(phoneNumber)); + instance.get = function get(phoneNumber) { + return new PhoneNumberContextImpl(version, phoneNumber); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PhoneNumberListInstance = PhoneNumberListInstance; diff --git a/node_modules/twilio/lib/rest/media/V1.d.ts b/node_modules/twilio/lib/rest/media/V1.d.ts new file mode 100644 index 00000000..86d70876 --- /dev/null +++ b/node_modules/twilio/lib/rest/media/V1.d.ts @@ -0,0 +1,25 @@ +import MediaBase from "../MediaBase"; +import Version from "../../base/Version"; +import { MediaProcessorListInstance } from "./v1/mediaProcessor"; +import { MediaRecordingListInstance } from "./v1/mediaRecording"; +import { PlayerStreamerListInstance } from "./v1/playerStreamer"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Media + * + * @param domain - The Twilio (Twilio.Media) domain + */ + constructor(domain: MediaBase); + /** mediaProcessor - { Twilio.Media.V1.MediaProcessorListInstance } resource */ + protected _mediaProcessor?: MediaProcessorListInstance; + /** mediaRecording - { Twilio.Media.V1.MediaRecordingListInstance } resource */ + protected _mediaRecording?: MediaRecordingListInstance; + /** playerStreamer - { Twilio.Media.V1.PlayerStreamerListInstance } resource */ + protected _playerStreamer?: PlayerStreamerListInstance; + /** Getter for mediaProcessor resource */ + get mediaProcessor(): MediaProcessorListInstance; + /** Getter for mediaRecording resource */ + get mediaRecording(): MediaRecordingListInstance; + /** Getter for playerStreamer resource */ + get playerStreamer(): PlayerStreamerListInstance; +} diff --git a/node_modules/twilio/lib/rest/media/V1.js b/node_modules/twilio/lib/rest/media/V1.js new file mode 100644 index 00000000..53c9fcfd --- /dev/null +++ b/node_modules/twilio/lib/rest/media/V1.js @@ -0,0 +1,51 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Media + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const mediaProcessor_1 = require("./v1/mediaProcessor"); +const mediaRecording_1 = require("./v1/mediaRecording"); +const playerStreamer_1 = require("./v1/playerStreamer"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Media + * + * @param domain - The Twilio (Twilio.Media) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for mediaProcessor resource */ + get mediaProcessor() { + this._mediaProcessor = + this._mediaProcessor || (0, mediaProcessor_1.MediaProcessorListInstance)(this); + return this._mediaProcessor; + } + /** Getter for mediaRecording resource */ + get mediaRecording() { + this._mediaRecording = + this._mediaRecording || (0, mediaRecording_1.MediaRecordingListInstance)(this); + return this._mediaRecording; + } + /** Getter for playerStreamer resource */ + get playerStreamer() { + this._playerStreamer = + this._playerStreamer || (0, playerStreamer_1.PlayerStreamerListInstance)(this); + return this._playerStreamer; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/media/v1/mediaProcessor.d.ts b/node_modules/twilio/lib/rest/media/v1/mediaProcessor.d.ts new file mode 100644 index 00000000..a0e75daf --- /dev/null +++ b/node_modules/twilio/lib/rest/media/v1/mediaProcessor.d.ts @@ -0,0 +1,317 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type MediaProcessorOrder = "asc" | "desc"; +export type MediaProcessorStatus = "failed" | "started" | "ended"; +export type MediaProcessorUpdateStatus = "ended"; +/** + * Options to pass to update a MediaProcessorInstance + */ +export interface MediaProcessorContextUpdateOptions { + /** */ + status: MediaProcessorUpdateStatus; +} +/** + * Options to pass to create a MediaProcessorInstance + */ +export interface MediaProcessorListInstanceCreateOptions { + /** The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` */ + extension: string; + /** The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send. */ + extensionContext: string; + /** User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about whether you need to provide this. */ + extensionEnvironment?: any; + /** The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. */ + statusCallback?: string; + /** The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. */ + statusCallbackMethod?: string; + /** The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. */ + maxDuration?: number; +} +/** + * Options to pass to each + */ +export interface MediaProcessorListInstanceEachOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: MediaProcessorOrder; + /** Status to filter by, with possible values `started`, `ended` or `failed`. */ + status?: MediaProcessorStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MediaProcessorInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MediaProcessorListInstanceOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: MediaProcessorOrder; + /** Status to filter by, with possible values `started`, `ended` or `failed`. */ + status?: MediaProcessorStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MediaProcessorListInstancePageOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: MediaProcessorOrder; + /** Status to filter by, with possible values `started`, `ended` or `failed`. */ + status?: MediaProcessorStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MediaProcessorContext { + /** + * Fetch a MediaProcessorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaProcessorInstance + */ + fetch(callback?: (error: Error | null, item?: MediaProcessorInstance) => any): Promise; + /** + * Update a MediaProcessorInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaProcessorInstance + */ + update(params: MediaProcessorContextUpdateOptions, callback?: (error: Error | null, item?: MediaProcessorInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MediaProcessorContextSolution { + sid: string; +} +export declare class MediaProcessorContextImpl implements MediaProcessorContext { + protected _version: V1; + protected _solution: MediaProcessorContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: MediaProcessorInstance) => any): Promise; + update(params: MediaProcessorContextUpdateOptions, callback?: (error: Error | null, item?: MediaProcessorInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MediaProcessorContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MediaProcessorPayload extends TwilioResponsePayload { + media_processors: MediaProcessorResource[]; +} +interface MediaProcessorResource { + account_sid: string; + sid: string; + date_created: Date; + date_updated: Date; + extension: string; + extension_context: string; + status: MediaProcessorStatus; + url: string; + ended_reason: string; + status_callback: string; + status_callback_method: string; + max_duration: number; +} +export declare class MediaProcessorInstance { + protected _version: V1; + protected _solution: MediaProcessorContextSolution; + protected _context?: MediaProcessorContext; + constructor(_version: V1, payload: MediaProcessorResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaProcessor resource. + */ + accountSid: string; + /** + * The unique string generated to identify the MediaProcessor resource. + */ + sid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` + */ + extension: string; + /** + * The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send. + */ + extensionContext: string; + status: MediaProcessorStatus; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The reason why a MediaProcessor ended. When a MediaProcessor is in progress, will be `null`. When a MediaProcessor is completed, can be `ended-via-api`, `max-duration-exceeded`, `error-loading-extension`, `error-streaming-media` or `internal-service-error`. See [ended reasons](/docs/live/api/mediaprocessors#mediaprocessor-ended-reason-values) for more details. + */ + endedReason: string; + /** + * The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. + */ + statusCallback: string; + /** + * The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. + */ + statusCallbackMethod: string; + /** + * The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. + */ + maxDuration: number; + private get _proxy(); + /** + * Fetch a MediaProcessorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaProcessorInstance + */ + fetch(callback?: (error: Error | null, item?: MediaProcessorInstance) => any): Promise; + /** + * Update a MediaProcessorInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaProcessorInstance + */ + update(params: MediaProcessorContextUpdateOptions, callback?: (error: Error | null, item?: MediaProcessorInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + dateCreated: Date; + dateUpdated: Date; + extension: string; + extensionContext: string; + status: MediaProcessorStatus; + url: string; + endedReason: string; + statusCallback: string; + statusCallbackMethod: string; + maxDuration: number; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MediaProcessorSolution { +} +export interface MediaProcessorListInstance { + _version: V1; + _solution: MediaProcessorSolution; + _uri: string; + (sid: string): MediaProcessorContext; + get(sid: string): MediaProcessorContext; + /** + * Create a MediaProcessorInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaProcessorInstance + */ + create(params: MediaProcessorListInstanceCreateOptions, callback?: (error: Error | null, item?: MediaProcessorInstance) => any): Promise; + /** + * Streams MediaProcessorInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaProcessorListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MediaProcessorInstance, done: (err?: Error) => void) => void): void; + each(params: MediaProcessorListInstanceEachOptions, callback?: (item: MediaProcessorInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MediaProcessorInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MediaProcessorPage) => any): Promise; + /** + * Lists MediaProcessorInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaProcessorListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MediaProcessorInstance[]) => any): Promise; + list(params: MediaProcessorListInstanceOptions, callback?: (error: Error | null, items: MediaProcessorInstance[]) => any): Promise; + /** + * Retrieve a single page of MediaProcessorInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaProcessorListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MediaProcessorPage) => any): Promise; + page(params: MediaProcessorListInstancePageOptions, callback?: (error: Error | null, items: MediaProcessorPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MediaProcessorListInstance(version: V1): MediaProcessorListInstance; +export declare class MediaProcessorPage extends Page { + /** + * Initialize the MediaProcessorPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MediaProcessorSolution); + /** + * Build an instance of MediaProcessorInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MediaProcessorResource): MediaProcessorInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/media/v1/mediaProcessor.js b/node_modules/twilio/lib/rest/media/v1/mediaProcessor.js new file mode 100644 index 00000000..ca9545a1 --- /dev/null +++ b/node_modules/twilio/lib/rest/media/v1/mediaProcessor.js @@ -0,0 +1,256 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Media + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MediaProcessorPage = exports.MediaProcessorListInstance = exports.MediaProcessorInstance = exports.MediaProcessorContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class MediaProcessorContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/MediaProcessors/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MediaProcessorInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MediaProcessorInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaProcessorContextImpl = MediaProcessorContextImpl; +class MediaProcessorInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.extension = payload.extension; + this.extensionContext = payload.extension_context; + this.status = payload.status; + this.url = payload.url; + this.endedReason = payload.ended_reason; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.maxDuration = deserialize.integer(payload.max_duration); + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MediaProcessorContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a MediaProcessorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaProcessorInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + extension: this.extension, + extensionContext: this.extensionContext, + status: this.status, + url: this.url, + endedReason: this.endedReason, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + maxDuration: this.maxDuration, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaProcessorInstance = MediaProcessorInstance; +function MediaProcessorListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MediaProcessorContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/MediaProcessors`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["extension"] === null || params["extension"] === undefined) { + throw new Error("Required parameter \"params['extension']\" missing."); + } + if (params["extensionContext"] === null || + params["extensionContext"] === undefined) { + throw new Error("Required parameter \"params['extensionContext']\" missing."); + } + let data = {}; + data["Extension"] = params["extension"]; + data["ExtensionContext"] = params["extensionContext"]; + if (params["extensionEnvironment"] !== undefined) + data["ExtensionEnvironment"] = serialize.object(params["extensionEnvironment"]); + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["maxDuration"] !== undefined) + data["MaxDuration"] = params["maxDuration"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MediaProcessorInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MediaProcessorPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MediaProcessorPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MediaProcessorListInstance = MediaProcessorListInstance; +class MediaProcessorPage extends Page_1.default { + /** + * Initialize the MediaProcessorPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MediaProcessorInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MediaProcessorInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaProcessorPage = MediaProcessorPage; diff --git a/node_modules/twilio/lib/rest/media/v1/mediaRecording.d.ts b/node_modules/twilio/lib/rest/media/v1/mediaRecording.d.ts new file mode 100644 index 00000000..d7d68d61 --- /dev/null +++ b/node_modules/twilio/lib/rest/media/v1/mediaRecording.d.ts @@ -0,0 +1,309 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type MediaRecordingFormat = "mp4" | "webm"; +export type MediaRecordingOrder = "asc" | "desc"; +export type MediaRecordingStatus = "processing" | "completed" | "deleted" | "failed"; +/** + * Options to pass to each + */ +export interface MediaRecordingListInstanceEachOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: MediaRecordingOrder; + /** Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. */ + status?: MediaRecordingStatus; + /** SID of a MediaProcessor to filter by. */ + processorSid?: string; + /** SID of a MediaRecording source to filter by. */ + sourceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MediaRecordingListInstanceOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: MediaRecordingOrder; + /** Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. */ + status?: MediaRecordingStatus; + /** SID of a MediaProcessor to filter by. */ + processorSid?: string; + /** SID of a MediaRecording source to filter by. */ + sourceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MediaRecordingListInstancePageOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: MediaRecordingOrder; + /** Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. */ + status?: MediaRecordingStatus; + /** SID of a MediaProcessor to filter by. */ + processorSid?: string; + /** SID of a MediaRecording source to filter by. */ + sourceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MediaRecordingContext { + /** + * Remove a MediaRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MediaRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaRecordingInstance + */ + fetch(callback?: (error: Error | null, item?: MediaRecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MediaRecordingContextSolution { + sid: string; +} +export declare class MediaRecordingContextImpl implements MediaRecordingContext { + protected _version: V1; + protected _solution: MediaRecordingContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MediaRecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MediaRecordingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MediaRecordingPayload extends TwilioResponsePayload { + media_recordings: MediaRecordingResource[]; +} +interface MediaRecordingResource { + account_sid: string; + date_created: Date; + date_updated: Date; + duration: number; + format: MediaRecordingFormat; + links: Record; + processor_sid: string; + resolution: string; + source_sid: string; + sid: string; + media_size: number; + status: MediaRecordingStatus; + status_callback: string; + status_callback_method: string; + url: string; +} +export declare class MediaRecordingInstance { + protected _version: V1; + protected _solution: MediaRecordingContextSolution; + protected _context?: MediaRecordingContext; + constructor(_version: V1, payload: MediaRecordingResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaRecording resource. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The duration of the MediaRecording in seconds. + */ + duration: number; + format: MediaRecordingFormat; + /** + * The URLs of related resources. + */ + links: Record; + /** + * The SID of the MediaProcessor resource which produced the MediaRecording. + */ + processorSid: string; + /** + * The dimensions of the video image in pixels expressed as columns (width) and rows (height). + */ + resolution: string; + /** + * The SID of the resource that generated the original media track(s) of the MediaRecording. + */ + sourceSid: string; + /** + * The unique string generated to identify the MediaRecording resource. + */ + sid: string; + /** + * The size of the recording media in bytes. + */ + mediaSize: number; + status: MediaRecordingStatus; + /** + * The URL to which Twilio will send asynchronous webhook requests for every MediaRecording event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. + */ + statusCallback: string; + /** + * The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. + */ + statusCallbackMethod: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a MediaRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MediaRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaRecordingInstance + */ + fetch(callback?: (error: Error | null, item?: MediaRecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + duration: number; + format: MediaRecordingFormat; + links: Record; + processorSid: string; + resolution: string; + sourceSid: string; + sid: string; + mediaSize: number; + status: MediaRecordingStatus; + statusCallback: string; + statusCallbackMethod: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MediaRecordingSolution { +} +export interface MediaRecordingListInstance { + _version: V1; + _solution: MediaRecordingSolution; + _uri: string; + (sid: string): MediaRecordingContext; + get(sid: string): MediaRecordingContext; + /** + * Streams MediaRecordingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaRecordingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void): void; + each(params: MediaRecordingListInstanceEachOptions, callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MediaRecordingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise; + /** + * Lists MediaRecordingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaRecordingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MediaRecordingInstance[]) => any): Promise; + list(params: MediaRecordingListInstanceOptions, callback?: (error: Error | null, items: MediaRecordingInstance[]) => any): Promise; + /** + * Retrieve a single page of MediaRecordingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MediaRecordingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise; + page(params: MediaRecordingListInstancePageOptions, callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MediaRecordingListInstance(version: V1): MediaRecordingListInstance; +export declare class MediaRecordingPage extends Page { + /** + * Initialize the MediaRecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MediaRecordingSolution); + /** + * Build an instance of MediaRecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MediaRecordingResource): MediaRecordingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/media/v1/mediaRecording.js b/node_modules/twilio/lib/rest/media/v1/mediaRecording.js new file mode 100644 index 00000000..a355c2c4 --- /dev/null +++ b/node_modules/twilio/lib/rest/media/v1/mediaRecording.js @@ -0,0 +1,226 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Media + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MediaRecordingPage = exports.MediaRecordingListInstance = exports.MediaRecordingInstance = exports.MediaRecordingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class MediaRecordingContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/MediaRecordings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MediaRecordingInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaRecordingContextImpl = MediaRecordingContextImpl; +class MediaRecordingInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.duration = deserialize.integer(payload.duration); + this.format = payload.format; + this.links = payload.links; + this.processorSid = payload.processor_sid; + this.resolution = payload.resolution; + this.sourceSid = payload.source_sid; + this.sid = payload.sid; + this.mediaSize = payload.media_size; + this.status = payload.status; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new MediaRecordingContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a MediaRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a MediaRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MediaRecordingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + duration: this.duration, + format: this.format, + links: this.links, + processorSid: this.processorSid, + resolution: this.resolution, + sourceSid: this.sourceSid, + sid: this.sid, + mediaSize: this.mediaSize, + status: this.status, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaRecordingInstance = MediaRecordingInstance; +function MediaRecordingListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MediaRecordingContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/MediaRecordings`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["processorSid"] !== undefined) + data["ProcessorSid"] = params["processorSid"]; + if (params["sourceSid"] !== undefined) + data["SourceSid"] = params["sourceSid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MediaRecordingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MediaRecordingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MediaRecordingListInstance = MediaRecordingListInstance; +class MediaRecordingPage extends Page_1.default { + /** + * Initialize the MediaRecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MediaRecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MediaRecordingInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MediaRecordingPage = MediaRecordingPage; diff --git a/node_modules/twilio/lib/rest/media/v1/playerStreamer.d.ts b/node_modules/twilio/lib/rest/media/v1/playerStreamer.d.ts new file mode 100644 index 00000000..7121c366 --- /dev/null +++ b/node_modules/twilio/lib/rest/media/v1/playerStreamer.d.ts @@ -0,0 +1,327 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { PlaybackGrantListInstance } from "./playerStreamer/playbackGrant"; +export type PlayerStreamerEndedReason = "ended-via-api" | "max-duration-exceeded" | "stream-disconnected-by-source" | "unexpected-failure"; +export type PlayerStreamerOrder = "asc" | "desc"; +export type PlayerStreamerStatus = "created" | "started" | "ended" | "failed"; +export type PlayerStreamerUpdateStatus = "ended"; +/** + * Options to pass to update a PlayerStreamerInstance + */ +export interface PlayerStreamerContextUpdateOptions { + /** */ + status: PlayerStreamerUpdateStatus; +} +/** + * Options to pass to create a PlayerStreamerInstance + */ +export interface PlayerStreamerListInstanceCreateOptions { + /** Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. */ + video?: boolean; + /** The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. */ + statusCallback?: string; + /** The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. */ + statusCallbackMethod?: string; + /** The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. */ + maxDuration?: number; +} +/** + * Options to pass to each + */ +export interface PlayerStreamerListInstanceEachOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: PlayerStreamerOrder; + /** Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. */ + status?: PlayerStreamerStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: PlayerStreamerInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface PlayerStreamerListInstanceOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: PlayerStreamerOrder; + /** Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. */ + status?: PlayerStreamerStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface PlayerStreamerListInstancePageOptions { + /** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */ + order?: PlayerStreamerOrder; + /** Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. */ + status?: PlayerStreamerStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface PlayerStreamerContext { + playbackGrant: PlaybackGrantListInstance; + /** + * Fetch a PlayerStreamerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlayerStreamerInstance + */ + fetch(callback?: (error: Error | null, item?: PlayerStreamerInstance) => any): Promise; + /** + * Update a PlayerStreamerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlayerStreamerInstance + */ + update(params: PlayerStreamerContextUpdateOptions, callback?: (error: Error | null, item?: PlayerStreamerInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PlayerStreamerContextSolution { + sid: string; +} +export declare class PlayerStreamerContextImpl implements PlayerStreamerContext { + protected _version: V1; + protected _solution: PlayerStreamerContextSolution; + protected _uri: string; + protected _playbackGrant?: PlaybackGrantListInstance; + constructor(_version: V1, sid: string); + get playbackGrant(): PlaybackGrantListInstance; + fetch(callback?: (error: Error | null, item?: PlayerStreamerInstance) => any): Promise; + update(params: PlayerStreamerContextUpdateOptions, callback?: (error: Error | null, item?: PlayerStreamerInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PlayerStreamerContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PlayerStreamerPayload extends TwilioResponsePayload { + player_streamers: PlayerStreamerResource[]; +} +interface PlayerStreamerResource { + account_sid: string; + date_created: Date; + date_updated: Date; + video: boolean; + links: Record; + sid: string; + status: PlayerStreamerStatus; + url: string; + status_callback: string; + status_callback_method: string; + ended_reason: PlayerStreamerEndedReason; + max_duration: number; +} +export declare class PlayerStreamerInstance { + protected _version: V1; + protected _solution: PlayerStreamerContextSolution; + protected _context?: PlayerStreamerContext; + constructor(_version: V1, payload: PlayerStreamerResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PlayerStreamer resource. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. + */ + video: boolean; + /** + * The URLs of related resources. + */ + links: Record; + /** + * The unique string generated to identify the PlayerStreamer resource. + */ + sid: string; + status: PlayerStreamerStatus; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. + */ + statusCallback: string; + /** + * The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. + */ + statusCallbackMethod: string; + endedReason: PlayerStreamerEndedReason; + /** + * The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. + */ + maxDuration: number; + private get _proxy(); + /** + * Fetch a PlayerStreamerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlayerStreamerInstance + */ + fetch(callback?: (error: Error | null, item?: PlayerStreamerInstance) => any): Promise; + /** + * Update a PlayerStreamerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlayerStreamerInstance + */ + update(params: PlayerStreamerContextUpdateOptions, callback?: (error: Error | null, item?: PlayerStreamerInstance) => any): Promise; + /** + * Access the playbackGrant. + */ + playbackGrant(): PlaybackGrantListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + video: boolean; + links: Record; + sid: string; + status: PlayerStreamerStatus; + url: string; + statusCallback: string; + statusCallbackMethod: string; + endedReason: PlayerStreamerEndedReason; + maxDuration: number; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PlayerStreamerSolution { +} +export interface PlayerStreamerListInstance { + _version: V1; + _solution: PlayerStreamerSolution; + _uri: string; + (sid: string): PlayerStreamerContext; + get(sid: string): PlayerStreamerContext; + /** + * Create a PlayerStreamerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlayerStreamerInstance + */ + create(callback?: (error: Error | null, item?: PlayerStreamerInstance) => any): Promise; + /** + * Create a PlayerStreamerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlayerStreamerInstance + */ + create(params: PlayerStreamerListInstanceCreateOptions, callback?: (error: Error | null, item?: PlayerStreamerInstance) => any): Promise; + /** + * Streams PlayerStreamerInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PlayerStreamerListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: PlayerStreamerInstance, done: (err?: Error) => void) => void): void; + each(params: PlayerStreamerListInstanceEachOptions, callback?: (item: PlayerStreamerInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of PlayerStreamerInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: PlayerStreamerPage) => any): Promise; + /** + * Lists PlayerStreamerInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PlayerStreamerListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: PlayerStreamerInstance[]) => any): Promise; + list(params: PlayerStreamerListInstanceOptions, callback?: (error: Error | null, items: PlayerStreamerInstance[]) => any): Promise; + /** + * Retrieve a single page of PlayerStreamerInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PlayerStreamerListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: PlayerStreamerPage) => any): Promise; + page(params: PlayerStreamerListInstancePageOptions, callback?: (error: Error | null, items: PlayerStreamerPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PlayerStreamerListInstance(version: V1): PlayerStreamerListInstance; +export declare class PlayerStreamerPage extends Page { + /** + * Initialize the PlayerStreamerPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: PlayerStreamerSolution); + /** + * Build an instance of PlayerStreamerInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: PlayerStreamerResource): PlayerStreamerInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/media/v1/playerStreamer.js b/node_modules/twilio/lib/rest/media/v1/playerStreamer.js new file mode 100644 index 00000000..c4fdb0f0 --- /dev/null +++ b/node_modules/twilio/lib/rest/media/v1/playerStreamer.js @@ -0,0 +1,264 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Media + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlayerStreamerPage = exports.PlayerStreamerListInstance = exports.PlayerStreamerInstance = exports.PlayerStreamerContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const playbackGrant_1 = require("./playerStreamer/playbackGrant"); +class PlayerStreamerContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/PlayerStreamers/${sid}`; + } + get playbackGrant() { + this._playbackGrant = + this._playbackGrant || + (0, playbackGrant_1.PlaybackGrantListInstance)(this._version, this._solution.sid); + return this._playbackGrant; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PlayerStreamerInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PlayerStreamerInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PlayerStreamerContextImpl = PlayerStreamerContextImpl; +class PlayerStreamerInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.video = payload.video; + this.links = payload.links; + this.sid = payload.sid; + this.status = payload.status; + this.url = payload.url; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.endedReason = payload.ended_reason; + this.maxDuration = deserialize.integer(payload.max_duration); + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PlayerStreamerContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a PlayerStreamerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlayerStreamerInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the playbackGrant. + */ + playbackGrant() { + return this._proxy.playbackGrant; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + video: this.video, + links: this.links, + sid: this.sid, + status: this.status, + url: this.url, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + endedReason: this.endedReason, + maxDuration: this.maxDuration, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PlayerStreamerInstance = PlayerStreamerInstance; +function PlayerStreamerListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PlayerStreamerContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/PlayerStreamers`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["video"] !== undefined) + data["Video"] = serialize.bool(params["video"]); + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["maxDuration"] !== undefined) + data["MaxDuration"] = params["maxDuration"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PlayerStreamerInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PlayerStreamerPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new PlayerStreamerPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PlayerStreamerListInstance = PlayerStreamerListInstance; +class PlayerStreamerPage extends Page_1.default { + /** + * Initialize the PlayerStreamerPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of PlayerStreamerInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new PlayerStreamerInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PlayerStreamerPage = PlayerStreamerPage; diff --git a/node_modules/twilio/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts b/node_modules/twilio/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts new file mode 100644 index 00000000..2d21fc7d --- /dev/null +++ b/node_modules/twilio/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts @@ -0,0 +1,151 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * Options to pass to create a PlaybackGrantInstance + */ +export interface PlaybackGrantContextCreateOptions { + /** The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. */ + ttl?: number; + /** The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. */ + accessControlAllowOrigin?: string; +} +export interface PlaybackGrantContext { + /** + * Create a PlaybackGrantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlaybackGrantInstance + */ + create(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise; + /** + * Create a PlaybackGrantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlaybackGrantInstance + */ + create(params: PlaybackGrantContextCreateOptions, callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise; + /** + * Fetch a PlaybackGrantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlaybackGrantInstance + */ + fetch(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PlaybackGrantContextSolution { + sid: string; +} +export declare class PlaybackGrantContextImpl implements PlaybackGrantContext { + protected _version: V1; + protected _solution: PlaybackGrantContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + create(params?: PlaybackGrantContextCreateOptions | ((error: Error | null, item?: PlaybackGrantInstance) => any), callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise; + fetch(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PlaybackGrantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PlaybackGrantResource { + sid: string; + url: string; + account_sid: string; + date_created: Date; + grant: any; +} +export declare class PlaybackGrantInstance { + protected _version: V1; + protected _solution: PlaybackGrantContextSolution; + protected _context?: PlaybackGrantContext; + constructor(_version: V1, payload: PlaybackGrantResource, sid: string); + /** + * The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for. + */ + sid: string; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this resource. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The grant that authorizes the player sdk to connect to the livestream + */ + grant: any; + private get _proxy(); + /** + * Create a PlaybackGrantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlaybackGrantInstance + */ + create(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise; + /** + * Create a PlaybackGrantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlaybackGrantInstance + */ + create(params: PlaybackGrantContextCreateOptions, callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise; + /** + * Fetch a PlaybackGrantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlaybackGrantInstance + */ + fetch(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + url: string; + accountSid: string; + dateCreated: Date; + grant: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PlaybackGrantSolution { + sid: string; +} +export interface PlaybackGrantListInstance { + _version: V1; + _solution: PlaybackGrantSolution; + _uri: string; + (): PlaybackGrantContext; + get(): PlaybackGrantContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PlaybackGrantListInstance(version: V1, sid: string): PlaybackGrantListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/media/v1/playerStreamer/playbackGrant.js b/node_modules/twilio/lib/rest/media/v1/playerStreamer/playbackGrant.js new file mode 100644 index 00000000..6cf6a0b2 --- /dev/null +++ b/node_modules/twilio/lib/rest/media/v1/playerStreamer/playbackGrant.js @@ -0,0 +1,146 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Media + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlaybackGrantListInstance = exports.PlaybackGrantInstance = exports.PlaybackGrantContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PlaybackGrantContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/PlayerStreamers/${sid}/PlaybackGrant`; + } + create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["accessControlAllowOrigin"] !== undefined) + data["AccessControlAllowOrigin"] = params["accessControlAllowOrigin"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PlaybackGrantInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PlaybackGrantInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PlaybackGrantContextImpl = PlaybackGrantContextImpl; +class PlaybackGrantInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.url = payload.url; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.grant = payload.grant; + this._solution = { sid }; + } + get _proxy() { + this._context = + this._context || + new PlaybackGrantContextImpl(this._version, this._solution.sid); + return this._context; + } + create(params, callback) { + return this._proxy.create(params, callback); + } + /** + * Fetch a PlaybackGrantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PlaybackGrantInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + url: this.url, + accountSid: this.accountSid, + dateCreated: this.dateCreated, + grant: this.grant, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PlaybackGrantInstance = PlaybackGrantInstance; +function PlaybackGrantListInstance(version, sid) { + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new PlaybackGrantContextImpl(version, sid); + }; + instance._version = version; + instance._solution = { sid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PlaybackGrantListInstance = PlaybackGrantListInstance; diff --git a/node_modules/twilio/lib/rest/messaging/V1.d.ts b/node_modules/twilio/lib/rest/messaging/V1.d.ts new file mode 100644 index 00000000..ffb1f033 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/V1.d.ts @@ -0,0 +1,65 @@ +import MessagingBase from "../MessagingBase"; +import Version from "../../base/Version"; +import { BrandRegistrationListInstance } from "./v1/brandRegistration"; +import { DeactivationsListInstance } from "./v1/deactivations"; +import { DomainCertsListInstance } from "./v1/domainCerts"; +import { DomainConfigListInstance } from "./v1/domainConfig"; +import { DomainConfigMessagingServiceListInstance } from "./v1/domainConfigMessagingService"; +import { ExternalCampaignListInstance } from "./v1/externalCampaign"; +import { LinkshorteningMessagingServiceListInstance } from "./v1/linkshorteningMessagingService"; +import { LinkshorteningMessagingServiceDomainAssociationListInstance } from "./v1/linkshorteningMessagingServiceDomainAssociation"; +import { ServiceListInstance } from "./v1/service"; +import { TollfreeVerificationListInstance } from "./v1/tollfreeVerification"; +import { UsecaseListInstance } from "./v1/usecase"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Messaging + * + * @param domain - The Twilio (Twilio.Messaging) domain + */ + constructor(domain: MessagingBase); + /** brandRegistrations - { Twilio.Messaging.V1.BrandRegistrationListInstance } resource */ + protected _brandRegistrations?: BrandRegistrationListInstance; + /** deactivations - { Twilio.Messaging.V1.DeactivationsListInstance } resource */ + protected _deactivations?: DeactivationsListInstance; + /** domainCerts - { Twilio.Messaging.V1.DomainCertsListInstance } resource */ + protected _domainCerts?: DomainCertsListInstance; + /** domainConfig - { Twilio.Messaging.V1.DomainConfigListInstance } resource */ + protected _domainConfig?: DomainConfigListInstance; + /** domainConfigMessagingService - { Twilio.Messaging.V1.DomainConfigMessagingServiceListInstance } resource */ + protected _domainConfigMessagingService?: DomainConfigMessagingServiceListInstance; + /** externalCampaign - { Twilio.Messaging.V1.ExternalCampaignListInstance } resource */ + protected _externalCampaign?: ExternalCampaignListInstance; + /** linkshorteningMessagingService - { Twilio.Messaging.V1.LinkshorteningMessagingServiceListInstance } resource */ + protected _linkshorteningMessagingService?: LinkshorteningMessagingServiceListInstance; + /** linkshorteningMessagingServiceDomainAssociation - { Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationListInstance } resource */ + protected _linkshorteningMessagingServiceDomainAssociation?: LinkshorteningMessagingServiceDomainAssociationListInstance; + /** services - { Twilio.Messaging.V1.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** tollfreeVerifications - { Twilio.Messaging.V1.TollfreeVerificationListInstance } resource */ + protected _tollfreeVerifications?: TollfreeVerificationListInstance; + /** usecases - { Twilio.Messaging.V1.UsecaseListInstance } resource */ + protected _usecases?: UsecaseListInstance; + /** Getter for brandRegistrations resource */ + get brandRegistrations(): BrandRegistrationListInstance; + /** Getter for deactivations resource */ + get deactivations(): DeactivationsListInstance; + /** Getter for domainCerts resource */ + get domainCerts(): DomainCertsListInstance; + /** Getter for domainConfig resource */ + get domainConfig(): DomainConfigListInstance; + /** Getter for domainConfigMessagingService resource */ + get domainConfigMessagingService(): DomainConfigMessagingServiceListInstance; + /** Getter for externalCampaign resource */ + get externalCampaign(): ExternalCampaignListInstance; + /** Getter for linkshorteningMessagingService resource */ + get linkshorteningMessagingService(): LinkshorteningMessagingServiceListInstance; + /** Getter for linkshorteningMessagingServiceDomainAssociation resource */ + get linkshorteningMessagingServiceDomainAssociation(): LinkshorteningMessagingServiceDomainAssociationListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; + /** Getter for tollfreeVerifications resource */ + get tollfreeVerifications(): TollfreeVerificationListInstance; + /** Getter for usecases resource */ + get usecases(): UsecaseListInstance; +} diff --git a/node_modules/twilio/lib/rest/messaging/V1.js b/node_modules/twilio/lib/rest/messaging/V1.js new file mode 100644 index 00000000..ece47923 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/V1.js @@ -0,0 +1,106 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const brandRegistration_1 = require("./v1/brandRegistration"); +const deactivations_1 = require("./v1/deactivations"); +const domainCerts_1 = require("./v1/domainCerts"); +const domainConfig_1 = require("./v1/domainConfig"); +const domainConfigMessagingService_1 = require("./v1/domainConfigMessagingService"); +const externalCampaign_1 = require("./v1/externalCampaign"); +const linkshorteningMessagingService_1 = require("./v1/linkshorteningMessagingService"); +const linkshorteningMessagingServiceDomainAssociation_1 = require("./v1/linkshorteningMessagingServiceDomainAssociation"); +const service_1 = require("./v1/service"); +const tollfreeVerification_1 = require("./v1/tollfreeVerification"); +const usecase_1 = require("./v1/usecase"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Messaging + * + * @param domain - The Twilio (Twilio.Messaging) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for brandRegistrations resource */ + get brandRegistrations() { + this._brandRegistrations = + this._brandRegistrations || (0, brandRegistration_1.BrandRegistrationListInstance)(this); + return this._brandRegistrations; + } + /** Getter for deactivations resource */ + get deactivations() { + this._deactivations = + this._deactivations || (0, deactivations_1.DeactivationsListInstance)(this); + return this._deactivations; + } + /** Getter for domainCerts resource */ + get domainCerts() { + this._domainCerts = this._domainCerts || (0, domainCerts_1.DomainCertsListInstance)(this); + return this._domainCerts; + } + /** Getter for domainConfig resource */ + get domainConfig() { + this._domainConfig = this._domainConfig || (0, domainConfig_1.DomainConfigListInstance)(this); + return this._domainConfig; + } + /** Getter for domainConfigMessagingService resource */ + get domainConfigMessagingService() { + this._domainConfigMessagingService = + this._domainConfigMessagingService || + (0, domainConfigMessagingService_1.DomainConfigMessagingServiceListInstance)(this); + return this._domainConfigMessagingService; + } + /** Getter for externalCampaign resource */ + get externalCampaign() { + this._externalCampaign = + this._externalCampaign || (0, externalCampaign_1.ExternalCampaignListInstance)(this); + return this._externalCampaign; + } + /** Getter for linkshorteningMessagingService resource */ + get linkshorteningMessagingService() { + this._linkshorteningMessagingService = + this._linkshorteningMessagingService || + (0, linkshorteningMessagingService_1.LinkshorteningMessagingServiceListInstance)(this); + return this._linkshorteningMessagingService; + } + /** Getter for linkshorteningMessagingServiceDomainAssociation resource */ + get linkshorteningMessagingServiceDomainAssociation() { + this._linkshorteningMessagingServiceDomainAssociation = + this._linkshorteningMessagingServiceDomainAssociation || + (0, linkshorteningMessagingServiceDomainAssociation_1.LinkshorteningMessagingServiceDomainAssociationListInstance)(this); + return this._linkshorteningMessagingServiceDomainAssociation; + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } + /** Getter for tollfreeVerifications resource */ + get tollfreeVerifications() { + this._tollfreeVerifications = + this._tollfreeVerifications || (0, tollfreeVerification_1.TollfreeVerificationListInstance)(this); + return this._tollfreeVerifications; + } + /** Getter for usecases resource */ + get usecases() { + this._usecases = this._usecases || (0, usecase_1.UsecaseListInstance)(this); + return this._usecases; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/messaging/v1/brandRegistration.d.ts b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration.d.ts new file mode 100644 index 00000000..d01581a3 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration.d.ts @@ -0,0 +1,352 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { BrandRegistrationOtpListInstance } from "./brandRegistration/brandRegistrationOtp"; +import { BrandVettingListInstance } from "./brandRegistration/brandVetting"; +export type BrandRegistrationBrandFeedback = "TAX_ID" | "STOCK_SYMBOL" | "NONPROFIT" | "GOVERNMENT_ENTITY" | "OTHERS"; +export type BrandRegistrationIdentityStatus = "SELF_DECLARED" | "UNVERIFIED" | "VERIFIED" | "VETTED_VERIFIED"; +export type BrandRegistrationStatus = "PENDING" | "APPROVED" | "FAILED" | "IN_REVIEW" | "DELETED"; +/** + * Options to pass to create a BrandRegistrationInstance + */ +export interface BrandRegistrationListInstanceCreateOptions { + /** Customer Profile Bundle Sid. */ + customerProfileBundleSid: string; + /** A2P Messaging Profile Bundle Sid. */ + a2PProfileBundleSid: string; + /** Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. */ + brandType?: string; + /** A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. */ + mock?: boolean; + /** A flag to disable automatic secondary vetting for brands which it would otherwise be done. */ + skipAutomaticSecVet?: boolean; +} +/** + * Options to pass to each + */ +export interface BrandRegistrationListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BrandRegistrationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BrandRegistrationListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BrandRegistrationListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BrandRegistrationContext { + brandRegistrationOtps: BrandRegistrationOtpListInstance; + brandVettings: BrandVettingListInstance; + /** + * Fetch a BrandRegistrationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandRegistrationInstance + */ + fetch(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise; + /** + * Update a BrandRegistrationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandRegistrationInstance + */ + update(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BrandRegistrationContextSolution { + sid: string; +} +export declare class BrandRegistrationContextImpl implements BrandRegistrationContext { + protected _version: V1; + protected _solution: BrandRegistrationContextSolution; + protected _uri: string; + protected _brandRegistrationOtps?: BrandRegistrationOtpListInstance; + protected _brandVettings?: BrandVettingListInstance; + constructor(_version: V1, sid: string); + get brandRegistrationOtps(): BrandRegistrationOtpListInstance; + get brandVettings(): BrandVettingListInstance; + fetch(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise; + update(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BrandRegistrationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BrandRegistrationPayload extends TwilioResponsePayload { + data: BrandRegistrationResource[]; +} +interface BrandRegistrationResource { + sid: string; + account_sid: string; + customer_profile_bundle_sid: string; + a2p_profile_bundle_sid: string; + date_created: Date; + date_updated: Date; + brand_type: string; + status: BrandRegistrationStatus; + tcr_id: string; + failure_reason: string; + url: string; + brand_score: number; + brand_feedback: Array; + identity_status: BrandRegistrationIdentityStatus; + russell_3000: boolean; + government_entity: boolean; + tax_exempt_status: string; + skip_automatic_sec_vet: boolean; + mock: boolean; + links: Record; +} +export declare class BrandRegistrationInstance { + protected _version: V1; + protected _solution: BrandRegistrationContextSolution; + protected _context?: BrandRegistrationContext; + constructor(_version: V1, payload: BrandRegistrationResource, sid?: string); + /** + * The unique string to identify Brand Registration. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Brand Registration resource. + */ + accountSid: string; + /** + * A2P Messaging Profile Bundle BundleSid. + */ + customerProfileBundleSid: string; + /** + * A2P Messaging Profile Bundle BundleSid. + */ + a2pProfileBundleSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Type of brand. One of: \"STANDARD\", \"SOLE_PROPRIETOR\". SOLE_PROPRIETOR is for the low volume, SOLE_PROPRIETOR campaign use case. There can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR brand. STANDARD is for all other campaign use cases. Multiple campaign use cases can be created per STANDARD brand. + */ + brandType: string; + status: BrandRegistrationStatus; + /** + * Campaign Registry (TCR) Brand ID. Assigned only after successful brand registration. + */ + tcrId: string; + /** + * A reason why brand registration has failed. Only applicable when status is FAILED. + */ + failureReason: string; + /** + * The absolute URL of the Brand Registration resource. + */ + url: string; + /** + * The secondary vetting score if it was done. Otherwise, it will be the brand score if it\'s returned from TCR. It may be null if no score is available. + */ + brandScore: number; + /** + * Feedback on how to improve brand score + */ + brandFeedback: Array; + identityStatus: BrandRegistrationIdentityStatus; + /** + * Publicly traded company identified in the Russell 3000 Index + */ + russell3000: boolean; + /** + * Identified as a government entity + */ + governmentEntity: boolean; + /** + * Nonprofit organization tax-exempt status per section 501 of the U.S. tax code. + */ + taxExemptStatus: string; + /** + * A flag to disable automatic secondary vetting for brands which it would otherwise be done. + */ + skipAutomaticSecVet: boolean; + /** + * A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. + */ + mock: boolean; + links: Record; + private get _proxy(); + /** + * Fetch a BrandRegistrationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandRegistrationInstance + */ + fetch(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise; + /** + * Update a BrandRegistrationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandRegistrationInstance + */ + update(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise; + /** + * Access the brandRegistrationOtps. + */ + brandRegistrationOtps(): BrandRegistrationOtpListInstance; + /** + * Access the brandVettings. + */ + brandVettings(): BrandVettingListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + customerProfileBundleSid: string; + a2pProfileBundleSid: string; + dateCreated: Date; + dateUpdated: Date; + brandType: string; + status: BrandRegistrationStatus; + tcrId: string; + failureReason: string; + url: string; + brandScore: number; + brandFeedback: BrandRegistrationBrandFeedback[]; + identityStatus: BrandRegistrationIdentityStatus; + russell3000: boolean; + governmentEntity: boolean; + taxExemptStatus: string; + skipAutomaticSecVet: boolean; + mock: boolean; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BrandRegistrationSolution { +} +export interface BrandRegistrationListInstance { + _version: V1; + _solution: BrandRegistrationSolution; + _uri: string; + (sid: string): BrandRegistrationContext; + get(sid: string): BrandRegistrationContext; + /** + * Create a BrandRegistrationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandRegistrationInstance + */ + create(params: BrandRegistrationListInstanceCreateOptions, callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise; + /** + * Streams BrandRegistrationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BrandRegistrationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BrandRegistrationInstance, done: (err?: Error) => void) => void): void; + each(params: BrandRegistrationListInstanceEachOptions, callback?: (item: BrandRegistrationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BrandRegistrationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BrandRegistrationPage) => any): Promise; + /** + * Lists BrandRegistrationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BrandRegistrationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BrandRegistrationInstance[]) => any): Promise; + list(params: BrandRegistrationListInstanceOptions, callback?: (error: Error | null, items: BrandRegistrationInstance[]) => any): Promise; + /** + * Retrieve a single page of BrandRegistrationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BrandRegistrationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BrandRegistrationPage) => any): Promise; + page(params: BrandRegistrationListInstancePageOptions, callback?: (error: Error | null, items: BrandRegistrationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BrandRegistrationListInstance(version: V1): BrandRegistrationListInstance; +export declare class BrandRegistrationPage extends Page { + /** + * Initialize the BrandRegistrationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: BrandRegistrationSolution); + /** + * Build an instance of BrandRegistrationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BrandRegistrationResource): BrandRegistrationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/brandRegistration.js b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration.js new file mode 100644 index 00000000..5677db20 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration.js @@ -0,0 +1,288 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BrandRegistrationPage = exports.BrandRegistrationListInstance = exports.BrandRegistrationInstance = exports.BrandRegistrationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const brandRegistrationOtp_1 = require("./brandRegistration/brandRegistrationOtp"); +const brandVetting_1 = require("./brandRegistration/brandVetting"); +class BrandRegistrationContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/a2p/BrandRegistrations/${sid}`; + } + get brandRegistrationOtps() { + this._brandRegistrationOtps = + this._brandRegistrationOtps || + (0, brandRegistrationOtp_1.BrandRegistrationOtpListInstance)(this._version, this._solution.sid); + return this._brandRegistrationOtps; + } + get brandVettings() { + this._brandVettings = + this._brandVettings || + (0, brandVetting_1.BrandVettingListInstance)(this._version, this._solution.sid); + return this._brandVettings; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BrandRegistrationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + }); + operationPromise = operationPromise.then((payload) => new BrandRegistrationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BrandRegistrationContextImpl = BrandRegistrationContextImpl; +class BrandRegistrationInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.customerProfileBundleSid = payload.customer_profile_bundle_sid; + this.a2pProfileBundleSid = payload.a2p_profile_bundle_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.brandType = payload.brand_type; + this.status = payload.status; + this.tcrId = payload.tcr_id; + this.failureReason = payload.failure_reason; + this.url = payload.url; + this.brandScore = deserialize.integer(payload.brand_score); + this.brandFeedback = payload.brand_feedback; + this.identityStatus = payload.identity_status; + this.russell3000 = payload.russell_3000; + this.governmentEntity = payload.government_entity; + this.taxExemptStatus = payload.tax_exempt_status; + this.skipAutomaticSecVet = payload.skip_automatic_sec_vet; + this.mock = payload.mock; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new BrandRegistrationContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a BrandRegistrationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandRegistrationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Update a BrandRegistrationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandRegistrationInstance + */ + update(callback) { + return this._proxy.update(callback); + } + /** + * Access the brandRegistrationOtps. + */ + brandRegistrationOtps() { + return this._proxy.brandRegistrationOtps; + } + /** + * Access the brandVettings. + */ + brandVettings() { + return this._proxy.brandVettings; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + customerProfileBundleSid: this.customerProfileBundleSid, + a2pProfileBundleSid: this.a2pProfileBundleSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + brandType: this.brandType, + status: this.status, + tcrId: this.tcrId, + failureReason: this.failureReason, + url: this.url, + brandScore: this.brandScore, + brandFeedback: this.brandFeedback, + identityStatus: this.identityStatus, + russell3000: this.russell3000, + governmentEntity: this.governmentEntity, + taxExemptStatus: this.taxExemptStatus, + skipAutomaticSecVet: this.skipAutomaticSecVet, + mock: this.mock, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BrandRegistrationInstance = BrandRegistrationInstance; +function BrandRegistrationListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new BrandRegistrationContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/a2p/BrandRegistrations`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["customerProfileBundleSid"] === null || + params["customerProfileBundleSid"] === undefined) { + throw new Error("Required parameter \"params['customerProfileBundleSid']\" missing."); + } + if (params["a2PProfileBundleSid"] === null || + params["a2PProfileBundleSid"] === undefined) { + throw new Error("Required parameter \"params['a2PProfileBundleSid']\" missing."); + } + let data = {}; + data["CustomerProfileBundleSid"] = params["customerProfileBundleSid"]; + data["A2PProfileBundleSid"] = params["a2PProfileBundleSid"]; + if (params["brandType"] !== undefined) + data["BrandType"] = params["brandType"]; + if (params["mock"] !== undefined) + data["Mock"] = serialize.bool(params["mock"]); + if (params["skipAutomaticSecVet"] !== undefined) + data["SkipAutomaticSecVet"] = serialize.bool(params["skipAutomaticSecVet"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BrandRegistrationInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BrandRegistrationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BrandRegistrationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BrandRegistrationListInstance = BrandRegistrationListInstance; +class BrandRegistrationPage extends Page_1.default { + /** + * Initialize the BrandRegistrationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BrandRegistrationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BrandRegistrationInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BrandRegistrationPage = BrandRegistrationPage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandRegistrationOtp.d.ts b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandRegistrationOtp.d.ts new file mode 100644 index 00000000..0206d2ac --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandRegistrationOtp.d.ts @@ -0,0 +1,52 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export interface BrandRegistrationOtpSolution { + brandRegistrationSid: string; +} +export interface BrandRegistrationOtpListInstance { + _version: V1; + _solution: BrandRegistrationOtpSolution; + _uri: string; + /** + * Create a BrandRegistrationOtpInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandRegistrationOtpInstance + */ + create(callback?: (error: Error | null, item?: BrandRegistrationOtpInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BrandRegistrationOtpListInstance(version: V1, brandRegistrationSid: string): BrandRegistrationOtpListInstance; +interface BrandRegistrationOtpResource { + account_sid: string; + brand_registration_sid: string; +} +export declare class BrandRegistrationOtpInstance { + protected _version: V1; + constructor(_version: V1, payload: BrandRegistrationOtpResource, brandRegistrationSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Brand Registration resource. + */ + accountSid: string; + /** + * The unique string to identify Brand Registration of Sole Proprietor Brand + */ + brandRegistrationSid: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + brandRegistrationSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandRegistrationOtp.js b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandRegistrationOtp.js new file mode 100644 index 00000000..c9100772 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandRegistrationOtp.js @@ -0,0 +1,68 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BrandRegistrationOtpInstance = exports.BrandRegistrationOtpListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function BrandRegistrationOtpListInstance(version, brandRegistrationSid) { + if (!(0, utility_1.isValidPathParam)(brandRegistrationSid)) { + throw new Error("Parameter 'brandRegistrationSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { brandRegistrationSid }; + instance._uri = `/a2p/BrandRegistrations/${brandRegistrationSid}/SmsOtp`; + instance.create = function create(callback) { + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + }); + operationPromise = operationPromise.then((payload) => new BrandRegistrationOtpInstance(operationVersion, payload, instance._solution.brandRegistrationSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BrandRegistrationOtpListInstance = BrandRegistrationOtpListInstance; +class BrandRegistrationOtpInstance { + constructor(_version, payload, brandRegistrationSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.brandRegistrationSid = payload.brand_registration_sid; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + brandRegistrationSid: this.brandRegistrationSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BrandRegistrationOtpInstance = BrandRegistrationOtpInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts new file mode 100644 index 00000000..88eff99e --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts @@ -0,0 +1,265 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type BrandVettingVettingProvider = "campaign-verify"; +/** + * Options to pass to create a BrandVettingInstance + */ +export interface BrandVettingListInstanceCreateOptions { + /** */ + vettingProvider: BrandVettingVettingProvider; + /** The unique ID of the vetting */ + vettingId?: string; +} +/** + * Options to pass to each + */ +export interface BrandVettingListInstanceEachOptions { + /** The third-party provider of the vettings to read */ + vettingProvider?: BrandVettingVettingProvider; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BrandVettingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BrandVettingListInstanceOptions { + /** The third-party provider of the vettings to read */ + vettingProvider?: BrandVettingVettingProvider; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BrandVettingListInstancePageOptions { + /** The third-party provider of the vettings to read */ + vettingProvider?: BrandVettingVettingProvider; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BrandVettingContext { + /** + * Fetch a BrandVettingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandVettingInstance + */ + fetch(callback?: (error: Error | null, item?: BrandVettingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BrandVettingContextSolution { + brandSid: string; + brandVettingSid: string; +} +export declare class BrandVettingContextImpl implements BrandVettingContext { + protected _version: V1; + protected _solution: BrandVettingContextSolution; + protected _uri: string; + constructor(_version: V1, brandSid: string, brandVettingSid: string); + fetch(callback?: (error: Error | null, item?: BrandVettingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BrandVettingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BrandVettingPayload extends TwilioResponsePayload { + data: BrandVettingResource[]; +} +interface BrandVettingResource { + account_sid: string; + brand_sid: string; + brand_vetting_sid: string; + date_updated: Date; + date_created: Date; + vetting_id: string; + vetting_class: string; + vetting_status: string; + vetting_provider: BrandVettingVettingProvider; + url: string; +} +export declare class BrandVettingInstance { + protected _version: V1; + protected _solution: BrandVettingContextSolution; + protected _context?: BrandVettingContext; + constructor(_version: V1, payload: BrandVettingResource, brandSid: string, brandVettingSid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the vetting record. + */ + accountSid: string; + /** + * The unique string to identify Brand Registration. + */ + brandSid: string; + /** + * The Twilio SID of the third-party vetting record. + */ + brandVettingSid: string; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The unique identifier of the vetting from the third-party provider. + */ + vettingId: string; + /** + * The type of vetting that has been conducted. One of “STANDARD” (Aegis) or “POLITICAL” (Campaign Verify). + */ + vettingClass: string; + /** + * The status of the import vetting attempt. One of “PENDING,” “SUCCESS,” or “FAILED”. + */ + vettingStatus: string; + vettingProvider: BrandVettingVettingProvider; + /** + * The absolute URL of the Brand Vetting resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a BrandVettingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandVettingInstance + */ + fetch(callback?: (error: Error | null, item?: BrandVettingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + brandSid: string; + brandVettingSid: string; + dateUpdated: Date; + dateCreated: Date; + vettingId: string; + vettingClass: string; + vettingStatus: string; + vettingProvider: "campaign-verify"; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BrandVettingSolution { + brandSid: string; +} +export interface BrandVettingListInstance { + _version: V1; + _solution: BrandVettingSolution; + _uri: string; + (brandVettingSid: string): BrandVettingContext; + get(brandVettingSid: string): BrandVettingContext; + /** + * Create a BrandVettingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandVettingInstance + */ + create(params: BrandVettingListInstanceCreateOptions, callback?: (error: Error | null, item?: BrandVettingInstance) => any): Promise; + /** + * Streams BrandVettingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BrandVettingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BrandVettingInstance, done: (err?: Error) => void) => void): void; + each(params: BrandVettingListInstanceEachOptions, callback?: (item: BrandVettingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BrandVettingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BrandVettingPage) => any): Promise; + /** + * Lists BrandVettingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BrandVettingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BrandVettingInstance[]) => any): Promise; + list(params: BrandVettingListInstanceOptions, callback?: (error: Error | null, items: BrandVettingInstance[]) => any): Promise; + /** + * Retrieve a single page of BrandVettingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BrandVettingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BrandVettingPage) => any): Promise; + page(params: BrandVettingListInstancePageOptions, callback?: (error: Error | null, items: BrandVettingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BrandVettingListInstance(version: V1, brandSid: string): BrandVettingListInstance; +export declare class BrandVettingPage extends Page { + /** + * Initialize the BrandVettingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: BrandVettingSolution); + /** + * Build an instance of BrandVettingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BrandVettingResource): BrandVettingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandVetting.js b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandVetting.js new file mode 100644 index 00000000..2a9206ef --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/brandRegistration/brandVetting.js @@ -0,0 +1,224 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BrandVettingPage = exports.BrandVettingListInstance = exports.BrandVettingInstance = exports.BrandVettingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class BrandVettingContextImpl { + constructor(_version, brandSid, brandVettingSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(brandSid)) { + throw new Error("Parameter 'brandSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(brandVettingSid)) { + throw new Error("Parameter 'brandVettingSid' is not valid."); + } + this._solution = { brandSid, brandVettingSid }; + this._uri = `/a2p/BrandRegistrations/${brandSid}/Vettings/${brandVettingSid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BrandVettingInstance(operationVersion, payload, instance._solution.brandSid, instance._solution.brandVettingSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BrandVettingContextImpl = BrandVettingContextImpl; +class BrandVettingInstance { + constructor(_version, payload, brandSid, brandVettingSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.brandSid = payload.brand_sid; + this.brandVettingSid = payload.brand_vetting_sid; + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.vettingId = payload.vetting_id; + this.vettingClass = payload.vetting_class; + this.vettingStatus = payload.vetting_status; + this.vettingProvider = payload.vetting_provider; + this.url = payload.url; + this._solution = { + brandSid, + brandVettingSid: brandVettingSid || this.brandVettingSid, + }; + } + get _proxy() { + this._context = + this._context || + new BrandVettingContextImpl(this._version, this._solution.brandSid, this._solution.brandVettingSid); + return this._context; + } + /** + * Fetch a BrandVettingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BrandVettingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + brandSid: this.brandSid, + brandVettingSid: this.brandVettingSid, + dateUpdated: this.dateUpdated, + dateCreated: this.dateCreated, + vettingId: this.vettingId, + vettingClass: this.vettingClass, + vettingStatus: this.vettingStatus, + vettingProvider: this.vettingProvider, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BrandVettingInstance = BrandVettingInstance; +function BrandVettingListInstance(version, brandSid) { + if (!(0, utility_1.isValidPathParam)(brandSid)) { + throw new Error("Parameter 'brandSid' is not valid."); + } + const instance = ((brandVettingSid) => instance.get(brandVettingSid)); + instance.get = function get(brandVettingSid) { + return new BrandVettingContextImpl(version, brandSid, brandVettingSid); + }; + instance._version = version; + instance._solution = { brandSid }; + instance._uri = `/a2p/BrandRegistrations/${brandSid}/Vettings`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["vettingProvider"] === null || + params["vettingProvider"] === undefined) { + throw new Error("Required parameter \"params['vettingProvider']\" missing."); + } + let data = {}; + data["VettingProvider"] = params["vettingProvider"]; + if (params["vettingId"] !== undefined) + data["VettingId"] = params["vettingId"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BrandVettingInstance(operationVersion, payload, instance._solution.brandSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["vettingProvider"] !== undefined) + data["VettingProvider"] = params["vettingProvider"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BrandVettingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BrandVettingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BrandVettingListInstance = BrandVettingListInstance; +class BrandVettingPage extends Page_1.default { + /** + * Initialize the BrandVettingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BrandVettingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BrandVettingInstance(this._version, payload, this._solution.brandSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BrandVettingPage = BrandVettingPage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/deactivations.d.ts b/node_modules/twilio/lib/rest/messaging/v1/deactivations.d.ts new file mode 100644 index 00000000..9ccea854 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/deactivations.d.ts @@ -0,0 +1,106 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to fetch a DeactivationsInstance + */ +export interface DeactivationsContextFetchOptions { + /** The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. */ + date?: Date; +} +export interface DeactivationsContext { + /** + * Fetch a DeactivationsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeactivationsInstance + */ + fetch(callback?: (error: Error | null, item?: DeactivationsInstance) => any): Promise; + /** + * Fetch a DeactivationsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeactivationsInstance + */ + fetch(params: DeactivationsContextFetchOptions, callback?: (error: Error | null, item?: DeactivationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeactivationsContextSolution { +} +export declare class DeactivationsContextImpl implements DeactivationsContext { + protected _version: V1; + protected _solution: DeactivationsContextSolution; + protected _uri: string; + constructor(_version: V1); + fetch(params?: DeactivationsContextFetchOptions | ((error: Error | null, item?: DeactivationsInstance) => any), callback?: (error: Error | null, item?: DeactivationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeactivationsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DeactivationsResource { + redirect_to: string; +} +export declare class DeactivationsInstance { + protected _version: V1; + protected _solution: DeactivationsContextSolution; + protected _context?: DeactivationsContext; + constructor(_version: V1, payload: DeactivationsResource); + /** + * Returns an authenticated url that redirects to a file containing the deactivated numbers for the requested day. This url is valid for up to two minutes. + */ + redirectTo: string; + private get _proxy(); + /** + * Fetch a DeactivationsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeactivationsInstance + */ + fetch(callback?: (error: Error | null, item?: DeactivationsInstance) => any): Promise; + /** + * Fetch a DeactivationsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeactivationsInstance + */ + fetch(params: DeactivationsContextFetchOptions, callback?: (error: Error | null, item?: DeactivationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + redirectTo: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeactivationsSolution { +} +export interface DeactivationsListInstance { + _version: V1; + _solution: DeactivationsSolution; + _uri: string; + (): DeactivationsContext; + get(): DeactivationsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeactivationsListInstance(version: V1): DeactivationsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/deactivations.js b/node_modules/twilio/lib/rest/messaging/v1/deactivations.js new file mode 100644 index 00000000..84b6548f --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/deactivations.js @@ -0,0 +1,107 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeactivationsListInstance = exports.DeactivationsInstance = exports.DeactivationsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class DeactivationsContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Deactivations`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["date"] !== undefined) + data["Date"] = serialize.iso8601Date(params["date"]); + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeactivationsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeactivationsContextImpl = DeactivationsContextImpl; +class DeactivationsInstance { + constructor(_version, payload) { + this._version = _version; + this.redirectTo = payload.redirect_to; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new DeactivationsContextImpl(this._version); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + redirectTo: this.redirectTo, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeactivationsInstance = DeactivationsInstance; +function DeactivationsListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new DeactivationsContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeactivationsListInstance = DeactivationsListInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/domainCerts.d.ts b/node_modules/twilio/lib/rest/messaging/v1/domainCerts.d.ts new file mode 100644 index 00000000..ed8ee1f0 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/domainCerts.d.ts @@ -0,0 +1,164 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to update a DomainCertsInstance + */ +export interface DomainCertsContextUpdateOptions { + /** Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. */ + tlsCert: string; +} +export interface DomainCertsContext { + /** + * Remove a DomainCertsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DomainCertsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainCertsInstance + */ + fetch(callback?: (error: Error | null, item?: DomainCertsInstance) => any): Promise; + /** + * Update a DomainCertsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainCertsInstance + */ + update(params: DomainCertsContextUpdateOptions, callback?: (error: Error | null, item?: DomainCertsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DomainCertsContextSolution { + domainSid: string; +} +export declare class DomainCertsContextImpl implements DomainCertsContext { + protected _version: V1; + protected _solution: DomainCertsContextSolution; + protected _uri: string; + constructor(_version: V1, domainSid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DomainCertsInstance) => any): Promise; + update(params: DomainCertsContextUpdateOptions, callback?: (error: Error | null, item?: DomainCertsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DomainCertsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DomainCertsResource { + domain_sid: string; + date_updated: Date; + date_expires: Date; + date_created: Date; + domain_name: string; + certificate_sid: string; + url: string; + cert_in_validation: any; +} +export declare class DomainCertsInstance { + protected _version: V1; + protected _solution: DomainCertsContextSolution; + protected _context?: DomainCertsContext; + constructor(_version: V1, payload: DomainCertsResource, domainSid?: string); + /** + * The unique string that we created to identify the Domain resource. + */ + domainSid: string; + /** + * Date that this Domain was last updated. + */ + dateUpdated: Date; + /** + * Date that the private certificate associated with this domain expires. You will need to update the certificate before that date to ensure your shortened links will continue to work. + */ + dateExpires: Date; + /** + * Date that this Domain was registered to the Twilio platform to create a new Domain object. + */ + dateCreated: Date; + /** + * Full url path for this domain. + */ + domainName: string; + /** + * The unique string that we created to identify this Certificate resource. + */ + certificateSid: string; + url: string; + /** + * Optional JSON field describing the status and upload date of a new certificate in the process of validation + */ + certInValidation: any; + private get _proxy(); + /** + * Remove a DomainCertsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DomainCertsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainCertsInstance + */ + fetch(callback?: (error: Error | null, item?: DomainCertsInstance) => any): Promise; + /** + * Update a DomainCertsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainCertsInstance + */ + update(params: DomainCertsContextUpdateOptions, callback?: (error: Error | null, item?: DomainCertsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + domainSid: string; + dateUpdated: Date; + dateExpires: Date; + dateCreated: Date; + domainName: string; + certificateSid: string; + url: string; + certInValidation: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DomainCertsSolution { +} +export interface DomainCertsListInstance { + _version: V1; + _solution: DomainCertsSolution; + _uri: string; + (domainSid: string): DomainCertsContext; + get(domainSid: string): DomainCertsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DomainCertsListInstance(version: V1): DomainCertsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/domainCerts.js b/node_modules/twilio/lib/rest/messaging/v1/domainCerts.js new file mode 100644 index 00000000..cbdaa672 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/domainCerts.js @@ -0,0 +1,164 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DomainCertsListInstance = exports.DomainCertsInstance = exports.DomainCertsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class DomainCertsContextImpl { + constructor(_version, domainSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + this._solution = { domainSid }; + this._uri = `/LinkShortening/Domains/${domainSid}/Certificate`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DomainCertsInstance(operationVersion, payload, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["tlsCert"] === null || params["tlsCert"] === undefined) { + throw new Error("Required parameter \"params['tlsCert']\" missing."); + } + let data = {}; + data["TlsCert"] = params["tlsCert"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DomainCertsInstance(operationVersion, payload, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainCertsContextImpl = DomainCertsContextImpl; +class DomainCertsInstance { + constructor(_version, payload, domainSid) { + this._version = _version; + this.domainSid = payload.domain_sid; + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.dateExpires = deserialize.iso8601DateTime(payload.date_expires); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.domainName = payload.domain_name; + this.certificateSid = payload.certificate_sid; + this.url = payload.url; + this.certInValidation = payload.cert_in_validation; + this._solution = { domainSid: domainSid || this.domainSid }; + } + get _proxy() { + this._context = + this._context || + new DomainCertsContextImpl(this._version, this._solution.domainSid); + return this._context; + } + /** + * Remove a DomainCertsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DomainCertsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainCertsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + domainSid: this.domainSid, + dateUpdated: this.dateUpdated, + dateExpires: this.dateExpires, + dateCreated: this.dateCreated, + domainName: this.domainName, + certificateSid: this.certificateSid, + url: this.url, + certInValidation: this.certInValidation, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainCertsInstance = DomainCertsInstance; +function DomainCertsListInstance(version) { + const instance = ((domainSid) => instance.get(domainSid)); + instance.get = function get(domainSid) { + return new DomainCertsContextImpl(version, domainSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DomainCertsListInstance = DomainCertsListInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/domainConfig.d.ts b/node_modules/twilio/lib/rest/messaging/v1/domainConfig.d.ts new file mode 100644 index 00000000..abf1c4c4 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/domainConfig.d.ts @@ -0,0 +1,175 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to update a DomainConfigInstance + */ +export interface DomainConfigContextUpdateOptions { + /** Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. */ + fallbackUrl?: string; + /** URL to receive click events to your webhook whenever the recipients click on the shortened links */ + callbackUrl?: string; + /** Boolean field to set customer delivery preference when there is a failure in linkShortening service */ + continueOnFailure?: boolean; + /** Customer\\\'s choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. */ + disableHttps?: boolean; +} +export interface DomainConfigContext { + /** + * Fetch a DomainConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigInstance + */ + fetch(callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise; + /** + * Update a DomainConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigInstance + */ + update(callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise; + /** + * Update a DomainConfigInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigInstance + */ + update(params: DomainConfigContextUpdateOptions, callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DomainConfigContextSolution { + domainSid: string; +} +export declare class DomainConfigContextImpl implements DomainConfigContext { + protected _version: V1; + protected _solution: DomainConfigContextSolution; + protected _uri: string; + constructor(_version: V1, domainSid: string); + fetch(callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise; + update(params?: DomainConfigContextUpdateOptions | ((error: Error | null, item?: DomainConfigInstance) => any), callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DomainConfigContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DomainConfigResource { + domain_sid: string; + config_sid: string; + fallback_url: string; + callback_url: string; + continue_on_failure: boolean; + date_created: Date; + date_updated: Date; + url: string; + disable_https: boolean; +} +export declare class DomainConfigInstance { + protected _version: V1; + protected _solution: DomainConfigContextSolution; + protected _context?: DomainConfigContext; + constructor(_version: V1, payload: DomainConfigResource, domainSid?: string); + /** + * The unique string that we created to identify the Domain resource. + */ + domainSid: string; + /** + * The unique string that we created to identify the Domain config (prefix ZK). + */ + configSid: string; + /** + * Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. + */ + fallbackUrl: string; + /** + * URL to receive click events to your webhook whenever the recipients click on the shortened links. + */ + callbackUrl: string; + /** + * Boolean field to set customer delivery preference when there is a failure in linkShortening service + */ + continueOnFailure: boolean; + /** + * Date this Domain Config was created. + */ + dateCreated: Date; + /** + * Date that this Domain Config was last updated. + */ + dateUpdated: Date; + url: string; + /** + * Customer\'s choice to send links with/without \"https://\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. + */ + disableHttps: boolean; + private get _proxy(); + /** + * Fetch a DomainConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigInstance + */ + fetch(callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise; + /** + * Update a DomainConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigInstance + */ + update(callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise; + /** + * Update a DomainConfigInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigInstance + */ + update(params: DomainConfigContextUpdateOptions, callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + domainSid: string; + configSid: string; + fallbackUrl: string; + callbackUrl: string; + continueOnFailure: boolean; + dateCreated: Date; + dateUpdated: Date; + url: string; + disableHttps: boolean; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DomainConfigSolution { +} +export interface DomainConfigListInstance { + _version: V1; + _solution: DomainConfigSolution; + _uri: string; + (domainSid: string): DomainConfigContext; + get(domainSid: string): DomainConfigContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DomainConfigListInstance(version: V1): DomainConfigListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/domainConfig.js b/node_modules/twilio/lib/rest/messaging/v1/domainConfig.js new file mode 100644 index 00000000..3caf1e6d --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/domainConfig.js @@ -0,0 +1,155 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DomainConfigListInstance = exports.DomainConfigInstance = exports.DomainConfigContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class DomainConfigContextImpl { + constructor(_version, domainSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + this._solution = { domainSid }; + this._uri = `/LinkShortening/Domains/${domainSid}/Config`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DomainConfigInstance(operationVersion, payload, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["fallbackUrl"] !== undefined) + data["FallbackUrl"] = params["fallbackUrl"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["continueOnFailure"] !== undefined) + data["ContinueOnFailure"] = serialize.bool(params["continueOnFailure"]); + if (params["disableHttps"] !== undefined) + data["DisableHttps"] = serialize.bool(params["disableHttps"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DomainConfigInstance(operationVersion, payload, instance._solution.domainSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainConfigContextImpl = DomainConfigContextImpl; +class DomainConfigInstance { + constructor(_version, payload, domainSid) { + this._version = _version; + this.domainSid = payload.domain_sid; + this.configSid = payload.config_sid; + this.fallbackUrl = payload.fallback_url; + this.callbackUrl = payload.callback_url; + this.continueOnFailure = payload.continue_on_failure; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.disableHttps = payload.disable_https; + this._solution = { domainSid: domainSid || this.domainSid }; + } + get _proxy() { + this._context = + this._context || + new DomainConfigContextImpl(this._version, this._solution.domainSid); + return this._context; + } + /** + * Fetch a DomainConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + domainSid: this.domainSid, + configSid: this.configSid, + fallbackUrl: this.fallbackUrl, + callbackUrl: this.callbackUrl, + continueOnFailure: this.continueOnFailure, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + disableHttps: this.disableHttps, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainConfigInstance = DomainConfigInstance; +function DomainConfigListInstance(version) { + const instance = ((domainSid) => instance.get(domainSid)); + instance.get = function get(domainSid) { + return new DomainConfigContextImpl(version, domainSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DomainConfigListInstance = DomainConfigListInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/domainConfigMessagingService.d.ts b/node_modules/twilio/lib/rest/messaging/v1/domainConfigMessagingService.d.ts new file mode 100644 index 00000000..99ffae4d --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/domainConfigMessagingService.d.ts @@ -0,0 +1,127 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface DomainConfigMessagingServiceContext { + /** + * Fetch a DomainConfigMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigMessagingServiceInstance + */ + fetch(callback?: (error: Error | null, item?: DomainConfigMessagingServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DomainConfigMessagingServiceContextSolution { + messagingServiceSid: string; +} +export declare class DomainConfigMessagingServiceContextImpl implements DomainConfigMessagingServiceContext { + protected _version: V1; + protected _solution: DomainConfigMessagingServiceContextSolution; + protected _uri: string; + constructor(_version: V1, messagingServiceSid: string); + fetch(callback?: (error: Error | null, item?: DomainConfigMessagingServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DomainConfigMessagingServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DomainConfigMessagingServiceResource { + domain_sid: string; + config_sid: string; + messaging_service_sid: string; + fallback_url: string; + callback_url: string; + continue_on_failure: boolean; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class DomainConfigMessagingServiceInstance { + protected _version: V1; + protected _solution: DomainConfigMessagingServiceContextSolution; + protected _context?: DomainConfigMessagingServiceContext; + constructor(_version: V1, payload: DomainConfigMessagingServiceResource, messagingServiceSid?: string); + /** + * The unique string that we created to identify the Domain resource. + */ + domainSid: string; + /** + * The unique string that we created to identify the Domain config (prefix ZK). + */ + configSid: string; + /** + * The unique string that identifies the messaging service + */ + messagingServiceSid: string; + /** + * Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. + */ + fallbackUrl: string; + /** + * URL to receive click events to your webhook whenever the recipients click on the shortened links. + */ + callbackUrl: string; + /** + * Boolean field to set customer delivery preference when there is a failure in linkShortening service + */ + continueOnFailure: boolean; + /** + * Date this Domain Config was created. + */ + dateCreated: Date; + /** + * Date that this Domain Config was last updated. + */ + dateUpdated: Date; + url: string; + private get _proxy(); + /** + * Fetch a DomainConfigMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigMessagingServiceInstance + */ + fetch(callback?: (error: Error | null, item?: DomainConfigMessagingServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + domainSid: string; + configSid: string; + messagingServiceSid: string; + fallbackUrl: string; + callbackUrl: string; + continueOnFailure: boolean; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DomainConfigMessagingServiceSolution { +} +export interface DomainConfigMessagingServiceListInstance { + _version: V1; + _solution: DomainConfigMessagingServiceSolution; + _uri: string; + (messagingServiceSid: string): DomainConfigMessagingServiceContext; + get(messagingServiceSid: string): DomainConfigMessagingServiceContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DomainConfigMessagingServiceListInstance(version: V1): DomainConfigMessagingServiceListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/domainConfigMessagingService.js b/node_modules/twilio/lib/rest/messaging/v1/domainConfigMessagingService.js new file mode 100644 index 00000000..61564f2f --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/domainConfigMessagingService.js @@ -0,0 +1,124 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DomainConfigMessagingServiceListInstance = exports.DomainConfigMessagingServiceInstance = exports.DomainConfigMessagingServiceContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class DomainConfigMessagingServiceContextImpl { + constructor(_version, messagingServiceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(messagingServiceSid)) { + throw new Error("Parameter 'messagingServiceSid' is not valid."); + } + this._solution = { messagingServiceSid }; + this._uri = `/LinkShortening/MessagingService/${messagingServiceSid}/DomainConfig`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DomainConfigMessagingServiceInstance(operationVersion, payload, instance._solution.messagingServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainConfigMessagingServiceContextImpl = DomainConfigMessagingServiceContextImpl; +class DomainConfigMessagingServiceInstance { + constructor(_version, payload, messagingServiceSid) { + this._version = _version; + this.domainSid = payload.domain_sid; + this.configSid = payload.config_sid; + this.messagingServiceSid = payload.messaging_service_sid; + this.fallbackUrl = payload.fallback_url; + this.callbackUrl = payload.callback_url; + this.continueOnFailure = payload.continue_on_failure; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { + messagingServiceSid: messagingServiceSid || this.messagingServiceSid, + }; + } + get _proxy() { + this._context = + this._context || + new DomainConfigMessagingServiceContextImpl(this._version, this._solution.messagingServiceSid); + return this._context; + } + /** + * Fetch a DomainConfigMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DomainConfigMessagingServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + domainSid: this.domainSid, + configSid: this.configSid, + messagingServiceSid: this.messagingServiceSid, + fallbackUrl: this.fallbackUrl, + callbackUrl: this.callbackUrl, + continueOnFailure: this.continueOnFailure, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DomainConfigMessagingServiceInstance = DomainConfigMessagingServiceInstance; +function DomainConfigMessagingServiceListInstance(version) { + const instance = ((messagingServiceSid) => instance.get(messagingServiceSid)); + instance.get = function get(messagingServiceSid) { + return new DomainConfigMessagingServiceContextImpl(version, messagingServiceSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DomainConfigMessagingServiceListInstance = DomainConfigMessagingServiceListInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/externalCampaign.d.ts b/node_modules/twilio/lib/rest/messaging/v1/externalCampaign.d.ts new file mode 100644 index 00000000..82970711 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/externalCampaign.d.ts @@ -0,0 +1,79 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to create a ExternalCampaignInstance + */ +export interface ExternalCampaignListInstanceCreateOptions { + /** ID of the preregistered campaign. */ + campaignId: string; + /** The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. */ + messagingServiceSid: string; +} +export interface ExternalCampaignSolution { +} +export interface ExternalCampaignListInstance { + _version: V1; + _solution: ExternalCampaignSolution; + _uri: string; + /** + * Create a ExternalCampaignInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExternalCampaignInstance + */ + create(params: ExternalCampaignListInstanceCreateOptions, callback?: (error: Error | null, item?: ExternalCampaignInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExternalCampaignListInstance(version: V1): ExternalCampaignListInstance; +interface ExternalCampaignResource { + sid: string; + account_sid: string; + campaign_id: string; + messaging_service_sid: string; + date_created: Date; +} +export declare class ExternalCampaignInstance { + protected _version: V1; + constructor(_version: V1, payload: ExternalCampaignResource); + /** + * The unique string that identifies a US A2P Compliance resource `QE2c6890da8086d771620e9b13fadeba0b`. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Campaign belongs to. + */ + accountSid: string; + /** + * ID of the preregistered campaign. + */ + campaignId: string; + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. + */ + messagingServiceSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + campaignId: string; + messagingServiceSid: string; + dateCreated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/externalCampaign.js b/node_modules/twilio/lib/rest/messaging/v1/externalCampaign.js new file mode 100644 index 00000000..93737cf0 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/externalCampaign.js @@ -0,0 +1,87 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExternalCampaignInstance = exports.ExternalCampaignListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function ExternalCampaignListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services/PreregisteredUsa2p`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["campaignId"] === null || params["campaignId"] === undefined) { + throw new Error("Required parameter \"params['campaignId']\" missing."); + } + if (params["messagingServiceSid"] === null || + params["messagingServiceSid"] === undefined) { + throw new Error("Required parameter \"params['messagingServiceSid']\" missing."); + } + let data = {}; + data["CampaignId"] = params["campaignId"]; + data["MessagingServiceSid"] = params["messagingServiceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExternalCampaignInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExternalCampaignListInstance = ExternalCampaignListInstance; +class ExternalCampaignInstance { + constructor(_version, payload) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.campaignId = payload.campaign_id; + this.messagingServiceSid = payload.messaging_service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + campaignId: this.campaignId, + messagingServiceSid: this.messagingServiceSid, + dateCreated: this.dateCreated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExternalCampaignInstance = ExternalCampaignInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingService.d.ts b/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingService.d.ts new file mode 100644 index 00000000..82f3d8b8 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingService.d.ts @@ -0,0 +1,109 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface LinkshorteningMessagingServiceContext { + /** + * Create a LinkshorteningMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LinkshorteningMessagingServiceInstance + */ + create(callback?: (error: Error | null, item?: LinkshorteningMessagingServiceInstance) => any): Promise; + /** + * Remove a LinkshorteningMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface LinkshorteningMessagingServiceContextSolution { + domainSid: string; + messagingServiceSid: string; +} +export declare class LinkshorteningMessagingServiceContextImpl implements LinkshorteningMessagingServiceContext { + protected _version: V1; + protected _solution: LinkshorteningMessagingServiceContextSolution; + protected _uri: string; + constructor(_version: V1, domainSid: string, messagingServiceSid: string); + create(callback?: (error: Error | null, item?: LinkshorteningMessagingServiceInstance) => any): Promise; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): LinkshorteningMessagingServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface LinkshorteningMessagingServiceResource { + domain_sid: string; + messaging_service_sid: string; + url: string; +} +export declare class LinkshorteningMessagingServiceInstance { + protected _version: V1; + protected _solution: LinkshorteningMessagingServiceContextSolution; + protected _context?: LinkshorteningMessagingServiceContext; + constructor(_version: V1, payload: LinkshorteningMessagingServiceResource, domainSid?: string, messagingServiceSid?: string); + /** + * The unique string identifies the domain resource + */ + domainSid: string; + /** + * The unique string that identifies the messaging service + */ + messagingServiceSid: string; + url: string; + private get _proxy(); + /** + * Create a LinkshorteningMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LinkshorteningMessagingServiceInstance + */ + create(callback?: (error: Error | null, item?: LinkshorteningMessagingServiceInstance) => any): Promise; + /** + * Remove a LinkshorteningMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + domainSid: string; + messagingServiceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface LinkshorteningMessagingServiceSolution { +} +export interface LinkshorteningMessagingServiceListInstance { + _version: V1; + _solution: LinkshorteningMessagingServiceSolution; + _uri: string; + (domainSid: string, messagingServiceSid: string): LinkshorteningMessagingServiceContext; + get(domainSid: string, messagingServiceSid: string): LinkshorteningMessagingServiceContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function LinkshorteningMessagingServiceListInstance(version: V1): LinkshorteningMessagingServiceListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingService.js b/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingService.js new file mode 100644 index 00000000..e1ad6bb3 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingService.js @@ -0,0 +1,135 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LinkshorteningMessagingServiceListInstance = exports.LinkshorteningMessagingServiceInstance = exports.LinkshorteningMessagingServiceContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class LinkshorteningMessagingServiceContextImpl { + constructor(_version, domainSid, messagingServiceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(domainSid)) { + throw new Error("Parameter 'domainSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(messagingServiceSid)) { + throw new Error("Parameter 'messagingServiceSid' is not valid."); + } + this._solution = { domainSid, messagingServiceSid }; + this._uri = `/LinkShortening/Domains/${domainSid}/MessagingServices/${messagingServiceSid}`; + } + create(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + }); + operationPromise = operationPromise.then((payload) => new LinkshorteningMessagingServiceInstance(operationVersion, payload, instance._solution.domainSid, instance._solution.messagingServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LinkshorteningMessagingServiceContextImpl = LinkshorteningMessagingServiceContextImpl; +class LinkshorteningMessagingServiceInstance { + constructor(_version, payload, domainSid, messagingServiceSid) { + this._version = _version; + this.domainSid = payload.domain_sid; + this.messagingServiceSid = payload.messaging_service_sid; + this.url = payload.url; + this._solution = { + domainSid: domainSid || this.domainSid, + messagingServiceSid: messagingServiceSid || this.messagingServiceSid, + }; + } + get _proxy() { + this._context = + this._context || + new LinkshorteningMessagingServiceContextImpl(this._version, this._solution.domainSid, this._solution.messagingServiceSid); + return this._context; + } + /** + * Create a LinkshorteningMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LinkshorteningMessagingServiceInstance + */ + create(callback) { + return this._proxy.create(callback); + } + /** + * Remove a LinkshorteningMessagingServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + domainSid: this.domainSid, + messagingServiceSid: this.messagingServiceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LinkshorteningMessagingServiceInstance = LinkshorteningMessagingServiceInstance; +function LinkshorteningMessagingServiceListInstance(version) { + const instance = ((domainSid, messagingServiceSid) => instance.get(domainSid, messagingServiceSid)); + instance.get = function get(domainSid, messagingServiceSid) { + return new LinkshorteningMessagingServiceContextImpl(version, domainSid, messagingServiceSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.LinkshorteningMessagingServiceListInstance = LinkshorteningMessagingServiceListInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.d.ts b/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.d.ts new file mode 100644 index 00000000..d23a622f --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.d.ts @@ -0,0 +1,91 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface LinkshorteningMessagingServiceDomainAssociationContext { + /** + * Fetch a LinkshorteningMessagingServiceDomainAssociationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LinkshorteningMessagingServiceDomainAssociationInstance + */ + fetch(callback?: (error: Error | null, item?: LinkshorteningMessagingServiceDomainAssociationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface LinkshorteningMessagingServiceDomainAssociationContextSolution { + messagingServiceSid: string; +} +export declare class LinkshorteningMessagingServiceDomainAssociationContextImpl implements LinkshorteningMessagingServiceDomainAssociationContext { + protected _version: V1; + protected _solution: LinkshorteningMessagingServiceDomainAssociationContextSolution; + protected _uri: string; + constructor(_version: V1, messagingServiceSid: string); + fetch(callback?: (error: Error | null, item?: LinkshorteningMessagingServiceDomainAssociationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): LinkshorteningMessagingServiceDomainAssociationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface LinkshorteningMessagingServiceDomainAssociationResource { + domain_sid: string; + messaging_service_sid: string; + url: string; +} +export declare class LinkshorteningMessagingServiceDomainAssociationInstance { + protected _version: V1; + protected _solution: LinkshorteningMessagingServiceDomainAssociationContextSolution; + protected _context?: LinkshorteningMessagingServiceDomainAssociationContext; + constructor(_version: V1, payload: LinkshorteningMessagingServiceDomainAssociationResource, messagingServiceSid?: string); + /** + * The unique string that we created to identify the Domain resource. + */ + domainSid: string; + /** + * The unique string that identifies the messaging service + */ + messagingServiceSid: string; + url: string; + private get _proxy(); + /** + * Fetch a LinkshorteningMessagingServiceDomainAssociationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LinkshorteningMessagingServiceDomainAssociationInstance + */ + fetch(callback?: (error: Error | null, item?: LinkshorteningMessagingServiceDomainAssociationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + domainSid: string; + messagingServiceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface LinkshorteningMessagingServiceDomainAssociationSolution { +} +export interface LinkshorteningMessagingServiceDomainAssociationListInstance { + _version: V1; + _solution: LinkshorteningMessagingServiceDomainAssociationSolution; + _uri: string; + (messagingServiceSid: string): LinkshorteningMessagingServiceDomainAssociationContext; + get(messagingServiceSid: string): LinkshorteningMessagingServiceDomainAssociationContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function LinkshorteningMessagingServiceDomainAssociationListInstance(version: V1): LinkshorteningMessagingServiceDomainAssociationListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.js b/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.js new file mode 100644 index 00000000..873008e2 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/linkshorteningMessagingServiceDomainAssociation.js @@ -0,0 +1,112 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LinkshorteningMessagingServiceDomainAssociationListInstance = exports.LinkshorteningMessagingServiceDomainAssociationInstance = exports.LinkshorteningMessagingServiceDomainAssociationContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class LinkshorteningMessagingServiceDomainAssociationContextImpl { + constructor(_version, messagingServiceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(messagingServiceSid)) { + throw new Error("Parameter 'messagingServiceSid' is not valid."); + } + this._solution = { messagingServiceSid }; + this._uri = `/LinkShortening/MessagingServices/${messagingServiceSid}/Domain`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new LinkshorteningMessagingServiceDomainAssociationInstance(operationVersion, payload, instance._solution.messagingServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LinkshorteningMessagingServiceDomainAssociationContextImpl = LinkshorteningMessagingServiceDomainAssociationContextImpl; +class LinkshorteningMessagingServiceDomainAssociationInstance { + constructor(_version, payload, messagingServiceSid) { + this._version = _version; + this.domainSid = payload.domain_sid; + this.messagingServiceSid = payload.messaging_service_sid; + this.url = payload.url; + this._solution = { + messagingServiceSid: messagingServiceSid || this.messagingServiceSid, + }; + } + get _proxy() { + this._context = + this._context || + new LinkshorteningMessagingServiceDomainAssociationContextImpl(this._version, this._solution.messagingServiceSid); + return this._context; + } + /** + * Fetch a LinkshorteningMessagingServiceDomainAssociationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LinkshorteningMessagingServiceDomainAssociationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + domainSid: this.domainSid, + messagingServiceSid: this.messagingServiceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LinkshorteningMessagingServiceDomainAssociationInstance = LinkshorteningMessagingServiceDomainAssociationInstance; +function LinkshorteningMessagingServiceDomainAssociationListInstance(version) { + const instance = ((messagingServiceSid) => instance.get(messagingServiceSid)); + instance.get = function get(messagingServiceSid) { + return new LinkshorteningMessagingServiceDomainAssociationContextImpl(version, messagingServiceSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.LinkshorteningMessagingServiceDomainAssociationListInstance = LinkshorteningMessagingServiceDomainAssociationListInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service.d.ts b/node_modules/twilio/lib/rest/messaging/v1/service.d.ts new file mode 100644 index 00000000..761d1005 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service.d.ts @@ -0,0 +1,500 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { AlphaSenderListInstance } from "./service/alphaSender"; +import { ChannelSenderListInstance } from "./service/channelSender"; +import { PhoneNumberListInstance } from "./service/phoneNumber"; +import { ShortCodeListInstance } from "./service/shortCode"; +import { UsAppToPersonListInstance } from "./service/usAppToPerson"; +import { UsAppToPersonUsecaseListInstance } from "./service/usAppToPersonUsecase"; +export type ServiceScanMessageContent = "inherit" | "enable" | "disable"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. */ + inboundRequestUrl?: string; + /** The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. */ + inboundMethod?: string; + /** The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. */ + fallbackUrl?: string; + /** The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. */ + fallbackMethod?: string; + /** The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. */ + statusCallback?: string; + /** Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. */ + stickySender?: boolean; + /** Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. */ + mmsConverter?: boolean; + /** Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. */ + smartEncoding?: boolean; + /** */ + scanMessageContent?: ServiceScanMessageContent; + /** [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. */ + fallbackToLongCode?: boolean; + /** Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. */ + areaCodeGeomatch?: boolean; + /** How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. */ + validityPeriod?: number; + /** Reserved. */ + synchronousValidation?: boolean; + /** A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. */ + usecase?: string; + /** A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. */ + useInboundWebhookOnNumber?: boolean; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName: string; + /** The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. */ + inboundRequestUrl?: string; + /** The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. */ + inboundMethod?: string; + /** The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. */ + fallbackUrl?: string; + /** The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. */ + fallbackMethod?: string; + /** The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. */ + statusCallback?: string; + /** Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. */ + stickySender?: boolean; + /** Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. */ + mmsConverter?: boolean; + /** Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. */ + smartEncoding?: boolean; + /** */ + scanMessageContent?: ServiceScanMessageContent; + /** [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. */ + fallbackToLongCode?: boolean; + /** Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. */ + areaCodeGeomatch?: boolean; + /** How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. */ + validityPeriod?: number; + /** Reserved. */ + synchronousValidation?: boolean; + /** A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. */ + usecase?: string; + /** A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. */ + useInboundWebhookOnNumber?: boolean; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + alphaSenders: AlphaSenderListInstance; + channelSenders: ChannelSenderListInstance; + phoneNumbers: PhoneNumberListInstance; + shortCodes: ShortCodeListInstance; + usAppToPerson: UsAppToPersonListInstance; + usAppToPersonUsecases: UsAppToPersonUsecaseListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _alphaSenders?: AlphaSenderListInstance; + protected _channelSenders?: ChannelSenderListInstance; + protected _phoneNumbers?: PhoneNumberListInstance; + protected _shortCodes?: ShortCodeListInstance; + protected _usAppToPerson?: UsAppToPersonListInstance; + protected _usAppToPersonUsecases?: UsAppToPersonUsecaseListInstance; + constructor(_version: V1, sid: string); + get alphaSenders(): AlphaSenderListInstance; + get channelSenders(): ChannelSenderListInstance; + get phoneNumbers(): PhoneNumberListInstance; + get shortCodes(): ShortCodeListInstance; + get usAppToPerson(): UsAppToPersonListInstance; + get usAppToPersonUsecases(): UsAppToPersonUsecaseListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + inbound_request_url: string; + inbound_method: string; + fallback_url: string; + fallback_method: string; + status_callback: string; + sticky_sender: boolean; + mms_converter: boolean; + smart_encoding: boolean; + scan_message_content: ServiceScanMessageContent; + fallback_to_long_code: boolean; + area_code_geomatch: boolean; + synchronous_validation: boolean; + validity_period: number; + url: string; + links: Record; + usecase: string; + us_app_to_person_registered: boolean; + use_inbound_webhook_on_number: boolean; +} +export declare class ServiceInstance { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V1, payload: ServiceResource, sid?: string); + /** + * The unique string that we created to identify the Service resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + */ + inboundRequestUrl: string; + /** + * The HTTP method we use to call `inbound_request_url`. Can be `GET` or `POST`. + */ + inboundMethod: string; + /** + * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + */ + fallbackUrl: string; + /** + * The HTTP method we use to call `fallback_url`. Can be: `GET` or `POST`. + */ + fallbackMethod: string; + /** + * The URL we call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + */ + statusCallback: string; + /** + * Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. + */ + stickySender: boolean; + /** + * Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. + */ + mmsConverter: boolean; + /** + * Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. + */ + smartEncoding: boolean; + scanMessageContent: ServiceScanMessageContent; + /** + * [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. + */ + fallbackToLongCode: boolean; + /** + * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. + */ + areaCodeGeomatch: boolean; + /** + * Reserved. + */ + synchronousValidation: boolean; + /** + * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + */ + validityPeriod: number; + /** + * The absolute URL of the Service resource. + */ + url: string; + /** + * The absolute URLs of related resources. + */ + links: Record; + /** + * A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. + */ + usecase: string; + /** + * Whether US A2P campaign is registered for this Service. + */ + usAppToPersonRegistered: boolean; + /** + * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + */ + useInboundWebhookOnNumber: boolean; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the alphaSenders. + */ + alphaSenders(): AlphaSenderListInstance; + /** + * Access the channelSenders. + */ + channelSenders(): ChannelSenderListInstance; + /** + * Access the phoneNumbers. + */ + phoneNumbers(): PhoneNumberListInstance; + /** + * Access the shortCodes. + */ + shortCodes(): ShortCodeListInstance; + /** + * Access the usAppToPerson. + */ + usAppToPerson(): UsAppToPersonListInstance; + /** + * Access the usAppToPersonUsecases. + */ + usAppToPersonUsecases(): UsAppToPersonUsecaseListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + inboundRequestUrl: string; + inboundMethod: string; + fallbackUrl: string; + fallbackMethod: string; + statusCallback: string; + stickySender: boolean; + mmsConverter: boolean; + smartEncoding: boolean; + scanMessageContent: ServiceScanMessageContent; + fallbackToLongCode: boolean; + areaCodeGeomatch: boolean; + synchronousValidation: boolean; + validityPeriod: number; + url: string; + links: Record; + usecase: string; + usAppToPersonRegistered: boolean; + useInboundWebhookOnNumber: boolean; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V1; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V1): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service.js b/node_modules/twilio/lib/rest/messaging/v1/service.js new file mode 100644 index 00000000..92af9061 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service.js @@ -0,0 +1,421 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const alphaSender_1 = require("./service/alphaSender"); +const channelSender_1 = require("./service/channelSender"); +const phoneNumber_1 = require("./service/phoneNumber"); +const shortCode_1 = require("./service/shortCode"); +const usAppToPerson_1 = require("./service/usAppToPerson"); +const usAppToPersonUsecase_1 = require("./service/usAppToPersonUsecase"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get alphaSenders() { + this._alphaSenders = + this._alphaSenders || + (0, alphaSender_1.AlphaSenderListInstance)(this._version, this._solution.sid); + return this._alphaSenders; + } + get channelSenders() { + this._channelSenders = + this._channelSenders || + (0, channelSender_1.ChannelSenderListInstance)(this._version, this._solution.sid); + return this._channelSenders; + } + get phoneNumbers() { + this._phoneNumbers = + this._phoneNumbers || + (0, phoneNumber_1.PhoneNumberListInstance)(this._version, this._solution.sid); + return this._phoneNumbers; + } + get shortCodes() { + this._shortCodes = + this._shortCodes || + (0, shortCode_1.ShortCodeListInstance)(this._version, this._solution.sid); + return this._shortCodes; + } + get usAppToPerson() { + this._usAppToPerson = + this._usAppToPerson || + (0, usAppToPerson_1.UsAppToPersonListInstance)(this._version, this._solution.sid); + return this._usAppToPerson; + } + get usAppToPersonUsecases() { + this._usAppToPersonUsecases = + this._usAppToPersonUsecases || + (0, usAppToPersonUsecase_1.UsAppToPersonUsecaseListInstance)(this._version, this._solution.sid); + return this._usAppToPersonUsecases; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["inboundRequestUrl"] !== undefined) + data["InboundRequestUrl"] = params["inboundRequestUrl"]; + if (params["inboundMethod"] !== undefined) + data["InboundMethod"] = params["inboundMethod"]; + if (params["fallbackUrl"] !== undefined) + data["FallbackUrl"] = params["fallbackUrl"]; + if (params["fallbackMethod"] !== undefined) + data["FallbackMethod"] = params["fallbackMethod"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["stickySender"] !== undefined) + data["StickySender"] = serialize.bool(params["stickySender"]); + if (params["mmsConverter"] !== undefined) + data["MmsConverter"] = serialize.bool(params["mmsConverter"]); + if (params["smartEncoding"] !== undefined) + data["SmartEncoding"] = serialize.bool(params["smartEncoding"]); + if (params["scanMessageContent"] !== undefined) + data["ScanMessageContent"] = params["scanMessageContent"]; + if (params["fallbackToLongCode"] !== undefined) + data["FallbackToLongCode"] = serialize.bool(params["fallbackToLongCode"]); + if (params["areaCodeGeomatch"] !== undefined) + data["AreaCodeGeomatch"] = serialize.bool(params["areaCodeGeomatch"]); + if (params["validityPeriod"] !== undefined) + data["ValidityPeriod"] = params["validityPeriod"]; + if (params["synchronousValidation"] !== undefined) + data["SynchronousValidation"] = serialize.bool(params["synchronousValidation"]); + if (params["usecase"] !== undefined) + data["Usecase"] = params["usecase"]; + if (params["useInboundWebhookOnNumber"] !== undefined) + data["UseInboundWebhookOnNumber"] = serialize.bool(params["useInboundWebhookOnNumber"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.inboundRequestUrl = payload.inbound_request_url; + this.inboundMethod = payload.inbound_method; + this.fallbackUrl = payload.fallback_url; + this.fallbackMethod = payload.fallback_method; + this.statusCallback = payload.status_callback; + this.stickySender = payload.sticky_sender; + this.mmsConverter = payload.mms_converter; + this.smartEncoding = payload.smart_encoding; + this.scanMessageContent = payload.scan_message_content; + this.fallbackToLongCode = payload.fallback_to_long_code; + this.areaCodeGeomatch = payload.area_code_geomatch; + this.synchronousValidation = payload.synchronous_validation; + this.validityPeriod = deserialize.integer(payload.validity_period); + this.url = payload.url; + this.links = payload.links; + this.usecase = payload.usecase; + this.usAppToPersonRegistered = payload.us_app_to_person_registered; + this.useInboundWebhookOnNumber = payload.use_inbound_webhook_on_number; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the alphaSenders. + */ + alphaSenders() { + return this._proxy.alphaSenders; + } + /** + * Access the channelSenders. + */ + channelSenders() { + return this._proxy.channelSenders; + } + /** + * Access the phoneNumbers. + */ + phoneNumbers() { + return this._proxy.phoneNumbers; + } + /** + * Access the shortCodes. + */ + shortCodes() { + return this._proxy.shortCodes; + } + /** + * Access the usAppToPerson. + */ + usAppToPerson() { + return this._proxy.usAppToPerson; + } + /** + * Access the usAppToPersonUsecases. + */ + usAppToPersonUsecases() { + return this._proxy.usAppToPersonUsecases; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + inboundRequestUrl: this.inboundRequestUrl, + inboundMethod: this.inboundMethod, + fallbackUrl: this.fallbackUrl, + fallbackMethod: this.fallbackMethod, + statusCallback: this.statusCallback, + stickySender: this.stickySender, + mmsConverter: this.mmsConverter, + smartEncoding: this.smartEncoding, + scanMessageContent: this.scanMessageContent, + fallbackToLongCode: this.fallbackToLongCode, + areaCodeGeomatch: this.areaCodeGeomatch, + synchronousValidation: this.synchronousValidation, + validityPeriod: this.validityPeriod, + url: this.url, + links: this.links, + usecase: this.usecase, + usAppToPersonRegistered: this.usAppToPersonRegistered, + useInboundWebhookOnNumber: this.useInboundWebhookOnNumber, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["inboundRequestUrl"] !== undefined) + data["InboundRequestUrl"] = params["inboundRequestUrl"]; + if (params["inboundMethod"] !== undefined) + data["InboundMethod"] = params["inboundMethod"]; + if (params["fallbackUrl"] !== undefined) + data["FallbackUrl"] = params["fallbackUrl"]; + if (params["fallbackMethod"] !== undefined) + data["FallbackMethod"] = params["fallbackMethod"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["stickySender"] !== undefined) + data["StickySender"] = serialize.bool(params["stickySender"]); + if (params["mmsConverter"] !== undefined) + data["MmsConverter"] = serialize.bool(params["mmsConverter"]); + if (params["smartEncoding"] !== undefined) + data["SmartEncoding"] = serialize.bool(params["smartEncoding"]); + if (params["scanMessageContent"] !== undefined) + data["ScanMessageContent"] = params["scanMessageContent"]; + if (params["fallbackToLongCode"] !== undefined) + data["FallbackToLongCode"] = serialize.bool(params["fallbackToLongCode"]); + if (params["areaCodeGeomatch"] !== undefined) + data["AreaCodeGeomatch"] = serialize.bool(params["areaCodeGeomatch"]); + if (params["validityPeriod"] !== undefined) + data["ValidityPeriod"] = params["validityPeriod"]; + if (params["synchronousValidation"] !== undefined) + data["SynchronousValidation"] = serialize.bool(params["synchronousValidation"]); + if (params["usecase"] !== undefined) + data["Usecase"] = params["usecase"]; + if (params["useInboundWebhookOnNumber"] !== undefined) + data["UseInboundWebhookOnNumber"] = serialize.bool(params["useInboundWebhookOnNumber"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/alphaSender.d.ts b/node_modules/twilio/lib/rest/messaging/v1/service/alphaSender.d.ts new file mode 100644 index 00000000..bcd883b3 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/alphaSender.d.ts @@ -0,0 +1,264 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a AlphaSenderInstance + */ +export interface AlphaSenderListInstanceCreateOptions { + /** The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers. */ + alphaSender: string; +} +/** + * Options to pass to each + */ +export interface AlphaSenderListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AlphaSenderInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AlphaSenderListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AlphaSenderListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AlphaSenderContext { + /** + * Remove a AlphaSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AlphaSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AlphaSenderInstance + */ + fetch(callback?: (error: Error | null, item?: AlphaSenderInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AlphaSenderContextSolution { + serviceSid: string; + sid: string; +} +export declare class AlphaSenderContextImpl implements AlphaSenderContext { + protected _version: V1; + protected _solution: AlphaSenderContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AlphaSenderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AlphaSenderContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AlphaSenderPayload extends TwilioResponsePayload { + alpha_senders: AlphaSenderResource[]; +} +interface AlphaSenderResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + alpha_sender: string; + capabilities: Array; + url: string; +} +export declare class AlphaSenderInstance { + protected _version: V1; + protected _solution: AlphaSenderContextSolution; + protected _context?: AlphaSenderContext; + constructor(_version: V1, payload: AlphaSenderResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the AlphaSender resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AlphaSender resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the resource is associated with. + */ + serviceSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The Alphanumeric Sender ID string. + */ + alphaSender: string; + /** + * An array of values that describe whether the number can receive calls or messages. Can be: `SMS`. + */ + capabilities: Array; + /** + * The absolute URL of the AlphaSender resource. + */ + url: string; + private get _proxy(); + /** + * Remove a AlphaSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AlphaSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AlphaSenderInstance + */ + fetch(callback?: (error: Error | null, item?: AlphaSenderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + alphaSender: string; + capabilities: string[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AlphaSenderSolution { + serviceSid: string; +} +export interface AlphaSenderListInstance { + _version: V1; + _solution: AlphaSenderSolution; + _uri: string; + (sid: string): AlphaSenderContext; + get(sid: string): AlphaSenderContext; + /** + * Create a AlphaSenderInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AlphaSenderInstance + */ + create(params: AlphaSenderListInstanceCreateOptions, callback?: (error: Error | null, item?: AlphaSenderInstance) => any): Promise; + /** + * Streams AlphaSenderInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AlphaSenderListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AlphaSenderInstance, done: (err?: Error) => void) => void): void; + each(params: AlphaSenderListInstanceEachOptions, callback?: (item: AlphaSenderInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AlphaSenderInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AlphaSenderPage) => any): Promise; + /** + * Lists AlphaSenderInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AlphaSenderListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AlphaSenderInstance[]) => any): Promise; + list(params: AlphaSenderListInstanceOptions, callback?: (error: Error | null, items: AlphaSenderInstance[]) => any): Promise; + /** + * Retrieve a single page of AlphaSenderInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AlphaSenderListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AlphaSenderPage) => any): Promise; + page(params: AlphaSenderListInstancePageOptions, callback?: (error: Error | null, items: AlphaSenderPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AlphaSenderListInstance(version: V1, serviceSid: string): AlphaSenderListInstance; +export declare class AlphaSenderPage extends Page { + /** + * Initialize the AlphaSenderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AlphaSenderSolution); + /** + * Build an instance of AlphaSenderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AlphaSenderResource): AlphaSenderInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/alphaSender.js b/node_modules/twilio/lib/rest/messaging/v1/service/alphaSender.js new file mode 100644 index 00000000..e7881507 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/alphaSender.js @@ -0,0 +1,231 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AlphaSenderPage = exports.AlphaSenderListInstance = exports.AlphaSenderInstance = exports.AlphaSenderContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class AlphaSenderContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/AlphaSenders/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AlphaSenderInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AlphaSenderContextImpl = AlphaSenderContextImpl; +class AlphaSenderInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.alphaSender = payload.alpha_sender; + this.capabilities = payload.capabilities; + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AlphaSenderContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a AlphaSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AlphaSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AlphaSenderInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + alphaSender: this.alphaSender, + capabilities: this.capabilities, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AlphaSenderInstance = AlphaSenderInstance; +function AlphaSenderListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AlphaSenderContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/AlphaSenders`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["alphaSender"] === null || params["alphaSender"] === undefined) { + throw new Error("Required parameter \"params['alphaSender']\" missing."); + } + let data = {}; + data["AlphaSender"] = params["alphaSender"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AlphaSenderInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AlphaSenderPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AlphaSenderPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AlphaSenderListInstance = AlphaSenderListInstance; +class AlphaSenderPage extends Page_1.default { + /** + * Initialize the AlphaSenderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AlphaSenderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AlphaSenderInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AlphaSenderPage = AlphaSenderPage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/channelSender.d.ts b/node_modules/twilio/lib/rest/messaging/v1/service/channelSender.d.ts new file mode 100644 index 00000000..3d6cc0e1 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/channelSender.d.ts @@ -0,0 +1,237 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to each + */ +export interface ChannelSenderListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ChannelSenderInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ChannelSenderListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ChannelSenderListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ChannelSenderContext { + /** + * Fetch a ChannelSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelSenderInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelSenderInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ChannelSenderContextSolution { + messagingServiceSid: string; + sid: string; +} +export declare class ChannelSenderContextImpl implements ChannelSenderContext { + protected _version: V1; + protected _solution: ChannelSenderContextSolution; + protected _uri: string; + constructor(_version: V1, messagingServiceSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: ChannelSenderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ChannelSenderContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ChannelSenderPayload extends TwilioResponsePayload { + senders: ChannelSenderResource[]; +} +interface ChannelSenderResource { + account_sid: string; + messaging_service_sid: string; + sid: string; + sender: string; + sender_type: string; + country_code: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class ChannelSenderInstance { + protected _version: V1; + protected _solution: ChannelSenderContextSolution; + protected _context?: ChannelSenderContext; + constructor(_version: V1, payload: ChannelSenderResource, messagingServiceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ChannelSender resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/messaging/services) the resource is associated with. + */ + messagingServiceSid: string; + /** + * The unique string that we created to identify the ChannelSender resource. + */ + sid: string; + /** + * The unique string that identifies the sender e.g whatsapp:+123456XXXX. + */ + sender: string; + /** + * A string value that identifies the sender type e.g WhatsApp, Messenger. + */ + senderType: string; + /** + * The 2-character [ISO Country Code](https://www.iso.org/iso-3166-country-codes.html) of the number. + */ + countryCode: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the ChannelSender resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ChannelSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelSenderInstance + */ + fetch(callback?: (error: Error | null, item?: ChannelSenderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + messagingServiceSid: string; + sid: string; + sender: string; + senderType: string; + countryCode: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ChannelSenderSolution { + messagingServiceSid: string; +} +export interface ChannelSenderListInstance { + _version: V1; + _solution: ChannelSenderSolution; + _uri: string; + (sid: string): ChannelSenderContext; + get(sid: string): ChannelSenderContext; + /** + * Streams ChannelSenderInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelSenderListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ChannelSenderInstance, done: (err?: Error) => void) => void): void; + each(params: ChannelSenderListInstanceEachOptions, callback?: (item: ChannelSenderInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ChannelSenderInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ChannelSenderPage) => any): Promise; + /** + * Lists ChannelSenderInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelSenderListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ChannelSenderInstance[]) => any): Promise; + list(params: ChannelSenderListInstanceOptions, callback?: (error: Error | null, items: ChannelSenderInstance[]) => any): Promise; + /** + * Retrieve a single page of ChannelSenderInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChannelSenderListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ChannelSenderPage) => any): Promise; + page(params: ChannelSenderListInstancePageOptions, callback?: (error: Error | null, items: ChannelSenderPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ChannelSenderListInstance(version: V1, messagingServiceSid: string): ChannelSenderListInstance; +export declare class ChannelSenderPage extends Page { + /** + * Initialize the ChannelSenderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ChannelSenderSolution); + /** + * Build an instance of ChannelSenderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ChannelSenderResource): ChannelSenderInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/channelSender.js b/node_modules/twilio/lib/rest/messaging/v1/service/channelSender.js new file mode 100644 index 00000000..10396745 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/channelSender.js @@ -0,0 +1,193 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChannelSenderPage = exports.ChannelSenderListInstance = exports.ChannelSenderInstance = exports.ChannelSenderContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ChannelSenderContextImpl { + constructor(_version, messagingServiceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(messagingServiceSid)) { + throw new Error("Parameter 'messagingServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { messagingServiceSid, sid }; + this._uri = `/Services/${messagingServiceSid}/ChannelSenders/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ChannelSenderInstance(operationVersion, payload, instance._solution.messagingServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelSenderContextImpl = ChannelSenderContextImpl; +class ChannelSenderInstance { + constructor(_version, payload, messagingServiceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.messagingServiceSid = payload.messaging_service_sid; + this.sid = payload.sid; + this.sender = payload.sender; + this.senderType = payload.sender_type; + this.countryCode = payload.country_code; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { messagingServiceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ChannelSenderContextImpl(this._version, this._solution.messagingServiceSid, this._solution.sid); + return this._context; + } + /** + * Fetch a ChannelSenderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChannelSenderInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + messagingServiceSid: this.messagingServiceSid, + sid: this.sid, + sender: this.sender, + senderType: this.senderType, + countryCode: this.countryCode, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelSenderInstance = ChannelSenderInstance; +function ChannelSenderListInstance(version, messagingServiceSid) { + if (!(0, utility_1.isValidPathParam)(messagingServiceSid)) { + throw new Error("Parameter 'messagingServiceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ChannelSenderContextImpl(version, messagingServiceSid, sid); + }; + instance._version = version; + instance._solution = { messagingServiceSid }; + instance._uri = `/Services/${messagingServiceSid}/ChannelSenders`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChannelSenderPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ChannelSenderPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ChannelSenderListInstance = ChannelSenderListInstance; +class ChannelSenderPage extends Page_1.default { + /** + * Initialize the ChannelSenderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ChannelSenderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ChannelSenderInstance(this._version, payload, this._solution.messagingServiceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChannelSenderPage = ChannelSenderPage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/phoneNumber.d.ts b/node_modules/twilio/lib/rest/messaging/v1/service/phoneNumber.d.ts new file mode 100644 index 00000000..c3ae8d7b --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/phoneNumber.d.ts @@ -0,0 +1,270 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a PhoneNumberInstance + */ +export interface PhoneNumberListInstanceCreateOptions { + /** The SID of the Phone Number being added to the Service. */ + phoneNumberSid: string; +} +/** + * Options to pass to each + */ +export interface PhoneNumberListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface PhoneNumberListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface PhoneNumberListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface PhoneNumberContext { + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PhoneNumberContextSolution { + serviceSid: string; + sid: string; +} +export declare class PhoneNumberContextImpl implements PhoneNumberContext { + protected _version: V1; + protected _solution: PhoneNumberContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PhoneNumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PhoneNumberPayload extends TwilioResponsePayload { + phone_numbers: PhoneNumberResource[]; +} +interface PhoneNumberResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + phone_number: string; + country_code: string; + capabilities: Array; + url: string; +} +export declare class PhoneNumberInstance { + protected _version: V1; + protected _solution: PhoneNumberContextSolution; + protected _context?: PhoneNumberContext; + constructor(_version: V1, payload: PhoneNumberResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the PhoneNumber resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PhoneNumber resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the resource is associated with. + */ + serviceSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The 2-character [ISO Country Code](https://www.iso.org/iso-3166-country-codes.html) of the number. + */ + countryCode: string; + /** + * An array of values that describe whether the number can receive calls or messages. Can be: `Voice`, `SMS`, and `MMS`. + */ + capabilities: Array; + /** + * The absolute URL of the PhoneNumber resource. + */ + url: string; + private get _proxy(); + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + phoneNumber: string; + countryCode: string; + capabilities: string[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PhoneNumberSolution { + serviceSid: string; +} +export interface PhoneNumberListInstance { + _version: V1; + _solution: PhoneNumberSolution; + _uri: string; + (sid: string): PhoneNumberContext; + get(sid: string): PhoneNumberContext; + /** + * Create a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + create(params: PhoneNumberListInstanceCreateOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Streams PhoneNumberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void): void; + each(params: PhoneNumberListInstanceEachOptions, callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of PhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + /** + * Lists PhoneNumberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: PhoneNumberInstance[]) => any): Promise; + list(params: PhoneNumberListInstanceOptions, callback?: (error: Error | null, items: PhoneNumberInstance[]) => any): Promise; + /** + * Retrieve a single page of PhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + page(params: PhoneNumberListInstancePageOptions, callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PhoneNumberListInstance(version: V1, serviceSid: string): PhoneNumberListInstance; +export declare class PhoneNumberPage extends Page { + /** + * Initialize the PhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: PhoneNumberSolution); + /** + * Build an instance of PhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: PhoneNumberResource): PhoneNumberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/phoneNumber.js b/node_modules/twilio/lib/rest/messaging/v1/service/phoneNumber.js new file mode 100644 index 00000000..0ff2f3f3 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/phoneNumber.js @@ -0,0 +1,234 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PhoneNumberPage = exports.PhoneNumberListInstance = exports.PhoneNumberInstance = exports.PhoneNumberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PhoneNumberContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/PhoneNumbers/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberContextImpl = PhoneNumberContextImpl; +class PhoneNumberInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.phoneNumber = payload.phone_number; + this.countryCode = payload.country_code; + this.capabilities = payload.capabilities; + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PhoneNumberContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + phoneNumber: this.phoneNumber, + countryCode: this.countryCode, + capabilities: this.capabilities, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberInstance = PhoneNumberInstance; +function PhoneNumberListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PhoneNumberContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/PhoneNumbers`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumberSid"] === null || + params["phoneNumberSid"] === undefined) { + throw new Error("Required parameter \"params['phoneNumberSid']\" missing."); + } + let data = {}; + data["PhoneNumberSid"] = params["phoneNumberSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new PhoneNumberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PhoneNumberListInstance = PhoneNumberListInstance; +class PhoneNumberPage extends Page_1.default { + /** + * Initialize the PhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of PhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new PhoneNumberInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberPage = PhoneNumberPage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/shortCode.d.ts b/node_modules/twilio/lib/rest/messaging/v1/service/shortCode.d.ts new file mode 100644 index 00000000..346be212 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/shortCode.d.ts @@ -0,0 +1,270 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a ShortCodeInstance + */ +export interface ShortCodeListInstanceCreateOptions { + /** The SID of the ShortCode resource being added to the Service. */ + shortCodeSid: string; +} +/** + * Options to pass to each + */ +export interface ShortCodeListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ShortCodeListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ShortCodeListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ShortCodeContext { + /** + * Remove a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ShortCodeContextSolution { + serviceSid: string; + sid: string; +} +export declare class ShortCodeContextImpl implements ShortCodeContext { + protected _version: V1; + protected _solution: ShortCodeContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ShortCodeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ShortCodePayload extends TwilioResponsePayload { + short_codes: ShortCodeResource[]; +} +interface ShortCodeResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + short_code: string; + country_code: string; + capabilities: Array; + url: string; +} +export declare class ShortCodeInstance { + protected _version: V1; + protected _solution: ShortCodeContextSolution; + protected _context?: ShortCodeContext; + constructor(_version: V1, payload: ShortCodeResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the ShortCode resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the resource is associated with. + */ + serviceSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The [E.164](https://www.twilio.com/docs/glossary/what-e164) format of the short code. + */ + shortCode: string; + /** + * The 2-character [ISO Country Code](https://www.iso.org/iso-3166-country-codes.html) of the number. + */ + countryCode: string; + /** + * An array of values that describe whether the number can receive calls or messages. Can be: `SMS` and `MMS`. + */ + capabilities: Array; + /** + * The absolute URL of the ShortCode resource. + */ + url: string; + private get _proxy(); + /** + * Remove a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + shortCode: string; + countryCode: string; + capabilities: string[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ShortCodeSolution { + serviceSid: string; +} +export interface ShortCodeListInstance { + _version: V1; + _solution: ShortCodeSolution; + _uri: string; + (sid: string): ShortCodeContext; + get(sid: string): ShortCodeContext; + /** + * Create a ShortCodeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + create(params: ShortCodeListInstanceCreateOptions, callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Streams ShortCodeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void): void; + each(params: ShortCodeListInstanceEachOptions, callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ShortCodeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + /** + * Lists ShortCodeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ShortCodeInstance[]) => any): Promise; + list(params: ShortCodeListInstanceOptions, callback?: (error: Error | null, items: ShortCodeInstance[]) => any): Promise; + /** + * Retrieve a single page of ShortCodeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + page(params: ShortCodeListInstancePageOptions, callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ShortCodeListInstance(version: V1, serviceSid: string): ShortCodeListInstance; +export declare class ShortCodePage extends Page { + /** + * Initialize the ShortCodePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ShortCodeSolution); + /** + * Build an instance of ShortCodeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ShortCodeResource): ShortCodeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/shortCode.js b/node_modules/twilio/lib/rest/messaging/v1/service/shortCode.js new file mode 100644 index 00000000..8690f86a --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/shortCode.js @@ -0,0 +1,234 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ShortCodePage = exports.ShortCodeListInstance = exports.ShortCodeInstance = exports.ShortCodeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ShortCodeContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/ShortCodes/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ShortCodeInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodeContextImpl = ShortCodeContextImpl; +class ShortCodeInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.shortCode = payload.short_code; + this.countryCode = payload.country_code; + this.capabilities = payload.capabilities; + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ShortCodeContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + shortCode: this.shortCode, + countryCode: this.countryCode, + capabilities: this.capabilities, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodeInstance = ShortCodeInstance; +function ShortCodeListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ShortCodeContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/ShortCodes`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["shortCodeSid"] === null || + params["shortCodeSid"] === undefined) { + throw new Error("Required parameter \"params['shortCodeSid']\" missing."); + } + let data = {}; + data["ShortCodeSid"] = params["shortCodeSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ShortCodeInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ShortCodePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ShortCodePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ShortCodeListInstance = ShortCodeListInstance; +class ShortCodePage extends Page_1.default { + /** + * Initialize the ShortCodePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ShortCodeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ShortCodeInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodePage = ShortCodePage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPerson.d.ts b/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPerson.d.ts new file mode 100644 index 00000000..491d3dd2 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPerson.d.ts @@ -0,0 +1,452 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a UsAppToPersonInstance + */ +export interface UsAppToPersonContextUpdateOptions { + /** Indicates that this SMS campaign will send messages that contain links. */ + hasEmbeddedLinks: boolean; + /** Indicates that this SMS campaign will send messages that contain phone numbers. */ + hasEmbeddedPhone: boolean; + /** An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. */ + messageSamples: Array; + /** Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. */ + messageFlow: string; + /** A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. */ + description: string; + /** A boolean that specifies whether campaign requires age gate for federally legal content. */ + ageGated: boolean; + /** A boolean that specifies whether campaign allows direct lending or not. */ + directLending: boolean; +} +/** + * Options to pass to create a UsAppToPersonInstance + */ +export interface UsAppToPersonListInstanceCreateOptions { + /** A2P Brand Registration SID */ + brandRegistrationSid: string; + /** A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. */ + description: string; + /** Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. */ + messageFlow: string; + /** An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. */ + messageSamples: Array; + /** A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] */ + usAppToPersonUsecase: string; + /** Indicates that this SMS campaign will send messages that contain links. */ + hasEmbeddedLinks: boolean; + /** Indicates that this SMS campaign will send messages that contain phone numbers. */ + hasEmbeddedPhone: boolean; + /** If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. */ + optInMessage?: string; + /** Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio\\\'s Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. */ + optOutMessage?: string; + /** When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio\\\'s Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. */ + helpMessage?: string; + /** If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. */ + optInKeywords?: Array; + /** End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio\\\'s Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. */ + optOutKeywords?: Array; + /** End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio\\\'s Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. */ + helpKeywords?: Array; + /** A boolean that specifies whether campaign has Subscriber Optin or not. */ + subscriberOptIn?: boolean; + /** A boolean that specifies whether campaign is age gated or not. */ + ageGated?: boolean; + /** A boolean that specifies whether campaign allows direct lending or not. */ + directLending?: boolean; +} +/** + * Options to pass to each + */ +export interface UsAppToPersonListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UsAppToPersonInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UsAppToPersonListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UsAppToPersonListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UsAppToPersonContext { + /** + * Remove a UsAppToPersonInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UsAppToPersonInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsAppToPersonInstance + */ + fetch(callback?: (error: Error | null, item?: UsAppToPersonInstance) => any): Promise; + /** + * Update a UsAppToPersonInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsAppToPersonInstance + */ + update(params: UsAppToPersonContextUpdateOptions, callback?: (error: Error | null, item?: UsAppToPersonInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UsAppToPersonContextSolution { + messagingServiceSid: string; + sid: string; +} +export declare class UsAppToPersonContextImpl implements UsAppToPersonContext { + protected _version: V1; + protected _solution: UsAppToPersonContextSolution; + protected _uri: string; + constructor(_version: V1, messagingServiceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: UsAppToPersonInstance) => any): Promise; + update(params: UsAppToPersonContextUpdateOptions, callback?: (error: Error | null, item?: UsAppToPersonInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UsAppToPersonContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UsAppToPersonPayload extends TwilioResponsePayload { + compliance: UsAppToPersonResource[]; +} +interface UsAppToPersonResource { + sid: string; + account_sid: string; + brand_registration_sid: string; + messaging_service_sid: string; + description: string; + message_samples: Array; + us_app_to_person_usecase: string; + has_embedded_links: boolean; + has_embedded_phone: boolean; + subscriber_opt_in: boolean; + age_gated: boolean; + direct_lending: boolean; + campaign_status: string; + campaign_id: string; + is_externally_registered: boolean; + rate_limits: any; + message_flow: string; + opt_in_message: string; + opt_out_message: string; + help_message: string; + opt_in_keywords: Array; + opt_out_keywords: Array; + help_keywords: Array; + date_created: Date; + date_updated: Date; + url: string; + mock: boolean; + errors: Array; +} +export declare class UsAppToPersonInstance { + protected _version: V1; + protected _solution: UsAppToPersonContextSolution; + protected _context?: UsAppToPersonContext; + constructor(_version: V1, payload: UsAppToPersonResource, messagingServiceSid: string, sid?: string); + /** + * The unique string that identifies a US A2P Compliance resource `QE2c6890da8086d771620e9b13fadeba0b`. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Campaign belongs to. + */ + accountSid: string; + /** + * The unique string to identify the A2P brand. + */ + brandRegistrationSid: string; + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. + */ + messagingServiceSid: string; + /** + * A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + */ + description: string; + /** + * An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + */ + messageSamples: Array; + /** + * A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, SOLE_PROPRIETOR...]. SOLE_PROPRIETOR campaign use cases can only be created by SOLE_PROPRIETOR Brands, and there can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR Brand. + */ + usAppToPersonUsecase: string; + /** + * Indicate that this SMS campaign will send messages that contain links. + */ + hasEmbeddedLinks: boolean; + /** + * Indicates that this SMS campaign will send messages that contain phone numbers. + */ + hasEmbeddedPhone: boolean; + /** + * A boolean that specifies whether campaign has Subscriber Optin or not. + */ + subscriberOptIn: boolean; + /** + * A boolean that specifies whether campaign is age gated or not. + */ + ageGated: boolean; + /** + * A boolean that specifies whether campaign allows direct lending or not. + */ + directLending: boolean; + /** + * Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED. + */ + campaignStatus: string; + /** + * The Campaign Registry (TCR) Campaign ID. + */ + campaignId: string; + /** + * Indicates whether the campaign was registered externally or not. + */ + isExternallyRegistered: boolean; + /** + * Rate limit and/or classification set by each carrier, Ex. AT&T or T-Mobile. + */ + rateLimits: any; + /** + * Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + */ + messageFlow: string; + /** + * If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. + */ + optInMessage: string; + /** + * Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio\'s Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + */ + optOutMessage: string; + /** + * When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio\'s Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + */ + helpMessage: string; + /** + * If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. + */ + optInKeywords: Array; + /** + * End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio\'s Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + */ + optOutKeywords: Array; + /** + * End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio\'s Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + */ + helpKeywords: Array; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the US App to Person resource. + */ + url: string; + /** + * A boolean that specifies whether campaign is a mock or not. Mock campaigns will be automatically created if using a mock brand. Mock campaigns should only be used for testing purposes. + */ + mock: boolean; + /** + * Details indicating why a campaign registration failed. These errors can indicate one or more fields that were incorrect or did not meet review requirements. + */ + errors: Array; + private get _proxy(); + /** + * Remove a UsAppToPersonInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a UsAppToPersonInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsAppToPersonInstance + */ + fetch(callback?: (error: Error | null, item?: UsAppToPersonInstance) => any): Promise; + /** + * Update a UsAppToPersonInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsAppToPersonInstance + */ + update(params: UsAppToPersonContextUpdateOptions, callback?: (error: Error | null, item?: UsAppToPersonInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + brandRegistrationSid: string; + messagingServiceSid: string; + description: string; + messageSamples: string[]; + usAppToPersonUsecase: string; + hasEmbeddedLinks: boolean; + hasEmbeddedPhone: boolean; + subscriberOptIn: boolean; + ageGated: boolean; + directLending: boolean; + campaignStatus: string; + campaignId: string; + isExternallyRegistered: boolean; + rateLimits: any; + messageFlow: string; + optInMessage: string; + optOutMessage: string; + helpMessage: string; + optInKeywords: string[]; + optOutKeywords: string[]; + helpKeywords: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + mock: boolean; + errors: any[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UsAppToPersonSolution { + messagingServiceSid: string; +} +export interface UsAppToPersonListInstance { + _version: V1; + _solution: UsAppToPersonSolution; + _uri: string; + (sid: string): UsAppToPersonContext; + get(sid: string): UsAppToPersonContext; + /** + * Create a UsAppToPersonInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsAppToPersonInstance + */ + create(params: UsAppToPersonListInstanceCreateOptions, callback?: (error: Error | null, item?: UsAppToPersonInstance) => any): Promise; + /** + * Streams UsAppToPersonInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsAppToPersonListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UsAppToPersonInstance, done: (err?: Error) => void) => void): void; + each(params: UsAppToPersonListInstanceEachOptions, callback?: (item: UsAppToPersonInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UsAppToPersonInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UsAppToPersonPage) => any): Promise; + /** + * Lists UsAppToPersonInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsAppToPersonListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UsAppToPersonInstance[]) => any): Promise; + list(params: UsAppToPersonListInstanceOptions, callback?: (error: Error | null, items: UsAppToPersonInstance[]) => any): Promise; + /** + * Retrieve a single page of UsAppToPersonInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsAppToPersonListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UsAppToPersonPage) => any): Promise; + page(params: UsAppToPersonListInstancePageOptions, callback?: (error: Error | null, items: UsAppToPersonPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UsAppToPersonListInstance(version: V1, messagingServiceSid: string): UsAppToPersonListInstance; +export declare class UsAppToPersonPage extends Page { + /** + * Initialize the UsAppToPersonPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UsAppToPersonSolution); + /** + * Build an instance of UsAppToPersonInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UsAppToPersonResource): UsAppToPersonInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPerson.js b/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPerson.js new file mode 100644 index 00000000..d09297b1 --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPerson.js @@ -0,0 +1,371 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsAppToPersonPage = exports.UsAppToPersonListInstance = exports.UsAppToPersonInstance = exports.UsAppToPersonContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class UsAppToPersonContextImpl { + constructor(_version, messagingServiceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(messagingServiceSid)) { + throw new Error("Parameter 'messagingServiceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { messagingServiceSid, sid }; + this._uri = `/Services/${messagingServiceSid}/Compliance/Usa2p/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UsAppToPersonInstance(operationVersion, payload, instance._solution.messagingServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["hasEmbeddedLinks"] === null || + params["hasEmbeddedLinks"] === undefined) { + throw new Error("Required parameter \"params['hasEmbeddedLinks']\" missing."); + } + if (params["hasEmbeddedPhone"] === null || + params["hasEmbeddedPhone"] === undefined) { + throw new Error("Required parameter \"params['hasEmbeddedPhone']\" missing."); + } + if (params["messageSamples"] === null || + params["messageSamples"] === undefined) { + throw new Error("Required parameter \"params['messageSamples']\" missing."); + } + if (params["messageFlow"] === null || params["messageFlow"] === undefined) { + throw new Error("Required parameter \"params['messageFlow']\" missing."); + } + if (params["description"] === null || params["description"] === undefined) { + throw new Error("Required parameter \"params['description']\" missing."); + } + if (params["ageGated"] === null || params["ageGated"] === undefined) { + throw new Error("Required parameter \"params['ageGated']\" missing."); + } + if (params["directLending"] === null || + params["directLending"] === undefined) { + throw new Error("Required parameter \"params['directLending']\" missing."); + } + let data = {}; + data["HasEmbeddedLinks"] = serialize.bool(params["hasEmbeddedLinks"]); + data["HasEmbeddedPhone"] = serialize.bool(params["hasEmbeddedPhone"]); + data["MessageSamples"] = serialize.map(params["messageSamples"], (e) => e); + data["MessageFlow"] = params["messageFlow"]; + data["Description"] = params["description"]; + data["AgeGated"] = serialize.bool(params["ageGated"]); + data["DirectLending"] = serialize.bool(params["directLending"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UsAppToPersonInstance(operationVersion, payload, instance._solution.messagingServiceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsAppToPersonContextImpl = UsAppToPersonContextImpl; +class UsAppToPersonInstance { + constructor(_version, payload, messagingServiceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.brandRegistrationSid = payload.brand_registration_sid; + this.messagingServiceSid = payload.messaging_service_sid; + this.description = payload.description; + this.messageSamples = payload.message_samples; + this.usAppToPersonUsecase = payload.us_app_to_person_usecase; + this.hasEmbeddedLinks = payload.has_embedded_links; + this.hasEmbeddedPhone = payload.has_embedded_phone; + this.subscriberOptIn = payload.subscriber_opt_in; + this.ageGated = payload.age_gated; + this.directLending = payload.direct_lending; + this.campaignStatus = payload.campaign_status; + this.campaignId = payload.campaign_id; + this.isExternallyRegistered = payload.is_externally_registered; + this.rateLimits = payload.rate_limits; + this.messageFlow = payload.message_flow; + this.optInMessage = payload.opt_in_message; + this.optOutMessage = payload.opt_out_message; + this.helpMessage = payload.help_message; + this.optInKeywords = payload.opt_in_keywords; + this.optOutKeywords = payload.opt_out_keywords; + this.helpKeywords = payload.help_keywords; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.mock = payload.mock; + this.errors = payload.errors; + this._solution = { messagingServiceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new UsAppToPersonContextImpl(this._version, this._solution.messagingServiceSid, this._solution.sid); + return this._context; + } + /** + * Remove a UsAppToPersonInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a UsAppToPersonInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsAppToPersonInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + brandRegistrationSid: this.brandRegistrationSid, + messagingServiceSid: this.messagingServiceSid, + description: this.description, + messageSamples: this.messageSamples, + usAppToPersonUsecase: this.usAppToPersonUsecase, + hasEmbeddedLinks: this.hasEmbeddedLinks, + hasEmbeddedPhone: this.hasEmbeddedPhone, + subscriberOptIn: this.subscriberOptIn, + ageGated: this.ageGated, + directLending: this.directLending, + campaignStatus: this.campaignStatus, + campaignId: this.campaignId, + isExternallyRegistered: this.isExternallyRegistered, + rateLimits: this.rateLimits, + messageFlow: this.messageFlow, + optInMessage: this.optInMessage, + optOutMessage: this.optOutMessage, + helpMessage: this.helpMessage, + optInKeywords: this.optInKeywords, + optOutKeywords: this.optOutKeywords, + helpKeywords: this.helpKeywords, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + mock: this.mock, + errors: this.errors, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsAppToPersonInstance = UsAppToPersonInstance; +function UsAppToPersonListInstance(version, messagingServiceSid) { + if (!(0, utility_1.isValidPathParam)(messagingServiceSid)) { + throw new Error("Parameter 'messagingServiceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new UsAppToPersonContextImpl(version, messagingServiceSid, sid); + }; + instance._version = version; + instance._solution = { messagingServiceSid }; + instance._uri = `/Services/${messagingServiceSid}/Compliance/Usa2p`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["brandRegistrationSid"] === null || + params["brandRegistrationSid"] === undefined) { + throw new Error("Required parameter \"params['brandRegistrationSid']\" missing."); + } + if (params["description"] === null || params["description"] === undefined) { + throw new Error("Required parameter \"params['description']\" missing."); + } + if (params["messageFlow"] === null || params["messageFlow"] === undefined) { + throw new Error("Required parameter \"params['messageFlow']\" missing."); + } + if (params["messageSamples"] === null || + params["messageSamples"] === undefined) { + throw new Error("Required parameter \"params['messageSamples']\" missing."); + } + if (params["usAppToPersonUsecase"] === null || + params["usAppToPersonUsecase"] === undefined) { + throw new Error("Required parameter \"params['usAppToPersonUsecase']\" missing."); + } + if (params["hasEmbeddedLinks"] === null || + params["hasEmbeddedLinks"] === undefined) { + throw new Error("Required parameter \"params['hasEmbeddedLinks']\" missing."); + } + if (params["hasEmbeddedPhone"] === null || + params["hasEmbeddedPhone"] === undefined) { + throw new Error("Required parameter \"params['hasEmbeddedPhone']\" missing."); + } + let data = {}; + data["BrandRegistrationSid"] = params["brandRegistrationSid"]; + data["Description"] = params["description"]; + data["MessageFlow"] = params["messageFlow"]; + data["MessageSamples"] = serialize.map(params["messageSamples"], (e) => e); + data["UsAppToPersonUsecase"] = params["usAppToPersonUsecase"]; + data["HasEmbeddedLinks"] = serialize.bool(params["hasEmbeddedLinks"]); + data["HasEmbeddedPhone"] = serialize.bool(params["hasEmbeddedPhone"]); + if (params["optInMessage"] !== undefined) + data["OptInMessage"] = params["optInMessage"]; + if (params["optOutMessage"] !== undefined) + data["OptOutMessage"] = params["optOutMessage"]; + if (params["helpMessage"] !== undefined) + data["HelpMessage"] = params["helpMessage"]; + if (params["optInKeywords"] !== undefined) + data["OptInKeywords"] = serialize.map(params["optInKeywords"], (e) => e); + if (params["optOutKeywords"] !== undefined) + data["OptOutKeywords"] = serialize.map(params["optOutKeywords"], (e) => e); + if (params["helpKeywords"] !== undefined) + data["HelpKeywords"] = serialize.map(params["helpKeywords"], (e) => e); + if (params["subscriberOptIn"] !== undefined) + data["SubscriberOptIn"] = serialize.bool(params["subscriberOptIn"]); + if (params["ageGated"] !== undefined) + data["AgeGated"] = serialize.bool(params["ageGated"]); + if (params["directLending"] !== undefined) + data["DirectLending"] = serialize.bool(params["directLending"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UsAppToPersonInstance(operationVersion, payload, instance._solution.messagingServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UsAppToPersonPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UsAppToPersonPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UsAppToPersonListInstance = UsAppToPersonListInstance; +class UsAppToPersonPage extends Page_1.default { + /** + * Initialize the UsAppToPersonPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UsAppToPersonInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UsAppToPersonInstance(this._version, payload, this._solution.messagingServiceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsAppToPersonPage = UsAppToPersonPage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPersonUsecase.d.ts b/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPersonUsecase.d.ts new file mode 100644 index 00000000..9839154e --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPersonUsecase.d.ts @@ -0,0 +1,62 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * Options to pass to fetch a UsAppToPersonUsecaseInstance + */ +export interface UsAppToPersonUsecaseListInstanceFetchOptions { + /** The unique string to identify the A2P brand. */ + brandRegistrationSid?: string; +} +export interface UsAppToPersonUsecaseSolution { + messagingServiceSid: string; +} +export interface UsAppToPersonUsecaseListInstance { + _version: V1; + _solution: UsAppToPersonUsecaseSolution; + _uri: string; + /** + * Fetch a UsAppToPersonUsecaseInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsAppToPersonUsecaseInstance + */ + fetch(callback?: (error: Error | null, item?: UsAppToPersonUsecaseInstance) => any): Promise; + /** + * Fetch a UsAppToPersonUsecaseInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsAppToPersonUsecaseInstance + */ + fetch(params: UsAppToPersonUsecaseListInstanceFetchOptions, callback?: (error: Error | null, item?: UsAppToPersonUsecaseInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UsAppToPersonUsecaseListInstance(version: V1, messagingServiceSid: string): UsAppToPersonUsecaseListInstance; +interface UsAppToPersonUsecaseResource { + us_app_to_person_usecases: Array; +} +export declare class UsAppToPersonUsecaseInstance { + protected _version: V1; + constructor(_version: V1, payload: UsAppToPersonUsecaseResource, messagingServiceSid: string); + /** + * Human readable name, code, description and post_approval_required (indicates whether or not post approval is required for this Use Case) of A2P Campaign Use Cases. + */ + usAppToPersonUsecases: Array; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + usAppToPersonUsecases: any[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPersonUsecase.js b/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPersonUsecase.js new file mode 100644 index 00000000..6dfd107c --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/service/usAppToPersonUsecase.js @@ -0,0 +1,79 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsAppToPersonUsecaseInstance = exports.UsAppToPersonUsecaseListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function UsAppToPersonUsecaseListInstance(version, messagingServiceSid) { + if (!(0, utility_1.isValidPathParam)(messagingServiceSid)) { + throw new Error("Parameter 'messagingServiceSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { messagingServiceSid }; + instance._uri = `/Services/${messagingServiceSid}/Compliance/Usa2p/Usecases`; + instance.fetch = function fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["brandRegistrationSid"] !== undefined) + data["BrandRegistrationSid"] = params["brandRegistrationSid"]; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UsAppToPersonUsecaseInstance(operationVersion, payload, instance._solution.messagingServiceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UsAppToPersonUsecaseListInstance = UsAppToPersonUsecaseListInstance; +class UsAppToPersonUsecaseInstance { + constructor(_version, payload, messagingServiceSid) { + this._version = _version; + this.usAppToPersonUsecases = payload.us_app_to_person_usecases; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + usAppToPersonUsecases: this.usAppToPersonUsecases, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsAppToPersonUsecaseInstance = UsAppToPersonUsecaseInstance; diff --git a/node_modules/twilio/lib/rest/messaging/v1/tollfreeVerification.d.ts b/node_modules/twilio/lib/rest/messaging/v1/tollfreeVerification.d.ts new file mode 100644 index 00000000..b7106cbb --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/tollfreeVerification.d.ts @@ -0,0 +1,564 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type TollfreeVerificationOptInType = "VERBAL" | "WEB_FORM" | "PAPER_FORM" | "VIA_TEXT" | "MOBILE_QR_CODE"; +export type TollfreeVerificationStatus = "PENDING_REVIEW" | "IN_REVIEW" | "TWILIO_APPROVED" | "TWILIO_REJECTED"; +/** + * Options to pass to update a TollfreeVerificationInstance + */ +export interface TollfreeVerificationContextUpdateOptions { + /** The name of the business or organization using the Tollfree number. */ + businessName?: string; + /** The website of the business or organization using the Tollfree number. */ + businessWebsite?: string; + /** The email address to receive the notification about the verification result. . */ + notificationEmail?: string; + /** The category of the use case for the Tollfree Number. List as many are applicable.. */ + useCaseCategories?: Array; + /** Use this to further explain how messaging is used by the business or organization. */ + useCaseSummary?: string; + /** An example of message content, i.e. a sample message. */ + productionMessageSample?: string; + /** Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. */ + optInImageUrls?: Array; + /** */ + optInType?: TollfreeVerificationOptInType; + /** Estimate monthly volume of messages from the Tollfree Number. */ + messageVolume?: string; + /** The address of the business or organization using the Tollfree number. */ + businessStreetAddress?: string; + /** The address of the business or organization using the Tollfree number. */ + businessStreetAddress2?: string; + /** The city of the business or organization using the Tollfree number. */ + businessCity?: string; + /** The state/province/region of the business or organization using the Tollfree number. */ + businessStateProvinceRegion?: string; + /** The postal code of the business or organization using the Tollfree number. */ + businessPostalCode?: string; + /** The country of the business or organization using the Tollfree number. */ + businessCountry?: string; + /** Additional information to be provided for verification. */ + additionalInformation?: string; + /** The first name of the contact for the business or organization using the Tollfree number. */ + businessContactFirstName?: string; + /** The last name of the contact for the business or organization using the Tollfree number. */ + businessContactLastName?: string; + /** The email address of the contact for the business or organization using the Tollfree number. */ + businessContactEmail?: string; + /** The phone number of the contact for the business or organization using the Tollfree number. */ + businessContactPhone?: string; + /** Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to \\\'Website fixed\\\'. */ + editReason?: string; +} +/** + * Options to pass to create a TollfreeVerificationInstance + */ +export interface TollfreeVerificationListInstanceCreateOptions { + /** The name of the business or organization using the Tollfree number. */ + businessName: string; + /** The website of the business or organization using the Tollfree number. */ + businessWebsite: string; + /** The email address to receive the notification about the verification result. . */ + notificationEmail: string; + /** The category of the use case for the Tollfree Number. List as many are applicable.. */ + useCaseCategories: Array; + /** Use this to further explain how messaging is used by the business or organization. */ + useCaseSummary: string; + /** An example of message content, i.e. a sample message. */ + productionMessageSample: string; + /** Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. */ + optInImageUrls: Array; + /** */ + optInType: TollfreeVerificationOptInType; + /** Estimate monthly volume of messages from the Tollfree Number. */ + messageVolume: string; + /** The SID of the Phone Number associated with the Tollfree Verification. */ + tollfreePhoneNumberSid: string; + /** Customer\\\'s Profile Bundle BundleSid. */ + customerProfileSid?: string; + /** The address of the business or organization using the Tollfree number. */ + businessStreetAddress?: string; + /** The address of the business or organization using the Tollfree number. */ + businessStreetAddress2?: string; + /** The city of the business or organization using the Tollfree number. */ + businessCity?: string; + /** The state/province/region of the business or organization using the Tollfree number. */ + businessStateProvinceRegion?: string; + /** The postal code of the business or organization using the Tollfree number. */ + businessPostalCode?: string; + /** The country of the business or organization using the Tollfree number. */ + businessCountry?: string; + /** Additional information to be provided for verification. */ + additionalInformation?: string; + /** The first name of the contact for the business or organization using the Tollfree number. */ + businessContactFirstName?: string; + /** The last name of the contact for the business or organization using the Tollfree number. */ + businessContactLastName?: string; + /** The email address of the contact for the business or organization using the Tollfree number. */ + businessContactEmail?: string; + /** The phone number of the contact for the business or organization using the Tollfree number. */ + businessContactPhone?: string; + /** An optional external reference ID supplied by customer and echoed back on status retrieval. */ + externalReferenceId?: string; +} +/** + * Options to pass to each + */ +export interface TollfreeVerificationListInstanceEachOptions { + /** The SID of the Phone Number associated with the Tollfree Verification. */ + tollfreePhoneNumberSid?: string; + /** The compliance status of the Tollfree Verification record. */ + status?: TollfreeVerificationStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TollfreeVerificationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TollfreeVerificationListInstanceOptions { + /** The SID of the Phone Number associated with the Tollfree Verification. */ + tollfreePhoneNumberSid?: string; + /** The compliance status of the Tollfree Verification record. */ + status?: TollfreeVerificationStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TollfreeVerificationListInstancePageOptions { + /** The SID of the Phone Number associated with the Tollfree Verification. */ + tollfreePhoneNumberSid?: string; + /** The compliance status of the Tollfree Verification record. */ + status?: TollfreeVerificationStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TollfreeVerificationContext { + /** + * Remove a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollfreeVerificationInstance + */ + fetch(callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + /** + * Update a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollfreeVerificationInstance + */ + update(callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + /** + * Update a TollfreeVerificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollfreeVerificationInstance + */ + update(params: TollfreeVerificationContextUpdateOptions, callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TollfreeVerificationContextSolution { + sid: string; +} +export declare class TollfreeVerificationContextImpl implements TollfreeVerificationContext { + protected _version: V1; + protected _solution: TollfreeVerificationContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + update(params?: TollfreeVerificationContextUpdateOptions | ((error: Error | null, item?: TollfreeVerificationInstance) => any), callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TollfreeVerificationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TollfreeVerificationPayload extends TwilioResponsePayload { + verifications: TollfreeVerificationResource[]; +} +interface TollfreeVerificationResource { + sid: string; + account_sid: string; + customer_profile_sid: string; + trust_product_sid: string; + date_created: Date; + date_updated: Date; + regulated_item_sid: string; + business_name: string; + business_street_address: string; + business_street_address2: string; + business_city: string; + business_state_province_region: string; + business_postal_code: string; + business_country: string; + business_website: string; + business_contact_first_name: string; + business_contact_last_name: string; + business_contact_email: string; + business_contact_phone: string; + notification_email: string; + use_case_categories: Array; + use_case_summary: string; + production_message_sample: string; + opt_in_image_urls: Array; + opt_in_type: TollfreeVerificationOptInType; + message_volume: string; + additional_information: string; + tollfree_phone_number_sid: string; + status: TollfreeVerificationStatus; + url: string; + rejection_reason: string; + error_code: number; + edit_expiration: Date; + edit_allowed: boolean; + resource_links: any; + external_reference_id: string; +} +export declare class TollfreeVerificationInstance { + protected _version: V1; + protected _solution: TollfreeVerificationContextSolution; + protected _context?: TollfreeVerificationContext; + constructor(_version: V1, payload: TollfreeVerificationResource, sid?: string); + /** + * The unique string to identify Tollfree Verification. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tollfree Verification resource. + */ + accountSid: string; + /** + * Customer\'s Profile Bundle BundleSid. + */ + customerProfileSid: string; + /** + * Tollfree TrustProduct Bundle BundleSid. + */ + trustProductSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The SID of the Regulated Item. + */ + regulatedItemSid: string; + /** + * The name of the business or organization using the Tollfree number. + */ + businessName: string; + /** + * The address of the business or organization using the Tollfree number. + */ + businessStreetAddress: string; + /** + * The address of the business or organization using the Tollfree number. + */ + businessStreetAddress2: string; + /** + * The city of the business or organization using the Tollfree number. + */ + businessCity: string; + /** + * The state/province/region of the business or organization using the Tollfree number. + */ + businessStateProvinceRegion: string; + /** + * The postal code of the business or organization using the Tollfree number. + */ + businessPostalCode: string; + /** + * The country of the business or organization using the Tollfree number. + */ + businessCountry: string; + /** + * The website of the business or organization using the Tollfree number. + */ + businessWebsite: string; + /** + * The first name of the contact for the business or organization using the Tollfree number. + */ + businessContactFirstName: string; + /** + * The last name of the contact for the business or organization using the Tollfree number. + */ + businessContactLastName: string; + /** + * The email address of the contact for the business or organization using the Tollfree number. + */ + businessContactEmail: string; + /** + * The phone number of the contact for the business or organization using the Tollfree number. + */ + businessContactPhone: string; + /** + * The email address to receive the notification about the verification result. . + */ + notificationEmail: string; + /** + * The category of the use case for the Tollfree Number. List as many are applicable.. + */ + useCaseCategories: Array; + /** + * Use this to further explain how messaging is used by the business or organization. + */ + useCaseSummary: string; + /** + * An example of message content, i.e. a sample message. + */ + productionMessageSample: string; + /** + * Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + */ + optInImageUrls: Array; + optInType: TollfreeVerificationOptInType; + /** + * Estimate monthly volume of messages from the Tollfree Number. + */ + messageVolume: string; + /** + * Additional information to be provided for verification. + */ + additionalInformation: string; + /** + * The SID of the Phone Number associated with the Tollfree Verification. + */ + tollfreePhoneNumberSid: string; + status: TollfreeVerificationStatus; + /** + * The absolute URL of the Tollfree Verification resource. + */ + url: string; + /** + * The rejection reason given when a Tollfree Verification has been rejected. + */ + rejectionReason: string; + /** + * The error code given when a Tollfree Verification has been rejected. + */ + errorCode: number; + /** + * The date and time when the ability to edit a rejected verification expires. + */ + editExpiration: Date; + /** + * If a rejected verification is allowed to be edited/resubmitted. Some rejection reasons allow editing and some do not. + */ + editAllowed: boolean; + /** + * The URLs of the documents associated with the Tollfree Verification resource. + */ + resourceLinks: any; + /** + * An optional external reference ID supplied by customer and echoed back on status retrieval. + */ + externalReferenceId: string; + private get _proxy(); + /** + * Remove a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollfreeVerificationInstance + */ + fetch(callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + /** + * Update a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollfreeVerificationInstance + */ + update(callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + /** + * Update a TollfreeVerificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollfreeVerificationInstance + */ + update(params: TollfreeVerificationContextUpdateOptions, callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + customerProfileSid: string; + trustProductSid: string; + dateCreated: Date; + dateUpdated: Date; + regulatedItemSid: string; + businessName: string; + businessStreetAddress: string; + businessStreetAddress2: string; + businessCity: string; + businessStateProvinceRegion: string; + businessPostalCode: string; + businessCountry: string; + businessWebsite: string; + businessContactFirstName: string; + businessContactLastName: string; + businessContactEmail: string; + businessContactPhone: string; + notificationEmail: string; + useCaseCategories: string[]; + useCaseSummary: string; + productionMessageSample: string; + optInImageUrls: string[]; + optInType: TollfreeVerificationOptInType; + messageVolume: string; + additionalInformation: string; + tollfreePhoneNumberSid: string; + status: TollfreeVerificationStatus; + url: string; + rejectionReason: string; + errorCode: number; + editExpiration: Date; + editAllowed: boolean; + resourceLinks: any; + externalReferenceId: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TollfreeVerificationSolution { +} +export interface TollfreeVerificationListInstance { + _version: V1; + _solution: TollfreeVerificationSolution; + _uri: string; + (sid: string): TollfreeVerificationContext; + get(sid: string): TollfreeVerificationContext; + /** + * Create a TollfreeVerificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollfreeVerificationInstance + */ + create(params: TollfreeVerificationListInstanceCreateOptions, callback?: (error: Error | null, item?: TollfreeVerificationInstance) => any): Promise; + /** + * Streams TollfreeVerificationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollfreeVerificationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TollfreeVerificationInstance, done: (err?: Error) => void) => void): void; + each(params: TollfreeVerificationListInstanceEachOptions, callback?: (item: TollfreeVerificationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TollfreeVerificationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TollfreeVerificationPage) => any): Promise; + /** + * Lists TollfreeVerificationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollfreeVerificationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TollfreeVerificationInstance[]) => any): Promise; + list(params: TollfreeVerificationListInstanceOptions, callback?: (error: Error | null, items: TollfreeVerificationInstance[]) => any): Promise; + /** + * Retrieve a single page of TollfreeVerificationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TollfreeVerificationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TollfreeVerificationPage) => any): Promise; + page(params: TollfreeVerificationListInstancePageOptions, callback?: (error: Error | null, items: TollfreeVerificationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TollfreeVerificationListInstance(version: V1): TollfreeVerificationListInstance; +export declare class TollfreeVerificationPage extends Page { + /** + * Initialize the TollfreeVerificationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TollfreeVerificationSolution); + /** + * Build an instance of TollfreeVerificationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TollfreeVerificationResource): TollfreeVerificationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/tollfreeVerification.js b/node_modules/twilio/lib/rest/messaging/v1/tollfreeVerification.js new file mode 100644 index 00000000..01d51f9e --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/tollfreeVerification.js @@ -0,0 +1,425 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TollfreeVerificationPage = exports.TollfreeVerificationListInstance = exports.TollfreeVerificationInstance = exports.TollfreeVerificationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class TollfreeVerificationContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Tollfree/Verifications/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TollfreeVerificationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["businessName"] !== undefined) + data["BusinessName"] = params["businessName"]; + if (params["businessWebsite"] !== undefined) + data["BusinessWebsite"] = params["businessWebsite"]; + if (params["notificationEmail"] !== undefined) + data["NotificationEmail"] = params["notificationEmail"]; + if (params["useCaseCategories"] !== undefined) + data["UseCaseCategories"] = serialize.map(params["useCaseCategories"], (e) => e); + if (params["useCaseSummary"] !== undefined) + data["UseCaseSummary"] = params["useCaseSummary"]; + if (params["productionMessageSample"] !== undefined) + data["ProductionMessageSample"] = params["productionMessageSample"]; + if (params["optInImageUrls"] !== undefined) + data["OptInImageUrls"] = serialize.map(params["optInImageUrls"], (e) => e); + if (params["optInType"] !== undefined) + data["OptInType"] = params["optInType"]; + if (params["messageVolume"] !== undefined) + data["MessageVolume"] = params["messageVolume"]; + if (params["businessStreetAddress"] !== undefined) + data["BusinessStreetAddress"] = params["businessStreetAddress"]; + if (params["businessStreetAddress2"] !== undefined) + data["BusinessStreetAddress2"] = params["businessStreetAddress2"]; + if (params["businessCity"] !== undefined) + data["BusinessCity"] = params["businessCity"]; + if (params["businessStateProvinceRegion"] !== undefined) + data["BusinessStateProvinceRegion"] = + params["businessStateProvinceRegion"]; + if (params["businessPostalCode"] !== undefined) + data["BusinessPostalCode"] = params["businessPostalCode"]; + if (params["businessCountry"] !== undefined) + data["BusinessCountry"] = params["businessCountry"]; + if (params["additionalInformation"] !== undefined) + data["AdditionalInformation"] = params["additionalInformation"]; + if (params["businessContactFirstName"] !== undefined) + data["BusinessContactFirstName"] = params["businessContactFirstName"]; + if (params["businessContactLastName"] !== undefined) + data["BusinessContactLastName"] = params["businessContactLastName"]; + if (params["businessContactEmail"] !== undefined) + data["BusinessContactEmail"] = params["businessContactEmail"]; + if (params["businessContactPhone"] !== undefined) + data["BusinessContactPhone"] = params["businessContactPhone"]; + if (params["editReason"] !== undefined) + data["EditReason"] = params["editReason"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TollfreeVerificationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TollfreeVerificationContextImpl = TollfreeVerificationContextImpl; +class TollfreeVerificationInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.customerProfileSid = payload.customer_profile_sid; + this.trustProductSid = payload.trust_product_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.regulatedItemSid = payload.regulated_item_sid; + this.businessName = payload.business_name; + this.businessStreetAddress = payload.business_street_address; + this.businessStreetAddress2 = payload.business_street_address2; + this.businessCity = payload.business_city; + this.businessStateProvinceRegion = payload.business_state_province_region; + this.businessPostalCode = payload.business_postal_code; + this.businessCountry = payload.business_country; + this.businessWebsite = payload.business_website; + this.businessContactFirstName = payload.business_contact_first_name; + this.businessContactLastName = payload.business_contact_last_name; + this.businessContactEmail = payload.business_contact_email; + this.businessContactPhone = payload.business_contact_phone; + this.notificationEmail = payload.notification_email; + this.useCaseCategories = payload.use_case_categories; + this.useCaseSummary = payload.use_case_summary; + this.productionMessageSample = payload.production_message_sample; + this.optInImageUrls = payload.opt_in_image_urls; + this.optInType = payload.opt_in_type; + this.messageVolume = payload.message_volume; + this.additionalInformation = payload.additional_information; + this.tollfreePhoneNumberSid = payload.tollfree_phone_number_sid; + this.status = payload.status; + this.url = payload.url; + this.rejectionReason = payload.rejection_reason; + this.errorCode = deserialize.integer(payload.error_code); + this.editExpiration = deserialize.iso8601DateTime(payload.edit_expiration); + this.editAllowed = payload.edit_allowed; + this.resourceLinks = payload.resource_links; + this.externalReferenceId = payload.external_reference_id; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TollfreeVerificationContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TollfreeVerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TollfreeVerificationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + customerProfileSid: this.customerProfileSid, + trustProductSid: this.trustProductSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + regulatedItemSid: this.regulatedItemSid, + businessName: this.businessName, + businessStreetAddress: this.businessStreetAddress, + businessStreetAddress2: this.businessStreetAddress2, + businessCity: this.businessCity, + businessStateProvinceRegion: this.businessStateProvinceRegion, + businessPostalCode: this.businessPostalCode, + businessCountry: this.businessCountry, + businessWebsite: this.businessWebsite, + businessContactFirstName: this.businessContactFirstName, + businessContactLastName: this.businessContactLastName, + businessContactEmail: this.businessContactEmail, + businessContactPhone: this.businessContactPhone, + notificationEmail: this.notificationEmail, + useCaseCategories: this.useCaseCategories, + useCaseSummary: this.useCaseSummary, + productionMessageSample: this.productionMessageSample, + optInImageUrls: this.optInImageUrls, + optInType: this.optInType, + messageVolume: this.messageVolume, + additionalInformation: this.additionalInformation, + tollfreePhoneNumberSid: this.tollfreePhoneNumberSid, + status: this.status, + url: this.url, + rejectionReason: this.rejectionReason, + errorCode: this.errorCode, + editExpiration: this.editExpiration, + editAllowed: this.editAllowed, + resourceLinks: this.resourceLinks, + externalReferenceId: this.externalReferenceId, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TollfreeVerificationInstance = TollfreeVerificationInstance; +function TollfreeVerificationListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TollfreeVerificationContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Tollfree/Verifications`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["businessName"] === null || + params["businessName"] === undefined) { + throw new Error("Required parameter \"params['businessName']\" missing."); + } + if (params["businessWebsite"] === null || + params["businessWebsite"] === undefined) { + throw new Error("Required parameter \"params['businessWebsite']\" missing."); + } + if (params["notificationEmail"] === null || + params["notificationEmail"] === undefined) { + throw new Error("Required parameter \"params['notificationEmail']\" missing."); + } + if (params["useCaseCategories"] === null || + params["useCaseCategories"] === undefined) { + throw new Error("Required parameter \"params['useCaseCategories']\" missing."); + } + if (params["useCaseSummary"] === null || + params["useCaseSummary"] === undefined) { + throw new Error("Required parameter \"params['useCaseSummary']\" missing."); + } + if (params["productionMessageSample"] === null || + params["productionMessageSample"] === undefined) { + throw new Error("Required parameter \"params['productionMessageSample']\" missing."); + } + if (params["optInImageUrls"] === null || + params["optInImageUrls"] === undefined) { + throw new Error("Required parameter \"params['optInImageUrls']\" missing."); + } + if (params["optInType"] === null || params["optInType"] === undefined) { + throw new Error("Required parameter \"params['optInType']\" missing."); + } + if (params["messageVolume"] === null || + params["messageVolume"] === undefined) { + throw new Error("Required parameter \"params['messageVolume']\" missing."); + } + if (params["tollfreePhoneNumberSid"] === null || + params["tollfreePhoneNumberSid"] === undefined) { + throw new Error("Required parameter \"params['tollfreePhoneNumberSid']\" missing."); + } + let data = {}; + data["BusinessName"] = params["businessName"]; + data["BusinessWebsite"] = params["businessWebsite"]; + data["NotificationEmail"] = params["notificationEmail"]; + data["UseCaseCategories"] = serialize.map(params["useCaseCategories"], (e) => e); + data["UseCaseSummary"] = params["useCaseSummary"]; + data["ProductionMessageSample"] = params["productionMessageSample"]; + data["OptInImageUrls"] = serialize.map(params["optInImageUrls"], (e) => e); + data["OptInType"] = params["optInType"]; + data["MessageVolume"] = params["messageVolume"]; + data["TollfreePhoneNumberSid"] = params["tollfreePhoneNumberSid"]; + if (params["customerProfileSid"] !== undefined) + data["CustomerProfileSid"] = params["customerProfileSid"]; + if (params["businessStreetAddress"] !== undefined) + data["BusinessStreetAddress"] = params["businessStreetAddress"]; + if (params["businessStreetAddress2"] !== undefined) + data["BusinessStreetAddress2"] = params["businessStreetAddress2"]; + if (params["businessCity"] !== undefined) + data["BusinessCity"] = params["businessCity"]; + if (params["businessStateProvinceRegion"] !== undefined) + data["BusinessStateProvinceRegion"] = + params["businessStateProvinceRegion"]; + if (params["businessPostalCode"] !== undefined) + data["BusinessPostalCode"] = params["businessPostalCode"]; + if (params["businessCountry"] !== undefined) + data["BusinessCountry"] = params["businessCountry"]; + if (params["additionalInformation"] !== undefined) + data["AdditionalInformation"] = params["additionalInformation"]; + if (params["businessContactFirstName"] !== undefined) + data["BusinessContactFirstName"] = params["businessContactFirstName"]; + if (params["businessContactLastName"] !== undefined) + data["BusinessContactLastName"] = params["businessContactLastName"]; + if (params["businessContactEmail"] !== undefined) + data["BusinessContactEmail"] = params["businessContactEmail"]; + if (params["businessContactPhone"] !== undefined) + data["BusinessContactPhone"] = params["businessContactPhone"]; + if (params["externalReferenceId"] !== undefined) + data["ExternalReferenceId"] = params["externalReferenceId"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TollfreeVerificationInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["tollfreePhoneNumberSid"] !== undefined) + data["TollfreePhoneNumberSid"] = params["tollfreePhoneNumberSid"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TollfreeVerificationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TollfreeVerificationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TollfreeVerificationListInstance = TollfreeVerificationListInstance; +class TollfreeVerificationPage extends Page_1.default { + /** + * Initialize the TollfreeVerificationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TollfreeVerificationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TollfreeVerificationInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TollfreeVerificationPage = TollfreeVerificationPage; diff --git a/node_modules/twilio/lib/rest/messaging/v1/usecase.d.ts b/node_modules/twilio/lib/rest/messaging/v1/usecase.d.ts new file mode 100644 index 00000000..ee3e672c --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/usecase.d.ts @@ -0,0 +1,45 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface UsecaseSolution { +} +export interface UsecaseListInstance { + _version: V1; + _solution: UsecaseSolution; + _uri: string; + /** + * Fetch a UsecaseInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsecaseInstance + */ + fetch(callback?: (error: Error | null, item?: UsecaseInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UsecaseListInstance(version: V1): UsecaseListInstance; +interface UsecaseResource { + usecases: Array; +} +export declare class UsecaseInstance { + protected _version: V1; + constructor(_version: V1, payload: UsecaseResource); + /** + * Human readable use case details (usecase, description and purpose) of Messaging Service Use Cases. + */ + usecases: Array; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + usecases: any[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/messaging/v1/usecase.js b/node_modules/twilio/lib/rest/messaging/v1/usecase.js new file mode 100644 index 00000000..162a798b --- /dev/null +++ b/node_modules/twilio/lib/rest/messaging/v1/usecase.js @@ -0,0 +1,62 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Messaging + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsecaseInstance = exports.UsecaseListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function UsecaseListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services/Usecases`; + instance.fetch = function fetch(callback) { + let operationVersion = version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new UsecaseInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UsecaseListInstance = UsecaseListInstance; +class UsecaseInstance { + constructor(_version, payload) { + this._version = _version; + this.usecases = payload.usecases; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + usecases: this.usecases, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsecaseInstance = UsecaseInstance; diff --git a/node_modules/twilio/lib/rest/microvisor/V1.d.ts b/node_modules/twilio/lib/rest/microvisor/V1.d.ts new file mode 100644 index 00000000..386c76a3 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/V1.d.ts @@ -0,0 +1,30 @@ +import MicrovisorBase from "../MicrovisorBase"; +import Version from "../../base/Version"; +import { AccountConfigListInstance } from "./v1/accountConfig"; +import { AccountSecretListInstance } from "./v1/accountSecret"; +import { AppListInstance } from "./v1/app"; +import { DeviceListInstance } from "./v1/device"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Microvisor + * + * @param domain - The Twilio (Twilio.Microvisor) domain + */ + constructor(domain: MicrovisorBase); + /** accountConfigs - { Twilio.Microvisor.V1.AccountConfigListInstance } resource */ + protected _accountConfigs?: AccountConfigListInstance; + /** accountSecrets - { Twilio.Microvisor.V1.AccountSecretListInstance } resource */ + protected _accountSecrets?: AccountSecretListInstance; + /** apps - { Twilio.Microvisor.V1.AppListInstance } resource */ + protected _apps?: AppListInstance; + /** devices - { Twilio.Microvisor.V1.DeviceListInstance } resource */ + protected _devices?: DeviceListInstance; + /** Getter for accountConfigs resource */ + get accountConfigs(): AccountConfigListInstance; + /** Getter for accountSecrets resource */ + get accountSecrets(): AccountSecretListInstance; + /** Getter for apps resource */ + get apps(): AppListInstance; + /** Getter for devices resource */ + get devices(): DeviceListInstance; +} diff --git a/node_modules/twilio/lib/rest/microvisor/V1.js b/node_modules/twilio/lib/rest/microvisor/V1.js new file mode 100644 index 00000000..b11f2783 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/V1.js @@ -0,0 +1,56 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Microvisor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const accountConfig_1 = require("./v1/accountConfig"); +const accountSecret_1 = require("./v1/accountSecret"); +const app_1 = require("./v1/app"); +const device_1 = require("./v1/device"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Microvisor + * + * @param domain - The Twilio (Twilio.Microvisor) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for accountConfigs resource */ + get accountConfigs() { + this._accountConfigs = + this._accountConfigs || (0, accountConfig_1.AccountConfigListInstance)(this); + return this._accountConfigs; + } + /** Getter for accountSecrets resource */ + get accountSecrets() { + this._accountSecrets = + this._accountSecrets || (0, accountSecret_1.AccountSecretListInstance)(this); + return this._accountSecrets; + } + /** Getter for apps resource */ + get apps() { + this._apps = this._apps || (0, app_1.AppListInstance)(this); + return this._apps; + } + /** Getter for devices resource */ + get devices() { + this._devices = this._devices || (0, device_1.DeviceListInstance)(this); + return this._devices; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/accountConfig.d.ts b/node_modules/twilio/lib/rest/microvisor/v1/accountConfig.d.ts new file mode 100644 index 00000000..75079b48 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/accountConfig.d.ts @@ -0,0 +1,263 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to update a AccountConfigInstance + */ +export interface AccountConfigContextUpdateOptions { + /** The config value; up to 4096 characters. */ + value: string; +} +/** + * Options to pass to create a AccountConfigInstance + */ +export interface AccountConfigListInstanceCreateOptions { + /** The config key; up to 100 characters. */ + key: string; + /** The config value; up to 4096 characters. */ + value: string; +} +/** + * Options to pass to each + */ +export interface AccountConfigListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AccountConfigListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AccountConfigListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AccountConfigContext { + /** + * Remove a AccountConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AccountConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountConfigInstance + */ + fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise; + /** + * Update a AccountConfigInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountConfigInstance + */ + update(params: AccountConfigContextUpdateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AccountConfigContextSolution { + key: string; +} +export declare class AccountConfigContextImpl implements AccountConfigContext { + protected _version: V1; + protected _solution: AccountConfigContextSolution; + protected _uri: string; + constructor(_version: V1, key: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise; + update(params: AccountConfigContextUpdateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AccountConfigContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AccountConfigPayload extends TwilioResponsePayload { + configs: AccountConfigResource[]; +} +interface AccountConfigResource { + key: string; + date_updated: Date; + value: string; + url: string; +} +export declare class AccountConfigInstance { + protected _version: V1; + protected _solution: AccountConfigContextSolution; + protected _context?: AccountConfigContext; + constructor(_version: V1, payload: AccountConfigResource, key?: string); + /** + * The config key; up to 100 characters. + */ + key: string; + dateUpdated: Date; + /** + * The config value; up to 4096 characters. + */ + value: string; + /** + * The absolute URL of the Config. + */ + url: string; + private get _proxy(); + /** + * Remove a AccountConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AccountConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountConfigInstance + */ + fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise; + /** + * Update a AccountConfigInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountConfigInstance + */ + update(params: AccountConfigContextUpdateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + key: string; + dateUpdated: Date; + value: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AccountConfigSolution { +} +export interface AccountConfigListInstance { + _version: V1; + _solution: AccountConfigSolution; + _uri: string; + (key: string): AccountConfigContext; + get(key: string): AccountConfigContext; + /** + * Create a AccountConfigInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountConfigInstance + */ + create(params: AccountConfigListInstanceCreateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise; + /** + * Streams AccountConfigInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountConfigListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void): void; + each(params: AccountConfigListInstanceEachOptions, callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AccountConfigInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AccountConfigPage) => any): Promise; + /** + * Lists AccountConfigInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountConfigListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AccountConfigInstance[]) => any): Promise; + list(params: AccountConfigListInstanceOptions, callback?: (error: Error | null, items: AccountConfigInstance[]) => any): Promise; + /** + * Retrieve a single page of AccountConfigInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountConfigListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AccountConfigPage) => any): Promise; + page(params: AccountConfigListInstancePageOptions, callback?: (error: Error | null, items: AccountConfigPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AccountConfigListInstance(version: V1): AccountConfigListInstance; +export declare class AccountConfigPage extends Page { + /** + * Initialize the AccountConfigPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AccountConfigSolution); + /** + * Build an instance of AccountConfigInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AccountConfigResource): AccountConfigInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/accountConfig.js b/node_modules/twilio/lib/rest/microvisor/v1/accountConfig.js new file mode 100644 index 00000000..f7d2f406 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/accountConfig.js @@ -0,0 +1,246 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Microvisor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AccountConfigPage = exports.AccountConfigListInstance = exports.AccountConfigInstance = exports.AccountConfigContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class AccountConfigContextImpl { + constructor(_version, key) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(key)) { + throw new Error("Parameter 'key' is not valid."); + } + this._solution = { key }; + this._uri = `/Configs/${key}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AccountConfigInstance(operationVersion, payload, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountConfigInstance(operationVersion, payload, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountConfigContextImpl = AccountConfigContextImpl; +class AccountConfigInstance { + constructor(_version, payload, key) { + this._version = _version; + this.key = payload.key; + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.value = payload.value; + this.url = payload.url; + this._solution = { key: key || this.key }; + } + get _proxy() { + this._context = + this._context || + new AccountConfigContextImpl(this._version, this._solution.key); + return this._context; + } + /** + * Remove a AccountConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AccountConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountConfigInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + key: this.key, + dateUpdated: this.dateUpdated, + value: this.value, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountConfigInstance = AccountConfigInstance; +function AccountConfigListInstance(version) { + const instance = ((key) => instance.get(key)); + instance.get = function get(key) { + return new AccountConfigContextImpl(version, key); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Configs`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["key"] === null || params["key"] === undefined) { + throw new Error("Required parameter \"params['key']\" missing."); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Key"] = params["key"]; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountConfigInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountConfigPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AccountConfigPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AccountConfigListInstance = AccountConfigListInstance; +class AccountConfigPage extends Page_1.default { + /** + * Initialize the AccountConfigPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AccountConfigInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AccountConfigInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountConfigPage = AccountConfigPage; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/accountSecret.d.ts b/node_modules/twilio/lib/rest/microvisor/v1/accountSecret.d.ts new file mode 100644 index 00000000..efa17d24 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/accountSecret.d.ts @@ -0,0 +1,257 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to update a AccountSecretInstance + */ +export interface AccountSecretContextUpdateOptions { + /** The secret value; up to 4096 characters. */ + value: string; +} +/** + * Options to pass to create a AccountSecretInstance + */ +export interface AccountSecretListInstanceCreateOptions { + /** The secret key; up to 100 characters. */ + key: string; + /** The secret value; up to 4096 characters. */ + value: string; +} +/** + * Options to pass to each + */ +export interface AccountSecretListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AccountSecretInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AccountSecretListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AccountSecretListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AccountSecretContext { + /** + * Remove a AccountSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AccountSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountSecretInstance + */ + fetch(callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise; + /** + * Update a AccountSecretInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountSecretInstance + */ + update(params: AccountSecretContextUpdateOptions, callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AccountSecretContextSolution { + key: string; +} +export declare class AccountSecretContextImpl implements AccountSecretContext { + protected _version: V1; + protected _solution: AccountSecretContextSolution; + protected _uri: string; + constructor(_version: V1, key: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise; + update(params: AccountSecretContextUpdateOptions, callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AccountSecretContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AccountSecretPayload extends TwilioResponsePayload { + secrets: AccountSecretResource[]; +} +interface AccountSecretResource { + key: string; + date_rotated: Date; + url: string; +} +export declare class AccountSecretInstance { + protected _version: V1; + protected _solution: AccountSecretContextSolution; + protected _context?: AccountSecretContext; + constructor(_version: V1, payload: AccountSecretResource, key?: string); + /** + * The secret key; up to 100 characters. + */ + key: string; + dateRotated: Date; + /** + * The absolute URL of the Secret. + */ + url: string; + private get _proxy(); + /** + * Remove a AccountSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AccountSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountSecretInstance + */ + fetch(callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise; + /** + * Update a AccountSecretInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountSecretInstance + */ + update(params: AccountSecretContextUpdateOptions, callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + key: string; + dateRotated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AccountSecretSolution { +} +export interface AccountSecretListInstance { + _version: V1; + _solution: AccountSecretSolution; + _uri: string; + (key: string): AccountSecretContext; + get(key: string): AccountSecretContext; + /** + * Create a AccountSecretInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountSecretInstance + */ + create(params: AccountSecretListInstanceCreateOptions, callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise; + /** + * Streams AccountSecretInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountSecretListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AccountSecretInstance, done: (err?: Error) => void) => void): void; + each(params: AccountSecretListInstanceEachOptions, callback?: (item: AccountSecretInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AccountSecretInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AccountSecretPage) => any): Promise; + /** + * Lists AccountSecretInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountSecretListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AccountSecretInstance[]) => any): Promise; + list(params: AccountSecretListInstanceOptions, callback?: (error: Error | null, items: AccountSecretInstance[]) => any): Promise; + /** + * Retrieve a single page of AccountSecretInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AccountSecretListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AccountSecretPage) => any): Promise; + page(params: AccountSecretListInstancePageOptions, callback?: (error: Error | null, items: AccountSecretPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AccountSecretListInstance(version: V1): AccountSecretListInstance; +export declare class AccountSecretPage extends Page { + /** + * Initialize the AccountSecretPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AccountSecretSolution); + /** + * Build an instance of AccountSecretInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AccountSecretResource): AccountSecretInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/accountSecret.js b/node_modules/twilio/lib/rest/microvisor/v1/accountSecret.js new file mode 100644 index 00000000..b6628ad0 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/accountSecret.js @@ -0,0 +1,244 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Microvisor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AccountSecretPage = exports.AccountSecretListInstance = exports.AccountSecretInstance = exports.AccountSecretContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class AccountSecretContextImpl { + constructor(_version, key) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(key)) { + throw new Error("Parameter 'key' is not valid."); + } + this._solution = { key }; + this._uri = `/Secrets/${key}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AccountSecretInstance(operationVersion, payload, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountSecretInstance(operationVersion, payload, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountSecretContextImpl = AccountSecretContextImpl; +class AccountSecretInstance { + constructor(_version, payload, key) { + this._version = _version; + this.key = payload.key; + this.dateRotated = deserialize.iso8601DateTime(payload.date_rotated); + this.url = payload.url; + this._solution = { key: key || this.key }; + } + get _proxy() { + this._context = + this._context || + new AccountSecretContextImpl(this._version, this._solution.key); + return this._context; + } + /** + * Remove a AccountSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AccountSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccountSecretInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + key: this.key, + dateRotated: this.dateRotated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountSecretInstance = AccountSecretInstance; +function AccountSecretListInstance(version) { + const instance = ((key) => instance.get(key)); + instance.get = function get(key) { + return new AccountSecretContextImpl(version, key); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Secrets`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["key"] === null || params["key"] === undefined) { + throw new Error("Required parameter \"params['key']\" missing."); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Key"] = params["key"]; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountSecretInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccountSecretPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AccountSecretPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AccountSecretListInstance = AccountSecretListInstance; +class AccountSecretPage extends Page_1.default { + /** + * Initialize the AccountSecretPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AccountSecretInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AccountSecretInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccountSecretPage = AccountSecretPage; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/app.d.ts b/node_modules/twilio/lib/rest/microvisor/v1/app.d.ts new file mode 100644 index 00000000..e0890c13 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/app.d.ts @@ -0,0 +1,251 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { AppManifestListInstance } from "./app/appManifest"; +/** + * Options to pass to each + */ +export interface AppListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AppInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AppListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AppListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AppContext { + appManifests: AppManifestListInstance; + /** + * Remove a AppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AppInstance + */ + fetch(callback?: (error: Error | null, item?: AppInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AppContextSolution { + sid: string; +} +export declare class AppContextImpl implements AppContext { + protected _version: V1; + protected _solution: AppContextSolution; + protected _uri: string; + protected _appManifests?: AppManifestListInstance; + constructor(_version: V1, sid: string); + get appManifests(): AppManifestListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AppInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AppContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AppPayload extends TwilioResponsePayload { + apps: AppResource[]; +} +interface AppResource { + sid: string; + account_sid: string; + hash: string; + unique_name: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class AppInstance { + protected _version: V1; + protected _solution: AppContextSolution; + protected _context?: AppContext; + constructor(_version: V1, payload: AppResource, sid?: string); + /** + * A 34-character string that uniquely identifies this App. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * App manifest hash represented as `hash_algorithm:hash_value`. + */ + hash: string; + /** + * A developer-defined string that uniquely identifies the App. This value must be unique for all Apps on this Account. The `unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource. + */ + uniqueName: string; + /** + * The date that this App was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date that this App was last updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The URL of this resource. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Remove a AppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AppInstance + */ + fetch(callback?: (error: Error | null, item?: AppInstance) => any): Promise; + /** + * Access the appManifests. + */ + appManifests(): AppManifestListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + hash: string; + uniqueName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AppSolution { +} +export interface AppListInstance { + _version: V1; + _solution: AppSolution; + _uri: string; + (sid: string): AppContext; + get(sid: string): AppContext; + /** + * Streams AppInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AppListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AppInstance, done: (err?: Error) => void) => void): void; + each(params: AppListInstanceEachOptions, callback?: (item: AppInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AppInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AppPage) => any): Promise; + /** + * Lists AppInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AppListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AppInstance[]) => any): Promise; + list(params: AppListInstanceOptions, callback?: (error: Error | null, items: AppInstance[]) => any): Promise; + /** + * Retrieve a single page of AppInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AppListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AppPage) => any): Promise; + page(params: AppListInstancePageOptions, callback?: (error: Error | null, items: AppPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AppListInstance(version: V1): AppListInstance; +export declare class AppPage extends Page { + /** + * Initialize the AppPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AppSolution); + /** + * Build an instance of AppInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AppResource): AppInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/app.js b/node_modules/twilio/lib/rest/microvisor/v1/app.js new file mode 100644 index 00000000..0946dcca --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/app.js @@ -0,0 +1,216 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Microvisor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AppPage = exports.AppListInstance = exports.AppInstance = exports.AppContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const appManifest_1 = require("./app/appManifest"); +class AppContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Apps/${sid}`; + } + get appManifests() { + this._appManifests = + this._appManifests || + (0, appManifest_1.AppManifestListInstance)(this._version, this._solution.sid); + return this._appManifests; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AppInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AppContextImpl = AppContextImpl; +class AppInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.hash = payload.hash; + this.uniqueName = payload.unique_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new AppContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a AppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AppInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AppInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the appManifests. + */ + appManifests() { + return this._proxy.appManifests; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + hash: this.hash, + uniqueName: this.uniqueName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AppInstance = AppInstance; +function AppListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AppContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Apps`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AppPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AppPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AppListInstance = AppListInstance; +class AppPage extends Page_1.default { + /** + * Initialize the AppPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AppInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AppInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AppPage = AppPage; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/app/appManifest.d.ts b/node_modules/twilio/lib/rest/microvisor/v1/app/appManifest.d.ts new file mode 100644 index 00000000..e565d153 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/app/appManifest.d.ts @@ -0,0 +1,101 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export interface AppManifestContext { + /** + * Fetch a AppManifestInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AppManifestInstance + */ + fetch(callback?: (error: Error | null, item?: AppManifestInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AppManifestContextSolution { + appSid: string; +} +export declare class AppManifestContextImpl implements AppManifestContext { + protected _version: V1; + protected _solution: AppManifestContextSolution; + protected _uri: string; + constructor(_version: V1, appSid: string); + fetch(callback?: (error: Error | null, item?: AppManifestInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AppManifestContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AppManifestResource { + app_sid: string; + hash: string; + encoded_bytes: string; + url: string; +} +export declare class AppManifestInstance { + protected _version: V1; + protected _solution: AppManifestContextSolution; + protected _context?: AppManifestContext; + constructor(_version: V1, payload: AppManifestResource, appSid: string); + /** + * A 34-character string that uniquely identifies this App. + */ + appSid: string; + /** + * App manifest hash represented as `hash_algorithm:hash_value`. + */ + hash: string; + /** + * The base-64 encoded manifest + */ + encodedBytes: string; + /** + * The absolute URL of this Manifest. + */ + url: string; + private get _proxy(); + /** + * Fetch a AppManifestInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AppManifestInstance + */ + fetch(callback?: (error: Error | null, item?: AppManifestInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + appSid: string; + hash: string; + encodedBytes: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AppManifestSolution { + appSid: string; +} +export interface AppManifestListInstance { + _version: V1; + _solution: AppManifestSolution; + _uri: string; + (): AppManifestContext; + get(): AppManifestContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AppManifestListInstance(version: V1, appSid: string): AppManifestListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/app/appManifest.js b/node_modules/twilio/lib/rest/microvisor/v1/app/appManifest.js new file mode 100644 index 00000000..2960d6fa --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/app/appManifest.js @@ -0,0 +1,115 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Microvisor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AppManifestListInstance = exports.AppManifestInstance = exports.AppManifestContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class AppManifestContextImpl { + constructor(_version, appSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(appSid)) { + throw new Error("Parameter 'appSid' is not valid."); + } + this._solution = { appSid }; + this._uri = `/Apps/${appSid}/Manifest`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AppManifestInstance(operationVersion, payload, instance._solution.appSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AppManifestContextImpl = AppManifestContextImpl; +class AppManifestInstance { + constructor(_version, payload, appSid) { + this._version = _version; + this.appSid = payload.app_sid; + this.hash = payload.hash; + this.encodedBytes = payload.encoded_bytes; + this.url = payload.url; + this._solution = { appSid }; + } + get _proxy() { + this._context = + this._context || + new AppManifestContextImpl(this._version, this._solution.appSid); + return this._context; + } + /** + * Fetch a AppManifestInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AppManifestInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + appSid: this.appSid, + hash: this.hash, + encodedBytes: this.encodedBytes, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AppManifestInstance = AppManifestInstance; +function AppManifestListInstance(version, appSid) { + if (!(0, utility_1.isValidPathParam)(appSid)) { + throw new Error("Parameter 'appSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new AppManifestContextImpl(version, appSid); + }; + instance._version = version; + instance._solution = { appSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AppManifestListInstance = AppManifestListInstance; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/device.d.ts b/node_modules/twilio/lib/rest/microvisor/v1/device.d.ts new file mode 100644 index 00000000..ede0304f --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/device.d.ts @@ -0,0 +1,299 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { DeviceConfigListInstance } from "./device/deviceConfig"; +import { DeviceSecretListInstance } from "./device/deviceSecret"; +/** + * Options to pass to update a DeviceInstance + */ +export interface DeviceContextUpdateOptions { + /** A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. */ + uniqueName?: string; + /** The SID or unique name of the App to be targeted to the Device. */ + targetApp?: string; + /** A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. */ + loggingEnabled?: boolean; + /** Set to true to restart the App running on the Device. */ + restartApp?: boolean; +} +/** + * Options to pass to each + */ +export interface DeviceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DeviceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DeviceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DeviceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DeviceContext { + deviceConfigs: DeviceConfigListInstance; + deviceSecrets: DeviceSecretListInstance; + /** + * Fetch a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + fetch(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Update a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + update(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Update a DeviceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + update(params: DeviceContextUpdateOptions, callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeviceContextSolution { + sid: string; +} +export declare class DeviceContextImpl implements DeviceContext { + protected _version: V1; + protected _solution: DeviceContextSolution; + protected _uri: string; + protected _deviceConfigs?: DeviceConfigListInstance; + protected _deviceSecrets?: DeviceSecretListInstance; + constructor(_version: V1, sid: string); + get deviceConfigs(): DeviceConfigListInstance; + get deviceSecrets(): DeviceSecretListInstance; + fetch(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + update(params?: DeviceContextUpdateOptions | ((error: Error | null, item?: DeviceInstance) => any), callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeviceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DevicePayload extends TwilioResponsePayload { + devices: DeviceResource[]; +} +interface DeviceResource { + sid: string; + unique_name: string; + account_sid: string; + app: any; + logging: any; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class DeviceInstance { + protected _version: V1; + protected _solution: DeviceContextSolution; + protected _context?: DeviceContext; + constructor(_version: V1, payload: DeviceResource, sid?: string); + /** + * A 34-character string that uniquely identifies this Device. + */ + sid: string; + /** + * A developer-defined string that uniquely identifies the Device. This value must be unique for all Devices on this Account. The `unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource. + */ + uniqueName: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * Information about the target App and the App reported by this Device. Contains the properties `target_sid`, `date_targeted`, `update_status` (one of `up-to-date`, `pending` and `error`), `update_error_code`, `reported_sid` and `date_reported`. + */ + app: any; + /** + * Object specifying whether application logging is enabled for this Device. Contains the properties `enabled` and `date_expires`. + */ + logging: any; + /** + * The date that this Device was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date that this Device was last updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The URL of this resource. + */ + url: string; + /** + * The absolute URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + fetch(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Update a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + update(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Update a DeviceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + update(params: DeviceContextUpdateOptions, callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Access the deviceConfigs. + */ + deviceConfigs(): DeviceConfigListInstance; + /** + * Access the deviceSecrets. + */ + deviceSecrets(): DeviceSecretListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + app: any; + logging: any; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeviceSolution { +} +export interface DeviceListInstance { + _version: V1; + _solution: DeviceSolution; + _uri: string; + (sid: string): DeviceContext; + get(sid: string): DeviceContext; + /** + * Streams DeviceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DeviceInstance, done: (err?: Error) => void) => void): void; + each(params: DeviceListInstanceEachOptions, callback?: (item: DeviceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DeviceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DevicePage) => any): Promise; + /** + * Lists DeviceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DeviceInstance[]) => any): Promise; + list(params: DeviceListInstanceOptions, callback?: (error: Error | null, items: DeviceInstance[]) => any): Promise; + /** + * Retrieve a single page of DeviceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DevicePage) => any): Promise; + page(params: DeviceListInstancePageOptions, callback?: (error: Error | null, items: DevicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeviceListInstance(version: V1): DeviceListInstance; +export declare class DevicePage extends Page { + /** + * Initialize the DevicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DeviceSolution); + /** + * Build an instance of DeviceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DeviceResource): DeviceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/device.js b/node_modules/twilio/lib/rest/microvisor/v1/device.js new file mode 100644 index 00000000..eea27cb2 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/device.js @@ -0,0 +1,245 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Microvisor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DevicePage = exports.DeviceListInstance = exports.DeviceInstance = exports.DeviceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const deviceConfig_1 = require("./device/deviceConfig"); +const deviceSecret_1 = require("./device/deviceSecret"); +class DeviceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Devices/${sid}`; + } + get deviceConfigs() { + this._deviceConfigs = + this._deviceConfigs || + (0, deviceConfig_1.DeviceConfigListInstance)(this._version, this._solution.sid); + return this._deviceConfigs; + } + get deviceSecrets() { + this._deviceSecrets = + this._deviceSecrets || + (0, deviceSecret_1.DeviceSecretListInstance)(this._version, this._solution.sid); + return this._deviceSecrets; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DeviceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["targetApp"] !== undefined) + data["TargetApp"] = params["targetApp"]; + if (params["loggingEnabled"] !== undefined) + data["LoggingEnabled"] = serialize.bool(params["loggingEnabled"]); + if (params["restartApp"] !== undefined) + data["RestartApp"] = serialize.bool(params["restartApp"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceContextImpl = DeviceContextImpl; +class DeviceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.app = payload.app; + this.logging = payload.logging; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new DeviceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the deviceConfigs. + */ + deviceConfigs() { + return this._proxy.deviceConfigs; + } + /** + * Access the deviceSecrets. + */ + deviceSecrets() { + return this._proxy.deviceSecrets; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + app: this.app, + logging: this.logging, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceInstance = DeviceInstance; +function DeviceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DeviceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Devices`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DevicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DevicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeviceListInstance = DeviceListInstance; +class DevicePage extends Page_1.default { + /** + * Initialize the DevicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DeviceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DeviceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DevicePage = DevicePage; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/device/deviceConfig.d.ts b/node_modules/twilio/lib/rest/microvisor/v1/device/deviceConfig.d.ts new file mode 100644 index 00000000..785a6fbc --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/device/deviceConfig.d.ts @@ -0,0 +1,271 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a DeviceConfigInstance + */ +export interface DeviceConfigContextUpdateOptions { + /** The config value; up to 4096 characters. */ + value: string; +} +/** + * Options to pass to create a DeviceConfigInstance + */ +export interface DeviceConfigListInstanceCreateOptions { + /** The config key; up to 100 characters. */ + key: string; + /** The config value; up to 4096 characters. */ + value: string; +} +/** + * Options to pass to each + */ +export interface DeviceConfigListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DeviceConfigInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DeviceConfigListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DeviceConfigListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DeviceConfigContext { + /** + * Remove a DeviceConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DeviceConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceConfigInstance + */ + fetch(callback?: (error: Error | null, item?: DeviceConfigInstance) => any): Promise; + /** + * Update a DeviceConfigInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceConfigInstance + */ + update(params: DeviceConfigContextUpdateOptions, callback?: (error: Error | null, item?: DeviceConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeviceConfigContextSolution { + deviceSid: string; + key: string; +} +export declare class DeviceConfigContextImpl implements DeviceConfigContext { + protected _version: V1; + protected _solution: DeviceConfigContextSolution; + protected _uri: string; + constructor(_version: V1, deviceSid: string, key: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DeviceConfigInstance) => any): Promise; + update(params: DeviceConfigContextUpdateOptions, callback?: (error: Error | null, item?: DeviceConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeviceConfigContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DeviceConfigPayload extends TwilioResponsePayload { + configs: DeviceConfigResource[]; +} +interface DeviceConfigResource { + device_sid: string; + key: string; + value: string; + date_updated: Date; + url: string; +} +export declare class DeviceConfigInstance { + protected _version: V1; + protected _solution: DeviceConfigContextSolution; + protected _context?: DeviceConfigContext; + constructor(_version: V1, payload: DeviceConfigResource, deviceSid: string, key?: string); + /** + * A 34-character string that uniquely identifies the parent Device. + */ + deviceSid: string; + /** + * The config key; up to 100 characters. + */ + key: string; + /** + * The config value; up to 4096 characters. + */ + value: string; + dateUpdated: Date; + /** + * The absolute URL of the Config. + */ + url: string; + private get _proxy(); + /** + * Remove a DeviceConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DeviceConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceConfigInstance + */ + fetch(callback?: (error: Error | null, item?: DeviceConfigInstance) => any): Promise; + /** + * Update a DeviceConfigInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceConfigInstance + */ + update(params: DeviceConfigContextUpdateOptions, callback?: (error: Error | null, item?: DeviceConfigInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + deviceSid: string; + key: string; + value: string; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeviceConfigSolution { + deviceSid: string; +} +export interface DeviceConfigListInstance { + _version: V1; + _solution: DeviceConfigSolution; + _uri: string; + (key: string): DeviceConfigContext; + get(key: string): DeviceConfigContext; + /** + * Create a DeviceConfigInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceConfigInstance + */ + create(params: DeviceConfigListInstanceCreateOptions, callback?: (error: Error | null, item?: DeviceConfigInstance) => any): Promise; + /** + * Streams DeviceConfigInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceConfigListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DeviceConfigInstance, done: (err?: Error) => void) => void): void; + each(params: DeviceConfigListInstanceEachOptions, callback?: (item: DeviceConfigInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DeviceConfigInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DeviceConfigPage) => any): Promise; + /** + * Lists DeviceConfigInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceConfigListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DeviceConfigInstance[]) => any): Promise; + list(params: DeviceConfigListInstanceOptions, callback?: (error: Error | null, items: DeviceConfigInstance[]) => any): Promise; + /** + * Retrieve a single page of DeviceConfigInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceConfigListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DeviceConfigPage) => any): Promise; + page(params: DeviceConfigListInstancePageOptions, callback?: (error: Error | null, items: DeviceConfigPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeviceConfigListInstance(version: V1, deviceSid: string): DeviceConfigListInstance; +export declare class DeviceConfigPage extends Page { + /** + * Initialize the DeviceConfigPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DeviceConfigSolution); + /** + * Build an instance of DeviceConfigInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DeviceConfigResource): DeviceConfigInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/device/deviceConfig.js b/node_modules/twilio/lib/rest/microvisor/v1/device/deviceConfig.js new file mode 100644 index 00000000..02d40981 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/device/deviceConfig.js @@ -0,0 +1,254 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Microvisor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeviceConfigPage = exports.DeviceConfigListInstance = exports.DeviceConfigInstance = exports.DeviceConfigContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class DeviceConfigContextImpl { + constructor(_version, deviceSid, key) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(deviceSid)) { + throw new Error("Parameter 'deviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(key)) { + throw new Error("Parameter 'key' is not valid."); + } + this._solution = { deviceSid, key }; + this._uri = `/Devices/${deviceSid}/Configs/${key}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DeviceConfigInstance(operationVersion, payload, instance._solution.deviceSid, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceConfigInstance(operationVersion, payload, instance._solution.deviceSid, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceConfigContextImpl = DeviceConfigContextImpl; +class DeviceConfigInstance { + constructor(_version, payload, deviceSid, key) { + this._version = _version; + this.deviceSid = payload.device_sid; + this.key = payload.key; + this.value = payload.value; + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { deviceSid, key: key || this.key }; + } + get _proxy() { + this._context = + this._context || + new DeviceConfigContextImpl(this._version, this._solution.deviceSid, this._solution.key); + return this._context; + } + /** + * Remove a DeviceConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DeviceConfigInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceConfigInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + deviceSid: this.deviceSid, + key: this.key, + value: this.value, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceConfigInstance = DeviceConfigInstance; +function DeviceConfigListInstance(version, deviceSid) { + if (!(0, utility_1.isValidPathParam)(deviceSid)) { + throw new Error("Parameter 'deviceSid' is not valid."); + } + const instance = ((key) => instance.get(key)); + instance.get = function get(key) { + return new DeviceConfigContextImpl(version, deviceSid, key); + }; + instance._version = version; + instance._solution = { deviceSid }; + instance._uri = `/Devices/${deviceSid}/Configs`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["key"] === null || params["key"] === undefined) { + throw new Error("Required parameter \"params['key']\" missing."); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Key"] = params["key"]; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceConfigInstance(operationVersion, payload, instance._solution.deviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceConfigPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DeviceConfigPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeviceConfigListInstance = DeviceConfigListInstance; +class DeviceConfigPage extends Page_1.default { + /** + * Initialize the DeviceConfigPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DeviceConfigInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DeviceConfigInstance(this._version, payload, this._solution.deviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceConfigPage = DeviceConfigPage; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/device/deviceSecret.d.ts b/node_modules/twilio/lib/rest/microvisor/v1/device/deviceSecret.d.ts new file mode 100644 index 00000000..8c0542f1 --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/device/deviceSecret.d.ts @@ -0,0 +1,265 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a DeviceSecretInstance + */ +export interface DeviceSecretContextUpdateOptions { + /** The secret value; up to 4096 characters. */ + value: string; +} +/** + * Options to pass to create a DeviceSecretInstance + */ +export interface DeviceSecretListInstanceCreateOptions { + /** The secret key; up to 100 characters. */ + key: string; + /** The secret value; up to 4096 characters. */ + value: string; +} +/** + * Options to pass to each + */ +export interface DeviceSecretListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DeviceSecretInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DeviceSecretListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DeviceSecretListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DeviceSecretContext { + /** + * Remove a DeviceSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DeviceSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceSecretInstance + */ + fetch(callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise; + /** + * Update a DeviceSecretInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceSecretInstance + */ + update(params: DeviceSecretContextUpdateOptions, callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeviceSecretContextSolution { + deviceSid: string; + key: string; +} +export declare class DeviceSecretContextImpl implements DeviceSecretContext { + protected _version: V1; + protected _solution: DeviceSecretContextSolution; + protected _uri: string; + constructor(_version: V1, deviceSid: string, key: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise; + update(params: DeviceSecretContextUpdateOptions, callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeviceSecretContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DeviceSecretPayload extends TwilioResponsePayload { + secrets: DeviceSecretResource[]; +} +interface DeviceSecretResource { + device_sid: string; + key: string; + date_rotated: Date; + url: string; +} +export declare class DeviceSecretInstance { + protected _version: V1; + protected _solution: DeviceSecretContextSolution; + protected _context?: DeviceSecretContext; + constructor(_version: V1, payload: DeviceSecretResource, deviceSid: string, key?: string); + /** + * A 34-character string that uniquely identifies the parent Device. + */ + deviceSid: string; + /** + * The secret key; up to 100 characters. + */ + key: string; + dateRotated: Date; + /** + * The absolute URL of the Secret. + */ + url: string; + private get _proxy(); + /** + * Remove a DeviceSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DeviceSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceSecretInstance + */ + fetch(callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise; + /** + * Update a DeviceSecretInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceSecretInstance + */ + update(params: DeviceSecretContextUpdateOptions, callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + deviceSid: string; + key: string; + dateRotated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeviceSecretSolution { + deviceSid: string; +} +export interface DeviceSecretListInstance { + _version: V1; + _solution: DeviceSecretSolution; + _uri: string; + (key: string): DeviceSecretContext; + get(key: string): DeviceSecretContext; + /** + * Create a DeviceSecretInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceSecretInstance + */ + create(params: DeviceSecretListInstanceCreateOptions, callback?: (error: Error | null, item?: DeviceSecretInstance) => any): Promise; + /** + * Streams DeviceSecretInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceSecretListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DeviceSecretInstance, done: (err?: Error) => void) => void): void; + each(params: DeviceSecretListInstanceEachOptions, callback?: (item: DeviceSecretInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DeviceSecretInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DeviceSecretPage) => any): Promise; + /** + * Lists DeviceSecretInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceSecretListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DeviceSecretInstance[]) => any): Promise; + list(params: DeviceSecretListInstanceOptions, callback?: (error: Error | null, items: DeviceSecretInstance[]) => any): Promise; + /** + * Retrieve a single page of DeviceSecretInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceSecretListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DeviceSecretPage) => any): Promise; + page(params: DeviceSecretListInstancePageOptions, callback?: (error: Error | null, items: DeviceSecretPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeviceSecretListInstance(version: V1, deviceSid: string): DeviceSecretListInstance; +export declare class DeviceSecretPage extends Page { + /** + * Initialize the DeviceSecretPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DeviceSecretSolution); + /** + * Build an instance of DeviceSecretInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DeviceSecretResource): DeviceSecretInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/microvisor/v1/device/deviceSecret.js b/node_modules/twilio/lib/rest/microvisor/v1/device/deviceSecret.js new file mode 100644 index 00000000..1412636a --- /dev/null +++ b/node_modules/twilio/lib/rest/microvisor/v1/device/deviceSecret.js @@ -0,0 +1,252 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Microvisor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeviceSecretPage = exports.DeviceSecretListInstance = exports.DeviceSecretInstance = exports.DeviceSecretContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class DeviceSecretContextImpl { + constructor(_version, deviceSid, key) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(deviceSid)) { + throw new Error("Parameter 'deviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(key)) { + throw new Error("Parameter 'key' is not valid."); + } + this._solution = { deviceSid, key }; + this._uri = `/Devices/${deviceSid}/Secrets/${key}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DeviceSecretInstance(operationVersion, payload, instance._solution.deviceSid, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceSecretInstance(operationVersion, payload, instance._solution.deviceSid, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceSecretContextImpl = DeviceSecretContextImpl; +class DeviceSecretInstance { + constructor(_version, payload, deviceSid, key) { + this._version = _version; + this.deviceSid = payload.device_sid; + this.key = payload.key; + this.dateRotated = deserialize.iso8601DateTime(payload.date_rotated); + this.url = payload.url; + this._solution = { deviceSid, key: key || this.key }; + } + get _proxy() { + this._context = + this._context || + new DeviceSecretContextImpl(this._version, this._solution.deviceSid, this._solution.key); + return this._context; + } + /** + * Remove a DeviceSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DeviceSecretInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceSecretInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + deviceSid: this.deviceSid, + key: this.key, + dateRotated: this.dateRotated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceSecretInstance = DeviceSecretInstance; +function DeviceSecretListInstance(version, deviceSid) { + if (!(0, utility_1.isValidPathParam)(deviceSid)) { + throw new Error("Parameter 'deviceSid' is not valid."); + } + const instance = ((key) => instance.get(key)); + instance.get = function get(key) { + return new DeviceSecretContextImpl(version, deviceSid, key); + }; + instance._version = version; + instance._solution = { deviceSid }; + instance._uri = `/Devices/${deviceSid}/Secrets`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["key"] === null || params["key"] === undefined) { + throw new Error("Required parameter \"params['key']\" missing."); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Key"] = params["key"]; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceSecretInstance(operationVersion, payload, instance._solution.deviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceSecretPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DeviceSecretPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeviceSecretListInstance = DeviceSecretListInstance; +class DeviceSecretPage extends Page_1.default { + /** + * Initialize the DeviceSecretPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DeviceSecretInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DeviceSecretInstance(this._version, payload, this._solution.deviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceSecretPage = DeviceSecretPage; diff --git a/node_modules/twilio/lib/rest/monitor/V1.d.ts b/node_modules/twilio/lib/rest/monitor/V1.d.ts new file mode 100644 index 00000000..ef3a09d0 --- /dev/null +++ b/node_modules/twilio/lib/rest/monitor/V1.d.ts @@ -0,0 +1,20 @@ +import MonitorBase from "../MonitorBase"; +import Version from "../../base/Version"; +import { AlertListInstance } from "./v1/alert"; +import { EventListInstance } from "./v1/event"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Monitor + * + * @param domain - The Twilio (Twilio.Monitor) domain + */ + constructor(domain: MonitorBase); + /** alerts - { Twilio.Monitor.V1.AlertListInstance } resource */ + protected _alerts?: AlertListInstance; + /** events - { Twilio.Monitor.V1.EventListInstance } resource */ + protected _events?: EventListInstance; + /** Getter for alerts resource */ + get alerts(): AlertListInstance; + /** Getter for events resource */ + get events(): EventListInstance; +} diff --git a/node_modules/twilio/lib/rest/monitor/V1.js b/node_modules/twilio/lib/rest/monitor/V1.js new file mode 100644 index 00000000..016bea05 --- /dev/null +++ b/node_modules/twilio/lib/rest/monitor/V1.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Monitor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const alert_1 = require("./v1/alert"); +const event_1 = require("./v1/event"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Monitor + * + * @param domain - The Twilio (Twilio.Monitor) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for alerts resource */ + get alerts() { + this._alerts = this._alerts || (0, alert_1.AlertListInstance)(this); + return this._alerts; + } + /** Getter for events resource */ + get events() { + this._events = this._events || (0, event_1.EventListInstance)(this); + return this._events; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/monitor/v1/alert.d.ts b/node_modules/twilio/lib/rest/monitor/v1/alert.d.ts new file mode 100644 index 00000000..6afa3d68 --- /dev/null +++ b/node_modules/twilio/lib/rest/monitor/v1/alert.d.ts @@ -0,0 +1,313 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface AlertListInstanceEachOptions { + /** Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. */ + logLevel?: string; + /** Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. */ + startDate?: Date; + /** Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AlertInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AlertListInstanceOptions { + /** Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. */ + logLevel?: string; + /** Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. */ + startDate?: Date; + /** Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AlertListInstancePageOptions { + /** Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. */ + logLevel?: string; + /** Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. */ + startDate?: Date; + /** Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AlertContext { + /** + * Fetch a AlertInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AlertInstance + */ + fetch(callback?: (error: Error | null, item?: AlertInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AlertContextSolution { + sid: string; +} +export declare class AlertContextImpl implements AlertContext { + protected _version: V1; + protected _solution: AlertContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: AlertInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AlertContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AlertPayload extends TwilioResponsePayload { + alerts: AlertResource[]; +} +interface AlertResource { + account_sid: string; + alert_text: string; + api_version: string; + date_created: Date; + date_generated: Date; + date_updated: Date; + error_code: string; + log_level: string; + more_info: string; + request_method: string; + request_url: string; + request_variables: string; + resource_sid: string; + response_body: string; + response_headers: string; + sid: string; + url: string; + request_headers: string; + service_sid: string; +} +export declare class AlertInstance { + protected _version: V1; + protected _solution: AlertContextSolution; + protected _context?: AlertContext; + constructor(_version: V1, payload: AlertResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Alert resource. + */ + accountSid: string; + /** + * The text of the alert. + */ + alertText: string; + /** + * The API version used when the alert was generated. Can be empty for events that don\'t have a specific API version. + */ + apiVersion: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the alert was generated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. Due to buffering, this can be different than `date_created`. + */ + dateGenerated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The error code for the condition that generated the alert. See the [Error Dictionary](https://www.twilio.com/docs/api/errors) for possible causes and solutions to the error. + */ + errorCode: string; + /** + * The log level. Can be: `error`, `warning`, `notice`, or `debug`. + */ + logLevel: string; + /** + * The URL of the page in our [Error Dictionary](https://www.twilio.com/docs/api/errors) with more information about the error condition. + */ + moreInfo: string; + /** + * The method used by the request that generated the alert. If the alert was generated by a request we made to your server, this is the method we used. If the alert was generated by a request from your application to our API, this is the method your application used. + */ + requestMethod: string; + /** + * The URL of the request that generated the alert. If the alert was generated by a request we made to your server, this is the URL on your server that generated the alert. If the alert was generated by a request from your application to our API, this is the URL of the resource requested. + */ + requestUrl: string; + /** + * The variables passed in the request that generated the alert. This value is only returned when a single Alert resource is fetched. + */ + requestVariables: string; + /** + * The SID of the resource for which the alert was generated. For instance, if your server failed to respond to an HTTP request during the flow of a particular call, this value would be the SID of the server. This value is empty if the alert was not generated for a particular resource. + */ + resourceSid: string; + /** + * The response body of the request that generated the alert. This value is only returned when a single Alert resource is fetched. + */ + responseBody: string; + /** + * The response headers of the request that generated the alert. This value is only returned when a single Alert resource is fetched. + */ + responseHeaders: string; + /** + * The unique string that we created to identify the Alert resource. + */ + sid: string; + /** + * The absolute URL of the Alert resource. + */ + url: string; + /** + * The request headers of the request that generated the alert. This value is only returned when a single Alert resource is fetched. + */ + requestHeaders: string; + /** + * The SID of the service or resource that generated the alert. Can be `null`. + */ + serviceSid: string; + private get _proxy(); + /** + * Fetch a AlertInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AlertInstance + */ + fetch(callback?: (error: Error | null, item?: AlertInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + alertText: string; + apiVersion: string; + dateCreated: Date; + dateGenerated: Date; + dateUpdated: Date; + errorCode: string; + logLevel: string; + moreInfo: string; + requestMethod: string; + requestUrl: string; + requestVariables: string; + resourceSid: string; + responseBody: string; + responseHeaders: string; + sid: string; + url: string; + requestHeaders: string; + serviceSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AlertSolution { +} +export interface AlertListInstance { + _version: V1; + _solution: AlertSolution; + _uri: string; + (sid: string): AlertContext; + get(sid: string): AlertContext; + /** + * Streams AlertInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AlertListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AlertInstance, done: (err?: Error) => void) => void): void; + each(params: AlertListInstanceEachOptions, callback?: (item: AlertInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AlertInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AlertPage) => any): Promise; + /** + * Lists AlertInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AlertListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AlertInstance[]) => any): Promise; + list(params: AlertListInstanceOptions, callback?: (error: Error | null, items: AlertInstance[]) => any): Promise; + /** + * Retrieve a single page of AlertInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AlertListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AlertPage) => any): Promise; + page(params: AlertListInstancePageOptions, callback?: (error: Error | null, items: AlertPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AlertListInstance(version: V1): AlertListInstance; +export declare class AlertPage extends Page { + /** + * Initialize the AlertPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AlertSolution); + /** + * Build an instance of AlertInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AlertResource): AlertInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/monitor/v1/alert.js b/node_modules/twilio/lib/rest/monitor/v1/alert.js new file mode 100644 index 00000000..e77c4d46 --- /dev/null +++ b/node_modules/twilio/lib/rest/monitor/v1/alert.js @@ -0,0 +1,212 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Monitor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AlertPage = exports.AlertListInstance = exports.AlertInstance = exports.AlertContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class AlertContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Alerts/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AlertInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AlertContextImpl = AlertContextImpl; +class AlertInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.alertText = payload.alert_text; + this.apiVersion = payload.api_version; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateGenerated = deserialize.iso8601DateTime(payload.date_generated); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.errorCode = payload.error_code; + this.logLevel = payload.log_level; + this.moreInfo = payload.more_info; + this.requestMethod = payload.request_method; + this.requestUrl = payload.request_url; + this.requestVariables = payload.request_variables; + this.resourceSid = payload.resource_sid; + this.responseBody = payload.response_body; + this.responseHeaders = payload.response_headers; + this.sid = payload.sid; + this.url = payload.url; + this.requestHeaders = payload.request_headers; + this.serviceSid = payload.service_sid; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new AlertContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a AlertInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AlertInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + alertText: this.alertText, + apiVersion: this.apiVersion, + dateCreated: this.dateCreated, + dateGenerated: this.dateGenerated, + dateUpdated: this.dateUpdated, + errorCode: this.errorCode, + logLevel: this.logLevel, + moreInfo: this.moreInfo, + requestMethod: this.requestMethod, + requestUrl: this.requestUrl, + requestVariables: this.requestVariables, + resourceSid: this.resourceSid, + responseBody: this.responseBody, + responseHeaders: this.responseHeaders, + sid: this.sid, + url: this.url, + requestHeaders: this.requestHeaders, + serviceSid: this.serviceSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AlertInstance = AlertInstance; +function AlertListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AlertContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Alerts`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["logLevel"] !== undefined) + data["LogLevel"] = params["logLevel"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AlertPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AlertPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AlertListInstance = AlertListInstance; +class AlertPage extends Page_1.default { + /** + * Initialize the AlertPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AlertInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AlertInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AlertPage = AlertPage; diff --git a/node_modules/twilio/lib/rest/monitor/v1/event.d.ts b/node_modules/twilio/lib/rest/monitor/v1/event.d.ts new file mode 100644 index 00000000..6c116cc3 --- /dev/null +++ b/node_modules/twilio/lib/rest/monitor/v1/event.d.ts @@ -0,0 +1,301 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface EventListInstanceEachOptions { + /** Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. */ + actorSid?: string; + /** Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). */ + eventType?: string; + /** Only include events that refer to this resource. Useful for discovering the history of a specific resource. */ + resourceSid?: string; + /** Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. */ + sourceIpAddress?: string; + /** Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EventInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EventListInstanceOptions { + /** Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. */ + actorSid?: string; + /** Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). */ + eventType?: string; + /** Only include events that refer to this resource. Useful for discovering the history of a specific resource. */ + resourceSid?: string; + /** Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. */ + sourceIpAddress?: string; + /** Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EventListInstancePageOptions { + /** Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. */ + actorSid?: string; + /** Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). */ + eventType?: string; + /** Only include events that refer to this resource. Useful for discovering the history of a specific resource. */ + resourceSid?: string; + /** Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. */ + sourceIpAddress?: string; + /** Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EventContext { + /** + * Fetch a EventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventInstance + */ + fetch(callback?: (error: Error | null, item?: EventInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EventContextSolution { + sid: string; +} +export declare class EventContextImpl implements EventContext { + protected _version: V1; + protected _solution: EventContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: EventInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EventContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EventPayload extends TwilioResponsePayload { + events: EventResource[]; +} +interface EventResource { + account_sid: string; + actor_sid: string; + actor_type: string; + description: string; + event_data: any; + event_date: Date; + event_type: string; + resource_sid: string; + resource_type: string; + sid: string; + source: string; + source_ip_address: string; + url: string; + links: Record; +} +export declare class EventInstance { + protected _version: V1; + protected _solution: EventContextSolution; + protected _context?: EventContext; + constructor(_version: V1, payload: EventResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource. + */ + accountSid: string; + /** + * The SID of the actor that caused the event, if available. Can be `null`. + */ + actorSid: string; + /** + * The type of actor that caused the event. Can be: `user` for a change made by a logged-in user in the Twilio Console, `account` for an event caused by an API request by an authenticating Account, `twilio-admin` for an event caused by a Twilio employee, and so on. + */ + actorType: string; + /** + * A description of the event. Can be `null`. + */ + description: string; + /** + * An object with additional data about the event. The contents depend on `event_type`. For example, event-types of the form `RESOURCE.updated`, this value contains a `resource_properties` dictionary that describes the previous and updated properties of the resource. + */ + eventData: any; + /** + * The date and time in GMT when the event was recorded specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + eventDate: Date; + /** + * The event\'s type. Event-types are typically in the form: `RESOURCE_TYPE.ACTION`, where `RESOURCE_TYPE` is the type of resource that was affected and `ACTION` is what happened to it. For example, `phone-number.created`. For a full list of all event-types, see the [Monitor Event Types](https://www.twilio.com/docs/usage/monitor-events#event-types). + */ + eventType: string; + /** + * The SID of the resource that was affected. + */ + resourceSid: string; + /** + * The type of resource that was affected. For a full list of all resource-types, see the [Monitor Event Types](https://www.twilio.com/docs/usage/monitor-events#event-types). + */ + resourceType: string; + /** + * The unique string that we created to identify the Event resource. + */ + sid: string; + /** + * The originating system or interface that caused the event. Can be: `web` for events caused by user action in the Twilio Console, `api` for events caused by a request to our API, or `twilio` for events caused by an automated or internal Twilio system. + */ + source: string; + /** + * The IP address of the source, if the source is outside the Twilio cloud. This value is `null` for events with `source` of `twilio` + */ + sourceIpAddress: string; + /** + * The absolute URL of the resource that was affected. Can be `null`. + */ + url: string; + /** + * The absolute URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a EventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventInstance + */ + fetch(callback?: (error: Error | null, item?: EventInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + actorSid: string; + actorType: string; + description: string; + eventData: any; + eventDate: Date; + eventType: string; + resourceSid: string; + resourceType: string; + sid: string; + source: string; + sourceIpAddress: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EventSolution { +} +export interface EventListInstance { + _version: V1; + _solution: EventSolution; + _uri: string; + (sid: string): EventContext; + get(sid: string): EventContext; + /** + * Streams EventInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EventInstance, done: (err?: Error) => void) => void): void; + each(params: EventListInstanceEachOptions, callback?: (item: EventInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EventInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EventPage) => any): Promise; + /** + * Lists EventInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EventInstance[]) => any): Promise; + list(params: EventListInstanceOptions, callback?: (error: Error | null, items: EventInstance[]) => any): Promise; + /** + * Retrieve a single page of EventInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EventPage) => any): Promise; + page(params: EventListInstancePageOptions, callback?: (error: Error | null, items: EventPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EventListInstance(version: V1): EventListInstance; +export declare class EventPage extends Page { + /** + * Initialize the EventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EventSolution); + /** + * Build an instance of EventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EventResource): EventInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/monitor/v1/event.js b/node_modules/twilio/lib/rest/monitor/v1/event.js new file mode 100644 index 00000000..1bf4f5a1 --- /dev/null +++ b/node_modules/twilio/lib/rest/monitor/v1/event.js @@ -0,0 +1,208 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Monitor + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EventPage = exports.EventListInstance = exports.EventInstance = exports.EventContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class EventContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Events/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EventInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventContextImpl = EventContextImpl; +class EventInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.actorSid = payload.actor_sid; + this.actorType = payload.actor_type; + this.description = payload.description; + this.eventData = payload.event_data; + this.eventDate = deserialize.iso8601DateTime(payload.event_date); + this.eventType = payload.event_type; + this.resourceSid = payload.resource_sid; + this.resourceType = payload.resource_type; + this.sid = payload.sid; + this.source = payload.source; + this.sourceIpAddress = payload.source_ip_address; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new EventContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a EventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + actorSid: this.actorSid, + actorType: this.actorType, + description: this.description, + eventData: this.eventData, + eventDate: this.eventDate, + eventType: this.eventType, + resourceSid: this.resourceSid, + resourceType: this.resourceType, + sid: this.sid, + source: this.source, + sourceIpAddress: this.sourceIpAddress, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventInstance = EventInstance; +function EventListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EventContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Events`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["actorSid"] !== undefined) + data["ActorSid"] = params["actorSid"]; + if (params["eventType"] !== undefined) + data["EventType"] = params["eventType"]; + if (params["resourceSid"] !== undefined) + data["ResourceSid"] = params["resourceSid"]; + if (params["sourceIpAddress"] !== undefined) + data["SourceIpAddress"] = params["sourceIpAddress"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EventPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EventPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EventListInstance = EventListInstance; +class EventPage extends Page_1.default { + /** + * Initialize the EventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EventInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventPage = EventPage; diff --git a/node_modules/twilio/lib/rest/notify/V1.d.ts b/node_modules/twilio/lib/rest/notify/V1.d.ts new file mode 100644 index 00000000..ccfe21e2 --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/V1.d.ts @@ -0,0 +1,20 @@ +import NotifyBase from "../NotifyBase"; +import Version from "../../base/Version"; +import { CredentialListInstance } from "./v1/credential"; +import { ServiceListInstance } from "./v1/service"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Notify + * + * @param domain - The Twilio (Twilio.Notify) domain + */ + constructor(domain: NotifyBase); + /** credentials - { Twilio.Notify.V1.CredentialListInstance } resource */ + protected _credentials?: CredentialListInstance; + /** services - { Twilio.Notify.V1.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for credentials resource */ + get credentials(): CredentialListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/notify/V1.js b/node_modules/twilio/lib/rest/notify/V1.js new file mode 100644 index 00000000..a1a3f53c --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/V1.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Notify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const credential_1 = require("./v1/credential"); +const service_1 = require("./v1/service"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Notify + * + * @param domain - The Twilio (Twilio.Notify) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for credentials resource */ + get credentials() { + this._credentials = this._credentials || (0, credential_1.CredentialListInstance)(this); + return this._credentials; + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/notify/v1/credential.d.ts b/node_modules/twilio/lib/rest/notify/v1/credential.d.ts new file mode 100644 index 00000000..6da74c16 --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/v1/credential.d.ts @@ -0,0 +1,324 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type CredentialPushService = "gcm" | "apn" | "fcm"; +/** + * Options to pass to update a CredentialInstance + */ +export interface CredentialContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` */ + certificate?: string; + /** [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` */ + privateKey?: string; + /** [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. */ + sandbox?: boolean; + /** [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. */ + apiKey?: string; + /** [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. */ + secret?: string; +} +/** + * Options to pass to create a CredentialInstance + */ +export interface CredentialListInstanceCreateOptions { + /** */ + type: CredentialPushService; + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` */ + certificate?: string; + /** [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` */ + privateKey?: string; + /** [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. */ + sandbox?: boolean; + /** [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. */ + apiKey?: string; + /** [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. */ + secret?: string; +} +/** + * Options to pass to each + */ +export interface CredentialListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialContext { + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialContextSolution { + sid: string; +} +export declare class CredentialContextImpl implements CredentialContext { + protected _version: V1; + protected _solution: CredentialContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + update(params?: CredentialContextUpdateOptions | ((error: Error | null, item?: CredentialInstance) => any), callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialPayload extends TwilioResponsePayload { + credentials: CredentialResource[]; +} +interface CredentialResource { + sid: string; + account_sid: string; + friendly_name: string; + type: CredentialPushService; + sandbox: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CredentialInstance { + protected _version: V1; + protected _solution: CredentialContextSolution; + protected _context?: CredentialContext; + constructor(_version: V1, payload: CredentialResource, sid?: string); + /** + * The unique string that we created to identify the Credential resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Credential resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + type: CredentialPushService; + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + */ + sandbox: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Credential resource. + */ + url: string; + private get _proxy(); + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Update a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + update(params: CredentialContextUpdateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + type: CredentialPushService; + sandbox: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialSolution { +} +export interface CredentialListInstance { + _version: V1; + _solution: CredentialSolution; + _uri: string; + (sid: string): CredentialContext; + get(sid: string): CredentialContext; + /** + * Create a CredentialInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + create(params: CredentialListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialInstance) => any): Promise; + /** + * Streams CredentialInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListInstanceEachOptions, callback?: (item: CredentialInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Lists CredentialInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + list(params: CredentialListInstanceOptions, callback?: (error: Error | null, items: CredentialInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialPage) => any): Promise; + page(params: CredentialListInstancePageOptions, callback?: (error: Error | null, items: CredentialPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListInstance(version: V1): CredentialListInstance; +export declare class CredentialPage extends Page { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CredentialSolution); + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialResource): CredentialInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/notify/v1/credential.js b/node_modules/twilio/lib/rest/notify/v1/credential.js new file mode 100644 index 00000000..53af5a2e --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/v1/credential.js @@ -0,0 +1,274 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Notify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialPage = exports.CredentialListInstance = exports.CredentialInstance = exports.CredentialContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CredentialContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Credentials/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialContextImpl = CredentialContextImpl; +class CredentialInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.sandbox = payload.sandbox; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + type: this.type, + sandbox: this.sandbox, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialInstance = CredentialInstance; +function CredentialListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Credentials`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["Type"] = params["type"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["certificate"] !== undefined) + data["Certificate"] = params["certificate"]; + if (params["privateKey"] !== undefined) + data["PrivateKey"] = params["privateKey"]; + if (params["sandbox"] !== undefined) + data["Sandbox"] = serialize.bool(params["sandbox"]); + if (params["apiKey"] !== undefined) + data["ApiKey"] = params["apiKey"]; + if (params["secret"] !== undefined) + data["Secret"] = params["secret"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListInstance = CredentialListInstance; +class CredentialPage extends Page_1.default { + /** + * Initialize the CredentialPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialPage = CredentialPage; diff --git a/node_modules/twilio/lib/rest/notify/v1/service.d.ts b/node_modules/twilio/lib/rest/notify/v1/service.d.ts new file mode 100644 index 00000000..b5a492b2 --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/v1/service.d.ts @@ -0,0 +1,458 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { BindingListInstance } from "./service/binding"; +import { NotificationListInstance } from "./service/notification"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. */ + apnCredentialSid?: string; + /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. */ + gcmCredentialSid?: string; + /** The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. */ + messagingServiceSid?: string; + /** Deprecated. */ + facebookMessengerPageId?: string; + /** The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. */ + defaultApnNotificationProtocolVersion?: string; + /** The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. */ + defaultGcmNotificationProtocolVersion?: string; + /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. */ + fcmCredentialSid?: string; + /** The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. */ + defaultFcmNotificationProtocolVersion?: string; + /** Whether to log notifications. Can be: `true` or `false` and the default is `true`. */ + logEnabled?: boolean; + /** Deprecated. */ + alexaSkillId?: string; + /** Deprecated. */ + defaultAlexaNotificationProtocolVersion?: string; + /** URL to send delivery status callback. */ + deliveryCallbackUrl?: string; + /** Callback configuration that enables delivery callbacks, default false */ + deliveryCallbackEnabled?: boolean; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. */ + apnCredentialSid?: string; + /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. */ + gcmCredentialSid?: string; + /** The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. */ + messagingServiceSid?: string; + /** Deprecated. */ + facebookMessengerPageId?: string; + /** The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. */ + defaultApnNotificationProtocolVersion?: string; + /** The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. */ + defaultGcmNotificationProtocolVersion?: string; + /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. */ + fcmCredentialSid?: string; + /** The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. */ + defaultFcmNotificationProtocolVersion?: string; + /** Whether to log notifications. Can be: `true` or `false` and the default is `true`. */ + logEnabled?: boolean; + /** Deprecated. */ + alexaSkillId?: string; + /** Deprecated. */ + defaultAlexaNotificationProtocolVersion?: string; + /** URL to send delivery status callback. */ + deliveryCallbackUrl?: string; + /** Callback configuration that enables delivery callbacks, default false */ + deliveryCallbackEnabled?: boolean; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** The string that identifies the Service resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** The string that identifies the Service resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** The string that identifies the Service resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + bindings: BindingListInstance; + notifications: NotificationListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _bindings?: BindingListInstance; + protected _notifications?: NotificationListInstance; + constructor(_version: V1, sid: string); + get bindings(): BindingListInstance; + get notifications(): NotificationListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + apn_credential_sid: string; + gcm_credential_sid: string; + fcm_credential_sid: string; + messaging_service_sid: string; + facebook_messenger_page_id: string; + default_apn_notification_protocol_version: string; + default_gcm_notification_protocol_version: string; + default_fcm_notification_protocol_version: string; + log_enabled: boolean; + url: string; + links: Record; + alexa_skill_id: string; + default_alexa_notification_protocol_version: string; + delivery_callback_url: string; + delivery_callback_enabled: boolean; +} +export declare class ServiceInstance { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V1, payload: ServiceResource, sid?: string); + /** + * The unique string that we created to identify the Service resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + */ + apnCredentialSid: string; + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + */ + gcmCredentialSid: string; + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + */ + fcmCredentialSid: string; + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. + */ + messagingServiceSid: string; + /** + * Deprecated. + */ + facebookMessengerPageId: string; + /** + * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + */ + defaultApnNotificationProtocolVersion: string; + /** + * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + */ + defaultGcmNotificationProtocolVersion: string; + /** + * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + */ + defaultFcmNotificationProtocolVersion: string; + /** + * Whether to log notifications. Can be: `true` or `false` and the default is `true`. + */ + logEnabled: boolean; + /** + * The absolute URL of the Service resource. + */ + url: string; + /** + * The URLs of the Binding, Notification, Segment, and User resources related to the service. + */ + links: Record; + /** + * Deprecated. + */ + alexaSkillId: string; + /** + * Deprecated. + */ + defaultAlexaNotificationProtocolVersion: string; + /** + * URL to send delivery status callback. + */ + deliveryCallbackUrl: string; + /** + * Callback configuration that enables delivery callbacks, default false + */ + deliveryCallbackEnabled: boolean; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the bindings. + */ + bindings(): BindingListInstance; + /** + * Access the notifications. + */ + notifications(): NotificationListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + apnCredentialSid: string; + gcmCredentialSid: string; + fcmCredentialSid: string; + messagingServiceSid: string; + facebookMessengerPageId: string; + defaultApnNotificationProtocolVersion: string; + defaultGcmNotificationProtocolVersion: string; + defaultFcmNotificationProtocolVersion: string; + logEnabled: boolean; + url: string; + links: Record; + alexaSkillId: string; + defaultAlexaNotificationProtocolVersion: string; + deliveryCallbackUrl: string; + deliveryCallbackEnabled: boolean; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V1; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V1): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/notify/v1/service.js b/node_modules/twilio/lib/rest/notify/v1/service.js new file mode 100644 index 00000000..5a82675f --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/v1/service.js @@ -0,0 +1,369 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Notify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const binding_1 = require("./service/binding"); +const notification_1 = require("./service/notification"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get bindings() { + this._bindings = + this._bindings || (0, binding_1.BindingListInstance)(this._version, this._solution.sid); + return this._bindings; + } + get notifications() { + this._notifications = + this._notifications || + (0, notification_1.NotificationListInstance)(this._version, this._solution.sid); + return this._notifications; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["apnCredentialSid"] !== undefined) + data["ApnCredentialSid"] = params["apnCredentialSid"]; + if (params["gcmCredentialSid"] !== undefined) + data["GcmCredentialSid"] = params["gcmCredentialSid"]; + if (params["messagingServiceSid"] !== undefined) + data["MessagingServiceSid"] = params["messagingServiceSid"]; + if (params["facebookMessengerPageId"] !== undefined) + data["FacebookMessengerPageId"] = params["facebookMessengerPageId"]; + if (params["defaultApnNotificationProtocolVersion"] !== undefined) + data["DefaultApnNotificationProtocolVersion"] = + params["defaultApnNotificationProtocolVersion"]; + if (params["defaultGcmNotificationProtocolVersion"] !== undefined) + data["DefaultGcmNotificationProtocolVersion"] = + params["defaultGcmNotificationProtocolVersion"]; + if (params["fcmCredentialSid"] !== undefined) + data["FcmCredentialSid"] = params["fcmCredentialSid"]; + if (params["defaultFcmNotificationProtocolVersion"] !== undefined) + data["DefaultFcmNotificationProtocolVersion"] = + params["defaultFcmNotificationProtocolVersion"]; + if (params["logEnabled"] !== undefined) + data["LogEnabled"] = serialize.bool(params["logEnabled"]); + if (params["alexaSkillId"] !== undefined) + data["AlexaSkillId"] = params["alexaSkillId"]; + if (params["defaultAlexaNotificationProtocolVersion"] !== undefined) + data["DefaultAlexaNotificationProtocolVersion"] = + params["defaultAlexaNotificationProtocolVersion"]; + if (params["deliveryCallbackUrl"] !== undefined) + data["DeliveryCallbackUrl"] = params["deliveryCallbackUrl"]; + if (params["deliveryCallbackEnabled"] !== undefined) + data["DeliveryCallbackEnabled"] = serialize.bool(params["deliveryCallbackEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.apnCredentialSid = payload.apn_credential_sid; + this.gcmCredentialSid = payload.gcm_credential_sid; + this.fcmCredentialSid = payload.fcm_credential_sid; + this.messagingServiceSid = payload.messaging_service_sid; + this.facebookMessengerPageId = payload.facebook_messenger_page_id; + this.defaultApnNotificationProtocolVersion = + payload.default_apn_notification_protocol_version; + this.defaultGcmNotificationProtocolVersion = + payload.default_gcm_notification_protocol_version; + this.defaultFcmNotificationProtocolVersion = + payload.default_fcm_notification_protocol_version; + this.logEnabled = payload.log_enabled; + this.url = payload.url; + this.links = payload.links; + this.alexaSkillId = payload.alexa_skill_id; + this.defaultAlexaNotificationProtocolVersion = + payload.default_alexa_notification_protocol_version; + this.deliveryCallbackUrl = payload.delivery_callback_url; + this.deliveryCallbackEnabled = payload.delivery_callback_enabled; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the bindings. + */ + bindings() { + return this._proxy.bindings; + } + /** + * Access the notifications. + */ + notifications() { + return this._proxy.notifications; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + apnCredentialSid: this.apnCredentialSid, + gcmCredentialSid: this.gcmCredentialSid, + fcmCredentialSid: this.fcmCredentialSid, + messagingServiceSid: this.messagingServiceSid, + facebookMessengerPageId: this.facebookMessengerPageId, + defaultApnNotificationProtocolVersion: this.defaultApnNotificationProtocolVersion, + defaultGcmNotificationProtocolVersion: this.defaultGcmNotificationProtocolVersion, + defaultFcmNotificationProtocolVersion: this.defaultFcmNotificationProtocolVersion, + logEnabled: this.logEnabled, + url: this.url, + links: this.links, + alexaSkillId: this.alexaSkillId, + defaultAlexaNotificationProtocolVersion: this.defaultAlexaNotificationProtocolVersion, + deliveryCallbackUrl: this.deliveryCallbackUrl, + deliveryCallbackEnabled: this.deliveryCallbackEnabled, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["apnCredentialSid"] !== undefined) + data["ApnCredentialSid"] = params["apnCredentialSid"]; + if (params["gcmCredentialSid"] !== undefined) + data["GcmCredentialSid"] = params["gcmCredentialSid"]; + if (params["messagingServiceSid"] !== undefined) + data["MessagingServiceSid"] = params["messagingServiceSid"]; + if (params["facebookMessengerPageId"] !== undefined) + data["FacebookMessengerPageId"] = params["facebookMessengerPageId"]; + if (params["defaultApnNotificationProtocolVersion"] !== undefined) + data["DefaultApnNotificationProtocolVersion"] = + params["defaultApnNotificationProtocolVersion"]; + if (params["defaultGcmNotificationProtocolVersion"] !== undefined) + data["DefaultGcmNotificationProtocolVersion"] = + params["defaultGcmNotificationProtocolVersion"]; + if (params["fcmCredentialSid"] !== undefined) + data["FcmCredentialSid"] = params["fcmCredentialSid"]; + if (params["defaultFcmNotificationProtocolVersion"] !== undefined) + data["DefaultFcmNotificationProtocolVersion"] = + params["defaultFcmNotificationProtocolVersion"]; + if (params["logEnabled"] !== undefined) + data["LogEnabled"] = serialize.bool(params["logEnabled"]); + if (params["alexaSkillId"] !== undefined) + data["AlexaSkillId"] = params["alexaSkillId"]; + if (params["defaultAlexaNotificationProtocolVersion"] !== undefined) + data["DefaultAlexaNotificationProtocolVersion"] = + params["defaultAlexaNotificationProtocolVersion"]; + if (params["deliveryCallbackUrl"] !== undefined) + data["DeliveryCallbackUrl"] = params["deliveryCallbackUrl"]; + if (params["deliveryCallbackEnabled"] !== undefined) + data["DeliveryCallbackEnabled"] = serialize.bool(params["deliveryCallbackEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/notify/v1/service/binding.d.ts b/node_modules/twilio/lib/rest/notify/v1/service/binding.d.ts new file mode 100644 index 00000000..0feb8d04 --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/v1/service/binding.d.ts @@ -0,0 +1,337 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type BindingBindingType = "apn" | "gcm" | "sms" | "fcm" | "facebook-messenger" | "alexa"; +/** + * Options to pass to create a BindingInstance + */ +export interface BindingListInstanceCreateOptions { + /** The `identity` value that uniquely identifies the new resource\\\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Up to 20 Bindings can be created for the same Identity in a given Service. */ + identity: string; + /** */ + bindingType: BindingBindingType; + /** The channel-specific address. For APNS, the device token. For FCM and GCM, the registration token. For SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger ID of the user or a phone number in E.164 format. */ + address: string; + /** A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. */ + tag?: Array; + /** The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` for the protocol in the [Service](https://www.twilio.com/docs/notify/api/service-resource). The current version is `\\\"3\\\"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. */ + notificationProtocolVersion?: string; + /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only `apn`, `fcm`, and `gcm` type Bindings. */ + credentialSid?: string; + /** Deprecated. */ + endpoint?: string; +} +/** + * Options to pass to each + */ +export interface BindingListInstanceEachOptions { + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. */ + endDate?: Date; + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. */ + identity?: Array; + /** Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. */ + tag?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BindingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BindingListInstanceOptions { + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. */ + endDate?: Date; + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. */ + identity?: Array; + /** Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. */ + tag?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BindingListInstancePageOptions { + /** Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. */ + startDate?: Date; + /** Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. */ + endDate?: Date; + /** The [User](https://www.twilio.com/docs/chat/rest/user-resource)\'s `identity` value of the resources to read. */ + identity?: Array; + /** Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. */ + tag?: Array; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BindingContext { + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BindingContextSolution { + serviceSid: string; + sid: string; +} +export declare class BindingContextImpl implements BindingContext { + protected _version: V1; + protected _solution: BindingContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BindingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BindingPayload extends TwilioResponsePayload { + bindings: BindingResource[]; +} +interface BindingResource { + sid: string; + account_sid: string; + service_sid: string; + credential_sid: string; + date_created: Date; + date_updated: Date; + notification_protocol_version: string; + endpoint: string; + identity: string; + binding_type: string; + address: string; + tags: Array; + url: string; + links: Record; +} +export declare class BindingInstance { + protected _version: V1; + protected _solution: BindingContextSolution; + protected _context?: BindingContext; + constructor(_version: V1, payload: BindingResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Binding resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Binding resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/notify/api/service-resource) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applicable only to `apn`, `fcm`, and `gcm` type Bindings. + */ + credentialSid: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` in the [Service](https://www.twilio.com/docs/notify/api/service-resource) for the protocol. The current version is `\"3\"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. + */ + notificationProtocolVersion: string; + /** + * Deprecated. + */ + endpoint: string; + /** + * The `identity` value that uniquely identifies the resource\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Up to 20 Bindings can be created for the same Identity in a given Service. + */ + identity: string; + /** + * The transport technology to use for the Binding. Can be: `apn`, `fcm`, `gcm`, `sms`, or `facebook-messenger`. + */ + bindingType: string; + /** + * The channel-specific address. For APNS, the device token. For FCM and GCM, the registration token. For SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger ID of the user or a phone number in E.164 format. + */ + address: string; + /** + * The list of tags associated with this Binding. Tags can be used to select the Bindings to use when sending a notification. Maximum 20 tags are allowed. + */ + tags: Array; + /** + * The absolute URL of the Binding resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + credentialSid: string; + dateCreated: Date; + dateUpdated: Date; + notificationProtocolVersion: string; + endpoint: string; + identity: string; + bindingType: string; + address: string; + tags: string[]; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BindingSolution { + serviceSid: string; +} +export interface BindingListInstance { + _version: V1; + _solution: BindingSolution; + _uri: string; + (sid: string): BindingContext; + get(sid: string): BindingContext; + /** + * Create a BindingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + create(params: BindingListInstanceCreateOptions, callback?: (error: Error | null, item?: BindingInstance) => any): Promise; + /** + * Streams BindingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BindingInstance, done: (err?: Error) => void) => void): void; + each(params: BindingListInstanceEachOptions, callback?: (item: BindingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BindingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BindingPage) => any): Promise; + /** + * Lists BindingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BindingInstance[]) => any): Promise; + list(params: BindingListInstanceOptions, callback?: (error: Error | null, items: BindingInstance[]) => any): Promise; + /** + * Retrieve a single page of BindingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BindingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BindingPage) => any): Promise; + page(params: BindingListInstancePageOptions, callback?: (error: Error | null, items: BindingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BindingListInstance(version: V1, serviceSid: string): BindingListInstance; +export declare class BindingPage extends Page { + /** + * Initialize the BindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: BindingSolution); + /** + * Build an instance of BindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BindingResource): BindingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/notify/v1/service/binding.js b/node_modules/twilio/lib/rest/notify/v1/service/binding.js new file mode 100644 index 00000000..b1396a1f --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/v1/service/binding.js @@ -0,0 +1,268 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Notify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BindingPage = exports.BindingListInstance = exports.BindingInstance = exports.BindingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class BindingContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Bindings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BindingInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingContextImpl = BindingContextImpl; +class BindingInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.credentialSid = payload.credential_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.notificationProtocolVersion = payload.notification_protocol_version; + this.endpoint = payload.endpoint; + this.identity = payload.identity; + this.bindingType = payload.binding_type; + this.address = payload.address; + this.tags = payload.tags; + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new BindingContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a BindingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BindingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + credentialSid: this.credentialSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + notificationProtocolVersion: this.notificationProtocolVersion, + endpoint: this.endpoint, + identity: this.identity, + bindingType: this.bindingType, + address: this.address, + tags: this.tags, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingInstance = BindingInstance; +function BindingListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new BindingContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Bindings`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + if (params["bindingType"] === null || params["bindingType"] === undefined) { + throw new Error("Required parameter \"params['bindingType']\" missing."); + } + if (params["address"] === null || params["address"] === undefined) { + throw new Error("Required parameter \"params['address']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + data["BindingType"] = params["bindingType"]; + data["Address"] = params["address"]; + if (params["tag"] !== undefined) + data["Tag"] = serialize.map(params["tag"], (e) => e); + if (params["notificationProtocolVersion"] !== undefined) + data["NotificationProtocolVersion"] = + params["notificationProtocolVersion"]; + if (params["credentialSid"] !== undefined) + data["CredentialSid"] = params["credentialSid"]; + if (params["endpoint"] !== undefined) + data["Endpoint"] = params["endpoint"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BindingInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601Date(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601Date(params["endDate"]); + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["tag"] !== undefined) + data["Tag"] = serialize.map(params["tag"], (e) => e); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BindingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BindingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BindingListInstance = BindingListInstance; +class BindingPage extends Page_1.default { + /** + * Initialize the BindingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BindingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BindingInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BindingPage = BindingPage; diff --git a/node_modules/twilio/lib/rest/notify/v1/service/notification.d.ts b/node_modules/twilio/lib/rest/notify/v1/service/notification.d.ts new file mode 100644 index 00000000..6d0dfb14 --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/v1/service/notification.d.ts @@ -0,0 +1,208 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export type NotificationPriority = "high" | "low"; +/** + * Options to pass to create a NotificationInstance + */ +export interface NotificationListInstanceCreateOptions { + /** The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. */ + body?: string; + /** */ + priority?: NotificationPriority; + /** How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. */ + ttl?: number; + /** The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. */ + title?: string; + /** The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. */ + sound?: string; + /** The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. */ + action?: string; + /** The custom key-value pairs of the notification\\\'s payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. */ + data?: any; + /** The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. */ + apn?: any; + /** The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). */ + gcm?: any; + /** The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. */ + sms?: any; + /** Deprecated. */ + facebookMessenger?: any; + /** The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. */ + fcm?: any; + /** The Segment resource is deprecated. Use the `tag` parameter, instead. */ + segment?: Array; + /** Deprecated. */ + alexa?: any; + /** The destination address specified as a JSON string. Multiple `to_binding` parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. */ + toBinding?: Array; + /** URL to send webhooks. */ + deliveryCallbackUrl?: string; + /** The `identity` value that uniquely identifies the new resource\\\'s [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. */ + identity?: Array; + /** A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag `all` is available to notify all Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings in a specific channel. */ + tag?: Array; +} +export interface NotificationSolution { + serviceSid: string; +} +export interface NotificationListInstance { + _version: V1; + _solution: NotificationSolution; + _uri: string; + /** + * Create a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + create(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Create a NotificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + create(params: NotificationListInstanceCreateOptions, callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NotificationListInstance(version: V1, serviceSid: string): NotificationListInstance; +interface NotificationResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + identities: Array; + tags: Array; + segments: Array; + priority: NotificationPriority; + ttl: number; + title: string; + body: string; + sound: string; + action: string; + data: any; + apn: any; + gcm: any; + fcm: any; + sms: any; + facebook_messenger: any; + alexa: any; +} +export declare class NotificationInstance { + protected _version: V1; + constructor(_version: V1, payload: NotificationResource, serviceSid: string); + /** + * The unique string that we created to identify the Notification resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/notify/api/service-resource) the resource is associated with. + */ + serviceSid: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The list of `identity` values of the Users to notify. We will attempt to deliver notifications only to Bindings with an identity in this list. + */ + identities: Array; + /** + * The tags that select the Bindings to notify. Notifications will be attempted only to Bindings that have all of the tags listed in this property. + */ + tags: Array; + /** + * The list of Segments to notify. The [Segment](https://www.twilio.com/docs/notify/api/segment-resource) resource is deprecated. Use the `tags` property, instead. + */ + segments: Array; + priority: NotificationPriority; + /** + * How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. + */ + ttl: number; + /** + * The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. + */ + title: string; + /** + * The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. + */ + body: string; + /** + * The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. + */ + sound: string; + /** + * The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + */ + action: string; + /** + * The custom key-value pairs of the notification\'s payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + */ + data: any; + /** + * The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. + */ + apn: any; + /** + * The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. + */ + gcm: any; + /** + * The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. + */ + fcm: any; + /** + * The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/api/message-resource) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + */ + sms: any; + /** + * Deprecated. + */ + facebookMessenger: any; + /** + * Deprecated. + */ + alexa: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + identities: string[]; + tags: string[]; + segments: string[]; + priority: NotificationPriority; + ttl: number; + title: string; + body: string; + sound: string; + action: string; + data: any; + apn: any; + gcm: any; + fcm: any; + sms: any; + facebookMessenger: any; + alexa: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/notify/v1/service/notification.js b/node_modules/twilio/lib/rest/notify/v1/service/notification.js new file mode 100644 index 00000000..5a354f1b --- /dev/null +++ b/node_modules/twilio/lib/rest/notify/v1/service/notification.js @@ -0,0 +1,152 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Notify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NotificationInstance = exports.NotificationListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function NotificationListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Notifications`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["priority"] !== undefined) + data["Priority"] = params["priority"]; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["title"] !== undefined) + data["Title"] = params["title"]; + if (params["sound"] !== undefined) + data["Sound"] = params["sound"]; + if (params["action"] !== undefined) + data["Action"] = params["action"]; + if (params["data"] !== undefined) + data["Data"] = serialize.object(params["data"]); + if (params["apn"] !== undefined) + data["Apn"] = serialize.object(params["apn"]); + if (params["gcm"] !== undefined) + data["Gcm"] = serialize.object(params["gcm"]); + if (params["sms"] !== undefined) + data["Sms"] = serialize.object(params["sms"]); + if (params["facebookMessenger"] !== undefined) + data["FacebookMessenger"] = serialize.object(params["facebookMessenger"]); + if (params["fcm"] !== undefined) + data["Fcm"] = serialize.object(params["fcm"]); + if (params["segment"] !== undefined) + data["Segment"] = serialize.map(params["segment"], (e) => e); + if (params["alexa"] !== undefined) + data["Alexa"] = serialize.object(params["alexa"]); + if (params["toBinding"] !== undefined) + data["ToBinding"] = serialize.map(params["toBinding"], (e) => e); + if (params["deliveryCallbackUrl"] !== undefined) + data["DeliveryCallbackUrl"] = params["deliveryCallbackUrl"]; + if (params["identity"] !== undefined) + data["Identity"] = serialize.map(params["identity"], (e) => e); + if (params["tag"] !== undefined) + data["Tag"] = serialize.map(params["tag"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NotificationInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NotificationListInstance = NotificationListInstance; +class NotificationInstance { + constructor(_version, payload, serviceSid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.identities = payload.identities; + this.tags = payload.tags; + this.segments = payload.segments; + this.priority = payload.priority; + this.ttl = deserialize.integer(payload.ttl); + this.title = payload.title; + this.body = payload.body; + this.sound = payload.sound; + this.action = payload.action; + this.data = payload.data; + this.apn = payload.apn; + this.gcm = payload.gcm; + this.fcm = payload.fcm; + this.sms = payload.sms; + this.facebookMessenger = payload.facebook_messenger; + this.alexa = payload.alexa; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + identities: this.identities, + tags: this.tags, + segments: this.segments, + priority: this.priority, + ttl: this.ttl, + title: this.title, + body: this.body, + sound: this.sound, + action: this.action, + data: this.data, + apn: this.apn, + gcm: this.gcm, + fcm: this.fcm, + sms: this.sms, + facebookMessenger: this.facebookMessenger, + alexa: this.alexa, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationInstance = NotificationInstance; diff --git a/node_modules/twilio/lib/rest/numbers/V1.d.ts b/node_modules/twilio/lib/rest/numbers/V1.d.ts new file mode 100644 index 00000000..7af31d03 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/V1.d.ts @@ -0,0 +1,30 @@ +import NumbersBase from "../NumbersBase"; +import Version from "../../base/Version"; +import { BulkEligibilityListInstance } from "./v1/bulkEligibility"; +import { PortingBulkPortabilityListInstance } from "./v1/portingBulkPortability"; +import { PortingPortInFetchListInstance } from "./v1/portingPortInFetch"; +import { PortingPortabilityListInstance } from "./v1/portingPortability"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Numbers + * + * @param domain - The Twilio (Twilio.Numbers) domain + */ + constructor(domain: NumbersBase); + /** bulkEligibilities - { Twilio.Numbers.V1.BulkEligibilityListInstance } resource */ + protected _bulkEligibilities?: BulkEligibilityListInstance; + /** portingBulkPortabilities - { Twilio.Numbers.V1.PortingBulkPortabilityListInstance } resource */ + protected _portingBulkPortabilities?: PortingBulkPortabilityListInstance; + /** portingPortIns - { Twilio.Numbers.V1.PortingPortInFetchListInstance } resource */ + protected _portingPortIns?: PortingPortInFetchListInstance; + /** portingPortabilities - { Twilio.Numbers.V1.PortingPortabilityListInstance } resource */ + protected _portingPortabilities?: PortingPortabilityListInstance; + /** Getter for bulkEligibilities resource */ + get bulkEligibilities(): BulkEligibilityListInstance; + /** Getter for portingBulkPortabilities resource */ + get portingBulkPortabilities(): PortingBulkPortabilityListInstance; + /** Getter for portingPortIns resource */ + get portingPortIns(): PortingPortInFetchListInstance; + /** Getter for portingPortabilities resource */ + get portingPortabilities(): PortingPortabilityListInstance; +} diff --git a/node_modules/twilio/lib/rest/numbers/V1.js b/node_modules/twilio/lib/rest/numbers/V1.js new file mode 100644 index 00000000..de084d54 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/V1.js @@ -0,0 +1,59 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const bulkEligibility_1 = require("./v1/bulkEligibility"); +const portingBulkPortability_1 = require("./v1/portingBulkPortability"); +const portingPortInFetch_1 = require("./v1/portingPortInFetch"); +const portingPortability_1 = require("./v1/portingPortability"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Numbers + * + * @param domain - The Twilio (Twilio.Numbers) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for bulkEligibilities resource */ + get bulkEligibilities() { + this._bulkEligibilities = + this._bulkEligibilities || (0, bulkEligibility_1.BulkEligibilityListInstance)(this); + return this._bulkEligibilities; + } + /** Getter for portingBulkPortabilities resource */ + get portingBulkPortabilities() { + this._portingBulkPortabilities = + this._portingBulkPortabilities || + (0, portingBulkPortability_1.PortingBulkPortabilityListInstance)(this); + return this._portingBulkPortabilities; + } + /** Getter for portingPortIns resource */ + get portingPortIns() { + this._portingPortIns = + this._portingPortIns || (0, portingPortInFetch_1.PortingPortInFetchListInstance)(this); + return this._portingPortIns; + } + /** Getter for portingPortabilities resource */ + get portingPortabilities() { + this._portingPortabilities = + this._portingPortabilities || (0, portingPortability_1.PortingPortabilityListInstance)(this); + return this._portingPortabilities; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/numbers/V2.d.ts b/node_modules/twilio/lib/rest/numbers/V2.d.ts new file mode 100644 index 00000000..c3ca95f5 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/V2.d.ts @@ -0,0 +1,30 @@ +import NumbersBase from "../NumbersBase"; +import Version from "../../base/Version"; +import { AuthorizationDocumentListInstance } from "./v2/authorizationDocument"; +import { BulkHostedNumberOrderListInstance } from "./v2/bulkHostedNumberOrder"; +import { HostedNumberOrderListInstance } from "./v2/hostedNumberOrder"; +import { RegulatoryComplianceListInstance } from "./v2/regulatoryCompliance"; +export default class V2 extends Version { + /** + * Initialize the V2 version of Numbers + * + * @param domain - The Twilio (Twilio.Numbers) domain + */ + constructor(domain: NumbersBase); + /** authorizationDocuments - { Twilio.Numbers.V2.AuthorizationDocumentListInstance } resource */ + protected _authorizationDocuments?: AuthorizationDocumentListInstance; + /** bulkHostedNumberOrders - { Twilio.Numbers.V2.BulkHostedNumberOrderListInstance } resource */ + protected _bulkHostedNumberOrders?: BulkHostedNumberOrderListInstance; + /** hostedNumberOrders - { Twilio.Numbers.V2.HostedNumberOrderListInstance } resource */ + protected _hostedNumberOrders?: HostedNumberOrderListInstance; + /** regulatoryCompliance - { Twilio.Numbers.V2.RegulatoryComplianceListInstance } resource */ + protected _regulatoryCompliance?: RegulatoryComplianceListInstance; + /** Getter for authorizationDocuments resource */ + get authorizationDocuments(): AuthorizationDocumentListInstance; + /** Getter for bulkHostedNumberOrders resource */ + get bulkHostedNumberOrders(): BulkHostedNumberOrderListInstance; + /** Getter for hostedNumberOrders resource */ + get hostedNumberOrders(): HostedNumberOrderListInstance; + /** Getter for regulatoryCompliance resource */ + get regulatoryCompliance(): RegulatoryComplianceListInstance; +} diff --git a/node_modules/twilio/lib/rest/numbers/V2.js b/node_modules/twilio/lib/rest/numbers/V2.js new file mode 100644 index 00000000..349bb502 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/V2.js @@ -0,0 +1,58 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const authorizationDocument_1 = require("./v2/authorizationDocument"); +const bulkHostedNumberOrder_1 = require("./v2/bulkHostedNumberOrder"); +const hostedNumberOrder_1 = require("./v2/hostedNumberOrder"); +const regulatoryCompliance_1 = require("./v2/regulatoryCompliance"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of Numbers + * + * @param domain - The Twilio (Twilio.Numbers) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for authorizationDocuments resource */ + get authorizationDocuments() { + this._authorizationDocuments = + this._authorizationDocuments || (0, authorizationDocument_1.AuthorizationDocumentListInstance)(this); + return this._authorizationDocuments; + } + /** Getter for bulkHostedNumberOrders resource */ + get bulkHostedNumberOrders() { + this._bulkHostedNumberOrders = + this._bulkHostedNumberOrders || (0, bulkHostedNumberOrder_1.BulkHostedNumberOrderListInstance)(this); + return this._bulkHostedNumberOrders; + } + /** Getter for hostedNumberOrders resource */ + get hostedNumberOrders() { + this._hostedNumberOrders = + this._hostedNumberOrders || (0, hostedNumberOrder_1.HostedNumberOrderListInstance)(this); + return this._hostedNumberOrders; + } + /** Getter for regulatoryCompliance resource */ + get regulatoryCompliance() { + this._regulatoryCompliance = + this._regulatoryCompliance || (0, regulatoryCompliance_1.RegulatoryComplianceListInstance)(this); + return this._regulatoryCompliance; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.d.ts b/node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.d.ts new file mode 100644 index 00000000..5dd739d5 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.d.ts @@ -0,0 +1,112 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface BulkEligibilityContext { + /** + * Fetch a BulkEligibilityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BulkEligibilityInstance + */ + fetch(callback?: (error: Error | null, item?: BulkEligibilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BulkEligibilityContextSolution { + requestId: string; +} +export declare class BulkEligibilityContextImpl implements BulkEligibilityContext { + protected _version: V1; + protected _solution: BulkEligibilityContextSolution; + protected _uri: string; + constructor(_version: V1, requestId: string); + fetch(callback?: (error: Error | null, item?: BulkEligibilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BulkEligibilityContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BulkEligibilityResource { + request_id: string; + url: string; + results: Array; + friendly_name: string; + status: string; + date_created: Date; + date_completed: Date; +} +export declare class BulkEligibilityInstance { + protected _version: V1; + protected _solution: BulkEligibilityContextSolution; + protected _context?: BulkEligibilityContext; + constructor(_version: V1, payload: BulkEligibilityResource, requestId?: string); + /** + * The SID of the bulk eligibility check that you want to know about. + */ + requestId: string; + /** + * This is the url of the request that you\'re trying to reach out to locate the resource. + */ + url: string; + /** + * The result set that contains the eligibility check response for each requested number, each result has at least the following attributes: phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number\'s ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status. + */ + results: Array; + /** + * This is the string that you assigned as a friendly name for describing the eligibility check request. + */ + friendlyName: string; + /** + * This is the status of the bulk eligibility check request. (Example: COMPLETE, IN_PROGRESS) + */ + status: string; + dateCreated: Date; + dateCompleted: Date; + private get _proxy(); + /** + * Fetch a BulkEligibilityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BulkEligibilityInstance + */ + fetch(callback?: (error: Error | null, item?: BulkEligibilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + requestId: string; + url: string; + results: any[]; + friendlyName: string; + status: string; + dateCreated: Date; + dateCompleted: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BulkEligibilitySolution { +} +export interface BulkEligibilityListInstance { + _version: V1; + _solution: BulkEligibilitySolution; + _uri: string; + (requestId: string): BulkEligibilityContext; + get(requestId: string): BulkEligibilityContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BulkEligibilityListInstance(version: V1): BulkEligibilityListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.js b/node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.js new file mode 100644 index 00000000..56e927ee --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v1/bulkEligibility.js @@ -0,0 +1,118 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BulkEligibilityListInstance = exports.BulkEligibilityInstance = exports.BulkEligibilityContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class BulkEligibilityContextImpl { + constructor(_version, requestId) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(requestId)) { + throw new Error("Parameter 'requestId' is not valid."); + } + this._solution = { requestId }; + this._uri = `/HostedNumber/Eligibility/Bulk/${requestId}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BulkEligibilityInstance(operationVersion, payload, instance._solution.requestId)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BulkEligibilityContextImpl = BulkEligibilityContextImpl; +class BulkEligibilityInstance { + constructor(_version, payload, requestId) { + this._version = _version; + this.requestId = payload.request_id; + this.url = payload.url; + this.results = payload.results; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateCompleted = deserialize.iso8601DateTime(payload.date_completed); + this._solution = { requestId: requestId || this.requestId }; + } + get _proxy() { + this._context = + this._context || + new BulkEligibilityContextImpl(this._version, this._solution.requestId); + return this._context; + } + /** + * Fetch a BulkEligibilityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BulkEligibilityInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + requestId: this.requestId, + url: this.url, + results: this.results, + friendlyName: this.friendlyName, + status: this.status, + dateCreated: this.dateCreated, + dateCompleted: this.dateCompleted, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BulkEligibilityInstance = BulkEligibilityInstance; +function BulkEligibilityListInstance(version) { + const instance = ((requestId) => instance.get(requestId)); + instance.get = function get(requestId) { + return new BulkEligibilityContextImpl(version, requestId); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BulkEligibilityListInstance = BulkEligibilityListInstance; diff --git a/node_modules/twilio/lib/rest/numbers/v1/portingBulkPortability.d.ts b/node_modules/twilio/lib/rest/numbers/v1/portingBulkPortability.d.ts new file mode 100644 index 00000000..5399d8d8 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v1/portingBulkPortability.d.ts @@ -0,0 +1,120 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export type PortingBulkPortabilityStatus = "in-progress" | "completed" | "expired"; +/** + * Options to pass to create a PortingBulkPortabilityInstance + */ +export interface PortingBulkPortabilityListInstanceCreateOptions { + /** The phone numbers which portability is to be checked. This should be a list of strings. Phone numbers are in E.164 format (e.g. +16175551212). . */ + phoneNumbers: Array; +} +export interface PortingBulkPortabilityContext { + /** + * Fetch a PortingBulkPortabilityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingBulkPortabilityInstance + */ + fetch(callback?: (error: Error | null, item?: PortingBulkPortabilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PortingBulkPortabilityContextSolution { + sid: string; +} +export declare class PortingBulkPortabilityContextImpl implements PortingBulkPortabilityContext { + protected _version: V1; + protected _solution: PortingBulkPortabilityContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: PortingBulkPortabilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PortingBulkPortabilityContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PortingBulkPortabilityResource { + sid: string; + status: PortingBulkPortabilityStatus; + datetime_created: Date; + phone_numbers: Array; + url: string; +} +export declare class PortingBulkPortabilityInstance { + protected _version: V1; + protected _solution: PortingBulkPortabilityContextSolution; + protected _context?: PortingBulkPortabilityContext; + constructor(_version: V1, payload: PortingBulkPortabilityResource, sid?: string); + /** + * A 34 character string that uniquely identifies this Portability check. + */ + sid: string; + status: PortingBulkPortabilityStatus; + /** + * The date that the Portability check was created, given in ISO 8601 format. + */ + datetimeCreated: Date; + /** + * Contains a list with all the information of the requested phone numbers. Each phone number contains the following properties: `phone_number`: The phone number which portability is to be checked. `portable`: Boolean flag specifying if phone number is portable or not. `not_portable_reason`: Reason why the phone number cannot be ported into Twilio, `null` otherwise. `not_portable_reason_code`: The Portability Reason Code for the phone number if it cannot be ported in Twilio, `null` otherwise. `pin_and_account_number_required`: Boolean flag specifying if PIN and account number is required for the phone number. `number_type`: The type of the requested phone number. `country` Country the phone number belongs to. `messaging_carrier` Current messaging carrier of the phone number. `voice_carrier` Current voice carrier of the phone number. + */ + phoneNumbers: Array; + /** + * This is the url of the request that you\'re trying to reach out to locate the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a PortingBulkPortabilityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingBulkPortabilityInstance + */ + fetch(callback?: (error: Error | null, item?: PortingBulkPortabilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + status: PortingBulkPortabilityStatus; + datetimeCreated: Date; + phoneNumbers: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PortingBulkPortabilitySolution { +} +export interface PortingBulkPortabilityListInstance { + _version: V1; + _solution: PortingBulkPortabilitySolution; + _uri: string; + (sid: string): PortingBulkPortabilityContext; + get(sid: string): PortingBulkPortabilityContext; + /** + * Create a PortingBulkPortabilityInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingBulkPortabilityInstance + */ + create(params: PortingBulkPortabilityListInstanceCreateOptions, callback?: (error: Error | null, item?: PortingBulkPortabilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PortingBulkPortabilityListInstance(version: V1): PortingBulkPortabilityListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v1/portingBulkPortability.js b/node_modules/twilio/lib/rest/numbers/v1/portingBulkPortability.js new file mode 100644 index 00000000..71508f19 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v1/portingBulkPortability.js @@ -0,0 +1,136 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PortingBulkPortabilityListInstance = exports.PortingBulkPortabilityInstance = exports.PortingBulkPortabilityContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PortingBulkPortabilityContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Porting/Portability/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PortingBulkPortabilityInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PortingBulkPortabilityContextImpl = PortingBulkPortabilityContextImpl; +class PortingBulkPortabilityInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.status = payload.status; + this.datetimeCreated = deserialize.iso8601DateTime(payload.datetime_created); + this.phoneNumbers = payload.phone_numbers; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PortingBulkPortabilityContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a PortingBulkPortabilityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingBulkPortabilityInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + status: this.status, + datetimeCreated: this.datetimeCreated, + phoneNumbers: this.phoneNumbers, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PortingBulkPortabilityInstance = PortingBulkPortabilityInstance; +function PortingBulkPortabilityListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PortingBulkPortabilityContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Porting/Portability`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumbers"] === null || + params["phoneNumbers"] === undefined) { + throw new Error("Required parameter \"params['phoneNumbers']\" missing."); + } + let data = {}; + data["PhoneNumbers"] = serialize.map(params["phoneNumbers"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PortingBulkPortabilityInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PortingBulkPortabilityListInstance = PortingBulkPortabilityListInstance; diff --git a/node_modules/twilio/lib/rest/numbers/v1/portingPortInFetch.d.ts b/node_modules/twilio/lib/rest/numbers/v1/portingPortInFetch.d.ts new file mode 100644 index 00000000..7da00162 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v1/portingPortInFetch.d.ts @@ -0,0 +1,136 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface PortingPortInFetchContext { + /** + * Fetch a PortingPortInFetchInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortInFetchInstance + */ + fetch(callback?: (error: Error | null, item?: PortingPortInFetchInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PortingPortInFetchContextSolution { + portInRequestSid: string; +} +export declare class PortingPortInFetchContextImpl implements PortingPortInFetchContext { + protected _version: V1; + protected _solution: PortingPortInFetchContextSolution; + protected _uri: string; + constructor(_version: V1, portInRequestSid: string); + fetch(callback?: (error: Error | null, item?: PortingPortInFetchInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PortingPortInFetchContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PortingPortInFetchResource { + port_in_request_sid: string; + url: string; + account_sid: string; + notification_emails: Array; + target_port_in_date: Date; + target_port_in_time_range_start: string; + target_port_in_time_range_end: string; + losing_carrier_information: any; + phone_numbers: Array; + documents: Array; +} +export declare class PortingPortInFetchInstance { + protected _version: V1; + protected _solution: PortingPortInFetchContextSolution; + protected _context?: PortingPortInFetchContext; + constructor(_version: V1, payload: PortingPortInFetchResource, portInRequestSid?: string); + /** + * The SID of the Port In request. This is a unique identifier of the port in request. + */ + portInRequestSid: string; + /** + * The URL of this Port In request + */ + url: string; + /** + * The Account SID that the numbers will be added to after they are ported into Twilio. + */ + accountSid: string; + /** + * List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. + */ + notificationEmails: Array; + /** + * Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. + */ + targetPortInDate: Date; + /** + * Minimum hour in the future needs to be established with the Ops team for validation. + */ + targetPortInTimeRangeStart: string; + /** + * Maximum hour in the future needs to be established with the Ops team for validation. + */ + targetPortInTimeRangeEnd: string; + /** + * The information for the losing carrier. + */ + losingCarrierInformation: any; + /** + * The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). + */ + phoneNumbers: Array; + /** + * The list of documents SID referencing a utility bills + */ + documents: Array; + private get _proxy(); + /** + * Fetch a PortingPortInFetchInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortInFetchInstance + */ + fetch(callback?: (error: Error | null, item?: PortingPortInFetchInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + portInRequestSid: string; + url: string; + accountSid: string; + notificationEmails: string[]; + targetPortInDate: Date; + targetPortInTimeRangeStart: string; + targetPortInTimeRangeEnd: string; + losingCarrierInformation: any; + phoneNumbers: any[]; + documents: string[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PortingPortInFetchSolution { +} +export interface PortingPortInFetchListInstance { + _version: V1; + _solution: PortingPortInFetchSolution; + _uri: string; + (portInRequestSid: string): PortingPortInFetchContext; + get(portInRequestSid: string): PortingPortInFetchContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PortingPortInFetchListInstance(version: V1): PortingPortInFetchListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v1/portingPortInFetch.js b/node_modules/twilio/lib/rest/numbers/v1/portingPortInFetch.js new file mode 100644 index 00000000..5b73c9d4 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v1/portingPortInFetch.js @@ -0,0 +1,126 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PortingPortInFetchListInstance = exports.PortingPortInFetchInstance = exports.PortingPortInFetchContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PortingPortInFetchContextImpl { + constructor(_version, portInRequestSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(portInRequestSid)) { + throw new Error("Parameter 'portInRequestSid' is not valid."); + } + this._solution = { portInRequestSid }; + this._uri = `/Porting/PortIn/${portInRequestSid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PortingPortInFetchInstance(operationVersion, payload, instance._solution.portInRequestSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PortingPortInFetchContextImpl = PortingPortInFetchContextImpl; +class PortingPortInFetchInstance { + constructor(_version, payload, portInRequestSid) { + this._version = _version; + this.portInRequestSid = payload.port_in_request_sid; + this.url = payload.url; + this.accountSid = payload.account_sid; + this.notificationEmails = payload.notification_emails; + this.targetPortInDate = deserialize.iso8601Date(payload.target_port_in_date); + this.targetPortInTimeRangeStart = payload.target_port_in_time_range_start; + this.targetPortInTimeRangeEnd = payload.target_port_in_time_range_end; + this.losingCarrierInformation = payload.losing_carrier_information; + this.phoneNumbers = payload.phone_numbers; + this.documents = payload.documents; + this._solution = { + portInRequestSid: portInRequestSid || this.portInRequestSid, + }; + } + get _proxy() { + this._context = + this._context || + new PortingPortInFetchContextImpl(this._version, this._solution.portInRequestSid); + return this._context; + } + /** + * Fetch a PortingPortInFetchInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortInFetchInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + portInRequestSid: this.portInRequestSid, + url: this.url, + accountSid: this.accountSid, + notificationEmails: this.notificationEmails, + targetPortInDate: this.targetPortInDate, + targetPortInTimeRangeStart: this.targetPortInTimeRangeStart, + targetPortInTimeRangeEnd: this.targetPortInTimeRangeEnd, + losingCarrierInformation: this.losingCarrierInformation, + phoneNumbers: this.phoneNumbers, + documents: this.documents, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PortingPortInFetchInstance = PortingPortInFetchInstance; +function PortingPortInFetchListInstance(version) { + const instance = ((portInRequestSid) => instance.get(portInRequestSid)); + instance.get = function get(portInRequestSid) { + return new PortingPortInFetchContextImpl(version, portInRequestSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PortingPortInFetchListInstance = PortingPortInFetchListInstance; diff --git a/node_modules/twilio/lib/rest/numbers/v1/portingPortability.d.ts b/node_modules/twilio/lib/rest/numbers/v1/portingPortability.d.ts new file mode 100644 index 00000000..afbeee41 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v1/portingPortability.d.ts @@ -0,0 +1,165 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export type PortingPortabilityNumberType = "LOCAL" | "UNKNOWN" | "MOBILE" | "TOLL-FREE"; +/** + * Options to pass to fetch a PortingPortabilityInstance + */ +export interface PortingPortabilityContextFetchOptions { + /** The SID of the account where the phone number(s) will be ported. */ + targetAccountSid?: string; +} +export interface PortingPortabilityContext { + /** + * Fetch a PortingPortabilityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortabilityInstance + */ + fetch(callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise; + /** + * Fetch a PortingPortabilityInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortabilityInstance + */ + fetch(params: PortingPortabilityContextFetchOptions, callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PortingPortabilityContextSolution { + phoneNumber: string; +} +export declare class PortingPortabilityContextImpl implements PortingPortabilityContext { + protected _version: V1; + protected _solution: PortingPortabilityContextSolution; + protected _uri: string; + constructor(_version: V1, phoneNumber: string); + fetch(params?: PortingPortabilityContextFetchOptions | ((error: Error | null, item?: PortingPortabilityInstance) => any), callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PortingPortabilityContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PortingPortabilityResource { + phone_number: string; + account_sid: string; + portable: boolean; + pin_and_account_number_required: boolean; + not_portable_reason: string; + not_portable_reason_code: number; + number_type: PortingPortabilityNumberType; + country: string; + messaging_carrier: string; + voice_carrier: string; + url: string; +} +export declare class PortingPortabilityInstance { + protected _version: V1; + protected _solution: PortingPortabilityContextSolution; + protected _context?: PortingPortabilityContext; + constructor(_version: V1, payload: PortingPortabilityResource, phoneNumber?: string); + /** + * The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212). + */ + phoneNumber: string; + /** + * The target account sid to which the number will be ported + */ + accountSid: string; + /** + * Boolean flag specifying if phone number is portable or not. + */ + portable: boolean; + /** + * Boolean flag specifying if PIN and account number is required for the phone number. + */ + pinAndAccountNumberRequired: boolean; + /** + * Reason why the phone number cannot be ported into Twilio, `null` otherwise. + */ + notPortableReason: string; + /** + * The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise. One of `22131`, `22132`, `22130`, `22133`, `22102` or `22135`. + */ + notPortableReasonCode: number; + numberType: PortingPortabilityNumberType; + /** + * Country the phone number belongs to. + */ + country: string; + /** + * Current messaging carrier of the phone number + */ + messagingCarrier: string; + /** + * Current voice carrier of the phone number + */ + voiceCarrier: string; + /** + * This is the url of the request that you\'re trying to reach out to locate the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a PortingPortabilityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortabilityInstance + */ + fetch(callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise; + /** + * Fetch a PortingPortabilityInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortabilityInstance + */ + fetch(params: PortingPortabilityContextFetchOptions, callback?: (error: Error | null, item?: PortingPortabilityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + phoneNumber: string; + accountSid: string; + portable: boolean; + pinAndAccountNumberRequired: boolean; + notPortableReason: string; + notPortableReasonCode: number; + numberType: PortingPortabilityNumberType; + country: string; + messagingCarrier: string; + voiceCarrier: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PortingPortabilitySolution { +} +export interface PortingPortabilityListInstance { + _version: V1; + _solution: PortingPortabilitySolution; + _uri: string; + (phoneNumber: string): PortingPortabilityContext; + get(phoneNumber: string): PortingPortabilityContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PortingPortabilityListInstance(version: V1): PortingPortabilityListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v1/portingPortability.js b/node_modules/twilio/lib/rest/numbers/v1/portingPortability.js new file mode 100644 index 00000000..71021bee --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v1/portingPortability.js @@ -0,0 +1,132 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PortingPortabilityListInstance = exports.PortingPortabilityInstance = exports.PortingPortabilityContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PortingPortabilityContextImpl { + constructor(_version, phoneNumber) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(phoneNumber)) { + throw new Error("Parameter 'phoneNumber' is not valid."); + } + this._solution = { phoneNumber }; + this._uri = `/Porting/Portability/PhoneNumber/${phoneNumber}`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["targetAccountSid"] !== undefined) + data["TargetAccountSid"] = params["targetAccountSid"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PortingPortabilityInstance(operationVersion, payload, instance._solution.phoneNumber)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PortingPortabilityContextImpl = PortingPortabilityContextImpl; +class PortingPortabilityInstance { + constructor(_version, payload, phoneNumber) { + this._version = _version; + this.phoneNumber = payload.phone_number; + this.accountSid = payload.account_sid; + this.portable = payload.portable; + this.pinAndAccountNumberRequired = payload.pin_and_account_number_required; + this.notPortableReason = payload.not_portable_reason; + this.notPortableReasonCode = deserialize.integer(payload.not_portable_reason_code); + this.numberType = payload.number_type; + this.country = payload.country; + this.messagingCarrier = payload.messaging_carrier; + this.voiceCarrier = payload.voice_carrier; + this.url = payload.url; + this._solution = { phoneNumber: phoneNumber || this.phoneNumber }; + } + get _proxy() { + this._context = + this._context || + new PortingPortabilityContextImpl(this._version, this._solution.phoneNumber); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + phoneNumber: this.phoneNumber, + accountSid: this.accountSid, + portable: this.portable, + pinAndAccountNumberRequired: this.pinAndAccountNumberRequired, + notPortableReason: this.notPortableReason, + notPortableReasonCode: this.notPortableReasonCode, + numberType: this.numberType, + country: this.country, + messagingCarrier: this.messagingCarrier, + voiceCarrier: this.voiceCarrier, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PortingPortabilityInstance = PortingPortabilityInstance; +function PortingPortabilityListInstance(version) { + const instance = ((phoneNumber) => instance.get(phoneNumber)); + instance.get = function get(phoneNumber) { + return new PortingPortabilityContextImpl(version, phoneNumber); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PortingPortabilityListInstance = PortingPortabilityListInstance; diff --git a/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.d.ts b/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.d.ts new file mode 100644 index 00000000..53dbdd3e --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.d.ts @@ -0,0 +1,290 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +import { DependentHostedNumberOrderListInstance } from "./authorizationDocument/dependentHostedNumberOrder"; +export type AuthorizationDocumentStatus = "opened" | "signing" | "signed" | "canceled" | "failed"; +/** + * Options to pass to create a AuthorizationDocumentInstance + */ +export interface AuthorizationDocumentListInstanceCreateOptions { + /** A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. */ + addressSid: string; + /** Email that this AuthorizationDocument will be sent to for signing. */ + email: string; + /** The contact phone number of the person authorized to sign the Authorization Document. */ + contactPhoneNumber: string; + /** A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio\\\'s platform. */ + hostedNumberOrderSids: Array; + /** The title of the person authorized to sign the Authorization Document for this phone number. */ + contactTitle?: string; + /** Email recipients who will be informed when an Authorization Document has been sent and signed. */ + ccEmails?: Array; +} +/** + * Options to pass to each + */ +export interface AuthorizationDocumentListInstanceEachOptions { + /** Email that this AuthorizationDocument will be sent to for signing. */ + email?: string; + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: AuthorizationDocumentStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AuthorizationDocumentListInstanceOptions { + /** Email that this AuthorizationDocument will be sent to for signing. */ + email?: string; + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: AuthorizationDocumentStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AuthorizationDocumentListInstancePageOptions { + /** Email that this AuthorizationDocument will be sent to for signing. */ + email?: string; + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: AuthorizationDocumentStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AuthorizationDocumentContext { + dependentHostedNumberOrders: DependentHostedNumberOrderListInstance; + /** + * Remove a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AuthorizationDocumentContextSolution { + sid: string; +} +export declare class AuthorizationDocumentContextImpl implements AuthorizationDocumentContext { + protected _version: V2; + protected _solution: AuthorizationDocumentContextSolution; + protected _uri: string; + protected _dependentHostedNumberOrders?: DependentHostedNumberOrderListInstance; + constructor(_version: V2, sid: string); + get dependentHostedNumberOrders(): DependentHostedNumberOrderListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AuthorizationDocumentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AuthorizationDocumentPayload extends TwilioResponsePayload { + items: AuthorizationDocumentResource[]; +} +interface AuthorizationDocumentResource { + sid: string; + address_sid: string; + status: AuthorizationDocumentStatus; + email: string; + cc_emails: Array; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class AuthorizationDocumentInstance { + protected _version: V2; + protected _solution: AuthorizationDocumentContextSolution; + protected _context?: AuthorizationDocumentContext; + constructor(_version: V2, payload: AuthorizationDocumentResource, sid?: string); + /** + * A 34 character string that uniquely identifies this AuthorizationDocument. + */ + sid: string; + /** + * A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + */ + addressSid: string; + status: AuthorizationDocumentStatus; + /** + * Email that this AuthorizationDocument will be sent to for signing. + */ + email: string; + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed. + */ + ccEmails: Array; + /** + * The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + url: string; + links: Record; + private get _proxy(); + /** + * Remove a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Access the dependentHostedNumberOrders. + */ + dependentHostedNumberOrders(): DependentHostedNumberOrderListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + addressSid: string; + status: AuthorizationDocumentStatus; + email: string; + ccEmails: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AuthorizationDocumentSolution { +} +export interface AuthorizationDocumentListInstance { + _version: V2; + _solution: AuthorizationDocumentSolution; + _uri: string; + (sid: string): AuthorizationDocumentContext; + get(sid: string): AuthorizationDocumentContext; + /** + * Create a AuthorizationDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + create(params: AuthorizationDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Streams AuthorizationDocumentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizationDocumentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void; + each(params: AuthorizationDocumentListInstanceEachOptions, callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AuthorizationDocumentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise; + /** + * Lists AuthorizationDocumentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizationDocumentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AuthorizationDocumentInstance[]) => any): Promise; + list(params: AuthorizationDocumentListInstanceOptions, callback?: (error: Error | null, items: AuthorizationDocumentInstance[]) => any): Promise; + /** + * Retrieve a single page of AuthorizationDocumentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizationDocumentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise; + page(params: AuthorizationDocumentListInstancePageOptions, callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthorizationDocumentListInstance(version: V2): AuthorizationDocumentListInstance; +export declare class AuthorizationDocumentPage extends Page { + /** + * Initialize the AuthorizationDocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: AuthorizationDocumentSolution); + /** + * Build an instance of AuthorizationDocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AuthorizationDocumentResource): AuthorizationDocumentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.js b/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.js new file mode 100644 index 00000000..2e5d827d --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument.js @@ -0,0 +1,262 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthorizationDocumentPage = exports.AuthorizationDocumentListInstance = exports.AuthorizationDocumentInstance = exports.AuthorizationDocumentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const dependentHostedNumberOrder_1 = require("./authorizationDocument/dependentHostedNumberOrder"); +class AuthorizationDocumentContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/HostedNumber/AuthorizationDocuments/${sid}`; + } + get dependentHostedNumberOrders() { + this._dependentHostedNumberOrders = + this._dependentHostedNumberOrders || + (0, dependentHostedNumberOrder_1.DependentHostedNumberOrderListInstance)(this._version, this._solution.sid); + return this._dependentHostedNumberOrders; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AuthorizationDocumentInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizationDocumentContextImpl = AuthorizationDocumentContextImpl; +class AuthorizationDocumentInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.addressSid = payload.address_sid; + this.status = payload.status; + this.email = payload.email; + this.ccEmails = payload.cc_emails; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AuthorizationDocumentContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the dependentHostedNumberOrders. + */ + dependentHostedNumberOrders() { + return this._proxy.dependentHostedNumberOrders; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + addressSid: this.addressSid, + status: this.status, + email: this.email, + ccEmails: this.ccEmails, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizationDocumentInstance = AuthorizationDocumentInstance; +function AuthorizationDocumentListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AuthorizationDocumentContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/HostedNumber/AuthorizationDocuments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["addressSid"] === null || params["addressSid"] === undefined) { + throw new Error("Required parameter \"params['addressSid']\" missing."); + } + if (params["email"] === null || params["email"] === undefined) { + throw new Error("Required parameter \"params['email']\" missing."); + } + if (params["contactPhoneNumber"] === null || + params["contactPhoneNumber"] === undefined) { + throw new Error("Required parameter \"params['contactPhoneNumber']\" missing."); + } + if (params["hostedNumberOrderSids"] === null || + params["hostedNumberOrderSids"] === undefined) { + throw new Error("Required parameter \"params['hostedNumberOrderSids']\" missing."); + } + let data = {}; + data["AddressSid"] = params["addressSid"]; + data["Email"] = params["email"]; + data["ContactPhoneNumber"] = params["contactPhoneNumber"]; + data["HostedNumberOrderSids"] = serialize.map(params["hostedNumberOrderSids"], (e) => e); + if (params["contactTitle"] !== undefined) + data["ContactTitle"] = params["contactTitle"]; + if (params["ccEmails"] !== undefined) + data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthorizationDocumentInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthorizationDocumentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AuthorizationDocumentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthorizationDocumentListInstance = AuthorizationDocumentListInstance; +class AuthorizationDocumentPage extends Page_1.default { + /** + * Initialize the AuthorizationDocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AuthorizationDocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AuthorizationDocumentInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizationDocumentPage = AuthorizationDocumentPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts b/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts new file mode 100644 index 00000000..ec032a3e --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts @@ -0,0 +1,265 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { PhoneNumberCapabilities } from "../../../../interfaces"; +export type DependentHostedNumberOrderStatus = "received" | "verified" | "pending-loa" | "carrier-processing" | "completed" | "failed" | "action-required"; +/** + * Options to pass to each + */ +export interface DependentHostedNumberOrderListInstanceEachOptions { + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: DependentHostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 128 characters. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DependentHostedNumberOrderListInstanceOptions { + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: DependentHostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 128 characters. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DependentHostedNumberOrderListInstancePageOptions { + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: DependentHostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 128 characters. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DependentHostedNumberOrderSolution { + signingDocumentSid: string; +} +export interface DependentHostedNumberOrderListInstance { + _version: V2; + _solution: DependentHostedNumberOrderSolution; + _uri: string; + /** + * Streams DependentHostedNumberOrderInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentHostedNumberOrderListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void): void; + each(params: DependentHostedNumberOrderListInstanceEachOptions, callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DependentHostedNumberOrderInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DependentHostedNumberOrderPage) => any): Promise; + /** + * Lists DependentHostedNumberOrderInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentHostedNumberOrderListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DependentHostedNumberOrderInstance[]) => any): Promise; + list(params: DependentHostedNumberOrderListInstanceOptions, callback?: (error: Error | null, items: DependentHostedNumberOrderInstance[]) => any): Promise; + /** + * Retrieve a single page of DependentHostedNumberOrderInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentHostedNumberOrderListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DependentHostedNumberOrderPage) => any): Promise; + page(params: DependentHostedNumberOrderListInstancePageOptions, callback?: (error: Error | null, items: DependentHostedNumberOrderPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DependentHostedNumberOrderListInstance(version: V2, signingDocumentSid: string): DependentHostedNumberOrderListInstance; +interface DependentHostedNumberOrderPayload extends TwilioResponsePayload { + items: DependentHostedNumberOrderResource[]; +} +interface DependentHostedNumberOrderResource { + sid: string; + bulk_hosting_request_sid: string; + next_step: string; + account_sid: string; + incoming_phone_number_sid: string; + address_sid: string; + signing_document_sid: string; + phone_number: string; + capabilities: PhoneNumberCapabilities; + friendly_name: string; + status: DependentHostedNumberOrderStatus; + failure_reason: string; + date_created: Date; + date_updated: Date; + email: string; + cc_emails: Array; + contact_title: string; + contact_phone_number: string; +} +export declare class DependentHostedNumberOrderInstance { + protected _version: V2; + constructor(_version: V2, payload: DependentHostedNumberOrderResource, signingDocumentSid: string); + /** + * A 34 character string that uniquely identifies this Authorization Document + */ + sid: string; + /** + * A 34 character string that uniquely identifies the bulk hosting request associated with this HostedNumberOrder. + */ + bulkHostingRequestSid: string; + /** + * The next step you need to take to complete the hosted number order and request it successfully. + */ + nextStep: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + */ + incomingPhoneNumberSid: string; + /** + * A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. + */ + addressSid: string; + /** + * A 34 character string that uniquely identifies the LOA document associated with this HostedNumberOrder. + */ + signingDocumentSid: string; + /** + * An E164 formatted phone number hosted by this HostedNumberOrder. + */ + phoneNumber: string; + capabilities: PhoneNumberCapabilities; + /** + * A human readable description of this resource, up to 128 characters. + */ + friendlyName: string; + status: DependentHostedNumberOrderStatus; + /** + * A message that explains why a hosted_number_order went to status \"action-required\" + */ + failureReason: string; + /** + * The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * Email of the owner of this phone number that is being hosted. + */ + email: string; + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed + */ + ccEmails: Array; + /** + * The title of the person authorized to sign the Authorization Document for this phone number. + */ + contactTitle: string; + /** + * The contact phone number of the person authorized to sign the Authorization Document. + */ + contactPhoneNumber: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + bulkHostingRequestSid: string; + nextStep: string; + accountSid: string; + incomingPhoneNumberSid: string; + addressSid: string; + signingDocumentSid: string; + phoneNumber: string; + capabilities: PhoneNumberCapabilities; + friendlyName: string; + status: DependentHostedNumberOrderStatus; + failureReason: string; + dateCreated: Date; + dateUpdated: Date; + email: string; + ccEmails: string[]; + contactTitle: string; + contactPhoneNumber: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class DependentHostedNumberOrderPage extends Page { + /** + * Initialize the DependentHostedNumberOrderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: DependentHostedNumberOrderSolution); + /** + * Build an instance of DependentHostedNumberOrderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DependentHostedNumberOrderResource): DependentHostedNumberOrderInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.js b/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.js new file mode 100644 index 00000000..5dbbd41b --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.js @@ -0,0 +1,164 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DependentHostedNumberOrderPage = exports.DependentHostedNumberOrderInstance = exports.DependentHostedNumberOrderListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function DependentHostedNumberOrderListInstance(version, signingDocumentSid) { + if (!(0, utility_1.isValidPathParam)(signingDocumentSid)) { + throw new Error("Parameter 'signingDocumentSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { signingDocumentSid }; + instance._uri = `/HostedNumber/AuthorizationDocuments/${signingDocumentSid}/DependentHostedNumberOrders`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["incomingPhoneNumberSid"] !== undefined) + data["IncomingPhoneNumberSid"] = params["incomingPhoneNumberSid"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DependentHostedNumberOrderPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DependentHostedNumberOrderPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DependentHostedNumberOrderListInstance = DependentHostedNumberOrderListInstance; +class DependentHostedNumberOrderInstance { + constructor(_version, payload, signingDocumentSid) { + this._version = _version; + this.sid = payload.sid; + this.bulkHostingRequestSid = payload.bulk_hosting_request_sid; + this.nextStep = payload.next_step; + this.accountSid = payload.account_sid; + this.incomingPhoneNumberSid = payload.incoming_phone_number_sid; + this.addressSid = payload.address_sid; + this.signingDocumentSid = payload.signing_document_sid; + this.phoneNumber = payload.phone_number; + this.capabilities = payload.capabilities; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.failureReason = payload.failure_reason; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.email = payload.email; + this.ccEmails = payload.cc_emails; + this.contactTitle = payload.contact_title; + this.contactPhoneNumber = payload.contact_phone_number; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + bulkHostingRequestSid: this.bulkHostingRequestSid, + nextStep: this.nextStep, + accountSid: this.accountSid, + incomingPhoneNumberSid: this.incomingPhoneNumberSid, + addressSid: this.addressSid, + signingDocumentSid: this.signingDocumentSid, + phoneNumber: this.phoneNumber, + capabilities: this.capabilities, + friendlyName: this.friendlyName, + status: this.status, + failureReason: this.failureReason, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + email: this.email, + ccEmails: this.ccEmails, + contactTitle: this.contactTitle, + contactPhoneNumber: this.contactPhoneNumber, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DependentHostedNumberOrderInstance = DependentHostedNumberOrderInstance; +class DependentHostedNumberOrderPage extends Page_1.default { + /** + * Initialize the DependentHostedNumberOrderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DependentHostedNumberOrderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DependentHostedNumberOrderInstance(this._version, payload, this._solution.signingDocumentSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DependentHostedNumberOrderPage = DependentHostedNumberOrderPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.d.ts b/node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.d.ts new file mode 100644 index 00000000..7e5ad09f --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.d.ts @@ -0,0 +1,153 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +export type BulkHostedNumberOrderRequestStatus = "QUEUED" | "IN_PROGRESS" | "PROCESSED"; +/** + * Options to pass to fetch a BulkHostedNumberOrderInstance + */ +export interface BulkHostedNumberOrderContextFetchOptions { + /** Order status can be used for filtering on Hosted Number Order status values. To see a complete list of order statuses, please check \'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values\'. */ + orderStatus?: string; +} +export interface BulkHostedNumberOrderContext { + /** + * Fetch a BulkHostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BulkHostedNumberOrderInstance + */ + fetch(callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise; + /** + * Fetch a BulkHostedNumberOrderInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BulkHostedNumberOrderInstance + */ + fetch(params: BulkHostedNumberOrderContextFetchOptions, callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BulkHostedNumberOrderContextSolution { + bulkHostingSid: string; +} +export declare class BulkHostedNumberOrderContextImpl implements BulkHostedNumberOrderContext { + protected _version: V2; + protected _solution: BulkHostedNumberOrderContextSolution; + protected _uri: string; + constructor(_version: V2, bulkHostingSid: string); + fetch(params?: BulkHostedNumberOrderContextFetchOptions | ((error: Error | null, item?: BulkHostedNumberOrderInstance) => any), callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BulkHostedNumberOrderContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BulkHostedNumberOrderResource { + bulk_hosting_sid: string; + request_status: BulkHostedNumberOrderRequestStatus; + friendly_name: string; + notification_email: string; + date_created: Date; + date_completed: Date; + url: string; + total_count: number; + results: Array; +} +export declare class BulkHostedNumberOrderInstance { + protected _version: V2; + protected _solution: BulkHostedNumberOrderContextSolution; + protected _context?: BulkHostedNumberOrderContext; + constructor(_version: V2, payload: BulkHostedNumberOrderResource, bulkHostingSid?: string); + /** + * A 34 character string that uniquely identifies this BulkHostedNumberOrder. + */ + bulkHostingSid: string; + requestStatus: BulkHostedNumberOrderRequestStatus; + /** + * A 128 character string that is a human-readable text that describes this resource. + */ + friendlyName: string; + /** + * Email address used for send notifications about this Bulk hosted number request. + */ + notificationEmail: string; + /** + * The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date that this resource was completed, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCompleted: Date; + /** + * The URL of this BulkHostedNumberOrder resource. + */ + url: string; + /** + * The total count of phone numbers in this Bulk hosting request. + */ + totalCount: number; + /** + * Contains a list of all the individual hosting orders and their information, for this Bulk request. Each result object is grouped by its order status. To see a complete list of order status, please check \'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values\'. + */ + results: Array; + private get _proxy(); + /** + * Fetch a BulkHostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BulkHostedNumberOrderInstance + */ + fetch(callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise; + /** + * Fetch a BulkHostedNumberOrderInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BulkHostedNumberOrderInstance + */ + fetch(params: BulkHostedNumberOrderContextFetchOptions, callback?: (error: Error | null, item?: BulkHostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + bulkHostingSid: string; + requestStatus: BulkHostedNumberOrderRequestStatus; + friendlyName: string; + notificationEmail: string; + dateCreated: Date; + dateCompleted: Date; + url: string; + totalCount: number; + results: any[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BulkHostedNumberOrderSolution { +} +export interface BulkHostedNumberOrderListInstance { + _version: V2; + _solution: BulkHostedNumberOrderSolution; + _uri: string; + (bulkHostingSid: string): BulkHostedNumberOrderContext; + get(bulkHostingSid: string): BulkHostedNumberOrderContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BulkHostedNumberOrderListInstance(version: V2): BulkHostedNumberOrderListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.js b/node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.js new file mode 100644 index 00000000..833c252a --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/bulkHostedNumberOrder.js @@ -0,0 +1,128 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BulkHostedNumberOrderListInstance = exports.BulkHostedNumberOrderInstance = exports.BulkHostedNumberOrderContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class BulkHostedNumberOrderContextImpl { + constructor(_version, bulkHostingSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(bulkHostingSid)) { + throw new Error("Parameter 'bulkHostingSid' is not valid."); + } + this._solution = { bulkHostingSid }; + this._uri = `/HostedNumber/Orders/Bulk/${bulkHostingSid}`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["orderStatus"] !== undefined) + data["OrderStatus"] = params["orderStatus"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BulkHostedNumberOrderInstance(operationVersion, payload, instance._solution.bulkHostingSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BulkHostedNumberOrderContextImpl = BulkHostedNumberOrderContextImpl; +class BulkHostedNumberOrderInstance { + constructor(_version, payload, bulkHostingSid) { + this._version = _version; + this.bulkHostingSid = payload.bulk_hosting_sid; + this.requestStatus = payload.request_status; + this.friendlyName = payload.friendly_name; + this.notificationEmail = payload.notification_email; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateCompleted = deserialize.iso8601DateTime(payload.date_completed); + this.url = payload.url; + this.totalCount = deserialize.integer(payload.total_count); + this.results = payload.results; + this._solution = { bulkHostingSid: bulkHostingSid || this.bulkHostingSid }; + } + get _proxy() { + this._context = + this._context || + new BulkHostedNumberOrderContextImpl(this._version, this._solution.bulkHostingSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + bulkHostingSid: this.bulkHostingSid, + requestStatus: this.requestStatus, + friendlyName: this.friendlyName, + notificationEmail: this.notificationEmail, + dateCreated: this.dateCreated, + dateCompleted: this.dateCompleted, + url: this.url, + totalCount: this.totalCount, + results: this.results, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BulkHostedNumberOrderInstance = BulkHostedNumberOrderInstance; +function BulkHostedNumberOrderListInstance(version) { + const instance = ((bulkHostingSid) => instance.get(bulkHostingSid)); + instance.get = function get(bulkHostingSid) { + return new BulkHostedNumberOrderContextImpl(version, bulkHostingSid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BulkHostedNumberOrderListInstance = BulkHostedNumberOrderListInstance; diff --git a/node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.d.ts b/node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.d.ts new file mode 100644 index 00000000..31c56b7f --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.d.ts @@ -0,0 +1,384 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +import { PhoneNumberCapabilities } from "../../../interfaces"; +export type HostedNumberOrderStatus = "received" | "verified" | "pending-loa" | "carrier-processing" | "completed" | "failed" | "action-required"; +/** + * Options to pass to create a HostedNumberOrderInstance + */ +export interface HostedNumberOrderListInstanceCreateOptions { + /** The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format */ + phoneNumber: string; + /** The contact phone number of the person authorized to sign the Authorization Document. */ + contactPhoneNumber: string; + /** Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. */ + addressSid: string; + /** Optional. Email of the owner of this phone number that is being hosted. */ + email: string; + /** This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. */ + accountSid?: string; + /** A 128 character string that is a human readable text that describes this resource. */ + friendlyName?: string; + /** Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. */ + ccEmails?: Array; + /** The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. */ + smsUrl?: string; + /** The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */ + smsMethod?: string; + /** A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. */ + smsFallbackUrl?: string; + /** Used to specify that the SMS capability will be hosted on Twilio\\\'s platform. */ + smsCapability?: boolean; + /** The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */ + smsFallbackMethod?: string; + /** Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. */ + statusCallbackUrl?: string; + /** Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. */ + statusCallbackMethod?: string; + /** Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. */ + smsApplicationSid?: string; + /** The title of the person authorized to sign the Authorization Document for this phone number. */ + contactTitle?: string; +} +/** + * Options to pass to each + */ +export interface HostedNumberOrderListInstanceEachOptions { + /** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */ + status?: HostedNumberOrderStatus; + /** Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. */ + smsCapability?: boolean; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 128 characters. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface HostedNumberOrderListInstanceOptions { + /** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */ + status?: HostedNumberOrderStatus; + /** Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. */ + smsCapability?: boolean; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 128 characters. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface HostedNumberOrderListInstancePageOptions { + /** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */ + status?: HostedNumberOrderStatus; + /** Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. */ + smsCapability?: boolean; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 128 characters. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface HostedNumberOrderContext { + /** + * Remove a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + fetch(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface HostedNumberOrderContextSolution { + sid: string; +} +export declare class HostedNumberOrderContextImpl implements HostedNumberOrderContext { + protected _version: V2; + protected _solution: HostedNumberOrderContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): HostedNumberOrderContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface HostedNumberOrderPayload extends TwilioResponsePayload { + items: HostedNumberOrderResource[]; +} +interface HostedNumberOrderResource { + sid: string; + account_sid: string; + incoming_phone_number_sid: string; + address_sid: string; + signing_document_sid: string; + phone_number: string; + capabilities: PhoneNumberCapabilities; + friendly_name: string; + status: HostedNumberOrderStatus; + failure_reason: string; + date_created: Date; + date_updated: Date; + email: string; + cc_emails: Array; + url: string; + contact_title: string; + contact_phone_number: string; + bulk_hosting_request_sid: string; + next_step: string; +} +export declare class HostedNumberOrderInstance { + protected _version: V2; + protected _solution: HostedNumberOrderContextSolution; + protected _context?: HostedNumberOrderContext; + constructor(_version: V2, payload: HostedNumberOrderResource, sid?: string); + /** + * A 34 character string that uniquely identifies this HostedNumberOrder. + */ + sid: string; + /** + * A 34 character string that uniquely identifies the account. + */ + accountSid: string; + /** + * A 34 character string that uniquely identifies the [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the phone number being hosted. + */ + incomingPhoneNumberSid: string; + /** + * A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. + */ + addressSid: string; + /** + * A 34 character string that uniquely identifies the [Authorization Document](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource) the user needs to sign. + */ + signingDocumentSid: string; + /** + * Phone number to be hosted. This must be in [E.164](https://en.wikipedia.org/wiki/E.164) format, e.g., +16175551212 + */ + phoneNumber: string; + capabilities: PhoneNumberCapabilities; + /** + * A 128 character string that is a human-readable text that describes this resource. + */ + friendlyName: string; + status: HostedNumberOrderStatus; + /** + * A message that explains why a hosted_number_order went to status \"action-required\" + */ + failureReason: string; + /** + * The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * Email of the owner of this phone number that is being hosted. + */ + email: string; + /** + * A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. + */ + ccEmails: Array; + /** + * The URL of this HostedNumberOrder. + */ + url: string; + /** + * The title of the person authorized to sign the Authorization Document for this phone number. + */ + contactTitle: string; + /** + * The contact phone number of the person authorized to sign the Authorization Document. + */ + contactPhoneNumber: string; + /** + * A 34 character string that uniquely identifies the bulk hosting request associated with this HostedNumberOrder. + */ + bulkHostingRequestSid: string; + /** + * The next step you need to take to complete the hosted number order and request it successfully. + */ + nextStep: string; + private get _proxy(); + /** + * Remove a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + fetch(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + incomingPhoneNumberSid: string; + addressSid: string; + signingDocumentSid: string; + phoneNumber: string; + capabilities: PhoneNumberCapabilities; + friendlyName: string; + status: HostedNumberOrderStatus; + failureReason: string; + dateCreated: Date; + dateUpdated: Date; + email: string; + ccEmails: string[]; + url: string; + contactTitle: string; + contactPhoneNumber: string; + bulkHostingRequestSid: string; + nextStep: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface HostedNumberOrderSolution { +} +export interface HostedNumberOrderListInstance { + _version: V2; + _solution: HostedNumberOrderSolution; + _uri: string; + (sid: string): HostedNumberOrderContext; + get(sid: string): HostedNumberOrderContext; + /** + * Create a HostedNumberOrderInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + create(params: HostedNumberOrderListInstanceCreateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Streams HostedNumberOrderInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HostedNumberOrderListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void): void; + each(params: HostedNumberOrderListInstanceEachOptions, callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of HostedNumberOrderInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: HostedNumberOrderPage) => any): Promise; + /** + * Lists HostedNumberOrderInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HostedNumberOrderListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: HostedNumberOrderInstance[]) => any): Promise; + list(params: HostedNumberOrderListInstanceOptions, callback?: (error: Error | null, items: HostedNumberOrderInstance[]) => any): Promise; + /** + * Retrieve a single page of HostedNumberOrderInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HostedNumberOrderListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: HostedNumberOrderPage) => any): Promise; + page(params: HostedNumberOrderListInstancePageOptions, callback?: (error: Error | null, items: HostedNumberOrderPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function HostedNumberOrderListInstance(version: V2): HostedNumberOrderListInstance; +export declare class HostedNumberOrderPage extends Page { + /** + * Initialize the HostedNumberOrderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: HostedNumberOrderSolution); + /** + * Build an instance of HostedNumberOrderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: HostedNumberOrderResource): HostedNumberOrderInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.js b/node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.js new file mode 100644 index 00000000..b720036c --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/hostedNumberOrder.js @@ -0,0 +1,294 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HostedNumberOrderPage = exports.HostedNumberOrderListInstance = exports.HostedNumberOrderInstance = exports.HostedNumberOrderContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class HostedNumberOrderContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/HostedNumber/Orders/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new HostedNumberOrderInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.HostedNumberOrderContextImpl = HostedNumberOrderContextImpl; +class HostedNumberOrderInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.incomingPhoneNumberSid = payload.incoming_phone_number_sid; + this.addressSid = payload.address_sid; + this.signingDocumentSid = payload.signing_document_sid; + this.phoneNumber = payload.phone_number; + this.capabilities = payload.capabilities; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.failureReason = payload.failure_reason; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.email = payload.email; + this.ccEmails = payload.cc_emails; + this.url = payload.url; + this.contactTitle = payload.contact_title; + this.contactPhoneNumber = payload.contact_phone_number; + this.bulkHostingRequestSid = payload.bulk_hosting_request_sid; + this.nextStep = payload.next_step; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new HostedNumberOrderContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + incomingPhoneNumberSid: this.incomingPhoneNumberSid, + addressSid: this.addressSid, + signingDocumentSid: this.signingDocumentSid, + phoneNumber: this.phoneNumber, + capabilities: this.capabilities, + friendlyName: this.friendlyName, + status: this.status, + failureReason: this.failureReason, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + email: this.email, + ccEmails: this.ccEmails, + url: this.url, + contactTitle: this.contactTitle, + contactPhoneNumber: this.contactPhoneNumber, + bulkHostingRequestSid: this.bulkHostingRequestSid, + nextStep: this.nextStep, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.HostedNumberOrderInstance = HostedNumberOrderInstance; +function HostedNumberOrderListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new HostedNumberOrderContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/HostedNumber/Orders`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) { + throw new Error("Required parameter \"params['phoneNumber']\" missing."); + } + if (params["contactPhoneNumber"] === null || + params["contactPhoneNumber"] === undefined) { + throw new Error("Required parameter \"params['contactPhoneNumber']\" missing."); + } + if (params["addressSid"] === null || params["addressSid"] === undefined) { + throw new Error("Required parameter \"params['addressSid']\" missing."); + } + if (params["email"] === null || params["email"] === undefined) { + throw new Error("Required parameter \"params['email']\" missing."); + } + let data = {}; + data["PhoneNumber"] = params["phoneNumber"]; + data["ContactPhoneNumber"] = params["contactPhoneNumber"]; + data["AddressSid"] = params["addressSid"]; + data["Email"] = params["email"]; + if (params["accountSid"] !== undefined) + data["AccountSid"] = params["accountSid"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["ccEmails"] !== undefined) + data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e); + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsCapability"] !== undefined) + data["SmsCapability"] = serialize.bool(params["smsCapability"]); + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["statusCallbackUrl"] !== undefined) + data["StatusCallbackUrl"] = params["statusCallbackUrl"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["smsApplicationSid"] !== undefined) + data["SmsApplicationSid"] = params["smsApplicationSid"]; + if (params["contactTitle"] !== undefined) + data["ContactTitle"] = params["contactTitle"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new HostedNumberOrderInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["smsCapability"] !== undefined) + data["SmsCapability"] = serialize.bool(params["smsCapability"]); + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["incomingPhoneNumberSid"] !== undefined) + data["IncomingPhoneNumberSid"] = params["incomingPhoneNumberSid"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new HostedNumberOrderPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new HostedNumberOrderPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.HostedNumberOrderListInstance = HostedNumberOrderListInstance; +class HostedNumberOrderPage extends Page_1.default { + /** + * Initialize the HostedNumberOrderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of HostedNumberOrderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new HostedNumberOrderInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.HostedNumberOrderPage = HostedNumberOrderPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.d.ts new file mode 100644 index 00000000..c34d65e1 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.d.ts @@ -0,0 +1,35 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +import { BundleListInstance } from "./regulatoryCompliance/bundle"; +import { EndUserListInstance } from "./regulatoryCompliance/endUser"; +import { EndUserTypeListInstance } from "./regulatoryCompliance/endUserType"; +import { RegulationListInstance } from "./regulatoryCompliance/regulation"; +import { SupportingDocumentListInstance } from "./regulatoryCompliance/supportingDocument"; +import { SupportingDocumentTypeListInstance } from "./regulatoryCompliance/supportingDocumentType"; +export type RegulatoryComplianceEndUserType = "individual" | "business"; +export interface RegulatoryComplianceSolution { +} +export interface RegulatoryComplianceListInstance { + _version: V2; + _solution: RegulatoryComplianceSolution; + _uri: string; + _bundles?: BundleListInstance; + bundles: BundleListInstance; + _endUsers?: EndUserListInstance; + endUsers: EndUserListInstance; + _endUserTypes?: EndUserTypeListInstance; + endUserTypes: EndUserTypeListInstance; + _regulations?: RegulationListInstance; + regulations: RegulationListInstance; + _supportingDocuments?: SupportingDocumentListInstance; + supportingDocuments: SupportingDocumentListInstance; + _supportingDocumentTypes?: SupportingDocumentTypeListInstance; + supportingDocumentTypes: SupportingDocumentTypeListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RegulatoryComplianceListInstance(version: V2): RegulatoryComplianceListInstance; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.js new file mode 100644 index 00000000..f920a178 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance.js @@ -0,0 +1,87 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RegulatoryComplianceListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const bundle_1 = require("./regulatoryCompliance/bundle"); +const endUser_1 = require("./regulatoryCompliance/endUser"); +const endUserType_1 = require("./regulatoryCompliance/endUserType"); +const regulation_1 = require("./regulatoryCompliance/regulation"); +const supportingDocument_1 = require("./regulatoryCompliance/supportingDocument"); +const supportingDocumentType_1 = require("./regulatoryCompliance/supportingDocumentType"); +function RegulatoryComplianceListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/RegulatoryCompliance`; + Object.defineProperty(instance, "bundles", { + get: function bundles() { + if (!instance._bundles) { + instance._bundles = (0, bundle_1.BundleListInstance)(instance._version); + } + return instance._bundles; + }, + }); + Object.defineProperty(instance, "endUsers", { + get: function endUsers() { + if (!instance._endUsers) { + instance._endUsers = (0, endUser_1.EndUserListInstance)(instance._version); + } + return instance._endUsers; + }, + }); + Object.defineProperty(instance, "endUserTypes", { + get: function endUserTypes() { + if (!instance._endUserTypes) { + instance._endUserTypes = (0, endUserType_1.EndUserTypeListInstance)(instance._version); + } + return instance._endUserTypes; + }, + }); + Object.defineProperty(instance, "regulations", { + get: function regulations() { + if (!instance._regulations) { + instance._regulations = (0, regulation_1.RegulationListInstance)(instance._version); + } + return instance._regulations; + }, + }); + Object.defineProperty(instance, "supportingDocuments", { + get: function supportingDocuments() { + if (!instance._supportingDocuments) { + instance._supportingDocuments = (0, supportingDocument_1.SupportingDocumentListInstance)(instance._version); + } + return instance._supportingDocuments; + }, + }); + Object.defineProperty(instance, "supportingDocumentTypes", { + get: function supportingDocumentTypes() { + if (!instance._supportingDocumentTypes) { + instance._supportingDocumentTypes = (0, supportingDocumentType_1.SupportingDocumentTypeListInstance)(instance._version); + } + return instance._supportingDocumentTypes; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RegulatoryComplianceListInstance = RegulatoryComplianceListInstance; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts new file mode 100644 index 00000000..bc8d47c3 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts @@ -0,0 +1,445 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { BundleCopyListInstance } from "./bundle/bundleCopy"; +import { EvaluationListInstance } from "./bundle/evaluation"; +import { ItemAssignmentListInstance } from "./bundle/itemAssignment"; +import { ReplaceItemsListInstance } from "./bundle/replaceItems"; +export type BundleEndUserType = "individual" | "business"; +export type BundleSortBy = "valid-until" | "date-updated"; +export type BundleSortDirection = "ASC" | "DESC"; +export type BundleStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved" | "provisionally-approved"; +/** + * Options to pass to update a BundleInstance + */ +export interface BundleContextUpdateOptions { + /** */ + status?: BundleStatus; + /** The URL we call to inform your application of status changes. */ + statusCallback?: string; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The email address that will receive updates when the Bundle resource changes status. */ + email?: string; +} +/** + * Options to pass to create a BundleInstance + */ +export interface BundleListInstanceCreateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName: string; + /** The email address that will receive updates when the Bundle resource changes status. */ + email: string; + /** The URL we call to inform your application of status changes. */ + statusCallback?: string; + /** The unique string of a regulation that is associated to the Bundle resource. */ + regulationSid?: string; + /** The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle\\\'s phone number country ownership request. */ + isoCountry?: string; + /** */ + endUserType?: BundleEndUserType; + /** The type of phone number of the Bundle\\\'s ownership request. Can be `local`, `mobile`, `national`, or `toll free`. */ + numberType?: string; +} +/** + * Options to pass to each + */ +export interface BundleListInstanceEachOptions { + /** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */ + status?: BundleStatus; + /** The string that you assigned to describe the resource. The column can contain 255 variable characters. */ + friendlyName?: string; + /** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */ + regulationSid?: string; + /** The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle\'s phone number country ownership request. */ + isoCountry?: string; + /** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. */ + numberType?: string; + /** Indicates that the Bundle is a valid Bundle until a specified expiration date. */ + hasValidUntilDate?: boolean; + /** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */ + sortBy?: BundleSortBy; + /** Default is `DESC`. Can be `ASC` or `DESC`. */ + sortDirection?: BundleSortDirection; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDate?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateBefore?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BundleInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BundleListInstanceOptions { + /** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */ + status?: BundleStatus; + /** The string that you assigned to describe the resource. The column can contain 255 variable characters. */ + friendlyName?: string; + /** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */ + regulationSid?: string; + /** The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle\'s phone number country ownership request. */ + isoCountry?: string; + /** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. */ + numberType?: string; + /** Indicates that the Bundle is a valid Bundle until a specified expiration date. */ + hasValidUntilDate?: boolean; + /** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */ + sortBy?: BundleSortBy; + /** Default is `DESC`. Can be `ASC` or `DESC`. */ + sortDirection?: BundleSortDirection; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDate?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateBefore?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BundleListInstancePageOptions { + /** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */ + status?: BundleStatus; + /** The string that you assigned to describe the resource. The column can contain 255 variable characters. */ + friendlyName?: string; + /** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */ + regulationSid?: string; + /** The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle\'s phone number country ownership request. */ + isoCountry?: string; + /** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. */ + numberType?: string; + /** Indicates that the Bundle is a valid Bundle until a specified expiration date. */ + hasValidUntilDate?: boolean; + /** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */ + sortBy?: BundleSortBy; + /** Default is `DESC`. Can be `ASC` or `DESC`. */ + sortDirection?: BundleSortDirection; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDate?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateBefore?: Date; + /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ + validUntilDateAfter?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BundleContext { + bundleCopies: BundleCopyListInstance; + evaluations: EvaluationListInstance; + itemAssignments: ItemAssignmentListInstance; + replaceItems: ReplaceItemsListInstance; + /** + * Remove a BundleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BundleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleInstance + */ + fetch(callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + /** + * Update a BundleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleInstance + */ + update(callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + /** + * Update a BundleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleInstance + */ + update(params: BundleContextUpdateOptions, callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BundleContextSolution { + sid: string; +} +export declare class BundleContextImpl implements BundleContext { + protected _version: V2; + protected _solution: BundleContextSolution; + protected _uri: string; + protected _bundleCopies?: BundleCopyListInstance; + protected _evaluations?: EvaluationListInstance; + protected _itemAssignments?: ItemAssignmentListInstance; + protected _replaceItems?: ReplaceItemsListInstance; + constructor(_version: V2, sid: string); + get bundleCopies(): BundleCopyListInstance; + get evaluations(): EvaluationListInstance; + get itemAssignments(): ItemAssignmentListInstance; + get replaceItems(): ReplaceItemsListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + update(params?: BundleContextUpdateOptions | ((error: Error | null, item?: BundleInstance) => any), callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BundleContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BundlePayload extends TwilioResponsePayload { + results: BundleResource[]; +} +interface BundleResource { + sid: string; + account_sid: string; + regulation_sid: string; + friendly_name: string; + status: BundleStatus; + valid_until: Date; + email: string; + status_callback: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class BundleInstance { + protected _version: V2; + protected _solution: BundleContextSolution; + protected _context?: BundleContext; + constructor(_version: V2, payload: BundleResource, sid?: string); + /** + * The unique string that we created to identify the Bundle resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource. + */ + accountSid: string; + /** + * The unique string of a regulation that is associated to the Bundle resource. + */ + regulationSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + status: BundleStatus; + /** + * The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until. + */ + validUntil: Date; + /** + * The email address that will receive updates when the Bundle resource changes status. + */ + email: string; + /** + * The URL we call to inform your application of status changes. + */ + statusCallback: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Bundle resource. + */ + url: string; + /** + * The URLs of the Assigned Items of the Bundle resource. + */ + links: Record; + private get _proxy(); + /** + * Remove a BundleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BundleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleInstance + */ + fetch(callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + /** + * Update a BundleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleInstance + */ + update(callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + /** + * Update a BundleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleInstance + */ + update(params: BundleContextUpdateOptions, callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + /** + * Access the bundleCopies. + */ + bundleCopies(): BundleCopyListInstance; + /** + * Access the evaluations. + */ + evaluations(): EvaluationListInstance; + /** + * Access the itemAssignments. + */ + itemAssignments(): ItemAssignmentListInstance; + /** + * Access the replaceItems. + */ + replaceItems(): ReplaceItemsListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + regulationSid: string; + friendlyName: string; + status: BundleStatus; + validUntil: Date; + email: string; + statusCallback: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BundleSolution { +} +export interface BundleListInstance { + _version: V2; + _solution: BundleSolution; + _uri: string; + (sid: string): BundleContext; + get(sid: string): BundleContext; + /** + * Create a BundleInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleInstance + */ + create(params: BundleListInstanceCreateOptions, callback?: (error: Error | null, item?: BundleInstance) => any): Promise; + /** + * Streams BundleInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BundleListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BundleInstance, done: (err?: Error) => void) => void): void; + each(params: BundleListInstanceEachOptions, callback?: (item: BundleInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BundleInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BundlePage) => any): Promise; + /** + * Lists BundleInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BundleListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BundleInstance[]) => any): Promise; + list(params: BundleListInstanceOptions, callback?: (error: Error | null, items: BundleInstance[]) => any): Promise; + /** + * Retrieve a single page of BundleInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BundleListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BundlePage) => any): Promise; + page(params: BundleListInstancePageOptions, callback?: (error: Error | null, items: BundlePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BundleListInstance(version: V2): BundleListInstance; +export declare class BundlePage extends Page { + /** + * Initialize the BundlePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: BundleSolution); + /** + * Build an instance of BundleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BundleResource): BundleInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.js new file mode 100644 index 00000000..8b0163b8 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle.js @@ -0,0 +1,354 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BundlePage = exports.BundleListInstance = exports.BundleInstance = exports.BundleContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const bundleCopy_1 = require("./bundle/bundleCopy"); +const evaluation_1 = require("./bundle/evaluation"); +const itemAssignment_1 = require("./bundle/itemAssignment"); +const replaceItems_1 = require("./bundle/replaceItems"); +class BundleContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/RegulatoryCompliance/Bundles/${sid}`; + } + get bundleCopies() { + this._bundleCopies = + this._bundleCopies || + (0, bundleCopy_1.BundleCopyListInstance)(this._version, this._solution.sid); + return this._bundleCopies; + } + get evaluations() { + this._evaluations = + this._evaluations || + (0, evaluation_1.EvaluationListInstance)(this._version, this._solution.sid); + return this._evaluations; + } + get itemAssignments() { + this._itemAssignments = + this._itemAssignments || + (0, itemAssignment_1.ItemAssignmentListInstance)(this._version, this._solution.sid); + return this._itemAssignments; + } + get replaceItems() { + this._replaceItems = + this._replaceItems || + (0, replaceItems_1.ReplaceItemsListInstance)(this._version, this._solution.sid); + return this._replaceItems; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BundleInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BundleInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BundleContextImpl = BundleContextImpl; +class BundleInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.regulationSid = payload.regulation_sid; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.validUntil = deserialize.iso8601DateTime(payload.valid_until); + this.email = payload.email; + this.statusCallback = payload.status_callback; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new BundleContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a BundleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a BundleInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the bundleCopies. + */ + bundleCopies() { + return this._proxy.bundleCopies; + } + /** + * Access the evaluations. + */ + evaluations() { + return this._proxy.evaluations; + } + /** + * Access the itemAssignments. + */ + itemAssignments() { + return this._proxy.itemAssignments; + } + /** + * Access the replaceItems. + */ + replaceItems() { + return this._proxy.replaceItems; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + regulationSid: this.regulationSid, + friendlyName: this.friendlyName, + status: this.status, + validUntil: this.validUntil, + email: this.email, + statusCallback: this.statusCallback, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BundleInstance = BundleInstance; +function BundleListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new BundleContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/RegulatoryCompliance/Bundles`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["email"] === null || params["email"] === undefined) { + throw new Error("Required parameter \"params['email']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Email"] = params["email"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["regulationSid"] !== undefined) + data["RegulationSid"] = params["regulationSid"]; + if (params["isoCountry"] !== undefined) + data["IsoCountry"] = params["isoCountry"]; + if (params["endUserType"] !== undefined) + data["EndUserType"] = params["endUserType"]; + if (params["numberType"] !== undefined) + data["NumberType"] = params["numberType"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BundleInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["regulationSid"] !== undefined) + data["RegulationSid"] = params["regulationSid"]; + if (params["isoCountry"] !== undefined) + data["IsoCountry"] = params["isoCountry"]; + if (params["numberType"] !== undefined) + data["NumberType"] = params["numberType"]; + if (params["hasValidUntilDate"] !== undefined) + data["HasValidUntilDate"] = serialize.bool(params["hasValidUntilDate"]); + if (params["sortBy"] !== undefined) + data["SortBy"] = params["sortBy"]; + if (params["sortDirection"] !== undefined) + data["SortDirection"] = params["sortDirection"]; + if (params["validUntilDate"] !== undefined) + data["ValidUntilDate"] = serialize.iso8601DateTime(params["validUntilDate"]); + if (params["validUntilDateBefore"] !== undefined) + data["ValidUntilDate<"] = serialize.iso8601DateTime(params["validUntilDateBefore"]); + if (params["validUntilDateAfter"] !== undefined) + data["ValidUntilDate>"] = serialize.iso8601DateTime(params["validUntilDateAfter"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BundlePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BundlePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BundleListInstance = BundleListInstance; +class BundlePage extends Page_1.default { + /** + * Initialize the BundlePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BundleInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BundleInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BundlePage = BundlePage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts new file mode 100644 index 00000000..9816ac5e --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts @@ -0,0 +1,219 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type BundleCopyStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved" | "provisionally-approved"; +/** + * Options to pass to create a BundleCopyInstance + */ +export interface BundleCopyListInstanceCreateOptions { + /** The string that you assigned to describe the copied bundle. */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface BundleCopyListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BundleCopyListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BundleCopyListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BundleCopySolution { + bundleSid: string; +} +export interface BundleCopyListInstance { + _version: V2; + _solution: BundleCopySolution; + _uri: string; + /** + * Create a BundleCopyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleCopyInstance + */ + create(callback?: (error: Error | null, item?: BundleCopyInstance) => any): Promise; + /** + * Create a BundleCopyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BundleCopyInstance + */ + create(params: BundleCopyListInstanceCreateOptions, callback?: (error: Error | null, item?: BundleCopyInstance) => any): Promise; + /** + * Streams BundleCopyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BundleCopyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void): void; + each(params: BundleCopyListInstanceEachOptions, callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BundleCopyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BundleCopyPage) => any): Promise; + /** + * Lists BundleCopyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BundleCopyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BundleCopyInstance[]) => any): Promise; + list(params: BundleCopyListInstanceOptions, callback?: (error: Error | null, items: BundleCopyInstance[]) => any): Promise; + /** + * Retrieve a single page of BundleCopyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BundleCopyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BundleCopyPage) => any): Promise; + page(params: BundleCopyListInstancePageOptions, callback?: (error: Error | null, items: BundleCopyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BundleCopyListInstance(version: V2, bundleSid: string): BundleCopyListInstance; +interface BundleCopyPayload extends TwilioResponsePayload { + results: BundleCopyResource[]; +} +interface BundleCopyResource { + sid: string; + account_sid: string; + regulation_sid: string; + friendly_name: string; + status: BundleCopyStatus; + valid_until: Date; + email: string; + status_callback: string; + date_created: Date; + date_updated: Date; +} +export declare class BundleCopyInstance { + protected _version: V2; + constructor(_version: V2, payload: BundleCopyResource, bundleSid: string); + /** + * The unique string that we created to identify the Bundle resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource. + */ + accountSid: string; + /** + * The unique string of a regulation that is associated to the Bundle resource. + */ + regulationSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + status: BundleCopyStatus; + /** + * The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until. + */ + validUntil: Date; + /** + * The email address that will receive updates when the Bundle resource changes status. + */ + email: string; + /** + * The URL we call to inform your application of status changes. + */ + statusCallback: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + regulationSid: string; + friendlyName: string; + status: BundleCopyStatus; + validUntil: Date; + email: string; + statusCallback: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class BundleCopyPage extends Page { + /** + * Initialize the BundleCopyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: BundleCopySolution); + /** + * Build an instance of BundleCopyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BundleCopyResource): BundleCopyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js new file mode 100644 index 00000000..e6707157 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js @@ -0,0 +1,163 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BundleCopyPage = exports.BundleCopyInstance = exports.BundleCopyListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function BundleCopyListInstance(version, bundleSid) { + if (!(0, utility_1.isValidPathParam)(bundleSid)) { + throw new Error("Parameter 'bundleSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { bundleSid }; + instance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/Copies`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BundleCopyInstance(operationVersion, payload, instance._solution.bundleSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BundleCopyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BundleCopyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BundleCopyListInstance = BundleCopyListInstance; +class BundleCopyInstance { + constructor(_version, payload, bundleSid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.regulationSid = payload.regulation_sid; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.validUntil = deserialize.iso8601DateTime(payload.valid_until); + this.email = payload.email; + this.statusCallback = payload.status_callback; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + regulationSid: this.regulationSid, + friendlyName: this.friendlyName, + status: this.status, + validUntil: this.validUntil, + email: this.email, + statusCallback: this.statusCallback, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BundleCopyInstance = BundleCopyInstance; +class BundleCopyPage extends Page_1.default { + /** + * Initialize the BundleCopyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BundleCopyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BundleCopyInstance(this._version, payload, this._solution.bundleSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BundleCopyPage = BundleCopyPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.d.ts new file mode 100644 index 00000000..d662cfa2 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.d.ts @@ -0,0 +1,231 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type EvaluationStatus = "compliant" | "noncompliant"; +/** + * Options to pass to each + */ +export interface EvaluationListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EvaluationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EvaluationListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EvaluationListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EvaluationContext { + /** + * Fetch a EvaluationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EvaluationInstance + */ + fetch(callback?: (error: Error | null, item?: EvaluationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EvaluationContextSolution { + bundleSid: string; + sid: string; +} +export declare class EvaluationContextImpl implements EvaluationContext { + protected _version: V2; + protected _solution: EvaluationContextSolution; + protected _uri: string; + constructor(_version: V2, bundleSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: EvaluationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EvaluationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EvaluationPayload extends TwilioResponsePayload { + results: EvaluationResource[]; +} +interface EvaluationResource { + sid: string; + account_sid: string; + regulation_sid: string; + bundle_sid: string; + status: EvaluationStatus; + results: Array; + date_created: Date; + url: string; +} +export declare class EvaluationInstance { + protected _version: V2; + protected _solution: EvaluationContextSolution; + protected _context?: EvaluationContext; + constructor(_version: V2, payload: EvaluationResource, bundleSid: string, sid?: string); + /** + * The unique string that identifies the Evaluation resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource. + */ + accountSid: string; + /** + * The unique string of a regulation that is associated to the Bundle resource. + */ + regulationSid: string; + /** + * The unique string that we created to identify the Bundle resource. + */ + bundleSid: string; + status: EvaluationStatus; + /** + * The results of the Evaluation which includes the valid and invalid attributes. + */ + results: Array; + dateCreated: Date; + url: string; + private get _proxy(); + /** + * Fetch a EvaluationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EvaluationInstance + */ + fetch(callback?: (error: Error | null, item?: EvaluationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + regulationSid: string; + bundleSid: string; + status: EvaluationStatus; + results: any[]; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EvaluationSolution { + bundleSid: string; +} +export interface EvaluationListInstance { + _version: V2; + _solution: EvaluationSolution; + _uri: string; + (sid: string): EvaluationContext; + get(sid: string): EvaluationContext; + /** + * Create a EvaluationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EvaluationInstance + */ + create(callback?: (error: Error | null, item?: EvaluationInstance) => any): Promise; + /** + * Streams EvaluationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EvaluationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EvaluationInstance, done: (err?: Error) => void) => void): void; + each(params: EvaluationListInstanceEachOptions, callback?: (item: EvaluationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EvaluationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EvaluationPage) => any): Promise; + /** + * Lists EvaluationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EvaluationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EvaluationInstance[]) => any): Promise; + list(params: EvaluationListInstanceOptions, callback?: (error: Error | null, items: EvaluationInstance[]) => any): Promise; + /** + * Retrieve a single page of EvaluationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EvaluationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EvaluationPage) => any): Promise; + page(params: EvaluationListInstancePageOptions, callback?: (error: Error | null, items: EvaluationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EvaluationListInstance(version: V2, bundleSid: string): EvaluationListInstance; +export declare class EvaluationPage extends Page { + /** + * Initialize the EvaluationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: EvaluationSolution); + /** + * Build an instance of EvaluationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EvaluationResource): EvaluationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.js new file mode 100644 index 00000000..7fddc6be --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.js @@ -0,0 +1,200 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EvaluationPage = exports.EvaluationListInstance = exports.EvaluationInstance = exports.EvaluationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class EvaluationContextImpl { + constructor(_version, bundleSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(bundleSid)) { + throw new Error("Parameter 'bundleSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { bundleSid, sid }; + this._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/Evaluations/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EvaluationInstance(operationVersion, payload, instance._solution.bundleSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EvaluationContextImpl = EvaluationContextImpl; +class EvaluationInstance { + constructor(_version, payload, bundleSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.regulationSid = payload.regulation_sid; + this.bundleSid = payload.bundle_sid; + this.status = payload.status; + this.results = payload.results; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { bundleSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EvaluationContextImpl(this._version, this._solution.bundleSid, this._solution.sid); + return this._context; + } + /** + * Fetch a EvaluationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EvaluationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + regulationSid: this.regulationSid, + bundleSid: this.bundleSid, + status: this.status, + results: this.results, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EvaluationInstance = EvaluationInstance; +function EvaluationListInstance(version, bundleSid) { + if (!(0, utility_1.isValidPathParam)(bundleSid)) { + throw new Error("Parameter 'bundleSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EvaluationContextImpl(version, bundleSid, sid); + }; + instance._version = version; + instance._solution = { bundleSid }; + instance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/Evaluations`; + instance.create = function create(callback) { + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + }); + operationPromise = operationPromise.then((payload) => new EvaluationInstance(operationVersion, payload, instance._solution.bundleSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EvaluationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EvaluationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EvaluationListInstance = EvaluationListInstance; +class EvaluationPage extends Page_1.default { + /** + * Initialize the EvaluationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EvaluationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EvaluationInstance(this._version, payload, this._solution.bundleSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EvaluationPage = EvaluationPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.d.ts new file mode 100644 index 00000000..792633ae --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.d.ts @@ -0,0 +1,252 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +/** + * Options to pass to create a ItemAssignmentInstance + */ +export interface ItemAssignmentListInstanceCreateOptions { + /** The SID of an object bag that holds information of the different items. */ + objectSid: string; +} +/** + * Options to pass to each + */ +export interface ItemAssignmentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ItemAssignmentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ItemAssignmentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ItemAssignmentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ItemAssignmentContext { + /** + * Remove a ItemAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ItemAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ItemAssignmentInstance + */ + fetch(callback?: (error: Error | null, item?: ItemAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ItemAssignmentContextSolution { + bundleSid: string; + sid: string; +} +export declare class ItemAssignmentContextImpl implements ItemAssignmentContext { + protected _version: V2; + protected _solution: ItemAssignmentContextSolution; + protected _uri: string; + constructor(_version: V2, bundleSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ItemAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ItemAssignmentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ItemAssignmentPayload extends TwilioResponsePayload { + results: ItemAssignmentResource[]; +} +interface ItemAssignmentResource { + sid: string; + bundle_sid: string; + account_sid: string; + object_sid: string; + date_created: Date; + url: string; +} +export declare class ItemAssignmentInstance { + protected _version: V2; + protected _solution: ItemAssignmentContextSolution; + protected _context?: ItemAssignmentContext; + constructor(_version: V2, payload: ItemAssignmentResource, bundleSid: string, sid?: string); + /** + * The unique string that we created to identify the Item Assignment resource. + */ + sid: string; + /** + * The unique string that we created to identify the Bundle resource. + */ + bundleSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Item Assignment resource. + */ + accountSid: string; + /** + * The SID of an object bag that holds information of the different items. + */ + objectSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The absolute URL of the Identity resource. + */ + url: string; + private get _proxy(); + /** + * Remove a ItemAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ItemAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ItemAssignmentInstance + */ + fetch(callback?: (error: Error | null, item?: ItemAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + bundleSid: string; + accountSid: string; + objectSid: string; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ItemAssignmentSolution { + bundleSid: string; +} +export interface ItemAssignmentListInstance { + _version: V2; + _solution: ItemAssignmentSolution; + _uri: string; + (sid: string): ItemAssignmentContext; + get(sid: string): ItemAssignmentContext; + /** + * Create a ItemAssignmentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ItemAssignmentInstance + */ + create(params: ItemAssignmentListInstanceCreateOptions, callback?: (error: Error | null, item?: ItemAssignmentInstance) => any): Promise; + /** + * Streams ItemAssignmentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ItemAssignmentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ItemAssignmentInstance, done: (err?: Error) => void) => void): void; + each(params: ItemAssignmentListInstanceEachOptions, callback?: (item: ItemAssignmentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ItemAssignmentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ItemAssignmentPage) => any): Promise; + /** + * Lists ItemAssignmentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ItemAssignmentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ItemAssignmentInstance[]) => any): Promise; + list(params: ItemAssignmentListInstanceOptions, callback?: (error: Error | null, items: ItemAssignmentInstance[]) => any): Promise; + /** + * Retrieve a single page of ItemAssignmentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ItemAssignmentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ItemAssignmentPage) => any): Promise; + page(params: ItemAssignmentListInstancePageOptions, callback?: (error: Error | null, items: ItemAssignmentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ItemAssignmentListInstance(version: V2, bundleSid: string): ItemAssignmentListInstance; +export declare class ItemAssignmentPage extends Page { + /** + * Initialize the ItemAssignmentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ItemAssignmentSolution); + /** + * Build an instance of ItemAssignmentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ItemAssignmentResource): ItemAssignmentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.js new file mode 100644 index 00000000..87e6cce5 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.js @@ -0,0 +1,227 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ItemAssignmentPage = exports.ItemAssignmentListInstance = exports.ItemAssignmentInstance = exports.ItemAssignmentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class ItemAssignmentContextImpl { + constructor(_version, bundleSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(bundleSid)) { + throw new Error("Parameter 'bundleSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { bundleSid, sid }; + this._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/ItemAssignments/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ItemAssignmentInstance(operationVersion, payload, instance._solution.bundleSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ItemAssignmentContextImpl = ItemAssignmentContextImpl; +class ItemAssignmentInstance { + constructor(_version, payload, bundleSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.bundleSid = payload.bundle_sid; + this.accountSid = payload.account_sid; + this.objectSid = payload.object_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { bundleSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ItemAssignmentContextImpl(this._version, this._solution.bundleSid, this._solution.sid); + return this._context; + } + /** + * Remove a ItemAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ItemAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ItemAssignmentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + bundleSid: this.bundleSid, + accountSid: this.accountSid, + objectSid: this.objectSid, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ItemAssignmentInstance = ItemAssignmentInstance; +function ItemAssignmentListInstance(version, bundleSid) { + if (!(0, utility_1.isValidPathParam)(bundleSid)) { + throw new Error("Parameter 'bundleSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ItemAssignmentContextImpl(version, bundleSid, sid); + }; + instance._version = version; + instance._solution = { bundleSid }; + instance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/ItemAssignments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["objectSid"] === null || params["objectSid"] === undefined) { + throw new Error("Required parameter \"params['objectSid']\" missing."); + } + let data = {}; + data["ObjectSid"] = params["objectSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ItemAssignmentInstance(operationVersion, payload, instance._solution.bundleSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ItemAssignmentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ItemAssignmentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ItemAssignmentListInstance = ItemAssignmentListInstance; +class ItemAssignmentPage extends Page_1.default { + /** + * Initialize the ItemAssignmentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ItemAssignmentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ItemAssignmentInstance(this._version, payload, this._solution.bundleSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ItemAssignmentPage = ItemAssignmentPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts new file mode 100644 index 00000000..021afa86 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts @@ -0,0 +1,106 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../../V2"; +export type ReplaceItemsStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved" | "provisionally-approved"; +/** + * Options to pass to create a ReplaceItemsInstance + */ +export interface ReplaceItemsListInstanceCreateOptions { + /** The source bundle sid to copy the item assignments from. */ + fromBundleSid: string; +} +export interface ReplaceItemsSolution { + bundleSid: string; +} +export interface ReplaceItemsListInstance { + _version: V2; + _solution: ReplaceItemsSolution; + _uri: string; + /** + * Create a ReplaceItemsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReplaceItemsInstance + */ + create(params: ReplaceItemsListInstanceCreateOptions, callback?: (error: Error | null, item?: ReplaceItemsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ReplaceItemsListInstance(version: V2, bundleSid: string): ReplaceItemsListInstance; +interface ReplaceItemsResource { + sid: string; + account_sid: string; + regulation_sid: string; + friendly_name: string; + status: ReplaceItemsStatus; + valid_until: Date; + email: string; + status_callback: string; + date_created: Date; + date_updated: Date; +} +export declare class ReplaceItemsInstance { + protected _version: V2; + constructor(_version: V2, payload: ReplaceItemsResource, bundleSid: string); + /** + * The unique string that we created to identify the Bundle resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource. + */ + accountSid: string; + /** + * The unique string of a regulation that is associated to the Bundle resource. + */ + regulationSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + status: ReplaceItemsStatus; + /** + * The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until. + */ + validUntil: Date; + /** + * The email address that will receive updates when the Bundle resource changes status. + */ + email: string; + /** + * The URL we call to inform your application of status changes. + */ + statusCallback: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + regulationSid: string; + friendlyName: string; + status: ReplaceItemsStatus; + validUntil: Date; + email: string; + statusCallback: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js new file mode 100644 index 00000000..fd51d282 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js @@ -0,0 +1,97 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReplaceItemsInstance = exports.ReplaceItemsListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function ReplaceItemsListInstance(version, bundleSid) { + if (!(0, utility_1.isValidPathParam)(bundleSid)) { + throw new Error("Parameter 'bundleSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { bundleSid }; + instance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/ReplaceItems`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["fromBundleSid"] === null || + params["fromBundleSid"] === undefined) { + throw new Error("Required parameter \"params['fromBundleSid']\" missing."); + } + let data = {}; + data["FromBundleSid"] = params["fromBundleSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ReplaceItemsInstance(operationVersion, payload, instance._solution.bundleSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ReplaceItemsListInstance = ReplaceItemsListInstance; +class ReplaceItemsInstance { + constructor(_version, payload, bundleSid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.regulationSid = payload.regulation_sid; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.validUntil = deserialize.iso8601DateTime(payload.valid_until); + this.email = payload.email; + this.statusCallback = payload.status_callback; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + regulationSid: this.regulationSid, + friendlyName: this.friendlyName, + status: this.status, + validUntil: this.validUntil, + email: this.email, + statusCallback: this.statusCallback, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ReplaceItemsInstance = ReplaceItemsInstance; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.d.ts new file mode 100644 index 00000000..018efe1d --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.d.ts @@ -0,0 +1,308 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type EndUserType = "individual" | "business"; +/** + * Options to pass to update a EndUserInstance + */ +export interface EndUserContextUpdateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The set of parameters that are the attributes of the End User resource which are derived End User Types. */ + attributes?: any; +} +/** + * Options to pass to create a EndUserInstance + */ +export interface EndUserListInstanceCreateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName: string; + /** */ + type: EndUserType; + /** The set of parameters that are the attributes of the End User resource which are derived End User Types. */ + attributes?: any; +} +/** + * Options to pass to each + */ +export interface EndUserListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EndUserInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EndUserListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EndUserListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EndUserContext { + /** + * Remove a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + fetch(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Update a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + update(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Update a EndUserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + update(params: EndUserContextUpdateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EndUserContextSolution { + sid: string; +} +export declare class EndUserContextImpl implements EndUserContext { + protected _version: V2; + protected _solution: EndUserContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + update(params?: EndUserContextUpdateOptions | ((error: Error | null, item?: EndUserInstance) => any), callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EndUserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EndUserPayload extends TwilioResponsePayload { + results: EndUserResource[]; +} +interface EndUserResource { + sid: string; + account_sid: string; + friendly_name: string; + type: EndUserType; + attributes: any; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class EndUserInstance { + protected _version: V2; + protected _solution: EndUserContextSolution; + protected _context?: EndUserContext; + constructor(_version: V2, payload: EndUserResource, sid?: string); + /** + * The unique string created by Twilio to identify the End User resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the End User resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + type: EndUserType; + /** + * The set of parameters that are the attributes of the End Users resource which are listed in the End User Types. + */ + attributes: any; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the End User resource. + */ + url: string; + private get _proxy(); + /** + * Remove a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + fetch(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Update a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + update(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Update a EndUserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + update(params: EndUserContextUpdateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + type: EndUserType; + attributes: any; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EndUserSolution { +} +export interface EndUserListInstance { + _version: V2; + _solution: EndUserSolution; + _uri: string; + (sid: string): EndUserContext; + get(sid: string): EndUserContext; + /** + * Create a EndUserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + create(params: EndUserListInstanceCreateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Streams EndUserInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EndUserInstance, done: (err?: Error) => void) => void): void; + each(params: EndUserListInstanceEachOptions, callback?: (item: EndUserInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EndUserInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EndUserPage) => any): Promise; + /** + * Lists EndUserInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EndUserInstance[]) => any): Promise; + list(params: EndUserListInstanceOptions, callback?: (error: Error | null, items: EndUserInstance[]) => any): Promise; + /** + * Retrieve a single page of EndUserInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EndUserPage) => any): Promise; + page(params: EndUserListInstancePageOptions, callback?: (error: Error | null, items: EndUserPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EndUserListInstance(version: V2): EndUserListInstance; +export declare class EndUserPage extends Page { + /** + * Initialize the EndUserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: EndUserSolution); + /** + * Build an instance of EndUserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EndUserResource): EndUserInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.js new file mode 100644 index 00000000..88e6f544 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUser.js @@ -0,0 +1,261 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EndUserPage = exports.EndUserListInstance = exports.EndUserInstance = exports.EndUserContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class EndUserContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/RegulatoryCompliance/EndUsers/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EndUserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = serialize.object(params["attributes"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EndUserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserContextImpl = EndUserContextImpl; +class EndUserInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.attributes = payload.attributes; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EndUserContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + type: this.type, + attributes: this.attributes, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserInstance = EndUserInstance; +function EndUserListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EndUserContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/RegulatoryCompliance/EndUsers`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + if (params["attributes"] !== undefined) + data["Attributes"] = serialize.object(params["attributes"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EndUserInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EndUserPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EndUserPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EndUserListInstance = EndUserListInstance; +class EndUserPage extends Page_1.default { + /** + * Initialize the EndUserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EndUserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EndUserInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserPage = EndUserPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.d.ts new file mode 100644 index 00000000..3624c4ec --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.d.ts @@ -0,0 +1,211 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +/** + * Options to pass to each + */ +export interface EndUserTypeListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EndUserTypeListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EndUserTypeListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EndUserTypeContext { + /** + * Fetch a EndUserTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserTypeInstance + */ + fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EndUserTypeContextSolution { + sid: string; +} +export declare class EndUserTypeContextImpl implements EndUserTypeContext { + protected _version: V2; + protected _solution: EndUserTypeContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EndUserTypeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EndUserTypePayload extends TwilioResponsePayload { + end_user_types: EndUserTypeResource[]; +} +interface EndUserTypeResource { + sid: string; + friendly_name: string; + machine_name: string; + fields: Array; + url: string; +} +export declare class EndUserTypeInstance { + protected _version: V2; + protected _solution: EndUserTypeContextSolution; + protected _context?: EndUserTypeContext; + constructor(_version: V2, payload: EndUserTypeResource, sid?: string); + /** + * The unique string that identifies the End-User Type resource. + */ + sid: string; + /** + * A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc + */ + friendlyName: string; + /** + * A machine-readable description of the End-User Type resource. Examples can include first_name, last_name, email, business_name, etc. + */ + machineName: string; + /** + * The required information for creating an End-User. The required fields will change as regulatory needs change and will differ for businesses and individuals. + */ + fields: Array; + /** + * The absolute URL of the End-User Type resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a EndUserTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserTypeInstance + */ + fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + machineName: string; + fields: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EndUserTypeSolution { +} +export interface EndUserTypeListInstance { + _version: V2; + _solution: EndUserTypeSolution; + _uri: string; + (sid: string): EndUserTypeContext; + get(sid: string): EndUserTypeContext; + /** + * Streams EndUserTypeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserTypeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void): void; + each(params: EndUserTypeListInstanceEachOptions, callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EndUserTypeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EndUserTypePage) => any): Promise; + /** + * Lists EndUserTypeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserTypeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EndUserTypeInstance[]) => any): Promise; + list(params: EndUserTypeListInstanceOptions, callback?: (error: Error | null, items: EndUserTypeInstance[]) => any): Promise; + /** + * Retrieve a single page of EndUserTypeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserTypeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EndUserTypePage) => any): Promise; + page(params: EndUserTypeListInstancePageOptions, callback?: (error: Error | null, items: EndUserTypePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EndUserTypeListInstance(version: V2): EndUserTypeListInstance; +export declare class EndUserTypePage extends Page { + /** + * Initialize the EndUserTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: EndUserTypeSolution); + /** + * Build an instance of EndUserTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EndUserTypeResource): EndUserTypeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.js new file mode 100644 index 00000000..3c01d9d5 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/endUserType.js @@ -0,0 +1,179 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EndUserTypePage = exports.EndUserTypeListInstance = exports.EndUserTypeInstance = exports.EndUserTypeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class EndUserTypeContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/RegulatoryCompliance/EndUserTypes/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EndUserTypeInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserTypeContextImpl = EndUserTypeContextImpl; +class EndUserTypeInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.machineName = payload.machine_name; + this.fields = payload.fields; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EndUserTypeContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a EndUserTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserTypeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + machineName: this.machineName, + fields: this.fields, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserTypeInstance = EndUserTypeInstance; +function EndUserTypeListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EndUserTypeContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/RegulatoryCompliance/EndUserTypes`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EndUserTypePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EndUserTypePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EndUserTypeListInstance = EndUserTypeListInstance; +class EndUserTypePage extends Page_1.default { + /** + * Initialize the EndUserTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EndUserTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EndUserTypeInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserTypePage = EndUserTypePage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts new file mode 100644 index 00000000..f3338369 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts @@ -0,0 +1,239 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type RegulationEndUserType = "individual" | "business"; +/** + * Options to pass to each + */ +export interface RegulationListInstanceEachOptions { + /** The type of End User the regulation requires - can be `individual` or `business`. */ + endUserType?: RegulationEndUserType; + /** The ISO country code of the phone number\'s country. */ + isoCountry?: string; + /** The type of phone number that the regulatory requiremnt is restricting. */ + numberType?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RegulationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RegulationListInstanceOptions { + /** The type of End User the regulation requires - can be `individual` or `business`. */ + endUserType?: RegulationEndUserType; + /** The ISO country code of the phone number\'s country. */ + isoCountry?: string; + /** The type of phone number that the regulatory requiremnt is restricting. */ + numberType?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RegulationListInstancePageOptions { + /** The type of End User the regulation requires - can be `individual` or `business`. */ + endUserType?: RegulationEndUserType; + /** The ISO country code of the phone number\'s country. */ + isoCountry?: string; + /** The type of phone number that the regulatory requiremnt is restricting. */ + numberType?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RegulationContext { + /** + * Fetch a RegulationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RegulationInstance + */ + fetch(callback?: (error: Error | null, item?: RegulationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RegulationContextSolution { + sid: string; +} +export declare class RegulationContextImpl implements RegulationContext { + protected _version: V2; + protected _solution: RegulationContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + fetch(callback?: (error: Error | null, item?: RegulationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RegulationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RegulationPayload extends TwilioResponsePayload { + results: RegulationResource[]; +} +interface RegulationResource { + sid: string; + friendly_name: string; + iso_country: string; + number_type: string; + end_user_type: RegulationEndUserType; + requirements: any; + url: string; +} +export declare class RegulationInstance { + protected _version: V2; + protected _solution: RegulationContextSolution; + protected _context?: RegulationContext; + constructor(_version: V2, payload: RegulationResource, sid?: string); + /** + * The unique string that identifies the Regulation resource. + */ + sid: string; + /** + * A human-readable description that is assigned to describe the Regulation resource. Examples can include Germany: Mobile - Business. + */ + friendlyName: string; + /** + * The ISO country code of the phone number\'s country. + */ + isoCountry: string; + /** + * The type of phone number restricted by the regulatory requirement. For example, Germany mobile phone numbers provisioned by businesses require a business name with commercial register proof from the Handelsregisterauszug and a proof of address from Handelsregisterauszug or a trade license by Gewerbeanmeldung. + */ + numberType: string; + endUserType: RegulationEndUserType; + /** + * The SID of an object that holds the regulatory information of the phone number country, phone number type, and end user type. + */ + requirements: any; + /** + * The absolute URL of the Regulation resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a RegulationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RegulationInstance + */ + fetch(callback?: (error: Error | null, item?: RegulationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + isoCountry: string; + numberType: string; + endUserType: RegulationEndUserType; + requirements: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RegulationSolution { +} +export interface RegulationListInstance { + _version: V2; + _solution: RegulationSolution; + _uri: string; + (sid: string): RegulationContext; + get(sid: string): RegulationContext; + /** + * Streams RegulationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RegulationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RegulationInstance, done: (err?: Error) => void) => void): void; + each(params: RegulationListInstanceEachOptions, callback?: (item: RegulationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RegulationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RegulationPage) => any): Promise; + /** + * Lists RegulationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RegulationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RegulationInstance[]) => any): Promise; + list(params: RegulationListInstanceOptions, callback?: (error: Error | null, items: RegulationInstance[]) => any): Promise; + /** + * Retrieve a single page of RegulationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RegulationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RegulationPage) => any): Promise; + page(params: RegulationListInstancePageOptions, callback?: (error: Error | null, items: RegulationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RegulationListInstance(version: V2): RegulationListInstance; +export declare class RegulationPage extends Page { + /** + * Initialize the RegulationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: RegulationSolution); + /** + * Build an instance of RegulationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RegulationResource): RegulationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.js new file mode 100644 index 00000000..ca343c5b --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/regulation.js @@ -0,0 +1,189 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RegulationPage = exports.RegulationListInstance = exports.RegulationInstance = exports.RegulationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class RegulationContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/RegulatoryCompliance/Regulations/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RegulationInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RegulationContextImpl = RegulationContextImpl; +class RegulationInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.isoCountry = payload.iso_country; + this.numberType = payload.number_type; + this.endUserType = payload.end_user_type; + this.requirements = payload.requirements; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RegulationContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a RegulationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RegulationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + isoCountry: this.isoCountry, + numberType: this.numberType, + endUserType: this.endUserType, + requirements: this.requirements, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RegulationInstance = RegulationInstance; +function RegulationListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RegulationContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/RegulatoryCompliance/Regulations`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["endUserType"] !== undefined) + data["EndUserType"] = params["endUserType"]; + if (params["isoCountry"] !== undefined) + data["IsoCountry"] = params["isoCountry"]; + if (params["numberType"] !== undefined) + data["NumberType"] = params["numberType"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RegulationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RegulationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RegulationListInstance = RegulationListInstance; +class RegulationPage extends Page_1.default { + /** + * Initialize the RegulationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RegulationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RegulationInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RegulationPage = RegulationPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts new file mode 100644 index 00000000..2bcdeaee --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts @@ -0,0 +1,326 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type SupportingDocumentStatus = "draft" | "pending-review" | "rejected" | "approved" | "expired" | "provisionally-approved"; +/** + * Options to pass to update a SupportingDocumentInstance + */ +export interface SupportingDocumentContextUpdateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. */ + attributes?: any; +} +/** + * Options to pass to create a SupportingDocumentInstance + */ +export interface SupportingDocumentListInstanceCreateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName: string; + /** The type of the Supporting Document. */ + type: string; + /** The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. */ + attributes?: any; +} +/** + * Options to pass to each + */ +export interface SupportingDocumentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SupportingDocumentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SupportingDocumentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SupportingDocumentContext { + /** + * Remove a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + fetch(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Update a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + update(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Update a SupportingDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + update(params: SupportingDocumentContextUpdateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SupportingDocumentContextSolution { + sid: string; +} +export declare class SupportingDocumentContextImpl implements SupportingDocumentContext { + protected _version: V2; + protected _solution: SupportingDocumentContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + update(params?: SupportingDocumentContextUpdateOptions | ((error: Error | null, item?: SupportingDocumentInstance) => any), callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SupportingDocumentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SupportingDocumentPayload extends TwilioResponsePayload { + results: SupportingDocumentResource[]; +} +interface SupportingDocumentResource { + sid: string; + account_sid: string; + friendly_name: string; + mime_type: string; + status: SupportingDocumentStatus; + failure_reason: string; + type: string; + attributes: any; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class SupportingDocumentInstance { + protected _version: V2; + protected _solution: SupportingDocumentContextSolution; + protected _context?: SupportingDocumentContext; + constructor(_version: V2, payload: SupportingDocumentResource, sid?: string); + /** + * The unique string created by Twilio to identify the Supporting Document resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Document resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The image type uploaded in the Supporting Document container. + */ + mimeType: string; + status: SupportingDocumentStatus; + /** + * The failure reason of the Supporting Document Resource. + */ + failureReason: string; + /** + * The type of the Supporting Document. + */ + type: string; + /** + * The set of parameters that are the attributes of the Supporting Documents resource which are listed in the Supporting Document Types. + */ + attributes: any; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Supporting Document resource. + */ + url: string; + private get _proxy(); + /** + * Remove a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + fetch(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Update a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + update(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Update a SupportingDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + update(params: SupportingDocumentContextUpdateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + mimeType: string; + status: SupportingDocumentStatus; + failureReason: string; + type: string; + attributes: any; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SupportingDocumentSolution { +} +export interface SupportingDocumentListInstance { + _version: V2; + _solution: SupportingDocumentSolution; + _uri: string; + (sid: string): SupportingDocumentContext; + get(sid: string): SupportingDocumentContext; + /** + * Create a SupportingDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + create(params: SupportingDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Streams SupportingDocumentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void): void; + each(params: SupportingDocumentListInstanceEachOptions, callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SupportingDocumentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SupportingDocumentPage) => any): Promise; + /** + * Lists SupportingDocumentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SupportingDocumentInstance[]) => any): Promise; + list(params: SupportingDocumentListInstanceOptions, callback?: (error: Error | null, items: SupportingDocumentInstance[]) => any): Promise; + /** + * Retrieve a single page of SupportingDocumentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SupportingDocumentPage) => any): Promise; + page(params: SupportingDocumentListInstancePageOptions, callback?: (error: Error | null, items: SupportingDocumentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SupportingDocumentListInstance(version: V2): SupportingDocumentListInstance; +export declare class SupportingDocumentPage extends Page { + /** + * Initialize the SupportingDocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: SupportingDocumentSolution); + /** + * Build an instance of SupportingDocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SupportingDocumentResource): SupportingDocumentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js new file mode 100644 index 00000000..09a0d905 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js @@ -0,0 +1,267 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SupportingDocumentPage = exports.SupportingDocumentListInstance = exports.SupportingDocumentInstance = exports.SupportingDocumentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class SupportingDocumentContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/RegulatoryCompliance/SupportingDocuments/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = serialize.object(params["attributes"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentContextImpl = SupportingDocumentContextImpl; +class SupportingDocumentInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.mimeType = payload.mime_type; + this.status = payload.status; + this.failureReason = payload.failure_reason; + this.type = payload.type; + this.attributes = payload.attributes; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SupportingDocumentContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + mimeType: this.mimeType, + status: this.status, + failureReason: this.failureReason, + type: this.type, + attributes: this.attributes, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentInstance = SupportingDocumentInstance; +function SupportingDocumentListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SupportingDocumentContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/RegulatoryCompliance/SupportingDocuments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + if (params["attributes"] !== undefined) + data["Attributes"] = serialize.object(params["attributes"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SupportingDocumentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SupportingDocumentListInstance = SupportingDocumentListInstance; +class SupportingDocumentPage extends Page_1.default { + /** + * Initialize the SupportingDocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SupportingDocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SupportingDocumentInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentPage = SupportingDocumentPage; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.d.ts b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.d.ts new file mode 100644 index 00000000..fc13399f --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.d.ts @@ -0,0 +1,211 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +/** + * Options to pass to each + */ +export interface SupportingDocumentTypeListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SupportingDocumentTypeListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SupportingDocumentTypeListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SupportingDocumentTypeContext { + /** + * Fetch a SupportingDocumentTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentTypeInstance + */ + fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SupportingDocumentTypeContextSolution { + sid: string; +} +export declare class SupportingDocumentTypeContextImpl implements SupportingDocumentTypeContext { + protected _version: V2; + protected _solution: SupportingDocumentTypeContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SupportingDocumentTypeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SupportingDocumentTypePayload extends TwilioResponsePayload { + supporting_document_types: SupportingDocumentTypeResource[]; +} +interface SupportingDocumentTypeResource { + sid: string; + friendly_name: string; + machine_name: string; + fields: Array; + url: string; +} +export declare class SupportingDocumentTypeInstance { + protected _version: V2; + protected _solution: SupportingDocumentTypeContextSolution; + protected _context?: SupportingDocumentTypeContext; + constructor(_version: V2, payload: SupportingDocumentTypeResource, sid?: string); + /** + * The unique string that identifies the Supporting Document Type resource. + */ + sid: string; + /** + * A human-readable description of the Supporting Document Type resource. + */ + friendlyName: string; + /** + * The machine-readable description of the Supporting Document Type resource. + */ + machineName: string; + /** + * The required information for creating a Supporting Document. The required fields will change as regulatory needs change and will differ for businesses and individuals. + */ + fields: Array; + /** + * The absolute URL of the Supporting Document Type resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a SupportingDocumentTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentTypeInstance + */ + fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + machineName: string; + fields: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SupportingDocumentTypeSolution { +} +export interface SupportingDocumentTypeListInstance { + _version: V2; + _solution: SupportingDocumentTypeSolution; + _uri: string; + (sid: string): SupportingDocumentTypeContext; + get(sid: string): SupportingDocumentTypeContext; + /** + * Streams SupportingDocumentTypeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentTypeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void): void; + each(params: SupportingDocumentTypeListInstanceEachOptions, callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SupportingDocumentTypeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SupportingDocumentTypePage) => any): Promise; + /** + * Lists SupportingDocumentTypeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentTypeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SupportingDocumentTypeInstance[]) => any): Promise; + list(params: SupportingDocumentTypeListInstanceOptions, callback?: (error: Error | null, items: SupportingDocumentTypeInstance[]) => any): Promise; + /** + * Retrieve a single page of SupportingDocumentTypeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentTypeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SupportingDocumentTypePage) => any): Promise; + page(params: SupportingDocumentTypeListInstancePageOptions, callback?: (error: Error | null, items: SupportingDocumentTypePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SupportingDocumentTypeListInstance(version: V2): SupportingDocumentTypeListInstance; +export declare class SupportingDocumentTypePage extends Page { + /** + * Initialize the SupportingDocumentTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: SupportingDocumentTypeSolution); + /** + * Build an instance of SupportingDocumentTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SupportingDocumentTypeResource): SupportingDocumentTypeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.js b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.js new file mode 100644 index 00000000..c0cf1794 --- /dev/null +++ b/node_modules/twilio/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.js @@ -0,0 +1,179 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SupportingDocumentTypePage = exports.SupportingDocumentTypeListInstance = exports.SupportingDocumentTypeInstance = exports.SupportingDocumentTypeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class SupportingDocumentTypeContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/RegulatoryCompliance/SupportingDocumentTypes/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentTypeInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentTypeContextImpl = SupportingDocumentTypeContextImpl; +class SupportingDocumentTypeInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.machineName = payload.machine_name; + this.fields = payload.fields; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SupportingDocumentTypeContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a SupportingDocumentTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentTypeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + machineName: this.machineName, + fields: this.fields, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentTypeInstance = SupportingDocumentTypeInstance; +function SupportingDocumentTypeListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SupportingDocumentTypeContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/RegulatoryCompliance/SupportingDocumentTypes`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentTypePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SupportingDocumentTypePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SupportingDocumentTypeListInstance = SupportingDocumentTypeListInstance; +class SupportingDocumentTypePage extends Page_1.default { + /** + * Initialize the SupportingDocumentTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SupportingDocumentTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SupportingDocumentTypeInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentTypePage = SupportingDocumentTypePage; diff --git a/node_modules/twilio/lib/rest/preview/DeployedDevices.d.ts b/node_modules/twilio/lib/rest/preview/DeployedDevices.d.ts new file mode 100644 index 00000000..70c9650a --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/DeployedDevices.d.ts @@ -0,0 +1,15 @@ +import PreviewBase from "../PreviewBase"; +import Version from "../../base/Version"; +import { FleetListInstance } from "./deployed_devices/fleet"; +export default class DeployedDevices extends Version { + /** + * Initialize the DeployedDevices version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain: PreviewBase); + /** fleets - { Twilio.Preview.DeployedDevices.FleetListInstance } resource */ + protected _fleets?: FleetListInstance; + /** Getter for fleets resource */ + get fleets(): FleetListInstance; +} diff --git a/node_modules/twilio/lib/rest/preview/DeployedDevices.js b/node_modules/twilio/lib/rest/preview/DeployedDevices.js new file mode 100644 index 00000000..1f3906e5 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/DeployedDevices.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const fleet_1 = require("./deployed_devices/fleet"); +class DeployedDevices extends Version_1.default { + /** + * Initialize the DeployedDevices version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain) { + super(domain, "DeployedDevices"); + } + /** Getter for fleets resource */ + get fleets() { + this._fleets = this._fleets || (0, fleet_1.FleetListInstance)(this); + return this._fleets; + } +} +exports.default = DeployedDevices; diff --git a/node_modules/twilio/lib/rest/preview/HostedNumbers.d.ts b/node_modules/twilio/lib/rest/preview/HostedNumbers.d.ts new file mode 100644 index 00000000..14f2b31f --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/HostedNumbers.d.ts @@ -0,0 +1,20 @@ +import PreviewBase from "../PreviewBase"; +import Version from "../../base/Version"; +import { AuthorizationDocumentListInstance } from "./hosted_numbers/authorizationDocument"; +import { HostedNumberOrderListInstance } from "./hosted_numbers/hostedNumberOrder"; +export default class HostedNumbers extends Version { + /** + * Initialize the HostedNumbers version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain: PreviewBase); + /** authorizationDocuments - { Twilio.Preview.HostedNumbers.AuthorizationDocumentListInstance } resource */ + protected _authorizationDocuments?: AuthorizationDocumentListInstance; + /** hostedNumberOrders - { Twilio.Preview.HostedNumbers.HostedNumberOrderListInstance } resource */ + protected _hostedNumberOrders?: HostedNumberOrderListInstance; + /** Getter for authorizationDocuments resource */ + get authorizationDocuments(): AuthorizationDocumentListInstance; + /** Getter for hostedNumberOrders resource */ + get hostedNumberOrders(): HostedNumberOrderListInstance; +} diff --git a/node_modules/twilio/lib/rest/preview/HostedNumbers.js b/node_modules/twilio/lib/rest/preview/HostedNumbers.js new file mode 100644 index 00000000..a4a1a2b4 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/HostedNumbers.js @@ -0,0 +1,44 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const authorizationDocument_1 = require("./hosted_numbers/authorizationDocument"); +const hostedNumberOrder_1 = require("./hosted_numbers/hostedNumberOrder"); +class HostedNumbers extends Version_1.default { + /** + * Initialize the HostedNumbers version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain) { + super(domain, "HostedNumbers"); + } + /** Getter for authorizationDocuments resource */ + get authorizationDocuments() { + this._authorizationDocuments = + this._authorizationDocuments || (0, authorizationDocument_1.AuthorizationDocumentListInstance)(this); + return this._authorizationDocuments; + } + /** Getter for hostedNumberOrders resource */ + get hostedNumberOrders() { + this._hostedNumberOrders = + this._hostedNumberOrders || (0, hostedNumberOrder_1.HostedNumberOrderListInstance)(this); + return this._hostedNumberOrders; + } +} +exports.default = HostedNumbers; diff --git a/node_modules/twilio/lib/rest/preview/Marketplace.d.ts b/node_modules/twilio/lib/rest/preview/Marketplace.d.ts new file mode 100644 index 00000000..c251384c --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/Marketplace.d.ts @@ -0,0 +1,20 @@ +import PreviewBase from "../PreviewBase"; +import Version from "../../base/Version"; +import { AvailableAddOnListInstance } from "./marketplace/availableAddOn"; +import { InstalledAddOnListInstance } from "./marketplace/installedAddOn"; +export default class Marketplace extends Version { + /** + * Initialize the Marketplace version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain: PreviewBase); + /** availableAddOns - { Twilio.Preview.Marketplace.AvailableAddOnListInstance } resource */ + protected _availableAddOns?: AvailableAddOnListInstance; + /** installedAddOns - { Twilio.Preview.Marketplace.InstalledAddOnListInstance } resource */ + protected _installedAddOns?: InstalledAddOnListInstance; + /** Getter for availableAddOns resource */ + get availableAddOns(): AvailableAddOnListInstance; + /** Getter for installedAddOns resource */ + get installedAddOns(): InstalledAddOnListInstance; +} diff --git a/node_modules/twilio/lib/rest/preview/Marketplace.js b/node_modules/twilio/lib/rest/preview/Marketplace.js new file mode 100644 index 00000000..167fea74 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/Marketplace.js @@ -0,0 +1,44 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const availableAddOn_1 = require("./marketplace/availableAddOn"); +const installedAddOn_1 = require("./marketplace/installedAddOn"); +class Marketplace extends Version_1.default { + /** + * Initialize the Marketplace version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain) { + super(domain, "marketplace"); + } + /** Getter for availableAddOns resource */ + get availableAddOns() { + this._availableAddOns = + this._availableAddOns || (0, availableAddOn_1.AvailableAddOnListInstance)(this); + return this._availableAddOns; + } + /** Getter for installedAddOns resource */ + get installedAddOns() { + this._installedAddOns = + this._installedAddOns || (0, installedAddOn_1.InstalledAddOnListInstance)(this); + return this._installedAddOns; + } +} +exports.default = Marketplace; diff --git a/node_modules/twilio/lib/rest/preview/Sync.d.ts b/node_modules/twilio/lib/rest/preview/Sync.d.ts new file mode 100644 index 00000000..3a8c8961 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/Sync.d.ts @@ -0,0 +1,15 @@ +import PreviewBase from "../PreviewBase"; +import Version from "../../base/Version"; +import { ServiceListInstance } from "./sync/service"; +export default class Sync extends Version { + /** + * Initialize the Sync version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain: PreviewBase); + /** services - { Twilio.Preview.Sync.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/preview/Sync.js b/node_modules/twilio/lib/rest/preview/Sync.js new file mode 100644 index 00000000..d9ae13f9 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/Sync.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const service_1 = require("./sync/service"); +class Sync extends Version_1.default { + /** + * Initialize the Sync version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain) { + super(domain, "Sync"); + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = Sync; diff --git a/node_modules/twilio/lib/rest/preview/Wireless.d.ts b/node_modules/twilio/lib/rest/preview/Wireless.d.ts new file mode 100644 index 00000000..c0a018bd --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/Wireless.d.ts @@ -0,0 +1,25 @@ +import PreviewBase from "../PreviewBase"; +import Version from "../../base/Version"; +import { CommandListInstance } from "./wireless/command"; +import { RatePlanListInstance } from "./wireless/ratePlan"; +import { SimListInstance } from "./wireless/sim"; +export default class Wireless extends Version { + /** + * Initialize the Wireless version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain: PreviewBase); + /** commands - { Twilio.Preview.Wireless.CommandListInstance } resource */ + protected _commands?: CommandListInstance; + /** ratePlans - { Twilio.Preview.Wireless.RatePlanListInstance } resource */ + protected _ratePlans?: RatePlanListInstance; + /** sims - { Twilio.Preview.Wireless.SimListInstance } resource */ + protected _sims?: SimListInstance; + /** Getter for commands resource */ + get commands(): CommandListInstance; + /** Getter for ratePlans resource */ + get ratePlans(): RatePlanListInstance; + /** Getter for sims resource */ + get sims(): SimListInstance; +} diff --git a/node_modules/twilio/lib/rest/preview/Wireless.js b/node_modules/twilio/lib/rest/preview/Wireless.js new file mode 100644 index 00000000..d8c9dfef --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/Wireless.js @@ -0,0 +1,48 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const command_1 = require("./wireless/command"); +const ratePlan_1 = require("./wireless/ratePlan"); +const sim_1 = require("./wireless/sim"); +class Wireless extends Version_1.default { + /** + * Initialize the Wireless version of Preview + * + * @param domain - The Twilio (Twilio.Preview) domain + */ + constructor(domain) { + super(domain, "wireless"); + } + /** Getter for commands resource */ + get commands() { + this._commands = this._commands || (0, command_1.CommandListInstance)(this); + return this._commands; + } + /** Getter for ratePlans resource */ + get ratePlans() { + this._ratePlans = this._ratePlans || (0, ratePlan_1.RatePlanListInstance)(this); + return this._ratePlans; + } + /** Getter for sims resource */ + get sims() { + this._sims = this._sims || (0, sim_1.SimListInstance)(this); + return this._sims; + } +} +exports.default = Wireless; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet.d.ts b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet.d.ts new file mode 100644 index 00000000..e44e72dc --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet.d.ts @@ -0,0 +1,352 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import DeployedDevices from "../DeployedDevices"; +import { CertificateListInstance } from "./fleet/certificate"; +import { DeploymentListInstance } from "./fleet/deployment"; +import { DeviceListInstance } from "./fleet/device"; +import { KeyListInstance } from "./fleet/key"; +/** + * Options to pass to update a FleetInstance + */ +export interface FleetContextUpdateOptions { + /** Provides a human readable descriptive text for this Fleet, up to 256 characters long. */ + friendlyName?: string; + /** Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. */ + defaultDeploymentSid?: string; +} +/** + * Options to pass to create a FleetInstance + */ +export interface FleetListInstanceCreateOptions { + /** Provides a human readable descriptive text for this Fleet, up to 256 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface FleetListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FleetInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FleetListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FleetListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FleetContext { + certificates: CertificateListInstance; + deployments: DeploymentListInstance; + devices: DeviceListInstance; + keys: KeyListInstance; + /** + * Remove a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Update a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + update(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Update a FleetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + update(params: FleetContextUpdateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FleetContextSolution { + sid: string; +} +export declare class FleetContextImpl implements FleetContext { + protected _version: DeployedDevices; + protected _solution: FleetContextSolution; + protected _uri: string; + protected _certificates?: CertificateListInstance; + protected _deployments?: DeploymentListInstance; + protected _devices?: DeviceListInstance; + protected _keys?: KeyListInstance; + constructor(_version: DeployedDevices, sid: string); + get certificates(): CertificateListInstance; + get deployments(): DeploymentListInstance; + get devices(): DeviceListInstance; + get keys(): KeyListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + update(params?: FleetContextUpdateOptions | ((error: Error | null, item?: FleetInstance) => any), callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FleetContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FleetPayload extends TwilioResponsePayload { + fleets: FleetResource[]; +} +interface FleetResource { + sid: string; + url: string; + unique_name: string; + friendly_name: string; + account_sid: string; + default_deployment_sid: string; + date_created: Date; + date_updated: Date; + links: Record; +} +export declare class FleetInstance { + protected _version: DeployedDevices; + protected _solution: FleetContextSolution; + protected _context?: FleetContext; + constructor(_version: DeployedDevices, payload: FleetResource, sid?: string); + /** + * Contains a 34 character string that uniquely identifies this Fleet resource. + */ + sid: string; + /** + * Contains an absolute URL for this Fleet resource. + */ + url: string; + /** + * Contains a unique and addressable name of this Fleet, e.g. \'default\', up to 128 characters long. + */ + uniqueName: string; + /** + * Contains a human readable descriptive text for this Fleet, up to 256 characters long. + */ + friendlyName: string; + /** + * Speicifies the unique string identifier of the Account responsible for this Fleet. + */ + accountSid: string; + /** + * Contains the string identifier of the automatically provisioned default Deployment of this Fleet. + */ + defaultDeploymentSid: string; + /** + * Specifies the date this Fleet was created, given in UTC ISO 8601 format. + */ + dateCreated: Date; + /** + * Specifies the date this Fleet was last updated, given in UTC ISO 8601 format. + */ + dateUpdated: Date; + /** + * Contains a dictionary of URL links to nested resources of this Fleet. + */ + links: Record; + private get _proxy(); + /** + * Remove a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Update a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + update(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Update a FleetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + update(params: FleetContextUpdateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Access the certificates. + */ + certificates(): CertificateListInstance; + /** + * Access the deployments. + */ + deployments(): DeploymentListInstance; + /** + * Access the devices. + */ + devices(): DeviceListInstance; + /** + * Access the keys. + */ + keys(): KeyListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + url: string; + uniqueName: string; + friendlyName: string; + accountSid: string; + defaultDeploymentSid: string; + dateCreated: Date; + dateUpdated: Date; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FleetSolution { +} +export interface FleetListInstance { + _version: DeployedDevices; + _solution: FleetSolution; + _uri: string; + (sid: string): FleetContext; + get(sid: string): FleetContext; + /** + * Create a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + create(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Create a FleetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + create(params: FleetListInstanceCreateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Streams FleetInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FleetListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FleetInstance, done: (err?: Error) => void) => void): void; + each(params: FleetListInstanceEachOptions, callback?: (item: FleetInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FleetInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FleetPage) => any): Promise; + /** + * Lists FleetInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FleetListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FleetInstance[]) => any): Promise; + list(params: FleetListInstanceOptions, callback?: (error: Error | null, items: FleetInstance[]) => any): Promise; + /** + * Retrieve a single page of FleetInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FleetListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FleetPage) => any): Promise; + page(params: FleetListInstancePageOptions, callback?: (error: Error | null, items: FleetPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FleetListInstance(version: DeployedDevices): FleetListInstance; +export declare class FleetPage extends Page { + /** + * Initialize the FleetPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: DeployedDevices, response: Response, solution: FleetSolution); + /** + * Build an instance of FleetInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FleetResource): FleetInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet.js b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet.js new file mode 100644 index 00000000..b841fe9e --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet.js @@ -0,0 +1,307 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FleetPage = exports.FleetListInstance = exports.FleetInstance = exports.FleetContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const certificate_1 = require("./fleet/certificate"); +const deployment_1 = require("./fleet/deployment"); +const device_1 = require("./fleet/device"); +const key_1 = require("./fleet/key"); +class FleetContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Fleets/${sid}`; + } + get certificates() { + this._certificates = + this._certificates || + (0, certificate_1.CertificateListInstance)(this._version, this._solution.sid); + return this._certificates; + } + get deployments() { + this._deployments = + this._deployments || + (0, deployment_1.DeploymentListInstance)(this._version, this._solution.sid); + return this._deployments; + } + get devices() { + this._devices = + this._devices || (0, device_1.DeviceListInstance)(this._version, this._solution.sid); + return this._devices; + } + get keys() { + this._keys = + this._keys || (0, key_1.KeyListInstance)(this._version, this._solution.sid); + return this._keys; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["defaultDeploymentSid"] !== undefined) + data["DefaultDeploymentSid"] = params["defaultDeploymentSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FleetContextImpl = FleetContextImpl; +class FleetInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.url = payload.url; + this.uniqueName = payload.unique_name; + this.friendlyName = payload.friendly_name; + this.accountSid = payload.account_sid; + this.defaultDeploymentSid = payload.default_deployment_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new FleetContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the certificates. + */ + certificates() { + return this._proxy.certificates; + } + /** + * Access the deployments. + */ + deployments() { + return this._proxy.deployments; + } + /** + * Access the devices. + */ + devices() { + return this._proxy.devices; + } + /** + * Access the keys. + */ + keys() { + return this._proxy.keys; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + url: this.url, + uniqueName: this.uniqueName, + friendlyName: this.friendlyName, + accountSid: this.accountSid, + defaultDeploymentSid: this.defaultDeploymentSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FleetInstance = FleetInstance; +function FleetListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FleetContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Fleets`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FleetPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FleetPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FleetListInstance = FleetListInstance; +class FleetPage extends Page_1.default { + /** + * Initialize the FleetPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FleetInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FleetInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FleetPage = FleetPage; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/certificate.d.ts b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/certificate.d.ts new file mode 100644 index 00000000..df291756 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/certificate.d.ts @@ -0,0 +1,324 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import DeployedDevices from "../../DeployedDevices"; +/** + * Options to pass to update a CertificateInstance + */ +export interface CertificateContextUpdateOptions { + /** Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. */ + friendlyName?: string; + /** Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. */ + deviceSid?: string; +} +/** + * Options to pass to create a CertificateInstance + */ +export interface CertificateListInstanceCreateOptions { + /** Provides a URL encoded representation of the public certificate in PEM format. */ + certificateData: string; + /** Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. */ + friendlyName?: string; + /** Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. */ + deviceSid?: string; +} +/** + * Options to pass to each + */ +export interface CertificateListInstanceEachOptions { + /** Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. */ + deviceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CertificateInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CertificateListInstanceOptions { + /** Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. */ + deviceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CertificateListInstancePageOptions { + /** Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. */ + deviceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CertificateContext { + /** + * Remove a CertificateInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CertificateInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CertificateInstance + */ + fetch(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + /** + * Update a CertificateInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CertificateInstance + */ + update(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + /** + * Update a CertificateInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CertificateInstance + */ + update(params: CertificateContextUpdateOptions, callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CertificateContextSolution { + fleetSid: string; + sid: string; +} +export declare class CertificateContextImpl implements CertificateContext { + protected _version: DeployedDevices; + protected _solution: CertificateContextSolution; + protected _uri: string; + constructor(_version: DeployedDevices, fleetSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + update(params?: CertificateContextUpdateOptions | ((error: Error | null, item?: CertificateInstance) => any), callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CertificateContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CertificatePayload extends TwilioResponsePayload { + certificates: CertificateResource[]; +} +interface CertificateResource { + sid: string; + url: string; + friendly_name: string; + fleet_sid: string; + account_sid: string; + device_sid: string; + thumbprint: string; + date_created: Date; + date_updated: Date; +} +export declare class CertificateInstance { + protected _version: DeployedDevices; + protected _solution: CertificateContextSolution; + protected _context?: CertificateContext; + constructor(_version: DeployedDevices, payload: CertificateResource, fleetSid: string, sid?: string); + /** + * Contains a 34 character string that uniquely identifies this Certificate credential resource. + */ + sid: string; + /** + * Contains an absolute URL for this Certificate credential resource. + */ + url: string; + /** + * Contains a human readable descriptive text for this Certificate credential, up to 256 characters long. + */ + friendlyName: string; + /** + * Specifies the unique string identifier of the Fleet that the given Certificate credential belongs to. + */ + fleetSid: string; + /** + * Specifies the unique string identifier of the Account responsible for this Certificate credential. + */ + accountSid: string; + /** + * Specifies the unique string identifier of a Device authenticated with this Certificate credential. + */ + deviceSid: string; + /** + * Contains a unique hash of the payload of this Certificate credential, used to authenticate the Device. + */ + thumbprint: string; + /** + * Specifies the date this Certificate credential was created, given in UTC ISO 8601 format. + */ + dateCreated: Date; + /** + * Specifies the date this Certificate credential was last updated, given in UTC ISO 8601 format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a CertificateInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CertificateInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CertificateInstance + */ + fetch(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + /** + * Update a CertificateInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CertificateInstance + */ + update(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + /** + * Update a CertificateInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CertificateInstance + */ + update(params: CertificateContextUpdateOptions, callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + url: string; + friendlyName: string; + fleetSid: string; + accountSid: string; + deviceSid: string; + thumbprint: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CertificateSolution { + fleetSid: string; +} +export interface CertificateListInstance { + _version: DeployedDevices; + _solution: CertificateSolution; + _uri: string; + (sid: string): CertificateContext; + get(sid: string): CertificateContext; + /** + * Create a CertificateInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CertificateInstance + */ + create(params: CertificateListInstanceCreateOptions, callback?: (error: Error | null, item?: CertificateInstance) => any): Promise; + /** + * Streams CertificateInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CertificateListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CertificateInstance, done: (err?: Error) => void) => void): void; + each(params: CertificateListInstanceEachOptions, callback?: (item: CertificateInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CertificateInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CertificatePage) => any): Promise; + /** + * Lists CertificateInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CertificateListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CertificateInstance[]) => any): Promise; + list(params: CertificateListInstanceOptions, callback?: (error: Error | null, items: CertificateInstance[]) => any): Promise; + /** + * Retrieve a single page of CertificateInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CertificateListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CertificatePage) => any): Promise; + page(params: CertificateListInstancePageOptions, callback?: (error: Error | null, items: CertificatePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CertificateListInstance(version: DeployedDevices, fleetSid: string): CertificateListInstance; +export declare class CertificatePage extends Page { + /** + * Initialize the CertificatePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: DeployedDevices, response: Response, solution: CertificateSolution); + /** + * Build an instance of CertificateInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CertificateResource): CertificateInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/certificate.js b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/certificate.js new file mode 100644 index 00000000..04260307 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/certificate.js @@ -0,0 +1,269 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CertificatePage = exports.CertificateListInstance = exports.CertificateInstance = exports.CertificateContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class CertificateContextImpl { + constructor(_version, fleetSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(fleetSid)) { + throw new Error("Parameter 'fleetSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { fleetSid, sid }; + this._uri = `/Fleets/${fleetSid}/Certificates/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CertificateInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["deviceSid"] !== undefined) + data["DeviceSid"] = params["deviceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CertificateInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CertificateContextImpl = CertificateContextImpl; +class CertificateInstance { + constructor(_version, payload, fleetSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.url = payload.url; + this.friendlyName = payload.friendly_name; + this.fleetSid = payload.fleet_sid; + this.accountSid = payload.account_sid; + this.deviceSid = payload.device_sid; + this.thumbprint = payload.thumbprint; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { fleetSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CertificateContextImpl(this._version, this._solution.fleetSid, this._solution.sid); + return this._context; + } + /** + * Remove a CertificateInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CertificateInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CertificateInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + url: this.url, + friendlyName: this.friendlyName, + fleetSid: this.fleetSid, + accountSid: this.accountSid, + deviceSid: this.deviceSid, + thumbprint: this.thumbprint, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CertificateInstance = CertificateInstance; +function CertificateListInstance(version, fleetSid) { + if (!(0, utility_1.isValidPathParam)(fleetSid)) { + throw new Error("Parameter 'fleetSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CertificateContextImpl(version, fleetSid, sid); + }; + instance._version = version; + instance._solution = { fleetSid }; + instance._uri = `/Fleets/${fleetSid}/Certificates`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["certificateData"] === null || + params["certificateData"] === undefined) { + throw new Error("Required parameter \"params['certificateData']\" missing."); + } + let data = {}; + data["CertificateData"] = params["certificateData"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["deviceSid"] !== undefined) + data["DeviceSid"] = params["deviceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CertificateInstance(operationVersion, payload, instance._solution.fleetSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["deviceSid"] !== undefined) + data["DeviceSid"] = params["deviceSid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CertificatePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CertificatePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CertificateListInstance = CertificateListInstance; +class CertificatePage extends Page_1.default { + /** + * Initialize the CertificatePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CertificateInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CertificateInstance(this._version, payload, this._solution.fleetSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CertificatePage = CertificatePage; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/deployment.d.ts b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/deployment.d.ts new file mode 100644 index 00000000..e0b0f2bc --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/deployment.d.ts @@ -0,0 +1,318 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import DeployedDevices from "../../DeployedDevices"; +/** + * Options to pass to update a DeploymentInstance + */ +export interface DeploymentContextUpdateOptions { + /** Provides a human readable descriptive text for this Deployment, up to 64 characters long */ + friendlyName?: string; + /** Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. */ + syncServiceSid?: string; +} +/** + * Options to pass to create a DeploymentInstance + */ +export interface DeploymentListInstanceCreateOptions { + /** Provides a human readable descriptive text for this Deployment, up to 256 characters long. */ + friendlyName?: string; + /** Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. */ + syncServiceSid?: string; +} +/** + * Options to pass to each + */ +export interface DeploymentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DeploymentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DeploymentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DeploymentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DeploymentContext { + /** + * Remove a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + fetch(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Update a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + update(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Update a DeploymentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + update(params: DeploymentContextUpdateOptions, callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeploymentContextSolution { + fleetSid: string; + sid: string; +} +export declare class DeploymentContextImpl implements DeploymentContext { + protected _version: DeployedDevices; + protected _solution: DeploymentContextSolution; + protected _uri: string; + constructor(_version: DeployedDevices, fleetSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + update(params?: DeploymentContextUpdateOptions | ((error: Error | null, item?: DeploymentInstance) => any), callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeploymentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DeploymentPayload extends TwilioResponsePayload { + deployments: DeploymentResource[]; +} +interface DeploymentResource { + sid: string; + url: string; + friendly_name: string; + fleet_sid: string; + account_sid: string; + sync_service_sid: string; + date_created: Date; + date_updated: Date; +} +export declare class DeploymentInstance { + protected _version: DeployedDevices; + protected _solution: DeploymentContextSolution; + protected _context?: DeploymentContext; + constructor(_version: DeployedDevices, payload: DeploymentResource, fleetSid: string, sid?: string); + /** + * Contains a 34 character string that uniquely identifies this Deployment resource. + */ + sid: string; + /** + * Contains an absolute URL for this Deployment resource. + */ + url: string; + /** + * Contains a human readable descriptive text for this Deployment, up to 64 characters long + */ + friendlyName: string; + /** + * Specifies the unique string identifier of the Fleet that the given Deployment belongs to. + */ + fleetSid: string; + /** + * Specifies the unique string identifier of the Account responsible for this Deployment. + */ + accountSid: string; + /** + * Specifies the unique string identifier of the Twilio Sync service instance linked to and accessible by this Deployment. + */ + syncServiceSid: string; + /** + * Specifies the date this Deployment was created, given in UTC ISO 8601 format. + */ + dateCreated: Date; + /** + * Specifies the date this Deployment was last updated, given in UTC ISO 8601 format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + fetch(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Update a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + update(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Update a DeploymentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + update(params: DeploymentContextUpdateOptions, callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + url: string; + friendlyName: string; + fleetSid: string; + accountSid: string; + syncServiceSid: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeploymentSolution { + fleetSid: string; +} +export interface DeploymentListInstance { + _version: DeployedDevices; + _solution: DeploymentSolution; + _uri: string; + (sid: string): DeploymentContext; + get(sid: string): DeploymentContext; + /** + * Create a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + create(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Create a DeploymentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + create(params: DeploymentListInstanceCreateOptions, callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Streams DeploymentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeploymentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DeploymentInstance, done: (err?: Error) => void) => void): void; + each(params: DeploymentListInstanceEachOptions, callback?: (item: DeploymentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DeploymentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DeploymentPage) => any): Promise; + /** + * Lists DeploymentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeploymentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DeploymentInstance[]) => any): Promise; + list(params: DeploymentListInstanceOptions, callback?: (error: Error | null, items: DeploymentInstance[]) => any): Promise; + /** + * Retrieve a single page of DeploymentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeploymentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DeploymentPage) => any): Promise; + page(params: DeploymentListInstancePageOptions, callback?: (error: Error | null, items: DeploymentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeploymentListInstance(version: DeployedDevices, fleetSid: string): DeploymentListInstance; +export declare class DeploymentPage extends Page { + /** + * Initialize the DeploymentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: DeployedDevices, response: Response, solution: DeploymentSolution); + /** + * Build an instance of DeploymentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DeploymentResource): DeploymentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/deployment.js b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/deployment.js new file mode 100644 index 00000000..919ef396 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/deployment.js @@ -0,0 +1,264 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeploymentPage = exports.DeploymentListInstance = exports.DeploymentInstance = exports.DeploymentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class DeploymentContextImpl { + constructor(_version, fleetSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(fleetSid)) { + throw new Error("Parameter 'fleetSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { fleetSid, sid }; + this._uri = `/Fleets/${fleetSid}/Deployments/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DeploymentInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["syncServiceSid"] !== undefined) + data["SyncServiceSid"] = params["syncServiceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeploymentInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeploymentContextImpl = DeploymentContextImpl; +class DeploymentInstance { + constructor(_version, payload, fleetSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.url = payload.url; + this.friendlyName = payload.friendly_name; + this.fleetSid = payload.fleet_sid; + this.accountSid = payload.account_sid; + this.syncServiceSid = payload.sync_service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { fleetSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new DeploymentContextImpl(this._version, this._solution.fleetSid, this._solution.sid); + return this._context; + } + /** + * Remove a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + url: this.url, + friendlyName: this.friendlyName, + fleetSid: this.fleetSid, + accountSid: this.accountSid, + syncServiceSid: this.syncServiceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeploymentInstance = DeploymentInstance; +function DeploymentListInstance(version, fleetSid) { + if (!(0, utility_1.isValidPathParam)(fleetSid)) { + throw new Error("Parameter 'fleetSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DeploymentContextImpl(version, fleetSid, sid); + }; + instance._version = version; + instance._solution = { fleetSid }; + instance._uri = `/Fleets/${fleetSid}/Deployments`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["syncServiceSid"] !== undefined) + data["SyncServiceSid"] = params["syncServiceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeploymentInstance(operationVersion, payload, instance._solution.fleetSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeploymentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DeploymentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeploymentListInstance = DeploymentListInstance; +class DeploymentPage extends Page_1.default { + /** + * Initialize the DeploymentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DeploymentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DeploymentInstance(this._version, payload, this._solution.fleetSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeploymentPage = DeploymentPage; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/device.d.ts b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/device.d.ts new file mode 100644 index 00000000..b742b798 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/device.d.ts @@ -0,0 +1,358 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import DeployedDevices from "../../DeployedDevices"; +/** + * Options to pass to update a DeviceInstance + */ +export interface DeviceContextUpdateOptions { + /** Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. */ + friendlyName?: string; + /** Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. */ + identity?: string; + /** Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. */ + deploymentSid?: string; + /** */ + enabled?: boolean; +} +/** + * Options to pass to create a DeviceInstance + */ +export interface DeviceListInstanceCreateOptions { + /** Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. */ + uniqueName?: string; + /** Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. */ + friendlyName?: string; + /** Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. */ + identity?: string; + /** Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. */ + deploymentSid?: string; + /** */ + enabled?: boolean; +} +/** + * Options to pass to each + */ +export interface DeviceListInstanceEachOptions { + /** Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. */ + deploymentSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DeviceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DeviceListInstanceOptions { + /** Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. */ + deploymentSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DeviceListInstancePageOptions { + /** Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. */ + deploymentSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DeviceContext { + /** + * Remove a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + fetch(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Update a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + update(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Update a DeviceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + update(params: DeviceContextUpdateOptions, callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeviceContextSolution { + fleetSid: string; + sid: string; +} +export declare class DeviceContextImpl implements DeviceContext { + protected _version: DeployedDevices; + protected _solution: DeviceContextSolution; + protected _uri: string; + constructor(_version: DeployedDevices, fleetSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + update(params?: DeviceContextUpdateOptions | ((error: Error | null, item?: DeviceInstance) => any), callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeviceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DevicePayload extends TwilioResponsePayload { + devices: DeviceResource[]; +} +interface DeviceResource { + sid: string; + url: string; + unique_name: string; + friendly_name: string; + fleet_sid: string; + enabled: boolean; + account_sid: string; + identity: string; + deployment_sid: string; + date_created: Date; + date_updated: Date; + date_authenticated: Date; +} +export declare class DeviceInstance { + protected _version: DeployedDevices; + protected _solution: DeviceContextSolution; + protected _context?: DeviceContext; + constructor(_version: DeployedDevices, payload: DeviceResource, fleetSid: string, sid?: string); + /** + * Contains a 34 character string that uniquely identifies this Device resource. + */ + sid: string; + /** + * Contains an absolute URL for this Device resource. + */ + url: string; + /** + * Contains a unique and addressable name of this Device, assigned by the developer, up to 128 characters long. + */ + uniqueName: string; + /** + * Contains a human readable descriptive text for this Device, up to 256 characters long + */ + friendlyName: string; + /** + * Specifies the unique string identifier of the Fleet that the given Device belongs to. + */ + fleetSid: string; + /** + * Contains a boolean flag indicating whether the device is enabled or not, blocks device connectivity if set to false. + */ + enabled: boolean; + /** + * Specifies the unique string identifier of the Account responsible for this Device. + */ + accountSid: string; + /** + * Contains an arbitrary string identifier representing a human user associated with this Device, assigned by the developer, up to 256 characters long. + */ + identity: string; + /** + * Specifies the unique string identifier of the Deployment group that this Device is associated with. + */ + deploymentSid: string; + /** + * Specifies the date this Device was created, given in UTC ISO 8601 format. + */ + dateCreated: Date; + /** + * Specifies the date this Device was last updated, given in UTC ISO 8601 format. + */ + dateUpdated: Date; + /** + * Specifies the date this Device was last authenticated, given in UTC ISO 8601 format. + */ + dateAuthenticated: Date; + private get _proxy(); + /** + * Remove a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + fetch(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Update a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + update(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Update a DeviceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + update(params: DeviceContextUpdateOptions, callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + url: string; + uniqueName: string; + friendlyName: string; + fleetSid: string; + enabled: boolean; + accountSid: string; + identity: string; + deploymentSid: string; + dateCreated: Date; + dateUpdated: Date; + dateAuthenticated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeviceSolution { + fleetSid: string; +} +export interface DeviceListInstance { + _version: DeployedDevices; + _solution: DeviceSolution; + _uri: string; + (sid: string): DeviceContext; + get(sid: string): DeviceContext; + /** + * Create a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + create(callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Create a DeviceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + create(params: DeviceListInstanceCreateOptions, callback?: (error: Error | null, item?: DeviceInstance) => any): Promise; + /** + * Streams DeviceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DeviceInstance, done: (err?: Error) => void) => void): void; + each(params: DeviceListInstanceEachOptions, callback?: (item: DeviceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DeviceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DevicePage) => any): Promise; + /** + * Lists DeviceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DeviceInstance[]) => any): Promise; + list(params: DeviceListInstanceOptions, callback?: (error: Error | null, items: DeviceInstance[]) => any): Promise; + /** + * Retrieve a single page of DeviceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeviceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DevicePage) => any): Promise; + page(params: DeviceListInstancePageOptions, callback?: (error: Error | null, items: DevicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeviceListInstance(version: DeployedDevices, fleetSid: string): DeviceListInstance; +export declare class DevicePage extends Page { + /** + * Initialize the DevicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: DeployedDevices, response: Response, solution: DeviceSolution); + /** + * Build an instance of DeviceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DeviceResource): DeviceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/device.js b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/device.js new file mode 100644 index 00000000..b50dda76 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/device.js @@ -0,0 +1,284 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DevicePage = exports.DeviceListInstance = exports.DeviceInstance = exports.DeviceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class DeviceContextImpl { + constructor(_version, fleetSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(fleetSid)) { + throw new Error("Parameter 'fleetSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { fleetSid, sid }; + this._uri = `/Fleets/${fleetSid}/Devices/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DeviceInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["deploymentSid"] !== undefined) + data["DeploymentSid"] = params["deploymentSid"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceContextImpl = DeviceContextImpl; +class DeviceInstance { + constructor(_version, payload, fleetSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.url = payload.url; + this.uniqueName = payload.unique_name; + this.friendlyName = payload.friendly_name; + this.fleetSid = payload.fleet_sid; + this.enabled = payload.enabled; + this.accountSid = payload.account_sid; + this.identity = payload.identity; + this.deploymentSid = payload.deployment_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.dateAuthenticated = deserialize.iso8601DateTime(payload.date_authenticated); + this._solution = { fleetSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new DeviceContextImpl(this._version, this._solution.fleetSid, this._solution.sid); + return this._context; + } + /** + * Remove a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DeviceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeviceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + url: this.url, + uniqueName: this.uniqueName, + friendlyName: this.friendlyName, + fleetSid: this.fleetSid, + enabled: this.enabled, + accountSid: this.accountSid, + identity: this.identity, + deploymentSid: this.deploymentSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + dateAuthenticated: this.dateAuthenticated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeviceInstance = DeviceInstance; +function DeviceListInstance(version, fleetSid) { + if (!(0, utility_1.isValidPathParam)(fleetSid)) { + throw new Error("Parameter 'fleetSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DeviceContextImpl(version, fleetSid, sid); + }; + instance._version = version; + instance._solution = { fleetSid }; + instance._uri = `/Fleets/${fleetSid}/Devices`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["deploymentSid"] !== undefined) + data["DeploymentSid"] = params["deploymentSid"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeviceInstance(operationVersion, payload, instance._solution.fleetSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["deploymentSid"] !== undefined) + data["DeploymentSid"] = params["deploymentSid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DevicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DevicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeviceListInstance = DeviceListInstance; +class DevicePage extends Page_1.default { + /** + * Initialize the DevicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DeviceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DeviceInstance(this._version, payload, this._solution.fleetSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DevicePage = DevicePage; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/key.d.ts b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/key.d.ts new file mode 100644 index 00000000..8ee4f23a --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/key.d.ts @@ -0,0 +1,330 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import DeployedDevices from "../../DeployedDevices"; +/** + * Options to pass to update a KeyInstance + */ +export interface KeyContextUpdateOptions { + /** Provides a human readable descriptive text for this Key credential, up to 256 characters long. */ + friendlyName?: string; + /** Provides the unique string identifier of an existing Device to become authenticated with this Key credential. */ + deviceSid?: string; +} +/** + * Options to pass to create a KeyInstance + */ +export interface KeyListInstanceCreateOptions { + /** Provides a human readable descriptive text for this Key credential, up to 256 characters long. */ + friendlyName?: string; + /** Provides the unique string identifier of an existing Device to become authenticated with this Key credential. */ + deviceSid?: string; +} +/** + * Options to pass to each + */ +export interface KeyListInstanceEachOptions { + /** Filters the resulting list of Keys by a unique string identifier of an authenticated Device. */ + deviceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: KeyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface KeyListInstanceOptions { + /** Filters the resulting list of Keys by a unique string identifier of an authenticated Device. */ + deviceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface KeyListInstancePageOptions { + /** Filters the resulting list of Keys by a unique string identifier of an authenticated Device. */ + deviceSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface KeyContext { + /** + * Remove a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + fetch(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Update a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + update(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Update a KeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + update(params: KeyContextUpdateOptions, callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface KeyContextSolution { + fleetSid: string; + sid: string; +} +export declare class KeyContextImpl implements KeyContext { + protected _version: DeployedDevices; + protected _solution: KeyContextSolution; + protected _uri: string; + constructor(_version: DeployedDevices, fleetSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + update(params?: KeyContextUpdateOptions | ((error: Error | null, item?: KeyInstance) => any), callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): KeyContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface KeyPayload extends TwilioResponsePayload { + keys: KeyResource[]; +} +interface KeyResource { + sid: string; + url: string; + friendly_name: string; + fleet_sid: string; + account_sid: string; + device_sid: string; + secret: string; + date_created: Date; + date_updated: Date; +} +export declare class KeyInstance { + protected _version: DeployedDevices; + protected _solution: KeyContextSolution; + protected _context?: KeyContext; + constructor(_version: DeployedDevices, payload: KeyResource, fleetSid: string, sid?: string); + /** + * Contains a 34 character string that uniquely identifies this Key credential resource. + */ + sid: string; + /** + * Contains an absolute URL for this Key credential resource. + */ + url: string; + /** + * Contains a human readable descriptive text for this Key credential, up to 256 characters long. + */ + friendlyName: string; + /** + * Specifies the unique string identifier of the Fleet that the given Key credential belongs to. + */ + fleetSid: string; + /** + * Specifies the unique string identifier of the Account responsible for this Key credential. + */ + accountSid: string; + /** + * Specifies the unique string identifier of a Device authenticated with this Key credential. + */ + deviceSid: string; + /** + * Contains the automatically generated secret belonging to this Key credential, used to authenticate the Device. + */ + secret: string; + /** + * Specifies the date this Key credential was created, given in UTC ISO 8601 format. + */ + dateCreated: Date; + /** + * Specifies the date this Key credential was last updated, given in UTC ISO 8601 format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Remove a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + fetch(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Update a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + update(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Update a KeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + update(params: KeyContextUpdateOptions, callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + url: string; + friendlyName: string; + fleetSid: string; + accountSid: string; + deviceSid: string; + secret: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface KeySolution { + fleetSid: string; +} +export interface KeyListInstance { + _version: DeployedDevices; + _solution: KeySolution; + _uri: string; + (sid: string): KeyContext; + get(sid: string): KeyContext; + /** + * Create a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + create(callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Create a KeyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + create(params: KeyListInstanceCreateOptions, callback?: (error: Error | null, item?: KeyInstance) => any): Promise; + /** + * Streams KeyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { KeyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: KeyInstance, done: (err?: Error) => void) => void): void; + each(params: KeyListInstanceEachOptions, callback?: (item: KeyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of KeyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: KeyPage) => any): Promise; + /** + * Lists KeyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { KeyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: KeyInstance[]) => any): Promise; + list(params: KeyListInstanceOptions, callback?: (error: Error | null, items: KeyInstance[]) => any): Promise; + /** + * Retrieve a single page of KeyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { KeyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: KeyPage) => any): Promise; + page(params: KeyListInstancePageOptions, callback?: (error: Error | null, items: KeyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function KeyListInstance(version: DeployedDevices, fleetSid: string): KeyListInstance; +export declare class KeyPage extends Page { + /** + * Initialize the KeyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: DeployedDevices, response: Response, solution: KeySolution); + /** + * Build an instance of KeyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: KeyResource): KeyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/key.js b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/key.js new file mode 100644 index 00000000..65712ac5 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/deployed_devices/fleet/key.js @@ -0,0 +1,268 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KeyPage = exports.KeyListInstance = exports.KeyInstance = exports.KeyContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class KeyContextImpl { + constructor(_version, fleetSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(fleetSid)) { + throw new Error("Parameter 'fleetSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { fleetSid, sid }; + this._uri = `/Fleets/${fleetSid}/Keys/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new KeyInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["deviceSid"] !== undefined) + data["DeviceSid"] = params["deviceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new KeyInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.KeyContextImpl = KeyContextImpl; +class KeyInstance { + constructor(_version, payload, fleetSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.url = payload.url; + this.friendlyName = payload.friendly_name; + this.fleetSid = payload.fleet_sid; + this.accountSid = payload.account_sid; + this.deviceSid = payload.device_sid; + this.secret = payload.secret; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { fleetSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new KeyContextImpl(this._version, this._solution.fleetSid, this._solution.sid); + return this._context; + } + /** + * Remove a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a KeyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed KeyInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + url: this.url, + friendlyName: this.friendlyName, + fleetSid: this.fleetSid, + accountSid: this.accountSid, + deviceSid: this.deviceSid, + secret: this.secret, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.KeyInstance = KeyInstance; +function KeyListInstance(version, fleetSid) { + if (!(0, utility_1.isValidPathParam)(fleetSid)) { + throw new Error("Parameter 'fleetSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new KeyContextImpl(version, fleetSid, sid); + }; + instance._version = version; + instance._solution = { fleetSid }; + instance._uri = `/Fleets/${fleetSid}/Keys`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["deviceSid"] !== undefined) + data["DeviceSid"] = params["deviceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new KeyInstance(operationVersion, payload, instance._solution.fleetSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["deviceSid"] !== undefined) + data["DeviceSid"] = params["deviceSid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new KeyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new KeyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.KeyListInstance = KeyListInstance; +class KeyPage extends Page_1.default { + /** + * Initialize the KeyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of KeyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new KeyInstance(this._version, payload, this._solution.fleetSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.KeyPage = KeyPage; diff --git a/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument.d.ts b/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument.d.ts new file mode 100644 index 00000000..a42a0429 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument.d.ts @@ -0,0 +1,327 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import HostedNumbers from "../HostedNumbers"; +import { DependentHostedNumberOrderListInstance } from "./authorizationDocument/dependentHostedNumberOrder"; +export type AuthorizationDocumentStatus = "opened" | "signing" | "signed" | "canceled" | "failed"; +/** + * Options to pass to update a AuthorizationDocumentInstance + */ +export interface AuthorizationDocumentContextUpdateOptions { + /** A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio\\\'s platform. */ + hostedNumberOrderSids?: Array; + /** A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. */ + addressSid?: string; + /** Email that this AuthorizationDocument will be sent to for signing. */ + email?: string; + /** Email recipients who will be informed when an Authorization Document has been sent and signed */ + ccEmails?: Array; + /** */ + status?: AuthorizationDocumentStatus; + /** The title of the person authorized to sign the Authorization Document for this phone number. */ + contactTitle?: string; + /** The contact phone number of the person authorized to sign the Authorization Document. */ + contactPhoneNumber?: string; +} +/** + * Options to pass to create a AuthorizationDocumentInstance + */ +export interface AuthorizationDocumentListInstanceCreateOptions { + /** A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio\\\'s platform. */ + hostedNumberOrderSids: Array; + /** A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. */ + addressSid: string; + /** Email that this AuthorizationDocument will be sent to for signing. */ + email: string; + /** The title of the person authorized to sign the Authorization Document for this phone number. */ + contactTitle: string; + /** The contact phone number of the person authorized to sign the Authorization Document. */ + contactPhoneNumber: string; + /** Email recipients who will be informed when an Authorization Document has been sent and signed. */ + ccEmails?: Array; +} +/** + * Options to pass to each + */ +export interface AuthorizationDocumentListInstanceEachOptions { + /** Email that this AuthorizationDocument will be sent to for signing. */ + email?: string; + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: AuthorizationDocumentStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AuthorizationDocumentListInstanceOptions { + /** Email that this AuthorizationDocument will be sent to for signing. */ + email?: string; + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: AuthorizationDocumentStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AuthorizationDocumentListInstancePageOptions { + /** Email that this AuthorizationDocument will be sent to for signing. */ + email?: string; + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: AuthorizationDocumentStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AuthorizationDocumentContext { + dependentHostedNumberOrders: DependentHostedNumberOrderListInstance; + /** + * Fetch a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Update a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + update(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Update a AuthorizationDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + update(params: AuthorizationDocumentContextUpdateOptions, callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AuthorizationDocumentContextSolution { + sid: string; +} +export declare class AuthorizationDocumentContextImpl implements AuthorizationDocumentContext { + protected _version: HostedNumbers; + protected _solution: AuthorizationDocumentContextSolution; + protected _uri: string; + protected _dependentHostedNumberOrders?: DependentHostedNumberOrderListInstance; + constructor(_version: HostedNumbers, sid: string); + get dependentHostedNumberOrders(): DependentHostedNumberOrderListInstance; + fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + update(params?: AuthorizationDocumentContextUpdateOptions | ((error: Error | null, item?: AuthorizationDocumentInstance) => any), callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AuthorizationDocumentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AuthorizationDocumentPayload extends TwilioResponsePayload { + items: AuthorizationDocumentResource[]; +} +interface AuthorizationDocumentResource { + sid: string; + address_sid: string; + status: AuthorizationDocumentStatus; + email: string; + cc_emails: Array; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class AuthorizationDocumentInstance { + protected _version: HostedNumbers; + protected _solution: AuthorizationDocumentContextSolution; + protected _context?: AuthorizationDocumentContext; + constructor(_version: HostedNumbers, payload: AuthorizationDocumentResource, sid?: string); + /** + * A 34 character string that uniquely identifies this AuthorizationDocument. + */ + sid: string; + /** + * A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + */ + addressSid: string; + status: AuthorizationDocumentStatus; + /** + * Email that this AuthorizationDocument will be sent to for signing. + */ + email: string; + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed. + */ + ccEmails: Array; + /** + * The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + url: string; + links: Record; + private get _proxy(); + /** + * Fetch a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Update a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + update(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Update a AuthorizationDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + update(params: AuthorizationDocumentContextUpdateOptions, callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Access the dependentHostedNumberOrders. + */ + dependentHostedNumberOrders(): DependentHostedNumberOrderListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + addressSid: string; + status: AuthorizationDocumentStatus; + email: string; + ccEmails: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AuthorizationDocumentSolution { +} +export interface AuthorizationDocumentListInstance { + _version: HostedNumbers; + _solution: AuthorizationDocumentSolution; + _uri: string; + (sid: string): AuthorizationDocumentContext; + get(sid: string): AuthorizationDocumentContext; + /** + * Create a AuthorizationDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + create(params: AuthorizationDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise; + /** + * Streams AuthorizationDocumentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizationDocumentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void; + each(params: AuthorizationDocumentListInstanceEachOptions, callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AuthorizationDocumentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise; + /** + * Lists AuthorizationDocumentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizationDocumentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AuthorizationDocumentInstance[]) => any): Promise; + list(params: AuthorizationDocumentListInstanceOptions, callback?: (error: Error | null, items: AuthorizationDocumentInstance[]) => any): Promise; + /** + * Retrieve a single page of AuthorizationDocumentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AuthorizationDocumentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise; + page(params: AuthorizationDocumentListInstancePageOptions, callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AuthorizationDocumentListInstance(version: HostedNumbers): AuthorizationDocumentListInstance; +export declare class AuthorizationDocumentPage extends Page { + /** + * Initialize the AuthorizationDocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: HostedNumbers, response: Response, solution: AuthorizationDocumentSolution); + /** + * Build an instance of AuthorizationDocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AuthorizationDocumentResource): AuthorizationDocumentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument.js b/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument.js new file mode 100644 index 00000000..3c1741c6 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument.js @@ -0,0 +1,285 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthorizationDocumentPage = exports.AuthorizationDocumentListInstance = exports.AuthorizationDocumentInstance = exports.AuthorizationDocumentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const dependentHostedNumberOrder_1 = require("./authorizationDocument/dependentHostedNumberOrder"); +class AuthorizationDocumentContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/AuthorizationDocuments/${sid}`; + } + get dependentHostedNumberOrders() { + this._dependentHostedNumberOrders = + this._dependentHostedNumberOrders || + (0, dependentHostedNumberOrder_1.DependentHostedNumberOrderListInstance)(this._version, this._solution.sid); + return this._dependentHostedNumberOrders; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AuthorizationDocumentInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["hostedNumberOrderSids"] !== undefined) + data["HostedNumberOrderSids"] = serialize.map(params["hostedNumberOrderSids"], (e) => e); + if (params["addressSid"] !== undefined) + data["AddressSid"] = params["addressSid"]; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + if (params["ccEmails"] !== undefined) + data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e); + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["contactTitle"] !== undefined) + data["ContactTitle"] = params["contactTitle"]; + if (params["contactPhoneNumber"] !== undefined) + data["ContactPhoneNumber"] = params["contactPhoneNumber"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthorizationDocumentInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizationDocumentContextImpl = AuthorizationDocumentContextImpl; +class AuthorizationDocumentInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.addressSid = payload.address_sid; + this.status = payload.status; + this.email = payload.email; + this.ccEmails = payload.cc_emails; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AuthorizationDocumentContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a AuthorizationDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AuthorizationDocumentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the dependentHostedNumberOrders. + */ + dependentHostedNumberOrders() { + return this._proxy.dependentHostedNumberOrders; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + addressSid: this.addressSid, + status: this.status, + email: this.email, + ccEmails: this.ccEmails, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizationDocumentInstance = AuthorizationDocumentInstance; +function AuthorizationDocumentListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AuthorizationDocumentContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/AuthorizationDocuments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["hostedNumberOrderSids"] === null || + params["hostedNumberOrderSids"] === undefined) { + throw new Error("Required parameter \"params['hostedNumberOrderSids']\" missing."); + } + if (params["addressSid"] === null || params["addressSid"] === undefined) { + throw new Error("Required parameter \"params['addressSid']\" missing."); + } + if (params["email"] === null || params["email"] === undefined) { + throw new Error("Required parameter \"params['email']\" missing."); + } + if (params["contactTitle"] === null || + params["contactTitle"] === undefined) { + throw new Error("Required parameter \"params['contactTitle']\" missing."); + } + if (params["contactPhoneNumber"] === null || + params["contactPhoneNumber"] === undefined) { + throw new Error("Required parameter \"params['contactPhoneNumber']\" missing."); + } + let data = {}; + data["HostedNumberOrderSids"] = serialize.map(params["hostedNumberOrderSids"], (e) => e); + data["AddressSid"] = params["addressSid"]; + data["Email"] = params["email"]; + data["ContactTitle"] = params["contactTitle"]; + data["ContactPhoneNumber"] = params["contactPhoneNumber"]; + if (params["ccEmails"] !== undefined) + data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthorizationDocumentInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AuthorizationDocumentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AuthorizationDocumentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AuthorizationDocumentListInstance = AuthorizationDocumentListInstance; +class AuthorizationDocumentPage extends Page_1.default { + /** + * Initialize the AuthorizationDocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AuthorizationDocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AuthorizationDocumentInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AuthorizationDocumentPage = AuthorizationDocumentPage; diff --git a/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.d.ts b/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.d.ts new file mode 100644 index 00000000..f812f4ce --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.d.ts @@ -0,0 +1,293 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import HostedNumbers from "../../HostedNumbers"; +import { PhoneNumberCapabilities } from "../../../../interfaces"; +export type DependentHostedNumberOrderStatus = "received" | "pending-verification" | "verified" | "pending-loa" | "carrier-processing" | "testing" | "completed" | "failed" | "action-required"; +export type DependentHostedNumberOrderVerificationType = "phone-call" | "phone-bill"; +/** + * Options to pass to each + */ +export interface DependentHostedNumberOrderListInstanceEachOptions { + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: DependentHostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; + /** Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DependentHostedNumberOrderListInstanceOptions { + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: DependentHostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; + /** Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DependentHostedNumberOrderListInstancePageOptions { + /** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ + status?: DependentHostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; + /** Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DependentHostedNumberOrderSolution { + signingDocumentSid: string; +} +export interface DependentHostedNumberOrderListInstance { + _version: HostedNumbers; + _solution: DependentHostedNumberOrderSolution; + _uri: string; + /** + * Streams DependentHostedNumberOrderInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentHostedNumberOrderListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void): void; + each(params: DependentHostedNumberOrderListInstanceEachOptions, callback?: (item: DependentHostedNumberOrderInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DependentHostedNumberOrderInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DependentHostedNumberOrderPage) => any): Promise; + /** + * Lists DependentHostedNumberOrderInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentHostedNumberOrderListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DependentHostedNumberOrderInstance[]) => any): Promise; + list(params: DependentHostedNumberOrderListInstanceOptions, callback?: (error: Error | null, items: DependentHostedNumberOrderInstance[]) => any): Promise; + /** + * Retrieve a single page of DependentHostedNumberOrderInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DependentHostedNumberOrderListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DependentHostedNumberOrderPage) => any): Promise; + page(params: DependentHostedNumberOrderListInstancePageOptions, callback?: (error: Error | null, items: DependentHostedNumberOrderPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DependentHostedNumberOrderListInstance(version: HostedNumbers, signingDocumentSid: string): DependentHostedNumberOrderListInstance; +interface DependentHostedNumberOrderPayload extends TwilioResponsePayload { + items: DependentHostedNumberOrderResource[]; +} +interface DependentHostedNumberOrderResource { + sid: string; + account_sid: string; + incoming_phone_number_sid: string; + address_sid: string; + signing_document_sid: string; + phone_number: string; + capabilities: PhoneNumberCapabilities; + friendly_name: string; + unique_name: string; + status: DependentHostedNumberOrderStatus; + failure_reason: string; + date_created: Date; + date_updated: Date; + verification_attempts: number; + email: string; + cc_emails: Array; + verification_type: DependentHostedNumberOrderVerificationType; + verification_document_sid: string; + extension: string; + call_delay: number; + verification_code: string; + verification_call_sids: Array; +} +export declare class DependentHostedNumberOrderInstance { + protected _version: HostedNumbers; + constructor(_version: HostedNumbers, payload: DependentHostedNumberOrderResource, signingDocumentSid: string); + /** + * A 34 character string that uniquely identifies this Authorization Document + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + */ + incomingPhoneNumberSid: string; + /** + * A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. + */ + addressSid: string; + /** + * A 34 character string that uniquely identifies the LOA document associated with this HostedNumberOrder. + */ + signingDocumentSid: string; + /** + * An E164 formatted phone number hosted by this HostedNumberOrder. + */ + phoneNumber: string; + capabilities: PhoneNumberCapabilities; + /** + * A human readable description of this resource, up to 64 characters. + */ + friendlyName: string; + /** + * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + */ + uniqueName: string; + status: DependentHostedNumberOrderStatus; + /** + * A message that explains why a hosted_number_order went to status \"action-required\" + */ + failureReason: string; + /** + * The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The number of attempts made to verify ownership of the phone number that is being hosted. + */ + verificationAttempts: number; + /** + * Email of the owner of this phone number that is being hosted. + */ + email: string; + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed + */ + ccEmails: Array; + verificationType: DependentHostedNumberOrderVerificationType; + /** + * A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted. + */ + verificationDocumentSid: string; + /** + * A numerical extension to be used when making the ownership verification call. + */ + extension: string; + /** + * A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call. + */ + callDelay: number; + /** + * The digits passed during the ownership verification call. + */ + verificationCode: string; + /** + * A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification. + */ + verificationCallSids: Array; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + incomingPhoneNumberSid: string; + addressSid: string; + signingDocumentSid: string; + phoneNumber: string; + capabilities: PhoneNumberCapabilities; + friendlyName: string; + uniqueName: string; + status: DependentHostedNumberOrderStatus; + failureReason: string; + dateCreated: Date; + dateUpdated: Date; + verificationAttempts: number; + email: string; + ccEmails: string[]; + verificationType: DependentHostedNumberOrderVerificationType; + verificationDocumentSid: string; + extension: string; + callDelay: number; + verificationCode: string; + verificationCallSids: string[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class DependentHostedNumberOrderPage extends Page { + /** + * Initialize the DependentHostedNumberOrderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: HostedNumbers, response: Response, solution: DependentHostedNumberOrderSolution); + /** + * Build an instance of DependentHostedNumberOrderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DependentHostedNumberOrderResource): DependentHostedNumberOrderInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.js b/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.js new file mode 100644 index 00000000..e022f3b0 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.js @@ -0,0 +1,174 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DependentHostedNumberOrderPage = exports.DependentHostedNumberOrderInstance = exports.DependentHostedNumberOrderListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function DependentHostedNumberOrderListInstance(version, signingDocumentSid) { + if (!(0, utility_1.isValidPathParam)(signingDocumentSid)) { + throw new Error("Parameter 'signingDocumentSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { signingDocumentSid }; + instance._uri = `/AuthorizationDocuments/${signingDocumentSid}/DependentHostedNumberOrders`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["incomingPhoneNumberSid"] !== undefined) + data["IncomingPhoneNumberSid"] = params["incomingPhoneNumberSid"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DependentHostedNumberOrderPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DependentHostedNumberOrderPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DependentHostedNumberOrderListInstance = DependentHostedNumberOrderListInstance; +class DependentHostedNumberOrderInstance { + constructor(_version, payload, signingDocumentSid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.incomingPhoneNumberSid = payload.incoming_phone_number_sid; + this.addressSid = payload.address_sid; + this.signingDocumentSid = payload.signing_document_sid; + this.phoneNumber = payload.phone_number; + this.capabilities = payload.capabilities; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.status = payload.status; + this.failureReason = payload.failure_reason; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.verificationAttempts = deserialize.integer(payload.verification_attempts); + this.email = payload.email; + this.ccEmails = payload.cc_emails; + this.verificationType = payload.verification_type; + this.verificationDocumentSid = payload.verification_document_sid; + this.extension = payload.extension; + this.callDelay = deserialize.integer(payload.call_delay); + this.verificationCode = payload.verification_code; + this.verificationCallSids = payload.verification_call_sids; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + incomingPhoneNumberSid: this.incomingPhoneNumberSid, + addressSid: this.addressSid, + signingDocumentSid: this.signingDocumentSid, + phoneNumber: this.phoneNumber, + capabilities: this.capabilities, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + status: this.status, + failureReason: this.failureReason, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + verificationAttempts: this.verificationAttempts, + email: this.email, + ccEmails: this.ccEmails, + verificationType: this.verificationType, + verificationDocumentSid: this.verificationDocumentSid, + extension: this.extension, + callDelay: this.callDelay, + verificationCode: this.verificationCode, + verificationCallSids: this.verificationCallSids, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DependentHostedNumberOrderInstance = DependentHostedNumberOrderInstance; +class DependentHostedNumberOrderPage extends Page_1.default { + /** + * Initialize the DependentHostedNumberOrderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DependentHostedNumberOrderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DependentHostedNumberOrderInstance(this._version, payload, this._solution.signingDocumentSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DependentHostedNumberOrderPage = DependentHostedNumberOrderPage; diff --git a/node_modules/twilio/lib/rest/preview/hosted_numbers/hostedNumberOrder.d.ts b/node_modules/twilio/lib/rest/preview/hosted_numbers/hostedNumberOrder.d.ts new file mode 100644 index 00000000..40979e67 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/hosted_numbers/hostedNumberOrder.d.ts @@ -0,0 +1,468 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import HostedNumbers from "../HostedNumbers"; +import { PhoneNumberCapabilities } from "../../../interfaces"; +export type HostedNumberOrderStatus = "received" | "pending-verification" | "verified" | "pending-loa" | "carrier-processing" | "testing" | "completed" | "failed" | "action-required"; +export type HostedNumberOrderVerificationType = "phone-call" | "phone-bill"; +/** + * Options to pass to update a HostedNumberOrderInstance + */ +export interface HostedNumberOrderContextUpdateOptions { + /** A 64 character string that is a human readable text that describes this resource. */ + friendlyName?: string; + /** Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** Email of the owner of this phone number that is being hosted. */ + email?: string; + /** Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. */ + ccEmails?: Array; + /** */ + status?: HostedNumberOrderStatus; + /** A verification code that is given to the user via a phone call to the phone number that is being hosted. */ + verificationCode?: string; + /** */ + verificationType?: HostedNumberOrderVerificationType; + /** Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. */ + verificationDocumentSid?: string; + /** Digits to dial after connecting the verification call. */ + extension?: string; + /** The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. */ + callDelay?: number; +} +/** + * Options to pass to create a HostedNumberOrderInstance + */ +export interface HostedNumberOrderListInstanceCreateOptions { + /** The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format */ + phoneNumber: string; + /** Used to specify that the SMS capability will be hosted on Twilio\\\'s platform. */ + smsCapability: boolean; + /** This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. */ + accountSid?: string; + /** A 64 character string that is a human readable text that describes this resource. */ + friendlyName?: string; + /** Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. */ + ccEmails?: Array; + /** The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. */ + smsUrl?: string; + /** The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */ + smsMethod?: string; + /** A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. */ + smsFallbackUrl?: string; + /** The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */ + smsFallbackMethod?: string; + /** Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. */ + statusCallbackUrl?: string; + /** Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. */ + statusCallbackMethod?: string; + /** Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. */ + smsApplicationSid?: string; + /** Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. */ + addressSid?: string; + /** Optional. Email of the owner of this phone number that is being hosted. */ + email?: string; + /** */ + verificationType?: HostedNumberOrderVerificationType; + /** Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. */ + verificationDocumentSid?: string; +} +/** + * Options to pass to each + */ +export interface HostedNumberOrderListInstanceEachOptions { + /** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */ + status?: HostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; + /** Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface HostedNumberOrderListInstanceOptions { + /** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */ + status?: HostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; + /** Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface HostedNumberOrderListInstancePageOptions { + /** The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. */ + status?: HostedNumberOrderStatus; + /** An E164 formatted phone number hosted by this HostedNumberOrder. */ + phoneNumber?: string; + /** A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. */ + incomingPhoneNumberSid?: string; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; + /** Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ + uniqueName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface HostedNumberOrderContext { + /** + * Remove a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + fetch(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Update a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + update(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Update a HostedNumberOrderInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + update(params: HostedNumberOrderContextUpdateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface HostedNumberOrderContextSolution { + sid: string; +} +export declare class HostedNumberOrderContextImpl implements HostedNumberOrderContext { + protected _version: HostedNumbers; + protected _solution: HostedNumberOrderContextSolution; + protected _uri: string; + constructor(_version: HostedNumbers, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + update(params?: HostedNumberOrderContextUpdateOptions | ((error: Error | null, item?: HostedNumberOrderInstance) => any), callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): HostedNumberOrderContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface HostedNumberOrderPayload extends TwilioResponsePayload { + items: HostedNumberOrderResource[]; +} +interface HostedNumberOrderResource { + sid: string; + account_sid: string; + incoming_phone_number_sid: string; + address_sid: string; + signing_document_sid: string; + phone_number: string; + capabilities: PhoneNumberCapabilities; + friendly_name: string; + unique_name: string; + status: HostedNumberOrderStatus; + failure_reason: string; + date_created: Date; + date_updated: Date; + verification_attempts: number; + email: string; + cc_emails: Array; + url: string; + verification_type: HostedNumberOrderVerificationType; + verification_document_sid: string; + extension: string; + call_delay: number; + verification_code: string; + verification_call_sids: Array; +} +export declare class HostedNumberOrderInstance { + protected _version: HostedNumbers; + protected _solution: HostedNumberOrderContextSolution; + protected _context?: HostedNumberOrderContext; + constructor(_version: HostedNumbers, payload: HostedNumberOrderResource, sid?: string); + /** + * A 34 character string that uniquely identifies this HostedNumberOrder. + */ + sid: string; + /** + * A 34 character string that uniquely identifies the account. + */ + accountSid: string; + /** + * A 34 character string that uniquely identifies the [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the phone number being hosted. + */ + incomingPhoneNumberSid: string; + /** + * A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. + */ + addressSid: string; + /** + * A 34 character string that uniquely identifies the [Authorization Document](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource) the user needs to sign. + */ + signingDocumentSid: string; + /** + * Phone number to be hosted. This must be in [E.164](https://en.wikipedia.org/wiki/E.164) format, e.g., +16175551212 + */ + phoneNumber: string; + capabilities: PhoneNumberCapabilities; + /** + * A 64 character string that is a human-readable text that describes this resource. + */ + friendlyName: string; + /** + * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + */ + uniqueName: string; + status: HostedNumberOrderStatus; + /** + * A message that explains why a hosted_number_order went to status \"action-required\" + */ + failureReason: string; + /** + * The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The number of attempts made to verify ownership of the phone number that is being hosted. + */ + verificationAttempts: number; + /** + * Email of the owner of this phone number that is being hosted. + */ + email: string; + /** + * A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. + */ + ccEmails: Array; + /** + * The URL of this HostedNumberOrder. + */ + url: string; + verificationType: HostedNumberOrderVerificationType; + /** + * A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted. + */ + verificationDocumentSid: string; + /** + * A numerical extension to be used when making the ownership verification call. + */ + extension: string; + /** + * A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call. + */ + callDelay: number; + /** + * A verification code provided in the response for a user to enter when they pick up the phone call. + */ + verificationCode: string; + /** + * A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification. + */ + verificationCallSids: Array; + private get _proxy(); + /** + * Remove a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + fetch(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Update a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + update(callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Update a HostedNumberOrderInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + update(params: HostedNumberOrderContextUpdateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + incomingPhoneNumberSid: string; + addressSid: string; + signingDocumentSid: string; + phoneNumber: string; + capabilities: PhoneNumberCapabilities; + friendlyName: string; + uniqueName: string; + status: HostedNumberOrderStatus; + failureReason: string; + dateCreated: Date; + dateUpdated: Date; + verificationAttempts: number; + email: string; + ccEmails: string[]; + url: string; + verificationType: HostedNumberOrderVerificationType; + verificationDocumentSid: string; + extension: string; + callDelay: number; + verificationCode: string; + verificationCallSids: string[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface HostedNumberOrderSolution { +} +export interface HostedNumberOrderListInstance { + _version: HostedNumbers; + _solution: HostedNumberOrderSolution; + _uri: string; + (sid: string): HostedNumberOrderContext; + get(sid: string): HostedNumberOrderContext; + /** + * Create a HostedNumberOrderInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + create(params: HostedNumberOrderListInstanceCreateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise; + /** + * Streams HostedNumberOrderInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HostedNumberOrderListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void): void; + each(params: HostedNumberOrderListInstanceEachOptions, callback?: (item: HostedNumberOrderInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of HostedNumberOrderInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: HostedNumberOrderPage) => any): Promise; + /** + * Lists HostedNumberOrderInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HostedNumberOrderListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: HostedNumberOrderInstance[]) => any): Promise; + list(params: HostedNumberOrderListInstanceOptions, callback?: (error: Error | null, items: HostedNumberOrderInstance[]) => any): Promise; + /** + * Retrieve a single page of HostedNumberOrderInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HostedNumberOrderListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: HostedNumberOrderPage) => any): Promise; + page(params: HostedNumberOrderListInstancePageOptions, callback?: (error: Error | null, items: HostedNumberOrderPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function HostedNumberOrderListInstance(version: HostedNumbers): HostedNumberOrderListInstance; +export declare class HostedNumberOrderPage extends Page { + /** + * Initialize the HostedNumberOrderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: HostedNumbers, response: Response, solution: HostedNumberOrderSolution); + /** + * Build an instance of HostedNumberOrderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: HostedNumberOrderResource): HostedNumberOrderInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/hosted_numbers/hostedNumberOrder.js b/node_modules/twilio/lib/rest/preview/hosted_numbers/hostedNumberOrder.js new file mode 100644 index 00000000..23869276 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/hosted_numbers/hostedNumberOrder.js @@ -0,0 +1,345 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HostedNumberOrderPage = exports.HostedNumberOrderListInstance = exports.HostedNumberOrderInstance = exports.HostedNumberOrderContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class HostedNumberOrderContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/HostedNumberOrders/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new HostedNumberOrderInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + if (params["ccEmails"] !== undefined) + data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e); + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["verificationCode"] !== undefined) + data["VerificationCode"] = params["verificationCode"]; + if (params["verificationType"] !== undefined) + data["VerificationType"] = params["verificationType"]; + if (params["verificationDocumentSid"] !== undefined) + data["VerificationDocumentSid"] = params["verificationDocumentSid"]; + if (params["extension"] !== undefined) + data["Extension"] = params["extension"]; + if (params["callDelay"] !== undefined) + data["CallDelay"] = params["callDelay"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new HostedNumberOrderInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.HostedNumberOrderContextImpl = HostedNumberOrderContextImpl; +class HostedNumberOrderInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.incomingPhoneNumberSid = payload.incoming_phone_number_sid; + this.addressSid = payload.address_sid; + this.signingDocumentSid = payload.signing_document_sid; + this.phoneNumber = payload.phone_number; + this.capabilities = payload.capabilities; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.status = payload.status; + this.failureReason = payload.failure_reason; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.verificationAttempts = deserialize.integer(payload.verification_attempts); + this.email = payload.email; + this.ccEmails = payload.cc_emails; + this.url = payload.url; + this.verificationType = payload.verification_type; + this.verificationDocumentSid = payload.verification_document_sid; + this.extension = payload.extension; + this.callDelay = deserialize.integer(payload.call_delay); + this.verificationCode = payload.verification_code; + this.verificationCallSids = payload.verification_call_sids; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new HostedNumberOrderContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a HostedNumberOrderInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed HostedNumberOrderInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + incomingPhoneNumberSid: this.incomingPhoneNumberSid, + addressSid: this.addressSid, + signingDocumentSid: this.signingDocumentSid, + phoneNumber: this.phoneNumber, + capabilities: this.capabilities, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + status: this.status, + failureReason: this.failureReason, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + verificationAttempts: this.verificationAttempts, + email: this.email, + ccEmails: this.ccEmails, + url: this.url, + verificationType: this.verificationType, + verificationDocumentSid: this.verificationDocumentSid, + extension: this.extension, + callDelay: this.callDelay, + verificationCode: this.verificationCode, + verificationCallSids: this.verificationCallSids, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.HostedNumberOrderInstance = HostedNumberOrderInstance; +function HostedNumberOrderListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new HostedNumberOrderContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/HostedNumberOrders`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) { + throw new Error("Required parameter \"params['phoneNumber']\" missing."); + } + if (params["smsCapability"] === null || + params["smsCapability"] === undefined) { + throw new Error("Required parameter \"params['smsCapability']\" missing."); + } + let data = {}; + data["PhoneNumber"] = params["phoneNumber"]; + data["SmsCapability"] = serialize.bool(params["smsCapability"]); + if (params["accountSid"] !== undefined) + data["AccountSid"] = params["accountSid"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["ccEmails"] !== undefined) + data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e); + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["statusCallbackUrl"] !== undefined) + data["StatusCallbackUrl"] = params["statusCallbackUrl"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["smsApplicationSid"] !== undefined) + data["SmsApplicationSid"] = params["smsApplicationSid"]; + if (params["addressSid"] !== undefined) + data["AddressSid"] = params["addressSid"]; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + if (params["verificationType"] !== undefined) + data["VerificationType"] = params["verificationType"]; + if (params["verificationDocumentSid"] !== undefined) + data["VerificationDocumentSid"] = params["verificationDocumentSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new HostedNumberOrderInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["incomingPhoneNumberSid"] !== undefined) + data["IncomingPhoneNumberSid"] = params["incomingPhoneNumberSid"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new HostedNumberOrderPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new HostedNumberOrderPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.HostedNumberOrderListInstance = HostedNumberOrderListInstance; +class HostedNumberOrderPage extends Page_1.default { + /** + * Initialize the HostedNumberOrderPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of HostedNumberOrderInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new HostedNumberOrderInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.HostedNumberOrderPage = HostedNumberOrderPage; diff --git a/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn.d.ts b/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn.d.ts new file mode 100644 index 00000000..02992a3c --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn.d.ts @@ -0,0 +1,231 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import Marketplace from "../Marketplace"; +import { AvailableAddOnExtensionListInstance } from "./availableAddOn/availableAddOnExtension"; +/** + * Options to pass to each + */ +export interface AvailableAddOnListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AvailableAddOnInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AvailableAddOnListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AvailableAddOnListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AvailableAddOnContext { + extensions: AvailableAddOnExtensionListInstance; + /** + * Fetch a AvailableAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailableAddOnInstance + */ + fetch(callback?: (error: Error | null, item?: AvailableAddOnInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AvailableAddOnContextSolution { + sid: string; +} +export declare class AvailableAddOnContextImpl implements AvailableAddOnContext { + protected _version: Marketplace; + protected _solution: AvailableAddOnContextSolution; + protected _uri: string; + protected _extensions?: AvailableAddOnExtensionListInstance; + constructor(_version: Marketplace, sid: string); + get extensions(): AvailableAddOnExtensionListInstance; + fetch(callback?: (error: Error | null, item?: AvailableAddOnInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AvailableAddOnContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AvailableAddOnPayload extends TwilioResponsePayload { + available_add_ons: AvailableAddOnResource[]; +} +interface AvailableAddOnResource { + sid: string; + friendly_name: string; + description: string; + pricing_type: string; + configuration_schema: any; + url: string; + links: Record; +} +export declare class AvailableAddOnInstance { + protected _version: Marketplace; + protected _solution: AvailableAddOnContextSolution; + protected _context?: AvailableAddOnContext; + constructor(_version: Marketplace, payload: AvailableAddOnResource, sid?: string); + /** + * The unique string that we created to identify the AvailableAddOn resource. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * A short description of the Add-on\'s functionality. + */ + description: string; + /** + * How customers are charged for using this Add-on. + */ + pricingType: string; + /** + * The JSON object with the configuration that must be provided when installing a given Add-on. + */ + configurationSchema: any; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a AvailableAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailableAddOnInstance + */ + fetch(callback?: (error: Error | null, item?: AvailableAddOnInstance) => any): Promise; + /** + * Access the extensions. + */ + extensions(): AvailableAddOnExtensionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + description: string; + pricingType: string; + configurationSchema: any; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AvailableAddOnSolution { +} +export interface AvailableAddOnListInstance { + _version: Marketplace; + _solution: AvailableAddOnSolution; + _uri: string; + (sid: string): AvailableAddOnContext; + get(sid: string): AvailableAddOnContext; + /** + * Streams AvailableAddOnInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailableAddOnListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AvailableAddOnInstance, done: (err?: Error) => void) => void): void; + each(params: AvailableAddOnListInstanceEachOptions, callback?: (item: AvailableAddOnInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AvailableAddOnInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AvailableAddOnPage) => any): Promise; + /** + * Lists AvailableAddOnInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailableAddOnListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AvailableAddOnInstance[]) => any): Promise; + list(params: AvailableAddOnListInstanceOptions, callback?: (error: Error | null, items: AvailableAddOnInstance[]) => any): Promise; + /** + * Retrieve a single page of AvailableAddOnInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailableAddOnListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AvailableAddOnPage) => any): Promise; + page(params: AvailableAddOnListInstancePageOptions, callback?: (error: Error | null, items: AvailableAddOnPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AvailableAddOnListInstance(version: Marketplace): AvailableAddOnListInstance; +export declare class AvailableAddOnPage extends Page { + /** + * Initialize the AvailableAddOnPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Marketplace, response: Response, solution: AvailableAddOnSolution); + /** + * Build an instance of AvailableAddOnInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AvailableAddOnResource): AvailableAddOnInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn.js b/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn.js new file mode 100644 index 00000000..a81a1bb6 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn.js @@ -0,0 +1,196 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AvailableAddOnPage = exports.AvailableAddOnListInstance = exports.AvailableAddOnInstance = exports.AvailableAddOnContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const availableAddOnExtension_1 = require("./availableAddOn/availableAddOnExtension"); +class AvailableAddOnContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/AvailableAddOns/${sid}`; + } + get extensions() { + this._extensions = + this._extensions || + (0, availableAddOnExtension_1.AvailableAddOnExtensionListInstance)(this._version, this._solution.sid); + return this._extensions; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AvailableAddOnInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailableAddOnContextImpl = AvailableAddOnContextImpl; +class AvailableAddOnInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.description = payload.description; + this.pricingType = payload.pricing_type; + this.configurationSchema = payload.configuration_schema; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AvailableAddOnContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a AvailableAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailableAddOnInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the extensions. + */ + extensions() { + return this._proxy.extensions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + description: this.description, + pricingType: this.pricingType, + configurationSchema: this.configurationSchema, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailableAddOnInstance = AvailableAddOnInstance; +function AvailableAddOnListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AvailableAddOnContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/AvailableAddOns`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AvailableAddOnPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AvailableAddOnPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AvailableAddOnListInstance = AvailableAddOnListInstance; +class AvailableAddOnPage extends Page_1.default { + /** + * Initialize the AvailableAddOnPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AvailableAddOnInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AvailableAddOnInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailableAddOnPage = AvailableAddOnPage; diff --git a/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.d.ts b/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.d.ts new file mode 100644 index 00000000..2a740817 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.d.ts @@ -0,0 +1,219 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import Marketplace from "../../Marketplace"; +/** + * Options to pass to each + */ +export interface AvailableAddOnExtensionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AvailableAddOnExtensionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AvailableAddOnExtensionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AvailableAddOnExtensionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AvailableAddOnExtensionContext { + /** + * Fetch a AvailableAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailableAddOnExtensionInstance + */ + fetch(callback?: (error: Error | null, item?: AvailableAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AvailableAddOnExtensionContextSolution { + availableAddOnSid: string; + sid: string; +} +export declare class AvailableAddOnExtensionContextImpl implements AvailableAddOnExtensionContext { + protected _version: Marketplace; + protected _solution: AvailableAddOnExtensionContextSolution; + protected _uri: string; + constructor(_version: Marketplace, availableAddOnSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: AvailableAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AvailableAddOnExtensionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AvailableAddOnExtensionPayload extends TwilioResponsePayload { + extensions: AvailableAddOnExtensionResource[]; +} +interface AvailableAddOnExtensionResource { + sid: string; + available_add_on_sid: string; + friendly_name: string; + product_name: string; + unique_name: string; + url: string; +} +export declare class AvailableAddOnExtensionInstance { + protected _version: Marketplace; + protected _solution: AvailableAddOnExtensionContextSolution; + protected _context?: AvailableAddOnExtensionContext; + constructor(_version: Marketplace, payload: AvailableAddOnExtensionResource, availableAddOnSid: string, sid?: string); + /** + * The unique string that we created to identify the AvailableAddOnExtension resource. + */ + sid: string; + /** + * The SID of the AvailableAddOn resource to which this extension applies. + */ + availableAddOnSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The name of the Product this Extension is used within. + */ + productName: string; + /** + * An application-defined string that uniquely identifies the resource. + */ + uniqueName: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a AvailableAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailableAddOnExtensionInstance + */ + fetch(callback?: (error: Error | null, item?: AvailableAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + availableAddOnSid: string; + friendlyName: string; + productName: string; + uniqueName: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AvailableAddOnExtensionSolution { + availableAddOnSid: string; +} +export interface AvailableAddOnExtensionListInstance { + _version: Marketplace; + _solution: AvailableAddOnExtensionSolution; + _uri: string; + (sid: string): AvailableAddOnExtensionContext; + get(sid: string): AvailableAddOnExtensionContext; + /** + * Streams AvailableAddOnExtensionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailableAddOnExtensionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AvailableAddOnExtensionInstance, done: (err?: Error) => void) => void): void; + each(params: AvailableAddOnExtensionListInstanceEachOptions, callback?: (item: AvailableAddOnExtensionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AvailableAddOnExtensionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AvailableAddOnExtensionPage) => any): Promise; + /** + * Lists AvailableAddOnExtensionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailableAddOnExtensionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AvailableAddOnExtensionInstance[]) => any): Promise; + list(params: AvailableAddOnExtensionListInstanceOptions, callback?: (error: Error | null, items: AvailableAddOnExtensionInstance[]) => any): Promise; + /** + * Retrieve a single page of AvailableAddOnExtensionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AvailableAddOnExtensionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AvailableAddOnExtensionPage) => any): Promise; + page(params: AvailableAddOnExtensionListInstancePageOptions, callback?: (error: Error | null, items: AvailableAddOnExtensionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AvailableAddOnExtensionListInstance(version: Marketplace, availableAddOnSid: string): AvailableAddOnExtensionListInstance; +export declare class AvailableAddOnExtensionPage extends Page { + /** + * Initialize the AvailableAddOnExtensionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Marketplace, response: Response, solution: AvailableAddOnExtensionSolution); + /** + * Build an instance of AvailableAddOnExtensionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AvailableAddOnExtensionResource): AvailableAddOnExtensionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js b/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js new file mode 100644 index 00000000..24966a5c --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js @@ -0,0 +1,187 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AvailableAddOnExtensionPage = exports.AvailableAddOnExtensionListInstance = exports.AvailableAddOnExtensionInstance = exports.AvailableAddOnExtensionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class AvailableAddOnExtensionContextImpl { + constructor(_version, availableAddOnSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(availableAddOnSid)) { + throw new Error("Parameter 'availableAddOnSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { availableAddOnSid, sid }; + this._uri = `/AvailableAddOns/${availableAddOnSid}/Extensions/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AvailableAddOnExtensionInstance(operationVersion, payload, instance._solution.availableAddOnSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailableAddOnExtensionContextImpl = AvailableAddOnExtensionContextImpl; +class AvailableAddOnExtensionInstance { + constructor(_version, payload, availableAddOnSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.availableAddOnSid = payload.available_add_on_sid; + this.friendlyName = payload.friendly_name; + this.productName = payload.product_name; + this.uniqueName = payload.unique_name; + this.url = payload.url; + this._solution = { availableAddOnSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AvailableAddOnExtensionContextImpl(this._version, this._solution.availableAddOnSid, this._solution.sid); + return this._context; + } + /** + * Fetch a AvailableAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AvailableAddOnExtensionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + availableAddOnSid: this.availableAddOnSid, + friendlyName: this.friendlyName, + productName: this.productName, + uniqueName: this.uniqueName, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailableAddOnExtensionInstance = AvailableAddOnExtensionInstance; +function AvailableAddOnExtensionListInstance(version, availableAddOnSid) { + if (!(0, utility_1.isValidPathParam)(availableAddOnSid)) { + throw new Error("Parameter 'availableAddOnSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AvailableAddOnExtensionContextImpl(version, availableAddOnSid, sid); + }; + instance._version = version; + instance._solution = { availableAddOnSid }; + instance._uri = `/AvailableAddOns/${availableAddOnSid}/Extensions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AvailableAddOnExtensionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AvailableAddOnExtensionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AvailableAddOnExtensionListInstance = AvailableAddOnExtensionListInstance; +class AvailableAddOnExtensionPage extends Page_1.default { + /** + * Initialize the AvailableAddOnExtensionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AvailableAddOnExtensionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AvailableAddOnExtensionInstance(this._version, payload, this._solution.availableAddOnSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AvailableAddOnExtensionPage = AvailableAddOnExtensionPage; diff --git a/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn.d.ts b/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn.d.ts new file mode 100644 index 00000000..22d9bc2a --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn.d.ts @@ -0,0 +1,332 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import Marketplace from "../Marketplace"; +import { InstalledAddOnExtensionListInstance } from "./installedAddOn/installedAddOnExtension"; +/** + * Options to pass to update a InstalledAddOnInstance + */ +export interface InstalledAddOnContextUpdateOptions { + /** Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured */ + configuration?: any; + /** An application-defined string that uniquely identifies the resource. This value must be unique within the Account. */ + uniqueName?: string; +} +/** + * Options to pass to create a InstalledAddOnInstance + */ +export interface InstalledAddOnListInstanceCreateOptions { + /** The SID of the AvaliableAddOn to install. */ + availableAddOnSid: string; + /** Whether the Terms of Service were accepted. */ + acceptTermsOfService: boolean; + /** The JSON object that represents the configuration of the new Add-on being installed. */ + configuration?: any; + /** An application-defined string that uniquely identifies the resource. This value must be unique within the Account. */ + uniqueName?: string; +} +/** + * Options to pass to each + */ +export interface InstalledAddOnListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InstalledAddOnInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InstalledAddOnListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InstalledAddOnListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InstalledAddOnContext { + extensions: InstalledAddOnExtensionListInstance; + /** + * Remove a InstalledAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InstalledAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnInstance + */ + fetch(callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + /** + * Update a InstalledAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnInstance + */ + update(callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + /** + * Update a InstalledAddOnInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnInstance + */ + update(params: InstalledAddOnContextUpdateOptions, callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InstalledAddOnContextSolution { + sid: string; +} +export declare class InstalledAddOnContextImpl implements InstalledAddOnContext { + protected _version: Marketplace; + protected _solution: InstalledAddOnContextSolution; + protected _uri: string; + protected _extensions?: InstalledAddOnExtensionListInstance; + constructor(_version: Marketplace, sid: string); + get extensions(): InstalledAddOnExtensionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + update(params?: InstalledAddOnContextUpdateOptions | ((error: Error | null, item?: InstalledAddOnInstance) => any), callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InstalledAddOnContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InstalledAddOnPayload extends TwilioResponsePayload { + installed_add_ons: InstalledAddOnResource[]; +} +interface InstalledAddOnResource { + sid: string; + account_sid: string; + friendly_name: string; + description: string; + configuration: any; + unique_name: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class InstalledAddOnInstance { + protected _version: Marketplace; + protected _solution: InstalledAddOnContextSolution; + protected _context?: InstalledAddOnContext; + constructor(_version: Marketplace, payload: InstalledAddOnResource, sid?: string); + /** + * The unique string that we created to identify the InstalledAddOn resource. This Sid can also be found in the Console on that specific Add-ons page as the \'Available Add-on Sid\'. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the InstalledAddOn resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * A short description of the Add-on\'s functionality. + */ + description: string; + /** + * The JSON object that represents the current configuration of installed Add-on. + */ + configuration: any; + /** + * An application-defined string that uniquely identifies the resource. + */ + uniqueName: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a InstalledAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InstalledAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnInstance + */ + fetch(callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + /** + * Update a InstalledAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnInstance + */ + update(callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + /** + * Update a InstalledAddOnInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnInstance + */ + update(params: InstalledAddOnContextUpdateOptions, callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + /** + * Access the extensions. + */ + extensions(): InstalledAddOnExtensionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + description: string; + configuration: any; + uniqueName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InstalledAddOnSolution { +} +export interface InstalledAddOnListInstance { + _version: Marketplace; + _solution: InstalledAddOnSolution; + _uri: string; + (sid: string): InstalledAddOnContext; + get(sid: string): InstalledAddOnContext; + /** + * Create a InstalledAddOnInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnInstance + */ + create(params: InstalledAddOnListInstanceCreateOptions, callback?: (error: Error | null, item?: InstalledAddOnInstance) => any): Promise; + /** + * Streams InstalledAddOnInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InstalledAddOnListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InstalledAddOnInstance, done: (err?: Error) => void) => void): void; + each(params: InstalledAddOnListInstanceEachOptions, callback?: (item: InstalledAddOnInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InstalledAddOnInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InstalledAddOnPage) => any): Promise; + /** + * Lists InstalledAddOnInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InstalledAddOnListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InstalledAddOnInstance[]) => any): Promise; + list(params: InstalledAddOnListInstanceOptions, callback?: (error: Error | null, items: InstalledAddOnInstance[]) => any): Promise; + /** + * Retrieve a single page of InstalledAddOnInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InstalledAddOnListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InstalledAddOnPage) => any): Promise; + page(params: InstalledAddOnListInstancePageOptions, callback?: (error: Error | null, items: InstalledAddOnPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InstalledAddOnListInstance(version: Marketplace): InstalledAddOnListInstance; +export declare class InstalledAddOnPage extends Page { + /** + * Initialize the InstalledAddOnPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Marketplace, response: Response, solution: InstalledAddOnSolution); + /** + * Build an instance of InstalledAddOnInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InstalledAddOnResource): InstalledAddOnInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn.js b/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn.js new file mode 100644 index 00000000..3858ed46 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn.js @@ -0,0 +1,281 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InstalledAddOnPage = exports.InstalledAddOnListInstance = exports.InstalledAddOnInstance = exports.InstalledAddOnContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const installedAddOnExtension_1 = require("./installedAddOn/installedAddOnExtension"); +class InstalledAddOnContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/InstalledAddOns/${sid}`; + } + get extensions() { + this._extensions = + this._extensions || + (0, installedAddOnExtension_1.InstalledAddOnExtensionListInstance)(this._version, this._solution.sid); + return this._extensions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InstalledAddOnInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["configuration"] !== undefined) + data["Configuration"] = serialize.object(params["configuration"]); + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InstalledAddOnInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InstalledAddOnContextImpl = InstalledAddOnContextImpl; +class InstalledAddOnInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.description = payload.description; + this.configuration = payload.configuration; + this.uniqueName = payload.unique_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InstalledAddOnContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a InstalledAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a InstalledAddOnInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the extensions. + */ + extensions() { + return this._proxy.extensions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + description: this.description, + configuration: this.configuration, + uniqueName: this.uniqueName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InstalledAddOnInstance = InstalledAddOnInstance; +function InstalledAddOnListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InstalledAddOnContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/InstalledAddOns`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["availableAddOnSid"] === null || + params["availableAddOnSid"] === undefined) { + throw new Error("Required parameter \"params['availableAddOnSid']\" missing."); + } + if (params["acceptTermsOfService"] === null || + params["acceptTermsOfService"] === undefined) { + throw new Error("Required parameter \"params['acceptTermsOfService']\" missing."); + } + let data = {}; + data["AvailableAddOnSid"] = params["availableAddOnSid"]; + data["AcceptTermsOfService"] = serialize.bool(params["acceptTermsOfService"]); + if (params["configuration"] !== undefined) + data["Configuration"] = serialize.object(params["configuration"]); + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InstalledAddOnInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InstalledAddOnPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InstalledAddOnPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InstalledAddOnListInstance = InstalledAddOnListInstance; +class InstalledAddOnPage extends Page_1.default { + /** + * Initialize the InstalledAddOnPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InstalledAddOnInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InstalledAddOnInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InstalledAddOnPage = InstalledAddOnPage; diff --git a/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.d.ts b/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.d.ts new file mode 100644 index 00000000..16d33998 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.d.ts @@ -0,0 +1,251 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import Marketplace from "../../Marketplace"; +/** + * Options to pass to update a InstalledAddOnExtensionInstance + */ +export interface InstalledAddOnExtensionContextUpdateOptions { + /** Whether the Extension should be invoked. */ + enabled: boolean; +} +/** + * Options to pass to each + */ +export interface InstalledAddOnExtensionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InstalledAddOnExtensionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InstalledAddOnExtensionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InstalledAddOnExtensionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InstalledAddOnExtensionContext { + /** + * Fetch a InstalledAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnExtensionInstance + */ + fetch(callback?: (error: Error | null, item?: InstalledAddOnExtensionInstance) => any): Promise; + /** + * Update a InstalledAddOnExtensionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnExtensionInstance + */ + update(params: InstalledAddOnExtensionContextUpdateOptions, callback?: (error: Error | null, item?: InstalledAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InstalledAddOnExtensionContextSolution { + installedAddOnSid: string; + sid: string; +} +export declare class InstalledAddOnExtensionContextImpl implements InstalledAddOnExtensionContext { + protected _version: Marketplace; + protected _solution: InstalledAddOnExtensionContextSolution; + protected _uri: string; + constructor(_version: Marketplace, installedAddOnSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: InstalledAddOnExtensionInstance) => any): Promise; + update(params: InstalledAddOnExtensionContextUpdateOptions, callback?: (error: Error | null, item?: InstalledAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InstalledAddOnExtensionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InstalledAddOnExtensionPayload extends TwilioResponsePayload { + extensions: InstalledAddOnExtensionResource[]; +} +interface InstalledAddOnExtensionResource { + sid: string; + installed_add_on_sid: string; + friendly_name: string; + product_name: string; + unique_name: string; + enabled: boolean; + url: string; +} +export declare class InstalledAddOnExtensionInstance { + protected _version: Marketplace; + protected _solution: InstalledAddOnExtensionContextSolution; + protected _context?: InstalledAddOnExtensionContext; + constructor(_version: Marketplace, payload: InstalledAddOnExtensionResource, installedAddOnSid: string, sid?: string); + /** + * The unique string that we created to identify the InstalledAddOn Extension resource. + */ + sid: string; + /** + * The SID of the InstalledAddOn resource to which this extension applies. + */ + installedAddOnSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The name of the Product this Extension is used within. + */ + productName: string; + /** + * An application-defined string that uniquely identifies the resource. + */ + uniqueName: string; + /** + * Whether the Extension will be invoked. + */ + enabled: boolean; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a InstalledAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnExtensionInstance + */ + fetch(callback?: (error: Error | null, item?: InstalledAddOnExtensionInstance) => any): Promise; + /** + * Update a InstalledAddOnExtensionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnExtensionInstance + */ + update(params: InstalledAddOnExtensionContextUpdateOptions, callback?: (error: Error | null, item?: InstalledAddOnExtensionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + installedAddOnSid: string; + friendlyName: string; + productName: string; + uniqueName: string; + enabled: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InstalledAddOnExtensionSolution { + installedAddOnSid: string; +} +export interface InstalledAddOnExtensionListInstance { + _version: Marketplace; + _solution: InstalledAddOnExtensionSolution; + _uri: string; + (sid: string): InstalledAddOnExtensionContext; + get(sid: string): InstalledAddOnExtensionContext; + /** + * Streams InstalledAddOnExtensionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InstalledAddOnExtensionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InstalledAddOnExtensionInstance, done: (err?: Error) => void) => void): void; + each(params: InstalledAddOnExtensionListInstanceEachOptions, callback?: (item: InstalledAddOnExtensionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InstalledAddOnExtensionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InstalledAddOnExtensionPage) => any): Promise; + /** + * Lists InstalledAddOnExtensionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InstalledAddOnExtensionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InstalledAddOnExtensionInstance[]) => any): Promise; + list(params: InstalledAddOnExtensionListInstanceOptions, callback?: (error: Error | null, items: InstalledAddOnExtensionInstance[]) => any): Promise; + /** + * Retrieve a single page of InstalledAddOnExtensionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InstalledAddOnExtensionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InstalledAddOnExtensionPage) => any): Promise; + page(params: InstalledAddOnExtensionListInstancePageOptions, callback?: (error: Error | null, items: InstalledAddOnExtensionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InstalledAddOnExtensionListInstance(version: Marketplace, installedAddOnSid: string): InstalledAddOnExtensionListInstance; +export declare class InstalledAddOnExtensionPage extends Page { + /** + * Initialize the InstalledAddOnExtensionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Marketplace, response: Response, solution: InstalledAddOnExtensionSolution); + /** + * Build an instance of InstalledAddOnExtensionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InstalledAddOnExtensionResource): InstalledAddOnExtensionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js b/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js new file mode 100644 index 00000000..e19aadcd --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js @@ -0,0 +1,214 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InstalledAddOnExtensionPage = exports.InstalledAddOnExtensionListInstance = exports.InstalledAddOnExtensionInstance = exports.InstalledAddOnExtensionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class InstalledAddOnExtensionContextImpl { + constructor(_version, installedAddOnSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(installedAddOnSid)) { + throw new Error("Parameter 'installedAddOnSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { installedAddOnSid, sid }; + this._uri = `/InstalledAddOns/${installedAddOnSid}/Extensions/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InstalledAddOnExtensionInstance(operationVersion, payload, instance._solution.installedAddOnSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["enabled"] === null || params["enabled"] === undefined) { + throw new Error("Required parameter \"params['enabled']\" missing."); + } + let data = {}; + data["Enabled"] = serialize.bool(params["enabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InstalledAddOnExtensionInstance(operationVersion, payload, instance._solution.installedAddOnSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InstalledAddOnExtensionContextImpl = InstalledAddOnExtensionContextImpl; +class InstalledAddOnExtensionInstance { + constructor(_version, payload, installedAddOnSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.installedAddOnSid = payload.installed_add_on_sid; + this.friendlyName = payload.friendly_name; + this.productName = payload.product_name; + this.uniqueName = payload.unique_name; + this.enabled = payload.enabled; + this.url = payload.url; + this._solution = { installedAddOnSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InstalledAddOnExtensionContextImpl(this._version, this._solution.installedAddOnSid, this._solution.sid); + return this._context; + } + /** + * Fetch a InstalledAddOnExtensionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InstalledAddOnExtensionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + installedAddOnSid: this.installedAddOnSid, + friendlyName: this.friendlyName, + productName: this.productName, + uniqueName: this.uniqueName, + enabled: this.enabled, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InstalledAddOnExtensionInstance = InstalledAddOnExtensionInstance; +function InstalledAddOnExtensionListInstance(version, installedAddOnSid) { + if (!(0, utility_1.isValidPathParam)(installedAddOnSid)) { + throw new Error("Parameter 'installedAddOnSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InstalledAddOnExtensionContextImpl(version, installedAddOnSid, sid); + }; + instance._version = version; + instance._solution = { installedAddOnSid }; + instance._uri = `/InstalledAddOns/${installedAddOnSid}/Extensions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InstalledAddOnExtensionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InstalledAddOnExtensionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InstalledAddOnExtensionListInstance = InstalledAddOnExtensionListInstance; +class InstalledAddOnExtensionPage extends Page_1.default { + /** + * Initialize the InstalledAddOnExtensionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InstalledAddOnExtensionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InstalledAddOnExtensionInstance(this._version, payload, this._solution.installedAddOnSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InstalledAddOnExtensionPage = InstalledAddOnExtensionPage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service.d.ts b/node_modules/twilio/lib/rest/preview/sync/service.d.ts new file mode 100644 index 00000000..dc9e4ebd --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service.d.ts @@ -0,0 +1,330 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import Sync from "../Sync"; +import { DocumentListInstance } from "./service/document"; +import { SyncListListInstance } from "./service/syncList"; +import { SyncMapListInstance } from "./service/syncMap"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** */ + webhookUrl?: string; + /** */ + friendlyName?: string; + /** */ + reachabilityWebhooksEnabled?: boolean; + /** */ + aclEnabled?: boolean; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** */ + friendlyName?: string; + /** */ + webhookUrl?: string; + /** */ + reachabilityWebhooksEnabled?: boolean; + /** */ + aclEnabled?: boolean; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + documents: DocumentListInstance; + syncLists: SyncListListInstance; + syncMaps: SyncMapListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: Sync; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _documents?: DocumentListInstance; + protected _syncLists?: SyncListListInstance; + protected _syncMaps?: SyncMapListInstance; + constructor(_version: Sync, sid: string); + get documents(): DocumentListInstance; + get syncLists(): SyncListListInstance; + get syncMaps(): SyncMapListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; + webhook_url: string; + reachability_webhooks_enabled: boolean; + acl_enabled: boolean; + links: Record; +} +export declare class ServiceInstance { + protected _version: Sync; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: Sync, payload: ServiceResource, sid?: string); + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + webhookUrl: string; + reachabilityWebhooksEnabled: boolean; + aclEnabled: boolean; + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the documents. + */ + documents(): DocumentListInstance; + /** + * Access the syncLists. + */ + syncLists(): SyncListListInstance; + /** + * Access the syncMaps. + */ + syncMaps(): SyncMapListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + webhookUrl: string; + reachabilityWebhooksEnabled: boolean; + aclEnabled: boolean; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: Sync; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: Sync): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service.js b/node_modules/twilio/lib/rest/preview/sync/service.js new file mode 100644 index 00000000..cd86009d --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service.js @@ -0,0 +1,308 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const document_1 = require("./service/document"); +const syncList_1 = require("./service/syncList"); +const syncMap_1 = require("./service/syncMap"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get documents() { + this._documents = + this._documents || + (0, document_1.DocumentListInstance)(this._version, this._solution.sid); + return this._documents; + } + get syncLists() { + this._syncLists = + this._syncLists || + (0, syncList_1.SyncListListInstance)(this._version, this._solution.sid); + return this._syncLists; + } + get syncMaps() { + this._syncMaps = + this._syncMaps || (0, syncMap_1.SyncMapListInstance)(this._version, this._solution.sid); + return this._syncMaps; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["reachabilityWebhooksEnabled"] !== undefined) + data["ReachabilityWebhooksEnabled"] = serialize.bool(params["reachabilityWebhooksEnabled"]); + if (params["aclEnabled"] !== undefined) + data["AclEnabled"] = serialize.bool(params["aclEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.webhookUrl = payload.webhook_url; + this.reachabilityWebhooksEnabled = payload.reachability_webhooks_enabled; + this.aclEnabled = payload.acl_enabled; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the documents. + */ + documents() { + return this._proxy.documents; + } + /** + * Access the syncLists. + */ + syncLists() { + return this._proxy.syncLists; + } + /** + * Access the syncMaps. + */ + syncMaps() { + return this._proxy.syncMaps; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + webhookUrl: this.webhookUrl, + reachabilityWebhooksEnabled: this.reachabilityWebhooksEnabled, + aclEnabled: this.aclEnabled, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["reachabilityWebhooksEnabled"] !== undefined) + data["ReachabilityWebhooksEnabled"] = serialize.bool(params["reachabilityWebhooksEnabled"]); + if (params["aclEnabled"] !== undefined) + data["AclEnabled"] = serialize.bool(params["aclEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/document.d.ts b/node_modules/twilio/lib/rest/preview/sync/service/document.d.ts new file mode 100644 index 00000000..9e75ac62 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/document.d.ts @@ -0,0 +1,295 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import Sync from "../../Sync"; +import { DocumentPermissionListInstance } from "./document/documentPermission"; +/** + * Options to pass to update a DocumentInstance + */ +export interface DocumentContextUpdateOptions { + /** */ + data: any; + /** The If-Match HTTP request header */ + ifMatch?: string; +} +/** + * Options to pass to create a DocumentInstance + */ +export interface DocumentListInstanceCreateOptions { + /** */ + uniqueName?: string; + /** */ + data?: any; +} +/** + * Options to pass to each + */ +export interface DocumentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DocumentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DocumentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DocumentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DocumentContext { + documentPermissions: DocumentPermissionListInstance; + /** + * Remove a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + fetch(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Update a DocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + update(params: DocumentContextUpdateOptions, callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DocumentContextSolution { + serviceSid: string; + sid: string; +} +export declare class DocumentContextImpl implements DocumentContext { + protected _version: Sync; + protected _solution: DocumentContextSolution; + protected _uri: string; + protected _documentPermissions?: DocumentPermissionListInstance; + constructor(_version: Sync, serviceSid: string, sid: string); + get documentPermissions(): DocumentPermissionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + update(params: DocumentContextUpdateOptions, callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DocumentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DocumentPayload extends TwilioResponsePayload { + documents: DocumentResource[]; +} +interface DocumentResource { + sid: string; + unique_name: string; + account_sid: string; + service_sid: string; + url: string; + links: Record; + revision: string; + data: any; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class DocumentInstance { + protected _version: Sync; + protected _solution: DocumentContextSolution; + protected _context?: DocumentContext; + constructor(_version: Sync, payload: DocumentResource, serviceSid: string, sid?: string); + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + data: any; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + private get _proxy(); + /** + * Remove a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + fetch(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Update a DocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + update(params: DocumentContextUpdateOptions, callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Access the documentPermissions. + */ + documentPermissions(): DocumentPermissionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + data: any; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DocumentSolution { + serviceSid: string; +} +export interface DocumentListInstance { + _version: Sync; + _solution: DocumentSolution; + _uri: string; + (sid: string): DocumentContext; + get(sid: string): DocumentContext; + /** + * Create a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + create(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Create a DocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + create(params: DocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Streams DocumentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DocumentInstance, done: (err?: Error) => void) => void): void; + each(params: DocumentListInstanceEachOptions, callback?: (item: DocumentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DocumentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DocumentPage) => any): Promise; + /** + * Lists DocumentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DocumentInstance[]) => any): Promise; + list(params: DocumentListInstanceOptions, callback?: (error: Error | null, items: DocumentInstance[]) => any): Promise; + /** + * Retrieve a single page of DocumentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DocumentPage) => any): Promise; + page(params: DocumentListInstancePageOptions, callback?: (error: Error | null, items: DocumentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DocumentListInstance(version: Sync, serviceSid: string): DocumentListInstance; +export declare class DocumentPage extends Page { + /** + * Initialize the DocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: DocumentSolution); + /** + * Build an instance of DocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DocumentResource): DocumentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/document.js b/node_modules/twilio/lib/rest/preview/sync/service/document.js new file mode 100644 index 00000000..766df3de --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/document.js @@ -0,0 +1,281 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DocumentPage = exports.DocumentListInstance = exports.DocumentInstance = exports.DocumentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const documentPermission_1 = require("./document/documentPermission"); +class DocumentContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Documents/${sid}`; + } + get documentPermissions() { + this._documentPermissions = + this._documentPermissions || + (0, documentPermission_1.DocumentPermissionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._documentPermissions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DocumentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["data"] === null || params["data"] === undefined) { + throw new Error("Required parameter \"params['data']\" missing."); + } + let data = {}; + data["Data"] = serialize.object(params["data"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentContextImpl = DocumentContextImpl; +class DocumentInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.url = payload.url; + this.links = payload.links; + this.revision = payload.revision; + this.data = payload.data; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new DocumentContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the documentPermissions. + */ + documentPermissions() { + return this._proxy.documentPermissions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + url: this.url, + links: this.links, + revision: this.revision, + data: this.data, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentInstance = DocumentInstance; +function DocumentListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DocumentContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Documents`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["data"] !== undefined) + data["Data"] = serialize.object(params["data"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DocumentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DocumentListInstance = DocumentListInstance; +class DocumentPage extends Page_1.default { + /** + * Initialize the DocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DocumentInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentPage = DocumentPage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/document/documentPermission.d.ts b/node_modules/twilio/lib/rest/preview/sync/service/document/documentPermission.d.ts new file mode 100644 index 00000000..2c501087 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/document/documentPermission.d.ts @@ -0,0 +1,280 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import Sync from "../../../Sync"; +/** + * Options to pass to update a DocumentPermissionInstance + */ +export interface DocumentPermissionContextUpdateOptions { + /** Boolean flag specifying whether the identity can read the Sync Document. */ + read: boolean; + /** Boolean flag specifying whether the identity can update the Sync Document. */ + write: boolean; + /** Boolean flag specifying whether the identity can delete the Sync Document. */ + manage: boolean; +} +/** + * Options to pass to each + */ +export interface DocumentPermissionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DocumentPermissionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DocumentPermissionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DocumentPermissionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DocumentPermissionContext { + /** + * Remove a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Update a DocumentPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + update(params: DocumentPermissionContextUpdateOptions, callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DocumentPermissionContextSolution { + serviceSid: string; + documentSid: string; + identity: string; +} +export declare class DocumentPermissionContextImpl implements DocumentPermissionContext { + protected _version: Sync; + protected _solution: DocumentPermissionContextSolution; + protected _uri: string; + constructor(_version: Sync, serviceSid: string, documentSid: string, identity: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + update(params: DocumentPermissionContextUpdateOptions, callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DocumentPermissionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DocumentPermissionPayload extends TwilioResponsePayload { + permissions: DocumentPermissionResource[]; +} +interface DocumentPermissionResource { + account_sid: string; + service_sid: string; + document_sid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; +} +export declare class DocumentPermissionInstance { + protected _version: Sync; + protected _solution: DocumentPermissionContextSolution; + protected _context?: DocumentPermissionContext; + constructor(_version: Sync, payload: DocumentPermissionResource, serviceSid: string, documentSid: string, identity?: string); + /** + * The unique SID identifier of the Twilio Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Sync Service Instance. + */ + serviceSid: string; + /** + * The unique SID identifier of the Sync Document to which the Permission applies. + */ + documentSid: string; + /** + * Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. + */ + identity: string; + /** + * Boolean flag specifying whether the identity can read the Sync Document. + */ + read: boolean; + /** + * Boolean flag specifying whether the identity can update the Sync Document. + */ + write: boolean; + /** + * Boolean flag specifying whether the identity can delete the Sync Document. + */ + manage: boolean; + /** + * Contains an absolute URL for this Sync Document Permission. + */ + url: string; + private get _proxy(); + /** + * Remove a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Update a DocumentPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + update(params: DocumentPermissionContextUpdateOptions, callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + documentSid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DocumentPermissionSolution { + serviceSid: string; + documentSid: string; +} +export interface DocumentPermissionListInstance { + _version: Sync; + _solution: DocumentPermissionSolution; + _uri: string; + (identity: string): DocumentPermissionContext; + get(identity: string): DocumentPermissionContext; + /** + * Streams DocumentPermissionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentPermissionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DocumentPermissionInstance, done: (err?: Error) => void) => void): void; + each(params: DocumentPermissionListInstanceEachOptions, callback?: (item: DocumentPermissionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DocumentPermissionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DocumentPermissionPage) => any): Promise; + /** + * Lists DocumentPermissionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentPermissionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DocumentPermissionInstance[]) => any): Promise; + list(params: DocumentPermissionListInstanceOptions, callback?: (error: Error | null, items: DocumentPermissionInstance[]) => any): Promise; + /** + * Retrieve a single page of DocumentPermissionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentPermissionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DocumentPermissionPage) => any): Promise; + page(params: DocumentPermissionListInstancePageOptions, callback?: (error: Error | null, items: DocumentPermissionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DocumentPermissionListInstance(version: Sync, serviceSid: string, documentSid: string): DocumentPermissionListInstance; +export declare class DocumentPermissionPage extends Page { + /** + * Initialize the DocumentPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: DocumentPermissionSolution); + /** + * Build an instance of DocumentPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DocumentPermissionResource): DocumentPermissionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/document/documentPermission.js b/node_modules/twilio/lib/rest/preview/sync/service/document/documentPermission.js new file mode 100644 index 00000000..cf53ef60 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/document/documentPermission.js @@ -0,0 +1,253 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DocumentPermissionPage = exports.DocumentPermissionListInstance = exports.DocumentPermissionInstance = exports.DocumentPermissionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class DocumentPermissionContextImpl { + constructor(_version, serviceSid, documentSid, identity) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(documentSid)) { + throw new Error("Parameter 'documentSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + this._solution = { serviceSid, documentSid, identity }; + this._uri = `/Services/${serviceSid}/Documents/${documentSid}/Permissions/${identity}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DocumentPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.documentSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["read"] === null || params["read"] === undefined) { + throw new Error("Required parameter \"params['read']\" missing."); + } + if (params["write"] === null || params["write"] === undefined) { + throw new Error("Required parameter \"params['write']\" missing."); + } + if (params["manage"] === null || params["manage"] === undefined) { + throw new Error("Required parameter \"params['manage']\" missing."); + } + let data = {}; + data["Read"] = serialize.bool(params["read"]); + data["Write"] = serialize.bool(params["write"]); + data["Manage"] = serialize.bool(params["manage"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.documentSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentPermissionContextImpl = DocumentPermissionContextImpl; +class DocumentPermissionInstance { + constructor(_version, payload, serviceSid, documentSid, identity) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.documentSid = payload.document_sid; + this.identity = payload.identity; + this.read = payload.read; + this.write = payload.write; + this.manage = payload.manage; + this.url = payload.url; + this._solution = { + serviceSid, + documentSid, + identity: identity || this.identity, + }; + } + get _proxy() { + this._context = + this._context || + new DocumentPermissionContextImpl(this._version, this._solution.serviceSid, this._solution.documentSid, this._solution.identity); + return this._context; + } + /** + * Remove a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + documentSid: this.documentSid, + identity: this.identity, + read: this.read, + write: this.write, + manage: this.manage, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentPermissionInstance = DocumentPermissionInstance; +function DocumentPermissionListInstance(version, serviceSid, documentSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(documentSid)) { + throw new Error("Parameter 'documentSid' is not valid."); + } + const instance = ((identity) => instance.get(identity)); + instance.get = function get(identity) { + return new DocumentPermissionContextImpl(version, serviceSid, documentSid, identity); + }; + instance._version = version; + instance._solution = { serviceSid, documentSid }; + instance._uri = `/Services/${serviceSid}/Documents/${documentSid}/Permissions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentPermissionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DocumentPermissionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DocumentPermissionListInstance = DocumentPermissionListInstance; +class DocumentPermissionPage extends Page_1.default { + /** + * Initialize the DocumentPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DocumentPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DocumentPermissionInstance(this._version, payload, this._solution.serviceSid, this._solution.documentSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentPermissionPage = DocumentPermissionPage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncList.d.ts b/node_modules/twilio/lib/rest/preview/sync/service/syncList.d.ts new file mode 100644 index 00000000..1d326cbf --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncList.d.ts @@ -0,0 +1,270 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import Sync from "../../Sync"; +import { SyncListItemListInstance } from "./syncList/syncListItem"; +import { SyncListPermissionListInstance } from "./syncList/syncListPermission"; +/** + * Options to pass to create a SyncListInstance + */ +export interface SyncListListInstanceCreateOptions { + /** */ + uniqueName?: string; +} +/** + * Options to pass to each + */ +export interface SyncListListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncListInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncListListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncListListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncListContext { + syncListItems: SyncListItemListInstance; + syncListPermissions: SyncListPermissionListInstance; + /** + * Remove a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncListContextSolution { + serviceSid: string; + sid: string; +} +export declare class SyncListContextImpl implements SyncListContext { + protected _version: Sync; + protected _solution: SyncListContextSolution; + protected _uri: string; + protected _syncListItems?: SyncListItemListInstance; + protected _syncListPermissions?: SyncListPermissionListInstance; + constructor(_version: Sync, serviceSid: string, sid: string); + get syncListItems(): SyncListItemListInstance; + get syncListPermissions(): SyncListPermissionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncListContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncListPayload extends TwilioResponsePayload { + lists: SyncListResource[]; +} +interface SyncListResource { + sid: string; + unique_name: string; + account_sid: string; + service_sid: string; + url: string; + links: Record; + revision: string; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncListInstance { + protected _version: Sync; + protected _solution: SyncListContextSolution; + protected _context?: SyncListContext; + constructor(_version: Sync, payload: SyncListResource, serviceSid: string, sid?: string); + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + private get _proxy(); + /** + * Remove a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Access the syncListItems. + */ + syncListItems(): SyncListItemListInstance; + /** + * Access the syncListPermissions. + */ + syncListPermissions(): SyncListPermissionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncListSolution { + serviceSid: string; +} +export interface SyncListListInstance { + _version: Sync; + _solution: SyncListSolution; + _uri: string; + (sid: string): SyncListContext; + get(sid: string): SyncListContext; + /** + * Create a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + create(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Create a SyncListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + create(params: SyncListListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Streams SyncListInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncListInstance, done: (err?: Error) => void) => void): void; + each(params: SyncListListInstanceEachOptions, callback?: (item: SyncListInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncListInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncListPage) => any): Promise; + /** + * Lists SyncListInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncListInstance[]) => any): Promise; + list(params: SyncListListInstanceOptions, callback?: (error: Error | null, items: SyncListInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncListInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncListPage) => any): Promise; + page(params: SyncListListInstancePageOptions, callback?: (error: Error | null, items: SyncListPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncListListInstance(version: Sync, serviceSid: string): SyncListListInstance; +export declare class SyncListPage extends Page { + /** + * Initialize the SyncListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: SyncListSolution); + /** + * Build an instance of SyncListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncListResource): SyncListInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncList.js b/node_modules/twilio/lib/rest/preview/sync/service/syncList.js new file mode 100644 index 00000000..9c21fd96 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncList.js @@ -0,0 +1,263 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncListPage = exports.SyncListListInstance = exports.SyncListInstance = exports.SyncListContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const syncListItem_1 = require("./syncList/syncListItem"); +const syncListPermission_1 = require("./syncList/syncListPermission"); +class SyncListContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Lists/${sid}`; + } + get syncListItems() { + this._syncListItems = + this._syncListItems || + (0, syncListItem_1.SyncListItemListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._syncListItems; + } + get syncListPermissions() { + this._syncListPermissions = + this._syncListPermissions || + (0, syncListPermission_1.SyncListPermissionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._syncListPermissions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncListInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListContextImpl = SyncListContextImpl; +class SyncListInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.url = payload.url; + this.links = payload.links; + this.revision = payload.revision; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SyncListContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the syncListItems. + */ + syncListItems() { + return this._proxy.syncListItems; + } + /** + * Access the syncListPermissions. + */ + syncListPermissions() { + return this._proxy.syncListPermissions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + url: this.url, + links: this.links, + revision: this.revision, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListInstance = SyncListInstance; +function SyncListListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SyncListContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Lists`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncListPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncListListInstance = SyncListListInstance; +class SyncListPage extends Page_1.default { + /** + * Initialize the SyncListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncListInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListPage = SyncListPage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListItem.d.ts b/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListItem.d.ts new file mode 100644 index 00000000..465900a7 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListItem.d.ts @@ -0,0 +1,321 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import Sync from "../../../Sync"; +export type SyncListItemQueryFromBoundType = "inclusive" | "exclusive"; +export type SyncListItemQueryResultOrder = "asc" | "desc"; +/** + * Options to pass to remove a SyncListItemInstance + */ +export interface SyncListItemContextRemoveOptions { + /** The If-Match HTTP request header */ + ifMatch?: string; +} +/** + * Options to pass to update a SyncListItemInstance + */ +export interface SyncListItemContextUpdateOptions { + /** */ + data: any; + /** The If-Match HTTP request header */ + ifMatch?: string; +} +/** + * Options to pass to create a SyncListItemInstance + */ +export interface SyncListItemListInstanceCreateOptions { + /** */ + data: any; +} +/** + * Options to pass to each + */ +export interface SyncListItemListInstanceEachOptions { + /** */ + order?: SyncListItemQueryResultOrder; + /** */ + from?: string; + /** */ + bounds?: SyncListItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncListItemInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncListItemListInstanceOptions { + /** */ + order?: SyncListItemQueryResultOrder; + /** */ + from?: string; + /** */ + bounds?: SyncListItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncListItemListInstancePageOptions { + /** */ + order?: SyncListItemQueryResultOrder; + /** */ + from?: string; + /** */ + bounds?: SyncListItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncListItemContext { + /** + * Remove a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + remove(params: SyncListItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Update a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + update(params: SyncListItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncListItemContextSolution { + serviceSid: string; + listSid: string; + index: number; +} +export declare class SyncListItemContextImpl implements SyncListItemContext { + protected _version: Sync; + protected _solution: SyncListItemContextSolution; + protected _uri: string; + constructor(_version: Sync, serviceSid: string, listSid: string, index: number); + remove(params?: SyncListItemContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + update(params: SyncListItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncListItemContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncListItemPayload extends TwilioResponsePayload { + items: SyncListItemResource[]; +} +interface SyncListItemResource { + index: number; + account_sid: string; + service_sid: string; + list_sid: string; + url: string; + revision: string; + data: any; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncListItemInstance { + protected _version: Sync; + protected _solution: SyncListItemContextSolution; + protected _context?: SyncListItemContext; + constructor(_version: Sync, payload: SyncListItemResource, serviceSid: string, listSid: string, index?: number); + index: number; + accountSid: string; + serviceSid: string; + listSid: string; + url: string; + revision: string; + data: any; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + private get _proxy(); + /** + * Remove a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + remove(params: SyncListItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Update a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + update(params: SyncListItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + index: number; + accountSid: string; + serviceSid: string; + listSid: string; + url: string; + revision: string; + data: any; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncListItemSolution { + serviceSid: string; + listSid: string; +} +export interface SyncListItemListInstance { + _version: Sync; + _solution: SyncListItemSolution; + _uri: string; + (index: number): SyncListItemContext; + get(index: number): SyncListItemContext; + /** + * Create a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + create(params: SyncListItemListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Streams SyncListItemInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListItemListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncListItemInstance, done: (err?: Error) => void) => void): void; + each(params: SyncListItemListInstanceEachOptions, callback?: (item: SyncListItemInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncListItemInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncListItemPage) => any): Promise; + /** + * Lists SyncListItemInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListItemListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncListItemInstance[]) => any): Promise; + list(params: SyncListItemListInstanceOptions, callback?: (error: Error | null, items: SyncListItemInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncListItemInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListItemListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncListItemPage) => any): Promise; + page(params: SyncListItemListInstancePageOptions, callback?: (error: Error | null, items: SyncListItemPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncListItemListInstance(version: Sync, serviceSid: string, listSid: string): SyncListItemListInstance; +export declare class SyncListItemPage extends Page { + /** + * Initialize the SyncListItemPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: SyncListItemSolution); + /** + * Build an instance of SyncListItemInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncListItemResource): SyncListItemInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListItem.js b/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListItem.js new file mode 100644 index 00000000..9d91822f --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListItem.js @@ -0,0 +1,280 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncListItemPage = exports.SyncListItemListInstance = exports.SyncListItemInstance = exports.SyncListItemContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SyncListItemContextImpl { + constructor(_version, serviceSid, listSid, index) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(listSid)) { + throw new Error("Parameter 'listSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(index)) { + throw new Error("Parameter 'index' is not valid."); + } + this._solution = { serviceSid, listSid, index }; + this._uri = `/Services/${serviceSid}/Lists/${listSid}/Items/${index}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncListItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid, instance._solution.index)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["data"] === null || params["data"] === undefined) { + throw new Error("Required parameter \"params['data']\" missing."); + } + let data = {}; + data["Data"] = serialize.object(params["data"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid, instance._solution.index)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListItemContextImpl = SyncListItemContextImpl; +class SyncListItemInstance { + constructor(_version, payload, serviceSid, listSid, index) { + this._version = _version; + this.index = deserialize.integer(payload.index); + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.listSid = payload.list_sid; + this.url = payload.url; + this.revision = payload.revision; + this.data = payload.data; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, listSid, index: index || this.index }; + } + get _proxy() { + this._context = + this._context || + new SyncListItemContextImpl(this._version, this._solution.serviceSid, this._solution.listSid, this._solution.index); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + index: this.index, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + listSid: this.listSid, + url: this.url, + revision: this.revision, + data: this.data, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListItemInstance = SyncListItemInstance; +function SyncListItemListInstance(version, serviceSid, listSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(listSid)) { + throw new Error("Parameter 'listSid' is not valid."); + } + const instance = ((index) => instance.get(index)); + instance.get = function get(index) { + return new SyncListItemContextImpl(version, serviceSid, listSid, index); + }; + instance._version = version; + instance._solution = { serviceSid, listSid }; + instance._uri = `/Services/${serviceSid}/Lists/${listSid}/Items`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["data"] === null || params["data"] === undefined) { + throw new Error("Required parameter \"params['data']\" missing."); + } + let data = {}; + data["Data"] = serialize.object(params["data"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["bounds"] !== undefined) + data["Bounds"] = params["bounds"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListItemPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncListItemPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncListItemListInstance = SyncListItemListInstance; +class SyncListItemPage extends Page_1.default { + /** + * Initialize the SyncListItemPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncListItemInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncListItemInstance(this._version, payload, this._solution.serviceSid, this._solution.listSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListItemPage = SyncListItemPage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListPermission.d.ts b/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListPermission.d.ts new file mode 100644 index 00000000..cc7ee804 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListPermission.d.ts @@ -0,0 +1,280 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import Sync from "../../../Sync"; +/** + * Options to pass to update a SyncListPermissionInstance + */ +export interface SyncListPermissionContextUpdateOptions { + /** Boolean flag specifying whether the identity can read the Sync List. */ + read: boolean; + /** Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. */ + write: boolean; + /** Boolean flag specifying whether the identity can delete the Sync List. */ + manage: boolean; +} +/** + * Options to pass to each + */ +export interface SyncListPermissionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncListPermissionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncListPermissionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncListPermissionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncListPermissionContext { + /** + * Remove a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Update a SyncListPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + update(params: SyncListPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncListPermissionContextSolution { + serviceSid: string; + listSid: string; + identity: string; +} +export declare class SyncListPermissionContextImpl implements SyncListPermissionContext { + protected _version: Sync; + protected _solution: SyncListPermissionContextSolution; + protected _uri: string; + constructor(_version: Sync, serviceSid: string, listSid: string, identity: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + update(params: SyncListPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncListPermissionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncListPermissionPayload extends TwilioResponsePayload { + permissions: SyncListPermissionResource[]; +} +interface SyncListPermissionResource { + account_sid: string; + service_sid: string; + list_sid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; +} +export declare class SyncListPermissionInstance { + protected _version: Sync; + protected _solution: SyncListPermissionContextSolution; + protected _context?: SyncListPermissionContext; + constructor(_version: Sync, payload: SyncListPermissionResource, serviceSid: string, listSid: string, identity?: string); + /** + * The unique SID identifier of the Twilio Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Sync Service Instance. + */ + serviceSid: string; + /** + * The unique SID identifier of the Sync List to which the Permission applies. + */ + listSid: string; + /** + * Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. + */ + identity: string; + /** + * Boolean flag specifying whether the identity can read the Sync List and its Items. + */ + read: boolean; + /** + * Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. + */ + write: boolean; + /** + * Boolean flag specifying whether the identity can delete the Sync List. + */ + manage: boolean; + /** + * Contains an absolute URL for this Sync List Permission. + */ + url: string; + private get _proxy(); + /** + * Remove a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Update a SyncListPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + update(params: SyncListPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + listSid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncListPermissionSolution { + serviceSid: string; + listSid: string; +} +export interface SyncListPermissionListInstance { + _version: Sync; + _solution: SyncListPermissionSolution; + _uri: string; + (identity: string): SyncListPermissionContext; + get(identity: string): SyncListPermissionContext; + /** + * Streams SyncListPermissionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListPermissionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncListPermissionInstance, done: (err?: Error) => void) => void): void; + each(params: SyncListPermissionListInstanceEachOptions, callback?: (item: SyncListPermissionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncListPermissionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncListPermissionPage) => any): Promise; + /** + * Lists SyncListPermissionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListPermissionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncListPermissionInstance[]) => any): Promise; + list(params: SyncListPermissionListInstanceOptions, callback?: (error: Error | null, items: SyncListPermissionInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncListPermissionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListPermissionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncListPermissionPage) => any): Promise; + page(params: SyncListPermissionListInstancePageOptions, callback?: (error: Error | null, items: SyncListPermissionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncListPermissionListInstance(version: Sync, serviceSid: string, listSid: string): SyncListPermissionListInstance; +export declare class SyncListPermissionPage extends Page { + /** + * Initialize the SyncListPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: SyncListPermissionSolution); + /** + * Build an instance of SyncListPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncListPermissionResource): SyncListPermissionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListPermission.js b/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListPermission.js new file mode 100644 index 00000000..802057e8 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncList/syncListPermission.js @@ -0,0 +1,253 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncListPermissionPage = exports.SyncListPermissionListInstance = exports.SyncListPermissionInstance = exports.SyncListPermissionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SyncListPermissionContextImpl { + constructor(_version, serviceSid, listSid, identity) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(listSid)) { + throw new Error("Parameter 'listSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + this._solution = { serviceSid, listSid, identity }; + this._uri = `/Services/${serviceSid}/Lists/${listSid}/Permissions/${identity}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncListPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["read"] === null || params["read"] === undefined) { + throw new Error("Required parameter \"params['read']\" missing."); + } + if (params["write"] === null || params["write"] === undefined) { + throw new Error("Required parameter \"params['write']\" missing."); + } + if (params["manage"] === null || params["manage"] === undefined) { + throw new Error("Required parameter \"params['manage']\" missing."); + } + let data = {}; + data["Read"] = serialize.bool(params["read"]); + data["Write"] = serialize.bool(params["write"]); + data["Manage"] = serialize.bool(params["manage"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListPermissionContextImpl = SyncListPermissionContextImpl; +class SyncListPermissionInstance { + constructor(_version, payload, serviceSid, listSid, identity) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.listSid = payload.list_sid; + this.identity = payload.identity; + this.read = payload.read; + this.write = payload.write; + this.manage = payload.manage; + this.url = payload.url; + this._solution = { + serviceSid, + listSid, + identity: identity || this.identity, + }; + } + get _proxy() { + this._context = + this._context || + new SyncListPermissionContextImpl(this._version, this._solution.serviceSid, this._solution.listSid, this._solution.identity); + return this._context; + } + /** + * Remove a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + listSid: this.listSid, + identity: this.identity, + read: this.read, + write: this.write, + manage: this.manage, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListPermissionInstance = SyncListPermissionInstance; +function SyncListPermissionListInstance(version, serviceSid, listSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(listSid)) { + throw new Error("Parameter 'listSid' is not valid."); + } + const instance = ((identity) => instance.get(identity)); + instance.get = function get(identity) { + return new SyncListPermissionContextImpl(version, serviceSid, listSid, identity); + }; + instance._version = version; + instance._solution = { serviceSid, listSid }; + instance._uri = `/Services/${serviceSid}/Lists/${listSid}/Permissions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListPermissionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncListPermissionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncListPermissionListInstance = SyncListPermissionListInstance; +class SyncListPermissionPage extends Page_1.default { + /** + * Initialize the SyncListPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncListPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncListPermissionInstance(this._version, payload, this._solution.serviceSid, this._solution.listSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListPermissionPage = SyncListPermissionPage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncMap.d.ts b/node_modules/twilio/lib/rest/preview/sync/service/syncMap.d.ts new file mode 100644 index 00000000..88bd4f32 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncMap.d.ts @@ -0,0 +1,270 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import Sync from "../../Sync"; +import { SyncMapItemListInstance } from "./syncMap/syncMapItem"; +import { SyncMapPermissionListInstance } from "./syncMap/syncMapPermission"; +/** + * Options to pass to create a SyncMapInstance + */ +export interface SyncMapListInstanceCreateOptions { + /** */ + uniqueName?: string; +} +/** + * Options to pass to each + */ +export interface SyncMapListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncMapInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncMapListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncMapListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncMapContext { + syncMapItems: SyncMapItemListInstance; + syncMapPermissions: SyncMapPermissionListInstance; + /** + * Remove a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncMapContextSolution { + serviceSid: string; + sid: string; +} +export declare class SyncMapContextImpl implements SyncMapContext { + protected _version: Sync; + protected _solution: SyncMapContextSolution; + protected _uri: string; + protected _syncMapItems?: SyncMapItemListInstance; + protected _syncMapPermissions?: SyncMapPermissionListInstance; + constructor(_version: Sync, serviceSid: string, sid: string); + get syncMapItems(): SyncMapItemListInstance; + get syncMapPermissions(): SyncMapPermissionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncMapContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncMapPayload extends TwilioResponsePayload { + maps: SyncMapResource[]; +} +interface SyncMapResource { + sid: string; + unique_name: string; + account_sid: string; + service_sid: string; + url: string; + links: Record; + revision: string; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncMapInstance { + protected _version: Sync; + protected _solution: SyncMapContextSolution; + protected _context?: SyncMapContext; + constructor(_version: Sync, payload: SyncMapResource, serviceSid: string, sid?: string); + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + private get _proxy(); + /** + * Remove a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Access the syncMapItems. + */ + syncMapItems(): SyncMapItemListInstance; + /** + * Access the syncMapPermissions. + */ + syncMapPermissions(): SyncMapPermissionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncMapSolution { + serviceSid: string; +} +export interface SyncMapListInstance { + _version: Sync; + _solution: SyncMapSolution; + _uri: string; + (sid: string): SyncMapContext; + get(sid: string): SyncMapContext; + /** + * Create a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + create(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Create a SyncMapInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + create(params: SyncMapListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Streams SyncMapInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncMapInstance, done: (err?: Error) => void) => void): void; + each(params: SyncMapListInstanceEachOptions, callback?: (item: SyncMapInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncMapInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncMapPage) => any): Promise; + /** + * Lists SyncMapInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncMapInstance[]) => any): Promise; + list(params: SyncMapListInstanceOptions, callback?: (error: Error | null, items: SyncMapInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncMapInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncMapPage) => any): Promise; + page(params: SyncMapListInstancePageOptions, callback?: (error: Error | null, items: SyncMapPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncMapListInstance(version: Sync, serviceSid: string): SyncMapListInstance; +export declare class SyncMapPage extends Page { + /** + * Initialize the SyncMapPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: SyncMapSolution); + /** + * Build an instance of SyncMapInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncMapResource): SyncMapInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncMap.js b/node_modules/twilio/lib/rest/preview/sync/service/syncMap.js new file mode 100644 index 00000000..7f8a6fb2 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncMap.js @@ -0,0 +1,263 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncMapPage = exports.SyncMapListInstance = exports.SyncMapInstance = exports.SyncMapContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const syncMapItem_1 = require("./syncMap/syncMapItem"); +const syncMapPermission_1 = require("./syncMap/syncMapPermission"); +class SyncMapContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Maps/${sid}`; + } + get syncMapItems() { + this._syncMapItems = + this._syncMapItems || + (0, syncMapItem_1.SyncMapItemListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._syncMapItems; + } + get syncMapPermissions() { + this._syncMapPermissions = + this._syncMapPermissions || + (0, syncMapPermission_1.SyncMapPermissionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._syncMapPermissions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncMapInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapContextImpl = SyncMapContextImpl; +class SyncMapInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.url = payload.url; + this.links = payload.links; + this.revision = payload.revision; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SyncMapContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the syncMapItems. + */ + syncMapItems() { + return this._proxy.syncMapItems; + } + /** + * Access the syncMapPermissions. + */ + syncMapPermissions() { + return this._proxy.syncMapPermissions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + url: this.url, + links: this.links, + revision: this.revision, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapInstance = SyncMapInstance; +function SyncMapListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SyncMapContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Maps`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncMapPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncMapListInstance = SyncMapListInstance; +class SyncMapPage extends Page_1.default { + /** + * Initialize the SyncMapPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncMapInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncMapInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapPage = SyncMapPage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapItem.d.ts b/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapItem.d.ts new file mode 100644 index 00000000..774f46a2 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapItem.d.ts @@ -0,0 +1,323 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import Sync from "../../../Sync"; +export type SyncMapItemQueryFromBoundType = "inclusive" | "exclusive"; +export type SyncMapItemQueryResultOrder = "asc" | "desc"; +/** + * Options to pass to remove a SyncMapItemInstance + */ +export interface SyncMapItemContextRemoveOptions { + /** The If-Match HTTP request header */ + ifMatch?: string; +} +/** + * Options to pass to update a SyncMapItemInstance + */ +export interface SyncMapItemContextUpdateOptions { + /** */ + data: any; + /** The If-Match HTTP request header */ + ifMatch?: string; +} +/** + * Options to pass to create a SyncMapItemInstance + */ +export interface SyncMapItemListInstanceCreateOptions { + /** */ + key: string; + /** */ + data: any; +} +/** + * Options to pass to each + */ +export interface SyncMapItemListInstanceEachOptions { + /** */ + order?: SyncMapItemQueryResultOrder; + /** */ + from?: string; + /** */ + bounds?: SyncMapItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncMapItemListInstanceOptions { + /** */ + order?: SyncMapItemQueryResultOrder; + /** */ + from?: string; + /** */ + bounds?: SyncMapItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncMapItemListInstancePageOptions { + /** */ + order?: SyncMapItemQueryResultOrder; + /** */ + from?: string; + /** */ + bounds?: SyncMapItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncMapItemContext { + /** + * Remove a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + remove(params: SyncMapItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Update a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + update(params: SyncMapItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncMapItemContextSolution { + serviceSid: string; + mapSid: string; + key: string; +} +export declare class SyncMapItemContextImpl implements SyncMapItemContext { + protected _version: Sync; + protected _solution: SyncMapItemContextSolution; + protected _uri: string; + constructor(_version: Sync, serviceSid: string, mapSid: string, key: string); + remove(params?: SyncMapItemContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + update(params: SyncMapItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncMapItemContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncMapItemPayload extends TwilioResponsePayload { + items: SyncMapItemResource[]; +} +interface SyncMapItemResource { + key: string; + account_sid: string; + service_sid: string; + map_sid: string; + url: string; + revision: string; + data: any; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncMapItemInstance { + protected _version: Sync; + protected _solution: SyncMapItemContextSolution; + protected _context?: SyncMapItemContext; + constructor(_version: Sync, payload: SyncMapItemResource, serviceSid: string, mapSid: string, key?: string); + key: string; + accountSid: string; + serviceSid: string; + mapSid: string; + url: string; + revision: string; + data: any; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + private get _proxy(); + /** + * Remove a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + remove(params: SyncMapItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Update a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + update(params: SyncMapItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + key: string; + accountSid: string; + serviceSid: string; + mapSid: string; + url: string; + revision: string; + data: any; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncMapItemSolution { + serviceSid: string; + mapSid: string; +} +export interface SyncMapItemListInstance { + _version: Sync; + _solution: SyncMapItemSolution; + _uri: string; + (key: string): SyncMapItemContext; + get(key: string): SyncMapItemContext; + /** + * Create a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + create(params: SyncMapItemListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Streams SyncMapItemInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapItemListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void): void; + each(params: SyncMapItemListInstanceEachOptions, callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncMapItemInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise; + /** + * Lists SyncMapItemInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapItemListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncMapItemInstance[]) => any): Promise; + list(params: SyncMapItemListInstanceOptions, callback?: (error: Error | null, items: SyncMapItemInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncMapItemInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapItemListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise; + page(params: SyncMapItemListInstancePageOptions, callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncMapItemListInstance(version: Sync, serviceSid: string, mapSid: string): SyncMapItemListInstance; +export declare class SyncMapItemPage extends Page { + /** + * Initialize the SyncMapItemPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: SyncMapItemSolution); + /** + * Build an instance of SyncMapItemInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncMapItemResource): SyncMapItemInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapItem.js b/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapItem.js new file mode 100644 index 00000000..c863b5d9 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapItem.js @@ -0,0 +1,284 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncMapItemPage = exports.SyncMapItemListInstance = exports.SyncMapItemInstance = exports.SyncMapItemContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SyncMapItemContextImpl { + constructor(_version, serviceSid, mapSid, key) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(mapSid)) { + throw new Error("Parameter 'mapSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(key)) { + throw new Error("Parameter 'key' is not valid."); + } + this._solution = { serviceSid, mapSid, key }; + this._uri = `/Services/${serviceSid}/Maps/${mapSid}/Items/${key}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["data"] === null || params["data"] === undefined) { + throw new Error("Required parameter \"params['data']\" missing."); + } + let data = {}; + data["Data"] = serialize.object(params["data"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapItemContextImpl = SyncMapItemContextImpl; +class SyncMapItemInstance { + constructor(_version, payload, serviceSid, mapSid, key) { + this._version = _version; + this.key = payload.key; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.mapSid = payload.map_sid; + this.url = payload.url; + this.revision = payload.revision; + this.data = payload.data; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, mapSid, key: key || this.key }; + } + get _proxy() { + this._context = + this._context || + new SyncMapItemContextImpl(this._version, this._solution.serviceSid, this._solution.mapSid, this._solution.key); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + key: this.key, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + mapSid: this.mapSid, + url: this.url, + revision: this.revision, + data: this.data, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapItemInstance = SyncMapItemInstance; +function SyncMapItemListInstance(version, serviceSid, mapSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(mapSid)) { + throw new Error("Parameter 'mapSid' is not valid."); + } + const instance = ((key) => instance.get(key)); + instance.get = function get(key) { + return new SyncMapItemContextImpl(version, serviceSid, mapSid, key); + }; + instance._version = version; + instance._solution = { serviceSid, mapSid }; + instance._uri = `/Services/${serviceSid}/Maps/${mapSid}/Items`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["key"] === null || params["key"] === undefined) { + throw new Error("Required parameter \"params['key']\" missing."); + } + if (params["data"] === null || params["data"] === undefined) { + throw new Error("Required parameter \"params['data']\" missing."); + } + let data = {}; + data["Key"] = params["key"]; + data["Data"] = serialize.object(params["data"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["bounds"] !== undefined) + data["Bounds"] = params["bounds"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapItemPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncMapItemPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncMapItemListInstance = SyncMapItemListInstance; +class SyncMapItemPage extends Page_1.default { + /** + * Initialize the SyncMapItemPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncMapItemInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncMapItemInstance(this._version, payload, this._solution.serviceSid, this._solution.mapSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapItemPage = SyncMapItemPage; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapPermission.d.ts b/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapPermission.d.ts new file mode 100644 index 00000000..4b3da198 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapPermission.d.ts @@ -0,0 +1,280 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import Sync from "../../../Sync"; +/** + * Options to pass to update a SyncMapPermissionInstance + */ +export interface SyncMapPermissionContextUpdateOptions { + /** Boolean flag specifying whether the identity can read the Sync Map. */ + read: boolean; + /** Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. */ + write: boolean; + /** Boolean flag specifying whether the identity can delete the Sync Map. */ + manage: boolean; +} +/** + * Options to pass to each + */ +export interface SyncMapPermissionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncMapPermissionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncMapPermissionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncMapPermissionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncMapPermissionContext { + /** + * Remove a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Update a SyncMapPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + update(params: SyncMapPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncMapPermissionContextSolution { + serviceSid: string; + mapSid: string; + identity: string; +} +export declare class SyncMapPermissionContextImpl implements SyncMapPermissionContext { + protected _version: Sync; + protected _solution: SyncMapPermissionContextSolution; + protected _uri: string; + constructor(_version: Sync, serviceSid: string, mapSid: string, identity: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + update(params: SyncMapPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncMapPermissionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncMapPermissionPayload extends TwilioResponsePayload { + permissions: SyncMapPermissionResource[]; +} +interface SyncMapPermissionResource { + account_sid: string; + service_sid: string; + map_sid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; +} +export declare class SyncMapPermissionInstance { + protected _version: Sync; + protected _solution: SyncMapPermissionContextSolution; + protected _context?: SyncMapPermissionContext; + constructor(_version: Sync, payload: SyncMapPermissionResource, serviceSid: string, mapSid: string, identity?: string); + /** + * The unique SID identifier of the Twilio Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Sync Service Instance. + */ + serviceSid: string; + /** + * The unique SID identifier of the Sync Map to which the Permission applies. + */ + mapSid: string; + /** + * Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. + */ + identity: string; + /** + * Boolean flag specifying whether the identity can read the Sync Map and its Items. + */ + read: boolean; + /** + * Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. + */ + write: boolean; + /** + * Boolean flag specifying whether the identity can delete the Sync Map. + */ + manage: boolean; + /** + * Contains an absolute URL for this Sync Map Permission. + */ + url: string; + private get _proxy(); + /** + * Remove a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Update a SyncMapPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + update(params: SyncMapPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + mapSid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncMapPermissionSolution { + serviceSid: string; + mapSid: string; +} +export interface SyncMapPermissionListInstance { + _version: Sync; + _solution: SyncMapPermissionSolution; + _uri: string; + (identity: string): SyncMapPermissionContext; + get(identity: string): SyncMapPermissionContext; + /** + * Streams SyncMapPermissionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapPermissionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncMapPermissionInstance, done: (err?: Error) => void) => void): void; + each(params: SyncMapPermissionListInstanceEachOptions, callback?: (item: SyncMapPermissionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncMapPermissionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncMapPermissionPage) => any): Promise; + /** + * Lists SyncMapPermissionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapPermissionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncMapPermissionInstance[]) => any): Promise; + list(params: SyncMapPermissionListInstanceOptions, callback?: (error: Error | null, items: SyncMapPermissionInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncMapPermissionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapPermissionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncMapPermissionPage) => any): Promise; + page(params: SyncMapPermissionListInstancePageOptions, callback?: (error: Error | null, items: SyncMapPermissionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncMapPermissionListInstance(version: Sync, serviceSid: string, mapSid: string): SyncMapPermissionListInstance; +export declare class SyncMapPermissionPage extends Page { + /** + * Initialize the SyncMapPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Sync, response: Response, solution: SyncMapPermissionSolution); + /** + * Build an instance of SyncMapPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncMapPermissionResource): SyncMapPermissionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapPermission.js b/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapPermission.js new file mode 100644 index 00000000..47c01e57 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/sync/service/syncMap/syncMapPermission.js @@ -0,0 +1,253 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncMapPermissionPage = exports.SyncMapPermissionListInstance = exports.SyncMapPermissionInstance = exports.SyncMapPermissionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SyncMapPermissionContextImpl { + constructor(_version, serviceSid, mapSid, identity) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(mapSid)) { + throw new Error("Parameter 'mapSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + this._solution = { serviceSid, mapSid, identity }; + this._uri = `/Services/${serviceSid}/Maps/${mapSid}/Permissions/${identity}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncMapPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["read"] === null || params["read"] === undefined) { + throw new Error("Required parameter \"params['read']\" missing."); + } + if (params["write"] === null || params["write"] === undefined) { + throw new Error("Required parameter \"params['write']\" missing."); + } + if (params["manage"] === null || params["manage"] === undefined) { + throw new Error("Required parameter \"params['manage']\" missing."); + } + let data = {}; + data["Read"] = serialize.bool(params["read"]); + data["Write"] = serialize.bool(params["write"]); + data["Manage"] = serialize.bool(params["manage"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapPermissionContextImpl = SyncMapPermissionContextImpl; +class SyncMapPermissionInstance { + constructor(_version, payload, serviceSid, mapSid, identity) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.mapSid = payload.map_sid; + this.identity = payload.identity; + this.read = payload.read; + this.write = payload.write; + this.manage = payload.manage; + this.url = payload.url; + this._solution = { + serviceSid, + mapSid, + identity: identity || this.identity, + }; + } + get _proxy() { + this._context = + this._context || + new SyncMapPermissionContextImpl(this._version, this._solution.serviceSid, this._solution.mapSid, this._solution.identity); + return this._context; + } + /** + * Remove a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + mapSid: this.mapSid, + identity: this.identity, + read: this.read, + write: this.write, + manage: this.manage, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapPermissionInstance = SyncMapPermissionInstance; +function SyncMapPermissionListInstance(version, serviceSid, mapSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(mapSid)) { + throw new Error("Parameter 'mapSid' is not valid."); + } + const instance = ((identity) => instance.get(identity)); + instance.get = function get(identity) { + return new SyncMapPermissionContextImpl(version, serviceSid, mapSid, identity); + }; + instance._version = version; + instance._solution = { serviceSid, mapSid }; + instance._uri = `/Services/${serviceSid}/Maps/${mapSid}/Permissions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapPermissionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncMapPermissionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncMapPermissionListInstance = SyncMapPermissionListInstance; +class SyncMapPermissionPage extends Page_1.default { + /** + * Initialize the SyncMapPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncMapPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncMapPermissionInstance(this._version, payload, this._solution.serviceSid, this._solution.mapSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapPermissionPage = SyncMapPermissionPage; diff --git a/node_modules/twilio/lib/rest/preview/wireless/command.d.ts b/node_modules/twilio/lib/rest/preview/wireless/command.d.ts new file mode 100644 index 00000000..fb8b87b4 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/wireless/command.d.ts @@ -0,0 +1,266 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import Wireless from "../Wireless"; +/** + * Options to pass to create a CommandInstance + */ +export interface CommandListInstanceCreateOptions { + /** */ + command: string; + /** */ + device?: string; + /** */ + sim?: string; + /** */ + callbackMethod?: string; + /** */ + callbackUrl?: string; + /** */ + commandMode?: string; + /** */ + includeSid?: string; +} +/** + * Options to pass to each + */ +export interface CommandListInstanceEachOptions { + /** */ + device?: string; + /** */ + sim?: string; + /** */ + status?: string; + /** */ + direction?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CommandInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CommandListInstanceOptions { + /** */ + device?: string; + /** */ + sim?: string; + /** */ + status?: string; + /** */ + direction?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CommandListInstancePageOptions { + /** */ + device?: string; + /** */ + sim?: string; + /** */ + status?: string; + /** */ + direction?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CommandContext { + /** + * Fetch a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CommandInstance + */ + fetch(callback?: (error: Error | null, item?: CommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CommandContextSolution { + sid: string; +} +export declare class CommandContextImpl implements CommandContext { + protected _version: Wireless; + protected _solution: CommandContextSolution; + protected _uri: string; + constructor(_version: Wireless, sid: string); + fetch(callback?: (error: Error | null, item?: CommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CommandContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CommandPayload extends TwilioResponsePayload { + commands: CommandResource[]; +} +interface CommandResource { + sid: string; + account_sid: string; + device_sid: string; + sim_sid: string; + command: string; + command_mode: string; + status: string; + direction: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CommandInstance { + protected _version: Wireless; + protected _solution: CommandContextSolution; + protected _context?: CommandContext; + constructor(_version: Wireless, payload: CommandResource, sid?: string); + sid: string; + accountSid: string; + deviceSid: string; + simSid: string; + command: string; + commandMode: string; + status: string; + direction: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + private get _proxy(); + /** + * Fetch a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CommandInstance + */ + fetch(callback?: (error: Error | null, item?: CommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + deviceSid: string; + simSid: string; + command: string; + commandMode: string; + status: string; + direction: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CommandSolution { +} +export interface CommandListInstance { + _version: Wireless; + _solution: CommandSolution; + _uri: string; + (sid: string): CommandContext; + get(sid: string): CommandContext; + /** + * Create a CommandInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CommandInstance + */ + create(params: CommandListInstanceCreateOptions, callback?: (error: Error | null, item?: CommandInstance) => any): Promise; + /** + * Streams CommandInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CommandListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CommandInstance, done: (err?: Error) => void) => void): void; + each(params: CommandListInstanceEachOptions, callback?: (item: CommandInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CommandInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CommandPage) => any): Promise; + /** + * Lists CommandInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CommandListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CommandInstance[]) => any): Promise; + list(params: CommandListInstanceOptions, callback?: (error: Error | null, items: CommandInstance[]) => any): Promise; + /** + * Retrieve a single page of CommandInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CommandListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CommandPage) => any): Promise; + page(params: CommandListInstancePageOptions, callback?: (error: Error | null, items: CommandPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CommandListInstance(version: Wireless): CommandListInstance; +export declare class CommandPage extends Page { + /** + * Initialize the CommandPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Wireless, response: Response, solution: CommandSolution); + /** + * Build an instance of CommandInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CommandResource): CommandInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/wireless/command.js b/node_modules/twilio/lib/rest/preview/wireless/command.js new file mode 100644 index 00000000..56e13eb0 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/wireless/command.js @@ -0,0 +1,232 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CommandPage = exports.CommandListInstance = exports.CommandInstance = exports.CommandContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CommandContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Commands/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CommandInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CommandContextImpl = CommandContextImpl; +class CommandInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.deviceSid = payload.device_sid; + this.simSid = payload.sim_sid; + this.command = payload.command; + this.commandMode = payload.command_mode; + this.status = payload.status; + this.direction = payload.direction; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CommandContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CommandInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + deviceSid: this.deviceSid, + simSid: this.simSid, + command: this.command, + commandMode: this.commandMode, + status: this.status, + direction: this.direction, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CommandInstance = CommandInstance; +function CommandListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CommandContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Commands`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["command"] === null || params["command"] === undefined) { + throw new Error("Required parameter \"params['command']\" missing."); + } + let data = {}; + data["Command"] = params["command"]; + if (params["device"] !== undefined) + data["Device"] = params["device"]; + if (params["sim"] !== undefined) + data["Sim"] = params["sim"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["commandMode"] !== undefined) + data["CommandMode"] = params["commandMode"]; + if (params["includeSid"] !== undefined) + data["IncludeSid"] = params["includeSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CommandInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["device"] !== undefined) + data["Device"] = params["device"]; + if (params["sim"] !== undefined) + data["Sim"] = params["sim"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["direction"] !== undefined) + data["Direction"] = params["direction"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CommandPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CommandPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CommandListInstance = CommandListInstance; +class CommandPage extends Page_1.default { + /** + * Initialize the CommandPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CommandInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CommandInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CommandPage = CommandPage; diff --git a/node_modules/twilio/lib/rest/preview/wireless/ratePlan.d.ts b/node_modules/twilio/lib/rest/preview/wireless/ratePlan.d.ts new file mode 100644 index 00000000..e28b057c --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/wireless/ratePlan.d.ts @@ -0,0 +1,326 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import Wireless from "../Wireless"; +/** + * Options to pass to update a RatePlanInstance + */ +export interface RatePlanContextUpdateOptions { + /** */ + uniqueName?: string; + /** */ + friendlyName?: string; +} +/** + * Options to pass to create a RatePlanInstance + */ +export interface RatePlanListInstanceCreateOptions { + /** */ + uniqueName?: string; + /** */ + friendlyName?: string; + /** */ + dataEnabled?: boolean; + /** */ + dataLimit?: number; + /** */ + dataMetering?: string; + /** */ + messagingEnabled?: boolean; + /** */ + voiceEnabled?: boolean; + /** */ + commandsEnabled?: boolean; + /** */ + nationalRoamingEnabled?: boolean; + /** */ + internationalRoaming?: Array; +} +/** + * Options to pass to each + */ +export interface RatePlanListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RatePlanInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RatePlanListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RatePlanListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RatePlanContext { + /** + * Remove a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + fetch(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Update a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + update(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Update a RatePlanInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + update(params: RatePlanContextUpdateOptions, callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RatePlanContextSolution { + sid: string; +} +export declare class RatePlanContextImpl implements RatePlanContext { + protected _version: Wireless; + protected _solution: RatePlanContextSolution; + protected _uri: string; + constructor(_version: Wireless, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + update(params?: RatePlanContextUpdateOptions | ((error: Error | null, item?: RatePlanInstance) => any), callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RatePlanContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RatePlanPayload extends TwilioResponsePayload { + rate_plans: RatePlanResource[]; +} +interface RatePlanResource { + sid: string; + unique_name: string; + account_sid: string; + friendly_name: string; + data_enabled: boolean; + data_metering: string; + data_limit: number; + messaging_enabled: boolean; + voice_enabled: boolean; + national_roaming_enabled: boolean; + international_roaming: Array; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class RatePlanInstance { + protected _version: Wireless; + protected _solution: RatePlanContextSolution; + protected _context?: RatePlanContext; + constructor(_version: Wireless, payload: RatePlanResource, sid?: string); + sid: string; + uniqueName: string; + accountSid: string; + friendlyName: string; + dataEnabled: boolean; + dataMetering: string; + dataLimit: number; + messagingEnabled: boolean; + voiceEnabled: boolean; + nationalRoamingEnabled: boolean; + internationalRoaming: Array; + dateCreated: Date; + dateUpdated: Date; + url: string; + private get _proxy(); + /** + * Remove a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + fetch(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Update a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + update(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Update a RatePlanInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + update(params: RatePlanContextUpdateOptions, callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + friendlyName: string; + dataEnabled: boolean; + dataMetering: string; + dataLimit: number; + messagingEnabled: boolean; + voiceEnabled: boolean; + nationalRoamingEnabled: boolean; + internationalRoaming: string[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RatePlanSolution { +} +export interface RatePlanListInstance { + _version: Wireless; + _solution: RatePlanSolution; + _uri: string; + (sid: string): RatePlanContext; + get(sid: string): RatePlanContext; + /** + * Create a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + create(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Create a RatePlanInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + create(params: RatePlanListInstanceCreateOptions, callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Streams RatePlanInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RatePlanListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RatePlanInstance, done: (err?: Error) => void) => void): void; + each(params: RatePlanListInstanceEachOptions, callback?: (item: RatePlanInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RatePlanInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RatePlanPage) => any): Promise; + /** + * Lists RatePlanInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RatePlanListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RatePlanInstance[]) => any): Promise; + list(params: RatePlanListInstanceOptions, callback?: (error: Error | null, items: RatePlanInstance[]) => any): Promise; + /** + * Retrieve a single page of RatePlanInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RatePlanListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RatePlanPage) => any): Promise; + page(params: RatePlanListInstancePageOptions, callback?: (error: Error | null, items: RatePlanPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RatePlanListInstance(version: Wireless): RatePlanListInstance; +export declare class RatePlanPage extends Page { + /** + * Initialize the RatePlanPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Wireless, response: Response, solution: RatePlanSolution); + /** + * Build an instance of RatePlanInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RatePlanResource): RatePlanInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/wireless/ratePlan.js b/node_modules/twilio/lib/rest/preview/wireless/ratePlan.js new file mode 100644 index 00000000..6e6950be --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/wireless/ratePlan.js @@ -0,0 +1,286 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RatePlanPage = exports.RatePlanListInstance = exports.RatePlanInstance = exports.RatePlanContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class RatePlanContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/RatePlans/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RatePlanInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RatePlanInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RatePlanContextImpl = RatePlanContextImpl; +class RatePlanInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dataEnabled = payload.data_enabled; + this.dataMetering = payload.data_metering; + this.dataLimit = deserialize.integer(payload.data_limit); + this.messagingEnabled = payload.messaging_enabled; + this.voiceEnabled = payload.voice_enabled; + this.nationalRoamingEnabled = payload.national_roaming_enabled; + this.internationalRoaming = payload.international_roaming; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RatePlanContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dataEnabled: this.dataEnabled, + dataMetering: this.dataMetering, + dataLimit: this.dataLimit, + messagingEnabled: this.messagingEnabled, + voiceEnabled: this.voiceEnabled, + nationalRoamingEnabled: this.nationalRoamingEnabled, + internationalRoaming: this.internationalRoaming, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RatePlanInstance = RatePlanInstance; +function RatePlanListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RatePlanContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/RatePlans`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["dataEnabled"] !== undefined) + data["DataEnabled"] = serialize.bool(params["dataEnabled"]); + if (params["dataLimit"] !== undefined) + data["DataLimit"] = params["dataLimit"]; + if (params["dataMetering"] !== undefined) + data["DataMetering"] = params["dataMetering"]; + if (params["messagingEnabled"] !== undefined) + data["MessagingEnabled"] = serialize.bool(params["messagingEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["commandsEnabled"] !== undefined) + data["CommandsEnabled"] = serialize.bool(params["commandsEnabled"]); + if (params["nationalRoamingEnabled"] !== undefined) + data["NationalRoamingEnabled"] = serialize.bool(params["nationalRoamingEnabled"]); + if (params["internationalRoaming"] !== undefined) + data["InternationalRoaming"] = serialize.map(params["internationalRoaming"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RatePlanInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RatePlanPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RatePlanPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RatePlanListInstance = RatePlanListInstance; +class RatePlanPage extends Page_1.default { + /** + * Initialize the RatePlanPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RatePlanInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RatePlanInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RatePlanPage = RatePlanPage; diff --git a/node_modules/twilio/lib/rest/preview/wireless/sim.d.ts b/node_modules/twilio/lib/rest/preview/wireless/sim.d.ts new file mode 100644 index 00000000..ce01c6da --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/wireless/sim.d.ts @@ -0,0 +1,357 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import Wireless from "../Wireless"; +import { UsageListInstance } from "./sim/usage"; +/** + * Options to pass to update a SimInstance + */ +export interface SimContextUpdateOptions { + /** */ + uniqueName?: string; + /** */ + callbackMethod?: string; + /** */ + callbackUrl?: string; + /** */ + friendlyName?: string; + /** */ + ratePlan?: string; + /** */ + status?: string; + /** */ + commandsCallbackMethod?: string; + /** */ + commandsCallbackUrl?: string; + /** */ + smsFallbackMethod?: string; + /** */ + smsFallbackUrl?: string; + /** */ + smsMethod?: string; + /** */ + smsUrl?: string; + /** */ + voiceFallbackMethod?: string; + /** */ + voiceFallbackUrl?: string; + /** */ + voiceMethod?: string; + /** */ + voiceUrl?: string; +} +/** + * Options to pass to each + */ +export interface SimListInstanceEachOptions { + /** */ + status?: string; + /** */ + iccid?: string; + /** */ + ratePlan?: string; + /** */ + eId?: string; + /** */ + simRegistrationCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SimInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SimListInstanceOptions { + /** */ + status?: string; + /** */ + iccid?: string; + /** */ + ratePlan?: string; + /** */ + eId?: string; + /** */ + simRegistrationCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SimListInstancePageOptions { + /** */ + status?: string; + /** */ + iccid?: string; + /** */ + ratePlan?: string; + /** */ + eId?: string; + /** */ + simRegistrationCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SimContext { + usage: UsageListInstance; + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(params: SimContextUpdateOptions, callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SimContextSolution { + sid: string; +} +export declare class SimContextImpl implements SimContext { + protected _version: Wireless; + protected _solution: SimContextSolution; + protected _uri: string; + protected _usage?: UsageListInstance; + constructor(_version: Wireless, sid: string); + get usage(): UsageListInstance; + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + update(params?: SimContextUpdateOptions | ((error: Error | null, item?: SimInstance) => any), callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SimContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SimPayload extends TwilioResponsePayload { + sims: SimResource[]; +} +interface SimResource { + sid: string; + unique_name: string; + account_sid: string; + rate_plan_sid: string; + friendly_name: string; + iccid: string; + e_id: string; + status: string; + commands_callback_url: string; + commands_callback_method: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_url: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class SimInstance { + protected _version: Wireless; + protected _solution: SimContextSolution; + protected _context?: SimContext; + constructor(_version: Wireless, payload: SimResource, sid?: string); + sid: string; + uniqueName: string; + accountSid: string; + ratePlanSid: string; + friendlyName: string; + iccid: string; + eId: string; + status: string; + commandsCallbackUrl: string; + commandsCallbackMethod: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + private get _proxy(); + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(params: SimContextUpdateOptions, callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Access the usage. + */ + usage(): UsageListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + ratePlanSid: string; + friendlyName: string; + iccid: string; + eId: string; + status: string; + commandsCallbackUrl: string; + commandsCallbackMethod: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SimSolution { +} +export interface SimListInstance { + _version: Wireless; + _solution: SimSolution; + _uri: string; + (sid: string): SimContext; + get(sid: string): SimContext; + /** + * Streams SimInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SimInstance, done: (err?: Error) => void) => void): void; + each(params: SimListInstanceEachOptions, callback?: (item: SimInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SimInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SimPage) => any): Promise; + /** + * Lists SimInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SimInstance[]) => any): Promise; + list(params: SimListInstanceOptions, callback?: (error: Error | null, items: SimInstance[]) => any): Promise; + /** + * Retrieve a single page of SimInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SimPage) => any): Promise; + page(params: SimListInstancePageOptions, callback?: (error: Error | null, items: SimPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SimListInstance(version: Wireless): SimListInstance; +export declare class SimPage extends Page { + /** + * Initialize the SimPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Wireless, response: Response, solution: SimSolution); + /** + * Build an instance of SimInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SimResource): SimInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/preview/wireless/sim.js b/node_modules/twilio/lib/rest/preview/wireless/sim.js new file mode 100644 index 00000000..289d30f1 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/wireless/sim.js @@ -0,0 +1,291 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SimPage = exports.SimListInstance = exports.SimInstance = exports.SimContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const usage_1 = require("./sim/usage"); +class SimContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Sims/${sid}`; + } + get usage() { + this._usage = + this._usage || (0, usage_1.UsageListInstance)(this._version, this._solution.sid); + return this._usage; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SimInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["ratePlan"] !== undefined) + data["RatePlan"] = params["ratePlan"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["commandsCallbackMethod"] !== undefined) + data["CommandsCallbackMethod"] = params["commandsCallbackMethod"]; + if (params["commandsCallbackUrl"] !== undefined) + data["CommandsCallbackUrl"] = params["commandsCallbackUrl"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SimInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimContextImpl = SimContextImpl; +class SimInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.ratePlanSid = payload.rate_plan_sid; + this.friendlyName = payload.friendly_name; + this.iccid = payload.iccid; + this.eId = payload.e_id; + this.status = payload.status; + this.commandsCallbackUrl = payload.commands_callback_url; + this.commandsCallbackMethod = payload.commands_callback_method; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceUrl = payload.voice_url; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new SimContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the usage. + */ + usage() { + return this._proxy.usage; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + ratePlanSid: this.ratePlanSid, + friendlyName: this.friendlyName, + iccid: this.iccid, + eId: this.eId, + status: this.status, + commandsCallbackUrl: this.commandsCallbackUrl, + commandsCallbackMethod: this.commandsCallbackMethod, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceUrl: this.voiceUrl, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimInstance = SimInstance; +function SimListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SimContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Sims`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["iccid"] !== undefined) + data["Iccid"] = params["iccid"]; + if (params["ratePlan"] !== undefined) + data["RatePlan"] = params["ratePlan"]; + if (params["eId"] !== undefined) + data["EId"] = params["eId"]; + if (params["simRegistrationCode"] !== undefined) + data["SimRegistrationCode"] = params["simRegistrationCode"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SimPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SimPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SimListInstance = SimListInstance; +class SimPage extends Page_1.default { + /** + * Initialize the SimPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SimInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SimInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimPage = SimPage; diff --git a/node_modules/twilio/lib/rest/preview/wireless/sim/usage.d.ts b/node_modules/twilio/lib/rest/preview/wireless/sim/usage.d.ts new file mode 100644 index 00000000..22d59794 --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/wireless/sim/usage.d.ts @@ -0,0 +1,131 @@ +/// +import { inspect, InspectOptions } from "util"; +import Wireless from "../../Wireless"; +/** + * Options to pass to fetch a UsageInstance + */ +export interface UsageContextFetchOptions { + /** */ + end?: string; + /** */ + start?: string; +} +export interface UsageContext { + /** + * Fetch a UsageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsageInstance + */ + fetch(callback?: (error: Error | null, item?: UsageInstance) => any): Promise; + /** + * Fetch a UsageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsageInstance + */ + fetch(params: UsageContextFetchOptions, callback?: (error: Error | null, item?: UsageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface UsageContextSolution { + simSid: string; +} +export declare class UsageContextImpl implements UsageContext { + protected _version: Wireless; + protected _solution: UsageContextSolution; + protected _uri: string; + constructor(_version: Wireless, simSid: string); + fetch(params?: UsageContextFetchOptions | ((error: Error | null, item?: UsageInstance) => any), callback?: (error: Error | null, item?: UsageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): UsageContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface UsageResource { + sim_sid: string; + sim_unique_name: string; + account_sid: string; + period: any; + commands_usage: any; + commands_costs: any; + data_usage: any; + data_costs: any; + url: string; +} +export declare class UsageInstance { + protected _version: Wireless; + protected _solution: UsageContextSolution; + protected _context?: UsageContext; + constructor(_version: Wireless, payload: UsageResource, simSid: string); + simSid: string; + simUniqueName: string; + accountSid: string; + period: any; + commandsUsage: any; + commandsCosts: any; + dataUsage: any; + dataCosts: any; + url: string; + private get _proxy(); + /** + * Fetch a UsageInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsageInstance + */ + fetch(callback?: (error: Error | null, item?: UsageInstance) => any): Promise; + /** + * Fetch a UsageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed UsageInstance + */ + fetch(params: UsageContextFetchOptions, callback?: (error: Error | null, item?: UsageInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + simSid: string; + simUniqueName: string; + accountSid: string; + period: any; + commandsUsage: any; + commandsCosts: any; + dataUsage: any; + dataCosts: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface UsageSolution { + simSid: string; +} +export interface UsageListInstance { + _version: Wireless; + _solution: UsageSolution; + _uri: string; + (): UsageContext; + get(): UsageContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UsageListInstance(version: Wireless, simSid: string): UsageListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/preview/wireless/sim/usage.js b/node_modules/twilio/lib/rest/preview/wireless/sim/usage.js new file mode 100644 index 00000000..1f92cb7c --- /dev/null +++ b/node_modules/twilio/lib/rest/preview/wireless/sim/usage.js @@ -0,0 +1,133 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Preview + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsageListInstance = exports.UsageInstance = exports.UsageContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class UsageContextImpl { + constructor(_version, simSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(simSid)) { + throw new Error("Parameter 'simSid' is not valid."); + } + this._solution = { simSid }; + this._uri = `/Sims/${simSid}/Usage`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["end"] !== undefined) + data["End"] = params["end"]; + if (params["start"] !== undefined) + data["Start"] = params["start"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UsageInstance(operationVersion, payload, instance._solution.simSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsageContextImpl = UsageContextImpl; +class UsageInstance { + constructor(_version, payload, simSid) { + this._version = _version; + this.simSid = payload.sim_sid; + this.simUniqueName = payload.sim_unique_name; + this.accountSid = payload.account_sid; + this.period = payload.period; + this.commandsUsage = payload.commands_usage; + this.commandsCosts = payload.commands_costs; + this.dataUsage = payload.data_usage; + this.dataCosts = payload.data_costs; + this.url = payload.url; + this._solution = { simSid }; + } + get _proxy() { + this._context = + this._context || + new UsageContextImpl(this._version, this._solution.simSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + simSid: this.simSid, + simUniqueName: this.simUniqueName, + accountSid: this.accountSid, + period: this.period, + commandsUsage: this.commandsUsage, + commandsCosts: this.commandsCosts, + dataUsage: this.dataUsage, + dataCosts: this.dataCosts, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsageInstance = UsageInstance; +function UsageListInstance(version, simSid) { + if (!(0, utility_1.isValidPathParam)(simSid)) { + throw new Error("Parameter 'simSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new UsageContextImpl(version, simSid); + }; + instance._version = version; + instance._solution = { simSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UsageListInstance = UsageListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/V1.d.ts b/node_modules/twilio/lib/rest/pricing/V1.d.ts new file mode 100644 index 00000000..d27b7d69 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/V1.d.ts @@ -0,0 +1,25 @@ +import PricingBase from "../PricingBase"; +import Version from "../../base/Version"; +import { MessagingListInstance } from "./v1/messaging"; +import { PhoneNumberListInstance } from "./v1/phoneNumber"; +import { VoiceListInstance } from "./v1/voice"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Pricing + * + * @param domain - The Twilio (Twilio.Pricing) domain + */ + constructor(domain: PricingBase); + /** messaging - { Twilio.Pricing.V1.MessagingListInstance } resource */ + protected _messaging?: MessagingListInstance; + /** phoneNumbers - { Twilio.Pricing.V1.PhoneNumberListInstance } resource */ + protected _phoneNumbers?: PhoneNumberListInstance; + /** voice - { Twilio.Pricing.V1.VoiceListInstance } resource */ + protected _voice?: VoiceListInstance; + /** Getter for messaging resource */ + get messaging(): MessagingListInstance; + /** Getter for phoneNumbers resource */ + get phoneNumbers(): PhoneNumberListInstance; + /** Getter for voice resource */ + get voice(): VoiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/pricing/V1.js b/node_modules/twilio/lib/rest/pricing/V1.js new file mode 100644 index 00000000..49c87e0b --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/V1.js @@ -0,0 +1,48 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const messaging_1 = require("./v1/messaging"); +const phoneNumber_1 = require("./v1/phoneNumber"); +const voice_1 = require("./v1/voice"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Pricing + * + * @param domain - The Twilio (Twilio.Pricing) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for messaging resource */ + get messaging() { + this._messaging = this._messaging || (0, messaging_1.MessagingListInstance)(this); + return this._messaging; + } + /** Getter for phoneNumbers resource */ + get phoneNumbers() { + this._phoneNumbers = this._phoneNumbers || (0, phoneNumber_1.PhoneNumberListInstance)(this); + return this._phoneNumbers; + } + /** Getter for voice resource */ + get voice() { + this._voice = this._voice || (0, voice_1.VoiceListInstance)(this); + return this._voice; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/pricing/V2.d.ts b/node_modules/twilio/lib/rest/pricing/V2.d.ts new file mode 100644 index 00000000..956efaa8 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/V2.d.ts @@ -0,0 +1,25 @@ +import PricingBase from "../PricingBase"; +import Version from "../../base/Version"; +import { CountryListInstance } from "./v2/country"; +import { NumberListInstance } from "./v2/number"; +import { VoiceListInstance } from "./v2/voice"; +export default class V2 extends Version { + /** + * Initialize the V2 version of Pricing + * + * @param domain - The Twilio (Twilio.Pricing) domain + */ + constructor(domain: PricingBase); + /** countries - { Twilio.Pricing.V2.CountryListInstance } resource */ + protected _countries?: CountryListInstance; + /** numbers - { Twilio.Pricing.V2.NumberListInstance } resource */ + protected _numbers?: NumberListInstance; + /** voice - { Twilio.Pricing.V2.VoiceListInstance } resource */ + protected _voice?: VoiceListInstance; + /** Getter for countries resource */ + get countries(): CountryListInstance; + /** Getter for numbers resource */ + get numbers(): NumberListInstance; + /** Getter for voice resource */ + get voice(): VoiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/pricing/V2.js b/node_modules/twilio/lib/rest/pricing/V2.js new file mode 100644 index 00000000..fede6a23 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/V2.js @@ -0,0 +1,48 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const country_1 = require("./v2/country"); +const number_1 = require("./v2/number"); +const voice_1 = require("./v2/voice"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of Pricing + * + * @param domain - The Twilio (Twilio.Pricing) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for countries resource */ + get countries() { + this._countries = this._countries || (0, country_1.CountryListInstance)(this); + return this._countries; + } + /** Getter for numbers resource */ + get numbers() { + this._numbers = this._numbers || (0, number_1.NumberListInstance)(this); + return this._numbers; + } + /** Getter for voice resource */ + get voice() { + this._voice = this._voice || (0, voice_1.VoiceListInstance)(this); + return this._voice; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/pricing/v1/messaging.d.ts b/node_modules/twilio/lib/rest/pricing/v1/messaging.d.ts new file mode 100644 index 00000000..2cf80fd9 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/messaging.d.ts @@ -0,0 +1,19 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { CountryListInstance } from "./messaging/country"; +export interface MessagingSolution { +} +export interface MessagingListInstance { + _version: V1; + _solution: MessagingSolution; + _uri: string; + _countries?: CountryListInstance; + countries: CountryListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessagingListInstance(version: V1): MessagingListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v1/messaging.js b/node_modules/twilio/lib/rest/pricing/v1/messaging.js new file mode 100644 index 00000000..09f72dbf --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/messaging.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagingListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const country_1 = require("./messaging/country"); +function MessagingListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Messaging`; + Object.defineProperty(instance, "countries", { + get: function countries() { + if (!instance._countries) { + instance._countries = (0, country_1.CountryListInstance)(instance._version); + } + return instance._countries; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessagingListInstance = MessagingListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v1/messaging/country.d.ts b/node_modules/twilio/lib/rest/pricing/v1/messaging/country.d.ts new file mode 100644 index 00000000..4824e6d9 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/messaging/country.d.ts @@ -0,0 +1,233 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export declare class PricingV1MessagingMessagingCountryInstanceInboundSmsPrices { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +export declare class PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices { + "carrier"?: string; + "mcc"?: string; + "mnc"?: string; + "prices"?: Array; +} +export declare class PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +/** + * Options to pass to each + */ +export interface CountryListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CountryInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CountryListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CountryListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CountryContext { + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CountryContextSolution { + isoCountry: string; +} +export declare class CountryContextImpl implements CountryContext { + protected _version: V1; + protected _solution: CountryContextSolution; + protected _uri: string; + constructor(_version: V1, isoCountry: string); + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CountryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CountryPayload extends TwilioResponsePayload { + countries: CountryResource[]; +} +interface CountryResource { + country: string; + iso_country: string; + outbound_sms_prices: Array; + inbound_sms_prices: Array; + price_unit: string; + url: string; +} +export declare class CountryInstance { + protected _version: V1; + protected _solution: CountryContextSolution; + protected _context?: CountryContext; + constructor(_version: V1, payload: CountryResource, isoCountry?: string); + /** + * The name of the country. + */ + country: string; + /** + * The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + */ + isoCountry: string; + /** + * The list of [OutboundSMSPrice](https://www.twilio.com/docs/sms/api/pricing#outbound-sms-price) records that represent the price to send a message for each MCC/MNC applicable in this country. + */ + outboundSmsPrices: Array; + /** + * The list of [InboundPrice](https://www.twilio.com/docs/sms/api/pricing#inbound-price) records that describe the price to receive an inbound SMS to the different Twilio phone number types supported in this country + */ + inboundSmsPrices: Array; + /** + * The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + country: string; + isoCountry: string; + outboundSmsPrices: PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices[]; + inboundSmsPrices: PricingV1MessagingMessagingCountryInstanceInboundSmsPrices[]; + priceUnit: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CountrySolution { +} +export interface CountryListInstance { + _version: V1; + _solution: CountrySolution; + _uri: string; + (isoCountry: string): CountryContext; + get(isoCountry: string): CountryContext; + /** + * Streams CountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + each(params: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Lists CountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + list(params: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + /** + * Retrieve a single page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CountryPage) => any): Promise; + page(params: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CountryListInstance(version: V1): CountryListInstance; +export declare class CountryPage extends Page { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CountrySolution); + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CountryResource): CountryInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/pricing/v1/messaging/country.js b/node_modules/twilio/lib/rest/pricing/v1/messaging/country.js new file mode 100644 index 00000000..485ec698 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/messaging/country.js @@ -0,0 +1,190 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountryPage = exports.CountryListInstance = exports.CountryInstance = exports.CountryContextImpl = exports.PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices = exports.PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices = exports.PricingV1MessagingMessagingCountryInstanceInboundSmsPrices = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PricingV1MessagingMessagingCountryInstanceInboundSmsPrices { +} +exports.PricingV1MessagingMessagingCountryInstanceInboundSmsPrices = PricingV1MessagingMessagingCountryInstanceInboundSmsPrices; +class PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices { +} +exports.PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices = PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices; +class PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices { +} +exports.PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices = PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices; +class CountryContextImpl { + constructor(_version, isoCountry) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(isoCountry)) { + throw new Error("Parameter 'isoCountry' is not valid."); + } + this._solution = { isoCountry }; + this._uri = `/Messaging/Countries/${isoCountry}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CountryInstance(operationVersion, payload, instance._solution.isoCountry)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryContextImpl = CountryContextImpl; +class CountryInstance { + constructor(_version, payload, isoCountry) { + this._version = _version; + this.country = payload.country; + this.isoCountry = payload.iso_country; + this.outboundSmsPrices = payload.outbound_sms_prices; + this.inboundSmsPrices = payload.inbound_sms_prices; + this.priceUnit = payload.price_unit; + this.url = payload.url; + this._solution = { isoCountry: isoCountry || this.isoCountry }; + } + get _proxy() { + this._context = + this._context || + new CountryContextImpl(this._version, this._solution.isoCountry); + return this._context; + } + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + country: this.country, + isoCountry: this.isoCountry, + outboundSmsPrices: this.outboundSmsPrices, + inboundSmsPrices: this.inboundSmsPrices, + priceUnit: this.priceUnit, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryInstance = CountryInstance; +function CountryListInstance(version) { + const instance = ((isoCountry) => instance.get(isoCountry)); + instance.get = function get(isoCountry) { + return new CountryContextImpl(version, isoCountry); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Messaging/Countries`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CountryPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CountryPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CountryListInstance = CountryListInstance; +class CountryPage extends Page_1.default { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CountryInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryPage = CountryPage; diff --git a/node_modules/twilio/lib/rest/pricing/v1/phoneNumber.d.ts b/node_modules/twilio/lib/rest/pricing/v1/phoneNumber.d.ts new file mode 100644 index 00000000..0836e7d1 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/phoneNumber.d.ts @@ -0,0 +1,19 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { CountryListInstance } from "./phoneNumber/country"; +export interface PhoneNumberSolution { +} +export interface PhoneNumberListInstance { + _version: V1; + _solution: PhoneNumberSolution; + _uri: string; + _countries?: CountryListInstance; + countries: CountryListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PhoneNumberListInstance(version: V1): PhoneNumberListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v1/phoneNumber.js b/node_modules/twilio/lib/rest/pricing/v1/phoneNumber.js new file mode 100644 index 00000000..64a96d50 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/phoneNumber.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PhoneNumberListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const country_1 = require("./phoneNumber/country"); +function PhoneNumberListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/PhoneNumbers`; + Object.defineProperty(instance, "countries", { + get: function countries() { + if (!instance._countries) { + instance._countries = (0, country_1.CountryListInstance)(instance._version); + } + return instance._countries; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PhoneNumberListInstance = PhoneNumberListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v1/phoneNumber/country.d.ts b/node_modules/twilio/lib/rest/pricing/v1/phoneNumber/country.d.ts new file mode 100644 index 00000000..569e4cbd --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/phoneNumber/country.d.ts @@ -0,0 +1,216 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export declare class PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +/** + * Options to pass to each + */ +export interface CountryListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CountryInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CountryListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CountryListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CountryContext { + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CountryContextSolution { + isoCountry: string; +} +export declare class CountryContextImpl implements CountryContext { + protected _version: V1; + protected _solution: CountryContextSolution; + protected _uri: string; + constructor(_version: V1, isoCountry: string); + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CountryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CountryPayload extends TwilioResponsePayload { + countries: CountryResource[]; +} +interface CountryResource { + country: string; + iso_country: string; + phone_number_prices: Array; + price_unit: string; + url: string; +} +export declare class CountryInstance { + protected _version: V1; + protected _solution: CountryContextSolution; + protected _context?: CountryContext; + constructor(_version: V1, payload: CountryResource, isoCountry?: string); + /** + * The name of the country. + */ + country: string; + /** + * The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + */ + isoCountry: string; + /** + * The list of [PhoneNumberPrice](https://www.twilio.com/docs/phone-numbers/pricing#phone-number-price) records. + */ + phoneNumberPrices: Array; + /** + * The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + country: string; + isoCountry: string; + phoneNumberPrices: PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices[]; + priceUnit: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CountrySolution { +} +export interface CountryListInstance { + _version: V1; + _solution: CountrySolution; + _uri: string; + (isoCountry: string): CountryContext; + get(isoCountry: string): CountryContext; + /** + * Streams CountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + each(params: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Lists CountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + list(params: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + /** + * Retrieve a single page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CountryPage) => any): Promise; + page(params: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CountryListInstance(version: V1): CountryListInstance; +export declare class CountryPage extends Page { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CountrySolution); + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CountryResource): CountryInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/pricing/v1/phoneNumber/country.js b/node_modules/twilio/lib/rest/pricing/v1/phoneNumber/country.js new file mode 100644 index 00000000..8babbd06 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/phoneNumber/country.js @@ -0,0 +1,182 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountryPage = exports.CountryListInstance = exports.CountryInstance = exports.CountryContextImpl = exports.PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices { +} +exports.PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices = PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices; +class CountryContextImpl { + constructor(_version, isoCountry) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(isoCountry)) { + throw new Error("Parameter 'isoCountry' is not valid."); + } + this._solution = { isoCountry }; + this._uri = `/PhoneNumbers/Countries/${isoCountry}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CountryInstance(operationVersion, payload, instance._solution.isoCountry)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryContextImpl = CountryContextImpl; +class CountryInstance { + constructor(_version, payload, isoCountry) { + this._version = _version; + this.country = payload.country; + this.isoCountry = payload.iso_country; + this.phoneNumberPrices = payload.phone_number_prices; + this.priceUnit = payload.price_unit; + this.url = payload.url; + this._solution = { isoCountry: isoCountry || this.isoCountry }; + } + get _proxy() { + this._context = + this._context || + new CountryContextImpl(this._version, this._solution.isoCountry); + return this._context; + } + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + country: this.country, + isoCountry: this.isoCountry, + phoneNumberPrices: this.phoneNumberPrices, + priceUnit: this.priceUnit, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryInstance = CountryInstance; +function CountryListInstance(version) { + const instance = ((isoCountry) => instance.get(isoCountry)); + instance.get = function get(isoCountry) { + return new CountryContextImpl(version, isoCountry); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/PhoneNumbers/Countries`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CountryPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CountryPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CountryListInstance = CountryListInstance; +class CountryPage extends Page_1.default { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CountryInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryPage = CountryPage; diff --git a/node_modules/twilio/lib/rest/pricing/v1/voice.d.ts b/node_modules/twilio/lib/rest/pricing/v1/voice.d.ts new file mode 100644 index 00000000..18313ba4 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/voice.d.ts @@ -0,0 +1,22 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { CountryListInstance } from "./voice/country"; +import { NumberListInstance } from "./voice/number"; +export interface VoiceSolution { +} +export interface VoiceListInstance { + _version: V1; + _solution: VoiceSolution; + _uri: string; + _countries?: CountryListInstance; + countries: CountryListInstance; + _numbers?: NumberListInstance; + numbers: NumberListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function VoiceListInstance(version: V1): VoiceListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v1/voice.js b/node_modules/twilio/lib/rest/pricing/v1/voice.js new file mode 100644 index 00000000..c133c8d8 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/voice.js @@ -0,0 +1,51 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VoiceListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const country_1 = require("./voice/country"); +const number_1 = require("./voice/number"); +function VoiceListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Voice`; + Object.defineProperty(instance, "countries", { + get: function countries() { + if (!instance._countries) { + instance._countries = (0, country_1.CountryListInstance)(instance._version); + } + return instance._countries; + }, + }); + Object.defineProperty(instance, "numbers", { + get: function numbers() { + if (!instance._numbers) { + instance._numbers = (0, number_1.NumberListInstance)(instance._version); + } + return instance._numbers; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.VoiceListInstance = VoiceListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v1/voice/country.d.ts b/node_modules/twilio/lib/rest/pricing/v1/voice/country.d.ts new file mode 100644 index 00000000..60f12885 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/voice/country.d.ts @@ -0,0 +1,228 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export declare class PricingV1VoiceVoiceCountryInstanceInboundCallPrices { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +export declare class PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices { + "prefixes"?: Array; + "basePrice"?: number; + "currentPrice"?: number; + "friendlyName"?: string; +} +/** + * Options to pass to each + */ +export interface CountryListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CountryInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CountryListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CountryListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CountryContext { + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CountryContextSolution { + isoCountry: string; +} +export declare class CountryContextImpl implements CountryContext { + protected _version: V1; + protected _solution: CountryContextSolution; + protected _uri: string; + constructor(_version: V1, isoCountry: string); + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CountryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CountryPayload extends TwilioResponsePayload { + countries: CountryResource[]; +} +interface CountryResource { + country: string; + iso_country: string; + outbound_prefix_prices: Array; + inbound_call_prices: Array; + price_unit: string; + url: string; +} +export declare class CountryInstance { + protected _version: V1; + protected _solution: CountryContextSolution; + protected _context?: CountryContext; + constructor(_version: V1, payload: CountryResource, isoCountry?: string); + /** + * The name of the country. + */ + country: string; + /** + * The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + */ + isoCountry: string; + /** + * The list of OutboundPrefixPrice records, which include a list of the `prefixes`, the `friendly_name`, `base_price`, and the `current_price` for those prefixes. + */ + outboundPrefixPrices: Array; + /** + * The list of [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) records. + */ + inboundCallPrices: Array; + /** + * The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + country: string; + isoCountry: string; + outboundPrefixPrices: PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices[]; + inboundCallPrices: PricingV1VoiceVoiceCountryInstanceInboundCallPrices[]; + priceUnit: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CountrySolution { +} +export interface CountryListInstance { + _version: V1; + _solution: CountrySolution; + _uri: string; + (isoCountry: string): CountryContext; + get(isoCountry: string): CountryContext; + /** + * Streams CountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + each(params: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Lists CountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + list(params: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + /** + * Retrieve a single page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CountryPage) => any): Promise; + page(params: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CountryListInstance(version: V1): CountryListInstance; +export declare class CountryPage extends Page { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CountrySolution); + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CountryResource): CountryInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/pricing/v1/voice/country.js b/node_modules/twilio/lib/rest/pricing/v1/voice/country.js new file mode 100644 index 00000000..2aa042cc --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/voice/country.js @@ -0,0 +1,187 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountryPage = exports.CountryListInstance = exports.CountryInstance = exports.CountryContextImpl = exports.PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices = exports.PricingV1VoiceVoiceCountryInstanceInboundCallPrices = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PricingV1VoiceVoiceCountryInstanceInboundCallPrices { +} +exports.PricingV1VoiceVoiceCountryInstanceInboundCallPrices = PricingV1VoiceVoiceCountryInstanceInboundCallPrices; +class PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices { +} +exports.PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices = PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices; +class CountryContextImpl { + constructor(_version, isoCountry) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(isoCountry)) { + throw new Error("Parameter 'isoCountry' is not valid."); + } + this._solution = { isoCountry }; + this._uri = `/Voice/Countries/${isoCountry}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CountryInstance(operationVersion, payload, instance._solution.isoCountry)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryContextImpl = CountryContextImpl; +class CountryInstance { + constructor(_version, payload, isoCountry) { + this._version = _version; + this.country = payload.country; + this.isoCountry = payload.iso_country; + this.outboundPrefixPrices = payload.outbound_prefix_prices; + this.inboundCallPrices = payload.inbound_call_prices; + this.priceUnit = payload.price_unit; + this.url = payload.url; + this._solution = { isoCountry: isoCountry || this.isoCountry }; + } + get _proxy() { + this._context = + this._context || + new CountryContextImpl(this._version, this._solution.isoCountry); + return this._context; + } + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + country: this.country, + isoCountry: this.isoCountry, + outboundPrefixPrices: this.outboundPrefixPrices, + inboundCallPrices: this.inboundCallPrices, + priceUnit: this.priceUnit, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryInstance = CountryInstance; +function CountryListInstance(version) { + const instance = ((isoCountry) => instance.get(isoCountry)); + instance.get = function get(isoCountry) { + return new CountryContextImpl(version, isoCountry); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Voice/Countries`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CountryPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CountryPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CountryListInstance = CountryListInstance; +class CountryPage extends Page_1.default { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CountryInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryPage = CountryPage; diff --git a/node_modules/twilio/lib/rest/pricing/v1/voice/number.d.ts b/node_modules/twilio/lib/rest/pricing/v1/voice/number.d.ts new file mode 100644 index 00000000..ee209702 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/voice/number.d.ts @@ -0,0 +1,127 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * The [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record. If `null`, the Phone Number is not a Twilio number owned by this account. + */ +export declare class PricingV1VoiceVoiceNumberInboundCallPrice { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +/** + * The OutboundCallPrice record, which includes a list of `origination_prefixes` and the `base_price` and `current_price` for those prefixes. + */ +export declare class PricingV1VoiceVoiceNumberOutboundCallPrice { + "basePrice"?: number; + "currentPrice"?: number; +} +export interface NumberContext { + /** + * Fetch a NumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NumberContextSolution { + number: string; +} +export declare class NumberContextImpl implements NumberContext { + protected _version: V1; + protected _solution: NumberContextSolution; + protected _uri: string; + constructor(_version: V1, number: string); + fetch(callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NumberResource { + number: string; + country: string; + iso_country: string; + outbound_call_price: PricingV1VoiceVoiceNumberOutboundCallPrice; + inbound_call_price: PricingV1VoiceVoiceNumberInboundCallPrice; + price_unit: string; + url: string; +} +export declare class NumberInstance { + protected _version: V1; + protected _solution: NumberContextSolution; + protected _context?: NumberContext; + constructor(_version: V1, payload: NumberResource, number?: string); + /** + * The phone number. + */ + number: string; + /** + * The name of the country. + */ + country: string; + /** + * The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + */ + isoCountry: string; + outboundCallPrice: PricingV1VoiceVoiceNumberOutboundCallPrice; + inboundCallPrice: PricingV1VoiceVoiceNumberInboundCallPrice; + /** + * The currency in which prices are measured, specified in [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a NumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + number: string; + country: string; + isoCountry: string; + outboundCallPrice: PricingV1VoiceVoiceNumberOutboundCallPrice; + inboundCallPrice: PricingV1VoiceVoiceNumberInboundCallPrice; + priceUnit: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NumberSolution { +} +export interface NumberListInstance { + _version: V1; + _solution: NumberSolution; + _uri: string; + (number: string): NumberContext; + get(number: string): NumberContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NumberListInstance(version: V1): NumberListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/pricing/v1/voice/number.js b/node_modules/twilio/lib/rest/pricing/v1/voice/number.js new file mode 100644 index 00000000..bc03910d --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v1/voice/number.js @@ -0,0 +1,130 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NumberListInstance = exports.NumberInstance = exports.NumberContextImpl = exports.PricingV1VoiceVoiceNumberOutboundCallPrice = exports.PricingV1VoiceVoiceNumberInboundCallPrice = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +/** + * The [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record. If `null`, the Phone Number is not a Twilio number owned by this account. + */ +class PricingV1VoiceVoiceNumberInboundCallPrice { +} +exports.PricingV1VoiceVoiceNumberInboundCallPrice = PricingV1VoiceVoiceNumberInboundCallPrice; +/** + * The OutboundCallPrice record, which includes a list of `origination_prefixes` and the `base_price` and `current_price` for those prefixes. + */ +class PricingV1VoiceVoiceNumberOutboundCallPrice { +} +exports.PricingV1VoiceVoiceNumberOutboundCallPrice = PricingV1VoiceVoiceNumberOutboundCallPrice; +class NumberContextImpl { + constructor(_version, number) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(number)) { + throw new Error("Parameter 'number' is not valid."); + } + this._solution = { number }; + this._uri = `/Voice/Numbers/${number}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new NumberInstance(operationVersion, payload, instance._solution.number)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NumberContextImpl = NumberContextImpl; +class NumberInstance { + constructor(_version, payload, number) { + this._version = _version; + this.number = payload.number; + this.country = payload.country; + this.isoCountry = payload.iso_country; + this.outboundCallPrice = payload.outbound_call_price; + this.inboundCallPrice = payload.inbound_call_price; + this.priceUnit = payload.price_unit; + this.url = payload.url; + this._solution = { number: number || this.number }; + } + get _proxy() { + this._context = + this._context || + new NumberContextImpl(this._version, this._solution.number); + return this._context; + } + /** + * Fetch a NumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + number: this.number, + country: this.country, + isoCountry: this.isoCountry, + outboundCallPrice: this.outboundCallPrice, + inboundCallPrice: this.inboundCallPrice, + priceUnit: this.priceUnit, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NumberInstance = NumberInstance; +function NumberListInstance(version) { + const instance = ((number) => instance.get(number)); + instance.get = function get(number) { + return new NumberContextImpl(version, number); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NumberListInstance = NumberListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v2/country.d.ts b/node_modules/twilio/lib/rest/pricing/v2/country.d.ts new file mode 100644 index 00000000..5ba660ae --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/country.d.ts @@ -0,0 +1,229 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +export declare class PricingV2TrunkingCountryInstanceOriginatingCallPrices { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +export declare class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices { + "originationPrefixes"?: Array; + "destinationPrefixes"?: Array; + "basePrice"?: number; + "currentPrice"?: number; + "friendlyName"?: string; +} +/** + * Options to pass to each + */ +export interface CountryListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CountryInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CountryListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CountryListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CountryContext { + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CountryContextSolution { + isoCountry: string; +} +export declare class CountryContextImpl implements CountryContext { + protected _version: V2; + protected _solution: CountryContextSolution; + protected _uri: string; + constructor(_version: V2, isoCountry: string); + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CountryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CountryPayload extends TwilioResponsePayload { + countries: CountryResource[]; +} +interface CountryResource { + country: string; + iso_country: string; + terminating_prefix_prices: Array; + originating_call_prices: Array; + price_unit: string; + url: string; +} +export declare class CountryInstance { + protected _version: V2; + protected _solution: CountryContextSolution; + protected _context?: CountryContext; + constructor(_version: V2, payload: CountryResource, isoCountry?: string); + /** + * The name of the country. + */ + country: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + */ + isoCountry: string; + /** + * The list of [TerminatingPrefixPrice](https://www.twilio.com/docs/voice/pricing#outbound-prefix-price-with-origin) records. + */ + terminatingPrefixPrices: Array; + /** + * The list of [OriginatingCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) records. + */ + originatingCallPrices: Array; + /** + * The currency in which prices are measured, specified in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + country: string; + isoCountry: string; + terminatingPrefixPrices: PricingV2TrunkingCountryInstanceTerminatingPrefixPrices[]; + originatingCallPrices: PricingV2TrunkingCountryInstanceOriginatingCallPrices[]; + priceUnit: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CountrySolution { +} +export interface CountryListInstance { + _version: V2; + _solution: CountrySolution; + _uri: string; + (isoCountry: string): CountryContext; + get(isoCountry: string): CountryContext; + /** + * Streams CountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + each(params: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Lists CountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + list(params: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + /** + * Retrieve a single page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CountryPage) => any): Promise; + page(params: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CountryListInstance(version: V2): CountryListInstance; +export declare class CountryPage extends Page { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: CountrySolution); + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CountryResource): CountryInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/pricing/v2/country.js b/node_modules/twilio/lib/rest/pricing/v2/country.js new file mode 100644 index 00000000..f21201dd --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/country.js @@ -0,0 +1,187 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountryPage = exports.CountryListInstance = exports.CountryInstance = exports.CountryContextImpl = exports.PricingV2TrunkingCountryInstanceTerminatingPrefixPrices = exports.PricingV2TrunkingCountryInstanceOriginatingCallPrices = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PricingV2TrunkingCountryInstanceOriginatingCallPrices { +} +exports.PricingV2TrunkingCountryInstanceOriginatingCallPrices = PricingV2TrunkingCountryInstanceOriginatingCallPrices; +class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices { +} +exports.PricingV2TrunkingCountryInstanceTerminatingPrefixPrices = PricingV2TrunkingCountryInstanceTerminatingPrefixPrices; +class CountryContextImpl { + constructor(_version, isoCountry) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(isoCountry)) { + throw new Error("Parameter 'isoCountry' is not valid."); + } + this._solution = { isoCountry }; + this._uri = `/Trunking/Countries/${isoCountry}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CountryInstance(operationVersion, payload, instance._solution.isoCountry)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryContextImpl = CountryContextImpl; +class CountryInstance { + constructor(_version, payload, isoCountry) { + this._version = _version; + this.country = payload.country; + this.isoCountry = payload.iso_country; + this.terminatingPrefixPrices = payload.terminating_prefix_prices; + this.originatingCallPrices = payload.originating_call_prices; + this.priceUnit = payload.price_unit; + this.url = payload.url; + this._solution = { isoCountry: isoCountry || this.isoCountry }; + } + get _proxy() { + this._context = + this._context || + new CountryContextImpl(this._version, this._solution.isoCountry); + return this._context; + } + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + country: this.country, + isoCountry: this.isoCountry, + terminatingPrefixPrices: this.terminatingPrefixPrices, + originatingCallPrices: this.originatingCallPrices, + priceUnit: this.priceUnit, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryInstance = CountryInstance; +function CountryListInstance(version) { + const instance = ((isoCountry) => instance.get(isoCountry)); + instance.get = function get(isoCountry) { + return new CountryContextImpl(version, isoCountry); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Trunking/Countries`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CountryPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CountryPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CountryListInstance = CountryListInstance; +class CountryPage extends Page_1.default { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CountryInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryPage = CountryPage; diff --git a/node_modules/twilio/lib/rest/pricing/v2/number.d.ts b/node_modules/twilio/lib/rest/pricing/v2/number.d.ts new file mode 100644 index 00000000..be5257b5 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/number.d.ts @@ -0,0 +1,158 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +export declare class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices { + "originationPrefixes"?: Array; + "destinationPrefixes"?: Array; + "basePrice"?: number; + "currentPrice"?: number; + "friendlyName"?: string; +} +/** + * The [OriginatingCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record. + */ +export declare class PricingV2TrunkingNumberOriginatingCallPrice { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +/** + * Options to pass to fetch a NumberInstance + */ +export interface NumberContextFetchOptions { + /** The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ + originationNumber?: string; +} +export interface NumberContext { + /** + * Fetch a NumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Fetch a NumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(params: NumberContextFetchOptions, callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NumberContextSolution { + destinationNumber: string; +} +export declare class NumberContextImpl implements NumberContext { + protected _version: V2; + protected _solution: NumberContextSolution; + protected _uri: string; + constructor(_version: V2, destinationNumber: string); + fetch(params?: NumberContextFetchOptions | ((error: Error | null, item?: NumberInstance) => any), callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NumberResource { + destination_number: string; + origination_number: string; + country: string; + iso_country: string; + terminating_prefix_prices: Array; + originating_call_price: PricingV2TrunkingNumberOriginatingCallPrice; + price_unit: string; + url: string; +} +export declare class NumberInstance { + protected _version: V2; + protected _solution: NumberContextSolution; + protected _context?: NumberContext; + constructor(_version: V2, payload: NumberResource, destinationNumber?: string); + /** + * The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + destinationNumber: string; + /** + * The origination phone number in [[E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + originationNumber: string; + /** + * The name of the country. + */ + country: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + */ + isoCountry: string; + terminatingPrefixPrices: Array; + originatingCallPrice: PricingV2TrunkingNumberOriginatingCallPrice; + /** + * The currency in which prices are measured, specified in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a NumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Fetch a NumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(params: NumberContextFetchOptions, callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + destinationNumber: string; + originationNumber: string; + country: string; + isoCountry: string; + terminatingPrefixPrices: PricingV2TrunkingCountryInstanceTerminatingPrefixPrices[]; + originatingCallPrice: PricingV2TrunkingNumberOriginatingCallPrice; + priceUnit: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NumberSolution { +} +export interface NumberListInstance { + _version: V2; + _solution: NumberSolution; + _uri: string; + (destinationNumber: string): NumberContext; + get(destinationNumber: string): NumberContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NumberListInstance(version: V2): NumberListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/pricing/v2/number.js b/node_modules/twilio/lib/rest/pricing/v2/number.js new file mode 100644 index 00000000..4bf9bff6 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/number.js @@ -0,0 +1,137 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NumberListInstance = exports.NumberInstance = exports.NumberContextImpl = exports.PricingV2TrunkingNumberOriginatingCallPrice = exports.PricingV2TrunkingCountryInstanceTerminatingPrefixPrices = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices { +} +exports.PricingV2TrunkingCountryInstanceTerminatingPrefixPrices = PricingV2TrunkingCountryInstanceTerminatingPrefixPrices; +/** + * The [OriginatingCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record. + */ +class PricingV2TrunkingNumberOriginatingCallPrice { +} +exports.PricingV2TrunkingNumberOriginatingCallPrice = PricingV2TrunkingNumberOriginatingCallPrice; +class NumberContextImpl { + constructor(_version, destinationNumber) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(destinationNumber)) { + throw new Error("Parameter 'destinationNumber' is not valid."); + } + this._solution = { destinationNumber }; + this._uri = `/Trunking/Numbers/${destinationNumber}`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["originationNumber"] !== undefined) + data["OriginationNumber"] = params["originationNumber"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NumberInstance(operationVersion, payload, instance._solution.destinationNumber)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NumberContextImpl = NumberContextImpl; +class NumberInstance { + constructor(_version, payload, destinationNumber) { + this._version = _version; + this.destinationNumber = payload.destination_number; + this.originationNumber = payload.origination_number; + this.country = payload.country; + this.isoCountry = payload.iso_country; + this.terminatingPrefixPrices = payload.terminating_prefix_prices; + this.originatingCallPrice = payload.originating_call_price; + this.priceUnit = payload.price_unit; + this.url = payload.url; + this._solution = { + destinationNumber: destinationNumber || this.destinationNumber, + }; + } + get _proxy() { + this._context = + this._context || + new NumberContextImpl(this._version, this._solution.destinationNumber); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + destinationNumber: this.destinationNumber, + originationNumber: this.originationNumber, + country: this.country, + isoCountry: this.isoCountry, + terminatingPrefixPrices: this.terminatingPrefixPrices, + originatingCallPrice: this.originatingCallPrice, + priceUnit: this.priceUnit, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NumberInstance = NumberInstance; +function NumberListInstance(version) { + const instance = ((destinationNumber) => instance.get(destinationNumber)); + instance.get = function get(destinationNumber) { + return new NumberContextImpl(version, destinationNumber); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NumberListInstance = NumberListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v2/voice.d.ts b/node_modules/twilio/lib/rest/pricing/v2/voice.d.ts new file mode 100644 index 00000000..25bbda91 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/voice.d.ts @@ -0,0 +1,22 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +import { CountryListInstance } from "./voice/country"; +import { NumberListInstance } from "./voice/number"; +export interface VoiceSolution { +} +export interface VoiceListInstance { + _version: V2; + _solution: VoiceSolution; + _uri: string; + _countries?: CountryListInstance; + countries: CountryListInstance; + _numbers?: NumberListInstance; + numbers: NumberListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function VoiceListInstance(version: V2): VoiceListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v2/voice.js b/node_modules/twilio/lib/rest/pricing/v2/voice.js new file mode 100644 index 00000000..c133c8d8 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/voice.js @@ -0,0 +1,51 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VoiceListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const country_1 = require("./voice/country"); +const number_1 = require("./voice/number"); +function VoiceListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Voice`; + Object.defineProperty(instance, "countries", { + get: function countries() { + if (!instance._countries) { + instance._countries = (0, country_1.CountryListInstance)(instance._version); + } + return instance._countries; + }, + }); + Object.defineProperty(instance, "numbers", { + get: function numbers() { + if (!instance._numbers) { + instance._numbers = (0, number_1.NumberListInstance)(instance._version); + } + return instance._numbers; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.VoiceListInstance = VoiceListInstance; diff --git a/node_modules/twilio/lib/rest/pricing/v2/voice/country.d.ts b/node_modules/twilio/lib/rest/pricing/v2/voice/country.d.ts new file mode 100644 index 00000000..b28c04bd --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/voice/country.d.ts @@ -0,0 +1,229 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export declare class PricingV2TrunkingCountryInstanceOriginatingCallPrices { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +export declare class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices { + "originationPrefixes"?: Array; + "destinationPrefixes"?: Array; + "basePrice"?: number; + "currentPrice"?: number; + "friendlyName"?: string; +} +/** + * Options to pass to each + */ +export interface CountryListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CountryInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CountryListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CountryListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CountryContext { + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CountryContextSolution { + isoCountry: string; +} +export declare class CountryContextImpl implements CountryContext { + protected _version: V2; + protected _solution: CountryContextSolution; + protected _uri: string; + constructor(_version: V2, isoCountry: string); + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CountryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CountryPayload extends TwilioResponsePayload { + countries: CountryResource[]; +} +interface CountryResource { + country: string; + iso_country: string; + outbound_prefix_prices: Array; + inbound_call_prices: Array; + price_unit: string; + url: string; +} +export declare class CountryInstance { + protected _version: V2; + protected _solution: CountryContextSolution; + protected _context?: CountryContext; + constructor(_version: V2, payload: CountryResource, isoCountry?: string); + /** + * The name of the country. + */ + country: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + */ + isoCountry: string; + /** + * The list of [OutboundPrefixPriceWithOrigin](https://www.twilio.com/docs/voice/pricing#outbound-prefix-price-with-origin) records. + */ + outboundPrefixPrices: Array; + /** + * The list of [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) records. + */ + inboundCallPrices: Array; + /** + * The currency in which prices are measured, specified in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + country: string; + isoCountry: string; + outboundPrefixPrices: PricingV2TrunkingCountryInstanceTerminatingPrefixPrices[]; + inboundCallPrices: PricingV2TrunkingCountryInstanceOriginatingCallPrices[]; + priceUnit: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CountrySolution { +} +export interface CountryListInstance { + _version: V2; + _solution: CountrySolution; + _uri: string; + (isoCountry: string): CountryContext; + get(isoCountry: string): CountryContext; + /** + * Streams CountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + each(params: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Lists CountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + list(params: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + /** + * Retrieve a single page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CountryPage) => any): Promise; + page(params: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CountryListInstance(version: V2): CountryListInstance; +export declare class CountryPage extends Page { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: CountrySolution); + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CountryResource): CountryInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/pricing/v2/voice/country.js b/node_modules/twilio/lib/rest/pricing/v2/voice/country.js new file mode 100644 index 00000000..01a31cd9 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/voice/country.js @@ -0,0 +1,187 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountryPage = exports.CountryListInstance = exports.CountryInstance = exports.CountryContextImpl = exports.PricingV2TrunkingCountryInstanceTerminatingPrefixPrices = exports.PricingV2TrunkingCountryInstanceOriginatingCallPrices = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PricingV2TrunkingCountryInstanceOriginatingCallPrices { +} +exports.PricingV2TrunkingCountryInstanceOriginatingCallPrices = PricingV2TrunkingCountryInstanceOriginatingCallPrices; +class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices { +} +exports.PricingV2TrunkingCountryInstanceTerminatingPrefixPrices = PricingV2TrunkingCountryInstanceTerminatingPrefixPrices; +class CountryContextImpl { + constructor(_version, isoCountry) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(isoCountry)) { + throw new Error("Parameter 'isoCountry' is not valid."); + } + this._solution = { isoCountry }; + this._uri = `/Voice/Countries/${isoCountry}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CountryInstance(operationVersion, payload, instance._solution.isoCountry)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryContextImpl = CountryContextImpl; +class CountryInstance { + constructor(_version, payload, isoCountry) { + this._version = _version; + this.country = payload.country; + this.isoCountry = payload.iso_country; + this.outboundPrefixPrices = payload.outbound_prefix_prices; + this.inboundCallPrices = payload.inbound_call_prices; + this.priceUnit = payload.price_unit; + this.url = payload.url; + this._solution = { isoCountry: isoCountry || this.isoCountry }; + } + get _proxy() { + this._context = + this._context || + new CountryContextImpl(this._version, this._solution.isoCountry); + return this._context; + } + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + country: this.country, + isoCountry: this.isoCountry, + outboundPrefixPrices: this.outboundPrefixPrices, + inboundCallPrices: this.inboundCallPrices, + priceUnit: this.priceUnit, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryInstance = CountryInstance; +function CountryListInstance(version) { + const instance = ((isoCountry) => instance.get(isoCountry)); + instance.get = function get(isoCountry) { + return new CountryContextImpl(version, isoCountry); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Voice/Countries`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CountryPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CountryPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CountryListInstance = CountryListInstance; +class CountryPage extends Page_1.default { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CountryInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryPage = CountryPage; diff --git a/node_modules/twilio/lib/rest/pricing/v2/voice/number.d.ts b/node_modules/twilio/lib/rest/pricing/v2/voice/number.d.ts new file mode 100644 index 00000000..3fb57917 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/voice/number.d.ts @@ -0,0 +1,159 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../V2"; +/** + * The [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record. + */ +export declare class PricingV2VoiceVoiceNumberInboundCallPrice { + "basePrice"?: number; + "currentPrice"?: number; + "numberType"?: string; +} +export declare class PricingV2VoiceVoiceNumberOutboundCallPrices { + "basePrice"?: number; + "currentPrice"?: number; + "originationPrefixes"?: Array; +} +/** + * Options to pass to fetch a NumberInstance + */ +export interface NumberContextFetchOptions { + /** The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ + originationNumber?: string; +} +export interface NumberContext { + /** + * Fetch a NumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Fetch a NumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(params: NumberContextFetchOptions, callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NumberContextSolution { + destinationNumber: string; +} +export declare class NumberContextImpl implements NumberContext { + protected _version: V2; + protected _solution: NumberContextSolution; + protected _uri: string; + constructor(_version: V2, destinationNumber: string); + fetch(params?: NumberContextFetchOptions | ((error: Error | null, item?: NumberInstance) => any), callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NumberResource { + destination_number: string; + origination_number: string; + country: string; + iso_country: string; + outbound_call_prices: Array; + inbound_call_price: PricingV2VoiceVoiceNumberInboundCallPrice; + price_unit: string; + url: string; +} +export declare class NumberInstance { + protected _version: V2; + protected _solution: NumberContextSolution; + protected _context?: NumberContext; + constructor(_version: V2, payload: NumberResource, destinationNumber?: string); + /** + * The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + destinationNumber: string; + /** + * The origination phone number in [[E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + originationNumber: string; + /** + * The name of the country. + */ + country: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + */ + isoCountry: string; + /** + * The list of [OutboundCallPriceWithOrigin](https://www.twilio.com/docs/voice/pricing#outbound-call-price-with-origin) records. + */ + outboundCallPrices: Array; + inboundCallPrice: PricingV2VoiceVoiceNumberInboundCallPrice; + /** + * The currency in which prices are measured, specified in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). + */ + priceUnit: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a NumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Fetch a NumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NumberInstance + */ + fetch(params: NumberContextFetchOptions, callback?: (error: Error | null, item?: NumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + destinationNumber: string; + originationNumber: string; + country: string; + isoCountry: string; + outboundCallPrices: PricingV2VoiceVoiceNumberOutboundCallPrices[]; + inboundCallPrice: PricingV2VoiceVoiceNumberInboundCallPrice; + priceUnit: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NumberSolution { +} +export interface NumberListInstance { + _version: V2; + _solution: NumberSolution; + _uri: string; + (destinationNumber: string): NumberContext; + get(destinationNumber: string): NumberContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NumberListInstance(version: V2): NumberListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/pricing/v2/voice/number.js b/node_modules/twilio/lib/rest/pricing/v2/voice/number.js new file mode 100644 index 00000000..e8299ad7 --- /dev/null +++ b/node_modules/twilio/lib/rest/pricing/v2/voice/number.js @@ -0,0 +1,137 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Pricing + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NumberListInstance = exports.NumberInstance = exports.NumberContextImpl = exports.PricingV2VoiceVoiceNumberOutboundCallPrices = exports.PricingV2VoiceVoiceNumberInboundCallPrice = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +/** + * The [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record. + */ +class PricingV2VoiceVoiceNumberInboundCallPrice { +} +exports.PricingV2VoiceVoiceNumberInboundCallPrice = PricingV2VoiceVoiceNumberInboundCallPrice; +class PricingV2VoiceVoiceNumberOutboundCallPrices { +} +exports.PricingV2VoiceVoiceNumberOutboundCallPrices = PricingV2VoiceVoiceNumberOutboundCallPrices; +class NumberContextImpl { + constructor(_version, destinationNumber) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(destinationNumber)) { + throw new Error("Parameter 'destinationNumber' is not valid."); + } + this._solution = { destinationNumber }; + this._uri = `/Voice/Numbers/${destinationNumber}`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["originationNumber"] !== undefined) + data["OriginationNumber"] = params["originationNumber"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NumberInstance(operationVersion, payload, instance._solution.destinationNumber)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NumberContextImpl = NumberContextImpl; +class NumberInstance { + constructor(_version, payload, destinationNumber) { + this._version = _version; + this.destinationNumber = payload.destination_number; + this.originationNumber = payload.origination_number; + this.country = payload.country; + this.isoCountry = payload.iso_country; + this.outboundCallPrices = payload.outbound_call_prices; + this.inboundCallPrice = payload.inbound_call_price; + this.priceUnit = payload.price_unit; + this.url = payload.url; + this._solution = { + destinationNumber: destinationNumber || this.destinationNumber, + }; + } + get _proxy() { + this._context = + this._context || + new NumberContextImpl(this._version, this._solution.destinationNumber); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + destinationNumber: this.destinationNumber, + originationNumber: this.originationNumber, + country: this.country, + isoCountry: this.isoCountry, + outboundCallPrices: this.outboundCallPrices, + inboundCallPrice: this.inboundCallPrice, + priceUnit: this.priceUnit, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NumberInstance = NumberInstance; +function NumberListInstance(version) { + const instance = ((destinationNumber) => instance.get(destinationNumber)); + instance.get = function get(destinationNumber) { + return new NumberContextImpl(version, destinationNumber); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NumberListInstance = NumberListInstance; diff --git a/node_modules/twilio/lib/rest/proxy/V1.d.ts b/node_modules/twilio/lib/rest/proxy/V1.d.ts new file mode 100644 index 00000000..649dd0e8 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/V1.d.ts @@ -0,0 +1,15 @@ +import ProxyBase from "../ProxyBase"; +import Version from "../../base/Version"; +import { ServiceListInstance } from "./v1/service"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Proxy + * + * @param domain - The Twilio (Twilio.Proxy) domain + */ + constructor(domain: ProxyBase); + /** services - { Twilio.Proxy.V1.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/proxy/V1.js b/node_modules/twilio/lib/rest/proxy/V1.js new file mode 100644 index 00000000..72f515b8 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/V1.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Proxy + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const service_1 = require("./v1/service"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Proxy + * + * @param domain - The Twilio (Twilio.Proxy) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service.d.ts b/node_modules/twilio/lib/rest/proxy/v1/service.d.ts new file mode 100644 index 00000000..a3dba8d9 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service.d.ts @@ -0,0 +1,388 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { PhoneNumberListInstance } from "./service/phoneNumber"; +import { SessionListInstance } from "./service/session"; +import { ShortCodeListInstance } from "./service/shortCode"; +export type ServiceGeoMatchLevel = "area-code" | "overlay" | "radius" | "country"; +export type ServiceNumberSelectionBehavior = "avoid-sticky" | "prefer-sticky"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** */ + uniqueName?: string; + /** The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session\\\'s last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session\\\'s default TTL value by setting its `ttl` value. */ + defaultTtl?: number; + /** The URL we should call when the interaction status changes. */ + callbackUrl?: string; + /** */ + geoMatchLevel?: ServiceGeoMatchLevel; + /** */ + numberSelectionBehavior?: ServiceNumberSelectionBehavior; + /** The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. */ + interceptCallbackUrl?: string; + /** The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. */ + outOfSessionCallbackUrl?: string; + /** The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. */ + chatInstanceSid?: string; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** */ + uniqueName: string; + /** The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session\\\'s last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session\\\'s default TTL value by setting its `ttl` value. */ + defaultTtl?: number; + /** The URL we should call when the interaction status changes. */ + callbackUrl?: string; + /** */ + geoMatchLevel?: ServiceGeoMatchLevel; + /** */ + numberSelectionBehavior?: ServiceNumberSelectionBehavior; + /** The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. */ + interceptCallbackUrl?: string; + /** The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. */ + outOfSessionCallbackUrl?: string; + /** The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. */ + chatInstanceSid?: string; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + phoneNumbers: PhoneNumberListInstance; + sessions: SessionListInstance; + shortCodes: ShortCodeListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _phoneNumbers?: PhoneNumberListInstance; + protected _sessions?: SessionListInstance; + protected _shortCodes?: ShortCodeListInstance; + constructor(_version: V1, sid: string); + get phoneNumbers(): PhoneNumberListInstance; + get sessions(): SessionListInstance; + get shortCodes(): ShortCodeListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + unique_name: string; + account_sid: string; + chat_instance_sid: string; + callback_url: string; + default_ttl: number; + number_selection_behavior: ServiceNumberSelectionBehavior; + geo_match_level: ServiceGeoMatchLevel; + intercept_callback_url: string; + out_of_session_callback_url: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ServiceInstance { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V1, payload: ServiceResource, sid?: string); + /** + * The unique string that we created to identify the Service resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. Supports UTF-8 characters. **This value should not have PII.** + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + */ + chatInstanceSid: string; + /** + * The URL we call when the interaction status changes. + */ + callbackUrl: string; + /** + * The default `ttl` value for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session\'s last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session\'s default TTL value by setting its `ttl` value. + */ + defaultTtl: number; + numberSelectionBehavior: ServiceNumberSelectionBehavior; + geoMatchLevel: ServiceGeoMatchLevel; + /** + * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + */ + interceptCallbackUrl: string; + /** + * The URL we call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + */ + outOfSessionCallbackUrl: string; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created. + */ + dateCreated: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated. + */ + dateUpdated: Date; + /** + * The absolute URL of the Service resource. + */ + url: string; + /** + * The URLs of resources related to the Service. + */ + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the phoneNumbers. + */ + phoneNumbers(): PhoneNumberListInstance; + /** + * Access the sessions. + */ + sessions(): SessionListInstance; + /** + * Access the shortCodes. + */ + shortCodes(): ShortCodeListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + chatInstanceSid: string; + callbackUrl: string; + defaultTtl: number; + numberSelectionBehavior: ServiceNumberSelectionBehavior; + geoMatchLevel: ServiceGeoMatchLevel; + interceptCallbackUrl: string; + outOfSessionCallbackUrl: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V1; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V1): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service.js b/node_modules/twilio/lib/rest/proxy/v1/service.js new file mode 100644 index 00000000..3dad33b8 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service.js @@ -0,0 +1,330 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Proxy + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const phoneNumber_1 = require("./service/phoneNumber"); +const session_1 = require("./service/session"); +const shortCode_1 = require("./service/shortCode"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get phoneNumbers() { + this._phoneNumbers = + this._phoneNumbers || + (0, phoneNumber_1.PhoneNumberListInstance)(this._version, this._solution.sid); + return this._phoneNumbers; + } + get sessions() { + this._sessions = + this._sessions || (0, session_1.SessionListInstance)(this._version, this._solution.sid); + return this._sessions; + } + get shortCodes() { + this._shortCodes = + this._shortCodes || + (0, shortCode_1.ShortCodeListInstance)(this._version, this._solution.sid); + return this._shortCodes; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["defaultTtl"] !== undefined) + data["DefaultTtl"] = params["defaultTtl"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["geoMatchLevel"] !== undefined) + data["GeoMatchLevel"] = params["geoMatchLevel"]; + if (params["numberSelectionBehavior"] !== undefined) + data["NumberSelectionBehavior"] = params["numberSelectionBehavior"]; + if (params["interceptCallbackUrl"] !== undefined) + data["InterceptCallbackUrl"] = params["interceptCallbackUrl"]; + if (params["outOfSessionCallbackUrl"] !== undefined) + data["OutOfSessionCallbackUrl"] = params["outOfSessionCallbackUrl"]; + if (params["chatInstanceSid"] !== undefined) + data["ChatInstanceSid"] = params["chatInstanceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.chatInstanceSid = payload.chat_instance_sid; + this.callbackUrl = payload.callback_url; + this.defaultTtl = deserialize.integer(payload.default_ttl); + this.numberSelectionBehavior = payload.number_selection_behavior; + this.geoMatchLevel = payload.geo_match_level; + this.interceptCallbackUrl = payload.intercept_callback_url; + this.outOfSessionCallbackUrl = payload.out_of_session_callback_url; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the phoneNumbers. + */ + phoneNumbers() { + return this._proxy.phoneNumbers; + } + /** + * Access the sessions. + */ + sessions() { + return this._proxy.sessions; + } + /** + * Access the shortCodes. + */ + shortCodes() { + return this._proxy.shortCodes; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + chatInstanceSid: this.chatInstanceSid, + callbackUrl: this.callbackUrl, + defaultTtl: this.defaultTtl, + numberSelectionBehavior: this.numberSelectionBehavior, + geoMatchLevel: this.geoMatchLevel, + interceptCallbackUrl: this.interceptCallbackUrl, + outOfSessionCallbackUrl: this.outOfSessionCallbackUrl, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["uniqueName"] === null || params["uniqueName"] === undefined) { + throw new Error("Required parameter \"params['uniqueName']\" missing."); + } + let data = {}; + data["UniqueName"] = params["uniqueName"]; + if (params["defaultTtl"] !== undefined) + data["DefaultTtl"] = params["defaultTtl"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["geoMatchLevel"] !== undefined) + data["GeoMatchLevel"] = params["geoMatchLevel"]; + if (params["numberSelectionBehavior"] !== undefined) + data["NumberSelectionBehavior"] = params["numberSelectionBehavior"]; + if (params["interceptCallbackUrl"] !== undefined) + data["InterceptCallbackUrl"] = params["interceptCallbackUrl"]; + if (params["outOfSessionCallbackUrl"] !== undefined) + data["OutOfSessionCallbackUrl"] = params["outOfSessionCallbackUrl"]; + if (params["chatInstanceSid"] !== undefined) + data["ChatInstanceSid"] = params["chatInstanceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/phoneNumber.d.ts b/node_modules/twilio/lib/rest/proxy/v1/service/phoneNumber.d.ts new file mode 100644 index 00000000..8d6aecfd --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/phoneNumber.d.ts @@ -0,0 +1,340 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { PhoneNumberCapabilities } from "../../../../interfaces"; +/** + * Options to pass to update a PhoneNumberInstance + */ +export interface PhoneNumberContextUpdateOptions { + /** Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. */ + isReserved?: boolean; +} +/** + * Options to pass to create a PhoneNumberInstance + */ +export interface PhoneNumberListInstanceCreateOptions { + /** The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. */ + sid?: string; + /** The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. */ + phoneNumber?: string; + /** Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. */ + isReserved?: boolean; +} +/** + * Options to pass to each + */ +export interface PhoneNumberListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface PhoneNumberListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface PhoneNumberListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface PhoneNumberContext { + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Update a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + update(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Update a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + update(params: PhoneNumberContextUpdateOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PhoneNumberContextSolution { + serviceSid: string; + sid: string; +} +export declare class PhoneNumberContextImpl implements PhoneNumberContext { + protected _version: V1; + protected _solution: PhoneNumberContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + update(params?: PhoneNumberContextUpdateOptions | ((error: Error | null, item?: PhoneNumberInstance) => any), callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PhoneNumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PhoneNumberPayload extends TwilioResponsePayload { + phone_numbers: PhoneNumberResource[]; +} +interface PhoneNumberResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + phone_number: string; + friendly_name: string; + iso_country: string; + capabilities: PhoneNumberCapabilities; + url: string; + is_reserved: boolean; + in_use: number; +} +export declare class PhoneNumberInstance { + protected _version: V1; + protected _solution: PhoneNumberContextSolution; + protected _context?: PhoneNumberContext; + constructor(_version: V1, payload: PhoneNumberResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the PhoneNumber resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PhoneNumber resource. + */ + accountSid: string; + /** + * The SID of the PhoneNumber resource\'s parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. + */ + serviceSid: string; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created. + */ + dateCreated: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated. + */ + dateUpdated: Date; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The ISO Country Code for the phone number. + */ + isoCountry: string; + capabilities: PhoneNumberCapabilities; + /** + * The absolute URL of the PhoneNumber resource. + */ + url: string; + /** + * Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + */ + isReserved: boolean; + /** + * The number of open session assigned to the number. See the [How many Phone Numbers do I need?](https://www.twilio.com/docs/proxy/phone-numbers-needed) guide for more information. + */ + inUse: number; + private get _proxy(); + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Update a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + update(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Update a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + update(params: PhoneNumberContextUpdateOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + phoneNumber: string; + friendlyName: string; + isoCountry: string; + capabilities: PhoneNumberCapabilities; + url: string; + isReserved: boolean; + inUse: number; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PhoneNumberSolution { + serviceSid: string; +} +export interface PhoneNumberListInstance { + _version: V1; + _solution: PhoneNumberSolution; + _uri: string; + (sid: string): PhoneNumberContext; + get(sid: string): PhoneNumberContext; + /** + * Create a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + create(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Create a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + create(params: PhoneNumberListInstanceCreateOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Streams PhoneNumberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void): void; + each(params: PhoneNumberListInstanceEachOptions, callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of PhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + /** + * Lists PhoneNumberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: PhoneNumberInstance[]) => any): Promise; + list(params: PhoneNumberListInstanceOptions, callback?: (error: Error | null, items: PhoneNumberInstance[]) => any): Promise; + /** + * Retrieve a single page of PhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + page(params: PhoneNumberListInstancePageOptions, callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PhoneNumberListInstance(version: V1, serviceSid: string): PhoneNumberListInstance; +export declare class PhoneNumberPage extends Page { + /** + * Initialize the PhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: PhoneNumberSolution); + /** + * Build an instance of PhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: PhoneNumberResource): PhoneNumberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/phoneNumber.js b/node_modules/twilio/lib/rest/proxy/v1/service/phoneNumber.js new file mode 100644 index 00000000..13237a9d --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/phoneNumber.js @@ -0,0 +1,272 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Proxy + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PhoneNumberPage = exports.PhoneNumberListInstance = exports.PhoneNumberInstance = exports.PhoneNumberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PhoneNumberContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/PhoneNumbers/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["isReserved"] !== undefined) + data["IsReserved"] = serialize.bool(params["isReserved"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberContextImpl = PhoneNumberContextImpl; +class PhoneNumberInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.phoneNumber = payload.phone_number; + this.friendlyName = payload.friendly_name; + this.isoCountry = payload.iso_country; + this.capabilities = payload.capabilities; + this.url = payload.url; + this.isReserved = payload.is_reserved; + this.inUse = deserialize.integer(payload.in_use); + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PhoneNumberContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + phoneNumber: this.phoneNumber, + friendlyName: this.friendlyName, + isoCountry: this.isoCountry, + capabilities: this.capabilities, + url: this.url, + isReserved: this.isReserved, + inUse: this.inUse, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberInstance = PhoneNumberInstance; +function PhoneNumberListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PhoneNumberContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/PhoneNumbers`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["sid"] !== undefined) + data["Sid"] = params["sid"]; + if (params["phoneNumber"] !== undefined) + data["PhoneNumber"] = params["phoneNumber"]; + if (params["isReserved"] !== undefined) + data["IsReserved"] = serialize.bool(params["isReserved"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new PhoneNumberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PhoneNumberListInstance = PhoneNumberListInstance; +class PhoneNumberPage extends Page_1.default { + /** + * Initialize the PhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of PhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new PhoneNumberInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberPage = PhoneNumberPage; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/session.d.ts b/node_modules/twilio/lib/rest/proxy/v1/service/session.d.ts new file mode 100644 index 00000000..00bcd29f --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/session.d.ts @@ -0,0 +1,388 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { InteractionListInstance } from "./session/interaction"; +import { ParticipantListInstance } from "./session/participant"; +export type SessionMode = "message-only" | "voice-only" | "voice-and-message"; +export type SessionStatus = "open" | "in-progress" | "closed" | "failed" | "unknown"; +/** + * Options to pass to update a SessionInstance + */ +export interface SessionContextUpdateOptions { + /** The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. */ + dateExpiry?: Date; + /** The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session\\\'s last Interaction. */ + ttl?: number; + /** */ + status?: SessionStatus; +} +/** + * Options to pass to create a SessionInstance + */ +export interface SessionListInstanceCreateOptions { + /** An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** */ + uniqueName?: string; + /** The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. */ + dateExpiry?: Date; + /** The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session\\\'s last Interaction. */ + ttl?: number; + /** */ + mode?: SessionMode; + /** */ + status?: SessionStatus; + /** The Participant objects to include in the new session. */ + participants?: Array; +} +/** + * Options to pass to each + */ +export interface SessionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SessionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SessionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SessionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SessionContext { + interactions: InteractionListInstance; + participants: ParticipantListInstance; + /** + * Remove a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + fetch(callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Update a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + update(callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Update a SessionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + update(params: SessionContextUpdateOptions, callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SessionContextSolution { + serviceSid: string; + sid: string; +} +export declare class SessionContextImpl implements SessionContext { + protected _version: V1; + protected _solution: SessionContextSolution; + protected _uri: string; + protected _interactions?: InteractionListInstance; + protected _participants?: ParticipantListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get interactions(): InteractionListInstance; + get participants(): ParticipantListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + update(params?: SessionContextUpdateOptions | ((error: Error | null, item?: SessionInstance) => any), callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SessionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SessionPayload extends TwilioResponsePayload { + sessions: SessionResource[]; +} +interface SessionResource { + sid: string; + service_sid: string; + account_sid: string; + date_started: Date; + date_ended: Date; + date_last_interaction: Date; + date_expiry: Date; + unique_name: string; + status: SessionStatus; + closed_reason: string; + ttl: number; + mode: SessionMode; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class SessionInstance { + protected _version: V1; + protected _solution: SessionContextSolution; + protected _context?: SessionContext; + constructor(_version: V1, payload: SessionResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Session resource. + */ + sid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/proxy/api/service) the session is associated with. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Session resource. + */ + accountSid: string; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session started. + */ + dateStarted: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session ended. + */ + dateEnded: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session last had an interaction. + */ + dateLastInteraction: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + */ + dateExpiry: Date; + /** + * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. Supports UTF-8 characters. **This value should not have PII.** + */ + uniqueName: string; + status: SessionStatus; + /** + * The reason the Session ended. + */ + closedReason: string; + /** + * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session\'s last Interaction. + */ + ttl: number; + mode: SessionMode; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created. + */ + dateCreated: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated. + */ + dateUpdated: Date; + /** + * The absolute URL of the Session resource. + */ + url: string; + /** + * The URLs of resources related to the Session. + */ + links: Record; + private get _proxy(); + /** + * Remove a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + fetch(callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Update a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + update(callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Update a SessionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + update(params: SessionContextUpdateOptions, callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Access the interactions. + */ + interactions(): InteractionListInstance; + /** + * Access the participants. + */ + participants(): ParticipantListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + serviceSid: string; + accountSid: string; + dateStarted: Date; + dateEnded: Date; + dateLastInteraction: Date; + dateExpiry: Date; + uniqueName: string; + status: SessionStatus; + closedReason: string; + ttl: number; + mode: SessionMode; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SessionSolution { + serviceSid: string; +} +export interface SessionListInstance { + _version: V1; + _solution: SessionSolution; + _uri: string; + (sid: string): SessionContext; + get(sid: string): SessionContext; + /** + * Create a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + create(callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Create a SessionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + create(params: SessionListInstanceCreateOptions, callback?: (error: Error | null, item?: SessionInstance) => any): Promise; + /** + * Streams SessionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SessionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SessionInstance, done: (err?: Error) => void) => void): void; + each(params: SessionListInstanceEachOptions, callback?: (item: SessionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SessionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SessionPage) => any): Promise; + /** + * Lists SessionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SessionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SessionInstance[]) => any): Promise; + list(params: SessionListInstanceOptions, callback?: (error: Error | null, items: SessionInstance[]) => any): Promise; + /** + * Retrieve a single page of SessionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SessionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SessionPage) => any): Promise; + page(params: SessionListInstancePageOptions, callback?: (error: Error | null, items: SessionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SessionListInstance(version: V1, serviceSid: string): SessionListInstance; +export declare class SessionPage extends Page { + /** + * Initialize the SessionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SessionSolution); + /** + * Build an instance of SessionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SessionResource): SessionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/session.js b/node_modules/twilio/lib/rest/proxy/v1/service/session.js new file mode 100644 index 00000000..06aabcb1 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/session.js @@ -0,0 +1,316 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Proxy + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SessionPage = exports.SessionListInstance = exports.SessionInstance = exports.SessionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const interaction_1 = require("./session/interaction"); +const participant_1 = require("./session/participant"); +class SessionContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Sessions/${sid}`; + } + get interactions() { + this._interactions = + this._interactions || + (0, interaction_1.InteractionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._interactions; + } + get participants() { + this._participants = + this._participants || + (0, participant_1.ParticipantListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._participants; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SessionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateExpiry"] !== undefined) + data["DateExpiry"] = serialize.iso8601DateTime(params["dateExpiry"]); + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SessionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SessionContextImpl = SessionContextImpl; +class SessionInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.dateStarted = deserialize.iso8601DateTime(payload.date_started); + this.dateEnded = deserialize.iso8601DateTime(payload.date_ended); + this.dateLastInteraction = deserialize.iso8601DateTime(payload.date_last_interaction); + this.dateExpiry = deserialize.iso8601DateTime(payload.date_expiry); + this.uniqueName = payload.unique_name; + this.status = payload.status; + this.closedReason = payload.closed_reason; + this.ttl = deserialize.integer(payload.ttl); + this.mode = payload.mode; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SessionContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SessionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SessionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the interactions. + */ + interactions() { + return this._proxy.interactions; + } + /** + * Access the participants. + */ + participants() { + return this._proxy.participants; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + dateStarted: this.dateStarted, + dateEnded: this.dateEnded, + dateLastInteraction: this.dateLastInteraction, + dateExpiry: this.dateExpiry, + uniqueName: this.uniqueName, + status: this.status, + closedReason: this.closedReason, + ttl: this.ttl, + mode: this.mode, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SessionInstance = SessionInstance; +function SessionListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SessionContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Sessions`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["dateExpiry"] !== undefined) + data["DateExpiry"] = serialize.iso8601DateTime(params["dateExpiry"]); + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["mode"] !== undefined) + data["Mode"] = params["mode"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["participants"] !== undefined) + data["Participants"] = serialize.map(params["participants"], (e) => serialize.object(e)); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SessionInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SessionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SessionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SessionListInstance = SessionListInstance; +class SessionPage extends Page_1.default { + /** + * Initialize the SessionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SessionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SessionInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SessionPage = SessionPage; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/session/interaction.d.ts b/node_modules/twilio/lib/rest/proxy/v1/service/session/interaction.d.ts new file mode 100644 index 00000000..fab79f89 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/session/interaction.d.ts @@ -0,0 +1,309 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type InteractionResourceStatus = "accepted" | "answered" | "busy" | "canceled" | "completed" | "deleted" | "delivered" | "delivery-unknown" | "failed" | "in-progress" | "initiated" | "no-answer" | "queued" | "received" | "receiving" | "ringing" | "scheduled" | "sending" | "sent" | "undelivered" | "unknown"; +export type InteractionType = "message" | "voice" | "unknown"; +/** + * Options to pass to each + */ +export interface InteractionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: InteractionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface InteractionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface InteractionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface InteractionContext { + /** + * Remove a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionInstance + */ + fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface InteractionContextSolution { + serviceSid: string; + sessionSid: string; + sid: string; +} +export declare class InteractionContextImpl implements InteractionContext { + protected _version: V1; + protected _solution: InteractionContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sessionSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): InteractionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface InteractionPayload extends TwilioResponsePayload { + interactions: InteractionResource[]; +} +interface InteractionResource { + sid: string; + session_sid: string; + service_sid: string; + account_sid: string; + data: string; + type: InteractionType; + inbound_participant_sid: string; + inbound_resource_sid: string; + inbound_resource_status: InteractionResourceStatus; + inbound_resource_type: string; + inbound_resource_url: string; + outbound_participant_sid: string; + outbound_resource_sid: string; + outbound_resource_status: InteractionResourceStatus; + outbound_resource_type: string; + outbound_resource_url: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class InteractionInstance { + protected _version: V1; + protected _solution: InteractionContextSolution; + protected _context?: InteractionContext; + constructor(_version: V1, payload: InteractionResource, serviceSid: string, sessionSid: string, sid?: string); + /** + * The unique string that we created to identify the Interaction resource. + */ + sid: string; + /** + * The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) resource. + */ + sessionSid: string; + /** + * The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Interaction resource. + */ + accountSid: string; + /** + * A JSON string that includes the message body of message interactions (e.g. `{\"body\": \"hello\"}`) or the call duration (when available) of a call (e.g. `{\"duration\": \"5\"}`). + */ + data: string; + type: InteractionType; + /** + * The SID of the inbound [Participant](https://www.twilio.com/docs/proxy/api/participant) resource. + */ + inboundParticipantSid: string; + /** + * The SID of the inbound resource; either the [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message-resource). + */ + inboundResourceSid: string; + inboundResourceStatus: InteractionResourceStatus; + /** + * The inbound resource type. Can be [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message-resource). + */ + inboundResourceType: string; + /** + * The URL of the Twilio inbound resource + */ + inboundResourceUrl: string; + /** + * The SID of the outbound [Participant](https://www.twilio.com/docs/proxy/api/participant)). + */ + outboundParticipantSid: string; + /** + * The SID of the outbound resource; either the [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message-resource). + */ + outboundResourceSid: string; + outboundResourceStatus: InteractionResourceStatus; + /** + * The outbound resource type. Can be: [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message-resource). + */ + outboundResourceType: string; + /** + * The URL of the Twilio outbound resource. + */ + outboundResourceUrl: string; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the Interaction was created. + */ + dateCreated: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated. + */ + dateUpdated: Date; + /** + * The absolute URL of the Interaction resource. + */ + url: string; + private get _proxy(); + /** + * Remove a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionInstance + */ + fetch(callback?: (error: Error | null, item?: InteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + sessionSid: string; + serviceSid: string; + accountSid: string; + data: string; + type: InteractionType; + inboundParticipantSid: string; + inboundResourceSid: string; + inboundResourceStatus: InteractionResourceStatus; + inboundResourceType: string; + inboundResourceUrl: string; + outboundParticipantSid: string; + outboundResourceSid: string; + outboundResourceStatus: InteractionResourceStatus; + outboundResourceType: string; + outboundResourceUrl: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface InteractionSolution { + serviceSid: string; + sessionSid: string; +} +export interface InteractionListInstance { + _version: V1; + _solution: InteractionSolution; + _uri: string; + (sid: string): InteractionContext; + get(sid: string): InteractionContext; + /** + * Streams InteractionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: InteractionInstance, done: (err?: Error) => void) => void): void; + each(params: InteractionListInstanceEachOptions, callback?: (item: InteractionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of InteractionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: InteractionPage) => any): Promise; + /** + * Lists InteractionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: InteractionInstance[]) => any): Promise; + list(params: InteractionListInstanceOptions, callback?: (error: Error | null, items: InteractionInstance[]) => any): Promise; + /** + * Retrieve a single page of InteractionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { InteractionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: InteractionPage) => any): Promise; + page(params: InteractionListInstancePageOptions, callback?: (error: Error | null, items: InteractionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function InteractionListInstance(version: V1, serviceSid: string, sessionSid: string): InteractionListInstance; +export declare class InteractionPage extends Page { + /** + * Initialize the InteractionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: InteractionSolution); + /** + * Build an instance of InteractionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: InteractionResource): InteractionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/session/interaction.js b/node_modules/twilio/lib/rest/proxy/v1/service/session/interaction.js new file mode 100644 index 00000000..49bd95df --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/session/interaction.js @@ -0,0 +1,238 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Proxy + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InteractionPage = exports.InteractionListInstance = exports.InteractionInstance = exports.InteractionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class InteractionContextImpl { + constructor(_version, serviceSid, sessionSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sessionSid)) { + throw new Error("Parameter 'sessionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sessionSid, sid }; + this._uri = `/Services/${serviceSid}/Sessions/${sessionSid}/Interactions/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new InteractionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sessionSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionContextImpl = InteractionContextImpl; +class InteractionInstance { + constructor(_version, payload, serviceSid, sessionSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.sessionSid = payload.session_sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.data = payload.data; + this.type = payload.type; + this.inboundParticipantSid = payload.inbound_participant_sid; + this.inboundResourceSid = payload.inbound_resource_sid; + this.inboundResourceStatus = payload.inbound_resource_status; + this.inboundResourceType = payload.inbound_resource_type; + this.inboundResourceUrl = payload.inbound_resource_url; + this.outboundParticipantSid = payload.outbound_participant_sid; + this.outboundResourceSid = payload.outbound_resource_sid; + this.outboundResourceStatus = payload.outbound_resource_status; + this.outboundResourceType = payload.outbound_resource_type; + this.outboundResourceUrl = payload.outbound_resource_url; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, sessionSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new InteractionContextImpl(this._version, this._solution.serviceSid, this._solution.sessionSid, this._solution.sid); + return this._context; + } + /** + * Remove a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a InteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed InteractionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + sessionSid: this.sessionSid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + data: this.data, + type: this.type, + inboundParticipantSid: this.inboundParticipantSid, + inboundResourceSid: this.inboundResourceSid, + inboundResourceStatus: this.inboundResourceStatus, + inboundResourceType: this.inboundResourceType, + inboundResourceUrl: this.inboundResourceUrl, + outboundParticipantSid: this.outboundParticipantSid, + outboundResourceSid: this.outboundResourceSid, + outboundResourceStatus: this.outboundResourceStatus, + outboundResourceType: this.outboundResourceType, + outboundResourceUrl: this.outboundResourceUrl, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionInstance = InteractionInstance; +function InteractionListInstance(version, serviceSid, sessionSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sessionSid)) { + throw new Error("Parameter 'sessionSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new InteractionContextImpl(version, serviceSid, sessionSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, sessionSid }; + instance._uri = `/Services/${serviceSid}/Sessions/${sessionSid}/Interactions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new InteractionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new InteractionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.InteractionListInstance = InteractionListInstance; +class InteractionPage extends Page_1.default { + /** + * Initialize the InteractionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of InteractionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new InteractionInstance(this._version, payload, this._solution.serviceSid, this._solution.sessionSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.InteractionPage = InteractionPage; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/session/participant.d.ts b/node_modules/twilio/lib/rest/proxy/v1/service/session/participant.d.ts new file mode 100644 index 00000000..9abd4ccf --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/session/participant.d.ts @@ -0,0 +1,310 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +import { MessageInteractionListInstance } from "./participant/messageInteraction"; +/** + * Options to pass to create a ParticipantInstance + */ +export interface ParticipantListInstanceCreateOptions { + /** The phone number of the Participant. */ + identifier: string; + /** The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** */ + friendlyName?: string; + /** The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool. */ + proxyIdentifier?: string; + /** The SID of the Proxy Identifier to assign to the Participant. */ + proxyIdentifierSid?: string; +} +/** + * Options to pass to each + */ +export interface ParticipantListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ParticipantListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ParticipantListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ParticipantContext { + messageInteractions: MessageInteractionListInstance; + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ParticipantContextSolution { + serviceSid: string; + sessionSid: string; + sid: string; +} +export declare class ParticipantContextImpl implements ParticipantContext { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _uri: string; + protected _messageInteractions?: MessageInteractionListInstance; + constructor(_version: V1, serviceSid: string, sessionSid: string, sid: string); + get messageInteractions(): MessageInteractionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ParticipantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ParticipantPayload extends TwilioResponsePayload { + participants: ParticipantResource[]; +} +interface ParticipantResource { + sid: string; + session_sid: string; + service_sid: string; + account_sid: string; + friendly_name: string; + identifier: string; + proxy_identifier: string; + proxy_identifier_sid: string; + date_deleted: Date; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ParticipantInstance { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _context?: ParticipantContext; + constructor(_version: V1, payload: ParticipantResource, serviceSid: string, sessionSid: string, sid?: string); + /** + * The unique string that we created to identify the Participant resource. + */ + sid: string; + /** + * The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) resource. + */ + sessionSid: string; + /** + * The SID of the resource\'s parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Participant resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the participant. This value must be 255 characters or fewer. Supports UTF-8 characters. **This value should not have PII.** + */ + friendlyName: string; + /** + * The phone number or channel identifier of the Participant. This value must be 191 characters or fewer. Supports UTF-8 characters. + */ + identifier: string; + /** + * The phone number or short code (masked number) of the participant\'s partner. The participant will call or message the partner participant at this number. + */ + proxyIdentifier: string; + /** + * The SID of the Proxy Identifier assigned to the Participant. + */ + proxyIdentifierSid: string; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Participant was removed from the session. + */ + dateDeleted: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created. + */ + dateCreated: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated. + */ + dateUpdated: Date; + /** + * The absolute URL of the Participant resource. + */ + url: string; + /** + * The URLs to resources related the participant. + */ + links: Record; + private get _proxy(); + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Access the messageInteractions. + */ + messageInteractions(): MessageInteractionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + sessionSid: string; + serviceSid: string; + accountSid: string; + friendlyName: string; + identifier: string; + proxyIdentifier: string; + proxyIdentifierSid: string; + dateDeleted: Date; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ParticipantSolution { + serviceSid: string; + sessionSid: string; +} +export interface ParticipantListInstance { + _version: V1; + _solution: ParticipantSolution; + _uri: string; + (sid: string): ParticipantContext; + get(sid: string): ParticipantContext; + /** + * Create a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + create(params: ParticipantListInstanceCreateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Streams ParticipantInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + each(params: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Lists ParticipantInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + list(params: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + /** + * Retrieve a single page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + page(params: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ParticipantListInstance(version: V1, serviceSid: string, sessionSid: string): ParticipantListInstance; +export declare class ParticipantPage extends Page { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ParticipantSolution); + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ParticipantResource): ParticipantInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/session/participant.js b/node_modules/twilio/lib/rest/proxy/v1/service/session/participant.js new file mode 100644 index 00000000..e72b1806 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/session/participant.js @@ -0,0 +1,266 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Proxy + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParticipantPage = exports.ParticipantListInstance = exports.ParticipantInstance = exports.ParticipantContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const messageInteraction_1 = require("./participant/messageInteraction"); +class ParticipantContextImpl { + constructor(_version, serviceSid, sessionSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sessionSid)) { + throw new Error("Parameter 'sessionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sessionSid, sid }; + this._uri = `/Services/${serviceSid}/Sessions/${sessionSid}/Participants/${sid}`; + } + get messageInteractions() { + this._messageInteractions = + this._messageInteractions || + (0, messageInteraction_1.MessageInteractionListInstance)(this._version, this._solution.serviceSid, this._solution.sessionSid, this._solution.sid); + return this._messageInteractions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sessionSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantContextImpl = ParticipantContextImpl; +class ParticipantInstance { + constructor(_version, payload, serviceSid, sessionSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.sessionSid = payload.session_sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.identifier = payload.identifier; + this.proxyIdentifier = payload.proxy_identifier; + this.proxyIdentifierSid = payload.proxy_identifier_sid; + this.dateDeleted = deserialize.iso8601DateTime(payload.date_deleted); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sessionSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ParticipantContextImpl(this._version, this._solution.serviceSid, this._solution.sessionSid, this._solution.sid); + return this._context; + } + /** + * Remove a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the messageInteractions. + */ + messageInteractions() { + return this._proxy.messageInteractions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + sessionSid: this.sessionSid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + identifier: this.identifier, + proxyIdentifier: this.proxyIdentifier, + proxyIdentifierSid: this.proxyIdentifierSid, + dateDeleted: this.dateDeleted, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantInstance = ParticipantInstance; +function ParticipantListInstance(version, serviceSid, sessionSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sessionSid)) { + throw new Error("Parameter 'sessionSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ParticipantContextImpl(version, serviceSid, sessionSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, sessionSid }; + instance._uri = `/Services/${serviceSid}/Sessions/${sessionSid}/Participants`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identifier"] === null || params["identifier"] === undefined) { + throw new Error("Required parameter \"params['identifier']\" missing."); + } + let data = {}; + data["Identifier"] = params["identifier"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["proxyIdentifier"] !== undefined) + data["ProxyIdentifier"] = params["proxyIdentifier"]; + if (params["proxyIdentifierSid"] !== undefined) + data["ProxyIdentifierSid"] = params["proxyIdentifierSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sessionSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ParticipantPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ParticipantListInstance = ParticipantListInstance; +class ParticipantPage extends Page_1.default { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ParticipantInstance(this._version, payload, this._solution.serviceSid, this._solution.sessionSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantPage = ParticipantPage; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/session/participant/messageInteraction.d.ts b/node_modules/twilio/lib/rest/proxy/v1/service/session/participant/messageInteraction.d.ts new file mode 100644 index 00000000..81b19706 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/session/participant/messageInteraction.d.ts @@ -0,0 +1,326 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../../base/Page"; +import Response from "../../../../../../http/response"; +import V1 from "../../../../V1"; +export type MessageInteractionResourceStatus = "accepted" | "answered" | "busy" | "canceled" | "completed" | "deleted" | "delivered" | "delivery-unknown" | "failed" | "in-progress" | "initiated" | "no-answer" | "queued" | "received" | "receiving" | "ringing" | "scheduled" | "sending" | "sent" | "undelivered" | "unknown"; +export type MessageInteractionType = "message" | "voice" | "unknown"; +/** + * Options to pass to create a MessageInteractionInstance + */ +export interface MessageInteractionListInstanceCreateOptions { + /** The message to send to the participant */ + body?: string; + /** Reserved. Not currently supported. */ + mediaUrl?: Array; +} +/** + * Options to pass to each + */ +export interface MessageInteractionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessageInteractionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessageInteractionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessageInteractionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessageInteractionContext { + /** + * Fetch a MessageInteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInteractionInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessageInteractionContextSolution { + serviceSid: string; + sessionSid: string; + participantSid: string; + sid: string; +} +export declare class MessageInteractionContextImpl implements MessageInteractionContext { + protected _version: V1; + protected _solution: MessageInteractionContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sessionSid: string, participantSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: MessageInteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessageInteractionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessageInteractionPayload extends TwilioResponsePayload { + interactions: MessageInteractionResource[]; +} +interface MessageInteractionResource { + sid: string; + session_sid: string; + service_sid: string; + account_sid: string; + data: string; + type: MessageInteractionType; + participant_sid: string; + inbound_participant_sid: string; + inbound_resource_sid: string; + inbound_resource_status: MessageInteractionResourceStatus; + inbound_resource_type: string; + inbound_resource_url: string; + outbound_participant_sid: string; + outbound_resource_sid: string; + outbound_resource_status: MessageInteractionResourceStatus; + outbound_resource_type: string; + outbound_resource_url: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class MessageInteractionInstance { + protected _version: V1; + protected _solution: MessageInteractionContextSolution; + protected _context?: MessageInteractionContext; + constructor(_version: V1, payload: MessageInteractionResource, serviceSid: string, sessionSid: string, participantSid: string, sid?: string); + /** + * The unique string that we created to identify the MessageInteraction resource. + */ + sid: string; + /** + * The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) resource. + */ + sessionSid: string; + /** + * The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MessageInteraction resource. + */ + accountSid: string; + /** + * A JSON string that includes the message body sent to the participant. (e.g. `{\"body\": \"hello\"}`) + */ + data: string; + type: MessageInteractionType; + /** + * The SID of the [Participant](https://www.twilio.com/docs/proxy/api/participant) resource. + */ + participantSid: string; + /** + * Always empty for created Message Interactions. + */ + inboundParticipantSid: string; + /** + * Always empty for created Message Interactions. + */ + inboundResourceSid: string; + inboundResourceStatus: MessageInteractionResourceStatus; + /** + * Always empty for created Message Interactions. + */ + inboundResourceType: string; + /** + * Always empty for created Message Interactions. + */ + inboundResourceUrl: string; + /** + * The SID of the outbound [Participant](https://www.twilio.com/docs/proxy/api/participant) resource. + */ + outboundParticipantSid: string; + /** + * The SID of the outbound [Message](https://www.twilio.com/docs/sms/api/message-resource) resource. + */ + outboundResourceSid: string; + outboundResourceStatus: MessageInteractionResourceStatus; + /** + * The outbound resource type. This value is always `Message`. + */ + outboundResourceType: string; + /** + * The URL of the Twilio message resource. + */ + outboundResourceUrl: string; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created. + */ + dateCreated: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated. + */ + dateUpdated: Date; + /** + * The absolute URL of the MessageInteraction resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a MessageInteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInteractionInstance + */ + fetch(callback?: (error: Error | null, item?: MessageInteractionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + sessionSid: string; + serviceSid: string; + accountSid: string; + data: string; + type: MessageInteractionType; + participantSid: string; + inboundParticipantSid: string; + inboundResourceSid: string; + inboundResourceStatus: MessageInteractionResourceStatus; + inboundResourceType: string; + inboundResourceUrl: string; + outboundParticipantSid: string; + outboundResourceSid: string; + outboundResourceStatus: MessageInteractionResourceStatus; + outboundResourceType: string; + outboundResourceUrl: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessageInteractionSolution { + serviceSid: string; + sessionSid: string; + participantSid: string; +} +export interface MessageInteractionListInstance { + _version: V1; + _solution: MessageInteractionSolution; + _uri: string; + (sid: string): MessageInteractionContext; + get(sid: string): MessageInteractionContext; + /** + * Create a MessageInteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInteractionInstance + */ + create(callback?: (error: Error | null, item?: MessageInteractionInstance) => any): Promise; + /** + * Create a MessageInteractionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInteractionInstance + */ + create(params: MessageInteractionListInstanceCreateOptions, callback?: (error: Error | null, item?: MessageInteractionInstance) => any): Promise; + /** + * Streams MessageInteractionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageInteractionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessageInteractionInstance, done: (err?: Error) => void) => void): void; + each(params: MessageInteractionListInstanceEachOptions, callback?: (item: MessageInteractionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessageInteractionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessageInteractionPage) => any): Promise; + /** + * Lists MessageInteractionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageInteractionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessageInteractionInstance[]) => any): Promise; + list(params: MessageInteractionListInstanceOptions, callback?: (error: Error | null, items: MessageInteractionInstance[]) => any): Promise; + /** + * Retrieve a single page of MessageInteractionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessageInteractionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessageInteractionPage) => any): Promise; + page(params: MessageInteractionListInstancePageOptions, callback?: (error: Error | null, items: MessageInteractionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessageInteractionListInstance(version: V1, serviceSid: string, sessionSid: string, participantSid: string): MessageInteractionListInstance; +export declare class MessageInteractionPage extends Page { + /** + * Initialize the MessageInteractionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: MessageInteractionSolution); + /** + * Build an instance of MessageInteractionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessageInteractionResource): MessageInteractionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/session/participant/messageInteraction.js b/node_modules/twilio/lib/rest/proxy/v1/service/session/participant/messageInteraction.js new file mode 100644 index 00000000..fce3caf2 --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/session/participant/messageInteraction.js @@ -0,0 +1,257 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Proxy + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessageInteractionPage = exports.MessageInteractionListInstance = exports.MessageInteractionInstance = exports.MessageInteractionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../../base/Page")); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class MessageInteractionContextImpl { + constructor(_version, serviceSid, sessionSid, participantSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sessionSid)) { + throw new Error("Parameter 'sessionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sessionSid, participantSid, sid }; + this._uri = `/Services/${serviceSid}/Sessions/${sessionSid}/Participants/${participantSid}/MessageInteractions/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessageInteractionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sessionSid, instance._solution.participantSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInteractionContextImpl = MessageInteractionContextImpl; +class MessageInteractionInstance { + constructor(_version, payload, serviceSid, sessionSid, participantSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.sessionSid = payload.session_sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.data = payload.data; + this.type = payload.type; + this.participantSid = payload.participant_sid; + this.inboundParticipantSid = payload.inbound_participant_sid; + this.inboundResourceSid = payload.inbound_resource_sid; + this.inboundResourceStatus = payload.inbound_resource_status; + this.inboundResourceType = payload.inbound_resource_type; + this.inboundResourceUrl = payload.inbound_resource_url; + this.outboundParticipantSid = payload.outbound_participant_sid; + this.outboundResourceSid = payload.outbound_resource_sid; + this.outboundResourceStatus = payload.outbound_resource_status; + this.outboundResourceType = payload.outbound_resource_type; + this.outboundResourceUrl = payload.outbound_resource_url; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { + serviceSid, + sessionSid, + participantSid, + sid: sid || this.sid, + }; + } + get _proxy() { + this._context = + this._context || + new MessageInteractionContextImpl(this._version, this._solution.serviceSid, this._solution.sessionSid, this._solution.participantSid, this._solution.sid); + return this._context; + } + /** + * Fetch a MessageInteractionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessageInteractionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + sessionSid: this.sessionSid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + data: this.data, + type: this.type, + participantSid: this.participantSid, + inboundParticipantSid: this.inboundParticipantSid, + inboundResourceSid: this.inboundResourceSid, + inboundResourceStatus: this.inboundResourceStatus, + inboundResourceType: this.inboundResourceType, + inboundResourceUrl: this.inboundResourceUrl, + outboundParticipantSid: this.outboundParticipantSid, + outboundResourceSid: this.outboundResourceSid, + outboundResourceStatus: this.outboundResourceStatus, + outboundResourceType: this.outboundResourceType, + outboundResourceUrl: this.outboundResourceUrl, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInteractionInstance = MessageInteractionInstance; +function MessageInteractionListInstance(version, serviceSid, sessionSid, participantSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sessionSid)) { + throw new Error("Parameter 'sessionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new MessageInteractionContextImpl(version, serviceSid, sessionSid, participantSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, sessionSid, participantSid }; + instance._uri = `/Services/${serviceSid}/Sessions/${sessionSid}/Participants/${participantSid}/MessageInteractions`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["body"] !== undefined) + data["Body"] = params["body"]; + if (params["mediaUrl"] !== undefined) + data["MediaUrl"] = serialize.map(params["mediaUrl"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInteractionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sessionSid, instance._solution.participantSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessageInteractionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessageInteractionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessageInteractionListInstance = MessageInteractionListInstance; +class MessageInteractionPage extends Page_1.default { + /** + * Initialize the MessageInteractionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessageInteractionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessageInteractionInstance(this._version, payload, this._solution.serviceSid, this._solution.sessionSid, this._solution.participantSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessageInteractionPage = MessageInteractionPage; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/shortCode.d.ts b/node_modules/twilio/lib/rest/proxy/v1/service/shortCode.d.ts new file mode 100644 index 00000000..420a0adc --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/shortCode.d.ts @@ -0,0 +1,316 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { PhoneNumberCapabilities } from "../../../../interfaces"; +/** + * Options to pass to update a ShortCodeInstance + */ +export interface ShortCodeContextUpdateOptions { + /** Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. */ + isReserved?: boolean; +} +/** + * Options to pass to create a ShortCodeInstance + */ +export interface ShortCodeListInstanceCreateOptions { + /** The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. */ + sid: string; +} +/** + * Options to pass to each + */ +export interface ShortCodeListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ShortCodeListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ShortCodeListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ShortCodeContext { + /** + * Remove a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Update a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + update(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Update a ShortCodeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + update(params: ShortCodeContextUpdateOptions, callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ShortCodeContextSolution { + serviceSid: string; + sid: string; +} +export declare class ShortCodeContextImpl implements ShortCodeContext { + protected _version: V1; + protected _solution: ShortCodeContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + update(params?: ShortCodeContextUpdateOptions | ((error: Error | null, item?: ShortCodeInstance) => any), callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ShortCodeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ShortCodePayload extends TwilioResponsePayload { + short_codes: ShortCodeResource[]; +} +interface ShortCodeResource { + sid: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + short_code: string; + iso_country: string; + capabilities: PhoneNumberCapabilities; + url: string; + is_reserved: boolean; +} +export declare class ShortCodeInstance { + protected _version: V1; + protected _solution: ShortCodeContextSolution; + protected _context?: ShortCodeContext; + constructor(_version: V1, payload: ShortCodeResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the ShortCode resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource. + */ + accountSid: string; + /** + * The SID of the ShortCode resource\'s parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. + */ + serviceSid: string; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created. + */ + dateCreated: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated. + */ + dateUpdated: Date; + /** + * The short code\'s number. + */ + shortCode: string; + /** + * The ISO Country Code for the short code. + */ + isoCountry: string; + capabilities: PhoneNumberCapabilities; + /** + * The absolute URL of the ShortCode resource. + */ + url: string; + /** + * Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + */ + isReserved: boolean; + private get _proxy(); + /** + * Remove a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Update a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + update(callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Update a ShortCodeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + update(params: ShortCodeContextUpdateOptions, callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + shortCode: string; + isoCountry: string; + capabilities: PhoneNumberCapabilities; + url: string; + isReserved: boolean; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ShortCodeSolution { + serviceSid: string; +} +export interface ShortCodeListInstance { + _version: V1; + _solution: ShortCodeSolution; + _uri: string; + (sid: string): ShortCodeContext; + get(sid: string): ShortCodeContext; + /** + * Create a ShortCodeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + create(params: ShortCodeListInstanceCreateOptions, callback?: (error: Error | null, item?: ShortCodeInstance) => any): Promise; + /** + * Streams ShortCodeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void): void; + each(params: ShortCodeListInstanceEachOptions, callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ShortCodeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + /** + * Lists ShortCodeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ShortCodeInstance[]) => any): Promise; + list(params: ShortCodeListInstanceOptions, callback?: (error: Error | null, items: ShortCodeInstance[]) => any): Promise; + /** + * Retrieve a single page of ShortCodeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ShortCodeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + page(params: ShortCodeListInstancePageOptions, callback?: (error: Error | null, items: ShortCodePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ShortCodeListInstance(version: V1, serviceSid: string): ShortCodeListInstance; +export declare class ShortCodePage extends Page { + /** + * Initialize the ShortCodePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ShortCodeSolution); + /** + * Build an instance of ShortCodeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ShortCodeResource): ShortCodeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/proxy/v1/service/shortCode.js b/node_modules/twilio/lib/rest/proxy/v1/service/shortCode.js new file mode 100644 index 00000000..718ab94e --- /dev/null +++ b/node_modules/twilio/lib/rest/proxy/v1/service/shortCode.js @@ -0,0 +1,262 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Proxy + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ShortCodePage = exports.ShortCodeListInstance = exports.ShortCodeInstance = exports.ShortCodeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ShortCodeContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/ShortCodes/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ShortCodeInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["isReserved"] !== undefined) + data["IsReserved"] = serialize.bool(params["isReserved"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ShortCodeInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodeContextImpl = ShortCodeContextImpl; +class ShortCodeInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.shortCode = payload.short_code; + this.isoCountry = payload.iso_country; + this.capabilities = payload.capabilities; + this.url = payload.url; + this.isReserved = payload.is_reserved; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ShortCodeContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ShortCodeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ShortCodeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + shortCode: this.shortCode, + isoCountry: this.isoCountry, + capabilities: this.capabilities, + url: this.url, + isReserved: this.isReserved, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodeInstance = ShortCodeInstance; +function ShortCodeListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ShortCodeContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/ShortCodes`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["sid"] === null || params["sid"] === undefined) { + throw new Error("Required parameter \"params['sid']\" missing."); + } + let data = {}; + data["Sid"] = params["sid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ShortCodeInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ShortCodePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ShortCodePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ShortCodeListInstance = ShortCodeListInstance; +class ShortCodePage extends Page_1.default { + /** + * Initialize the ShortCodePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ShortCodeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ShortCodeInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ShortCodePage = ShortCodePage; diff --git a/node_modules/twilio/lib/rest/routes/V2.d.ts b/node_modules/twilio/lib/rest/routes/V2.d.ts new file mode 100644 index 00000000..4de0b593 --- /dev/null +++ b/node_modules/twilio/lib/rest/routes/V2.d.ts @@ -0,0 +1,25 @@ +import RoutesBase from "../RoutesBase"; +import Version from "../../base/Version"; +import { PhoneNumberListInstance } from "./v2/phoneNumber"; +import { SipDomainListInstance } from "./v2/sipDomain"; +import { TrunkListInstance } from "./v2/trunk"; +export default class V2 extends Version { + /** + * Initialize the V2 version of Routes + * + * @param domain - The Twilio (Twilio.Routes) domain + */ + constructor(domain: RoutesBase); + /** phoneNumbers - { Twilio.Routes.V2.PhoneNumberListInstance } resource */ + protected _phoneNumbers?: PhoneNumberListInstance; + /** sipDomains - { Twilio.Routes.V2.SipDomainListInstance } resource */ + protected _sipDomains?: SipDomainListInstance; + /** trunks - { Twilio.Routes.V2.TrunkListInstance } resource */ + protected _trunks?: TrunkListInstance; + /** Getter for phoneNumbers resource */ + get phoneNumbers(): PhoneNumberListInstance; + /** Getter for sipDomains resource */ + get sipDomains(): SipDomainListInstance; + /** Getter for trunks resource */ + get trunks(): TrunkListInstance; +} diff --git a/node_modules/twilio/lib/rest/routes/V2.js b/node_modules/twilio/lib/rest/routes/V2.js new file mode 100644 index 00000000..155021b7 --- /dev/null +++ b/node_modules/twilio/lib/rest/routes/V2.js @@ -0,0 +1,48 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Routes + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const phoneNumber_1 = require("./v2/phoneNumber"); +const sipDomain_1 = require("./v2/sipDomain"); +const trunk_1 = require("./v2/trunk"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of Routes + * + * @param domain - The Twilio (Twilio.Routes) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for phoneNumbers resource */ + get phoneNumbers() { + this._phoneNumbers = this._phoneNumbers || (0, phoneNumber_1.PhoneNumberListInstance)(this); + return this._phoneNumbers; + } + /** Getter for sipDomains resource */ + get sipDomains() { + this._sipDomains = this._sipDomains || (0, sipDomain_1.SipDomainListInstance)(this); + return this._sipDomains; + } + /** Getter for trunks resource */ + get trunks() { + this._trunks = this._trunks || (0, trunk_1.TrunkListInstance)(this); + return this._trunks; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/routes/v2/phoneNumber.d.ts b/node_modules/twilio/lib/rest/routes/v2/phoneNumber.d.ts new file mode 100644 index 00000000..2b9fa94c --- /dev/null +++ b/node_modules/twilio/lib/rest/routes/v2/phoneNumber.d.ts @@ -0,0 +1,168 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +/** + * Options to pass to update a PhoneNumberInstance + */ +export interface PhoneNumberContextUpdateOptions { + /** The Inbound Processing Region used for this phone number for voice */ + voiceRegion?: string; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; +} +export interface PhoneNumberContext { + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Update a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + update(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Update a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + update(params: PhoneNumberContextUpdateOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PhoneNumberContextSolution { + phoneNumber: string; +} +export declare class PhoneNumberContextImpl implements PhoneNumberContext { + protected _version: V2; + protected _solution: PhoneNumberContextSolution; + protected _uri: string; + constructor(_version: V2, phoneNumber: string); + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + update(params?: PhoneNumberContextUpdateOptions | ((error: Error | null, item?: PhoneNumberInstance) => any), callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PhoneNumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PhoneNumberResource { + phone_number: string; + url: string; + sid: string; + account_sid: string; + friendly_name: string; + voice_region: string; + date_created: Date; + date_updated: Date; +} +export declare class PhoneNumberInstance { + protected _version: V2; + protected _solution: PhoneNumberContextSolution; + protected _context?: PhoneNumberContext; + constructor(_version: V2, payload: PhoneNumberResource, phoneNumber?: string); + /** + * The phone number in E.164 format + */ + phoneNumber: string; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * A 34 character string that uniquely identifies the Inbound Processing Region assignments for this phone number. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * A human readable description of the Inbound Processing Region assignments for this phone number, up to 64 characters. + */ + friendlyName: string; + /** + * The Inbound Processing Region used for this phone number for voice. + */ + voiceRegion: string; + /** + * The date that this phone number was assigned an Inbound Processing Region, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that the Inbound Processing Region was updated for this phone number, given in ISO 8601 format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Update a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + update(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Update a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + update(params: PhoneNumberContextUpdateOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + phoneNumber: string; + url: string; + sid: string; + accountSid: string; + friendlyName: string; + voiceRegion: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PhoneNumberSolution { +} +export interface PhoneNumberListInstance { + _version: V2; + _solution: PhoneNumberSolution; + _uri: string; + (phoneNumber: string): PhoneNumberContext; + get(phoneNumber: string): PhoneNumberContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PhoneNumberListInstance(version: V2): PhoneNumberListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/routes/v2/phoneNumber.js b/node_modules/twilio/lib/rest/routes/v2/phoneNumber.js new file mode 100644 index 00000000..4375f253 --- /dev/null +++ b/node_modules/twilio/lib/rest/routes/v2/phoneNumber.js @@ -0,0 +1,149 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Routes + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PhoneNumberListInstance = exports.PhoneNumberInstance = exports.PhoneNumberContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PhoneNumberContextImpl { + constructor(_version, phoneNumber) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(phoneNumber)) { + throw new Error("Parameter 'phoneNumber' is not valid."); + } + this._solution = { phoneNumber }; + this._uri = `/PhoneNumbers/${phoneNumber}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.phoneNumber)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["voiceRegion"] !== undefined) + data["VoiceRegion"] = params["voiceRegion"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.phoneNumber)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberContextImpl = PhoneNumberContextImpl; +class PhoneNumberInstance { + constructor(_version, payload, phoneNumber) { + this._version = _version; + this.phoneNumber = payload.phone_number; + this.url = payload.url; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.voiceRegion = payload.voice_region; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { phoneNumber: phoneNumber || this.phoneNumber }; + } + get _proxy() { + this._context = + this._context || + new PhoneNumberContextImpl(this._version, this._solution.phoneNumber); + return this._context; + } + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + phoneNumber: this.phoneNumber, + url: this.url, + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + voiceRegion: this.voiceRegion, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberInstance = PhoneNumberInstance; +function PhoneNumberListInstance(version) { + const instance = ((phoneNumber) => instance.get(phoneNumber)); + instance.get = function get(phoneNumber) { + return new PhoneNumberContextImpl(version, phoneNumber); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PhoneNumberListInstance = PhoneNumberListInstance; diff --git a/node_modules/twilio/lib/rest/routes/v2/sipDomain.d.ts b/node_modules/twilio/lib/rest/routes/v2/sipDomain.d.ts new file mode 100644 index 00000000..bbc9bab3 --- /dev/null +++ b/node_modules/twilio/lib/rest/routes/v2/sipDomain.d.ts @@ -0,0 +1,144 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +/** + * Options to pass to update a SipDomainInstance + */ +export interface SipDomainContextUpdateOptions { + /** */ + voiceRegion?: string; + /** */ + friendlyName?: string; +} +export interface SipDomainContext { + /** + * Fetch a SipDomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SipDomainInstance + */ + fetch(callback?: (error: Error | null, item?: SipDomainInstance) => any): Promise; + /** + * Update a SipDomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SipDomainInstance + */ + update(callback?: (error: Error | null, item?: SipDomainInstance) => any): Promise; + /** + * Update a SipDomainInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SipDomainInstance + */ + update(params: SipDomainContextUpdateOptions, callback?: (error: Error | null, item?: SipDomainInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SipDomainContextSolution { + sipDomain: string; +} +export declare class SipDomainContextImpl implements SipDomainContext { + protected _version: V2; + protected _solution: SipDomainContextSolution; + protected _uri: string; + constructor(_version: V2, sipDomain: string); + fetch(callback?: (error: Error | null, item?: SipDomainInstance) => any): Promise; + update(params?: SipDomainContextUpdateOptions | ((error: Error | null, item?: SipDomainInstance) => any), callback?: (error: Error | null, item?: SipDomainInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SipDomainContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SipDomainResource { + sip_domain: string; + url: string; + sid: string; + account_sid: string; + friendly_name: string; + voice_region: string; + date_created: Date; + date_updated: Date; +} +export declare class SipDomainInstance { + protected _version: V2; + protected _solution: SipDomainContextSolution; + protected _context?: SipDomainContext; + constructor(_version: V2, payload: SipDomainResource, sipDomain?: string); + sipDomain: string; + url: string; + sid: string; + accountSid: string; + friendlyName: string; + voiceRegion: string; + dateCreated: Date; + dateUpdated: Date; + private get _proxy(); + /** + * Fetch a SipDomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SipDomainInstance + */ + fetch(callback?: (error: Error | null, item?: SipDomainInstance) => any): Promise; + /** + * Update a SipDomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SipDomainInstance + */ + update(callback?: (error: Error | null, item?: SipDomainInstance) => any): Promise; + /** + * Update a SipDomainInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SipDomainInstance + */ + update(params: SipDomainContextUpdateOptions, callback?: (error: Error | null, item?: SipDomainInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sipDomain: string; + url: string; + sid: string; + accountSid: string; + friendlyName: string; + voiceRegion: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SipDomainSolution { +} +export interface SipDomainListInstance { + _version: V2; + _solution: SipDomainSolution; + _uri: string; + (sipDomain: string): SipDomainContext; + get(sipDomain: string): SipDomainContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SipDomainListInstance(version: V2): SipDomainListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/routes/v2/sipDomain.js b/node_modules/twilio/lib/rest/routes/v2/sipDomain.js new file mode 100644 index 00000000..34fe001b --- /dev/null +++ b/node_modules/twilio/lib/rest/routes/v2/sipDomain.js @@ -0,0 +1,149 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Routes + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SipDomainListInstance = exports.SipDomainInstance = exports.SipDomainContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class SipDomainContextImpl { + constructor(_version, sipDomain) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sipDomain)) { + throw new Error("Parameter 'sipDomain' is not valid."); + } + this._solution = { sipDomain }; + this._uri = `/SipDomains/${sipDomain}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SipDomainInstance(operationVersion, payload, instance._solution.sipDomain)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["voiceRegion"] !== undefined) + data["VoiceRegion"] = params["voiceRegion"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SipDomainInstance(operationVersion, payload, instance._solution.sipDomain)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SipDomainContextImpl = SipDomainContextImpl; +class SipDomainInstance { + constructor(_version, payload, sipDomain) { + this._version = _version; + this.sipDomain = payload.sip_domain; + this.url = payload.url; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.voiceRegion = payload.voice_region; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { sipDomain: sipDomain || this.sipDomain }; + } + get _proxy() { + this._context = + this._context || + new SipDomainContextImpl(this._version, this._solution.sipDomain); + return this._context; + } + /** + * Fetch a SipDomainInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SipDomainInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sipDomain: this.sipDomain, + url: this.url, + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + voiceRegion: this.voiceRegion, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SipDomainInstance = SipDomainInstance; +function SipDomainListInstance(version) { + const instance = ((sipDomain) => instance.get(sipDomain)); + instance.get = function get(sipDomain) { + return new SipDomainContextImpl(version, sipDomain); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SipDomainListInstance = SipDomainListInstance; diff --git a/node_modules/twilio/lib/rest/routes/v2/trunk.d.ts b/node_modules/twilio/lib/rest/routes/v2/trunk.d.ts new file mode 100644 index 00000000..88cf62df --- /dev/null +++ b/node_modules/twilio/lib/rest/routes/v2/trunk.d.ts @@ -0,0 +1,168 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +/** + * Options to pass to update a TrunkInstance + */ +export interface TrunkContextUpdateOptions { + /** The Inbound Processing Region used for this SIP Trunk for voice */ + voiceRegion?: string; + /** A human readable description of this resource, up to 64 characters. */ + friendlyName?: string; +} +export interface TrunkContext { + /** + * Fetch a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + fetch(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Update a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + update(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Update a TrunkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + update(params: TrunkContextUpdateOptions, callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TrunkContextSolution { + sipTrunkDomain: string; +} +export declare class TrunkContextImpl implements TrunkContext { + protected _version: V2; + protected _solution: TrunkContextSolution; + protected _uri: string; + constructor(_version: V2, sipTrunkDomain: string); + fetch(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + update(params?: TrunkContextUpdateOptions | ((error: Error | null, item?: TrunkInstance) => any), callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TrunkContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TrunkResource { + sip_trunk_domain: string; + url: string; + sid: string; + account_sid: string; + friendly_name: string; + voice_region: string; + date_created: Date; + date_updated: Date; +} +export declare class TrunkInstance { + protected _version: V2; + protected _solution: TrunkContextSolution; + protected _context?: TrunkContext; + constructor(_version: V2, payload: TrunkResource, sipTrunkDomain?: string); + /** + * The absolute URL of the SIP Trunk + */ + sipTrunkDomain: string; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * A 34 character string that uniquely identifies the Inbound Processing Region assignments for this SIP Trunk. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * A human readable description of the Inbound Processing Region assignments for this SIP Trunk, up to 64 characters. + */ + friendlyName: string; + /** + * The Inbound Processing Region used for this SIP Trunk for voice. + */ + voiceRegion: string; + /** + * The date that this SIP Trunk was assigned an Inbound Processing Region, given in ISO 8601 format. + */ + dateCreated: Date; + /** + * The date that the Inbound Processing Region was updated for this SIP Trunk, given in ISO 8601 format. + */ + dateUpdated: Date; + private get _proxy(); + /** + * Fetch a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + fetch(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Update a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + update(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Update a TrunkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + update(params: TrunkContextUpdateOptions, callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sipTrunkDomain: string; + url: string; + sid: string; + accountSid: string; + friendlyName: string; + voiceRegion: string; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TrunkSolution { +} +export interface TrunkListInstance { + _version: V2; + _solution: TrunkSolution; + _uri: string; + (sipTrunkDomain: string): TrunkContext; + get(sipTrunkDomain: string): TrunkContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TrunkListInstance(version: V2): TrunkListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/routes/v2/trunk.js b/node_modules/twilio/lib/rest/routes/v2/trunk.js new file mode 100644 index 00000000..0a9dd4e9 --- /dev/null +++ b/node_modules/twilio/lib/rest/routes/v2/trunk.js @@ -0,0 +1,149 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Routes + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TrunkListInstance = exports.TrunkInstance = exports.TrunkContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class TrunkContextImpl { + constructor(_version, sipTrunkDomain) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sipTrunkDomain)) { + throw new Error("Parameter 'sipTrunkDomain' is not valid."); + } + this._solution = { sipTrunkDomain }; + this._uri = `/Trunks/${sipTrunkDomain}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TrunkInstance(operationVersion, payload, instance._solution.sipTrunkDomain)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["voiceRegion"] !== undefined) + data["VoiceRegion"] = params["voiceRegion"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrunkInstance(operationVersion, payload, instance._solution.sipTrunkDomain)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrunkContextImpl = TrunkContextImpl; +class TrunkInstance { + constructor(_version, payload, sipTrunkDomain) { + this._version = _version; + this.sipTrunkDomain = payload.sip_trunk_domain; + this.url = payload.url; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.voiceRegion = payload.voice_region; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this._solution = { sipTrunkDomain: sipTrunkDomain || this.sipTrunkDomain }; + } + get _proxy() { + this._context = + this._context || + new TrunkContextImpl(this._version, this._solution.sipTrunkDomain); + return this._context; + } + /** + * Fetch a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sipTrunkDomain: this.sipTrunkDomain, + url: this.url, + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + voiceRegion: this.voiceRegion, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrunkInstance = TrunkInstance; +function TrunkListInstance(version) { + const instance = ((sipTrunkDomain) => instance.get(sipTrunkDomain)); + instance.get = function get(sipTrunkDomain) { + return new TrunkContextImpl(version, sipTrunkDomain); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TrunkListInstance = TrunkListInstance; diff --git a/node_modules/twilio/lib/rest/serverless/V1.d.ts b/node_modules/twilio/lib/rest/serverless/V1.d.ts new file mode 100644 index 00000000..46d4a6c5 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/V1.d.ts @@ -0,0 +1,15 @@ +import ServerlessBase from "../ServerlessBase"; +import Version from "../../base/Version"; +import { ServiceListInstance } from "./v1/service"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Serverless + * + * @param domain - The Twilio (Twilio.Serverless) domain + */ + constructor(domain: ServerlessBase); + /** services - { Twilio.Serverless.V1.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/serverless/V1.js b/node_modules/twilio/lib/rest/serverless/V1.js new file mode 100644 index 00000000..29853842 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/V1.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const service_1 = require("./v1/service"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Serverless + * + * @param domain - The Twilio (Twilio.Serverless) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service.d.ts new file mode 100644 index 00000000..0fc246e1 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service.d.ts @@ -0,0 +1,364 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { AssetListInstance } from "./service/asset"; +import { BuildListInstance } from "./service/build"; +import { EnvironmentListInstance } from "./service/environment"; +import { FunctionListInstance } from "./service/function"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** Whether to inject Account credentials into a function invocation context. */ + includeCredentials?: boolean; + /** A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. */ + friendlyName?: string; + /** Whether the Service resource\\\'s properties and subresources can be edited via the UI. The default value is `false`. */ + uiEditable?: boolean; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** A user-defined string that uniquely identifies the Service resource. It can be used as an alternative to the `sid` in the URL path to address the Service resource. This value must be 50 characters or less in length and be unique. */ + uniqueName: string; + /** A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. */ + friendlyName: string; + /** Whether to inject Account credentials into a function invocation context. The default value is `true`. */ + includeCredentials?: boolean; + /** Whether the Service\\\'s properties and subresources can be edited via the UI. The default value is `false`. */ + uiEditable?: boolean; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + assets: AssetListInstance; + builds: BuildListInstance; + environments: EnvironmentListInstance; + functions: FunctionListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _assets?: AssetListInstance; + protected _builds?: BuildListInstance; + protected _environments?: EnvironmentListInstance; + protected _functions?: FunctionListInstance; + constructor(_version: V1, sid: string); + get assets(): AssetListInstance; + get builds(): BuildListInstance; + get environments(): EnvironmentListInstance; + get functions(): FunctionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + unique_name: string; + include_credentials: boolean; + ui_editable: boolean; + domain_base: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ServiceInstance { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V1, payload: ServiceResource, sid?: string); + /** + * The unique string that we created to identify the Service resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the Service resource. + */ + friendlyName: string; + /** + * A user-defined string that uniquely identifies the Service resource. It can be used in place of the Service resource\'s `sid` in the URL to address the Service resource. + */ + uniqueName: string; + /** + * Whether to inject Account credentials into a function invocation context. + */ + includeCredentials: boolean; + /** + * Whether the Service resource\'s properties and subresources can be edited via the UI. + */ + uiEditable: boolean; + /** + * The base domain name for this Service, which is a combination of the unique name and a randomly generated string. + */ + domainBase: string; + /** + * The date and time in GMT when the Service resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Service resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Service resource. + */ + url: string; + /** + * The URLs of the Service\'s nested resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the assets. + */ + assets(): AssetListInstance; + /** + * Access the builds. + */ + builds(): BuildListInstance; + /** + * Access the environments. + */ + environments(): EnvironmentListInstance; + /** + * Access the functions. + */ + functions(): FunctionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + uniqueName: string; + includeCredentials: boolean; + uiEditable: boolean; + domainBase: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V1; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V1): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service.js b/node_modules/twilio/lib/rest/serverless/v1/service.js new file mode 100644 index 00000000..ed4d42da --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service.js @@ -0,0 +1,321 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const asset_1 = require("./service/asset"); +const build_1 = require("./service/build"); +const environment_1 = require("./service/environment"); +const function_1 = require("./service/function"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get assets() { + this._assets = + this._assets || (0, asset_1.AssetListInstance)(this._version, this._solution.sid); + return this._assets; + } + get builds() { + this._builds = + this._builds || (0, build_1.BuildListInstance)(this._version, this._solution.sid); + return this._builds; + } + get environments() { + this._environments = + this._environments || + (0, environment_1.EnvironmentListInstance)(this._version, this._solution.sid); + return this._environments; + } + get functions() { + this._functions = + this._functions || + (0, function_1.FunctionListInstance)(this._version, this._solution.sid); + return this._functions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["includeCredentials"] !== undefined) + data["IncludeCredentials"] = serialize.bool(params["includeCredentials"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["uiEditable"] !== undefined) + data["UiEditable"] = serialize.bool(params["uiEditable"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.uniqueName = payload.unique_name; + this.includeCredentials = payload.include_credentials; + this.uiEditable = payload.ui_editable; + this.domainBase = payload.domain_base; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the assets. + */ + assets() { + return this._proxy.assets; + } + /** + * Access the builds. + */ + builds() { + return this._proxy.builds; + } + /** + * Access the environments. + */ + environments() { + return this._proxy.environments; + } + /** + * Access the functions. + */ + functions() { + return this._proxy.functions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + uniqueName: this.uniqueName, + includeCredentials: this.includeCredentials, + uiEditable: this.uiEditable, + domainBase: this.domainBase, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["uniqueName"] === null || params["uniqueName"] === undefined) { + throw new Error("Required parameter \"params['uniqueName']\" missing."); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["UniqueName"] = params["uniqueName"]; + data["FriendlyName"] = params["friendlyName"]; + if (params["includeCredentials"] !== undefined) + data["IncludeCredentials"] = serialize.bool(params["includeCredentials"]); + if (params["uiEditable"] !== undefined) + data["UiEditable"] = serialize.bool(params["uiEditable"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/asset.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/asset.d.ts new file mode 100644 index 00000000..e971255d --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/asset.d.ts @@ -0,0 +1,298 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { AssetVersionListInstance } from "./asset/assetVersion"; +/** + * Options to pass to update a AssetInstance + */ +export interface AssetContextUpdateOptions { + /** A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. */ + friendlyName: string; +} +/** + * Options to pass to create a AssetInstance + */ +export interface AssetListInstanceCreateOptions { + /** A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface AssetListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AssetInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AssetListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AssetListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AssetContext { + assetVersions: AssetVersionListInstance; + /** + * Remove a AssetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AssetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetInstance + */ + fetch(callback?: (error: Error | null, item?: AssetInstance) => any): Promise; + /** + * Update a AssetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetInstance + */ + update(params: AssetContextUpdateOptions, callback?: (error: Error | null, item?: AssetInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AssetContextSolution { + serviceSid: string; + sid: string; +} +export declare class AssetContextImpl implements AssetContext { + protected _version: V1; + protected _solution: AssetContextSolution; + protected _uri: string; + protected _assetVersions?: AssetVersionListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get assetVersions(): AssetVersionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: AssetInstance) => any): Promise; + update(params: AssetContextUpdateOptions, callback?: (error: Error | null, item?: AssetInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AssetContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AssetPayload extends TwilioResponsePayload { + assets: AssetResource[]; +} +interface AssetResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class AssetInstance { + protected _version: V1; + protected _solution: AssetContextSolution; + protected _context?: AssetContext; + constructor(_version: V1, payload: AssetResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Asset resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Asset resource. + */ + accountSid: string; + /** + * The SID of the Service that the Asset resource is associated with. + */ + serviceSid: string; + /** + * The string that you assigned to describe the Asset resource. It can be a maximum of 255 characters. + */ + friendlyName: string; + /** + * The date and time in GMT when the Asset resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Asset resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Asset resource. + */ + url: string; + /** + * The URLs of the Asset resource\'s nested resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a AssetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a AssetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetInstance + */ + fetch(callback?: (error: Error | null, item?: AssetInstance) => any): Promise; + /** + * Update a AssetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetInstance + */ + update(params: AssetContextUpdateOptions, callback?: (error: Error | null, item?: AssetInstance) => any): Promise; + /** + * Access the assetVersions. + */ + assetVersions(): AssetVersionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AssetSolution { + serviceSid: string; +} +export interface AssetListInstance { + _version: V1; + _solution: AssetSolution; + _uri: string; + (sid: string): AssetContext; + get(sid: string): AssetContext; + /** + * Create a AssetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetInstance + */ + create(params: AssetListInstanceCreateOptions, callback?: (error: Error | null, item?: AssetInstance) => any): Promise; + /** + * Streams AssetInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssetListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AssetInstance, done: (err?: Error) => void) => void): void; + each(params: AssetListInstanceEachOptions, callback?: (item: AssetInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AssetInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AssetPage) => any): Promise; + /** + * Lists AssetInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssetListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AssetInstance[]) => any): Promise; + list(params: AssetListInstanceOptions, callback?: (error: Error | null, items: AssetInstance[]) => any): Promise; + /** + * Retrieve a single page of AssetInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssetListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AssetPage) => any): Promise; + page(params: AssetListInstancePageOptions, callback?: (error: Error | null, items: AssetPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AssetListInstance(version: V1, serviceSid: string): AssetListInstance; +export declare class AssetPage extends Page { + /** + * Initialize the AssetPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AssetSolution); + /** + * Build an instance of AssetInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AssetResource): AssetInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/asset.js b/node_modules/twilio/lib/rest/serverless/v1/service/asset.js new file mode 100644 index 00000000..08da8583 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/asset.js @@ -0,0 +1,271 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssetPage = exports.AssetListInstance = exports.AssetInstance = exports.AssetContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const assetVersion_1 = require("./asset/assetVersion"); +class AssetContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Assets/${sid}`; + } + get assetVersions() { + this._assetVersions = + this._assetVersions || + (0, assetVersion_1.AssetVersionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._assetVersions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AssetInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssetInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssetContextImpl = AssetContextImpl; +class AssetInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AssetContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a AssetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a AssetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the assetVersions. + */ + assetVersions() { + return this._proxy.assetVersions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssetInstance = AssetInstance; +function AssetListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AssetContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Assets`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssetInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssetPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AssetPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AssetListInstance = AssetListInstance; +class AssetPage extends Page_1.default { + /** + * Initialize the AssetPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AssetInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AssetInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssetPage = AssetPage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/asset/assetVersion.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/asset/assetVersion.d.ts new file mode 100644 index 00000000..404fa08f --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/asset/assetVersion.d.ts @@ -0,0 +1,231 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type AssetVersionVisibility = "public" | "private" | "protected"; +/** + * Options to pass to each + */ +export interface AssetVersionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: AssetVersionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface AssetVersionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface AssetVersionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface AssetVersionContext { + /** + * Fetch a AssetVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetVersionInstance + */ + fetch(callback?: (error: Error | null, item?: AssetVersionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AssetVersionContextSolution { + serviceSid: string; + assetSid: string; + sid: string; +} +export declare class AssetVersionContextImpl implements AssetVersionContext { + protected _version: V1; + protected _solution: AssetVersionContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, assetSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: AssetVersionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AssetVersionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AssetVersionPayload extends TwilioResponsePayload { + asset_versions: AssetVersionResource[]; +} +interface AssetVersionResource { + sid: string; + account_sid: string; + service_sid: string; + asset_sid: string; + path: string; + visibility: AssetVersionVisibility; + date_created: Date; + url: string; +} +export declare class AssetVersionInstance { + protected _version: V1; + protected _solution: AssetVersionContextSolution; + protected _context?: AssetVersionContext; + constructor(_version: V1, payload: AssetVersionResource, serviceSid: string, assetSid: string, sid?: string); + /** + * The unique string that we created to identify the Asset Version resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Asset Version resource. + */ + accountSid: string; + /** + * The SID of the Service that the Asset Version resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Asset resource that is the parent of the Asset Version. + */ + assetSid: string; + /** + * The URL-friendly string by which the Asset Version can be referenced. It can be a maximum of 255 characters. All paths begin with a forward slash (\'/\'). If an Asset Version creation request is submitted with a path not containing a leading slash, the path will automatically be prepended with one. + */ + path: string; + visibility: AssetVersionVisibility; + /** + * The date and time in GMT when the Asset Version resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The absolute URL of the Asset Version resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a AssetVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetVersionInstance + */ + fetch(callback?: (error: Error | null, item?: AssetVersionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + assetSid: string; + path: string; + visibility: AssetVersionVisibility; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AssetVersionSolution { + serviceSid: string; + assetSid: string; +} +export interface AssetVersionListInstance { + _version: V1; + _solution: AssetVersionSolution; + _uri: string; + (sid: string): AssetVersionContext; + get(sid: string): AssetVersionContext; + /** + * Streams AssetVersionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssetVersionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: AssetVersionInstance, done: (err?: Error) => void) => void): void; + each(params: AssetVersionListInstanceEachOptions, callback?: (item: AssetVersionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of AssetVersionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: AssetVersionPage) => any): Promise; + /** + * Lists AssetVersionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssetVersionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: AssetVersionInstance[]) => any): Promise; + list(params: AssetVersionListInstanceOptions, callback?: (error: Error | null, items: AssetVersionInstance[]) => any): Promise; + /** + * Retrieve a single page of AssetVersionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { AssetVersionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: AssetVersionPage) => any): Promise; + page(params: AssetVersionListInstancePageOptions, callback?: (error: Error | null, items: AssetVersionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AssetVersionListInstance(version: V1, serviceSid: string, assetSid: string): AssetVersionListInstance; +export declare class AssetVersionPage extends Page { + /** + * Initialize the AssetVersionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: AssetVersionSolution); + /** + * Build an instance of AssetVersionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AssetVersionResource): AssetVersionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/asset/assetVersion.js b/node_modules/twilio/lib/rest/serverless/v1/service/asset/assetVersion.js new file mode 100644 index 00000000..5f02ca77 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/asset/assetVersion.js @@ -0,0 +1,197 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssetVersionPage = exports.AssetVersionListInstance = exports.AssetVersionInstance = exports.AssetVersionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class AssetVersionContextImpl { + constructor(_version, serviceSid, assetSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(assetSid)) { + throw new Error("Parameter 'assetSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, assetSid, sid }; + this._uri = `/Services/${serviceSid}/Assets/${assetSid}/Versions/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AssetVersionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.assetSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssetVersionContextImpl = AssetVersionContextImpl; +class AssetVersionInstance { + constructor(_version, payload, serviceSid, assetSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.assetSid = payload.asset_sid; + this.path = payload.path; + this.visibility = payload.visibility; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { serviceSid, assetSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AssetVersionContextImpl(this._version, this._solution.serviceSid, this._solution.assetSid, this._solution.sid); + return this._context; + } + /** + * Fetch a AssetVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AssetVersionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + assetSid: this.assetSid, + path: this.path, + visibility: this.visibility, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssetVersionInstance = AssetVersionInstance; +function AssetVersionListInstance(version, serviceSid, assetSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(assetSid)) { + throw new Error("Parameter 'assetSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AssetVersionContextImpl(version, serviceSid, assetSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, assetSid }; + instance._uri = `/Services/${serviceSid}/Assets/${assetSid}/Versions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AssetVersionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new AssetVersionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AssetVersionListInstance = AssetVersionListInstance; +class AssetVersionPage extends Page_1.default { + /** + * Initialize the AssetVersionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of AssetVersionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new AssetVersionInstance(this._version, payload, this._solution.serviceSid, this._solution.assetSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AssetVersionPage = AssetVersionPage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/build.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/build.d.ts new file mode 100644 index 00000000..177ac1b1 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/build.d.ts @@ -0,0 +1,303 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { BuildStatusListInstance } from "./build/buildStatus"; +export type BuildRuntime = "node8" | "node10" | "node12" | "node14" | "node16" | "node18"; +export type BuildStatus = "building" | "completed" | "failed"; +/** + * Options to pass to create a BuildInstance + */ +export interface BuildListInstanceCreateOptions { + /** The list of Asset Version resource SIDs to include in the Build. */ + assetVersions?: Array; + /** The list of the Function Version resource SIDs to include in the Build. */ + functionVersions?: Array; + /** A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. */ + dependencies?: string; + /** The Runtime version that will be used to run the Build resource when it is deployed. */ + runtime?: string; +} +/** + * Options to pass to each + */ +export interface BuildListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BuildInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BuildListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BuildListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BuildContext { + buildStatus: BuildStatusListInstance; + /** + * Remove a BuildInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BuildInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BuildInstance + */ + fetch(callback?: (error: Error | null, item?: BuildInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BuildContextSolution { + serviceSid: string; + sid: string; +} +export declare class BuildContextImpl implements BuildContext { + protected _version: V1; + protected _solution: BuildContextSolution; + protected _uri: string; + protected _buildStatus?: BuildStatusListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get buildStatus(): BuildStatusListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: BuildInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BuildContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BuildPayload extends TwilioResponsePayload { + builds: BuildResource[]; +} +interface BuildResource { + sid: string; + account_sid: string; + service_sid: string; + status: BuildStatus; + asset_versions: Array; + function_versions: Array; + dependencies: Array; + runtime: BuildRuntime; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class BuildInstance { + protected _version: V1; + protected _solution: BuildContextSolution; + protected _context?: BuildContext; + constructor(_version: V1, payload: BuildResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Build resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Build resource. + */ + accountSid: string; + /** + * The SID of the Service that the Build resource is associated with. + */ + serviceSid: string; + status: BuildStatus; + /** + * The list of Asset Version resource SIDs that are included in the Build. + */ + assetVersions: Array; + /** + * The list of Function Version resource SIDs that are included in the Build. + */ + functionVersions: Array; + /** + * A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. + */ + dependencies: Array; + runtime: BuildRuntime; + /** + * The date and time in GMT when the Build resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Build resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Build resource. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Remove a BuildInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BuildInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BuildInstance + */ + fetch(callback?: (error: Error | null, item?: BuildInstance) => any): Promise; + /** + * Access the buildStatus. + */ + buildStatus(): BuildStatusListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + status: BuildStatus; + assetVersions: any[]; + functionVersions: any[]; + dependencies: any[]; + runtime: BuildRuntime; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BuildSolution { + serviceSid: string; +} +export interface BuildListInstance { + _version: V1; + _solution: BuildSolution; + _uri: string; + (sid: string): BuildContext; + get(sid: string): BuildContext; + /** + * Create a BuildInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BuildInstance + */ + create(callback?: (error: Error | null, item?: BuildInstance) => any): Promise; + /** + * Create a BuildInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BuildInstance + */ + create(params: BuildListInstanceCreateOptions, callback?: (error: Error | null, item?: BuildInstance) => any): Promise; + /** + * Streams BuildInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BuildListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BuildInstance, done: (err?: Error) => void) => void): void; + each(params: BuildListInstanceEachOptions, callback?: (item: BuildInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BuildInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BuildPage) => any): Promise; + /** + * Lists BuildInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BuildListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BuildInstance[]) => any): Promise; + list(params: BuildListInstanceOptions, callback?: (error: Error | null, items: BuildInstance[]) => any): Promise; + /** + * Retrieve a single page of BuildInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BuildListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BuildPage) => any): Promise; + page(params: BuildListInstancePageOptions, callback?: (error: Error | null, items: BuildPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BuildListInstance(version: V1, serviceSid: string): BuildListInstance; +export declare class BuildPage extends Page { + /** + * Initialize the BuildPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: BuildSolution); + /** + * Build an instance of BuildInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BuildResource): BuildInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/build.js b/node_modules/twilio/lib/rest/serverless/v1/service/build.js new file mode 100644 index 00000000..891d7781 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/build.js @@ -0,0 +1,260 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BuildPage = exports.BuildListInstance = exports.BuildInstance = exports.BuildContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const buildStatus_1 = require("./build/buildStatus"); +class BuildContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Builds/${sid}`; + } + get buildStatus() { + this._buildStatus = + this._buildStatus || + (0, buildStatus_1.BuildStatusListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._buildStatus; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BuildInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BuildContextImpl = BuildContextImpl; +class BuildInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.status = payload.status; + this.assetVersions = payload.asset_versions; + this.functionVersions = payload.function_versions; + this.dependencies = payload.dependencies; + this.runtime = payload.runtime; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new BuildContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a BuildInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a BuildInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BuildInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the buildStatus. + */ + buildStatus() { + return this._proxy.buildStatus; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + status: this.status, + assetVersions: this.assetVersions, + functionVersions: this.functionVersions, + dependencies: this.dependencies, + runtime: this.runtime, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BuildInstance = BuildInstance; +function BuildListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new BuildContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Builds`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["assetVersions"] !== undefined) + data["AssetVersions"] = serialize.map(params["assetVersions"], (e) => e); + if (params["functionVersions"] !== undefined) + data["FunctionVersions"] = serialize.map(params["functionVersions"], (e) => e); + if (params["dependencies"] !== undefined) + data["Dependencies"] = params["dependencies"]; + if (params["runtime"] !== undefined) + data["Runtime"] = params["runtime"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BuildInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BuildPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BuildPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BuildListInstance = BuildListInstance; +class BuildPage extends Page_1.default { + /** + * Initialize the BuildPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BuildInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BuildInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BuildPage = BuildPage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/build/buildStatus.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/build/buildStatus.d.ts new file mode 100644 index 00000000..680935de --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/build/buildStatus.d.ts @@ -0,0 +1,107 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +export type BuildStatusStatus = "building" | "completed" | "failed"; +export interface BuildStatusContext { + /** + * Fetch a BuildStatusInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BuildStatusInstance + */ + fetch(callback?: (error: Error | null, item?: BuildStatusInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BuildStatusContextSolution { + serviceSid: string; + sid: string; +} +export declare class BuildStatusContextImpl implements BuildStatusContext { + protected _version: V1; + protected _solution: BuildStatusContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: BuildStatusInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BuildStatusContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BuildStatusResource { + sid: string; + account_sid: string; + service_sid: string; + status: BuildStatusStatus; + url: string; +} +export declare class BuildStatusInstance { + protected _version: V1; + protected _solution: BuildStatusContextSolution; + protected _context?: BuildStatusContext; + constructor(_version: V1, payload: BuildStatusResource, serviceSid: string, sid: string); + /** + * The unique string that we created to identify the Build resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Build resource. + */ + accountSid: string; + /** + * The SID of the Service that the Build resource is associated with. + */ + serviceSid: string; + status: BuildStatusStatus; + /** + * The absolute URL of the Build Status resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a BuildStatusInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BuildStatusInstance + */ + fetch(callback?: (error: Error | null, item?: BuildStatusInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + status: BuildStatusStatus; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BuildStatusSolution { + serviceSid: string; + sid: string; +} +export interface BuildStatusListInstance { + _version: V1; + _solution: BuildStatusSolution; + _uri: string; + (): BuildStatusContext; + get(): BuildStatusContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BuildStatusListInstance(version: V1, serviceSid: string, sid: string): BuildStatusListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/build/buildStatus.js b/node_modules/twilio/lib/rest/serverless/v1/service/build/buildStatus.js new file mode 100644 index 00000000..d4e99825 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/build/buildStatus.js @@ -0,0 +1,123 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BuildStatusListInstance = exports.BuildStatusInstance = exports.BuildStatusContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class BuildStatusContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Builds/${sid}/Status`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BuildStatusInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BuildStatusContextImpl = BuildStatusContextImpl; +class BuildStatusInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.status = payload.status; + this.url = payload.url; + this._solution = { serviceSid, sid }; + } + get _proxy() { + this._context = + this._context || + new BuildStatusContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Fetch a BuildStatusInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BuildStatusInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + status: this.status, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BuildStatusInstance = BuildStatusInstance; +function BuildStatusListInstance(version, serviceSid, sid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new BuildStatusContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, sid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BuildStatusListInstance = BuildStatusListInstance; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/environment.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/environment.d.ts new file mode 100644 index 00000000..5fb1c858 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/environment.d.ts @@ -0,0 +1,308 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { DeploymentListInstance } from "./environment/deployment"; +import { LogListInstance } from "./environment/log"; +import { VariableListInstance } from "./environment/variable"; +/** + * Options to pass to create a EnvironmentInstance + */ +export interface EnvironmentListInstanceCreateOptions { + /** A user-defined string that uniquely identifies the Environment resource. It can be a maximum of 100 characters. */ + uniqueName: string; + /** A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. */ + domainSuffix?: string; +} +/** + * Options to pass to each + */ +export interface EnvironmentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EnvironmentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EnvironmentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EnvironmentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EnvironmentContext { + deployments: DeploymentListInstance; + logs: LogListInstance; + variables: VariableListInstance; + /** + * Remove a EnvironmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EnvironmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EnvironmentInstance + */ + fetch(callback?: (error: Error | null, item?: EnvironmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EnvironmentContextSolution { + serviceSid: string; + sid: string; +} +export declare class EnvironmentContextImpl implements EnvironmentContext { + protected _version: V1; + protected _solution: EnvironmentContextSolution; + protected _uri: string; + protected _deployments?: DeploymentListInstance; + protected _logs?: LogListInstance; + protected _variables?: VariableListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get deployments(): DeploymentListInstance; + get logs(): LogListInstance; + get variables(): VariableListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: EnvironmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EnvironmentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EnvironmentPayload extends TwilioResponsePayload { + environments: EnvironmentResource[]; +} +interface EnvironmentResource { + sid: string; + account_sid: string; + service_sid: string; + build_sid: string; + unique_name: string; + domain_suffix: string; + domain_name: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class EnvironmentInstance { + protected _version: V1; + protected _solution: EnvironmentContextSolution; + protected _context?: EnvironmentContext; + constructor(_version: V1, payload: EnvironmentResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Environment resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Environment resource. + */ + accountSid: string; + /** + * The SID of the Service that the Environment resource is associated with. + */ + serviceSid: string; + /** + * The SID of the build deployed in the environment. + */ + buildSid: string; + /** + * A user-defined string that uniquely identifies the Environment resource. + */ + uniqueName: string; + /** + * A URL-friendly name that represents the environment and forms part of the domain name. + */ + domainSuffix: string; + /** + * The domain name for all Functions and Assets deployed in the Environment, using the Service unique name, a randomly-generated Service suffix, and an optional Environment domain suffix. + */ + domainName: string; + /** + * The date and time in GMT when the Environment resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Environment resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Environment resource. + */ + url: string; + /** + * The URLs of the Environment resource\'s nested resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a EnvironmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EnvironmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EnvironmentInstance + */ + fetch(callback?: (error: Error | null, item?: EnvironmentInstance) => any): Promise; + /** + * Access the deployments. + */ + deployments(): DeploymentListInstance; + /** + * Access the logs. + */ + logs(): LogListInstance; + /** + * Access the variables. + */ + variables(): VariableListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + buildSid: string; + uniqueName: string; + domainSuffix: string; + domainName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EnvironmentSolution { + serviceSid: string; +} +export interface EnvironmentListInstance { + _version: V1; + _solution: EnvironmentSolution; + _uri: string; + (sid: string): EnvironmentContext; + get(sid: string): EnvironmentContext; + /** + * Create a EnvironmentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EnvironmentInstance + */ + create(params: EnvironmentListInstanceCreateOptions, callback?: (error: Error | null, item?: EnvironmentInstance) => any): Promise; + /** + * Streams EnvironmentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EnvironmentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EnvironmentInstance, done: (err?: Error) => void) => void): void; + each(params: EnvironmentListInstanceEachOptions, callback?: (item: EnvironmentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EnvironmentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EnvironmentPage) => any): Promise; + /** + * Lists EnvironmentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EnvironmentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EnvironmentInstance[]) => any): Promise; + list(params: EnvironmentListInstanceOptions, callback?: (error: Error | null, items: EnvironmentInstance[]) => any): Promise; + /** + * Retrieve a single page of EnvironmentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EnvironmentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EnvironmentPage) => any): Promise; + page(params: EnvironmentListInstancePageOptions, callback?: (error: Error | null, items: EnvironmentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EnvironmentListInstance(version: V1, serviceSid: string): EnvironmentListInstance; +export declare class EnvironmentPage extends Page { + /** + * Initialize the EnvironmentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EnvironmentSolution); + /** + * Build an instance of EnvironmentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EnvironmentResource): EnvironmentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/environment.js b/node_modules/twilio/lib/rest/serverless/v1/service/environment.js new file mode 100644 index 00000000..3e58e601 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/environment.js @@ -0,0 +1,278 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EnvironmentPage = exports.EnvironmentListInstance = exports.EnvironmentInstance = exports.EnvironmentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const deployment_1 = require("./environment/deployment"); +const log_1 = require("./environment/log"); +const variable_1 = require("./environment/variable"); +class EnvironmentContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Environments/${sid}`; + } + get deployments() { + this._deployments = + this._deployments || + (0, deployment_1.DeploymentListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._deployments; + } + get logs() { + this._logs = + this._logs || + (0, log_1.LogListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._logs; + } + get variables() { + this._variables = + this._variables || + (0, variable_1.VariableListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._variables; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EnvironmentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EnvironmentContextImpl = EnvironmentContextImpl; +class EnvironmentInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.buildSid = payload.build_sid; + this.uniqueName = payload.unique_name; + this.domainSuffix = payload.domain_suffix; + this.domainName = payload.domain_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EnvironmentContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a EnvironmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a EnvironmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EnvironmentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the deployments. + */ + deployments() { + return this._proxy.deployments; + } + /** + * Access the logs. + */ + logs() { + return this._proxy.logs; + } + /** + * Access the variables. + */ + variables() { + return this._proxy.variables; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + buildSid: this.buildSid, + uniqueName: this.uniqueName, + domainSuffix: this.domainSuffix, + domainName: this.domainName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EnvironmentInstance = EnvironmentInstance; +function EnvironmentListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EnvironmentContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Environments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["uniqueName"] === null || params["uniqueName"] === undefined) { + throw new Error("Required parameter \"params['uniqueName']\" missing."); + } + let data = {}; + data["UniqueName"] = params["uniqueName"]; + if (params["domainSuffix"] !== undefined) + data["DomainSuffix"] = params["domainSuffix"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EnvironmentInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EnvironmentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EnvironmentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EnvironmentListInstance = EnvironmentListInstance; +class EnvironmentPage extends Page_1.default { + /** + * Initialize the EnvironmentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EnvironmentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EnvironmentInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EnvironmentPage = EnvironmentPage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/environment/deployment.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/environment/deployment.d.ts new file mode 100644 index 00000000..36fa3b97 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/environment/deployment.d.ts @@ -0,0 +1,257 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to create a DeploymentInstance + */ +export interface DeploymentListInstanceCreateOptions { + /** The SID of the Build for the Deployment. */ + buildSid?: string; +} +/** + * Options to pass to each + */ +export interface DeploymentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DeploymentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DeploymentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DeploymentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DeploymentContext { + /** + * Fetch a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + fetch(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DeploymentContextSolution { + serviceSid: string; + environmentSid: string; + sid: string; +} +export declare class DeploymentContextImpl implements DeploymentContext { + protected _version: V1; + protected _solution: DeploymentContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, environmentSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DeploymentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DeploymentPayload extends TwilioResponsePayload { + deployments: DeploymentResource[]; +} +interface DeploymentResource { + sid: string; + account_sid: string; + service_sid: string; + environment_sid: string; + build_sid: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class DeploymentInstance { + protected _version: V1; + protected _solution: DeploymentContextSolution; + protected _context?: DeploymentContext; + constructor(_version: V1, payload: DeploymentResource, serviceSid: string, environmentSid: string, sid?: string); + /** + * The unique string that we created to identify the Deployment resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Deployment resource. + */ + accountSid: string; + /** + * The SID of the Service that the Deployment resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Environment for the Deployment. + */ + environmentSid: string; + /** + * The SID of the Build for the deployment. + */ + buildSid: string; + /** + * The date and time in GMT when the Deployment resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Deployment resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Deployment resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + fetch(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + environmentSid: string; + buildSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DeploymentSolution { + serviceSid: string; + environmentSid: string; +} +export interface DeploymentListInstance { + _version: V1; + _solution: DeploymentSolution; + _uri: string; + (sid: string): DeploymentContext; + get(sid: string): DeploymentContext; + /** + * Create a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + create(callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Create a DeploymentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + create(params: DeploymentListInstanceCreateOptions, callback?: (error: Error | null, item?: DeploymentInstance) => any): Promise; + /** + * Streams DeploymentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeploymentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DeploymentInstance, done: (err?: Error) => void) => void): void; + each(params: DeploymentListInstanceEachOptions, callback?: (item: DeploymentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DeploymentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DeploymentPage) => any): Promise; + /** + * Lists DeploymentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeploymentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DeploymentInstance[]) => any): Promise; + list(params: DeploymentListInstanceOptions, callback?: (error: Error | null, items: DeploymentInstance[]) => any): Promise; + /** + * Retrieve a single page of DeploymentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DeploymentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DeploymentPage) => any): Promise; + page(params: DeploymentListInstancePageOptions, callback?: (error: Error | null, items: DeploymentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DeploymentListInstance(version: V1, serviceSid: string, environmentSid: string): DeploymentListInstance; +export declare class DeploymentPage extends Page { + /** + * Initialize the DeploymentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DeploymentSolution); + /** + * Build an instance of DeploymentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DeploymentResource): DeploymentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/environment/deployment.js b/node_modules/twilio/lib/rest/serverless/v1/service/environment/deployment.js new file mode 100644 index 00000000..bf0f13bc --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/environment/deployment.js @@ -0,0 +1,220 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeploymentPage = exports.DeploymentListInstance = exports.DeploymentInstance = exports.DeploymentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class DeploymentContextImpl { + constructor(_version, serviceSid, environmentSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(environmentSid)) { + throw new Error("Parameter 'environmentSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, environmentSid, sid }; + this._uri = `/Services/${serviceSid}/Environments/${environmentSid}/Deployments/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DeploymentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.environmentSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeploymentContextImpl = DeploymentContextImpl; +class DeploymentInstance { + constructor(_version, payload, serviceSid, environmentSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.environmentSid = payload.environment_sid; + this.buildSid = payload.build_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, environmentSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new DeploymentContextImpl(this._version, this._solution.serviceSid, this._solution.environmentSid, this._solution.sid); + return this._context; + } + /** + * Fetch a DeploymentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DeploymentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + environmentSid: this.environmentSid, + buildSid: this.buildSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeploymentInstance = DeploymentInstance; +function DeploymentListInstance(version, serviceSid, environmentSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(environmentSid)) { + throw new Error("Parameter 'environmentSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DeploymentContextImpl(version, serviceSid, environmentSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, environmentSid }; + instance._uri = `/Services/${serviceSid}/Environments/${environmentSid}/Deployments`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["buildSid"] !== undefined) + data["BuildSid"] = params["buildSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeploymentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.environmentSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DeploymentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DeploymentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DeploymentListInstance = DeploymentListInstance; +class DeploymentPage extends Page_1.default { + /** + * Initialize the DeploymentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DeploymentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DeploymentInstance(this._version, payload, this._solution.serviceSid, this._solution.environmentSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DeploymentPage = DeploymentPage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/environment/log.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/environment/log.d.ts new file mode 100644 index 00000000..be0ceb77 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/environment/log.d.ts @@ -0,0 +1,273 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type LogLevel = "info" | "warn" | "error"; +/** + * Options to pass to each + */ +export interface LogListInstanceEachOptions { + /** The SID of the function whose invocation produced the Log resources to read. */ + functionSid?: string; + /** The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. */ + startDate?: Date; + /** The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: LogInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface LogListInstanceOptions { + /** The SID of the function whose invocation produced the Log resources to read. */ + functionSid?: string; + /** The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. */ + startDate?: Date; + /** The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface LogListInstancePageOptions { + /** The SID of the function whose invocation produced the Log resources to read. */ + functionSid?: string; + /** The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. */ + startDate?: Date; + /** The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. */ + endDate?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface LogContext { + /** + * Fetch a LogInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LogInstance + */ + fetch(callback?: (error: Error | null, item?: LogInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface LogContextSolution { + serviceSid: string; + environmentSid: string; + sid: string; +} +export declare class LogContextImpl implements LogContext { + protected _version: V1; + protected _solution: LogContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, environmentSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: LogInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): LogContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface LogPayload extends TwilioResponsePayload { + logs: LogResource[]; +} +interface LogResource { + sid: string; + account_sid: string; + service_sid: string; + environment_sid: string; + build_sid: string; + deployment_sid: string; + function_sid: string; + request_sid: string; + level: LogLevel; + message: string; + date_created: Date; + url: string; +} +export declare class LogInstance { + protected _version: V1; + protected _solution: LogContextSolution; + protected _context?: LogContext; + constructor(_version: V1, payload: LogResource, serviceSid: string, environmentSid: string, sid?: string); + /** + * The unique string that we created to identify the Log resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Log resource. + */ + accountSid: string; + /** + * The SID of the Service that the Log resource is associated with. + */ + serviceSid: string; + /** + * The SID of the environment in which the log occurred. + */ + environmentSid: string; + /** + * The SID of the build that corresponds to the log. + */ + buildSid: string; + /** + * The SID of the deployment that corresponds to the log. + */ + deploymentSid: string; + /** + * The SID of the function whose invocation produced the log. + */ + functionSid: string; + /** + * The SID of the request associated with the log. + */ + requestSid: string; + level: LogLevel; + /** + * The log message. + */ + message: string; + /** + * The date and time in GMT when the Log resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The absolute URL of the Log resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a LogInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LogInstance + */ + fetch(callback?: (error: Error | null, item?: LogInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + environmentSid: string; + buildSid: string; + deploymentSid: string; + functionSid: string; + requestSid: string; + level: LogLevel; + message: string; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface LogSolution { + serviceSid: string; + environmentSid: string; +} +export interface LogListInstance { + _version: V1; + _solution: LogSolution; + _uri: string; + (sid: string): LogContext; + get(sid: string): LogContext; + /** + * Streams LogInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LogListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: LogInstance, done: (err?: Error) => void) => void): void; + each(params: LogListInstanceEachOptions, callback?: (item: LogInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of LogInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: LogPage) => any): Promise; + /** + * Lists LogInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LogListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: LogInstance[]) => any): Promise; + list(params: LogListInstanceOptions, callback?: (error: Error | null, items: LogInstance[]) => any): Promise; + /** + * Retrieve a single page of LogInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { LogListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: LogPage) => any): Promise; + page(params: LogListInstancePageOptions, callback?: (error: Error | null, items: LogPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function LogListInstance(version: V1, serviceSid: string, environmentSid: string): LogListInstance; +export declare class LogPage extends Page { + /** + * Initialize the LogPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: LogSolution); + /** + * Build an instance of LogInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: LogResource): LogInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/environment/log.js b/node_modules/twilio/lib/rest/serverless/v1/service/environment/log.js new file mode 100644 index 00000000..5b8077d4 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/environment/log.js @@ -0,0 +1,211 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LogPage = exports.LogListInstance = exports.LogInstance = exports.LogContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class LogContextImpl { + constructor(_version, serviceSid, environmentSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(environmentSid)) { + throw new Error("Parameter 'environmentSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, environmentSid, sid }; + this._uri = `/Services/${serviceSid}/Environments/${environmentSid}/Logs/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new LogInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.environmentSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LogContextImpl = LogContextImpl; +class LogInstance { + constructor(_version, payload, serviceSid, environmentSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.environmentSid = payload.environment_sid; + this.buildSid = payload.build_sid; + this.deploymentSid = payload.deployment_sid; + this.functionSid = payload.function_sid; + this.requestSid = payload.request_sid; + this.level = payload.level; + this.message = payload.message; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { serviceSid, environmentSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new LogContextImpl(this._version, this._solution.serviceSid, this._solution.environmentSid, this._solution.sid); + return this._context; + } + /** + * Fetch a LogInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed LogInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + environmentSid: this.environmentSid, + buildSid: this.buildSid, + deploymentSid: this.deploymentSid, + functionSid: this.functionSid, + requestSid: this.requestSid, + level: this.level, + message: this.message, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LogInstance = LogInstance; +function LogListInstance(version, serviceSid, environmentSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(environmentSid)) { + throw new Error("Parameter 'environmentSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new LogContextImpl(version, serviceSid, environmentSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, environmentSid }; + instance._uri = `/Services/${serviceSid}/Environments/${environmentSid}/Logs`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["functionSid"] !== undefined) + data["FunctionSid"] = params["functionSid"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new LogPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new LogPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.LogListInstance = LogListInstance; +class LogPage extends Page_1.default { + /** + * Initialize the LogPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of LogInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new LogInstance(this._version, payload, this._solution.serviceSid, this._solution.environmentSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.LogPage = LogPage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/environment/variable.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/environment/variable.d.ts new file mode 100644 index 00000000..b03a4145 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/environment/variable.d.ts @@ -0,0 +1,318 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to update a VariableInstance + */ +export interface VariableContextUpdateOptions { + /** A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. */ + key?: string; + /** A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. */ + value?: string; +} +/** + * Options to pass to create a VariableInstance + */ +export interface VariableListInstanceCreateOptions { + /** A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. */ + key: string; + /** A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. */ + value: string; +} +/** + * Options to pass to each + */ +export interface VariableListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: VariableInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface VariableListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface VariableListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface VariableContext { + /** + * Remove a VariableInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a VariableInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VariableInstance + */ + fetch(callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + /** + * Update a VariableInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VariableInstance + */ + update(callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + /** + * Update a VariableInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VariableInstance + */ + update(params: VariableContextUpdateOptions, callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface VariableContextSolution { + serviceSid: string; + environmentSid: string; + sid: string; +} +export declare class VariableContextImpl implements VariableContext { + protected _version: V1; + protected _solution: VariableContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, environmentSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + update(params?: VariableContextUpdateOptions | ((error: Error | null, item?: VariableInstance) => any), callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): VariableContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface VariablePayload extends TwilioResponsePayload { + variables: VariableResource[]; +} +interface VariableResource { + sid: string; + account_sid: string; + service_sid: string; + environment_sid: string; + key: string; + value: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class VariableInstance { + protected _version: V1; + protected _solution: VariableContextSolution; + protected _context?: VariableContext; + constructor(_version: V1, payload: VariableResource, serviceSid: string, environmentSid: string, sid?: string); + /** + * The unique string that we created to identify the Variable resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Variable resource. + */ + accountSid: string; + /** + * The SID of the Service that the Variable resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Environment in which the Variable exists. + */ + environmentSid: string; + /** + * A string by which the Variable resource can be referenced. + */ + key: string; + /** + * A string that contains the actual value of the Variable. + */ + value: string; + /** + * The date and time in GMT when the Variable resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Variable resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Variable resource. + */ + url: string; + private get _proxy(); + /** + * Remove a VariableInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a VariableInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VariableInstance + */ + fetch(callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + /** + * Update a VariableInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VariableInstance + */ + update(callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + /** + * Update a VariableInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VariableInstance + */ + update(params: VariableContextUpdateOptions, callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + environmentSid: string; + key: string; + value: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface VariableSolution { + serviceSid: string; + environmentSid: string; +} +export interface VariableListInstance { + _version: V1; + _solution: VariableSolution; + _uri: string; + (sid: string): VariableContext; + get(sid: string): VariableContext; + /** + * Create a VariableInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VariableInstance + */ + create(params: VariableListInstanceCreateOptions, callback?: (error: Error | null, item?: VariableInstance) => any): Promise; + /** + * Streams VariableInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VariableListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: VariableInstance, done: (err?: Error) => void) => void): void; + each(params: VariableListInstanceEachOptions, callback?: (item: VariableInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of VariableInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: VariablePage) => any): Promise; + /** + * Lists VariableInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VariableListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: VariableInstance[]) => any): Promise; + list(params: VariableListInstanceOptions, callback?: (error: Error | null, items: VariableInstance[]) => any): Promise; + /** + * Retrieve a single page of VariableInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VariableListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: VariablePage) => any): Promise; + page(params: VariableListInstancePageOptions, callback?: (error: Error | null, items: VariablePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function VariableListInstance(version: V1, serviceSid: string, environmentSid: string): VariableListInstance; +export declare class VariablePage extends Page { + /** + * Initialize the VariablePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: VariableSolution); + /** + * Build an instance of VariableInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: VariableResource): VariableInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/environment/variable.js b/node_modules/twilio/lib/rest/serverless/v1/service/environment/variable.js new file mode 100644 index 00000000..d97be6c4 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/environment/variable.js @@ -0,0 +1,272 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariablePage = exports.VariableListInstance = exports.VariableInstance = exports.VariableContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class VariableContextImpl { + constructor(_version, serviceSid, environmentSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(environmentSid)) { + throw new Error("Parameter 'environmentSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, environmentSid, sid }; + this._uri = `/Services/${serviceSid}/Environments/${environmentSid}/Variables/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new VariableInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.environmentSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["key"] !== undefined) + data["Key"] = params["key"]; + if (params["value"] !== undefined) + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VariableInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.environmentSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VariableContextImpl = VariableContextImpl; +class VariableInstance { + constructor(_version, payload, serviceSid, environmentSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.environmentSid = payload.environment_sid; + this.key = payload.key; + this.value = payload.value; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, environmentSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new VariableContextImpl(this._version, this._solution.serviceSid, this._solution.environmentSid, this._solution.sid); + return this._context; + } + /** + * Remove a VariableInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a VariableInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VariableInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + environmentSid: this.environmentSid, + key: this.key, + value: this.value, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VariableInstance = VariableInstance; +function VariableListInstance(version, serviceSid, environmentSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(environmentSid)) { + throw new Error("Parameter 'environmentSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new VariableContextImpl(version, serviceSid, environmentSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, environmentSid }; + instance._uri = `/Services/${serviceSid}/Environments/${environmentSid}/Variables`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["key"] === null || params["key"] === undefined) { + throw new Error("Required parameter \"params['key']\" missing."); + } + if (params["value"] === null || params["value"] === undefined) { + throw new Error("Required parameter \"params['value']\" missing."); + } + let data = {}; + data["Key"] = params["key"]; + data["Value"] = params["value"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VariableInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.environmentSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VariablePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new VariablePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.VariableListInstance = VariableListInstance; +class VariablePage extends Page_1.default { + /** + * Initialize the VariablePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of VariableInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new VariableInstance(this._version, payload, this._solution.serviceSid, this._solution.environmentSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VariablePage = VariablePage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/function.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/function.d.ts new file mode 100644 index 00000000..1e8b6e2c --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/function.d.ts @@ -0,0 +1,298 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { FunctionVersionListInstance } from "./function/functionVersion"; +/** + * Options to pass to update a FunctionInstance + */ +export interface FunctionContextUpdateOptions { + /** A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. */ + friendlyName: string; +} +/** + * Options to pass to create a FunctionInstance + */ +export interface FunctionListInstanceCreateOptions { + /** A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. */ + friendlyName: string; +} +/** + * Options to pass to each + */ +export interface FunctionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FunctionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FunctionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FunctionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FunctionContext { + functionVersions: FunctionVersionListInstance; + /** + * Remove a FunctionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FunctionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionInstance + */ + fetch(callback?: (error: Error | null, item?: FunctionInstance) => any): Promise; + /** + * Update a FunctionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionInstance + */ + update(params: FunctionContextUpdateOptions, callback?: (error: Error | null, item?: FunctionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FunctionContextSolution { + serviceSid: string; + sid: string; +} +export declare class FunctionContextImpl implements FunctionContext { + protected _version: V1; + protected _solution: FunctionContextSolution; + protected _uri: string; + protected _functionVersions?: FunctionVersionListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get functionVersions(): FunctionVersionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: FunctionInstance) => any): Promise; + update(params: FunctionContextUpdateOptions, callback?: (error: Error | null, item?: FunctionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FunctionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FunctionPayload extends TwilioResponsePayload { + functions: FunctionResource[]; +} +interface FunctionResource { + sid: string; + account_sid: string; + service_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class FunctionInstance { + protected _version: V1; + protected _solution: FunctionContextSolution; + protected _context?: FunctionContext; + constructor(_version: V1, payload: FunctionResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Function resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Function resource. + */ + accountSid: string; + /** + * The SID of the Service that the Function resource is associated with. + */ + serviceSid: string; + /** + * The string that you assigned to describe the Function resource. It can be a maximum of 255 characters. + */ + friendlyName: string; + /** + * The date and time in GMT when the Function resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Function resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Function resource. + */ + url: string; + /** + * The URLs of nested resources of the Function resource. + */ + links: Record; + private get _proxy(); + /** + * Remove a FunctionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FunctionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionInstance + */ + fetch(callback?: (error: Error | null, item?: FunctionInstance) => any): Promise; + /** + * Update a FunctionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionInstance + */ + update(params: FunctionContextUpdateOptions, callback?: (error: Error | null, item?: FunctionInstance) => any): Promise; + /** + * Access the functionVersions. + */ + functionVersions(): FunctionVersionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FunctionSolution { + serviceSid: string; +} +export interface FunctionListInstance { + _version: V1; + _solution: FunctionSolution; + _uri: string; + (sid: string): FunctionContext; + get(sid: string): FunctionContext; + /** + * Create a FunctionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionInstance + */ + create(params: FunctionListInstanceCreateOptions, callback?: (error: Error | null, item?: FunctionInstance) => any): Promise; + /** + * Streams FunctionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FunctionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FunctionInstance, done: (err?: Error) => void) => void): void; + each(params: FunctionListInstanceEachOptions, callback?: (item: FunctionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FunctionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FunctionPage) => any): Promise; + /** + * Lists FunctionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FunctionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FunctionInstance[]) => any): Promise; + list(params: FunctionListInstanceOptions, callback?: (error: Error | null, items: FunctionInstance[]) => any): Promise; + /** + * Retrieve a single page of FunctionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FunctionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FunctionPage) => any): Promise; + page(params: FunctionListInstancePageOptions, callback?: (error: Error | null, items: FunctionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FunctionListInstance(version: V1, serviceSid: string): FunctionListInstance; +export declare class FunctionPage extends Page { + /** + * Initialize the FunctionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: FunctionSolution); + /** + * Build an instance of FunctionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FunctionResource): FunctionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/function.js b/node_modules/twilio/lib/rest/serverless/v1/service/function.js new file mode 100644 index 00000000..2f75a3ff --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/function.js @@ -0,0 +1,271 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionPage = exports.FunctionListInstance = exports.FunctionInstance = exports.FunctionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const functionVersion_1 = require("./function/functionVersion"); +class FunctionContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Functions/${sid}`; + } + get functionVersions() { + this._functionVersions = + this._functionVersions || + (0, functionVersion_1.FunctionVersionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._functionVersions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FunctionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FunctionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FunctionContextImpl = FunctionContextImpl; +class FunctionInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new FunctionContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a FunctionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a FunctionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the functionVersions. + */ + functionVersions() { + return this._proxy.functionVersions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FunctionInstance = FunctionInstance; +function FunctionListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FunctionContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Functions`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FunctionInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FunctionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FunctionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FunctionListInstance = FunctionListInstance; +class FunctionPage extends Page_1.default { + /** + * Initialize the FunctionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FunctionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FunctionInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FunctionPage = FunctionPage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion.d.ts new file mode 100644 index 00000000..75a245d1 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion.d.ts @@ -0,0 +1,242 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +import { FunctionVersionContentListInstance } from "./functionVersion/functionVersionContent"; +export type FunctionVersionVisibility = "public" | "private" | "protected"; +/** + * Options to pass to each + */ +export interface FunctionVersionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FunctionVersionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FunctionVersionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FunctionVersionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FunctionVersionContext { + functionVersionContent: FunctionVersionContentListInstance; + /** + * Fetch a FunctionVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionVersionInstance + */ + fetch(callback?: (error: Error | null, item?: FunctionVersionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FunctionVersionContextSolution { + serviceSid: string; + functionSid: string; + sid: string; +} +export declare class FunctionVersionContextImpl implements FunctionVersionContext { + protected _version: V1; + protected _solution: FunctionVersionContextSolution; + protected _uri: string; + protected _functionVersionContent?: FunctionVersionContentListInstance; + constructor(_version: V1, serviceSid: string, functionSid: string, sid: string); + get functionVersionContent(): FunctionVersionContentListInstance; + fetch(callback?: (error: Error | null, item?: FunctionVersionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FunctionVersionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FunctionVersionPayload extends TwilioResponsePayload { + function_versions: FunctionVersionResource[]; +} +interface FunctionVersionResource { + sid: string; + account_sid: string; + service_sid: string; + function_sid: string; + path: string; + visibility: FunctionVersionVisibility; + date_created: Date; + url: string; + links: Record; +} +export declare class FunctionVersionInstance { + protected _version: V1; + protected _solution: FunctionVersionContextSolution; + protected _context?: FunctionVersionContext; + constructor(_version: V1, payload: FunctionVersionResource, serviceSid: string, functionSid: string, sid?: string); + /** + * The unique string that we created to identify the Function Version resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Function Version resource. + */ + accountSid: string; + /** + * The SID of the Service that the Function Version resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Function resource that is the parent of the Function Version resource. + */ + functionSid: string; + /** + * The URL-friendly string by which the Function Version resource can be referenced. It can be a maximum of 255 characters. All paths begin with a forward slash (\'/\'). If a Function Version creation request is submitted with a path not containing a leading slash, the path will automatically be prepended with one. + */ + path: string; + visibility: FunctionVersionVisibility; + /** + * The date and time in GMT when the Function Version resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The absolute URL of the Function Version resource. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Fetch a FunctionVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionVersionInstance + */ + fetch(callback?: (error: Error | null, item?: FunctionVersionInstance) => any): Promise; + /** + * Access the functionVersionContent. + */ + functionVersionContent(): FunctionVersionContentListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + functionSid: string; + path: string; + visibility: FunctionVersionVisibility; + dateCreated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FunctionVersionSolution { + serviceSid: string; + functionSid: string; +} +export interface FunctionVersionListInstance { + _version: V1; + _solution: FunctionVersionSolution; + _uri: string; + (sid: string): FunctionVersionContext; + get(sid: string): FunctionVersionContext; + /** + * Streams FunctionVersionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FunctionVersionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FunctionVersionInstance, done: (err?: Error) => void) => void): void; + each(params: FunctionVersionListInstanceEachOptions, callback?: (item: FunctionVersionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FunctionVersionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FunctionVersionPage) => any): Promise; + /** + * Lists FunctionVersionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FunctionVersionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FunctionVersionInstance[]) => any): Promise; + list(params: FunctionVersionListInstanceOptions, callback?: (error: Error | null, items: FunctionVersionInstance[]) => any): Promise; + /** + * Retrieve a single page of FunctionVersionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FunctionVersionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FunctionVersionPage) => any): Promise; + page(params: FunctionVersionListInstancePageOptions, callback?: (error: Error | null, items: FunctionVersionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FunctionVersionListInstance(version: V1, serviceSid: string, functionSid: string): FunctionVersionListInstance; +export declare class FunctionVersionPage extends Page { + /** + * Initialize the FunctionVersionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: FunctionVersionSolution); + /** + * Build an instance of FunctionVersionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FunctionVersionResource): FunctionVersionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion.js b/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion.js new file mode 100644 index 00000000..5d6e194a --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion.js @@ -0,0 +1,212 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionVersionPage = exports.FunctionVersionListInstance = exports.FunctionVersionInstance = exports.FunctionVersionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const functionVersionContent_1 = require("./functionVersion/functionVersionContent"); +class FunctionVersionContextImpl { + constructor(_version, serviceSid, functionSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(functionSid)) { + throw new Error("Parameter 'functionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, functionSid, sid }; + this._uri = `/Services/${serviceSid}/Functions/${functionSid}/Versions/${sid}`; + } + get functionVersionContent() { + this._functionVersionContent = + this._functionVersionContent || + (0, functionVersionContent_1.FunctionVersionContentListInstance)(this._version, this._solution.serviceSid, this._solution.functionSid, this._solution.sid); + return this._functionVersionContent; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FunctionVersionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.functionSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FunctionVersionContextImpl = FunctionVersionContextImpl; +class FunctionVersionInstance { + constructor(_version, payload, serviceSid, functionSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.functionSid = payload.function_sid; + this.path = payload.path; + this.visibility = payload.visibility; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, functionSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new FunctionVersionContextImpl(this._version, this._solution.serviceSid, this._solution.functionSid, this._solution.sid); + return this._context; + } + /** + * Fetch a FunctionVersionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionVersionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the functionVersionContent. + */ + functionVersionContent() { + return this._proxy.functionVersionContent; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + functionSid: this.functionSid, + path: this.path, + visibility: this.visibility, + dateCreated: this.dateCreated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FunctionVersionInstance = FunctionVersionInstance; +function FunctionVersionListInstance(version, serviceSid, functionSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(functionSid)) { + throw new Error("Parameter 'functionSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FunctionVersionContextImpl(version, serviceSid, functionSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, functionSid }; + instance._uri = `/Services/${serviceSid}/Functions/${functionSid}/Versions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FunctionVersionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FunctionVersionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FunctionVersionListInstance = FunctionVersionListInstance; +class FunctionVersionPage extends Page_1.default { + /** + * Initialize the FunctionVersionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FunctionVersionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FunctionVersionInstance(this._version, payload, this._solution.serviceSid, this._solution.functionSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FunctionVersionPage = FunctionVersionPage; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion/functionVersionContent.d.ts b/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion/functionVersionContent.d.ts new file mode 100644 index 00000000..02ebc217 --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion/functionVersionContent.d.ts @@ -0,0 +1,114 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../../V1"; +export interface FunctionVersionContentContext { + /** + * Fetch a FunctionVersionContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionVersionContentInstance + */ + fetch(callback?: (error: Error | null, item?: FunctionVersionContentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FunctionVersionContentContextSolution { + serviceSid: string; + functionSid: string; + sid: string; +} +export declare class FunctionVersionContentContextImpl implements FunctionVersionContentContext { + protected _version: V1; + protected _solution: FunctionVersionContentContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, functionSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: FunctionVersionContentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FunctionVersionContentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FunctionVersionContentResource { + sid: string; + account_sid: string; + service_sid: string; + function_sid: string; + content: string; + url: string; +} +export declare class FunctionVersionContentInstance { + protected _version: V1; + protected _solution: FunctionVersionContentContextSolution; + protected _context?: FunctionVersionContentContext; + constructor(_version: V1, payload: FunctionVersionContentResource, serviceSid: string, functionSid: string, sid: string); + /** + * The unique string that we created to identify the Function Version resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Function Version resource. + */ + accountSid: string; + /** + * The SID of the Service that the Function Version resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Function that is the parent of the Function Version. + */ + functionSid: string; + /** + * The content of the Function Version resource. + */ + content: string; + url: string; + private get _proxy(); + /** + * Fetch a FunctionVersionContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionVersionContentInstance + */ + fetch(callback?: (error: Error | null, item?: FunctionVersionContentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + functionSid: string; + content: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FunctionVersionContentSolution { + serviceSid: string; + functionSid: string; + sid: string; +} +export interface FunctionVersionContentListInstance { + _version: V1; + _solution: FunctionVersionContentSolution; + _uri: string; + (): FunctionVersionContentContext; + get(): FunctionVersionContentContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FunctionVersionContentListInstance(version: V1, serviceSid: string, functionSid: string, sid: string): FunctionVersionContentListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion/functionVersionContent.js b/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion/functionVersionContent.js new file mode 100644 index 00000000..e7aec4da --- /dev/null +++ b/node_modules/twilio/lib/rest/serverless/v1/service/function/functionVersion/functionVersionContent.js @@ -0,0 +1,131 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Serverless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionVersionContentListInstance = exports.FunctionVersionContentInstance = exports.FunctionVersionContentContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class FunctionVersionContentContextImpl { + constructor(_version, serviceSid, functionSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(functionSid)) { + throw new Error("Parameter 'functionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, functionSid, sid }; + this._uri = `/Services/${serviceSid}/Functions/${functionSid}/Versions/${sid}/Content`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FunctionVersionContentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.functionSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FunctionVersionContentContextImpl = FunctionVersionContentContextImpl; +class FunctionVersionContentInstance { + constructor(_version, payload, serviceSid, functionSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.functionSid = payload.function_sid; + this.content = payload.content; + this.url = payload.url; + this._solution = { serviceSid, functionSid, sid }; + } + get _proxy() { + this._context = + this._context || + new FunctionVersionContentContextImpl(this._version, this._solution.serviceSid, this._solution.functionSid, this._solution.sid); + return this._context; + } + /** + * Fetch a FunctionVersionContentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FunctionVersionContentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + functionSid: this.functionSid, + content: this.content, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FunctionVersionContentInstance = FunctionVersionContentInstance; +function FunctionVersionContentListInstance(version, serviceSid, functionSid, sid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(functionSid)) { + throw new Error("Parameter 'functionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new FunctionVersionContentContextImpl(version, serviceSid, functionSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, functionSid, sid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FunctionVersionContentListInstance = FunctionVersionContentListInstance; diff --git a/node_modules/twilio/lib/rest/studio/V1.d.ts b/node_modules/twilio/lib/rest/studio/V1.d.ts new file mode 100644 index 00000000..28a02f86 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/V1.d.ts @@ -0,0 +1,15 @@ +import StudioBase from "../StudioBase"; +import Version from "../../base/Version"; +import { FlowListInstance } from "./v1/flow"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Studio + * + * @param domain - The Twilio (Twilio.Studio) domain + */ + constructor(domain: StudioBase); + /** flows - { Twilio.Studio.V1.FlowListInstance } resource */ + protected _flows?: FlowListInstance; + /** Getter for flows resource */ + get flows(): FlowListInstance; +} diff --git a/node_modules/twilio/lib/rest/studio/V1.js b/node_modules/twilio/lib/rest/studio/V1.js new file mode 100644 index 00000000..03587394 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/V1.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const flow_1 = require("./v1/flow"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Studio + * + * @param domain - The Twilio (Twilio.Studio) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for flows resource */ + get flows() { + this._flows = this._flows || (0, flow_1.FlowListInstance)(this); + return this._flows; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/studio/V2.d.ts b/node_modules/twilio/lib/rest/studio/V2.d.ts new file mode 100644 index 00000000..e2f33647 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/V2.d.ts @@ -0,0 +1,20 @@ +import StudioBase from "../StudioBase"; +import Version from "../../base/Version"; +import { FlowListInstance } from "./v2/flow"; +import { FlowValidateListInstance } from "./v2/flowValidate"; +export default class V2 extends Version { + /** + * Initialize the V2 version of Studio + * + * @param domain - The Twilio (Twilio.Studio) domain + */ + constructor(domain: StudioBase); + /** flows - { Twilio.Studio.V2.FlowListInstance } resource */ + protected _flows?: FlowListInstance; + /** flowValidate - { Twilio.Studio.V2.FlowValidateListInstance } resource */ + protected _flowValidate?: FlowValidateListInstance; + /** Getter for flows resource */ + get flows(): FlowListInstance; + /** Getter for flowValidate resource */ + get flowValidate(): FlowValidateListInstance; +} diff --git a/node_modules/twilio/lib/rest/studio/V2.js b/node_modules/twilio/lib/rest/studio/V2.js new file mode 100644 index 00000000..5b4a2c71 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/V2.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const flow_1 = require("./v2/flow"); +const flowValidate_1 = require("./v2/flowValidate"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of Studio + * + * @param domain - The Twilio (Twilio.Studio) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for flows resource */ + get flows() { + this._flows = this._flows || (0, flow_1.FlowListInstance)(this); + return this._flows; + } + /** Getter for flowValidate resource */ + get flowValidate() { + this._flowValidate = this._flowValidate || (0, flowValidate_1.FlowValidateListInstance)(this); + return this._flowValidate; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow.d.ts new file mode 100644 index 00000000..c7d934c2 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow.d.ts @@ -0,0 +1,266 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { EngagementListInstance } from "./flow/engagement"; +import { ExecutionListInstance } from "./flow/execution"; +export type FlowStatus = "draft" | "published"; +/** + * Options to pass to each + */ +export interface FlowListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FlowInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FlowListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FlowListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FlowContext { + engagements: EngagementListInstance; + executions: ExecutionListInstance; + /** + * Remove a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + fetch(callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FlowContextSolution { + sid: string; +} +export declare class FlowContextImpl implements FlowContext { + protected _version: V1; + protected _solution: FlowContextSolution; + protected _uri: string; + protected _engagements?: EngagementListInstance; + protected _executions?: ExecutionListInstance; + constructor(_version: V1, sid: string); + get engagements(): EngagementListInstance; + get executions(): ExecutionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FlowContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FlowPayload extends TwilioResponsePayload { + flows: FlowResource[]; +} +interface FlowResource { + sid: string; + account_sid: string; + friendly_name: string; + status: FlowStatus; + version: number; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class FlowInstance { + protected _version: V1; + protected _solution: FlowContextSolution; + protected _context?: FlowContext; + constructor(_version: V1, payload: FlowResource, sid?: string); + /** + * The unique string that we created to identify the Flow resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flow resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the Flow. + */ + friendlyName: string; + status: FlowStatus; + /** + * The latest version number of the Flow\'s definition. + */ + version: number; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of the Flow\'s nested resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + fetch(callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Access the engagements. + */ + engagements(): EngagementListInstance; + /** + * Access the executions. + */ + executions(): ExecutionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + status: FlowStatus; + version: number; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FlowSolution { +} +export interface FlowListInstance { + _version: V1; + _solution: FlowSolution; + _uri: string; + (sid: string): FlowContext; + get(sid: string): FlowContext; + /** + * Streams FlowInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FlowInstance, done: (err?: Error) => void) => void): void; + each(params: FlowListInstanceEachOptions, callback?: (item: FlowInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FlowInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FlowPage) => any): Promise; + /** + * Lists FlowInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FlowInstance[]) => any): Promise; + list(params: FlowListInstanceOptions, callback?: (error: Error | null, items: FlowInstance[]) => any): Promise; + /** + * Retrieve a single page of FlowInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FlowPage) => any): Promise; + page(params: FlowListInstancePageOptions, callback?: (error: Error | null, items: FlowPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FlowListInstance(version: V1): FlowListInstance; +export declare class FlowPage extends Page { + /** + * Initialize the FlowPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: FlowSolution); + /** + * Build an instance of FlowInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FlowResource): FlowInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow.js b/node_modules/twilio/lib/rest/studio/v1/flow.js new file mode 100644 index 00000000..5418628a --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow.js @@ -0,0 +1,231 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FlowPage = exports.FlowListInstance = exports.FlowInstance = exports.FlowContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const engagement_1 = require("./flow/engagement"); +const execution_1 = require("./flow/execution"); +class FlowContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Flows/${sid}`; + } + get engagements() { + this._engagements = + this._engagements || + (0, engagement_1.EngagementListInstance)(this._version, this._solution.sid); + return this._engagements; + } + get executions() { + this._executions = + this._executions || + (0, execution_1.ExecutionListInstance)(this._version, this._solution.sid); + return this._executions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FlowInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowContextImpl = FlowContextImpl; +class FlowInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.version = deserialize.integer(payload.version); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new FlowContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the engagements. + */ + engagements() { + return this._proxy.engagements; + } + /** + * Access the executions. + */ + executions() { + return this._proxy.executions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + status: this.status, + version: this.version, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowInstance = FlowInstance; +function FlowListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FlowContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Flows`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlowPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FlowPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FlowListInstance = FlowListInstance; +class FlowPage extends Page_1.default { + /** + * Initialize the FlowPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FlowInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FlowInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowPage = FlowPage; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/engagement.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow/engagement.d.ts new file mode 100644 index 00000000..7914817c --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/engagement.d.ts @@ -0,0 +1,300 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { EngagementContextListInstance } from "./engagement/engagementContext"; +import { StepListInstance } from "./engagement/step"; +export type EngagementStatus = "active" | "ended"; +/** + * Options to pass to create a EngagementInstance + */ +export interface EngagementListInstanceCreateOptions { + /** The Contact phone number to start a Studio Flow Engagement, available as variable `{{contact.channel.address}}`. */ + to: string; + /** The Twilio phone number to send messages or initiate calls from during the Flow Engagement. Available as variable `{{flow.channel.address}}` */ + from: string; + /** A JSON string we will add to your flow\\\'s context and that you can access as variables inside your flow. For example, if you pass in `Parameters={\\\'name\\\':\\\'Zeke\\\'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string \\\'Zeke\\\'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. */ + parameters?: any; +} +/** + * Options to pass to each + */ +export interface EngagementListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EngagementInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EngagementListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EngagementListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EngagementContext { + engagementContext: EngagementContextListInstance; + steps: StepListInstance; + /** + * Remove a EngagementInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EngagementInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EngagementInstance + */ + fetch(callback?: (error: Error | null, item?: EngagementInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EngagementContextSolution { + flowSid: string; + sid: string; +} +export declare class EngagementContextImpl implements EngagementContext { + protected _version: V1; + protected _solution: EngagementContextSolution; + protected _uri: string; + protected _engagementContext?: EngagementContextListInstance; + protected _steps?: StepListInstance; + constructor(_version: V1, flowSid: string, sid: string); + get engagementContext(): EngagementContextListInstance; + get steps(): StepListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: EngagementInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EngagementContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EngagementPayload extends TwilioResponsePayload { + engagements: EngagementResource[]; +} +interface EngagementResource { + sid: string; + account_sid: string; + flow_sid: string; + contact_sid: string; + contact_channel_address: string; + context: any; + status: EngagementStatus; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class EngagementInstance { + protected _version: V1; + protected _solution: EngagementContextSolution; + protected _context?: EngagementContext; + constructor(_version: V1, payload: EngagementResource, flowSid: string, sid?: string); + /** + * The unique string that we created to identify the Engagement resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Engagement resource. + */ + accountSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the Contact. + */ + contactSid: string; + /** + * The phone number, SIP address or Client identifier that triggered this Engagement. Phone numbers are in E.164 format (+16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. + */ + contactChannelAddress: string; + /** + * The current state of the execution flow. As your flow executes, we save the state in a flow context. Your widgets can access the data in the flow context as variables, either in configuration fields or in text areas as variable substitution. + */ + context: any; + status: EngagementStatus; + /** + * The date and time in GMT when the Engagement was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Engagement was updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of the Engagement\'s nested resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a EngagementInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EngagementInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EngagementInstance + */ + fetch(callback?: (error: Error | null, item?: EngagementInstance) => any): Promise; + /** + * Access the engagementContext. + */ + engagementContext(): EngagementContextListInstance; + /** + * Access the steps. + */ + steps(): StepListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + flowSid: string; + contactSid: string; + contactChannelAddress: string; + context: any; + status: EngagementStatus; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EngagementSolution { + flowSid: string; +} +export interface EngagementListInstance { + _version: V1; + _solution: EngagementSolution; + _uri: string; + (sid: string): EngagementContext; + get(sid: string): EngagementContext; + /** + * Create a EngagementInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EngagementInstance + */ + create(params: EngagementListInstanceCreateOptions, callback?: (error: Error | null, item?: EngagementInstance) => any): Promise; + /** + * Streams EngagementInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EngagementListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EngagementInstance, done: (err?: Error) => void) => void): void; + each(params: EngagementListInstanceEachOptions, callback?: (item: EngagementInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EngagementInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EngagementPage) => any): Promise; + /** + * Lists EngagementInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EngagementListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EngagementInstance[]) => any): Promise; + list(params: EngagementListInstanceOptions, callback?: (error: Error | null, items: EngagementInstance[]) => any): Promise; + /** + * Retrieve a single page of EngagementInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EngagementListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EngagementPage) => any): Promise; + page(params: EngagementListInstancePageOptions, callback?: (error: Error | null, items: EngagementPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EngagementListInstance(version: V1, flowSid: string): EngagementListInstance; +export declare class EngagementPage extends Page { + /** + * Initialize the EngagementPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EngagementSolution); + /** + * Build an instance of EngagementInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EngagementResource): EngagementInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/engagement.js b/node_modules/twilio/lib/rest/studio/v1/flow/engagement.js new file mode 100644 index 00000000..3f7ddda4 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/engagement.js @@ -0,0 +1,269 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EngagementPage = exports.EngagementListInstance = exports.EngagementInstance = exports.EngagementContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const engagementContext_1 = require("./engagement/engagementContext"); +const step_1 = require("./engagement/step"); +class EngagementContextImpl { + constructor(_version, flowSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { flowSid, sid }; + this._uri = `/Flows/${flowSid}/Engagements/${sid}`; + } + get engagementContext() { + this._engagementContext = + this._engagementContext || + (0, engagementContext_1.EngagementContextListInstance)(this._version, this._solution.flowSid, this._solution.sid); + return this._engagementContext; + } + get steps() { + this._steps = + this._steps || + (0, step_1.StepListInstance)(this._version, this._solution.flowSid, this._solution.sid); + return this._steps; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EngagementInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EngagementContextImpl = EngagementContextImpl; +class EngagementInstance { + constructor(_version, payload, flowSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.flowSid = payload.flow_sid; + this.contactSid = payload.contact_sid; + this.contactChannelAddress = payload.contact_channel_address; + this.context = payload.context; + this.status = payload.status; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { flowSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EngagementContextImpl(this._version, this._solution.flowSid, this._solution.sid); + return this._context; + } + /** + * Remove a EngagementInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a EngagementInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EngagementInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the engagementContext. + */ + engagementContext() { + return this._proxy.engagementContext; + } + /** + * Access the steps. + */ + steps() { + return this._proxy.steps; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + flowSid: this.flowSid, + contactSid: this.contactSid, + contactChannelAddress: this.contactChannelAddress, + context: this.context, + status: this.status, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EngagementInstance = EngagementInstance; +function EngagementListInstance(version, flowSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EngagementContextImpl(version, flowSid, sid); + }; + instance._version = version; + instance._solution = { flowSid }; + instance._uri = `/Flows/${flowSid}/Engagements`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["to"] === null || params["to"] === undefined) { + throw new Error("Required parameter \"params['to']\" missing."); + } + if (params["from"] === null || params["from"] === undefined) { + throw new Error("Required parameter \"params['from']\" missing."); + } + let data = {}; + data["To"] = params["to"]; + data["From"] = params["from"]; + if (params["parameters"] !== undefined) + data["Parameters"] = serialize.object(params["parameters"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EngagementInstance(operationVersion, payload, instance._solution.flowSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EngagementPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EngagementPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EngagementListInstance = EngagementListInstance; +class EngagementPage extends Page_1.default { + /** + * Initialize the EngagementPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EngagementInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EngagementInstance(this._version, payload, this._solution.flowSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EngagementPage = EngagementPage; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/engagement/engagementContext.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/engagementContext.d.ts new file mode 100644 index 00000000..ee7500d7 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/engagementContext.d.ts @@ -0,0 +1,109 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +export interface EngagementContextContext { + /** + * Fetch a EngagementContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EngagementContextInstance + */ + fetch(callback?: (error: Error | null, item?: EngagementContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EngagementContextContextSolution { + flowSid: string; + engagementSid: string; +} +export declare class EngagementContextContextImpl implements EngagementContextContext { + protected _version: V1; + protected _solution: EngagementContextContextSolution; + protected _uri: string; + constructor(_version: V1, flowSid: string, engagementSid: string); + fetch(callback?: (error: Error | null, item?: EngagementContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EngagementContextContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EngagementContextResource { + account_sid: string; + context: any; + engagement_sid: string; + flow_sid: string; + url: string; +} +export declare class EngagementContextInstance { + protected _version: V1; + protected _solution: EngagementContextContextSolution; + protected _context?: EngagementContextContext; + constructor(_version: V1, payload: EngagementContextResource, flowSid: string, engagementSid: string); + /** + * The SID of the Account. + */ + accountSid: string; + /** + * As your flow executes, we save the state in what\'s called the Flow Context. Any data in the flow context can be accessed by your widgets as variables, either in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The SID of the Engagement. + */ + engagementSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a EngagementContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EngagementContextInstance + */ + fetch(callback?: (error: Error | null, item?: EngagementContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + context: any; + engagementSid: string; + flowSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EngagementContextSolution { + flowSid: string; + engagementSid: string; +} +export interface EngagementContextListInstance { + _version: V1; + _solution: EngagementContextSolution; + _uri: string; + (): EngagementContextContext; + get(): EngagementContextContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EngagementContextListInstance(version: V1, flowSid: string, engagementSid: string): EngagementContextListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/engagement/engagementContext.js b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/engagementContext.js new file mode 100644 index 00000000..e94a0d38 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/engagementContext.js @@ -0,0 +1,123 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EngagementContextListInstance = exports.EngagementContextInstance = exports.EngagementContextContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class EngagementContextContextImpl { + constructor(_version, flowSid, engagementSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(engagementSid)) { + throw new Error("Parameter 'engagementSid' is not valid."); + } + this._solution = { flowSid, engagementSid }; + this._uri = `/Flows/${flowSid}/Engagements/${engagementSid}/Context`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EngagementContextInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.engagementSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EngagementContextContextImpl = EngagementContextContextImpl; +class EngagementContextInstance { + constructor(_version, payload, flowSid, engagementSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.context = payload.context; + this.engagementSid = payload.engagement_sid; + this.flowSid = payload.flow_sid; + this.url = payload.url; + this._solution = { flowSid, engagementSid }; + } + get _proxy() { + this._context = + this._context || + new EngagementContextContextImpl(this._version, this._solution.flowSid, this._solution.engagementSid); + return this._context; + } + /** + * Fetch a EngagementContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EngagementContextInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + context: this.context, + engagementSid: this.engagementSid, + flowSid: this.flowSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EngagementContextInstance = EngagementContextInstance; +function EngagementContextListInstance(version, flowSid, engagementSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(engagementSid)) { + throw new Error("Parameter 'engagementSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new EngagementContextContextImpl(version, flowSid, engagementSid); + }; + instance._version = version; + instance._solution = { flowSid, engagementSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EngagementContextListInstance = EngagementContextListInstance; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step.d.ts new file mode 100644 index 00000000..5d59f36c --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step.d.ts @@ -0,0 +1,265 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +import { StepContextListInstance } from "./step/stepContext"; +/** + * Options to pass to each + */ +export interface StepListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: StepInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface StepListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface StepListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface StepContext { + stepContext: StepContextListInstance; + /** + * Fetch a StepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StepInstance + */ + fetch(callback?: (error: Error | null, item?: StepInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface StepContextSolution { + flowSid: string; + engagementSid: string; + sid: string; +} +export declare class StepContextImpl implements StepContext { + protected _version: V1; + protected _solution: StepContextSolution; + protected _uri: string; + protected _stepContext?: StepContextListInstance; + constructor(_version: V1, flowSid: string, engagementSid: string, sid: string); + get stepContext(): StepContextListInstance; + fetch(callback?: (error: Error | null, item?: StepInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): StepContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface StepPayload extends TwilioResponsePayload { + steps: StepResource[]; +} +interface StepResource { + sid: string; + account_sid: string; + flow_sid: string; + engagement_sid: string; + name: string; + context: any; + transitioned_from: string; + transitioned_to: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class StepInstance { + protected _version: V1; + protected _solution: StepContextSolution; + protected _context?: StepContext; + constructor(_version: V1, payload: StepResource, flowSid: string, engagementSid: string, sid?: string); + /** + * The unique string that we created to identify the Step resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Step resource. + */ + accountSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the Engagement. + */ + engagementSid: string; + /** + * The event that caused the Flow to transition to the Step. + */ + name: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The Widget that preceded the Widget for the Step. + */ + transitionedFrom: string; + /** + * The Widget that will follow the Widget for the Step. + */ + transitionedTo: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a StepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StepInstance + */ + fetch(callback?: (error: Error | null, item?: StepInstance) => any): Promise; + /** + * Access the stepContext. + */ + stepContext(): StepContextListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + flowSid: string; + engagementSid: string; + name: string; + context: any; + transitionedFrom: string; + transitionedTo: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface StepSolution { + flowSid: string; + engagementSid: string; +} +export interface StepListInstance { + _version: V1; + _solution: StepSolution; + _uri: string; + (sid: string): StepContext; + get(sid: string): StepContext; + /** + * Streams StepInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { StepListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: StepInstance, done: (err?: Error) => void) => void): void; + each(params: StepListInstanceEachOptions, callback?: (item: StepInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of StepInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: StepPage) => any): Promise; + /** + * Lists StepInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { StepListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: StepInstance[]) => any): Promise; + list(params: StepListInstanceOptions, callback?: (error: Error | null, items: StepInstance[]) => any): Promise; + /** + * Retrieve a single page of StepInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { StepListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: StepPage) => any): Promise; + page(params: StepListInstancePageOptions, callback?: (error: Error | null, items: StepPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function StepListInstance(version: V1, flowSid: string, engagementSid: string): StepListInstance; +export declare class StepPage extends Page { + /** + * Initialize the StepPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: StepSolution); + /** + * Build an instance of StepInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: StepResource): StepInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step.js b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step.js new file mode 100644 index 00000000..dd8683b7 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step.js @@ -0,0 +1,218 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StepPage = exports.StepListInstance = exports.StepInstance = exports.StepContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const stepContext_1 = require("./step/stepContext"); +class StepContextImpl { + constructor(_version, flowSid, engagementSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(engagementSid)) { + throw new Error("Parameter 'engagementSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { flowSid, engagementSid, sid }; + this._uri = `/Flows/${flowSid}/Engagements/${engagementSid}/Steps/${sid}`; + } + get stepContext() { + this._stepContext = + this._stepContext || + (0, stepContext_1.StepContextListInstance)(this._version, this._solution.flowSid, this._solution.engagementSid, this._solution.sid); + return this._stepContext; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new StepInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.engagementSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.StepContextImpl = StepContextImpl; +class StepInstance { + constructor(_version, payload, flowSid, engagementSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.flowSid = payload.flow_sid; + this.engagementSid = payload.engagement_sid; + this.name = payload.name; + this.context = payload.context; + this.transitionedFrom = payload.transitioned_from; + this.transitionedTo = payload.transitioned_to; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { flowSid, engagementSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new StepContextImpl(this._version, this._solution.flowSid, this._solution.engagementSid, this._solution.sid); + return this._context; + } + /** + * Fetch a StepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StepInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the stepContext. + */ + stepContext() { + return this._proxy.stepContext; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + flowSid: this.flowSid, + engagementSid: this.engagementSid, + name: this.name, + context: this.context, + transitionedFrom: this.transitionedFrom, + transitionedTo: this.transitionedTo, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.StepInstance = StepInstance; +function StepListInstance(version, flowSid, engagementSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(engagementSid)) { + throw new Error("Parameter 'engagementSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new StepContextImpl(version, flowSid, engagementSid, sid); + }; + instance._version = version; + instance._solution = { flowSid, engagementSid }; + instance._uri = `/Flows/${flowSid}/Engagements/${engagementSid}/Steps`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new StepPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new StepPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.StepListInstance = StepListInstance; +class StepPage extends Page_1.default { + /** + * Initialize the StepPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of StepInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new StepInstance(this._version, payload, this._solution.flowSid, this._solution.engagementSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.StepPage = StepPage; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step/stepContext.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step/stepContext.d.ts new file mode 100644 index 00000000..701d7c73 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step/stepContext.d.ts @@ -0,0 +1,117 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../../V1"; +export interface StepContextContext { + /** + * Fetch a StepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StepContextInstance + */ + fetch(callback?: (error: Error | null, item?: StepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface StepContextContextSolution { + flowSid: string; + engagementSid: string; + stepSid: string; +} +export declare class StepContextContextImpl implements StepContextContext { + protected _version: V1; + protected _solution: StepContextContextSolution; + protected _uri: string; + constructor(_version: V1, flowSid: string, engagementSid: string, stepSid: string); + fetch(callback?: (error: Error | null, item?: StepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): StepContextContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface StepContextResource { + account_sid: string; + context: any; + engagement_sid: string; + flow_sid: string; + step_sid: string; + url: string; +} +export declare class StepContextInstance { + protected _version: V1; + protected _solution: StepContextContextSolution; + protected _context?: StepContextContext; + constructor(_version: V1, payload: StepContextResource, flowSid: string, engagementSid: string, stepSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the StepContext resource. + */ + accountSid: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The SID of the Engagement. + */ + engagementSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the Step the context is associated with. + */ + stepSid: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a StepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StepContextInstance + */ + fetch(callback?: (error: Error | null, item?: StepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + context: any; + engagementSid: string; + flowSid: string; + stepSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface StepContextSolution { + flowSid: string; + engagementSid: string; + stepSid: string; +} +export interface StepContextListInstance { + _version: V1; + _solution: StepContextSolution; + _uri: string; + (): StepContextContext; + get(): StepContextContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function StepContextListInstance(version: V1, flowSid: string, engagementSid: string, stepSid: string): StepContextListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step/stepContext.js b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step/stepContext.js new file mode 100644 index 00000000..7ae21946 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/engagement/step/stepContext.js @@ -0,0 +1,131 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StepContextListInstance = exports.StepContextInstance = exports.StepContextContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class StepContextContextImpl { + constructor(_version, flowSid, engagementSid, stepSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(engagementSid)) { + throw new Error("Parameter 'engagementSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(stepSid)) { + throw new Error("Parameter 'stepSid' is not valid."); + } + this._solution = { flowSid, engagementSid, stepSid }; + this._uri = `/Flows/${flowSid}/Engagements/${engagementSid}/Steps/${stepSid}/Context`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new StepContextInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.engagementSid, instance._solution.stepSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.StepContextContextImpl = StepContextContextImpl; +class StepContextInstance { + constructor(_version, payload, flowSid, engagementSid, stepSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.context = payload.context; + this.engagementSid = payload.engagement_sid; + this.flowSid = payload.flow_sid; + this.stepSid = payload.step_sid; + this.url = payload.url; + this._solution = { flowSid, engagementSid, stepSid }; + } + get _proxy() { + this._context = + this._context || + new StepContextContextImpl(this._version, this._solution.flowSid, this._solution.engagementSid, this._solution.stepSid); + return this._context; + } + /** + * Fetch a StepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StepContextInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + context: this.context, + engagementSid: this.engagementSid, + flowSid: this.flowSid, + stepSid: this.stepSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.StepContextInstance = StepContextInstance; +function StepContextListInstance(version, flowSid, engagementSid, stepSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(engagementSid)) { + throw new Error("Parameter 'engagementSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(stepSid)) { + throw new Error("Parameter 'stepSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new StepContextContextImpl(version, flowSid, engagementSid, stepSid); + }; + instance._version = version; + instance._solution = { flowSid, engagementSid, stepSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.StepContextListInstance = StepContextListInstance; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/execution.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow/execution.d.ts new file mode 100644 index 00000000..3163e4f5 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/execution.d.ts @@ -0,0 +1,338 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { ExecutionContextListInstance } from "./execution/executionContext"; +import { ExecutionStepListInstance } from "./execution/executionStep"; +export type ExecutionStatus = "active" | "ended"; +/** + * Options to pass to update a ExecutionInstance + */ +export interface ExecutionContextUpdateOptions { + /** */ + status: ExecutionStatus; +} +/** + * Options to pass to create a ExecutionInstance + */ +export interface ExecutionListInstanceCreateOptions { + /** The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. */ + to: string; + /** The Twilio phone number to send messages or initiate calls from during the Flow\\\'s Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. */ + from: string; + /** JSON data that will be added to the Flow\\\'s context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. */ + parameters?: any; +} +/** + * Options to pass to each + */ +export interface ExecutionListInstanceEachOptions { + /** Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedFrom?: Date; + /** Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedTo?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ExecutionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ExecutionListInstanceOptions { + /** Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedFrom?: Date; + /** Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedTo?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ExecutionListInstancePageOptions { + /** Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedFrom?: Date; + /** Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedTo?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ExecutionContext { + executionContext: ExecutionContextListInstance; + steps: ExecutionStepListInstance; + /** + * Remove a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Update a ExecutionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + update(params: ExecutionContextUpdateOptions, callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExecutionContextSolution { + flowSid: string; + sid: string; +} +export declare class ExecutionContextImpl implements ExecutionContext { + protected _version: V1; + protected _solution: ExecutionContextSolution; + protected _uri: string; + protected _executionContext?: ExecutionContextListInstance; + protected _steps?: ExecutionStepListInstance; + constructor(_version: V1, flowSid: string, sid: string); + get executionContext(): ExecutionContextListInstance; + get steps(): ExecutionStepListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + update(params: ExecutionContextUpdateOptions, callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExecutionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExecutionPayload extends TwilioResponsePayload { + executions: ExecutionResource[]; +} +interface ExecutionResource { + sid: string; + account_sid: string; + flow_sid: string; + contact_sid: string; + contact_channel_address: string; + context: any; + status: ExecutionStatus; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ExecutionInstance { + protected _version: V1; + protected _solution: ExecutionContextSolution; + protected _context?: ExecutionContext; + constructor(_version: V1, payload: ExecutionResource, flowSid: string, sid?: string); + /** + * The unique string that we created to identify the Execution resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Execution resource. + */ + accountSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the Contact. + */ + contactSid: string; + /** + * The phone number, SIP address or Client identifier that triggered the Execution. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. + */ + contactChannelAddress: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + status: ExecutionStatus; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of nested resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Update a ExecutionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + update(params: ExecutionContextUpdateOptions, callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Access the executionContext. + */ + executionContext(): ExecutionContextListInstance; + /** + * Access the steps. + */ + steps(): ExecutionStepListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + flowSid: string; + contactSid: string; + contactChannelAddress: string; + context: any; + status: ExecutionStatus; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExecutionSolution { + flowSid: string; +} +export interface ExecutionListInstance { + _version: V1; + _solution: ExecutionSolution; + _uri: string; + (sid: string): ExecutionContext; + get(sid: string): ExecutionContext; + /** + * Create a ExecutionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + create(params: ExecutionListInstanceCreateOptions, callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Streams ExecutionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ExecutionInstance, done: (err?: Error) => void) => void): void; + each(params: ExecutionListInstanceEachOptions, callback?: (item: ExecutionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ExecutionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ExecutionPage) => any): Promise; + /** + * Lists ExecutionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ExecutionInstance[]) => any): Promise; + list(params: ExecutionListInstanceOptions, callback?: (error: Error | null, items: ExecutionInstance[]) => any): Promise; + /** + * Retrieve a single page of ExecutionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ExecutionPage) => any): Promise; + page(params: ExecutionListInstancePageOptions, callback?: (error: Error | null, items: ExecutionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExecutionListInstance(version: V1, flowSid: string): ExecutionListInstance; +export declare class ExecutionPage extends Page { + /** + * Initialize the ExecutionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ExecutionSolution); + /** + * Build an instance of ExecutionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ExecutionResource): ExecutionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/execution.js b/node_modules/twilio/lib/rest/studio/v1/flow/execution.js new file mode 100644 index 00000000..2ee16e06 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/execution.js @@ -0,0 +1,298 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionPage = exports.ExecutionListInstance = exports.ExecutionInstance = exports.ExecutionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const executionContext_1 = require("./execution/executionContext"); +const executionStep_1 = require("./execution/executionStep"); +class ExecutionContextImpl { + constructor(_version, flowSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { flowSid, sid }; + this._uri = `/Flows/${flowSid}/Executions/${sid}`; + } + get executionContext() { + this._executionContext = + this._executionContext || + (0, executionContext_1.ExecutionContextListInstance)(this._version, this._solution.flowSid, this._solution.sid); + return this._executionContext; + } + get steps() { + this._steps = + this._steps || + (0, executionStep_1.ExecutionStepListInstance)(this._version, this._solution.flowSid, this._solution.sid); + return this._steps; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExecutionInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExecutionInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionContextImpl = ExecutionContextImpl; +class ExecutionInstance { + constructor(_version, payload, flowSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.flowSid = payload.flow_sid; + this.contactSid = payload.contact_sid; + this.contactChannelAddress = payload.contact_channel_address; + this.context = payload.context; + this.status = payload.status; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { flowSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ExecutionContextImpl(this._version, this._solution.flowSid, this._solution.sid); + return this._context; + } + /** + * Remove a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the executionContext. + */ + executionContext() { + return this._proxy.executionContext; + } + /** + * Access the steps. + */ + steps() { + return this._proxy.steps; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + flowSid: this.flowSid, + contactSid: this.contactSid, + contactChannelAddress: this.contactChannelAddress, + context: this.context, + status: this.status, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionInstance = ExecutionInstance; +function ExecutionListInstance(version, flowSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ExecutionContextImpl(version, flowSid, sid); + }; + instance._version = version; + instance._solution = { flowSid }; + instance._uri = `/Flows/${flowSid}/Executions`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["to"] === null || params["to"] === undefined) { + throw new Error("Required parameter \"params['to']\" missing."); + } + if (params["from"] === null || params["from"] === undefined) { + throw new Error("Required parameter \"params['from']\" missing."); + } + let data = {}; + data["To"] = params["to"]; + data["From"] = params["from"]; + if (params["parameters"] !== undefined) + data["Parameters"] = serialize.object(params["parameters"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExecutionInstance(operationVersion, payload, instance._solution.flowSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreatedFrom"] !== undefined) + data["DateCreatedFrom"] = serialize.iso8601DateTime(params["dateCreatedFrom"]); + if (params["dateCreatedTo"] !== undefined) + data["DateCreatedTo"] = serialize.iso8601DateTime(params["dateCreatedTo"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExecutionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ExecutionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExecutionListInstance = ExecutionListInstance; +class ExecutionPage extends Page_1.default { + /** + * Initialize the ExecutionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ExecutionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ExecutionInstance(this._version, payload, this._solution.flowSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionPage = ExecutionPage; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionContext.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionContext.d.ts new file mode 100644 index 00000000..b1cb5534 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionContext.d.ts @@ -0,0 +1,109 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +export interface ExecutionContextContext { + /** + * Fetch a ExecutionContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionContextInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExecutionContextContextSolution { + flowSid: string; + executionSid: string; +} +export declare class ExecutionContextContextImpl implements ExecutionContextContext { + protected _version: V1; + protected _solution: ExecutionContextContextSolution; + protected _uri: string; + constructor(_version: V1, flowSid: string, executionSid: string); + fetch(callback?: (error: Error | null, item?: ExecutionContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExecutionContextContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExecutionContextResource { + account_sid: string; + context: any; + flow_sid: string; + execution_sid: string; + url: string; +} +export declare class ExecutionContextInstance { + protected _version: V1; + protected _solution: ExecutionContextContextSolution; + protected _context?: ExecutionContextContext; + constructor(_version: V1, payload: ExecutionContextResource, flowSid: string, executionSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionContext resource. + */ + accountSid: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the context\'s Execution resource. + */ + executionSid: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ExecutionContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionContextInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + context: any; + flowSid: string; + executionSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExecutionContextSolution { + flowSid: string; + executionSid: string; +} +export interface ExecutionContextListInstance { + _version: V1; + _solution: ExecutionContextSolution; + _uri: string; + (): ExecutionContextContext; + get(): ExecutionContextContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExecutionContextListInstance(version: V1, flowSid: string, executionSid: string): ExecutionContextListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionContext.js b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionContext.js new file mode 100644 index 00000000..76a99e54 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionContext.js @@ -0,0 +1,123 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionContextListInstance = exports.ExecutionContextInstance = exports.ExecutionContextContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class ExecutionContextContextImpl { + constructor(_version, flowSid, executionSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + this._solution = { flowSid, executionSid }; + this._uri = `/Flows/${flowSid}/Executions/${executionSid}/Context`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExecutionContextInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.executionSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionContextContextImpl = ExecutionContextContextImpl; +class ExecutionContextInstance { + constructor(_version, payload, flowSid, executionSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.context = payload.context; + this.flowSid = payload.flow_sid; + this.executionSid = payload.execution_sid; + this.url = payload.url; + this._solution = { flowSid, executionSid }; + } + get _proxy() { + this._context = + this._context || + new ExecutionContextContextImpl(this._version, this._solution.flowSid, this._solution.executionSid); + return this._context; + } + /** + * Fetch a ExecutionContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionContextInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + context: this.context, + flowSid: this.flowSid, + executionSid: this.executionSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionContextInstance = ExecutionContextInstance; +function ExecutionContextListInstance(version, flowSid, executionSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new ExecutionContextContextImpl(version, flowSid, executionSid); + }; + instance._version = version; + instance._solution = { flowSid, executionSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExecutionContextListInstance = ExecutionContextListInstance; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep.d.ts new file mode 100644 index 00000000..9f498d60 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep.d.ts @@ -0,0 +1,265 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +import { ExecutionStepContextListInstance } from "./executionStep/executionStepContext"; +/** + * Options to pass to each + */ +export interface ExecutionStepListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ExecutionStepInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ExecutionStepListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ExecutionStepListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ExecutionStepContext { + stepContext: ExecutionStepContextListInstance; + /** + * Fetch a ExecutionStepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionStepInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExecutionStepContextSolution { + flowSid: string; + executionSid: string; + sid: string; +} +export declare class ExecutionStepContextImpl implements ExecutionStepContext { + protected _version: V1; + protected _solution: ExecutionStepContextSolution; + protected _uri: string; + protected _stepContext?: ExecutionStepContextListInstance; + constructor(_version: V1, flowSid: string, executionSid: string, sid: string); + get stepContext(): ExecutionStepContextListInstance; + fetch(callback?: (error: Error | null, item?: ExecutionStepInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExecutionStepContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExecutionStepPayload extends TwilioResponsePayload { + steps: ExecutionStepResource[]; +} +interface ExecutionStepResource { + sid: string; + account_sid: string; + flow_sid: string; + execution_sid: string; + name: string; + context: any; + transitioned_from: string; + transitioned_to: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ExecutionStepInstance { + protected _version: V1; + protected _solution: ExecutionStepContextSolution; + protected _context?: ExecutionStepContext; + constructor(_version: V1, payload: ExecutionStepResource, flowSid: string, executionSid: string, sid?: string); + /** + * The unique string that we created to identify the ExecutionStep resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource. + */ + accountSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the Step\'s Execution resource. + */ + executionSid: string; + /** + * The event that caused the Flow to transition to the Step. + */ + name: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The Widget that preceded the Widget for the Step. + */ + transitionedFrom: string; + /** + * The Widget that will follow the Widget for the Step. + */ + transitionedTo: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ExecutionStepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionStepInstance) => any): Promise; + /** + * Access the stepContext. + */ + stepContext(): ExecutionStepContextListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + flowSid: string; + executionSid: string; + name: string; + context: any; + transitionedFrom: string; + transitionedTo: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExecutionStepSolution { + flowSid: string; + executionSid: string; +} +export interface ExecutionStepListInstance { + _version: V1; + _solution: ExecutionStepSolution; + _uri: string; + (sid: string): ExecutionStepContext; + get(sid: string): ExecutionStepContext; + /** + * Streams ExecutionStepInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionStepListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ExecutionStepInstance, done: (err?: Error) => void) => void): void; + each(params: ExecutionStepListInstanceEachOptions, callback?: (item: ExecutionStepInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ExecutionStepInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ExecutionStepPage) => any): Promise; + /** + * Lists ExecutionStepInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionStepListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ExecutionStepInstance[]) => any): Promise; + list(params: ExecutionStepListInstanceOptions, callback?: (error: Error | null, items: ExecutionStepInstance[]) => any): Promise; + /** + * Retrieve a single page of ExecutionStepInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionStepListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ExecutionStepPage) => any): Promise; + page(params: ExecutionStepListInstancePageOptions, callback?: (error: Error | null, items: ExecutionStepPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExecutionStepListInstance(version: V1, flowSid: string, executionSid: string): ExecutionStepListInstance; +export declare class ExecutionStepPage extends Page { + /** + * Initialize the ExecutionStepPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ExecutionStepSolution); + /** + * Build an instance of ExecutionStepInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ExecutionStepResource): ExecutionStepInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep.js b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep.js new file mode 100644 index 00000000..beaea528 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep.js @@ -0,0 +1,218 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionStepPage = exports.ExecutionStepListInstance = exports.ExecutionStepInstance = exports.ExecutionStepContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const executionStepContext_1 = require("./executionStep/executionStepContext"); +class ExecutionStepContextImpl { + constructor(_version, flowSid, executionSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { flowSid, executionSid, sid }; + this._uri = `/Flows/${flowSid}/Executions/${executionSid}/Steps/${sid}`; + } + get stepContext() { + this._stepContext = + this._stepContext || + (0, executionStepContext_1.ExecutionStepContextListInstance)(this._version, this._solution.flowSid, this._solution.executionSid, this._solution.sid); + return this._stepContext; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExecutionStepInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.executionSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepContextImpl = ExecutionStepContextImpl; +class ExecutionStepInstance { + constructor(_version, payload, flowSid, executionSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.flowSid = payload.flow_sid; + this.executionSid = payload.execution_sid; + this.name = payload.name; + this.context = payload.context; + this.transitionedFrom = payload.transitioned_from; + this.transitionedTo = payload.transitioned_to; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { flowSid, executionSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ExecutionStepContextImpl(this._version, this._solution.flowSid, this._solution.executionSid, this._solution.sid); + return this._context; + } + /** + * Fetch a ExecutionStepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the stepContext. + */ + stepContext() { + return this._proxy.stepContext; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + flowSid: this.flowSid, + executionSid: this.executionSid, + name: this.name, + context: this.context, + transitionedFrom: this.transitionedFrom, + transitionedTo: this.transitionedTo, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepInstance = ExecutionStepInstance; +function ExecutionStepListInstance(version, flowSid, executionSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ExecutionStepContextImpl(version, flowSid, executionSid, sid); + }; + instance._version = version; + instance._solution = { flowSid, executionSid }; + instance._uri = `/Flows/${flowSid}/Executions/${executionSid}/Steps`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExecutionStepPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ExecutionStepPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExecutionStepListInstance = ExecutionStepListInstance; +class ExecutionStepPage extends Page_1.default { + /** + * Initialize the ExecutionStepPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ExecutionStepInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ExecutionStepInstance(this._version, payload, this._solution.flowSid, this._solution.executionSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepPage = ExecutionStepPage; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.d.ts b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.d.ts new file mode 100644 index 00000000..8058ce0a --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.d.ts @@ -0,0 +1,117 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../../V1"; +export interface ExecutionStepContextContext { + /** + * Fetch a ExecutionStepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepContextInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionStepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExecutionStepContextContextSolution { + flowSid: string; + executionSid: string; + stepSid: string; +} +export declare class ExecutionStepContextContextImpl implements ExecutionStepContextContext { + protected _version: V1; + protected _solution: ExecutionStepContextContextSolution; + protected _uri: string; + constructor(_version: V1, flowSid: string, executionSid: string, stepSid: string); + fetch(callback?: (error: Error | null, item?: ExecutionStepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExecutionStepContextContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExecutionStepContextResource { + account_sid: string; + context: any; + execution_sid: string; + flow_sid: string; + step_sid: string; + url: string; +} +export declare class ExecutionStepContextInstance { + protected _version: V1; + protected _solution: ExecutionStepContextContextSolution; + protected _context?: ExecutionStepContextContext; + constructor(_version: V1, payload: ExecutionStepContextResource, flowSid: string, executionSid: string, stepSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStepContext resource. + */ + accountSid: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The SID of the context\'s Execution resource. + */ + executionSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the Step that the context is associated with. + */ + stepSid: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ExecutionStepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepContextInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionStepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + context: any; + executionSid: string; + flowSid: string; + stepSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExecutionStepContextSolution { + flowSid: string; + executionSid: string; + stepSid: string; +} +export interface ExecutionStepContextListInstance { + _version: V1; + _solution: ExecutionStepContextSolution; + _uri: string; + (): ExecutionStepContextContext; + get(): ExecutionStepContextContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExecutionStepContextListInstance(version: V1, flowSid: string, executionSid: string, stepSid: string): ExecutionStepContextListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.js b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.js new file mode 100644 index 00000000..31463371 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.js @@ -0,0 +1,131 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionStepContextListInstance = exports.ExecutionStepContextInstance = exports.ExecutionStepContextContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class ExecutionStepContextContextImpl { + constructor(_version, flowSid, executionSid, stepSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(stepSid)) { + throw new Error("Parameter 'stepSid' is not valid."); + } + this._solution = { flowSid, executionSid, stepSid }; + this._uri = `/Flows/${flowSid}/Executions/${executionSid}/Steps/${stepSid}/Context`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExecutionStepContextInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.executionSid, instance._solution.stepSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepContextContextImpl = ExecutionStepContextContextImpl; +class ExecutionStepContextInstance { + constructor(_version, payload, flowSid, executionSid, stepSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.context = payload.context; + this.executionSid = payload.execution_sid; + this.flowSid = payload.flow_sid; + this.stepSid = payload.step_sid; + this.url = payload.url; + this._solution = { flowSid, executionSid, stepSid }; + } + get _proxy() { + this._context = + this._context || + new ExecutionStepContextContextImpl(this._version, this._solution.flowSid, this._solution.executionSid, this._solution.stepSid); + return this._context; + } + /** + * Fetch a ExecutionStepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepContextInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + context: this.context, + executionSid: this.executionSid, + flowSid: this.flowSid, + stepSid: this.stepSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepContextInstance = ExecutionStepContextInstance; +function ExecutionStepContextListInstance(version, flowSid, executionSid, stepSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(stepSid)) { + throw new Error("Parameter 'stepSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new ExecutionStepContextContextImpl(version, flowSid, executionSid, stepSid); + }; + instance._version = version; + instance._solution = { flowSid, executionSid, stepSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExecutionStepContextListInstance = ExecutionStepContextListInstance; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow.d.ts b/node_modules/twilio/lib/rest/studio/v2/flow.d.ts new file mode 100644 index 00000000..f0f8dcd8 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow.d.ts @@ -0,0 +1,361 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +import { ExecutionListInstance } from "./flow/execution"; +import { FlowRevisionListInstance } from "./flow/flowRevision"; +import { FlowTestUserListInstance } from "./flow/flowTestUser"; +export type FlowStatus = "draft" | "published"; +/** + * Options to pass to update a FlowInstance + */ +export interface FlowContextUpdateOptions { + /** */ + status: FlowStatus; + /** The string that you assigned to describe the Flow. */ + friendlyName?: string; + /** JSON representation of flow definition. */ + definition?: any; + /** Description of change made in the revision. */ + commitMessage?: string; +} +/** + * Options to pass to create a FlowInstance + */ +export interface FlowListInstanceCreateOptions { + /** The string that you assigned to describe the Flow. */ + friendlyName: string; + /** */ + status: FlowStatus; + /** JSON representation of flow definition. */ + definition: any; + /** Description of change made in the revision. */ + commitMessage?: string; +} +/** + * Options to pass to each + */ +export interface FlowListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FlowInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FlowListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FlowListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FlowContext { + executions: ExecutionListInstance; + revisions: FlowRevisionListInstance; + testUsers: FlowTestUserListInstance; + /** + * Remove a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + fetch(callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Update a FlowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + update(params: FlowContextUpdateOptions, callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FlowContextSolution { + sid: string; +} +export declare class FlowContextImpl implements FlowContext { + protected _version: V2; + protected _solution: FlowContextSolution; + protected _uri: string; + protected _executions?: ExecutionListInstance; + protected _revisions?: FlowRevisionListInstance; + protected _testUsers?: FlowTestUserListInstance; + constructor(_version: V2, sid: string); + get executions(): ExecutionListInstance; + get revisions(): FlowRevisionListInstance; + get testUsers(): FlowTestUserListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + update(params: FlowContextUpdateOptions, callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FlowContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FlowPayload extends TwilioResponsePayload { + flows: FlowResource[]; +} +interface FlowResource { + sid: string; + account_sid: string; + friendly_name: string; + definition: any; + status: FlowStatus; + revision: number; + commit_message: string; + valid: boolean; + errors: Array; + warnings: Array; + date_created: Date; + date_updated: Date; + webhook_url: string; + url: string; + links: Record; +} +export declare class FlowInstance { + protected _version: V2; + protected _solution: FlowContextSolution; + protected _context?: FlowContext; + constructor(_version: V2, payload: FlowResource, sid?: string); + /** + * The unique string that we created to identify the Flow resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flow resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the Flow. + */ + friendlyName: string; + /** + * JSON representation of flow definition. + */ + definition: any; + status: FlowStatus; + /** + * The latest revision number of the Flow\'s definition. + */ + revision: number; + /** + * Description of change made in the revision. + */ + commitMessage: string; + /** + * Boolean if the flow definition is valid. + */ + valid: boolean; + /** + * List of error in the flow definition. + */ + errors: Array; + /** + * List of warnings in the flow definition. + */ + warnings: Array; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + webhookUrl: string; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of the Flow\'s nested resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + fetch(callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Update a FlowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + update(params: FlowContextUpdateOptions, callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Access the executions. + */ + executions(): ExecutionListInstance; + /** + * Access the revisions. + */ + revisions(): FlowRevisionListInstance; + /** + * Access the testUsers. + */ + testUsers(): FlowTestUserListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + definition: any; + status: FlowStatus; + revision: number; + commitMessage: string; + valid: boolean; + errors: any[]; + warnings: any[]; + dateCreated: Date; + dateUpdated: Date; + webhookUrl: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FlowSolution { +} +export interface FlowListInstance { + _version: V2; + _solution: FlowSolution; + _uri: string; + (sid: string): FlowContext; + get(sid: string): FlowContext; + /** + * Create a FlowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + create(params: FlowListInstanceCreateOptions, callback?: (error: Error | null, item?: FlowInstance) => any): Promise; + /** + * Streams FlowInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FlowInstance, done: (err?: Error) => void) => void): void; + each(params: FlowListInstanceEachOptions, callback?: (item: FlowInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FlowInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FlowPage) => any): Promise; + /** + * Lists FlowInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FlowInstance[]) => any): Promise; + list(params: FlowListInstanceOptions, callback?: (error: Error | null, items: FlowInstance[]) => any): Promise; + /** + * Retrieve a single page of FlowInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FlowPage) => any): Promise; + page(params: FlowListInstancePageOptions, callback?: (error: Error | null, items: FlowPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FlowListInstance(version: V2): FlowListInstance; +export declare class FlowPage extends Page { + /** + * Initialize the FlowPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: FlowSolution); + /** + * Build an instance of FlowInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FlowResource): FlowInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow.js b/node_modules/twilio/lib/rest/studio/v2/flow.js new file mode 100644 index 00000000..1e9015f9 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow.js @@ -0,0 +1,319 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FlowPage = exports.FlowListInstance = exports.FlowInstance = exports.FlowContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const execution_1 = require("./flow/execution"); +const flowRevision_1 = require("./flow/flowRevision"); +const flowTestUser_1 = require("./flow/flowTestUser"); +class FlowContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Flows/${sid}`; + } + get executions() { + this._executions = + this._executions || + (0, execution_1.ExecutionListInstance)(this._version, this._solution.sid); + return this._executions; + } + get revisions() { + this._revisions = + this._revisions || + (0, flowRevision_1.FlowRevisionListInstance)(this._version, this._solution.sid); + return this._revisions; + } + get testUsers() { + this._testUsers = + this._testUsers || + (0, flowTestUser_1.FlowTestUserListInstance)(this._version, this._solution.sid); + return this._testUsers; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FlowInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["definition"] !== undefined) + data["Definition"] = serialize.object(params["definition"]); + if (params["commitMessage"] !== undefined) + data["CommitMessage"] = params["commitMessage"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlowInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowContextImpl = FlowContextImpl; +class FlowInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.definition = payload.definition; + this.status = payload.status; + this.revision = deserialize.integer(payload.revision); + this.commitMessage = payload.commit_message; + this.valid = payload.valid; + this.errors = payload.errors; + this.warnings = payload.warnings; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.webhookUrl = payload.webhook_url; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new FlowContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a FlowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the executions. + */ + executions() { + return this._proxy.executions; + } + /** + * Access the revisions. + */ + revisions() { + return this._proxy.revisions; + } + /** + * Access the testUsers. + */ + testUsers() { + return this._proxy.testUsers; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + definition: this.definition, + status: this.status, + revision: this.revision, + commitMessage: this.commitMessage, + valid: this.valid, + errors: this.errors, + warnings: this.warnings, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + webhookUrl: this.webhookUrl, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowInstance = FlowInstance; +function FlowListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FlowContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Flows`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + if (params["definition"] === null || params["definition"] === undefined) { + throw new Error("Required parameter \"params['definition']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Status"] = params["status"]; + data["Definition"] = serialize.object(params["definition"]); + if (params["commitMessage"] !== undefined) + data["CommitMessage"] = params["commitMessage"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlowInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlowPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FlowPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FlowListInstance = FlowListInstance; +class FlowPage extends Page_1.default { + /** + * Initialize the FlowPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FlowInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FlowInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowPage = FlowPage; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/execution.d.ts b/node_modules/twilio/lib/rest/studio/v2/flow/execution.d.ts new file mode 100644 index 00000000..a07918cb --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/execution.d.ts @@ -0,0 +1,332 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { ExecutionContextListInstance } from "./execution/executionContext"; +import { ExecutionStepListInstance } from "./execution/executionStep"; +export type ExecutionStatus = "active" | "ended"; +/** + * Options to pass to update a ExecutionInstance + */ +export interface ExecutionContextUpdateOptions { + /** */ + status: ExecutionStatus; +} +/** + * Options to pass to create a ExecutionInstance + */ +export interface ExecutionListInstanceCreateOptions { + /** The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. */ + to: string; + /** The Twilio phone number to send messages or initiate calls from during the Flow\\\'s Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. */ + from: string; + /** JSON data that will be added to the Flow\\\'s context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. */ + parameters?: any; +} +/** + * Options to pass to each + */ +export interface ExecutionListInstanceEachOptions { + /** Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedFrom?: Date; + /** Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedTo?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ExecutionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ExecutionListInstanceOptions { + /** Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedFrom?: Date; + /** Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedTo?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ExecutionListInstancePageOptions { + /** Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedFrom?: Date; + /** Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ + dateCreatedTo?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ExecutionContext { + executionContext: ExecutionContextListInstance; + steps: ExecutionStepListInstance; + /** + * Remove a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Update a ExecutionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + update(params: ExecutionContextUpdateOptions, callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExecutionContextSolution { + flowSid: string; + sid: string; +} +export declare class ExecutionContextImpl implements ExecutionContext { + protected _version: V2; + protected _solution: ExecutionContextSolution; + protected _uri: string; + protected _executionContext?: ExecutionContextListInstance; + protected _steps?: ExecutionStepListInstance; + constructor(_version: V2, flowSid: string, sid: string); + get executionContext(): ExecutionContextListInstance; + get steps(): ExecutionStepListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + update(params: ExecutionContextUpdateOptions, callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExecutionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExecutionPayload extends TwilioResponsePayload { + executions: ExecutionResource[]; +} +interface ExecutionResource { + sid: string; + account_sid: string; + flow_sid: string; + contact_channel_address: string; + context: any; + status: ExecutionStatus; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ExecutionInstance { + protected _version: V2; + protected _solution: ExecutionContextSolution; + protected _context?: ExecutionContext; + constructor(_version: V2, payload: ExecutionResource, flowSid: string, sid?: string); + /** + * The unique string that we created to identify the Execution resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Execution resource. + */ + accountSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The phone number, SIP address or Client identifier that triggered the Execution. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. + */ + contactChannelAddress: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + status: ExecutionStatus; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of nested resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Update a ExecutionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + update(params: ExecutionContextUpdateOptions, callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Access the executionContext. + */ + executionContext(): ExecutionContextListInstance; + /** + * Access the steps. + */ + steps(): ExecutionStepListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + flowSid: string; + contactChannelAddress: string; + context: any; + status: ExecutionStatus; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExecutionSolution { + flowSid: string; +} +export interface ExecutionListInstance { + _version: V2; + _solution: ExecutionSolution; + _uri: string; + (sid: string): ExecutionContext; + get(sid: string): ExecutionContext; + /** + * Create a ExecutionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + create(params: ExecutionListInstanceCreateOptions, callback?: (error: Error | null, item?: ExecutionInstance) => any): Promise; + /** + * Streams ExecutionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ExecutionInstance, done: (err?: Error) => void) => void): void; + each(params: ExecutionListInstanceEachOptions, callback?: (item: ExecutionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ExecutionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ExecutionPage) => any): Promise; + /** + * Lists ExecutionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ExecutionInstance[]) => any): Promise; + list(params: ExecutionListInstanceOptions, callback?: (error: Error | null, items: ExecutionInstance[]) => any): Promise; + /** + * Retrieve a single page of ExecutionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ExecutionPage) => any): Promise; + page(params: ExecutionListInstancePageOptions, callback?: (error: Error | null, items: ExecutionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExecutionListInstance(version: V2, flowSid: string): ExecutionListInstance; +export declare class ExecutionPage extends Page { + /** + * Initialize the ExecutionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ExecutionSolution); + /** + * Build an instance of ExecutionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ExecutionResource): ExecutionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/execution.js b/node_modules/twilio/lib/rest/studio/v2/flow/execution.js new file mode 100644 index 00000000..50f50119 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/execution.js @@ -0,0 +1,296 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionPage = exports.ExecutionListInstance = exports.ExecutionInstance = exports.ExecutionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const executionContext_1 = require("./execution/executionContext"); +const executionStep_1 = require("./execution/executionStep"); +class ExecutionContextImpl { + constructor(_version, flowSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { flowSid, sid }; + this._uri = `/Flows/${flowSid}/Executions/${sid}`; + } + get executionContext() { + this._executionContext = + this._executionContext || + (0, executionContext_1.ExecutionContextListInstance)(this._version, this._solution.flowSid, this._solution.sid); + return this._executionContext; + } + get steps() { + this._steps = + this._steps || + (0, executionStep_1.ExecutionStepListInstance)(this._version, this._solution.flowSid, this._solution.sid); + return this._steps; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExecutionInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExecutionInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionContextImpl = ExecutionContextImpl; +class ExecutionInstance { + constructor(_version, payload, flowSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.flowSid = payload.flow_sid; + this.contactChannelAddress = payload.contact_channel_address; + this.context = payload.context; + this.status = payload.status; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { flowSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ExecutionContextImpl(this._version, this._solution.flowSid, this._solution.sid); + return this._context; + } + /** + * Remove a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ExecutionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the executionContext. + */ + executionContext() { + return this._proxy.executionContext; + } + /** + * Access the steps. + */ + steps() { + return this._proxy.steps; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + flowSid: this.flowSid, + contactChannelAddress: this.contactChannelAddress, + context: this.context, + status: this.status, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionInstance = ExecutionInstance; +function ExecutionListInstance(version, flowSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ExecutionContextImpl(version, flowSid, sid); + }; + instance._version = version; + instance._solution = { flowSid }; + instance._uri = `/Flows/${flowSid}/Executions`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["to"] === null || params["to"] === undefined) { + throw new Error("Required parameter \"params['to']\" missing."); + } + if (params["from"] === null || params["from"] === undefined) { + throw new Error("Required parameter \"params['from']\" missing."); + } + let data = {}; + data["To"] = params["to"]; + data["From"] = params["from"]; + if (params["parameters"] !== undefined) + data["Parameters"] = serialize.object(params["parameters"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExecutionInstance(operationVersion, payload, instance._solution.flowSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreatedFrom"] !== undefined) + data["DateCreatedFrom"] = serialize.iso8601DateTime(params["dateCreatedFrom"]); + if (params["dateCreatedTo"] !== undefined) + data["DateCreatedTo"] = serialize.iso8601DateTime(params["dateCreatedTo"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExecutionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ExecutionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExecutionListInstance = ExecutionListInstance; +class ExecutionPage extends Page_1.default { + /** + * Initialize the ExecutionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ExecutionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ExecutionInstance(this._version, payload, this._solution.flowSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionPage = ExecutionPage; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionContext.d.ts b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionContext.d.ts new file mode 100644 index 00000000..4d30105f --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionContext.d.ts @@ -0,0 +1,109 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../../V2"; +export interface ExecutionContextContext { + /** + * Fetch a ExecutionContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionContextInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExecutionContextContextSolution { + flowSid: string; + executionSid: string; +} +export declare class ExecutionContextContextImpl implements ExecutionContextContext { + protected _version: V2; + protected _solution: ExecutionContextContextSolution; + protected _uri: string; + constructor(_version: V2, flowSid: string, executionSid: string); + fetch(callback?: (error: Error | null, item?: ExecutionContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExecutionContextContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExecutionContextResource { + account_sid: string; + context: any; + flow_sid: string; + execution_sid: string; + url: string; +} +export declare class ExecutionContextInstance { + protected _version: V2; + protected _solution: ExecutionContextContextSolution; + protected _context?: ExecutionContextContext; + constructor(_version: V2, payload: ExecutionContextResource, flowSid: string, executionSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionContext resource. + */ + accountSid: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the context\'s Execution resource. + */ + executionSid: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ExecutionContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionContextInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + context: any; + flowSid: string; + executionSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExecutionContextSolution { + flowSid: string; + executionSid: string; +} +export interface ExecutionContextListInstance { + _version: V2; + _solution: ExecutionContextSolution; + _uri: string; + (): ExecutionContextContext; + get(): ExecutionContextContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExecutionContextListInstance(version: V2, flowSid: string, executionSid: string): ExecutionContextListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionContext.js b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionContext.js new file mode 100644 index 00000000..76a99e54 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionContext.js @@ -0,0 +1,123 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionContextListInstance = exports.ExecutionContextInstance = exports.ExecutionContextContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class ExecutionContextContextImpl { + constructor(_version, flowSid, executionSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + this._solution = { flowSid, executionSid }; + this._uri = `/Flows/${flowSid}/Executions/${executionSid}/Context`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExecutionContextInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.executionSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionContextContextImpl = ExecutionContextContextImpl; +class ExecutionContextInstance { + constructor(_version, payload, flowSid, executionSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.context = payload.context; + this.flowSid = payload.flow_sid; + this.executionSid = payload.execution_sid; + this.url = payload.url; + this._solution = { flowSid, executionSid }; + } + get _proxy() { + this._context = + this._context || + new ExecutionContextContextImpl(this._version, this._solution.flowSid, this._solution.executionSid); + return this._context; + } + /** + * Fetch a ExecutionContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionContextInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + context: this.context, + flowSid: this.flowSid, + executionSid: this.executionSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionContextInstance = ExecutionContextInstance; +function ExecutionContextListInstance(version, flowSid, executionSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new ExecutionContextContextImpl(version, flowSid, executionSid); + }; + instance._version = version; + instance._solution = { flowSid, executionSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExecutionContextListInstance = ExecutionContextListInstance; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep.d.ts b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep.d.ts new file mode 100644 index 00000000..32e16f0e --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep.d.ts @@ -0,0 +1,265 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +import { ExecutionStepContextListInstance } from "./executionStep/executionStepContext"; +/** + * Options to pass to each + */ +export interface ExecutionStepListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ExecutionStepInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ExecutionStepListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ExecutionStepListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ExecutionStepContext { + stepContext: ExecutionStepContextListInstance; + /** + * Fetch a ExecutionStepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionStepInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExecutionStepContextSolution { + flowSid: string; + executionSid: string; + sid: string; +} +export declare class ExecutionStepContextImpl implements ExecutionStepContext { + protected _version: V2; + protected _solution: ExecutionStepContextSolution; + protected _uri: string; + protected _stepContext?: ExecutionStepContextListInstance; + constructor(_version: V2, flowSid: string, executionSid: string, sid: string); + get stepContext(): ExecutionStepContextListInstance; + fetch(callback?: (error: Error | null, item?: ExecutionStepInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExecutionStepContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExecutionStepPayload extends TwilioResponsePayload { + steps: ExecutionStepResource[]; +} +interface ExecutionStepResource { + sid: string; + account_sid: string; + flow_sid: string; + execution_sid: string; + name: string; + context: any; + transitioned_from: string; + transitioned_to: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ExecutionStepInstance { + protected _version: V2; + protected _solution: ExecutionStepContextSolution; + protected _context?: ExecutionStepContext; + constructor(_version: V2, payload: ExecutionStepResource, flowSid: string, executionSid: string, sid?: string); + /** + * The unique string that we created to identify the ExecutionStep resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource. + */ + accountSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the Step\'s Execution resource. + */ + executionSid: string; + /** + * The event that caused the Flow to transition to the Step. + */ + name: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The Widget that preceded the Widget for the Step. + */ + transitionedFrom: string; + /** + * The Widget that will follow the Widget for the Step. + */ + transitionedTo: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ExecutionStepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionStepInstance) => any): Promise; + /** + * Access the stepContext. + */ + stepContext(): ExecutionStepContextListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + flowSid: string; + executionSid: string; + name: string; + context: any; + transitionedFrom: string; + transitionedTo: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExecutionStepSolution { + flowSid: string; + executionSid: string; +} +export interface ExecutionStepListInstance { + _version: V2; + _solution: ExecutionStepSolution; + _uri: string; + (sid: string): ExecutionStepContext; + get(sid: string): ExecutionStepContext; + /** + * Streams ExecutionStepInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionStepListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ExecutionStepInstance, done: (err?: Error) => void) => void): void; + each(params: ExecutionStepListInstanceEachOptions, callback?: (item: ExecutionStepInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ExecutionStepInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ExecutionStepPage) => any): Promise; + /** + * Lists ExecutionStepInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionStepListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ExecutionStepInstance[]) => any): Promise; + list(params: ExecutionStepListInstanceOptions, callback?: (error: Error | null, items: ExecutionStepInstance[]) => any): Promise; + /** + * Retrieve a single page of ExecutionStepInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ExecutionStepListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ExecutionStepPage) => any): Promise; + page(params: ExecutionStepListInstancePageOptions, callback?: (error: Error | null, items: ExecutionStepPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExecutionStepListInstance(version: V2, flowSid: string, executionSid: string): ExecutionStepListInstance; +export declare class ExecutionStepPage extends Page { + /** + * Initialize the ExecutionStepPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ExecutionStepSolution); + /** + * Build an instance of ExecutionStepInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ExecutionStepResource): ExecutionStepInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep.js b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep.js new file mode 100644 index 00000000..beaea528 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep.js @@ -0,0 +1,218 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionStepPage = exports.ExecutionStepListInstance = exports.ExecutionStepInstance = exports.ExecutionStepContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const executionStepContext_1 = require("./executionStep/executionStepContext"); +class ExecutionStepContextImpl { + constructor(_version, flowSid, executionSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { flowSid, executionSid, sid }; + this._uri = `/Flows/${flowSid}/Executions/${executionSid}/Steps/${sid}`; + } + get stepContext() { + this._stepContext = + this._stepContext || + (0, executionStepContext_1.ExecutionStepContextListInstance)(this._version, this._solution.flowSid, this._solution.executionSid, this._solution.sid); + return this._stepContext; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExecutionStepInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.executionSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepContextImpl = ExecutionStepContextImpl; +class ExecutionStepInstance { + constructor(_version, payload, flowSid, executionSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.flowSid = payload.flow_sid; + this.executionSid = payload.execution_sid; + this.name = payload.name; + this.context = payload.context; + this.transitionedFrom = payload.transitioned_from; + this.transitionedTo = payload.transitioned_to; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { flowSid, executionSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ExecutionStepContextImpl(this._version, this._solution.flowSid, this._solution.executionSid, this._solution.sid); + return this._context; + } + /** + * Fetch a ExecutionStepInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the stepContext. + */ + stepContext() { + return this._proxy.stepContext; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + flowSid: this.flowSid, + executionSid: this.executionSid, + name: this.name, + context: this.context, + transitionedFrom: this.transitionedFrom, + transitionedTo: this.transitionedTo, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepInstance = ExecutionStepInstance; +function ExecutionStepListInstance(version, flowSid, executionSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ExecutionStepContextImpl(version, flowSid, executionSid, sid); + }; + instance._version = version; + instance._solution = { flowSid, executionSid }; + instance._uri = `/Flows/${flowSid}/Executions/${executionSid}/Steps`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ExecutionStepPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ExecutionStepPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExecutionStepListInstance = ExecutionStepListInstance; +class ExecutionStepPage extends Page_1.default { + /** + * Initialize the ExecutionStepPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ExecutionStepInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ExecutionStepInstance(this._version, payload, this._solution.flowSid, this._solution.executionSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepPage = ExecutionStepPage; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep/executionStepContext.d.ts b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep/executionStepContext.d.ts new file mode 100644 index 00000000..de20febd --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep/executionStepContext.d.ts @@ -0,0 +1,117 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../../../V2"; +export interface ExecutionStepContextContext { + /** + * Fetch a ExecutionStepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepContextInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionStepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ExecutionStepContextContextSolution { + flowSid: string; + executionSid: string; + stepSid: string; +} +export declare class ExecutionStepContextContextImpl implements ExecutionStepContextContext { + protected _version: V2; + protected _solution: ExecutionStepContextContextSolution; + protected _uri: string; + constructor(_version: V2, flowSid: string, executionSid: string, stepSid: string); + fetch(callback?: (error: Error | null, item?: ExecutionStepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ExecutionStepContextContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ExecutionStepContextResource { + account_sid: string; + context: any; + execution_sid: string; + flow_sid: string; + step_sid: string; + url: string; +} +export declare class ExecutionStepContextInstance { + protected _version: V2; + protected _solution: ExecutionStepContextContextSolution; + protected _context?: ExecutionStepContextContext; + constructor(_version: V2, payload: ExecutionStepContextResource, flowSid: string, executionSid: string, stepSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStepContext resource. + */ + accountSid: string; + /** + * The current state of the Flow\'s Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + */ + context: any; + /** + * The SID of the context\'s Execution resource. + */ + executionSid: string; + /** + * The SID of the Flow. + */ + flowSid: string; + /** + * The SID of the Step that the context is associated with. + */ + stepSid: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a ExecutionStepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepContextInstance + */ + fetch(callback?: (error: Error | null, item?: ExecutionStepContextInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + context: any; + executionSid: string; + flowSid: string; + stepSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ExecutionStepContextSolution { + flowSid: string; + executionSid: string; + stepSid: string; +} +export interface ExecutionStepContextListInstance { + _version: V2; + _solution: ExecutionStepContextSolution; + _uri: string; + (): ExecutionStepContextContext; + get(): ExecutionStepContextContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ExecutionStepContextListInstance(version: V2, flowSid: string, executionSid: string, stepSid: string): ExecutionStepContextListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep/executionStepContext.js b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep/executionStepContext.js new file mode 100644 index 00000000..31463371 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/execution/executionStep/executionStepContext.js @@ -0,0 +1,131 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionStepContextListInstance = exports.ExecutionStepContextInstance = exports.ExecutionStepContextContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +class ExecutionStepContextContextImpl { + constructor(_version, flowSid, executionSid, stepSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(stepSid)) { + throw new Error("Parameter 'stepSid' is not valid."); + } + this._solution = { flowSid, executionSid, stepSid }; + this._uri = `/Flows/${flowSid}/Executions/${executionSid}/Steps/${stepSid}/Context`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ExecutionStepContextInstance(operationVersion, payload, instance._solution.flowSid, instance._solution.executionSid, instance._solution.stepSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepContextContextImpl = ExecutionStepContextContextImpl; +class ExecutionStepContextInstance { + constructor(_version, payload, flowSid, executionSid, stepSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.context = payload.context; + this.executionSid = payload.execution_sid; + this.flowSid = payload.flow_sid; + this.stepSid = payload.step_sid; + this.url = payload.url; + this._solution = { flowSid, executionSid, stepSid }; + } + get _proxy() { + this._context = + this._context || + new ExecutionStepContextContextImpl(this._version, this._solution.flowSid, this._solution.executionSid, this._solution.stepSid); + return this._context; + } + /** + * Fetch a ExecutionStepContextInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ExecutionStepContextInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + context: this.context, + executionSid: this.executionSid, + flowSid: this.flowSid, + stepSid: this.stepSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ExecutionStepContextInstance = ExecutionStepContextInstance; +function ExecutionStepContextListInstance(version, flowSid, executionSid, stepSid) { + if (!(0, utility_1.isValidPathParam)(flowSid)) { + throw new Error("Parameter 'flowSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(executionSid)) { + throw new Error("Parameter 'executionSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(stepSid)) { + throw new Error("Parameter 'stepSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new ExecutionStepContextContextImpl(version, flowSid, executionSid, stepSid); + }; + instance._version = version; + instance._solution = { flowSid, executionSid, stepSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ExecutionStepContextListInstance = ExecutionStepContextListInstance; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/flowRevision.d.ts b/node_modules/twilio/lib/rest/studio/v2/flow/flowRevision.d.ts new file mode 100644 index 00000000..3a0bdcc1 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/flowRevision.d.ts @@ -0,0 +1,253 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type FlowRevisionStatus = "draft" | "published"; +/** + * Options to pass to each + */ +export interface FlowRevisionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FlowRevisionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FlowRevisionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FlowRevisionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FlowRevisionContext { + /** + * Fetch a FlowRevisionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowRevisionInstance + */ + fetch(callback?: (error: Error | null, item?: FlowRevisionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FlowRevisionContextSolution { + sid: string; + revision: string; +} +export declare class FlowRevisionContextImpl implements FlowRevisionContext { + protected _version: V2; + protected _solution: FlowRevisionContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string, revision: string); + fetch(callback?: (error: Error | null, item?: FlowRevisionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FlowRevisionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FlowRevisionPayload extends TwilioResponsePayload { + revisions: FlowRevisionResource[]; +} +interface FlowRevisionResource { + sid: string; + account_sid: string; + friendly_name: string; + definition: any; + status: FlowRevisionStatus; + revision: number; + commit_message: string; + valid: boolean; + errors: Array; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class FlowRevisionInstance { + protected _version: V2; + protected _solution: FlowRevisionContextSolution; + protected _context?: FlowRevisionContext; + constructor(_version: V2, payload: FlowRevisionResource, sid: string, revision?: string); + /** + * The unique string that we created to identify the Flow resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flow resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the Flow. + */ + friendlyName: string; + /** + * JSON representation of flow definition. + */ + definition: any; + status: FlowRevisionStatus; + /** + * The latest revision number of the Flow\'s definition. + */ + revision: number; + /** + * Description of change made in the revision. + */ + commitMessage: string; + /** + * Boolean if the flow definition is valid. + */ + valid: boolean; + /** + * List of error in the flow definition. + */ + errors: Array; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a FlowRevisionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowRevisionInstance + */ + fetch(callback?: (error: Error | null, item?: FlowRevisionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + definition: any; + status: FlowRevisionStatus; + revision: number; + commitMessage: string; + valid: boolean; + errors: any[]; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FlowRevisionSolution { + sid: string; +} +export interface FlowRevisionListInstance { + _version: V2; + _solution: FlowRevisionSolution; + _uri: string; + (revision: string): FlowRevisionContext; + get(revision: string): FlowRevisionContext; + /** + * Streams FlowRevisionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowRevisionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FlowRevisionInstance, done: (err?: Error) => void) => void): void; + each(params: FlowRevisionListInstanceEachOptions, callback?: (item: FlowRevisionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FlowRevisionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FlowRevisionPage) => any): Promise; + /** + * Lists FlowRevisionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowRevisionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FlowRevisionInstance[]) => any): Promise; + list(params: FlowRevisionListInstanceOptions, callback?: (error: Error | null, items: FlowRevisionInstance[]) => any): Promise; + /** + * Retrieve a single page of FlowRevisionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FlowRevisionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FlowRevisionPage) => any): Promise; + page(params: FlowRevisionListInstancePageOptions, callback?: (error: Error | null, items: FlowRevisionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FlowRevisionListInstance(version: V2, sid: string): FlowRevisionListInstance; +export declare class FlowRevisionPage extends Page { + /** + * Initialize the FlowRevisionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: FlowRevisionSolution); + /** + * Build an instance of FlowRevisionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FlowRevisionResource): FlowRevisionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/flowRevision.js b/node_modules/twilio/lib/rest/studio/v2/flow/flowRevision.js new file mode 100644 index 00000000..51860a94 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/flowRevision.js @@ -0,0 +1,199 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FlowRevisionPage = exports.FlowRevisionListInstance = exports.FlowRevisionInstance = exports.FlowRevisionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class FlowRevisionContextImpl { + constructor(_version, sid, revision) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(revision)) { + throw new Error("Parameter 'revision' is not valid."); + } + this._solution = { sid, revision }; + this._uri = `/Flows/${sid}/Revisions/${revision}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FlowRevisionInstance(operationVersion, payload, instance._solution.sid, instance._solution.revision)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowRevisionContextImpl = FlowRevisionContextImpl; +class FlowRevisionInstance { + constructor(_version, payload, sid, revision) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.definition = payload.definition; + this.status = payload.status; + this.revision = deserialize.integer(payload.revision); + this.commitMessage = payload.commit_message; + this.valid = payload.valid; + this.errors = payload.errors; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid, revision: revision || this.revision.toString() }; + } + get _proxy() { + this._context = + this._context || + new FlowRevisionContextImpl(this._version, this._solution.sid, this._solution.revision); + return this._context; + } + /** + * Fetch a FlowRevisionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowRevisionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + definition: this.definition, + status: this.status, + revision: this.revision, + commitMessage: this.commitMessage, + valid: this.valid, + errors: this.errors, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowRevisionInstance = FlowRevisionInstance; +function FlowRevisionListInstance(version, sid) { + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = ((revision) => instance.get(revision)); + instance.get = function get(revision) { + return new FlowRevisionContextImpl(version, sid, revision); + }; + instance._version = version; + instance._solution = { sid }; + instance._uri = `/Flows/${sid}/Revisions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlowRevisionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FlowRevisionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FlowRevisionListInstance = FlowRevisionListInstance; +class FlowRevisionPage extends Page_1.default { + /** + * Initialize the FlowRevisionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FlowRevisionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FlowRevisionInstance(this._version, payload, this._solution.sid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowRevisionPage = FlowRevisionPage; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/flowTestUser.d.ts b/node_modules/twilio/lib/rest/studio/v2/flow/flowTestUser.d.ts new file mode 100644 index 00000000..bda9d389 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/flowTestUser.d.ts @@ -0,0 +1,121 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../V2"; +/** + * Options to pass to update a FlowTestUserInstance + */ +export interface FlowTestUserContextUpdateOptions { + /** List of test user identities that can test draft versions of the flow. */ + testUsers: Array; +} +export interface FlowTestUserContext { + /** + * Fetch a FlowTestUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowTestUserInstance + */ + fetch(callback?: (error: Error | null, item?: FlowTestUserInstance) => any): Promise; + /** + * Update a FlowTestUserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowTestUserInstance + */ + update(params: FlowTestUserContextUpdateOptions, callback?: (error: Error | null, item?: FlowTestUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FlowTestUserContextSolution { + sid: string; +} +export declare class FlowTestUserContextImpl implements FlowTestUserContext { + protected _version: V2; + protected _solution: FlowTestUserContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + fetch(callback?: (error: Error | null, item?: FlowTestUserInstance) => any): Promise; + update(params: FlowTestUserContextUpdateOptions, callback?: (error: Error | null, item?: FlowTestUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FlowTestUserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FlowTestUserResource { + sid: string; + test_users: Array; + url: string; +} +export declare class FlowTestUserInstance { + protected _version: V2; + protected _solution: FlowTestUserContextSolution; + protected _context?: FlowTestUserContext; + constructor(_version: V2, payload: FlowTestUserResource, sid: string); + /** + * Unique identifier of the flow. + */ + sid: string; + /** + * List of test user identities that can test draft versions of the flow. + */ + testUsers: Array; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a FlowTestUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowTestUserInstance + */ + fetch(callback?: (error: Error | null, item?: FlowTestUserInstance) => any): Promise; + /** + * Update a FlowTestUserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowTestUserInstance + */ + update(params: FlowTestUserContextUpdateOptions, callback?: (error: Error | null, item?: FlowTestUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + testUsers: string[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FlowTestUserSolution { + sid: string; +} +export interface FlowTestUserListInstance { + _version: V2; + _solution: FlowTestUserSolution; + _uri: string; + (): FlowTestUserContext; + get(): FlowTestUserContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FlowTestUserListInstance(version: V2, sid: string): FlowTestUserListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v2/flow/flowTestUser.js b/node_modules/twilio/lib/rest/studio/v2/flow/flowTestUser.js new file mode 100644 index 00000000..8bb5b73d --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flow/flowTestUser.js @@ -0,0 +1,138 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FlowTestUserListInstance = exports.FlowTestUserInstance = exports.FlowTestUserContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class FlowTestUserContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Flows/${sid}/TestUsers`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FlowTestUserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["testUsers"] === null || params["testUsers"] === undefined) { + throw new Error("Required parameter \"params['testUsers']\" missing."); + } + let data = {}; + data["TestUsers"] = serialize.map(params["testUsers"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlowTestUserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowTestUserContextImpl = FlowTestUserContextImpl; +class FlowTestUserInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.testUsers = payload.test_users; + this.url = payload.url; + this._solution = { sid }; + } + get _proxy() { + this._context = + this._context || + new FlowTestUserContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a FlowTestUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowTestUserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + testUsers: this.testUsers, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowTestUserInstance = FlowTestUserInstance; +function FlowTestUserListInstance(version, sid) { + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new FlowTestUserContextImpl(version, sid); + }; + instance._version = version; + instance._solution = { sid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FlowTestUserListInstance = FlowTestUserListInstance; diff --git a/node_modules/twilio/lib/rest/studio/v2/flowValidate.d.ts b/node_modules/twilio/lib/rest/studio/v2/flowValidate.d.ts new file mode 100644 index 00000000..10fb9612 --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flowValidate.d.ts @@ -0,0 +1,60 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +export type FlowValidateStatus = "draft" | "published"; +/** + * Options to pass to update a FlowValidateInstance + */ +export interface FlowValidateListInstanceUpdateOptions { + /** The string that you assigned to describe the Flow. */ + friendlyName: string; + /** */ + status: FlowValidateStatus; + /** JSON representation of flow definition. */ + definition: any; + /** Description of change made in the revision. */ + commitMessage?: string; +} +export interface FlowValidateSolution { +} +export interface FlowValidateListInstance { + _version: V2; + _solution: FlowValidateSolution; + _uri: string; + /** + * Update a FlowValidateInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FlowValidateInstance + */ + update(params: FlowValidateListInstanceUpdateOptions, callback?: (error: Error | null, item?: FlowValidateInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FlowValidateListInstance(version: V2): FlowValidateListInstance; +interface FlowValidateResource { + valid: boolean; +} +export declare class FlowValidateInstance { + protected _version: V2; + constructor(_version: V2, payload: FlowValidateResource); + /** + * Boolean if the flow definition is valid. + */ + valid: boolean; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + valid: boolean; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/studio/v2/flowValidate.js b/node_modules/twilio/lib/rest/studio/v2/flowValidate.js new file mode 100644 index 00000000..573ed55a --- /dev/null +++ b/node_modules/twilio/lib/rest/studio/v2/flowValidate.js @@ -0,0 +1,85 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Studio + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FlowValidateInstance = exports.FlowValidateListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function FlowValidateListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Flows/Validate`; + instance.update = function update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + if (params["definition"] === null || params["definition"] === undefined) { + throw new Error("Required parameter \"params['definition']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Status"] = params["status"]; + data["Definition"] = serialize.object(params["definition"]); + if (params["commitMessage"] !== undefined) + data["CommitMessage"] = params["commitMessage"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FlowValidateInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FlowValidateListInstance = FlowValidateListInstance; +class FlowValidateInstance { + constructor(_version, payload) { + this._version = _version; + this.valid = payload.valid; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + valid: this.valid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FlowValidateInstance = FlowValidateInstance; diff --git a/node_modules/twilio/lib/rest/supersim/V1.d.ts b/node_modules/twilio/lib/rest/supersim/V1.d.ts new file mode 100644 index 00000000..193d3ae6 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/V1.d.ts @@ -0,0 +1,55 @@ +import SupersimBase from "../SupersimBase"; +import Version from "../../base/Version"; +import { EsimProfileListInstance } from "./v1/esimProfile"; +import { FleetListInstance } from "./v1/fleet"; +import { IpCommandListInstance } from "./v1/ipCommand"; +import { NetworkListInstance } from "./v1/network"; +import { NetworkAccessProfileListInstance } from "./v1/networkAccessProfile"; +import { SettingsUpdateListInstance } from "./v1/settingsUpdate"; +import { SimListInstance } from "./v1/sim"; +import { SmsCommandListInstance } from "./v1/smsCommand"; +import { UsageRecordListInstance } from "./v1/usageRecord"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Supersim + * + * @param domain - The Twilio (Twilio.Supersim) domain + */ + constructor(domain: SupersimBase); + /** esimProfiles - { Twilio.Supersim.V1.EsimProfileListInstance } resource */ + protected _esimProfiles?: EsimProfileListInstance; + /** fleets - { Twilio.Supersim.V1.FleetListInstance } resource */ + protected _fleets?: FleetListInstance; + /** ipCommands - { Twilio.Supersim.V1.IpCommandListInstance } resource */ + protected _ipCommands?: IpCommandListInstance; + /** networks - { Twilio.Supersim.V1.NetworkListInstance } resource */ + protected _networks?: NetworkListInstance; + /** networkAccessProfiles - { Twilio.Supersim.V1.NetworkAccessProfileListInstance } resource */ + protected _networkAccessProfiles?: NetworkAccessProfileListInstance; + /** settingsUpdates - { Twilio.Supersim.V1.SettingsUpdateListInstance } resource */ + protected _settingsUpdates?: SettingsUpdateListInstance; + /** sims - { Twilio.Supersim.V1.SimListInstance } resource */ + protected _sims?: SimListInstance; + /** smsCommands - { Twilio.Supersim.V1.SmsCommandListInstance } resource */ + protected _smsCommands?: SmsCommandListInstance; + /** usageRecords - { Twilio.Supersim.V1.UsageRecordListInstance } resource */ + protected _usageRecords?: UsageRecordListInstance; + /** Getter for esimProfiles resource */ + get esimProfiles(): EsimProfileListInstance; + /** Getter for fleets resource */ + get fleets(): FleetListInstance; + /** Getter for ipCommands resource */ + get ipCommands(): IpCommandListInstance; + /** Getter for networks resource */ + get networks(): NetworkListInstance; + /** Getter for networkAccessProfiles resource */ + get networkAccessProfiles(): NetworkAccessProfileListInstance; + /** Getter for settingsUpdates resource */ + get settingsUpdates(): SettingsUpdateListInstance; + /** Getter for sims resource */ + get sims(): SimListInstance; + /** Getter for smsCommands resource */ + get smsCommands(): SmsCommandListInstance; + /** Getter for usageRecords resource */ + get usageRecords(): UsageRecordListInstance; +} diff --git a/node_modules/twilio/lib/rest/supersim/V1.js b/node_modules/twilio/lib/rest/supersim/V1.js new file mode 100644 index 00000000..4f841f37 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/V1.js @@ -0,0 +1,86 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const esimProfile_1 = require("./v1/esimProfile"); +const fleet_1 = require("./v1/fleet"); +const ipCommand_1 = require("./v1/ipCommand"); +const network_1 = require("./v1/network"); +const networkAccessProfile_1 = require("./v1/networkAccessProfile"); +const settingsUpdate_1 = require("./v1/settingsUpdate"); +const sim_1 = require("./v1/sim"); +const smsCommand_1 = require("./v1/smsCommand"); +const usageRecord_1 = require("./v1/usageRecord"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Supersim + * + * @param domain - The Twilio (Twilio.Supersim) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for esimProfiles resource */ + get esimProfiles() { + this._esimProfiles = this._esimProfiles || (0, esimProfile_1.EsimProfileListInstance)(this); + return this._esimProfiles; + } + /** Getter for fleets resource */ + get fleets() { + this._fleets = this._fleets || (0, fleet_1.FleetListInstance)(this); + return this._fleets; + } + /** Getter for ipCommands resource */ + get ipCommands() { + this._ipCommands = this._ipCommands || (0, ipCommand_1.IpCommandListInstance)(this); + return this._ipCommands; + } + /** Getter for networks resource */ + get networks() { + this._networks = this._networks || (0, network_1.NetworkListInstance)(this); + return this._networks; + } + /** Getter for networkAccessProfiles resource */ + get networkAccessProfiles() { + this._networkAccessProfiles = + this._networkAccessProfiles || (0, networkAccessProfile_1.NetworkAccessProfileListInstance)(this); + return this._networkAccessProfiles; + } + /** Getter for settingsUpdates resource */ + get settingsUpdates() { + this._settingsUpdates = + this._settingsUpdates || (0, settingsUpdate_1.SettingsUpdateListInstance)(this); + return this._settingsUpdates; + } + /** Getter for sims resource */ + get sims() { + this._sims = this._sims || (0, sim_1.SimListInstance)(this); + return this._sims; + } + /** Getter for smsCommands resource */ + get smsCommands() { + this._smsCommands = this._smsCommands || (0, smsCommand_1.SmsCommandListInstance)(this); + return this._smsCommands; + } + /** Getter for usageRecords resource */ + get usageRecords() { + this._usageRecords = this._usageRecords || (0, usageRecord_1.UsageRecordListInstance)(this); + return this._usageRecords; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/supersim/v1/esimProfile.d.ts b/node_modules/twilio/lib/rest/supersim/v1/esimProfile.d.ts new file mode 100644 index 00000000..580cfc23 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/esimProfile.d.ts @@ -0,0 +1,311 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type EsimProfileStatus = "new" | "reserving" | "available" | "downloaded" | "installed" | "failed"; +/** + * Options to pass to create a EsimProfileInstance + */ +export interface EsimProfileListInstanceCreateOptions { + /** The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. */ + callbackUrl?: string; + /** The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. */ + callbackMethod?: string; + /** When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. */ + generateMatchingId?: boolean; + /** Identifier of the eUICC that will claim the eSIM Profile. */ + eid?: string; +} +/** + * Options to pass to each + */ +export interface EsimProfileListInstanceEachOptions { + /** List the eSIM Profiles that have been associated with an EId. */ + eid?: string; + /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ + simSid?: string; + /** List the eSIM Profiles that are in a given status. */ + status?: EsimProfileStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EsimProfileInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EsimProfileListInstanceOptions { + /** List the eSIM Profiles that have been associated with an EId. */ + eid?: string; + /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ + simSid?: string; + /** List the eSIM Profiles that are in a given status. */ + status?: EsimProfileStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EsimProfileListInstancePageOptions { + /** List the eSIM Profiles that have been associated with an EId. */ + eid?: string; + /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ + simSid?: string; + /** List the eSIM Profiles that are in a given status. */ + status?: EsimProfileStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EsimProfileContext { + /** + * Fetch a EsimProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EsimProfileInstance + */ + fetch(callback?: (error: Error | null, item?: EsimProfileInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EsimProfileContextSolution { + sid: string; +} +export declare class EsimProfileContextImpl implements EsimProfileContext { + protected _version: V1; + protected _solution: EsimProfileContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: EsimProfileInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EsimProfileContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EsimProfilePayload extends TwilioResponsePayload { + esim_profiles: EsimProfileResource[]; +} +interface EsimProfileResource { + sid: string; + account_sid: string; + iccid: string; + sim_sid: string; + status: EsimProfileStatus; + eid: string; + smdp_plus_address: string; + matching_id: string; + activation_code: string; + error_code: string; + error_message: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class EsimProfileInstance { + protected _version: V1; + protected _solution: EsimProfileContextSolution; + protected _context?: EsimProfileContext; + constructor(_version: V1, payload: EsimProfileResource, sid?: string); + /** + * The unique string that we created to identify the eSIM Profile resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the eSIM Profile resource belongs. + */ + accountSid: string; + /** + * The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with the Sim resource. + */ + iccid: string; + /** + * The SID of the [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource that this eSIM Profile controls. + */ + simSid: string; + status: EsimProfileStatus; + /** + * Identifier of the eUICC that can claim the eSIM Profile. + */ + eid: string; + /** + * Address of the SM-DP+ server from which the Profile will be downloaded. The URL will appear once the eSIM Profile reaches the status `available`. + */ + smdpPlusAddress: string; + /** + * Unique identifier of the eSIM profile that can be used to identify and download the eSIM profile from the SM-DP+ server. Populated if `generate_matching_id` is set to `true` when creating the eSIM profile reservation. + */ + matchingId: string; + /** + * Combined machine-readable activation code for acquiring an eSIM Profile with the Activation Code download method. Can be used in a QR code to download an eSIM profile. + */ + activationCode: string; + /** + * Code indicating the failure if the download of the SIM Profile failed and the eSIM Profile is in `failed` state. + */ + errorCode: string; + /** + * Error message describing the failure if the download of the SIM Profile failed and the eSIM Profile is in `failed` state. + */ + errorMessage: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the eSIM Profile resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a EsimProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EsimProfileInstance + */ + fetch(callback?: (error: Error | null, item?: EsimProfileInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + iccid: string; + simSid: string; + status: EsimProfileStatus; + eid: string; + smdpPlusAddress: string; + matchingId: string; + activationCode: string; + errorCode: string; + errorMessage: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EsimProfileSolution { +} +export interface EsimProfileListInstance { + _version: V1; + _solution: EsimProfileSolution; + _uri: string; + (sid: string): EsimProfileContext; + get(sid: string): EsimProfileContext; + /** + * Create a EsimProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EsimProfileInstance + */ + create(callback?: (error: Error | null, item?: EsimProfileInstance) => any): Promise; + /** + * Create a EsimProfileInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EsimProfileInstance + */ + create(params: EsimProfileListInstanceCreateOptions, callback?: (error: Error | null, item?: EsimProfileInstance) => any): Promise; + /** + * Streams EsimProfileInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EsimProfileListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EsimProfileInstance, done: (err?: Error) => void) => void): void; + each(params: EsimProfileListInstanceEachOptions, callback?: (item: EsimProfileInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EsimProfileInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EsimProfilePage) => any): Promise; + /** + * Lists EsimProfileInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EsimProfileListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EsimProfileInstance[]) => any): Promise; + list(params: EsimProfileListInstanceOptions, callback?: (error: Error | null, items: EsimProfileInstance[]) => any): Promise; + /** + * Retrieve a single page of EsimProfileInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EsimProfileListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EsimProfilePage) => any): Promise; + page(params: EsimProfileListInstancePageOptions, callback?: (error: Error | null, items: EsimProfilePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EsimProfileListInstance(version: V1): EsimProfileListInstance; +export declare class EsimProfilePage extends Page { + /** + * Initialize the EsimProfilePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EsimProfileSolution); + /** + * Build an instance of EsimProfileInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EsimProfileResource): EsimProfileInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/esimProfile.js b/node_modules/twilio/lib/rest/supersim/v1/esimProfile.js new file mode 100644 index 00000000..9afcf4fb --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/esimProfile.js @@ -0,0 +1,232 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EsimProfilePage = exports.EsimProfileListInstance = exports.EsimProfileInstance = exports.EsimProfileContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class EsimProfileContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/ESimProfiles/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EsimProfileInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EsimProfileContextImpl = EsimProfileContextImpl; +class EsimProfileInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.iccid = payload.iccid; + this.simSid = payload.sim_sid; + this.status = payload.status; + this.eid = payload.eid; + this.smdpPlusAddress = payload.smdp_plus_address; + this.matchingId = payload.matching_id; + this.activationCode = payload.activation_code; + this.errorCode = payload.error_code; + this.errorMessage = payload.error_message; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EsimProfileContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a EsimProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EsimProfileInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + iccid: this.iccid, + simSid: this.simSid, + status: this.status, + eid: this.eid, + smdpPlusAddress: this.smdpPlusAddress, + matchingId: this.matchingId, + activationCode: this.activationCode, + errorCode: this.errorCode, + errorMessage: this.errorMessage, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EsimProfileInstance = EsimProfileInstance; +function EsimProfileListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EsimProfileContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/ESimProfiles`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["generateMatchingId"] !== undefined) + data["GenerateMatchingId"] = serialize.bool(params["generateMatchingId"]); + if (params["eid"] !== undefined) + data["Eid"] = params["eid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EsimProfileInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["eid"] !== undefined) + data["Eid"] = params["eid"]; + if (params["simSid"] !== undefined) + data["SimSid"] = params["simSid"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EsimProfilePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EsimProfilePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EsimProfileListInstance = EsimProfileListInstance; +class EsimProfilePage extends Page_1.default { + /** + * Initialize the EsimProfilePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EsimProfileInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EsimProfileInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EsimProfilePage = EsimProfilePage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/fleet.d.ts b/node_modules/twilio/lib/rest/supersim/v1/fleet.d.ts new file mode 100644 index 00000000..32e4ca81 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/fleet.d.ts @@ -0,0 +1,361 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type FleetDataMetering = "payg"; +/** + * Options to pass to update a FleetInstance + */ +export interface FleetContextUpdateOptions { + /** An application-defined string that uniquely identifies the resource. It can be used in place of the resource\\\'s `sid` in the URL to address the resource. */ + uniqueName?: string; + /** The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet\\\'s SIMs can connect to. */ + networkAccessProfile?: string; + /** The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. */ + ipCommandsUrl?: string; + /** A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. */ + ipCommandsMethod?: string; + /** The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. */ + smsCommandsUrl?: string; + /** A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. */ + smsCommandsMethod?: string; + /** The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). */ + dataLimit?: number; +} +/** + * Options to pass to create a FleetInstance + */ +export interface FleetListInstanceCreateOptions { + /** The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet\\\'s SIMs can connect to. */ + networkAccessProfile: string; + /** An application-defined string that uniquely identifies the resource. It can be used in place of the resource\\\'s `sid` in the URL to address the resource. */ + uniqueName?: string; + /** Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. */ + dataEnabled?: boolean; + /** The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). */ + dataLimit?: number; + /** The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. */ + ipCommandsUrl?: string; + /** A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. */ + ipCommandsMethod?: string; + /** Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. */ + smsCommandsEnabled?: boolean; + /** The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. */ + smsCommandsUrl?: string; + /** A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. */ + smsCommandsMethod?: string; +} +/** + * Options to pass to each + */ +export interface FleetListInstanceEachOptions { + /** The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet\'s SIMs can connect to. */ + networkAccessProfile?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FleetInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FleetListInstanceOptions { + /** The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet\'s SIMs can connect to. */ + networkAccessProfile?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FleetListInstancePageOptions { + /** The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet\'s SIMs can connect to. */ + networkAccessProfile?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FleetContext { + /** + * Fetch a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Update a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + update(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Update a FleetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + update(params: FleetContextUpdateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FleetContextSolution { + sid: string; +} +export declare class FleetContextImpl implements FleetContext { + protected _version: V1; + protected _solution: FleetContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + update(params?: FleetContextUpdateOptions | ((error: Error | null, item?: FleetInstance) => any), callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FleetContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FleetPayload extends TwilioResponsePayload { + fleets: FleetResource[]; +} +interface FleetResource { + account_sid: string; + sid: string; + unique_name: string; + date_created: Date; + date_updated: Date; + url: string; + data_enabled: boolean; + data_limit: number; + data_metering: FleetDataMetering; + sms_commands_enabled: boolean; + sms_commands_url: string; + sms_commands_method: string; + network_access_profile_sid: string; + ip_commands_url: string; + ip_commands_method: string; +} +export declare class FleetInstance { + protected _version: V1; + protected _solution: FleetContextSolution; + protected _context?: FleetContext; + constructor(_version: V1, payload: FleetResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Fleet resource. + */ + accountSid: string; + /** + * The unique string that we created to identify the Fleet resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Fleet resource. + */ + url: string; + /** + * Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. + */ + dataEnabled: boolean; + /** + * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 250MB. + */ + dataLimit: number; + dataMetering: FleetDataMetering; + /** + * Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `false`. + */ + smsCommandsEnabled: boolean; + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + */ + smsCommandsUrl: string; + /** + * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + */ + smsCommandsMethod: string; + /** + * The SID of the Network Access Profile that controls which cellular networks the Fleet\'s SIMs can connect to. + */ + networkAccessProfileSid: string; + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + */ + ipCommandsUrl: string; + /** + * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + */ + ipCommandsMethod: string; + private get _proxy(); + /** + * Fetch a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Update a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + update(callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Update a FleetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + update(params: FleetContextUpdateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + uniqueName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + dataEnabled: boolean; + dataLimit: number; + dataMetering: "payg"; + smsCommandsEnabled: boolean; + smsCommandsUrl: string; + smsCommandsMethod: string; + networkAccessProfileSid: string; + ipCommandsUrl: string; + ipCommandsMethod: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FleetSolution { +} +export interface FleetListInstance { + _version: V1; + _solution: FleetSolution; + _uri: string; + (sid: string): FleetContext; + get(sid: string): FleetContext; + /** + * Create a FleetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + create(params: FleetListInstanceCreateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise; + /** + * Streams FleetInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FleetListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FleetInstance, done: (err?: Error) => void) => void): void; + each(params: FleetListInstanceEachOptions, callback?: (item: FleetInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FleetInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FleetPage) => any): Promise; + /** + * Lists FleetInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FleetListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FleetInstance[]) => any): Promise; + list(params: FleetListInstanceOptions, callback?: (error: Error | null, items: FleetInstance[]) => any): Promise; + /** + * Retrieve a single page of FleetInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FleetListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FleetPage) => any): Promise; + page(params: FleetListInstancePageOptions, callback?: (error: Error | null, items: FleetPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FleetListInstance(version: V1): FleetListInstance; +export declare class FleetPage extends Page { + /** + * Initialize the FleetPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: FleetSolution); + /** + * Build an instance of FleetInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FleetResource): FleetInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/fleet.js b/node_modules/twilio/lib/rest/supersim/v1/fleet.js new file mode 100644 index 00000000..dace8525 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/fleet.js @@ -0,0 +1,277 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FleetPage = exports.FleetListInstance = exports.FleetInstance = exports.FleetContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class FleetContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Fleets/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["networkAccessProfile"] !== undefined) + data["NetworkAccessProfile"] = params["networkAccessProfile"]; + if (params["ipCommandsUrl"] !== undefined) + data["IpCommandsUrl"] = params["ipCommandsUrl"]; + if (params["ipCommandsMethod"] !== undefined) + data["IpCommandsMethod"] = params["ipCommandsMethod"]; + if (params["smsCommandsUrl"] !== undefined) + data["SmsCommandsUrl"] = params["smsCommandsUrl"]; + if (params["smsCommandsMethod"] !== undefined) + data["SmsCommandsMethod"] = params["smsCommandsMethod"]; + if (params["dataLimit"] !== undefined) + data["DataLimit"] = params["dataLimit"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FleetContextImpl = FleetContextImpl; +class FleetInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.dataEnabled = payload.data_enabled; + this.dataLimit = deserialize.integer(payload.data_limit); + this.dataMetering = payload.data_metering; + this.smsCommandsEnabled = payload.sms_commands_enabled; + this.smsCommandsUrl = payload.sms_commands_url; + this.smsCommandsMethod = payload.sms_commands_method; + this.networkAccessProfileSid = payload.network_access_profile_sid; + this.ipCommandsUrl = payload.ip_commands_url; + this.ipCommandsMethod = payload.ip_commands_method; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new FleetContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a FleetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FleetInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + uniqueName: this.uniqueName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + dataEnabled: this.dataEnabled, + dataLimit: this.dataLimit, + dataMetering: this.dataMetering, + smsCommandsEnabled: this.smsCommandsEnabled, + smsCommandsUrl: this.smsCommandsUrl, + smsCommandsMethod: this.smsCommandsMethod, + networkAccessProfileSid: this.networkAccessProfileSid, + ipCommandsUrl: this.ipCommandsUrl, + ipCommandsMethod: this.ipCommandsMethod, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FleetInstance = FleetInstance; +function FleetListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FleetContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Fleets`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["networkAccessProfile"] === null || + params["networkAccessProfile"] === undefined) { + throw new Error("Required parameter \"params['networkAccessProfile']\" missing."); + } + let data = {}; + data["NetworkAccessProfile"] = params["networkAccessProfile"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["dataEnabled"] !== undefined) + data["DataEnabled"] = serialize.bool(params["dataEnabled"]); + if (params["dataLimit"] !== undefined) + data["DataLimit"] = params["dataLimit"]; + if (params["ipCommandsUrl"] !== undefined) + data["IpCommandsUrl"] = params["ipCommandsUrl"]; + if (params["ipCommandsMethod"] !== undefined) + data["IpCommandsMethod"] = params["ipCommandsMethod"]; + if (params["smsCommandsEnabled"] !== undefined) + data["SmsCommandsEnabled"] = serialize.bool(params["smsCommandsEnabled"]); + if (params["smsCommandsUrl"] !== undefined) + data["SmsCommandsUrl"] = params["smsCommandsUrl"]; + if (params["smsCommandsMethod"] !== undefined) + data["SmsCommandsMethod"] = params["smsCommandsMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["networkAccessProfile"] !== undefined) + data["NetworkAccessProfile"] = params["networkAccessProfile"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FleetPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FleetPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FleetListInstance = FleetListInstance; +class FleetPage extends Page_1.default { + /** + * Initialize the FleetPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FleetInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FleetInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FleetPage = FleetPage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/ipCommand.d.ts b/node_modules/twilio/lib/rest/supersim/v1/ipCommand.d.ts new file mode 100644 index 00000000..5fb2c42b --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/ipCommand.d.ts @@ -0,0 +1,303 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type IpCommandDirection = "to_sim" | "from_sim"; +export type IpCommandPayloadType = "text" | "binary"; +export type IpCommandStatus = "queued" | "sent" | "received" | "failed"; +/** + * Options to pass to create a IpCommandInstance + */ +export interface IpCommandListInstanceCreateOptions { + /** The `sid` or `unique_name` of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the IP Command to. */ + sim: string; + /** The data that will be sent to the device. The payload cannot exceed 1300 bytes. If the PayloadType is set to text, the payload is encoded in UTF-8. If PayloadType is set to binary, the payload is encoded in Base64. */ + payload: string; + /** The device port to which the IP Command will be sent. */ + devicePort: number; + /** */ + payloadType?: IpCommandPayloadType; + /** The URL we should call using the `callback_method` after we have sent the IP Command. */ + callbackUrl?: string; + /** The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. */ + callbackMethod?: string; +} +/** + * Options to pass to each + */ +export interface IpCommandListInstanceEachOptions { + /** The SID or unique name of the Sim resource that IP Command was sent to or from. */ + sim?: string; + /** The ICCID of the Sim resource that IP Command was sent to or from. */ + simIccid?: string; + /** The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. */ + status?: IpCommandStatus; + /** The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ + direction?: IpCommandDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: IpCommandInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface IpCommandListInstanceOptions { + /** The SID or unique name of the Sim resource that IP Command was sent to or from. */ + sim?: string; + /** The ICCID of the Sim resource that IP Command was sent to or from. */ + simIccid?: string; + /** The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. */ + status?: IpCommandStatus; + /** The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ + direction?: IpCommandDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface IpCommandListInstancePageOptions { + /** The SID or unique name of the Sim resource that IP Command was sent to or from. */ + sim?: string; + /** The ICCID of the Sim resource that IP Command was sent to or from. */ + simIccid?: string; + /** The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. */ + status?: IpCommandStatus; + /** The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ + direction?: IpCommandDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface IpCommandContext { + /** + * Fetch a IpCommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpCommandInstance + */ + fetch(callback?: (error: Error | null, item?: IpCommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface IpCommandContextSolution { + sid: string; +} +export declare class IpCommandContextImpl implements IpCommandContext { + protected _version: V1; + protected _solution: IpCommandContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: IpCommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): IpCommandContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface IpCommandPayload extends TwilioResponsePayload { + ip_commands: IpCommandResource[]; +} +interface IpCommandResource { + sid: string; + account_sid: string; + sim_sid: string; + sim_iccid: string; + status: IpCommandStatus; + direction: IpCommandDirection; + device_ip: string; + device_port: number; + payload_type: IpCommandPayloadType; + payload: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class IpCommandInstance { + protected _version: V1; + protected _solution: IpCommandContextSolution; + protected _context?: IpCommandContext; + constructor(_version: V1, payload: IpCommandResource, sid?: string); + /** + * The unique string that we created to identify the IP Command resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IP Command resource. + */ + accountSid: string; + /** + * The SID of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) that this IP Command was sent to or from. + */ + simSid: string; + /** + * The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) that this IP Command was sent to or from. + */ + simIccid: string; + status: IpCommandStatus; + direction: IpCommandDirection; + /** + * The IP address of the device that the IP Command was sent to or received from. For an IP Command sent to a Super SIM, `device_ip` starts out as `null`, and once the IP Command is “sent”, the `device_ip` will be filled out. An IP Command sent from a Super SIM have its `device_ip` always set. + */ + deviceIp: string; + /** + * For an IP Command sent to a Super SIM, it would be the destination port of the IP message. For an IP Command sent from a Super SIM, it would be the source port of the IP message. + */ + devicePort: number; + payloadType: IpCommandPayloadType; + /** + * The payload that is carried in the IP/UDP message. The payload can be encoded in either text or binary format. For text payload, UTF-8 encoding must be used. For an IP Command sent to a Super SIM, the payload is appended to the IP/UDP message “as is”. The payload should not exceed 1300 bytes. For an IP Command sent from a Super SIM, the payload from the received IP/UDP message is extracted and sent in binary encoding. For an IP Command sent from a Super SIM, the payload should not exceed 1300 bytes. If it is larger than 1300 bytes, there might be fragmentation on the upstream and the message may appear truncated. + */ + payload: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the IP Command resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a IpCommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpCommandInstance + */ + fetch(callback?: (error: Error | null, item?: IpCommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + simSid: string; + simIccid: string; + status: IpCommandStatus; + direction: IpCommandDirection; + deviceIp: string; + devicePort: number; + payloadType: IpCommandPayloadType; + payload: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface IpCommandSolution { +} +export interface IpCommandListInstance { + _version: V1; + _solution: IpCommandSolution; + _uri: string; + (sid: string): IpCommandContext; + get(sid: string): IpCommandContext; + /** + * Create a IpCommandInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpCommandInstance + */ + create(params: IpCommandListInstanceCreateOptions, callback?: (error: Error | null, item?: IpCommandInstance) => any): Promise; + /** + * Streams IpCommandInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpCommandListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: IpCommandInstance, done: (err?: Error) => void) => void): void; + each(params: IpCommandListInstanceEachOptions, callback?: (item: IpCommandInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of IpCommandInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: IpCommandPage) => any): Promise; + /** + * Lists IpCommandInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpCommandListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: IpCommandInstance[]) => any): Promise; + list(params: IpCommandListInstanceOptions, callback?: (error: Error | null, items: IpCommandInstance[]) => any): Promise; + /** + * Retrieve a single page of IpCommandInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpCommandListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: IpCommandPage) => any): Promise; + page(params: IpCommandListInstancePageOptions, callback?: (error: Error | null, items: IpCommandPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function IpCommandListInstance(version: V1): IpCommandListInstance; +export declare class IpCommandPage extends Page { + /** + * Initialize the IpCommandPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: IpCommandSolution); + /** + * Build an instance of IpCommandInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: IpCommandResource): IpCommandInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/ipCommand.js b/node_modules/twilio/lib/rest/supersim/v1/ipCommand.js new file mode 100644 index 00000000..1daedfd3 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/ipCommand.js @@ -0,0 +1,238 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IpCommandPage = exports.IpCommandListInstance = exports.IpCommandInstance = exports.IpCommandContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class IpCommandContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/IpCommands/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new IpCommandInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpCommandContextImpl = IpCommandContextImpl; +class IpCommandInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.simSid = payload.sim_sid; + this.simIccid = payload.sim_iccid; + this.status = payload.status; + this.direction = payload.direction; + this.deviceIp = payload.device_ip; + this.devicePort = deserialize.integer(payload.device_port); + this.payloadType = payload.payload_type; + this.payload = payload.payload; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new IpCommandContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a IpCommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpCommandInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + simSid: this.simSid, + simIccid: this.simIccid, + status: this.status, + direction: this.direction, + deviceIp: this.deviceIp, + devicePort: this.devicePort, + payloadType: this.payloadType, + payload: this.payload, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpCommandInstance = IpCommandInstance; +function IpCommandListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new IpCommandContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/IpCommands`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["sim"] === null || params["sim"] === undefined) { + throw new Error("Required parameter \"params['sim']\" missing."); + } + if (params["payload"] === null || params["payload"] === undefined) { + throw new Error("Required parameter \"params['payload']\" missing."); + } + if (params["devicePort"] === null || params["devicePort"] === undefined) { + throw new Error("Required parameter \"params['devicePort']\" missing."); + } + let data = {}; + data["Sim"] = params["sim"]; + data["Payload"] = params["payload"]; + data["DevicePort"] = params["devicePort"]; + if (params["payloadType"] !== undefined) + data["PayloadType"] = params["payloadType"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpCommandInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["sim"] !== undefined) + data["Sim"] = params["sim"]; + if (params["simIccid"] !== undefined) + data["SimIccid"] = params["simIccid"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["direction"] !== undefined) + data["Direction"] = params["direction"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpCommandPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new IpCommandPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.IpCommandListInstance = IpCommandListInstance; +class IpCommandPage extends Page_1.default { + /** + * Initialize the IpCommandPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of IpCommandInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new IpCommandInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpCommandPage = IpCommandPage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/network.d.ts b/node_modules/twilio/lib/rest/supersim/v1/network.d.ts new file mode 100644 index 00000000..b3e6bda6 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/network.d.ts @@ -0,0 +1,229 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface NetworkListInstanceEachOptions { + /** The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. */ + isoCountry?: string; + /** The \'mobile country code\' of a country. Network resources with this `mcc` in their `identifiers` will be read. */ + mcc?: string; + /** The \'mobile network code\' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. */ + mnc?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: NetworkInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface NetworkListInstanceOptions { + /** The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. */ + isoCountry?: string; + /** The \'mobile country code\' of a country. Network resources with this `mcc` in their `identifiers` will be read. */ + mcc?: string; + /** The \'mobile network code\' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. */ + mnc?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface NetworkListInstancePageOptions { + /** The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. */ + isoCountry?: string; + /** The \'mobile country code\' of a country. Network resources with this `mcc` in their `identifiers` will be read. */ + mcc?: string; + /** The \'mobile network code\' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. */ + mnc?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface NetworkContext { + /** + * Fetch a NetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkInstance + */ + fetch(callback?: (error: Error | null, item?: NetworkInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NetworkContextSolution { + sid: string; +} +export declare class NetworkContextImpl implements NetworkContext { + protected _version: V1; + protected _solution: NetworkContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: NetworkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NetworkContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NetworkPayload extends TwilioResponsePayload { + networks: NetworkResource[]; +} +interface NetworkResource { + sid: string; + friendly_name: string; + url: string; + iso_country: string; + identifiers: Array; +} +export declare class NetworkInstance { + protected _version: V1; + protected _solution: NetworkContextSolution; + protected _context?: NetworkContext; + constructor(_version: V1, payload: NetworkResource, sid?: string); + /** + * The unique string that we created to identify the Network resource. + */ + sid: string; + /** + * A human readable identifier of this resource. + */ + friendlyName: string; + /** + * The absolute URL of the Network resource. + */ + url: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resource. + */ + isoCountry: string; + /** + * Array of objects identifying the [MCC-MNCs](https://en.wikipedia.org/wiki/Mobile_country_code) that are included in the Network resource. + */ + identifiers: Array; + private get _proxy(); + /** + * Fetch a NetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkInstance + */ + fetch(callback?: (error: Error | null, item?: NetworkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + url: string; + isoCountry: string; + identifiers: any[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NetworkSolution { +} +export interface NetworkListInstance { + _version: V1; + _solution: NetworkSolution; + _uri: string; + (sid: string): NetworkContext; + get(sid: string): NetworkContext; + /** + * Streams NetworkInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: NetworkInstance, done: (err?: Error) => void) => void): void; + each(params: NetworkListInstanceEachOptions, callback?: (item: NetworkInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of NetworkInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: NetworkPage) => any): Promise; + /** + * Lists NetworkInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: NetworkInstance[]) => any): Promise; + list(params: NetworkListInstanceOptions, callback?: (error: Error | null, items: NetworkInstance[]) => any): Promise; + /** + * Retrieve a single page of NetworkInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: NetworkPage) => any): Promise; + page(params: NetworkListInstancePageOptions, callback?: (error: Error | null, items: NetworkPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NetworkListInstance(version: V1): NetworkListInstance; +export declare class NetworkPage extends Page { + /** + * Initialize the NetworkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: NetworkSolution); + /** + * Build an instance of NetworkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: NetworkResource): NetworkInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/network.js b/node_modules/twilio/lib/rest/supersim/v1/network.js new file mode 100644 index 00000000..80fcf62d --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/network.js @@ -0,0 +1,185 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NetworkPage = exports.NetworkListInstance = exports.NetworkInstance = exports.NetworkContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class NetworkContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Networks/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new NetworkInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkContextImpl = NetworkContextImpl; +class NetworkInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.url = payload.url; + this.isoCountry = payload.iso_country; + this.identifiers = payload.identifiers; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new NetworkContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a NetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + url: this.url, + isoCountry: this.isoCountry, + identifiers: this.identifiers, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkInstance = NetworkInstance; +function NetworkListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new NetworkContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Networks`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["isoCountry"] !== undefined) + data["IsoCountry"] = params["isoCountry"]; + if (params["mcc"] !== undefined) + data["Mcc"] = params["mcc"]; + if (params["mnc"] !== undefined) + data["Mnc"] = params["mnc"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NetworkPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new NetworkPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NetworkListInstance = NetworkListInstance; +class NetworkPage extends Page_1.default { + /** + * Initialize the NetworkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of NetworkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new NetworkInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkPage = NetworkPage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile.d.ts b/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile.d.ts new file mode 100644 index 00000000..ea8ea4ad --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile.d.ts @@ -0,0 +1,296 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { NetworkAccessProfileNetworkListInstance } from "./networkAccessProfile/networkAccessProfileNetwork"; +/** + * Options to pass to update a NetworkAccessProfileInstance + */ +export interface NetworkAccessProfileContextUpdateOptions { + /** The new unique name of the Network Access Profile. */ + uniqueName?: string; +} +/** + * Options to pass to create a NetworkAccessProfileInstance + */ +export interface NetworkAccessProfileListInstanceCreateOptions { + /** An application-defined string that uniquely identifies the resource. It can be used in place of the resource\\\'s `sid` in the URL to address the resource. */ + uniqueName?: string; + /** List of Network SIDs that this Network Access Profile will allow connections to. */ + networks?: Array; +} +/** + * Options to pass to each + */ +export interface NetworkAccessProfileListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: NetworkAccessProfileInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface NetworkAccessProfileListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface NetworkAccessProfileListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface NetworkAccessProfileContext { + networks: NetworkAccessProfileNetworkListInstance; + /** + * Fetch a NetworkAccessProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + fetch(callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Update a NetworkAccessProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + update(callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Update a NetworkAccessProfileInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + update(params: NetworkAccessProfileContextUpdateOptions, callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NetworkAccessProfileContextSolution { + sid: string; +} +export declare class NetworkAccessProfileContextImpl implements NetworkAccessProfileContext { + protected _version: V1; + protected _solution: NetworkAccessProfileContextSolution; + protected _uri: string; + protected _networks?: NetworkAccessProfileNetworkListInstance; + constructor(_version: V1, sid: string); + get networks(): NetworkAccessProfileNetworkListInstance; + fetch(callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + update(params?: NetworkAccessProfileContextUpdateOptions | ((error: Error | null, item?: NetworkAccessProfileInstance) => any), callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NetworkAccessProfileContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NetworkAccessProfilePayload extends TwilioResponsePayload { + network_access_profiles: NetworkAccessProfileResource[]; +} +interface NetworkAccessProfileResource { + sid: string; + unique_name: string; + account_sid: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class NetworkAccessProfileInstance { + protected _version: V1; + protected _solution: NetworkAccessProfileContextSolution; + protected _context?: NetworkAccessProfileContext; + constructor(_version: V1, payload: NetworkAccessProfileResource, sid?: string); + /** + * The unique string that identifies the Network Access Profile resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Network Access Profile belongs to. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Network Access Profile resource. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Fetch a NetworkAccessProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + fetch(callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Update a NetworkAccessProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + update(callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Update a NetworkAccessProfileInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + update(params: NetworkAccessProfileContextUpdateOptions, callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Access the networks. + */ + networks(): NetworkAccessProfileNetworkListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NetworkAccessProfileSolution { +} +export interface NetworkAccessProfileListInstance { + _version: V1; + _solution: NetworkAccessProfileSolution; + _uri: string; + (sid: string): NetworkAccessProfileContext; + get(sid: string): NetworkAccessProfileContext; + /** + * Create a NetworkAccessProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + create(callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Create a NetworkAccessProfileInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + create(params: NetworkAccessProfileListInstanceCreateOptions, callback?: (error: Error | null, item?: NetworkAccessProfileInstance) => any): Promise; + /** + * Streams NetworkAccessProfileInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkAccessProfileListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: NetworkAccessProfileInstance, done: (err?: Error) => void) => void): void; + each(params: NetworkAccessProfileListInstanceEachOptions, callback?: (item: NetworkAccessProfileInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of NetworkAccessProfileInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: NetworkAccessProfilePage) => any): Promise; + /** + * Lists NetworkAccessProfileInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkAccessProfileListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: NetworkAccessProfileInstance[]) => any): Promise; + list(params: NetworkAccessProfileListInstanceOptions, callback?: (error: Error | null, items: NetworkAccessProfileInstance[]) => any): Promise; + /** + * Retrieve a single page of NetworkAccessProfileInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkAccessProfileListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: NetworkAccessProfilePage) => any): Promise; + page(params: NetworkAccessProfileListInstancePageOptions, callback?: (error: Error | null, items: NetworkAccessProfilePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NetworkAccessProfileListInstance(version: V1): NetworkAccessProfileListInstance; +export declare class NetworkAccessProfilePage extends Page { + /** + * Initialize the NetworkAccessProfilePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: NetworkAccessProfileSolution); + /** + * Build an instance of NetworkAccessProfileInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: NetworkAccessProfileResource): NetworkAccessProfileInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile.js b/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile.js new file mode 100644 index 00000000..4df60e8d --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile.js @@ -0,0 +1,248 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NetworkAccessProfilePage = exports.NetworkAccessProfileListInstance = exports.NetworkAccessProfileInstance = exports.NetworkAccessProfileContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const networkAccessProfileNetwork_1 = require("./networkAccessProfile/networkAccessProfileNetwork"); +class NetworkAccessProfileContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/NetworkAccessProfiles/${sid}`; + } + get networks() { + this._networks = + this._networks || + (0, networkAccessProfileNetwork_1.NetworkAccessProfileNetworkListInstance)(this._version, this._solution.sid); + return this._networks; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new NetworkAccessProfileInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NetworkAccessProfileInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkAccessProfileContextImpl = NetworkAccessProfileContextImpl; +class NetworkAccessProfileInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new NetworkAccessProfileContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a NetworkAccessProfileInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the networks. + */ + networks() { + return this._proxy.networks; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkAccessProfileInstance = NetworkAccessProfileInstance; +function NetworkAccessProfileListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new NetworkAccessProfileContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/NetworkAccessProfiles`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["networks"] !== undefined) + data["Networks"] = serialize.map(params["networks"], (e) => e); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NetworkAccessProfileInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NetworkAccessProfilePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new NetworkAccessProfilePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NetworkAccessProfileListInstance = NetworkAccessProfileListInstance; +class NetworkAccessProfilePage extends Page_1.default { + /** + * Initialize the NetworkAccessProfilePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of NetworkAccessProfileInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new NetworkAccessProfileInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkAccessProfilePage = NetworkAccessProfilePage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.d.ts b/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.d.ts new file mode 100644 index 00000000..f2f60978 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.d.ts @@ -0,0 +1,252 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a NetworkAccessProfileNetworkInstance + */ +export interface NetworkAccessProfileNetworkListInstanceCreateOptions { + /** The SID of the Network resource to be added to the Network Access Profile resource. */ + network: string; +} +/** + * Options to pass to each + */ +export interface NetworkAccessProfileNetworkListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: NetworkAccessProfileNetworkInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface NetworkAccessProfileNetworkListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface NetworkAccessProfileNetworkListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface NetworkAccessProfileNetworkContext { + /** + * Remove a NetworkAccessProfileNetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a NetworkAccessProfileNetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileNetworkInstance + */ + fetch(callback?: (error: Error | null, item?: NetworkAccessProfileNetworkInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface NetworkAccessProfileNetworkContextSolution { + networkAccessProfileSid: string; + sid: string; +} +export declare class NetworkAccessProfileNetworkContextImpl implements NetworkAccessProfileNetworkContext { + protected _version: V1; + protected _solution: NetworkAccessProfileNetworkContextSolution; + protected _uri: string; + constructor(_version: V1, networkAccessProfileSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: NetworkAccessProfileNetworkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): NetworkAccessProfileNetworkContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface NetworkAccessProfileNetworkPayload extends TwilioResponsePayload { + networks: NetworkAccessProfileNetworkResource[]; +} +interface NetworkAccessProfileNetworkResource { + sid: string; + network_access_profile_sid: string; + friendly_name: string; + iso_country: string; + identifiers: Array; + url: string; +} +export declare class NetworkAccessProfileNetworkInstance { + protected _version: V1; + protected _solution: NetworkAccessProfileNetworkContextSolution; + protected _context?: NetworkAccessProfileNetworkContext; + constructor(_version: V1, payload: NetworkAccessProfileNetworkResource, networkAccessProfileSid: string, sid?: string); + /** + * The unique string that identifies the Network resource. + */ + sid: string; + /** + * The unique string that identifies the Network resource\'s Network Access Profile resource. + */ + networkAccessProfileSid: string; + /** + * A human readable identifier of the Network this resource refers to. + */ + friendlyName: string; + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resource. + */ + isoCountry: string; + /** + * Array of objects identifying the [MCC-MNCs](https://en.wikipedia.org/wiki/Mobile_country_code) that are included in the Network resource. + */ + identifiers: Array; + /** + * The absolute URL of the Network resource. + */ + url: string; + private get _proxy(); + /** + * Remove a NetworkAccessProfileNetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a NetworkAccessProfileNetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileNetworkInstance + */ + fetch(callback?: (error: Error | null, item?: NetworkAccessProfileNetworkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + networkAccessProfileSid: string; + friendlyName: string; + isoCountry: string; + identifiers: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface NetworkAccessProfileNetworkSolution { + networkAccessProfileSid: string; +} +export interface NetworkAccessProfileNetworkListInstance { + _version: V1; + _solution: NetworkAccessProfileNetworkSolution; + _uri: string; + (sid: string): NetworkAccessProfileNetworkContext; + get(sid: string): NetworkAccessProfileNetworkContext; + /** + * Create a NetworkAccessProfileNetworkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileNetworkInstance + */ + create(params: NetworkAccessProfileNetworkListInstanceCreateOptions, callback?: (error: Error | null, item?: NetworkAccessProfileNetworkInstance) => any): Promise; + /** + * Streams NetworkAccessProfileNetworkInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkAccessProfileNetworkListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: NetworkAccessProfileNetworkInstance, done: (err?: Error) => void) => void): void; + each(params: NetworkAccessProfileNetworkListInstanceEachOptions, callback?: (item: NetworkAccessProfileNetworkInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of NetworkAccessProfileNetworkInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: NetworkAccessProfileNetworkPage) => any): Promise; + /** + * Lists NetworkAccessProfileNetworkInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkAccessProfileNetworkListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: NetworkAccessProfileNetworkInstance[]) => any): Promise; + list(params: NetworkAccessProfileNetworkListInstanceOptions, callback?: (error: Error | null, items: NetworkAccessProfileNetworkInstance[]) => any): Promise; + /** + * Retrieve a single page of NetworkAccessProfileNetworkInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { NetworkAccessProfileNetworkListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: NetworkAccessProfileNetworkPage) => any): Promise; + page(params: NetworkAccessProfileNetworkListInstancePageOptions, callback?: (error: Error | null, items: NetworkAccessProfileNetworkPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NetworkAccessProfileNetworkListInstance(version: V1, networkAccessProfileSid: string): NetworkAccessProfileNetworkListInstance; +export declare class NetworkAccessProfileNetworkPage extends Page { + /** + * Initialize the NetworkAccessProfileNetworkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: NetworkAccessProfileNetworkSolution); + /** + * Build an instance of NetworkAccessProfileNetworkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: NetworkAccessProfileNetworkResource): NetworkAccessProfileNetworkInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.js b/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.js new file mode 100644 index 00000000..168f9d76 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.js @@ -0,0 +1,227 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NetworkAccessProfileNetworkPage = exports.NetworkAccessProfileNetworkListInstance = exports.NetworkAccessProfileNetworkInstance = exports.NetworkAccessProfileNetworkContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class NetworkAccessProfileNetworkContextImpl { + constructor(_version, networkAccessProfileSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(networkAccessProfileSid)) { + throw new Error("Parameter 'networkAccessProfileSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { networkAccessProfileSid, sid }; + this._uri = `/NetworkAccessProfiles/${networkAccessProfileSid}/Networks/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new NetworkAccessProfileNetworkInstance(operationVersion, payload, instance._solution.networkAccessProfileSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkAccessProfileNetworkContextImpl = NetworkAccessProfileNetworkContextImpl; +class NetworkAccessProfileNetworkInstance { + constructor(_version, payload, networkAccessProfileSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.networkAccessProfileSid = payload.network_access_profile_sid; + this.friendlyName = payload.friendly_name; + this.isoCountry = payload.iso_country; + this.identifiers = payload.identifiers; + this.url = payload.url; + this._solution = { networkAccessProfileSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new NetworkAccessProfileNetworkContextImpl(this._version, this._solution.networkAccessProfileSid, this._solution.sid); + return this._context; + } + /** + * Remove a NetworkAccessProfileNetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a NetworkAccessProfileNetworkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NetworkAccessProfileNetworkInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + networkAccessProfileSid: this.networkAccessProfileSid, + friendlyName: this.friendlyName, + isoCountry: this.isoCountry, + identifiers: this.identifiers, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkAccessProfileNetworkInstance = NetworkAccessProfileNetworkInstance; +function NetworkAccessProfileNetworkListInstance(version, networkAccessProfileSid) { + if (!(0, utility_1.isValidPathParam)(networkAccessProfileSid)) { + throw new Error("Parameter 'networkAccessProfileSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new NetworkAccessProfileNetworkContextImpl(version, networkAccessProfileSid, sid); + }; + instance._version = version; + instance._solution = { networkAccessProfileSid }; + instance._uri = `/NetworkAccessProfiles/${networkAccessProfileSid}/Networks`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["network"] === null || params["network"] === undefined) { + throw new Error("Required parameter \"params['network']\" missing."); + } + let data = {}; + data["Network"] = params["network"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NetworkAccessProfileNetworkInstance(operationVersion, payload, instance._solution.networkAccessProfileSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NetworkAccessProfileNetworkPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new NetworkAccessProfileNetworkPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NetworkAccessProfileNetworkListInstance = NetworkAccessProfileNetworkListInstance; +class NetworkAccessProfileNetworkPage extends Page_1.default { + /** + * Initialize the NetworkAccessProfileNetworkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of NetworkAccessProfileNetworkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new NetworkAccessProfileNetworkInstance(this._version, payload, this._solution.networkAccessProfileSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NetworkAccessProfileNetworkPage = NetworkAccessProfileNetworkPage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/settingsUpdate.d.ts b/node_modules/twilio/lib/rest/supersim/v1/settingsUpdate.d.ts new file mode 100644 index 00000000..1735131c --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/settingsUpdate.d.ts @@ -0,0 +1,194 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type SettingsUpdateStatus = "scheduled" | "in-progress" | "successful" | "failed"; +/** + * Options to pass to each + */ +export interface SettingsUpdateListInstanceEachOptions { + /** Filter the Settings Updates by a Super SIM\'s SID or UniqueName. */ + sim?: string; + /** Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. */ + status?: SettingsUpdateStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SettingsUpdateInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SettingsUpdateListInstanceOptions { + /** Filter the Settings Updates by a Super SIM\'s SID or UniqueName. */ + sim?: string; + /** Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. */ + status?: SettingsUpdateStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SettingsUpdateListInstancePageOptions { + /** Filter the Settings Updates by a Super SIM\'s SID or UniqueName. */ + sim?: string; + /** Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. */ + status?: SettingsUpdateStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SettingsUpdateSolution { +} +export interface SettingsUpdateListInstance { + _version: V1; + _solution: SettingsUpdateSolution; + _uri: string; + /** + * Streams SettingsUpdateInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SettingsUpdateListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SettingsUpdateInstance, done: (err?: Error) => void) => void): void; + each(params: SettingsUpdateListInstanceEachOptions, callback?: (item: SettingsUpdateInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SettingsUpdateInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SettingsUpdatePage) => any): Promise; + /** + * Lists SettingsUpdateInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SettingsUpdateListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SettingsUpdateInstance[]) => any): Promise; + list(params: SettingsUpdateListInstanceOptions, callback?: (error: Error | null, items: SettingsUpdateInstance[]) => any): Promise; + /** + * Retrieve a single page of SettingsUpdateInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SettingsUpdateListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SettingsUpdatePage) => any): Promise; + page(params: SettingsUpdateListInstancePageOptions, callback?: (error: Error | null, items: SettingsUpdatePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SettingsUpdateListInstance(version: V1): SettingsUpdateListInstance; +interface SettingsUpdatePayload extends TwilioResponsePayload { + settings_updates: SettingsUpdateResource[]; +} +interface SettingsUpdateResource { + sid: string; + iccid: string; + sim_sid: string; + status: SettingsUpdateStatus; + packages: Array; + date_completed: Date; + date_created: Date; + date_updated: Date; +} +export declare class SettingsUpdateInstance { + protected _version: V1; + constructor(_version: V1, payload: SettingsUpdateResource); + /** + * The unique identifier of this Settings Update. + */ + sid: string; + /** + * The [ICCID](https://en.wikipedia.org/wiki/SIM_card#ICCID) associated with the SIM. + */ + iccid: string; + /** + * The SID of the Super SIM to which this Settings Update was applied. + */ + simSid: string; + status: SettingsUpdateStatus; + /** + * Array containing the different Settings Packages that will be applied to the SIM after the update completes. Each object within the array indicates the name and the version of the Settings Package that will be on the SIM if the update is successful. + */ + packages: Array; + /** + * The time, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the update successfully completed and the new settings were applied to the SIM. + */ + dateCompleted: Date; + /** + * The date that this Settings Update was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date that this Settings Update was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + iccid: string; + simSid: string; + status: SettingsUpdateStatus; + packages: any[]; + dateCompleted: Date; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class SettingsUpdatePage extends Page { + /** + * Initialize the SettingsUpdatePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SettingsUpdateSolution); + /** + * Build an instance of SettingsUpdateInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SettingsUpdateResource): SettingsUpdateInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/settingsUpdate.js b/node_modules/twilio/lib/rest/supersim/v1/settingsUpdate.js new file mode 100644 index 00000000..85404c9d --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/settingsUpdate.js @@ -0,0 +1,136 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SettingsUpdatePage = exports.SettingsUpdateInstance = exports.SettingsUpdateListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function SettingsUpdateListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/SettingsUpdates`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["sim"] !== undefined) + data["Sim"] = params["sim"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SettingsUpdatePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SettingsUpdatePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SettingsUpdateListInstance = SettingsUpdateListInstance; +class SettingsUpdateInstance { + constructor(_version, payload) { + this._version = _version; + this.sid = payload.sid; + this.iccid = payload.iccid; + this.simSid = payload.sim_sid; + this.status = payload.status; + this.packages = payload.packages; + this.dateCompleted = deserialize.iso8601DateTime(payload.date_completed); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + iccid: this.iccid, + simSid: this.simSid, + status: this.status, + packages: this.packages, + dateCompleted: this.dateCompleted, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SettingsUpdateInstance = SettingsUpdateInstance; +class SettingsUpdatePage extends Page_1.default { + /** + * Initialize the SettingsUpdatePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SettingsUpdateInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SettingsUpdateInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SettingsUpdatePage = SettingsUpdatePage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/sim.d.ts b/node_modules/twilio/lib/rest/supersim/v1/sim.d.ts new file mode 100644 index 00000000..e38851a4 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/sim.d.ts @@ -0,0 +1,341 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { BillingPeriodListInstance } from "./sim/billingPeriod"; +import { SimIpAddressListInstance } from "./sim/simIpAddress"; +export type SimStatus = "new" | "ready" | "active" | "inactive" | "scheduled"; +export type SimStatusUpdate = "ready" | "active" | "inactive"; +/** + * Options to pass to update a SimInstance + */ +export interface SimContextUpdateOptions { + /** An application-defined string that uniquely identifies the resource. It can be used in place of the resource\\\'s `sid` in the URL to address the resource. */ + uniqueName?: string; + /** */ + status?: SimStatusUpdate; + /** The SID or unique name of the Fleet to which the SIM resource should be assigned. */ + fleet?: string; + /** The URL we should call using the `callback_method` after an asynchronous update has finished. */ + callbackUrl?: string; + /** The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. */ + callbackMethod?: string; + /** The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource\\\'s status is new. */ + accountSid?: string; +} +/** + * Options to pass to create a SimInstance + */ +export interface SimListInstanceCreateOptions { + /** The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) of the Super SIM to be added to your Account. */ + iccid: string; + /** The 10-digit code required to claim the Super SIM for your Account. */ + registrationCode: string; +} +/** + * Options to pass to each + */ +export interface SimListInstanceEachOptions { + /** The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. */ + status?: SimStatus; + /** The SID or unique name of the Fleet to which a list of Sims are assigned. */ + fleet?: string; + /** The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. */ + iccid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SimInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SimListInstanceOptions { + /** The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. */ + status?: SimStatus; + /** The SID or unique name of the Fleet to which a list of Sims are assigned. */ + fleet?: string; + /** The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. */ + iccid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SimListInstancePageOptions { + /** The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. */ + status?: SimStatus; + /** The SID or unique name of the Fleet to which a list of Sims are assigned. */ + fleet?: string; + /** The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. */ + iccid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SimContext { + billingPeriods: BillingPeriodListInstance; + simIpAddresses: SimIpAddressListInstance; + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(params: SimContextUpdateOptions, callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SimContextSolution { + sid: string; +} +export declare class SimContextImpl implements SimContext { + protected _version: V1; + protected _solution: SimContextSolution; + protected _uri: string; + protected _billingPeriods?: BillingPeriodListInstance; + protected _simIpAddresses?: SimIpAddressListInstance; + constructor(_version: V1, sid: string); + get billingPeriods(): BillingPeriodListInstance; + get simIpAddresses(): SimIpAddressListInstance; + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + update(params?: SimContextUpdateOptions | ((error: Error | null, item?: SimInstance) => any), callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SimContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SimPayload extends TwilioResponsePayload { + sims: SimResource[]; +} +interface SimResource { + sid: string; + unique_name: string; + account_sid: string; + iccid: string; + status: SimStatus; + fleet_sid: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class SimInstance { + protected _version: V1; + protected _solution: SimContextSolution; + protected _context?: SimContext; + constructor(_version: V1, payload: SimResource, sid?: string); + /** + * The unique string that identifies the Sim resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Super SIM belongs to. + */ + accountSid: string; + /** + * The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with the SIM. + */ + iccid: string; + status: SimStatus; + /** + * The unique ID of the Fleet configured for this SIM. + */ + fleetSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Sim Resource. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(params: SimContextUpdateOptions, callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Access the billingPeriods. + */ + billingPeriods(): BillingPeriodListInstance; + /** + * Access the simIpAddresses. + */ + simIpAddresses(): SimIpAddressListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + iccid: string; + status: SimStatus; + fleetSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SimSolution { +} +export interface SimListInstance { + _version: V1; + _solution: SimSolution; + _uri: string; + (sid: string): SimContext; + get(sid: string): SimContext; + /** + * Create a SimInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + create(params: SimListInstanceCreateOptions, callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Streams SimInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SimInstance, done: (err?: Error) => void) => void): void; + each(params: SimListInstanceEachOptions, callback?: (item: SimInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SimInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SimPage) => any): Promise; + /** + * Lists SimInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SimInstance[]) => any): Promise; + list(params: SimListInstanceOptions, callback?: (error: Error | null, items: SimInstance[]) => any): Promise; + /** + * Retrieve a single page of SimInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SimPage) => any): Promise; + page(params: SimListInstancePageOptions, callback?: (error: Error | null, items: SimPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SimListInstance(version: V1): SimListInstance; +export declare class SimPage extends Page { + /** + * Initialize the SimPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SimSolution); + /** + * Build an instance of SimInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SimResource): SimInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/sim.js b/node_modules/twilio/lib/rest/supersim/v1/sim.js new file mode 100644 index 00000000..e4954bcc --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/sim.js @@ -0,0 +1,283 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SimPage = exports.SimListInstance = exports.SimInstance = exports.SimContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const billingPeriod_1 = require("./sim/billingPeriod"); +const simIpAddress_1 = require("./sim/simIpAddress"); +class SimContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Sims/${sid}`; + } + get billingPeriods() { + this._billingPeriods = + this._billingPeriods || + (0, billingPeriod_1.BillingPeriodListInstance)(this._version, this._solution.sid); + return this._billingPeriods; + } + get simIpAddresses() { + this._simIpAddresses = + this._simIpAddresses || + (0, simIpAddress_1.SimIpAddressListInstance)(this._version, this._solution.sid); + return this._simIpAddresses; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SimInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["fleet"] !== undefined) + data["Fleet"] = params["fleet"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["accountSid"] !== undefined) + data["AccountSid"] = params["accountSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SimInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimContextImpl = SimContextImpl; +class SimInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.iccid = payload.iccid; + this.status = payload.status; + this.fleetSid = payload.fleet_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new SimContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the billingPeriods. + */ + billingPeriods() { + return this._proxy.billingPeriods; + } + /** + * Access the simIpAddresses. + */ + simIpAddresses() { + return this._proxy.simIpAddresses; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + iccid: this.iccid, + status: this.status, + fleetSid: this.fleetSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimInstance = SimInstance; +function SimListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SimContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Sims`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["iccid"] === null || params["iccid"] === undefined) { + throw new Error("Required parameter \"params['iccid']\" missing."); + } + if (params["registrationCode"] === null || + params["registrationCode"] === undefined) { + throw new Error("Required parameter \"params['registrationCode']\" missing."); + } + let data = {}; + data["Iccid"] = params["iccid"]; + data["RegistrationCode"] = params["registrationCode"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SimInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["fleet"] !== undefined) + data["Fleet"] = params["fleet"]; + if (params["iccid"] !== undefined) + data["Iccid"] = params["iccid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SimPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SimPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SimListInstance = SimListInstance; +class SimPage extends Page_1.default { + /** + * Initialize the SimPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SimInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SimInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimPage = SimPage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/sim/billingPeriod.d.ts b/node_modules/twilio/lib/rest/supersim/v1/sim/billingPeriod.d.ts new file mode 100644 index 00000000..9abb6178 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/sim/billingPeriod.d.ts @@ -0,0 +1,183 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type BillingPeriodBpType = "ready" | "active"; +/** + * Options to pass to each + */ +export interface BillingPeriodListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BillingPeriodInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BillingPeriodListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BillingPeriodListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BillingPeriodSolution { + simSid: string; +} +export interface BillingPeriodListInstance { + _version: V1; + _solution: BillingPeriodSolution; + _uri: string; + /** + * Streams BillingPeriodInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BillingPeriodListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BillingPeriodInstance, done: (err?: Error) => void) => void): void; + each(params: BillingPeriodListInstanceEachOptions, callback?: (item: BillingPeriodInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BillingPeriodInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BillingPeriodPage) => any): Promise; + /** + * Lists BillingPeriodInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BillingPeriodListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BillingPeriodInstance[]) => any): Promise; + list(params: BillingPeriodListInstanceOptions, callback?: (error: Error | null, items: BillingPeriodInstance[]) => any): Promise; + /** + * Retrieve a single page of BillingPeriodInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BillingPeriodListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BillingPeriodPage) => any): Promise; + page(params: BillingPeriodListInstancePageOptions, callback?: (error: Error | null, items: BillingPeriodPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BillingPeriodListInstance(version: V1, simSid: string): BillingPeriodListInstance; +interface BillingPeriodPayload extends TwilioResponsePayload { + billing_periods: BillingPeriodResource[]; +} +interface BillingPeriodResource { + sid: string; + account_sid: string; + sim_sid: string; + start_time: Date; + end_time: Date; + period_type: BillingPeriodBpType; + date_created: Date; + date_updated: Date; +} +export declare class BillingPeriodInstance { + protected _version: V1; + constructor(_version: V1, payload: BillingPeriodResource, simSid: string); + /** + * The SID of the Billing Period. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) the Super SIM belongs to. + */ + accountSid: string; + /** + * The SID of the Super SIM the Billing Period belongs to. + */ + simSid: string; + /** + * The start time of the Billing Period specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + startTime: Date; + /** + * The end time of the Billing Period specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + endTime: Date; + periodType: BillingPeriodBpType; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + simSid: string; + startTime: Date; + endTime: Date; + periodType: BillingPeriodBpType; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class BillingPeriodPage extends Page { + /** + * Initialize the BillingPeriodPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: BillingPeriodSolution); + /** + * Build an instance of BillingPeriodInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BillingPeriodResource): BillingPeriodInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/sim/billingPeriod.js b/node_modules/twilio/lib/rest/supersim/v1/sim/billingPeriod.js new file mode 100644 index 00000000..65c03dd8 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/sim/billingPeriod.js @@ -0,0 +1,136 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BillingPeriodPage = exports.BillingPeriodInstance = exports.BillingPeriodListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function BillingPeriodListInstance(version, simSid) { + if (!(0, utility_1.isValidPathParam)(simSid)) { + throw new Error("Parameter 'simSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { simSid }; + instance._uri = `/Sims/${simSid}/BillingPeriods`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BillingPeriodPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BillingPeriodPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BillingPeriodListInstance = BillingPeriodListInstance; +class BillingPeriodInstance { + constructor(_version, payload, simSid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.simSid = payload.sim_sid; + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.periodType = payload.period_type; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + simSid: this.simSid, + startTime: this.startTime, + endTime: this.endTime, + periodType: this.periodType, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BillingPeriodInstance = BillingPeriodInstance; +class BillingPeriodPage extends Page_1.default { + /** + * Initialize the BillingPeriodPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BillingPeriodInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BillingPeriodInstance(this._version, payload, this._solution.simSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BillingPeriodPage = BillingPeriodPage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/sim/simIpAddress.d.ts b/node_modules/twilio/lib/rest/supersim/v1/sim/simIpAddress.d.ts new file mode 100644 index 00000000..538d8f1a --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/sim/simIpAddress.d.ts @@ -0,0 +1,147 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type SimIpAddressIpAddressVersion = "IPv4" | "IPv6"; +/** + * Options to pass to each + */ +export interface SimIpAddressListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SimIpAddressInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SimIpAddressListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SimIpAddressListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SimIpAddressSolution { + simSid: string; +} +export interface SimIpAddressListInstance { + _version: V1; + _solution: SimIpAddressSolution; + _uri: string; + /** + * Streams SimIpAddressInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimIpAddressListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SimIpAddressInstance, done: (err?: Error) => void) => void): void; + each(params: SimIpAddressListInstanceEachOptions, callback?: (item: SimIpAddressInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SimIpAddressInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SimIpAddressPage) => any): Promise; + /** + * Lists SimIpAddressInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimIpAddressListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SimIpAddressInstance[]) => any): Promise; + list(params: SimIpAddressListInstanceOptions, callback?: (error: Error | null, items: SimIpAddressInstance[]) => any): Promise; + /** + * Retrieve a single page of SimIpAddressInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimIpAddressListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SimIpAddressPage) => any): Promise; + page(params: SimIpAddressListInstancePageOptions, callback?: (error: Error | null, items: SimIpAddressPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SimIpAddressListInstance(version: V1, simSid: string): SimIpAddressListInstance; +interface SimIpAddressPayload extends TwilioResponsePayload { + ip_addresses: SimIpAddressResource[]; +} +interface SimIpAddressResource { + ip_address: string; + ip_address_version: SimIpAddressIpAddressVersion; +} +export declare class SimIpAddressInstance { + protected _version: V1; + constructor(_version: V1, payload: SimIpAddressResource, simSid: string); + /** + * IP address assigned to the given Super SIM + */ + ipAddress: string; + ipAddressVersion: SimIpAddressIpAddressVersion; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + ipAddress: string; + ipAddressVersion: SimIpAddressIpAddressVersion; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class SimIpAddressPage extends Page { + /** + * Initialize the SimIpAddressPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SimIpAddressSolution); + /** + * Build an instance of SimIpAddressInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SimIpAddressResource): SimIpAddressInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/sim/simIpAddress.js b/node_modules/twilio/lib/rest/supersim/v1/sim/simIpAddress.js new file mode 100644 index 00000000..4a33e4a5 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/sim/simIpAddress.js @@ -0,0 +1,124 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SimIpAddressPage = exports.SimIpAddressInstance = exports.SimIpAddressListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function SimIpAddressListInstance(version, simSid) { + if (!(0, utility_1.isValidPathParam)(simSid)) { + throw new Error("Parameter 'simSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { simSid }; + instance._uri = `/Sims/${simSid}/IpAddresses`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SimIpAddressPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SimIpAddressPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SimIpAddressListInstance = SimIpAddressListInstance; +class SimIpAddressInstance { + constructor(_version, payload, simSid) { + this._version = _version; + this.ipAddress = payload.ip_address; + this.ipAddressVersion = payload.ip_address_version; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + ipAddress: this.ipAddress, + ipAddressVersion: this.ipAddressVersion, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimIpAddressInstance = SimIpAddressInstance; +class SimIpAddressPage extends Page_1.default { + /** + * Initialize the SimIpAddressPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SimIpAddressInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SimIpAddressInstance(this._version, payload, this._solution.simSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimIpAddressPage = SimIpAddressPage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/smsCommand.d.ts b/node_modules/twilio/lib/rest/supersim/v1/smsCommand.d.ts new file mode 100644 index 00000000..bf2f28b2 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/smsCommand.d.ts @@ -0,0 +1,271 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type SmsCommandDirection = "to_sim" | "from_sim"; +export type SmsCommandStatus = "queued" | "sent" | "delivered" | "received" | "failed"; +/** + * Options to pass to create a SmsCommandInstance + */ +export interface SmsCommandListInstanceCreateOptions { + /** The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the SMS Command to. */ + sim: string; + /** The message body of the SMS Command. */ + payload: string; + /** The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. */ + callbackMethod?: string; + /** The URL we should call using the `callback_method` after we have sent the command. */ + callbackUrl?: string; +} +/** + * Options to pass to each + */ +export interface SmsCommandListInstanceEachOptions { + /** The SID or unique name of the Sim resource that SMS Command was sent to or from. */ + sim?: string; + /** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. */ + status?: SmsCommandStatus; + /** The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ + direction?: SmsCommandDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SmsCommandInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SmsCommandListInstanceOptions { + /** The SID or unique name of the Sim resource that SMS Command was sent to or from. */ + sim?: string; + /** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. */ + status?: SmsCommandStatus; + /** The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ + direction?: SmsCommandDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SmsCommandListInstancePageOptions { + /** The SID or unique name of the Sim resource that SMS Command was sent to or from. */ + sim?: string; + /** The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. */ + status?: SmsCommandStatus; + /** The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ + direction?: SmsCommandDirection; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SmsCommandContext { + /** + * Fetch a SmsCommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SmsCommandInstance + */ + fetch(callback?: (error: Error | null, item?: SmsCommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SmsCommandContextSolution { + sid: string; +} +export declare class SmsCommandContextImpl implements SmsCommandContext { + protected _version: V1; + protected _solution: SmsCommandContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: SmsCommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SmsCommandContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SmsCommandPayload extends TwilioResponsePayload { + sms_commands: SmsCommandResource[]; +} +interface SmsCommandResource { + sid: string; + account_sid: string; + sim_sid: string; + payload: string; + status: SmsCommandStatus; + direction: SmsCommandDirection; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class SmsCommandInstance { + protected _version: V1; + protected _solution: SmsCommandContextSolution; + protected _context?: SmsCommandContext; + constructor(_version: V1, payload: SmsCommandResource, sid?: string); + /** + * The unique string that we created to identify the SMS Command resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SMS Command resource. + */ + accountSid: string; + /** + * The SID of the [SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) that this SMS Command was sent to or from. + */ + simSid: string; + /** + * The message body of the SMS Command sent to or from the SIM. For text mode messages, this can be up to 160 characters. + */ + payload: string; + status: SmsCommandStatus; + direction: SmsCommandDirection; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the SMS Command resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a SmsCommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SmsCommandInstance + */ + fetch(callback?: (error: Error | null, item?: SmsCommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + simSid: string; + payload: string; + status: SmsCommandStatus; + direction: SmsCommandDirection; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SmsCommandSolution { +} +export interface SmsCommandListInstance { + _version: V1; + _solution: SmsCommandSolution; + _uri: string; + (sid: string): SmsCommandContext; + get(sid: string): SmsCommandContext; + /** + * Create a SmsCommandInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SmsCommandInstance + */ + create(params: SmsCommandListInstanceCreateOptions, callback?: (error: Error | null, item?: SmsCommandInstance) => any): Promise; + /** + * Streams SmsCommandInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SmsCommandListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SmsCommandInstance, done: (err?: Error) => void) => void): void; + each(params: SmsCommandListInstanceEachOptions, callback?: (item: SmsCommandInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SmsCommandInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SmsCommandPage) => any): Promise; + /** + * Lists SmsCommandInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SmsCommandListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SmsCommandInstance[]) => any): Promise; + list(params: SmsCommandListInstanceOptions, callback?: (error: Error | null, items: SmsCommandInstance[]) => any): Promise; + /** + * Retrieve a single page of SmsCommandInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SmsCommandListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SmsCommandPage) => any): Promise; + page(params: SmsCommandListInstancePageOptions, callback?: (error: Error | null, items: SmsCommandPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SmsCommandListInstance(version: V1): SmsCommandListInstance; +export declare class SmsCommandPage extends Page { + /** + * Initialize the SmsCommandPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SmsCommandSolution); + /** + * Build an instance of SmsCommandInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SmsCommandResource): SmsCommandInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/smsCommand.js b/node_modules/twilio/lib/rest/supersim/v1/smsCommand.js new file mode 100644 index 00000000..4f053cab --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/smsCommand.js @@ -0,0 +1,222 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SmsCommandPage = exports.SmsCommandListInstance = exports.SmsCommandInstance = exports.SmsCommandContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class SmsCommandContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/SmsCommands/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SmsCommandInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SmsCommandContextImpl = SmsCommandContextImpl; +class SmsCommandInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.simSid = payload.sim_sid; + this.payload = payload.payload; + this.status = payload.status; + this.direction = payload.direction; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SmsCommandContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a SmsCommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SmsCommandInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + simSid: this.simSid, + payload: this.payload, + status: this.status, + direction: this.direction, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SmsCommandInstance = SmsCommandInstance; +function SmsCommandListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SmsCommandContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/SmsCommands`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["sim"] === null || params["sim"] === undefined) { + throw new Error("Required parameter \"params['sim']\" missing."); + } + if (params["payload"] === null || params["payload"] === undefined) { + throw new Error("Required parameter \"params['payload']\" missing."); + } + let data = {}; + data["Sim"] = params["sim"]; + data["Payload"] = params["payload"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SmsCommandInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["sim"] !== undefined) + data["Sim"] = params["sim"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["direction"] !== undefined) + data["Direction"] = params["direction"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SmsCommandPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SmsCommandPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SmsCommandListInstance = SmsCommandListInstance; +class SmsCommandPage extends Page_1.default { + /** + * Initialize the SmsCommandPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SmsCommandInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SmsCommandInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SmsCommandPage = SmsCommandPage; diff --git a/node_modules/twilio/lib/rest/supersim/v1/usageRecord.d.ts b/node_modules/twilio/lib/rest/supersim/v1/usageRecord.d.ts new file mode 100644 index 00000000..c37282bd --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/usageRecord.d.ts @@ -0,0 +1,252 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type UsageRecordGranularity = "hour" | "day" | "all"; +export type UsageRecordGroup = "sim" | "fleet" | "network" | "isoCountry"; +/** + * Options to pass to each + */ +export interface UsageRecordListInstanceEachOptions { + /** SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. */ + sim?: string; + /** SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. */ + fleet?: string; + /** SID of a Network resource. Only show UsageRecords representing usage on this network. */ + network?: string; + /** Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. */ + isoCountry?: string; + /** Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. */ + group?: UsageRecordGroup; + /** Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. */ + startTime?: Date; + /** Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. */ + endTime?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UsageRecordListInstanceOptions { + /** SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. */ + sim?: string; + /** SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. */ + fleet?: string; + /** SID of a Network resource. Only show UsageRecords representing usage on this network. */ + network?: string; + /** Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. */ + isoCountry?: string; + /** Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. */ + group?: UsageRecordGroup; + /** Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. */ + startTime?: Date; + /** Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. */ + endTime?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UsageRecordListInstancePageOptions { + /** SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. */ + sim?: string; + /** SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. */ + fleet?: string; + /** SID of a Network resource. Only show UsageRecords representing usage on this network. */ + network?: string; + /** Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. */ + isoCountry?: string; + /** Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. */ + group?: UsageRecordGroup; + /** Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. */ + startTime?: Date; + /** Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. */ + endTime?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UsageRecordSolution { +} +export interface UsageRecordListInstance { + _version: V1; + _solution: UsageRecordSolution; + _uri: string; + /** + * Streams UsageRecordInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void): void; + each(params: UsageRecordListInstanceEachOptions, callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UsageRecordInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + /** + * Lists UsageRecordInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UsageRecordInstance[]) => any): Promise; + list(params: UsageRecordListInstanceOptions, callback?: (error: Error | null, items: UsageRecordInstance[]) => any): Promise; + /** + * Retrieve a single page of UsageRecordInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + page(params: UsageRecordListInstancePageOptions, callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UsageRecordListInstance(version: V1): UsageRecordListInstance; +interface UsageRecordPayload extends TwilioResponsePayload { + usage_records: UsageRecordResource[]; +} +interface UsageRecordResource { + account_sid: string; + sim_sid: string; + network_sid: string; + fleet_sid: string; + iso_country: string; + period: any; + data_upload: number; + data_download: number; + data_total: number; + data_total_billed: number; + billed_unit: string; +} +export declare class UsageRecordInstance { + protected _version: V1; + constructor(_version: V1, payload: UsageRecordResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that incurred the usage. + */ + accountSid: string; + /** + * SID of a Sim resource to which the UsageRecord belongs. Value will only be present when either a value for the `Sim` query parameter is provided or when UsageRecords are grouped by `sim`. Otherwise, the value will be `null`. + */ + simSid: string; + /** + * SID of the Network resource the usage occurred on. Value will only be present when either a value for the `Network` query parameter is provided or when UsageRecords are grouped by `network`. Otherwise, the value will be `null`. + */ + networkSid: string; + /** + * SID of the Fleet resource the usage occurred on. Value will only be present when either a value for the `Fleet` query parameter is provided or when UsageRecords are grouped by `fleet`. Otherwise, the value will be `null`. + */ + fleetSid: string; + /** + * Alpha-2 ISO Country Code that the usage occurred in. Value will only be present when either a value for the `IsoCountry` query parameter is provided or when UsageRecords are grouped by `isoCountry`. Otherwise, the value will be `null`. + */ + isoCountry: string; + /** + * The time period for which the usage is reported. The period is represented as a pair of `start_time` and `end_time` timestamps specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + period: any; + /** + * Total data uploaded in bytes, aggregated by the query parameters. + */ + dataUpload: number; + /** + * Total data downloaded in bytes, aggregated by the query parameters. + */ + dataDownload: number; + /** + * Total of data_upload and data_download. + */ + dataTotal: number; + /** + * Total amount in the `billed_unit` that was charged for the data uploaded or downloaded. Will return 0 for usage prior to February 1, 2022. Value may be 0 despite `data_total` being greater than 0 if the data usage is still being processed by Twilio\'s billing system. Refer to [Data Usage Processing](https://www.twilio.com/docs/iot/supersim/api/usage-record-resource#data-usage-processing) for more details. + */ + dataTotalBilled: number; + /** + * The currency in which the billed amounts are measured, specified in the 3 letter ISO 4127 format (e.g. `USD`, `EUR`, `JPY`). This can be null when data_toal_billed is 0 and we do not yet have billing information for the corresponding data usage. Refer to [Data Usage Processing](https://www.twilio.com/docs/iot/supersim/api/usage-record-resource#data-usage-processing) for more details. + */ + billedUnit: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + simSid: string; + networkSid: string; + fleetSid: string; + isoCountry: string; + period: any; + dataUpload: number; + dataDownload: number; + dataTotal: number; + dataTotalBilled: number; + billedUnit: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class UsageRecordPage extends Page { + /** + * Initialize the UsageRecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UsageRecordSolution); + /** + * Build an instance of UsageRecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UsageRecordResource): UsageRecordInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/supersim/v1/usageRecord.js b/node_modules/twilio/lib/rest/supersim/v1/usageRecord.js new file mode 100644 index 00000000..74fbb6a5 --- /dev/null +++ b/node_modules/twilio/lib/rest/supersim/v1/usageRecord.js @@ -0,0 +1,154 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Supersim + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsageRecordPage = exports.UsageRecordInstance = exports.UsageRecordListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function UsageRecordListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/UsageRecords`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["sim"] !== undefined) + data["Sim"] = params["sim"]; + if (params["fleet"] !== undefined) + data["Fleet"] = params["fleet"]; + if (params["network"] !== undefined) + data["Network"] = params["network"]; + if (params["isoCountry"] !== undefined) + data["IsoCountry"] = params["isoCountry"]; + if (params["group"] !== undefined) + data["Group"] = params["group"]; + if (params["granularity"] !== undefined) + data["Granularity"] = params["granularity"]; + if (params["startTime"] !== undefined) + data["StartTime"] = serialize.iso8601DateTime(params["startTime"]); + if (params["endTime"] !== undefined) + data["EndTime"] = serialize.iso8601DateTime(params["endTime"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UsageRecordPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UsageRecordPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UsageRecordListInstance = UsageRecordListInstance; +class UsageRecordInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.simSid = payload.sim_sid; + this.networkSid = payload.network_sid; + this.fleetSid = payload.fleet_sid; + this.isoCountry = payload.iso_country; + this.period = payload.period; + this.dataUpload = payload.data_upload; + this.dataDownload = payload.data_download; + this.dataTotal = payload.data_total; + this.dataTotalBilled = payload.data_total_billed; + this.billedUnit = payload.billed_unit; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + simSid: this.simSid, + networkSid: this.networkSid, + fleetSid: this.fleetSid, + isoCountry: this.isoCountry, + period: this.period, + dataUpload: this.dataUpload, + dataDownload: this.dataDownload, + dataTotal: this.dataTotal, + dataTotalBilled: this.dataTotalBilled, + billedUnit: this.billedUnit, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsageRecordInstance = UsageRecordInstance; +class UsageRecordPage extends Page_1.default { + /** + * Initialize the UsageRecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UsageRecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UsageRecordInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsageRecordPage = UsageRecordPage; diff --git a/node_modules/twilio/lib/rest/sync/V1.d.ts b/node_modules/twilio/lib/rest/sync/V1.d.ts new file mode 100644 index 00000000..4626b0b7 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/V1.d.ts @@ -0,0 +1,15 @@ +import SyncBase from "../SyncBase"; +import Version from "../../base/Version"; +import { ServiceListInstance } from "./v1/service"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Sync + * + * @param domain - The Twilio (Twilio.Sync) domain + */ + constructor(domain: SyncBase); + /** services - { Twilio.Sync.V1.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; +} diff --git a/node_modules/twilio/lib/rest/sync/V1.js b/node_modules/twilio/lib/rest/sync/V1.js new file mode 100644 index 00000000..4cebb977 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/V1.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const service_1 = require("./v1/service"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Sync + * + * @param domain - The Twilio (Twilio.Sync) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/sync/v1/service.d.ts b/node_modules/twilio/lib/rest/sync/v1/service.d.ts new file mode 100644 index 00000000..9c8d76b5 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service.d.ts @@ -0,0 +1,404 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { DocumentListInstance } from "./service/document"; +import { SyncListListInstance } from "./service/syncList"; +import { SyncMapListInstance } from "./service/syncMap"; +import { SyncStreamListInstance } from "./service/syncStream"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** The URL we should call when Sync objects are manipulated. */ + webhookUrl?: string; + /** A string that you assign to describe the resource. */ + friendlyName?: string; + /** Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. */ + reachabilityWebhooksEnabled?: boolean; + /** Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. */ + aclEnabled?: boolean; + /** Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. */ + reachabilityDebouncingEnabled?: boolean; + /** The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. */ + reachabilityDebouncingWindow?: number; + /** Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. */ + webhooksFromRestEnabled?: boolean; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** A string that you assign to describe the resource. */ + friendlyName?: string; + /** The URL we should call when Sync objects are manipulated. */ + webhookUrl?: string; + /** Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. */ + reachabilityWebhooksEnabled?: boolean; + /** Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. */ + aclEnabled?: boolean; + /** Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. */ + reachabilityDebouncingEnabled?: boolean; + /** The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. */ + reachabilityDebouncingWindow?: number; + /** Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. */ + webhooksFromRestEnabled?: boolean; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + documents: DocumentListInstance; + syncLists: SyncListListInstance; + syncMaps: SyncMapListInstance; + syncStreams: SyncStreamListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _documents?: DocumentListInstance; + protected _syncLists?: SyncListListInstance; + protected _syncMaps?: SyncMapListInstance; + protected _syncStreams?: SyncStreamListInstance; + constructor(_version: V1, sid: string); + get documents(): DocumentListInstance; + get syncLists(): SyncListListInstance; + get syncMaps(): SyncMapListInstance; + get syncStreams(): SyncStreamListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + unique_name: string; + account_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; + webhook_url: string; + webhooks_from_rest_enabled: boolean; + reachability_webhooks_enabled: boolean; + acl_enabled: boolean; + reachability_debouncing_enabled: boolean; + reachability_debouncing_window: number; + links: Record; +} +export declare class ServiceInstance { + protected _version: V1; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V1, payload: ServiceResource, sid?: string); + /** + * The unique string that we created to identify the Service resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. It is a read-only property, it cannot be assigned using REST API. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Service resource. + */ + url: string; + /** + * The URL we call when Sync objects are manipulated. + */ + webhookUrl: string; + /** + * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + */ + webhooksFromRestEnabled: boolean; + /** + * Whether the service instance calls `webhook_url` when client endpoints connect to Sync. The default is `false`. + */ + reachabilityWebhooksEnabled: boolean; + /** + * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. It is disabled (false) by default. + */ + aclEnabled: boolean; + /** + * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + */ + reachabilityDebouncingEnabled: boolean; + /** + * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before `webhook_url` is called, if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the reachability event from occurring. + */ + reachabilityDebouncingWindow: number; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the documents. + */ + documents(): DocumentListInstance; + /** + * Access the syncLists. + */ + syncLists(): SyncListListInstance; + /** + * Access the syncMaps. + */ + syncMaps(): SyncMapListInstance; + /** + * Access the syncStreams. + */ + syncStreams(): SyncStreamListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + webhookUrl: string; + webhooksFromRestEnabled: boolean; + reachabilityWebhooksEnabled: boolean; + aclEnabled: boolean; + reachabilityDebouncingEnabled: boolean; + reachabilityDebouncingWindow: number; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V1; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V1): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service.js b/node_modules/twilio/lib/rest/sync/v1/service.js new file mode 100644 index 00000000..bb4db1db --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service.js @@ -0,0 +1,344 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const document_1 = require("./service/document"); +const syncList_1 = require("./service/syncList"); +const syncMap_1 = require("./service/syncMap"); +const syncStream_1 = require("./service/syncStream"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get documents() { + this._documents = + this._documents || + (0, document_1.DocumentListInstance)(this._version, this._solution.sid); + return this._documents; + } + get syncLists() { + this._syncLists = + this._syncLists || + (0, syncList_1.SyncListListInstance)(this._version, this._solution.sid); + return this._syncLists; + } + get syncMaps() { + this._syncMaps = + this._syncMaps || (0, syncMap_1.SyncMapListInstance)(this._version, this._solution.sid); + return this._syncMaps; + } + get syncStreams() { + this._syncStreams = + this._syncStreams || + (0, syncStream_1.SyncStreamListInstance)(this._version, this._solution.sid); + return this._syncStreams; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["reachabilityWebhooksEnabled"] !== undefined) + data["ReachabilityWebhooksEnabled"] = serialize.bool(params["reachabilityWebhooksEnabled"]); + if (params["aclEnabled"] !== undefined) + data["AclEnabled"] = serialize.bool(params["aclEnabled"]); + if (params["reachabilityDebouncingEnabled"] !== undefined) + data["ReachabilityDebouncingEnabled"] = serialize.bool(params["reachabilityDebouncingEnabled"]); + if (params["reachabilityDebouncingWindow"] !== undefined) + data["ReachabilityDebouncingWindow"] = + params["reachabilityDebouncingWindow"]; + if (params["webhooksFromRestEnabled"] !== undefined) + data["WebhooksFromRestEnabled"] = serialize.bool(params["webhooksFromRestEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.webhookUrl = payload.webhook_url; + this.webhooksFromRestEnabled = payload.webhooks_from_rest_enabled; + this.reachabilityWebhooksEnabled = payload.reachability_webhooks_enabled; + this.aclEnabled = payload.acl_enabled; + this.reachabilityDebouncingEnabled = + payload.reachability_debouncing_enabled; + this.reachabilityDebouncingWindow = deserialize.integer(payload.reachability_debouncing_window); + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the documents. + */ + documents() { + return this._proxy.documents; + } + /** + * Access the syncLists. + */ + syncLists() { + return this._proxy.syncLists; + } + /** + * Access the syncMaps. + */ + syncMaps() { + return this._proxy.syncMaps; + } + /** + * Access the syncStreams. + */ + syncStreams() { + return this._proxy.syncStreams; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + webhookUrl: this.webhookUrl, + webhooksFromRestEnabled: this.webhooksFromRestEnabled, + reachabilityWebhooksEnabled: this.reachabilityWebhooksEnabled, + aclEnabled: this.aclEnabled, + reachabilityDebouncingEnabled: this.reachabilityDebouncingEnabled, + reachabilityDebouncingWindow: this.reachabilityDebouncingWindow, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["reachabilityWebhooksEnabled"] !== undefined) + data["ReachabilityWebhooksEnabled"] = serialize.bool(params["reachabilityWebhooksEnabled"]); + if (params["aclEnabled"] !== undefined) + data["AclEnabled"] = serialize.bool(params["aclEnabled"]); + if (params["reachabilityDebouncingEnabled"] !== undefined) + data["ReachabilityDebouncingEnabled"] = serialize.bool(params["reachabilityDebouncingEnabled"]); + if (params["reachabilityDebouncingWindow"] !== undefined) + data["ReachabilityDebouncingWindow"] = + params["reachabilityDebouncingWindow"]; + if (params["webhooksFromRestEnabled"] !== undefined) + data["WebhooksFromRestEnabled"] = serialize.bool(params["webhooksFromRestEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/document.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/document.d.ts new file mode 100644 index 00000000..e217a944 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/document.d.ts @@ -0,0 +1,354 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { DocumentPermissionListInstance } from "./document/documentPermission"; +/** + * Options to pass to update a DocumentInstance + */ +export interface DocumentContextUpdateOptions { + /** The If-Match HTTP request header */ + ifMatch?: string; + /** A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. */ + data?: any; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). */ + ttl?: number; +} +/** + * Options to pass to create a DocumentInstance + */ +export interface DocumentListInstanceCreateOptions { + /** An application-defined string that uniquely identifies the Sync Document */ + uniqueName?: string; + /** A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. */ + data?: any; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document\\\'s time-to-live). */ + ttl?: number; +} +/** + * Options to pass to each + */ +export interface DocumentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DocumentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DocumentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DocumentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DocumentContext { + documentPermissions: DocumentPermissionListInstance; + /** + * Remove a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + fetch(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Update a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + update(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Update a DocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + update(params: DocumentContextUpdateOptions, callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DocumentContextSolution { + serviceSid: string; + sid: string; +} +export declare class DocumentContextImpl implements DocumentContext { + protected _version: V1; + protected _solution: DocumentContextSolution; + protected _uri: string; + protected _documentPermissions?: DocumentPermissionListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get documentPermissions(): DocumentPermissionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + update(params?: DocumentContextUpdateOptions | ((error: Error | null, item?: DocumentInstance) => any), callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DocumentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DocumentPayload extends TwilioResponsePayload { + documents: DocumentResource[]; +} +interface DocumentResource { + sid: string; + unique_name: string; + account_sid: string; + service_sid: string; + url: string; + links: Record; + revision: string; + data: any; + date_expires: Date; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class DocumentInstance { + protected _version: V1; + protected _solution: DocumentContextSolution; + protected _context?: DocumentContext; + constructor(_version: V1, payload: DocumentResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Document resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource and can be up to 320 characters long. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Document resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The absolute URL of the Document resource. + */ + url: string; + /** + * The URLs of resources related to the Sync Document. + */ + links: Record; + /** + * The current revision of the Sync Document, represented as a string. The `revision` property is used with conditional updates to ensure data consistency. + */ + revision: string; + /** + * An arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + */ + data: any; + /** + * The date and time in GMT when the Sync Document expires and will be deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If the Sync Document does not expire, this value is `null`. The Document resource might not be deleted immediately after it expires. + */ + dateExpires: Date; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The identity of the Sync Document\'s creator. If the Sync Document is created from the client SDK, the value matches the Access Token\'s `identity` field. If the Sync Document was created from the REST API, the value is `system`. + */ + createdBy: string; + private get _proxy(); + /** + * Remove a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + fetch(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Update a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + update(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Update a DocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + update(params: DocumentContextUpdateOptions, callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Access the documentPermissions. + */ + documentPermissions(): DocumentPermissionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + data: any; + dateExpires: Date; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DocumentSolution { + serviceSid: string; +} +export interface DocumentListInstance { + _version: V1; + _solution: DocumentSolution; + _uri: string; + (sid: string): DocumentContext; + get(sid: string): DocumentContext; + /** + * Create a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + create(callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Create a DocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + create(params: DocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: DocumentInstance) => any): Promise; + /** + * Streams DocumentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DocumentInstance, done: (err?: Error) => void) => void): void; + each(params: DocumentListInstanceEachOptions, callback?: (item: DocumentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DocumentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DocumentPage) => any): Promise; + /** + * Lists DocumentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DocumentInstance[]) => any): Promise; + list(params: DocumentListInstanceOptions, callback?: (error: Error | null, items: DocumentInstance[]) => any): Promise; + /** + * Retrieve a single page of DocumentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DocumentPage) => any): Promise; + page(params: DocumentListInstancePageOptions, callback?: (error: Error | null, items: DocumentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DocumentListInstance(version: V1, serviceSid: string): DocumentListInstance; +export declare class DocumentPage extends Page { + /** + * Initialize the DocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DocumentSolution); + /** + * Build an instance of DocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DocumentResource): DocumentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/document.js b/node_modules/twilio/lib/rest/sync/v1/service/document.js new file mode 100644 index 00000000..86521730 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/document.js @@ -0,0 +1,289 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DocumentPage = exports.DocumentListInstance = exports.DocumentInstance = exports.DocumentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const documentPermission_1 = require("./document/documentPermission"); +class DocumentContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Documents/${sid}`; + } + get documentPermissions() { + this._documentPermissions = + this._documentPermissions || + (0, documentPermission_1.DocumentPermissionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._documentPermissions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DocumentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["data"] !== undefined) + data["Data"] = serialize.object(params["data"]); + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentContextImpl = DocumentContextImpl; +class DocumentInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.url = payload.url; + this.links = payload.links; + this.revision = payload.revision; + this.data = payload.data; + this.dateExpires = deserialize.iso8601DateTime(payload.date_expires); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new DocumentContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the documentPermissions. + */ + documentPermissions() { + return this._proxy.documentPermissions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + url: this.url, + links: this.links, + revision: this.revision, + data: this.data, + dateExpires: this.dateExpires, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentInstance = DocumentInstance; +function DocumentListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new DocumentContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Documents`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["data"] !== undefined) + data["Data"] = serialize.object(params["data"]); + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DocumentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DocumentListInstance = DocumentListInstance; +class DocumentPage extends Page_1.default { + /** + * Initialize the DocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DocumentInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentPage = DocumentPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/document/documentPermission.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/document/documentPermission.d.ts new file mode 100644 index 00000000..6744e698 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/document/documentPermission.d.ts @@ -0,0 +1,280 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to update a DocumentPermissionInstance + */ +export interface DocumentPermissionContextUpdateOptions { + /** Whether the identity can read the Sync Document. Default value is `false`. */ + read: boolean; + /** Whether the identity can update the Sync Document. Default value is `false`. */ + write: boolean; + /** Whether the identity can delete the Sync Document. Default value is `false`. */ + manage: boolean; +} +/** + * Options to pass to each + */ +export interface DocumentPermissionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DocumentPermissionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DocumentPermissionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DocumentPermissionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DocumentPermissionContext { + /** + * Remove a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Update a DocumentPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + update(params: DocumentPermissionContextUpdateOptions, callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface DocumentPermissionContextSolution { + serviceSid: string; + documentSid: string; + identity: string; +} +export declare class DocumentPermissionContextImpl implements DocumentPermissionContext { + protected _version: V1; + protected _solution: DocumentPermissionContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, documentSid: string, identity: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + update(params: DocumentPermissionContextUpdateOptions, callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): DocumentPermissionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface DocumentPermissionPayload extends TwilioResponsePayload { + permissions: DocumentPermissionResource[]; +} +interface DocumentPermissionResource { + account_sid: string; + service_sid: string; + document_sid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; +} +export declare class DocumentPermissionInstance { + protected _version: V1; + protected _solution: DocumentPermissionContextSolution; + protected _context?: DocumentPermissionContext; + constructor(_version: V1, payload: DocumentPermissionResource, serviceSid: string, documentSid: string, identity?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Document Permission resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Sync Document to which the Document Permission applies. + */ + documentSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s User within the Service to an FPA token. + */ + identity: string; + /** + * Whether the identity can read the Sync Document. + */ + read: boolean; + /** + * Whether the identity can update the Sync Document. + */ + write: boolean; + /** + * Whether the identity can delete the Sync Document. + */ + manage: boolean; + /** + * The absolute URL of the Sync Document Permission resource. + */ + url: string; + private get _proxy(); + /** + * Remove a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Update a DocumentPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + update(params: DocumentPermissionContextUpdateOptions, callback?: (error: Error | null, item?: DocumentPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + documentSid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface DocumentPermissionSolution { + serviceSid: string; + documentSid: string; +} +export interface DocumentPermissionListInstance { + _version: V1; + _solution: DocumentPermissionSolution; + _uri: string; + (identity: string): DocumentPermissionContext; + get(identity: string): DocumentPermissionContext; + /** + * Streams DocumentPermissionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentPermissionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DocumentPermissionInstance, done: (err?: Error) => void) => void): void; + each(params: DocumentPermissionListInstanceEachOptions, callback?: (item: DocumentPermissionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DocumentPermissionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DocumentPermissionPage) => any): Promise; + /** + * Lists DocumentPermissionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentPermissionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DocumentPermissionInstance[]) => any): Promise; + list(params: DocumentPermissionListInstanceOptions, callback?: (error: Error | null, items: DocumentPermissionInstance[]) => any): Promise; + /** + * Retrieve a single page of DocumentPermissionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DocumentPermissionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DocumentPermissionPage) => any): Promise; + page(params: DocumentPermissionListInstancePageOptions, callback?: (error: Error | null, items: DocumentPermissionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DocumentPermissionListInstance(version: V1, serviceSid: string, documentSid: string): DocumentPermissionListInstance; +export declare class DocumentPermissionPage extends Page { + /** + * Initialize the DocumentPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DocumentPermissionSolution); + /** + * Build an instance of DocumentPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DocumentPermissionResource): DocumentPermissionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/document/documentPermission.js b/node_modules/twilio/lib/rest/sync/v1/service/document/documentPermission.js new file mode 100644 index 00000000..7ae1ca3d --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/document/documentPermission.js @@ -0,0 +1,253 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DocumentPermissionPage = exports.DocumentPermissionListInstance = exports.DocumentPermissionInstance = exports.DocumentPermissionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class DocumentPermissionContextImpl { + constructor(_version, serviceSid, documentSid, identity) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(documentSid)) { + throw new Error("Parameter 'documentSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + this._solution = { serviceSid, documentSid, identity }; + this._uri = `/Services/${serviceSid}/Documents/${documentSid}/Permissions/${identity}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new DocumentPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.documentSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["read"] === null || params["read"] === undefined) { + throw new Error("Required parameter \"params['read']\" missing."); + } + if (params["write"] === null || params["write"] === undefined) { + throw new Error("Required parameter \"params['write']\" missing."); + } + if (params["manage"] === null || params["manage"] === undefined) { + throw new Error("Required parameter \"params['manage']\" missing."); + } + let data = {}; + data["Read"] = serialize.bool(params["read"]); + data["Write"] = serialize.bool(params["write"]); + data["Manage"] = serialize.bool(params["manage"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.documentSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentPermissionContextImpl = DocumentPermissionContextImpl; +class DocumentPermissionInstance { + constructor(_version, payload, serviceSid, documentSid, identity) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.documentSid = payload.document_sid; + this.identity = payload.identity; + this.read = payload.read; + this.write = payload.write; + this.manage = payload.manage; + this.url = payload.url; + this._solution = { + serviceSid, + documentSid, + identity: identity || this.identity, + }; + } + get _proxy() { + this._context = + this._context || + new DocumentPermissionContextImpl(this._version, this._solution.serviceSid, this._solution.documentSid, this._solution.identity); + return this._context; + } + /** + * Remove a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a DocumentPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed DocumentPermissionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + documentSid: this.documentSid, + identity: this.identity, + read: this.read, + write: this.write, + manage: this.manage, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentPermissionInstance = DocumentPermissionInstance; +function DocumentPermissionListInstance(version, serviceSid, documentSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(documentSid)) { + throw new Error("Parameter 'documentSid' is not valid."); + } + const instance = ((identity) => instance.get(identity)); + instance.get = function get(identity) { + return new DocumentPermissionContextImpl(version, serviceSid, documentSid, identity); + }; + instance._version = version; + instance._solution = { serviceSid, documentSid }; + instance._uri = `/Services/${serviceSid}/Documents/${documentSid}/Permissions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DocumentPermissionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DocumentPermissionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DocumentPermissionListInstance = DocumentPermissionListInstance; +class DocumentPermissionPage extends Page_1.default { + /** + * Initialize the DocumentPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DocumentPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DocumentPermissionInstance(this._version, payload, this._solution.serviceSid, this._solution.documentSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DocumentPermissionPage = DocumentPermissionPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncList.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/syncList.d.ts new file mode 100644 index 00000000..80f4a855 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncList.d.ts @@ -0,0 +1,354 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { SyncListItemListInstance } from "./syncList/syncListItem"; +import { SyncListPermissionListInstance } from "./syncList/syncListPermission"; +/** + * Options to pass to update a SyncListInstance + */ +export interface SyncListContextUpdateOptions { + /** An alias for `collection_ttl`. If both are provided, this value is ignored. */ + ttl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. */ + collectionTtl?: number; +} +/** + * Options to pass to create a SyncListInstance + */ +export interface SyncListListInstanceCreateOptions { + /** An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. */ + uniqueName?: string; + /** Alias for collection_ttl. If both are provided, this value is ignored. */ + ttl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. */ + collectionTtl?: number; +} +/** + * Options to pass to each + */ +export interface SyncListListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncListInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncListListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncListListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncListContext { + syncListItems: SyncListItemListInstance; + syncListPermissions: SyncListPermissionListInstance; + /** + * Remove a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Update a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + update(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Update a SyncListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + update(params: SyncListContextUpdateOptions, callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncListContextSolution { + serviceSid: string; + sid: string; +} +export declare class SyncListContextImpl implements SyncListContext { + protected _version: V1; + protected _solution: SyncListContextSolution; + protected _uri: string; + protected _syncListItems?: SyncListItemListInstance; + protected _syncListPermissions?: SyncListPermissionListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get syncListItems(): SyncListItemListInstance; + get syncListPermissions(): SyncListPermissionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + update(params?: SyncListContextUpdateOptions | ((error: Error | null, item?: SyncListInstance) => any), callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncListContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncListPayload extends TwilioResponsePayload { + lists: SyncListResource[]; +} +interface SyncListResource { + sid: string; + unique_name: string; + account_sid: string; + service_sid: string; + url: string; + links: Record; + revision: string; + date_expires: Date; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncListInstance { + protected _version: V1; + protected _solution: SyncListContextSolution; + protected _context?: SyncListContext; + constructor(_version: V1, payload: SyncListResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Sync List resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync List resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The absolute URL of the Sync List resource. + */ + url: string; + /** + * The URLs of the Sync List\'s nested resources. + */ + links: Record; + /** + * The current revision of the Sync List, represented as a string. + */ + revision: string; + /** + * The date and time in GMT when the Sync List expires and will be deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If the Sync List does not expire, this value is `null`. The Sync List might not be deleted immediately after it expires. + */ + dateExpires: Date; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The identity of the Sync List\'s creator. If the Sync List is created from the client SDK, the value matches the Access Token\'s `identity` field. If the Sync List was created from the REST API, the value is `system`. + */ + createdBy: string; + private get _proxy(); + /** + * Remove a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Update a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + update(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Update a SyncListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + update(params: SyncListContextUpdateOptions, callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Access the syncListItems. + */ + syncListItems(): SyncListItemListInstance; + /** + * Access the syncListPermissions. + */ + syncListPermissions(): SyncListPermissionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + dateExpires: Date; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncListSolution { + serviceSid: string; +} +export interface SyncListListInstance { + _version: V1; + _solution: SyncListSolution; + _uri: string; + (sid: string): SyncListContext; + get(sid: string): SyncListContext; + /** + * Create a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + create(callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Create a SyncListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + create(params: SyncListListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncListInstance) => any): Promise; + /** + * Streams SyncListInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncListInstance, done: (err?: Error) => void) => void): void; + each(params: SyncListListInstanceEachOptions, callback?: (item: SyncListInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncListInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncListPage) => any): Promise; + /** + * Lists SyncListInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncListInstance[]) => any): Promise; + list(params: SyncListListInstanceOptions, callback?: (error: Error | null, items: SyncListInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncListInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncListPage) => any): Promise; + page(params: SyncListListInstancePageOptions, callback?: (error: Error | null, items: SyncListPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncListListInstance(version: V1, serviceSid: string): SyncListListInstance; +export declare class SyncListPage extends Page { + /** + * Initialize the SyncListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SyncListSolution); + /** + * Build an instance of SyncListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncListResource): SyncListInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncList.js b/node_modules/twilio/lib/rest/sync/v1/service/syncList.js new file mode 100644 index 00000000..74cd6d17 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncList.js @@ -0,0 +1,298 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncListPage = exports.SyncListListInstance = exports.SyncListInstance = exports.SyncListContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const syncListItem_1 = require("./syncList/syncListItem"); +const syncListPermission_1 = require("./syncList/syncListPermission"); +class SyncListContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Lists/${sid}`; + } + get syncListItems() { + this._syncListItems = + this._syncListItems || + (0, syncListItem_1.SyncListItemListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._syncListItems; + } + get syncListPermissions() { + this._syncListPermissions = + this._syncListPermissions || + (0, syncListPermission_1.SyncListPermissionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._syncListPermissions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncListInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["collectionTtl"] !== undefined) + data["CollectionTtl"] = params["collectionTtl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListContextImpl = SyncListContextImpl; +class SyncListInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.url = payload.url; + this.links = payload.links; + this.revision = payload.revision; + this.dateExpires = deserialize.iso8601DateTime(payload.date_expires); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SyncListContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the syncListItems. + */ + syncListItems() { + return this._proxy.syncListItems; + } + /** + * Access the syncListPermissions. + */ + syncListPermissions() { + return this._proxy.syncListPermissions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + url: this.url, + links: this.links, + revision: this.revision, + dateExpires: this.dateExpires, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListInstance = SyncListInstance; +function SyncListListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SyncListContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Lists`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["collectionTtl"] !== undefined) + data["CollectionTtl"] = params["collectionTtl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncListPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncListListInstance = SyncListListInstance; +class SyncListPage extends Page_1.default { + /** + * Initialize the SyncListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncListInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListPage = SyncListPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListItem.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListItem.d.ts new file mode 100644 index 00000000..54e3ca04 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListItem.d.ts @@ -0,0 +1,385 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type SyncListItemQueryFromBoundType = "inclusive" | "exclusive"; +export type SyncListItemQueryResultOrder = "asc" | "desc"; +/** + * Options to pass to remove a SyncListItemInstance + */ +export interface SyncListItemContextRemoveOptions { + /** If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ + ifMatch?: string; +} +/** + * Options to pass to update a SyncListItemInstance + */ +export interface SyncListItemContextUpdateOptions { + /** If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ + ifMatch?: string; + /** A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. */ + data?: any; + /** An alias for `item_ttl`. If both parameters are provided, this value is ignored. */ + ttl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. */ + itemTtl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item\\\'s parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item\\\'s `data` or `ttl` is updated in the same request. */ + collectionTtl?: number; +} +/** + * Options to pass to create a SyncListItemInstance + */ +export interface SyncListItemListInstanceCreateOptions { + /** A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. */ + data: any; + /** An alias for `item_ttl`. If both parameters are provided, this value is ignored. */ + ttl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. */ + itemTtl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item\\\'s parent Sync List expires (time-to-live) and is deleted. */ + collectionTtl?: number; +} +/** + * Options to pass to each + */ +export interface SyncListItemListInstanceEachOptions { + /** How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. */ + order?: SyncListItemQueryResultOrder; + /** The `index` of the first Sync List Item resource to read. See also `bounds`. */ + from?: string; + /** Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. */ + bounds?: SyncListItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncListItemInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncListItemListInstanceOptions { + /** How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. */ + order?: SyncListItemQueryResultOrder; + /** The `index` of the first Sync List Item resource to read. See also `bounds`. */ + from?: string; + /** Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. */ + bounds?: SyncListItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncListItemListInstancePageOptions { + /** How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. */ + order?: SyncListItemQueryResultOrder; + /** The `index` of the first Sync List Item resource to read. See also `bounds`. */ + from?: string; + /** Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. */ + bounds?: SyncListItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncListItemContext { + /** + * Remove a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + remove(params: SyncListItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Update a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + update(callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Update a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + update(params: SyncListItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncListItemContextSolution { + serviceSid: string; + listSid: string; + index: number; +} +export declare class SyncListItemContextImpl implements SyncListItemContext { + protected _version: V1; + protected _solution: SyncListItemContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, listSid: string, index: number); + remove(params?: SyncListItemContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + update(params?: SyncListItemContextUpdateOptions | ((error: Error | null, item?: SyncListItemInstance) => any), callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncListItemContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncListItemPayload extends TwilioResponsePayload { + items: SyncListItemResource[]; +} +interface SyncListItemResource { + index: number; + account_sid: string; + service_sid: string; + list_sid: string; + url: string; + revision: string; + data: any; + date_expires: Date; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncListItemInstance { + protected _version: V1; + protected _solution: SyncListItemContextSolution; + protected _context?: SyncListItemContext; + constructor(_version: V1, payload: SyncListItemResource, serviceSid: string, listSid: string, index?: number); + /** + * The automatically generated index of the List Item. The `index` values of the List Items in a Sync List can have gaps in their sequence. + */ + index: number; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the List Item resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Sync List that contains the List Item. + */ + listSid: string; + /** + * The absolute URL of the List Item resource. + */ + url: string; + /** + * The current revision of the item, represented as a string. + */ + revision: string; + /** + * An arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + */ + data: any; + /** + * The date and time in GMT when the List Item expires and will be deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If the List Item does not expire, this value is `null`. The List Item resource might not be deleted immediately after it expires. + */ + dateExpires: Date; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The identity of the List Item\'s creator. If the item is created from the client SDK, the value matches the Access Token\'s `identity` field. If the item was created from the REST API, the value is `system`. + */ + createdBy: string; + private get _proxy(); + /** + * Remove a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + remove(params: SyncListItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Update a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + update(callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Update a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + update(params: SyncListItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + index: number; + accountSid: string; + serviceSid: string; + listSid: string; + url: string; + revision: string; + data: any; + dateExpires: Date; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncListItemSolution { + serviceSid: string; + listSid: string; +} +export interface SyncListItemListInstance { + _version: V1; + _solution: SyncListItemSolution; + _uri: string; + (index: number): SyncListItemContext; + get(index: number): SyncListItemContext; + /** + * Create a SyncListItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + create(params: SyncListItemListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncListItemInstance) => any): Promise; + /** + * Streams SyncListItemInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListItemListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncListItemInstance, done: (err?: Error) => void) => void): void; + each(params: SyncListItemListInstanceEachOptions, callback?: (item: SyncListItemInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncListItemInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncListItemPage) => any): Promise; + /** + * Lists SyncListItemInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListItemListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncListItemInstance[]) => any): Promise; + list(params: SyncListItemListInstanceOptions, callback?: (error: Error | null, items: SyncListItemInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncListItemInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListItemListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncListItemPage) => any): Promise; + page(params: SyncListItemListInstancePageOptions, callback?: (error: Error | null, items: SyncListItemPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncListItemListInstance(version: V1, serviceSid: string, listSid: string): SyncListItemListInstance; +export declare class SyncListItemPage extends Page { + /** + * Initialize the SyncListItemPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SyncListItemSolution); + /** + * Build an instance of SyncListItemInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncListItemResource): SyncListItemInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListItem.js b/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListItem.js new file mode 100644 index 00000000..d46747ef --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListItem.js @@ -0,0 +1,296 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncListItemPage = exports.SyncListItemListInstance = exports.SyncListItemInstance = exports.SyncListItemContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SyncListItemContextImpl { + constructor(_version, serviceSid, listSid, index) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(listSid)) { + throw new Error("Parameter 'listSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(index)) { + throw new Error("Parameter 'index' is not valid."); + } + this._solution = { serviceSid, listSid, index }; + this._uri = `/Services/${serviceSid}/Lists/${listSid}/Items/${index}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncListItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid, instance._solution.index)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["data"] !== undefined) + data["Data"] = serialize.object(params["data"]); + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["itemTtl"] !== undefined) + data["ItemTtl"] = params["itemTtl"]; + if (params["collectionTtl"] !== undefined) + data["CollectionTtl"] = params["collectionTtl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid, instance._solution.index)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListItemContextImpl = SyncListItemContextImpl; +class SyncListItemInstance { + constructor(_version, payload, serviceSid, listSid, index) { + this._version = _version; + this.index = deserialize.integer(payload.index); + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.listSid = payload.list_sid; + this.url = payload.url; + this.revision = payload.revision; + this.data = payload.data; + this.dateExpires = deserialize.iso8601DateTime(payload.date_expires); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, listSid, index: index || this.index }; + } + get _proxy() { + this._context = + this._context || + new SyncListItemContextImpl(this._version, this._solution.serviceSid, this._solution.listSid, this._solution.index); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a SyncListItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListItemInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + index: this.index, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + listSid: this.listSid, + url: this.url, + revision: this.revision, + data: this.data, + dateExpires: this.dateExpires, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListItemInstance = SyncListItemInstance; +function SyncListItemListInstance(version, serviceSid, listSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(listSid)) { + throw new Error("Parameter 'listSid' is not valid."); + } + const instance = ((index) => instance.get(index)); + instance.get = function get(index) { + return new SyncListItemContextImpl(version, serviceSid, listSid, index); + }; + instance._version = version; + instance._solution = { serviceSid, listSid }; + instance._uri = `/Services/${serviceSid}/Lists/${listSid}/Items`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["data"] === null || params["data"] === undefined) { + throw new Error("Required parameter \"params['data']\" missing."); + } + let data = {}; + data["Data"] = serialize.object(params["data"]); + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["itemTtl"] !== undefined) + data["ItemTtl"] = params["itemTtl"]; + if (params["collectionTtl"] !== undefined) + data["CollectionTtl"] = params["collectionTtl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["bounds"] !== undefined) + data["Bounds"] = params["bounds"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListItemPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncListItemPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncListItemListInstance = SyncListItemListInstance; +class SyncListItemPage extends Page_1.default { + /** + * Initialize the SyncListItemPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncListItemInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncListItemInstance(this._version, payload, this._solution.serviceSid, this._solution.listSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListItemPage = SyncListItemPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListPermission.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListPermission.d.ts new file mode 100644 index 00000000..0a14c214 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListPermission.d.ts @@ -0,0 +1,280 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to update a SyncListPermissionInstance + */ +export interface SyncListPermissionContextUpdateOptions { + /** Whether the identity can read the Sync List and its Items. Default value is `false`. */ + read: boolean; + /** Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. */ + write: boolean; + /** Whether the identity can delete the Sync List. Default value is `false`. */ + manage: boolean; +} +/** + * Options to pass to each + */ +export interface SyncListPermissionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncListPermissionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncListPermissionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncListPermissionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncListPermissionContext { + /** + * Remove a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Update a SyncListPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + update(params: SyncListPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncListPermissionContextSolution { + serviceSid: string; + listSid: string; + identity: string; +} +export declare class SyncListPermissionContextImpl implements SyncListPermissionContext { + protected _version: V1; + protected _solution: SyncListPermissionContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, listSid: string, identity: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + update(params: SyncListPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncListPermissionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncListPermissionPayload extends TwilioResponsePayload { + permissions: SyncListPermissionResource[]; +} +interface SyncListPermissionResource { + account_sid: string; + service_sid: string; + list_sid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; +} +export declare class SyncListPermissionInstance { + protected _version: V1; + protected _solution: SyncListPermissionContextSolution; + protected _context?: SyncListPermissionContext; + constructor(_version: V1, payload: SyncListPermissionResource, serviceSid: string, listSid: string, identity?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync List Permission resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Sync List to which the Permission applies. + */ + listSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s User within the Service to an FPA token. + */ + identity: string; + /** + * Whether the identity can read the Sync List and its Items. + */ + read: boolean; + /** + * Whether the identity can create, update, and delete Items in the Sync List. + */ + write: boolean; + /** + * Whether the identity can delete the Sync List. + */ + manage: boolean; + /** + * The absolute URL of the Sync List Permission resource. + */ + url: string; + private get _proxy(); + /** + * Remove a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Update a SyncListPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + update(params: SyncListPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncListPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + listSid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncListPermissionSolution { + serviceSid: string; + listSid: string; +} +export interface SyncListPermissionListInstance { + _version: V1; + _solution: SyncListPermissionSolution; + _uri: string; + (identity: string): SyncListPermissionContext; + get(identity: string): SyncListPermissionContext; + /** + * Streams SyncListPermissionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListPermissionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncListPermissionInstance, done: (err?: Error) => void) => void): void; + each(params: SyncListPermissionListInstanceEachOptions, callback?: (item: SyncListPermissionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncListPermissionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncListPermissionPage) => any): Promise; + /** + * Lists SyncListPermissionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListPermissionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncListPermissionInstance[]) => any): Promise; + list(params: SyncListPermissionListInstanceOptions, callback?: (error: Error | null, items: SyncListPermissionInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncListPermissionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncListPermissionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncListPermissionPage) => any): Promise; + page(params: SyncListPermissionListInstancePageOptions, callback?: (error: Error | null, items: SyncListPermissionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncListPermissionListInstance(version: V1, serviceSid: string, listSid: string): SyncListPermissionListInstance; +export declare class SyncListPermissionPage extends Page { + /** + * Initialize the SyncListPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SyncListPermissionSolution); + /** + * Build an instance of SyncListPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncListPermissionResource): SyncListPermissionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListPermission.js b/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListPermission.js new file mode 100644 index 00000000..b0f399f3 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncList/syncListPermission.js @@ -0,0 +1,253 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncListPermissionPage = exports.SyncListPermissionListInstance = exports.SyncListPermissionInstance = exports.SyncListPermissionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SyncListPermissionContextImpl { + constructor(_version, serviceSid, listSid, identity) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(listSid)) { + throw new Error("Parameter 'listSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + this._solution = { serviceSid, listSid, identity }; + this._uri = `/Services/${serviceSid}/Lists/${listSid}/Permissions/${identity}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncListPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["read"] === null || params["read"] === undefined) { + throw new Error("Required parameter \"params['read']\" missing."); + } + if (params["write"] === null || params["write"] === undefined) { + throw new Error("Required parameter \"params['write']\" missing."); + } + if (params["manage"] === null || params["manage"] === undefined) { + throw new Error("Required parameter \"params['manage']\" missing."); + } + let data = {}; + data["Read"] = serialize.bool(params["read"]); + data["Write"] = serialize.bool(params["write"]); + data["Manage"] = serialize.bool(params["manage"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.listSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListPermissionContextImpl = SyncListPermissionContextImpl; +class SyncListPermissionInstance { + constructor(_version, payload, serviceSid, listSid, identity) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.listSid = payload.list_sid; + this.identity = payload.identity; + this.read = payload.read; + this.write = payload.write; + this.manage = payload.manage; + this.url = payload.url; + this._solution = { + serviceSid, + listSid, + identity: identity || this.identity, + }; + } + get _proxy() { + this._context = + this._context || + new SyncListPermissionContextImpl(this._version, this._solution.serviceSid, this._solution.listSid, this._solution.identity); + return this._context; + } + /** + * Remove a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncListPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncListPermissionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + listSid: this.listSid, + identity: this.identity, + read: this.read, + write: this.write, + manage: this.manage, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListPermissionInstance = SyncListPermissionInstance; +function SyncListPermissionListInstance(version, serviceSid, listSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(listSid)) { + throw new Error("Parameter 'listSid' is not valid."); + } + const instance = ((identity) => instance.get(identity)); + instance.get = function get(identity) { + return new SyncListPermissionContextImpl(version, serviceSid, listSid, identity); + }; + instance._version = version; + instance._solution = { serviceSid, listSid }; + instance._uri = `/Services/${serviceSid}/Lists/${listSid}/Permissions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncListPermissionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncListPermissionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncListPermissionListInstance = SyncListPermissionListInstance; +class SyncListPermissionPage extends Page_1.default { + /** + * Initialize the SyncListPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncListPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncListPermissionInstance(this._version, payload, this._solution.serviceSid, this._solution.listSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncListPermissionPage = SyncListPermissionPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncMap.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/syncMap.d.ts new file mode 100644 index 00000000..7bb38457 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncMap.d.ts @@ -0,0 +1,354 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { SyncMapItemListInstance } from "./syncMap/syncMapItem"; +import { SyncMapPermissionListInstance } from "./syncMap/syncMapPermission"; +/** + * Options to pass to update a SyncMapInstance + */ +export interface SyncMapContextUpdateOptions { + /** An alias for `collection_ttl`. If both parameters are provided, this value is ignored. */ + ttl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. */ + collectionTtl?: number; +} +/** + * Options to pass to create a SyncMapInstance + */ +export interface SyncMapListInstanceCreateOptions { + /** An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. */ + uniqueName?: string; + /** An alias for `collection_ttl`. If both parameters are provided, this value is ignored. */ + ttl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. */ + collectionTtl?: number; +} +/** + * Options to pass to each + */ +export interface SyncMapListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncMapInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncMapListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncMapListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncMapContext { + syncMapItems: SyncMapItemListInstance; + syncMapPermissions: SyncMapPermissionListInstance; + /** + * Remove a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Update a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + update(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Update a SyncMapInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + update(params: SyncMapContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncMapContextSolution { + serviceSid: string; + sid: string; +} +export declare class SyncMapContextImpl implements SyncMapContext { + protected _version: V1; + protected _solution: SyncMapContextSolution; + protected _uri: string; + protected _syncMapItems?: SyncMapItemListInstance; + protected _syncMapPermissions?: SyncMapPermissionListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get syncMapItems(): SyncMapItemListInstance; + get syncMapPermissions(): SyncMapPermissionListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + update(params?: SyncMapContextUpdateOptions | ((error: Error | null, item?: SyncMapInstance) => any), callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncMapContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncMapPayload extends TwilioResponsePayload { + maps: SyncMapResource[]; +} +interface SyncMapResource { + sid: string; + unique_name: string; + account_sid: string; + service_sid: string; + url: string; + links: Record; + revision: string; + date_expires: Date; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncMapInstance { + protected _version: V1; + protected _solution: SyncMapContextSolution; + protected _context?: SyncMapContext; + constructor(_version: V1, payload: SyncMapResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Sync Map resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync Map resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The absolute URL of the Sync Map resource. + */ + url: string; + /** + * The URLs of the Sync Map\'s nested resources. + */ + links: Record; + /** + * The current revision of the Sync Map, represented as a string. + */ + revision: string; + /** + * The date and time in GMT when the Sync Map expires and will be deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If the Sync Map does not expire, this value is `null`. The Sync Map might not be deleted immediately after it expires. + */ + dateExpires: Date; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The identity of the Sync Map\'s creator. If the Sync Map is created from the client SDK, the value matches the Access Token\'s `identity` field. If the Sync Map was created from the REST API, the value is `system`. + */ + createdBy: string; + private get _proxy(); + /** + * Remove a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Update a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + update(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Update a SyncMapInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + update(params: SyncMapContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Access the syncMapItems. + */ + syncMapItems(): SyncMapItemListInstance; + /** + * Access the syncMapPermissions. + */ + syncMapPermissions(): SyncMapPermissionListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + revision: string; + dateExpires: Date; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncMapSolution { + serviceSid: string; +} +export interface SyncMapListInstance { + _version: V1; + _solution: SyncMapSolution; + _uri: string; + (sid: string): SyncMapContext; + get(sid: string): SyncMapContext; + /** + * Create a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + create(callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Create a SyncMapInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + create(params: SyncMapListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncMapInstance) => any): Promise; + /** + * Streams SyncMapInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncMapInstance, done: (err?: Error) => void) => void): void; + each(params: SyncMapListInstanceEachOptions, callback?: (item: SyncMapInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncMapInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncMapPage) => any): Promise; + /** + * Lists SyncMapInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncMapInstance[]) => any): Promise; + list(params: SyncMapListInstanceOptions, callback?: (error: Error | null, items: SyncMapInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncMapInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncMapPage) => any): Promise; + page(params: SyncMapListInstancePageOptions, callback?: (error: Error | null, items: SyncMapPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncMapListInstance(version: V1, serviceSid: string): SyncMapListInstance; +export declare class SyncMapPage extends Page { + /** + * Initialize the SyncMapPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SyncMapSolution); + /** + * Build an instance of SyncMapInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncMapResource): SyncMapInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncMap.js b/node_modules/twilio/lib/rest/sync/v1/service/syncMap.js new file mode 100644 index 00000000..c7df3d83 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncMap.js @@ -0,0 +1,298 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncMapPage = exports.SyncMapListInstance = exports.SyncMapInstance = exports.SyncMapContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const syncMapItem_1 = require("./syncMap/syncMapItem"); +const syncMapPermission_1 = require("./syncMap/syncMapPermission"); +class SyncMapContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Maps/${sid}`; + } + get syncMapItems() { + this._syncMapItems = + this._syncMapItems || + (0, syncMapItem_1.SyncMapItemListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._syncMapItems; + } + get syncMapPermissions() { + this._syncMapPermissions = + this._syncMapPermissions || + (0, syncMapPermission_1.SyncMapPermissionListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._syncMapPermissions; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncMapInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["collectionTtl"] !== undefined) + data["CollectionTtl"] = params["collectionTtl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapContextImpl = SyncMapContextImpl; +class SyncMapInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.url = payload.url; + this.links = payload.links; + this.revision = payload.revision; + this.dateExpires = deserialize.iso8601DateTime(payload.date_expires); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SyncMapContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncMapInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the syncMapItems. + */ + syncMapItems() { + return this._proxy.syncMapItems; + } + /** + * Access the syncMapPermissions. + */ + syncMapPermissions() { + return this._proxy.syncMapPermissions; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + url: this.url, + links: this.links, + revision: this.revision, + dateExpires: this.dateExpires, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapInstance = SyncMapInstance; +function SyncMapListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SyncMapContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Maps`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["collectionTtl"] !== undefined) + data["CollectionTtl"] = params["collectionTtl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncMapPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncMapListInstance = SyncMapListInstance; +class SyncMapPage extends Page_1.default { + /** + * Initialize the SyncMapPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncMapInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncMapInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapPage = SyncMapPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.d.ts new file mode 100644 index 00000000..4ac65bdd --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.d.ts @@ -0,0 +1,387 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type SyncMapItemQueryFromBoundType = "inclusive" | "exclusive"; +export type SyncMapItemQueryResultOrder = "asc" | "desc"; +/** + * Options to pass to remove a SyncMapItemInstance + */ +export interface SyncMapItemContextRemoveOptions { + /** If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ + ifMatch?: string; +} +/** + * Options to pass to update a SyncMapItemInstance + */ +export interface SyncMapItemContextUpdateOptions { + /** If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ + ifMatch?: string; + /** A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. */ + data?: any; + /** An alias for `item_ttl`. If both parameters are provided, this value is ignored. */ + ttl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. */ + itemTtl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item\\\'s parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item\\\'s `data` or `ttl` is updated in the same request. */ + collectionTtl?: number; +} +/** + * Options to pass to create a SyncMapItemInstance + */ +export interface SyncMapItemListInstanceCreateOptions { + /** The unique, user-defined key for the Map Item. Can be up to 320 characters long. */ + key: string; + /** A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. */ + data: any; + /** An alias for `item_ttl`. If both parameters are provided, this value is ignored. */ + ttl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. */ + itemTtl?: number; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item\\\'s parent Sync Map expires (time-to-live) and is deleted. */ + collectionTtl?: number; +} +/** + * Options to pass to each + */ +export interface SyncMapItemListInstanceEachOptions { + /** How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. */ + order?: SyncMapItemQueryResultOrder; + /** The `key` of the first Sync Map Item resource to read. See also `bounds`. */ + from?: string; + /** Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. */ + bounds?: SyncMapItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncMapItemListInstanceOptions { + /** How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. */ + order?: SyncMapItemQueryResultOrder; + /** The `key` of the first Sync Map Item resource to read. See also `bounds`. */ + from?: string; + /** Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. */ + bounds?: SyncMapItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncMapItemListInstancePageOptions { + /** How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. */ + order?: SyncMapItemQueryResultOrder; + /** The `key` of the first Sync Map Item resource to read. See also `bounds`. */ + from?: string; + /** Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. */ + bounds?: SyncMapItemQueryFromBoundType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncMapItemContext { + /** + * Remove a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + remove(params: SyncMapItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Update a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + update(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Update a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + update(params: SyncMapItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncMapItemContextSolution { + serviceSid: string; + mapSid: string; + key: string; +} +export declare class SyncMapItemContextImpl implements SyncMapItemContext { + protected _version: V1; + protected _solution: SyncMapItemContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, mapSid: string, key: string); + remove(params?: SyncMapItemContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + update(params?: SyncMapItemContextUpdateOptions | ((error: Error | null, item?: SyncMapItemInstance) => any), callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncMapItemContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncMapItemPayload extends TwilioResponsePayload { + items: SyncMapItemResource[]; +} +interface SyncMapItemResource { + key: string; + account_sid: string; + service_sid: string; + map_sid: string; + url: string; + revision: string; + data: any; + date_expires: Date; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncMapItemInstance { + protected _version: V1; + protected _solution: SyncMapItemContextSolution; + protected _context?: SyncMapItemContext; + constructor(_version: V1, payload: SyncMapItemResource, serviceSid: string, mapSid: string, key?: string); + /** + * The unique, user-defined key for the Map Item. + */ + key: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Map Item resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Sync Map that contains the Map Item. + */ + mapSid: string; + /** + * The absolute URL of the Map Item resource. + */ + url: string; + /** + * The current revision of the Map Item, represented as a string. + */ + revision: string; + /** + * An arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + */ + data: any; + /** + * The date and time in GMT when the Map Item expires and will be deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If the Map Item does not expire, this value is `null`. The Map Item might not be deleted immediately after it expires. + */ + dateExpires: Date; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The identity of the Map Item\'s creator. If the Map Item is created from the client SDK, the value matches the Access Token\'s `identity` field. If the Map Item was created from the REST API, the value is `system`. + */ + createdBy: string; + private get _proxy(); + /** + * Remove a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + remove(params: SyncMapItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Update a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + update(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Update a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + update(params: SyncMapItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + key: string; + accountSid: string; + serviceSid: string; + mapSid: string; + url: string; + revision: string; + data: any; + dateExpires: Date; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncMapItemSolution { + serviceSid: string; + mapSid: string; +} +export interface SyncMapItemListInstance { + _version: V1; + _solution: SyncMapItemSolution; + _uri: string; + (key: string): SyncMapItemContext; + get(key: string): SyncMapItemContext; + /** + * Create a SyncMapItemInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + create(params: SyncMapItemListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise; + /** + * Streams SyncMapItemInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapItemListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void): void; + each(params: SyncMapItemListInstanceEachOptions, callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncMapItemInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise; + /** + * Lists SyncMapItemInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapItemListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncMapItemInstance[]) => any): Promise; + list(params: SyncMapItemListInstanceOptions, callback?: (error: Error | null, items: SyncMapItemInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncMapItemInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapItemListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise; + page(params: SyncMapItemListInstancePageOptions, callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncMapItemListInstance(version: V1, serviceSid: string, mapSid: string): SyncMapItemListInstance; +export declare class SyncMapItemPage extends Page { + /** + * Initialize the SyncMapItemPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SyncMapItemSolution); + /** + * Build an instance of SyncMapItemInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncMapItemResource): SyncMapItemInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.js b/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.js new file mode 100644 index 00000000..0375f490 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.js @@ -0,0 +1,300 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncMapItemPage = exports.SyncMapItemListInstance = exports.SyncMapItemInstance = exports.SyncMapItemContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SyncMapItemContextImpl { + constructor(_version, serviceSid, mapSid, key) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(mapSid)) { + throw new Error("Parameter 'mapSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(key)) { + throw new Error("Parameter 'key' is not valid."); + } + this._solution = { serviceSid, mapSid, key }; + this._uri = `/Services/${serviceSid}/Maps/${mapSid}/Items/${key}`; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["data"] !== undefined) + data["Data"] = serialize.object(params["data"]); + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["itemTtl"] !== undefined) + data["ItemTtl"] = params["itemTtl"]; + if (params["collectionTtl"] !== undefined) + data["CollectionTtl"] = params["collectionTtl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.key)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapItemContextImpl = SyncMapItemContextImpl; +class SyncMapItemInstance { + constructor(_version, payload, serviceSid, mapSid, key) { + this._version = _version; + this.key = payload.key; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.mapSid = payload.map_sid; + this.url = payload.url; + this.revision = payload.revision; + this.data = payload.data; + this.dateExpires = deserialize.iso8601DateTime(payload.date_expires); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, mapSid, key: key || this.key }; + } + get _proxy() { + this._context = + this._context || + new SyncMapItemContextImpl(this._version, this._solution.serviceSid, this._solution.mapSid, this._solution.key); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a SyncMapItemInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapItemInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + key: this.key, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + mapSid: this.mapSid, + url: this.url, + revision: this.revision, + data: this.data, + dateExpires: this.dateExpires, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapItemInstance = SyncMapItemInstance; +function SyncMapItemListInstance(version, serviceSid, mapSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(mapSid)) { + throw new Error("Parameter 'mapSid' is not valid."); + } + const instance = ((key) => instance.get(key)); + instance.get = function get(key) { + return new SyncMapItemContextImpl(version, serviceSid, mapSid, key); + }; + instance._version = version; + instance._solution = { serviceSid, mapSid }; + instance._uri = `/Services/${serviceSid}/Maps/${mapSid}/Items`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["key"] === null || params["key"] === undefined) { + throw new Error("Required parameter \"params['key']\" missing."); + } + if (params["data"] === null || params["data"] === undefined) { + throw new Error("Required parameter \"params['data']\" missing."); + } + let data = {}; + data["Key"] = params["key"]; + data["Data"] = serialize.object(params["data"]); + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + if (params["itemTtl"] !== undefined) + data["ItemTtl"] = params["itemTtl"]; + if (params["collectionTtl"] !== undefined) + data["CollectionTtl"] = params["collectionTtl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["bounds"] !== undefined) + data["Bounds"] = params["bounds"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapItemPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncMapItemPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncMapItemListInstance = SyncMapItemListInstance; +class SyncMapItemPage extends Page_1.default { + /** + * Initialize the SyncMapItemPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncMapItemInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncMapItemInstance(this._version, payload, this._solution.serviceSid, this._solution.mapSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapItemPage = SyncMapItemPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapPermission.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapPermission.d.ts new file mode 100644 index 00000000..29615007 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapPermission.d.ts @@ -0,0 +1,280 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to update a SyncMapPermissionInstance + */ +export interface SyncMapPermissionContextUpdateOptions { + /** Whether the identity can read the Sync Map and its Items. Default value is `false`. */ + read: boolean; + /** Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. */ + write: boolean; + /** Whether the identity can delete the Sync Map. Default value is `false`. */ + manage: boolean; +} +/** + * Options to pass to each + */ +export interface SyncMapPermissionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncMapPermissionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncMapPermissionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncMapPermissionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncMapPermissionContext { + /** + * Remove a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Update a SyncMapPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + update(params: SyncMapPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncMapPermissionContextSolution { + serviceSid: string; + mapSid: string; + identity: string; +} +export declare class SyncMapPermissionContextImpl implements SyncMapPermissionContext { + protected _version: V1; + protected _solution: SyncMapPermissionContextSolution; + protected _uri: string; + constructor(_version: V1, serviceSid: string, mapSid: string, identity: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + update(params: SyncMapPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncMapPermissionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncMapPermissionPayload extends TwilioResponsePayload { + permissions: SyncMapPermissionResource[]; +} +interface SyncMapPermissionResource { + account_sid: string; + service_sid: string; + map_sid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; +} +export declare class SyncMapPermissionInstance { + protected _version: V1; + protected _solution: SyncMapPermissionContextSolution; + protected _context?: SyncMapPermissionContext; + constructor(_version: V1, payload: SyncMapPermissionResource, serviceSid: string, mapSid: string, identity?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync Map Permission resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the Sync Map to which the Permission applies. + */ + mapSid: string; + /** + * The application-defined string that uniquely identifies the resource\'s User within the Service to an FPA token. + */ + identity: string; + /** + * Whether the identity can read the Sync Map and its Items. + */ + read: boolean; + /** + * Whether the identity can create, update, and delete Items in the Sync Map. + */ + write: boolean; + /** + * Whether the identity can delete the Sync Map. + */ + manage: boolean; + /** + * The absolute URL of the Sync Map Permission resource. + */ + url: string; + private get _proxy(); + /** + * Remove a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + fetch(callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Update a SyncMapPermissionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + update(params: SyncMapPermissionContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapPermissionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + mapSid: string; + identity: string; + read: boolean; + write: boolean; + manage: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncMapPermissionSolution { + serviceSid: string; + mapSid: string; +} +export interface SyncMapPermissionListInstance { + _version: V1; + _solution: SyncMapPermissionSolution; + _uri: string; + (identity: string): SyncMapPermissionContext; + get(identity: string): SyncMapPermissionContext; + /** + * Streams SyncMapPermissionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapPermissionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncMapPermissionInstance, done: (err?: Error) => void) => void): void; + each(params: SyncMapPermissionListInstanceEachOptions, callback?: (item: SyncMapPermissionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncMapPermissionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncMapPermissionPage) => any): Promise; + /** + * Lists SyncMapPermissionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapPermissionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncMapPermissionInstance[]) => any): Promise; + list(params: SyncMapPermissionListInstanceOptions, callback?: (error: Error | null, items: SyncMapPermissionInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncMapPermissionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncMapPermissionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncMapPermissionPage) => any): Promise; + page(params: SyncMapPermissionListInstancePageOptions, callback?: (error: Error | null, items: SyncMapPermissionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncMapPermissionListInstance(version: V1, serviceSid: string, mapSid: string): SyncMapPermissionListInstance; +export declare class SyncMapPermissionPage extends Page { + /** + * Initialize the SyncMapPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SyncMapPermissionSolution); + /** + * Build an instance of SyncMapPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncMapPermissionResource): SyncMapPermissionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapPermission.js b/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapPermission.js new file mode 100644 index 00000000..9f2c6e59 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapPermission.js @@ -0,0 +1,253 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncMapPermissionPage = exports.SyncMapPermissionListInstance = exports.SyncMapPermissionInstance = exports.SyncMapPermissionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SyncMapPermissionContextImpl { + constructor(_version, serviceSid, mapSid, identity) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(mapSid)) { + throw new Error("Parameter 'mapSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + this._solution = { serviceSid, mapSid, identity }; + this._uri = `/Services/${serviceSid}/Maps/${mapSid}/Permissions/${identity}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncMapPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["read"] === null || params["read"] === undefined) { + throw new Error("Required parameter \"params['read']\" missing."); + } + if (params["write"] === null || params["write"] === undefined) { + throw new Error("Required parameter \"params['write']\" missing."); + } + if (params["manage"] === null || params["manage"] === undefined) { + throw new Error("Required parameter \"params['manage']\" missing."); + } + let data = {}; + data["Read"] = serialize.bool(params["read"]); + data["Write"] = serialize.bool(params["write"]); + data["Manage"] = serialize.bool(params["manage"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapPermissionInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapPermissionContextImpl = SyncMapPermissionContextImpl; +class SyncMapPermissionInstance { + constructor(_version, payload, serviceSid, mapSid, identity) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.mapSid = payload.map_sid; + this.identity = payload.identity; + this.read = payload.read; + this.write = payload.write; + this.manage = payload.manage; + this.url = payload.url; + this._solution = { + serviceSid, + mapSid, + identity: identity || this.identity, + }; + } + get _proxy() { + this._context = + this._context || + new SyncMapPermissionContextImpl(this._version, this._solution.serviceSid, this._solution.mapSid, this._solution.identity); + return this._context; + } + /** + * Remove a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncMapPermissionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncMapPermissionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + mapSid: this.mapSid, + identity: this.identity, + read: this.read, + write: this.write, + manage: this.manage, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapPermissionInstance = SyncMapPermissionInstance; +function SyncMapPermissionListInstance(version, serviceSid, mapSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(mapSid)) { + throw new Error("Parameter 'mapSid' is not valid."); + } + const instance = ((identity) => instance.get(identity)); + instance.get = function get(identity) { + return new SyncMapPermissionContextImpl(version, serviceSid, mapSid, identity); + }; + instance._version = version; + instance._solution = { serviceSid, mapSid }; + instance._uri = `/Services/${serviceSid}/Maps/${mapSid}/Permissions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncMapPermissionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncMapPermissionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncMapPermissionListInstance = SyncMapPermissionListInstance; +class SyncMapPermissionPage extends Page_1.default { + /** + * Initialize the SyncMapPermissionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncMapPermissionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncMapPermissionInstance(this._version, payload, this._solution.serviceSid, this._solution.mapSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncMapPermissionPage = SyncMapPermissionPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncStream.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/syncStream.d.ts new file mode 100644 index 00000000..5263d4c3 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncStream.d.ts @@ -0,0 +1,336 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { StreamMessageListInstance } from "./syncStream/streamMessage"; +/** + * Options to pass to update a SyncStreamInstance + */ +export interface SyncStreamContextUpdateOptions { + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). */ + ttl?: number; +} +/** + * Options to pass to create a SyncStreamInstance + */ +export interface SyncStreamListInstanceCreateOptions { + /** An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. */ + uniqueName?: string; + /** How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). */ + ttl?: number; +} +/** + * Options to pass to each + */ +export interface SyncStreamListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SyncStreamInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SyncStreamListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SyncStreamListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SyncStreamContext { + streamMessages: StreamMessageListInstance; + /** + * Remove a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + fetch(callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Update a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + update(callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Update a SyncStreamInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + update(params: SyncStreamContextUpdateOptions, callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SyncStreamContextSolution { + serviceSid: string; + sid: string; +} +export declare class SyncStreamContextImpl implements SyncStreamContext { + protected _version: V1; + protected _solution: SyncStreamContextSolution; + protected _uri: string; + protected _streamMessages?: StreamMessageListInstance; + constructor(_version: V1, serviceSid: string, sid: string); + get streamMessages(): StreamMessageListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + update(params?: SyncStreamContextUpdateOptions | ((error: Error | null, item?: SyncStreamInstance) => any), callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SyncStreamContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SyncStreamPayload extends TwilioResponsePayload { + streams: SyncStreamResource[]; +} +interface SyncStreamResource { + sid: string; + unique_name: string; + account_sid: string; + service_sid: string; + url: string; + links: Record; + date_expires: Date; + date_created: Date; + date_updated: Date; + created_by: string; +} +export declare class SyncStreamInstance { + protected _version: V1; + protected _solution: SyncStreamContextSolution; + protected _context?: SyncStreamContext; + constructor(_version: V1, payload: SyncStreamResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Sync Stream resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync Stream resource. + */ + accountSid: string; + /** + * The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The absolute URL of the Message Stream resource. + */ + url: string; + /** + * The URLs of the Stream\'s nested resources. + */ + links: Record; + /** + * The date and time in GMT when the Message Stream expires and will be deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If the Message Stream does not expire, this value is `null`. The Stream might not be deleted immediately after it expires. + */ + dateExpires: Date; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The identity of the Stream\'s creator. If the Stream is created from the client SDK, the value matches the Access Token\'s `identity` field. If the Stream was created from the REST API, the value is \'system\'. + */ + createdBy: string; + private get _proxy(); + /** + * Remove a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + fetch(callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Update a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + update(callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Update a SyncStreamInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + update(params: SyncStreamContextUpdateOptions, callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Access the streamMessages. + */ + streamMessages(): StreamMessageListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + serviceSid: string; + url: string; + links: Record; + dateExpires: Date; + dateCreated: Date; + dateUpdated: Date; + createdBy: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SyncStreamSolution { + serviceSid: string; +} +export interface SyncStreamListInstance { + _version: V1; + _solution: SyncStreamSolution; + _uri: string; + (sid: string): SyncStreamContext; + get(sid: string): SyncStreamContext; + /** + * Create a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + create(callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Create a SyncStreamInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + create(params: SyncStreamListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncStreamInstance) => any): Promise; + /** + * Streams SyncStreamInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncStreamListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SyncStreamInstance, done: (err?: Error) => void) => void): void; + each(params: SyncStreamListInstanceEachOptions, callback?: (item: SyncStreamInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SyncStreamInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SyncStreamPage) => any): Promise; + /** + * Lists SyncStreamInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncStreamListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SyncStreamInstance[]) => any): Promise; + list(params: SyncStreamListInstanceOptions, callback?: (error: Error | null, items: SyncStreamInstance[]) => any): Promise; + /** + * Retrieve a single page of SyncStreamInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SyncStreamListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SyncStreamPage) => any): Promise; + page(params: SyncStreamListInstancePageOptions, callback?: (error: Error | null, items: SyncStreamPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SyncStreamListInstance(version: V1, serviceSid: string): SyncStreamListInstance; +export declare class SyncStreamPage extends Page { + /** + * Initialize the SyncStreamPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SyncStreamSolution); + /** + * Build an instance of SyncStreamInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SyncStreamResource): SyncStreamInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncStream.js b/node_modules/twilio/lib/rest/sync/v1/service/syncStream.js new file mode 100644 index 00000000..58c7c93f --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncStream.js @@ -0,0 +1,279 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncStreamPage = exports.SyncStreamListInstance = exports.SyncStreamInstance = exports.SyncStreamContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const streamMessage_1 = require("./syncStream/streamMessage"); +class SyncStreamContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Streams/${sid}`; + } + get streamMessages() { + this._streamMessages = + this._streamMessages || + (0, streamMessage_1.StreamMessageListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._streamMessages; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SyncStreamInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncStreamInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncStreamContextImpl = SyncStreamContextImpl; +class SyncStreamInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.url = payload.url; + this.links = payload.links; + this.dateExpires = deserialize.iso8601DateTime(payload.date_expires); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.createdBy = payload.created_by; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SyncStreamContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SyncStreamInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SyncStreamInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the streamMessages. + */ + streamMessages() { + return this._proxy.streamMessages; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + url: this.url, + links: this.links, + dateExpires: this.dateExpires, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + createdBy: this.createdBy, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncStreamInstance = SyncStreamInstance; +function SyncStreamListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SyncStreamContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Streams`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncStreamInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SyncStreamPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SyncStreamPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SyncStreamListInstance = SyncStreamListInstance; +class SyncStreamPage extends Page_1.default { + /** + * Initialize the SyncStreamPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SyncStreamInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SyncStreamInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SyncStreamPage = SyncStreamPage; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncStream/streamMessage.d.ts b/node_modules/twilio/lib/rest/sync/v1/service/syncStream/streamMessage.d.ts new file mode 100644 index 00000000..d74ba0e6 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncStream/streamMessage.d.ts @@ -0,0 +1,61 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to create a StreamMessageInstance + */ +export interface StreamMessageListInstanceCreateOptions { + /** A JSON string that represents an arbitrary, schema-less object that makes up the Stream Message body. Can be up to 4 KiB in length. */ + data: any; +} +export interface StreamMessageSolution { + serviceSid: string; + streamSid: string; +} +export interface StreamMessageListInstance { + _version: V1; + _solution: StreamMessageSolution; + _uri: string; + /** + * Create a StreamMessageInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed StreamMessageInstance + */ + create(params: StreamMessageListInstanceCreateOptions, callback?: (error: Error | null, item?: StreamMessageInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function StreamMessageListInstance(version: V1, serviceSid: string, streamSid: string): StreamMessageListInstance; +interface StreamMessageResource { + sid: string; + data: any; +} +export declare class StreamMessageInstance { + protected _version: V1; + constructor(_version: V1, payload: StreamMessageResource, serviceSid: string, streamSid: string); + /** + * The unique string that we created to identify the Stream Message resource. + */ + sid: string; + /** + * An arbitrary, schema-less object that contains the Stream Message body. Can be up to 4 KiB in length. + */ + data: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + data: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/sync/v1/service/syncStream/streamMessage.js b/node_modules/twilio/lib/rest/sync/v1/service/syncStream/streamMessage.js new file mode 100644 index 00000000..e2a59d12 --- /dev/null +++ b/node_modules/twilio/lib/rest/sync/v1/service/syncStream/streamMessage.js @@ -0,0 +1,83 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Sync + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StreamMessageInstance = exports.StreamMessageListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function StreamMessageListInstance(version, serviceSid, streamSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(streamSid)) { + throw new Error("Parameter 'streamSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { serviceSid, streamSid }; + instance._uri = `/Services/${serviceSid}/Streams/${streamSid}/Messages`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["data"] === null || params["data"] === undefined) { + throw new Error("Required parameter \"params['data']\" missing."); + } + let data = {}; + data["Data"] = serialize.object(params["data"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new StreamMessageInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.streamSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.StreamMessageListInstance = StreamMessageListInstance; +class StreamMessageInstance { + constructor(_version, payload, serviceSid, streamSid) { + this._version = _version; + this.sid = payload.sid; + this.data = payload.data; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + data: this.data, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.StreamMessageInstance = StreamMessageInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/V1.d.ts b/node_modules/twilio/lib/rest/taskrouter/V1.d.ts new file mode 100644 index 00000000..6da0488b --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/V1.d.ts @@ -0,0 +1,15 @@ +import TaskrouterBase from "../TaskrouterBase"; +import Version from "../../base/Version"; +import { WorkspaceListInstance } from "./v1/workspace"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Taskrouter + * + * @param domain - The Twilio (Twilio.Taskrouter) domain + */ + constructor(domain: TaskrouterBase); + /** workspaces - { Twilio.Taskrouter.V1.WorkspaceListInstance } resource */ + protected _workspaces?: WorkspaceListInstance; + /** Getter for workspaces resource */ + get workspaces(): WorkspaceListInstance; +} diff --git a/node_modules/twilio/lib/rest/taskrouter/V1.js b/node_modules/twilio/lib/rest/taskrouter/V1.js new file mode 100644 index 00000000..d474b85e --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/V1.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const workspace_1 = require("./v1/workspace"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Taskrouter + * + * @param domain - The Twilio (Twilio.Taskrouter) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for workspaces resource */ + get workspaces() { + this._workspaces = this._workspaces || (0, workspace_1.WorkspaceListInstance)(this); + return this._workspaces; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace.d.ts new file mode 100644 index 00000000..f27838d9 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace.d.ts @@ -0,0 +1,452 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { ActivityListInstance } from "./workspace/activity"; +import { EventListInstance } from "./workspace/event"; +import { TaskListInstance } from "./workspace/task"; +import { TaskChannelListInstance } from "./workspace/taskChannel"; +import { TaskQueueListInstance } from "./workspace/taskQueue"; +import { WorkerListInstance } from "./workspace/worker"; +import { WorkflowListInstance } from "./workspace/workflow"; +import { WorkspaceCumulativeStatisticsListInstance } from "./workspace/workspaceCumulativeStatistics"; +import { WorkspaceRealTimeStatisticsListInstance } from "./workspace/workspaceRealTimeStatistics"; +import { WorkspaceStatisticsListInstance } from "./workspace/workspaceStatistics"; +export type WorkspaceQueueOrder = "FIFO" | "LIFO"; +/** + * Options to pass to update a WorkspaceInstance + */ +export interface WorkspaceContextUpdateOptions { + /** The SID of the Activity that will be used when new Workers are created in the Workspace. */ + defaultActivitySid?: string; + /** The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio\\\'s [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). */ + eventCallbackUrl?: string; + /** The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. */ + eventsFilter?: string; + /** A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. */ + friendlyName?: string; + /** Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can\\\'t be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). */ + multiTaskEnabled?: boolean; + /** The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. */ + timeoutActivitySid?: string; + /** */ + prioritizeQueueOrder?: WorkspaceQueueOrder; +} +/** + * Options to pass to create a WorkspaceInstance + */ +export interface WorkspaceListInstanceCreateOptions { + /** A descriptive string that you create to describe the Workspace resource. It can be up to 64 characters long. For example: `Customer Support` or `2014 Election Campaign`. */ + friendlyName: string; + /** The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio\\\'s [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). */ + eventCallbackUrl?: string; + /** The list of Workspace events for which to call event_callback_url. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. */ + eventsFilter?: string; + /** Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be created as multi-tasking. The default is `true`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). */ + multiTaskEnabled?: boolean; + /** An available template name. Can be: `NONE` or `FIFO` and the default is `NONE`. Pre-configures the Workspace with the Workflow and Activities specified in the template. `NONE` will create a Workspace with only a set of default activities. `FIFO` will configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter. */ + template?: string; + /** */ + prioritizeQueueOrder?: WorkspaceQueueOrder; +} +/** + * Options to pass to each + */ +export interface WorkspaceListInstanceEachOptions { + /** The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WorkspaceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WorkspaceListInstanceOptions { + /** The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WorkspaceListInstancePageOptions { + /** The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WorkspaceContext { + activities: ActivityListInstance; + events: EventListInstance; + tasks: TaskListInstance; + taskChannels: TaskChannelListInstance; + taskQueues: TaskQueueListInstance; + workers: WorkerListInstance; + workflows: WorkflowListInstance; + cumulativeStatistics: WorkspaceCumulativeStatisticsListInstance; + realTimeStatistics: WorkspaceRealTimeStatisticsListInstance; + statistics: WorkspaceStatisticsListInstance; + /** + * Remove a WorkspaceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WorkspaceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceInstance + */ + fetch(callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + /** + * Update a WorkspaceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceInstance + */ + update(callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + /** + * Update a WorkspaceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceInstance + */ + update(params: WorkspaceContextUpdateOptions, callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkspaceContextSolution { + sid: string; +} +export declare class WorkspaceContextImpl implements WorkspaceContext { + protected _version: V1; + protected _solution: WorkspaceContextSolution; + protected _uri: string; + protected _activities?: ActivityListInstance; + protected _events?: EventListInstance; + protected _tasks?: TaskListInstance; + protected _taskChannels?: TaskChannelListInstance; + protected _taskQueues?: TaskQueueListInstance; + protected _workers?: WorkerListInstance; + protected _workflows?: WorkflowListInstance; + protected _cumulativeStatistics?: WorkspaceCumulativeStatisticsListInstance; + protected _realTimeStatistics?: WorkspaceRealTimeStatisticsListInstance; + protected _statistics?: WorkspaceStatisticsListInstance; + constructor(_version: V1, sid: string); + get activities(): ActivityListInstance; + get events(): EventListInstance; + get tasks(): TaskListInstance; + get taskChannels(): TaskChannelListInstance; + get taskQueues(): TaskQueueListInstance; + get workers(): WorkerListInstance; + get workflows(): WorkflowListInstance; + get cumulativeStatistics(): WorkspaceCumulativeStatisticsListInstance; + get realTimeStatistics(): WorkspaceRealTimeStatisticsListInstance; + get statistics(): WorkspaceStatisticsListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + update(params?: WorkspaceContextUpdateOptions | ((error: Error | null, item?: WorkspaceInstance) => any), callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkspaceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkspacePayload extends TwilioResponsePayload { + workspaces: WorkspaceResource[]; +} +interface WorkspaceResource { + account_sid: string; + date_created: Date; + date_updated: Date; + default_activity_name: string; + default_activity_sid: string; + event_callback_url: string; + events_filter: string; + friendly_name: string; + multi_task_enabled: boolean; + sid: string; + timeout_activity_name: string; + timeout_activity_sid: string; + prioritize_queue_order: WorkspaceQueueOrder; + url: string; + links: Record; +} +export declare class WorkspaceInstance { + protected _version: V1; + protected _solution: WorkspaceContextSolution; + protected _context?: WorkspaceContext; + constructor(_version: V1, payload: WorkspaceResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workspace resource. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The name of the default activity. + */ + defaultActivityName: string; + /** + * The SID of the Activity that will be used when new Workers are created in the Workspace. + */ + defaultActivitySid: string; + /** + * The URL we call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio\'s [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + */ + eventCallbackUrl: string; + /** + * The list of Workspace events for which to call `event_callback_url`. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + */ + eventsFilter: string; + /** + * The string that you assigned to describe the Workspace resource. For example `Customer Support` or `2014 Election Campaign`. + */ + friendlyName: string; + /** + * Whether multi-tasking is enabled. The default is `true`, which enables multi-tasking. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking each Worker would only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + */ + multiTaskEnabled: boolean; + /** + * The unique string that we created to identify the Workspace resource. + */ + sid: string; + /** + * The name of the timeout activity. + */ + timeoutActivityName: string; + /** + * The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. + */ + timeoutActivitySid: string; + prioritizeQueueOrder: WorkspaceQueueOrder; + /** + * The absolute URL of the Workspace resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a WorkspaceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WorkspaceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceInstance + */ + fetch(callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + /** + * Update a WorkspaceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceInstance + */ + update(callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + /** + * Update a WorkspaceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceInstance + */ + update(params: WorkspaceContextUpdateOptions, callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + /** + * Access the activities. + */ + activities(): ActivityListInstance; + /** + * Access the events. + */ + events(): EventListInstance; + /** + * Access the tasks. + */ + tasks(): TaskListInstance; + /** + * Access the taskChannels. + */ + taskChannels(): TaskChannelListInstance; + /** + * Access the taskQueues. + */ + taskQueues(): TaskQueueListInstance; + /** + * Access the workers. + */ + workers(): WorkerListInstance; + /** + * Access the workflows. + */ + workflows(): WorkflowListInstance; + /** + * Access the cumulativeStatistics. + */ + cumulativeStatistics(): WorkspaceCumulativeStatisticsListInstance; + /** + * Access the realTimeStatistics. + */ + realTimeStatistics(): WorkspaceRealTimeStatisticsListInstance; + /** + * Access the statistics. + */ + statistics(): WorkspaceStatisticsListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + defaultActivityName: string; + defaultActivitySid: string; + eventCallbackUrl: string; + eventsFilter: string; + friendlyName: string; + multiTaskEnabled: boolean; + sid: string; + timeoutActivityName: string; + timeoutActivitySid: string; + prioritizeQueueOrder: WorkspaceQueueOrder; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkspaceSolution { +} +export interface WorkspaceListInstance { + _version: V1; + _solution: WorkspaceSolution; + _uri: string; + (sid: string): WorkspaceContext; + get(sid: string): WorkspaceContext; + /** + * Create a WorkspaceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceInstance + */ + create(params: WorkspaceListInstanceCreateOptions, callback?: (error: Error | null, item?: WorkspaceInstance) => any): Promise; + /** + * Streams WorkspaceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkspaceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WorkspaceInstance, done: (err?: Error) => void) => void): void; + each(params: WorkspaceListInstanceEachOptions, callback?: (item: WorkspaceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WorkspaceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WorkspacePage) => any): Promise; + /** + * Lists WorkspaceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkspaceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WorkspaceInstance[]) => any): Promise; + list(params: WorkspaceListInstanceOptions, callback?: (error: Error | null, items: WorkspaceInstance[]) => any): Promise; + /** + * Retrieve a single page of WorkspaceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkspaceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WorkspacePage) => any): Promise; + page(params: WorkspaceListInstancePageOptions, callback?: (error: Error | null, items: WorkspacePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkspaceListInstance(version: V1): WorkspaceListInstance; +export declare class WorkspacePage extends Page { + /** + * Initialize the WorkspacePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: WorkspaceSolution); + /** + * Build an instance of WorkspaceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WorkspaceResource): WorkspaceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace.js new file mode 100644 index 00000000..71ec71ab --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace.js @@ -0,0 +1,418 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkspacePage = exports.WorkspaceListInstance = exports.WorkspaceInstance = exports.WorkspaceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const activity_1 = require("./workspace/activity"); +const event_1 = require("./workspace/event"); +const task_1 = require("./workspace/task"); +const taskChannel_1 = require("./workspace/taskChannel"); +const taskQueue_1 = require("./workspace/taskQueue"); +const worker_1 = require("./workspace/worker"); +const workflow_1 = require("./workspace/workflow"); +const workspaceCumulativeStatistics_1 = require("./workspace/workspaceCumulativeStatistics"); +const workspaceRealTimeStatistics_1 = require("./workspace/workspaceRealTimeStatistics"); +const workspaceStatistics_1 = require("./workspace/workspaceStatistics"); +class WorkspaceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Workspaces/${sid}`; + } + get activities() { + this._activities = + this._activities || + (0, activity_1.ActivityListInstance)(this._version, this._solution.sid); + return this._activities; + } + get events() { + this._events = + this._events || (0, event_1.EventListInstance)(this._version, this._solution.sid); + return this._events; + } + get tasks() { + this._tasks = + this._tasks || (0, task_1.TaskListInstance)(this._version, this._solution.sid); + return this._tasks; + } + get taskChannels() { + this._taskChannels = + this._taskChannels || + (0, taskChannel_1.TaskChannelListInstance)(this._version, this._solution.sid); + return this._taskChannels; + } + get taskQueues() { + this._taskQueues = + this._taskQueues || + (0, taskQueue_1.TaskQueueListInstance)(this._version, this._solution.sid); + return this._taskQueues; + } + get workers() { + this._workers = + this._workers || (0, worker_1.WorkerListInstance)(this._version, this._solution.sid); + return this._workers; + } + get workflows() { + this._workflows = + this._workflows || + (0, workflow_1.WorkflowListInstance)(this._version, this._solution.sid); + return this._workflows; + } + get cumulativeStatistics() { + this._cumulativeStatistics = + this._cumulativeStatistics || + (0, workspaceCumulativeStatistics_1.WorkspaceCumulativeStatisticsListInstance)(this._version, this._solution.sid); + return this._cumulativeStatistics; + } + get realTimeStatistics() { + this._realTimeStatistics = + this._realTimeStatistics || + (0, workspaceRealTimeStatistics_1.WorkspaceRealTimeStatisticsListInstance)(this._version, this._solution.sid); + return this._realTimeStatistics; + } + get statistics() { + this._statistics = + this._statistics || + (0, workspaceStatistics_1.WorkspaceStatisticsListInstance)(this._version, this._solution.sid); + return this._statistics; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WorkspaceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["defaultActivitySid"] !== undefined) + data["DefaultActivitySid"] = params["defaultActivitySid"]; + if (params["eventCallbackUrl"] !== undefined) + data["EventCallbackUrl"] = params["eventCallbackUrl"]; + if (params["eventsFilter"] !== undefined) + data["EventsFilter"] = params["eventsFilter"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["multiTaskEnabled"] !== undefined) + data["MultiTaskEnabled"] = serialize.bool(params["multiTaskEnabled"]); + if (params["timeoutActivitySid"] !== undefined) + data["TimeoutActivitySid"] = params["timeoutActivitySid"]; + if (params["prioritizeQueueOrder"] !== undefined) + data["PrioritizeQueueOrder"] = params["prioritizeQueueOrder"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkspaceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspaceContextImpl = WorkspaceContextImpl; +class WorkspaceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.defaultActivityName = payload.default_activity_name; + this.defaultActivitySid = payload.default_activity_sid; + this.eventCallbackUrl = payload.event_callback_url; + this.eventsFilter = payload.events_filter; + this.friendlyName = payload.friendly_name; + this.multiTaskEnabled = payload.multi_task_enabled; + this.sid = payload.sid; + this.timeoutActivityName = payload.timeout_activity_name; + this.timeoutActivitySid = payload.timeout_activity_sid; + this.prioritizeQueueOrder = payload.prioritize_queue_order; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WorkspaceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a WorkspaceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a WorkspaceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the activities. + */ + activities() { + return this._proxy.activities; + } + /** + * Access the events. + */ + events() { + return this._proxy.events; + } + /** + * Access the tasks. + */ + tasks() { + return this._proxy.tasks; + } + /** + * Access the taskChannels. + */ + taskChannels() { + return this._proxy.taskChannels; + } + /** + * Access the taskQueues. + */ + taskQueues() { + return this._proxy.taskQueues; + } + /** + * Access the workers. + */ + workers() { + return this._proxy.workers; + } + /** + * Access the workflows. + */ + workflows() { + return this._proxy.workflows; + } + /** + * Access the cumulativeStatistics. + */ + cumulativeStatistics() { + return this._proxy.cumulativeStatistics; + } + /** + * Access the realTimeStatistics. + */ + realTimeStatistics() { + return this._proxy.realTimeStatistics; + } + /** + * Access the statistics. + */ + statistics() { + return this._proxy.statistics; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + defaultActivityName: this.defaultActivityName, + defaultActivitySid: this.defaultActivitySid, + eventCallbackUrl: this.eventCallbackUrl, + eventsFilter: this.eventsFilter, + friendlyName: this.friendlyName, + multiTaskEnabled: this.multiTaskEnabled, + sid: this.sid, + timeoutActivityName: this.timeoutActivityName, + timeoutActivitySid: this.timeoutActivitySid, + prioritizeQueueOrder: this.prioritizeQueueOrder, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspaceInstance = WorkspaceInstance; +function WorkspaceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WorkspaceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Workspaces`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["eventCallbackUrl"] !== undefined) + data["EventCallbackUrl"] = params["eventCallbackUrl"]; + if (params["eventsFilter"] !== undefined) + data["EventsFilter"] = params["eventsFilter"]; + if (params["multiTaskEnabled"] !== undefined) + data["MultiTaskEnabled"] = serialize.bool(params["multiTaskEnabled"]); + if (params["template"] !== undefined) + data["Template"] = params["template"]; + if (params["prioritizeQueueOrder"] !== undefined) + data["PrioritizeQueueOrder"] = params["prioritizeQueueOrder"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkspaceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkspacePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WorkspacePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkspaceListInstance = WorkspaceListInstance; +class WorkspacePage extends Page_1.default { + /** + * Initialize the WorkspacePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WorkspaceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WorkspaceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspacePage = WorkspacePage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/activity.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/activity.d.ts new file mode 100644 index 00000000..724cfa2f --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/activity.d.ts @@ -0,0 +1,323 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a ActivityInstance + */ +export interface ActivityContextUpdateOptions { + /** A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. */ + friendlyName?: string; +} +/** + * Options to pass to create a ActivityInstance + */ +export interface ActivityListInstanceCreateOptions { + /** A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. */ + friendlyName: string; + /** Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. The value cannot be changed after the Activity is created. */ + available?: boolean; +} +/** + * Options to pass to each + */ +export interface ActivityListInstanceEachOptions { + /** The `friendly_name` of the Activity resources to read. */ + friendlyName?: string; + /** Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of \'1\' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. */ + available?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ActivityInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ActivityListInstanceOptions { + /** The `friendly_name` of the Activity resources to read. */ + friendlyName?: string; + /** Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of \'1\' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. */ + available?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ActivityListInstancePageOptions { + /** The `friendly_name` of the Activity resources to read. */ + friendlyName?: string; + /** Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of \'1\' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. */ + available?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ActivityContext { + /** + * Remove a ActivityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ActivityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ActivityInstance + */ + fetch(callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + /** + * Update a ActivityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ActivityInstance + */ + update(callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + /** + * Update a ActivityInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ActivityInstance + */ + update(params: ActivityContextUpdateOptions, callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ActivityContextSolution { + workspaceSid: string; + sid: string; +} +export declare class ActivityContextImpl implements ActivityContext { + protected _version: V1; + protected _solution: ActivityContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + update(params?: ActivityContextUpdateOptions | ((error: Error | null, item?: ActivityInstance) => any), callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ActivityContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ActivityPayload extends TwilioResponsePayload { + activities: ActivityResource[]; +} +interface ActivityResource { + account_sid: string; + available: boolean; + date_created: Date; + date_updated: Date; + friendly_name: string; + sid: string; + workspace_sid: string; + url: string; + links: Record; +} +export declare class ActivityInstance { + protected _version: V1; + protected _solution: ActivityContextSolution; + protected _context?: ActivityContext; + constructor(_version: V1, payload: ActivityResource, workspaceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Activity resource. + */ + accountSid: string; + /** + * Whether the Worker is eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` indicates the Activity is available. All other values indicate that it is not. The value cannot be changed after the Activity is created. + */ + available: boolean; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the Activity resource. + */ + friendlyName: string; + /** + * The unique string that we created to identify the Activity resource. + */ + sid: string; + /** + * The SID of the Workspace that contains the Activity. + */ + workspaceSid: string; + /** + * The absolute URL of the Activity resource. + */ + url: string; + links: Record; + private get _proxy(); + /** + * Remove a ActivityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ActivityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ActivityInstance + */ + fetch(callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + /** + * Update a ActivityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ActivityInstance + */ + update(callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + /** + * Update a ActivityInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ActivityInstance + */ + update(params: ActivityContextUpdateOptions, callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + available: boolean; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + sid: string; + workspaceSid: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ActivitySolution { + workspaceSid: string; +} +export interface ActivityListInstance { + _version: V1; + _solution: ActivitySolution; + _uri: string; + (sid: string): ActivityContext; + get(sid: string): ActivityContext; + /** + * Create a ActivityInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ActivityInstance + */ + create(params: ActivityListInstanceCreateOptions, callback?: (error: Error | null, item?: ActivityInstance) => any): Promise; + /** + * Streams ActivityInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ActivityListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ActivityInstance, done: (err?: Error) => void) => void): void; + each(params: ActivityListInstanceEachOptions, callback?: (item: ActivityInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ActivityInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ActivityPage) => any): Promise; + /** + * Lists ActivityInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ActivityListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ActivityInstance[]) => any): Promise; + list(params: ActivityListInstanceOptions, callback?: (error: Error | null, items: ActivityInstance[]) => any): Promise; + /** + * Retrieve a single page of ActivityInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ActivityListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ActivityPage) => any): Promise; + page(params: ActivityListInstancePageOptions, callback?: (error: Error | null, items: ActivityPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ActivityListInstance(version: V1, workspaceSid: string): ActivityListInstance; +export declare class ActivityPage extends Page { + /** + * Initialize the ActivityPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ActivitySolution); + /** + * Build an instance of ActivityInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ActivityResource): ActivityInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/activity.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/activity.js new file mode 100644 index 00000000..5d7cc770 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/activity.js @@ -0,0 +1,267 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ActivityPage = exports.ActivityListInstance = exports.ActivityInstance = exports.ActivityContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ActivityContextImpl { + constructor(_version, workspaceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/Activities/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ActivityInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ActivityInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ActivityContextImpl = ActivityContextImpl; +class ActivityInstance { + constructor(_version, payload, workspaceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.available = payload.available; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this.links = payload.links; + this._solution = { workspaceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ActivityContextImpl(this._version, this._solution.workspaceSid, this._solution.sid); + return this._context; + } + /** + * Remove a ActivityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ActivityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ActivityInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + available: this.available, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + sid: this.sid, + workspaceSid: this.workspaceSid, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ActivityInstance = ActivityInstance; +function ActivityListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ActivityContextImpl(version, workspaceSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = `/Workspaces/${workspaceSid}/Activities`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["available"] !== undefined) + data["Available"] = serialize.bool(params["available"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ActivityInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["available"] !== undefined) + data["Available"] = params["available"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ActivityPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ActivityPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ActivityListInstance = ActivityListInstance; +class ActivityPage extends Page_1.default { + /** + * Initialize the ActivityPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ActivityInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ActivityInstance(this._version, payload, this._solution.workspaceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ActivityPage = ActivityPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/event.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/event.d.ts new file mode 100644 index 00000000..c25c65c9 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/event.d.ts @@ -0,0 +1,351 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to each + */ +export interface EventListInstanceEachOptions { + /** Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** The type of Events to read. Returns only Events of the type specified. */ + eventType?: string; + /** The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. */ + minutes?: number; + /** The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. */ + reservationSid?: string; + /** Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. */ + startDate?: Date; + /** The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. */ + taskQueueSid?: string; + /** The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. */ + taskSid?: string; + /** The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. */ + workerSid?: string; + /** The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. */ + workflowSid?: string; + /** The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. */ + taskChannel?: string; + /** The SID of the Event resource to read. */ + sid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EventInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EventListInstanceOptions { + /** Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** The type of Events to read. Returns only Events of the type specified. */ + eventType?: string; + /** The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. */ + minutes?: number; + /** The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. */ + reservationSid?: string; + /** Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. */ + startDate?: Date; + /** The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. */ + taskQueueSid?: string; + /** The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. */ + taskSid?: string; + /** The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. */ + workerSid?: string; + /** The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. */ + workflowSid?: string; + /** The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. */ + taskChannel?: string; + /** The SID of the Event resource to read. */ + sid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EventListInstancePageOptions { + /** Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** The type of Events to read. Returns only Events of the type specified. */ + eventType?: string; + /** The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. */ + minutes?: number; + /** The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. */ + reservationSid?: string; + /** Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. */ + startDate?: Date; + /** The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. */ + taskQueueSid?: string; + /** The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. */ + taskSid?: string; + /** The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. */ + workerSid?: string; + /** The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. */ + workflowSid?: string; + /** The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. */ + taskChannel?: string; + /** The SID of the Event resource to read. */ + sid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EventContext { + /** + * Fetch a EventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventInstance + */ + fetch(callback?: (error: Error | null, item?: EventInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EventContextSolution { + workspaceSid: string; + sid: string; +} +export declare class EventContextImpl implements EventContext { + protected _version: V1; + protected _solution: EventContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: EventInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EventContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EventPayload extends TwilioResponsePayload { + events: EventResource[]; +} +interface EventResource { + account_sid: string; + actor_sid: string; + actor_type: string; + actor_url: string; + description: string; + event_data: any; + event_date: Date; + event_date_ms: number; + event_type: string; + resource_sid: string; + resource_type: string; + resource_url: string; + sid: string; + source: string; + source_ip_address: string; + url: string; + workspace_sid: string; +} +export declare class EventInstance { + protected _version: V1; + protected _solution: EventContextSolution; + protected _context?: EventContext; + constructor(_version: V1, payload: EventResource, workspaceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource. + */ + accountSid: string; + /** + * The SID of the resource that triggered the event. + */ + actorSid: string; + /** + * The type of resource that triggered the event. + */ + actorType: string; + /** + * The absolute URL of the resource that triggered the event. + */ + actorUrl: string; + /** + * A description of the event. + */ + description: string; + /** + * Data about the event. For more information, see [Event types](https://www.twilio.com/docs/taskrouter/api/event#event-types). + */ + eventData: any; + /** + * The time the event was sent, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + eventDate: Date; + /** + * The time the event was sent in milliseconds. + */ + eventDateMs: number; + /** + * The identifier for the event. + */ + eventType: string; + /** + * The SID of the object the event is most relevant to, such as a TaskSid, ReservationSid, or a WorkerSid. + */ + resourceSid: string; + /** + * The type of object the event is most relevant to, such as a Task, Reservation, or a Worker). + */ + resourceType: string; + /** + * The URL of the resource the event is most relevant to. + */ + resourceUrl: string; + /** + * The unique string that we created to identify the Event resource. + */ + sid: string; + /** + * Where the Event originated. + */ + source: string; + /** + * The IP from which the Event originated. + */ + sourceIpAddress: string; + /** + * The absolute URL of the Event resource. + */ + url: string; + /** + * The SID of the Workspace that contains the Event. + */ + workspaceSid: string; + private get _proxy(); + /** + * Fetch a EventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventInstance + */ + fetch(callback?: (error: Error | null, item?: EventInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + actorSid: string; + actorType: string; + actorUrl: string; + description: string; + eventData: any; + eventDate: Date; + eventDateMs: number; + eventType: string; + resourceSid: string; + resourceType: string; + resourceUrl: string; + sid: string; + source: string; + sourceIpAddress: string; + url: string; + workspaceSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EventSolution { + workspaceSid: string; +} +export interface EventListInstance { + _version: V1; + _solution: EventSolution; + _uri: string; + (sid: string): EventContext; + get(sid: string): EventContext; + /** + * Streams EventInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EventInstance, done: (err?: Error) => void) => void): void; + each(params: EventListInstanceEachOptions, callback?: (item: EventInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EventInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EventPage) => any): Promise; + /** + * Lists EventInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EventInstance[]) => any): Promise; + list(params: EventListInstanceOptions, callback?: (error: Error | null, items: EventInstance[]) => any): Promise; + /** + * Retrieve a single page of EventInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EventListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EventPage) => any): Promise; + page(params: EventListInstancePageOptions, callback?: (error: Error | null, items: EventPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EventListInstance(version: V1, workspaceSid: string): EventListInstance; +export declare class EventPage extends Page { + /** + * Initialize the EventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EventSolution); + /** + * Build an instance of EventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EventResource): EventInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/event.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/event.js new file mode 100644 index 00000000..d5060340 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/event.js @@ -0,0 +1,231 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EventPage = exports.EventListInstance = exports.EventInstance = exports.EventContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class EventContextImpl { + constructor(_version, workspaceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/Events/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EventInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventContextImpl = EventContextImpl; +class EventInstance { + constructor(_version, payload, workspaceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.actorSid = payload.actor_sid; + this.actorType = payload.actor_type; + this.actorUrl = payload.actor_url; + this.description = payload.description; + this.eventData = payload.event_data; + this.eventDate = deserialize.iso8601DateTime(payload.event_date); + this.eventDateMs = payload.event_date_ms; + this.eventType = payload.event_type; + this.resourceSid = payload.resource_sid; + this.resourceType = payload.resource_type; + this.resourceUrl = payload.resource_url; + this.sid = payload.sid; + this.source = payload.source; + this.sourceIpAddress = payload.source_ip_address; + this.url = payload.url; + this.workspaceSid = payload.workspace_sid; + this._solution = { workspaceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EventContextImpl(this._version, this._solution.workspaceSid, this._solution.sid); + return this._context; + } + /** + * Fetch a EventInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EventInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + actorSid: this.actorSid, + actorType: this.actorType, + actorUrl: this.actorUrl, + description: this.description, + eventData: this.eventData, + eventDate: this.eventDate, + eventDateMs: this.eventDateMs, + eventType: this.eventType, + resourceSid: this.resourceSid, + resourceType: this.resourceType, + resourceUrl: this.resourceUrl, + sid: this.sid, + source: this.source, + sourceIpAddress: this.sourceIpAddress, + url: this.url, + workspaceSid: this.workspaceSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventInstance = EventInstance; +function EventListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EventContextImpl(version, workspaceSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = `/Workspaces/${workspaceSid}/Events`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["eventType"] !== undefined) + data["EventType"] = params["eventType"]; + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["reservationSid"] !== undefined) + data["ReservationSid"] = params["reservationSid"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["taskQueueSid"] !== undefined) + data["TaskQueueSid"] = params["taskQueueSid"]; + if (params["taskSid"] !== undefined) + data["TaskSid"] = params["taskSid"]; + if (params["workerSid"] !== undefined) + data["WorkerSid"] = params["workerSid"]; + if (params["workflowSid"] !== undefined) + data["WorkflowSid"] = params["workflowSid"]; + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["sid"] !== undefined) + data["Sid"] = params["sid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EventPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EventPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EventListInstance = EventListInstance; +class EventPage extends Page_1.default { + /** + * Initialize the EventPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EventInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EventInstance(this._version, payload, this._solution.workspaceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EventPage = EventPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task.d.ts new file mode 100644 index 00000000..044355dc --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task.d.ts @@ -0,0 +1,505 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { ReservationListInstance } from "./task/reservation"; +export type TaskStatus = "pending" | "reserved" | "assigned" | "canceled" | "completed" | "wrapping"; +/** + * Options to pass to remove a TaskInstance + */ +export interface TaskContextRemoveOptions { + /** If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ + ifMatch?: string; +} +/** + * Options to pass to update a TaskInstance + */ +export interface TaskContextUpdateOptions { + /** If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ + ifMatch?: string; + /** The JSON string that describes the custom attributes of the task. */ + attributes?: string; + /** */ + assignmentStatus?: TaskStatus; + /** The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. */ + reason?: string; + /** The Task\\\'s new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). */ + priority?: number; + /** When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel\\\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** The task\\\'s new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can\\\'t be in the future. */ + virtualStartTime?: Date; +} +/** + * Options to pass to create a TaskInstance + */ +export interface TaskListInstanceCreateOptions { + /** The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. */ + timeout?: number; + /** The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 2^31^ (2,147,483,647). */ + priority?: number; + /** When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. */ + taskChannel?: string; + /** The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. */ + workflowSid?: string; + /** A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow\\\'s `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. */ + attributes?: string; + /** The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can\\\'t be in the future. */ + virtualStartTime?: Date; +} +/** + * Options to pass to each + */ +export interface TaskListInstanceEachOptions { + /** The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. */ + priority?: number; + /** The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. */ + assignmentStatus?: Array; + /** The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. */ + workflowSid?: string; + /** The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. */ + workflowName?: string; + /** The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. */ + taskQueueSid?: string; + /** The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. */ + taskQueueName?: string; + /** The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. */ + evaluateTaskAttributes?: string; + /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */ + ordering?: string; + /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */ + hasAddons?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TaskInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TaskListInstanceOptions { + /** The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. */ + priority?: number; + /** The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. */ + assignmentStatus?: Array; + /** The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. */ + workflowSid?: string; + /** The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. */ + workflowName?: string; + /** The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. */ + taskQueueSid?: string; + /** The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. */ + taskQueueName?: string; + /** The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. */ + evaluateTaskAttributes?: string; + /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */ + ordering?: string; + /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */ + hasAddons?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TaskListInstancePageOptions { + /** The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. */ + priority?: number; + /** The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. */ + assignmentStatus?: Array; + /** The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. */ + workflowSid?: string; + /** The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. */ + workflowName?: string; + /** The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. */ + taskQueueSid?: string; + /** The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. */ + taskQueueName?: string; + /** The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. */ + evaluateTaskAttributes?: string; + /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */ + ordering?: string; + /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */ + hasAddons?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TaskContext { + reservations: ReservationListInstance; + /** + * Remove a TaskInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a TaskInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + remove(params: TaskContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TaskInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + fetch(callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Update a TaskInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + update(callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Update a TaskInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + update(params: TaskContextUpdateOptions, callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TaskContextSolution { + workspaceSid: string; + sid: string; +} +export declare class TaskContextImpl implements TaskContext { + protected _version: V1; + protected _solution: TaskContextSolution; + protected _uri: string; + protected _reservations?: ReservationListInstance; + constructor(_version: V1, workspaceSid: string, sid: string); + get reservations(): ReservationListInstance; + remove(params?: TaskContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + update(params?: TaskContextUpdateOptions | ((error: Error | null, item?: TaskInstance) => any), callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TaskContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TaskPayload extends TwilioResponsePayload { + tasks: TaskResource[]; +} +interface TaskResource { + account_sid: string; + age: number; + assignment_status: TaskStatus; + attributes: string; + addons: string; + date_created: Date; + date_updated: Date; + task_queue_entered_date: Date; + priority: number; + reason: string; + sid: string; + task_queue_sid: string; + task_queue_friendly_name: string; + task_channel_sid: string; + task_channel_unique_name: string; + timeout: number; + workflow_sid: string; + workflow_friendly_name: string; + workspace_sid: string; + url: string; + links: Record; + virtual_start_time: Date; +} +export declare class TaskInstance { + protected _version: V1; + protected _solution: TaskContextSolution; + protected _context?: TaskContext; + constructor(_version: V1, payload: TaskResource, workspaceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task resource. + */ + accountSid: string; + /** + * The number of seconds since the Task was created. + */ + age: number; + assignmentStatus: TaskStatus; + /** + * The JSON string with custom attributes of the work. **Note** If this property has been assigned a value, it will only be displayed in FETCH action that returns a single resource. Otherwise, it will be null. + */ + attributes: string; + /** + * An object that contains the [Add-on](https://www.twilio.com/docs/add-ons) data for all installed Add-ons. + */ + addons: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The date and time in GMT when the Task entered the TaskQueue, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + taskQueueEnteredDate: Date; + /** + * The current priority score of the Task as assigned to a Worker by the workflow. Tasks with higher priority values will be assigned before Tasks with lower values. + */ + priority: number; + /** + * The reason the Task was canceled or completed, if applicable. + */ + reason: string; + /** + * The unique string that we created to identify the Task resource. + */ + sid: string; + /** + * The SID of the TaskQueue. + */ + taskQueueSid: string; + /** + * The friendly name of the TaskQueue. + */ + taskQueueFriendlyName: string; + /** + * The SID of the TaskChannel. + */ + taskChannelSid: string; + /** + * The unique name of the TaskChannel. + */ + taskChannelUniqueName: string; + /** + * The amount of time in seconds that the Task can live before being assigned. + */ + timeout: number; + /** + * The SID of the Workflow that is controlling the Task. + */ + workflowSid: string; + /** + * The friendly name of the Workflow that is controlling the Task. + */ + workflowFriendlyName: string; + /** + * The SID of the Workspace that contains the Task. + */ + workspaceSid: string; + /** + * The absolute URL of the Task resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + /** + * The date and time in GMT indicating the ordering for routing of the Task specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + virtualStartTime: Date; + private get _proxy(); + /** + * Remove a TaskInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a TaskInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + remove(params: TaskContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TaskInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + fetch(callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Update a TaskInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + update(callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Update a TaskInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + update(params: TaskContextUpdateOptions, callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Access the reservations. + */ + reservations(): ReservationListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + age: number; + assignmentStatus: TaskStatus; + attributes: string; + addons: string; + dateCreated: Date; + dateUpdated: Date; + taskQueueEnteredDate: Date; + priority: number; + reason: string; + sid: string; + taskQueueSid: string; + taskQueueFriendlyName: string; + taskChannelSid: string; + taskChannelUniqueName: string; + timeout: number; + workflowSid: string; + workflowFriendlyName: string; + workspaceSid: string; + url: string; + links: Record; + virtualStartTime: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TaskSolution { + workspaceSid: string; +} +export interface TaskListInstance { + _version: V1; + _solution: TaskSolution; + _uri: string; + (sid: string): TaskContext; + get(sid: string): TaskContext; + /** + * Create a TaskInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + create(callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Create a TaskInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + create(params: TaskListInstanceCreateOptions, callback?: (error: Error | null, item?: TaskInstance) => any): Promise; + /** + * Streams TaskInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TaskInstance, done: (err?: Error) => void) => void): void; + each(params: TaskListInstanceEachOptions, callback?: (item: TaskInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TaskInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TaskPage) => any): Promise; + /** + * Lists TaskInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TaskInstance[]) => any): Promise; + list(params: TaskListInstanceOptions, callback?: (error: Error | null, items: TaskInstance[]) => any): Promise; + /** + * Retrieve a single page of TaskInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TaskPage) => any): Promise; + page(params: TaskListInstancePageOptions, callback?: (error: Error | null, items: TaskPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TaskListInstance(version: V1, workspaceSid: string): TaskListInstance; +export declare class TaskPage extends Page { + /** + * Initialize the TaskPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TaskSolution); + /** + * Build an instance of TaskInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TaskResource): TaskInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task.js new file mode 100644 index 00000000..bbb5e851 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task.js @@ -0,0 +1,347 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskPage = exports.TaskListInstance = exports.TaskInstance = exports.TaskContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const reservation_1 = require("./task/reservation"); +class TaskContextImpl { + constructor(_version, workspaceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/Tasks/${sid}`; + } + get reservations() { + this._reservations = + this._reservations || + (0, reservation_1.ReservationListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._reservations; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TaskInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["assignmentStatus"] !== undefined) + data["AssignmentStatus"] = params["assignmentStatus"]; + if (params["reason"] !== undefined) + data["Reason"] = params["reason"]; + if (params["priority"] !== undefined) + data["Priority"] = params["priority"]; + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["virtualStartTime"] !== undefined) + data["VirtualStartTime"] = serialize.iso8601DateTime(params["virtualStartTime"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskContextImpl = TaskContextImpl; +class TaskInstance { + constructor(_version, payload, workspaceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.age = deserialize.integer(payload.age); + this.assignmentStatus = payload.assignment_status; + this.attributes = payload.attributes; + this.addons = payload.addons; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.taskQueueEnteredDate = deserialize.iso8601DateTime(payload.task_queue_entered_date); + this.priority = deserialize.integer(payload.priority); + this.reason = payload.reason; + this.sid = payload.sid; + this.taskQueueSid = payload.task_queue_sid; + this.taskQueueFriendlyName = payload.task_queue_friendly_name; + this.taskChannelSid = payload.task_channel_sid; + this.taskChannelUniqueName = payload.task_channel_unique_name; + this.timeout = deserialize.integer(payload.timeout); + this.workflowSid = payload.workflow_sid; + this.workflowFriendlyName = payload.workflow_friendly_name; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this.links = payload.links; + this.virtualStartTime = deserialize.iso8601DateTime(payload.virtual_start_time); + this._solution = { workspaceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TaskContextImpl(this._version, this._solution.workspaceSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a TaskInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the reservations. + */ + reservations() { + return this._proxy.reservations; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + age: this.age, + assignmentStatus: this.assignmentStatus, + attributes: this.attributes, + addons: this.addons, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + taskQueueEnteredDate: this.taskQueueEnteredDate, + priority: this.priority, + reason: this.reason, + sid: this.sid, + taskQueueSid: this.taskQueueSid, + taskQueueFriendlyName: this.taskQueueFriendlyName, + taskChannelSid: this.taskChannelSid, + taskChannelUniqueName: this.taskChannelUniqueName, + timeout: this.timeout, + workflowSid: this.workflowSid, + workflowFriendlyName: this.workflowFriendlyName, + workspaceSid: this.workspaceSid, + url: this.url, + links: this.links, + virtualStartTime: this.virtualStartTime, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskInstance = TaskInstance; +function TaskListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TaskContextImpl(version, workspaceSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = `/Workspaces/${workspaceSid}/Tasks`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["timeout"] !== undefined) + data["Timeout"] = params["timeout"]; + if (params["priority"] !== undefined) + data["Priority"] = params["priority"]; + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["workflowSid"] !== undefined) + data["WorkflowSid"] = params["workflowSid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["virtualStartTime"] !== undefined) + data["VirtualStartTime"] = serialize.iso8601DateTime(params["virtualStartTime"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["priority"] !== undefined) + data["Priority"] = params["priority"]; + if (params["assignmentStatus"] !== undefined) + data["AssignmentStatus"] = serialize.map(params["assignmentStatus"], (e) => e); + if (params["workflowSid"] !== undefined) + data["WorkflowSid"] = params["workflowSid"]; + if (params["workflowName"] !== undefined) + data["WorkflowName"] = params["workflowName"]; + if (params["taskQueueSid"] !== undefined) + data["TaskQueueSid"] = params["taskQueueSid"]; + if (params["taskQueueName"] !== undefined) + data["TaskQueueName"] = params["taskQueueName"]; + if (params["evaluateTaskAttributes"] !== undefined) + data["EvaluateTaskAttributes"] = params["evaluateTaskAttributes"]; + if (params["ordering"] !== undefined) + data["Ordering"] = params["ordering"]; + if (params["hasAddons"] !== undefined) + data["HasAddons"] = serialize.bool(params["hasAddons"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TaskPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TaskListInstance = TaskListInstance; +class TaskPage extends Page_1.default { + /** + * Initialize the TaskPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TaskInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TaskInstance(this._version, payload, this._solution.workspaceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskPage = TaskPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts new file mode 100644 index 00000000..ae4a5abd --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts @@ -0,0 +1,414 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type ReservationCallStatus = "initiated" | "ringing" | "answered" | "completed"; +export type ReservationConferenceEvent = "start" | "end" | "join" | "leave" | "mute" | "hold" | "speaker"; +export type ReservationStatus = "pending" | "accepted" | "rejected" | "timeout" | "canceled" | "rescinded" | "wrapping" | "completed"; +export type ReservationSupervisorMode = "monitor" | "whisper" | "barge"; +/** + * Options to pass to update a ReservationInstance + */ +export interface ReservationContextUpdateOptions { + /** The If-Match HTTP request header */ + ifMatch?: string; + /** */ + reservationStatus?: ReservationStatus; + /** The new worker activity SID if rejecting a reservation. */ + workerActivitySid?: string; + /** The assignment instruction for reservation. */ + instruction?: string; + /** The SID of the Activity resource to start after executing a Dequeue instruction. */ + dequeuePostWorkActivitySid?: string; + /** The Caller ID of the call to the worker when executing a Dequeue instruction. */ + dequeueFrom?: string; + /** Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. */ + dequeueRecord?: string; + /** Timeout for call when executing a Dequeue instruction. */ + dequeueTimeout?: number; + /** The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. */ + dequeueTo?: string; + /** The Callback URL for completed call event when executing a Dequeue instruction. */ + dequeueStatusCallbackUrl?: string; + /** The Caller ID of the outbound call when executing a Call instruction. */ + callFrom?: string; + /** Whether to record both legs of a call when executing a Call instruction or which leg to record. */ + callRecord?: string; + /** Timeout for call when executing a Call instruction. */ + callTimeout?: number; + /** The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. */ + callTo?: string; + /** TwiML URI executed on answering the worker\\\'s leg as a result of the Call instruction. */ + callUrl?: string; + /** The URL to call for the completed call event when executing a Call instruction. */ + callStatusCallbackUrl?: string; + /** Whether to accept a reservation when executing a Call instruction. */ + callAccept?: boolean; + /** The Call SID of the call parked in the queue when executing a Redirect instruction. */ + redirectCallSid?: string; + /** Whether the reservation should be accepted when executing a Redirect instruction. */ + redirectAccept?: boolean; + /** TwiML URI to redirect the call to when executing the Redirect instruction. */ + redirectUrl?: string; + /** The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. */ + to?: string; + /** The Caller ID of the call to the worker when executing a Conference instruction. */ + from?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */ + statusCallbackMethod?: string; + /** The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. */ + statusCallbackEvent?: Array; + /** Timeout for call when executing a Conference instruction. */ + timeout?: number; + /** Whether to record the participant and their conferences, including the time between conferences. The default is `false`. */ + record?: boolean; + /** Whether the agent is muted in the conference. The default is `false`. */ + muted?: boolean; + /** Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. */ + beep?: string; + /** Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. */ + startConferenceOnEnter?: boolean; + /** Whether to end the conference when the agent leaves. */ + endConferenceOnExit?: boolean; + /** The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). */ + waitUrl?: string; + /** The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. */ + waitMethod?: string; + /** Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. */ + earlyMedia?: boolean; + /** The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. */ + maxParticipants?: number; + /** The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. */ + conferenceStatusCallback?: string; + /** The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + conferenceStatusCallbackMethod?: string; + /** The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. */ + conferenceStatusCallbackEvent?: Array; + /** Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. */ + conferenceRecord?: string; + /** How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. */ + conferenceTrim?: string; + /** The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. */ + recordingChannels?: string; + /** The URL that we should call using the `recording_status_callback_method` when the recording status changes. */ + recordingStatusCallback?: string; + /** The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + recordingStatusCallbackMethod?: string; + /** The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. */ + conferenceRecordingStatusCallback?: string; + /** The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + conferenceRecordingStatusCallbackMethod?: string; + /** The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. */ + region?: string; + /** The SIP username used for authentication. */ + sipAuthUsername?: string; + /** The SIP password for authentication. */ + sipAuthPassword?: string; + /** The Call progress events sent via webhooks as a result of a Dequeue instruction. */ + dequeueStatusCallbackEvent?: Array; + /** The new worker activity SID after executing a Conference instruction. */ + postWorkActivitySid?: string; + /** */ + supervisorMode?: ReservationSupervisorMode; + /** The Supervisor SID/URI when executing the Supervise instruction. */ + supervisor?: string; + /** Whether to end the conference when the customer leaves. */ + endConferenceOnCustomerExit?: boolean; + /** Whether to play a notification beep when the customer joins. */ + beepOnCustomerEntrance?: boolean; + /** The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. */ + jitterBufferSize?: string; +} +/** + * Options to pass to each + */ +export interface ReservationListInstanceEachOptions { + /** Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. */ + reservationStatus?: ReservationStatus; + /** The SID of the reserved Worker resource to read. */ + workerSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ReservationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ReservationListInstanceOptions { + /** Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. */ + reservationStatus?: ReservationStatus; + /** The SID of the reserved Worker resource to read. */ + workerSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ReservationListInstancePageOptions { + /** Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. */ + reservationStatus?: ReservationStatus; + /** The SID of the reserved Worker resource to read. */ + workerSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ReservationContext { + /** + * Fetch a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + fetch(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Update a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + update(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Update a ReservationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + update(params: ReservationContextUpdateOptions, callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ReservationContextSolution { + workspaceSid: string; + taskSid: string; + sid: string; +} +export declare class ReservationContextImpl implements ReservationContext { + protected _version: V1; + protected _solution: ReservationContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, taskSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + update(params?: ReservationContextUpdateOptions | ((error: Error | null, item?: ReservationInstance) => any), callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ReservationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ReservationPayload extends TwilioResponsePayload { + reservations: ReservationResource[]; +} +interface ReservationResource { + account_sid: string; + date_created: Date; + date_updated: Date; + reservation_status: ReservationStatus; + sid: string; + task_sid: string; + worker_name: string; + worker_sid: string; + workspace_sid: string; + url: string; + links: Record; +} +export declare class ReservationInstance { + protected _version: V1; + protected _solution: ReservationContextSolution; + protected _context?: ReservationContext; + constructor(_version: V1, payload: ReservationResource, workspaceSid: string, taskSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskReservation resource. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + reservationStatus: ReservationStatus; + /** + * The unique string that we created to identify the TaskReservation resource. + */ + sid: string; + /** + * The SID of the reserved Task resource. + */ + taskSid: string; + /** + * The `friendly_name` of the Worker that is reserved. + */ + workerName: string; + /** + * The SID of the reserved Worker resource. + */ + workerSid: string; + /** + * The SID of the Workspace that this task is contained within. + */ + workspaceSid: string; + /** + * The absolute URL of the TaskReservation reservation. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + fetch(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Update a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + update(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Update a ReservationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + update(params: ReservationContextUpdateOptions, callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + reservationStatus: ReservationStatus; + sid: string; + taskSid: string; + workerName: string; + workerSid: string; + workspaceSid: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ReservationSolution { + workspaceSid: string; + taskSid: string; +} +export interface ReservationListInstance { + _version: V1; + _solution: ReservationSolution; + _uri: string; + (sid: string): ReservationContext; + get(sid: string): ReservationContext; + /** + * Streams ReservationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ReservationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ReservationInstance, done: (err?: Error) => void) => void): void; + each(params: ReservationListInstanceEachOptions, callback?: (item: ReservationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ReservationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ReservationPage) => any): Promise; + /** + * Lists ReservationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ReservationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ReservationInstance[]) => any): Promise; + list(params: ReservationListInstanceOptions, callback?: (error: Error | null, items: ReservationInstance[]) => any): Promise; + /** + * Retrieve a single page of ReservationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ReservationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ReservationPage) => any): Promise; + page(params: ReservationListInstancePageOptions, callback?: (error: Error | null, items: ReservationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ReservationListInstance(version: V1, workspaceSid: string, taskSid: string): ReservationListInstance; +export declare class ReservationPage extends Page { + /** + * Initialize the ReservationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ReservationSolution); + /** + * Build an instance of ReservationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ReservationResource): ReservationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task/reservation.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task/reservation.js new file mode 100644 index 00000000..3a43203a --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/task/reservation.js @@ -0,0 +1,346 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReservationPage = exports.ReservationListInstance = exports.ReservationInstance = exports.ReservationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class ReservationContextImpl { + constructor(_version, workspaceSid, taskSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(taskSid)) { + throw new Error("Parameter 'taskSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, taskSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/Tasks/${taskSid}/Reservations/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ReservationInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.taskSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["reservationStatus"] !== undefined) + data["ReservationStatus"] = params["reservationStatus"]; + if (params["workerActivitySid"] !== undefined) + data["WorkerActivitySid"] = params["workerActivitySid"]; + if (params["instruction"] !== undefined) + data["Instruction"] = params["instruction"]; + if (params["dequeuePostWorkActivitySid"] !== undefined) + data["DequeuePostWorkActivitySid"] = params["dequeuePostWorkActivitySid"]; + if (params["dequeueFrom"] !== undefined) + data["DequeueFrom"] = params["dequeueFrom"]; + if (params["dequeueRecord"] !== undefined) + data["DequeueRecord"] = params["dequeueRecord"]; + if (params["dequeueTimeout"] !== undefined) + data["DequeueTimeout"] = params["dequeueTimeout"]; + if (params["dequeueTo"] !== undefined) + data["DequeueTo"] = params["dequeueTo"]; + if (params["dequeueStatusCallbackUrl"] !== undefined) + data["DequeueStatusCallbackUrl"] = params["dequeueStatusCallbackUrl"]; + if (params["callFrom"] !== undefined) + data["CallFrom"] = params["callFrom"]; + if (params["callRecord"] !== undefined) + data["CallRecord"] = params["callRecord"]; + if (params["callTimeout"] !== undefined) + data["CallTimeout"] = params["callTimeout"]; + if (params["callTo"] !== undefined) + data["CallTo"] = params["callTo"]; + if (params["callUrl"] !== undefined) + data["CallUrl"] = params["callUrl"]; + if (params["callStatusCallbackUrl"] !== undefined) + data["CallStatusCallbackUrl"] = params["callStatusCallbackUrl"]; + if (params["callAccept"] !== undefined) + data["CallAccept"] = serialize.bool(params["callAccept"]); + if (params["redirectCallSid"] !== undefined) + data["RedirectCallSid"] = params["redirectCallSid"]; + if (params["redirectAccept"] !== undefined) + data["RedirectAccept"] = serialize.bool(params["redirectAccept"]); + if (params["redirectUrl"] !== undefined) + data["RedirectUrl"] = params["redirectUrl"]; + if (params["to"] !== undefined) + data["To"] = params["to"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["statusCallbackEvent"] !== undefined) + data["StatusCallbackEvent"] = serialize.map(params["statusCallbackEvent"], (e) => e); + if (params["timeout"] !== undefined) + data["Timeout"] = params["timeout"]; + if (params["record"] !== undefined) + data["Record"] = serialize.bool(params["record"]); + if (params["muted"] !== undefined) + data["Muted"] = serialize.bool(params["muted"]); + if (params["beep"] !== undefined) + data["Beep"] = params["beep"]; + if (params["startConferenceOnEnter"] !== undefined) + data["StartConferenceOnEnter"] = serialize.bool(params["startConferenceOnEnter"]); + if (params["endConferenceOnExit"] !== undefined) + data["EndConferenceOnExit"] = serialize.bool(params["endConferenceOnExit"]); + if (params["waitUrl"] !== undefined) + data["WaitUrl"] = params["waitUrl"]; + if (params["waitMethod"] !== undefined) + data["WaitMethod"] = params["waitMethod"]; + if (params["earlyMedia"] !== undefined) + data["EarlyMedia"] = serialize.bool(params["earlyMedia"]); + if (params["maxParticipants"] !== undefined) + data["MaxParticipants"] = params["maxParticipants"]; + if (params["conferenceStatusCallback"] !== undefined) + data["ConferenceStatusCallback"] = params["conferenceStatusCallback"]; + if (params["conferenceStatusCallbackMethod"] !== undefined) + data["ConferenceStatusCallbackMethod"] = + params["conferenceStatusCallbackMethod"]; + if (params["conferenceStatusCallbackEvent"] !== undefined) + data["ConferenceStatusCallbackEvent"] = serialize.map(params["conferenceStatusCallbackEvent"], (e) => e); + if (params["conferenceRecord"] !== undefined) + data["ConferenceRecord"] = params["conferenceRecord"]; + if (params["conferenceTrim"] !== undefined) + data["ConferenceTrim"] = params["conferenceTrim"]; + if (params["recordingChannels"] !== undefined) + data["RecordingChannels"] = params["recordingChannels"]; + if (params["recordingStatusCallback"] !== undefined) + data["RecordingStatusCallback"] = params["recordingStatusCallback"]; + if (params["recordingStatusCallbackMethod"] !== undefined) + data["RecordingStatusCallbackMethod"] = + params["recordingStatusCallbackMethod"]; + if (params["conferenceRecordingStatusCallback"] !== undefined) + data["ConferenceRecordingStatusCallback"] = + params["conferenceRecordingStatusCallback"]; + if (params["conferenceRecordingStatusCallbackMethod"] !== undefined) + data["ConferenceRecordingStatusCallbackMethod"] = + params["conferenceRecordingStatusCallbackMethod"]; + if (params["region"] !== undefined) + data["Region"] = params["region"]; + if (params["sipAuthUsername"] !== undefined) + data["SipAuthUsername"] = params["sipAuthUsername"]; + if (params["sipAuthPassword"] !== undefined) + data["SipAuthPassword"] = params["sipAuthPassword"]; + if (params["dequeueStatusCallbackEvent"] !== undefined) + data["DequeueStatusCallbackEvent"] = serialize.map(params["dequeueStatusCallbackEvent"], (e) => e); + if (params["postWorkActivitySid"] !== undefined) + data["PostWorkActivitySid"] = params["postWorkActivitySid"]; + if (params["supervisorMode"] !== undefined) + data["SupervisorMode"] = params["supervisorMode"]; + if (params["supervisor"] !== undefined) + data["Supervisor"] = params["supervisor"]; + if (params["endConferenceOnCustomerExit"] !== undefined) + data["EndConferenceOnCustomerExit"] = serialize.bool(params["endConferenceOnCustomerExit"]); + if (params["beepOnCustomerEntrance"] !== undefined) + data["BeepOnCustomerEntrance"] = serialize.bool(params["beepOnCustomerEntrance"]); + if (params["jitterBufferSize"] !== undefined) + data["JitterBufferSize"] = params["jitterBufferSize"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ReservationInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.taskSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ReservationContextImpl = ReservationContextImpl; +class ReservationInstance { + constructor(_version, payload, workspaceSid, taskSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.reservationStatus = payload.reservation_status; + this.sid = payload.sid; + this.taskSid = payload.task_sid; + this.workerName = payload.worker_name; + this.workerSid = payload.worker_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this.links = payload.links; + this._solution = { workspaceSid, taskSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ReservationContextImpl(this._version, this._solution.workspaceSid, this._solution.taskSid, this._solution.sid); + return this._context; + } + /** + * Fetch a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + reservationStatus: this.reservationStatus, + sid: this.sid, + taskSid: this.taskSid, + workerName: this.workerName, + workerSid: this.workerSid, + workspaceSid: this.workspaceSid, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ReservationInstance = ReservationInstance; +function ReservationListInstance(version, workspaceSid, taskSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(taskSid)) { + throw new Error("Parameter 'taskSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ReservationContextImpl(version, workspaceSid, taskSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid, taskSid }; + instance._uri = `/Workspaces/${workspaceSid}/Tasks/${taskSid}/Reservations`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["reservationStatus"] !== undefined) + data["ReservationStatus"] = params["reservationStatus"]; + if (params["workerSid"] !== undefined) + data["WorkerSid"] = params["workerSid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ReservationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ReservationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ReservationListInstance = ReservationListInstance; +class ReservationPage extends Page_1.default { + /** + * Initialize the ReservationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ReservationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ReservationInstance(this._version, payload, this._solution.workspaceSid, this._solution.taskSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ReservationPage = ReservationPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskChannel.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskChannel.d.ts new file mode 100644 index 00000000..6cd84338 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskChannel.d.ts @@ -0,0 +1,324 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a TaskChannelInstance + */ +export interface TaskChannelContextUpdateOptions { + /** A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. */ + friendlyName?: string; + /** Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. */ + channelOptimizedRouting?: boolean; +} +/** + * Options to pass to create a TaskChannelInstance + */ +export interface TaskChannelListInstanceCreateOptions { + /** A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. */ + friendlyName: string; + /** An application-defined string that uniquely identifies the Task Channel, such as `voice` or `sms`. */ + uniqueName: string; + /** Whether the Task Channel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. */ + channelOptimizedRouting?: boolean; +} +/** + * Options to pass to each + */ +export interface TaskChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TaskChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TaskChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TaskChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TaskChannelContext { + /** + * Remove a TaskChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TaskChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskChannelInstance + */ + fetch(callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + /** + * Update a TaskChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskChannelInstance + */ + update(callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + /** + * Update a TaskChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskChannelInstance + */ + update(params: TaskChannelContextUpdateOptions, callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TaskChannelContextSolution { + workspaceSid: string; + sid: string; +} +export declare class TaskChannelContextImpl implements TaskChannelContext { + protected _version: V1; + protected _solution: TaskChannelContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + update(params?: TaskChannelContextUpdateOptions | ((error: Error | null, item?: TaskChannelInstance) => any), callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TaskChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TaskChannelPayload extends TwilioResponsePayload { + channels: TaskChannelResource[]; +} +interface TaskChannelResource { + account_sid: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + sid: string; + unique_name: string; + workspace_sid: string; + channel_optimized_routing: boolean; + url: string; + links: Record; +} +export declare class TaskChannelInstance { + protected _version: V1; + protected _solution: TaskChannelContextSolution; + protected _context?: TaskChannelContext; + constructor(_version: V1, payload: TaskChannelResource, workspaceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task Channel resource. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The unique string that we created to identify the Task Channel resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the Task Channel, such as `voice` or `sms`. + */ + uniqueName: string; + /** + * The SID of the Workspace that contains the Task Channel. + */ + workspaceSid: string; + /** + * Whether the Task Channel will prioritize Workers that have been idle. When `true`, Workers that have been idle the longest are prioritized. + */ + channelOptimizedRouting: boolean; + /** + * The absolute URL of the Task Channel resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a TaskChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TaskChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskChannelInstance + */ + fetch(callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + /** + * Update a TaskChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskChannelInstance + */ + update(callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + /** + * Update a TaskChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskChannelInstance + */ + update(params: TaskChannelContextUpdateOptions, callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + sid: string; + uniqueName: string; + workspaceSid: string; + channelOptimizedRouting: boolean; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TaskChannelSolution { + workspaceSid: string; +} +export interface TaskChannelListInstance { + _version: V1; + _solution: TaskChannelSolution; + _uri: string; + (sid: string): TaskChannelContext; + get(sid: string): TaskChannelContext; + /** + * Create a TaskChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskChannelInstance + */ + create(params: TaskChannelListInstanceCreateOptions, callback?: (error: Error | null, item?: TaskChannelInstance) => any): Promise; + /** + * Streams TaskChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TaskChannelInstance, done: (err?: Error) => void) => void): void; + each(params: TaskChannelListInstanceEachOptions, callback?: (item: TaskChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TaskChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TaskChannelPage) => any): Promise; + /** + * Lists TaskChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TaskChannelInstance[]) => any): Promise; + list(params: TaskChannelListInstanceOptions, callback?: (error: Error | null, items: TaskChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of TaskChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TaskChannelPage) => any): Promise; + page(params: TaskChannelListInstancePageOptions, callback?: (error: Error | null, items: TaskChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TaskChannelListInstance(version: V1, workspaceSid: string): TaskChannelListInstance; +export declare class TaskChannelPage extends Page { + /** + * Initialize the TaskChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TaskChannelSolution); + /** + * Build an instance of TaskChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TaskChannelResource): TaskChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskChannel.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskChannel.js new file mode 100644 index 00000000..7fc09833 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskChannel.js @@ -0,0 +1,271 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskChannelPage = exports.TaskChannelListInstance = exports.TaskChannelInstance = exports.TaskChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class TaskChannelContextImpl { + constructor(_version, workspaceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/TaskChannels/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TaskChannelInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["channelOptimizedRouting"] !== undefined) + data["ChannelOptimizedRouting"] = serialize.bool(params["channelOptimizedRouting"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskChannelInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskChannelContextImpl = TaskChannelContextImpl; +class TaskChannelInstance { + constructor(_version, payload, workspaceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.workspaceSid = payload.workspace_sid; + this.channelOptimizedRouting = payload.channel_optimized_routing; + this.url = payload.url; + this.links = payload.links; + this._solution = { workspaceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TaskChannelContextImpl(this._version, this._solution.workspaceSid, this._solution.sid); + return this._context; + } + /** + * Remove a TaskChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TaskChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + sid: this.sid, + uniqueName: this.uniqueName, + workspaceSid: this.workspaceSid, + channelOptimizedRouting: this.channelOptimizedRouting, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskChannelInstance = TaskChannelInstance; +function TaskChannelListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TaskChannelContextImpl(version, workspaceSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = `/Workspaces/${workspaceSid}/TaskChannels`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["uniqueName"] === null || params["uniqueName"] === undefined) { + throw new Error("Required parameter \"params['uniqueName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["UniqueName"] = params["uniqueName"]; + if (params["channelOptimizedRouting"] !== undefined) + data["ChannelOptimizedRouting"] = serialize.bool(params["channelOptimizedRouting"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskChannelInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TaskChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TaskChannelListInstance = TaskChannelListInstance; +class TaskChannelPage extends Page_1.default { + /** + * Initialize the TaskChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TaskChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TaskChannelInstance(this._version, payload, this._solution.workspaceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskChannelPage = TaskChannelPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts new file mode 100644 index 00000000..59801e83 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts @@ -0,0 +1,417 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { TaskQueueCumulativeStatisticsListInstance } from "./taskQueue/taskQueueCumulativeStatistics"; +import { TaskQueueRealTimeStatisticsListInstance } from "./taskQueue/taskQueueRealTimeStatistics"; +import { TaskQueueStatisticsListInstance } from "./taskQueue/taskQueueStatistics"; +import { TaskQueuesStatisticsListInstance } from "./taskQueue/taskQueuesStatistics"; +export type TaskQueueTaskOrder = "FIFO" | "LIFO"; +/** + * Options to pass to update a TaskQueueInstance + */ +export interface TaskQueueContextUpdateOptions { + /** A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. */ + friendlyName?: string; + /** A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example \\\'\\\"language\\\" == \\\"spanish\\\"\\\' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. */ + targetWorkers?: string; + /** The SID of the Activity to assign Workers when a task is reserved for them. */ + reservationActivitySid?: string; + /** The SID of the Activity to assign Workers when a task is assigned for them. */ + assignmentActivitySid?: string; + /** The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. */ + maxReservedWorkers?: number; + /** */ + taskOrder?: TaskQueueTaskOrder; +} +/** + * Options to pass to create a TaskQueueInstance + */ +export interface TaskQueueListInstanceCreateOptions { + /** A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. */ + friendlyName: string; + /** A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `\\\'\\\"language\\\" == \\\"spanish\\\"\\\'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). */ + targetWorkers?: string; + /** The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. */ + maxReservedWorkers?: number; + /** */ + taskOrder?: TaskQueueTaskOrder; + /** The SID of the Activity to assign Workers when a task is reserved for them. */ + reservationActivitySid?: string; + /** The SID of the Activity to assign Workers when a task is assigned to them. */ + assignmentActivitySid?: string; +} +/** + * Options to pass to each + */ +export interface TaskQueueListInstanceEachOptions { + /** The `friendly_name` of the TaskQueue resources to read. */ + friendlyName?: string; + /** The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. */ + evaluateWorkerAttributes?: string; + /** The SID of the Worker with the TaskQueue resources to read. */ + workerSid?: string; + /** Sorting parameter for TaskQueues */ + ordering?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TaskQueueInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TaskQueueListInstanceOptions { + /** The `friendly_name` of the TaskQueue resources to read. */ + friendlyName?: string; + /** The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. */ + evaluateWorkerAttributes?: string; + /** The SID of the Worker with the TaskQueue resources to read. */ + workerSid?: string; + /** Sorting parameter for TaskQueues */ + ordering?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TaskQueueListInstancePageOptions { + /** The `friendly_name` of the TaskQueue resources to read. */ + friendlyName?: string; + /** The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. */ + evaluateWorkerAttributes?: string; + /** The SID of the Worker with the TaskQueue resources to read. */ + workerSid?: string; + /** Sorting parameter for TaskQueues */ + ordering?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TaskQueueContext { + cumulativeStatistics: TaskQueueCumulativeStatisticsListInstance; + realTimeStatistics: TaskQueueRealTimeStatisticsListInstance; + statistics: TaskQueueStatisticsListInstance; + /** + * Remove a TaskQueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TaskQueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueInstance + */ + fetch(callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + /** + * Update a TaskQueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueInstance + */ + update(callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + /** + * Update a TaskQueueInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueInstance + */ + update(params: TaskQueueContextUpdateOptions, callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TaskQueueContextSolution { + workspaceSid: string; + sid: string; +} +export declare class TaskQueueContextImpl implements TaskQueueContext { + protected _version: V1; + protected _solution: TaskQueueContextSolution; + protected _uri: string; + protected _cumulativeStatistics?: TaskQueueCumulativeStatisticsListInstance; + protected _realTimeStatistics?: TaskQueueRealTimeStatisticsListInstance; + protected _statistics?: TaskQueueStatisticsListInstance; + constructor(_version: V1, workspaceSid: string, sid: string); + get cumulativeStatistics(): TaskQueueCumulativeStatisticsListInstance; + get realTimeStatistics(): TaskQueueRealTimeStatisticsListInstance; + get statistics(): TaskQueueStatisticsListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + update(params?: TaskQueueContextUpdateOptions | ((error: Error | null, item?: TaskQueueInstance) => any), callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TaskQueueContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TaskQueuePayload extends TwilioResponsePayload { + task_queues: TaskQueueResource[]; +} +interface TaskQueueResource { + account_sid: string; + assignment_activity_sid: string; + assignment_activity_name: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + max_reserved_workers: number; + reservation_activity_sid: string; + reservation_activity_name: string; + sid: string; + target_workers: string; + task_order: TaskQueueTaskOrder; + url: string; + workspace_sid: string; + links: Record; +} +export declare class TaskQueueInstance { + protected _version: V1; + protected _solution: TaskQueueContextSolution; + protected _context?: TaskQueueContext; + constructor(_version: V1, payload: TaskQueueResource, workspaceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. + */ + accountSid: string; + /** + * The SID of the Activity to assign Workers when a task is assigned for them. + */ + assignmentActivitySid: string; + /** + * The name of the Activity to assign Workers when a task is assigned for them. + */ + assignmentActivityName: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The maximum number of Workers to reserve for the assignment of a task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. + */ + maxReservedWorkers: number; + /** + * The SID of the Activity to assign Workers once a task is reserved for them. + */ + reservationActivitySid: string; + /** + * The name of the Activity to assign Workers once a task is reserved for them. + */ + reservationActivityName: string; + /** + * The unique string that we created to identify the TaskQueue resource. + */ + sid: string; + /** + * A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example `\'\"language\" == \"spanish\"\'` If no TargetWorkers parameter is provided, Tasks will wait in the TaskQueue until they are either deleted or moved to another TaskQueue. Additional examples on how to describing Worker selection criteria below. Defaults to 1==1. + */ + targetWorkers: string; + taskOrder: TaskQueueTaskOrder; + /** + * The absolute URL of the TaskQueue resource. + */ + url: string; + /** + * The SID of the Workspace that contains the TaskQueue. + */ + workspaceSid: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a TaskQueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TaskQueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueInstance + */ + fetch(callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + /** + * Update a TaskQueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueInstance + */ + update(callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + /** + * Update a TaskQueueInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueInstance + */ + update(params: TaskQueueContextUpdateOptions, callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + /** + * Access the cumulativeStatistics. + */ + cumulativeStatistics(): TaskQueueCumulativeStatisticsListInstance; + /** + * Access the realTimeStatistics. + */ + realTimeStatistics(): TaskQueueRealTimeStatisticsListInstance; + /** + * Access the statistics. + */ + statistics(): TaskQueueStatisticsListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + assignmentActivitySid: string; + assignmentActivityName: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + maxReservedWorkers: number; + reservationActivitySid: string; + reservationActivityName: string; + sid: string; + targetWorkers: string; + taskOrder: TaskQueueTaskOrder; + url: string; + workspaceSid: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TaskQueueSolution { + workspaceSid: string; +} +export interface TaskQueueListInstance { + _version: V1; + _solution: TaskQueueSolution; + _uri: string; + (sid: string): TaskQueueContext; + get(sid: string): TaskQueueContext; + _statistics?: TaskQueuesStatisticsListInstance; + statistics: TaskQueuesStatisticsListInstance; + /** + * Create a TaskQueueInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueInstance + */ + create(params: TaskQueueListInstanceCreateOptions, callback?: (error: Error | null, item?: TaskQueueInstance) => any): Promise; + /** + * Streams TaskQueueInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskQueueListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TaskQueueInstance, done: (err?: Error) => void) => void): void; + each(params: TaskQueueListInstanceEachOptions, callback?: (item: TaskQueueInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TaskQueueInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TaskQueuePage) => any): Promise; + /** + * Lists TaskQueueInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskQueueListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TaskQueueInstance[]) => any): Promise; + list(params: TaskQueueListInstanceOptions, callback?: (error: Error | null, items: TaskQueueInstance[]) => any): Promise; + /** + * Retrieve a single page of TaskQueueInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskQueueListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TaskQueuePage) => any): Promise; + page(params: TaskQueueListInstancePageOptions, callback?: (error: Error | null, items: TaskQueuePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TaskQueueListInstance(version: V1, workspaceSid: string): TaskQueueListInstance; +export declare class TaskQueuePage extends Page { + /** + * Initialize the TaskQueuePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TaskQueueSolution); + /** + * Build an instance of TaskQueueInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TaskQueueResource): TaskQueueInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue.js new file mode 100644 index 00000000..83ae5edc --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue.js @@ -0,0 +1,349 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskQueuePage = exports.TaskQueueListInstance = exports.TaskQueueInstance = exports.TaskQueueContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const taskQueueCumulativeStatistics_1 = require("./taskQueue/taskQueueCumulativeStatistics"); +const taskQueueRealTimeStatistics_1 = require("./taskQueue/taskQueueRealTimeStatistics"); +const taskQueueStatistics_1 = require("./taskQueue/taskQueueStatistics"); +const taskQueuesStatistics_1 = require("./taskQueue/taskQueuesStatistics"); +class TaskQueueContextImpl { + constructor(_version, workspaceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/TaskQueues/${sid}`; + } + get cumulativeStatistics() { + this._cumulativeStatistics = + this._cumulativeStatistics || + (0, taskQueueCumulativeStatistics_1.TaskQueueCumulativeStatisticsListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._cumulativeStatistics; + } + get realTimeStatistics() { + this._realTimeStatistics = + this._realTimeStatistics || + (0, taskQueueRealTimeStatistics_1.TaskQueueRealTimeStatisticsListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._realTimeStatistics; + } + get statistics() { + this._statistics = + this._statistics || + (0, taskQueueStatistics_1.TaskQueueStatisticsListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._statistics; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TaskQueueInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["targetWorkers"] !== undefined) + data["TargetWorkers"] = params["targetWorkers"]; + if (params["reservationActivitySid"] !== undefined) + data["ReservationActivitySid"] = params["reservationActivitySid"]; + if (params["assignmentActivitySid"] !== undefined) + data["AssignmentActivitySid"] = params["assignmentActivitySid"]; + if (params["maxReservedWorkers"] !== undefined) + data["MaxReservedWorkers"] = params["maxReservedWorkers"]; + if (params["taskOrder"] !== undefined) + data["TaskOrder"] = params["taskOrder"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskQueueInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueueContextImpl = TaskQueueContextImpl; +class TaskQueueInstance { + constructor(_version, payload, workspaceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.assignmentActivitySid = payload.assignment_activity_sid; + this.assignmentActivityName = payload.assignment_activity_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.maxReservedWorkers = deserialize.integer(payload.max_reserved_workers); + this.reservationActivitySid = payload.reservation_activity_sid; + this.reservationActivityName = payload.reservation_activity_name; + this.sid = payload.sid; + this.targetWorkers = payload.target_workers; + this.taskOrder = payload.task_order; + this.url = payload.url; + this.workspaceSid = payload.workspace_sid; + this.links = payload.links; + this._solution = { workspaceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TaskQueueContextImpl(this._version, this._solution.workspaceSid, this._solution.sid); + return this._context; + } + /** + * Remove a TaskQueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TaskQueueInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the cumulativeStatistics. + */ + cumulativeStatistics() { + return this._proxy.cumulativeStatistics; + } + /** + * Access the realTimeStatistics. + */ + realTimeStatistics() { + return this._proxy.realTimeStatistics; + } + /** + * Access the statistics. + */ + statistics() { + return this._proxy.statistics; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + assignmentActivitySid: this.assignmentActivitySid, + assignmentActivityName: this.assignmentActivityName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + maxReservedWorkers: this.maxReservedWorkers, + reservationActivitySid: this.reservationActivitySid, + reservationActivityName: this.reservationActivityName, + sid: this.sid, + targetWorkers: this.targetWorkers, + taskOrder: this.taskOrder, + url: this.url, + workspaceSid: this.workspaceSid, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueueInstance = TaskQueueInstance; +function TaskQueueListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TaskQueueContextImpl(version, workspaceSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = `/Workspaces/${workspaceSid}/TaskQueues`; + Object.defineProperty(instance, "statistics", { + get: function statistics() { + if (!instance._statistics) { + instance._statistics = (0, taskQueuesStatistics_1.TaskQueuesStatisticsListInstance)(instance._version, instance._solution.workspaceSid); + } + return instance._statistics; + }, + }); + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["targetWorkers"] !== undefined) + data["TargetWorkers"] = params["targetWorkers"]; + if (params["maxReservedWorkers"] !== undefined) + data["MaxReservedWorkers"] = params["maxReservedWorkers"]; + if (params["taskOrder"] !== undefined) + data["TaskOrder"] = params["taskOrder"]; + if (params["reservationActivitySid"] !== undefined) + data["ReservationActivitySid"] = params["reservationActivitySid"]; + if (params["assignmentActivitySid"] !== undefined) + data["AssignmentActivitySid"] = params["assignmentActivitySid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskQueueInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["evaluateWorkerAttributes"] !== undefined) + data["EvaluateWorkerAttributes"] = params["evaluateWorkerAttributes"]; + if (params["workerSid"] !== undefined) + data["WorkerSid"] = params["workerSid"]; + if (params["ordering"] !== undefined) + data["Ordering"] = params["ordering"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskQueuePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TaskQueuePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TaskQueueListInstance = TaskQueueListInstance; +class TaskQueuePage extends Page_1.default { + /** + * Initialize the TaskQueuePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TaskQueueInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TaskQueueInstance(this._version, payload, this._solution.workspaceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueuePage = TaskQueuePage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.d.ts new file mode 100644 index 00000000..9526cd11 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.d.ts @@ -0,0 +1,244 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a TaskQueueCumulativeStatisticsInstance + */ +export interface TaskQueueCumulativeStatisticsContextFetchOptions { + /** Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** Only calculate statistics since this many minutes in the past. The default is 15 minutes. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold. */ + splitByWaitTime?: string; +} +export interface TaskQueueCumulativeStatisticsContext { + /** + * Fetch a TaskQueueCumulativeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueCumulativeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: TaskQueueCumulativeStatisticsInstance) => any): Promise; + /** + * Fetch a TaskQueueCumulativeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueCumulativeStatisticsInstance + */ + fetch(params: TaskQueueCumulativeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: TaskQueueCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TaskQueueCumulativeStatisticsContextSolution { + workspaceSid: string; + taskQueueSid: string; +} +export declare class TaskQueueCumulativeStatisticsContextImpl implements TaskQueueCumulativeStatisticsContext { + protected _version: V1; + protected _solution: TaskQueueCumulativeStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, taskQueueSid: string); + fetch(params?: TaskQueueCumulativeStatisticsContextFetchOptions | ((error: Error | null, item?: TaskQueueCumulativeStatisticsInstance) => any), callback?: (error: Error | null, item?: TaskQueueCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TaskQueueCumulativeStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TaskQueueCumulativeStatisticsResource { + account_sid: string; + avg_task_acceptance_time: number; + start_time: Date; + end_time: Date; + reservations_created: number; + reservations_accepted: number; + reservations_rejected: number; + reservations_timed_out: number; + reservations_canceled: number; + reservations_rescinded: number; + split_by_wait_time: any; + task_queue_sid: string; + wait_duration_until_accepted: any; + wait_duration_until_canceled: any; + wait_duration_in_queue_until_accepted: any; + tasks_canceled: number; + tasks_completed: number; + tasks_deleted: number; + tasks_entered: number; + tasks_moved: number; + workspace_sid: string; + url: string; +} +export declare class TaskQueueCumulativeStatisticsInstance { + protected _version: V1; + protected _solution: TaskQueueCumulativeStatisticsContextSolution; + protected _context?: TaskQueueCumulativeStatisticsContext; + constructor(_version: V1, payload: TaskQueueCumulativeStatisticsResource, workspaceSid: string, taskQueueSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. + */ + accountSid: string; + /** + * The average time in seconds between Task creation and acceptance. + */ + avgTaskAcceptanceTime: number; + /** + * The beginning of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + startTime: Date; + /** + * The end of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + endTime: Date; + /** + * The total number of Reservations created for Tasks in the TaskQueue. + */ + reservationsCreated: number; + /** + * The total number of Reservations accepted for Tasks in the TaskQueue. + */ + reservationsAccepted: number; + /** + * The total number of Reservations rejected for Tasks in the TaskQueue. + */ + reservationsRejected: number; + /** + * The total number of Reservations that timed out for Tasks in the TaskQueue. + */ + reservationsTimedOut: number; + /** + * The total number of Reservations canceled for Tasks in the TaskQueue. + */ + reservationsCanceled: number; + /** + * The total number of Reservations rescinded. + */ + reservationsRescinded: number; + /** + * A list of objects that describe the number of Tasks canceled and reservations accepted above and below the thresholds specified in seconds. + */ + splitByWaitTime: any; + /** + * The SID of the TaskQueue from which these statistics were calculated. + */ + taskQueueSid: string; + /** + * The wait duration statistics (`avg`, `min`, `max`, `total`) for Tasks accepted while in the TaskQueue. Calculation is based on the time when the Tasks were created. For transfers, the wait duration is counted from the moment ***the Task was created***, and not from when the transfer was initiated. + */ + waitDurationUntilAccepted: any; + /** + * The wait duration statistics (`avg`, `min`, `max`, `total`) for Tasks canceled while in the TaskQueue. + */ + waitDurationUntilCanceled: any; + /** + * The relative wait duration statistics (`avg`, `min`, `max`, `total`) for Tasks accepted while in the TaskQueue. Calculation is based on the time when the Tasks entered the TaskQueue. + */ + waitDurationInQueueUntilAccepted: any; + /** + * The total number of Tasks canceled in the TaskQueue. + */ + tasksCanceled: number; + /** + * The total number of Tasks completed in the TaskQueue. + */ + tasksCompleted: number; + /** + * The total number of Tasks deleted in the TaskQueue. + */ + tasksDeleted: number; + /** + * The total number of Tasks entered into the TaskQueue. + */ + tasksEntered: number; + /** + * The total number of Tasks that were moved from one queue to another. + */ + tasksMoved: number; + /** + * The SID of the Workspace that contains the TaskQueue. + */ + workspaceSid: string; + /** + * The absolute URL of the TaskQueue statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a TaskQueueCumulativeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueCumulativeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: TaskQueueCumulativeStatisticsInstance) => any): Promise; + /** + * Fetch a TaskQueueCumulativeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueCumulativeStatisticsInstance + */ + fetch(params: TaskQueueCumulativeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: TaskQueueCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + avgTaskAcceptanceTime: number; + startTime: Date; + endTime: Date; + reservationsCreated: number; + reservationsAccepted: number; + reservationsRejected: number; + reservationsTimedOut: number; + reservationsCanceled: number; + reservationsRescinded: number; + splitByWaitTime: any; + taskQueueSid: string; + waitDurationUntilAccepted: any; + waitDurationUntilCanceled: any; + waitDurationInQueueUntilAccepted: any; + tasksCanceled: number; + tasksCompleted: number; + tasksDeleted: number; + tasksEntered: number; + tasksMoved: number; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TaskQueueCumulativeStatisticsSolution { + workspaceSid: string; + taskQueueSid: string; +} +export interface TaskQueueCumulativeStatisticsListInstance { + _version: V1; + _solution: TaskQueueCumulativeStatisticsSolution; + _uri: string; + (): TaskQueueCumulativeStatisticsContext; + get(): TaskQueueCumulativeStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TaskQueueCumulativeStatisticsListInstance(version: V1, workspaceSid: string, taskQueueSid: string): TaskQueueCumulativeStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js new file mode 100644 index 00000000..29750c38 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js @@ -0,0 +1,172 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskQueueCumulativeStatisticsListInstance = exports.TaskQueueCumulativeStatisticsInstance = exports.TaskQueueCumulativeStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class TaskQueueCumulativeStatisticsContextImpl { + constructor(_version, workspaceSid, taskQueueSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(taskQueueSid)) { + throw new Error("Parameter 'taskQueueSid' is not valid."); + } + this._solution = { workspaceSid, taskQueueSid }; + this._uri = `/Workspaces/${workspaceSid}/TaskQueues/${taskQueueSid}/CumulativeStatistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["splitByWaitTime"] !== undefined) + data["SplitByWaitTime"] = params["splitByWaitTime"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskQueueCumulativeStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.taskQueueSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueueCumulativeStatisticsContextImpl = TaskQueueCumulativeStatisticsContextImpl; +class TaskQueueCumulativeStatisticsInstance { + constructor(_version, payload, workspaceSid, taskQueueSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.avgTaskAcceptanceTime = deserialize.integer(payload.avg_task_acceptance_time); + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.reservationsCreated = deserialize.integer(payload.reservations_created); + this.reservationsAccepted = deserialize.integer(payload.reservations_accepted); + this.reservationsRejected = deserialize.integer(payload.reservations_rejected); + this.reservationsTimedOut = deserialize.integer(payload.reservations_timed_out); + this.reservationsCanceled = deserialize.integer(payload.reservations_canceled); + this.reservationsRescinded = deserialize.integer(payload.reservations_rescinded); + this.splitByWaitTime = payload.split_by_wait_time; + this.taskQueueSid = payload.task_queue_sid; + this.waitDurationUntilAccepted = payload.wait_duration_until_accepted; + this.waitDurationUntilCanceled = payload.wait_duration_until_canceled; + this.waitDurationInQueueUntilAccepted = + payload.wait_duration_in_queue_until_accepted; + this.tasksCanceled = deserialize.integer(payload.tasks_canceled); + this.tasksCompleted = deserialize.integer(payload.tasks_completed); + this.tasksDeleted = deserialize.integer(payload.tasks_deleted); + this.tasksEntered = deserialize.integer(payload.tasks_entered); + this.tasksMoved = deserialize.integer(payload.tasks_moved); + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid, taskQueueSid }; + } + get _proxy() { + this._context = + this._context || + new TaskQueueCumulativeStatisticsContextImpl(this._version, this._solution.workspaceSid, this._solution.taskQueueSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + avgTaskAcceptanceTime: this.avgTaskAcceptanceTime, + startTime: this.startTime, + endTime: this.endTime, + reservationsCreated: this.reservationsCreated, + reservationsAccepted: this.reservationsAccepted, + reservationsRejected: this.reservationsRejected, + reservationsTimedOut: this.reservationsTimedOut, + reservationsCanceled: this.reservationsCanceled, + reservationsRescinded: this.reservationsRescinded, + splitByWaitTime: this.splitByWaitTime, + taskQueueSid: this.taskQueueSid, + waitDurationUntilAccepted: this.waitDurationUntilAccepted, + waitDurationUntilCanceled: this.waitDurationUntilCanceled, + waitDurationInQueueUntilAccepted: this.waitDurationInQueueUntilAccepted, + tasksCanceled: this.tasksCanceled, + tasksCompleted: this.tasksCompleted, + tasksDeleted: this.tasksDeleted, + tasksEntered: this.tasksEntered, + tasksMoved: this.tasksMoved, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueueCumulativeStatisticsInstance = TaskQueueCumulativeStatisticsInstance; +function TaskQueueCumulativeStatisticsListInstance(version, workspaceSid, taskQueueSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(taskQueueSid)) { + throw new Error("Parameter 'taskQueueSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new TaskQueueCumulativeStatisticsContextImpl(version, workspaceSid, taskQueueSid); + }; + instance._version = version; + instance._solution = { workspaceSid, taskQueueSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TaskQueueCumulativeStatisticsListInstance = TaskQueueCumulativeStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.d.ts new file mode 100644 index 00000000..9d5a0066 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.d.ts @@ -0,0 +1,188 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a TaskQueueRealTimeStatisticsInstance + */ +export interface TaskQueueRealTimeStatisticsContextFetchOptions { + /** The TaskChannel for which to fetch statistics. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; +} +export interface TaskQueueRealTimeStatisticsContext { + /** + * Fetch a TaskQueueRealTimeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueRealTimeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: TaskQueueRealTimeStatisticsInstance) => any): Promise; + /** + * Fetch a TaskQueueRealTimeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueRealTimeStatisticsInstance + */ + fetch(params: TaskQueueRealTimeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: TaskQueueRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TaskQueueRealTimeStatisticsContextSolution { + workspaceSid: string; + taskQueueSid: string; +} +export declare class TaskQueueRealTimeStatisticsContextImpl implements TaskQueueRealTimeStatisticsContext { + protected _version: V1; + protected _solution: TaskQueueRealTimeStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, taskQueueSid: string); + fetch(params?: TaskQueueRealTimeStatisticsContextFetchOptions | ((error: Error | null, item?: TaskQueueRealTimeStatisticsInstance) => any), callback?: (error: Error | null, item?: TaskQueueRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TaskQueueRealTimeStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TaskQueueRealTimeStatisticsResource { + account_sid: string; + activity_statistics: Array; + longest_task_waiting_age: number; + longest_task_waiting_sid: string; + longest_relative_task_age_in_queue: number; + longest_relative_task_sid_in_queue: string; + task_queue_sid: string; + tasks_by_priority: any; + tasks_by_status: any; + total_available_workers: number; + total_eligible_workers: number; + total_tasks: number; + workspace_sid: string; + url: string; +} +export declare class TaskQueueRealTimeStatisticsInstance { + protected _version: V1; + protected _solution: TaskQueueRealTimeStatisticsContextSolution; + protected _context?: TaskQueueRealTimeStatisticsContext; + constructor(_version: V1, payload: TaskQueueRealTimeStatisticsResource, workspaceSid: string, taskQueueSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. + */ + accountSid: string; + /** + * The number of current Workers by Activity. + */ + activityStatistics: Array; + /** + * The age of the longest waiting Task. + */ + longestTaskWaitingAge: number; + /** + * The SID of the longest waiting Task. + */ + longestTaskWaitingSid: string; + /** + * The relative age in the TaskQueue for the longest waiting Task. Calculation is based on the time when the Task entered the TaskQueue. + */ + longestRelativeTaskAgeInQueue: number; + /** + * The Task SID of the Task waiting in the TaskQueue the longest. Calculation is based on the time when the Task entered the TaskQueue. + */ + longestRelativeTaskSidInQueue: string; + /** + * The SID of the TaskQueue from which these statistics were calculated. + */ + taskQueueSid: string; + /** + * The number of Tasks by priority. For example: `{\"0\": \"10\", \"99\": \"5\"}` shows 10 Tasks at priority 0 and 5 at priority 99. + */ + tasksByPriority: any; + /** + * The number of Tasks by their current status. For example: `{\"pending\": \"1\", \"reserved\": \"3\", \"assigned\": \"2\", \"completed\": \"5\"}`. + */ + tasksByStatus: any; + /** + * The total number of Workers available for Tasks in the TaskQueue. + */ + totalAvailableWorkers: number; + /** + * The total number of Workers eligible for Tasks in the TaskQueue, independent of their Activity state. + */ + totalEligibleWorkers: number; + /** + * The total number of Tasks. + */ + totalTasks: number; + /** + * The SID of the Workspace that contains the TaskQueue. + */ + workspaceSid: string; + /** + * The absolute URL of the TaskQueue statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a TaskQueueRealTimeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueRealTimeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: TaskQueueRealTimeStatisticsInstance) => any): Promise; + /** + * Fetch a TaskQueueRealTimeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueRealTimeStatisticsInstance + */ + fetch(params: TaskQueueRealTimeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: TaskQueueRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + activityStatistics: any[]; + longestTaskWaitingAge: number; + longestTaskWaitingSid: string; + longestRelativeTaskAgeInQueue: number; + longestRelativeTaskSidInQueue: string; + taskQueueSid: string; + tasksByPriority: any; + tasksByStatus: any; + totalAvailableWorkers: number; + totalEligibleWorkers: number; + totalTasks: number; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TaskQueueRealTimeStatisticsSolution { + workspaceSid: string; + taskQueueSid: string; +} +export interface TaskQueueRealTimeStatisticsListInstance { + _version: V1; + _solution: TaskQueueRealTimeStatisticsSolution; + _uri: string; + (): TaskQueueRealTimeStatisticsContext; + get(): TaskQueueRealTimeStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TaskQueueRealTimeStatisticsListInstance(version: V1, workspaceSid: string, taskQueueSid: string): TaskQueueRealTimeStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.js new file mode 100644 index 00000000..2d048714 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.js @@ -0,0 +1,148 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskQueueRealTimeStatisticsListInstance = exports.TaskQueueRealTimeStatisticsInstance = exports.TaskQueueRealTimeStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class TaskQueueRealTimeStatisticsContextImpl { + constructor(_version, workspaceSid, taskQueueSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(taskQueueSid)) { + throw new Error("Parameter 'taskQueueSid' is not valid."); + } + this._solution = { workspaceSid, taskQueueSid }; + this._uri = `/Workspaces/${workspaceSid}/TaskQueues/${taskQueueSid}/RealTimeStatistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskQueueRealTimeStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.taskQueueSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueueRealTimeStatisticsContextImpl = TaskQueueRealTimeStatisticsContextImpl; +class TaskQueueRealTimeStatisticsInstance { + constructor(_version, payload, workspaceSid, taskQueueSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.activityStatistics = payload.activity_statistics; + this.longestTaskWaitingAge = deserialize.integer(payload.longest_task_waiting_age); + this.longestTaskWaitingSid = payload.longest_task_waiting_sid; + this.longestRelativeTaskAgeInQueue = deserialize.integer(payload.longest_relative_task_age_in_queue); + this.longestRelativeTaskSidInQueue = + payload.longest_relative_task_sid_in_queue; + this.taskQueueSid = payload.task_queue_sid; + this.tasksByPriority = payload.tasks_by_priority; + this.tasksByStatus = payload.tasks_by_status; + this.totalAvailableWorkers = deserialize.integer(payload.total_available_workers); + this.totalEligibleWorkers = deserialize.integer(payload.total_eligible_workers); + this.totalTasks = deserialize.integer(payload.total_tasks); + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid, taskQueueSid }; + } + get _proxy() { + this._context = + this._context || + new TaskQueueRealTimeStatisticsContextImpl(this._version, this._solution.workspaceSid, this._solution.taskQueueSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + activityStatistics: this.activityStatistics, + longestTaskWaitingAge: this.longestTaskWaitingAge, + longestTaskWaitingSid: this.longestTaskWaitingSid, + longestRelativeTaskAgeInQueue: this.longestRelativeTaskAgeInQueue, + longestRelativeTaskSidInQueue: this.longestRelativeTaskSidInQueue, + taskQueueSid: this.taskQueueSid, + tasksByPriority: this.tasksByPriority, + tasksByStatus: this.tasksByStatus, + totalAvailableWorkers: this.totalAvailableWorkers, + totalEligibleWorkers: this.totalEligibleWorkers, + totalTasks: this.totalTasks, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueueRealTimeStatisticsInstance = TaskQueueRealTimeStatisticsInstance; +function TaskQueueRealTimeStatisticsListInstance(version, workspaceSid, taskQueueSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(taskQueueSid)) { + throw new Error("Parameter 'taskQueueSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new TaskQueueRealTimeStatisticsContextImpl(version, workspaceSid, taskQueueSid); + }; + instance._version = version; + instance._solution = { workspaceSid, taskQueueSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TaskQueueRealTimeStatisticsListInstance = TaskQueueRealTimeStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.d.ts new file mode 100644 index 00000000..2e1b2e38 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.d.ts @@ -0,0 +1,148 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a TaskQueueStatisticsInstance + */ +export interface TaskQueueStatisticsContextFetchOptions { + /** Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** Only calculate statistics since this many minutes in the past. The default is 15 minutes. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. */ + splitByWaitTime?: string; +} +export interface TaskQueueStatisticsContext { + /** + * Fetch a TaskQueueStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: TaskQueueStatisticsInstance) => any): Promise; + /** + * Fetch a TaskQueueStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueStatisticsInstance + */ + fetch(params: TaskQueueStatisticsContextFetchOptions, callback?: (error: Error | null, item?: TaskQueueStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TaskQueueStatisticsContextSolution { + workspaceSid: string; + taskQueueSid: string; +} +export declare class TaskQueueStatisticsContextImpl implements TaskQueueStatisticsContext { + protected _version: V1; + protected _solution: TaskQueueStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, taskQueueSid: string); + fetch(params?: TaskQueueStatisticsContextFetchOptions | ((error: Error | null, item?: TaskQueueStatisticsInstance) => any), callback?: (error: Error | null, item?: TaskQueueStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TaskQueueStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TaskQueueStatisticsResource { + account_sid: string; + cumulative: any; + realtime: any; + task_queue_sid: string; + workspace_sid: string; + url: string; +} +export declare class TaskQueueStatisticsInstance { + protected _version: V1; + protected _solution: TaskQueueStatisticsContextSolution; + protected _context?: TaskQueueStatisticsContext; + constructor(_version: V1, payload: TaskQueueStatisticsResource, workspaceSid: string, taskQueueSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. + */ + accountSid: string; + /** + * An object that contains the cumulative statistics for the TaskQueue. + */ + cumulative: any; + /** + * An object that contains the real-time statistics for the TaskQueue. + */ + realtime: any; + /** + * The SID of the TaskQueue from which these statistics were calculated. + */ + taskQueueSid: string; + /** + * The SID of the Workspace that contains the TaskQueue. + */ + workspaceSid: string; + /** + * The absolute URL of the TaskQueue statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a TaskQueueStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: TaskQueueStatisticsInstance) => any): Promise; + /** + * Fetch a TaskQueueStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TaskQueueStatisticsInstance + */ + fetch(params: TaskQueueStatisticsContextFetchOptions, callback?: (error: Error | null, item?: TaskQueueStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + cumulative: any; + realtime: any; + taskQueueSid: string; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TaskQueueStatisticsSolution { + workspaceSid: string; + taskQueueSid: string; +} +export interface TaskQueueStatisticsListInstance { + _version: V1; + _solution: TaskQueueStatisticsSolution; + _uri: string; + (): TaskQueueStatisticsContext; + get(): TaskQueueStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TaskQueueStatisticsListInstance(version: V1, workspaceSid: string, taskQueueSid: string): TaskQueueStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.js new file mode 100644 index 00000000..b4a3d549 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.js @@ -0,0 +1,139 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskQueueStatisticsListInstance = exports.TaskQueueStatisticsInstance = exports.TaskQueueStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class TaskQueueStatisticsContextImpl { + constructor(_version, workspaceSid, taskQueueSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(taskQueueSid)) { + throw new Error("Parameter 'taskQueueSid' is not valid."); + } + this._solution = { workspaceSid, taskQueueSid }; + this._uri = `/Workspaces/${workspaceSid}/TaskQueues/${taskQueueSid}/Statistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["splitByWaitTime"] !== undefined) + data["SplitByWaitTime"] = params["splitByWaitTime"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskQueueStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.taskQueueSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueueStatisticsContextImpl = TaskQueueStatisticsContextImpl; +class TaskQueueStatisticsInstance { + constructor(_version, payload, workspaceSid, taskQueueSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.cumulative = payload.cumulative; + this.realtime = payload.realtime; + this.taskQueueSid = payload.task_queue_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid, taskQueueSid }; + } + get _proxy() { + this._context = + this._context || + new TaskQueueStatisticsContextImpl(this._version, this._solution.workspaceSid, this._solution.taskQueueSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + cumulative: this.cumulative, + realtime: this.realtime, + taskQueueSid: this.taskQueueSid, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueueStatisticsInstance = TaskQueueStatisticsInstance; +function TaskQueueStatisticsListInstance(version, workspaceSid, taskQueueSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(taskQueueSid)) { + throw new Error("Parameter 'taskQueueSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new TaskQueueStatisticsContextImpl(version, workspaceSid, taskQueueSid); + }; + instance._version = version; + instance._solution = { workspaceSid, taskQueueSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TaskQueueStatisticsListInstance = TaskQueueStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.d.ts new file mode 100644 index 00000000..8f14a504 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.d.ts @@ -0,0 +1,203 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to each + */ +export interface TaskQueuesStatisticsListInstanceEachOptions { + /** Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** The `friendly_name` of the TaskQueue statistics to read. */ + friendlyName?: string; + /** Only calculate statistics since this many minutes in the past. The default is 15 minutes. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. */ + splitByWaitTime?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TaskQueuesStatisticsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TaskQueuesStatisticsListInstanceOptions { + /** Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** The `friendly_name` of the TaskQueue statistics to read. */ + friendlyName?: string; + /** Only calculate statistics since this many minutes in the past. The default is 15 minutes. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. */ + splitByWaitTime?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TaskQueuesStatisticsListInstancePageOptions { + /** Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** The `friendly_name` of the TaskQueue statistics to read. */ + friendlyName?: string; + /** Only calculate statistics since this many minutes in the past. The default is 15 minutes. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. */ + splitByWaitTime?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TaskQueuesStatisticsSolution { + workspaceSid: string; +} +export interface TaskQueuesStatisticsListInstance { + _version: V1; + _solution: TaskQueuesStatisticsSolution; + _uri: string; + /** + * Streams TaskQueuesStatisticsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskQueuesStatisticsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TaskQueuesStatisticsInstance, done: (err?: Error) => void) => void): void; + each(params: TaskQueuesStatisticsListInstanceEachOptions, callback?: (item: TaskQueuesStatisticsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TaskQueuesStatisticsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TaskQueuesStatisticsPage) => any): Promise; + /** + * Lists TaskQueuesStatisticsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskQueuesStatisticsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TaskQueuesStatisticsInstance[]) => any): Promise; + list(params: TaskQueuesStatisticsListInstanceOptions, callback?: (error: Error | null, items: TaskQueuesStatisticsInstance[]) => any): Promise; + /** + * Retrieve a single page of TaskQueuesStatisticsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TaskQueuesStatisticsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TaskQueuesStatisticsPage) => any): Promise; + page(params: TaskQueuesStatisticsListInstancePageOptions, callback?: (error: Error | null, items: TaskQueuesStatisticsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TaskQueuesStatisticsListInstance(version: V1, workspaceSid: string): TaskQueuesStatisticsListInstance; +interface TaskQueuesStatisticsPayload extends TwilioResponsePayload { + task_queues_statistics: TaskQueuesStatisticsResource[]; +} +interface TaskQueuesStatisticsResource { + account_sid: string; + cumulative: any; + realtime: any; + task_queue_sid: string; + workspace_sid: string; +} +export declare class TaskQueuesStatisticsInstance { + protected _version: V1; + constructor(_version: V1, payload: TaskQueuesStatisticsResource, workspaceSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. + */ + accountSid: string; + /** + * An object that contains the cumulative statistics for the TaskQueues. + */ + cumulative: any; + /** + * An object that contains the real-time statistics for the TaskQueues. + */ + realtime: any; + /** + * The SID of the TaskQueue from which these statistics were calculated. + */ + taskQueueSid: string; + /** + * The SID of the Workspace that contains the TaskQueues. + */ + workspaceSid: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + cumulative: any; + realtime: any; + taskQueueSid: string; + workspaceSid: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class TaskQueuesStatisticsPage extends Page { + /** + * Initialize the TaskQueuesStatisticsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TaskQueuesStatisticsSolution); + /** + * Build an instance of TaskQueuesStatisticsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TaskQueuesStatisticsResource): TaskQueuesStatisticsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js new file mode 100644 index 00000000..ff2e6a58 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js @@ -0,0 +1,142 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskQueuesStatisticsPage = exports.TaskQueuesStatisticsInstance = exports.TaskQueuesStatisticsListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function TaskQueuesStatisticsListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = `/Workspaces/${workspaceSid}/TaskQueues/Statistics`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["splitByWaitTime"] !== undefined) + data["SplitByWaitTime"] = params["splitByWaitTime"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TaskQueuesStatisticsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TaskQueuesStatisticsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TaskQueuesStatisticsListInstance = TaskQueuesStatisticsListInstance; +class TaskQueuesStatisticsInstance { + constructor(_version, payload, workspaceSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.cumulative = payload.cumulative; + this.realtime = payload.realtime; + this.taskQueueSid = payload.task_queue_sid; + this.workspaceSid = payload.workspace_sid; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + cumulative: this.cumulative, + realtime: this.realtime, + taskQueueSid: this.taskQueueSid, + workspaceSid: this.workspaceSid, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueuesStatisticsInstance = TaskQueuesStatisticsInstance; +class TaskQueuesStatisticsPage extends Page_1.default { + /** + * Initialize the TaskQueuesStatisticsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TaskQueuesStatisticsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TaskQueuesStatisticsInstance(this._version, payload, this._solution.workspaceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TaskQueuesStatisticsPage = TaskQueuesStatisticsPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker.d.ts new file mode 100644 index 00000000..0484612c --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker.d.ts @@ -0,0 +1,454 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { ReservationListInstance } from "./worker/reservation"; +import { WorkerChannelListInstance } from "./worker/workerChannel"; +import { WorkerStatisticsListInstance } from "./worker/workerStatistics"; +import { WorkersCumulativeStatisticsListInstance } from "./worker/workersCumulativeStatistics"; +import { WorkersRealTimeStatisticsListInstance } from "./worker/workersRealTimeStatistics"; +import { WorkersStatisticsListInstance } from "./worker/workersStatistics"; +/** + * Options to pass to remove a WorkerInstance + */ +export interface WorkerContextRemoveOptions { + /** The If-Match HTTP request header */ + ifMatch?: string; +} +/** + * Options to pass to update a WorkerInstance + */ +export interface WorkerContextUpdateOptions { + /** The If-Match HTTP request header */ + ifMatch?: string; + /** The SID of a valid Activity that will describe the Worker\\\'s initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. */ + activitySid?: string; + /** The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. */ + attributes?: string; + /** A descriptive string that you create to describe the Worker. It can be up to 64 characters long. */ + friendlyName?: string; + /** Whether to reject the Worker\\\'s pending reservations. This option is only valid if the Worker\\\'s new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. */ + rejectPendingReservations?: boolean; +} +/** + * Options to pass to create a WorkerInstance + */ +export interface WorkerListInstanceCreateOptions { + /** A descriptive string that you create to describe the new Worker. It can be up to 64 characters long. */ + friendlyName: string; + /** The SID of a valid Activity that will describe the new Worker\\\'s initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker\\\'s initial state is the `default_activity_sid` configured on the Workspace. */ + activitySid?: string; + /** A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. */ + attributes?: string; +} +/** + * Options to pass to each + */ +export interface WorkerListInstanceEachOptions { + /** The `activity_name` of the Worker resources to read. */ + activityName?: string; + /** The `activity_sid` of the Worker resources to read. */ + activitySid?: string; + /** Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. */ + available?: string; + /** The `friendly_name` of the Worker resources to read. */ + friendlyName?: string; + /** Filter by Workers that would match an expression. In addition to fields in the workers\' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` */ + targetWorkersExpression?: string; + /** The `friendly_name` of the TaskQueue that the Workers to read are eligible for. */ + taskQueueName?: string; + /** The SID of the TaskQueue that the Workers to read are eligible for. */ + taskQueueSid?: string; + /** Sorting parameter for Workers */ + ordering?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WorkerInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WorkerListInstanceOptions { + /** The `activity_name` of the Worker resources to read. */ + activityName?: string; + /** The `activity_sid` of the Worker resources to read. */ + activitySid?: string; + /** Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. */ + available?: string; + /** The `friendly_name` of the Worker resources to read. */ + friendlyName?: string; + /** Filter by Workers that would match an expression. In addition to fields in the workers\' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` */ + targetWorkersExpression?: string; + /** The `friendly_name` of the TaskQueue that the Workers to read are eligible for. */ + taskQueueName?: string; + /** The SID of the TaskQueue that the Workers to read are eligible for. */ + taskQueueSid?: string; + /** Sorting parameter for Workers */ + ordering?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WorkerListInstancePageOptions { + /** The `activity_name` of the Worker resources to read. */ + activityName?: string; + /** The `activity_sid` of the Worker resources to read. */ + activitySid?: string; + /** Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. */ + available?: string; + /** The `friendly_name` of the Worker resources to read. */ + friendlyName?: string; + /** Filter by Workers that would match an expression. In addition to fields in the workers\' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` */ + targetWorkersExpression?: string; + /** The `friendly_name` of the TaskQueue that the Workers to read are eligible for. */ + taskQueueName?: string; + /** The SID of the TaskQueue that the Workers to read are eligible for. */ + taskQueueSid?: string; + /** Sorting parameter for Workers */ + ordering?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WorkerContext { + reservations: ReservationListInstance; + workerChannels: WorkerChannelListInstance; + statistics: WorkerStatisticsListInstance; + /** + * Remove a WorkerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a WorkerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + remove(params: WorkerContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WorkerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + fetch(callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + /** + * Update a WorkerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + update(callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + /** + * Update a WorkerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + update(params: WorkerContextUpdateOptions, callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkerContextSolution { + workspaceSid: string; + sid: string; +} +export declare class WorkerContextImpl implements WorkerContext { + protected _version: V1; + protected _solution: WorkerContextSolution; + protected _uri: string; + protected _reservations?: ReservationListInstance; + protected _workerChannels?: WorkerChannelListInstance; + protected _statistics?: WorkerStatisticsListInstance; + constructor(_version: V1, workspaceSid: string, sid: string); + get reservations(): ReservationListInstance; + get workerChannels(): WorkerChannelListInstance; + get statistics(): WorkerStatisticsListInstance; + remove(params?: WorkerContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + update(params?: WorkerContextUpdateOptions | ((error: Error | null, item?: WorkerInstance) => any), callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkerContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkerPayload extends TwilioResponsePayload { + workers: WorkerResource[]; +} +interface WorkerResource { + account_sid: string; + activity_name: string; + activity_sid: string; + attributes: string; + available: boolean; + date_created: Date; + date_status_changed: Date; + date_updated: Date; + friendly_name: string; + sid: string; + workspace_sid: string; + url: string; + links: Record; +} +export declare class WorkerInstance { + protected _version: V1; + protected _solution: WorkerContextSolution; + protected _context?: WorkerContext; + constructor(_version: V1, payload: WorkerResource, workspaceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. + */ + accountSid: string; + /** + * The `friendly_name` of the Worker\'s current Activity. + */ + activityName: string; + /** + * The SID of the Worker\'s current Activity. + */ + activitySid: string; + /** + * The JSON string that describes the Worker. For example: `{ \"email\": \"Bob@example.com\", \"phone\": \"+5095551234\" }`. **Note** If this property has been assigned a value, it will only be displayed in FETCH actions that return a single resource. Otherwise, this property will be null, even if it has a value. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. + */ + attributes: string; + /** + * Whether the Worker is available to perform tasks. + */ + available: boolean; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT of the last change to the Worker\'s activity specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Used to calculate Workflow statistics. + */ + dateStatusChanged: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. Friendly names are case insensitive, and unique within the TaskRouter Workspace. + */ + friendlyName: string; + /** + * The unique string that we created to identify the Worker resource. + */ + sid: string; + /** + * The SID of the Workspace that contains the Worker. + */ + workspaceSid: string; + /** + * The absolute URL of the Worker resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a WorkerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Remove a WorkerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + remove(params: WorkerContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WorkerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + fetch(callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + /** + * Update a WorkerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + update(callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + /** + * Update a WorkerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + update(params: WorkerContextUpdateOptions, callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + /** + * Access the reservations. + */ + reservations(): ReservationListInstance; + /** + * Access the workerChannels. + */ + workerChannels(): WorkerChannelListInstance; + /** + * Access the statistics. + */ + statistics(): WorkerStatisticsListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + activityName: string; + activitySid: string; + attributes: string; + available: boolean; + dateCreated: Date; + dateStatusChanged: Date; + dateUpdated: Date; + friendlyName: string; + sid: string; + workspaceSid: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkerSolution { + workspaceSid: string; +} +export interface WorkerListInstance { + _version: V1; + _solution: WorkerSolution; + _uri: string; + (sid: string): WorkerContext; + get(sid: string): WorkerContext; + _cumulativeStatistics?: WorkersCumulativeStatisticsListInstance; + cumulativeStatistics: WorkersCumulativeStatisticsListInstance; + _realTimeStatistics?: WorkersRealTimeStatisticsListInstance; + realTimeStatistics: WorkersRealTimeStatisticsListInstance; + _statistics?: WorkersStatisticsListInstance; + statistics: WorkersStatisticsListInstance; + /** + * Create a WorkerInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + create(params: WorkerListInstanceCreateOptions, callback?: (error: Error | null, item?: WorkerInstance) => any): Promise; + /** + * Streams WorkerInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkerListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WorkerInstance, done: (err?: Error) => void) => void): void; + each(params: WorkerListInstanceEachOptions, callback?: (item: WorkerInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WorkerInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WorkerPage) => any): Promise; + /** + * Lists WorkerInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkerListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WorkerInstance[]) => any): Promise; + list(params: WorkerListInstanceOptions, callback?: (error: Error | null, items: WorkerInstance[]) => any): Promise; + /** + * Retrieve a single page of WorkerInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkerListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WorkerPage) => any): Promise; + page(params: WorkerListInstancePageOptions, callback?: (error: Error | null, items: WorkerPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkerListInstance(version: V1, workspaceSid: string): WorkerListInstance; +export declare class WorkerPage extends Page { + /** + * Initialize the WorkerPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: WorkerSolution); + /** + * Build an instance of WorkerInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WorkerResource): WorkerInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker.js new file mode 100644 index 00000000..6cfdf5a1 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker.js @@ -0,0 +1,370 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkerPage = exports.WorkerListInstance = exports.WorkerInstance = exports.WorkerContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const reservation_1 = require("./worker/reservation"); +const workerChannel_1 = require("./worker/workerChannel"); +const workerStatistics_1 = require("./worker/workerStatistics"); +const workersCumulativeStatistics_1 = require("./worker/workersCumulativeStatistics"); +const workersRealTimeStatistics_1 = require("./worker/workersRealTimeStatistics"); +const workersStatistics_1 = require("./worker/workersStatistics"); +class WorkerContextImpl { + constructor(_version, workspaceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/Workers/${sid}`; + } + get reservations() { + this._reservations = + this._reservations || + (0, reservation_1.ReservationListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._reservations; + } + get workerChannels() { + this._workerChannels = + this._workerChannels || + (0, workerChannel_1.WorkerChannelListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._workerChannels; + } + get statistics() { + this._statistics = + this._statistics || + (0, workerStatistics_1.WorkerStatisticsListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._statistics; + } + remove(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + const headers = {}; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + params: data, + headers, + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WorkerInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["activitySid"] !== undefined) + data["ActivitySid"] = params["activitySid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["rejectPendingReservations"] !== undefined) + data["RejectPendingReservations"] = serialize.bool(params["rejectPendingReservations"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkerInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkerContextImpl = WorkerContextImpl; +class WorkerInstance { + constructor(_version, payload, workspaceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.activityName = payload.activity_name; + this.activitySid = payload.activity_sid; + this.attributes = payload.attributes; + this.available = payload.available; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateStatusChanged = deserialize.iso8601DateTime(payload.date_status_changed); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this.links = payload.links; + this._solution = { workspaceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WorkerContextImpl(this._version, this._solution.workspaceSid, this._solution.sid); + return this._context; + } + remove(params, callback) { + return this._proxy.remove(params, callback); + } + /** + * Fetch a WorkerInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the reservations. + */ + reservations() { + return this._proxy.reservations; + } + /** + * Access the workerChannels. + */ + workerChannels() { + return this._proxy.workerChannels; + } + /** + * Access the statistics. + */ + statistics() { + return this._proxy.statistics; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + activityName: this.activityName, + activitySid: this.activitySid, + attributes: this.attributes, + available: this.available, + dateCreated: this.dateCreated, + dateStatusChanged: this.dateStatusChanged, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + sid: this.sid, + workspaceSid: this.workspaceSid, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkerInstance = WorkerInstance; +function WorkerListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WorkerContextImpl(version, workspaceSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = `/Workspaces/${workspaceSid}/Workers`; + Object.defineProperty(instance, "cumulativeStatistics", { + get: function cumulativeStatistics() { + if (!instance._cumulativeStatistics) { + instance._cumulativeStatistics = + (0, workersCumulativeStatistics_1.WorkersCumulativeStatisticsListInstance)(instance._version, instance._solution.workspaceSid); + } + return instance._cumulativeStatistics; + }, + }); + Object.defineProperty(instance, "realTimeStatistics", { + get: function realTimeStatistics() { + if (!instance._realTimeStatistics) { + instance._realTimeStatistics = (0, workersRealTimeStatistics_1.WorkersRealTimeStatisticsListInstance)(instance._version, instance._solution.workspaceSid); + } + return instance._realTimeStatistics; + }, + }); + Object.defineProperty(instance, "statistics", { + get: function statistics() { + if (!instance._statistics) { + instance._statistics = (0, workersStatistics_1.WorkersStatisticsListInstance)(instance._version, instance._solution.workspaceSid); + } + return instance._statistics; + }, + }); + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["activitySid"] !== undefined) + data["ActivitySid"] = params["activitySid"]; + if (params["attributes"] !== undefined) + data["Attributes"] = params["attributes"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkerInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["activityName"] !== undefined) + data["ActivityName"] = params["activityName"]; + if (params["activitySid"] !== undefined) + data["ActivitySid"] = params["activitySid"]; + if (params["available"] !== undefined) + data["Available"] = params["available"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["targetWorkersExpression"] !== undefined) + data["TargetWorkersExpression"] = params["targetWorkersExpression"]; + if (params["taskQueueName"] !== undefined) + data["TaskQueueName"] = params["taskQueueName"]; + if (params["taskQueueSid"] !== undefined) + data["TaskQueueSid"] = params["taskQueueSid"]; + if (params["ordering"] !== undefined) + data["Ordering"] = params["ordering"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkerPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WorkerPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkerListInstance = WorkerListInstance; +class WorkerPage extends Page_1.default { + /** + * Initialize the WorkerPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WorkerInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WorkerInstance(this._version, payload, this._solution.workspaceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkerPage = WorkerPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts new file mode 100644 index 00000000..0779619d --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts @@ -0,0 +1,403 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type ReservationCallStatus = "initiated" | "ringing" | "answered" | "completed"; +export type ReservationConferenceEvent = "start" | "end" | "join" | "leave" | "mute" | "hold" | "speaker"; +export type ReservationStatus = "pending" | "accepted" | "rejected" | "timeout" | "canceled" | "rescinded" | "wrapping" | "completed"; +/** + * Options to pass to update a ReservationInstance + */ +export interface ReservationContextUpdateOptions { + /** The If-Match HTTP request header */ + ifMatch?: string; + /** */ + reservationStatus?: ReservationStatus; + /** The new worker activity SID if rejecting a reservation. */ + workerActivitySid?: string; + /** The assignment instruction for the reservation. */ + instruction?: string; + /** The SID of the Activity resource to start after executing a Dequeue instruction. */ + dequeuePostWorkActivitySid?: string; + /** The caller ID of the call to the worker when executing a Dequeue instruction. */ + dequeueFrom?: string; + /** Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. */ + dequeueRecord?: string; + /** The timeout for call when executing a Dequeue instruction. */ + dequeueTimeout?: number; + /** The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. */ + dequeueTo?: string; + /** The callback URL for completed call event when executing a Dequeue instruction. */ + dequeueStatusCallbackUrl?: string; + /** The Caller ID of the outbound call when executing a Call instruction. */ + callFrom?: string; + /** Whether to record both legs of a call when executing a Call instruction. */ + callRecord?: string; + /** The timeout for a call when executing a Call instruction. */ + callTimeout?: number; + /** The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. */ + callTo?: string; + /** TwiML URI executed on answering the worker\\\'s leg as a result of the Call instruction. */ + callUrl?: string; + /** The URL to call for the completed call event when executing a Call instruction. */ + callStatusCallbackUrl?: string; + /** Whether to accept a reservation when executing a Call instruction. */ + callAccept?: boolean; + /** The Call SID of the call parked in the queue when executing a Redirect instruction. */ + redirectCallSid?: string; + /** Whether the reservation should be accepted when executing a Redirect instruction. */ + redirectAccept?: boolean; + /** TwiML URI to redirect the call to when executing the Redirect instruction. */ + redirectUrl?: string; + /** The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. */ + to?: string; + /** The caller ID of the call to the worker when executing a Conference instruction. */ + from?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */ + statusCallbackMethod?: string; + /** The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. */ + statusCallbackEvent?: Array; + /** The timeout for a call when executing a Conference instruction. */ + timeout?: number; + /** Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. */ + record?: boolean; + /** Whether the agent is muted in the conference. Defaults to `false`. */ + muted?: boolean; + /** Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. */ + beep?: string; + /** Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. */ + startConferenceOnEnter?: boolean; + /** Whether to end the conference when the agent leaves. */ + endConferenceOnExit?: boolean; + /** The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). */ + waitUrl?: string; + /** The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. */ + waitMethod?: string; + /** Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. */ + earlyMedia?: boolean; + /** The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. */ + maxParticipants?: number; + /** The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. */ + conferenceStatusCallback?: string; + /** The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + conferenceStatusCallbackMethod?: string; + /** The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. */ + conferenceStatusCallbackEvent?: Array; + /** Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. */ + conferenceRecord?: string; + /** Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. */ + conferenceTrim?: string; + /** The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. */ + recordingChannels?: string; + /** The URL that we should call using the `recording_status_callback_method` when the recording status changes. */ + recordingStatusCallback?: string; + /** The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + recordingStatusCallbackMethod?: string; + /** The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. */ + conferenceRecordingStatusCallback?: string; + /** The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. */ + conferenceRecordingStatusCallbackMethod?: string; + /** The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. */ + region?: string; + /** The SIP username used for authentication. */ + sipAuthUsername?: string; + /** The SIP password for authentication. */ + sipAuthPassword?: string; + /** The call progress events sent via webhooks as a result of a Dequeue instruction. */ + dequeueStatusCallbackEvent?: Array; + /** The new worker activity SID after executing a Conference instruction. */ + postWorkActivitySid?: string; + /** Whether to end the conference when the customer leaves. */ + endConferenceOnCustomerExit?: boolean; + /** Whether to play a notification beep when the customer joins. */ + beepOnCustomerEntrance?: boolean; + /** The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. */ + jitterBufferSize?: string; +} +/** + * Options to pass to each + */ +export interface ReservationListInstanceEachOptions { + /** Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. */ + reservationStatus?: ReservationStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ReservationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ReservationListInstanceOptions { + /** Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. */ + reservationStatus?: ReservationStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ReservationListInstancePageOptions { + /** Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. */ + reservationStatus?: ReservationStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ReservationContext { + /** + * Fetch a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + fetch(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Update a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + update(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Update a ReservationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + update(params: ReservationContextUpdateOptions, callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ReservationContextSolution { + workspaceSid: string; + workerSid: string; + sid: string; +} +export declare class ReservationContextImpl implements ReservationContext { + protected _version: V1; + protected _solution: ReservationContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, workerSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + update(params?: ReservationContextUpdateOptions | ((error: Error | null, item?: ReservationInstance) => any), callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ReservationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ReservationPayload extends TwilioResponsePayload { + reservations: ReservationResource[]; +} +interface ReservationResource { + account_sid: string; + date_created: Date; + date_updated: Date; + reservation_status: ReservationStatus; + sid: string; + task_sid: string; + worker_name: string; + worker_sid: string; + workspace_sid: string; + url: string; + links: Record; +} +export declare class ReservationInstance { + protected _version: V1; + protected _solution: ReservationContextSolution; + protected _context?: ReservationContext; + constructor(_version: V1, payload: ReservationResource, workspaceSid: string, workerSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the WorkerReservation resource. + */ + accountSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + reservationStatus: ReservationStatus; + /** + * The unique string that we created to identify the WorkerReservation resource. + */ + sid: string; + /** + * The SID of the reserved Task resource. + */ + taskSid: string; + /** + * The `friendly_name` of the Worker that is reserved. + */ + workerName: string; + /** + * The SID of the reserved Worker resource. + */ + workerSid: string; + /** + * The SID of the Workspace that this worker is contained within. + */ + workspaceSid: string; + /** + * The absolute URL of the WorkerReservation resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + fetch(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Update a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + update(callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Update a ReservationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + update(params: ReservationContextUpdateOptions, callback?: (error: Error | null, item?: ReservationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + dateCreated: Date; + dateUpdated: Date; + reservationStatus: ReservationStatus; + sid: string; + taskSid: string; + workerName: string; + workerSid: string; + workspaceSid: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ReservationSolution { + workspaceSid: string; + workerSid: string; +} +export interface ReservationListInstance { + _version: V1; + _solution: ReservationSolution; + _uri: string; + (sid: string): ReservationContext; + get(sid: string): ReservationContext; + /** + * Streams ReservationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ReservationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ReservationInstance, done: (err?: Error) => void) => void): void; + each(params: ReservationListInstanceEachOptions, callback?: (item: ReservationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ReservationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ReservationPage) => any): Promise; + /** + * Lists ReservationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ReservationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ReservationInstance[]) => any): Promise; + list(params: ReservationListInstanceOptions, callback?: (error: Error | null, items: ReservationInstance[]) => any): Promise; + /** + * Retrieve a single page of ReservationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ReservationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ReservationPage) => any): Promise; + page(params: ReservationListInstancePageOptions, callback?: (error: Error | null, items: ReservationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ReservationListInstance(version: V1, workspaceSid: string, workerSid: string): ReservationListInstance; +export declare class ReservationPage extends Page { + /** + * Initialize the ReservationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ReservationSolution); + /** + * Build an instance of ReservationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ReservationResource): ReservationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/reservation.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/reservation.js new file mode 100644 index 00000000..7c0274ce --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/reservation.js @@ -0,0 +1,340 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReservationPage = exports.ReservationListInstance = exports.ReservationInstance = exports.ReservationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class ReservationContextImpl { + constructor(_version, workspaceSid, workerSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workerSid)) { + throw new Error("Parameter 'workerSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, workerSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/Workers/${workerSid}/Reservations/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ReservationInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.workerSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["reservationStatus"] !== undefined) + data["ReservationStatus"] = params["reservationStatus"]; + if (params["workerActivitySid"] !== undefined) + data["WorkerActivitySid"] = params["workerActivitySid"]; + if (params["instruction"] !== undefined) + data["Instruction"] = params["instruction"]; + if (params["dequeuePostWorkActivitySid"] !== undefined) + data["DequeuePostWorkActivitySid"] = params["dequeuePostWorkActivitySid"]; + if (params["dequeueFrom"] !== undefined) + data["DequeueFrom"] = params["dequeueFrom"]; + if (params["dequeueRecord"] !== undefined) + data["DequeueRecord"] = params["dequeueRecord"]; + if (params["dequeueTimeout"] !== undefined) + data["DequeueTimeout"] = params["dequeueTimeout"]; + if (params["dequeueTo"] !== undefined) + data["DequeueTo"] = params["dequeueTo"]; + if (params["dequeueStatusCallbackUrl"] !== undefined) + data["DequeueStatusCallbackUrl"] = params["dequeueStatusCallbackUrl"]; + if (params["callFrom"] !== undefined) + data["CallFrom"] = params["callFrom"]; + if (params["callRecord"] !== undefined) + data["CallRecord"] = params["callRecord"]; + if (params["callTimeout"] !== undefined) + data["CallTimeout"] = params["callTimeout"]; + if (params["callTo"] !== undefined) + data["CallTo"] = params["callTo"]; + if (params["callUrl"] !== undefined) + data["CallUrl"] = params["callUrl"]; + if (params["callStatusCallbackUrl"] !== undefined) + data["CallStatusCallbackUrl"] = params["callStatusCallbackUrl"]; + if (params["callAccept"] !== undefined) + data["CallAccept"] = serialize.bool(params["callAccept"]); + if (params["redirectCallSid"] !== undefined) + data["RedirectCallSid"] = params["redirectCallSid"]; + if (params["redirectAccept"] !== undefined) + data["RedirectAccept"] = serialize.bool(params["redirectAccept"]); + if (params["redirectUrl"] !== undefined) + data["RedirectUrl"] = params["redirectUrl"]; + if (params["to"] !== undefined) + data["To"] = params["to"]; + if (params["from"] !== undefined) + data["From"] = params["from"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["statusCallbackEvent"] !== undefined) + data["StatusCallbackEvent"] = serialize.map(params["statusCallbackEvent"], (e) => e); + if (params["timeout"] !== undefined) + data["Timeout"] = params["timeout"]; + if (params["record"] !== undefined) + data["Record"] = serialize.bool(params["record"]); + if (params["muted"] !== undefined) + data["Muted"] = serialize.bool(params["muted"]); + if (params["beep"] !== undefined) + data["Beep"] = params["beep"]; + if (params["startConferenceOnEnter"] !== undefined) + data["StartConferenceOnEnter"] = serialize.bool(params["startConferenceOnEnter"]); + if (params["endConferenceOnExit"] !== undefined) + data["EndConferenceOnExit"] = serialize.bool(params["endConferenceOnExit"]); + if (params["waitUrl"] !== undefined) + data["WaitUrl"] = params["waitUrl"]; + if (params["waitMethod"] !== undefined) + data["WaitMethod"] = params["waitMethod"]; + if (params["earlyMedia"] !== undefined) + data["EarlyMedia"] = serialize.bool(params["earlyMedia"]); + if (params["maxParticipants"] !== undefined) + data["MaxParticipants"] = params["maxParticipants"]; + if (params["conferenceStatusCallback"] !== undefined) + data["ConferenceStatusCallback"] = params["conferenceStatusCallback"]; + if (params["conferenceStatusCallbackMethod"] !== undefined) + data["ConferenceStatusCallbackMethod"] = + params["conferenceStatusCallbackMethod"]; + if (params["conferenceStatusCallbackEvent"] !== undefined) + data["ConferenceStatusCallbackEvent"] = serialize.map(params["conferenceStatusCallbackEvent"], (e) => e); + if (params["conferenceRecord"] !== undefined) + data["ConferenceRecord"] = params["conferenceRecord"]; + if (params["conferenceTrim"] !== undefined) + data["ConferenceTrim"] = params["conferenceTrim"]; + if (params["recordingChannels"] !== undefined) + data["RecordingChannels"] = params["recordingChannels"]; + if (params["recordingStatusCallback"] !== undefined) + data["RecordingStatusCallback"] = params["recordingStatusCallback"]; + if (params["recordingStatusCallbackMethod"] !== undefined) + data["RecordingStatusCallbackMethod"] = + params["recordingStatusCallbackMethod"]; + if (params["conferenceRecordingStatusCallback"] !== undefined) + data["ConferenceRecordingStatusCallback"] = + params["conferenceRecordingStatusCallback"]; + if (params["conferenceRecordingStatusCallbackMethod"] !== undefined) + data["ConferenceRecordingStatusCallbackMethod"] = + params["conferenceRecordingStatusCallbackMethod"]; + if (params["region"] !== undefined) + data["Region"] = params["region"]; + if (params["sipAuthUsername"] !== undefined) + data["SipAuthUsername"] = params["sipAuthUsername"]; + if (params["sipAuthPassword"] !== undefined) + data["SipAuthPassword"] = params["sipAuthPassword"]; + if (params["dequeueStatusCallbackEvent"] !== undefined) + data["DequeueStatusCallbackEvent"] = serialize.map(params["dequeueStatusCallbackEvent"], (e) => e); + if (params["postWorkActivitySid"] !== undefined) + data["PostWorkActivitySid"] = params["postWorkActivitySid"]; + if (params["endConferenceOnCustomerExit"] !== undefined) + data["EndConferenceOnCustomerExit"] = serialize.bool(params["endConferenceOnCustomerExit"]); + if (params["beepOnCustomerEntrance"] !== undefined) + data["BeepOnCustomerEntrance"] = serialize.bool(params["beepOnCustomerEntrance"]); + if (params["jitterBufferSize"] !== undefined) + data["JitterBufferSize"] = params["jitterBufferSize"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + if (params["ifMatch"] !== undefined) + headers["If-Match"] = params["ifMatch"]; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ReservationInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.workerSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ReservationContextImpl = ReservationContextImpl; +class ReservationInstance { + constructor(_version, payload, workspaceSid, workerSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.reservationStatus = payload.reservation_status; + this.sid = payload.sid; + this.taskSid = payload.task_sid; + this.workerName = payload.worker_name; + this.workerSid = payload.worker_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this.links = payload.links; + this._solution = { workspaceSid, workerSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ReservationContextImpl(this._version, this._solution.workspaceSid, this._solution.workerSid, this._solution.sid); + return this._context; + } + /** + * Fetch a ReservationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ReservationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + reservationStatus: this.reservationStatus, + sid: this.sid, + taskSid: this.taskSid, + workerName: this.workerName, + workerSid: this.workerSid, + workspaceSid: this.workspaceSid, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ReservationInstance = ReservationInstance; +function ReservationListInstance(version, workspaceSid, workerSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workerSid)) { + throw new Error("Parameter 'workerSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ReservationContextImpl(version, workspaceSid, workerSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid, workerSid }; + instance._uri = `/Workspaces/${workspaceSid}/Workers/${workerSid}/Reservations`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["reservationStatus"] !== undefined) + data["ReservationStatus"] = params["reservationStatus"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ReservationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ReservationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ReservationListInstance = ReservationListInstance; +class ReservationPage extends Page_1.default { + /** + * Initialize the ReservationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ReservationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ReservationInstance(this._version, payload, this._solution.workspaceSid, this._solution.workerSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ReservationPage = ReservationPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerChannel.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerChannel.d.ts new file mode 100644 index 00000000..4d7abe6e --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerChannel.d.ts @@ -0,0 +1,307 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to update a WorkerChannelInstance + */ +export interface WorkerChannelContextUpdateOptions { + /** The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. */ + capacity?: number; + /** Whether the WorkerChannel is available. Set to `false` to prevent the Worker from receiving any new Tasks of this TaskChannel type. */ + available?: boolean; +} +/** + * Options to pass to each + */ +export interface WorkerChannelListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WorkerChannelInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WorkerChannelListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WorkerChannelListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WorkerChannelContext { + /** + * Fetch a WorkerChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerChannelInstance + */ + fetch(callback?: (error: Error | null, item?: WorkerChannelInstance) => any): Promise; + /** + * Update a WorkerChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerChannelInstance + */ + update(callback?: (error: Error | null, item?: WorkerChannelInstance) => any): Promise; + /** + * Update a WorkerChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerChannelInstance + */ + update(params: WorkerChannelContextUpdateOptions, callback?: (error: Error | null, item?: WorkerChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkerChannelContextSolution { + workspaceSid: string; + workerSid: string; + sid: string; +} +export declare class WorkerChannelContextImpl implements WorkerChannelContext { + protected _version: V1; + protected _solution: WorkerChannelContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, workerSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: WorkerChannelInstance) => any): Promise; + update(params?: WorkerChannelContextUpdateOptions | ((error: Error | null, item?: WorkerChannelInstance) => any), callback?: (error: Error | null, item?: WorkerChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkerChannelContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkerChannelPayload extends TwilioResponsePayload { + channels: WorkerChannelResource[]; +} +interface WorkerChannelResource { + account_sid: string; + assigned_tasks: number; + available: boolean; + available_capacity_percentage: number; + configured_capacity: number; + date_created: Date; + date_updated: Date; + sid: string; + task_channel_sid: string; + task_channel_unique_name: string; + worker_sid: string; + workspace_sid: string; + url: string; +} +export declare class WorkerChannelInstance { + protected _version: V1; + protected _solution: WorkerChannelContextSolution; + protected _context?: WorkerChannelContext; + constructor(_version: V1, payload: WorkerChannelResource, workspaceSid: string, workerSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. + */ + accountSid: string; + /** + * The total number of Tasks assigned to Worker for the TaskChannel type. + */ + assignedTasks: number; + /** + * Whether the Worker should receive Tasks of the TaskChannel type. + */ + available: boolean; + /** + * The current percentage of capacity the TaskChannel has available. Can be a number between `0` and `100`. A value of `0` indicates that TaskChannel has no capacity available and a value of `100` means the Worker is available to receive any Tasks of this TaskChannel type. + */ + availableCapacityPercentage: number; + /** + * The current configured capacity for the WorkerChannel. TaskRouter will not create any reservations after the assigned Tasks for the Worker reaches the value. + */ + configuredCapacity: number; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The unique string that we created to identify the WorkerChannel resource. + */ + sid: string; + /** + * The SID of the TaskChannel. + */ + taskChannelSid: string; + /** + * The unique name of the TaskChannel, such as `voice` or `sms`. + */ + taskChannelUniqueName: string; + /** + * The SID of the Worker that contains the WorkerChannel. + */ + workerSid: string; + /** + * The SID of the Workspace that contains the WorkerChannel. + */ + workspaceSid: string; + /** + * The absolute URL of the WorkerChannel resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkerChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerChannelInstance + */ + fetch(callback?: (error: Error | null, item?: WorkerChannelInstance) => any): Promise; + /** + * Update a WorkerChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerChannelInstance + */ + update(callback?: (error: Error | null, item?: WorkerChannelInstance) => any): Promise; + /** + * Update a WorkerChannelInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerChannelInstance + */ + update(params: WorkerChannelContextUpdateOptions, callback?: (error: Error | null, item?: WorkerChannelInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + assignedTasks: number; + available: boolean; + availableCapacityPercentage: number; + configuredCapacity: number; + dateCreated: Date; + dateUpdated: Date; + sid: string; + taskChannelSid: string; + taskChannelUniqueName: string; + workerSid: string; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkerChannelSolution { + workspaceSid: string; + workerSid: string; +} +export interface WorkerChannelListInstance { + _version: V1; + _solution: WorkerChannelSolution; + _uri: string; + (sid: string): WorkerChannelContext; + get(sid: string): WorkerChannelContext; + /** + * Streams WorkerChannelInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkerChannelListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WorkerChannelInstance, done: (err?: Error) => void) => void): void; + each(params: WorkerChannelListInstanceEachOptions, callback?: (item: WorkerChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WorkerChannelInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WorkerChannelPage) => any): Promise; + /** + * Lists WorkerChannelInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkerChannelListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WorkerChannelInstance[]) => any): Promise; + list(params: WorkerChannelListInstanceOptions, callback?: (error: Error | null, items: WorkerChannelInstance[]) => any): Promise; + /** + * Retrieve a single page of WorkerChannelInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkerChannelListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WorkerChannelPage) => any): Promise; + page(params: WorkerChannelListInstancePageOptions, callback?: (error: Error | null, items: WorkerChannelPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkerChannelListInstance(version: V1, workspaceSid: string, workerSid: string): WorkerChannelListInstance; +export declare class WorkerChannelPage extends Page { + /** + * Initialize the WorkerChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: WorkerChannelSolution); + /** + * Build an instance of WorkerChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WorkerChannelResource): WorkerChannelInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js new file mode 100644 index 00000000..f04ea8f0 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js @@ -0,0 +1,236 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkerChannelPage = exports.WorkerChannelListInstance = exports.WorkerChannelInstance = exports.WorkerChannelContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WorkerChannelContextImpl { + constructor(_version, workspaceSid, workerSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workerSid)) { + throw new Error("Parameter 'workerSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, workerSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/Workers/${workerSid}/Channels/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WorkerChannelInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.workerSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["capacity"] !== undefined) + data["Capacity"] = params["capacity"]; + if (params["available"] !== undefined) + data["Available"] = serialize.bool(params["available"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkerChannelInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.workerSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkerChannelContextImpl = WorkerChannelContextImpl; +class WorkerChannelInstance { + constructor(_version, payload, workspaceSid, workerSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.assignedTasks = deserialize.integer(payload.assigned_tasks); + this.available = payload.available; + this.availableCapacityPercentage = deserialize.integer(payload.available_capacity_percentage); + this.configuredCapacity = deserialize.integer(payload.configured_capacity); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.sid = payload.sid; + this.taskChannelSid = payload.task_channel_sid; + this.taskChannelUniqueName = payload.task_channel_unique_name; + this.workerSid = payload.worker_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid, workerSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WorkerChannelContextImpl(this._version, this._solution.workspaceSid, this._solution.workerSid, this._solution.sid); + return this._context; + } + /** + * Fetch a WorkerChannelInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerChannelInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + assignedTasks: this.assignedTasks, + available: this.available, + availableCapacityPercentage: this.availableCapacityPercentage, + configuredCapacity: this.configuredCapacity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + sid: this.sid, + taskChannelSid: this.taskChannelSid, + taskChannelUniqueName: this.taskChannelUniqueName, + workerSid: this.workerSid, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkerChannelInstance = WorkerChannelInstance; +function WorkerChannelListInstance(version, workspaceSid, workerSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workerSid)) { + throw new Error("Parameter 'workerSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WorkerChannelContextImpl(version, workspaceSid, workerSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid, workerSid }; + instance._uri = `/Workspaces/${workspaceSid}/Workers/${workerSid}/Channels`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkerChannelPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WorkerChannelPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkerChannelListInstance = WorkerChannelListInstance; +class WorkerChannelPage extends Page_1.default { + /** + * Initialize the WorkerChannelPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WorkerChannelInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WorkerChannelInstance(this._version, payload, this._solution.workspaceSid, this._solution.workerSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkerChannelPage = WorkerChannelPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.d.ts new file mode 100644 index 00000000..a5322e15 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.d.ts @@ -0,0 +1,140 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a WorkerStatisticsInstance + */ +export interface WorkerStatisticsContextFetchOptions { + /** Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** Only calculate statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; +} +export interface WorkerStatisticsContext { + /** + * Fetch a WorkerStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkerStatisticsInstance) => any): Promise; + /** + * Fetch a WorkerStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerStatisticsInstance + */ + fetch(params: WorkerStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkerStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkerStatisticsContextSolution { + workspaceSid: string; + workerSid: string; +} +export declare class WorkerStatisticsContextImpl implements WorkerStatisticsContext { + protected _version: V1; + protected _solution: WorkerStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, workerSid: string); + fetch(params?: WorkerStatisticsContextFetchOptions | ((error: Error | null, item?: WorkerStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkerStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkerStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkerStatisticsResource { + account_sid: string; + cumulative: any; + worker_sid: string; + workspace_sid: string; + url: string; +} +export declare class WorkerStatisticsInstance { + protected _version: V1; + protected _solution: WorkerStatisticsContextSolution; + protected _context?: WorkerStatisticsContext; + constructor(_version: V1, payload: WorkerStatisticsResource, workspaceSid: string, workerSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. + */ + accountSid: string; + /** + * An object that contains the cumulative statistics for the Worker. + */ + cumulative: any; + /** + * The SID of the Worker that contains the WorkerChannel. + */ + workerSid: string; + /** + * The SID of the Workspace that contains the WorkerChannel. + */ + workspaceSid: string; + /** + * The absolute URL of the WorkerChannel statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkerStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkerStatisticsInstance) => any): Promise; + /** + * Fetch a WorkerStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkerStatisticsInstance + */ + fetch(params: WorkerStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkerStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + cumulative: any; + workerSid: string; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkerStatisticsSolution { + workspaceSid: string; + workerSid: string; +} +export interface WorkerStatisticsListInstance { + _version: V1; + _solution: WorkerStatisticsSolution; + _uri: string; + (): WorkerStatisticsContext; + get(): WorkerStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkerStatisticsListInstance(version: V1, workspaceSid: string, workerSid: string): WorkerStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.js new file mode 100644 index 00000000..b3959457 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.js @@ -0,0 +1,135 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkerStatisticsListInstance = exports.WorkerStatisticsInstance = exports.WorkerStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WorkerStatisticsContextImpl { + constructor(_version, workspaceSid, workerSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workerSid)) { + throw new Error("Parameter 'workerSid' is not valid."); + } + this._solution = { workspaceSid, workerSid }; + this._uri = `/Workspaces/${workspaceSid}/Workers/${workerSid}/Statistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkerStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.workerSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkerStatisticsContextImpl = WorkerStatisticsContextImpl; +class WorkerStatisticsInstance { + constructor(_version, payload, workspaceSid, workerSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.cumulative = payload.cumulative; + this.workerSid = payload.worker_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid, workerSid }; + } + get _proxy() { + this._context = + this._context || + new WorkerStatisticsContextImpl(this._version, this._solution.workspaceSid, this._solution.workerSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + cumulative: this.cumulative, + workerSid: this.workerSid, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkerStatisticsInstance = WorkerStatisticsInstance; +function WorkerStatisticsListInstance(version, workspaceSid, workerSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workerSid)) { + throw new Error("Parameter 'workerSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkerStatisticsContextImpl(version, workspaceSid, workerSid); + }; + instance._version = version; + instance._solution = { workspaceSid, workerSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkerStatisticsListInstance = WorkerStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.d.ts new file mode 100644 index 00000000..ceb828e1 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.d.ts @@ -0,0 +1,180 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a WorkersCumulativeStatisticsInstance + */ +export interface WorkersCumulativeStatisticsContextFetchOptions { + /** Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + endDate?: Date; + /** Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; +} +export interface WorkersCumulativeStatisticsContext { + /** + * Fetch a WorkersCumulativeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersCumulativeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkersCumulativeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkersCumulativeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersCumulativeStatisticsInstance + */ + fetch(params: WorkersCumulativeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkersCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkersCumulativeStatisticsContextSolution { + workspaceSid: string; +} +export declare class WorkersCumulativeStatisticsContextImpl implements WorkersCumulativeStatisticsContext { + protected _version: V1; + protected _solution: WorkersCumulativeStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string); + fetch(params?: WorkersCumulativeStatisticsContextFetchOptions | ((error: Error | null, item?: WorkersCumulativeStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkersCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkersCumulativeStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkersCumulativeStatisticsResource { + account_sid: string; + start_time: Date; + end_time: Date; + activity_durations: Array; + reservations_created: number; + reservations_accepted: number; + reservations_rejected: number; + reservations_timed_out: number; + reservations_canceled: number; + reservations_rescinded: number; + workspace_sid: string; + url: string; +} +export declare class WorkersCumulativeStatisticsInstance { + protected _version: V1; + protected _solution: WorkersCumulativeStatisticsContextSolution; + protected _context?: WorkersCumulativeStatisticsContext; + constructor(_version: V1, payload: WorkersCumulativeStatisticsResource, workspaceSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. + */ + accountSid: string; + /** + * The beginning of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + startTime: Date; + /** + * The end of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + endTime: Date; + /** + * The minimum, average, maximum, and total time (in seconds) that Workers spent in each Activity. + */ + activityDurations: Array; + /** + * The total number of Reservations that were created. + */ + reservationsCreated: number; + /** + * The total number of Reservations that were accepted. + */ + reservationsAccepted: number; + /** + * The total number of Reservations that were rejected. + */ + reservationsRejected: number; + /** + * The total number of Reservations that were timed out. + */ + reservationsTimedOut: number; + /** + * The total number of Reservations that were canceled. + */ + reservationsCanceled: number; + /** + * The total number of Reservations that were rescinded. + */ + reservationsRescinded: number; + /** + * The SID of the Workspace that contains the Workers. + */ + workspaceSid: string; + /** + * The absolute URL of the Workers statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkersCumulativeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersCumulativeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkersCumulativeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkersCumulativeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersCumulativeStatisticsInstance + */ + fetch(params: WorkersCumulativeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkersCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + startTime: Date; + endTime: Date; + activityDurations: any[]; + reservationsCreated: number; + reservationsAccepted: number; + reservationsRejected: number; + reservationsTimedOut: number; + reservationsCanceled: number; + reservationsRescinded: number; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkersCumulativeStatisticsSolution { + workspaceSid: string; +} +export interface WorkersCumulativeStatisticsListInstance { + _version: V1; + _solution: WorkersCumulativeStatisticsSolution; + _uri: string; + (): WorkersCumulativeStatisticsContext; + get(): WorkersCumulativeStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkersCumulativeStatisticsListInstance(version: V1, workspaceSid: string): WorkersCumulativeStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.js new file mode 100644 index 00000000..638a653d --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.js @@ -0,0 +1,143 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkersCumulativeStatisticsListInstance = exports.WorkersCumulativeStatisticsInstance = exports.WorkersCumulativeStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WorkersCumulativeStatisticsContextImpl { + constructor(_version, workspaceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + this._solution = { workspaceSid }; + this._uri = `/Workspaces/${workspaceSid}/Workers/CumulativeStatistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkersCumulativeStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkersCumulativeStatisticsContextImpl = WorkersCumulativeStatisticsContextImpl; +class WorkersCumulativeStatisticsInstance { + constructor(_version, payload, workspaceSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.activityDurations = payload.activity_durations; + this.reservationsCreated = deserialize.integer(payload.reservations_created); + this.reservationsAccepted = deserialize.integer(payload.reservations_accepted); + this.reservationsRejected = deserialize.integer(payload.reservations_rejected); + this.reservationsTimedOut = deserialize.integer(payload.reservations_timed_out); + this.reservationsCanceled = deserialize.integer(payload.reservations_canceled); + this.reservationsRescinded = deserialize.integer(payload.reservations_rescinded); + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid }; + } + get _proxy() { + this._context = + this._context || + new WorkersCumulativeStatisticsContextImpl(this._version, this._solution.workspaceSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + startTime: this.startTime, + endTime: this.endTime, + activityDurations: this.activityDurations, + reservationsCreated: this.reservationsCreated, + reservationsAccepted: this.reservationsAccepted, + reservationsRejected: this.reservationsRejected, + reservationsTimedOut: this.reservationsTimedOut, + reservationsCanceled: this.reservationsCanceled, + reservationsRescinded: this.reservationsRescinded, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkersCumulativeStatisticsInstance = WorkersCumulativeStatisticsInstance; +function WorkersCumulativeStatisticsListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkersCumulativeStatisticsContextImpl(version, workspaceSid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkersCumulativeStatisticsListInstance = WorkersCumulativeStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.d.ts new file mode 100644 index 00000000..4f133830 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.d.ts @@ -0,0 +1,132 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a WorkersRealTimeStatisticsInstance + */ +export interface WorkersRealTimeStatisticsContextFetchOptions { + /** Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; +} +export interface WorkersRealTimeStatisticsContext { + /** + * Fetch a WorkersRealTimeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersRealTimeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkersRealTimeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkersRealTimeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersRealTimeStatisticsInstance + */ + fetch(params: WorkersRealTimeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkersRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkersRealTimeStatisticsContextSolution { + workspaceSid: string; +} +export declare class WorkersRealTimeStatisticsContextImpl implements WorkersRealTimeStatisticsContext { + protected _version: V1; + protected _solution: WorkersRealTimeStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string); + fetch(params?: WorkersRealTimeStatisticsContextFetchOptions | ((error: Error | null, item?: WorkersRealTimeStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkersRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkersRealTimeStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkersRealTimeStatisticsResource { + account_sid: string; + activity_statistics: Array; + total_workers: number; + workspace_sid: string; + url: string; +} +export declare class WorkersRealTimeStatisticsInstance { + protected _version: V1; + protected _solution: WorkersRealTimeStatisticsContextSolution; + protected _context?: WorkersRealTimeStatisticsContext; + constructor(_version: V1, payload: WorkersRealTimeStatisticsResource, workspaceSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. + */ + accountSid: string; + /** + * The number of current Workers by Activity. + */ + activityStatistics: Array; + /** + * The total number of Workers. + */ + totalWorkers: number; + /** + * The SID of the Workspace that contains the Workers. + */ + workspaceSid: string; + /** + * The absolute URL of the Workers statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkersRealTimeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersRealTimeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkersRealTimeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkersRealTimeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersRealTimeStatisticsInstance + */ + fetch(params: WorkersRealTimeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkersRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + activityStatistics: any[]; + totalWorkers: number; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkersRealTimeStatisticsSolution { + workspaceSid: string; +} +export interface WorkersRealTimeStatisticsListInstance { + _version: V1; + _solution: WorkersRealTimeStatisticsSolution; + _uri: string; + (): WorkersRealTimeStatisticsContext; + get(): WorkersRealTimeStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkersRealTimeStatisticsListInstance(version: V1, workspaceSid: string): WorkersRealTimeStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.js new file mode 100644 index 00000000..25cb8824 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.js @@ -0,0 +1,123 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkersRealTimeStatisticsListInstance = exports.WorkersRealTimeStatisticsInstance = exports.WorkersRealTimeStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WorkersRealTimeStatisticsContextImpl { + constructor(_version, workspaceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + this._solution = { workspaceSid }; + this._uri = `/Workspaces/${workspaceSid}/Workers/RealTimeStatistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkersRealTimeStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkersRealTimeStatisticsContextImpl = WorkersRealTimeStatisticsContextImpl; +class WorkersRealTimeStatisticsInstance { + constructor(_version, payload, workspaceSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.activityStatistics = payload.activity_statistics; + this.totalWorkers = deserialize.integer(payload.total_workers); + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid }; + } + get _proxy() { + this._context = + this._context || + new WorkersRealTimeStatisticsContextImpl(this._version, this._solution.workspaceSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + activityStatistics: this.activityStatistics, + totalWorkers: this.totalWorkers, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkersRealTimeStatisticsInstance = WorkersRealTimeStatisticsInstance; +function WorkersRealTimeStatisticsListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkersRealTimeStatisticsContextImpl(version, workspaceSid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkersRealTimeStatisticsListInstance = WorkersRealTimeStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.d.ts new file mode 100644 index 00000000..e3af303b --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.d.ts @@ -0,0 +1,144 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a WorkersStatisticsInstance + */ +export interface WorkersStatisticsContextFetchOptions { + /** Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** The SID of the TaskQueue for which to fetch Worker statistics. */ + taskQueueSid?: string; + /** The `friendly_name` of the TaskQueue for which to fetch Worker statistics. */ + taskQueueName?: string; + /** Only include Workers with `friendly_name` values that match this parameter. */ + friendlyName?: string; + /** Only calculate statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; +} +export interface WorkersStatisticsContext { + /** + * Fetch a WorkersStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkersStatisticsInstance) => any): Promise; + /** + * Fetch a WorkersStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersStatisticsInstance + */ + fetch(params: WorkersStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkersStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkersStatisticsContextSolution { + workspaceSid: string; +} +export declare class WorkersStatisticsContextImpl implements WorkersStatisticsContext { + protected _version: V1; + protected _solution: WorkersStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string); + fetch(params?: WorkersStatisticsContextFetchOptions | ((error: Error | null, item?: WorkersStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkersStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkersStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkersStatisticsResource { + realtime: any; + cumulative: any; + account_sid: string; + workspace_sid: string; + url: string; +} +export declare class WorkersStatisticsInstance { + protected _version: V1; + protected _solution: WorkersStatisticsContextSolution; + protected _context?: WorkersStatisticsContext; + constructor(_version: V1, payload: WorkersStatisticsResource, workspaceSid: string); + /** + * An object that contains the real-time statistics for the Worker. + */ + realtime: any; + /** + * An object that contains the cumulative statistics for the Worker. + */ + cumulative: any; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. + */ + accountSid: string; + /** + * The SID of the Workspace that contains the Worker. + */ + workspaceSid: string; + /** + * The absolute URL of the Worker statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkersStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkersStatisticsInstance) => any): Promise; + /** + * Fetch a WorkersStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkersStatisticsInstance + */ + fetch(params: WorkersStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkersStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + realtime: any; + cumulative: any; + accountSid: string; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkersStatisticsSolution { + workspaceSid: string; +} +export interface WorkersStatisticsListInstance { + _version: V1; + _solution: WorkersStatisticsSolution; + _uri: string; + (): WorkersStatisticsContext; + get(): WorkersStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkersStatisticsListInstance(version: V1, workspaceSid: string): WorkersStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.js new file mode 100644 index 00000000..46dac8d0 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.js @@ -0,0 +1,135 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkersStatisticsListInstance = exports.WorkersStatisticsInstance = exports.WorkersStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WorkersStatisticsContextImpl { + constructor(_version, workspaceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + this._solution = { workspaceSid }; + this._uri = `/Workspaces/${workspaceSid}/Workers/Statistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["taskQueueSid"] !== undefined) + data["TaskQueueSid"] = params["taskQueueSid"]; + if (params["taskQueueName"] !== undefined) + data["TaskQueueName"] = params["taskQueueName"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkersStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkersStatisticsContextImpl = WorkersStatisticsContextImpl; +class WorkersStatisticsInstance { + constructor(_version, payload, workspaceSid) { + this._version = _version; + this.realtime = payload.realtime; + this.cumulative = payload.cumulative; + this.accountSid = payload.account_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid }; + } + get _proxy() { + this._context = + this._context || + new WorkersStatisticsContextImpl(this._version, this._solution.workspaceSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + realtime: this.realtime, + cumulative: this.cumulative, + accountSid: this.accountSid, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkersStatisticsInstance = WorkersStatisticsInstance; +function WorkersStatisticsListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkersStatisticsContextImpl(version, workspaceSid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkersStatisticsListInstance = WorkersStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow.d.ts new file mode 100644 index 00000000..a84068e2 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow.d.ts @@ -0,0 +1,384 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { WorkflowCumulativeStatisticsListInstance } from "./workflow/workflowCumulativeStatistics"; +import { WorkflowRealTimeStatisticsListInstance } from "./workflow/workflowRealTimeStatistics"; +import { WorkflowStatisticsListInstance } from "./workflow/workflowStatistics"; +/** + * Options to pass to update a WorkflowInstance + */ +export interface WorkflowContextUpdateOptions { + /** A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. */ + friendlyName?: string; + /** The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. */ + assignmentCallbackUrl?: string; + /** The URL that we should call when a call to the `assignment_callback_url` fails. */ + fallbackAssignmentCallbackUrl?: string; + /** A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. */ + configuration?: string; + /** How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. */ + taskReservationTimeout?: number; + /** Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. */ + reEvaluateTasks?: string; +} +/** + * Options to pass to create a WorkflowInstance + */ +export interface WorkflowListInstanceCreateOptions { + /** A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. */ + friendlyName: string; + /** A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. */ + configuration: string; + /** The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. */ + assignmentCallbackUrl?: string; + /** The URL that we should call when a call to the `assignment_callback_url` fails. */ + fallbackAssignmentCallbackUrl?: string; + /** How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. */ + taskReservationTimeout?: number; +} +/** + * Options to pass to each + */ +export interface WorkflowListInstanceEachOptions { + /** The `friendly_name` of the Workflow resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WorkflowInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WorkflowListInstanceOptions { + /** The `friendly_name` of the Workflow resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WorkflowListInstancePageOptions { + /** The `friendly_name` of the Workflow resources to read. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WorkflowContext { + cumulativeStatistics: WorkflowCumulativeStatisticsListInstance; + realTimeStatistics: WorkflowRealTimeStatisticsListInstance; + statistics: WorkflowStatisticsListInstance; + /** + * Remove a WorkflowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WorkflowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowInstance + */ + fetch(callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + /** + * Update a WorkflowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowInstance + */ + update(callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + /** + * Update a WorkflowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowInstance + */ + update(params: WorkflowContextUpdateOptions, callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkflowContextSolution { + workspaceSid: string; + sid: string; +} +export declare class WorkflowContextImpl implements WorkflowContext { + protected _version: V1; + protected _solution: WorkflowContextSolution; + protected _uri: string; + protected _cumulativeStatistics?: WorkflowCumulativeStatisticsListInstance; + protected _realTimeStatistics?: WorkflowRealTimeStatisticsListInstance; + protected _statistics?: WorkflowStatisticsListInstance; + constructor(_version: V1, workspaceSid: string, sid: string); + get cumulativeStatistics(): WorkflowCumulativeStatisticsListInstance; + get realTimeStatistics(): WorkflowRealTimeStatisticsListInstance; + get statistics(): WorkflowStatisticsListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + update(params?: WorkflowContextUpdateOptions | ((error: Error | null, item?: WorkflowInstance) => any), callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkflowContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkflowPayload extends TwilioResponsePayload { + workflows: WorkflowResource[]; +} +interface WorkflowResource { + account_sid: string; + assignment_callback_url: string; + configuration: string; + date_created: Date; + date_updated: Date; + document_content_type: string; + fallback_assignment_callback_url: string; + friendly_name: string; + sid: string; + task_reservation_timeout: number; + workspace_sid: string; + url: string; + links: Record; +} +export declare class WorkflowInstance { + protected _version: V1; + protected _solution: WorkflowContextSolution; + protected _context?: WorkflowContext; + constructor(_version: V1, payload: WorkflowResource, workspaceSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. + */ + accountSid: string; + /** + * The URL that we call when a task managed by the Workflow is assigned to a Worker. See Assignment Callback URL for more information. + */ + assignmentCallbackUrl: string; + /** + * A JSON string that contains the Workflow\'s configuration. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + */ + configuration: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The MIME type of the document. + */ + documentContentType: string; + /** + * The URL that we call when a call to the `assignment_callback_url` fails. + */ + fallbackAssignmentCallbackUrl: string; + /** + * The string that you assigned to describe the Workflow resource. For example, `Customer Support` or `2014 Election Campaign`. + */ + friendlyName: string; + /** + * The unique string that we created to identify the Workflow resource. + */ + sid: string; + /** + * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + */ + taskReservationTimeout: number; + /** + * The SID of the Workspace that contains the Workflow. + */ + workspaceSid: string; + /** + * The absolute URL of the Workflow resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a WorkflowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WorkflowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowInstance + */ + fetch(callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + /** + * Update a WorkflowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowInstance + */ + update(callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + /** + * Update a WorkflowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowInstance + */ + update(params: WorkflowContextUpdateOptions, callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + /** + * Access the cumulativeStatistics. + */ + cumulativeStatistics(): WorkflowCumulativeStatisticsListInstance; + /** + * Access the realTimeStatistics. + */ + realTimeStatistics(): WorkflowRealTimeStatisticsListInstance; + /** + * Access the statistics. + */ + statistics(): WorkflowStatisticsListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + assignmentCallbackUrl: string; + configuration: string; + dateCreated: Date; + dateUpdated: Date; + documentContentType: string; + fallbackAssignmentCallbackUrl: string; + friendlyName: string; + sid: string; + taskReservationTimeout: number; + workspaceSid: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkflowSolution { + workspaceSid: string; +} +export interface WorkflowListInstance { + _version: V1; + _solution: WorkflowSolution; + _uri: string; + (sid: string): WorkflowContext; + get(sid: string): WorkflowContext; + /** + * Create a WorkflowInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowInstance + */ + create(params: WorkflowListInstanceCreateOptions, callback?: (error: Error | null, item?: WorkflowInstance) => any): Promise; + /** + * Streams WorkflowInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkflowListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WorkflowInstance, done: (err?: Error) => void) => void): void; + each(params: WorkflowListInstanceEachOptions, callback?: (item: WorkflowInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WorkflowInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WorkflowPage) => any): Promise; + /** + * Lists WorkflowInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkflowListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WorkflowInstance[]) => any): Promise; + list(params: WorkflowListInstanceOptions, callback?: (error: Error | null, items: WorkflowInstance[]) => any): Promise; + /** + * Retrieve a single page of WorkflowInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WorkflowListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WorkflowPage) => any): Promise; + page(params: WorkflowListInstancePageOptions, callback?: (error: Error | null, items: WorkflowPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkflowListInstance(version: V1, workspaceSid: string): WorkflowListInstance; +export declare class WorkflowPage extends Page { + /** + * Initialize the WorkflowPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: WorkflowSolution); + /** + * Build an instance of WorkflowInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WorkflowResource): WorkflowInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow.js new file mode 100644 index 00000000..c36636f3 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow.js @@ -0,0 +1,334 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkflowPage = exports.WorkflowListInstance = exports.WorkflowInstance = exports.WorkflowContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const workflowCumulativeStatistics_1 = require("./workflow/workflowCumulativeStatistics"); +const workflowRealTimeStatistics_1 = require("./workflow/workflowRealTimeStatistics"); +const workflowStatistics_1 = require("./workflow/workflowStatistics"); +class WorkflowContextImpl { + constructor(_version, workspaceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { workspaceSid, sid }; + this._uri = `/Workspaces/${workspaceSid}/Workflows/${sid}`; + } + get cumulativeStatistics() { + this._cumulativeStatistics = + this._cumulativeStatistics || + (0, workflowCumulativeStatistics_1.WorkflowCumulativeStatisticsListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._cumulativeStatistics; + } + get realTimeStatistics() { + this._realTimeStatistics = + this._realTimeStatistics || + (0, workflowRealTimeStatistics_1.WorkflowRealTimeStatisticsListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._realTimeStatistics; + } + get statistics() { + this._statistics = + this._statistics || + (0, workflowStatistics_1.WorkflowStatisticsListInstance)(this._version, this._solution.workspaceSid, this._solution.sid); + return this._statistics; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WorkflowInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["assignmentCallbackUrl"] !== undefined) + data["AssignmentCallbackUrl"] = params["assignmentCallbackUrl"]; + if (params["fallbackAssignmentCallbackUrl"] !== undefined) + data["FallbackAssignmentCallbackUrl"] = + params["fallbackAssignmentCallbackUrl"]; + if (params["configuration"] !== undefined) + data["Configuration"] = params["configuration"]; + if (params["taskReservationTimeout"] !== undefined) + data["TaskReservationTimeout"] = params["taskReservationTimeout"]; + if (params["reEvaluateTasks"] !== undefined) + data["ReEvaluateTasks"] = params["reEvaluateTasks"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkflowInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowContextImpl = WorkflowContextImpl; +class WorkflowInstance { + constructor(_version, payload, workspaceSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.assignmentCallbackUrl = payload.assignment_callback_url; + this.configuration = payload.configuration; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.documentContentType = payload.document_content_type; + this.fallbackAssignmentCallbackUrl = + payload.fallback_assignment_callback_url; + this.friendlyName = payload.friendly_name; + this.sid = payload.sid; + this.taskReservationTimeout = deserialize.integer(payload.task_reservation_timeout); + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this.links = payload.links; + this._solution = { workspaceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WorkflowContextImpl(this._version, this._solution.workspaceSid, this._solution.sid); + return this._context; + } + /** + * Remove a WorkflowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a WorkflowInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the cumulativeStatistics. + */ + cumulativeStatistics() { + return this._proxy.cumulativeStatistics; + } + /** + * Access the realTimeStatistics. + */ + realTimeStatistics() { + return this._proxy.realTimeStatistics; + } + /** + * Access the statistics. + */ + statistics() { + return this._proxy.statistics; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + assignmentCallbackUrl: this.assignmentCallbackUrl, + configuration: this.configuration, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + documentContentType: this.documentContentType, + fallbackAssignmentCallbackUrl: this.fallbackAssignmentCallbackUrl, + friendlyName: this.friendlyName, + sid: this.sid, + taskReservationTimeout: this.taskReservationTimeout, + workspaceSid: this.workspaceSid, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowInstance = WorkflowInstance; +function WorkflowListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WorkflowContextImpl(version, workspaceSid, sid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = `/Workspaces/${workspaceSid}/Workflows`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["configuration"] === null || + params["configuration"] === undefined) { + throw new Error("Required parameter \"params['configuration']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Configuration"] = params["configuration"]; + if (params["assignmentCallbackUrl"] !== undefined) + data["AssignmentCallbackUrl"] = params["assignmentCallbackUrl"]; + if (params["fallbackAssignmentCallbackUrl"] !== undefined) + data["FallbackAssignmentCallbackUrl"] = + params["fallbackAssignmentCallbackUrl"]; + if (params["taskReservationTimeout"] !== undefined) + data["TaskReservationTimeout"] = params["taskReservationTimeout"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkflowInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkflowPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WorkflowPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkflowListInstance = WorkflowListInstance; +class WorkflowPage extends Page_1.default { + /** + * Initialize the WorkflowPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WorkflowInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WorkflowInstance(this._version, payload, this._solution.workspaceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowPage = WorkflowPage; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.d.ts new file mode 100644 index 00000000..6ebf003d --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.d.ts @@ -0,0 +1,244 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a WorkflowCumulativeStatisticsInstance + */ +export interface WorkflowCumulativeStatisticsContextFetchOptions { + /** Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. */ + splitByWaitTime?: string; +} +export interface WorkflowCumulativeStatisticsContext { + /** + * Fetch a WorkflowCumulativeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowCumulativeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkflowCumulativeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkflowCumulativeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowCumulativeStatisticsInstance + */ + fetch(params: WorkflowCumulativeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkflowCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkflowCumulativeStatisticsContextSolution { + workspaceSid: string; + workflowSid: string; +} +export declare class WorkflowCumulativeStatisticsContextImpl implements WorkflowCumulativeStatisticsContext { + protected _version: V1; + protected _solution: WorkflowCumulativeStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, workflowSid: string); + fetch(params?: WorkflowCumulativeStatisticsContextFetchOptions | ((error: Error | null, item?: WorkflowCumulativeStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkflowCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkflowCumulativeStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkflowCumulativeStatisticsResource { + account_sid: string; + avg_task_acceptance_time: number; + start_time: Date; + end_time: Date; + reservations_created: number; + reservations_accepted: number; + reservations_rejected: number; + reservations_timed_out: number; + reservations_canceled: number; + reservations_rescinded: number; + split_by_wait_time: any; + wait_duration_until_accepted: any; + wait_duration_until_canceled: any; + tasks_canceled: number; + tasks_completed: number; + tasks_entered: number; + tasks_deleted: number; + tasks_moved: number; + tasks_timed_out_in_workflow: number; + workflow_sid: string; + workspace_sid: string; + url: string; +} +export declare class WorkflowCumulativeStatisticsInstance { + protected _version: V1; + protected _solution: WorkflowCumulativeStatisticsContextSolution; + protected _context?: WorkflowCumulativeStatisticsContext; + constructor(_version: V1, payload: WorkflowCumulativeStatisticsResource, workspaceSid: string, workflowSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. + */ + accountSid: string; + /** + * The average time in seconds between Task creation and acceptance. + */ + avgTaskAcceptanceTime: number; + /** + * The beginning of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + startTime: Date; + /** + * The end of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + endTime: Date; + /** + * The total number of Reservations that were created for Workers. + */ + reservationsCreated: number; + /** + * The total number of Reservations accepted by Workers. + */ + reservationsAccepted: number; + /** + * The total number of Reservations that were rejected. + */ + reservationsRejected: number; + /** + * The total number of Reservations that were timed out. + */ + reservationsTimedOut: number; + /** + * The total number of Reservations that were canceled. + */ + reservationsCanceled: number; + /** + * The total number of Reservations that were rescinded. + */ + reservationsRescinded: number; + /** + * A list of objects that describe the number of Tasks canceled and reservations accepted above and below the thresholds specified in seconds. + */ + splitByWaitTime: any; + /** + * The wait duration statistics (`avg`, `min`, `max`, `total`) for Tasks that were accepted. + */ + waitDurationUntilAccepted: any; + /** + * The wait duration statistics (`avg`, `min`, `max`, `total`) for Tasks that were canceled. + */ + waitDurationUntilCanceled: any; + /** + * The total number of Tasks that were canceled. + */ + tasksCanceled: number; + /** + * The total number of Tasks that were completed. + */ + tasksCompleted: number; + /** + * The total number of Tasks that entered the Workflow. + */ + tasksEntered: number; + /** + * The total number of Tasks that were deleted. + */ + tasksDeleted: number; + /** + * The total number of Tasks that were moved from one queue to another. + */ + tasksMoved: number; + /** + * The total number of Tasks that were timed out of their Workflows (and deleted). + */ + tasksTimedOutInWorkflow: number; + /** + * Returns the list of Tasks that are being controlled by the Workflow with the specified Sid value. + */ + workflowSid: string; + /** + * The SID of the Workspace that contains the Workflow. + */ + workspaceSid: string; + /** + * The absolute URL of the Workflow statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkflowCumulativeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowCumulativeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkflowCumulativeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkflowCumulativeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowCumulativeStatisticsInstance + */ + fetch(params: WorkflowCumulativeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkflowCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + avgTaskAcceptanceTime: number; + startTime: Date; + endTime: Date; + reservationsCreated: number; + reservationsAccepted: number; + reservationsRejected: number; + reservationsTimedOut: number; + reservationsCanceled: number; + reservationsRescinded: number; + splitByWaitTime: any; + waitDurationUntilAccepted: any; + waitDurationUntilCanceled: any; + tasksCanceled: number; + tasksCompleted: number; + tasksEntered: number; + tasksDeleted: number; + tasksMoved: number; + tasksTimedOutInWorkflow: number; + workflowSid: string; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkflowCumulativeStatisticsSolution { + workspaceSid: string; + workflowSid: string; +} +export interface WorkflowCumulativeStatisticsListInstance { + _version: V1; + _solution: WorkflowCumulativeStatisticsSolution; + _uri: string; + (): WorkflowCumulativeStatisticsContext; + get(): WorkflowCumulativeStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkflowCumulativeStatisticsListInstance(version: V1, workspaceSid: string, workflowSid: string): WorkflowCumulativeStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js new file mode 100644 index 00000000..86c0870b --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js @@ -0,0 +1,171 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkflowCumulativeStatisticsListInstance = exports.WorkflowCumulativeStatisticsInstance = exports.WorkflowCumulativeStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WorkflowCumulativeStatisticsContextImpl { + constructor(_version, workspaceSid, workflowSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workflowSid)) { + throw new Error("Parameter 'workflowSid' is not valid."); + } + this._solution = { workspaceSid, workflowSid }; + this._uri = `/Workspaces/${workspaceSid}/Workflows/${workflowSid}/CumulativeStatistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["splitByWaitTime"] !== undefined) + data["SplitByWaitTime"] = params["splitByWaitTime"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkflowCumulativeStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.workflowSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowCumulativeStatisticsContextImpl = WorkflowCumulativeStatisticsContextImpl; +class WorkflowCumulativeStatisticsInstance { + constructor(_version, payload, workspaceSid, workflowSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.avgTaskAcceptanceTime = deserialize.integer(payload.avg_task_acceptance_time); + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.reservationsCreated = deserialize.integer(payload.reservations_created); + this.reservationsAccepted = deserialize.integer(payload.reservations_accepted); + this.reservationsRejected = deserialize.integer(payload.reservations_rejected); + this.reservationsTimedOut = deserialize.integer(payload.reservations_timed_out); + this.reservationsCanceled = deserialize.integer(payload.reservations_canceled); + this.reservationsRescinded = deserialize.integer(payload.reservations_rescinded); + this.splitByWaitTime = payload.split_by_wait_time; + this.waitDurationUntilAccepted = payload.wait_duration_until_accepted; + this.waitDurationUntilCanceled = payload.wait_duration_until_canceled; + this.tasksCanceled = deserialize.integer(payload.tasks_canceled); + this.tasksCompleted = deserialize.integer(payload.tasks_completed); + this.tasksEntered = deserialize.integer(payload.tasks_entered); + this.tasksDeleted = deserialize.integer(payload.tasks_deleted); + this.tasksMoved = deserialize.integer(payload.tasks_moved); + this.tasksTimedOutInWorkflow = deserialize.integer(payload.tasks_timed_out_in_workflow); + this.workflowSid = payload.workflow_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid, workflowSid }; + } + get _proxy() { + this._context = + this._context || + new WorkflowCumulativeStatisticsContextImpl(this._version, this._solution.workspaceSid, this._solution.workflowSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + avgTaskAcceptanceTime: this.avgTaskAcceptanceTime, + startTime: this.startTime, + endTime: this.endTime, + reservationsCreated: this.reservationsCreated, + reservationsAccepted: this.reservationsAccepted, + reservationsRejected: this.reservationsRejected, + reservationsTimedOut: this.reservationsTimedOut, + reservationsCanceled: this.reservationsCanceled, + reservationsRescinded: this.reservationsRescinded, + splitByWaitTime: this.splitByWaitTime, + waitDurationUntilAccepted: this.waitDurationUntilAccepted, + waitDurationUntilCanceled: this.waitDurationUntilCanceled, + tasksCanceled: this.tasksCanceled, + tasksCompleted: this.tasksCompleted, + tasksEntered: this.tasksEntered, + tasksDeleted: this.tasksDeleted, + tasksMoved: this.tasksMoved, + tasksTimedOutInWorkflow: this.tasksTimedOutInWorkflow, + workflowSid: this.workflowSid, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowCumulativeStatisticsInstance = WorkflowCumulativeStatisticsInstance; +function WorkflowCumulativeStatisticsListInstance(version, workspaceSid, workflowSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workflowSid)) { + throw new Error("Parameter 'workflowSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkflowCumulativeStatisticsContextImpl(version, workspaceSid, workflowSid); + }; + instance._version = version; + instance._solution = { workspaceSid, workflowSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkflowCumulativeStatisticsListInstance = WorkflowCumulativeStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.d.ts new file mode 100644 index 00000000..2872507e --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.d.ts @@ -0,0 +1,158 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a WorkflowRealTimeStatisticsInstance + */ +export interface WorkflowRealTimeStatisticsContextFetchOptions { + /** Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; +} +export interface WorkflowRealTimeStatisticsContext { + /** + * Fetch a WorkflowRealTimeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowRealTimeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkflowRealTimeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkflowRealTimeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowRealTimeStatisticsInstance + */ + fetch(params: WorkflowRealTimeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkflowRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkflowRealTimeStatisticsContextSolution { + workspaceSid: string; + workflowSid: string; +} +export declare class WorkflowRealTimeStatisticsContextImpl implements WorkflowRealTimeStatisticsContext { + protected _version: V1; + protected _solution: WorkflowRealTimeStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, workflowSid: string); + fetch(params?: WorkflowRealTimeStatisticsContextFetchOptions | ((error: Error | null, item?: WorkflowRealTimeStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkflowRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkflowRealTimeStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkflowRealTimeStatisticsResource { + account_sid: string; + longest_task_waiting_age: number; + longest_task_waiting_sid: string; + tasks_by_priority: any; + tasks_by_status: any; + total_tasks: number; + workflow_sid: string; + workspace_sid: string; + url: string; +} +export declare class WorkflowRealTimeStatisticsInstance { + protected _version: V1; + protected _solution: WorkflowRealTimeStatisticsContextSolution; + protected _context?: WorkflowRealTimeStatisticsContext; + constructor(_version: V1, payload: WorkflowRealTimeStatisticsResource, workspaceSid: string, workflowSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. + */ + accountSid: string; + /** + * The age of the longest waiting Task. + */ + longestTaskWaitingAge: number; + /** + * The SID of the longest waiting Task. + */ + longestTaskWaitingSid: string; + /** + * The number of Tasks by priority. For example: `{\"0\": \"10\", \"99\": \"5\"}` shows 10 Tasks at priority 0 and 5 at priority 99. + */ + tasksByPriority: any; + /** + * The number of Tasks by their current status. For example: `{\"pending\": \"1\", \"reserved\": \"3\", \"assigned\": \"2\", \"completed\": \"5\"}`. + */ + tasksByStatus: any; + /** + * The total number of Tasks. + */ + totalTasks: number; + /** + * Returns the list of Tasks that are being controlled by the Workflow with the specified SID value. + */ + workflowSid: string; + /** + * The SID of the Workspace that contains the Workflow. + */ + workspaceSid: string; + /** + * The absolute URL of the Workflow statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkflowRealTimeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowRealTimeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkflowRealTimeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkflowRealTimeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowRealTimeStatisticsInstance + */ + fetch(params: WorkflowRealTimeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkflowRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + longestTaskWaitingAge: number; + longestTaskWaitingSid: string; + tasksByPriority: any; + tasksByStatus: any; + totalTasks: number; + workflowSid: string; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkflowRealTimeStatisticsSolution { + workspaceSid: string; + workflowSid: string; +} +export interface WorkflowRealTimeStatisticsListInstance { + _version: V1; + _solution: WorkflowRealTimeStatisticsSolution; + _uri: string; + (): WorkflowRealTimeStatisticsContext; + get(): WorkflowRealTimeStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkflowRealTimeStatisticsListInstance(version: V1, workspaceSid: string, workflowSid: string): WorkflowRealTimeStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.js new file mode 100644 index 00000000..78e4f605 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.js @@ -0,0 +1,137 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkflowRealTimeStatisticsListInstance = exports.WorkflowRealTimeStatisticsInstance = exports.WorkflowRealTimeStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WorkflowRealTimeStatisticsContextImpl { + constructor(_version, workspaceSid, workflowSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workflowSid)) { + throw new Error("Parameter 'workflowSid' is not valid."); + } + this._solution = { workspaceSid, workflowSid }; + this._uri = `/Workspaces/${workspaceSid}/Workflows/${workflowSid}/RealTimeStatistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkflowRealTimeStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.workflowSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowRealTimeStatisticsContextImpl = WorkflowRealTimeStatisticsContextImpl; +class WorkflowRealTimeStatisticsInstance { + constructor(_version, payload, workspaceSid, workflowSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.longestTaskWaitingAge = deserialize.integer(payload.longest_task_waiting_age); + this.longestTaskWaitingSid = payload.longest_task_waiting_sid; + this.tasksByPriority = payload.tasks_by_priority; + this.tasksByStatus = payload.tasks_by_status; + this.totalTasks = deserialize.integer(payload.total_tasks); + this.workflowSid = payload.workflow_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid, workflowSid }; + } + get _proxy() { + this._context = + this._context || + new WorkflowRealTimeStatisticsContextImpl(this._version, this._solution.workspaceSid, this._solution.workflowSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + longestTaskWaitingAge: this.longestTaskWaitingAge, + longestTaskWaitingSid: this.longestTaskWaitingSid, + tasksByPriority: this.tasksByPriority, + tasksByStatus: this.tasksByStatus, + totalTasks: this.totalTasks, + workflowSid: this.workflowSid, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowRealTimeStatisticsInstance = WorkflowRealTimeStatisticsInstance; +function WorkflowRealTimeStatisticsListInstance(version, workspaceSid, workflowSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workflowSid)) { + throw new Error("Parameter 'workflowSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkflowRealTimeStatisticsContextImpl(version, workspaceSid, workflowSid); + }; + instance._version = version; + instance._solution = { workspaceSid, workflowSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkflowRealTimeStatisticsListInstance = WorkflowRealTimeStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.d.ts new file mode 100644 index 00000000..7dd2c4f2 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.d.ts @@ -0,0 +1,148 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +/** + * Options to pass to fetch a WorkflowStatisticsInstance + */ +export interface WorkflowStatisticsContextFetchOptions { + /** Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. */ + splitByWaitTime?: string; +} +export interface WorkflowStatisticsContext { + /** + * Fetch a WorkflowStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkflowStatisticsInstance) => any): Promise; + /** + * Fetch a WorkflowStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowStatisticsInstance + */ + fetch(params: WorkflowStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkflowStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkflowStatisticsContextSolution { + workspaceSid: string; + workflowSid: string; +} +export declare class WorkflowStatisticsContextImpl implements WorkflowStatisticsContext { + protected _version: V1; + protected _solution: WorkflowStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string, workflowSid: string); + fetch(params?: WorkflowStatisticsContextFetchOptions | ((error: Error | null, item?: WorkflowStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkflowStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkflowStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkflowStatisticsResource { + account_sid: string; + cumulative: any; + realtime: any; + workflow_sid: string; + workspace_sid: string; + url: string; +} +export declare class WorkflowStatisticsInstance { + protected _version: V1; + protected _solution: WorkflowStatisticsContextSolution; + protected _context?: WorkflowStatisticsContext; + constructor(_version: V1, payload: WorkflowStatisticsResource, workspaceSid: string, workflowSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. + */ + accountSid: string; + /** + * An object that contains the cumulative statistics for the Workflow. + */ + cumulative: any; + /** + * An object that contains the real-time statistics for the Workflow. + */ + realtime: any; + /** + * Returns the list of Tasks that are being controlled by the Workflow with the specified SID value. + */ + workflowSid: string; + /** + * The SID of the Workspace that contains the Workflow. + */ + workspaceSid: string; + /** + * The absolute URL of the Workflow statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkflowStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkflowStatisticsInstance) => any): Promise; + /** + * Fetch a WorkflowStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkflowStatisticsInstance + */ + fetch(params: WorkflowStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkflowStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + cumulative: any; + realtime: any; + workflowSid: string; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkflowStatisticsSolution { + workspaceSid: string; + workflowSid: string; +} +export interface WorkflowStatisticsListInstance { + _version: V1; + _solution: WorkflowStatisticsSolution; + _uri: string; + (): WorkflowStatisticsContext; + get(): WorkflowStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkflowStatisticsListInstance(version: V1, workspaceSid: string, workflowSid: string): WorkflowStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.js new file mode 100644 index 00000000..fe96b96e --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.js @@ -0,0 +1,139 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkflowStatisticsListInstance = exports.WorkflowStatisticsInstance = exports.WorkflowStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class WorkflowStatisticsContextImpl { + constructor(_version, workspaceSid, workflowSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workflowSid)) { + throw new Error("Parameter 'workflowSid' is not valid."); + } + this._solution = { workspaceSid, workflowSid }; + this._uri = `/Workspaces/${workspaceSid}/Workflows/${workflowSid}/Statistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["splitByWaitTime"] !== undefined) + data["SplitByWaitTime"] = params["splitByWaitTime"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkflowStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid, instance._solution.workflowSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowStatisticsContextImpl = WorkflowStatisticsContextImpl; +class WorkflowStatisticsInstance { + constructor(_version, payload, workspaceSid, workflowSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.cumulative = payload.cumulative; + this.realtime = payload.realtime; + this.workflowSid = payload.workflow_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid, workflowSid }; + } + get _proxy() { + this._context = + this._context || + new WorkflowStatisticsContextImpl(this._version, this._solution.workspaceSid, this._solution.workflowSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + cumulative: this.cumulative, + realtime: this.realtime, + workflowSid: this.workflowSid, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkflowStatisticsInstance = WorkflowStatisticsInstance; +function WorkflowStatisticsListInstance(version, workspaceSid, workflowSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(workflowSid)) { + throw new Error("Parameter 'workflowSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkflowStatisticsContextImpl(version, workspaceSid, workflowSid); + }; + instance._version = version; + instance._solution = { workspaceSid, workflowSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkflowStatisticsListInstance = WorkflowStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.d.ts new file mode 100644 index 00000000..eb95a47c --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.d.ts @@ -0,0 +1,236 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * Options to pass to fetch a WorkspaceCumulativeStatisticsInstance + */ +export interface WorkspaceCumulativeStatisticsContextFetchOptions { + /** Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. */ + splitByWaitTime?: string; +} +export interface WorkspaceCumulativeStatisticsContext { + /** + * Fetch a WorkspaceCumulativeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceCumulativeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkspaceCumulativeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkspaceCumulativeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceCumulativeStatisticsInstance + */ + fetch(params: WorkspaceCumulativeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkspaceCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkspaceCumulativeStatisticsContextSolution { + workspaceSid: string; +} +export declare class WorkspaceCumulativeStatisticsContextImpl implements WorkspaceCumulativeStatisticsContext { + protected _version: V1; + protected _solution: WorkspaceCumulativeStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string); + fetch(params?: WorkspaceCumulativeStatisticsContextFetchOptions | ((error: Error | null, item?: WorkspaceCumulativeStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkspaceCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkspaceCumulativeStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkspaceCumulativeStatisticsResource { + account_sid: string; + avg_task_acceptance_time: number; + start_time: Date; + end_time: Date; + reservations_created: number; + reservations_accepted: number; + reservations_rejected: number; + reservations_timed_out: number; + reservations_canceled: number; + reservations_rescinded: number; + split_by_wait_time: any; + wait_duration_until_accepted: any; + wait_duration_until_canceled: any; + tasks_canceled: number; + tasks_completed: number; + tasks_created: number; + tasks_deleted: number; + tasks_moved: number; + tasks_timed_out_in_workflow: number; + workspace_sid: string; + url: string; +} +export declare class WorkspaceCumulativeStatisticsInstance { + protected _version: V1; + protected _solution: WorkspaceCumulativeStatisticsContextSolution; + protected _context?: WorkspaceCumulativeStatisticsContext; + constructor(_version: V1, payload: WorkspaceCumulativeStatisticsResource, workspaceSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workspace resource. + */ + accountSid: string; + /** + * The average time in seconds between Task creation and acceptance. + */ + avgTaskAcceptanceTime: number; + /** + * The beginning of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + startTime: Date; + /** + * The end of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + endTime: Date; + /** + * The total number of Reservations that were created for Workers. + */ + reservationsCreated: number; + /** + * The total number of Reservations accepted by Workers. + */ + reservationsAccepted: number; + /** + * The total number of Reservations that were rejected. + */ + reservationsRejected: number; + /** + * The total number of Reservations that were timed out. + */ + reservationsTimedOut: number; + /** + * The total number of Reservations that were canceled. + */ + reservationsCanceled: number; + /** + * The total number of Reservations that were rescinded. + */ + reservationsRescinded: number; + /** + * A list of objects that describe the number of Tasks canceled and reservations accepted above and below the thresholds specified in seconds. + */ + splitByWaitTime: any; + /** + * The wait duration statistics (`avg`, `min`, `max`, `total`) for Tasks that were accepted. + */ + waitDurationUntilAccepted: any; + /** + * The wait duration statistics (`avg`, `min`, `max`, `total`) for Tasks that were canceled. + */ + waitDurationUntilCanceled: any; + /** + * The total number of Tasks that were canceled. + */ + tasksCanceled: number; + /** + * The total number of Tasks that were completed. + */ + tasksCompleted: number; + /** + * The total number of Tasks created. + */ + tasksCreated: number; + /** + * The total number of Tasks that were deleted. + */ + tasksDeleted: number; + /** + * The total number of Tasks that were moved from one queue to another. + */ + tasksMoved: number; + /** + * The total number of Tasks that were timed out of their Workflows (and deleted). + */ + tasksTimedOutInWorkflow: number; + /** + * The SID of the Workspace. + */ + workspaceSid: string; + /** + * The absolute URL of the Workspace statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkspaceCumulativeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceCumulativeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkspaceCumulativeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkspaceCumulativeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceCumulativeStatisticsInstance + */ + fetch(params: WorkspaceCumulativeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkspaceCumulativeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + avgTaskAcceptanceTime: number; + startTime: Date; + endTime: Date; + reservationsCreated: number; + reservationsAccepted: number; + reservationsRejected: number; + reservationsTimedOut: number; + reservationsCanceled: number; + reservationsRescinded: number; + splitByWaitTime: any; + waitDurationUntilAccepted: any; + waitDurationUntilCanceled: any; + tasksCanceled: number; + tasksCompleted: number; + tasksCreated: number; + tasksDeleted: number; + tasksMoved: number; + tasksTimedOutInWorkflow: number; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkspaceCumulativeStatisticsSolution { + workspaceSid: string; +} +export interface WorkspaceCumulativeStatisticsListInstance { + _version: V1; + _solution: WorkspaceCumulativeStatisticsSolution; + _uri: string; + (): WorkspaceCumulativeStatisticsContext; + get(): WorkspaceCumulativeStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkspaceCumulativeStatisticsListInstance(version: V1, workspaceSid: string): WorkspaceCumulativeStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js new file mode 100644 index 00000000..19c0b2f3 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js @@ -0,0 +1,163 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkspaceCumulativeStatisticsListInstance = exports.WorkspaceCumulativeStatisticsInstance = exports.WorkspaceCumulativeStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class WorkspaceCumulativeStatisticsContextImpl { + constructor(_version, workspaceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + this._solution = { workspaceSid }; + this._uri = `/Workspaces/${workspaceSid}/CumulativeStatistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["splitByWaitTime"] !== undefined) + data["SplitByWaitTime"] = params["splitByWaitTime"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkspaceCumulativeStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspaceCumulativeStatisticsContextImpl = WorkspaceCumulativeStatisticsContextImpl; +class WorkspaceCumulativeStatisticsInstance { + constructor(_version, payload, workspaceSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.avgTaskAcceptanceTime = deserialize.integer(payload.avg_task_acceptance_time); + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.reservationsCreated = deserialize.integer(payload.reservations_created); + this.reservationsAccepted = deserialize.integer(payload.reservations_accepted); + this.reservationsRejected = deserialize.integer(payload.reservations_rejected); + this.reservationsTimedOut = deserialize.integer(payload.reservations_timed_out); + this.reservationsCanceled = deserialize.integer(payload.reservations_canceled); + this.reservationsRescinded = deserialize.integer(payload.reservations_rescinded); + this.splitByWaitTime = payload.split_by_wait_time; + this.waitDurationUntilAccepted = payload.wait_duration_until_accepted; + this.waitDurationUntilCanceled = payload.wait_duration_until_canceled; + this.tasksCanceled = deserialize.integer(payload.tasks_canceled); + this.tasksCompleted = deserialize.integer(payload.tasks_completed); + this.tasksCreated = deserialize.integer(payload.tasks_created); + this.tasksDeleted = deserialize.integer(payload.tasks_deleted); + this.tasksMoved = deserialize.integer(payload.tasks_moved); + this.tasksTimedOutInWorkflow = deserialize.integer(payload.tasks_timed_out_in_workflow); + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid }; + } + get _proxy() { + this._context = + this._context || + new WorkspaceCumulativeStatisticsContextImpl(this._version, this._solution.workspaceSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + avgTaskAcceptanceTime: this.avgTaskAcceptanceTime, + startTime: this.startTime, + endTime: this.endTime, + reservationsCreated: this.reservationsCreated, + reservationsAccepted: this.reservationsAccepted, + reservationsRejected: this.reservationsRejected, + reservationsTimedOut: this.reservationsTimedOut, + reservationsCanceled: this.reservationsCanceled, + reservationsRescinded: this.reservationsRescinded, + splitByWaitTime: this.splitByWaitTime, + waitDurationUntilAccepted: this.waitDurationUntilAccepted, + waitDurationUntilCanceled: this.waitDurationUntilCanceled, + tasksCanceled: this.tasksCanceled, + tasksCompleted: this.tasksCompleted, + tasksCreated: this.tasksCreated, + tasksDeleted: this.tasksDeleted, + tasksMoved: this.tasksMoved, + tasksTimedOutInWorkflow: this.tasksTimedOutInWorkflow, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspaceCumulativeStatisticsInstance = WorkspaceCumulativeStatisticsInstance; +function WorkspaceCumulativeStatisticsListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkspaceCumulativeStatisticsContextImpl(version, workspaceSid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkspaceCumulativeStatisticsListInstance = WorkspaceCumulativeStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.d.ts new file mode 100644 index 00000000..fff4dc3e --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.d.ts @@ -0,0 +1,162 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * Options to pass to fetch a WorkspaceRealTimeStatisticsInstance + */ +export interface WorkspaceRealTimeStatisticsContextFetchOptions { + /** Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; +} +export interface WorkspaceRealTimeStatisticsContext { + /** + * Fetch a WorkspaceRealTimeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceRealTimeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkspaceRealTimeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkspaceRealTimeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceRealTimeStatisticsInstance + */ + fetch(params: WorkspaceRealTimeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkspaceRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkspaceRealTimeStatisticsContextSolution { + workspaceSid: string; +} +export declare class WorkspaceRealTimeStatisticsContextImpl implements WorkspaceRealTimeStatisticsContext { + protected _version: V1; + protected _solution: WorkspaceRealTimeStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string); + fetch(params?: WorkspaceRealTimeStatisticsContextFetchOptions | ((error: Error | null, item?: WorkspaceRealTimeStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkspaceRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkspaceRealTimeStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkspaceRealTimeStatisticsResource { + account_sid: string; + activity_statistics: Array; + longest_task_waiting_age: number; + longest_task_waiting_sid: string; + tasks_by_priority: any; + tasks_by_status: any; + total_tasks: number; + total_workers: number; + workspace_sid: string; + url: string; +} +export declare class WorkspaceRealTimeStatisticsInstance { + protected _version: V1; + protected _solution: WorkspaceRealTimeStatisticsContextSolution; + protected _context?: WorkspaceRealTimeStatisticsContext; + constructor(_version: V1, payload: WorkspaceRealTimeStatisticsResource, workspaceSid: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workspace resource. + */ + accountSid: string; + /** + * The number of current Workers by Activity. + */ + activityStatistics: Array; + /** + * The age of the longest waiting Task. + */ + longestTaskWaitingAge: number; + /** + * The SID of the longest waiting Task. + */ + longestTaskWaitingSid: string; + /** + * The number of Tasks by priority. For example: `{\"0\": \"10\", \"99\": \"5\"}` shows 10 Tasks at priority 0 and 5 at priority 99. + */ + tasksByPriority: any; + /** + * The number of Tasks by their current status. For example: `{\"pending\": \"1\", \"reserved\": \"3\", \"assigned\": \"2\", \"completed\": \"5\"}`. + */ + tasksByStatus: any; + /** + * The total number of Tasks. + */ + totalTasks: number; + /** + * The total number of Workers in the Workspace. + */ + totalWorkers: number; + /** + * The SID of the Workspace. + */ + workspaceSid: string; + /** + * The absolute URL of the Workspace statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkspaceRealTimeStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceRealTimeStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkspaceRealTimeStatisticsInstance) => any): Promise; + /** + * Fetch a WorkspaceRealTimeStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceRealTimeStatisticsInstance + */ + fetch(params: WorkspaceRealTimeStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkspaceRealTimeStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + activityStatistics: any[]; + longestTaskWaitingAge: number; + longestTaskWaitingSid: string; + tasksByPriority: any; + tasksByStatus: any; + totalTasks: number; + totalWorkers: number; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkspaceRealTimeStatisticsSolution { + workspaceSid: string; +} +export interface WorkspaceRealTimeStatisticsListInstance { + _version: V1; + _solution: WorkspaceRealTimeStatisticsSolution; + _uri: string; + (): WorkspaceRealTimeStatisticsContext; + get(): WorkspaceRealTimeStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkspaceRealTimeStatisticsListInstance(version: V1, workspaceSid: string): WorkspaceRealTimeStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.js new file mode 100644 index 00000000..dadfe84e --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.js @@ -0,0 +1,133 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkspaceRealTimeStatisticsListInstance = exports.WorkspaceRealTimeStatisticsInstance = exports.WorkspaceRealTimeStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class WorkspaceRealTimeStatisticsContextImpl { + constructor(_version, workspaceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + this._solution = { workspaceSid }; + this._uri = `/Workspaces/${workspaceSid}/RealTimeStatistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkspaceRealTimeStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspaceRealTimeStatisticsContextImpl = WorkspaceRealTimeStatisticsContextImpl; +class WorkspaceRealTimeStatisticsInstance { + constructor(_version, payload, workspaceSid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.activityStatistics = payload.activity_statistics; + this.longestTaskWaitingAge = deserialize.integer(payload.longest_task_waiting_age); + this.longestTaskWaitingSid = payload.longest_task_waiting_sid; + this.tasksByPriority = payload.tasks_by_priority; + this.tasksByStatus = payload.tasks_by_status; + this.totalTasks = deserialize.integer(payload.total_tasks); + this.totalWorkers = deserialize.integer(payload.total_workers); + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid }; + } + get _proxy() { + this._context = + this._context || + new WorkspaceRealTimeStatisticsContextImpl(this._version, this._solution.workspaceSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + activityStatistics: this.activityStatistics, + longestTaskWaitingAge: this.longestTaskWaitingAge, + longestTaskWaitingSid: this.longestTaskWaitingSid, + tasksByPriority: this.tasksByPriority, + tasksByStatus: this.tasksByStatus, + totalTasks: this.totalTasks, + totalWorkers: this.totalWorkers, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspaceRealTimeStatisticsInstance = WorkspaceRealTimeStatisticsInstance; +function WorkspaceRealTimeStatisticsListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkspaceRealTimeStatisticsContextImpl(version, workspaceSid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkspaceRealTimeStatisticsListInstance = WorkspaceRealTimeStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceStatistics.d.ts b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceStatistics.d.ts new file mode 100644 index 00000000..55be4536 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceStatistics.d.ts @@ -0,0 +1,140 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * Options to pass to fetch a WorkspaceStatisticsInstance + */ +export interface WorkspaceStatisticsContextFetchOptions { + /** Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. */ + minutes?: number; + /** Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ + startDate?: Date; + /** Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. */ + endDate?: Date; + /** Only calculate statistics on this TaskChannel. Can be the TaskChannel\'s SID or its `unique_name`, such as `voice`, `sms`, or `default`. */ + taskChannel?: string; + /** A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. */ + splitByWaitTime?: string; +} +export interface WorkspaceStatisticsContext { + /** + * Fetch a WorkspaceStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkspaceStatisticsInstance) => any): Promise; + /** + * Fetch a WorkspaceStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceStatisticsInstance + */ + fetch(params: WorkspaceStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkspaceStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WorkspaceStatisticsContextSolution { + workspaceSid: string; +} +export declare class WorkspaceStatisticsContextImpl implements WorkspaceStatisticsContext { + protected _version: V1; + protected _solution: WorkspaceStatisticsContextSolution; + protected _uri: string; + constructor(_version: V1, workspaceSid: string); + fetch(params?: WorkspaceStatisticsContextFetchOptions | ((error: Error | null, item?: WorkspaceStatisticsInstance) => any), callback?: (error: Error | null, item?: WorkspaceStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WorkspaceStatisticsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WorkspaceStatisticsResource { + realtime: any; + cumulative: any; + account_sid: string; + workspace_sid: string; + url: string; +} +export declare class WorkspaceStatisticsInstance { + protected _version: V1; + protected _solution: WorkspaceStatisticsContextSolution; + protected _context?: WorkspaceStatisticsContext; + constructor(_version: V1, payload: WorkspaceStatisticsResource, workspaceSid: string); + /** + * An object that contains the real-time statistics for the Workspace. + */ + realtime: any; + /** + * An object that contains the cumulative statistics for the Workspace. + */ + cumulative: any; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workspace resource. + */ + accountSid: string; + /** + * The SID of the Workspace. + */ + workspaceSid: string; + /** + * The absolute URL of the Workspace statistics resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a WorkspaceStatisticsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceStatisticsInstance + */ + fetch(callback?: (error: Error | null, item?: WorkspaceStatisticsInstance) => any): Promise; + /** + * Fetch a WorkspaceStatisticsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WorkspaceStatisticsInstance + */ + fetch(params: WorkspaceStatisticsContextFetchOptions, callback?: (error: Error | null, item?: WorkspaceStatisticsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + realtime: any; + cumulative: any; + accountSid: string; + workspaceSid: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WorkspaceStatisticsSolution { + workspaceSid: string; +} +export interface WorkspaceStatisticsListInstance { + _version: V1; + _solution: WorkspaceStatisticsSolution; + _uri: string; + (): WorkspaceStatisticsContext; + get(): WorkspaceStatisticsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WorkspaceStatisticsListInstance(version: V1, workspaceSid: string): WorkspaceStatisticsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceStatistics.js b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceStatistics.js new file mode 100644 index 00000000..a17e3c68 --- /dev/null +++ b/node_modules/twilio/lib/rest/taskrouter/v1/workspace/workspaceStatistics.js @@ -0,0 +1,131 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Taskrouter + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WorkspaceStatisticsListInstance = exports.WorkspaceStatisticsInstance = exports.WorkspaceStatisticsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class WorkspaceStatisticsContextImpl { + constructor(_version, workspaceSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + this._solution = { workspaceSid }; + this._uri = `/Workspaces/${workspaceSid}/Statistics`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["minutes"] !== undefined) + data["Minutes"] = params["minutes"]; + if (params["startDate"] !== undefined) + data["StartDate"] = serialize.iso8601DateTime(params["startDate"]); + if (params["endDate"] !== undefined) + data["EndDate"] = serialize.iso8601DateTime(params["endDate"]); + if (params["taskChannel"] !== undefined) + data["TaskChannel"] = params["taskChannel"]; + if (params["splitByWaitTime"] !== undefined) + data["SplitByWaitTime"] = params["splitByWaitTime"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WorkspaceStatisticsInstance(operationVersion, payload, instance._solution.workspaceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspaceStatisticsContextImpl = WorkspaceStatisticsContextImpl; +class WorkspaceStatisticsInstance { + constructor(_version, payload, workspaceSid) { + this._version = _version; + this.realtime = payload.realtime; + this.cumulative = payload.cumulative; + this.accountSid = payload.account_sid; + this.workspaceSid = payload.workspace_sid; + this.url = payload.url; + this._solution = { workspaceSid }; + } + get _proxy() { + this._context = + this._context || + new WorkspaceStatisticsContextImpl(this._version, this._solution.workspaceSid); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + realtime: this.realtime, + cumulative: this.cumulative, + accountSid: this.accountSid, + workspaceSid: this.workspaceSid, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WorkspaceStatisticsInstance = WorkspaceStatisticsInstance; +function WorkspaceStatisticsListInstance(version, workspaceSid) { + if (!(0, utility_1.isValidPathParam)(workspaceSid)) { + throw new Error("Parameter 'workspaceSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new WorkspaceStatisticsContextImpl(version, workspaceSid); + }; + instance._version = version; + instance._solution = { workspaceSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WorkspaceStatisticsListInstance = WorkspaceStatisticsListInstance; diff --git a/node_modules/twilio/lib/rest/trunking/V1.d.ts b/node_modules/twilio/lib/rest/trunking/V1.d.ts new file mode 100644 index 00000000..f24f59ea --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/V1.d.ts @@ -0,0 +1,15 @@ +import TrunkingBase from "../TrunkingBase"; +import Version from "../../base/Version"; +import { TrunkListInstance } from "./v1/trunk"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Trunking + * + * @param domain - The Twilio (Twilio.Trunking) domain + */ + constructor(domain: TrunkingBase); + /** trunks - { Twilio.Trunking.V1.TrunkListInstance } resource */ + protected _trunks?: TrunkListInstance; + /** Getter for trunks resource */ + get trunks(): TrunkListInstance; +} diff --git a/node_modules/twilio/lib/rest/trunking/V1.js b/node_modules/twilio/lib/rest/trunking/V1.js new file mode 100644 index 00000000..eb7019f7 --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/V1.js @@ -0,0 +1,36 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trunking + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const trunk_1 = require("./v1/trunk"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Trunking + * + * @param domain - The Twilio (Twilio.Trunking) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for trunks resource */ + get trunks() { + this._trunks = this._trunks || (0, trunk_1.TrunkListInstance)(this); + return this._trunks; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk.d.ts b/node_modules/twilio/lib/rest/trunking/v1/trunk.d.ts new file mode 100644 index 00000000..126fb971 --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk.d.ts @@ -0,0 +1,430 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { CredentialListListInstance } from "./trunk/credentialList"; +import { IpAccessControlListListInstance } from "./trunk/ipAccessControlList"; +import { OriginationUrlListInstance } from "./trunk/originationUrl"; +import { PhoneNumberListInstance } from "./trunk/phoneNumber"; +import { RecordingListInstance } from "./trunk/recording"; +export type TrunkTransferCallerId = "from-transferee" | "from-transferor"; +export type TrunkTransferSetting = "disable-all" | "enable-all" | "sip-only"; +/** + * Options to pass to update a TrunkInstance + */ +export interface TrunkContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. */ + domainName?: string; + /** The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. */ + disasterRecoveryUrl?: string; + /** The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. */ + disasterRecoveryMethod?: string; + /** */ + transferMode?: TrunkTransferSetting; + /** Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. */ + secure?: boolean; + /** Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. */ + cnamLookupEnabled?: boolean; + /** */ + transferCallerId?: TrunkTransferCallerId; +} +/** + * Options to pass to create a TrunkInstance + */ +export interface TrunkListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. */ + domainName?: string; + /** The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. */ + disasterRecoveryUrl?: string; + /** The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. */ + disasterRecoveryMethod?: string; + /** */ + transferMode?: TrunkTransferSetting; + /** Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. */ + secure?: boolean; + /** Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. */ + cnamLookupEnabled?: boolean; + /** */ + transferCallerId?: TrunkTransferCallerId; +} +/** + * Options to pass to each + */ +export interface TrunkListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TrunkInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TrunkListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TrunkListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TrunkContext { + credentialsLists: CredentialListListInstance; + ipAccessControlLists: IpAccessControlListListInstance; + originationUrls: OriginationUrlListInstance; + phoneNumbers: PhoneNumberListInstance; + recordings: RecordingListInstance; + /** + * Remove a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + fetch(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Update a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + update(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Update a TrunkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + update(params: TrunkContextUpdateOptions, callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TrunkContextSolution { + sid: string; +} +export declare class TrunkContextImpl implements TrunkContext { + protected _version: V1; + protected _solution: TrunkContextSolution; + protected _uri: string; + protected _credentialsLists?: CredentialListListInstance; + protected _ipAccessControlLists?: IpAccessControlListListInstance; + protected _originationUrls?: OriginationUrlListInstance; + protected _phoneNumbers?: PhoneNumberListInstance; + protected _recordings?: RecordingListInstance; + constructor(_version: V1, sid: string); + get credentialsLists(): CredentialListListInstance; + get ipAccessControlLists(): IpAccessControlListListInstance; + get originationUrls(): OriginationUrlListInstance; + get phoneNumbers(): PhoneNumberListInstance; + get recordings(): RecordingListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + update(params?: TrunkContextUpdateOptions | ((error: Error | null, item?: TrunkInstance) => any), callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TrunkContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TrunkPayload extends TwilioResponsePayload { + trunks: TrunkResource[]; +} +interface TrunkResource { + account_sid: string; + domain_name: string; + disaster_recovery_method: string; + disaster_recovery_url: string; + friendly_name: string; + secure: boolean; + recording: any; + transfer_mode: TrunkTransferSetting; + transfer_caller_id: TrunkTransferCallerId; + cnam_lookup_enabled: boolean; + auth_type: string; + auth_type_set: Array; + date_created: Date; + date_updated: Date; + sid: string; + url: string; + links: Record; +} +export declare class TrunkInstance { + protected _version: V1; + protected _solution: TrunkContextSolution; + protected _context?: TrunkContext; + constructor(_version: V1, payload: TrunkResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Trunk resource. + */ + accountSid: string; + /** + * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + */ + domainName: string; + /** + * The HTTP method we use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + */ + disasterRecoveryMethod: string; + /** + * The URL we call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from this URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + */ + disasterRecoveryUrl: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + */ + secure: boolean; + /** + * The recording settings for the trunk. Can be: `do-not-record`, `record-from-ringing`, `record-from-answer`. If set to `record-from-ringing` or `record-from-answer`, all calls going through the trunk will be recorded. The only way to change recording parameters is on a sub-resource of a Trunk after it has been created. e.g.`/Trunks/[Trunk_SID]/Recording -XPOST -d\'Mode=record-from-answer\'`. See [Recording](https://www.twilio.com/docs/sip-trunking#recording) for more information. + */ + recording: any; + transferMode: TrunkTransferSetting; + transferCallerId: TrunkTransferCallerId; + /** + * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + */ + cnamLookupEnabled: boolean; + /** + * The types of authentication mapped to the domain. Can be: `IP_ACL` and `CREDENTIAL_LIST`. If both are mapped, the values are returned in a comma delimited list. If empty, the domain will not receive any traffic. + */ + authType: string; + /** + * Reserved. + */ + authTypeSet: Array; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The unique string that we created to identify the Trunk resource. + */ + sid: string; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + fetch(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Update a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + update(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Update a TrunkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + update(params: TrunkContextUpdateOptions, callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Access the credentialsLists. + */ + credentialsLists(): CredentialListListInstance; + /** + * Access the ipAccessControlLists. + */ + ipAccessControlLists(): IpAccessControlListListInstance; + /** + * Access the originationUrls. + */ + originationUrls(): OriginationUrlListInstance; + /** + * Access the phoneNumbers. + */ + phoneNumbers(): PhoneNumberListInstance; + /** + * Access the recordings. + */ + recordings(): RecordingListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + domainName: string; + disasterRecoveryMethod: string; + disasterRecoveryUrl: string; + friendlyName: string; + secure: boolean; + recording: any; + transferMode: TrunkTransferSetting; + transferCallerId: TrunkTransferCallerId; + cnamLookupEnabled: boolean; + authType: string; + authTypeSet: string[]; + dateCreated: Date; + dateUpdated: Date; + sid: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TrunkSolution { +} +export interface TrunkListInstance { + _version: V1; + _solution: TrunkSolution; + _uri: string; + (sid: string): TrunkContext; + get(sid: string): TrunkContext; + /** + * Create a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + create(callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Create a TrunkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + create(params: TrunkListInstanceCreateOptions, callback?: (error: Error | null, item?: TrunkInstance) => any): Promise; + /** + * Streams TrunkInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrunkListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TrunkInstance, done: (err?: Error) => void) => void): void; + each(params: TrunkListInstanceEachOptions, callback?: (item: TrunkInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TrunkInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TrunkPage) => any): Promise; + /** + * Lists TrunkInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrunkListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TrunkInstance[]) => any): Promise; + list(params: TrunkListInstanceOptions, callback?: (error: Error | null, items: TrunkInstance[]) => any): Promise; + /** + * Retrieve a single page of TrunkInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrunkListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TrunkPage) => any): Promise; + page(params: TrunkListInstancePageOptions, callback?: (error: Error | null, items: TrunkPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TrunkListInstance(version: V1): TrunkListInstance; +export declare class TrunkPage extends Page { + /** + * Initialize the TrunkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TrunkSolution); + /** + * Build an instance of TrunkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TrunkResource): TrunkInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk.js b/node_modules/twilio/lib/rest/trunking/v1/trunk.js new file mode 100644 index 00000000..5635d33f --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk.js @@ -0,0 +1,364 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trunking + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TrunkPage = exports.TrunkListInstance = exports.TrunkInstance = exports.TrunkContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const credentialList_1 = require("./trunk/credentialList"); +const ipAccessControlList_1 = require("./trunk/ipAccessControlList"); +const originationUrl_1 = require("./trunk/originationUrl"); +const phoneNumber_1 = require("./trunk/phoneNumber"); +const recording_1 = require("./trunk/recording"); +class TrunkContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Trunks/${sid}`; + } + get credentialsLists() { + this._credentialsLists = + this._credentialsLists || + (0, credentialList_1.CredentialListListInstance)(this._version, this._solution.sid); + return this._credentialsLists; + } + get ipAccessControlLists() { + this._ipAccessControlLists = + this._ipAccessControlLists || + (0, ipAccessControlList_1.IpAccessControlListListInstance)(this._version, this._solution.sid); + return this._ipAccessControlLists; + } + get originationUrls() { + this._originationUrls = + this._originationUrls || + (0, originationUrl_1.OriginationUrlListInstance)(this._version, this._solution.sid); + return this._originationUrls; + } + get phoneNumbers() { + this._phoneNumbers = + this._phoneNumbers || + (0, phoneNumber_1.PhoneNumberListInstance)(this._version, this._solution.sid); + return this._phoneNumbers; + } + get recordings() { + this._recordings = + this._recordings || + (0, recording_1.RecordingListInstance)(this._version, this._solution.sid); + return this._recordings; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TrunkInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["domainName"] !== undefined) + data["DomainName"] = params["domainName"]; + if (params["disasterRecoveryUrl"] !== undefined) + data["DisasterRecoveryUrl"] = params["disasterRecoveryUrl"]; + if (params["disasterRecoveryMethod"] !== undefined) + data["DisasterRecoveryMethod"] = params["disasterRecoveryMethod"]; + if (params["transferMode"] !== undefined) + data["TransferMode"] = params["transferMode"]; + if (params["secure"] !== undefined) + data["Secure"] = serialize.bool(params["secure"]); + if (params["cnamLookupEnabled"] !== undefined) + data["CnamLookupEnabled"] = serialize.bool(params["cnamLookupEnabled"]); + if (params["transferCallerId"] !== undefined) + data["TransferCallerId"] = params["transferCallerId"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrunkInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrunkContextImpl = TrunkContextImpl; +class TrunkInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.domainName = payload.domain_name; + this.disasterRecoveryMethod = payload.disaster_recovery_method; + this.disasterRecoveryUrl = payload.disaster_recovery_url; + this.friendlyName = payload.friendly_name; + this.secure = payload.secure; + this.recording = payload.recording; + this.transferMode = payload.transfer_mode; + this.transferCallerId = payload.transfer_caller_id; + this.cnamLookupEnabled = payload.cnam_lookup_enabled; + this.authType = payload.auth_type; + this.authTypeSet = payload.auth_type_set; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.sid = payload.sid; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new TrunkContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrunkInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the credentialsLists. + */ + credentialsLists() { + return this._proxy.credentialsLists; + } + /** + * Access the ipAccessControlLists. + */ + ipAccessControlLists() { + return this._proxy.ipAccessControlLists; + } + /** + * Access the originationUrls. + */ + originationUrls() { + return this._proxy.originationUrls; + } + /** + * Access the phoneNumbers. + */ + phoneNumbers() { + return this._proxy.phoneNumbers; + } + /** + * Access the recordings. + */ + recordings() { + return this._proxy.recordings; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + domainName: this.domainName, + disasterRecoveryMethod: this.disasterRecoveryMethod, + disasterRecoveryUrl: this.disasterRecoveryUrl, + friendlyName: this.friendlyName, + secure: this.secure, + recording: this.recording, + transferMode: this.transferMode, + transferCallerId: this.transferCallerId, + cnamLookupEnabled: this.cnamLookupEnabled, + authType: this.authType, + authTypeSet: this.authTypeSet, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + sid: this.sid, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrunkInstance = TrunkInstance; +function TrunkListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TrunkContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Trunks`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["domainName"] !== undefined) + data["DomainName"] = params["domainName"]; + if (params["disasterRecoveryUrl"] !== undefined) + data["DisasterRecoveryUrl"] = params["disasterRecoveryUrl"]; + if (params["disasterRecoveryMethod"] !== undefined) + data["DisasterRecoveryMethod"] = params["disasterRecoveryMethod"]; + if (params["transferMode"] !== undefined) + data["TransferMode"] = params["transferMode"]; + if (params["secure"] !== undefined) + data["Secure"] = serialize.bool(params["secure"]); + if (params["cnamLookupEnabled"] !== undefined) + data["CnamLookupEnabled"] = serialize.bool(params["cnamLookupEnabled"]); + if (params["transferCallerId"] !== undefined) + data["TransferCallerId"] = params["transferCallerId"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrunkInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrunkPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TrunkPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TrunkListInstance = TrunkListInstance; +class TrunkPage extends Page_1.default { + /** + * Initialize the TrunkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TrunkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TrunkInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrunkPage = TrunkPage; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/credentialList.d.ts b/node_modules/twilio/lib/rest/trunking/v1/trunk/credentialList.d.ts new file mode 100644 index 00000000..439ce920 --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/credentialList.d.ts @@ -0,0 +1,258 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a CredentialListInstance + */ +export interface CredentialListListInstanceCreateOptions { + /** The SID of the [Credential List](https://www.twilio.com/docs/voice/sip/api/sip-credentiallist-resource) that you want to associate with the trunk. Once associated, we will authenticate access to the trunk against this list. */ + credentialListSid: string; +} +/** + * Options to pass to each + */ +export interface CredentialListListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CredentialListInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CredentialListListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CredentialListListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CredentialListContext { + /** + * Remove a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CredentialListContextSolution { + trunkSid: string; + sid: string; +} +export declare class CredentialListContextImpl implements CredentialListContext { + protected _version: V1; + protected _solution: CredentialListContextSolution; + protected _uri: string; + constructor(_version: V1, trunkSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CredentialListContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CredentialListPayload extends TwilioResponsePayload { + credential_lists: CredentialListResource[]; +} +interface CredentialListResource { + account_sid: string; + sid: string; + trunk_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CredentialListInstance { + protected _version: V1; + protected _solution: CredentialListContextSolution; + protected _context?: CredentialListContext; + constructor(_version: V1, payload: CredentialListResource, trunkSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialList resource. + */ + accountSid: string; + /** + * The unique string that we created to identify the CredentialList resource. + */ + sid: string; + /** + * The SID of the Trunk the credential list in associated with. + */ + trunkSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + fetch(callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + trunkSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CredentialListSolution { + trunkSid: string; +} +export interface CredentialListListInstance { + _version: V1; + _solution: CredentialListSolution; + _uri: string; + (sid: string): CredentialListContext; + get(sid: string): CredentialListContext; + /** + * Create a CredentialListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + create(params: CredentialListListInstanceCreateOptions, callback?: (error: Error | null, item?: CredentialListInstance) => any): Promise; + /** + * Streams CredentialListInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CredentialListInstance, done: (err?: Error) => void) => void): void; + each(params: CredentialListListInstanceEachOptions, callback?: (item: CredentialListInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CredentialListInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CredentialListPage) => any): Promise; + /** + * Lists CredentialListInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CredentialListInstance[]) => any): Promise; + list(params: CredentialListListInstanceOptions, callback?: (error: Error | null, items: CredentialListInstance[]) => any): Promise; + /** + * Retrieve a single page of CredentialListInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CredentialListListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CredentialListPage) => any): Promise; + page(params: CredentialListListInstancePageOptions, callback?: (error: Error | null, items: CredentialListPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CredentialListListInstance(version: V1, trunkSid: string): CredentialListListInstance; +export declare class CredentialListPage extends Page { + /** + * Initialize the CredentialListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CredentialListSolution); + /** + * Build an instance of CredentialListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CredentialListResource): CredentialListInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/credentialList.js b/node_modules/twilio/lib/rest/trunking/v1/trunk/credentialList.js new file mode 100644 index 00000000..00cf85be --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/credentialList.js @@ -0,0 +1,230 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trunking + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialListPage = exports.CredentialListListInstance = exports.CredentialListInstance = exports.CredentialListContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class CredentialListContextImpl { + constructor(_version, trunkSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { trunkSid, sid }; + this._uri = `/Trunks/${trunkSid}/CredentialLists/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CredentialListInstance(operationVersion, payload, instance._solution.trunkSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListContextImpl = CredentialListContextImpl; +class CredentialListInstance { + constructor(_version, payload, trunkSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.trunkSid = payload.trunk_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { trunkSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CredentialListContextImpl(this._version, this._solution.trunkSid, this._solution.sid); + return this._context; + } + /** + * Remove a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CredentialListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CredentialListInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + trunkSid: this.trunkSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListInstance = CredentialListInstance; +function CredentialListListInstance(version, trunkSid) { + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CredentialListContextImpl(version, trunkSid, sid); + }; + instance._version = version; + instance._solution = { trunkSid }; + instance._uri = `/Trunks/${trunkSid}/CredentialLists`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["credentialListSid"] === null || + params["credentialListSid"] === undefined) { + throw new Error("Required parameter \"params['credentialListSid']\" missing."); + } + let data = {}; + data["CredentialListSid"] = params["credentialListSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialListInstance(operationVersion, payload, instance._solution.trunkSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CredentialListPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CredentialListPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CredentialListListInstance = CredentialListListInstance; +class CredentialListPage extends Page_1.default { + /** + * Initialize the CredentialListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CredentialListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CredentialListInstance(this._version, payload, this._solution.trunkSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CredentialListPage = CredentialListPage; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/ipAccessControlList.d.ts b/node_modules/twilio/lib/rest/trunking/v1/trunk/ipAccessControlList.d.ts new file mode 100644 index 00000000..ab75b14f --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/ipAccessControlList.d.ts @@ -0,0 +1,258 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a IpAccessControlListInstance + */ +export interface IpAccessControlListListInstanceCreateOptions { + /** The SID of the [IP Access Control List](https://www.twilio.com/docs/voice/sip/api/sip-ipaccesscontrollist-resource) that you want to associate with the trunk. */ + ipAccessControlListSid: string; +} +/** + * Options to pass to each + */ +export interface IpAccessControlListListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: IpAccessControlListInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface IpAccessControlListListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface IpAccessControlListListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface IpAccessControlListContext { + /** + * Remove a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + fetch(callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface IpAccessControlListContextSolution { + trunkSid: string; + sid: string; +} +export declare class IpAccessControlListContextImpl implements IpAccessControlListContext { + protected _version: V1; + protected _solution: IpAccessControlListContextSolution; + protected _uri: string; + constructor(_version: V1, trunkSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): IpAccessControlListContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface IpAccessControlListPayload extends TwilioResponsePayload { + ip_access_control_lists: IpAccessControlListResource[]; +} +interface IpAccessControlListResource { + account_sid: string; + sid: string; + trunk_sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class IpAccessControlListInstance { + protected _version: V1; + protected _solution: IpAccessControlListContextSolution; + protected _context?: IpAccessControlListContext; + constructor(_version: V1, payload: IpAccessControlListResource, trunkSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlList resource. + */ + accountSid: string; + /** + * The unique string that we created to identify the IpAccessControlList resource. + */ + sid: string; + /** + * The SID of the Trunk the resource is associated with. + */ + trunkSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + fetch(callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + trunkSid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface IpAccessControlListSolution { + trunkSid: string; +} +export interface IpAccessControlListListInstance { + _version: V1; + _solution: IpAccessControlListSolution; + _uri: string; + (sid: string): IpAccessControlListContext; + get(sid: string): IpAccessControlListContext; + /** + * Create a IpAccessControlListInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + create(params: IpAccessControlListListInstanceCreateOptions, callback?: (error: Error | null, item?: IpAccessControlListInstance) => any): Promise; + /** + * Streams IpAccessControlListInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: IpAccessControlListInstance, done: (err?: Error) => void) => void): void; + each(params: IpAccessControlListListInstanceEachOptions, callback?: (item: IpAccessControlListInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of IpAccessControlListInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: IpAccessControlListPage) => any): Promise; + /** + * Lists IpAccessControlListInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: IpAccessControlListInstance[]) => any): Promise; + list(params: IpAccessControlListListInstanceOptions, callback?: (error: Error | null, items: IpAccessControlListInstance[]) => any): Promise; + /** + * Retrieve a single page of IpAccessControlListInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpAccessControlListListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: IpAccessControlListPage) => any): Promise; + page(params: IpAccessControlListListInstancePageOptions, callback?: (error: Error | null, items: IpAccessControlListPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function IpAccessControlListListInstance(version: V1, trunkSid: string): IpAccessControlListListInstance; +export declare class IpAccessControlListPage extends Page { + /** + * Initialize the IpAccessControlListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: IpAccessControlListSolution); + /** + * Build an instance of IpAccessControlListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: IpAccessControlListResource): IpAccessControlListInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/ipAccessControlList.js b/node_modules/twilio/lib/rest/trunking/v1/trunk/ipAccessControlList.js new file mode 100644 index 00000000..2bb7aab1 --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/ipAccessControlList.js @@ -0,0 +1,230 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trunking + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IpAccessControlListPage = exports.IpAccessControlListListInstance = exports.IpAccessControlListInstance = exports.IpAccessControlListContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class IpAccessControlListContextImpl { + constructor(_version, trunkSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { trunkSid, sid }; + this._uri = `/Trunks/${trunkSid}/IpAccessControlLists/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListInstance(operationVersion, payload, instance._solution.trunkSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListContextImpl = IpAccessControlListContextImpl; +class IpAccessControlListInstance { + constructor(_version, payload, trunkSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.trunkSid = payload.trunk_sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { trunkSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new IpAccessControlListContextImpl(this._version, this._solution.trunkSid, this._solution.sid); + return this._context; + } + /** + * Remove a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a IpAccessControlListInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpAccessControlListInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + trunkSid: this.trunkSid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListInstance = IpAccessControlListInstance; +function IpAccessControlListListInstance(version, trunkSid) { + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new IpAccessControlListContextImpl(version, trunkSid, sid); + }; + instance._version = version; + instance._solution = { trunkSid }; + instance._uri = `/Trunks/${trunkSid}/IpAccessControlLists`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["ipAccessControlListSid"] === null || + params["ipAccessControlListSid"] === undefined) { + throw new Error("Required parameter \"params['ipAccessControlListSid']\" missing."); + } + let data = {}; + data["IpAccessControlListSid"] = params["ipAccessControlListSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListInstance(operationVersion, payload, instance._solution.trunkSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpAccessControlListPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new IpAccessControlListPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.IpAccessControlListListInstance = IpAccessControlListListInstance; +class IpAccessControlListPage extends Page_1.default { + /** + * Initialize the IpAccessControlListPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of IpAccessControlListInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new IpAccessControlListInstance(this._version, payload, this._solution.trunkSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpAccessControlListPage = IpAccessControlListPage; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/originationUrl.d.ts b/node_modules/twilio/lib/rest/trunking/v1/trunk/originationUrl.d.ts new file mode 100644 index 00000000..e2b9bbe5 --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/originationUrl.d.ts @@ -0,0 +1,340 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a OriginationUrlInstance + */ +export interface OriginationUrlContextUpdateOptions { + /** The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. */ + weight?: number; + /** The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. */ + priority?: number; + /** Whether the URL is enabled. The default is `true`. */ + enabled?: boolean; + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName?: string; + /** The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. */ + sipUrl?: string; +} +/** + * Options to pass to create a OriginationUrlInstance + */ +export interface OriginationUrlListInstanceCreateOptions { + /** The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. */ + weight: number; + /** The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. */ + priority: number; + /** Whether the URL is enabled. The default is `true`. */ + enabled: boolean; + /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ + friendlyName: string; + /** The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. */ + sipUrl: string; +} +/** + * Options to pass to each + */ +export interface OriginationUrlListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: OriginationUrlInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface OriginationUrlListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface OriginationUrlListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface OriginationUrlContext { + /** + * Remove a OriginationUrlInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a OriginationUrlInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OriginationUrlInstance + */ + fetch(callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + /** + * Update a OriginationUrlInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OriginationUrlInstance + */ + update(callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + /** + * Update a OriginationUrlInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OriginationUrlInstance + */ + update(params: OriginationUrlContextUpdateOptions, callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface OriginationUrlContextSolution { + trunkSid: string; + sid: string; +} +export declare class OriginationUrlContextImpl implements OriginationUrlContext { + protected _version: V1; + protected _solution: OriginationUrlContextSolution; + protected _uri: string; + constructor(_version: V1, trunkSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + update(params?: OriginationUrlContextUpdateOptions | ((error: Error | null, item?: OriginationUrlInstance) => any), callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): OriginationUrlContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface OriginationUrlPayload extends TwilioResponsePayload { + origination_urls: OriginationUrlResource[]; +} +interface OriginationUrlResource { + account_sid: string; + sid: string; + trunk_sid: string; + weight: number; + enabled: boolean; + sip_url: string; + friendly_name: string; + priority: number; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class OriginationUrlInstance { + protected _version: V1; + protected _solution: OriginationUrlContextSolution; + protected _context?: OriginationUrlContext; + constructor(_version: V1, payload: OriginationUrlResource, trunkSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OriginationUrl resource. + */ + accountSid: string; + /** + * The unique string that we created to identify the OriginationUrl resource. + */ + sid: string; + /** + * The SID of the Trunk that owns the Origination URL. + */ + trunkSid: string; + /** + * The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. + */ + weight: number; + /** + * Whether the URL is enabled. The default is `true`. + */ + enabled: boolean; + /** + * The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. + */ + sipUrl: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. + */ + priority: number; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a OriginationUrlInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a OriginationUrlInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OriginationUrlInstance + */ + fetch(callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + /** + * Update a OriginationUrlInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OriginationUrlInstance + */ + update(callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + /** + * Update a OriginationUrlInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OriginationUrlInstance + */ + update(params: OriginationUrlContextUpdateOptions, callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + trunkSid: string; + weight: number; + enabled: boolean; + sipUrl: string; + friendlyName: string; + priority: number; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface OriginationUrlSolution { + trunkSid: string; +} +export interface OriginationUrlListInstance { + _version: V1; + _solution: OriginationUrlSolution; + _uri: string; + (sid: string): OriginationUrlContext; + get(sid: string): OriginationUrlContext; + /** + * Create a OriginationUrlInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OriginationUrlInstance + */ + create(params: OriginationUrlListInstanceCreateOptions, callback?: (error: Error | null, item?: OriginationUrlInstance) => any): Promise; + /** + * Streams OriginationUrlInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OriginationUrlListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: OriginationUrlInstance, done: (err?: Error) => void) => void): void; + each(params: OriginationUrlListInstanceEachOptions, callback?: (item: OriginationUrlInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of OriginationUrlInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: OriginationUrlPage) => any): Promise; + /** + * Lists OriginationUrlInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OriginationUrlListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: OriginationUrlInstance[]) => any): Promise; + list(params: OriginationUrlListInstanceOptions, callback?: (error: Error | null, items: OriginationUrlInstance[]) => any): Promise; + /** + * Retrieve a single page of OriginationUrlInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { OriginationUrlListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: OriginationUrlPage) => any): Promise; + page(params: OriginationUrlListInstancePageOptions, callback?: (error: Error | null, items: OriginationUrlPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function OriginationUrlListInstance(version: V1, trunkSid: string): OriginationUrlListInstance; +export declare class OriginationUrlPage extends Page { + /** + * Initialize the OriginationUrlPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: OriginationUrlSolution); + /** + * Build an instance of OriginationUrlInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: OriginationUrlResource): OriginationUrlInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/originationUrl.js b/node_modules/twilio/lib/rest/trunking/v1/trunk/originationUrl.js new file mode 100644 index 00000000..5afb1be0 --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/originationUrl.js @@ -0,0 +1,289 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trunking + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OriginationUrlPage = exports.OriginationUrlListInstance = exports.OriginationUrlInstance = exports.OriginationUrlContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class OriginationUrlContextImpl { + constructor(_version, trunkSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { trunkSid, sid }; + this._uri = `/Trunks/${trunkSid}/OriginationUrls/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new OriginationUrlInstance(operationVersion, payload, instance._solution.trunkSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["weight"] !== undefined) + data["Weight"] = params["weight"]; + if (params["priority"] !== undefined) + data["Priority"] = params["priority"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["sipUrl"] !== undefined) + data["SipUrl"] = params["sipUrl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new OriginationUrlInstance(operationVersion, payload, instance._solution.trunkSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OriginationUrlContextImpl = OriginationUrlContextImpl; +class OriginationUrlInstance { + constructor(_version, payload, trunkSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.trunkSid = payload.trunk_sid; + this.weight = deserialize.integer(payload.weight); + this.enabled = payload.enabled; + this.sipUrl = payload.sip_url; + this.friendlyName = payload.friendly_name; + this.priority = deserialize.integer(payload.priority); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { trunkSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new OriginationUrlContextImpl(this._version, this._solution.trunkSid, this._solution.sid); + return this._context; + } + /** + * Remove a OriginationUrlInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a OriginationUrlInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed OriginationUrlInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + trunkSid: this.trunkSid, + weight: this.weight, + enabled: this.enabled, + sipUrl: this.sipUrl, + friendlyName: this.friendlyName, + priority: this.priority, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OriginationUrlInstance = OriginationUrlInstance; +function OriginationUrlListInstance(version, trunkSid) { + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new OriginationUrlContextImpl(version, trunkSid, sid); + }; + instance._version = version; + instance._solution = { trunkSid }; + instance._uri = `/Trunks/${trunkSid}/OriginationUrls`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["weight"] === null || params["weight"] === undefined) { + throw new Error("Required parameter \"params['weight']\" missing."); + } + if (params["priority"] === null || params["priority"] === undefined) { + throw new Error("Required parameter \"params['priority']\" missing."); + } + if (params["enabled"] === null || params["enabled"] === undefined) { + throw new Error("Required parameter \"params['enabled']\" missing."); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["sipUrl"] === null || params["sipUrl"] === undefined) { + throw new Error("Required parameter \"params['sipUrl']\" missing."); + } + let data = {}; + data["Weight"] = params["weight"]; + data["Priority"] = params["priority"]; + data["Enabled"] = serialize.bool(params["enabled"]); + data["FriendlyName"] = params["friendlyName"]; + data["SipUrl"] = params["sipUrl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new OriginationUrlInstance(operationVersion, payload, instance._solution.trunkSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new OriginationUrlPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new OriginationUrlPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.OriginationUrlListInstance = OriginationUrlListInstance; +class OriginationUrlPage extends Page_1.default { + /** + * Initialize the OriginationUrlPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of OriginationUrlInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new OriginationUrlInstance(this._version, payload, this._solution.trunkSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.OriginationUrlPage = OriginationUrlPage; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/phoneNumber.d.ts b/node_modules/twilio/lib/rest/trunking/v1/trunk/phoneNumber.d.ts new file mode 100644 index 00000000..8c9ff72b --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/phoneNumber.d.ts @@ -0,0 +1,370 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type PhoneNumberAddressRequirement = "none" | "any" | "local" | "foreign"; +/** + * Options to pass to create a PhoneNumberInstance + */ +export interface PhoneNumberListInstanceCreateOptions { + /** The SID of the [Incoming Phone Number](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) that you want to associate with the trunk. */ + phoneNumberSid: string; +} +/** + * Options to pass to each + */ +export interface PhoneNumberListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface PhoneNumberListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface PhoneNumberListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface PhoneNumberContext { + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PhoneNumberContextSolution { + trunkSid: string; + sid: string; +} +export declare class PhoneNumberContextImpl implements PhoneNumberContext { + protected _version: V1; + protected _solution: PhoneNumberContextSolution; + protected _uri: string; + constructor(_version: V1, trunkSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PhoneNumberContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PhoneNumberPayload extends TwilioResponsePayload { + phone_numbers: PhoneNumberResource[]; +} +interface PhoneNumberResource { + account_sid: string; + address_requirements: PhoneNumberAddressRequirement; + api_version: string; + beta: boolean; + capabilities: Record; + date_created: Date; + date_updated: Date; + friendly_name: string; + links: Record; + phone_number: string; + sid: string; + sms_application_sid: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + status_callback: string; + status_callback_method: string; + trunk_sid: string; + url: string; + voice_application_sid: string; + voice_caller_id_lookup: boolean; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_url: string; +} +export declare class PhoneNumberInstance { + protected _version: V1; + protected _solution: PhoneNumberContextSolution; + protected _context?: PhoneNumberContext; + constructor(_version: V1, payload: PhoneNumberResource, trunkSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PhoneNumber resource. + */ + accountSid: string; + addressRequirements: PhoneNumberAddressRequirement; + /** + * The API version used to start a new TwiML session. + */ + apiVersion: string; + /** + * Whether the phone number is new to the Twilio platform. Can be: `true` or `false`. + */ + beta: boolean; + /** + * The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` or `false`. + */ + capabilities: Record; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The URLs of related resources. + */ + links: Record; + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + phoneNumber: string; + /** + * The unique string that we created to identify the PhoneNumber resource. + */ + sid: string; + /** + * The SID of the application that handles SMS messages sent to the phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + */ + smsApplicationSid: string; + /** + * The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`. + */ + smsFallbackMethod: string; + /** + * The URL that we call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML from `sms_url`. + */ + smsFallbackUrl: string; + /** + * The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. + */ + smsMethod: string; + /** + * The URL we call using the `sms_method` when the phone number receives an incoming SMS message. + */ + smsUrl: string; + /** + * The URL we call using the `status_callback_method` to send status information to your application. + */ + statusCallback: string; + /** + * The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. + */ + statusCallbackMethod: string; + /** + * The SID of the Trunk that handles calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice URLs and voice applications and use those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + */ + trunkSid: string; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The SID of the application that handles calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice URLs and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + */ + voiceApplicationSid: string; + /** + * Whether we look up the caller\'s caller-ID name from the CNAM database ($0.01 per look up). Can be: `true` or `false`. + */ + voiceCallerIdLookup: boolean; + /** + * The HTTP method that we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call using the `voice_fallback_method` when an error occurs retrieving or executing the TwiML requested by `url`. + */ + voiceFallbackUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The URL we call using the `voice_method` when the phone number receives a call. The `voice_url` is not be used if a `voice_application_sid` or a `trunk_sid` is set. + */ + voiceUrl: string; + private get _proxy(); + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + addressRequirements: PhoneNumberAddressRequirement; + apiVersion: string; + beta: boolean; + capabilities: Record; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + links: Record; + phoneNumber: string; + sid: string; + smsApplicationSid: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + statusCallback: string; + statusCallbackMethod: string; + trunkSid: string; + url: string; + voiceApplicationSid: string; + voiceCallerIdLookup: boolean; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PhoneNumberSolution { + trunkSid: string; +} +export interface PhoneNumberListInstance { + _version: V1; + _solution: PhoneNumberSolution; + _uri: string; + (sid: string): PhoneNumberContext; + get(sid: string): PhoneNumberContext; + /** + * Create a PhoneNumberInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + create(params: PhoneNumberListInstanceCreateOptions, callback?: (error: Error | null, item?: PhoneNumberInstance) => any): Promise; + /** + * Streams PhoneNumberInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void): void; + each(params: PhoneNumberListInstanceEachOptions, callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of PhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + /** + * Lists PhoneNumberInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: PhoneNumberInstance[]) => any): Promise; + list(params: PhoneNumberListInstanceOptions, callback?: (error: Error | null, items: PhoneNumberInstance[]) => any): Promise; + /** + * Retrieve a single page of PhoneNumberInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PhoneNumberListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + page(params: PhoneNumberListInstancePageOptions, callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PhoneNumberListInstance(version: V1, trunkSid: string): PhoneNumberListInstance; +export declare class PhoneNumberPage extends Page { + /** + * Initialize the PhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: PhoneNumberSolution); + /** + * Build an instance of PhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: PhoneNumberResource): PhoneNumberInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/phoneNumber.js b/node_modules/twilio/lib/rest/trunking/v1/trunk/phoneNumber.js new file mode 100644 index 00000000..9c99967b --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/phoneNumber.js @@ -0,0 +1,268 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trunking + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PhoneNumberPage = exports.PhoneNumberListInstance = exports.PhoneNumberInstance = exports.PhoneNumberContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class PhoneNumberContextImpl { + constructor(_version, trunkSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { trunkSid, sid }; + this._uri = `/Trunks/${trunkSid}/PhoneNumbers/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.trunkSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberContextImpl = PhoneNumberContextImpl; +class PhoneNumberInstance { + constructor(_version, payload, trunkSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.addressRequirements = payload.address_requirements; + this.apiVersion = payload.api_version; + this.beta = payload.beta; + this.capabilities = payload.capabilities; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.links = payload.links; + this.phoneNumber = payload.phone_number; + this.sid = payload.sid; + this.smsApplicationSid = payload.sms_application_sid; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.trunkSid = payload.trunk_sid; + this.url = payload.url; + this.voiceApplicationSid = payload.voice_application_sid; + this.voiceCallerIdLookup = payload.voice_caller_id_lookup; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceUrl = payload.voice_url; + this._solution = { trunkSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PhoneNumberContextImpl(this._version, this._solution.trunkSid, this._solution.sid); + return this._context; + } + /** + * Remove a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a PhoneNumberInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PhoneNumberInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + addressRequirements: this.addressRequirements, + apiVersion: this.apiVersion, + beta: this.beta, + capabilities: this.capabilities, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + links: this.links, + phoneNumber: this.phoneNumber, + sid: this.sid, + smsApplicationSid: this.smsApplicationSid, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + trunkSid: this.trunkSid, + url: this.url, + voiceApplicationSid: this.voiceApplicationSid, + voiceCallerIdLookup: this.voiceCallerIdLookup, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceUrl: this.voiceUrl, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberInstance = PhoneNumberInstance; +function PhoneNumberListInstance(version, trunkSid) { + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PhoneNumberContextImpl(version, trunkSid, sid); + }; + instance._version = version; + instance._solution = { trunkSid }; + instance._uri = `/Trunks/${trunkSid}/PhoneNumbers`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumberSid"] === null || + params["phoneNumberSid"] === undefined) { + throw new Error("Required parameter \"params['phoneNumberSid']\" missing."); + } + let data = {}; + data["PhoneNumberSid"] = params["phoneNumberSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberInstance(operationVersion, payload, instance._solution.trunkSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PhoneNumberPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new PhoneNumberPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PhoneNumberListInstance = PhoneNumberListInstance; +class PhoneNumberPage extends Page_1.default { + /** + * Initialize the PhoneNumberPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of PhoneNumberInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new PhoneNumberInstance(this._version, payload, this._solution.trunkSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PhoneNumberPage = PhoneNumberPage; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/recording.d.ts b/node_modules/twilio/lib/rest/trunking/v1/trunk/recording.d.ts new file mode 100644 index 00000000..aef24a1e --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/recording.d.ts @@ -0,0 +1,129 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export type RecordingRecordingMode = "do-not-record" | "record-from-ringing" | "record-from-answer" | "record-from-ringing-dual" | "record-from-answer-dual"; +export type RecordingRecordingTrim = "trim-silence" | "do-not-trim"; +/** + * Options to pass to update a RecordingInstance + */ +export interface RecordingContextUpdateOptions { + /** */ + mode?: RecordingRecordingMode; + /** */ + trim?: RecordingRecordingTrim; +} +export interface RecordingContext { + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Update a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + update(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Update a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + update(params: RecordingContextUpdateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RecordingContextSolution { + trunkSid: string; +} +export declare class RecordingContextImpl implements RecordingContext { + protected _version: V1; + protected _solution: RecordingContextSolution; + protected _uri: string; + constructor(_version: V1, trunkSid: string); + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + update(params?: RecordingContextUpdateOptions | ((error: Error | null, item?: RecordingInstance) => any), callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RecordingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RecordingResource { + mode: RecordingRecordingMode; + trim: RecordingRecordingTrim; +} +export declare class RecordingInstance { + protected _version: V1; + protected _solution: RecordingContextSolution; + protected _context?: RecordingContext; + constructor(_version: V1, payload: RecordingResource, trunkSid: string); + mode: RecordingRecordingMode; + trim: RecordingRecordingTrim; + private get _proxy(); + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Update a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + update(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Update a RecordingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + update(params: RecordingContextUpdateOptions, callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + mode: RecordingRecordingMode; + trim: RecordingRecordingTrim; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RecordingSolution { + trunkSid: string; +} +export interface RecordingListInstance { + _version: V1; + _solution: RecordingSolution; + _uri: string; + (): RecordingContext; + get(): RecordingContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RecordingListInstance(version: V1, trunkSid: string): RecordingListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/trunking/v1/trunk/recording.js b/node_modules/twilio/lib/rest/trunking/v1/trunk/recording.js new file mode 100644 index 00000000..9be96cd7 --- /dev/null +++ b/node_modules/twilio/lib/rest/trunking/v1/trunk/recording.js @@ -0,0 +1,140 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trunking + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RecordingListInstance = exports.RecordingInstance = exports.RecordingContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class RecordingContextImpl { + constructor(_version, trunkSid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + this._solution = { trunkSid }; + this._uri = `/Trunks/${trunkSid}/Recording`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.trunkSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["mode"] !== undefined) + data["Mode"] = params["mode"]; + if (params["trim"] !== undefined) + data["Trim"] = params["trim"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.trunkSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingContextImpl = RecordingContextImpl; +class RecordingInstance { + constructor(_version, payload, trunkSid) { + this._version = _version; + this.mode = payload.mode; + this.trim = payload.trim; + this._solution = { trunkSid }; + } + get _proxy() { + this._context = + this._context || + new RecordingContextImpl(this._version, this._solution.trunkSid); + return this._context; + } + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + mode: this.mode, + trim: this.trim, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingInstance = RecordingInstance; +function RecordingListInstance(version, trunkSid) { + if (!(0, utility_1.isValidPathParam)(trunkSid)) { + throw new Error("Parameter 'trunkSid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new RecordingContextImpl(version, trunkSid); + }; + instance._version = version; + instance._solution = { trunkSid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RecordingListInstance = RecordingListInstance; diff --git a/node_modules/twilio/lib/rest/trusthub/V1.d.ts b/node_modules/twilio/lib/rest/trusthub/V1.d.ts new file mode 100644 index 00000000..c1b91bb3 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/V1.d.ts @@ -0,0 +1,60 @@ +import TrusthubBase from "../TrusthubBase"; +import Version from "../../base/Version"; +import { ComplianceInquiriesListInstance } from "./v1/complianceInquiries"; +import { ComplianceRegistrationInquiriesListInstance } from "./v1/complianceRegistrationInquiries"; +import { ComplianceTollfreeInquiriesListInstance } from "./v1/complianceTollfreeInquiries"; +import { CustomerProfilesListInstance } from "./v1/customerProfiles"; +import { EndUserListInstance } from "./v1/endUser"; +import { EndUserTypeListInstance } from "./v1/endUserType"; +import { PoliciesListInstance } from "./v1/policies"; +import { SupportingDocumentListInstance } from "./v1/supportingDocument"; +import { SupportingDocumentTypeListInstance } from "./v1/supportingDocumentType"; +import { TrustProductsListInstance } from "./v1/trustProducts"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Trusthub + * + * @param domain - The Twilio (Twilio.Trusthub) domain + */ + constructor(domain: TrusthubBase); + /** complianceInquiries - { Twilio.Trusthub.V1.ComplianceInquiriesListInstance } resource */ + protected _complianceInquiries?: ComplianceInquiriesListInstance; + /** complianceRegistrationInquiries - { Twilio.Trusthub.V1.ComplianceRegistrationInquiriesListInstance } resource */ + protected _complianceRegistrationInquiries?: ComplianceRegistrationInquiriesListInstance; + /** complianceTollfreeInquiries - { Twilio.Trusthub.V1.ComplianceTollfreeInquiriesListInstance } resource */ + protected _complianceTollfreeInquiries?: ComplianceTollfreeInquiriesListInstance; + /** customerProfiles - { Twilio.Trusthub.V1.CustomerProfilesListInstance } resource */ + protected _customerProfiles?: CustomerProfilesListInstance; + /** endUsers - { Twilio.Trusthub.V1.EndUserListInstance } resource */ + protected _endUsers?: EndUserListInstance; + /** endUserTypes - { Twilio.Trusthub.V1.EndUserTypeListInstance } resource */ + protected _endUserTypes?: EndUserTypeListInstance; + /** policies - { Twilio.Trusthub.V1.PoliciesListInstance } resource */ + protected _policies?: PoliciesListInstance; + /** supportingDocuments - { Twilio.Trusthub.V1.SupportingDocumentListInstance } resource */ + protected _supportingDocuments?: SupportingDocumentListInstance; + /** supportingDocumentTypes - { Twilio.Trusthub.V1.SupportingDocumentTypeListInstance } resource */ + protected _supportingDocumentTypes?: SupportingDocumentTypeListInstance; + /** trustProducts - { Twilio.Trusthub.V1.TrustProductsListInstance } resource */ + protected _trustProducts?: TrustProductsListInstance; + /** Getter for complianceInquiries resource */ + get complianceInquiries(): ComplianceInquiriesListInstance; + /** Getter for complianceRegistrationInquiries resource */ + get complianceRegistrationInquiries(): ComplianceRegistrationInquiriesListInstance; + /** Getter for complianceTollfreeInquiries resource */ + get complianceTollfreeInquiries(): ComplianceTollfreeInquiriesListInstance; + /** Getter for customerProfiles resource */ + get customerProfiles(): CustomerProfilesListInstance; + /** Getter for endUsers resource */ + get endUsers(): EndUserListInstance; + /** Getter for endUserTypes resource */ + get endUserTypes(): EndUserTypeListInstance; + /** Getter for policies resource */ + get policies(): PoliciesListInstance; + /** Getter for supportingDocuments resource */ + get supportingDocuments(): SupportingDocumentListInstance; + /** Getter for supportingDocumentTypes resource */ + get supportingDocumentTypes(): SupportingDocumentTypeListInstance; + /** Getter for trustProducts resource */ + get trustProducts(): TrustProductsListInstance; +} diff --git a/node_modules/twilio/lib/rest/trusthub/V1.js b/node_modules/twilio/lib/rest/trusthub/V1.js new file mode 100644 index 00000000..02007558 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/V1.js @@ -0,0 +1,99 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const complianceInquiries_1 = require("./v1/complianceInquiries"); +const complianceRegistrationInquiries_1 = require("./v1/complianceRegistrationInquiries"); +const complianceTollfreeInquiries_1 = require("./v1/complianceTollfreeInquiries"); +const customerProfiles_1 = require("./v1/customerProfiles"); +const endUser_1 = require("./v1/endUser"); +const endUserType_1 = require("./v1/endUserType"); +const policies_1 = require("./v1/policies"); +const supportingDocument_1 = require("./v1/supportingDocument"); +const supportingDocumentType_1 = require("./v1/supportingDocumentType"); +const trustProducts_1 = require("./v1/trustProducts"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Trusthub + * + * @param domain - The Twilio (Twilio.Trusthub) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for complianceInquiries resource */ + get complianceInquiries() { + this._complianceInquiries = + this._complianceInquiries || (0, complianceInquiries_1.ComplianceInquiriesListInstance)(this); + return this._complianceInquiries; + } + /** Getter for complianceRegistrationInquiries resource */ + get complianceRegistrationInquiries() { + this._complianceRegistrationInquiries = + this._complianceRegistrationInquiries || + (0, complianceRegistrationInquiries_1.ComplianceRegistrationInquiriesListInstance)(this); + return this._complianceRegistrationInquiries; + } + /** Getter for complianceTollfreeInquiries resource */ + get complianceTollfreeInquiries() { + this._complianceTollfreeInquiries = + this._complianceTollfreeInquiries || + (0, complianceTollfreeInquiries_1.ComplianceTollfreeInquiriesListInstance)(this); + return this._complianceTollfreeInquiries; + } + /** Getter for customerProfiles resource */ + get customerProfiles() { + this._customerProfiles = + this._customerProfiles || (0, customerProfiles_1.CustomerProfilesListInstance)(this); + return this._customerProfiles; + } + /** Getter for endUsers resource */ + get endUsers() { + this._endUsers = this._endUsers || (0, endUser_1.EndUserListInstance)(this); + return this._endUsers; + } + /** Getter for endUserTypes resource */ + get endUserTypes() { + this._endUserTypes = this._endUserTypes || (0, endUserType_1.EndUserTypeListInstance)(this); + return this._endUserTypes; + } + /** Getter for policies resource */ + get policies() { + this._policies = this._policies || (0, policies_1.PoliciesListInstance)(this); + return this._policies; + } + /** Getter for supportingDocuments resource */ + get supportingDocuments() { + this._supportingDocuments = + this._supportingDocuments || (0, supportingDocument_1.SupportingDocumentListInstance)(this); + return this._supportingDocuments; + } + /** Getter for supportingDocumentTypes resource */ + get supportingDocumentTypes() { + this._supportingDocumentTypes = + this._supportingDocumentTypes || (0, supportingDocumentType_1.SupportingDocumentTypeListInstance)(this); + return this._supportingDocumentTypes; + } + /** Getter for trustProducts resource */ + get trustProducts() { + this._trustProducts = + this._trustProducts || (0, trustProducts_1.TrustProductsListInstance)(this); + return this._trustProducts; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/complianceInquiries.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/complianceInquiries.d.ts new file mode 100644 index 00000000..06d46943 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/complianceInquiries.d.ts @@ -0,0 +1,127 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to update a ComplianceInquiriesInstance + */ +export interface ComplianceInquiriesContextUpdateOptions { + /** The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. */ + primaryProfileSid: string; +} +/** + * Options to pass to create a ComplianceInquiriesInstance + */ +export interface ComplianceInquiriesListInstanceCreateOptions { + /** The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. */ + primaryProfileSid: string; + /** The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. */ + notificationEmail?: string; +} +export interface ComplianceInquiriesContext { + /** + * Update a ComplianceInquiriesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ComplianceInquiriesInstance + */ + update(params: ComplianceInquiriesContextUpdateOptions, callback?: (error: Error | null, item?: ComplianceInquiriesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ComplianceInquiriesContextSolution { + customerId: string; +} +export declare class ComplianceInquiriesContextImpl implements ComplianceInquiriesContext { + protected _version: V1; + protected _solution: ComplianceInquiriesContextSolution; + protected _uri: string; + constructor(_version: V1, customerId: string); + update(params: ComplianceInquiriesContextUpdateOptions, callback?: (error: Error | null, item?: ComplianceInquiriesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ComplianceInquiriesContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ComplianceInquiriesResource { + inquiry_id: string; + inquiry_session_token: string; + customer_id: string; + url: string; +} +export declare class ComplianceInquiriesInstance { + protected _version: V1; + protected _solution: ComplianceInquiriesContextSolution; + protected _context?: ComplianceInquiriesContext; + constructor(_version: V1, payload: ComplianceInquiriesResource, customerId?: string); + /** + * The unique ID used to start an embedded compliance registration session. + */ + inquiryId: string; + /** + * The session token used to start an embedded compliance registration session. + */ + inquirySessionToken: string; + /** + * The CustomerID matching the Customer Profile that should be resumed or resubmitted for editing. + */ + customerId: string; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Update a ComplianceInquiriesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ComplianceInquiriesInstance + */ + update(params: ComplianceInquiriesContextUpdateOptions, callback?: (error: Error | null, item?: ComplianceInquiriesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + inquiryId: string; + inquirySessionToken: string; + customerId: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ComplianceInquiriesSolution { +} +export interface ComplianceInquiriesListInstance { + _version: V1; + _solution: ComplianceInquiriesSolution; + _uri: string; + (customerId: string): ComplianceInquiriesContext; + get(customerId: string): ComplianceInquiriesContext; + /** + * Create a ComplianceInquiriesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ComplianceInquiriesInstance + */ + create(params: ComplianceInquiriesListInstanceCreateOptions, callback?: (error: Error | null, item?: ComplianceInquiriesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ComplianceInquiriesListInstance(version: V1): ComplianceInquiriesListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/complianceInquiries.js b/node_modules/twilio/lib/rest/trusthub/v1/complianceInquiries.js new file mode 100644 index 00000000..23ad9fe6 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/complianceInquiries.js @@ -0,0 +1,142 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ComplianceInquiriesListInstance = exports.ComplianceInquiriesInstance = exports.ComplianceInquiriesContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class ComplianceInquiriesContextImpl { + constructor(_version, customerId) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(customerId)) { + throw new Error("Parameter 'customerId' is not valid."); + } + this._solution = { customerId }; + this._uri = `/ComplianceInquiries/Customers/${customerId}/Initialize`; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["primaryProfileSid"] === null || + params["primaryProfileSid"] === undefined) { + throw new Error("Required parameter \"params['primaryProfileSid']\" missing."); + } + let data = {}; + data["PrimaryProfileSid"] = params["primaryProfileSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ComplianceInquiriesInstance(operationVersion, payload, instance._solution.customerId)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ComplianceInquiriesContextImpl = ComplianceInquiriesContextImpl; +class ComplianceInquiriesInstance { + constructor(_version, payload, customerId) { + this._version = _version; + this.inquiryId = payload.inquiry_id; + this.inquirySessionToken = payload.inquiry_session_token; + this.customerId = payload.customer_id; + this.url = payload.url; + this._solution = { customerId: customerId || this.customerId }; + } + get _proxy() { + this._context = + this._context || + new ComplianceInquiriesContextImpl(this._version, this._solution.customerId); + return this._context; + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + inquiryId: this.inquiryId, + inquirySessionToken: this.inquirySessionToken, + customerId: this.customerId, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ComplianceInquiriesInstance = ComplianceInquiriesInstance; +function ComplianceInquiriesListInstance(version) { + const instance = ((customerId) => instance.get(customerId)); + instance.get = function get(customerId) { + return new ComplianceInquiriesContextImpl(version, customerId); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/ComplianceInquiries/Customers/Initialize`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["primaryProfileSid"] === null || + params["primaryProfileSid"] === undefined) { + throw new Error("Required parameter \"params['primaryProfileSid']\" missing."); + } + let data = {}; + data["PrimaryProfileSid"] = params["primaryProfileSid"]; + if (params["notificationEmail"] !== undefined) + data["NotificationEmail"] = params["notificationEmail"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ComplianceInquiriesInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ComplianceInquiriesListInstance = ComplianceInquiriesListInstance; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/complianceRegistrationInquiries.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/complianceRegistrationInquiries.d.ts new file mode 100644 index 00000000..64092deb --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/complianceRegistrationInquiries.d.ts @@ -0,0 +1,132 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export type ComplianceRegistrationInquiriesBusinessIdentityType = "direct_customer" | "isv_reseller_or_partner" | "unknown"; +export type ComplianceRegistrationInquiriesEndUserType = "Individual" | "Business"; +export type ComplianceRegistrationInquiriesPhoneNumberType = "local" | "national" | "mobile" | "toll-free"; +/** + * Options to pass to create a ComplianceRegistrationInquiriesInstance + */ +export interface ComplianceRegistrationInquiriesListInstanceCreateOptions { + /** */ + endUserType: ComplianceRegistrationInquiriesEndUserType; + /** */ + phoneNumberType: ComplianceRegistrationInquiriesPhoneNumberType; + /** */ + businessIdentityType?: ComplianceRegistrationInquiriesBusinessIdentityType; + /** The authority that registered the business */ + businessRegistrationAuthority?: string; + /** he name of the business or organization using the Tollfree number. */ + businessLegalName?: string; + /** he email address to receive the notification about the verification result. */ + notificationEmail?: string; + /** The email address to receive the notification about the verification result. */ + acceptedNotificationReceipt?: boolean; + /** Business registration number of the business */ + businessRegistrationNumber?: string; + /** The URL of the business website */ + businessWebsiteUrl?: string; + /** Friendly name for your business information */ + friendlyName?: string; + /** First name of the authorized representative */ + authorizedRepresentative1FirstName?: string; + /** Last name of the authorized representative */ + authorizedRepresentative1LastName?: string; + /** Phone number of the authorized representative */ + authorizedRepresentative1Phone?: string; + /** Email address of the authorized representative */ + authorizedRepresentative1Email?: string; + /** Birthdate of the authorized representative */ + authorizedRepresentative1DateOfBirth?: string; + /** Street address of the business */ + addressStreet?: string; + /** Street address of the business */ + addressStreetSecondary?: string; + /** City of the business */ + addressCity?: string; + /** State or province of the business */ + addressSubdivision?: string; + /** Postal code of the business */ + addressPostalCode?: string; + /** Country code of the business */ + addressCountryCode?: string; + /** Street address of the business */ + emergencyAddressStreet?: string; + /** Street address of the business */ + emergencyAddressStreetSecondary?: string; + /** City of the business */ + emergencyAddressCity?: string; + /** State or province of the business */ + emergencyAddressSubdivision?: string; + /** Postal code of the business */ + emergencyAddressPostalCode?: string; + /** Country code of the business */ + emergencyAddressCountryCode?: string; + /** Use the business address as the emergency address */ + useAddressAsEmergencyAddress?: boolean; + /** The name of the verification document to upload */ + fileName?: string; + /** The verification document to upload */ + file?: string; +} +export interface ComplianceRegistrationInquiriesSolution { +} +export interface ComplianceRegistrationInquiriesListInstance { + _version: V1; + _solution: ComplianceRegistrationInquiriesSolution; + _uri: string; + /** + * Create a ComplianceRegistrationInquiriesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ComplianceRegistrationInquiriesInstance + */ + create(params: ComplianceRegistrationInquiriesListInstanceCreateOptions, callback?: (error: Error | null, item?: ComplianceRegistrationInquiriesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ComplianceRegistrationInquiriesListInstance(version: V1): ComplianceRegistrationInquiriesListInstance; +interface ComplianceRegistrationInquiriesResource { + inquiry_id: string; + inquiry_session_token: string; + registration_id: string; + url: string; +} +export declare class ComplianceRegistrationInquiriesInstance { + protected _version: V1; + constructor(_version: V1, payload: ComplianceRegistrationInquiriesResource); + /** + * The unique ID used to start an embedded compliance registration session. + */ + inquiryId: string; + /** + * The session token used to start an embedded compliance registration session. + */ + inquirySessionToken: string; + /** + * The RegistrationId matching the Registration Profile that should be resumed or resubmitted for editing. + */ + registrationId: string; + /** + * The URL of this resource. + */ + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + inquiryId: string; + inquirySessionToken: string; + registrationId: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/complianceRegistrationInquiries.js b/node_modules/twilio/lib/rest/trusthub/v1/complianceRegistrationInquiries.js new file mode 100644 index 00000000..0867c7b5 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/complianceRegistrationInquiries.js @@ -0,0 +1,150 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ComplianceRegistrationInquiriesInstance = exports.ComplianceRegistrationInquiriesListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function ComplianceRegistrationInquiriesListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/ComplianceInquiries/Registration/RegulatoryCompliance/GB/Initialize`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["endUserType"] === null || params["endUserType"] === undefined) { + throw new Error("Required parameter \"params['endUserType']\" missing."); + } + if (params["phoneNumberType"] === null || + params["phoneNumberType"] === undefined) { + throw new Error("Required parameter \"params['phoneNumberType']\" missing."); + } + let data = {}; + data["EndUserType"] = params["endUserType"]; + data["PhoneNumberType"] = params["phoneNumberType"]; + if (params["businessIdentityType"] !== undefined) + data["BusinessIdentityType"] = params["businessIdentityType"]; + if (params["businessRegistrationAuthority"] !== undefined) + data["BusinessRegistrationAuthority"] = + params["businessRegistrationAuthority"]; + if (params["businessLegalName"] !== undefined) + data["BusinessLegalName"] = params["businessLegalName"]; + if (params["notificationEmail"] !== undefined) + data["NotificationEmail"] = params["notificationEmail"]; + if (params["acceptedNotificationReceipt"] !== undefined) + data["AcceptedNotificationReceipt"] = serialize.bool(params["acceptedNotificationReceipt"]); + if (params["businessRegistrationNumber"] !== undefined) + data["BusinessRegistrationNumber"] = params["businessRegistrationNumber"]; + if (params["businessWebsiteUrl"] !== undefined) + data["BusinessWebsiteUrl"] = params["businessWebsiteUrl"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["authorizedRepresentative1FirstName"] !== undefined) + data["AuthorizedRepresentative1FirstName"] = + params["authorizedRepresentative1FirstName"]; + if (params["authorizedRepresentative1LastName"] !== undefined) + data["AuthorizedRepresentative1LastName"] = + params["authorizedRepresentative1LastName"]; + if (params["authorizedRepresentative1Phone"] !== undefined) + data["AuthorizedRepresentative1Phone"] = + params["authorizedRepresentative1Phone"]; + if (params["authorizedRepresentative1Email"] !== undefined) + data["AuthorizedRepresentative1Email"] = + params["authorizedRepresentative1Email"]; + if (params["authorizedRepresentative1DateOfBirth"] !== undefined) + data["AuthorizedRepresentative1DateOfBirth"] = + params["authorizedRepresentative1DateOfBirth"]; + if (params["addressStreet"] !== undefined) + data["AddressStreet"] = params["addressStreet"]; + if (params["addressStreetSecondary"] !== undefined) + data["AddressStreetSecondary"] = params["addressStreetSecondary"]; + if (params["addressCity"] !== undefined) + data["AddressCity"] = params["addressCity"]; + if (params["addressSubdivision"] !== undefined) + data["AddressSubdivision"] = params["addressSubdivision"]; + if (params["addressPostalCode"] !== undefined) + data["AddressPostalCode"] = params["addressPostalCode"]; + if (params["addressCountryCode"] !== undefined) + data["AddressCountryCode"] = params["addressCountryCode"]; + if (params["emergencyAddressStreet"] !== undefined) + data["EmergencyAddressStreet"] = params["emergencyAddressStreet"]; + if (params["emergencyAddressStreetSecondary"] !== undefined) + data["EmergencyAddressStreetSecondary"] = + params["emergencyAddressStreetSecondary"]; + if (params["emergencyAddressCity"] !== undefined) + data["EmergencyAddressCity"] = params["emergencyAddressCity"]; + if (params["emergencyAddressSubdivision"] !== undefined) + data["EmergencyAddressSubdivision"] = + params["emergencyAddressSubdivision"]; + if (params["emergencyAddressPostalCode"] !== undefined) + data["EmergencyAddressPostalCode"] = params["emergencyAddressPostalCode"]; + if (params["emergencyAddressCountryCode"] !== undefined) + data["EmergencyAddressCountryCode"] = + params["emergencyAddressCountryCode"]; + if (params["useAddressAsEmergencyAddress"] !== undefined) + data["UseAddressAsEmergencyAddress"] = serialize.bool(params["useAddressAsEmergencyAddress"]); + if (params["fileName"] !== undefined) + data["FileName"] = params["fileName"]; + if (params["file"] !== undefined) + data["File"] = params["file"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ComplianceRegistrationInquiriesInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ComplianceRegistrationInquiriesListInstance = ComplianceRegistrationInquiriesListInstance; +class ComplianceRegistrationInquiriesInstance { + constructor(_version, payload) { + this._version = _version; + this.inquiryId = payload.inquiry_id; + this.inquirySessionToken = payload.inquiry_session_token; + this.registrationId = payload.registration_id; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + inquiryId: this.inquiryId, + inquirySessionToken: this.inquirySessionToken, + registrationId: this.registrationId, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ComplianceRegistrationInquiriesInstance = ComplianceRegistrationInquiriesInstance; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts new file mode 100644 index 00000000..97d0c2c7 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts @@ -0,0 +1,112 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export type ComplianceTollfreeInquiriesOptInType = "VERBAL" | "WEB_FORM" | "PAPER_FORM" | "VIA_TEXT" | "MOBILE_QR_CODE"; +/** + * Options to pass to create a ComplianceTollfreeInquiriesInstance + */ +export interface ComplianceTollfreeInquiriesListInstanceCreateOptions { + /** The Tollfree phone number to be verified */ + tollfreePhoneNumber: string; + /** The email address to receive the notification about the verification result. */ + notificationEmail: string; + /** The name of the business or organization using the Tollfree number. */ + businessName?: string; + /** The website of the business or organization using the Tollfree number. */ + businessWebsite?: string; + /** The category of the use case for the Tollfree Number. List as many are applicable.. */ + useCaseCategories?: Array; + /** Use this to further explain how messaging is used by the business or organization. */ + useCaseSummary?: string; + /** An example of message content, i.e. a sample message. */ + productionMessageSample?: string; + /** Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. */ + optInImageUrls?: Array; + /** */ + optInType?: ComplianceTollfreeInquiriesOptInType; + /** Estimate monthly volume of messages from the Tollfree Number. */ + messageVolume?: string; + /** The address of the business or organization using the Tollfree number. */ + businessStreetAddress?: string; + /** The address of the business or organization using the Tollfree number. */ + businessStreetAddress2?: string; + /** The city of the business or organization using the Tollfree number. */ + businessCity?: string; + /** The state/province/region of the business or organization using the Tollfree number. */ + businessStateProvinceRegion?: string; + /** The postal code of the business or organization using the Tollfree number. */ + businessPostalCode?: string; + /** The country of the business or organization using the Tollfree number. */ + businessCountry?: string; + /** Additional information to be provided for verification. */ + additionalInformation?: string; + /** The first name of the contact for the business or organization using the Tollfree number. */ + businessContactFirstName?: string; + /** The last name of the contact for the business or organization using the Tollfree number. */ + businessContactLastName?: string; + /** The email address of the contact for the business or organization using the Tollfree number. */ + businessContactEmail?: string; + /** The phone number of the contact for the business or organization using the Tollfree number. */ + businessContactPhone?: string; +} +export interface ComplianceTollfreeInquiriesSolution { +} +export interface ComplianceTollfreeInquiriesListInstance { + _version: V1; + _solution: ComplianceTollfreeInquiriesSolution; + _uri: string; + /** + * Create a ComplianceTollfreeInquiriesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ComplianceTollfreeInquiriesInstance + */ + create(params: ComplianceTollfreeInquiriesListInstanceCreateOptions, callback?: (error: Error | null, item?: ComplianceTollfreeInquiriesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ComplianceTollfreeInquiriesListInstance(version: V1): ComplianceTollfreeInquiriesListInstance; +interface ComplianceTollfreeInquiriesResource { + inquiry_id: string; + inquiry_session_token: string; + registration_id: string; + url: string; +} +export declare class ComplianceTollfreeInquiriesInstance { + protected _version: V1; + constructor(_version: V1, payload: ComplianceTollfreeInquiriesResource); + /** + * The unique ID used to start an embedded compliance registration session. + */ + inquiryId: string; + /** + * The session token used to start an embedded compliance registration session. + */ + inquirySessionToken: string; + /** + * The TolfreeId matching the Tollfree Profile that should be resumed or resubmitted for editing. + */ + registrationId: string; + /** + * The URL of this resource. + */ + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + inquiryId: string; + inquirySessionToken: string; + registrationId: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/complianceTollfreeInquiries.js b/node_modules/twilio/lib/rest/trusthub/v1/complianceTollfreeInquiries.js new file mode 100644 index 00000000..7553cad0 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/complianceTollfreeInquiries.js @@ -0,0 +1,125 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ComplianceTollfreeInquiriesInstance = exports.ComplianceTollfreeInquiriesListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function ComplianceTollfreeInquiriesListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/ComplianceInquiries/Tollfree/Initialize`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["tollfreePhoneNumber"] === null || + params["tollfreePhoneNumber"] === undefined) { + throw new Error("Required parameter \"params['tollfreePhoneNumber']\" missing."); + } + if (params["notificationEmail"] === null || + params["notificationEmail"] === undefined) { + throw new Error("Required parameter \"params['notificationEmail']\" missing."); + } + let data = {}; + data["TollfreePhoneNumber"] = params["tollfreePhoneNumber"]; + data["NotificationEmail"] = params["notificationEmail"]; + if (params["businessName"] !== undefined) + data["BusinessName"] = params["businessName"]; + if (params["businessWebsite"] !== undefined) + data["BusinessWebsite"] = params["businessWebsite"]; + if (params["useCaseCategories"] !== undefined) + data["UseCaseCategories"] = serialize.map(params["useCaseCategories"], (e) => e); + if (params["useCaseSummary"] !== undefined) + data["UseCaseSummary"] = params["useCaseSummary"]; + if (params["productionMessageSample"] !== undefined) + data["ProductionMessageSample"] = params["productionMessageSample"]; + if (params["optInImageUrls"] !== undefined) + data["OptInImageUrls"] = serialize.map(params["optInImageUrls"], (e) => e); + if (params["optInType"] !== undefined) + data["OptInType"] = params["optInType"]; + if (params["messageVolume"] !== undefined) + data["MessageVolume"] = params["messageVolume"]; + if (params["businessStreetAddress"] !== undefined) + data["BusinessStreetAddress"] = params["businessStreetAddress"]; + if (params["businessStreetAddress2"] !== undefined) + data["BusinessStreetAddress2"] = params["businessStreetAddress2"]; + if (params["businessCity"] !== undefined) + data["BusinessCity"] = params["businessCity"]; + if (params["businessStateProvinceRegion"] !== undefined) + data["BusinessStateProvinceRegion"] = + params["businessStateProvinceRegion"]; + if (params["businessPostalCode"] !== undefined) + data["BusinessPostalCode"] = params["businessPostalCode"]; + if (params["businessCountry"] !== undefined) + data["BusinessCountry"] = params["businessCountry"]; + if (params["additionalInformation"] !== undefined) + data["AdditionalInformation"] = params["additionalInformation"]; + if (params["businessContactFirstName"] !== undefined) + data["BusinessContactFirstName"] = params["businessContactFirstName"]; + if (params["businessContactLastName"] !== undefined) + data["BusinessContactLastName"] = params["businessContactLastName"]; + if (params["businessContactEmail"] !== undefined) + data["BusinessContactEmail"] = params["businessContactEmail"]; + if (params["businessContactPhone"] !== undefined) + data["BusinessContactPhone"] = params["businessContactPhone"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ComplianceTollfreeInquiriesInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ComplianceTollfreeInquiriesListInstance = ComplianceTollfreeInquiriesListInstance; +class ComplianceTollfreeInquiriesInstance { + constructor(_version, payload) { + this._version = _version; + this.inquiryId = payload.inquiry_id; + this.inquirySessionToken = payload.inquiry_session_token; + this.registrationId = payload.registration_id; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + inquiryId: this.inquiryId, + inquirySessionToken: this.inquirySessionToken, + registrationId: this.registrationId, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ComplianceTollfreeInquiriesInstance = ComplianceTollfreeInquiriesInstance; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles.d.ts new file mode 100644 index 00000000..d821c33f --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles.d.ts @@ -0,0 +1,380 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { CustomerProfilesChannelEndpointAssignmentListInstance } from "./customerProfiles/customerProfilesChannelEndpointAssignment"; +import { CustomerProfilesEntityAssignmentsListInstance } from "./customerProfiles/customerProfilesEntityAssignments"; +import { CustomerProfilesEvaluationsListInstance } from "./customerProfiles/customerProfilesEvaluations"; +export type CustomerProfilesStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved"; +/** + * Options to pass to update a CustomerProfilesInstance + */ +export interface CustomerProfilesContextUpdateOptions { + /** */ + status?: CustomerProfilesStatus; + /** The URL we call to inform your application of status changes. */ + statusCallback?: string; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The email address that will receive updates when the Customer-Profile resource changes status. */ + email?: string; +} +/** + * Options to pass to create a CustomerProfilesInstance + */ +export interface CustomerProfilesListInstanceCreateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName: string; + /** The email address that will receive updates when the Customer-Profile resource changes status. */ + email: string; + /** The unique string of a policy that is associated to the Customer-Profile resource. */ + policySid: string; + /** The URL we call to inform your application of status changes. */ + statusCallback?: string; +} +/** + * Options to pass to each + */ +export interface CustomerProfilesListInstanceEachOptions { + /** The verification status of the Customer-Profile resource. */ + status?: CustomerProfilesStatus; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The unique string of a policy that is associated to the Customer-Profile resource. */ + policySid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CustomerProfilesInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CustomerProfilesListInstanceOptions { + /** The verification status of the Customer-Profile resource. */ + status?: CustomerProfilesStatus; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The unique string of a policy that is associated to the Customer-Profile resource. */ + policySid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CustomerProfilesListInstancePageOptions { + /** The verification status of the Customer-Profile resource. */ + status?: CustomerProfilesStatus; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The unique string of a policy that is associated to the Customer-Profile resource. */ + policySid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CustomerProfilesContext { + customerProfilesChannelEndpointAssignment: CustomerProfilesChannelEndpointAssignmentListInstance; + customerProfilesEntityAssignments: CustomerProfilesEntityAssignmentsListInstance; + customerProfilesEvaluations: CustomerProfilesEvaluationsListInstance; + /** + * Remove a CustomerProfilesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CustomerProfilesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesInstance + */ + fetch(callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + /** + * Update a CustomerProfilesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesInstance + */ + update(callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + /** + * Update a CustomerProfilesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesInstance + */ + update(params: CustomerProfilesContextUpdateOptions, callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CustomerProfilesContextSolution { + sid: string; +} +export declare class CustomerProfilesContextImpl implements CustomerProfilesContext { + protected _version: V1; + protected _solution: CustomerProfilesContextSolution; + protected _uri: string; + protected _customerProfilesChannelEndpointAssignment?: CustomerProfilesChannelEndpointAssignmentListInstance; + protected _customerProfilesEntityAssignments?: CustomerProfilesEntityAssignmentsListInstance; + protected _customerProfilesEvaluations?: CustomerProfilesEvaluationsListInstance; + constructor(_version: V1, sid: string); + get customerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentListInstance; + get customerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsListInstance; + get customerProfilesEvaluations(): CustomerProfilesEvaluationsListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + update(params?: CustomerProfilesContextUpdateOptions | ((error: Error | null, item?: CustomerProfilesInstance) => any), callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CustomerProfilesContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CustomerProfilesPayload extends TwilioResponsePayload { + results: CustomerProfilesResource[]; +} +interface CustomerProfilesResource { + sid: string; + account_sid: string; + policy_sid: string; + friendly_name: string; + status: CustomerProfilesStatus; + valid_until: Date; + email: string; + status_callback: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class CustomerProfilesInstance { + protected _version: V1; + protected _solution: CustomerProfilesContextSolution; + protected _context?: CustomerProfilesContext; + constructor(_version: V1, payload: CustomerProfilesResource, sid?: string); + /** + * The unique string that we created to identify the Customer-Profile resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Customer-Profile resource. + */ + accountSid: string; + /** + * The unique string of a policy that is associated to the Customer-Profile resource. + */ + policySid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + status: CustomerProfilesStatus; + /** + * The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until. + */ + validUntil: Date; + /** + * The email address that will receive updates when the Customer-Profile resource changes status. + */ + email: string; + /** + * The URL we call to inform your application of status changes. + */ + statusCallback: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Customer-Profile resource. + */ + url: string; + /** + * The URLs of the Assigned Items of the Customer-Profile resource. + */ + links: Record; + private get _proxy(); + /** + * Remove a CustomerProfilesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CustomerProfilesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesInstance + */ + fetch(callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + /** + * Update a CustomerProfilesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesInstance + */ + update(callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + /** + * Update a CustomerProfilesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesInstance + */ + update(params: CustomerProfilesContextUpdateOptions, callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + /** + * Access the customerProfilesChannelEndpointAssignment. + */ + customerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentListInstance; + /** + * Access the customerProfilesEntityAssignments. + */ + customerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsListInstance; + /** + * Access the customerProfilesEvaluations. + */ + customerProfilesEvaluations(): CustomerProfilesEvaluationsListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + policySid: string; + friendlyName: string; + status: CustomerProfilesStatus; + validUntil: Date; + email: string; + statusCallback: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CustomerProfilesSolution { +} +export interface CustomerProfilesListInstance { + _version: V1; + _solution: CustomerProfilesSolution; + _uri: string; + (sid: string): CustomerProfilesContext; + get(sid: string): CustomerProfilesContext; + /** + * Create a CustomerProfilesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesInstance + */ + create(params: CustomerProfilesListInstanceCreateOptions, callback?: (error: Error | null, item?: CustomerProfilesInstance) => any): Promise; + /** + * Streams CustomerProfilesInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CustomerProfilesInstance, done: (err?: Error) => void) => void): void; + each(params: CustomerProfilesListInstanceEachOptions, callback?: (item: CustomerProfilesInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CustomerProfilesInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CustomerProfilesPage) => any): Promise; + /** + * Lists CustomerProfilesInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CustomerProfilesInstance[]) => any): Promise; + list(params: CustomerProfilesListInstanceOptions, callback?: (error: Error | null, items: CustomerProfilesInstance[]) => any): Promise; + /** + * Retrieve a single page of CustomerProfilesInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CustomerProfilesPage) => any): Promise; + page(params: CustomerProfilesListInstancePageOptions, callback?: (error: Error | null, items: CustomerProfilesPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CustomerProfilesListInstance(version: V1): CustomerProfilesListInstance; +export declare class CustomerProfilesPage extends Page { + /** + * Initialize the CustomerProfilesPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CustomerProfilesSolution); + /** + * Build an instance of CustomerProfilesInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CustomerProfilesResource): CustomerProfilesInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles.js b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles.js new file mode 100644 index 00000000..161e41f0 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles.js @@ -0,0 +1,322 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CustomerProfilesPage = exports.CustomerProfilesListInstance = exports.CustomerProfilesInstance = exports.CustomerProfilesContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const customerProfilesChannelEndpointAssignment_1 = require("./customerProfiles/customerProfilesChannelEndpointAssignment"); +const customerProfilesEntityAssignments_1 = require("./customerProfiles/customerProfilesEntityAssignments"); +const customerProfilesEvaluations_1 = require("./customerProfiles/customerProfilesEvaluations"); +class CustomerProfilesContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/CustomerProfiles/${sid}`; + } + get customerProfilesChannelEndpointAssignment() { + this._customerProfilesChannelEndpointAssignment = + this._customerProfilesChannelEndpointAssignment || + (0, customerProfilesChannelEndpointAssignment_1.CustomerProfilesChannelEndpointAssignmentListInstance)(this._version, this._solution.sid); + return this._customerProfilesChannelEndpointAssignment; + } + get customerProfilesEntityAssignments() { + this._customerProfilesEntityAssignments = + this._customerProfilesEntityAssignments || + (0, customerProfilesEntityAssignments_1.CustomerProfilesEntityAssignmentsListInstance)(this._version, this._solution.sid); + return this._customerProfilesEntityAssignments; + } + get customerProfilesEvaluations() { + this._customerProfilesEvaluations = + this._customerProfilesEvaluations || + (0, customerProfilesEvaluations_1.CustomerProfilesEvaluationsListInstance)(this._version, this._solution.sid); + return this._customerProfilesEvaluations; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesContextImpl = CustomerProfilesContextImpl; +class CustomerProfilesInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.policySid = payload.policy_sid; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.validUntil = deserialize.iso8601DateTime(payload.valid_until); + this.email = payload.email; + this.statusCallback = payload.status_callback; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CustomerProfilesContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CustomerProfilesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CustomerProfilesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the customerProfilesChannelEndpointAssignment. + */ + customerProfilesChannelEndpointAssignment() { + return this._proxy.customerProfilesChannelEndpointAssignment; + } + /** + * Access the customerProfilesEntityAssignments. + */ + customerProfilesEntityAssignments() { + return this._proxy.customerProfilesEntityAssignments; + } + /** + * Access the customerProfilesEvaluations. + */ + customerProfilesEvaluations() { + return this._proxy.customerProfilesEvaluations; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + policySid: this.policySid, + friendlyName: this.friendlyName, + status: this.status, + validUntil: this.validUntil, + email: this.email, + statusCallback: this.statusCallback, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesInstance = CustomerProfilesInstance; +function CustomerProfilesListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CustomerProfilesContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/CustomerProfiles`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["email"] === null || params["email"] === undefined) { + throw new Error("Required parameter \"params['email']\" missing."); + } + if (params["policySid"] === null || params["policySid"] === undefined) { + throw new Error("Required parameter \"params['policySid']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Email"] = params["email"]; + data["PolicySid"] = params["policySid"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["policySid"] !== undefined) + data["PolicySid"] = params["policySid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CustomerProfilesPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CustomerProfilesListInstance = CustomerProfilesListInstance; +class CustomerProfilesPage extends Page_1.default { + /** + * Initialize the CustomerProfilesPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CustomerProfilesInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CustomerProfilesInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesPage = CustomerProfilesPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.d.ts new file mode 100644 index 00000000..a61d8cac --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.d.ts @@ -0,0 +1,272 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a CustomerProfilesChannelEndpointAssignmentInstance + */ +export interface CustomerProfilesChannelEndpointAssignmentListInstanceCreateOptions { + /** The type of channel endpoint. eg: phone-number */ + channelEndpointType: string; + /** The SID of an channel endpoint */ + channelEndpointSid: string; +} +/** + * Options to pass to each + */ +export interface CustomerProfilesChannelEndpointAssignmentListInstanceEachOptions { + /** The SID of an channel endpoint */ + channelEndpointSid?: string; + /** comma separated list of channel endpoint sids */ + channelEndpointSids?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CustomerProfilesChannelEndpointAssignmentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CustomerProfilesChannelEndpointAssignmentListInstanceOptions { + /** The SID of an channel endpoint */ + channelEndpointSid?: string; + /** comma separated list of channel endpoint sids */ + channelEndpointSids?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CustomerProfilesChannelEndpointAssignmentListInstancePageOptions { + /** The SID of an channel endpoint */ + channelEndpointSid?: string; + /** comma separated list of channel endpoint sids */ + channelEndpointSids?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CustomerProfilesChannelEndpointAssignmentContext { + /** + * Remove a CustomerProfilesChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CustomerProfilesChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesChannelEndpointAssignmentInstance + */ + fetch(callback?: (error: Error | null, item?: CustomerProfilesChannelEndpointAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CustomerProfilesChannelEndpointAssignmentContextSolution { + customerProfileSid: string; + sid: string; +} +export declare class CustomerProfilesChannelEndpointAssignmentContextImpl implements CustomerProfilesChannelEndpointAssignmentContext { + protected _version: V1; + protected _solution: CustomerProfilesChannelEndpointAssignmentContextSolution; + protected _uri: string; + constructor(_version: V1, customerProfileSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CustomerProfilesChannelEndpointAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CustomerProfilesChannelEndpointAssignmentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CustomerProfilesChannelEndpointAssignmentPayload extends TwilioResponsePayload { + results: CustomerProfilesChannelEndpointAssignmentResource[]; +} +interface CustomerProfilesChannelEndpointAssignmentResource { + sid: string; + customer_profile_sid: string; + account_sid: string; + channel_endpoint_type: string; + channel_endpoint_sid: string; + date_created: Date; + url: string; +} +export declare class CustomerProfilesChannelEndpointAssignmentInstance { + protected _version: V1; + protected _solution: CustomerProfilesChannelEndpointAssignmentContextSolution; + protected _context?: CustomerProfilesChannelEndpointAssignmentContext; + constructor(_version: V1, payload: CustomerProfilesChannelEndpointAssignmentResource, customerProfileSid: string, sid?: string); + /** + * The unique string that we created to identify the Item Assignment resource. + */ + sid: string; + /** + * The unique string that we created to identify the CustomerProfile resource. + */ + customerProfileSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Item Assignment resource. + */ + accountSid: string; + /** + * The type of channel endpoint. eg: phone-number + */ + channelEndpointType: string; + /** + * The SID of an channel endpoint + */ + channelEndpointSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The absolute URL of the Identity resource. + */ + url: string; + private get _proxy(); + /** + * Remove a CustomerProfilesChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CustomerProfilesChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesChannelEndpointAssignmentInstance + */ + fetch(callback?: (error: Error | null, item?: CustomerProfilesChannelEndpointAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + customerProfileSid: string; + accountSid: string; + channelEndpointType: string; + channelEndpointSid: string; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CustomerProfilesChannelEndpointAssignmentSolution { + customerProfileSid: string; +} +export interface CustomerProfilesChannelEndpointAssignmentListInstance { + _version: V1; + _solution: CustomerProfilesChannelEndpointAssignmentSolution; + _uri: string; + (sid: string): CustomerProfilesChannelEndpointAssignmentContext; + get(sid: string): CustomerProfilesChannelEndpointAssignmentContext; + /** + * Create a CustomerProfilesChannelEndpointAssignmentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesChannelEndpointAssignmentInstance + */ + create(params: CustomerProfilesChannelEndpointAssignmentListInstanceCreateOptions, callback?: (error: Error | null, item?: CustomerProfilesChannelEndpointAssignmentInstance) => any): Promise; + /** + * Streams CustomerProfilesChannelEndpointAssignmentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesChannelEndpointAssignmentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CustomerProfilesChannelEndpointAssignmentInstance, done: (err?: Error) => void) => void): void; + each(params: CustomerProfilesChannelEndpointAssignmentListInstanceEachOptions, callback?: (item: CustomerProfilesChannelEndpointAssignmentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CustomerProfilesChannelEndpointAssignmentPage) => any): Promise; + /** + * Lists CustomerProfilesChannelEndpointAssignmentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesChannelEndpointAssignmentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CustomerProfilesChannelEndpointAssignmentInstance[]) => any): Promise; + list(params: CustomerProfilesChannelEndpointAssignmentListInstanceOptions, callback?: (error: Error | null, items: CustomerProfilesChannelEndpointAssignmentInstance[]) => any): Promise; + /** + * Retrieve a single page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesChannelEndpointAssignmentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CustomerProfilesChannelEndpointAssignmentPage) => any): Promise; + page(params: CustomerProfilesChannelEndpointAssignmentListInstancePageOptions, callback?: (error: Error | null, items: CustomerProfilesChannelEndpointAssignmentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CustomerProfilesChannelEndpointAssignmentListInstance(version: V1, customerProfileSid: string): CustomerProfilesChannelEndpointAssignmentListInstance; +export declare class CustomerProfilesChannelEndpointAssignmentPage extends Page { + /** + * Initialize the CustomerProfilesChannelEndpointAssignmentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CustomerProfilesChannelEndpointAssignmentSolution); + /** + * Build an instance of CustomerProfilesChannelEndpointAssignmentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CustomerProfilesChannelEndpointAssignmentResource): CustomerProfilesChannelEndpointAssignmentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.js b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.js new file mode 100644 index 00000000..b621a164 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.js @@ -0,0 +1,239 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CustomerProfilesChannelEndpointAssignmentPage = exports.CustomerProfilesChannelEndpointAssignmentListInstance = exports.CustomerProfilesChannelEndpointAssignmentInstance = exports.CustomerProfilesChannelEndpointAssignmentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class CustomerProfilesChannelEndpointAssignmentContextImpl { + constructor(_version, customerProfileSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(customerProfileSid)) { + throw new Error("Parameter 'customerProfileSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { customerProfileSid, sid }; + this._uri = `/CustomerProfiles/${customerProfileSid}/ChannelEndpointAssignments/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesChannelEndpointAssignmentInstance(operationVersion, payload, instance._solution.customerProfileSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesChannelEndpointAssignmentContextImpl = CustomerProfilesChannelEndpointAssignmentContextImpl; +class CustomerProfilesChannelEndpointAssignmentInstance { + constructor(_version, payload, customerProfileSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.customerProfileSid = payload.customer_profile_sid; + this.accountSid = payload.account_sid; + this.channelEndpointType = payload.channel_endpoint_type; + this.channelEndpointSid = payload.channel_endpoint_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { customerProfileSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CustomerProfilesChannelEndpointAssignmentContextImpl(this._version, this._solution.customerProfileSid, this._solution.sid); + return this._context; + } + /** + * Remove a CustomerProfilesChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CustomerProfilesChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesChannelEndpointAssignmentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + customerProfileSid: this.customerProfileSid, + accountSid: this.accountSid, + channelEndpointType: this.channelEndpointType, + channelEndpointSid: this.channelEndpointSid, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesChannelEndpointAssignmentInstance = CustomerProfilesChannelEndpointAssignmentInstance; +function CustomerProfilesChannelEndpointAssignmentListInstance(version, customerProfileSid) { + if (!(0, utility_1.isValidPathParam)(customerProfileSid)) { + throw new Error("Parameter 'customerProfileSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CustomerProfilesChannelEndpointAssignmentContextImpl(version, customerProfileSid, sid); + }; + instance._version = version; + instance._solution = { customerProfileSid }; + instance._uri = `/CustomerProfiles/${customerProfileSid}/ChannelEndpointAssignments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["channelEndpointType"] === null || + params["channelEndpointType"] === undefined) { + throw new Error("Required parameter \"params['channelEndpointType']\" missing."); + } + if (params["channelEndpointSid"] === null || + params["channelEndpointSid"] === undefined) { + throw new Error("Required parameter \"params['channelEndpointSid']\" missing."); + } + let data = {}; + data["ChannelEndpointType"] = params["channelEndpointType"]; + data["ChannelEndpointSid"] = params["channelEndpointSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesChannelEndpointAssignmentInstance(operationVersion, payload, instance._solution.customerProfileSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["channelEndpointSid"] !== undefined) + data["ChannelEndpointSid"] = params["channelEndpointSid"]; + if (params["channelEndpointSids"] !== undefined) + data["ChannelEndpointSids"] = params["channelEndpointSids"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesChannelEndpointAssignmentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CustomerProfilesChannelEndpointAssignmentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CustomerProfilesChannelEndpointAssignmentListInstance = CustomerProfilesChannelEndpointAssignmentListInstance; +class CustomerProfilesChannelEndpointAssignmentPage extends Page_1.default { + /** + * Initialize the CustomerProfilesChannelEndpointAssignmentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CustomerProfilesChannelEndpointAssignmentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CustomerProfilesChannelEndpointAssignmentInstance(this._version, payload, this._solution.customerProfileSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesChannelEndpointAssignmentPage = CustomerProfilesChannelEndpointAssignmentPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.d.ts new file mode 100644 index 00000000..99203bb5 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.d.ts @@ -0,0 +1,252 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a CustomerProfilesEntityAssignmentsInstance + */ +export interface CustomerProfilesEntityAssignmentsListInstanceCreateOptions { + /** The SID of an object bag that holds information of the different items. */ + objectSid: string; +} +/** + * Options to pass to each + */ +export interface CustomerProfilesEntityAssignmentsListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CustomerProfilesEntityAssignmentsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CustomerProfilesEntityAssignmentsListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CustomerProfilesEntityAssignmentsListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CustomerProfilesEntityAssignmentsContext { + /** + * Remove a CustomerProfilesEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CustomerProfilesEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesEntityAssignmentsInstance + */ + fetch(callback?: (error: Error | null, item?: CustomerProfilesEntityAssignmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CustomerProfilesEntityAssignmentsContextSolution { + customerProfileSid: string; + sid: string; +} +export declare class CustomerProfilesEntityAssignmentsContextImpl implements CustomerProfilesEntityAssignmentsContext { + protected _version: V1; + protected _solution: CustomerProfilesEntityAssignmentsContextSolution; + protected _uri: string; + constructor(_version: V1, customerProfileSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CustomerProfilesEntityAssignmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CustomerProfilesEntityAssignmentsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CustomerProfilesEntityAssignmentsPayload extends TwilioResponsePayload { + results: CustomerProfilesEntityAssignmentsResource[]; +} +interface CustomerProfilesEntityAssignmentsResource { + sid: string; + customer_profile_sid: string; + account_sid: string; + object_sid: string; + date_created: Date; + url: string; +} +export declare class CustomerProfilesEntityAssignmentsInstance { + protected _version: V1; + protected _solution: CustomerProfilesEntityAssignmentsContextSolution; + protected _context?: CustomerProfilesEntityAssignmentsContext; + constructor(_version: V1, payload: CustomerProfilesEntityAssignmentsResource, customerProfileSid: string, sid?: string); + /** + * The unique string that we created to identify the Item Assignment resource. + */ + sid: string; + /** + * The unique string that we created to identify the CustomerProfile resource. + */ + customerProfileSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Item Assignment resource. + */ + accountSid: string; + /** + * The SID of an object bag that holds information of the different items. + */ + objectSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The absolute URL of the Identity resource. + */ + url: string; + private get _proxy(); + /** + * Remove a CustomerProfilesEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CustomerProfilesEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesEntityAssignmentsInstance + */ + fetch(callback?: (error: Error | null, item?: CustomerProfilesEntityAssignmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + customerProfileSid: string; + accountSid: string; + objectSid: string; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CustomerProfilesEntityAssignmentsSolution { + customerProfileSid: string; +} +export interface CustomerProfilesEntityAssignmentsListInstance { + _version: V1; + _solution: CustomerProfilesEntityAssignmentsSolution; + _uri: string; + (sid: string): CustomerProfilesEntityAssignmentsContext; + get(sid: string): CustomerProfilesEntityAssignmentsContext; + /** + * Create a CustomerProfilesEntityAssignmentsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesEntityAssignmentsInstance + */ + create(params: CustomerProfilesEntityAssignmentsListInstanceCreateOptions, callback?: (error: Error | null, item?: CustomerProfilesEntityAssignmentsInstance) => any): Promise; + /** + * Streams CustomerProfilesEntityAssignmentsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesEntityAssignmentsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CustomerProfilesEntityAssignmentsInstance, done: (err?: Error) => void) => void): void; + each(params: CustomerProfilesEntityAssignmentsListInstanceEachOptions, callback?: (item: CustomerProfilesEntityAssignmentsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CustomerProfilesEntityAssignmentsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CustomerProfilesEntityAssignmentsPage) => any): Promise; + /** + * Lists CustomerProfilesEntityAssignmentsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesEntityAssignmentsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CustomerProfilesEntityAssignmentsInstance[]) => any): Promise; + list(params: CustomerProfilesEntityAssignmentsListInstanceOptions, callback?: (error: Error | null, items: CustomerProfilesEntityAssignmentsInstance[]) => any): Promise; + /** + * Retrieve a single page of CustomerProfilesEntityAssignmentsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesEntityAssignmentsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CustomerProfilesEntityAssignmentsPage) => any): Promise; + page(params: CustomerProfilesEntityAssignmentsListInstancePageOptions, callback?: (error: Error | null, items: CustomerProfilesEntityAssignmentsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CustomerProfilesEntityAssignmentsListInstance(version: V1, customerProfileSid: string): CustomerProfilesEntityAssignmentsListInstance; +export declare class CustomerProfilesEntityAssignmentsPage extends Page { + /** + * Initialize the CustomerProfilesEntityAssignmentsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CustomerProfilesEntityAssignmentsSolution); + /** + * Build an instance of CustomerProfilesEntityAssignmentsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CustomerProfilesEntityAssignmentsResource): CustomerProfilesEntityAssignmentsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.js b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.js new file mode 100644 index 00000000..b5bc8c77 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.js @@ -0,0 +1,227 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CustomerProfilesEntityAssignmentsPage = exports.CustomerProfilesEntityAssignmentsListInstance = exports.CustomerProfilesEntityAssignmentsInstance = exports.CustomerProfilesEntityAssignmentsContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class CustomerProfilesEntityAssignmentsContextImpl { + constructor(_version, customerProfileSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(customerProfileSid)) { + throw new Error("Parameter 'customerProfileSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { customerProfileSid, sid }; + this._uri = `/CustomerProfiles/${customerProfileSid}/EntityAssignments/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesEntityAssignmentsInstance(operationVersion, payload, instance._solution.customerProfileSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesEntityAssignmentsContextImpl = CustomerProfilesEntityAssignmentsContextImpl; +class CustomerProfilesEntityAssignmentsInstance { + constructor(_version, payload, customerProfileSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.customerProfileSid = payload.customer_profile_sid; + this.accountSid = payload.account_sid; + this.objectSid = payload.object_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { customerProfileSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CustomerProfilesEntityAssignmentsContextImpl(this._version, this._solution.customerProfileSid, this._solution.sid); + return this._context; + } + /** + * Remove a CustomerProfilesEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CustomerProfilesEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesEntityAssignmentsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + customerProfileSid: this.customerProfileSid, + accountSid: this.accountSid, + objectSid: this.objectSid, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesEntityAssignmentsInstance = CustomerProfilesEntityAssignmentsInstance; +function CustomerProfilesEntityAssignmentsListInstance(version, customerProfileSid) { + if (!(0, utility_1.isValidPathParam)(customerProfileSid)) { + throw new Error("Parameter 'customerProfileSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CustomerProfilesEntityAssignmentsContextImpl(version, customerProfileSid, sid); + }; + instance._version = version; + instance._solution = { customerProfileSid }; + instance._uri = `/CustomerProfiles/${customerProfileSid}/EntityAssignments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["objectSid"] === null || params["objectSid"] === undefined) { + throw new Error("Required parameter \"params['objectSid']\" missing."); + } + let data = {}; + data["ObjectSid"] = params["objectSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesEntityAssignmentsInstance(operationVersion, payload, instance._solution.customerProfileSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesEntityAssignmentsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CustomerProfilesEntityAssignmentsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CustomerProfilesEntityAssignmentsListInstance = CustomerProfilesEntityAssignmentsListInstance; +class CustomerProfilesEntityAssignmentsPage extends Page_1.default { + /** + * Initialize the CustomerProfilesEntityAssignmentsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CustomerProfilesEntityAssignmentsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CustomerProfilesEntityAssignmentsInstance(this._version, payload, this._solution.customerProfileSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesEntityAssignmentsPage = CustomerProfilesEntityAssignmentsPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.d.ts new file mode 100644 index 00000000..9faa7c17 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.d.ts @@ -0,0 +1,239 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type CustomerProfilesEvaluationsStatus = "compliant" | "noncompliant"; +/** + * Options to pass to create a CustomerProfilesEvaluationsInstance + */ +export interface CustomerProfilesEvaluationsListInstanceCreateOptions { + /** The unique string of a policy that is associated to the customer_profile resource. */ + policySid: string; +} +/** + * Options to pass to each + */ +export interface CustomerProfilesEvaluationsListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CustomerProfilesEvaluationsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CustomerProfilesEvaluationsListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CustomerProfilesEvaluationsListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CustomerProfilesEvaluationsContext { + /** + * Fetch a CustomerProfilesEvaluationsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesEvaluationsInstance + */ + fetch(callback?: (error: Error | null, item?: CustomerProfilesEvaluationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CustomerProfilesEvaluationsContextSolution { + customerProfileSid: string; + sid: string; +} +export declare class CustomerProfilesEvaluationsContextImpl implements CustomerProfilesEvaluationsContext { + protected _version: V1; + protected _solution: CustomerProfilesEvaluationsContextSolution; + protected _uri: string; + constructor(_version: V1, customerProfileSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: CustomerProfilesEvaluationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CustomerProfilesEvaluationsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CustomerProfilesEvaluationsPayload extends TwilioResponsePayload { + results: CustomerProfilesEvaluationsResource[]; +} +interface CustomerProfilesEvaluationsResource { + sid: string; + account_sid: string; + policy_sid: string; + customer_profile_sid: string; + status: CustomerProfilesEvaluationsStatus; + results: Array; + date_created: Date; + url: string; +} +export declare class CustomerProfilesEvaluationsInstance { + protected _version: V1; + protected _solution: CustomerProfilesEvaluationsContextSolution; + protected _context?: CustomerProfilesEvaluationsContext; + constructor(_version: V1, payload: CustomerProfilesEvaluationsResource, customerProfileSid: string, sid?: string); + /** + * The unique string that identifies the Evaluation resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the customer_profile resource. + */ + accountSid: string; + /** + * The unique string of a policy that is associated to the customer_profile resource. + */ + policySid: string; + /** + * The unique string that we created to identify the customer_profile resource. + */ + customerProfileSid: string; + status: CustomerProfilesEvaluationsStatus; + /** + * The results of the Evaluation which includes the valid and invalid attributes. + */ + results: Array; + dateCreated: Date; + url: string; + private get _proxy(); + /** + * Fetch a CustomerProfilesEvaluationsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesEvaluationsInstance + */ + fetch(callback?: (error: Error | null, item?: CustomerProfilesEvaluationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + policySid: string; + customerProfileSid: string; + status: CustomerProfilesEvaluationsStatus; + results: any[]; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CustomerProfilesEvaluationsSolution { + customerProfileSid: string; +} +export interface CustomerProfilesEvaluationsListInstance { + _version: V1; + _solution: CustomerProfilesEvaluationsSolution; + _uri: string; + (sid: string): CustomerProfilesEvaluationsContext; + get(sid: string): CustomerProfilesEvaluationsContext; + /** + * Create a CustomerProfilesEvaluationsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesEvaluationsInstance + */ + create(params: CustomerProfilesEvaluationsListInstanceCreateOptions, callback?: (error: Error | null, item?: CustomerProfilesEvaluationsInstance) => any): Promise; + /** + * Streams CustomerProfilesEvaluationsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesEvaluationsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CustomerProfilesEvaluationsInstance, done: (err?: Error) => void) => void): void; + each(params: CustomerProfilesEvaluationsListInstanceEachOptions, callback?: (item: CustomerProfilesEvaluationsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CustomerProfilesEvaluationsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CustomerProfilesEvaluationsPage) => any): Promise; + /** + * Lists CustomerProfilesEvaluationsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesEvaluationsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CustomerProfilesEvaluationsInstance[]) => any): Promise; + list(params: CustomerProfilesEvaluationsListInstanceOptions, callback?: (error: Error | null, items: CustomerProfilesEvaluationsInstance[]) => any): Promise; + /** + * Retrieve a single page of CustomerProfilesEvaluationsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CustomerProfilesEvaluationsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CustomerProfilesEvaluationsPage) => any): Promise; + page(params: CustomerProfilesEvaluationsListInstancePageOptions, callback?: (error: Error | null, items: CustomerProfilesEvaluationsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CustomerProfilesEvaluationsListInstance(version: V1, customerProfileSid: string): CustomerProfilesEvaluationsListInstance; +export declare class CustomerProfilesEvaluationsPage extends Page { + /** + * Initialize the CustomerProfilesEvaluationsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CustomerProfilesEvaluationsSolution); + /** + * Build an instance of CustomerProfilesEvaluationsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CustomerProfilesEvaluationsResource): CustomerProfilesEvaluationsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.js b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.js new file mode 100644 index 00000000..86a4dddf --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.js @@ -0,0 +1,212 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CustomerProfilesEvaluationsPage = exports.CustomerProfilesEvaluationsListInstance = exports.CustomerProfilesEvaluationsInstance = exports.CustomerProfilesEvaluationsContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class CustomerProfilesEvaluationsContextImpl { + constructor(_version, customerProfileSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(customerProfileSid)) { + throw new Error("Parameter 'customerProfileSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { customerProfileSid, sid }; + this._uri = `/CustomerProfiles/${customerProfileSid}/Evaluations/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesEvaluationsInstance(operationVersion, payload, instance._solution.customerProfileSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesEvaluationsContextImpl = CustomerProfilesEvaluationsContextImpl; +class CustomerProfilesEvaluationsInstance { + constructor(_version, payload, customerProfileSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.policySid = payload.policy_sid; + this.customerProfileSid = payload.customer_profile_sid; + this.status = payload.status; + this.results = payload.results; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { customerProfileSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CustomerProfilesEvaluationsContextImpl(this._version, this._solution.customerProfileSid, this._solution.sid); + return this._context; + } + /** + * Fetch a CustomerProfilesEvaluationsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CustomerProfilesEvaluationsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + policySid: this.policySid, + customerProfileSid: this.customerProfileSid, + status: this.status, + results: this.results, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesEvaluationsInstance = CustomerProfilesEvaluationsInstance; +function CustomerProfilesEvaluationsListInstance(version, customerProfileSid) { + if (!(0, utility_1.isValidPathParam)(customerProfileSid)) { + throw new Error("Parameter 'customerProfileSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CustomerProfilesEvaluationsContextImpl(version, customerProfileSid, sid); + }; + instance._version = version; + instance._solution = { customerProfileSid }; + instance._uri = `/CustomerProfiles/${customerProfileSid}/Evaluations`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["policySid"] === null || params["policySid"] === undefined) { + throw new Error("Required parameter \"params['policySid']\" missing."); + } + let data = {}; + data["PolicySid"] = params["policySid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesEvaluationsInstance(operationVersion, payload, instance._solution.customerProfileSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CustomerProfilesEvaluationsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CustomerProfilesEvaluationsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CustomerProfilesEvaluationsListInstance = CustomerProfilesEvaluationsListInstance; +class CustomerProfilesEvaluationsPage extends Page_1.default { + /** + * Initialize the CustomerProfilesEvaluationsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CustomerProfilesEvaluationsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CustomerProfilesEvaluationsInstance(this._version, payload, this._solution.customerProfileSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CustomerProfilesEvaluationsPage = CustomerProfilesEvaluationsPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/endUser.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/endUser.d.ts new file mode 100644 index 00000000..555f23fe --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/endUser.d.ts @@ -0,0 +1,310 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to update a EndUserInstance + */ +export interface EndUserContextUpdateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The set of parameters that are the attributes of the End User resource which are derived End User Types. */ + attributes?: any; +} +/** + * Options to pass to create a EndUserInstance + */ +export interface EndUserListInstanceCreateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName: string; + /** The type of end user of the Bundle resource - can be `individual` or `business`. */ + type: string; + /** The set of parameters that are the attributes of the End User resource which are derived End User Types. */ + attributes?: any; +} +/** + * Options to pass to each + */ +export interface EndUserListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EndUserInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EndUserListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EndUserListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EndUserContext { + /** + * Remove a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + fetch(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Update a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + update(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Update a EndUserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + update(params: EndUserContextUpdateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EndUserContextSolution { + sid: string; +} +export declare class EndUserContextImpl implements EndUserContext { + protected _version: V1; + protected _solution: EndUserContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + update(params?: EndUserContextUpdateOptions | ((error: Error | null, item?: EndUserInstance) => any), callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EndUserContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EndUserPayload extends TwilioResponsePayload { + results: EndUserResource[]; +} +interface EndUserResource { + sid: string; + account_sid: string; + friendly_name: string; + type: string; + attributes: any; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class EndUserInstance { + protected _version: V1; + protected _solution: EndUserContextSolution; + protected _context?: EndUserContext; + constructor(_version: V1, payload: EndUserResource, sid?: string); + /** + * The unique string created by Twilio to identify the End User resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the End User resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The type of end user of the Bundle resource - can be `individual` or `business`. + */ + type: string; + /** + * The set of parameters that are the attributes of the End Users resource which are listed in the End User Types. + */ + attributes: any; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the End User resource. + */ + url: string; + private get _proxy(); + /** + * Remove a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + fetch(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Update a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + update(callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Update a EndUserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + update(params: EndUserContextUpdateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + type: string; + attributes: any; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EndUserSolution { +} +export interface EndUserListInstance { + _version: V1; + _solution: EndUserSolution; + _uri: string; + (sid: string): EndUserContext; + get(sid: string): EndUserContext; + /** + * Create a EndUserInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + create(params: EndUserListInstanceCreateOptions, callback?: (error: Error | null, item?: EndUserInstance) => any): Promise; + /** + * Streams EndUserInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EndUserInstance, done: (err?: Error) => void) => void): void; + each(params: EndUserListInstanceEachOptions, callback?: (item: EndUserInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EndUserInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EndUserPage) => any): Promise; + /** + * Lists EndUserInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EndUserInstance[]) => any): Promise; + list(params: EndUserListInstanceOptions, callback?: (error: Error | null, items: EndUserInstance[]) => any): Promise; + /** + * Retrieve a single page of EndUserInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EndUserPage) => any): Promise; + page(params: EndUserListInstancePageOptions, callback?: (error: Error | null, items: EndUserPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EndUserListInstance(version: V1): EndUserListInstance; +export declare class EndUserPage extends Page { + /** + * Initialize the EndUserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EndUserSolution); + /** + * Build an instance of EndUserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EndUserResource): EndUserInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/endUser.js b/node_modules/twilio/lib/rest/trusthub/v1/endUser.js new file mode 100644 index 00000000..8eb6f202 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/endUser.js @@ -0,0 +1,261 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EndUserPage = exports.EndUserListInstance = exports.EndUserInstance = exports.EndUserContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class EndUserContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/EndUsers/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EndUserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = serialize.object(params["attributes"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EndUserInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserContextImpl = EndUserContextImpl; +class EndUserInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.type = payload.type; + this.attributes = payload.attributes; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EndUserContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a EndUserInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + type: this.type, + attributes: this.attributes, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserInstance = EndUserInstance; +function EndUserListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EndUserContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/EndUsers`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + if (params["attributes"] !== undefined) + data["Attributes"] = serialize.object(params["attributes"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EndUserInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EndUserPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EndUserPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EndUserListInstance = EndUserListInstance; +class EndUserPage extends Page_1.default { + /** + * Initialize the EndUserPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EndUserInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EndUserInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserPage = EndUserPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/endUserType.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/endUserType.d.ts new file mode 100644 index 00000000..77dcfa38 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/endUserType.d.ts @@ -0,0 +1,211 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface EndUserTypeListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EndUserTypeListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EndUserTypeListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EndUserTypeContext { + /** + * Fetch a EndUserTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserTypeInstance + */ + fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EndUserTypeContextSolution { + sid: string; +} +export declare class EndUserTypeContextImpl implements EndUserTypeContext { + protected _version: V1; + protected _solution: EndUserTypeContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EndUserTypeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EndUserTypePayload extends TwilioResponsePayload { + end_user_types: EndUserTypeResource[]; +} +interface EndUserTypeResource { + sid: string; + friendly_name: string; + machine_name: string; + fields: Array; + url: string; +} +export declare class EndUserTypeInstance { + protected _version: V1; + protected _solution: EndUserTypeContextSolution; + protected _context?: EndUserTypeContext; + constructor(_version: V1, payload: EndUserTypeResource, sid?: string); + /** + * The unique string that identifies the End-User Type resource. + */ + sid: string; + /** + * A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc + */ + friendlyName: string; + /** + * A machine-readable description of the End-User Type resource. Examples can include first_name, last_name, email, business_name, etc. + */ + machineName: string; + /** + * The required information for creating an End-User. The required fields will change as regulatory needs change and will differ for businesses and individuals. + */ + fields: Array; + /** + * The absolute URL of the End-User Type resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a EndUserTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserTypeInstance + */ + fetch(callback?: (error: Error | null, item?: EndUserTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + machineName: string; + fields: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EndUserTypeSolution { +} +export interface EndUserTypeListInstance { + _version: V1; + _solution: EndUserTypeSolution; + _uri: string; + (sid: string): EndUserTypeContext; + get(sid: string): EndUserTypeContext; + /** + * Streams EndUserTypeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserTypeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void): void; + each(params: EndUserTypeListInstanceEachOptions, callback?: (item: EndUserTypeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EndUserTypeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EndUserTypePage) => any): Promise; + /** + * Lists EndUserTypeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserTypeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EndUserTypeInstance[]) => any): Promise; + list(params: EndUserTypeListInstanceOptions, callback?: (error: Error | null, items: EndUserTypeInstance[]) => any): Promise; + /** + * Retrieve a single page of EndUserTypeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EndUserTypeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EndUserTypePage) => any): Promise; + page(params: EndUserTypeListInstancePageOptions, callback?: (error: Error | null, items: EndUserTypePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EndUserTypeListInstance(version: V1): EndUserTypeListInstance; +export declare class EndUserTypePage extends Page { + /** + * Initialize the EndUserTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: EndUserTypeSolution); + /** + * Build an instance of EndUserTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EndUserTypeResource): EndUserTypeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/endUserType.js b/node_modules/twilio/lib/rest/trusthub/v1/endUserType.js new file mode 100644 index 00000000..65838334 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/endUserType.js @@ -0,0 +1,179 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EndUserTypePage = exports.EndUserTypeListInstance = exports.EndUserTypeInstance = exports.EndUserTypeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class EndUserTypeContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/EndUserTypes/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EndUserTypeInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserTypeContextImpl = EndUserTypeContextImpl; +class EndUserTypeInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.machineName = payload.machine_name; + this.fields = payload.fields; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new EndUserTypeContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a EndUserTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EndUserTypeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + machineName: this.machineName, + fields: this.fields, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserTypeInstance = EndUserTypeInstance; +function EndUserTypeListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new EndUserTypeContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/EndUserTypes`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EndUserTypePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EndUserTypePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EndUserTypeListInstance = EndUserTypeListInstance; +class EndUserTypePage extends Page_1.default { + /** + * Initialize the EndUserTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EndUserTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EndUserTypeInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EndUserTypePage = EndUserTypePage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/policies.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/policies.d.ts new file mode 100644 index 00000000..6ba19d95 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/policies.d.ts @@ -0,0 +1,205 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface PoliciesListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: PoliciesInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface PoliciesListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface PoliciesListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface PoliciesContext { + /** + * Fetch a PoliciesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PoliciesInstance + */ + fetch(callback?: (error: Error | null, item?: PoliciesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PoliciesContextSolution { + sid: string; +} +export declare class PoliciesContextImpl implements PoliciesContext { + protected _version: V1; + protected _solution: PoliciesContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: PoliciesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PoliciesContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PoliciesPayload extends TwilioResponsePayload { + results: PoliciesResource[]; +} +interface PoliciesResource { + sid: string; + friendly_name: string; + requirements: any; + url: string; +} +export declare class PoliciesInstance { + protected _version: V1; + protected _solution: PoliciesContextSolution; + protected _context?: PoliciesContext; + constructor(_version: V1, payload: PoliciesResource, sid?: string); + /** + * The unique string that identifies the Policy resource. + */ + sid: string; + /** + * A human-readable description that is assigned to describe the Policy resource. Examples can include Primary Customer profile policy + */ + friendlyName: string; + /** + * The SID of an object that holds the policy information + */ + requirements: any; + /** + * The absolute URL of the Policy resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a PoliciesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PoliciesInstance + */ + fetch(callback?: (error: Error | null, item?: PoliciesInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + requirements: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PoliciesSolution { +} +export interface PoliciesListInstance { + _version: V1; + _solution: PoliciesSolution; + _uri: string; + (sid: string): PoliciesContext; + get(sid: string): PoliciesContext; + /** + * Streams PoliciesInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PoliciesListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: PoliciesInstance, done: (err?: Error) => void) => void): void; + each(params: PoliciesListInstanceEachOptions, callback?: (item: PoliciesInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of PoliciesInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: PoliciesPage) => any): Promise; + /** + * Lists PoliciesInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PoliciesListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: PoliciesInstance[]) => any): Promise; + list(params: PoliciesListInstanceOptions, callback?: (error: Error | null, items: PoliciesInstance[]) => any): Promise; + /** + * Retrieve a single page of PoliciesInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PoliciesListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: PoliciesPage) => any): Promise; + page(params: PoliciesListInstancePageOptions, callback?: (error: Error | null, items: PoliciesPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PoliciesListInstance(version: V1): PoliciesListInstance; +export declare class PoliciesPage extends Page { + /** + * Initialize the PoliciesPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: PoliciesSolution); + /** + * Build an instance of PoliciesInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: PoliciesResource): PoliciesInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/policies.js b/node_modules/twilio/lib/rest/trusthub/v1/policies.js new file mode 100644 index 00000000..14b2964c --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/policies.js @@ -0,0 +1,177 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PoliciesPage = exports.PoliciesListInstance = exports.PoliciesInstance = exports.PoliciesContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class PoliciesContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Policies/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PoliciesInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PoliciesContextImpl = PoliciesContextImpl; +class PoliciesInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.requirements = payload.requirements; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PoliciesContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a PoliciesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PoliciesInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + requirements: this.requirements, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PoliciesInstance = PoliciesInstance; +function PoliciesListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PoliciesContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Policies`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PoliciesPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new PoliciesPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PoliciesListInstance = PoliciesListInstance; +class PoliciesPage extends Page_1.default { + /** + * Initialize the PoliciesPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of PoliciesInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new PoliciesInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PoliciesPage = PoliciesPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/supportingDocument.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/supportingDocument.d.ts new file mode 100644 index 00000000..912fca2b --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/supportingDocument.d.ts @@ -0,0 +1,320 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type SupportingDocumentStatus = "draft" | "pending-review" | "rejected" | "approved" | "expired" | "provisionally-approved"; +/** + * Options to pass to update a SupportingDocumentInstance + */ +export interface SupportingDocumentContextUpdateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. */ + attributes?: any; +} +/** + * Options to pass to create a SupportingDocumentInstance + */ +export interface SupportingDocumentListInstanceCreateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName: string; + /** The type of the Supporting Document. */ + type: string; + /** The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. */ + attributes?: any; +} +/** + * Options to pass to each + */ +export interface SupportingDocumentListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SupportingDocumentListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SupportingDocumentListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SupportingDocumentContext { + /** + * Remove a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + fetch(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Update a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + update(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Update a SupportingDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + update(params: SupportingDocumentContextUpdateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SupportingDocumentContextSolution { + sid: string; +} +export declare class SupportingDocumentContextImpl implements SupportingDocumentContext { + protected _version: V1; + protected _solution: SupportingDocumentContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + update(params?: SupportingDocumentContextUpdateOptions | ((error: Error | null, item?: SupportingDocumentInstance) => any), callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SupportingDocumentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SupportingDocumentPayload extends TwilioResponsePayload { + results: SupportingDocumentResource[]; +} +interface SupportingDocumentResource { + sid: string; + account_sid: string; + friendly_name: string; + mime_type: string; + status: SupportingDocumentStatus; + type: string; + attributes: any; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class SupportingDocumentInstance { + protected _version: V1; + protected _solution: SupportingDocumentContextSolution; + protected _context?: SupportingDocumentContext; + constructor(_version: V1, payload: SupportingDocumentResource, sid?: string); + /** + * The unique string created by Twilio to identify the Supporting Document resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Document resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The image type uploaded in the Supporting Document container. + */ + mimeType: string; + status: SupportingDocumentStatus; + /** + * The type of the Supporting Document. + */ + type: string; + /** + * The set of parameters that are the attributes of the Supporting Documents resource which are listed in the Supporting Document Types. + */ + attributes: any; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Supporting Document resource. + */ + url: string; + private get _proxy(); + /** + * Remove a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + fetch(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Update a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + update(callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Update a SupportingDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + update(params: SupportingDocumentContextUpdateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + mimeType: string; + status: SupportingDocumentStatus; + type: string; + attributes: any; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SupportingDocumentSolution { +} +export interface SupportingDocumentListInstance { + _version: V1; + _solution: SupportingDocumentSolution; + _uri: string; + (sid: string): SupportingDocumentContext; + get(sid: string): SupportingDocumentContext; + /** + * Create a SupportingDocumentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + create(params: SupportingDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: SupportingDocumentInstance) => any): Promise; + /** + * Streams SupportingDocumentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void): void; + each(params: SupportingDocumentListInstanceEachOptions, callback?: (item: SupportingDocumentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SupportingDocumentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SupportingDocumentPage) => any): Promise; + /** + * Lists SupportingDocumentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SupportingDocumentInstance[]) => any): Promise; + list(params: SupportingDocumentListInstanceOptions, callback?: (error: Error | null, items: SupportingDocumentInstance[]) => any): Promise; + /** + * Retrieve a single page of SupportingDocumentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SupportingDocumentPage) => any): Promise; + page(params: SupportingDocumentListInstancePageOptions, callback?: (error: Error | null, items: SupportingDocumentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SupportingDocumentListInstance(version: V1): SupportingDocumentListInstance; +export declare class SupportingDocumentPage extends Page { + /** + * Initialize the SupportingDocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SupportingDocumentSolution); + /** + * Build an instance of SupportingDocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SupportingDocumentResource): SupportingDocumentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/supportingDocument.js b/node_modules/twilio/lib/rest/trusthub/v1/supportingDocument.js new file mode 100644 index 00000000..1c690e9c --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/supportingDocument.js @@ -0,0 +1,265 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SupportingDocumentPage = exports.SupportingDocumentListInstance = exports.SupportingDocumentInstance = exports.SupportingDocumentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class SupportingDocumentContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/SupportingDocuments/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["attributes"] !== undefined) + data["Attributes"] = serialize.object(params["attributes"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentContextImpl = SupportingDocumentContextImpl; +class SupportingDocumentInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.mimeType = payload.mime_type; + this.status = payload.status; + this.type = payload.type; + this.attributes = payload.attributes; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SupportingDocumentContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SupportingDocumentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + mimeType: this.mimeType, + status: this.status, + type: this.type, + attributes: this.attributes, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentInstance = SupportingDocumentInstance; +function SupportingDocumentListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SupportingDocumentContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/SupportingDocuments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["type"] === null || params["type"] === undefined) { + throw new Error("Required parameter \"params['type']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Type"] = params["type"]; + if (params["attributes"] !== undefined) + data["Attributes"] = serialize.object(params["attributes"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SupportingDocumentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SupportingDocumentListInstance = SupportingDocumentListInstance; +class SupportingDocumentPage extends Page_1.default { + /** + * Initialize the SupportingDocumentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SupportingDocumentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SupportingDocumentInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentPage = SupportingDocumentPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/supportingDocumentType.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/supportingDocumentType.d.ts new file mode 100644 index 00000000..c640ddb4 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/supportingDocumentType.d.ts @@ -0,0 +1,211 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to each + */ +export interface SupportingDocumentTypeListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SupportingDocumentTypeListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SupportingDocumentTypeListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SupportingDocumentTypeContext { + /** + * Fetch a SupportingDocumentTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentTypeInstance + */ + fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SupportingDocumentTypeContextSolution { + sid: string; +} +export declare class SupportingDocumentTypeContextImpl implements SupportingDocumentTypeContext { + protected _version: V1; + protected _solution: SupportingDocumentTypeContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SupportingDocumentTypeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SupportingDocumentTypePayload extends TwilioResponsePayload { + supporting_document_types: SupportingDocumentTypeResource[]; +} +interface SupportingDocumentTypeResource { + sid: string; + friendly_name: string; + machine_name: string; + fields: Array; + url: string; +} +export declare class SupportingDocumentTypeInstance { + protected _version: V1; + protected _solution: SupportingDocumentTypeContextSolution; + protected _context?: SupportingDocumentTypeContext; + constructor(_version: V1, payload: SupportingDocumentTypeResource, sid?: string); + /** + * The unique string that identifies the Supporting Document Type resource. + */ + sid: string; + /** + * A human-readable description of the Supporting Document Type resource. + */ + friendlyName: string; + /** + * The machine-readable description of the Supporting Document Type resource. + */ + machineName: string; + /** + * The required information for creating a Supporting Document. The required fields will change as regulatory needs change and will differ for businesses and individuals. + */ + fields: Array; + /** + * The absolute URL of the Supporting Document Type resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a SupportingDocumentTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentTypeInstance + */ + fetch(callback?: (error: Error | null, item?: SupportingDocumentTypeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + friendlyName: string; + machineName: string; + fields: any[]; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SupportingDocumentTypeSolution { +} +export interface SupportingDocumentTypeListInstance { + _version: V1; + _solution: SupportingDocumentTypeSolution; + _uri: string; + (sid: string): SupportingDocumentTypeContext; + get(sid: string): SupportingDocumentTypeContext; + /** + * Streams SupportingDocumentTypeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentTypeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void): void; + each(params: SupportingDocumentTypeListInstanceEachOptions, callback?: (item: SupportingDocumentTypeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SupportingDocumentTypeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SupportingDocumentTypePage) => any): Promise; + /** + * Lists SupportingDocumentTypeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentTypeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SupportingDocumentTypeInstance[]) => any): Promise; + list(params: SupportingDocumentTypeListInstanceOptions, callback?: (error: Error | null, items: SupportingDocumentTypeInstance[]) => any): Promise; + /** + * Retrieve a single page of SupportingDocumentTypeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SupportingDocumentTypeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SupportingDocumentTypePage) => any): Promise; + page(params: SupportingDocumentTypeListInstancePageOptions, callback?: (error: Error | null, items: SupportingDocumentTypePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SupportingDocumentTypeListInstance(version: V1): SupportingDocumentTypeListInstance; +export declare class SupportingDocumentTypePage extends Page { + /** + * Initialize the SupportingDocumentTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SupportingDocumentTypeSolution); + /** + * Build an instance of SupportingDocumentTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SupportingDocumentTypeResource): SupportingDocumentTypeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/supportingDocumentType.js b/node_modules/twilio/lib/rest/trusthub/v1/supportingDocumentType.js new file mode 100644 index 00000000..830c406e --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/supportingDocumentType.js @@ -0,0 +1,179 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SupportingDocumentTypePage = exports.SupportingDocumentTypeListInstance = exports.SupportingDocumentTypeInstance = exports.SupportingDocumentTypeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class SupportingDocumentTypeContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/SupportingDocumentTypes/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentTypeInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentTypeContextImpl = SupportingDocumentTypeContextImpl; +class SupportingDocumentTypeInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.machineName = payload.machine_name; + this.fields = payload.fields; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SupportingDocumentTypeContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a SupportingDocumentTypeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SupportingDocumentTypeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + friendlyName: this.friendlyName, + machineName: this.machineName, + fields: this.fields, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentTypeInstance = SupportingDocumentTypeInstance; +function SupportingDocumentTypeListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SupportingDocumentTypeContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/SupportingDocumentTypes`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SupportingDocumentTypePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SupportingDocumentTypePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SupportingDocumentTypeListInstance = SupportingDocumentTypeListInstance; +class SupportingDocumentTypePage extends Page_1.default { + /** + * Initialize the SupportingDocumentTypePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SupportingDocumentTypeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SupportingDocumentTypeInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SupportingDocumentTypePage = SupportingDocumentTypePage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/trustProducts.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts.d.ts new file mode 100644 index 00000000..75d3f2f7 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts.d.ts @@ -0,0 +1,380 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { TrustProductsChannelEndpointAssignmentListInstance } from "./trustProducts/trustProductsChannelEndpointAssignment"; +import { TrustProductsEntityAssignmentsListInstance } from "./trustProducts/trustProductsEntityAssignments"; +import { TrustProductsEvaluationsListInstance } from "./trustProducts/trustProductsEvaluations"; +export type TrustProductsStatus = "draft" | "pending-review" | "in-review" | "twilio-rejected" | "twilio-approved"; +/** + * Options to pass to update a TrustProductsInstance + */ +export interface TrustProductsContextUpdateOptions { + /** */ + status?: TrustProductsStatus; + /** The URL we call to inform your application of status changes. */ + statusCallback?: string; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The email address that will receive updates when the Customer-Profile resource changes status. */ + email?: string; +} +/** + * Options to pass to create a TrustProductsInstance + */ +export interface TrustProductsListInstanceCreateOptions { + /** The string that you assigned to describe the resource. */ + friendlyName: string; + /** The email address that will receive updates when the Customer-Profile resource changes status. */ + email: string; + /** The unique string of a policy that is associated to the Customer-Profile resource. */ + policySid: string; + /** The URL we call to inform your application of status changes. */ + statusCallback?: string; +} +/** + * Options to pass to each + */ +export interface TrustProductsListInstanceEachOptions { + /** The verification status of the Customer-Profile resource. */ + status?: TrustProductsStatus; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The unique string of a policy that is associated to the Customer-Profile resource. */ + policySid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TrustProductsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TrustProductsListInstanceOptions { + /** The verification status of the Customer-Profile resource. */ + status?: TrustProductsStatus; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The unique string of a policy that is associated to the Customer-Profile resource. */ + policySid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TrustProductsListInstancePageOptions { + /** The verification status of the Customer-Profile resource. */ + status?: TrustProductsStatus; + /** The string that you assigned to describe the resource. */ + friendlyName?: string; + /** The unique string of a policy that is associated to the Customer-Profile resource. */ + policySid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TrustProductsContext { + trustProductsChannelEndpointAssignment: TrustProductsChannelEndpointAssignmentListInstance; + trustProductsEntityAssignments: TrustProductsEntityAssignmentsListInstance; + trustProductsEvaluations: TrustProductsEvaluationsListInstance; + /** + * Remove a TrustProductsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TrustProductsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsInstance + */ + fetch(callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + /** + * Update a TrustProductsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsInstance + */ + update(callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + /** + * Update a TrustProductsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsInstance + */ + update(params: TrustProductsContextUpdateOptions, callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TrustProductsContextSolution { + sid: string; +} +export declare class TrustProductsContextImpl implements TrustProductsContext { + protected _version: V1; + protected _solution: TrustProductsContextSolution; + protected _uri: string; + protected _trustProductsChannelEndpointAssignment?: TrustProductsChannelEndpointAssignmentListInstance; + protected _trustProductsEntityAssignments?: TrustProductsEntityAssignmentsListInstance; + protected _trustProductsEvaluations?: TrustProductsEvaluationsListInstance; + constructor(_version: V1, sid: string); + get trustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentListInstance; + get trustProductsEntityAssignments(): TrustProductsEntityAssignmentsListInstance; + get trustProductsEvaluations(): TrustProductsEvaluationsListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + update(params?: TrustProductsContextUpdateOptions | ((error: Error | null, item?: TrustProductsInstance) => any), callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TrustProductsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TrustProductsPayload extends TwilioResponsePayload { + results: TrustProductsResource[]; +} +interface TrustProductsResource { + sid: string; + account_sid: string; + policy_sid: string; + friendly_name: string; + status: TrustProductsStatus; + valid_until: Date; + email: string; + status_callback: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class TrustProductsInstance { + protected _version: V1; + protected _solution: TrustProductsContextSolution; + protected _context?: TrustProductsContext; + constructor(_version: V1, payload: TrustProductsResource, sid?: string); + /** + * The unique string that we created to identify the Customer-Profile resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Customer-Profile resource. + */ + accountSid: string; + /** + * The unique string of a policy that is associated to the Customer-Profile resource. + */ + policySid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + status: TrustProductsStatus; + /** + * The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until. + */ + validUntil: Date; + /** + * The email address that will receive updates when the Customer-Profile resource changes status. + */ + email: string; + /** + * The URL we call to inform your application of status changes. + */ + statusCallback: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Customer-Profile resource. + */ + url: string; + /** + * The URLs of the Assigned Items of the Customer-Profile resource. + */ + links: Record; + private get _proxy(); + /** + * Remove a TrustProductsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TrustProductsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsInstance + */ + fetch(callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + /** + * Update a TrustProductsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsInstance + */ + update(callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + /** + * Update a TrustProductsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsInstance + */ + update(params: TrustProductsContextUpdateOptions, callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + /** + * Access the trustProductsChannelEndpointAssignment. + */ + trustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentListInstance; + /** + * Access the trustProductsEntityAssignments. + */ + trustProductsEntityAssignments(): TrustProductsEntityAssignmentsListInstance; + /** + * Access the trustProductsEvaluations. + */ + trustProductsEvaluations(): TrustProductsEvaluationsListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + policySid: string; + friendlyName: string; + status: TrustProductsStatus; + validUntil: Date; + email: string; + statusCallback: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TrustProductsSolution { +} +export interface TrustProductsListInstance { + _version: V1; + _solution: TrustProductsSolution; + _uri: string; + (sid: string): TrustProductsContext; + get(sid: string): TrustProductsContext; + /** + * Create a TrustProductsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsInstance + */ + create(params: TrustProductsListInstanceCreateOptions, callback?: (error: Error | null, item?: TrustProductsInstance) => any): Promise; + /** + * Streams TrustProductsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TrustProductsInstance, done: (err?: Error) => void) => void): void; + each(params: TrustProductsListInstanceEachOptions, callback?: (item: TrustProductsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TrustProductsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TrustProductsPage) => any): Promise; + /** + * Lists TrustProductsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TrustProductsInstance[]) => any): Promise; + list(params: TrustProductsListInstanceOptions, callback?: (error: Error | null, items: TrustProductsInstance[]) => any): Promise; + /** + * Retrieve a single page of TrustProductsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TrustProductsPage) => any): Promise; + page(params: TrustProductsListInstancePageOptions, callback?: (error: Error | null, items: TrustProductsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TrustProductsListInstance(version: V1): TrustProductsListInstance; +export declare class TrustProductsPage extends Page { + /** + * Initialize the TrustProductsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TrustProductsSolution); + /** + * Build an instance of TrustProductsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TrustProductsResource): TrustProductsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/trustProducts.js b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts.js new file mode 100644 index 00000000..c1ecf5e1 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts.js @@ -0,0 +1,322 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TrustProductsPage = exports.TrustProductsListInstance = exports.TrustProductsInstance = exports.TrustProductsContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const trustProductsChannelEndpointAssignment_1 = require("./trustProducts/trustProductsChannelEndpointAssignment"); +const trustProductsEntityAssignments_1 = require("./trustProducts/trustProductsEntityAssignments"); +const trustProductsEvaluations_1 = require("./trustProducts/trustProductsEvaluations"); +class TrustProductsContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/TrustProducts/${sid}`; + } + get trustProductsChannelEndpointAssignment() { + this._trustProductsChannelEndpointAssignment = + this._trustProductsChannelEndpointAssignment || + (0, trustProductsChannelEndpointAssignment_1.TrustProductsChannelEndpointAssignmentListInstance)(this._version, this._solution.sid); + return this._trustProductsChannelEndpointAssignment; + } + get trustProductsEntityAssignments() { + this._trustProductsEntityAssignments = + this._trustProductsEntityAssignments || + (0, trustProductsEntityAssignments_1.TrustProductsEntityAssignmentsListInstance)(this._version, this._solution.sid); + return this._trustProductsEntityAssignments; + } + get trustProductsEvaluations() { + this._trustProductsEvaluations = + this._trustProductsEvaluations || + (0, trustProductsEvaluations_1.TrustProductsEvaluationsListInstance)(this._version, this._solution.sid); + return this._trustProductsEvaluations; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TrustProductsInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["email"] !== undefined) + data["Email"] = params["email"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsContextImpl = TrustProductsContextImpl; +class TrustProductsInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.policySid = payload.policy_sid; + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.validUntil = deserialize.iso8601DateTime(payload.valid_until); + this.email = payload.email; + this.statusCallback = payload.status_callback; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TrustProductsContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a TrustProductsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TrustProductsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the trustProductsChannelEndpointAssignment. + */ + trustProductsChannelEndpointAssignment() { + return this._proxy.trustProductsChannelEndpointAssignment; + } + /** + * Access the trustProductsEntityAssignments. + */ + trustProductsEntityAssignments() { + return this._proxy.trustProductsEntityAssignments; + } + /** + * Access the trustProductsEvaluations. + */ + trustProductsEvaluations() { + return this._proxy.trustProductsEvaluations; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + policySid: this.policySid, + friendlyName: this.friendlyName, + status: this.status, + validUntil: this.validUntil, + email: this.email, + statusCallback: this.statusCallback, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsInstance = TrustProductsInstance; +function TrustProductsListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TrustProductsContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/TrustProducts`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["email"] === null || params["email"] === undefined) { + throw new Error("Required parameter \"params['email']\" missing."); + } + if (params["policySid"] === null || params["policySid"] === undefined) { + throw new Error("Required parameter \"params['policySid']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["Email"] = params["email"]; + data["PolicySid"] = params["policySid"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["policySid"] !== undefined) + data["PolicySid"] = params["policySid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TrustProductsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TrustProductsListInstance = TrustProductsListInstance; +class TrustProductsPage extends Page_1.default { + /** + * Initialize the TrustProductsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TrustProductsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TrustProductsInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsPage = TrustProductsPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.d.ts new file mode 100644 index 00000000..1b35a236 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.d.ts @@ -0,0 +1,272 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a TrustProductsChannelEndpointAssignmentInstance + */ +export interface TrustProductsChannelEndpointAssignmentListInstanceCreateOptions { + /** The type of channel endpoint. eg: phone-number */ + channelEndpointType: string; + /** The SID of an channel endpoint */ + channelEndpointSid: string; +} +/** + * Options to pass to each + */ +export interface TrustProductsChannelEndpointAssignmentListInstanceEachOptions { + /** The SID of an channel endpoint */ + channelEndpointSid?: string; + /** comma separated list of channel endpoint sids */ + channelEndpointSids?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TrustProductsChannelEndpointAssignmentInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TrustProductsChannelEndpointAssignmentListInstanceOptions { + /** The SID of an channel endpoint */ + channelEndpointSid?: string; + /** comma separated list of channel endpoint sids */ + channelEndpointSids?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TrustProductsChannelEndpointAssignmentListInstancePageOptions { + /** The SID of an channel endpoint */ + channelEndpointSid?: string; + /** comma separated list of channel endpoint sids */ + channelEndpointSids?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TrustProductsChannelEndpointAssignmentContext { + /** + * Remove a TrustProductsChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TrustProductsChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsChannelEndpointAssignmentInstance + */ + fetch(callback?: (error: Error | null, item?: TrustProductsChannelEndpointAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TrustProductsChannelEndpointAssignmentContextSolution { + trustProductSid: string; + sid: string; +} +export declare class TrustProductsChannelEndpointAssignmentContextImpl implements TrustProductsChannelEndpointAssignmentContext { + protected _version: V1; + protected _solution: TrustProductsChannelEndpointAssignmentContextSolution; + protected _uri: string; + constructor(_version: V1, trustProductSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TrustProductsChannelEndpointAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TrustProductsChannelEndpointAssignmentContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TrustProductsChannelEndpointAssignmentPayload extends TwilioResponsePayload { + results: TrustProductsChannelEndpointAssignmentResource[]; +} +interface TrustProductsChannelEndpointAssignmentResource { + sid: string; + trust_product_sid: string; + account_sid: string; + channel_endpoint_type: string; + channel_endpoint_sid: string; + date_created: Date; + url: string; +} +export declare class TrustProductsChannelEndpointAssignmentInstance { + protected _version: V1; + protected _solution: TrustProductsChannelEndpointAssignmentContextSolution; + protected _context?: TrustProductsChannelEndpointAssignmentContext; + constructor(_version: V1, payload: TrustProductsChannelEndpointAssignmentResource, trustProductSid: string, sid?: string); + /** + * The unique string that we created to identify the Item Assignment resource. + */ + sid: string; + /** + * The unique string that we created to identify the CustomerProfile resource. + */ + trustProductSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Item Assignment resource. + */ + accountSid: string; + /** + * The type of channel endpoint. eg: phone-number + */ + channelEndpointType: string; + /** + * The SID of an channel endpoint + */ + channelEndpointSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The absolute URL of the Identity resource. + */ + url: string; + private get _proxy(); + /** + * Remove a TrustProductsChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TrustProductsChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsChannelEndpointAssignmentInstance + */ + fetch(callback?: (error: Error | null, item?: TrustProductsChannelEndpointAssignmentInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + trustProductSid: string; + accountSid: string; + channelEndpointType: string; + channelEndpointSid: string; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TrustProductsChannelEndpointAssignmentSolution { + trustProductSid: string; +} +export interface TrustProductsChannelEndpointAssignmentListInstance { + _version: V1; + _solution: TrustProductsChannelEndpointAssignmentSolution; + _uri: string; + (sid: string): TrustProductsChannelEndpointAssignmentContext; + get(sid: string): TrustProductsChannelEndpointAssignmentContext; + /** + * Create a TrustProductsChannelEndpointAssignmentInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsChannelEndpointAssignmentInstance + */ + create(params: TrustProductsChannelEndpointAssignmentListInstanceCreateOptions, callback?: (error: Error | null, item?: TrustProductsChannelEndpointAssignmentInstance) => any): Promise; + /** + * Streams TrustProductsChannelEndpointAssignmentInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsChannelEndpointAssignmentListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TrustProductsChannelEndpointAssignmentInstance, done: (err?: Error) => void) => void): void; + each(params: TrustProductsChannelEndpointAssignmentListInstanceEachOptions, callback?: (item: TrustProductsChannelEndpointAssignmentInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TrustProductsChannelEndpointAssignmentInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TrustProductsChannelEndpointAssignmentPage) => any): Promise; + /** + * Lists TrustProductsChannelEndpointAssignmentInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsChannelEndpointAssignmentListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TrustProductsChannelEndpointAssignmentInstance[]) => any): Promise; + list(params: TrustProductsChannelEndpointAssignmentListInstanceOptions, callback?: (error: Error | null, items: TrustProductsChannelEndpointAssignmentInstance[]) => any): Promise; + /** + * Retrieve a single page of TrustProductsChannelEndpointAssignmentInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsChannelEndpointAssignmentListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TrustProductsChannelEndpointAssignmentPage) => any): Promise; + page(params: TrustProductsChannelEndpointAssignmentListInstancePageOptions, callback?: (error: Error | null, items: TrustProductsChannelEndpointAssignmentPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TrustProductsChannelEndpointAssignmentListInstance(version: V1, trustProductSid: string): TrustProductsChannelEndpointAssignmentListInstance; +export declare class TrustProductsChannelEndpointAssignmentPage extends Page { + /** + * Initialize the TrustProductsChannelEndpointAssignmentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TrustProductsChannelEndpointAssignmentSolution); + /** + * Build an instance of TrustProductsChannelEndpointAssignmentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TrustProductsChannelEndpointAssignmentResource): TrustProductsChannelEndpointAssignmentInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.js b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.js new file mode 100644 index 00000000..5ee8d434 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.js @@ -0,0 +1,239 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TrustProductsChannelEndpointAssignmentPage = exports.TrustProductsChannelEndpointAssignmentListInstance = exports.TrustProductsChannelEndpointAssignmentInstance = exports.TrustProductsChannelEndpointAssignmentContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class TrustProductsChannelEndpointAssignmentContextImpl { + constructor(_version, trustProductSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(trustProductSid)) { + throw new Error("Parameter 'trustProductSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { trustProductSid, sid }; + this._uri = `/TrustProducts/${trustProductSid}/ChannelEndpointAssignments/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TrustProductsChannelEndpointAssignmentInstance(operationVersion, payload, instance._solution.trustProductSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsChannelEndpointAssignmentContextImpl = TrustProductsChannelEndpointAssignmentContextImpl; +class TrustProductsChannelEndpointAssignmentInstance { + constructor(_version, payload, trustProductSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.trustProductSid = payload.trust_product_sid; + this.accountSid = payload.account_sid; + this.channelEndpointType = payload.channel_endpoint_type; + this.channelEndpointSid = payload.channel_endpoint_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { trustProductSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TrustProductsChannelEndpointAssignmentContextImpl(this._version, this._solution.trustProductSid, this._solution.sid); + return this._context; + } + /** + * Remove a TrustProductsChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TrustProductsChannelEndpointAssignmentInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsChannelEndpointAssignmentInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + trustProductSid: this.trustProductSid, + accountSid: this.accountSid, + channelEndpointType: this.channelEndpointType, + channelEndpointSid: this.channelEndpointSid, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsChannelEndpointAssignmentInstance = TrustProductsChannelEndpointAssignmentInstance; +function TrustProductsChannelEndpointAssignmentListInstance(version, trustProductSid) { + if (!(0, utility_1.isValidPathParam)(trustProductSid)) { + throw new Error("Parameter 'trustProductSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TrustProductsChannelEndpointAssignmentContextImpl(version, trustProductSid, sid); + }; + instance._version = version; + instance._solution = { trustProductSid }; + instance._uri = `/TrustProducts/${trustProductSid}/ChannelEndpointAssignments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["channelEndpointType"] === null || + params["channelEndpointType"] === undefined) { + throw new Error("Required parameter \"params['channelEndpointType']\" missing."); + } + if (params["channelEndpointSid"] === null || + params["channelEndpointSid"] === undefined) { + throw new Error("Required parameter \"params['channelEndpointSid']\" missing."); + } + let data = {}; + data["ChannelEndpointType"] = params["channelEndpointType"]; + data["ChannelEndpointSid"] = params["channelEndpointSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsChannelEndpointAssignmentInstance(operationVersion, payload, instance._solution.trustProductSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["channelEndpointSid"] !== undefined) + data["ChannelEndpointSid"] = params["channelEndpointSid"]; + if (params["channelEndpointSids"] !== undefined) + data["ChannelEndpointSids"] = params["channelEndpointSids"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsChannelEndpointAssignmentPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TrustProductsChannelEndpointAssignmentPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TrustProductsChannelEndpointAssignmentListInstance = TrustProductsChannelEndpointAssignmentListInstance; +class TrustProductsChannelEndpointAssignmentPage extends Page_1.default { + /** + * Initialize the TrustProductsChannelEndpointAssignmentPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TrustProductsChannelEndpointAssignmentInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TrustProductsChannelEndpointAssignmentInstance(this._version, payload, this._solution.trustProductSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsChannelEndpointAssignmentPage = TrustProductsChannelEndpointAssignmentPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.d.ts new file mode 100644 index 00000000..1c5a2f8b --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.d.ts @@ -0,0 +1,252 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to create a TrustProductsEntityAssignmentsInstance + */ +export interface TrustProductsEntityAssignmentsListInstanceCreateOptions { + /** The SID of an object bag that holds information of the different items. */ + objectSid: string; +} +/** + * Options to pass to each + */ +export interface TrustProductsEntityAssignmentsListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TrustProductsEntityAssignmentsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TrustProductsEntityAssignmentsListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TrustProductsEntityAssignmentsListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TrustProductsEntityAssignmentsContext { + /** + * Remove a TrustProductsEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TrustProductsEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsEntityAssignmentsInstance + */ + fetch(callback?: (error: Error | null, item?: TrustProductsEntityAssignmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TrustProductsEntityAssignmentsContextSolution { + trustProductSid: string; + sid: string; +} +export declare class TrustProductsEntityAssignmentsContextImpl implements TrustProductsEntityAssignmentsContext { + protected _version: V1; + protected _solution: TrustProductsEntityAssignmentsContextSolution; + protected _uri: string; + constructor(_version: V1, trustProductSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: TrustProductsEntityAssignmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TrustProductsEntityAssignmentsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TrustProductsEntityAssignmentsPayload extends TwilioResponsePayload { + results: TrustProductsEntityAssignmentsResource[]; +} +interface TrustProductsEntityAssignmentsResource { + sid: string; + trust_product_sid: string; + account_sid: string; + object_sid: string; + date_created: Date; + url: string; +} +export declare class TrustProductsEntityAssignmentsInstance { + protected _version: V1; + protected _solution: TrustProductsEntityAssignmentsContextSolution; + protected _context?: TrustProductsEntityAssignmentsContext; + constructor(_version: V1, payload: TrustProductsEntityAssignmentsResource, trustProductSid: string, sid?: string); + /** + * The unique string that we created to identify the Item Assignment resource. + */ + sid: string; + /** + * The unique string that we created to identify the TrustProduct resource. + */ + trustProductSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Item Assignment resource. + */ + accountSid: string; + /** + * The SID of an object bag that holds information of the different items. + */ + objectSid: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The absolute URL of the Identity resource. + */ + url: string; + private get _proxy(); + /** + * Remove a TrustProductsEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a TrustProductsEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsEntityAssignmentsInstance + */ + fetch(callback?: (error: Error | null, item?: TrustProductsEntityAssignmentsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + trustProductSid: string; + accountSid: string; + objectSid: string; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TrustProductsEntityAssignmentsSolution { + trustProductSid: string; +} +export interface TrustProductsEntityAssignmentsListInstance { + _version: V1; + _solution: TrustProductsEntityAssignmentsSolution; + _uri: string; + (sid: string): TrustProductsEntityAssignmentsContext; + get(sid: string): TrustProductsEntityAssignmentsContext; + /** + * Create a TrustProductsEntityAssignmentsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsEntityAssignmentsInstance + */ + create(params: TrustProductsEntityAssignmentsListInstanceCreateOptions, callback?: (error: Error | null, item?: TrustProductsEntityAssignmentsInstance) => any): Promise; + /** + * Streams TrustProductsEntityAssignmentsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsEntityAssignmentsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TrustProductsEntityAssignmentsInstance, done: (err?: Error) => void) => void): void; + each(params: TrustProductsEntityAssignmentsListInstanceEachOptions, callback?: (item: TrustProductsEntityAssignmentsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TrustProductsEntityAssignmentsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TrustProductsEntityAssignmentsPage) => any): Promise; + /** + * Lists TrustProductsEntityAssignmentsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsEntityAssignmentsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsInstance[]) => any): Promise; + list(params: TrustProductsEntityAssignmentsListInstanceOptions, callback?: (error: Error | null, items: TrustProductsEntityAssignmentsInstance[]) => any): Promise; + /** + * Retrieve a single page of TrustProductsEntityAssignmentsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsEntityAssignmentsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TrustProductsEntityAssignmentsPage) => any): Promise; + page(params: TrustProductsEntityAssignmentsListInstancePageOptions, callback?: (error: Error | null, items: TrustProductsEntityAssignmentsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TrustProductsEntityAssignmentsListInstance(version: V1, trustProductSid: string): TrustProductsEntityAssignmentsListInstance; +export declare class TrustProductsEntityAssignmentsPage extends Page { + /** + * Initialize the TrustProductsEntityAssignmentsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TrustProductsEntityAssignmentsSolution); + /** + * Build an instance of TrustProductsEntityAssignmentsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TrustProductsEntityAssignmentsResource): TrustProductsEntityAssignmentsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.js b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.js new file mode 100644 index 00000000..7cdbea94 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.js @@ -0,0 +1,227 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TrustProductsEntityAssignmentsPage = exports.TrustProductsEntityAssignmentsListInstance = exports.TrustProductsEntityAssignmentsInstance = exports.TrustProductsEntityAssignmentsContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class TrustProductsEntityAssignmentsContextImpl { + constructor(_version, trustProductSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(trustProductSid)) { + throw new Error("Parameter 'trustProductSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { trustProductSid, sid }; + this._uri = `/TrustProducts/${trustProductSid}/EntityAssignments/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TrustProductsEntityAssignmentsInstance(operationVersion, payload, instance._solution.trustProductSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsEntityAssignmentsContextImpl = TrustProductsEntityAssignmentsContextImpl; +class TrustProductsEntityAssignmentsInstance { + constructor(_version, payload, trustProductSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.trustProductSid = payload.trust_product_sid; + this.accountSid = payload.account_sid; + this.objectSid = payload.object_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { trustProductSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TrustProductsEntityAssignmentsContextImpl(this._version, this._solution.trustProductSid, this._solution.sid); + return this._context; + } + /** + * Remove a TrustProductsEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a TrustProductsEntityAssignmentsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsEntityAssignmentsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + trustProductSid: this.trustProductSid, + accountSid: this.accountSid, + objectSid: this.objectSid, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsEntityAssignmentsInstance = TrustProductsEntityAssignmentsInstance; +function TrustProductsEntityAssignmentsListInstance(version, trustProductSid) { + if (!(0, utility_1.isValidPathParam)(trustProductSid)) { + throw new Error("Parameter 'trustProductSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TrustProductsEntityAssignmentsContextImpl(version, trustProductSid, sid); + }; + instance._version = version; + instance._solution = { trustProductSid }; + instance._uri = `/TrustProducts/${trustProductSid}/EntityAssignments`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["objectSid"] === null || params["objectSid"] === undefined) { + throw new Error("Required parameter \"params['objectSid']\" missing."); + } + let data = {}; + data["ObjectSid"] = params["objectSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsEntityAssignmentsInstance(operationVersion, payload, instance._solution.trustProductSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsEntityAssignmentsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TrustProductsEntityAssignmentsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TrustProductsEntityAssignmentsListInstance = TrustProductsEntityAssignmentsListInstance; +class TrustProductsEntityAssignmentsPage extends Page_1.default { + /** + * Initialize the TrustProductsEntityAssignmentsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TrustProductsEntityAssignmentsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TrustProductsEntityAssignmentsInstance(this._version, payload, this._solution.trustProductSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsEntityAssignmentsPage = TrustProductsEntityAssignmentsPage; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.d.ts b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.d.ts new file mode 100644 index 00000000..753935cd --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.d.ts @@ -0,0 +1,239 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type TrustProductsEvaluationsStatus = "compliant" | "noncompliant"; +/** + * Options to pass to create a TrustProductsEvaluationsInstance + */ +export interface TrustProductsEvaluationsListInstanceCreateOptions { + /** The unique string of a policy that is associated to the customer_profile resource. */ + policySid: string; +} +/** + * Options to pass to each + */ +export interface TrustProductsEvaluationsListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TrustProductsEvaluationsInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TrustProductsEvaluationsListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TrustProductsEvaluationsListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TrustProductsEvaluationsContext { + /** + * Fetch a TrustProductsEvaluationsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsEvaluationsInstance + */ + fetch(callback?: (error: Error | null, item?: TrustProductsEvaluationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface TrustProductsEvaluationsContextSolution { + trustProductSid: string; + sid: string; +} +export declare class TrustProductsEvaluationsContextImpl implements TrustProductsEvaluationsContext { + protected _version: V1; + protected _solution: TrustProductsEvaluationsContextSolution; + protected _uri: string; + constructor(_version: V1, trustProductSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: TrustProductsEvaluationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): TrustProductsEvaluationsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface TrustProductsEvaluationsPayload extends TwilioResponsePayload { + results: TrustProductsEvaluationsResource[]; +} +interface TrustProductsEvaluationsResource { + sid: string; + account_sid: string; + policy_sid: string; + trust_product_sid: string; + status: TrustProductsEvaluationsStatus; + results: Array; + date_created: Date; + url: string; +} +export declare class TrustProductsEvaluationsInstance { + protected _version: V1; + protected _solution: TrustProductsEvaluationsContextSolution; + protected _context?: TrustProductsEvaluationsContext; + constructor(_version: V1, payload: TrustProductsEvaluationsResource, trustProductSid: string, sid?: string); + /** + * The unique string that identifies the Evaluation resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the trust_product resource. + */ + accountSid: string; + /** + * The unique string of a policy that is associated to the trust_product resource. + */ + policySid: string; + /** + * The unique string that we created to identify the trust_product resource. + */ + trustProductSid: string; + status: TrustProductsEvaluationsStatus; + /** + * The results of the Evaluation which includes the valid and invalid attributes. + */ + results: Array; + dateCreated: Date; + url: string; + private get _proxy(); + /** + * Fetch a TrustProductsEvaluationsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsEvaluationsInstance + */ + fetch(callback?: (error: Error | null, item?: TrustProductsEvaluationsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + policySid: string; + trustProductSid: string; + status: TrustProductsEvaluationsStatus; + results: any[]; + dateCreated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface TrustProductsEvaluationsSolution { + trustProductSid: string; +} +export interface TrustProductsEvaluationsListInstance { + _version: V1; + _solution: TrustProductsEvaluationsSolution; + _uri: string; + (sid: string): TrustProductsEvaluationsContext; + get(sid: string): TrustProductsEvaluationsContext; + /** + * Create a TrustProductsEvaluationsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsEvaluationsInstance + */ + create(params: TrustProductsEvaluationsListInstanceCreateOptions, callback?: (error: Error | null, item?: TrustProductsEvaluationsInstance) => any): Promise; + /** + * Streams TrustProductsEvaluationsInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsEvaluationsListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TrustProductsEvaluationsInstance, done: (err?: Error) => void) => void): void; + each(params: TrustProductsEvaluationsListInstanceEachOptions, callback?: (item: TrustProductsEvaluationsInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TrustProductsEvaluationsInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TrustProductsEvaluationsPage) => any): Promise; + /** + * Lists TrustProductsEvaluationsInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsEvaluationsListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TrustProductsEvaluationsInstance[]) => any): Promise; + list(params: TrustProductsEvaluationsListInstanceOptions, callback?: (error: Error | null, items: TrustProductsEvaluationsInstance[]) => any): Promise; + /** + * Retrieve a single page of TrustProductsEvaluationsInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TrustProductsEvaluationsListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TrustProductsEvaluationsPage) => any): Promise; + page(params: TrustProductsEvaluationsListInstancePageOptions, callback?: (error: Error | null, items: TrustProductsEvaluationsPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TrustProductsEvaluationsListInstance(version: V1, trustProductSid: string): TrustProductsEvaluationsListInstance; +export declare class TrustProductsEvaluationsPage extends Page { + /** + * Initialize the TrustProductsEvaluationsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: TrustProductsEvaluationsSolution); + /** + * Build an instance of TrustProductsEvaluationsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TrustProductsEvaluationsResource): TrustProductsEvaluationsInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.js b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.js new file mode 100644 index 00000000..cdc82676 --- /dev/null +++ b/node_modules/twilio/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.js @@ -0,0 +1,212 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TrustProductsEvaluationsPage = exports.TrustProductsEvaluationsListInstance = exports.TrustProductsEvaluationsInstance = exports.TrustProductsEvaluationsContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class TrustProductsEvaluationsContextImpl { + constructor(_version, trustProductSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(trustProductSid)) { + throw new Error("Parameter 'trustProductSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { trustProductSid, sid }; + this._uri = `/TrustProducts/${trustProductSid}/Evaluations/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new TrustProductsEvaluationsInstance(operationVersion, payload, instance._solution.trustProductSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsEvaluationsContextImpl = TrustProductsEvaluationsContextImpl; +class TrustProductsEvaluationsInstance { + constructor(_version, payload, trustProductSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.policySid = payload.policy_sid; + this.trustProductSid = payload.trust_product_sid; + this.status = payload.status; + this.results = payload.results; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.url = payload.url; + this._solution = { trustProductSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new TrustProductsEvaluationsContextImpl(this._version, this._solution.trustProductSid, this._solution.sid); + return this._context; + } + /** + * Fetch a TrustProductsEvaluationsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed TrustProductsEvaluationsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + policySid: this.policySid, + trustProductSid: this.trustProductSid, + status: this.status, + results: this.results, + dateCreated: this.dateCreated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsEvaluationsInstance = TrustProductsEvaluationsInstance; +function TrustProductsEvaluationsListInstance(version, trustProductSid) { + if (!(0, utility_1.isValidPathParam)(trustProductSid)) { + throw new Error("Parameter 'trustProductSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new TrustProductsEvaluationsContextImpl(version, trustProductSid, sid); + }; + instance._version = version; + instance._solution = { trustProductSid }; + instance._uri = `/TrustProducts/${trustProductSid}/Evaluations`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["policySid"] === null || params["policySid"] === undefined) { + throw new Error("Required parameter \"params['policySid']\" missing."); + } + let data = {}; + data["PolicySid"] = params["policySid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsEvaluationsInstance(operationVersion, payload, instance._solution.trustProductSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TrustProductsEvaluationsPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TrustProductsEvaluationsPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TrustProductsEvaluationsListInstance = TrustProductsEvaluationsListInstance; +class TrustProductsEvaluationsPage extends Page_1.default { + /** + * Initialize the TrustProductsEvaluationsPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TrustProductsEvaluationsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TrustProductsEvaluationsInstance(this._version, payload, this._solution.trustProductSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TrustProductsEvaluationsPage = TrustProductsEvaluationsPage; diff --git a/node_modules/twilio/lib/rest/verify/V2.d.ts b/node_modules/twilio/lib/rest/verify/V2.d.ts new file mode 100644 index 00000000..64f442d2 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/V2.d.ts @@ -0,0 +1,40 @@ +import VerifyBase from "../VerifyBase"; +import Version from "../../base/Version"; +import { FormListInstance } from "./v2/form"; +import { SafelistListInstance } from "./v2/safelist"; +import { ServiceListInstance } from "./v2/service"; +import { TemplateListInstance } from "./v2/template"; +import { VerificationAttemptListInstance } from "./v2/verificationAttempt"; +import { VerificationAttemptsSummaryListInstance } from "./v2/verificationAttemptsSummary"; +export default class V2 extends Version { + /** + * Initialize the V2 version of Verify + * + * @param domain - The Twilio (Twilio.Verify) domain + */ + constructor(domain: VerifyBase); + /** forms - { Twilio.Verify.V2.FormListInstance } resource */ + protected _forms?: FormListInstance; + /** safelist - { Twilio.Verify.V2.SafelistListInstance } resource */ + protected _safelist?: SafelistListInstance; + /** services - { Twilio.Verify.V2.ServiceListInstance } resource */ + protected _services?: ServiceListInstance; + /** templates - { Twilio.Verify.V2.TemplateListInstance } resource */ + protected _templates?: TemplateListInstance; + /** verificationAttempts - { Twilio.Verify.V2.VerificationAttemptListInstance } resource */ + protected _verificationAttempts?: VerificationAttemptListInstance; + /** verificationAttemptsSummary - { Twilio.Verify.V2.VerificationAttemptsSummaryListInstance } resource */ + protected _verificationAttemptsSummary?: VerificationAttemptsSummaryListInstance; + /** Getter for forms resource */ + get forms(): FormListInstance; + /** Getter for safelist resource */ + get safelist(): SafelistListInstance; + /** Getter for services resource */ + get services(): ServiceListInstance; + /** Getter for templates resource */ + get templates(): TemplateListInstance; + /** Getter for verificationAttempts resource */ + get verificationAttempts(): VerificationAttemptListInstance; + /** Getter for verificationAttemptsSummary resource */ + get verificationAttemptsSummary(): VerificationAttemptsSummaryListInstance; +} diff --git a/node_modules/twilio/lib/rest/verify/V2.js b/node_modules/twilio/lib/rest/verify/V2.js new file mode 100644 index 00000000..9707e067 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/V2.js @@ -0,0 +1,69 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const form_1 = require("./v2/form"); +const safelist_1 = require("./v2/safelist"); +const service_1 = require("./v2/service"); +const template_1 = require("./v2/template"); +const verificationAttempt_1 = require("./v2/verificationAttempt"); +const verificationAttemptsSummary_1 = require("./v2/verificationAttemptsSummary"); +class V2 extends Version_1.default { + /** + * Initialize the V2 version of Verify + * + * @param domain - The Twilio (Twilio.Verify) domain + */ + constructor(domain) { + super(domain, "v2"); + } + /** Getter for forms resource */ + get forms() { + this._forms = this._forms || (0, form_1.FormListInstance)(this); + return this._forms; + } + /** Getter for safelist resource */ + get safelist() { + this._safelist = this._safelist || (0, safelist_1.SafelistListInstance)(this); + return this._safelist; + } + /** Getter for services resource */ + get services() { + this._services = this._services || (0, service_1.ServiceListInstance)(this); + return this._services; + } + /** Getter for templates resource */ + get templates() { + this._templates = this._templates || (0, template_1.TemplateListInstance)(this); + return this._templates; + } + /** Getter for verificationAttempts resource */ + get verificationAttempts() { + this._verificationAttempts = + this._verificationAttempts || (0, verificationAttempt_1.VerificationAttemptListInstance)(this); + return this._verificationAttempts; + } + /** Getter for verificationAttemptsSummary resource */ + get verificationAttemptsSummary() { + this._verificationAttemptsSummary = + this._verificationAttemptsSummary || + (0, verificationAttemptsSummary_1.VerificationAttemptsSummaryListInstance)(this); + return this._verificationAttemptsSummary; + } +} +exports.default = V2; diff --git a/node_modules/twilio/lib/rest/verify/v2/form.d.ts b/node_modules/twilio/lib/rest/verify/v2/form.d.ts new file mode 100644 index 00000000..533de7a7 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/form.d.ts @@ -0,0 +1,98 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +export type FormFormTypes = "form-push"; +export interface FormContext { + /** + * Fetch a FormInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FormInstance + */ + fetch(callback?: (error: Error | null, item?: FormInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FormContextSolution { + formType: FormFormTypes; +} +export declare class FormContextImpl implements FormContext { + protected _version: V2; + protected _solution: FormContextSolution; + protected _uri: string; + constructor(_version: V2, formType: FormFormTypes); + fetch(callback?: (error: Error | null, item?: FormInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FormContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FormResource { + form_type: FormFormTypes; + forms: any; + form_meta: any; + url: string; +} +export declare class FormInstance { + protected _version: V2; + protected _solution: FormContextSolution; + protected _context?: FormContext; + constructor(_version: V2, payload: FormResource, formType?: FormFormTypes); + formType: FormFormTypes; + /** + * Object that contains the available forms for this type. This available forms are given in the standard [JSON Schema](https://json-schema.org/) format + */ + forms: any; + /** + * Additional information for the available forms for this type. E.g. The separator string used for `binding` in a Factor push. + */ + formMeta: any; + /** + * The URL to access the forms for this type. + */ + url: string; + private get _proxy(); + /** + * Fetch a FormInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FormInstance + */ + fetch(callback?: (error: Error | null, item?: FormInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + formType: "form-push"; + forms: any; + formMeta: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FormSolution { +} +export interface FormListInstance { + _version: V2; + _solution: FormSolution; + _uri: string; + (formType: FormFormTypes): FormContext; + get(formType: FormFormTypes): FormContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FormListInstance(version: V2): FormListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/form.js b/node_modules/twilio/lib/rest/verify/v2/form.js new file mode 100644 index 00000000..0815113a --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/form.js @@ -0,0 +1,112 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FormListInstance = exports.FormInstance = exports.FormContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class FormContextImpl { + constructor(_version, formType) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(formType)) { + throw new Error("Parameter 'formType' is not valid."); + } + this._solution = { formType }; + this._uri = `/Forms/${formType}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FormInstance(operationVersion, payload, instance._solution.formType)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FormContextImpl = FormContextImpl; +class FormInstance { + constructor(_version, payload, formType) { + this._version = _version; + this.formType = payload.form_type; + this.forms = payload.forms; + this.formMeta = payload.form_meta; + this.url = payload.url; + this._solution = { formType: formType || this.formType }; + } + get _proxy() { + this._context = + this._context || + new FormContextImpl(this._version, this._solution.formType); + return this._context; + } + /** + * Fetch a FormInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FormInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + formType: this.formType, + forms: this.forms, + formMeta: this.formMeta, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FormInstance = FormInstance; +function FormListInstance(version) { + const instance = ((formType) => instance.get(formType)); + instance.get = function get(formType) { + return new FormContextImpl(version, formType); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FormListInstance = FormListInstance; diff --git a/node_modules/twilio/lib/rest/verify/v2/safelist.d.ts b/node_modules/twilio/lib/rest/verify/v2/safelist.d.ts new file mode 100644 index 00000000..74ae381a --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/safelist.d.ts @@ -0,0 +1,127 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +/** + * Options to pass to create a SafelistInstance + */ +export interface SafelistListInstanceCreateOptions { + /** The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ + phoneNumber: string; +} +export interface SafelistContext { + /** + * Remove a SafelistInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SafelistInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SafelistInstance + */ + fetch(callback?: (error: Error | null, item?: SafelistInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SafelistContextSolution { + phoneNumber: string; +} +export declare class SafelistContextImpl implements SafelistContext { + protected _version: V2; + protected _solution: SafelistContextSolution; + protected _uri: string; + constructor(_version: V2, phoneNumber: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SafelistInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SafelistContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SafelistResource { + sid: string; + phone_number: string; + url: string; +} +export declare class SafelistInstance { + protected _version: V2; + protected _solution: SafelistContextSolution; + protected _context?: SafelistContext; + constructor(_version: V2, payload: SafelistResource, phoneNumber?: string); + /** + * The unique string that we created to identify the SafeList resource. + */ + sid: string; + /** + * The phone number in SafeList. + */ + phoneNumber: string; + /** + * The absolute URL of the SafeList resource. + */ + url: string; + private get _proxy(); + /** + * Remove a SafelistInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SafelistInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SafelistInstance + */ + fetch(callback?: (error: Error | null, item?: SafelistInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + phoneNumber: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SafelistSolution { +} +export interface SafelistListInstance { + _version: V2; + _solution: SafelistSolution; + _uri: string; + (phoneNumber: string): SafelistContext; + get(phoneNumber: string): SafelistContext; + /** + * Create a SafelistInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SafelistInstance + */ + create(params: SafelistListInstanceCreateOptions, callback?: (error: Error | null, item?: SafelistInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SafelistListInstance(version: V2): SafelistListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/safelist.js b/node_modules/twilio/lib/rest/verify/v2/safelist.js new file mode 100644 index 00000000..915384c0 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/safelist.js @@ -0,0 +1,150 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SafelistListInstance = exports.SafelistInstance = exports.SafelistContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class SafelistContextImpl { + constructor(_version, phoneNumber) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(phoneNumber)) { + throw new Error("Parameter 'phoneNumber' is not valid."); + } + this._solution = { phoneNumber }; + this._uri = `/SafeList/Numbers/${phoneNumber}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SafelistInstance(operationVersion, payload, instance._solution.phoneNumber)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SafelistContextImpl = SafelistContextImpl; +class SafelistInstance { + constructor(_version, payload, phoneNumber) { + this._version = _version; + this.sid = payload.sid; + this.phoneNumber = payload.phone_number; + this.url = payload.url; + this._solution = { phoneNumber: phoneNumber || this.phoneNumber }; + } + get _proxy() { + this._context = + this._context || + new SafelistContextImpl(this._version, this._solution.phoneNumber); + return this._context; + } + /** + * Remove a SafelistInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SafelistInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SafelistInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + phoneNumber: this.phoneNumber, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SafelistInstance = SafelistInstance; +function SafelistListInstance(version) { + const instance = ((phoneNumber) => instance.get(phoneNumber)); + instance.get = function get(phoneNumber) { + return new SafelistContextImpl(version, phoneNumber); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/SafeList/Numbers`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) { + throw new Error("Required parameter \"params['phoneNumber']\" missing."); + } + let data = {}; + data["PhoneNumber"] = params["phoneNumber"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SafelistInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SafelistListInstance = SafelistListInstance; diff --git a/node_modules/twilio/lib/rest/verify/v2/service.d.ts b/node_modules/twilio/lib/rest/verify/v2/service.d.ts new file mode 100644 index 00000000..1b6c5e4a --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service.d.ts @@ -0,0 +1,491 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +import { AccessTokenListInstance } from "./service/accessToken"; +import { EntityListInstance } from "./service/entity"; +import { MessagingConfigurationListInstance } from "./service/messagingConfiguration"; +import { RateLimitListInstance } from "./service/rateLimit"; +import { VerificationListInstance } from "./service/verification"; +import { VerificationCheckListInstance } from "./service/verificationCheck"; +import { WebhookListInstance } from "./service/webhook"; +/** + * Options to pass to update a ServiceInstance + */ +export interface ServiceContextUpdateOptions { + /** A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** */ + friendlyName?: string; + /** The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. */ + codeLength?: number; + /** Whether to perform a lookup with each verification started and return info about the phone number. */ + lookupEnabled?: boolean; + /** Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. */ + skipSmsToLandlines?: boolean; + /** Whether to ask the user to press a number before delivering the verify code in a phone call. */ + dtmfInputRequired?: boolean; + /** The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. */ + ttsName?: string; + /** Whether to pass PSD2 transaction parameters when starting a verification. */ + psd2Enabled?: boolean; + /** Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** */ + doNotShareWarningEnabled?: boolean; + /** Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. */ + customCodeEnabled?: boolean; + /** Optional configuration for the Push factors. If true, include the date in the Challenge\\\'s response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. */ + "push.includeDate"?: boolean; + /** Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) */ + "push.apnCredentialSid"?: string; + /** Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) */ + "push.fcmCredentialSid"?: string; + /** Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. */ + "totp.issuer"?: string; + /** Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds */ + "totp.timeStep"?: number; + /** Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 */ + "totp.codeLength"?: number; + /** Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 */ + "totp.skew"?: number; + /** The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. */ + defaultTemplateSid?: string; + /** Whether to allow verifications from the service to reach the stream-events sinks if configured */ + verifyEventSubscriptionEnabled?: boolean; +} +/** + * Options to pass to create a ServiceInstance + */ +export interface ServiceListInstanceCreateOptions { + /** A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** */ + friendlyName: string; + /** The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. */ + codeLength?: number; + /** Whether to perform a lookup with each verification started and return info about the phone number. */ + lookupEnabled?: boolean; + /** Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. */ + skipSmsToLandlines?: boolean; + /** Whether to ask the user to press a number before delivering the verify code in a phone call. */ + dtmfInputRequired?: boolean; + /** The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. */ + ttsName?: string; + /** Whether to pass PSD2 transaction parameters when starting a verification. */ + psd2Enabled?: boolean; + /** Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` */ + doNotShareWarningEnabled?: boolean; + /** Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. */ + customCodeEnabled?: boolean; + /** Optional configuration for the Push factors. If true, include the date in the Challenge\\\'s response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. */ + "push.includeDate"?: boolean; + /** Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) */ + "push.apnCredentialSid"?: string; + /** Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) */ + "push.fcmCredentialSid"?: string; + /** Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. */ + "totp.issuer"?: string; + /** Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds */ + "totp.timeStep"?: number; + /** Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 */ + "totp.codeLength"?: number; + /** Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 */ + "totp.skew"?: number; + /** The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. */ + defaultTemplateSid?: string; + /** Whether to allow verifications from the service to reach the stream-events sinks if configured */ + verifyEventSubscriptionEnabled?: boolean; +} +/** + * Options to pass to each + */ +export interface ServiceListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ServiceListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ServiceListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ServiceContext { + accessTokens: AccessTokenListInstance; + entities: EntityListInstance; + messagingConfigurations: MessagingConfigurationListInstance; + rateLimits: RateLimitListInstance; + verifications: VerificationListInstance; + verificationChecks: VerificationCheckListInstance; + webhooks: WebhookListInstance; + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ServiceContextSolution { + sid: string; +} +export declare class ServiceContextImpl implements ServiceContext { + protected _version: V2; + protected _solution: ServiceContextSolution; + protected _uri: string; + protected _accessTokens?: AccessTokenListInstance; + protected _entities?: EntityListInstance; + protected _messagingConfigurations?: MessagingConfigurationListInstance; + protected _rateLimits?: RateLimitListInstance; + protected _verifications?: VerificationListInstance; + protected _verificationChecks?: VerificationCheckListInstance; + protected _webhooks?: WebhookListInstance; + constructor(_version: V2, sid: string); + get accessTokens(): AccessTokenListInstance; + get entities(): EntityListInstance; + get messagingConfigurations(): MessagingConfigurationListInstance; + get rateLimits(): RateLimitListInstance; + get verifications(): VerificationListInstance; + get verificationChecks(): VerificationCheckListInstance; + get webhooks(): WebhookListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ServiceContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ServicePayload extends TwilioResponsePayload { + services: ServiceResource[]; +} +interface ServiceResource { + sid: string; + account_sid: string; + friendly_name: string; + code_length: number; + lookup_enabled: boolean; + psd2_enabled: boolean; + skip_sms_to_landlines: boolean; + dtmf_input_required: boolean; + tts_name: string; + do_not_share_warning_enabled: boolean; + custom_code_enabled: boolean; + push: any; + totp: any; + default_template_sid: string; + verify_event_subscription_enabled: boolean; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ServiceInstance { + protected _version: V2; + protected _solution: ServiceContextSolution; + protected _context?: ServiceContext; + constructor(_version: V2, payload: ServiceResource, sid?: string); + /** + * The unique string that we created to identify the Service resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** + */ + friendlyName: string; + /** + * The length of the verification code to generate. + */ + codeLength: number; + /** + * Whether to perform a lookup with each verification started and return info about the phone number. + */ + lookupEnabled: boolean; + /** + * Whether to pass PSD2 transaction parameters when starting a verification. + */ + psd2Enabled: boolean; + /** + * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + */ + skipSmsToLandlines: boolean; + /** + * Whether to ask the user to press a number before delivering the verify code in a phone call. + */ + dtmfInputRequired: boolean; + /** + * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + */ + ttsName: string; + /** + * Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` + */ + doNotShareWarningEnabled: boolean; + /** + * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + */ + customCodeEnabled: boolean; + /** + * Configurations for the Push factors (channel) created under this Service. + */ + push: any; + /** + * Configurations for the TOTP factors (channel) created under this Service. + */ + totp: any; + defaultTemplateSid: string; + /** + * Whether to allow verifications from the service to reach the stream-events sinks if configured + */ + verifyEventSubscriptionEnabled: boolean; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Update a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Access the accessTokens. + */ + accessTokens(): AccessTokenListInstance; + /** + * Access the entities. + */ + entities(): EntityListInstance; + /** + * Access the messagingConfigurations. + */ + messagingConfigurations(): MessagingConfigurationListInstance; + /** + * Access the rateLimits. + */ + rateLimits(): RateLimitListInstance; + /** + * Access the verifications. + */ + verifications(): VerificationListInstance; + /** + * Access the verificationChecks. + */ + verificationChecks(): VerificationCheckListInstance; + /** + * Access the webhooks. + */ + webhooks(): WebhookListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + codeLength: number; + lookupEnabled: boolean; + psd2Enabled: boolean; + skipSmsToLandlines: boolean; + dtmfInputRequired: boolean; + ttsName: string; + doNotShareWarningEnabled: boolean; + customCodeEnabled: boolean; + push: any; + totp: any; + defaultTemplateSid: string; + verifyEventSubscriptionEnabled: boolean; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ServiceSolution { +} +export interface ServiceListInstance { + _version: V2; + _solution: ServiceSolution; + _uri: string; + (sid: string): ServiceContext; + get(sid: string): ServiceContext; + /** + * Create a ServiceInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise; + /** + * Streams ServiceInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Lists ServiceInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; + /** + * Retrieve a single page of ServiceInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ServiceListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ServicePage) => any): Promise; + page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ServiceListInstance(version: V2): ServiceListInstance; +export declare class ServicePage extends Page { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ServiceSolution); + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ServiceResource): ServiceInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service.js b/node_modules/twilio/lib/rest/verify/v2/service.js new file mode 100644 index 00000000..03453a07 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service.js @@ -0,0 +1,433 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const accessToken_1 = require("./service/accessToken"); +const entity_1 = require("./service/entity"); +const messagingConfiguration_1 = require("./service/messagingConfiguration"); +const rateLimit_1 = require("./service/rateLimit"); +const verification_1 = require("./service/verification"); +const verificationCheck_1 = require("./service/verificationCheck"); +const webhook_1 = require("./service/webhook"); +class ServiceContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Services/${sid}`; + } + get accessTokens() { + this._accessTokens = + this._accessTokens || + (0, accessToken_1.AccessTokenListInstance)(this._version, this._solution.sid); + return this._accessTokens; + } + get entities() { + this._entities = + this._entities || (0, entity_1.EntityListInstance)(this._version, this._solution.sid); + return this._entities; + } + get messagingConfigurations() { + this._messagingConfigurations = + this._messagingConfigurations || + (0, messagingConfiguration_1.MessagingConfigurationListInstance)(this._version, this._solution.sid); + return this._messagingConfigurations; + } + get rateLimits() { + this._rateLimits = + this._rateLimits || + (0, rateLimit_1.RateLimitListInstance)(this._version, this._solution.sid); + return this._rateLimits; + } + get verifications() { + this._verifications = + this._verifications || + (0, verification_1.VerificationListInstance)(this._version, this._solution.sid); + return this._verifications; + } + get verificationChecks() { + this._verificationChecks = + this._verificationChecks || + (0, verificationCheck_1.VerificationCheckListInstance)(this._version, this._solution.sid); + return this._verificationChecks; + } + get webhooks() { + this._webhooks = + this._webhooks || (0, webhook_1.WebhookListInstance)(this._version, this._solution.sid); + return this._webhooks; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["codeLength"] !== undefined) + data["CodeLength"] = params["codeLength"]; + if (params["lookupEnabled"] !== undefined) + data["LookupEnabled"] = serialize.bool(params["lookupEnabled"]); + if (params["skipSmsToLandlines"] !== undefined) + data["SkipSmsToLandlines"] = serialize.bool(params["skipSmsToLandlines"]); + if (params["dtmfInputRequired"] !== undefined) + data["DtmfInputRequired"] = serialize.bool(params["dtmfInputRequired"]); + if (params["ttsName"] !== undefined) + data["TtsName"] = params["ttsName"]; + if (params["psd2Enabled"] !== undefined) + data["Psd2Enabled"] = serialize.bool(params["psd2Enabled"]); + if (params["doNotShareWarningEnabled"] !== undefined) + data["DoNotShareWarningEnabled"] = serialize.bool(params["doNotShareWarningEnabled"]); + if (params["customCodeEnabled"] !== undefined) + data["CustomCodeEnabled"] = serialize.bool(params["customCodeEnabled"]); + if (params["push.includeDate"] !== undefined) + data["Push.IncludeDate"] = serialize.bool(params["push.includeDate"]); + if (params["push.apnCredentialSid"] !== undefined) + data["Push.ApnCredentialSid"] = params["push.apnCredentialSid"]; + if (params["push.fcmCredentialSid"] !== undefined) + data["Push.FcmCredentialSid"] = params["push.fcmCredentialSid"]; + if (params["totp.issuer"] !== undefined) + data["Totp.Issuer"] = params["totp.issuer"]; + if (params["totp.timeStep"] !== undefined) + data["Totp.TimeStep"] = params["totp.timeStep"]; + if (params["totp.codeLength"] !== undefined) + data["Totp.CodeLength"] = params["totp.codeLength"]; + if (params["totp.skew"] !== undefined) + data["Totp.Skew"] = params["totp.skew"]; + if (params["defaultTemplateSid"] !== undefined) + data["DefaultTemplateSid"] = params["defaultTemplateSid"]; + if (params["verifyEventSubscriptionEnabled"] !== undefined) + data["VerifyEventSubscriptionEnabled"] = serialize.bool(params["verifyEventSubscriptionEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceContextImpl = ServiceContextImpl; +class ServiceInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.codeLength = deserialize.integer(payload.code_length); + this.lookupEnabled = payload.lookup_enabled; + this.psd2Enabled = payload.psd2_enabled; + this.skipSmsToLandlines = payload.skip_sms_to_landlines; + this.dtmfInputRequired = payload.dtmf_input_required; + this.ttsName = payload.tts_name; + this.doNotShareWarningEnabled = payload.do_not_share_warning_enabled; + this.customCodeEnabled = payload.custom_code_enabled; + this.push = payload.push; + this.totp = payload.totp; + this.defaultTemplateSid = payload.default_template_sid; + this.verifyEventSubscriptionEnabled = + payload.verify_event_subscription_enabled; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ServiceContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ServiceInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ServiceInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the accessTokens. + */ + accessTokens() { + return this._proxy.accessTokens; + } + /** + * Access the entities. + */ + entities() { + return this._proxy.entities; + } + /** + * Access the messagingConfigurations. + */ + messagingConfigurations() { + return this._proxy.messagingConfigurations; + } + /** + * Access the rateLimits. + */ + rateLimits() { + return this._proxy.rateLimits; + } + /** + * Access the verifications. + */ + verifications() { + return this._proxy.verifications; + } + /** + * Access the verificationChecks. + */ + verificationChecks() { + return this._proxy.verificationChecks; + } + /** + * Access the webhooks. + */ + webhooks() { + return this._proxy.webhooks; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + codeLength: this.codeLength, + lookupEnabled: this.lookupEnabled, + psd2Enabled: this.psd2Enabled, + skipSmsToLandlines: this.skipSmsToLandlines, + dtmfInputRequired: this.dtmfInputRequired, + ttsName: this.ttsName, + doNotShareWarningEnabled: this.doNotShareWarningEnabled, + customCodeEnabled: this.customCodeEnabled, + push: this.push, + totp: this.totp, + defaultTemplateSid: this.defaultTemplateSid, + verifyEventSubscriptionEnabled: this.verifyEventSubscriptionEnabled, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServiceInstance = ServiceInstance; +function ServiceListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ServiceContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Services`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["codeLength"] !== undefined) + data["CodeLength"] = params["codeLength"]; + if (params["lookupEnabled"] !== undefined) + data["LookupEnabled"] = serialize.bool(params["lookupEnabled"]); + if (params["skipSmsToLandlines"] !== undefined) + data["SkipSmsToLandlines"] = serialize.bool(params["skipSmsToLandlines"]); + if (params["dtmfInputRequired"] !== undefined) + data["DtmfInputRequired"] = serialize.bool(params["dtmfInputRequired"]); + if (params["ttsName"] !== undefined) + data["TtsName"] = params["ttsName"]; + if (params["psd2Enabled"] !== undefined) + data["Psd2Enabled"] = serialize.bool(params["psd2Enabled"]); + if (params["doNotShareWarningEnabled"] !== undefined) + data["DoNotShareWarningEnabled"] = serialize.bool(params["doNotShareWarningEnabled"]); + if (params["customCodeEnabled"] !== undefined) + data["CustomCodeEnabled"] = serialize.bool(params["customCodeEnabled"]); + if (params["push.includeDate"] !== undefined) + data["Push.IncludeDate"] = serialize.bool(params["push.includeDate"]); + if (params["push.apnCredentialSid"] !== undefined) + data["Push.ApnCredentialSid"] = params["push.apnCredentialSid"]; + if (params["push.fcmCredentialSid"] !== undefined) + data["Push.FcmCredentialSid"] = params["push.fcmCredentialSid"]; + if (params["totp.issuer"] !== undefined) + data["Totp.Issuer"] = params["totp.issuer"]; + if (params["totp.timeStep"] !== undefined) + data["Totp.TimeStep"] = params["totp.timeStep"]; + if (params["totp.codeLength"] !== undefined) + data["Totp.CodeLength"] = params["totp.codeLength"]; + if (params["totp.skew"] !== undefined) + data["Totp.Skew"] = params["totp.skew"]; + if (params["defaultTemplateSid"] !== undefined) + data["DefaultTemplateSid"] = params["defaultTemplateSid"]; + if (params["verifyEventSubscriptionEnabled"] !== undefined) + data["VerifyEventSubscriptionEnabled"] = serialize.bool(params["verifyEventSubscriptionEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ServiceListInstance = ServiceListInstance; +class ServicePage extends Page_1.default { + /** + * Initialize the ServicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ServiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ServiceInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ServicePage = ServicePage; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/accessToken.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/accessToken.d.ts new file mode 100644 index 00000000..8646b677 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/accessToken.d.ts @@ -0,0 +1,158 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../V2"; +export type AccessTokenFactorTypes = "push"; +/** + * Options to pass to create a AccessTokenInstance + */ +export interface AccessTokenListInstanceCreateOptions { + /** The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user\\\'s UUID, GUID, or SID. */ + identity: string; + /** */ + factorType: AccessTokenFactorTypes; + /** The friendly name of the factor that is going to be created with this access token */ + factorFriendlyName?: string; + /** How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. */ + ttl?: number; +} +export interface AccessTokenContext { + /** + * Fetch a AccessTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccessTokenInstance + */ + fetch(callback?: (error: Error | null, item?: AccessTokenInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AccessTokenContextSolution { + serviceSid: string; + sid: string; +} +export declare class AccessTokenContextImpl implements AccessTokenContext { + protected _version: V2; + protected _solution: AccessTokenContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: AccessTokenInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AccessTokenContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AccessTokenResource { + sid: string; + account_sid: string; + service_sid: string; + entity_identity: string; + factor_type: AccessTokenFactorTypes; + factor_friendly_name: string; + token: string; + url: string; + ttl: number; + date_created: Date; +} +export declare class AccessTokenInstance { + protected _version: V2; + protected _solution: AccessTokenContextSolution; + protected _context?: AccessTokenContext; + constructor(_version: V2, payload: AccessTokenResource, serviceSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this Access Token. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Verify Service. + */ + serviceSid: string; + /** + * The unique external identifier for the Entity of the Service. + */ + entityIdentity: string; + factorType: AccessTokenFactorTypes; + /** + * A human readable description of this factor, up to 64 characters. For a push factor, this can be the device\'s name. + */ + factorFriendlyName: string; + /** + * The access token generated for enrollment, this is an encrypted json web token. + */ + token: string; + /** + * The URL of this resource. + */ + url: string; + /** + * How long, in seconds, the access token is valid. Max: 5 minutes + */ + ttl: number; + /** + * The date that this access token was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + private get _proxy(); + /** + * Fetch a AccessTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccessTokenInstance + */ + fetch(callback?: (error: Error | null, item?: AccessTokenInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + entityIdentity: string; + factorType: "push"; + factorFriendlyName: string; + token: string; + url: string; + ttl: number; + dateCreated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AccessTokenSolution { + serviceSid: string; +} +export interface AccessTokenListInstance { + _version: V2; + _solution: AccessTokenSolution; + _uri: string; + (sid: string): AccessTokenContext; + get(sid: string): AccessTokenContext; + /** + * Create a AccessTokenInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccessTokenInstance + */ + create(params: AccessTokenListInstanceCreateOptions, callback?: (error: Error | null, item?: AccessTokenInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AccessTokenListInstance(version: V2, serviceSid: string): AccessTokenListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/accessToken.js b/node_modules/twilio/lib/rest/verify/v2/service/accessToken.js new file mode 100644 index 00000000..7fe5ab0b --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/accessToken.js @@ -0,0 +1,159 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AccessTokenListInstance = exports.AccessTokenInstance = exports.AccessTokenContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class AccessTokenContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/AccessTokens/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new AccessTokenInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccessTokenContextImpl = AccessTokenContextImpl; +class AccessTokenInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.entityIdentity = payload.entity_identity; + this.factorType = payload.factor_type; + this.factorFriendlyName = payload.factor_friendly_name; + this.token = payload.token; + this.url = payload.url; + this.ttl = deserialize.integer(payload.ttl); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new AccessTokenContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Fetch a AccessTokenInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AccessTokenInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + entityIdentity: this.entityIdentity, + factorType: this.factorType, + factorFriendlyName: this.factorFriendlyName, + token: this.token, + url: this.url, + ttl: this.ttl, + dateCreated: this.dateCreated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AccessTokenInstance = AccessTokenInstance; +function AccessTokenListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new AccessTokenContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/AccessTokens`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + if (params["factorType"] === null || params["factorType"] === undefined) { + throw new Error("Required parameter \"params['factorType']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + data["FactorType"] = params["factorType"]; + if (params["factorFriendlyName"] !== undefined) + data["FactorFriendlyName"] = params["factorFriendlyName"]; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new AccessTokenInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AccessTokenListInstance = AccessTokenListInstance; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/entity.d.ts new file mode 100644 index 00000000..9b1a27f6 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity.d.ts @@ -0,0 +1,288 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { ChallengeListInstance } from "./entity/challenge"; +import { FactorListInstance } from "./entity/factor"; +import { NewFactorListInstance } from "./entity/newFactor"; +/** + * Options to pass to create a EntityInstance + */ +export interface EntityListInstanceCreateOptions { + /** The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user\\\'s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ + identity: string; +} +/** + * Options to pass to each + */ +export interface EntityListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: EntityInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface EntityListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface EntityListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface EntityContext { + challenges: ChallengeListInstance; + factors: FactorListInstance; + newFactors: NewFactorListInstance; + /** + * Remove a EntityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EntityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EntityInstance + */ + fetch(callback?: (error: Error | null, item?: EntityInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface EntityContextSolution { + serviceSid: string; + identity: string; +} +export declare class EntityContextImpl implements EntityContext { + protected _version: V2; + protected _solution: EntityContextSolution; + protected _uri: string; + protected _challenges?: ChallengeListInstance; + protected _factors?: FactorListInstance; + protected _newFactors?: NewFactorListInstance; + constructor(_version: V2, serviceSid: string, identity: string); + get challenges(): ChallengeListInstance; + get factors(): FactorListInstance; + get newFactors(): NewFactorListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: EntityInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): EntityContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface EntityPayload extends TwilioResponsePayload { + entities: EntityResource[]; +} +interface EntityResource { + sid: string; + identity: string; + account_sid: string; + service_sid: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class EntityInstance { + protected _version: V2; + protected _solution: EntityContextSolution; + protected _context?: EntityContext; + constructor(_version: V2, payload: EntityResource, serviceSid: string, identity?: string); + /** + * A 34 character string that uniquely identifies this Entity. + */ + sid: string; + /** + * The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user\'s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + */ + identity: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Service. + */ + serviceSid: string; + /** + * The date that this Entity was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date that this Entity was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The URL of this resource. + */ + url: string; + /** + * Contains a dictionary of URL links to nested resources of this Entity. + */ + links: Record; + private get _proxy(); + /** + * Remove a EntityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a EntityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EntityInstance + */ + fetch(callback?: (error: Error | null, item?: EntityInstance) => any): Promise; + /** + * Access the challenges. + */ + challenges(): ChallengeListInstance; + /** + * Access the factors. + */ + factors(): FactorListInstance; + /** + * Access the newFactors. + */ + newFactors(): NewFactorListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + identity: string; + accountSid: string; + serviceSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface EntitySolution { + serviceSid: string; +} +export interface EntityListInstance { + _version: V2; + _solution: EntitySolution; + _uri: string; + (identity: string): EntityContext; + get(identity: string): EntityContext; + /** + * Create a EntityInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EntityInstance + */ + create(params: EntityListInstanceCreateOptions, callback?: (error: Error | null, item?: EntityInstance) => any): Promise; + /** + * Streams EntityInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EntityListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: EntityInstance, done: (err?: Error) => void) => void): void; + each(params: EntityListInstanceEachOptions, callback?: (item: EntityInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of EntityInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: EntityPage) => any): Promise; + /** + * Lists EntityInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EntityListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: EntityInstance[]) => any): Promise; + list(params: EntityListInstanceOptions, callback?: (error: Error | null, items: EntityInstance[]) => any): Promise; + /** + * Retrieve a single page of EntityInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { EntityListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: EntityPage) => any): Promise; + page(params: EntityListInstancePageOptions, callback?: (error: Error | null, items: EntityPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function EntityListInstance(version: V2, serviceSid: string): EntityListInstance; +export declare class EntityPage extends Page { + /** + * Initialize the EntityPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: EntitySolution); + /** + * Build an instance of EntityInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: EntityResource): EntityInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity.js b/node_modules/twilio/lib/rest/verify/v2/service/entity.js new file mode 100644 index 00000000..81606bff --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity.js @@ -0,0 +1,270 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EntityPage = exports.EntityListInstance = exports.EntityInstance = exports.EntityContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const challenge_1 = require("./entity/challenge"); +const factor_1 = require("./entity/factor"); +const newFactor_1 = require("./entity/newFactor"); +class EntityContextImpl { + constructor(_version, serviceSid, identity) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + this._solution = { serviceSid, identity }; + this._uri = `/Services/${serviceSid}/Entities/${identity}`; + } + get challenges() { + this._challenges = + this._challenges || + (0, challenge_1.ChallengeListInstance)(this._version, this._solution.serviceSid, this._solution.identity); + return this._challenges; + } + get factors() { + this._factors = + this._factors || + (0, factor_1.FactorListInstance)(this._version, this._solution.serviceSid, this._solution.identity); + return this._factors; + } + get newFactors() { + this._newFactors = + this._newFactors || + (0, newFactor_1.NewFactorListInstance)(this._version, this._solution.serviceSid, this._solution.identity); + return this._newFactors; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new EntityInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EntityContextImpl = EntityContextImpl; +class EntityInstance { + constructor(_version, payload, serviceSid, identity) { + this._version = _version; + this.sid = payload.sid; + this.identity = payload.identity; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, identity: identity || this.identity }; + } + get _proxy() { + this._context = + this._context || + new EntityContextImpl(this._version, this._solution.serviceSid, this._solution.identity); + return this._context; + } + /** + * Remove a EntityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a EntityInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed EntityInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the challenges. + */ + challenges() { + return this._proxy.challenges; + } + /** + * Access the factors. + */ + factors() { + return this._proxy.factors; + } + /** + * Access the newFactors. + */ + newFactors() { + return this._proxy.newFactors; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + identity: this.identity, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EntityInstance = EntityInstance; +function EntityListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((identity) => instance.get(identity)); + instance.get = function get(identity) { + return new EntityContextImpl(version, serviceSid, identity); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Entities`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["identity"] === null || params["identity"] === undefined) { + throw new Error("Required parameter \"params['identity']\" missing."); + } + let data = {}; + data["Identity"] = params["identity"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EntityInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new EntityPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new EntityPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.EntityListInstance = EntityListInstance; +class EntityPage extends Page_1.default { + /** + * Initialize the EntityPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of EntityInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new EntityInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.EntityPage = EntityPage; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge.d.ts new file mode 100644 index 00000000..237bf4ab --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge.d.ts @@ -0,0 +1,384 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +import { NotificationListInstance } from "./challenge/notification"; +export type ChallengeChallengeReasons = "none" | "not_needed" | "not_requested"; +export type ChallengeChallengeStatuses = "pending" | "expired" | "approved" | "denied"; +export type ChallengeFactorTypes = "push" | "totp"; +export type ChallengeListOrders = "asc" | "desc"; +/** + * Options to pass to update a ChallengeInstance + */ +export interface ChallengeContextUpdateOptions { + /** The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length */ + authPayload?: string; + /** Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. */ + metadata?: any; +} +/** + * Options to pass to create a ChallengeInstance + */ +export interface ChallengeListInstanceCreateOptions { + /** The unique SID identifier of the Factor. */ + factorSid: string; + /** The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. */ + expirationDate?: Date; + /** Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length */ + "details.message"?: string; + /** A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. */ + "details.fields"?: Array; + /** Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length */ + hiddenDetails?: any; + /** Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. */ + authPayload?: string; +} +/** + * Options to pass to each + */ +export interface ChallengeListInstanceEachOptions { + /** The unique SID identifier of the Factor. */ + factorSid?: string; + /** The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. */ + status?: ChallengeChallengeStatuses; + /** The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. */ + order?: ChallengeListOrders; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ChallengeInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ChallengeListInstanceOptions { + /** The unique SID identifier of the Factor. */ + factorSid?: string; + /** The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. */ + status?: ChallengeChallengeStatuses; + /** The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. */ + order?: ChallengeListOrders; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ChallengeListInstancePageOptions { + /** The unique SID identifier of the Factor. */ + factorSid?: string; + /** The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. */ + status?: ChallengeChallengeStatuses; + /** The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. */ + order?: ChallengeListOrders; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ChallengeContext { + notifications: NotificationListInstance; + /** + * Fetch a ChallengeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChallengeInstance + */ + fetch(callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + /** + * Update a ChallengeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChallengeInstance + */ + update(callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + /** + * Update a ChallengeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChallengeInstance + */ + update(params: ChallengeContextUpdateOptions, callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ChallengeContextSolution { + serviceSid: string; + identity: string; + sid: string; +} +export declare class ChallengeContextImpl implements ChallengeContext { + protected _version: V2; + protected _solution: ChallengeContextSolution; + protected _uri: string; + protected _notifications?: NotificationListInstance; + constructor(_version: V2, serviceSid: string, identity: string, sid: string); + get notifications(): NotificationListInstance; + fetch(callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + update(params?: ChallengeContextUpdateOptions | ((error: Error | null, item?: ChallengeInstance) => any), callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ChallengeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ChallengePayload extends TwilioResponsePayload { + challenges: ChallengeResource[]; +} +interface ChallengeResource { + sid: string; + account_sid: string; + service_sid: string; + entity_sid: string; + identity: string; + factor_sid: string; + date_created: Date; + date_updated: Date; + date_responded: Date; + expiration_date: Date; + status: ChallengeChallengeStatuses; + responded_reason: ChallengeChallengeReasons; + details: any; + hidden_details: any; + metadata: any; + factor_type: ChallengeFactorTypes; + url: string; + links: Record; +} +export declare class ChallengeInstance { + protected _version: V2; + protected _solution: ChallengeContextSolution; + protected _context?: ChallengeContext; + constructor(_version: V2, payload: ChallengeResource, serviceSid: string, identity: string, sid?: string); + /** + * A 34 character string that uniquely identifies this Challenge. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Service. + */ + serviceSid: string; + /** + * The unique SID identifier of the Entity. + */ + entitySid: string; + /** + * Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user\'s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + */ + identity: string; + /** + * The unique SID identifier of the Factor. + */ + factorSid: string; + /** + * The date that this Challenge was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date that this Challenge was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The date that this Challenge was responded, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateResponded: Date; + /** + * The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. + */ + expirationDate: Date; + status: ChallengeChallengeStatuses; + respondedReason: ChallengeChallengeReasons; + /** + * Details provided to give context about the Challenge. Intended to be shown to the end user. + */ + details: any; + /** + * Details provided to give context about the Challenge. Intended to be hidden from the end user. It must be a stringified JSON with only strings values eg. `{\"ip\": \"172.168.1.234\"}` + */ + hiddenDetails: any; + /** + * Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\"os\": \"Android\"}`. Can be up to 1024 characters in length. + */ + metadata: any; + factorType: ChallengeFactorTypes; + /** + * The URL of this resource. + */ + url: string; + /** + * Contains a dictionary of URL links to nested resources of this Challenge. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ChallengeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChallengeInstance + */ + fetch(callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + /** + * Update a ChallengeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChallengeInstance + */ + update(callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + /** + * Update a ChallengeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChallengeInstance + */ + update(params: ChallengeContextUpdateOptions, callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + /** + * Access the notifications. + */ + notifications(): NotificationListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + entitySid: string; + identity: string; + factorSid: string; + dateCreated: Date; + dateUpdated: Date; + dateResponded: Date; + expirationDate: Date; + status: ChallengeChallengeStatuses; + respondedReason: ChallengeChallengeReasons; + details: any; + hiddenDetails: any; + metadata: any; + factorType: ChallengeFactorTypes; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ChallengeSolution { + serviceSid: string; + identity: string; +} +export interface ChallengeListInstance { + _version: V2; + _solution: ChallengeSolution; + _uri: string; + (sid: string): ChallengeContext; + get(sid: string): ChallengeContext; + /** + * Create a ChallengeInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChallengeInstance + */ + create(params: ChallengeListInstanceCreateOptions, callback?: (error: Error | null, item?: ChallengeInstance) => any): Promise; + /** + * Streams ChallengeInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChallengeListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ChallengeInstance, done: (err?: Error) => void) => void): void; + each(params: ChallengeListInstanceEachOptions, callback?: (item: ChallengeInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ChallengeInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ChallengePage) => any): Promise; + /** + * Lists ChallengeInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChallengeListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ChallengeInstance[]) => any): Promise; + list(params: ChallengeListInstanceOptions, callback?: (error: Error | null, items: ChallengeInstance[]) => any): Promise; + /** + * Retrieve a single page of ChallengeInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ChallengeListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ChallengePage) => any): Promise; + page(params: ChallengeListInstancePageOptions, callback?: (error: Error | null, items: ChallengePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ChallengeListInstance(version: V2, serviceSid: string, identity: string): ChallengeListInstance; +export declare class ChallengePage extends Page { + /** + * Initialize the ChallengePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: ChallengeSolution); + /** + * Build an instance of ChallengeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ChallengeResource): ChallengeInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge.js b/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge.js new file mode 100644 index 00000000..a6632dad --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge.js @@ -0,0 +1,296 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChallengePage = exports.ChallengeListInstance = exports.ChallengeInstance = exports.ChallengeContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +const notification_1 = require("./challenge/notification"); +class ChallengeContextImpl { + constructor(_version, serviceSid, identity, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, identity, sid }; + this._uri = `/Services/${serviceSid}/Entities/${identity}/Challenges/${sid}`; + } + get notifications() { + this._notifications = + this._notifications || + (0, notification_1.NotificationListInstance)(this._version, this._solution.serviceSid, this._solution.identity, this._solution.sid); + return this._notifications; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ChallengeInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.identity, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["authPayload"] !== undefined) + data["AuthPayload"] = params["authPayload"]; + if (params["metadata"] !== undefined) + data["Metadata"] = serialize.object(params["metadata"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChallengeInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.identity, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChallengeContextImpl = ChallengeContextImpl; +class ChallengeInstance { + constructor(_version, payload, serviceSid, identity, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.entitySid = payload.entity_sid; + this.identity = payload.identity; + this.factorSid = payload.factor_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.dateResponded = deserialize.iso8601DateTime(payload.date_responded); + this.expirationDate = deserialize.iso8601DateTime(payload.expiration_date); + this.status = payload.status; + this.respondedReason = payload.responded_reason; + this.details = payload.details; + this.hiddenDetails = payload.hidden_details; + this.metadata = payload.metadata; + this.factorType = payload.factor_type; + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, identity, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ChallengeContextImpl(this._version, this._solution.serviceSid, this._solution.identity, this._solution.sid); + return this._context; + } + /** + * Fetch a ChallengeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ChallengeInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the notifications. + */ + notifications() { + return this._proxy.notifications; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + entitySid: this.entitySid, + identity: this.identity, + factorSid: this.factorSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + dateResponded: this.dateResponded, + expirationDate: this.expirationDate, + status: this.status, + respondedReason: this.respondedReason, + details: this.details, + hiddenDetails: this.hiddenDetails, + metadata: this.metadata, + factorType: this.factorType, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChallengeInstance = ChallengeInstance; +function ChallengeListInstance(version, serviceSid, identity) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ChallengeContextImpl(version, serviceSid, identity, sid); + }; + instance._version = version; + instance._solution = { serviceSid, identity }; + instance._uri = `/Services/${serviceSid}/Entities/${identity}/Challenges`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["factorSid"] === null || params["factorSid"] === undefined) { + throw new Error("Required parameter \"params['factorSid']\" missing."); + } + let data = {}; + data["FactorSid"] = params["factorSid"]; + if (params["expirationDate"] !== undefined) + data["ExpirationDate"] = serialize.iso8601DateTime(params["expirationDate"]); + if (params["details.message"] !== undefined) + data["Details.Message"] = params["details.message"]; + if (params["details.fields"] !== undefined) + data["Details.Fields"] = serialize.map(params["details.fields"], (e) => serialize.object(e)); + if (params["hiddenDetails"] !== undefined) + data["HiddenDetails"] = serialize.object(params["hiddenDetails"]); + if (params["authPayload"] !== undefined) + data["AuthPayload"] = params["authPayload"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChallengeInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["factorSid"] !== undefined) + data["FactorSid"] = params["factorSid"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["order"] !== undefined) + data["Order"] = params["order"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ChallengePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ChallengePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ChallengeListInstance = ChallengeListInstance; +class ChallengePage extends Page_1.default { + /** + * Initialize the ChallengePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ChallengeInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ChallengeInstance(this._version, payload, this._solution.serviceSid, this._solution.identity); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ChallengePage = ChallengePage; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge/notification.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge/notification.d.ts new file mode 100644 index 00000000..3f02a7d3 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge/notification.d.ts @@ -0,0 +1,112 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../../../V2"; +/** + * Options to pass to create a NotificationInstance + */ +export interface NotificationListInstanceCreateOptions { + /** How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. */ + ttl?: number; +} +export interface NotificationSolution { + serviceSid: string; + identity: string; + challengeSid: string; +} +export interface NotificationListInstance { + _version: V2; + _solution: NotificationSolution; + _uri: string; + /** + * Create a NotificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + create(callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Create a NotificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NotificationInstance + */ + create(params: NotificationListInstanceCreateOptions, callback?: (error: Error | null, item?: NotificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NotificationListInstance(version: V2, serviceSid: string, identity: string, challengeSid: string): NotificationListInstance; +interface NotificationResource { + sid: string; + account_sid: string; + service_sid: string; + entity_sid: string; + identity: string; + challenge_sid: string; + priority: string; + ttl: number; + date_created: Date; +} +export declare class NotificationInstance { + protected _version: V2; + constructor(_version: V2, payload: NotificationResource, serviceSid: string, identity: string, challengeSid: string); + /** + * A 34 character string that uniquely identifies this Notification. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Service. + */ + serviceSid: string; + /** + * The unique SID identifier of the Entity. + */ + entitySid: string; + /** + * Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user\'s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + */ + identity: string; + /** + * The unique SID identifier of the Challenge. + */ + challengeSid: string; + /** + * The priority of the notification. For `push` Challenges it\'s always `high` which sends the notification immediately, and can wake up a sleeping device. + */ + priority: string; + /** + * How long, in seconds, the notification is valid. Max: 5 minutes + */ + ttl: number; + /** + * The date that this Notification was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + entitySid: string; + identity: string; + challengeSid: string; + priority: string; + ttl: number; + dateCreated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge/notification.js b/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge/notification.js new file mode 100644 index 00000000..24f932db --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity/challenge/notification.js @@ -0,0 +1,102 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NotificationInstance = exports.NotificationListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../../base/deserialize"); +const serialize = require("../../../../../../base/serialize"); +const utility_1 = require("../../../../../../base/utility"); +function NotificationListInstance(version, serviceSid, identity, challengeSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(challengeSid)) { + throw new Error("Parameter 'challengeSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { serviceSid, identity, challengeSid }; + instance._uri = `/Services/${serviceSid}/Entities/${identity}/Challenges/${challengeSid}/Notifications`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["ttl"] !== undefined) + data["Ttl"] = params["ttl"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NotificationInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.identity, instance._solution.challengeSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NotificationListInstance = NotificationListInstance; +class NotificationInstance { + constructor(_version, payload, serviceSid, identity, challengeSid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.entitySid = payload.entity_sid; + this.identity = payload.identity; + this.challengeSid = payload.challenge_sid; + this.priority = payload.priority; + this.ttl = deserialize.integer(payload.ttl); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + entitySid: this.entitySid, + identity: this.identity, + challengeSid: this.challengeSid, + priority: this.priority, + ttl: this.ttl, + dateCreated: this.dateCreated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NotificationInstance = NotificationInstance; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity/factor.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/entity/factor.d.ts new file mode 100644 index 00000000..b4daec67 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity/factor.d.ts @@ -0,0 +1,335 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +export type FactorFactorStatuses = "unverified" | "verified"; +export type FactorFactorTypes = "push" | "totp"; +export type FactorTotpAlgorithms = "sha1" | "sha256" | "sha512"; +/** + * Options to pass to update a FactorInstance + */ +export interface FactorContextUpdateOptions { + /** The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. */ + authPayload?: string; + /** The new friendly name of this Factor. It can be up to 64 characters. */ + friendlyName?: string; + /** For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. */ + "config.notificationToken"?: string; + /** The Verify Push SDK version used to configure the factor */ + "config.sdkVersion"?: string; + /** Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive */ + "config.timeStep"?: number; + /** The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive */ + "config.skew"?: number; + /** Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive */ + "config.codeLength"?: number; + /** */ + "config.alg"?: FactorTotpAlgorithms; + /** The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. */ + "config.notificationPlatform"?: string; +} +/** + * Options to pass to each + */ +export interface FactorListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: FactorInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface FactorListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface FactorListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface FactorContext { + /** + * Remove a FactorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FactorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FactorInstance + */ + fetch(callback?: (error: Error | null, item?: FactorInstance) => any): Promise; + /** + * Update a FactorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FactorInstance + */ + update(callback?: (error: Error | null, item?: FactorInstance) => any): Promise; + /** + * Update a FactorInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FactorInstance + */ + update(params: FactorContextUpdateOptions, callback?: (error: Error | null, item?: FactorInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface FactorContextSolution { + serviceSid: string; + identity: string; + sid: string; +} +export declare class FactorContextImpl implements FactorContext { + protected _version: V2; + protected _solution: FactorContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, identity: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: FactorInstance) => any): Promise; + update(params?: FactorContextUpdateOptions | ((error: Error | null, item?: FactorInstance) => any), callback?: (error: Error | null, item?: FactorInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): FactorContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface FactorPayload extends TwilioResponsePayload { + factors: FactorResource[]; +} +interface FactorResource { + sid: string; + account_sid: string; + service_sid: string; + entity_sid: string; + identity: string; + date_created: Date; + date_updated: Date; + friendly_name: string; + status: FactorFactorStatuses; + factor_type: FactorFactorTypes; + config: any; + metadata: any; + url: string; +} +export declare class FactorInstance { + protected _version: V2; + protected _solution: FactorContextSolution; + protected _context?: FactorContext; + constructor(_version: V2, payload: FactorResource, serviceSid: string, identity: string, sid?: string); + /** + * A 34 character string that uniquely identifies this Factor. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Service. + */ + serviceSid: string; + /** + * The unique SID identifier of the Entity. + */ + entitySid: string; + /** + * Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user\'s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + */ + identity: string; + /** + * The date that this Factor was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date that this Factor was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * A human readable description of this resource, up to 64 characters. For a push factor, this can be the device\'s name. + */ + friendlyName: string; + status: FactorFactorStatuses; + factorType: FactorFactorTypes; + /** + * An object that contains configurations specific to a `factor_type`. + */ + config: any; + /** + * Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\"os\": \"Android\"}`. Can be up to 1024 characters in length. + */ + metadata: any; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Remove a FactorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a FactorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FactorInstance + */ + fetch(callback?: (error: Error | null, item?: FactorInstance) => any): Promise; + /** + * Update a FactorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FactorInstance + */ + update(callback?: (error: Error | null, item?: FactorInstance) => any): Promise; + /** + * Update a FactorInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FactorInstance + */ + update(params: FactorContextUpdateOptions, callback?: (error: Error | null, item?: FactorInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + entitySid: string; + identity: string; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + status: FactorFactorStatuses; + factorType: FactorFactorTypes; + config: any; + metadata: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface FactorSolution { + serviceSid: string; + identity: string; +} +export interface FactorListInstance { + _version: V2; + _solution: FactorSolution; + _uri: string; + (sid: string): FactorContext; + get(sid: string): FactorContext; + /** + * Streams FactorInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FactorListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: FactorInstance, done: (err?: Error) => void) => void): void; + each(params: FactorListInstanceEachOptions, callback?: (item: FactorInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of FactorInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: FactorPage) => any): Promise; + /** + * Lists FactorInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FactorListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: FactorInstance[]) => any): Promise; + list(params: FactorListInstanceOptions, callback?: (error: Error | null, items: FactorInstance[]) => any): Promise; + /** + * Retrieve a single page of FactorInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { FactorListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: FactorPage) => any): Promise; + page(params: FactorListInstancePageOptions, callback?: (error: Error | null, items: FactorPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function FactorListInstance(version: V2, serviceSid: string, identity: string): FactorListInstance; +export declare class FactorPage extends Page { + /** + * Initialize the FactorPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: FactorSolution); + /** + * Build an instance of FactorInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: FactorResource): FactorInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity/factor.js b/node_modules/twilio/lib/rest/verify/v2/service/entity/factor.js new file mode 100644 index 00000000..89ffeb80 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity/factor.js @@ -0,0 +1,270 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FactorPage = exports.FactorListInstance = exports.FactorInstance = exports.FactorContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class FactorContextImpl { + constructor(_version, serviceSid, identity, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, identity, sid }; + this._uri = `/Services/${serviceSid}/Entities/${identity}/Factors/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new FactorInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.identity, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["authPayload"] !== undefined) + data["AuthPayload"] = params["authPayload"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["config.notificationToken"] !== undefined) + data["Config.NotificationToken"] = params["config.notificationToken"]; + if (params["config.sdkVersion"] !== undefined) + data["Config.SdkVersion"] = params["config.sdkVersion"]; + if (params["config.timeStep"] !== undefined) + data["Config.TimeStep"] = params["config.timeStep"]; + if (params["config.skew"] !== undefined) + data["Config.Skew"] = params["config.skew"]; + if (params["config.codeLength"] !== undefined) + data["Config.CodeLength"] = params["config.codeLength"]; + if (params["config.alg"] !== undefined) + data["Config.Alg"] = params["config.alg"]; + if (params["config.notificationPlatform"] !== undefined) + data["Config.NotificationPlatform"] = + params["config.notificationPlatform"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FactorInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.identity, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FactorContextImpl = FactorContextImpl; +class FactorInstance { + constructor(_version, payload, serviceSid, identity, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.entitySid = payload.entity_sid; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.factorType = payload.factor_type; + this.config = payload.config; + this.metadata = payload.metadata; + this.url = payload.url; + this._solution = { serviceSid, identity, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new FactorContextImpl(this._version, this._solution.serviceSid, this._solution.identity, this._solution.sid); + return this._context; + } + /** + * Remove a FactorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a FactorInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed FactorInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + entitySid: this.entitySid, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + status: this.status, + factorType: this.factorType, + config: this.config, + metadata: this.metadata, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FactorInstance = FactorInstance; +function FactorListInstance(version, serviceSid, identity) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new FactorContextImpl(version, serviceSid, identity, sid); + }; + instance._version = version; + instance._solution = { serviceSid, identity }; + instance._uri = `/Services/${serviceSid}/Entities/${identity}/Factors`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new FactorPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new FactorPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.FactorListInstance = FactorListInstance; +class FactorPage extends Page_1.default { + /** + * Initialize the FactorPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of FactorInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new FactorInstance(this._version, payload, this._solution.serviceSid, this._solution.identity); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.FactorPage = FactorPage; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity/newFactor.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/entity/newFactor.d.ts new file mode 100644 index 00000000..a561e5b4 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity/newFactor.d.ts @@ -0,0 +1,157 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../../V2"; +export type NewFactorFactorStatuses = "unverified" | "verified"; +export type NewFactorFactorTypes = "push" | "totp"; +export type NewFactorNotificationPlatforms = "apn" | "fcm" | "none"; +export type NewFactorTotpAlgorithms = "sha1" | "sha256" | "sha512"; +/** + * Options to pass to create a NewFactorInstance + */ +export interface NewFactorListInstanceCreateOptions { + /** The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For `factor_type` `push`, this could be a device name. For `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property. At the same time, we recommend avoiding providing PII. */ + friendlyName: string; + /** */ + factorType: NewFactorFactorTypes; + /** The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` */ + "binding.alg"?: string; + /** The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` */ + "binding.publicKey"?: string; + /** The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. */ + "config.appId"?: string; + /** */ + "config.notificationPlatform"?: NewFactorNotificationPlatforms; + /** For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. */ + "config.notificationToken"?: string; + /** The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` */ + "config.sdkVersion"?: string; + /** The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` */ + "binding.secret"?: string; + /** Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` */ + "config.timeStep"?: number; + /** The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` */ + "config.skew"?: number; + /** Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` */ + "config.codeLength"?: number; + /** */ + "config.alg"?: NewFactorTotpAlgorithms; + /** Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. */ + metadata?: any; +} +export interface NewFactorSolution { + serviceSid: string; + identity: string; +} +export interface NewFactorListInstance { + _version: V2; + _solution: NewFactorSolution; + _uri: string; + /** + * Create a NewFactorInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed NewFactorInstance + */ + create(params: NewFactorListInstanceCreateOptions, callback?: (error: Error | null, item?: NewFactorInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function NewFactorListInstance(version: V2, serviceSid: string, identity: string): NewFactorListInstance; +interface NewFactorResource { + sid: string; + account_sid: string; + service_sid: string; + entity_sid: string; + identity: string; + binding: any; + date_created: Date; + date_updated: Date; + friendly_name: string; + status: NewFactorFactorStatuses; + factor_type: NewFactorFactorTypes; + config: any; + metadata: any; + url: string; +} +export declare class NewFactorInstance { + protected _version: V2; + constructor(_version: V2, payload: NewFactorResource, serviceSid: string, identity: string); + /** + * A 34 character string that uniquely identifies this Factor. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * The unique SID identifier of the Service. + */ + serviceSid: string; + /** + * The unique SID identifier of the Entity. + */ + entitySid: string; + /** + * Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user\'s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + */ + identity: string; + /** + * Contains the `factor_type` specific secret and metadata. For push, this is `binding.public_key` and `binding.alg`. For totp, this is `binding.secret` and `binding.uri`. The `binding.uri` property is generated following the [google authenticator key URI format](https://github.com/google/google-authenticator/wiki/Key-Uri-Format), and `Factor.friendly_name` is used for the “accountname” value and `Service.friendly_name` or `Service.totp.issuer` is used for the `issuer` value. The Binding property is ONLY returned upon Factor creation. + */ + binding: any; + /** + * The date that this Factor was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date that this Factor was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For `factor_type` `push`, this could be a device name. For `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property. At the same time, we recommend avoiding providing PII. + */ + friendlyName: string; + status: NewFactorFactorStatuses; + factorType: NewFactorFactorTypes; + /** + * An object that contains configurations specific to a `factor_type`. + */ + config: any; + /** + * Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\"os\": \"Android\"}`. Can be up to 1024 characters in length. + */ + metadata: any; + /** + * The URL of this resource. + */ + url: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + entitySid: string; + identity: string; + binding: any; + dateCreated: Date; + dateUpdated: Date; + friendlyName: string; + status: NewFactorFactorStatuses; + factorType: NewFactorFactorTypes; + config: any; + metadata: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/entity/newFactor.js b/node_modules/twilio/lib/rest/verify/v2/service/entity/newFactor.js new file mode 100644 index 00000000..f6eb33ba --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/entity/newFactor.js @@ -0,0 +1,137 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NewFactorInstance = exports.NewFactorListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function NewFactorListInstance(version, serviceSid, identity) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(identity)) { + throw new Error("Parameter 'identity' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { serviceSid, identity }; + instance._uri = `/Services/${serviceSid}/Entities/${identity}/Factors`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["factorType"] === null || params["factorType"] === undefined) { + throw new Error("Required parameter \"params['factorType']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["FactorType"] = params["factorType"]; + if (params["binding.alg"] !== undefined) + data["Binding.Alg"] = params["binding.alg"]; + if (params["binding.publicKey"] !== undefined) + data["Binding.PublicKey"] = params["binding.publicKey"]; + if (params["config.appId"] !== undefined) + data["Config.AppId"] = params["config.appId"]; + if (params["config.notificationPlatform"] !== undefined) + data["Config.NotificationPlatform"] = + params["config.notificationPlatform"]; + if (params["config.notificationToken"] !== undefined) + data["Config.NotificationToken"] = params["config.notificationToken"]; + if (params["config.sdkVersion"] !== undefined) + data["Config.SdkVersion"] = params["config.sdkVersion"]; + if (params["binding.secret"] !== undefined) + data["Binding.Secret"] = params["binding.secret"]; + if (params["config.timeStep"] !== undefined) + data["Config.TimeStep"] = params["config.timeStep"]; + if (params["config.skew"] !== undefined) + data["Config.Skew"] = params["config.skew"]; + if (params["config.codeLength"] !== undefined) + data["Config.CodeLength"] = params["config.codeLength"]; + if (params["config.alg"] !== undefined) + data["Config.Alg"] = params["config.alg"]; + if (params["metadata"] !== undefined) + data["Metadata"] = serialize.object(params["metadata"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new NewFactorInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.identity)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.NewFactorListInstance = NewFactorListInstance; +class NewFactorInstance { + constructor(_version, payload, serviceSid, identity) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.entitySid = payload.entity_sid; + this.identity = payload.identity; + this.binding = payload.binding; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.friendlyName = payload.friendly_name; + this.status = payload.status; + this.factorType = payload.factor_type; + this.config = payload.config; + this.metadata = payload.metadata; + this.url = payload.url; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + entitySid: this.entitySid, + identity: this.identity, + binding: this.binding, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + friendlyName: this.friendlyName, + status: this.status, + factorType: this.factorType, + config: this.config, + metadata: this.metadata, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.NewFactorInstance = NewFactorInstance; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/messagingConfiguration.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/messagingConfiguration.d.ts new file mode 100644 index 00000000..8327f7c8 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/messagingConfiguration.d.ts @@ -0,0 +1,286 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +/** + * Options to pass to update a MessagingConfigurationInstance + */ +export interface MessagingConfigurationContextUpdateOptions { + /** The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. */ + messagingServiceSid: string; +} +/** + * Options to pass to create a MessagingConfigurationInstance + */ +export interface MessagingConfigurationListInstanceCreateOptions { + /** The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. */ + country: string; + /** The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. */ + messagingServiceSid: string; +} +/** + * Options to pass to each + */ +export interface MessagingConfigurationListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: MessagingConfigurationInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface MessagingConfigurationListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface MessagingConfigurationListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface MessagingConfigurationContext { + /** + * Remove a MessagingConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessagingConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessagingConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: MessagingConfigurationInstance) => any): Promise; + /** + * Update a MessagingConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessagingConfigurationInstance + */ + update(params: MessagingConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: MessagingConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface MessagingConfigurationContextSolution { + serviceSid: string; + country: string; +} +export declare class MessagingConfigurationContextImpl implements MessagingConfigurationContext { + protected _version: V2; + protected _solution: MessagingConfigurationContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, country: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: MessagingConfigurationInstance) => any): Promise; + update(params: MessagingConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: MessagingConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): MessagingConfigurationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface MessagingConfigurationPayload extends TwilioResponsePayload { + messaging_configurations: MessagingConfigurationResource[]; +} +interface MessagingConfigurationResource { + account_sid: string; + service_sid: string; + country: string; + messaging_service_sid: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class MessagingConfigurationInstance { + protected _version: V2; + protected _solution: MessagingConfigurationContextSolution; + protected _context?: MessagingConfigurationContext; + constructor(_version: V2, payload: MessagingConfigurationResource, serviceSid: string, country?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with. + */ + serviceSid: string; + /** + * The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. + */ + country: string; + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. + */ + messagingServiceSid: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Remove a MessagingConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a MessagingConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessagingConfigurationInstance + */ + fetch(callback?: (error: Error | null, item?: MessagingConfigurationInstance) => any): Promise; + /** + * Update a MessagingConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessagingConfigurationInstance + */ + update(params: MessagingConfigurationContextUpdateOptions, callback?: (error: Error | null, item?: MessagingConfigurationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + serviceSid: string; + country: string; + messagingServiceSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface MessagingConfigurationSolution { + serviceSid: string; +} +export interface MessagingConfigurationListInstance { + _version: V2; + _solution: MessagingConfigurationSolution; + _uri: string; + (country: string): MessagingConfigurationContext; + get(country: string): MessagingConfigurationContext; + /** + * Create a MessagingConfigurationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessagingConfigurationInstance + */ + create(params: MessagingConfigurationListInstanceCreateOptions, callback?: (error: Error | null, item?: MessagingConfigurationInstance) => any): Promise; + /** + * Streams MessagingConfigurationInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessagingConfigurationListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: MessagingConfigurationInstance, done: (err?: Error) => void) => void): void; + each(params: MessagingConfigurationListInstanceEachOptions, callback?: (item: MessagingConfigurationInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of MessagingConfigurationInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: MessagingConfigurationPage) => any): Promise; + /** + * Lists MessagingConfigurationInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessagingConfigurationListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: MessagingConfigurationInstance[]) => any): Promise; + list(params: MessagingConfigurationListInstanceOptions, callback?: (error: Error | null, items: MessagingConfigurationInstance[]) => any): Promise; + /** + * Retrieve a single page of MessagingConfigurationInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { MessagingConfigurationListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: MessagingConfigurationPage) => any): Promise; + page(params: MessagingConfigurationListInstancePageOptions, callback?: (error: Error | null, items: MessagingConfigurationPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function MessagingConfigurationListInstance(version: V2, serviceSid: string): MessagingConfigurationListInstance; +export declare class MessagingConfigurationPage extends Page { + /** + * Initialize the MessagingConfigurationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: MessagingConfigurationSolution); + /** + * Build an instance of MessagingConfigurationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: MessagingConfigurationResource): MessagingConfigurationInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/messagingConfiguration.js b/node_modules/twilio/lib/rest/verify/v2/service/messagingConfiguration.js new file mode 100644 index 00000000..3bcf425e --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/messagingConfiguration.js @@ -0,0 +1,260 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessagingConfigurationPage = exports.MessagingConfigurationListInstance = exports.MessagingConfigurationInstance = exports.MessagingConfigurationContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class MessagingConfigurationContextImpl { + constructor(_version, serviceSid, country) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(country)) { + throw new Error("Parameter 'country' is not valid."); + } + this._solution = { serviceSid, country }; + this._uri = `/Services/${serviceSid}/MessagingConfigurations/${country}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new MessagingConfigurationInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.country)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["messagingServiceSid"] === null || + params["messagingServiceSid"] === undefined) { + throw new Error("Required parameter \"params['messagingServiceSid']\" missing."); + } + let data = {}; + data["MessagingServiceSid"] = params["messagingServiceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagingConfigurationInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.country)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagingConfigurationContextImpl = MessagingConfigurationContextImpl; +class MessagingConfigurationInstance { + constructor(_version, payload, serviceSid, country) { + this._version = _version; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.country = payload.country; + this.messagingServiceSid = payload.messaging_service_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, country: country || this.country }; + } + get _proxy() { + this._context = + this._context || + new MessagingConfigurationContextImpl(this._version, this._solution.serviceSid, this._solution.country); + return this._context; + } + /** + * Remove a MessagingConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a MessagingConfigurationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed MessagingConfigurationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + serviceSid: this.serviceSid, + country: this.country, + messagingServiceSid: this.messagingServiceSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagingConfigurationInstance = MessagingConfigurationInstance; +function MessagingConfigurationListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((country) => instance.get(country)); + instance.get = function get(country) { + return new MessagingConfigurationContextImpl(version, serviceSid, country); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/MessagingConfigurations`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["country"] === null || params["country"] === undefined) { + throw new Error("Required parameter \"params['country']\" missing."); + } + if (params["messagingServiceSid"] === null || + params["messagingServiceSid"] === undefined) { + throw new Error("Required parameter \"params['messagingServiceSid']\" missing."); + } + let data = {}; + data["Country"] = params["country"]; + data["MessagingServiceSid"] = params["messagingServiceSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagingConfigurationInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new MessagingConfigurationPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new MessagingConfigurationPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.MessagingConfigurationListInstance = MessagingConfigurationListInstance; +class MessagingConfigurationPage extends Page_1.default { + /** + * Initialize the MessagingConfigurationPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of MessagingConfigurationInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new MessagingConfigurationInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.MessagingConfigurationPage = MessagingConfigurationPage; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/rateLimit.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/rateLimit.d.ts new file mode 100644 index 00000000..921eeafb --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/rateLimit.d.ts @@ -0,0 +1,322 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +import { BucketListInstance } from "./rateLimit/bucket"; +/** + * Options to pass to update a RateLimitInstance + */ +export interface RateLimitContextUpdateOptions { + /** Description of this Rate Limit */ + description?: string; +} +/** + * Options to pass to create a RateLimitInstance + */ +export interface RateLimitListInstanceCreateOptions { + /** Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.** */ + uniqueName: string; + /** Description of this Rate Limit */ + description?: string; +} +/** + * Options to pass to each + */ +export interface RateLimitListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RateLimitInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RateLimitListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RateLimitListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RateLimitContext { + buckets: BucketListInstance; + /** + * Remove a RateLimitInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RateLimitInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RateLimitInstance + */ + fetch(callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + /** + * Update a RateLimitInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RateLimitInstance + */ + update(callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + /** + * Update a RateLimitInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RateLimitInstance + */ + update(params: RateLimitContextUpdateOptions, callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RateLimitContextSolution { + serviceSid: string; + sid: string; +} +export declare class RateLimitContextImpl implements RateLimitContext { + protected _version: V2; + protected _solution: RateLimitContextSolution; + protected _uri: string; + protected _buckets?: BucketListInstance; + constructor(_version: V2, serviceSid: string, sid: string); + get buckets(): BucketListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + update(params?: RateLimitContextUpdateOptions | ((error: Error | null, item?: RateLimitInstance) => any), callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RateLimitContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RateLimitPayload extends TwilioResponsePayload { + rate_limits: RateLimitResource[]; +} +interface RateLimitResource { + sid: string; + service_sid: string; + account_sid: string; + unique_name: string; + description: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class RateLimitInstance { + protected _version: V2; + protected _solution: RateLimitContextSolution; + protected _context?: RateLimitContext; + constructor(_version: V2, payload: RateLimitResource, serviceSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this Rate Limit. + */ + sid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Rate Limit resource. + */ + accountSid: string; + /** + * Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.** + */ + uniqueName: string; + /** + * Description of this Rate Limit + */ + description: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URL of this resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a RateLimitInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RateLimitInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RateLimitInstance + */ + fetch(callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + /** + * Update a RateLimitInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RateLimitInstance + */ + update(callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + /** + * Update a RateLimitInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RateLimitInstance + */ + update(params: RateLimitContextUpdateOptions, callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + /** + * Access the buckets. + */ + buckets(): BucketListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + serviceSid: string; + accountSid: string; + uniqueName: string; + description: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RateLimitSolution { + serviceSid: string; +} +export interface RateLimitListInstance { + _version: V2; + _solution: RateLimitSolution; + _uri: string; + (sid: string): RateLimitContext; + get(sid: string): RateLimitContext; + /** + * Create a RateLimitInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RateLimitInstance + */ + create(params: RateLimitListInstanceCreateOptions, callback?: (error: Error | null, item?: RateLimitInstance) => any): Promise; + /** + * Streams RateLimitInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RateLimitListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RateLimitInstance, done: (err?: Error) => void) => void): void; + each(params: RateLimitListInstanceEachOptions, callback?: (item: RateLimitInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RateLimitInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RateLimitPage) => any): Promise; + /** + * Lists RateLimitInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RateLimitListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RateLimitInstance[]) => any): Promise; + list(params: RateLimitListInstanceOptions, callback?: (error: Error | null, items: RateLimitInstance[]) => any): Promise; + /** + * Retrieve a single page of RateLimitInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RateLimitListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RateLimitPage) => any): Promise; + page(params: RateLimitListInstancePageOptions, callback?: (error: Error | null, items: RateLimitPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RateLimitListInstance(version: V2, serviceSid: string): RateLimitListInstance; +export declare class RateLimitPage extends Page { + /** + * Initialize the RateLimitPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: RateLimitSolution); + /** + * Build an instance of RateLimitInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RateLimitResource): RateLimitInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/rateLimit.js b/node_modules/twilio/lib/rest/verify/v2/service/rateLimit.js new file mode 100644 index 00000000..db5fc968 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/rateLimit.js @@ -0,0 +1,275 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RateLimitPage = exports.RateLimitListInstance = exports.RateLimitInstance = exports.RateLimitContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const bucket_1 = require("./rateLimit/bucket"); +class RateLimitContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/RateLimits/${sid}`; + } + get buckets() { + this._buckets = + this._buckets || + (0, bucket_1.BucketListInstance)(this._version, this._solution.serviceSid, this._solution.sid); + return this._buckets; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RateLimitInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["description"] !== undefined) + data["Description"] = params["description"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RateLimitInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RateLimitContextImpl = RateLimitContextImpl; +class RateLimitInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.uniqueName = payload.unique_name; + this.description = payload.description; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RateLimitContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a RateLimitInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RateLimitInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RateLimitInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the buckets. + */ + buckets() { + return this._proxy.buckets; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + uniqueName: this.uniqueName, + description: this.description, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RateLimitInstance = RateLimitInstance; +function RateLimitListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RateLimitContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/RateLimits`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["uniqueName"] === null || params["uniqueName"] === undefined) { + throw new Error("Required parameter \"params['uniqueName']\" missing."); + } + let data = {}; + data["UniqueName"] = params["uniqueName"]; + if (params["description"] !== undefined) + data["Description"] = params["description"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RateLimitInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RateLimitPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RateLimitPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RateLimitListInstance = RateLimitListInstance; +class RateLimitPage extends Page_1.default { + /** + * Initialize the RateLimitPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RateLimitInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RateLimitInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RateLimitPage = RateLimitPage; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/rateLimit/bucket.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/rateLimit/bucket.d.ts new file mode 100644 index 00000000..050ccd63 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/rateLimit/bucket.d.ts @@ -0,0 +1,318 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V2 from "../../../V2"; +/** + * Options to pass to update a BucketInstance + */ +export interface BucketContextUpdateOptions { + /** Maximum number of requests permitted in during the interval. */ + max?: number; + /** Number of seconds that the rate limit will be enforced over. */ + interval?: number; +} +/** + * Options to pass to create a BucketInstance + */ +export interface BucketListInstanceCreateOptions { + /** Maximum number of requests permitted in during the interval. */ + max: number; + /** Number of seconds that the rate limit will be enforced over. */ + interval: number; +} +/** + * Options to pass to each + */ +export interface BucketListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: BucketInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface BucketListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface BucketListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface BucketContext { + /** + * Remove a BucketInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BucketInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BucketInstance + */ + fetch(callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + /** + * Update a BucketInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BucketInstance + */ + update(callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + /** + * Update a BucketInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BucketInstance + */ + update(params: BucketContextUpdateOptions, callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface BucketContextSolution { + serviceSid: string; + rateLimitSid: string; + sid: string; +} +export declare class BucketContextImpl implements BucketContext { + protected _version: V2; + protected _solution: BucketContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, rateLimitSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + update(params?: BucketContextUpdateOptions | ((error: Error | null, item?: BucketInstance) => any), callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): BucketContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface BucketPayload extends TwilioResponsePayload { + buckets: BucketResource[]; +} +interface BucketResource { + sid: string; + rate_limit_sid: string; + service_sid: string; + account_sid: string; + max: number; + interval: number; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class BucketInstance { + protected _version: V2; + protected _solution: BucketContextSolution; + protected _context?: BucketContext; + constructor(_version: V2, payload: BucketResource, serviceSid: string, rateLimitSid: string, sid?: string); + /** + * A 34 character string that uniquely identifies this Bucket. + */ + sid: string; + /** + * The Twilio-provided string that uniquely identifies the Rate Limit resource. + */ + rateLimitSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Rate Limit resource. + */ + accountSid: string; + /** + * Maximum number of requests permitted in during the interval. + */ + max: number; + /** + * Number of seconds that the rate limit will be enforced over. + */ + interval: number; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Remove a BucketInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a BucketInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BucketInstance + */ + fetch(callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + /** + * Update a BucketInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BucketInstance + */ + update(callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + /** + * Update a BucketInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BucketInstance + */ + update(params: BucketContextUpdateOptions, callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + rateLimitSid: string; + serviceSid: string; + accountSid: string; + max: number; + interval: number; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface BucketSolution { + serviceSid: string; + rateLimitSid: string; +} +export interface BucketListInstance { + _version: V2; + _solution: BucketSolution; + _uri: string; + (sid: string): BucketContext; + get(sid: string): BucketContext; + /** + * Create a BucketInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BucketInstance + */ + create(params: BucketListInstanceCreateOptions, callback?: (error: Error | null, item?: BucketInstance) => any): Promise; + /** + * Streams BucketInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BucketListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: BucketInstance, done: (err?: Error) => void) => void): void; + each(params: BucketListInstanceEachOptions, callback?: (item: BucketInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of BucketInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: BucketPage) => any): Promise; + /** + * Lists BucketInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BucketListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: BucketInstance[]) => any): Promise; + list(params: BucketListInstanceOptions, callback?: (error: Error | null, items: BucketInstance[]) => any): Promise; + /** + * Retrieve a single page of BucketInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { BucketListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: BucketPage) => any): Promise; + page(params: BucketListInstancePageOptions, callback?: (error: Error | null, items: BucketPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BucketListInstance(version: V2, serviceSid: string, rateLimitSid: string): BucketListInstance; +export declare class BucketPage extends Page { + /** + * Initialize the BucketPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: BucketSolution); + /** + * Build an instance of BucketInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: BucketResource): BucketInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/rateLimit/bucket.js b/node_modules/twilio/lib/rest/verify/v2/service/rateLimit/bucket.js new file mode 100644 index 00000000..a98eb802 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/rateLimit/bucket.js @@ -0,0 +1,272 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BucketPage = exports.BucketListInstance = exports.BucketInstance = exports.BucketContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class BucketContextImpl { + constructor(_version, serviceSid, rateLimitSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(rateLimitSid)) { + throw new Error("Parameter 'rateLimitSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, rateLimitSid, sid }; + this._uri = `/Services/${serviceSid}/RateLimits/${rateLimitSid}/Buckets/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new BucketInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.rateLimitSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["max"] !== undefined) + data["Max"] = params["max"]; + if (params["interval"] !== undefined) + data["Interval"] = params["interval"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BucketInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.rateLimitSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BucketContextImpl = BucketContextImpl; +class BucketInstance { + constructor(_version, payload, serviceSid, rateLimitSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.rateLimitSid = payload.rate_limit_sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.max = deserialize.integer(payload.max); + this.interval = deserialize.integer(payload.interval); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, rateLimitSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new BucketContextImpl(this._version, this._solution.serviceSid, this._solution.rateLimitSid, this._solution.sid); + return this._context; + } + /** + * Remove a BucketInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a BucketInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BucketInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + rateLimitSid: this.rateLimitSid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + max: this.max, + interval: this.interval, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BucketInstance = BucketInstance; +function BucketListInstance(version, serviceSid, rateLimitSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(rateLimitSid)) { + throw new Error("Parameter 'rateLimitSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new BucketContextImpl(version, serviceSid, rateLimitSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid, rateLimitSid }; + instance._uri = `/Services/${serviceSid}/RateLimits/${rateLimitSid}/Buckets`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["max"] === null || params["max"] === undefined) { + throw new Error("Required parameter \"params['max']\" missing."); + } + if (params["interval"] === null || params["interval"] === undefined) { + throw new Error("Required parameter \"params['interval']\" missing."); + } + let data = {}; + data["Max"] = params["max"]; + data["Interval"] = params["interval"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BucketInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.rateLimitSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BucketPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new BucketPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BucketListInstance = BucketListInstance; +class BucketPage extends Page_1.default { + /** + * Initialize the BucketPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of BucketInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new BucketInstance(this._version, payload, this._solution.serviceSid, this._solution.rateLimitSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BucketPage = BucketPage; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/verification.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/verification.d.ts new file mode 100644 index 00000000..b6c99d71 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/verification.d.ts @@ -0,0 +1,242 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../V2"; +export type VerificationChannel = "sms" | "call" | "email" | "whatsapp" | "sna"; +export type VerificationRiskCheck = "enable" | "disable"; +export type VerificationStatus = "canceled" | "approved"; +/** + * Options to pass to update a VerificationInstance + */ +export interface VerificationContextUpdateOptions { + /** */ + status: VerificationStatus; +} +/** + * Options to pass to create a VerificationInstance + */ +export interface VerificationListInstanceCreateOptions { + /** The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ + to: string; + /** The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, `sna` or `auto`. */ + channel: string; + /** A custom user defined friendly name that overwrites the existing one in the verification message */ + customFriendlyName?: string; + /** The text of a custom message to use for the verification. */ + customMessage?: string; + /** The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). */ + sendDigits?: string; + /** Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). */ + locale?: string; + /** A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. */ + customCode?: string; + /** The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. */ + amount?: string; + /** The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. */ + payee?: string; + /** The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. */ + rateLimits?: any; + /** [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields \\\'from\\\' and \\\'from_name\\\' are optional but if included the \\\'from\\\' field must have a valid email address. */ + channelConfiguration?: any; + /** Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. */ + appHash?: string; + /** The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. */ + templateSid?: string; + /** A stringified JSON object in which the keys are the template\\\'s special variables and the values are the variables substitutions. */ + templateCustomSubstitutions?: string; + /** Strongly encouraged if using the auto channel. The IP address of the client\\\'s device. If provided, it has to be a valid IPv4 or IPv6 address. */ + deviceIp?: string; + /** */ + riskCheck?: VerificationRiskCheck; + /** A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. */ + tags?: string; +} +export interface VerificationContext { + /** + * Fetch a VerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationInstance + */ + fetch(callback?: (error: Error | null, item?: VerificationInstance) => any): Promise; + /** + * Update a VerificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationInstance + */ + update(params: VerificationContextUpdateOptions, callback?: (error: Error | null, item?: VerificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface VerificationContextSolution { + serviceSid: string; + sid: string; +} +export declare class VerificationContextImpl implements VerificationContext { + protected _version: V2; + protected _solution: VerificationContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: VerificationInstance) => any): Promise; + update(params: VerificationContextUpdateOptions, callback?: (error: Error | null, item?: VerificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): VerificationContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface VerificationResource { + sid: string; + service_sid: string; + account_sid: string; + to: string; + channel: VerificationChannel; + status: string; + valid: boolean; + lookup: any; + amount: string; + payee: string; + send_code_attempts: Array; + date_created: Date; + date_updated: Date; + sna: any; + url: string; +} +export declare class VerificationInstance { + protected _version: V2; + protected _solution: VerificationContextSolution; + protected _context?: VerificationContext; + constructor(_version: V2, payload: VerificationResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Verification resource. + */ + sid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Verification resource. + */ + accountSid: string; + /** + * The phone number or [email](https://www.twilio.com/docs/verify/email) being verified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + */ + to: string; + channel: VerificationChannel; + /** + * The status of the verification. One of: `pending`, `approved`, or `canceled` + */ + status: string; + /** + * Use \"status\" instead. Legacy property indicating whether the verification was successful. + */ + valid: boolean; + /** + * Information about the phone number being verified. + */ + lookup: any; + /** + * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + */ + amount: string; + /** + * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + */ + payee: string; + /** + * An array of verification attempt objects containing the channel attempted and the channel-specific transaction SID. + */ + sendCodeAttempts: Array; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The set of fields used for a silent network auth (`sna`) verification. Contains a single field with the URL to be invoked to verify the phone number. + */ + sna: any; + /** + * The absolute URL of the Verification resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a VerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationInstance + */ + fetch(callback?: (error: Error | null, item?: VerificationInstance) => any): Promise; + /** + * Update a VerificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationInstance + */ + update(params: VerificationContextUpdateOptions, callback?: (error: Error | null, item?: VerificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + serviceSid: string; + accountSid: string; + to: string; + channel: VerificationChannel; + status: string; + valid: boolean; + lookup: any; + amount: string; + payee: string; + sendCodeAttempts: any[]; + dateCreated: Date; + dateUpdated: Date; + sna: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface VerificationSolution { + serviceSid: string; +} +export interface VerificationListInstance { + _version: V2; + _solution: VerificationSolution; + _uri: string; + (sid: string): VerificationContext; + get(sid: string): VerificationContext; + /** + * Create a VerificationInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationInstance + */ + create(params: VerificationListInstanceCreateOptions, callback?: (error: Error | null, item?: VerificationInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function VerificationListInstance(version: V2, serviceSid: string): VerificationListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/verification.js b/node_modules/twilio/lib/rest/verify/v2/service/verification.js new file mode 100644 index 00000000..e5ce1f45 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/verification.js @@ -0,0 +1,221 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VerificationListInstance = exports.VerificationInstance = exports.VerificationContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class VerificationContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Verifications/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new VerificationInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VerificationInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VerificationContextImpl = VerificationContextImpl; +class VerificationInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.to = payload.to; + this.channel = payload.channel; + this.status = payload.status; + this.valid = payload.valid; + this.lookup = payload.lookup; + this.amount = payload.amount; + this.payee = payload.payee; + this.sendCodeAttempts = payload.send_code_attempts; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.sna = payload.sna; + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new VerificationContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Fetch a VerificationInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + to: this.to, + channel: this.channel, + status: this.status, + valid: this.valid, + lookup: this.lookup, + amount: this.amount, + payee: this.payee, + sendCodeAttempts: this.sendCodeAttempts, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + sna: this.sna, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VerificationInstance = VerificationInstance; +function VerificationListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new VerificationContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Verifications`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["to"] === null || params["to"] === undefined) { + throw new Error("Required parameter \"params['to']\" missing."); + } + if (params["channel"] === null || params["channel"] === undefined) { + throw new Error("Required parameter \"params['channel']\" missing."); + } + let data = {}; + data["To"] = params["to"]; + data["Channel"] = params["channel"]; + if (params["customFriendlyName"] !== undefined) + data["CustomFriendlyName"] = params["customFriendlyName"]; + if (params["customMessage"] !== undefined) + data["CustomMessage"] = params["customMessage"]; + if (params["sendDigits"] !== undefined) + data["SendDigits"] = params["sendDigits"]; + if (params["locale"] !== undefined) + data["Locale"] = params["locale"]; + if (params["customCode"] !== undefined) + data["CustomCode"] = params["customCode"]; + if (params["amount"] !== undefined) + data["Amount"] = params["amount"]; + if (params["payee"] !== undefined) + data["Payee"] = params["payee"]; + if (params["rateLimits"] !== undefined) + data["RateLimits"] = serialize.object(params["rateLimits"]); + if (params["channelConfiguration"] !== undefined) + data["ChannelConfiguration"] = serialize.object(params["channelConfiguration"]); + if (params["appHash"] !== undefined) + data["AppHash"] = params["appHash"]; + if (params["templateSid"] !== undefined) + data["TemplateSid"] = params["templateSid"]; + if (params["templateCustomSubstitutions"] !== undefined) + data["TemplateCustomSubstitutions"] = + params["templateCustomSubstitutions"]; + if (params["deviceIp"] !== undefined) + data["DeviceIp"] = params["deviceIp"]; + if (params["riskCheck"] !== undefined) + data["RiskCheck"] = params["riskCheck"]; + if (params["tags"] !== undefined) + data["Tags"] = params["tags"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VerificationInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.VerificationListInstance = VerificationListInstance; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/verificationCheck.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/verificationCheck.d.ts new file mode 100644 index 00000000..93158af1 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/verificationCheck.d.ts @@ -0,0 +1,134 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../../V2"; +export type VerificationCheckChannel = "sms" | "call" | "email" | "whatsapp" | "sna"; +/** + * Options to pass to create a VerificationCheckInstance + */ +export interface VerificationCheckListInstanceCreateOptions { + /** The 4-10 character string being verified. */ + code?: string; + /** The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ + to?: string; + /** A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. */ + verificationSid?: string; + /** The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. */ + amount?: string; + /** The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. */ + payee?: string; +} +export interface VerificationCheckSolution { + serviceSid: string; +} +export interface VerificationCheckListInstance { + _version: V2; + _solution: VerificationCheckSolution; + _uri: string; + /** + * Create a VerificationCheckInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationCheckInstance + */ + create(callback?: (error: Error | null, item?: VerificationCheckInstance) => any): Promise; + /** + * Create a VerificationCheckInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationCheckInstance + */ + create(params: VerificationCheckListInstanceCreateOptions, callback?: (error: Error | null, item?: VerificationCheckInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function VerificationCheckListInstance(version: V2, serviceSid: string): VerificationCheckListInstance; +interface VerificationCheckResource { + sid: string; + service_sid: string; + account_sid: string; + to: string; + channel: VerificationCheckChannel; + status: string; + valid: boolean; + amount: string; + payee: string; + date_created: Date; + date_updated: Date; + sna_attempts_error_codes: Array; +} +export declare class VerificationCheckInstance { + protected _version: V2; + constructor(_version: V2, payload: VerificationCheckResource, serviceSid: string); + /** + * The unique string that we created to identify the VerificationCheck resource. + */ + sid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the VerificationCheck resource. + */ + accountSid: string; + /** + * The phone number or [email](https://www.twilio.com/docs/verify/email) being verified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + */ + to: string; + channel: VerificationCheckChannel; + /** + * The status of the verification. Can be: `pending`, `approved`, or `canceled`. + */ + status: string; + /** + * Use \"status\" instead. Legacy property indicating whether the verification was successful. + */ + valid: boolean; + /** + * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + */ + amount: string; + /** + * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + */ + payee: string; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the Verification Check resource was created. + */ + dateCreated: Date; + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the Verification Check resource was last updated. + */ + dateUpdated: Date; + /** + * List of error codes as a result of attempting a verification using the `sna` channel. The error codes are chronologically ordered, from the first attempt to the latest attempt. This will be an empty list if no errors occured or `null` if the last channel used wasn\'t `sna`. + */ + snaAttemptsErrorCodes: Array; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + serviceSid: string; + accountSid: string; + to: string; + channel: VerificationCheckChannel; + status: string; + valid: boolean; + amount: string; + payee: string; + dateCreated: Date; + dateUpdated: Date; + snaAttemptsErrorCodes: any[]; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/verificationCheck.js b/node_modules/twilio/lib/rest/verify/v2/service/verificationCheck.js new file mode 100644 index 00000000..3f061478 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/verificationCheck.js @@ -0,0 +1,110 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VerificationCheckInstance = exports.VerificationCheckListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function VerificationCheckListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/VerificationCheck`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["code"] !== undefined) + data["Code"] = params["code"]; + if (params["to"] !== undefined) + data["To"] = params["to"]; + if (params["verificationSid"] !== undefined) + data["VerificationSid"] = params["verificationSid"]; + if (params["amount"] !== undefined) + data["Amount"] = params["amount"]; + if (params["payee"] !== undefined) + data["Payee"] = params["payee"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VerificationCheckInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.VerificationCheckListInstance = VerificationCheckListInstance; +class VerificationCheckInstance { + constructor(_version, payload, serviceSid) { + this._version = _version; + this.sid = payload.sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.to = payload.to; + this.channel = payload.channel; + this.status = payload.status; + this.valid = payload.valid; + this.amount = payload.amount; + this.payee = payload.payee; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.snaAttemptsErrorCodes = payload.sna_attempts_error_codes; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + to: this.to, + channel: this.channel, + status: this.status, + valid: this.valid, + amount: this.amount, + payee: this.payee, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + snaAttemptsErrorCodes: this.snaAttemptsErrorCodes, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VerificationCheckInstance = VerificationCheckInstance; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/webhook.d.ts b/node_modules/twilio/lib/rest/verify/v2/service/webhook.d.ts new file mode 100644 index 00000000..3a2b54a7 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/webhook.d.ts @@ -0,0 +1,340 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V2 from "../../V2"; +export type WebhookMethods = "GET" | "POST"; +export type WebhookStatus = "enabled" | "disabled"; +export type WebhookVersion = "v1" | "v2"; +/** + * Options to pass to update a WebhookInstance + */ +export interface WebhookContextUpdateOptions { + /** The string that you assigned to describe the webhook. **This value should not contain PII.** */ + friendlyName?: string; + /** The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` */ + eventTypes?: Array; + /** The URL associated with this Webhook. */ + webhookUrl?: string; + /** */ + status?: WebhookStatus; + /** */ + version?: WebhookVersion; +} +/** + * Options to pass to create a WebhookInstance + */ +export interface WebhookListInstanceCreateOptions { + /** The string that you assigned to describe the webhook. **This value should not contain PII.** */ + friendlyName: string; + /** The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` */ + eventTypes: Array; + /** The URL associated with this Webhook. */ + webhookUrl: string; + /** */ + status?: WebhookStatus; + /** */ + version?: WebhookVersion; +} +/** + * Options to pass to each + */ +export interface WebhookListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: WebhookInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface WebhookListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface WebhookListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface WebhookContext { + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface WebhookContextSolution { + serviceSid: string; + sid: string; +} +export declare class WebhookContextImpl implements WebhookContext { + protected _version: V2; + protected _solution: WebhookContextSolution; + protected _uri: string; + constructor(_version: V2, serviceSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + update(params?: WebhookContextUpdateOptions | ((error: Error | null, item?: WebhookInstance) => any), callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): WebhookContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface WebhookPayload extends TwilioResponsePayload { + webhooks: WebhookResource[]; +} +interface WebhookResource { + sid: string; + service_sid: string; + account_sid: string; + friendly_name: string; + event_types: Array; + status: WebhookStatus; + version: WebhookVersion; + webhook_url: string; + webhook_method: WebhookMethods; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class WebhookInstance { + protected _version: V2; + protected _solution: WebhookContextSolution; + protected _context?: WebhookContext; + constructor(_version: V2, payload: WebhookResource, serviceSid: string, sid?: string); + /** + * The unique string that we created to identify the Webhook resource. + */ + sid: string; + /** + * The unique SID identifier of the Service. + */ + serviceSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the webhook. **This value should not contain PII.** + */ + friendlyName: string; + /** + * The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + */ + eventTypes: Array; + status: WebhookStatus; + version: WebhookVersion; + /** + * The URL associated with this Webhook. + */ + webhookUrl: string; + webhookMethod: WebhookMethods; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the Webhook resource. + */ + url: string; + private get _proxy(); + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Update a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + update(params: WebhookContextUpdateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + serviceSid: string; + accountSid: string; + friendlyName: string; + eventTypes: string[]; + status: WebhookStatus; + version: WebhookVersion; + webhookUrl: string; + webhookMethod: WebhookMethods; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface WebhookSolution { + serviceSid: string; +} +export interface WebhookListInstance { + _version: V2; + _solution: WebhookSolution; + _uri: string; + (sid: string): WebhookContext; + get(sid: string): WebhookContext; + /** + * Create a WebhookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + create(params: WebhookListInstanceCreateOptions, callback?: (error: Error | null, item?: WebhookInstance) => any): Promise; + /** + * Streams WebhookInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + each(params: WebhookListInstanceEachOptions, callback?: (item: WebhookInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Lists WebhookInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + list(params: WebhookListInstanceOptions, callback?: (error: Error | null, items: WebhookInstance[]) => any): Promise; + /** + * Retrieve a single page of WebhookInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { WebhookListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: WebhookPage) => any): Promise; + page(params: WebhookListInstancePageOptions, callback?: (error: Error | null, items: WebhookPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function WebhookListInstance(version: V2, serviceSid: string): WebhookListInstance; +export declare class WebhookPage extends Page { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: WebhookSolution); + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: WebhookResource): WebhookInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/service/webhook.js b/node_modules/twilio/lib/rest/verify/v2/service/webhook.js new file mode 100644 index 00000000..92cd03e7 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/service/webhook.js @@ -0,0 +1,287 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebhookPage = exports.WebhookListInstance = exports.WebhookInstance = exports.WebhookContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class WebhookContextImpl { + constructor(_version, serviceSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { serviceSid, sid }; + this._uri = `/Services/${serviceSid}/Webhooks/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["eventTypes"] !== undefined) + data["EventTypes"] = serialize.map(params["eventTypes"], (e) => e); + if (params["webhookUrl"] !== undefined) + data["WebhookUrl"] = params["webhookUrl"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["version"] !== undefined) + data["Version"] = params["version"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookContextImpl = WebhookContextImpl; +class WebhookInstance { + constructor(_version, payload, serviceSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.serviceSid = payload.service_sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.eventTypes = payload.event_types; + this.status = payload.status; + this.version = payload.version; + this.webhookUrl = payload.webhook_url; + this.webhookMethod = payload.webhook_method; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { serviceSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new WebhookContextImpl(this._version, this._solution.serviceSid, this._solution.sid); + return this._context; + } + /** + * Remove a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a WebhookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed WebhookInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + serviceSid: this.serviceSid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + eventTypes: this.eventTypes, + status: this.status, + version: this.version, + webhookUrl: this.webhookUrl, + webhookMethod: this.webhookMethod, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookInstance = WebhookInstance; +function WebhookListInstance(version, serviceSid) { + if (!(0, utility_1.isValidPathParam)(serviceSid)) { + throw new Error("Parameter 'serviceSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new WebhookContextImpl(version, serviceSid, sid); + }; + instance._version = version; + instance._solution = { serviceSid }; + instance._uri = `/Services/${serviceSid}/Webhooks`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + if (params["eventTypes"] === null || params["eventTypes"] === undefined) { + throw new Error("Required parameter \"params['eventTypes']\" missing."); + } + if (params["webhookUrl"] === null || params["webhookUrl"] === undefined) { + throw new Error("Required parameter \"params['webhookUrl']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + data["EventTypes"] = serialize.map(params["eventTypes"], (e) => e); + data["WebhookUrl"] = params["webhookUrl"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["version"] !== undefined) + data["Version"] = params["version"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookInstance(operationVersion, payload, instance._solution.serviceSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new WebhookPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new WebhookPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.WebhookListInstance = WebhookListInstance; +class WebhookPage extends Page_1.default { + /** + * Initialize the WebhookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of WebhookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new WebhookInstance(this._version, payload, this._solution.serviceSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.WebhookPage = WebhookPage; diff --git a/node_modules/twilio/lib/rest/verify/v2/template.d.ts b/node_modules/twilio/lib/rest/verify/v2/template.d.ts new file mode 100644 index 00000000..c6f6f32a --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/template.d.ts @@ -0,0 +1,172 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +/** + * Options to pass to each + */ +export interface TemplateListInstanceEachOptions { + /** String filter used to query templates with a given friendly name. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: TemplateInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface TemplateListInstanceOptions { + /** String filter used to query templates with a given friendly name. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface TemplateListInstancePageOptions { + /** String filter used to query templates with a given friendly name. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface TemplateSolution { +} +export interface TemplateListInstance { + _version: V2; + _solution: TemplateSolution; + _uri: string; + /** + * Streams TemplateInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TemplateListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: TemplateInstance, done: (err?: Error) => void) => void): void; + each(params: TemplateListInstanceEachOptions, callback?: (item: TemplateInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of TemplateInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: TemplatePage) => any): Promise; + /** + * Lists TemplateInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TemplateListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: TemplateInstance[]) => any): Promise; + list(params: TemplateListInstanceOptions, callback?: (error: Error | null, items: TemplateInstance[]) => any): Promise; + /** + * Retrieve a single page of TemplateInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { TemplateListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: TemplatePage) => any): Promise; + page(params: TemplateListInstancePageOptions, callback?: (error: Error | null, items: TemplatePage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function TemplateListInstance(version: V2): TemplateListInstance; +interface TemplatePayload extends TwilioResponsePayload { + templates: TemplateResource[]; +} +interface TemplateResource { + sid: string; + account_sid: string; + friendly_name: string; + channels: Array; + translations: any; +} +export declare class TemplateInstance { + protected _version: V2; + constructor(_version: V2, payload: TemplateResource); + /** + * A 34 character string that uniquely identifies a Verification Template. + */ + sid: string; + /** + * The unique SID identifier of the Account. + */ + accountSid: string; + /** + * A descriptive string that you create to describe a Template. It can be up to 32 characters long. + */ + friendlyName: string; + /** + * A list of channels that support the Template. Can include: sms, voice. + */ + channels: Array; + /** + * An object that contains the different translations of the template. Every translation is identified by the language short name and contains its respective information as the approval status, text and created/modified date. + */ + translations: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + friendlyName: string; + channels: string[]; + translations: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class TemplatePage extends Page { + /** + * Initialize the TemplatePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: TemplateSolution); + /** + * Build an instance of TemplateInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: TemplateResource): TemplateInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/template.js b/node_modules/twilio/lib/rest/verify/v2/template.js new file mode 100644 index 00000000..c4b93ce0 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/template.js @@ -0,0 +1,128 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TemplatePage = exports.TemplateInstance = exports.TemplateListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function TemplateListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/Templates`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new TemplatePage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new TemplatePage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.TemplateListInstance = TemplateListInstance; +class TemplateInstance { + constructor(_version, payload) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.channels = payload.channels; + this.translations = payload.translations; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + channels: this.channels, + translations: this.translations, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TemplateInstance = TemplateInstance; +class TemplatePage extends Page_1.default { + /** + * Initialize the TemplatePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of TemplateInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new TemplateInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.TemplatePage = TemplatePage; diff --git a/node_modules/twilio/lib/rest/verify/v2/verificationAttempt.d.ts b/node_modules/twilio/lib/rest/verify/v2/verificationAttempt.d.ts new file mode 100644 index 00000000..93a2e809 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/verificationAttempt.d.ts @@ -0,0 +1,288 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V2 from "../V2"; +export type VerificationAttemptChannels = "sms" | "call" | "email" | "whatsapp"; +export type VerificationAttemptConversionStatus = "converted" | "unconverted"; +/** + * Options to pass to each + */ +export interface VerificationAttemptListInstanceEachOptions { + /** Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd\'T\'HH:mm:ss\'Z. */ + dateCreatedAfter?: Date; + /** Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd\'T\'HH:mm:ss\'Z. */ + dateCreatedBefore?: Date; + /** Destination of a verification. It is phone number in E.164 format. */ + "channelData.to"?: string; + /** Filter used to query Verification Attempts sent to the specified destination country. */ + country?: string; + /** Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` */ + channel?: VerificationAttemptChannels; + /** Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. */ + verifyServiceSid?: string; + /** Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. */ + verificationSid?: string; + /** Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. */ + status?: VerificationAttemptConversionStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: VerificationAttemptInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface VerificationAttemptListInstanceOptions { + /** Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd\'T\'HH:mm:ss\'Z. */ + dateCreatedAfter?: Date; + /** Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd\'T\'HH:mm:ss\'Z. */ + dateCreatedBefore?: Date; + /** Destination of a verification. It is phone number in E.164 format. */ + "channelData.to"?: string; + /** Filter used to query Verification Attempts sent to the specified destination country. */ + country?: string; + /** Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` */ + channel?: VerificationAttemptChannels; + /** Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. */ + verifyServiceSid?: string; + /** Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. */ + verificationSid?: string; + /** Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. */ + status?: VerificationAttemptConversionStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface VerificationAttemptListInstancePageOptions { + /** Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd\'T\'HH:mm:ss\'Z. */ + dateCreatedAfter?: Date; + /** Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd\'T\'HH:mm:ss\'Z. */ + dateCreatedBefore?: Date; + /** Destination of a verification. It is phone number in E.164 format. */ + "channelData.to"?: string; + /** Filter used to query Verification Attempts sent to the specified destination country. */ + country?: string; + /** Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` */ + channel?: VerificationAttemptChannels; + /** Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. */ + verifyServiceSid?: string; + /** Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. */ + verificationSid?: string; + /** Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. */ + status?: VerificationAttemptConversionStatus; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface VerificationAttemptContext { + /** + * Fetch a VerificationAttemptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationAttemptInstance + */ + fetch(callback?: (error: Error | null, item?: VerificationAttemptInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface VerificationAttemptContextSolution { + sid: string; +} +export declare class VerificationAttemptContextImpl implements VerificationAttemptContext { + protected _version: V2; + protected _solution: VerificationAttemptContextSolution; + protected _uri: string; + constructor(_version: V2, sid: string); + fetch(callback?: (error: Error | null, item?: VerificationAttemptInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): VerificationAttemptContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface VerificationAttemptPayload extends TwilioResponsePayload { + attempts: VerificationAttemptResource[]; +} +interface VerificationAttemptResource { + sid: string; + account_sid: string; + service_sid: string; + verification_sid: string; + date_created: Date; + date_updated: Date; + conversion_status: VerificationAttemptConversionStatus; + channel: VerificationAttemptChannels; + price: any; + channel_data: any; + url: string; +} +export declare class VerificationAttemptInstance { + protected _version: V2; + protected _solution: VerificationAttemptContextSolution; + protected _context?: VerificationAttemptContext; + constructor(_version: V2, payload: VerificationAttemptResource, sid?: string); + /** + * The SID that uniquely identifies the verification attempt resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Verification resource. + */ + accountSid: string; + /** + * The SID of the [Service](https://www.twilio.com/docs/verify/api/service) used to generate the attempt. + */ + serviceSid: string; + /** + * The SID of the [Verification](https://www.twilio.com/docs/verify/api/verification) that generated the attempt. + */ + verificationSid: string; + /** + * The date that this Attempt was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date that this Attempt was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + conversionStatus: VerificationAttemptConversionStatus; + channel: VerificationAttemptChannels; + /** + * An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](https://www.twilio.com/en-us/verify/pricing). + */ + price: any; + /** + * An object containing the channel specific information for an attempt. + */ + channelData: any; + url: string; + private get _proxy(); + /** + * Fetch a VerificationAttemptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationAttemptInstance + */ + fetch(callback?: (error: Error | null, item?: VerificationAttemptInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + serviceSid: string; + verificationSid: string; + dateCreated: Date; + dateUpdated: Date; + conversionStatus: VerificationAttemptConversionStatus; + channel: VerificationAttemptChannels; + price: any; + channelData: any; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface VerificationAttemptSolution { +} +export interface VerificationAttemptListInstance { + _version: V2; + _solution: VerificationAttemptSolution; + _uri: string; + (sid: string): VerificationAttemptContext; + get(sid: string): VerificationAttemptContext; + /** + * Streams VerificationAttemptInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VerificationAttemptListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: VerificationAttemptInstance, done: (err?: Error) => void) => void): void; + each(params: VerificationAttemptListInstanceEachOptions, callback?: (item: VerificationAttemptInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of VerificationAttemptInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: VerificationAttemptPage) => any): Promise; + /** + * Lists VerificationAttemptInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VerificationAttemptListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: VerificationAttemptInstance[]) => any): Promise; + list(params: VerificationAttemptListInstanceOptions, callback?: (error: Error | null, items: VerificationAttemptInstance[]) => any): Promise; + /** + * Retrieve a single page of VerificationAttemptInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { VerificationAttemptListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: VerificationAttemptPage) => any): Promise; + page(params: VerificationAttemptListInstancePageOptions, callback?: (error: Error | null, items: VerificationAttemptPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function VerificationAttemptListInstance(version: V2): VerificationAttemptListInstance; +export declare class VerificationAttemptPage extends Page { + /** + * Initialize the VerificationAttemptPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: VerificationAttemptSolution); + /** + * Build an instance of VerificationAttemptInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: VerificationAttemptResource): VerificationAttemptInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/verificationAttempt.js b/node_modules/twilio/lib/rest/verify/v2/verificationAttempt.js new file mode 100644 index 00000000..561788d7 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/verificationAttempt.js @@ -0,0 +1,207 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VerificationAttemptPage = exports.VerificationAttemptListInstance = exports.VerificationAttemptInstance = exports.VerificationAttemptContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class VerificationAttemptContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Attempts/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new VerificationAttemptInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VerificationAttemptContextImpl = VerificationAttemptContextImpl; +class VerificationAttemptInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.serviceSid = payload.service_sid; + this.verificationSid = payload.verification_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.conversionStatus = payload.conversion_status; + this.channel = payload.channel; + this.price = payload.price; + this.channelData = payload.channel_data; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new VerificationAttemptContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a VerificationAttemptInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationAttemptInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + serviceSid: this.serviceSid, + verificationSid: this.verificationSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + conversionStatus: this.conversionStatus, + channel: this.channel, + price: this.price, + channelData: this.channelData, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VerificationAttemptInstance = VerificationAttemptInstance; +function VerificationAttemptListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new VerificationAttemptContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Attempts`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dateCreatedAfter"] !== undefined) + data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["channelData.to"] !== undefined) + data["ChannelData.To"] = params["channelData.to"]; + if (params["country"] !== undefined) + data["Country"] = params["country"]; + if (params["channel"] !== undefined) + data["Channel"] = params["channel"]; + if (params["verifyServiceSid"] !== undefined) + data["VerifyServiceSid"] = params["verifyServiceSid"]; + if (params["verificationSid"] !== undefined) + data["VerificationSid"] = params["verificationSid"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VerificationAttemptPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new VerificationAttemptPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.VerificationAttemptListInstance = VerificationAttemptListInstance; +class VerificationAttemptPage extends Page_1.default { + /** + * Initialize the VerificationAttemptPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of VerificationAttemptInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new VerificationAttemptInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VerificationAttemptPage = VerificationAttemptPage; diff --git a/node_modules/twilio/lib/rest/verify/v2/verificationAttemptsSummary.d.ts b/node_modules/twilio/lib/rest/verify/v2/verificationAttemptsSummary.d.ts new file mode 100644 index 00000000..608ce10e --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/verificationAttemptsSummary.d.ts @@ -0,0 +1,138 @@ +/// +import { inspect, InspectOptions } from "util"; +import V2 from "../V2"; +export type VerificationAttemptsSummaryChannels = "sms" | "call" | "email" | "whatsapp"; +/** + * Options to pass to fetch a VerificationAttemptsSummaryInstance + */ +export interface VerificationAttemptsSummaryContextFetchOptions { + /** Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. */ + verifyServiceSid?: string; + /** Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd\'T\'HH:mm:ss\'Z. */ + dateCreatedAfter?: Date; + /** Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd\'T\'HH:mm:ss\'Z. */ + dateCreatedBefore?: Date; + /** Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. */ + country?: string; + /** Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` */ + channel?: VerificationAttemptsSummaryChannels; + /** Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. */ + destinationPrefix?: string; +} +export interface VerificationAttemptsSummaryContext { + /** + * Fetch a VerificationAttemptsSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationAttemptsSummaryInstance + */ + fetch(callback?: (error: Error | null, item?: VerificationAttemptsSummaryInstance) => any): Promise; + /** + * Fetch a VerificationAttemptsSummaryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationAttemptsSummaryInstance + */ + fetch(params: VerificationAttemptsSummaryContextFetchOptions, callback?: (error: Error | null, item?: VerificationAttemptsSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface VerificationAttemptsSummaryContextSolution { +} +export declare class VerificationAttemptsSummaryContextImpl implements VerificationAttemptsSummaryContext { + protected _version: V2; + protected _solution: VerificationAttemptsSummaryContextSolution; + protected _uri: string; + constructor(_version: V2); + fetch(params?: VerificationAttemptsSummaryContextFetchOptions | ((error: Error | null, item?: VerificationAttemptsSummaryInstance) => any), callback?: (error: Error | null, item?: VerificationAttemptsSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): VerificationAttemptsSummaryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface VerificationAttemptsSummaryResource { + total_attempts: number; + total_converted: number; + total_unconverted: number; + conversion_rate_percentage: number; + url: string; +} +export declare class VerificationAttemptsSummaryInstance { + protected _version: V2; + protected _solution: VerificationAttemptsSummaryContextSolution; + protected _context?: VerificationAttemptsSummaryContext; + constructor(_version: V2, payload: VerificationAttemptsSummaryResource); + /** + * Total of attempts made according to the provided filters + */ + totalAttempts: number; + /** + * Total of attempts made that were confirmed by the end user, according to the provided filters. + */ + totalConverted: number; + /** + * Total of attempts made that were not confirmed by the end user, according to the provided filters. + */ + totalUnconverted: number; + /** + * Percentage of the confirmed messages over the total, defined by (total_converted/total_attempts)*100. + */ + conversionRatePercentage: number; + url: string; + private get _proxy(); + /** + * Fetch a VerificationAttemptsSummaryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationAttemptsSummaryInstance + */ + fetch(callback?: (error: Error | null, item?: VerificationAttemptsSummaryInstance) => any): Promise; + /** + * Fetch a VerificationAttemptsSummaryInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed VerificationAttemptsSummaryInstance + */ + fetch(params: VerificationAttemptsSummaryContextFetchOptions, callback?: (error: Error | null, item?: VerificationAttemptsSummaryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + totalAttempts: number; + totalConverted: number; + totalUnconverted: number; + conversionRatePercentage: number; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface VerificationAttemptsSummarySolution { +} +export interface VerificationAttemptsSummaryListInstance { + _version: V2; + _solution: VerificationAttemptsSummarySolution; + _uri: string; + (): VerificationAttemptsSummaryContext; + get(): VerificationAttemptsSummaryContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function VerificationAttemptsSummaryListInstance(version: V2): VerificationAttemptsSummaryListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/verify/v2/verificationAttemptsSummary.js b/node_modules/twilio/lib/rest/verify/v2/verificationAttemptsSummary.js new file mode 100644 index 00000000..66d44825 --- /dev/null +++ b/node_modules/twilio/lib/rest/verify/v2/verificationAttemptsSummary.js @@ -0,0 +1,126 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Verify + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VerificationAttemptsSummaryListInstance = exports.VerificationAttemptsSummaryInstance = exports.VerificationAttemptsSummaryContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class VerificationAttemptsSummaryContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Attempts/Summary`; + } + fetch(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["verifyServiceSid"] !== undefined) + data["VerifyServiceSid"] = params["verifyServiceSid"]; + if (params["dateCreatedAfter"] !== undefined) + data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["country"] !== undefined) + data["Country"] = params["country"]; + if (params["channel"] !== undefined) + data["Channel"] = params["channel"]; + if (params["destinationPrefix"] !== undefined) + data["DestinationPrefix"] = params["destinationPrefix"]; + const headers = {}; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new VerificationAttemptsSummaryInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VerificationAttemptsSummaryContextImpl = VerificationAttemptsSummaryContextImpl; +class VerificationAttemptsSummaryInstance { + constructor(_version, payload) { + this._version = _version; + this.totalAttempts = deserialize.integer(payload.total_attempts); + this.totalConverted = deserialize.integer(payload.total_converted); + this.totalUnconverted = deserialize.integer(payload.total_unconverted); + this.conversionRatePercentage = payload.conversion_rate_percentage; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || + new VerificationAttemptsSummaryContextImpl(this._version); + return this._context; + } + fetch(params, callback) { + return this._proxy.fetch(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + totalAttempts: this.totalAttempts, + totalConverted: this.totalConverted, + totalUnconverted: this.totalUnconverted, + conversionRatePercentage: this.conversionRatePercentage, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.VerificationAttemptsSummaryInstance = VerificationAttemptsSummaryInstance; +function VerificationAttemptsSummaryListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new VerificationAttemptsSummaryContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.VerificationAttemptsSummaryListInstance = VerificationAttemptsSummaryListInstance; diff --git a/node_modules/twilio/lib/rest/video/V1.d.ts b/node_modules/twilio/lib/rest/video/V1.d.ts new file mode 100644 index 00000000..e6efbb21 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/V1.d.ts @@ -0,0 +1,40 @@ +import VideoBase from "../VideoBase"; +import Version from "../../base/Version"; +import { CompositionListInstance } from "./v1/composition"; +import { CompositionHookListInstance } from "./v1/compositionHook"; +import { CompositionSettingsListInstance } from "./v1/compositionSettings"; +import { RecordingListInstance } from "./v1/recording"; +import { RecordingSettingsListInstance } from "./v1/recordingSettings"; +import { RoomListInstance } from "./v1/room"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Video + * + * @param domain - The Twilio (Twilio.Video) domain + */ + constructor(domain: VideoBase); + /** compositions - { Twilio.Video.V1.CompositionListInstance } resource */ + protected _compositions?: CompositionListInstance; + /** compositionHooks - { Twilio.Video.V1.CompositionHookListInstance } resource */ + protected _compositionHooks?: CompositionHookListInstance; + /** compositionSettings - { Twilio.Video.V1.CompositionSettingsListInstance } resource */ + protected _compositionSettings?: CompositionSettingsListInstance; + /** recordings - { Twilio.Video.V1.RecordingListInstance } resource */ + protected _recordings?: RecordingListInstance; + /** recordingSettings - { Twilio.Video.V1.RecordingSettingsListInstance } resource */ + protected _recordingSettings?: RecordingSettingsListInstance; + /** rooms - { Twilio.Video.V1.RoomListInstance } resource */ + protected _rooms?: RoomListInstance; + /** Getter for compositions resource */ + get compositions(): CompositionListInstance; + /** Getter for compositionHooks resource */ + get compositionHooks(): CompositionHookListInstance; + /** Getter for compositionSettings resource */ + get compositionSettings(): CompositionSettingsListInstance; + /** Getter for recordings resource */ + get recordings(): RecordingListInstance; + /** Getter for recordingSettings resource */ + get recordingSettings(): RecordingSettingsListInstance; + /** Getter for rooms resource */ + get rooms(): RoomListInstance; +} diff --git a/node_modules/twilio/lib/rest/video/V1.js b/node_modules/twilio/lib/rest/video/V1.js new file mode 100644 index 00000000..34577ff9 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/V1.js @@ -0,0 +1,69 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const composition_1 = require("./v1/composition"); +const compositionHook_1 = require("./v1/compositionHook"); +const compositionSettings_1 = require("./v1/compositionSettings"); +const recording_1 = require("./v1/recording"); +const recordingSettings_1 = require("./v1/recordingSettings"); +const room_1 = require("./v1/room"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Video + * + * @param domain - The Twilio (Twilio.Video) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for compositions resource */ + get compositions() { + this._compositions = this._compositions || (0, composition_1.CompositionListInstance)(this); + return this._compositions; + } + /** Getter for compositionHooks resource */ + get compositionHooks() { + this._compositionHooks = + this._compositionHooks || (0, compositionHook_1.CompositionHookListInstance)(this); + return this._compositionHooks; + } + /** Getter for compositionSettings resource */ + get compositionSettings() { + this._compositionSettings = + this._compositionSettings || (0, compositionSettings_1.CompositionSettingsListInstance)(this); + return this._compositionSettings; + } + /** Getter for recordings resource */ + get recordings() { + this._recordings = this._recordings || (0, recording_1.RecordingListInstance)(this); + return this._recordings; + } + /** Getter for recordingSettings resource */ + get recordingSettings() { + this._recordingSettings = + this._recordingSettings || (0, recordingSettings_1.RecordingSettingsListInstance)(this); + return this._recordingSettings; + } + /** Getter for rooms resource */ + get rooms() { + this._rooms = this._rooms || (0, room_1.RoomListInstance)(this); + return this._rooms; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/video/v1/composition.d.ts b/node_modules/twilio/lib/rest/video/v1/composition.d.ts new file mode 100644 index 00000000..d8150a72 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/composition.d.ts @@ -0,0 +1,376 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type CompositionFormat = "mp4" | "webm"; +export type CompositionStatus = "enqueued" | "processing" | "completed" | "deleted" | "failed"; +/** + * Options to pass to create a CompositionInstance + */ +export interface CompositionListInstanceCreateOptions { + /** The SID of the Group Room with the media tracks to be used as composition sources. */ + roomSid: string; + /** An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request */ + videoLayout?: any; + /** An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request */ + audioSources?: Array; + /** An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. */ + audioSourcesExcluded?: Array; + /** A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string\\\'s format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ + resolution?: string; + /** */ + format?: CompositionFormat; + /** The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */ + statusCallbackMethod?: string; + /** Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ + trim?: boolean; +} +/** + * Options to pass to each + */ +export interface CompositionListInstanceEachOptions { + /** Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. */ + status?: CompositionStatus; + /** Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */ + dateCreatedAfter?: Date; + /** Read only Composition resources created before this ISO 8601 date-time with time zone. */ + dateCreatedBefore?: Date; + /** Read only Composition resources with this Room SID. */ + roomSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CompositionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CompositionListInstanceOptions { + /** Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. */ + status?: CompositionStatus; + /** Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */ + dateCreatedAfter?: Date; + /** Read only Composition resources created before this ISO 8601 date-time with time zone. */ + dateCreatedBefore?: Date; + /** Read only Composition resources with this Room SID. */ + roomSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CompositionListInstancePageOptions { + /** Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. */ + status?: CompositionStatus; + /** Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */ + dateCreatedAfter?: Date; + /** Read only Composition resources created before this ISO 8601 date-time with time zone. */ + dateCreatedBefore?: Date; + /** Read only Composition resources with this Room SID. */ + roomSid?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CompositionContext { + /** + * Remove a CompositionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CompositionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionInstance + */ + fetch(callback?: (error: Error | null, item?: CompositionInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CompositionContextSolution { + sid: string; +} +export declare class CompositionContextImpl implements CompositionContext { + protected _version: V1; + protected _solution: CompositionContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CompositionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CompositionContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CompositionPayload extends TwilioResponsePayload { + compositions: CompositionResource[]; +} +interface CompositionResource { + account_sid: string; + status: CompositionStatus; + date_created: Date; + date_completed: Date; + date_deleted: Date; + sid: string; + room_sid: string; + audio_sources: Array; + audio_sources_excluded: Array; + video_layout: any; + resolution: string; + trim: boolean; + format: CompositionFormat; + bitrate: number; + size: number; + duration: number; + media_external_location: string; + status_callback: string; + status_callback_method: string; + url: string; + links: Record; +} +export declare class CompositionInstance { + protected _version: V1; + protected _solution: CompositionContextSolution; + protected _context?: CompositionContext; + constructor(_version: V1, payload: CompositionResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Composition resource. + */ + accountSid: string; + status: CompositionStatus; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the composition\'s media processing task finished, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCompleted: Date; + /** + * The date and time in GMT when the composition generated media was deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateDeleted: Date; + /** + * The unique string that we created to identify the Composition resource. + */ + sid: string; + /** + * The SID of the Group Room that generated the audio and video tracks used in the composition. All media sources included in a composition must belong to the same Group Room. + */ + roomSid: string; + /** + * The array of track names to include in the composition. The composition includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + */ + audioSources: Array; + /** + * The array of track names to exclude from the composition. The composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + */ + audioSourcesExcluded: Array; + /** + * An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + */ + videoLayout: any; + /** + * The dimensions of the video image in pixels expressed as columns (width) and rows (height). The string\'s format is `{width}x{height}`, such as `640x480`. + */ + resolution: string; + /** + * Whether to remove intervals with no media, as specified in the POST request that created the composition. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + */ + trim: boolean; + format: CompositionFormat; + /** + * The average bit rate of the composition\'s media. + */ + bitrate: number; + /** + * The size of the composed media file in bytes. + */ + size: number; + /** + * The duration of the composition\'s media file in seconds. + */ + duration: number; + /** + * The URL of the media file associated with the composition when stored externally. See [External S3 Compositions](/docs/video/api/external-s3-compositions) for more details. + */ + mediaExternalLocation: string; + /** + * The URL called using the `status_callback_method` to send status information on every composition event. + */ + statusCallback: string; + /** + * The HTTP method used to call `status_callback`. Can be: `POST` or `GET`, defaults to `POST`. + */ + statusCallbackMethod: string; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URL of the media file associated with the composition. + */ + links: Record; + private get _proxy(); + /** + * Remove a CompositionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CompositionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionInstance + */ + fetch(callback?: (error: Error | null, item?: CompositionInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + status: CompositionStatus; + dateCreated: Date; + dateCompleted: Date; + dateDeleted: Date; + sid: string; + roomSid: string; + audioSources: string[]; + audioSourcesExcluded: string[]; + videoLayout: any; + resolution: string; + trim: boolean; + format: CompositionFormat; + bitrate: number; + size: number; + duration: number; + mediaExternalLocation: string; + statusCallback: string; + statusCallbackMethod: string; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CompositionSolution { +} +export interface CompositionListInstance { + _version: V1; + _solution: CompositionSolution; + _uri: string; + (sid: string): CompositionContext; + get(sid: string): CompositionContext; + /** + * Create a CompositionInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionInstance + */ + create(params: CompositionListInstanceCreateOptions, callback?: (error: Error | null, item?: CompositionInstance) => any): Promise; + /** + * Streams CompositionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CompositionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CompositionInstance, done: (err?: Error) => void) => void): void; + each(params: CompositionListInstanceEachOptions, callback?: (item: CompositionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CompositionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CompositionPage) => any): Promise; + /** + * Lists CompositionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CompositionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CompositionInstance[]) => any): Promise; + list(params: CompositionListInstanceOptions, callback?: (error: Error | null, items: CompositionInstance[]) => any): Promise; + /** + * Retrieve a single page of CompositionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CompositionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CompositionPage) => any): Promise; + page(params: CompositionListInstancePageOptions, callback?: (error: Error | null, items: CompositionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CompositionListInstance(version: V1): CompositionListInstance; +export declare class CompositionPage extends Page { + /** + * Initialize the CompositionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CompositionSolution); + /** + * Build an instance of CompositionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CompositionResource): CompositionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/composition.js b/node_modules/twilio/lib/rest/video/v1/composition.js new file mode 100644 index 00000000..aac3f000 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/composition.js @@ -0,0 +1,275 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CompositionPage = exports.CompositionListInstance = exports.CompositionInstance = exports.CompositionContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CompositionContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Compositions/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CompositionInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CompositionContextImpl = CompositionContextImpl; +class CompositionInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.status = payload.status; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateCompleted = deserialize.iso8601DateTime(payload.date_completed); + this.dateDeleted = deserialize.iso8601DateTime(payload.date_deleted); + this.sid = payload.sid; + this.roomSid = payload.room_sid; + this.audioSources = payload.audio_sources; + this.audioSourcesExcluded = payload.audio_sources_excluded; + this.videoLayout = payload.video_layout; + this.resolution = payload.resolution; + this.trim = payload.trim; + this.format = payload.format; + this.bitrate = deserialize.integer(payload.bitrate); + this.size = payload.size; + this.duration = deserialize.integer(payload.duration); + this.mediaExternalLocation = payload.media_external_location; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CompositionContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CompositionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CompositionInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + status: this.status, + dateCreated: this.dateCreated, + dateCompleted: this.dateCompleted, + dateDeleted: this.dateDeleted, + sid: this.sid, + roomSid: this.roomSid, + audioSources: this.audioSources, + audioSourcesExcluded: this.audioSourcesExcluded, + videoLayout: this.videoLayout, + resolution: this.resolution, + trim: this.trim, + format: this.format, + bitrate: this.bitrate, + size: this.size, + duration: this.duration, + mediaExternalLocation: this.mediaExternalLocation, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CompositionInstance = CompositionInstance; +function CompositionListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CompositionContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Compositions`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["roomSid"] === null || params["roomSid"] === undefined) { + throw new Error("Required parameter \"params['roomSid']\" missing."); + } + let data = {}; + data["RoomSid"] = params["roomSid"]; + if (params["videoLayout"] !== undefined) + data["VideoLayout"] = serialize.object(params["videoLayout"]); + if (params["audioSources"] !== undefined) + data["AudioSources"] = serialize.map(params["audioSources"], (e) => e); + if (params["audioSourcesExcluded"] !== undefined) + data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e); + if (params["resolution"] !== undefined) + data["Resolution"] = params["resolution"]; + if (params["format"] !== undefined) + data["Format"] = params["format"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["trim"] !== undefined) + data["Trim"] = serialize.bool(params["trim"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CompositionInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["dateCreatedAfter"] !== undefined) + data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["roomSid"] !== undefined) + data["RoomSid"] = params["roomSid"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CompositionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CompositionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CompositionListInstance = CompositionListInstance; +class CompositionPage extends Page_1.default { + /** + * Initialize the CompositionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CompositionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CompositionInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CompositionPage = CompositionPage; diff --git a/node_modules/twilio/lib/rest/video/v1/compositionHook.d.ts b/node_modules/twilio/lib/rest/video/v1/compositionHook.d.ts new file mode 100644 index 00000000..65f55c32 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/compositionHook.d.ts @@ -0,0 +1,388 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type CompositionHookFormat = "mp4" | "webm"; +/** + * Options to pass to update a CompositionHookInstance + */ +export interface CompositionHookContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. */ + friendlyName: string; + /** Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. */ + enabled?: boolean; + /** A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ + videoLayout?: any; + /** An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. */ + audioSources?: Array; + /** An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. */ + audioSourcesExcluded?: Array; + /** Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ + trim?: boolean; + /** */ + format?: CompositionHookFormat; + /** A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string\\\'s format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ + resolution?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */ + statusCallbackMethod?: string; +} +/** + * Options to pass to create a CompositionHookInstance + */ +export interface CompositionHookListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. */ + friendlyName: string; + /** Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. */ + enabled?: boolean; + /** An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ + videoLayout?: any; + /** An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. */ + audioSources?: Array; + /** An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. */ + audioSourcesExcluded?: Array; + /** A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string\\\'s format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ + resolution?: string; + /** */ + format?: CompositionHookFormat; + /** The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */ + statusCallbackMethod?: string; + /** Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ + trim?: boolean; +} +/** + * Options to pass to each + */ +export interface CompositionHookListInstanceEachOptions { + /** Read only CompositionHook resources with an `enabled` value that matches this parameter. */ + enabled?: boolean; + /** Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedAfter?: Date; + /** Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedBefore?: Date; + /** Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CompositionHookInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CompositionHookListInstanceOptions { + /** Read only CompositionHook resources with an `enabled` value that matches this parameter. */ + enabled?: boolean; + /** Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedAfter?: Date; + /** Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedBefore?: Date; + /** Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CompositionHookListInstancePageOptions { + /** Read only CompositionHook resources with an `enabled` value that matches this parameter. */ + enabled?: boolean; + /** Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedAfter?: Date; + /** Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedBefore?: Date; + /** Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. */ + friendlyName?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CompositionHookContext { + /** + * Remove a CompositionHookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CompositionHookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionHookInstance + */ + fetch(callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise; + /** + * Update a CompositionHookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionHookInstance + */ + update(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CompositionHookContextSolution { + sid: string; +} +export declare class CompositionHookContextImpl implements CompositionHookContext { + protected _version: V1; + protected _solution: CompositionHookContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise; + update(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CompositionHookContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CompositionHookPayload extends TwilioResponsePayload { + composition_hooks: CompositionHookResource[]; +} +interface CompositionHookResource { + account_sid: string; + friendly_name: string; + enabled: boolean; + date_created: Date; + date_updated: Date; + sid: string; + audio_sources: Array; + audio_sources_excluded: Array; + video_layout: any; + resolution: string; + trim: boolean; + format: CompositionHookFormat; + status_callback: string; + status_callback_method: string; + url: string; +} +export declare class CompositionHookInstance { + protected _version: V1; + protected _solution: CompositionHookContextSolution; + protected _context?: CompositionHookContext; + constructor(_version: V1, payload: CompositionHookResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionHook resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. Can be up to 100 characters long and must be unique within the account. + */ + friendlyName: string; + /** + * Whether the CompositionHook is active. When `true`, the CompositionHook is triggered for every completed Group Room on the account. When `false`, the CompositionHook is never triggered. + */ + enabled: boolean; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The unique string that we created to identify the CompositionHook resource. + */ + sid: string; + /** + * The array of track names to include in the compositions created by the composition hook. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + */ + audioSources: Array; + /** + * The array of track names to exclude from the compositions created by the composition hook. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + */ + audioSourcesExcluded: Array; + /** + * A JSON object that describes the video layout of the composition in terms of regions as specified in the HTTP POST request that created the CompositionHook resource. See [POST Parameters](https://www.twilio.com/docs/video/api/compositions-resource#http-post-parameters) for more information. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + */ + videoLayout: any; + /** + * The dimensions of the video image in pixels expressed as columns (width) and rows (height). The string\'s format is `{width}x{height}`, such as `640x480`. + */ + resolution: string; + /** + * Whether intervals with no media are clipped, as specified in the POST request that created the CompositionHook resource. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + */ + trim: boolean; + format: CompositionHookFormat; + /** + * The URL we call using the `status_callback_method` to send status information to your application. + */ + statusCallback: string; + /** + * The HTTP method we should use to call `status_callback`. Can be `POST` or `GET` and defaults to `POST`. + */ + statusCallbackMethod: string; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a CompositionHookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CompositionHookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionHookInstance + */ + fetch(callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise; + /** + * Update a CompositionHookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionHookInstance + */ + update(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + friendlyName: string; + enabled: boolean; + dateCreated: Date; + dateUpdated: Date; + sid: string; + audioSources: string[]; + audioSourcesExcluded: string[]; + videoLayout: any; + resolution: string; + trim: boolean; + format: CompositionHookFormat; + statusCallback: string; + statusCallbackMethod: string; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CompositionHookSolution { +} +export interface CompositionHookListInstance { + _version: V1; + _solution: CompositionHookSolution; + _uri: string; + (sid: string): CompositionHookContext; + get(sid: string): CompositionHookContext; + /** + * Create a CompositionHookInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionHookInstance + */ + create(params: CompositionHookListInstanceCreateOptions, callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise; + /** + * Streams CompositionHookInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CompositionHookListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CompositionHookInstance, done: (err?: Error) => void) => void): void; + each(params: CompositionHookListInstanceEachOptions, callback?: (item: CompositionHookInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CompositionHookInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CompositionHookPage) => any): Promise; + /** + * Lists CompositionHookInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CompositionHookListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CompositionHookInstance[]) => any): Promise; + list(params: CompositionHookListInstanceOptions, callback?: (error: Error | null, items: CompositionHookInstance[]) => any): Promise; + /** + * Retrieve a single page of CompositionHookInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CompositionHookListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CompositionHookPage) => any): Promise; + page(params: CompositionHookListInstancePageOptions, callback?: (error: Error | null, items: CompositionHookPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CompositionHookListInstance(version: V1): CompositionHookListInstance; +export declare class CompositionHookPage extends Page { + /** + * Initialize the CompositionHookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CompositionHookSolution); + /** + * Build an instance of CompositionHookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CompositionHookResource): CompositionHookInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/compositionHook.js b/node_modules/twilio/lib/rest/video/v1/compositionHook.js new file mode 100644 index 00000000..0e78d8ec --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/compositionHook.js @@ -0,0 +1,310 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CompositionHookPage = exports.CompositionHookListInstance = exports.CompositionHookInstance = exports.CompositionHookContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CompositionHookContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/CompositionHooks/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CompositionHookInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + if (params["videoLayout"] !== undefined) + data["VideoLayout"] = serialize.object(params["videoLayout"]); + if (params["audioSources"] !== undefined) + data["AudioSources"] = serialize.map(params["audioSources"], (e) => e); + if (params["audioSourcesExcluded"] !== undefined) + data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e); + if (params["trim"] !== undefined) + data["Trim"] = serialize.bool(params["trim"]); + if (params["format"] !== undefined) + data["Format"] = params["format"]; + if (params["resolution"] !== undefined) + data["Resolution"] = params["resolution"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CompositionHookInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CompositionHookContextImpl = CompositionHookContextImpl; +class CompositionHookInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.enabled = payload.enabled; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.sid = payload.sid; + this.audioSources = payload.audio_sources; + this.audioSourcesExcluded = payload.audio_sources_excluded; + this.videoLayout = payload.video_layout; + this.resolution = payload.resolution; + this.trim = payload.trim; + this.format = payload.format; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CompositionHookContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CompositionHookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CompositionHookInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionHookInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + friendlyName: this.friendlyName, + enabled: this.enabled, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + sid: this.sid, + audioSources: this.audioSources, + audioSourcesExcluded: this.audioSourcesExcluded, + videoLayout: this.videoLayout, + resolution: this.resolution, + trim: this.trim, + format: this.format, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CompositionHookInstance = CompositionHookInstance; +function CompositionHookListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CompositionHookContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/CompositionHooks`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + if (params["videoLayout"] !== undefined) + data["VideoLayout"] = serialize.object(params["videoLayout"]); + if (params["audioSources"] !== undefined) + data["AudioSources"] = serialize.map(params["audioSources"], (e) => e); + if (params["audioSourcesExcluded"] !== undefined) + data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e); + if (params["resolution"] !== undefined) + data["Resolution"] = params["resolution"]; + if (params["format"] !== undefined) + data["Format"] = params["format"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["trim"] !== undefined) + data["Trim"] = serialize.bool(params["trim"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CompositionHookInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + if (params["dateCreatedAfter"] !== undefined) + data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CompositionHookPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CompositionHookPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CompositionHookListInstance = CompositionHookListInstance; +class CompositionHookPage extends Page_1.default { + /** + * Initialize the CompositionHookPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CompositionHookInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CompositionHookInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CompositionHookPage = CompositionHookPage; diff --git a/node_modules/twilio/lib/rest/video/v1/compositionSettings.d.ts b/node_modules/twilio/lib/rest/video/v1/compositionSettings.d.ts new file mode 100644 index 00000000..9c5e87f7 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/compositionSettings.d.ts @@ -0,0 +1,159 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to create a CompositionSettingsInstance + */ +export interface CompositionSettingsContextCreateOptions { + /** A descriptive string that you create to describe the resource and show to the user in the console */ + friendlyName: string; + /** The SID of the stored Credential resource. */ + awsCredentialsSid?: string; + /** The SID of the Public Key resource to use for encryption. */ + encryptionKeySid?: string; + /** The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). */ + awsS3Url?: string; + /** Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. */ + awsStorageEnabled?: boolean; + /** Whether all compositions should be stored in an encrypted form. The default is `false`. */ + encryptionEnabled?: boolean; +} +export interface CompositionSettingsContext { + /** + * Create a CompositionSettingsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionSettingsInstance + */ + create(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise; + /** + * Fetch a CompositionSettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionSettingsInstance + */ + fetch(callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CompositionSettingsContextSolution { +} +export declare class CompositionSettingsContextImpl implements CompositionSettingsContext { + protected _version: V1; + protected _solution: CompositionSettingsContextSolution; + protected _uri: string; + constructor(_version: V1); + create(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise; + fetch(callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CompositionSettingsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CompositionSettingsResource { + account_sid: string; + friendly_name: string; + aws_credentials_sid: string; + aws_s3_url: string; + aws_storage_enabled: boolean; + encryption_key_sid: string; + encryption_enabled: boolean; + url: string; +} +export declare class CompositionSettingsInstance { + protected _version: V1; + protected _solution: CompositionSettingsContextSolution; + protected _context?: CompositionSettingsContext; + constructor(_version: V1, payload: CompositionSettingsResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionSettings resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource and that will be shown in the console + */ + friendlyName: string; + /** + * The SID of the stored Credential resource. + */ + awsCredentialsSid: string; + /** + * The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). + */ + awsS3Url: string; + /** + * Whether all compositions are written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. + */ + awsStorageEnabled: boolean; + /** + * The SID of the Public Key resource used for encryption. + */ + encryptionKeySid: string; + /** + * Whether all compositions are stored in an encrypted form. The default is `false`. + */ + encryptionEnabled: boolean; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Create a CompositionSettingsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionSettingsInstance + */ + create(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise; + /** + * Fetch a CompositionSettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionSettingsInstance + */ + fetch(callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + friendlyName: string; + awsCredentialsSid: string; + awsS3Url: string; + awsStorageEnabled: boolean; + encryptionKeySid: string; + encryptionEnabled: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CompositionSettingsSolution { +} +export interface CompositionSettingsListInstance { + _version: V1; + _solution: CompositionSettingsSolution; + _uri: string; + (): CompositionSettingsContext; + get(): CompositionSettingsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CompositionSettingsListInstance(version: V1): CompositionSettingsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/compositionSettings.js b/node_modules/twilio/lib/rest/video/v1/compositionSettings.js new file mode 100644 index 00000000..db739cc1 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/compositionSettings.js @@ -0,0 +1,151 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CompositionSettingsListInstance = exports.CompositionSettingsInstance = exports.CompositionSettingsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class CompositionSettingsContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/CompositionSettings/Default`; + } + create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["awsCredentialsSid"] !== undefined) + data["AwsCredentialsSid"] = params["awsCredentialsSid"]; + if (params["encryptionKeySid"] !== undefined) + data["EncryptionKeySid"] = params["encryptionKeySid"]; + if (params["awsS3Url"] !== undefined) + data["AwsS3Url"] = params["awsS3Url"]; + if (params["awsStorageEnabled"] !== undefined) + data["AwsStorageEnabled"] = serialize.bool(params["awsStorageEnabled"]); + if (params["encryptionEnabled"] !== undefined) + data["EncryptionEnabled"] = serialize.bool(params["encryptionEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CompositionSettingsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CompositionSettingsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CompositionSettingsContextImpl = CompositionSettingsContextImpl; +class CompositionSettingsInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.awsCredentialsSid = payload.aws_credentials_sid; + this.awsS3Url = payload.aws_s3_url; + this.awsStorageEnabled = payload.aws_storage_enabled; + this.encryptionKeySid = payload.encryption_key_sid; + this.encryptionEnabled = payload.encryption_enabled; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new CompositionSettingsContextImpl(this._version); + return this._context; + } + create(params, callback) { + return this._proxy.create(params, callback); + } + /** + * Fetch a CompositionSettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CompositionSettingsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + friendlyName: this.friendlyName, + awsCredentialsSid: this.awsCredentialsSid, + awsS3Url: this.awsS3Url, + awsStorageEnabled: this.awsStorageEnabled, + encryptionKeySid: this.encryptionKeySid, + encryptionEnabled: this.encryptionEnabled, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CompositionSettingsInstance = CompositionSettingsInstance; +function CompositionSettingsListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new CompositionSettingsContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CompositionSettingsListInstance = CompositionSettingsListInstance; diff --git a/node_modules/twilio/lib/rest/video/v1/recording.d.ts b/node_modules/twilio/lib/rest/video/v1/recording.d.ts new file mode 100644 index 00000000..a919b401 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/recording.d.ts @@ -0,0 +1,334 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type RecordingCodec = "VP8" | "H264" | "OPUS" | "PCMU"; +export type RecordingFormat = "mka" | "mkv"; +export type RecordingStatus = "processing" | "completed" | "deleted" | "failed"; +export type RecordingType = "audio" | "video" | "data"; +/** + * Options to pass to each + */ +export interface RecordingListInstanceEachOptions { + /** Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. */ + status?: RecordingStatus; + /** Read only the recordings that have this `source_sid`. */ + sourceSid?: string; + /** Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. */ + groupingSid?: Array; + /** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */ + dateCreatedAfter?: Date; + /** Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. */ + dateCreatedBefore?: Date; + /** Read only recordings that have this media type. Can be either `audio` or `video`. */ + mediaType?: RecordingType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RecordingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RecordingListInstanceOptions { + /** Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. */ + status?: RecordingStatus; + /** Read only the recordings that have this `source_sid`. */ + sourceSid?: string; + /** Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. */ + groupingSid?: Array; + /** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */ + dateCreatedAfter?: Date; + /** Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. */ + dateCreatedBefore?: Date; + /** Read only recordings that have this media type. Can be either `audio` or `video`. */ + mediaType?: RecordingType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RecordingListInstancePageOptions { + /** Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. */ + status?: RecordingStatus; + /** Read only the recordings that have this `source_sid`. */ + sourceSid?: string; + /** Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. */ + groupingSid?: Array; + /** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */ + dateCreatedAfter?: Date; + /** Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. */ + dateCreatedBefore?: Date; + /** Read only recordings that have this media type. Can be either `audio` or `video`. */ + mediaType?: RecordingType; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RecordingContext { + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RecordingContextSolution { + sid: string; +} +export declare class RecordingContextImpl implements RecordingContext { + protected _version: V1; + protected _solution: RecordingContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RecordingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RecordingPayload extends TwilioResponsePayload { + recordings: RecordingResource[]; +} +interface RecordingResource { + account_sid: string; + status: RecordingStatus; + date_created: Date; + sid: string; + source_sid: string; + size: number; + url: string; + type: RecordingType; + duration: number; + container_format: RecordingFormat; + codec: RecordingCodec; + grouping_sids: any; + track_name: string; + offset: number; + media_external_location: string; + status_callback: string; + status_callback_method: string; + links: Record; +} +export declare class RecordingInstance { + protected _version: V1; + protected _solution: RecordingContextSolution; + protected _context?: RecordingContext; + constructor(_version: V1, payload: RecordingResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resource. + */ + accountSid: string; + status: RecordingStatus; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The unique string that we created to identify the Recording resource. + */ + sid: string; + /** + * The SID of the recording source. For a Room Recording, this value is a `track_sid`. + */ + sourceSid: string; + /** + * The size of the recorded track, in bytes. + */ + size: number; + /** + * The absolute URL of the resource. + */ + url: string; + type: RecordingType; + /** + * The duration of the recording in seconds rounded to the nearest second. Sub-second tracks have a `Duration` property of 1 second + */ + duration: number; + containerFormat: RecordingFormat; + codec: RecordingCodec; + /** + * A list of SIDs related to the recording. Includes the `room_sid` and `participant_sid`. + */ + groupingSids: any; + /** + * The name that was given to the source track of the recording. If no name is given, the `source_sid` is used. + */ + trackName: string; + /** + * The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started. This information provides a synchronization mechanism for recordings belonging to the same room. + */ + offset: number; + /** + * The URL of the media file associated with the recording when stored externally. See [External S3 Recordings](/docs/video/api/external-s3-recordings) for more details. + */ + mediaExternalLocation: string; + /** + * The URL called using the `status_callback_method` to send status information on every recording event. + */ + statusCallback: string; + /** + * The HTTP method used to call `status_callback`. Can be: `POST` or `GET`, defaults to `POST`. + */ + statusCallbackMethod: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + status: RecordingStatus; + dateCreated: Date; + sid: string; + sourceSid: string; + size: number; + url: string; + type: RecordingType; + duration: number; + containerFormat: RecordingFormat; + codec: RecordingCodec; + groupingSids: any; + trackName: string; + offset: number; + mediaExternalLocation: string; + statusCallback: string; + statusCallbackMethod: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RecordingSolution { +} +export interface RecordingListInstance { + _version: V1; + _solution: RecordingSolution; + _uri: string; + (sid: string): RecordingContext; + get(sid: string): RecordingContext; + /** + * Streams RecordingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void; + each(params: RecordingListInstanceEachOptions, callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RecordingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RecordingPage) => any): Promise; + /** + * Lists RecordingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise; + list(params: RecordingListInstanceOptions, callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise; + /** + * Retrieve a single page of RecordingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RecordingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RecordingPage) => any): Promise; + page(params: RecordingListInstancePageOptions, callback?: (error: Error | null, items: RecordingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RecordingListInstance(version: V1): RecordingListInstance; +export declare class RecordingPage extends Page { + /** + * Initialize the RecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RecordingSolution); + /** + * Build an instance of RecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RecordingResource): RecordingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/recording.js b/node_modules/twilio/lib/rest/video/v1/recording.js new file mode 100644 index 00000000..5284b3f8 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/recording.js @@ -0,0 +1,236 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RecordingPage = exports.RecordingListInstance = exports.RecordingInstance = exports.RecordingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class RecordingContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Recordings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingContextImpl = RecordingContextImpl; +class RecordingInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.status = payload.status; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.sid = payload.sid; + this.sourceSid = payload.source_sid; + this.size = payload.size; + this.url = payload.url; + this.type = payload.type; + this.duration = deserialize.integer(payload.duration); + this.containerFormat = payload.container_format; + this.codec = payload.codec; + this.groupingSids = payload.grouping_sids; + this.trackName = payload.track_name; + this.offset = payload.offset; + this.mediaExternalLocation = payload.media_external_location; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RecordingContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + status: this.status, + dateCreated: this.dateCreated, + sid: this.sid, + sourceSid: this.sourceSid, + size: this.size, + url: this.url, + type: this.type, + duration: this.duration, + containerFormat: this.containerFormat, + codec: this.codec, + groupingSids: this.groupingSids, + trackName: this.trackName, + offset: this.offset, + mediaExternalLocation: this.mediaExternalLocation, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingInstance = RecordingInstance; +function RecordingListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RecordingContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Recordings`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["sourceSid"] !== undefined) + data["SourceSid"] = params["sourceSid"]; + if (params["groupingSid"] !== undefined) + data["GroupingSid"] = serialize.map(params["groupingSid"], (e) => e); + if (params["dateCreatedAfter"] !== undefined) + data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["mediaType"] !== undefined) + data["MediaType"] = params["mediaType"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RecordingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RecordingListInstance = RecordingListInstance; +class RecordingPage extends Page_1.default { + /** + * Initialize the RecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RecordingInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingPage = RecordingPage; diff --git a/node_modules/twilio/lib/rest/video/v1/recordingSettings.d.ts b/node_modules/twilio/lib/rest/video/v1/recordingSettings.d.ts new file mode 100644 index 00000000..0c2744ea --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/recordingSettings.d.ts @@ -0,0 +1,159 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +/** + * Options to pass to create a RecordingSettingsInstance + */ +export interface RecordingSettingsContextCreateOptions { + /** A descriptive string that you create to describe the resource and be shown to users in the console */ + friendlyName: string; + /** The SID of the stored Credential resource. */ + awsCredentialsSid?: string; + /** The SID of the Public Key resource to use for encryption. */ + encryptionKeySid?: string; + /** The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). */ + awsS3Url?: string; + /** Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. */ + awsStorageEnabled?: boolean; + /** Whether all recordings should be stored in an encrypted form. The default is `false`. */ + encryptionEnabled?: boolean; +} +export interface RecordingSettingsContext { + /** + * Create a RecordingSettingsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingSettingsInstance + */ + create(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise; + /** + * Fetch a RecordingSettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingSettingsInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RecordingSettingsContextSolution { +} +export declare class RecordingSettingsContextImpl implements RecordingSettingsContext { + protected _version: V1; + protected _solution: RecordingSettingsContextSolution; + protected _uri: string; + constructor(_version: V1); + create(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise; + fetch(callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RecordingSettingsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RecordingSettingsResource { + account_sid: string; + friendly_name: string; + aws_credentials_sid: string; + aws_s3_url: string; + aws_storage_enabled: boolean; + encryption_key_sid: string; + encryption_enabled: boolean; + url: string; +} +export declare class RecordingSettingsInstance { + protected _version: V1; + protected _solution: RecordingSettingsContextSolution; + protected _context?: RecordingSettingsContext; + constructor(_version: V1, payload: RecordingSettingsResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RecordingSettings resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource and show the user in the console + */ + friendlyName: string; + /** + * The SID of the stored Credential resource. + */ + awsCredentialsSid: string; + /** + * The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). + */ + awsS3Url: string; + /** + * Whether all recordings are written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. + */ + awsStorageEnabled: boolean; + /** + * The SID of the Public Key resource used for encryption. + */ + encryptionKeySid: string; + /** + * Whether all recordings are stored in an encrypted form. The default is `false`. + */ + encryptionEnabled: boolean; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Create a RecordingSettingsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingSettingsInstance + */ + create(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise; + /** + * Fetch a RecordingSettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingSettingsInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + friendlyName: string; + awsCredentialsSid: string; + awsS3Url: string; + awsStorageEnabled: boolean; + encryptionKeySid: string; + encryptionEnabled: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RecordingSettingsSolution { +} +export interface RecordingSettingsListInstance { + _version: V1; + _solution: RecordingSettingsSolution; + _uri: string; + (): RecordingSettingsContext; + get(): RecordingSettingsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RecordingSettingsListInstance(version: V1): RecordingSettingsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/recordingSettings.js b/node_modules/twilio/lib/rest/video/v1/recordingSettings.js new file mode 100644 index 00000000..c8433ac4 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/recordingSettings.js @@ -0,0 +1,151 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RecordingSettingsListInstance = exports.RecordingSettingsInstance = exports.RecordingSettingsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +class RecordingSettingsContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/RecordingSettings/Default`; + } + create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["friendlyName"] === null || + params["friendlyName"] === undefined) { + throw new Error("Required parameter \"params['friendlyName']\" missing."); + } + let data = {}; + data["FriendlyName"] = params["friendlyName"]; + if (params["awsCredentialsSid"] !== undefined) + data["AwsCredentialsSid"] = params["awsCredentialsSid"]; + if (params["encryptionKeySid"] !== undefined) + data["EncryptionKeySid"] = params["encryptionKeySid"]; + if (params["awsS3Url"] !== undefined) + data["AwsS3Url"] = params["awsS3Url"]; + if (params["awsStorageEnabled"] !== undefined) + data["AwsStorageEnabled"] = serialize.bool(params["awsStorageEnabled"]); + if (params["encryptionEnabled"] !== undefined) + data["EncryptionEnabled"] = serialize.bool(params["encryptionEnabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingSettingsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RecordingSettingsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingSettingsContextImpl = RecordingSettingsContextImpl; +class RecordingSettingsInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.awsCredentialsSid = payload.aws_credentials_sid; + this.awsS3Url = payload.aws_s3_url; + this.awsStorageEnabled = payload.aws_storage_enabled; + this.encryptionKeySid = payload.encryption_key_sid; + this.encryptionEnabled = payload.encryption_enabled; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = + this._context || new RecordingSettingsContextImpl(this._version); + return this._context; + } + create(params, callback) { + return this._proxy.create(params, callback); + } + /** + * Fetch a RecordingSettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingSettingsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + friendlyName: this.friendlyName, + awsCredentialsSid: this.awsCredentialsSid, + awsS3Url: this.awsS3Url, + awsStorageEnabled: this.awsStorageEnabled, + encryptionKeySid: this.encryptionKeySid, + encryptionEnabled: this.encryptionEnabled, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingSettingsInstance = RecordingSettingsInstance; +function RecordingSettingsListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new RecordingSettingsContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RecordingSettingsListInstance = RecordingSettingsListInstance; diff --git a/node_modules/twilio/lib/rest/video/v1/room.d.ts b/node_modules/twilio/lib/rest/video/v1/room.d.ts new file mode 100644 index 00000000..dcd8d45f --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room.d.ts @@ -0,0 +1,448 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { ParticipantListInstance } from "./room/participant"; +import { RecordingRulesListInstance } from "./room/recordingRules"; +import { RoomRecordingListInstance } from "./room/roomRecording"; +export type RoomRoomStatus = "in-progress" | "completed" | "failed"; +export type RoomRoomType = "go" | "peer-to-peer" | "group" | "group-small"; +export type RoomVideoCodec = "VP8" | "H264"; +/** + * Options to pass to update a RoomInstance + */ +export interface RoomContextUpdateOptions { + /** */ + status: RoomRoomStatus; +} +/** + * Options to pass to create a RoomInstance + */ +export interface RoomListInstanceCreateOptions { + /** Deprecated, now always considered to be true. */ + enableTurn?: boolean; + /** */ + type?: RoomRoomType; + /** An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource\\\'s `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. */ + uniqueName?: string; + /** The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. */ + statusCallback?: string; + /** The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. */ + statusCallbackMethod?: string; + /** The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. */ + maxParticipants?: number; + /** Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** */ + recordParticipantsOnConnect?: boolean; + /** An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** */ + videoCodecs?: Array; + /** The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** */ + mediaRegion?: string; + /** A collection of Recording Rules that describe how to include or exclude matching tracks for recording */ + recordingRules?: any; + /** When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. */ + audioOnly?: boolean; + /** The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). */ + maxParticipantDuration?: number; + /** Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). */ + emptyRoomTimeout?: number; + /** Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). */ + unusedRoomTimeout?: number; + /** When set to true, indicated that this is the large room. */ + largeRoom?: boolean; +} +/** + * Options to pass to each + */ +export interface RoomListInstanceEachOptions { + /** Read only the rooms with this status. Can be: `in-progress` (default) or `completed` */ + status?: RoomRoomStatus; + /** Read only rooms with the this `unique_name`. */ + uniqueName?: string; + /** Read only rooms that started on or after this date, given as `YYYY-MM-DD`. */ + dateCreatedAfter?: Date; + /** Read only rooms that started before this date, given as `YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoomInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoomListInstanceOptions { + /** Read only the rooms with this status. Can be: `in-progress` (default) or `completed` */ + status?: RoomRoomStatus; + /** Read only rooms with the this `unique_name`. */ + uniqueName?: string; + /** Read only rooms that started on or after this date, given as `YYYY-MM-DD`. */ + dateCreatedAfter?: Date; + /** Read only rooms that started before this date, given as `YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoomListInstancePageOptions { + /** Read only the rooms with this status. Can be: `in-progress` (default) or `completed` */ + status?: RoomRoomStatus; + /** Read only rooms with the this `unique_name`. */ + uniqueName?: string; + /** Read only rooms that started on or after this date, given as `YYYY-MM-DD`. */ + dateCreatedAfter?: Date; + /** Read only rooms that started before this date, given as `YYYY-MM-DD`. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoomContext { + participants: ParticipantListInstance; + recordingRules: RecordingRulesListInstance; + recordings: RoomRecordingListInstance; + /** + * Fetch a RoomInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Update a RoomInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + update(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoomContextSolution { + sid: string; +} +export declare class RoomContextImpl implements RoomContext { + protected _version: V1; + protected _solution: RoomContextSolution; + protected _uri: string; + protected _participants?: ParticipantListInstance; + protected _recordingRules?: RecordingRulesListInstance; + protected _recordings?: RoomRecordingListInstance; + constructor(_version: V1, sid: string); + get participants(): ParticipantListInstance; + get recordingRules(): RecordingRulesListInstance; + get recordings(): RoomRecordingListInstance; + fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + update(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoomContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RoomPayload extends TwilioResponsePayload { + rooms: RoomResource[]; +} +interface RoomResource { + sid: string; + status: RoomRoomStatus; + date_created: Date; + date_updated: Date; + account_sid: string; + enable_turn: boolean; + unique_name: string; + status_callback: string; + status_callback_method: string; + end_time: Date; + duration: number; + type: RoomRoomType; + max_participants: number; + max_participant_duration: number; + max_concurrent_published_tracks: number; + record_participants_on_connect: boolean; + video_codecs: Array; + media_region: string; + audio_only: boolean; + empty_room_timeout: number; + unused_room_timeout: number; + large_room: boolean; + url: string; + links: Record; +} +export declare class RoomInstance { + protected _version: V1; + protected _solution: RoomContextSolution; + protected _context?: RoomContext; + constructor(_version: V1, payload: RoomResource, sid?: string); + /** + * The unique string that we created to identify the Room resource. + */ + sid: string; + status: RoomRoomStatus; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Room resource. + */ + accountSid: string; + /** + * Deprecated, now always considered to be true. + */ + enableTurn: boolean; + /** + * An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource\'s `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. + */ + uniqueName: string; + /** + * The URL we call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. + */ + statusCallback: string; + /** + * The HTTP method we use to call `status_callback`. Can be `POST` or `GET` and defaults to `POST`. + */ + statusCallbackMethod: string; + /** + * The UTC end time of the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + */ + endTime: Date; + /** + * The duration of the room in seconds. + */ + duration: number; + type: RoomRoomType; + /** + * The maximum number of concurrent Participants allowed in the room. + */ + maxParticipants: number; + /** + * The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). + */ + maxParticipantDuration: number; + /** + * The maximum number of published audio, video, and data tracks all participants combined are allowed to publish in the room at the same time. Check [Programmable Video Limits](https://www.twilio.com/docs/video/programmable-video-limits) for more details. If it is set to 0 it means unconstrained. + */ + maxConcurrentPublishedTracks: number; + /** + * Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** + */ + recordParticipantsOnConnect: boolean; + /** + * An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** + */ + videoCodecs: Array; + /** + * The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#media-servers). ***This feature is not available in `peer-to-peer` rooms.*** + */ + mediaRegion: string; + /** + * When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. + */ + audioOnly: boolean; + /** + * Specifies how long (in minutes) a room will remain active after last participant leaves. Can be configured when creating a room via REST API. For Ad-Hoc rooms this value cannot be changed. + */ + emptyRoomTimeout: number; + /** + * Specifies how long (in minutes) a room will remain active if no one joins. Can be configured when creating a room via REST API. For Ad-Hoc rooms this value cannot be changed. + */ + unusedRoomTimeout: number; + /** + * Indicates if this is a large room. + */ + largeRoom: boolean; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a RoomInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Update a RoomInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + update(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Access the participants. + */ + participants(): ParticipantListInstance; + /** + * Access the recordingRules. + */ + recordingRules(): RecordingRulesListInstance; + /** + * Access the recordings. + */ + recordings(): RoomRecordingListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + status: RoomRoomStatus; + dateCreated: Date; + dateUpdated: Date; + accountSid: string; + enableTurn: boolean; + uniqueName: string; + statusCallback: string; + statusCallbackMethod: string; + endTime: Date; + duration: number; + type: RoomRoomType; + maxParticipants: number; + maxParticipantDuration: number; + maxConcurrentPublishedTracks: number; + recordParticipantsOnConnect: boolean; + videoCodecs: RoomVideoCodec[]; + mediaRegion: string; + audioOnly: boolean; + emptyRoomTimeout: number; + unusedRoomTimeout: number; + largeRoom: boolean; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoomSolution { +} +export interface RoomListInstance { + _version: V1; + _solution: RoomSolution; + _uri: string; + (sid: string): RoomContext; + get(sid: string): RoomContext; + /** + * Create a RoomInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + create(callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Create a RoomInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + create(params: RoomListInstanceCreateOptions, callback?: (error: Error | null, item?: RoomInstance) => any): Promise; + /** + * Streams RoomInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoomInstance, done: (err?: Error) => void) => void): void; + each(params: RoomListInstanceEachOptions, callback?: (item: RoomInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoomInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RoomPage) => any): Promise; + /** + * Lists RoomInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoomInstance[]) => any): Promise; + list(params: RoomListInstanceOptions, callback?: (error: Error | null, items: RoomInstance[]) => any): Promise; + /** + * Retrieve a single page of RoomInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RoomPage) => any): Promise; + page(params: RoomListInstancePageOptions, callback?: (error: Error | null, items: RoomPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoomListInstance(version: V1): RoomListInstance; +export declare class RoomPage extends Page { + /** + * Initialize the RoomPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RoomSolution); + /** + * Build an instance of RoomInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoomResource): RoomInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/room.js b/node_modules/twilio/lib/rest/video/v1/room.js new file mode 100644 index 00000000..9ed9c66e --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room.js @@ -0,0 +1,339 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RoomPage = exports.RoomListInstance = exports.RoomInstance = exports.RoomContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const participant_1 = require("./room/participant"); +const recordingRules_1 = require("./room/recordingRules"); +const roomRecording_1 = require("./room/roomRecording"); +class RoomContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Rooms/${sid}`; + } + get participants() { + this._participants = + this._participants || + (0, participant_1.ParticipantListInstance)(this._version, this._solution.sid); + return this._participants; + } + get recordingRules() { + this._recordingRules = + this._recordingRules || + (0, recordingRules_1.RecordingRulesListInstance)(this._version, this._solution.sid); + return this._recordingRules; + } + get recordings() { + this._recordings = + this._recordings || + (0, roomRecording_1.RoomRecordingListInstance)(this._version, this._solution.sid); + return this._recordings; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoomInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["status"] === null || params["status"] === undefined) { + throw new Error("Required parameter \"params['status']\" missing."); + } + let data = {}; + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoomInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomContextImpl = RoomContextImpl; +class RoomInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.status = payload.status; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.accountSid = payload.account_sid; + this.enableTurn = payload.enable_turn; + this.uniqueName = payload.unique_name; + this.statusCallback = payload.status_callback; + this.statusCallbackMethod = payload.status_callback_method; + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.duration = deserialize.integer(payload.duration); + this.type = payload.type; + this.maxParticipants = deserialize.integer(payload.max_participants); + this.maxParticipantDuration = deserialize.integer(payload.max_participant_duration); + this.maxConcurrentPublishedTracks = deserialize.integer(payload.max_concurrent_published_tracks); + this.recordParticipantsOnConnect = payload.record_participants_on_connect; + this.videoCodecs = payload.video_codecs; + this.mediaRegion = payload.media_region; + this.audioOnly = payload.audio_only; + this.emptyRoomTimeout = deserialize.integer(payload.empty_room_timeout); + this.unusedRoomTimeout = deserialize.integer(payload.unused_room_timeout); + this.largeRoom = payload.large_room; + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new RoomContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Fetch a RoomInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the participants. + */ + participants() { + return this._proxy.participants; + } + /** + * Access the recordingRules. + */ + recordingRules() { + return this._proxy.recordingRules; + } + /** + * Access the recordings. + */ + recordings() { + return this._proxy.recordings; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + status: this.status, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + accountSid: this.accountSid, + enableTurn: this.enableTurn, + uniqueName: this.uniqueName, + statusCallback: this.statusCallback, + statusCallbackMethod: this.statusCallbackMethod, + endTime: this.endTime, + duration: this.duration, + type: this.type, + maxParticipants: this.maxParticipants, + maxParticipantDuration: this.maxParticipantDuration, + maxConcurrentPublishedTracks: this.maxConcurrentPublishedTracks, + recordParticipantsOnConnect: this.recordParticipantsOnConnect, + videoCodecs: this.videoCodecs, + mediaRegion: this.mediaRegion, + audioOnly: this.audioOnly, + emptyRoomTimeout: this.emptyRoomTimeout, + unusedRoomTimeout: this.unusedRoomTimeout, + largeRoom: this.largeRoom, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomInstance = RoomInstance; +function RoomListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RoomContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Rooms`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["enableTurn"] !== undefined) + data["EnableTurn"] = serialize.bool(params["enableTurn"]); + if (params["type"] !== undefined) + data["Type"] = params["type"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["statusCallback"] !== undefined) + data["StatusCallback"] = params["statusCallback"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["maxParticipants"] !== undefined) + data["MaxParticipants"] = params["maxParticipants"]; + if (params["recordParticipantsOnConnect"] !== undefined) + data["RecordParticipantsOnConnect"] = serialize.bool(params["recordParticipantsOnConnect"]); + if (params["videoCodecs"] !== undefined) + data["VideoCodecs"] = serialize.map(params["videoCodecs"], (e) => e); + if (params["mediaRegion"] !== undefined) + data["MediaRegion"] = params["mediaRegion"]; + if (params["recordingRules"] !== undefined) + data["RecordingRules"] = serialize.object(params["recordingRules"]); + if (params["audioOnly"] !== undefined) + data["AudioOnly"] = serialize.bool(params["audioOnly"]); + if (params["maxParticipantDuration"] !== undefined) + data["MaxParticipantDuration"] = params["maxParticipantDuration"]; + if (params["emptyRoomTimeout"] !== undefined) + data["EmptyRoomTimeout"] = params["emptyRoomTimeout"]; + if (params["unusedRoomTimeout"] !== undefined) + data["UnusedRoomTimeout"] = params["unusedRoomTimeout"]; + if (params["largeRoom"] !== undefined) + data["LargeRoom"] = serialize.bool(params["largeRoom"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoomInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["dateCreatedAfter"] !== undefined) + data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoomPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RoomPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoomListInstance = RoomListInstance; +class RoomPage extends Page_1.default { + /** + * Initialize the RoomPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoomInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoomInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomPage = RoomPage; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant.d.ts b/node_modules/twilio/lib/rest/video/v1/room/participant.d.ts new file mode 100644 index 00000000..6f9ddb1e --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant.d.ts @@ -0,0 +1,351 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { AnonymizeListInstance } from "./participant/anonymize"; +import { PublishedTrackListInstance } from "./participant/publishedTrack"; +import { SubscribeRulesListInstance } from "./participant/subscribeRules"; +import { SubscribedTrackListInstance } from "./participant/subscribedTrack"; +export type ParticipantStatus = "connected" | "disconnected"; +/** + * Options to pass to update a ParticipantInstance + */ +export interface ParticipantContextUpdateOptions { + /** */ + status?: ParticipantStatus; +} +/** + * Options to pass to each + */ +export interface ParticipantListInstanceEachOptions { + /** Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. */ + status?: ParticipantStatus; + /** Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. */ + identity?: string; + /** Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */ + dateCreatedAfter?: Date; + /** Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ParticipantListInstanceOptions { + /** Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. */ + status?: ParticipantStatus; + /** Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. */ + identity?: string; + /** Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */ + dateCreatedAfter?: Date; + /** Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ParticipantListInstancePageOptions { + /** Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. */ + status?: ParticipantStatus; + /** Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. */ + identity?: string; + /** Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */ + dateCreatedAfter?: Date; + /** Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ParticipantContext { + anonymize: AnonymizeListInstance; + publishedTracks: PublishedTrackListInstance; + subscribeRules: SubscribeRulesListInstance; + subscribedTracks: SubscribedTrackListInstance; + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ParticipantContextSolution { + roomSid: string; + sid: string; +} +export declare class ParticipantContextImpl implements ParticipantContext { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _uri: string; + protected _anonymize?: AnonymizeListInstance; + protected _publishedTracks?: PublishedTrackListInstance; + protected _subscribeRules?: SubscribeRulesListInstance; + protected _subscribedTracks?: SubscribedTrackListInstance; + constructor(_version: V1, roomSid: string, sid: string); + get anonymize(): AnonymizeListInstance; + get publishedTracks(): PublishedTrackListInstance; + get subscribeRules(): SubscribeRulesListInstance; + get subscribedTracks(): SubscribedTrackListInstance; + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + update(params?: ParticipantContextUpdateOptions | ((error: Error | null, item?: ParticipantInstance) => any), callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ParticipantContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ParticipantPayload extends TwilioResponsePayload { + participants: ParticipantResource[]; +} +interface ParticipantResource { + sid: string; + room_sid: string; + account_sid: string; + status: ParticipantStatus; + identity: string; + date_created: Date; + date_updated: Date; + start_time: Date; + end_time: Date; + duration: number; + url: string; + links: Record; +} +export declare class ParticipantInstance { + protected _version: V1; + protected _solution: ParticipantContextSolution; + protected _context?: ParticipantContext; + constructor(_version: V1, payload: ParticipantResource, roomSid: string, sid?: string); + /** + * The unique string that we created to identify the RoomParticipant resource. + */ + sid: string; + /** + * The SID of the participant\'s room. + */ + roomSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RoomParticipant resource. + */ + accountSid: string; + status: ParticipantStatus; + /** + * The application-defined string that uniquely identifies the resource\'s User within a Room. If a client joins with an existing Identity, the existing client is disconnected. See [access tokens](https://www.twilio.com/docs/video/tutorials/user-identity-access-tokens) and [limits](https://www.twilio.com/docs/video/programmable-video-limits) for more info. + */ + identity: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The time of participant connected to the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + */ + startTime: Date; + /** + * The time when the participant disconnected from the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + */ + endTime: Date; + /** + * The duration in seconds that the participant was `connected`. Populated only after the participant is `disconnected`. + */ + duration: number; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Update a ParticipantInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise; + /** + * Access the anonymize. + */ + anonymize(): AnonymizeListInstance; + /** + * Access the publishedTracks. + */ + publishedTracks(): PublishedTrackListInstance; + /** + * Access the subscribeRules. + */ + subscribeRules(): SubscribeRulesListInstance; + /** + * Access the subscribedTracks. + */ + subscribedTracks(): SubscribedTrackListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + roomSid: string; + accountSid: string; + status: ParticipantStatus; + identity: string; + dateCreated: Date; + dateUpdated: Date; + startTime: Date; + endTime: Date; + duration: number; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ParticipantSolution { + roomSid: string; +} +export interface ParticipantListInstance { + _version: V1; + _solution: ParticipantSolution; + _uri: string; + (sid: string): ParticipantContext; + get(sid: string): ParticipantContext; + /** + * Streams ParticipantInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + each(params: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Lists ParticipantInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + list(params: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; + /** + * Retrieve a single page of ParticipantInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ParticipantListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + page(params: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ParticipantListInstance(version: V1, roomSid: string): ParticipantListInstance; +export declare class ParticipantPage extends Page { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ParticipantSolution); + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ParticipantResource): ParticipantInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant.js b/node_modules/twilio/lib/rest/video/v1/room/participant.js new file mode 100644 index 00000000..8f0ee945 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant.js @@ -0,0 +1,286 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParticipantPage = exports.ParticipantListInstance = exports.ParticipantInstance = exports.ParticipantContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const anonymize_1 = require("./participant/anonymize"); +const publishedTrack_1 = require("./participant/publishedTrack"); +const subscribeRules_1 = require("./participant/subscribeRules"); +const subscribedTrack_1 = require("./participant/subscribedTrack"); +class ParticipantContextImpl { + constructor(_version, roomSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { roomSid, sid }; + this._uri = `/Rooms/${roomSid}/Participants/${sid}`; + } + get anonymize() { + this._anonymize = + this._anonymize || + (0, anonymize_1.AnonymizeListInstance)(this._version, this._solution.roomSid, this._solution.sid); + return this._anonymize; + } + get publishedTracks() { + this._publishedTracks = + this._publishedTracks || + (0, publishedTrack_1.PublishedTrackListInstance)(this._version, this._solution.roomSid, this._solution.sid); + return this._publishedTracks; + } + get subscribeRules() { + this._subscribeRules = + this._subscribeRules || + (0, subscribeRules_1.SubscribeRulesListInstance)(this._version, this._solution.roomSid, this._solution.sid); + return this._subscribeRules; + } + get subscribedTracks() { + this._subscribedTracks = + this._subscribedTracks || + (0, subscribedTrack_1.SubscribedTrackListInstance)(this._version, this._solution.roomSid, this._solution.sid); + return this._subscribedTracks; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantContextImpl = ParticipantContextImpl; +class ParticipantInstance { + constructor(_version, payload, roomSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.roomSid = payload.room_sid; + this.accountSid = payload.account_sid; + this.status = payload.status; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.duration = deserialize.integer(payload.duration); + this.url = payload.url; + this.links = payload.links; + this._solution = { roomSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ParticipantContextImpl(this._version, this._solution.roomSid, this._solution.sid); + return this._context; + } + /** + * Fetch a ParticipantInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ParticipantInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the anonymize. + */ + anonymize() { + return this._proxy.anonymize; + } + /** + * Access the publishedTracks. + */ + publishedTracks() { + return this._proxy.publishedTracks; + } + /** + * Access the subscribeRules. + */ + subscribeRules() { + return this._proxy.subscribeRules; + } + /** + * Access the subscribedTracks. + */ + subscribedTracks() { + return this._proxy.subscribedTracks; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + roomSid: this.roomSid, + accountSid: this.accountSid, + status: this.status, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + startTime: this.startTime, + endTime: this.endTime, + duration: this.duration, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantInstance = ParticipantInstance; +function ParticipantListInstance(version, roomSid) { + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ParticipantContextImpl(version, roomSid, sid); + }; + instance._version = version; + instance._solution = { roomSid }; + instance._uri = `/Rooms/${roomSid}/Participants`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["identity"] !== undefined) + data["Identity"] = params["identity"]; + if (params["dateCreatedAfter"] !== undefined) + data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ParticipantPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ParticipantPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ParticipantListInstance = ParticipantListInstance; +class ParticipantPage extends Page_1.default { + /** + * Initialize the ParticipantPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ParticipantInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ParticipantInstance(this._version, payload, this._solution.roomSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ParticipantPage = ParticipantPage; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.d.ts b/node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.d.ts new file mode 100644 index 00000000..6056e52b --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.d.ts @@ -0,0 +1,143 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +export type AnonymizeStatus = "connected" | "disconnected"; +export interface AnonymizeContext { + /** + * Update a AnonymizeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnonymizeInstance + */ + update(callback?: (error: Error | null, item?: AnonymizeInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface AnonymizeContextSolution { + roomSid: string; + sid: string; +} +export declare class AnonymizeContextImpl implements AnonymizeContext { + protected _version: V1; + protected _solution: AnonymizeContextSolution; + protected _uri: string; + constructor(_version: V1, roomSid: string, sid: string); + update(callback?: (error: Error | null, item?: AnonymizeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): AnonymizeContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface AnonymizeResource { + sid: string; + room_sid: string; + account_sid: string; + status: AnonymizeStatus; + identity: string; + date_created: Date; + date_updated: Date; + start_time: Date; + end_time: Date; + duration: number; + url: string; +} +export declare class AnonymizeInstance { + protected _version: V1; + protected _solution: AnonymizeContextSolution; + protected _context?: AnonymizeContext; + constructor(_version: V1, payload: AnonymizeResource, roomSid: string, sid: string); + /** + * The unique string that we created to identify the RoomParticipant resource. + */ + sid: string; + /** + * The SID of the participant\'s room. + */ + roomSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RoomParticipant resource. + */ + accountSid: string; + status: AnonymizeStatus; + /** + * The SID of the participant. + */ + identity: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * The time of participant connected to the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + */ + startTime: Date; + /** + * The time when the participant disconnected from the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + */ + endTime: Date; + /** + * The duration in seconds that the participant was `connected`. Populated only after the participant is `disconnected`. + */ + duration: number; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Update a AnonymizeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnonymizeInstance + */ + update(callback?: (error: Error | null, item?: AnonymizeInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + roomSid: string; + accountSid: string; + status: AnonymizeStatus; + identity: string; + dateCreated: Date; + dateUpdated: Date; + startTime: Date; + endTime: Date; + duration: number; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface AnonymizeSolution { + roomSid: string; + sid: string; +} +export interface AnonymizeListInstance { + _version: V1; + _solution: AnonymizeSolution; + _uri: string; + (): AnonymizeContext; + get(): AnonymizeContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function AnonymizeListInstance(version: V1, roomSid: string, sid: string): AnonymizeListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.js b/node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.js new file mode 100644 index 00000000..871eff0c --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.js @@ -0,0 +1,135 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnonymizeListInstance = exports.AnonymizeInstance = exports.AnonymizeContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class AnonymizeContextImpl { + constructor(_version, roomSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { roomSid, sid }; + this._uri = `/Rooms/${roomSid}/Participants/${sid}/Anonymize`; + } + update(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + }); + operationPromise = operationPromise.then((payload) => new AnonymizeInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AnonymizeContextImpl = AnonymizeContextImpl; +class AnonymizeInstance { + constructor(_version, payload, roomSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.roomSid = payload.room_sid; + this.accountSid = payload.account_sid; + this.status = payload.status; + this.identity = payload.identity; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.startTime = deserialize.iso8601DateTime(payload.start_time); + this.endTime = deserialize.iso8601DateTime(payload.end_time); + this.duration = deserialize.integer(payload.duration); + this.url = payload.url; + this._solution = { roomSid, sid }; + } + get _proxy() { + this._context = + this._context || + new AnonymizeContextImpl(this._version, this._solution.roomSid, this._solution.sid); + return this._context; + } + /** + * Update a AnonymizeInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed AnonymizeInstance + */ + update(callback) { + return this._proxy.update(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + roomSid: this.roomSid, + accountSid: this.accountSid, + status: this.status, + identity: this.identity, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + startTime: this.startTime, + endTime: this.endTime, + duration: this.duration, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.AnonymizeInstance = AnonymizeInstance; +function AnonymizeListInstance(version, roomSid, sid) { + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + const instance = (() => instance.get()); + instance.get = function get() { + return new AnonymizeContextImpl(version, roomSid, sid); + }; + instance._version = version; + instance._solution = { roomSid, sid }; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.AnonymizeListInstance = AnonymizeListInstance; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.d.ts b/node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.d.ts new file mode 100644 index 00000000..4ea7ad4e --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.d.ts @@ -0,0 +1,237 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type PublishedTrackKind = "audio" | "video" | "data"; +/** + * Options to pass to each + */ +export interface PublishedTrackListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: PublishedTrackInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface PublishedTrackListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface PublishedTrackListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface PublishedTrackContext { + /** + * Fetch a PublishedTrackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublishedTrackInstance + */ + fetch(callback?: (error: Error | null, item?: PublishedTrackInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface PublishedTrackContextSolution { + roomSid: string; + participantSid: string; + sid: string; +} +export declare class PublishedTrackContextImpl implements PublishedTrackContext { + protected _version: V1; + protected _solution: PublishedTrackContextSolution; + protected _uri: string; + constructor(_version: V1, roomSid: string, participantSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: PublishedTrackInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): PublishedTrackContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface PublishedTrackPayload extends TwilioResponsePayload { + published_tracks: PublishedTrackResource[]; +} +interface PublishedTrackResource { + sid: string; + participant_sid: string; + room_sid: string; + name: string; + date_created: Date; + date_updated: Date; + enabled: boolean; + kind: PublishedTrackKind; + url: string; +} +export declare class PublishedTrackInstance { + protected _version: V1; + protected _solution: PublishedTrackContextSolution; + protected _context?: PublishedTrackContext; + constructor(_version: V1, payload: PublishedTrackResource, roomSid: string, participantSid: string, sid?: string); + /** + * The unique string that we created to identify the RoomParticipantPublishedTrack resource. + */ + sid: string; + /** + * The SID of the Participant resource with the published track. + */ + participantSid: string; + /** + * The SID of the Room resource where the track is published. + */ + roomSid: string; + /** + * The track name. Must be no more than 128 characters, and be unique among the participant\'s published tracks. + */ + name: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Whether the track is enabled. + */ + enabled: boolean; + kind: PublishedTrackKind; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a PublishedTrackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublishedTrackInstance + */ + fetch(callback?: (error: Error | null, item?: PublishedTrackInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + participantSid: string; + roomSid: string; + name: string; + dateCreated: Date; + dateUpdated: Date; + enabled: boolean; + kind: PublishedTrackKind; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface PublishedTrackSolution { + roomSid: string; + participantSid: string; +} +export interface PublishedTrackListInstance { + _version: V1; + _solution: PublishedTrackSolution; + _uri: string; + (sid: string): PublishedTrackContext; + get(sid: string): PublishedTrackContext; + /** + * Streams PublishedTrackInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PublishedTrackListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: PublishedTrackInstance, done: (err?: Error) => void) => void): void; + each(params: PublishedTrackListInstanceEachOptions, callback?: (item: PublishedTrackInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of PublishedTrackInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: PublishedTrackPage) => any): Promise; + /** + * Lists PublishedTrackInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PublishedTrackListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: PublishedTrackInstance[]) => any): Promise; + list(params: PublishedTrackListInstanceOptions, callback?: (error: Error | null, items: PublishedTrackInstance[]) => any): Promise; + /** + * Retrieve a single page of PublishedTrackInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { PublishedTrackListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: PublishedTrackPage) => any): Promise; + page(params: PublishedTrackListInstancePageOptions, callback?: (error: Error | null, items: PublishedTrackPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function PublishedTrackListInstance(version: V1, roomSid: string, participantSid: string): PublishedTrackListInstance; +export declare class PublishedTrackPage extends Page { + /** + * Initialize the PublishedTrackPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: PublishedTrackSolution); + /** + * Build an instance of PublishedTrackInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: PublishedTrackResource): PublishedTrackInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.js b/node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.js new file mode 100644 index 00000000..4e20c79c --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.js @@ -0,0 +1,199 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PublishedTrackPage = exports.PublishedTrackListInstance = exports.PublishedTrackInstance = exports.PublishedTrackContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class PublishedTrackContextImpl { + constructor(_version, roomSid, participantSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { roomSid, participantSid, sid }; + this._uri = `/Rooms/${roomSid}/Participants/${participantSid}/PublishedTracks/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new PublishedTrackInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PublishedTrackContextImpl = PublishedTrackContextImpl; +class PublishedTrackInstance { + constructor(_version, payload, roomSid, participantSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.participantSid = payload.participant_sid; + this.roomSid = payload.room_sid; + this.name = payload.name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.enabled = payload.enabled; + this.kind = payload.kind; + this.url = payload.url; + this._solution = { roomSid, participantSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new PublishedTrackContextImpl(this._version, this._solution.roomSid, this._solution.participantSid, this._solution.sid); + return this._context; + } + /** + * Fetch a PublishedTrackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PublishedTrackInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + participantSid: this.participantSid, + roomSid: this.roomSid, + name: this.name, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + enabled: this.enabled, + kind: this.kind, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PublishedTrackInstance = PublishedTrackInstance; +function PublishedTrackListInstance(version, roomSid, participantSid) { + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new PublishedTrackContextImpl(version, roomSid, participantSid, sid); + }; + instance._version = version; + instance._solution = { roomSid, participantSid }; + instance._uri = `/Rooms/${roomSid}/Participants/${participantSid}/PublishedTracks`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new PublishedTrackPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new PublishedTrackPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.PublishedTrackListInstance = PublishedTrackListInstance; +class PublishedTrackPage extends Page_1.default { + /** + * Initialize the PublishedTrackPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of PublishedTrackInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new PublishedTrackInstance(this._version, payload, this._solution.roomSid, this._solution.participantSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.PublishedTrackPage = PublishedTrackPage; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.d.ts b/node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.d.ts new file mode 100644 index 00000000..ce868d30 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.d.ts @@ -0,0 +1,103 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../../V1"; +export declare class VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules { + "type"?: string; + "all"?: boolean; + "publisher"?: string; + "track"?: string; + "kind"?: string; + "priority"?: string; +} +/** + * Options to pass to update a SubscribeRulesInstance + */ +export interface SubscribeRulesListInstanceUpdateOptions { + /** A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. */ + rules?: any; +} +export interface SubscribeRulesSolution { + roomSid: string; + participantSid: string; +} +export interface SubscribeRulesListInstance { + _version: V1; + _solution: SubscribeRulesSolution; + _uri: string; + /** + * Fetch a SubscribeRulesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribeRulesInstance + */ + fetch(callback?: (error: Error | null, item?: SubscribeRulesInstance) => any): Promise; + /** + * Update a SubscribeRulesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribeRulesInstance + */ + update(callback?: (error: Error | null, item?: SubscribeRulesInstance) => any): Promise; + /** + * Update a SubscribeRulesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribeRulesInstance + */ + update(params: SubscribeRulesListInstanceUpdateOptions, callback?: (error: Error | null, item?: SubscribeRulesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SubscribeRulesListInstance(version: V1, roomSid: string, participantSid: string): SubscribeRulesListInstance; +interface SubscribeRulesResource { + participant_sid: string; + room_sid: string; + rules: Array; + date_created: Date; + date_updated: Date; +} +export declare class SubscribeRulesInstance { + protected _version: V1; + constructor(_version: V1, payload: SubscribeRulesResource, roomSid: string, participantSid: string); + /** + * The SID of the Participant resource for the Subscribe Rules. + */ + participantSid: string; + /** + * The SID of the Room resource for the Subscribe Rules + */ + roomSid: string; + /** + * A collection of Subscribe Rules that describe how to include or exclude matching tracks. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. + */ + rules: Array; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + participantSid: string; + roomSid: string; + rules: VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules[]; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.js b/node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.js new file mode 100644 index 00000000..b818f592 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.js @@ -0,0 +1,103 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SubscribeRulesInstance = exports.SubscribeRulesListInstance = exports.VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules { +} +exports.VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules = VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules; +function SubscribeRulesListInstance(version, roomSid, participantSid) { + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { roomSid, participantSid }; + instance._uri = `/Rooms/${roomSid}/Participants/${participantSid}/SubscribeRules`; + instance.fetch = function fetch(callback) { + let operationVersion = version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SubscribeRulesInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.update = function update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["rules"] !== undefined) + data["Rules"] = serialize.object(params["rules"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SubscribeRulesInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SubscribeRulesListInstance = SubscribeRulesListInstance; +class SubscribeRulesInstance { + constructor(_version, payload, roomSid, participantSid) { + this._version = _version; + this.participantSid = payload.participant_sid; + this.roomSid = payload.room_sid; + this.rules = payload.rules; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + participantSid: this.participantSid, + roomSid: this.roomSid, + rules: this.rules, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscribeRulesInstance = SubscribeRulesInstance; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.d.ts b/node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.d.ts new file mode 100644 index 00000000..20e4edcc --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.d.ts @@ -0,0 +1,243 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +export type SubscribedTrackKind = "audio" | "video" | "data"; +/** + * Options to pass to each + */ +export interface SubscribedTrackListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SubscribedTrackInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SubscribedTrackListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SubscribedTrackListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SubscribedTrackContext { + /** + * Fetch a SubscribedTrackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedTrackInstance + */ + fetch(callback?: (error: Error | null, item?: SubscribedTrackInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SubscribedTrackContextSolution { + roomSid: string; + participantSid: string; + sid: string; +} +export declare class SubscribedTrackContextImpl implements SubscribedTrackContext { + protected _version: V1; + protected _solution: SubscribedTrackContextSolution; + protected _uri: string; + constructor(_version: V1, roomSid: string, participantSid: string, sid: string); + fetch(callback?: (error: Error | null, item?: SubscribedTrackInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SubscribedTrackContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SubscribedTrackPayload extends TwilioResponsePayload { + subscribed_tracks: SubscribedTrackResource[]; +} +interface SubscribedTrackResource { + sid: string; + participant_sid: string; + publisher_sid: string; + room_sid: string; + name: string; + date_created: Date; + date_updated: Date; + enabled: boolean; + kind: SubscribedTrackKind; + url: string; +} +export declare class SubscribedTrackInstance { + protected _version: V1; + protected _solution: SubscribedTrackContextSolution; + protected _context?: SubscribedTrackContext; + constructor(_version: V1, payload: SubscribedTrackResource, roomSid: string, participantSid: string, sid?: string); + /** + * The unique string that we created to identify the RoomParticipantSubscribedTrack resource. + */ + sid: string; + /** + * The SID of the participant that subscribes to the track. + */ + participantSid: string; + /** + * The SID of the participant that publishes the track. + */ + publisherSid: string; + /** + * The SID of the room where the track is published. + */ + roomSid: string; + /** + * The track name. Must have no more than 128 characters and be unique among the participant\'s published tracks. + */ + name: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Whether the track is enabled. + */ + enabled: boolean; + kind: SubscribedTrackKind; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a SubscribedTrackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedTrackInstance + */ + fetch(callback?: (error: Error | null, item?: SubscribedTrackInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + participantSid: string; + publisherSid: string; + roomSid: string; + name: string; + dateCreated: Date; + dateUpdated: Date; + enabled: boolean; + kind: SubscribedTrackKind; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SubscribedTrackSolution { + roomSid: string; + participantSid: string; +} +export interface SubscribedTrackListInstance { + _version: V1; + _solution: SubscribedTrackSolution; + _uri: string; + (sid: string): SubscribedTrackContext; + get(sid: string): SubscribedTrackContext; + /** + * Streams SubscribedTrackInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscribedTrackListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SubscribedTrackInstance, done: (err?: Error) => void) => void): void; + each(params: SubscribedTrackListInstanceEachOptions, callback?: (item: SubscribedTrackInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SubscribedTrackInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SubscribedTrackPage) => any): Promise; + /** + * Lists SubscribedTrackInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscribedTrackListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SubscribedTrackInstance[]) => any): Promise; + list(params: SubscribedTrackListInstanceOptions, callback?: (error: Error | null, items: SubscribedTrackInstance[]) => any): Promise; + /** + * Retrieve a single page of SubscribedTrackInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SubscribedTrackListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SubscribedTrackPage) => any): Promise; + page(params: SubscribedTrackListInstancePageOptions, callback?: (error: Error | null, items: SubscribedTrackPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SubscribedTrackListInstance(version: V1, roomSid: string, participantSid: string): SubscribedTrackListInstance; +export declare class SubscribedTrackPage extends Page { + /** + * Initialize the SubscribedTrackPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SubscribedTrackSolution); + /** + * Build an instance of SubscribedTrackInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SubscribedTrackResource): SubscribedTrackInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.js b/node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.js new file mode 100644 index 00000000..3a3296a2 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.js @@ -0,0 +1,201 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SubscribedTrackPage = exports.SubscribedTrackListInstance = exports.SubscribedTrackInstance = exports.SubscribedTrackContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +class SubscribedTrackContextImpl { + constructor(_version, roomSid, participantSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { roomSid, participantSid, sid }; + this._uri = `/Rooms/${roomSid}/Participants/${participantSid}/SubscribedTracks/${sid}`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SubscribedTrackInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscribedTrackContextImpl = SubscribedTrackContextImpl; +class SubscribedTrackInstance { + constructor(_version, payload, roomSid, participantSid, sid) { + this._version = _version; + this.sid = payload.sid; + this.participantSid = payload.participant_sid; + this.publisherSid = payload.publisher_sid; + this.roomSid = payload.room_sid; + this.name = payload.name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.enabled = payload.enabled; + this.kind = payload.kind; + this.url = payload.url; + this._solution = { roomSid, participantSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SubscribedTrackContextImpl(this._version, this._solution.roomSid, this._solution.participantSid, this._solution.sid); + return this._context; + } + /** + * Fetch a SubscribedTrackInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SubscribedTrackInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + participantSid: this.participantSid, + publisherSid: this.publisherSid, + roomSid: this.roomSid, + name: this.name, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + enabled: this.enabled, + kind: this.kind, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscribedTrackInstance = SubscribedTrackInstance; +function SubscribedTrackListInstance(version, roomSid, participantSid) { + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(participantSid)) { + throw new Error("Parameter 'participantSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SubscribedTrackContextImpl(version, roomSid, participantSid, sid); + }; + instance._version = version; + instance._solution = { roomSid, participantSid }; + instance._uri = `/Rooms/${roomSid}/Participants/${participantSid}/SubscribedTracks`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SubscribedTrackPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SubscribedTrackPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SubscribedTrackListInstance = SubscribedTrackListInstance; +class SubscribedTrackPage extends Page_1.default { + /** + * Initialize the SubscribedTrackPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SubscribedTrackInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SubscribedTrackInstance(this._version, payload, this._solution.roomSid, this._solution.participantSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SubscribedTrackPage = SubscribedTrackPage; diff --git a/node_modules/twilio/lib/rest/video/v1/room/recordingRules.d.ts b/node_modules/twilio/lib/rest/video/v1/room/recordingRules.d.ts new file mode 100644 index 00000000..33825b77 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/recordingRules.d.ts @@ -0,0 +1,95 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +export declare class VideoV1RoomRoomRecordingRuleRules { + "type"?: string; + "all"?: boolean; + "publisher"?: string; + "track"?: string; + "kind"?: string; +} +/** + * Options to pass to update a RecordingRulesInstance + */ +export interface RecordingRulesListInstanceUpdateOptions { + /** A JSON-encoded array of recording rules. */ + rules?: any; +} +export interface RecordingRulesSolution { + roomSid: string; +} +export interface RecordingRulesListInstance { + _version: V1; + _solution: RecordingRulesSolution; + _uri: string; + /** + * Fetch a RecordingRulesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingRulesInstance + */ + fetch(callback?: (error: Error | null, item?: RecordingRulesInstance) => any): Promise; + /** + * Update a RecordingRulesInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingRulesInstance + */ + update(callback?: (error: Error | null, item?: RecordingRulesInstance) => any): Promise; + /** + * Update a RecordingRulesInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RecordingRulesInstance + */ + update(params: RecordingRulesListInstanceUpdateOptions, callback?: (error: Error | null, item?: RecordingRulesInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RecordingRulesListInstance(version: V1, roomSid: string): RecordingRulesListInstance; +interface RecordingRulesResource { + room_sid: string; + rules: Array; + date_created: Date; + date_updated: Date; +} +export declare class RecordingRulesInstance { + protected _version: V1; + constructor(_version: V1, payload: RecordingRulesResource, roomSid: string); + /** + * The SID of the Room resource for the Recording Rules + */ + roomSid: string; + /** + * A collection of Recording Rules that describe how to include or exclude matching tracks for recording + */ + rules: Array; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateUpdated: Date; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + roomSid: string; + rules: VideoV1RoomRoomRecordingRuleRules[]; + dateCreated: Date; + dateUpdated: Date; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/room/recordingRules.js b/node_modules/twilio/lib/rest/video/v1/room/recordingRules.js new file mode 100644 index 00000000..ecb72dfc --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/recordingRules.js @@ -0,0 +1,98 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RecordingRulesInstance = exports.RecordingRulesListInstance = exports.VideoV1RoomRoomRecordingRuleRules = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class VideoV1RoomRoomRecordingRuleRules { +} +exports.VideoV1RoomRoomRecordingRuleRules = VideoV1RoomRoomRecordingRuleRules; +function RecordingRulesListInstance(version, roomSid) { + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { roomSid }; + instance._uri = `/Rooms/${roomSid}/RecordingRules`; + instance.fetch = function fetch(callback) { + let operationVersion = version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RecordingRulesInstance(operationVersion, payload, instance._solution.roomSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.update = function update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["rules"] !== undefined) + data["Rules"] = serialize.object(params["rules"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RecordingRulesInstance(operationVersion, payload, instance._solution.roomSid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RecordingRulesListInstance = RecordingRulesListInstance; +class RecordingRulesInstance { + constructor(_version, payload, roomSid) { + this._version = _version; + this.roomSid = payload.room_sid; + this.rules = payload.rules; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + roomSid: this.roomSid, + rules: this.rules, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RecordingRulesInstance = RecordingRulesInstance; diff --git a/node_modules/twilio/lib/rest/video/v1/room/roomRecording.d.ts b/node_modules/twilio/lib/rest/video/v1/room/roomRecording.d.ts new file mode 100644 index 00000000..931abe87 --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/roomRecording.d.ts @@ -0,0 +1,318 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type RoomRecordingCodec = "VP8" | "H264" | "OPUS" | "PCMU"; +export type RoomRecordingFormat = "mka" | "mkv"; +export type RoomRecordingStatus = "processing" | "completed" | "deleted" | "failed"; +export type RoomRecordingType = "audio" | "video" | "data"; +/** + * Options to pass to each + */ +export interface RoomRecordingListInstanceEachOptions { + /** Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. */ + status?: RoomRecordingStatus; + /** Read only the recordings that have this `source_sid`. */ + sourceSid?: string; + /** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedAfter?: Date; + /** Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RoomRecordingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RoomRecordingListInstanceOptions { + /** Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. */ + status?: RoomRecordingStatus; + /** Read only the recordings that have this `source_sid`. */ + sourceSid?: string; + /** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedAfter?: Date; + /** Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RoomRecordingListInstancePageOptions { + /** Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. */ + status?: RoomRecordingStatus; + /** Read only the recordings that have this `source_sid`. */ + sourceSid?: string; + /** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedAfter?: Date; + /** Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ + dateCreatedBefore?: Date; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RoomRecordingContext { + /** + * Remove a RoomRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoomRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomRecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RoomRecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RoomRecordingContextSolution { + roomSid: string; + sid: string; +} +export declare class RoomRecordingContextImpl implements RoomRecordingContext { + protected _version: V1; + protected _solution: RoomRecordingContextSolution; + protected _uri: string; + constructor(_version: V1, roomSid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RoomRecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RoomRecordingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RoomRecordingPayload extends TwilioResponsePayload { + recordings: RoomRecordingResource[]; +} +interface RoomRecordingResource { + account_sid: string; + status: RoomRecordingStatus; + date_created: Date; + sid: string; + source_sid: string; + size: number; + url: string; + type: RoomRecordingType; + duration: number; + container_format: RoomRecordingFormat; + codec: RoomRecordingCodec; + grouping_sids: any; + track_name: string; + offset: number; + media_external_location: string; + room_sid: string; + links: Record; +} +export declare class RoomRecordingInstance { + protected _version: V1; + protected _solution: RoomRecordingContextSolution; + protected _context?: RoomRecordingContext; + constructor(_version: V1, payload: RoomRecordingResource, roomSid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RoomRecording resource. + */ + accountSid: string; + status: RoomRecordingStatus; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + */ + dateCreated: Date; + /** + * The unique string that we created to identify the RoomRecording resource. + */ + sid: string; + /** + * The SID of the recording source. For a Room Recording, this value is a `track_sid`. + */ + sourceSid: string; + /** + * The size of the recorded track in bytes. + */ + size: number; + /** + * The absolute URL of the resource. + */ + url: string; + type: RoomRecordingType; + /** + * The duration of the recording rounded to the nearest second. Sub-second duration tracks have a `duration` of 1 second + */ + duration: number; + containerFormat: RoomRecordingFormat; + codec: RoomRecordingCodec; + /** + * A list of SIDs related to the Recording. Includes the `room_sid` and `participant_sid`. + */ + groupingSids: any; + /** + * The name that was given to the source track of the recording. If no name is given, the `source_sid` is used. + */ + trackName: string; + /** + * The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started. This information provides a synchronization mechanism for recordings belonging to the same room. + */ + offset: number; + /** + * The URL of the media file associated with the recording when stored externally. See [External S3 Recordings](/docs/video/api/external-s3-recordings) for more details. + */ + mediaExternalLocation: string; + /** + * The SID of the Room resource the recording is associated with. + */ + roomSid: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a RoomRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RoomRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomRecordingInstance + */ + fetch(callback?: (error: Error | null, item?: RoomRecordingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + status: RoomRecordingStatus; + dateCreated: Date; + sid: string; + sourceSid: string; + size: number; + url: string; + type: RoomRecordingType; + duration: number; + containerFormat: RoomRecordingFormat; + codec: RoomRecordingCodec; + groupingSids: any; + trackName: string; + offset: number; + mediaExternalLocation: string; + roomSid: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RoomRecordingSolution { + roomSid: string; +} +export interface RoomRecordingListInstance { + _version: V1; + _solution: RoomRecordingSolution; + _uri: string; + (sid: string): RoomRecordingContext; + get(sid: string): RoomRecordingContext; + /** + * Streams RoomRecordingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomRecordingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RoomRecordingInstance, done: (err?: Error) => void) => void): void; + each(params: RoomRecordingListInstanceEachOptions, callback?: (item: RoomRecordingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RoomRecordingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RoomRecordingPage) => any): Promise; + /** + * Lists RoomRecordingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomRecordingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RoomRecordingInstance[]) => any): Promise; + list(params: RoomRecordingListInstanceOptions, callback?: (error: Error | null, items: RoomRecordingInstance[]) => any): Promise; + /** + * Retrieve a single page of RoomRecordingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RoomRecordingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RoomRecordingPage) => any): Promise; + page(params: RoomRecordingListInstancePageOptions, callback?: (error: Error | null, items: RoomRecordingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RoomRecordingListInstance(version: V1, roomSid: string): RoomRecordingListInstance; +export declare class RoomRecordingPage extends Page { + /** + * Initialize the RoomRecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RoomRecordingSolution); + /** + * Build an instance of RoomRecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RoomRecordingResource): RoomRecordingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/video/v1/room/roomRecording.js b/node_modules/twilio/lib/rest/video/v1/room/roomRecording.js new file mode 100644 index 00000000..3b7d357b --- /dev/null +++ b/node_modules/twilio/lib/rest/video/v1/room/roomRecording.js @@ -0,0 +1,236 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RoomRecordingPage = exports.RoomRecordingListInstance = exports.RoomRecordingInstance = exports.RoomRecordingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class RoomRecordingContextImpl { + constructor(_version, roomSid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { roomSid, sid }; + this._uri = `/Rooms/${roomSid}/Recordings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RoomRecordingInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomRecordingContextImpl = RoomRecordingContextImpl; +class RoomRecordingInstance { + constructor(_version, payload, roomSid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.status = payload.status; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.sid = payload.sid; + this.sourceSid = payload.source_sid; + this.size = payload.size; + this.url = payload.url; + this.type = payload.type; + this.duration = deserialize.integer(payload.duration); + this.containerFormat = payload.container_format; + this.codec = payload.codec; + this.groupingSids = payload.grouping_sids; + this.trackName = payload.track_name; + this.offset = payload.offset; + this.mediaExternalLocation = payload.media_external_location; + this.roomSid = payload.room_sid; + this.links = payload.links; + this._solution = { roomSid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RoomRecordingContextImpl(this._version, this._solution.roomSid, this._solution.sid); + return this._context; + } + /** + * Remove a RoomRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RoomRecordingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RoomRecordingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + status: this.status, + dateCreated: this.dateCreated, + sid: this.sid, + sourceSid: this.sourceSid, + size: this.size, + url: this.url, + type: this.type, + duration: this.duration, + containerFormat: this.containerFormat, + codec: this.codec, + groupingSids: this.groupingSids, + trackName: this.trackName, + offset: this.offset, + mediaExternalLocation: this.mediaExternalLocation, + roomSid: this.roomSid, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomRecordingInstance = RoomRecordingInstance; +function RoomRecordingListInstance(version, roomSid) { + if (!(0, utility_1.isValidPathParam)(roomSid)) { + throw new Error("Parameter 'roomSid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RoomRecordingContextImpl(version, roomSid, sid); + }; + instance._version = version; + instance._solution = { roomSid }; + instance._uri = `/Rooms/${roomSid}/Recordings`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["sourceSid"] !== undefined) + data["SourceSid"] = params["sourceSid"]; + if (params["dateCreatedAfter"] !== undefined) + data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]); + if (params["dateCreatedBefore"] !== undefined) + data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RoomRecordingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RoomRecordingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RoomRecordingListInstance = RoomRecordingListInstance; +class RoomRecordingPage extends Page_1.default { + /** + * Initialize the RoomRecordingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RoomRecordingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RoomRecordingInstance(this._version, payload, this._solution.roomSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RoomRecordingPage = RoomRecordingPage; diff --git a/node_modules/twilio/lib/rest/voice/V1.d.ts b/node_modules/twilio/lib/rest/voice/V1.d.ts new file mode 100644 index 00000000..3766127d --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/V1.d.ts @@ -0,0 +1,40 @@ +import VoiceBase from "../VoiceBase"; +import Version from "../../base/Version"; +import { ArchivedCallListInstance } from "./v1/archivedCall"; +import { ByocTrunkListInstance } from "./v1/byocTrunk"; +import { ConnectionPolicyListInstance } from "./v1/connectionPolicy"; +import { DialingPermissionsListInstance } from "./v1/dialingPermissions"; +import { IpRecordListInstance } from "./v1/ipRecord"; +import { SourceIpMappingListInstance } from "./v1/sourceIpMapping"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Voice + * + * @param domain - The Twilio (Twilio.Voice) domain + */ + constructor(domain: VoiceBase); + /** archivedCalls - { Twilio.Voice.V1.ArchivedCallListInstance } resource */ + protected _archivedCalls?: ArchivedCallListInstance; + /** byocTrunks - { Twilio.Voice.V1.ByocTrunkListInstance } resource */ + protected _byocTrunks?: ByocTrunkListInstance; + /** connectionPolicies - { Twilio.Voice.V1.ConnectionPolicyListInstance } resource */ + protected _connectionPolicies?: ConnectionPolicyListInstance; + /** dialingPermissions - { Twilio.Voice.V1.DialingPermissionsListInstance } resource */ + protected _dialingPermissions?: DialingPermissionsListInstance; + /** ipRecords - { Twilio.Voice.V1.IpRecordListInstance } resource */ + protected _ipRecords?: IpRecordListInstance; + /** sourceIpMappings - { Twilio.Voice.V1.SourceIpMappingListInstance } resource */ + protected _sourceIpMappings?: SourceIpMappingListInstance; + /** Getter for archivedCalls resource */ + get archivedCalls(): ArchivedCallListInstance; + /** Getter for byocTrunks resource */ + get byocTrunks(): ByocTrunkListInstance; + /** Getter for connectionPolicies resource */ + get connectionPolicies(): ConnectionPolicyListInstance; + /** Getter for dialingPermissions resource */ + get dialingPermissions(): DialingPermissionsListInstance; + /** Getter for ipRecords resource */ + get ipRecords(): IpRecordListInstance; + /** Getter for sourceIpMappings resource */ + get sourceIpMappings(): SourceIpMappingListInstance; +} diff --git a/node_modules/twilio/lib/rest/voice/V1.js b/node_modules/twilio/lib/rest/voice/V1.js new file mode 100644 index 00000000..fc477b16 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/V1.js @@ -0,0 +1,69 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const archivedCall_1 = require("./v1/archivedCall"); +const byocTrunk_1 = require("./v1/byocTrunk"); +const connectionPolicy_1 = require("./v1/connectionPolicy"); +const dialingPermissions_1 = require("./v1/dialingPermissions"); +const ipRecord_1 = require("./v1/ipRecord"); +const sourceIpMapping_1 = require("./v1/sourceIpMapping"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Voice + * + * @param domain - The Twilio (Twilio.Voice) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for archivedCalls resource */ + get archivedCalls() { + this._archivedCalls = this._archivedCalls || (0, archivedCall_1.ArchivedCallListInstance)(this); + return this._archivedCalls; + } + /** Getter for byocTrunks resource */ + get byocTrunks() { + this._byocTrunks = this._byocTrunks || (0, byocTrunk_1.ByocTrunkListInstance)(this); + return this._byocTrunks; + } + /** Getter for connectionPolicies resource */ + get connectionPolicies() { + this._connectionPolicies = + this._connectionPolicies || (0, connectionPolicy_1.ConnectionPolicyListInstance)(this); + return this._connectionPolicies; + } + /** Getter for dialingPermissions resource */ + get dialingPermissions() { + this._dialingPermissions = + this._dialingPermissions || (0, dialingPermissions_1.DialingPermissionsListInstance)(this); + return this._dialingPermissions; + } + /** Getter for ipRecords resource */ + get ipRecords() { + this._ipRecords = this._ipRecords || (0, ipRecord_1.IpRecordListInstance)(this); + return this._ipRecords; + } + /** Getter for sourceIpMappings resource */ + get sourceIpMappings() { + this._sourceIpMappings = + this._sourceIpMappings || (0, sourceIpMapping_1.SourceIpMappingListInstance)(this); + return this._sourceIpMappings; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/voice/v1/archivedCall.d.ts b/node_modules/twilio/lib/rest/voice/v1/archivedCall.d.ts new file mode 100644 index 00000000..f83e45f2 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/archivedCall.d.ts @@ -0,0 +1,51 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +export interface ArchivedCallContext { + /** + * Remove a ArchivedCallInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ArchivedCallContextSolution { + date: Date; + sid: string; +} +export declare class ArchivedCallContextImpl implements ArchivedCallContext { + protected _version: V1; + protected _solution: ArchivedCallContextSolution; + protected _uri: string; + constructor(_version: V1, date: Date, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ArchivedCallContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ArchivedCallSolution { +} +export interface ArchivedCallListInstance { + _version: V1; + _solution: ArchivedCallSolution; + _uri: string; + (date: Date, sid: string): ArchivedCallContext; + get(date: Date, sid: string): ArchivedCallContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ArchivedCallListInstance(version: V1): ArchivedCallListInstance; diff --git a/node_modules/twilio/lib/rest/voice/v1/archivedCall.js b/node_modules/twilio/lib/rest/voice/v1/archivedCall.js new file mode 100644 index 00000000..ff495864 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/archivedCall.js @@ -0,0 +1,71 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ArchivedCallListInstance = exports.ArchivedCallContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class ArchivedCallContextImpl { + constructor(_version, date, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(date)) { + throw new Error("Parameter 'date' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { date, sid }; + this._uri = `/Archives/${date}/Calls/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ArchivedCallContextImpl = ArchivedCallContextImpl; +function ArchivedCallListInstance(version) { + const instance = ((date, sid) => instance.get(date, sid)); + instance.get = function get(date, sid) { + return new ArchivedCallContextImpl(version, date, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ArchivedCallListInstance = ArchivedCallListInstance; diff --git a/node_modules/twilio/lib/rest/voice/v1/byocTrunk.d.ts b/node_modules/twilio/lib/rest/voice/v1/byocTrunk.d.ts new file mode 100644 index 00000000..73be1855 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/byocTrunk.d.ts @@ -0,0 +1,390 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to update a ByocTrunkInstance + */ +export interface ByocTrunkContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ + friendlyName?: string; + /** The URL we should call when the BYOC Trunk receives a call. */ + voiceUrl?: string; + /** The HTTP method we should use to call `voice_url` */ + voiceMethod?: string; + /** The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. */ + voiceFallbackUrl?: string; + /** The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call to pass status parameters (such as call ended) to your application. */ + statusCallbackUrl?: string; + /** The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. */ + statusCallbackMethod?: string; + /** Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. */ + cnamLookupEnabled?: boolean; + /** The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. */ + connectionPolicySid?: string; + /** The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". */ + fromDomainSid?: string; +} +/** + * Options to pass to create a ByocTrunkInstance + */ +export interface ByocTrunkListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ + friendlyName?: string; + /** The URL we should call when the BYOC Trunk receives a call. */ + voiceUrl?: string; + /** The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. */ + voiceMethod?: string; + /** The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. */ + voiceFallbackUrl?: string; + /** The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. */ + voiceFallbackMethod?: string; + /** The URL that we should call to pass status parameters (such as call ended) to your application. */ + statusCallbackUrl?: string; + /** The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. */ + statusCallbackMethod?: string; + /** Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. */ + cnamLookupEnabled?: boolean; + /** The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. */ + connectionPolicySid?: string; + /** The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". */ + fromDomainSid?: string; +} +/** + * Options to pass to each + */ +export interface ByocTrunkListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ByocTrunkInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ByocTrunkListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ByocTrunkListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ByocTrunkContext { + /** + * Remove a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + fetch(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Update a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + update(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Update a ByocTrunkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + update(params: ByocTrunkContextUpdateOptions, callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ByocTrunkContextSolution { + sid: string; +} +export declare class ByocTrunkContextImpl implements ByocTrunkContext { + protected _version: V1; + protected _solution: ByocTrunkContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + update(params?: ByocTrunkContextUpdateOptions | ((error: Error | null, item?: ByocTrunkInstance) => any), callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ByocTrunkContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ByocTrunkPayload extends TwilioResponsePayload { + byoc_trunks: ByocTrunkResource[]; +} +interface ByocTrunkResource { + account_sid: string; + sid: string; + friendly_name: string; + voice_url: string; + voice_method: string; + voice_fallback_url: string; + voice_fallback_method: string; + status_callback_url: string; + status_callback_method: string; + cnam_lookup_enabled: boolean; + connection_policy_sid: string; + from_domain_sid: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class ByocTrunkInstance { + protected _version: V1; + protected _solution: ByocTrunkContextSolution; + protected _context?: ByocTrunkContext; + constructor(_version: V1, payload: ByocTrunkResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the BYOC Trunk resource. + */ + accountSid: string; + /** + * The unique string that that we created to identify the BYOC Trunk resource. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The URL we call using the `voice_method` when the BYOC Trunk receives a call. + */ + voiceUrl: string; + /** + * The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. + */ + voiceMethod: string; + /** + * The URL that we call when an error occurs while retrieving or executing the TwiML requested from `voice_url`. + */ + voiceFallbackUrl: string; + /** + * The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. + */ + voiceFallbackMethod: string; + /** + * The URL that we call to pass status parameters (such as call ended) to your application. + */ + statusCallbackUrl: string; + /** + * The HTTP method we use to call `status_callback_url`. Either `GET` or `POST`. + */ + statusCallbackMethod: string; + /** + * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + */ + cnamLookupEnabled: boolean; + /** + * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + */ + connectionPolicySid: string; + /** + * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \"call back\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \"sip.twilio.com\". + */ + fromDomainSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + fetch(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Update a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + update(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Update a ByocTrunkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + update(params: ByocTrunkContextUpdateOptions, callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + friendlyName: string; + voiceUrl: string; + voiceMethod: string; + voiceFallbackUrl: string; + voiceFallbackMethod: string; + statusCallbackUrl: string; + statusCallbackMethod: string; + cnamLookupEnabled: boolean; + connectionPolicySid: string; + fromDomainSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ByocTrunkSolution { +} +export interface ByocTrunkListInstance { + _version: V1; + _solution: ByocTrunkSolution; + _uri: string; + (sid: string): ByocTrunkContext; + get(sid: string): ByocTrunkContext; + /** + * Create a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + create(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Create a ByocTrunkInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + create(params: ByocTrunkListInstanceCreateOptions, callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise; + /** + * Streams ByocTrunkInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ByocTrunkListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ByocTrunkInstance, done: (err?: Error) => void) => void): void; + each(params: ByocTrunkListInstanceEachOptions, callback?: (item: ByocTrunkInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ByocTrunkInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ByocTrunkPage) => any): Promise; + /** + * Lists ByocTrunkInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ByocTrunkListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ByocTrunkInstance[]) => any): Promise; + list(params: ByocTrunkListInstanceOptions, callback?: (error: Error | null, items: ByocTrunkInstance[]) => any): Promise; + /** + * Retrieve a single page of ByocTrunkInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ByocTrunkListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ByocTrunkPage) => any): Promise; + page(params: ByocTrunkListInstancePageOptions, callback?: (error: Error | null, items: ByocTrunkPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ByocTrunkListInstance(version: V1): ByocTrunkListInstance; +export declare class ByocTrunkPage extends Page { + /** + * Initialize the ByocTrunkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ByocTrunkSolution); + /** + * Build an instance of ByocTrunkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ByocTrunkResource): ByocTrunkInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/byocTrunk.js b/node_modules/twilio/lib/rest/voice/v1/byocTrunk.js new file mode 100644 index 00000000..bc913881 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/byocTrunk.js @@ -0,0 +1,304 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ByocTrunkPage = exports.ByocTrunkListInstance = exports.ByocTrunkInstance = exports.ByocTrunkContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class ByocTrunkContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/ByocTrunks/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ByocTrunkInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["statusCallbackUrl"] !== undefined) + data["StatusCallbackUrl"] = params["statusCallbackUrl"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["cnamLookupEnabled"] !== undefined) + data["CnamLookupEnabled"] = serialize.bool(params["cnamLookupEnabled"]); + if (params["connectionPolicySid"] !== undefined) + data["ConnectionPolicySid"] = params["connectionPolicySid"]; + if (params["fromDomainSid"] !== undefined) + data["FromDomainSid"] = params["fromDomainSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ByocTrunkInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ByocTrunkContextImpl = ByocTrunkContextImpl; +class ByocTrunkInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.voiceUrl = payload.voice_url; + this.voiceMethod = payload.voice_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.statusCallbackUrl = payload.status_callback_url; + this.statusCallbackMethod = payload.status_callback_method; + this.cnamLookupEnabled = payload.cnam_lookup_enabled; + this.connectionPolicySid = payload.connection_policy_sid; + this.fromDomainSid = payload.from_domain_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ByocTrunkContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ByocTrunkInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ByocTrunkInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + friendlyName: this.friendlyName, + voiceUrl: this.voiceUrl, + voiceMethod: this.voiceMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceFallbackMethod: this.voiceFallbackMethod, + statusCallbackUrl: this.statusCallbackUrl, + statusCallbackMethod: this.statusCallbackMethod, + cnamLookupEnabled: this.cnamLookupEnabled, + connectionPolicySid: this.connectionPolicySid, + fromDomainSid: this.fromDomainSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ByocTrunkInstance = ByocTrunkInstance; +function ByocTrunkListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ByocTrunkContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/ByocTrunks`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["statusCallbackUrl"] !== undefined) + data["StatusCallbackUrl"] = params["statusCallbackUrl"]; + if (params["statusCallbackMethod"] !== undefined) + data["StatusCallbackMethod"] = params["statusCallbackMethod"]; + if (params["cnamLookupEnabled"] !== undefined) + data["CnamLookupEnabled"] = serialize.bool(params["cnamLookupEnabled"]); + if (params["connectionPolicySid"] !== undefined) + data["ConnectionPolicySid"] = params["connectionPolicySid"]; + if (params["fromDomainSid"] !== undefined) + data["FromDomainSid"] = params["fromDomainSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ByocTrunkInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ByocTrunkPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ByocTrunkPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ByocTrunkListInstance = ByocTrunkListInstance; +class ByocTrunkPage extends Page_1.default { + /** + * Initialize the ByocTrunkPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ByocTrunkInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ByocTrunkInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ByocTrunkPage = ByocTrunkPage; diff --git a/node_modules/twilio/lib/rest/voice/v1/connectionPolicy.d.ts b/node_modules/twilio/lib/rest/voice/v1/connectionPolicy.d.ts new file mode 100644 index 00000000..859e0387 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/connectionPolicy.d.ts @@ -0,0 +1,314 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { ConnectionPolicyTargetListInstance } from "./connectionPolicy/connectionPolicyTarget"; +/** + * Options to pass to update a ConnectionPolicyInstance + */ +export interface ConnectionPolicyContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to create a ConnectionPolicyInstance + */ +export interface ConnectionPolicyListInstanceCreateOptions { + /** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to each + */ +export interface ConnectionPolicyListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ConnectionPolicyInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ConnectionPolicyListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ConnectionPolicyListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ConnectionPolicyContext { + targets: ConnectionPolicyTargetListInstance; + /** + * Remove a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + fetch(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Update a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + update(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Update a ConnectionPolicyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + update(params: ConnectionPolicyContextUpdateOptions, callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConnectionPolicyContextSolution { + sid: string; +} +export declare class ConnectionPolicyContextImpl implements ConnectionPolicyContext { + protected _version: V1; + protected _solution: ConnectionPolicyContextSolution; + protected _uri: string; + protected _targets?: ConnectionPolicyTargetListInstance; + constructor(_version: V1, sid: string); + get targets(): ConnectionPolicyTargetListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + update(params?: ConnectionPolicyContextUpdateOptions | ((error: Error | null, item?: ConnectionPolicyInstance) => any), callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConnectionPolicyContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConnectionPolicyPayload extends TwilioResponsePayload { + connection_policies: ConnectionPolicyResource[]; +} +interface ConnectionPolicyResource { + account_sid: string; + sid: string; + friendly_name: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; +} +export declare class ConnectionPolicyInstance { + protected _version: V1; + protected _solution: ConnectionPolicyContextSolution; + protected _context?: ConnectionPolicyContext; + constructor(_version: V1, payload: ConnectionPolicyResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Connection Policy resource. + */ + accountSid: string; + /** + * The unique string that we created to identify the Connection Policy resource. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related resources. + */ + links: Record; + private get _proxy(); + /** + * Remove a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + fetch(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Update a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + update(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Update a ConnectionPolicyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + update(params: ConnectionPolicyContextUpdateOptions, callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Access the targets. + */ + targets(): ConnectionPolicyTargetListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + friendlyName: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConnectionPolicySolution { +} +export interface ConnectionPolicyListInstance { + _version: V1; + _solution: ConnectionPolicySolution; + _uri: string; + (sid: string): ConnectionPolicyContext; + get(sid: string): ConnectionPolicyContext; + /** + * Create a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + create(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Create a ConnectionPolicyInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + create(params: ConnectionPolicyListInstanceCreateOptions, callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise; + /** + * Streams ConnectionPolicyInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectionPolicyListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ConnectionPolicyInstance, done: (err?: Error) => void) => void): void; + each(params: ConnectionPolicyListInstanceEachOptions, callback?: (item: ConnectionPolicyInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ConnectionPolicyInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ConnectionPolicyPage) => any): Promise; + /** + * Lists ConnectionPolicyInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectionPolicyListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ConnectionPolicyInstance[]) => any): Promise; + list(params: ConnectionPolicyListInstanceOptions, callback?: (error: Error | null, items: ConnectionPolicyInstance[]) => any): Promise; + /** + * Retrieve a single page of ConnectionPolicyInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectionPolicyListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ConnectionPolicyPage) => any): Promise; + page(params: ConnectionPolicyListInstancePageOptions, callback?: (error: Error | null, items: ConnectionPolicyPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConnectionPolicyListInstance(version: V1): ConnectionPolicyListInstance; +export declare class ConnectionPolicyPage extends Page { + /** + * Initialize the ConnectionPolicyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ConnectionPolicySolution); + /** + * Build an instance of ConnectionPolicyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ConnectionPolicyResource): ConnectionPolicyInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/connectionPolicy.js b/node_modules/twilio/lib/rest/voice/v1/connectionPolicy.js new file mode 100644 index 00000000..1eb464b8 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/connectionPolicy.js @@ -0,0 +1,265 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectionPolicyPage = exports.ConnectionPolicyListInstance = exports.ConnectionPolicyInstance = exports.ConnectionPolicyContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const connectionPolicyTarget_1 = require("./connectionPolicy/connectionPolicyTarget"); +class ConnectionPolicyContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/ConnectionPolicies/${sid}`; + } + get targets() { + this._targets = + this._targets || + (0, connectionPolicyTarget_1.ConnectionPolicyTargetListInstance)(this._version, this._solution.sid); + return this._targets; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConnectionPolicyInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConnectionPolicyInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectionPolicyContextImpl = ConnectionPolicyContextImpl; +class ConnectionPolicyInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ConnectionPolicyContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ConnectionPolicyInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the targets. + */ + targets() { + return this._proxy.targets; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + friendlyName: this.friendlyName, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectionPolicyInstance = ConnectionPolicyInstance; +function ConnectionPolicyListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ConnectionPolicyContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/ConnectionPolicies`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConnectionPolicyInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConnectionPolicyPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ConnectionPolicyPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConnectionPolicyListInstance = ConnectionPolicyListInstance; +class ConnectionPolicyPage extends Page_1.default { + /** + * Initialize the ConnectionPolicyPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ConnectionPolicyInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ConnectionPolicyInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectionPolicyPage = ConnectionPolicyPage; diff --git a/node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.d.ts b/node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.d.ts new file mode 100644 index 00000000..dd807973 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.d.ts @@ -0,0 +1,340 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to update a ConnectionPolicyTargetInstance + */ +export interface ConnectionPolicyTargetContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ + friendlyName?: string; + /** The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. */ + target?: string; + /** The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. */ + priority?: number; + /** The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. */ + weight?: number; + /** Whether the Target is enabled. */ + enabled?: boolean; +} +/** + * Options to pass to create a ConnectionPolicyTargetInstance + */ +export interface ConnectionPolicyTargetListInstanceCreateOptions { + /** The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. */ + target: string; + /** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ + friendlyName?: string; + /** The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. */ + priority?: number; + /** The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. */ + weight?: number; + /** Whether the Target is enabled. The default is `true`. */ + enabled?: boolean; +} +/** + * Options to pass to each + */ +export interface ConnectionPolicyTargetListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: ConnectionPolicyTargetInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface ConnectionPolicyTargetListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface ConnectionPolicyTargetListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface ConnectionPolicyTargetContext { + /** + * Remove a ConnectionPolicyTargetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConnectionPolicyTargetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyTargetInstance + */ + fetch(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + /** + * Update a ConnectionPolicyTargetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyTargetInstance + */ + update(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + /** + * Update a ConnectionPolicyTargetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyTargetInstance + */ + update(params: ConnectionPolicyTargetContextUpdateOptions, callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface ConnectionPolicyTargetContextSolution { + connectionPolicySid: string; + sid: string; +} +export declare class ConnectionPolicyTargetContextImpl implements ConnectionPolicyTargetContext { + protected _version: V1; + protected _solution: ConnectionPolicyTargetContextSolution; + protected _uri: string; + constructor(_version: V1, connectionPolicySid: string, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + update(params?: ConnectionPolicyTargetContextUpdateOptions | ((error: Error | null, item?: ConnectionPolicyTargetInstance) => any), callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): ConnectionPolicyTargetContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface ConnectionPolicyTargetPayload extends TwilioResponsePayload { + targets: ConnectionPolicyTargetResource[]; +} +interface ConnectionPolicyTargetResource { + account_sid: string; + connection_policy_sid: string; + sid: string; + friendly_name: string; + target: string; + priority: number; + weight: number; + enabled: boolean; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class ConnectionPolicyTargetInstance { + protected _version: V1; + protected _solution: ConnectionPolicyTargetContextSolution; + protected _context?: ConnectionPolicyTargetContext; + constructor(_version: V1, payload: ConnectionPolicyTargetResource, connectionPolicySid: string, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Target resource. + */ + accountSid: string; + /** + * The SID of the Connection Policy that owns the Target. + */ + connectionPolicySid: string; + /** + * The unique string that we created to identify the Target resource. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + */ + target: string; + /** + * The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. + */ + priority: number; + /** + * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. + */ + weight: number; + /** + * Whether the target is enabled. The default is `true`. + */ + enabled: boolean; + /** + * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a ConnectionPolicyTargetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a ConnectionPolicyTargetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyTargetInstance + */ + fetch(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + /** + * Update a ConnectionPolicyTargetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyTargetInstance + */ + update(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + /** + * Update a ConnectionPolicyTargetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyTargetInstance + */ + update(params: ConnectionPolicyTargetContextUpdateOptions, callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + connectionPolicySid: string; + sid: string; + friendlyName: string; + target: string; + priority: number; + weight: number; + enabled: boolean; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface ConnectionPolicyTargetSolution { + connectionPolicySid: string; +} +export interface ConnectionPolicyTargetListInstance { + _version: V1; + _solution: ConnectionPolicyTargetSolution; + _uri: string; + (sid: string): ConnectionPolicyTargetContext; + get(sid: string): ConnectionPolicyTargetContext; + /** + * Create a ConnectionPolicyTargetInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyTargetInstance + */ + create(params: ConnectionPolicyTargetListInstanceCreateOptions, callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise; + /** + * Streams ConnectionPolicyTargetInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectionPolicyTargetListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: ConnectionPolicyTargetInstance, done: (err?: Error) => void) => void): void; + each(params: ConnectionPolicyTargetListInstanceEachOptions, callback?: (item: ConnectionPolicyTargetInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of ConnectionPolicyTargetInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: ConnectionPolicyTargetPage) => any): Promise; + /** + * Lists ConnectionPolicyTargetInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectionPolicyTargetListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: ConnectionPolicyTargetInstance[]) => any): Promise; + list(params: ConnectionPolicyTargetListInstanceOptions, callback?: (error: Error | null, items: ConnectionPolicyTargetInstance[]) => any): Promise; + /** + * Retrieve a single page of ConnectionPolicyTargetInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { ConnectionPolicyTargetListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: ConnectionPolicyTargetPage) => any): Promise; + page(params: ConnectionPolicyTargetListInstancePageOptions, callback?: (error: Error | null, items: ConnectionPolicyTargetPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function ConnectionPolicyTargetListInstance(version: V1, connectionPolicySid: string): ConnectionPolicyTargetListInstance; +export declare class ConnectionPolicyTargetPage extends Page { + /** + * Initialize the ConnectionPolicyTargetPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: ConnectionPolicyTargetSolution); + /** + * Build an instance of ConnectionPolicyTargetInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: ConnectionPolicyTargetResource): ConnectionPolicyTargetInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.js b/node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.js new file mode 100644 index 00000000..7c618ade --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.js @@ -0,0 +1,280 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectionPolicyTargetPage = exports.ConnectionPolicyTargetListInstance = exports.ConnectionPolicyTargetInstance = exports.ConnectionPolicyTargetContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +class ConnectionPolicyTargetContextImpl { + constructor(_version, connectionPolicySid, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(connectionPolicySid)) { + throw new Error("Parameter 'connectionPolicySid' is not valid."); + } + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { connectionPolicySid, sid }; + this._uri = `/ConnectionPolicies/${connectionPolicySid}/Targets/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new ConnectionPolicyTargetInstance(operationVersion, payload, instance._solution.connectionPolicySid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["target"] !== undefined) + data["Target"] = params["target"]; + if (params["priority"] !== undefined) + data["Priority"] = params["priority"]; + if (params["weight"] !== undefined) + data["Weight"] = params["weight"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConnectionPolicyTargetInstance(operationVersion, payload, instance._solution.connectionPolicySid, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectionPolicyTargetContextImpl = ConnectionPolicyTargetContextImpl; +class ConnectionPolicyTargetInstance { + constructor(_version, payload, connectionPolicySid, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.connectionPolicySid = payload.connection_policy_sid; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.target = payload.target; + this.priority = deserialize.integer(payload.priority); + this.weight = deserialize.integer(payload.weight); + this.enabled = payload.enabled; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { connectionPolicySid, sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new ConnectionPolicyTargetContextImpl(this._version, this._solution.connectionPolicySid, this._solution.sid); + return this._context; + } + /** + * Remove a ConnectionPolicyTargetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a ConnectionPolicyTargetInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ConnectionPolicyTargetInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + connectionPolicySid: this.connectionPolicySid, + sid: this.sid, + friendlyName: this.friendlyName, + target: this.target, + priority: this.priority, + weight: this.weight, + enabled: this.enabled, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectionPolicyTargetInstance = ConnectionPolicyTargetInstance; +function ConnectionPolicyTargetListInstance(version, connectionPolicySid) { + if (!(0, utility_1.isValidPathParam)(connectionPolicySid)) { + throw new Error("Parameter 'connectionPolicySid' is not valid."); + } + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new ConnectionPolicyTargetContextImpl(version, connectionPolicySid, sid); + }; + instance._version = version; + instance._solution = { connectionPolicySid }; + instance._uri = `/ConnectionPolicies/${connectionPolicySid}/Targets`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["target"] === null || params["target"] === undefined) { + throw new Error("Required parameter \"params['target']\" missing."); + } + let data = {}; + data["Target"] = params["target"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["priority"] !== undefined) + data["Priority"] = params["priority"]; + if (params["weight"] !== undefined) + data["Weight"] = params["weight"]; + if (params["enabled"] !== undefined) + data["Enabled"] = serialize.bool(params["enabled"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConnectionPolicyTargetInstance(operationVersion, payload, instance._solution.connectionPolicySid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new ConnectionPolicyTargetPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new ConnectionPolicyTargetPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.ConnectionPolicyTargetListInstance = ConnectionPolicyTargetListInstance; +class ConnectionPolicyTargetPage extends Page_1.default { + /** + * Initialize the ConnectionPolicyTargetPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of ConnectionPolicyTargetInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new ConnectionPolicyTargetInstance(this._version, payload, this._solution.connectionPolicySid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.ConnectionPolicyTargetPage = ConnectionPolicyTargetPage; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions.d.ts b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions.d.ts new file mode 100644 index 00000000..e2ca3eb3 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions.d.ts @@ -0,0 +1,25 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +import { BulkCountryUpdateListInstance } from "./dialingPermissions/bulkCountryUpdate"; +import { CountryListInstance } from "./dialingPermissions/country"; +import { SettingsListInstance } from "./dialingPermissions/settings"; +export interface DialingPermissionsSolution { +} +export interface DialingPermissionsListInstance { + _version: V1; + _solution: DialingPermissionsSolution; + _uri: string; + _bulkCountryUpdates?: BulkCountryUpdateListInstance; + bulkCountryUpdates: BulkCountryUpdateListInstance; + _countries?: CountryListInstance; + countries: CountryListInstance; + _settings?: SettingsListInstance; + settings: SettingsListInstance; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DialingPermissionsListInstance(version: V1): DialingPermissionsListInstance; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions.js b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions.js new file mode 100644 index 00000000..fa369887 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions.js @@ -0,0 +1,60 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DialingPermissionsListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const bulkCountryUpdate_1 = require("./dialingPermissions/bulkCountryUpdate"); +const country_1 = require("./dialingPermissions/country"); +const settings_1 = require("./dialingPermissions/settings"); +function DialingPermissionsListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/DialingPermissions`; + Object.defineProperty(instance, "bulkCountryUpdates", { + get: function bulkCountryUpdates() { + if (!instance._bulkCountryUpdates) { + instance._bulkCountryUpdates = (0, bulkCountryUpdate_1.BulkCountryUpdateListInstance)(instance._version); + } + return instance._bulkCountryUpdates; + }, + }); + Object.defineProperty(instance, "countries", { + get: function countries() { + if (!instance._countries) { + instance._countries = (0, country_1.CountryListInstance)(instance._version); + } + return instance._countries; + }, + }); + Object.defineProperty(instance, "settings", { + get: function settings() { + if (!instance._settings) { + instance._settings = (0, settings_1.SettingsListInstance)(instance._version); + } + return instance._settings; + }, + }); + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DialingPermissionsListInstance = DialingPermissionsListInstance; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.d.ts b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.d.ts new file mode 100644 index 00000000..b61ffc89 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.d.ts @@ -0,0 +1,59 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * Options to pass to create a BulkCountryUpdateInstance + */ +export interface BulkCountryUpdateListInstanceCreateOptions { + /** URL encoded JSON array of update objects. example : `[ { \\\"iso_code\\\": \\\"GB\\\", \\\"low_risk_numbers_enabled\\\": \\\"true\\\", \\\"high_risk_special_numbers_enabled\\\":\\\"true\\\", \\\"high_risk_tollfraud_numbers_enabled\\\": \\\"false\\\" } ]` */ + updateRequest: string; +} +export interface BulkCountryUpdateSolution { +} +export interface BulkCountryUpdateListInstance { + _version: V1; + _solution: BulkCountryUpdateSolution; + _uri: string; + /** + * Create a BulkCountryUpdateInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed BulkCountryUpdateInstance + */ + create(params: BulkCountryUpdateListInstanceCreateOptions, callback?: (error: Error | null, item?: BulkCountryUpdateInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function BulkCountryUpdateListInstance(version: V1): BulkCountryUpdateListInstance; +interface BulkCountryUpdateResource { + update_count: number; + update_request: string; +} +export declare class BulkCountryUpdateInstance { + protected _version: V1; + constructor(_version: V1, payload: BulkCountryUpdateResource); + /** + * The number of countries updated + */ + updateCount: number; + /** + * A bulk update request to change voice dialing country permissions stored as a URL-encoded, JSON array of update objects. For example : `[ { \"iso_code\": \"GB\", \"low_risk_numbers_enabled\": \"true\", \"high_risk_special_numbers_enabled\":\"true\", \"high_risk_tollfraud_numbers_enabled\": \"false\" } ]` + */ + updateRequest: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + updateCount: number; + updateRequest: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.js b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.js new file mode 100644 index 00000000..182b3178 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.js @@ -0,0 +1,77 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BulkCountryUpdateInstance = exports.BulkCountryUpdateListInstance = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +function BulkCountryUpdateListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/DialingPermissions/BulkCountryUpdates`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["updateRequest"] === null || + params["updateRequest"] === undefined) { + throw new Error("Required parameter \"params['updateRequest']\" missing."); + } + let data = {}; + data["UpdateRequest"] = params["updateRequest"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new BulkCountryUpdateInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.BulkCountryUpdateListInstance = BulkCountryUpdateListInstance; +class BulkCountryUpdateInstance { + constructor(_version, payload) { + this._version = _version; + this.updateCount = deserialize.integer(payload.update_count); + this.updateRequest = payload.update_request; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + updateCount: this.updateCount, + updateRequest: this.updateRequest, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.BulkCountryUpdateInstance = BulkCountryUpdateInstance; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.d.ts b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.d.ts new file mode 100644 index 00000000..f079fc1f --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.d.ts @@ -0,0 +1,279 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +import { HighriskSpecialPrefixListInstance } from "./country/highriskSpecialPrefix"; +/** + * Options to pass to each + */ +export interface CountryListInstanceEachOptions { + /** Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) */ + isoCode?: string; + /** Filter to retrieve the country permissions by specifying the continent */ + continent?: string; + /** Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) */ + countryCode?: string; + /** Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. */ + lowRiskNumbersEnabled?: boolean; + /** Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` */ + highRiskSpecialNumbersEnabled?: boolean; + /** Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. */ + highRiskTollfraudNumbersEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CountryInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CountryListInstanceOptions { + /** Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) */ + isoCode?: string; + /** Filter to retrieve the country permissions by specifying the continent */ + continent?: string; + /** Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) */ + countryCode?: string; + /** Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. */ + lowRiskNumbersEnabled?: boolean; + /** Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` */ + highRiskSpecialNumbersEnabled?: boolean; + /** Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. */ + highRiskTollfraudNumbersEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CountryListInstancePageOptions { + /** Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) */ + isoCode?: string; + /** Filter to retrieve the country permissions by specifying the continent */ + continent?: string; + /** Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) */ + countryCode?: string; + /** Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. */ + lowRiskNumbersEnabled?: boolean; + /** Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` */ + highRiskSpecialNumbersEnabled?: boolean; + /** Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. */ + highRiskTollfraudNumbersEnabled?: boolean; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CountryContext { + highriskSpecialPrefixes: HighriskSpecialPrefixListInstance; + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CountryContextSolution { + isoCode: string; +} +export declare class CountryContextImpl implements CountryContext { + protected _version: V1; + protected _solution: CountryContextSolution; + protected _uri: string; + protected _highriskSpecialPrefixes?: HighriskSpecialPrefixListInstance; + constructor(_version: V1, isoCode: string); + get highriskSpecialPrefixes(): HighriskSpecialPrefixListInstance; + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CountryContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CountryPayload extends TwilioResponsePayload { + content: CountryResource[]; +} +interface CountryResource { + iso_code: string; + name: string; + continent: string; + country_codes: Array; + low_risk_numbers_enabled: boolean; + high_risk_special_numbers_enabled: boolean; + high_risk_tollfraud_numbers_enabled: boolean; + url: string; + links: Record; +} +export declare class CountryInstance { + protected _version: V1; + protected _solution: CountryContextSolution; + protected _context?: CountryContext; + constructor(_version: V1, payload: CountryResource, isoCode?: string); + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + */ + isoCode: string; + /** + * The name of the country. + */ + name: string; + /** + * The name of the continent in which the country is located. + */ + continent: string; + /** + * The E.164 assigned [country codes(s)](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) + */ + countryCodes: Array; + /** + * Whether dialing to low-risk numbers is enabled. + */ + lowRiskNumbersEnabled: boolean; + /** + * Whether dialing to high-risk special services numbers is enabled. These prefixes include number ranges allocated by the country and include premium numbers, special services, shared cost, and others + */ + highRiskSpecialNumbersEnabled: boolean; + /** + * Whether dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers is enabled. These prefixes include narrow number ranges that have a high-risk of international revenue sharing fraud (IRSF) attacks, also known as [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html). These prefixes are collected from anti-fraud databases and verified by analyzing calls on our network. These prefixes are not available for download and are updated frequently + */ + highRiskTollfraudNumbersEnabled: boolean; + /** + * The absolute URL of this resource. + */ + url: string; + /** + * A list of URLs related to this resource. + */ + links: Record; + private get _proxy(); + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise; + /** + * Access the highriskSpecialPrefixes. + */ + highriskSpecialPrefixes(): HighriskSpecialPrefixListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + isoCode: string; + name: string; + continent: string; + countryCodes: string[]; + lowRiskNumbersEnabled: boolean; + highRiskSpecialNumbersEnabled: boolean; + highRiskTollfraudNumbersEnabled: boolean; + url: string; + links: Record; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CountrySolution { +} +export interface CountryListInstance { + _version: V1; + _solution: CountrySolution; + _uri: string; + (isoCode: string): CountryContext; + get(isoCode: string): CountryContext; + /** + * Streams CountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + each(params: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Lists CountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + list(params: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + /** + * Retrieve a single page of CountryInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CountryListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CountryPage) => any): Promise; + page(params: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CountryListInstance(version: V1): CountryListInstance; +export declare class CountryPage extends Page { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CountrySolution); + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CountryResource): CountryInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.js b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.js new file mode 100644 index 00000000..5a57d58b --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.js @@ -0,0 +1,214 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountryPage = exports.CountryListInstance = exports.CountryInstance = exports.CountryContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +const highriskSpecialPrefix_1 = require("./country/highriskSpecialPrefix"); +class CountryContextImpl { + constructor(_version, isoCode) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(isoCode)) { + throw new Error("Parameter 'isoCode' is not valid."); + } + this._solution = { isoCode }; + this._uri = `/DialingPermissions/Countries/${isoCode}`; + } + get highriskSpecialPrefixes() { + this._highriskSpecialPrefixes = + this._highriskSpecialPrefixes || + (0, highriskSpecialPrefix_1.HighriskSpecialPrefixListInstance)(this._version, this._solution.isoCode); + return this._highriskSpecialPrefixes; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CountryInstance(operationVersion, payload, instance._solution.isoCode)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryContextImpl = CountryContextImpl; +class CountryInstance { + constructor(_version, payload, isoCode) { + this._version = _version; + this.isoCode = payload.iso_code; + this.name = payload.name; + this.continent = payload.continent; + this.countryCodes = payload.country_codes; + this.lowRiskNumbersEnabled = payload.low_risk_numbers_enabled; + this.highRiskSpecialNumbersEnabled = + payload.high_risk_special_numbers_enabled; + this.highRiskTollfraudNumbersEnabled = + payload.high_risk_tollfraud_numbers_enabled; + this.url = payload.url; + this.links = payload.links; + this._solution = { isoCode: isoCode || this.isoCode }; + } + get _proxy() { + this._context = + this._context || + new CountryContextImpl(this._version, this._solution.isoCode); + return this._context; + } + /** + * Fetch a CountryInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CountryInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Access the highriskSpecialPrefixes. + */ + highriskSpecialPrefixes() { + return this._proxy.highriskSpecialPrefixes; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + isoCode: this.isoCode, + name: this.name, + continent: this.continent, + countryCodes: this.countryCodes, + lowRiskNumbersEnabled: this.lowRiskNumbersEnabled, + highRiskSpecialNumbersEnabled: this.highRiskSpecialNumbersEnabled, + highRiskTollfraudNumbersEnabled: this.highRiskTollfraudNumbersEnabled, + url: this.url, + links: this.links, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryInstance = CountryInstance; +function CountryListInstance(version) { + const instance = ((isoCode) => instance.get(isoCode)); + instance.get = function get(isoCode) { + return new CountryContextImpl(version, isoCode); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/DialingPermissions/Countries`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["isoCode"] !== undefined) + data["IsoCode"] = params["isoCode"]; + if (params["continent"] !== undefined) + data["Continent"] = params["continent"]; + if (params["countryCode"] !== undefined) + data["CountryCode"] = params["countryCode"]; + if (params["lowRiskNumbersEnabled"] !== undefined) + data["LowRiskNumbersEnabled"] = serialize.bool(params["lowRiskNumbersEnabled"]); + if (params["highRiskSpecialNumbersEnabled"] !== undefined) + data["HighRiskSpecialNumbersEnabled"] = serialize.bool(params["highRiskSpecialNumbersEnabled"]); + if (params["highRiskTollfraudNumbersEnabled"] !== undefined) + data["HighRiskTollfraudNumbersEnabled"] = serialize.bool(params["highRiskTollfraudNumbersEnabled"]); + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CountryPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CountryPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CountryListInstance = CountryListInstance; +class CountryPage extends Page_1.default { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CountryInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CountryPage = CountryPage; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.d.ts b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.d.ts new file mode 100644 index 00000000..545e4514 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.d.ts @@ -0,0 +1,143 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../../base/Page"; +import Response from "../../../../../http/response"; +import V1 from "../../../V1"; +/** + * Options to pass to each + */ +export interface HighriskSpecialPrefixListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: HighriskSpecialPrefixInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface HighriskSpecialPrefixListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface HighriskSpecialPrefixListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface HighriskSpecialPrefixSolution { + isoCode: string; +} +export interface HighriskSpecialPrefixListInstance { + _version: V1; + _solution: HighriskSpecialPrefixSolution; + _uri: string; + /** + * Streams HighriskSpecialPrefixInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HighriskSpecialPrefixListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: HighriskSpecialPrefixInstance, done: (err?: Error) => void) => void): void; + each(params: HighriskSpecialPrefixListInstanceEachOptions, callback?: (item: HighriskSpecialPrefixInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of HighriskSpecialPrefixInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: HighriskSpecialPrefixPage) => any): Promise; + /** + * Lists HighriskSpecialPrefixInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HighriskSpecialPrefixListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: HighriskSpecialPrefixInstance[]) => any): Promise; + list(params: HighriskSpecialPrefixListInstanceOptions, callback?: (error: Error | null, items: HighriskSpecialPrefixInstance[]) => any): Promise; + /** + * Retrieve a single page of HighriskSpecialPrefixInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { HighriskSpecialPrefixListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: HighriskSpecialPrefixPage) => any): Promise; + page(params: HighriskSpecialPrefixListInstancePageOptions, callback?: (error: Error | null, items: HighriskSpecialPrefixPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function HighriskSpecialPrefixListInstance(version: V1, isoCode: string): HighriskSpecialPrefixListInstance; +interface HighriskSpecialPrefixPayload extends TwilioResponsePayload { + content: HighriskSpecialPrefixResource[]; +} +interface HighriskSpecialPrefixResource { + prefix: string; +} +export declare class HighriskSpecialPrefixInstance { + protected _version: V1; + constructor(_version: V1, payload: HighriskSpecialPrefixResource, isoCode: string); + /** + * A prefix is a contiguous number range for a block of E.164 numbers that includes the E.164 assigned country code. For example, a North American Numbering Plan prefix like `+1510720` written like `+1(510) 720` matches all numbers inclusive from `+1(510) 720-0000` to `+1(510) 720-9999`. + */ + prefix: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + prefix: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class HighriskSpecialPrefixPage extends Page { + /** + * Initialize the HighriskSpecialPrefixPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: HighriskSpecialPrefixSolution); + /** + * Build an instance of HighriskSpecialPrefixInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: HighriskSpecialPrefixResource): HighriskSpecialPrefixInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.js b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.js new file mode 100644 index 00000000..36d97dcf --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.js @@ -0,0 +1,122 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HighriskSpecialPrefixPage = exports.HighriskSpecialPrefixInstance = exports.HighriskSpecialPrefixListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../../base/Page")); +const deserialize = require("../../../../../base/deserialize"); +const serialize = require("../../../../../base/serialize"); +const utility_1 = require("../../../../../base/utility"); +function HighriskSpecialPrefixListInstance(version, isoCode) { + if (!(0, utility_1.isValidPathParam)(isoCode)) { + throw new Error("Parameter 'isoCode' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { isoCode }; + instance._uri = `/DialingPermissions/Countries/${isoCode}/HighRiskSpecialPrefixes`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new HighriskSpecialPrefixPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new HighriskSpecialPrefixPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.HighriskSpecialPrefixListInstance = HighriskSpecialPrefixListInstance; +class HighriskSpecialPrefixInstance { + constructor(_version, payload, isoCode) { + this._version = _version; + this.prefix = payload.prefix; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + prefix: this.prefix, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.HighriskSpecialPrefixInstance = HighriskSpecialPrefixInstance; +class HighriskSpecialPrefixPage extends Page_1.default { + /** + * Initialize the HighriskSpecialPrefixPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of HighriskSpecialPrefixInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new HighriskSpecialPrefixInstance(this._version, payload, this._solution.isoCode); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.HighriskSpecialPrefixPage = HighriskSpecialPrefixPage; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.d.ts b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.d.ts new file mode 100644 index 00000000..f2f2d83d --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.d.ts @@ -0,0 +1,129 @@ +/// +import { inspect, InspectOptions } from "util"; +import V1 from "../../V1"; +/** + * Options to pass to update a SettingsInstance + */ +export interface SettingsContextUpdateOptions { + /** `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. */ + dialingPermissionsInheritance?: boolean; +} +export interface SettingsContext { + /** + * Fetch a SettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingsInstance + */ + fetch(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise; + /** + * Update a SettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingsInstance + */ + update(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise; + /** + * Update a SettingsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingsInstance + */ + update(params: SettingsContextUpdateOptions, callback?: (error: Error | null, item?: SettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SettingsContextSolution { +} +export declare class SettingsContextImpl implements SettingsContext { + protected _version: V1; + protected _solution: SettingsContextSolution; + protected _uri: string; + constructor(_version: V1); + fetch(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise; + update(params?: SettingsContextUpdateOptions | ((error: Error | null, item?: SettingsInstance) => any), callback?: (error: Error | null, item?: SettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SettingsContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SettingsResource { + dialing_permissions_inheritance: boolean; + url: string; +} +export declare class SettingsInstance { + protected _version: V1; + protected _solution: SettingsContextSolution; + protected _context?: SettingsContext; + constructor(_version: V1, payload: SettingsResource); + /** + * `true` if the sub-account will inherit voice dialing permissions from the Master Project; otherwise `false`. + */ + dialingPermissionsInheritance: boolean; + /** + * The absolute URL of this resource. + */ + url: string; + private get _proxy(); + /** + * Fetch a SettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingsInstance + */ + fetch(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise; + /** + * Update a SettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingsInstance + */ + update(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise; + /** + * Update a SettingsInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingsInstance + */ + update(params: SettingsContextUpdateOptions, callback?: (error: Error | null, item?: SettingsInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + dialingPermissionsInheritance: boolean; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SettingsSolution { +} +export interface SettingsListInstance { + _version: V1; + _solution: SettingsSolution; + _uri: string; + (): SettingsContext; + get(): SettingsContext; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SettingsListInstance(version: V1): SettingsListInstance; +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.js b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.js new file mode 100644 index 00000000..f20fba81 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.js @@ -0,0 +1,130 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SettingsListInstance = exports.SettingsInstance = exports.SettingsContextImpl = void 0; +const util_1 = require("util"); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +class SettingsContextImpl { + constructor(_version) { + this._version = _version; + this._solution = {}; + this._uri = `/Settings`; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SettingsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["dialingPermissionsInheritance"] !== undefined) + data["DialingPermissionsInheritance"] = serialize.bool(params["dialingPermissionsInheritance"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SettingsInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SettingsContextImpl = SettingsContextImpl; +class SettingsInstance { + constructor(_version, payload) { + this._version = _version; + this.dialingPermissionsInheritance = + payload.dialing_permissions_inheritance; + this.url = payload.url; + this._solution = {}; + } + get _proxy() { + this._context = this._context || new SettingsContextImpl(this._version); + return this._context; + } + /** + * Fetch a SettingsInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SettingsInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + dialingPermissionsInheritance: this.dialingPermissionsInheritance, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SettingsInstance = SettingsInstance; +function SettingsListInstance(version) { + const instance = (() => instance.get()); + instance.get = function get() { + return new SettingsContextImpl(version); + }; + instance._version = version; + instance._solution = {}; + instance._uri = ``; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SettingsListInstance = SettingsListInstance; diff --git a/node_modules/twilio/lib/rest/voice/v1/ipRecord.d.ts b/node_modules/twilio/lib/rest/voice/v1/ipRecord.d.ts new file mode 100644 index 00000000..242c4c44 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/ipRecord.d.ts @@ -0,0 +1,308 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to update a IpRecordInstance + */ +export interface IpRecordContextUpdateOptions { + /** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ + friendlyName?: string; +} +/** + * Options to pass to create a IpRecordInstance + */ +export interface IpRecordListInstanceCreateOptions { + /** An IP address in dotted decimal notation, IPv4 only. */ + ipAddress: string; + /** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ + friendlyName?: string; + /** An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. */ + cidrPrefixLength?: number; +} +/** + * Options to pass to each + */ +export interface IpRecordListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: IpRecordInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface IpRecordListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface IpRecordListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface IpRecordContext { + /** + * Remove a IpRecordInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpRecordInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpRecordInstance + */ + fetch(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + /** + * Update a IpRecordInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpRecordInstance + */ + update(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + /** + * Update a IpRecordInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpRecordInstance + */ + update(params: IpRecordContextUpdateOptions, callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface IpRecordContextSolution { + sid: string; +} +export declare class IpRecordContextImpl implements IpRecordContext { + protected _version: V1; + protected _solution: IpRecordContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + update(params?: IpRecordContextUpdateOptions | ((error: Error | null, item?: IpRecordInstance) => any), callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): IpRecordContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface IpRecordPayload extends TwilioResponsePayload { + ip_records: IpRecordResource[]; +} +interface IpRecordResource { + account_sid: string; + sid: string; + friendly_name: string; + ip_address: string; + cidr_prefix_length: number; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class IpRecordInstance { + protected _version: V1; + protected _solution: IpRecordContextSolution; + protected _context?: IpRecordContext; + constructor(_version: V1, payload: IpRecordResource, sid?: string); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IP Record resource. + */ + accountSid: string; + /** + * The unique string that we created to identify the IP Record resource. + */ + sid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * An IP address in dotted decimal notation, IPv4 only. + */ + ipAddress: string; + /** + * An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. + */ + cidrPrefixLength: number; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a IpRecordInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a IpRecordInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpRecordInstance + */ + fetch(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + /** + * Update a IpRecordInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpRecordInstance + */ + update(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + /** + * Update a IpRecordInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpRecordInstance + */ + update(params: IpRecordContextUpdateOptions, callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + sid: string; + friendlyName: string; + ipAddress: string; + cidrPrefixLength: number; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface IpRecordSolution { +} +export interface IpRecordListInstance { + _version: V1; + _solution: IpRecordSolution; + _uri: string; + (sid: string): IpRecordContext; + get(sid: string): IpRecordContext; + /** + * Create a IpRecordInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpRecordInstance + */ + create(params: IpRecordListInstanceCreateOptions, callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise; + /** + * Streams IpRecordInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpRecordListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: IpRecordInstance, done: (err?: Error) => void) => void): void; + each(params: IpRecordListInstanceEachOptions, callback?: (item: IpRecordInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of IpRecordInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: IpRecordPage) => any): Promise; + /** + * Lists IpRecordInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpRecordListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: IpRecordInstance[]) => any): Promise; + list(params: IpRecordListInstanceOptions, callback?: (error: Error | null, items: IpRecordInstance[]) => any): Promise; + /** + * Retrieve a single page of IpRecordInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { IpRecordListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: IpRecordPage) => any): Promise; + page(params: IpRecordListInstancePageOptions, callback?: (error: Error | null, items: IpRecordPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function IpRecordListInstance(version: V1): IpRecordListInstance; +export declare class IpRecordPage extends Page { + /** + * Initialize the IpRecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: IpRecordSolution); + /** + * Build an instance of IpRecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: IpRecordResource): IpRecordInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/ipRecord.js b/node_modules/twilio/lib/rest/voice/v1/ipRecord.js new file mode 100644 index 00000000..3942240b --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/ipRecord.js @@ -0,0 +1,256 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IpRecordPage = exports.IpRecordListInstance = exports.IpRecordInstance = exports.IpRecordContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class IpRecordContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/IpRecords/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new IpRecordInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpRecordInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpRecordContextImpl = IpRecordContextImpl; +class IpRecordInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.accountSid = payload.account_sid; + this.sid = payload.sid; + this.friendlyName = payload.friendly_name; + this.ipAddress = payload.ip_address; + this.cidrPrefixLength = deserialize.integer(payload.cidr_prefix_length); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new IpRecordContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a IpRecordInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a IpRecordInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed IpRecordInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + sid: this.sid, + friendlyName: this.friendlyName, + ipAddress: this.ipAddress, + cidrPrefixLength: this.cidrPrefixLength, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpRecordInstance = IpRecordInstance; +function IpRecordListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new IpRecordContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/IpRecords`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["ipAddress"] === null || params["ipAddress"] === undefined) { + throw new Error("Required parameter \"params['ipAddress']\" missing."); + } + let data = {}; + data["IpAddress"] = params["ipAddress"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["cidrPrefixLength"] !== undefined) + data["CidrPrefixLength"] = params["cidrPrefixLength"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpRecordInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new IpRecordPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new IpRecordPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.IpRecordListInstance = IpRecordListInstance; +class IpRecordPage extends Page_1.default { + /** + * Initialize the IpRecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of IpRecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new IpRecordInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.IpRecordPage = IpRecordPage; diff --git a/node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.d.ts b/node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.d.ts new file mode 100644 index 00000000..13ee0447 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.d.ts @@ -0,0 +1,278 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to update a SourceIpMappingInstance + */ +export interface SourceIpMappingContextUpdateOptions { + /** The SID of the SIP Domain that the IP Record should be mapped to. */ + sipDomainSid: string; +} +/** + * Options to pass to create a SourceIpMappingInstance + */ +export interface SourceIpMappingListInstanceCreateOptions { + /** The Twilio-provided string that uniquely identifies the IP Record resource to map from. */ + ipRecordSid: string; + /** The SID of the SIP Domain that the IP Record should be mapped to. */ + sipDomainSid: string; +} +/** + * Options to pass to each + */ +export interface SourceIpMappingListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SourceIpMappingInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SourceIpMappingListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SourceIpMappingListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SourceIpMappingContext { + /** + * Remove a SourceIpMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SourceIpMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SourceIpMappingInstance + */ + fetch(callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise; + /** + * Update a SourceIpMappingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SourceIpMappingInstance + */ + update(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SourceIpMappingContextSolution { + sid: string; +} +export declare class SourceIpMappingContextImpl implements SourceIpMappingContext { + protected _version: V1; + protected _solution: SourceIpMappingContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise; + update(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SourceIpMappingContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SourceIpMappingPayload extends TwilioResponsePayload { + source_ip_mappings: SourceIpMappingResource[]; +} +interface SourceIpMappingResource { + sid: string; + ip_record_sid: string; + sip_domain_sid: string; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class SourceIpMappingInstance { + protected _version: V1; + protected _solution: SourceIpMappingContextSolution; + protected _context?: SourceIpMappingContext; + constructor(_version: V1, payload: SourceIpMappingResource, sid?: string); + /** + * The unique string that we created to identify the IP Record resource. + */ + sid: string; + /** + * The Twilio-provided string that uniquely identifies the IP Record resource to map from. + */ + ipRecordSid: string; + /** + * The SID of the SIP Domain that the IP Record is mapped to. + */ + sipDomainSid: string; + /** + * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateCreated: Date; + /** + * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a SourceIpMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SourceIpMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SourceIpMappingInstance + */ + fetch(callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise; + /** + * Update a SourceIpMappingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SourceIpMappingInstance + */ + update(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + ipRecordSid: string; + sipDomainSid: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SourceIpMappingSolution { +} +export interface SourceIpMappingListInstance { + _version: V1; + _solution: SourceIpMappingSolution; + _uri: string; + (sid: string): SourceIpMappingContext; + get(sid: string): SourceIpMappingContext; + /** + * Create a SourceIpMappingInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SourceIpMappingInstance + */ + create(params: SourceIpMappingListInstanceCreateOptions, callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise; + /** + * Streams SourceIpMappingInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SourceIpMappingListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SourceIpMappingInstance, done: (err?: Error) => void) => void): void; + each(params: SourceIpMappingListInstanceEachOptions, callback?: (item: SourceIpMappingInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SourceIpMappingInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SourceIpMappingPage) => any): Promise; + /** + * Lists SourceIpMappingInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SourceIpMappingListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SourceIpMappingInstance[]) => any): Promise; + list(params: SourceIpMappingListInstanceOptions, callback?: (error: Error | null, items: SourceIpMappingInstance[]) => any): Promise; + /** + * Retrieve a single page of SourceIpMappingInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SourceIpMappingListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SourceIpMappingPage) => any): Promise; + page(params: SourceIpMappingListInstancePageOptions, callback?: (error: Error | null, items: SourceIpMappingPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SourceIpMappingListInstance(version: V1): SourceIpMappingListInstance; +export declare class SourceIpMappingPage extends Page { + /** + * Initialize the SourceIpMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SourceIpMappingSolution); + /** + * Build an instance of SourceIpMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SourceIpMappingResource): SourceIpMappingInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.js b/node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.js new file mode 100644 index 00000000..a1a107f0 --- /dev/null +++ b/node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.js @@ -0,0 +1,252 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Voice + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SourceIpMappingPage = exports.SourceIpMappingListInstance = exports.SourceIpMappingInstance = exports.SourceIpMappingContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class SourceIpMappingContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/SourceIpMappings/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SourceIpMappingInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["sipDomainSid"] === null || + params["sipDomainSid"] === undefined) { + throw new Error("Required parameter \"params['sipDomainSid']\" missing."); + } + let data = {}; + data["SipDomainSid"] = params["sipDomainSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SourceIpMappingInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SourceIpMappingContextImpl = SourceIpMappingContextImpl; +class SourceIpMappingInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.ipRecordSid = payload.ip_record_sid; + this.sipDomainSid = payload.sip_domain_sid; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new SourceIpMappingContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a SourceIpMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SourceIpMappingInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SourceIpMappingInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + ipRecordSid: this.ipRecordSid, + sipDomainSid: this.sipDomainSid, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SourceIpMappingInstance = SourceIpMappingInstance; +function SourceIpMappingListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SourceIpMappingContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/SourceIpMappings`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["ipRecordSid"] === null || params["ipRecordSid"] === undefined) { + throw new Error("Required parameter \"params['ipRecordSid']\" missing."); + } + if (params["sipDomainSid"] === null || + params["sipDomainSid"] === undefined) { + throw new Error("Required parameter \"params['sipDomainSid']\" missing."); + } + let data = {}; + data["IpRecordSid"] = params["ipRecordSid"]; + data["SipDomainSid"] = params["sipDomainSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SourceIpMappingInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SourceIpMappingPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SourceIpMappingPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SourceIpMappingListInstance = SourceIpMappingListInstance; +class SourceIpMappingPage extends Page_1.default { + /** + * Initialize the SourceIpMappingPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SourceIpMappingInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SourceIpMappingInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SourceIpMappingPage = SourceIpMappingPage; diff --git a/node_modules/twilio/lib/rest/wireless/V1.d.ts b/node_modules/twilio/lib/rest/wireless/V1.d.ts new file mode 100644 index 00000000..9a25ce85 --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/V1.d.ts @@ -0,0 +1,30 @@ +import WirelessBase from "../WirelessBase"; +import Version from "../../base/Version"; +import { CommandListInstance } from "./v1/command"; +import { RatePlanListInstance } from "./v1/ratePlan"; +import { SimListInstance } from "./v1/sim"; +import { UsageRecordListInstance } from "./v1/usageRecord"; +export default class V1 extends Version { + /** + * Initialize the V1 version of Wireless + * + * @param domain - The Twilio (Twilio.Wireless) domain + */ + constructor(domain: WirelessBase); + /** commands - { Twilio.Wireless.V1.CommandListInstance } resource */ + protected _commands?: CommandListInstance; + /** ratePlans - { Twilio.Wireless.V1.RatePlanListInstance } resource */ + protected _ratePlans?: RatePlanListInstance; + /** sims - { Twilio.Wireless.V1.SimListInstance } resource */ + protected _sims?: SimListInstance; + /** usageRecords - { Twilio.Wireless.V1.UsageRecordListInstance } resource */ + protected _usageRecords?: UsageRecordListInstance; + /** Getter for commands resource */ + get commands(): CommandListInstance; + /** Getter for ratePlans resource */ + get ratePlans(): RatePlanListInstance; + /** Getter for sims resource */ + get sims(): SimListInstance; + /** Getter for usageRecords resource */ + get usageRecords(): UsageRecordListInstance; +} diff --git a/node_modules/twilio/lib/rest/wireless/V1.js b/node_modules/twilio/lib/rest/wireless/V1.js new file mode 100644 index 00000000..746dc28f --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/V1.js @@ -0,0 +1,54 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Wireless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Version_1 = __importDefault(require("../../base/Version")); +const command_1 = require("./v1/command"); +const ratePlan_1 = require("./v1/ratePlan"); +const sim_1 = require("./v1/sim"); +const usageRecord_1 = require("./v1/usageRecord"); +class V1 extends Version_1.default { + /** + * Initialize the V1 version of Wireless + * + * @param domain - The Twilio (Twilio.Wireless) domain + */ + constructor(domain) { + super(domain, "v1"); + } + /** Getter for commands resource */ + get commands() { + this._commands = this._commands || (0, command_1.CommandListInstance)(this); + return this._commands; + } + /** Getter for ratePlans resource */ + get ratePlans() { + this._ratePlans = this._ratePlans || (0, ratePlan_1.RatePlanListInstance)(this); + return this._ratePlans; + } + /** Getter for sims resource */ + get sims() { + this._sims = this._sims || (0, sim_1.SimListInstance)(this); + return this._sims; + } + /** Getter for usageRecords resource */ + get usageRecords() { + this._usageRecords = this._usageRecords || (0, usageRecord_1.UsageRecordListInstance)(this); + return this._usageRecords; + } +} +exports.default = V1; diff --git a/node_modules/twilio/lib/rest/wireless/v1/command.d.ts b/node_modules/twilio/lib/rest/wireless/v1/command.d.ts new file mode 100644 index 00000000..1657b3ed --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/command.d.ts @@ -0,0 +1,314 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type CommandCommandMode = "text" | "binary"; +export type CommandDirection = "from_sim" | "to_sim"; +export type CommandStatus = "queued" | "sent" | "delivered" | "received" | "failed"; +export type CommandTransport = "sms" | "ip"; +/** + * Options to pass to create a CommandInstance + */ +export interface CommandListInstanceCreateOptions { + /** The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode. */ + command: string; + /** The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. */ + sim?: string; + /** The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. */ + callbackMethod?: string; + /** The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. */ + callbackUrl?: string; + /** */ + commandMode?: CommandCommandMode; + /** Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. */ + includeSid?: string; + /** Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to \\\'delivered\\\' once the server has received a delivery receipt from the device. The default value is `true`. */ + deliveryReceiptRequested?: boolean; +} +/** + * Options to pass to each + */ +export interface CommandListInstanceEachOptions { + /** The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. */ + sim?: string; + /** The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. */ + status?: CommandStatus; + /** Only return Commands with this direction value. */ + direction?: CommandDirection; + /** Only return Commands with this transport value. Can be: `sms` or `ip`. */ + transport?: CommandTransport; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: CommandInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface CommandListInstanceOptions { + /** The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. */ + sim?: string; + /** The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. */ + status?: CommandStatus; + /** Only return Commands with this direction value. */ + direction?: CommandDirection; + /** Only return Commands with this transport value. Can be: `sms` or `ip`. */ + transport?: CommandTransport; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface CommandListInstancePageOptions { + /** The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. */ + sim?: string; + /** The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. */ + status?: CommandStatus; + /** Only return Commands with this direction value. */ + direction?: CommandDirection; + /** Only return Commands with this transport value. Can be: `sms` or `ip`. */ + transport?: CommandTransport; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface CommandContext { + /** + * Remove a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CommandInstance + */ + fetch(callback?: (error: Error | null, item?: CommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface CommandContextSolution { + sid: string; +} +export declare class CommandContextImpl implements CommandContext { + protected _version: V1; + protected _solution: CommandContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: CommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): CommandContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface CommandPayload extends TwilioResponsePayload { + commands: CommandResource[]; +} +interface CommandResource { + sid: string; + account_sid: string; + sim_sid: string; + command: string; + command_mode: CommandCommandMode; + transport: CommandTransport; + delivery_receipt_requested: boolean; + status: CommandStatus; + direction: CommandDirection; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class CommandInstance { + protected _version: V1; + protected _solution: CommandContextSolution; + protected _context?: CommandContext; + constructor(_version: V1, payload: CommandResource, sid?: string); + /** + * The unique string that we created to identify the Command resource. + */ + sid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Command resource. + */ + accountSid: string; + /** + * The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) that the Command was sent to or from. + */ + simSid: string; + /** + * The message being sent to or from the SIM. For text mode messages, this can be up to 160 characters. For binary mode messages, this is a series of up to 140 bytes of data encoded using base64. + */ + command: string; + commandMode: CommandCommandMode; + transport: CommandTransport; + /** + * Whether to request a delivery receipt. + */ + deliveryReceiptRequested: boolean; + status: CommandStatus; + direction: CommandDirection; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CommandInstance + */ + fetch(callback?: (error: Error | null, item?: CommandInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + accountSid: string; + simSid: string; + command: string; + commandMode: CommandCommandMode; + transport: CommandTransport; + deliveryReceiptRequested: boolean; + status: CommandStatus; + direction: CommandDirection; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface CommandSolution { +} +export interface CommandListInstance { + _version: V1; + _solution: CommandSolution; + _uri: string; + (sid: string): CommandContext; + get(sid: string): CommandContext; + /** + * Create a CommandInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CommandInstance + */ + create(params: CommandListInstanceCreateOptions, callback?: (error: Error | null, item?: CommandInstance) => any): Promise; + /** + * Streams CommandInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CommandListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: CommandInstance, done: (err?: Error) => void) => void): void; + each(params: CommandListInstanceEachOptions, callback?: (item: CommandInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of CommandInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: CommandPage) => any): Promise; + /** + * Lists CommandInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CommandListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: CommandInstance[]) => any): Promise; + list(params: CommandListInstanceOptions, callback?: (error: Error | null, items: CommandInstance[]) => any): Promise; + /** + * Retrieve a single page of CommandInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { CommandListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: CommandPage) => any): Promise; + page(params: CommandListInstancePageOptions, callback?: (error: Error | null, items: CommandPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function CommandListInstance(version: V1): CommandListInstance; +export declare class CommandPage extends Page { + /** + * Initialize the CommandPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: CommandSolution); + /** + * Build an instance of CommandInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CommandResource): CommandInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/wireless/v1/command.js b/node_modules/twilio/lib/rest/wireless/v1/command.js new file mode 100644 index 00000000..fb04f5fe --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/command.js @@ -0,0 +1,253 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Wireless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CommandPage = exports.CommandListInstance = exports.CommandInstance = exports.CommandContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class CommandContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Commands/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new CommandInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CommandContextImpl = CommandContextImpl; +class CommandInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.accountSid = payload.account_sid; + this.simSid = payload.sim_sid; + this.command = payload.command; + this.commandMode = payload.command_mode; + this.transport = payload.transport; + this.deliveryReceiptRequested = payload.delivery_receipt_requested; + this.status = payload.status; + this.direction = payload.direction; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new CommandContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a CommandInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed CommandInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + accountSid: this.accountSid, + simSid: this.simSid, + command: this.command, + commandMode: this.commandMode, + transport: this.transport, + deliveryReceiptRequested: this.deliveryReceiptRequested, + status: this.status, + direction: this.direction, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CommandInstance = CommandInstance; +function CommandListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new CommandContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Commands`; + instance.create = function create(params, callback) { + if (params === null || params === undefined) { + throw new Error('Required parameter "params" missing.'); + } + if (params["command"] === null || params["command"] === undefined) { + throw new Error("Required parameter \"params['command']\" missing."); + } + let data = {}; + data["Command"] = params["command"]; + if (params["sim"] !== undefined) + data["Sim"] = params["sim"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["commandMode"] !== undefined) + data["CommandMode"] = params["commandMode"]; + if (params["includeSid"] !== undefined) + data["IncludeSid"] = params["includeSid"]; + if (params["deliveryReceiptRequested"] !== undefined) + data["DeliveryReceiptRequested"] = serialize.bool(params["deliveryReceiptRequested"]); + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CommandInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["sim"] !== undefined) + data["Sim"] = params["sim"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["direction"] !== undefined) + data["Direction"] = params["direction"]; + if (params["transport"] !== undefined) + data["Transport"] = params["transport"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new CommandPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new CommandPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.CommandListInstance = CommandListInstance; +class CommandPage extends Page_1.default { + /** + * Initialize the CommandPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of CommandInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new CommandInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.CommandPage = CommandPage; diff --git a/node_modules/twilio/lib/rest/wireless/v1/ratePlan.d.ts b/node_modules/twilio/lib/rest/wireless/v1/ratePlan.d.ts new file mode 100644 index 00000000..81fad239 --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/ratePlan.d.ts @@ -0,0 +1,382 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +/** + * Options to pass to update a RatePlanInstance + */ +export interface RatePlanContextUpdateOptions { + /** An application-defined string that uniquely identifies the resource. It can be used in place of the resource\\\'s `sid` in the URL to address the resource. */ + uniqueName?: string; + /** A descriptive string that you create to describe the resource. It does not have to be unique. */ + friendlyName?: string; +} +/** + * Options to pass to create a RatePlanInstance + */ +export interface RatePlanListInstanceCreateOptions { + /** An application-defined string that uniquely identifies the resource. It can be used in place of the resource\\\'s `sid` in the URL to address the resource. */ + uniqueName?: string; + /** A descriptive string that you create to describe the resource. It does not have to be unique. */ + friendlyName?: string; + /** Whether SIMs can use GPRS/3G/4G/LTE data connectivity. */ + dataEnabled?: boolean; + /** The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. */ + dataLimit?: number; + /** The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). */ + dataMetering?: string; + /** Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). */ + messagingEnabled?: boolean; + /** Deprecated. */ + voiceEnabled?: boolean; + /** Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). */ + nationalRoamingEnabled?: boolean; + /** The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. */ + internationalRoaming?: Array; + /** The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. */ + nationalRoamingDataLimit?: number; + /** The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. */ + internationalRoamingDataLimit?: number; +} +/** + * Options to pass to each + */ +export interface RatePlanListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: RatePlanInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface RatePlanListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface RatePlanListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface RatePlanContext { + /** + * Remove a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + fetch(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Update a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + update(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Update a RatePlanInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + update(params: RatePlanContextUpdateOptions, callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface RatePlanContextSolution { + sid: string; +} +export declare class RatePlanContextImpl implements RatePlanContext { + protected _version: V1; + protected _solution: RatePlanContextSolution; + protected _uri: string; + constructor(_version: V1, sid: string); + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + update(params?: RatePlanContextUpdateOptions | ((error: Error | null, item?: RatePlanInstance) => any), callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): RatePlanContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface RatePlanPayload extends TwilioResponsePayload { + rate_plans: RatePlanResource[]; +} +interface RatePlanResource { + sid: string; + unique_name: string; + account_sid: string; + friendly_name: string; + data_enabled: boolean; + data_metering: string; + data_limit: number; + messaging_enabled: boolean; + voice_enabled: boolean; + national_roaming_enabled: boolean; + national_roaming_data_limit: number; + international_roaming: Array; + international_roaming_data_limit: number; + date_created: Date; + date_updated: Date; + url: string; +} +export declare class RatePlanInstance { + protected _version: V1; + protected _solution: RatePlanContextSolution; + protected _context?: RatePlanContext; + constructor(_version: V1, payload: RatePlanResource, sid?: string); + /** + * The unique string that we created to identify the RatePlan resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RatePlan resource. + */ + accountSid: string; + /** + * The string that you assigned to describe the resource. + */ + friendlyName: string; + /** + * Whether SIMs can use GPRS/3G/4G/LTE data connectivity. + */ + dataEnabled: boolean; + /** + * The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). + */ + dataMetering: string; + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. + */ + dataLimit: number; + /** + * Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). + */ + messagingEnabled: boolean; + /** + * Deprecated. Whether SIMs can make and receive voice calls. + */ + voiceEnabled: boolean; + /** + * Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). + */ + nationalRoamingEnabled: boolean; + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. + */ + nationalRoamingDataLimit: number; + /** + * The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. + */ + internationalRoaming: Array; + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. + */ + internationalRoamingDataLimit: number; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + private get _proxy(); + /** + * Remove a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + fetch(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Update a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + update(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Update a RatePlanInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + update(params: RatePlanContextUpdateOptions, callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + friendlyName: string; + dataEnabled: boolean; + dataMetering: string; + dataLimit: number; + messagingEnabled: boolean; + voiceEnabled: boolean; + nationalRoamingEnabled: boolean; + nationalRoamingDataLimit: number; + internationalRoaming: string[]; + internationalRoamingDataLimit: number; + dateCreated: Date; + dateUpdated: Date; + url: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface RatePlanSolution { +} +export interface RatePlanListInstance { + _version: V1; + _solution: RatePlanSolution; + _uri: string; + (sid: string): RatePlanContext; + get(sid: string): RatePlanContext; + /** + * Create a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + create(callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Create a RatePlanInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + create(params: RatePlanListInstanceCreateOptions, callback?: (error: Error | null, item?: RatePlanInstance) => any): Promise; + /** + * Streams RatePlanInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RatePlanListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: RatePlanInstance, done: (err?: Error) => void) => void): void; + each(params: RatePlanListInstanceEachOptions, callback?: (item: RatePlanInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of RatePlanInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: RatePlanPage) => any): Promise; + /** + * Lists RatePlanInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RatePlanListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: RatePlanInstance[]) => any): Promise; + list(params: RatePlanListInstanceOptions, callback?: (error: Error | null, items: RatePlanInstance[]) => any): Promise; + /** + * Retrieve a single page of RatePlanInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { RatePlanListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: RatePlanPage) => any): Promise; + page(params: RatePlanListInstancePageOptions, callback?: (error: Error | null, items: RatePlanPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function RatePlanListInstance(version: V1): RatePlanListInstance; +export declare class RatePlanPage extends Page { + /** + * Initialize the RatePlanPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: RatePlanSolution); + /** + * Build an instance of RatePlanInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: RatePlanResource): RatePlanInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/wireless/v1/ratePlan.js b/node_modules/twilio/lib/rest/wireless/v1/ratePlan.js new file mode 100644 index 00000000..1a943cc9 --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/ratePlan.js @@ -0,0 +1,293 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Wireless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RatePlanPage = exports.RatePlanListInstance = exports.RatePlanInstance = exports.RatePlanContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +class RatePlanContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/RatePlans/${sid}`; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new RatePlanInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RatePlanInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RatePlanContextImpl = RatePlanContextImpl; +class RatePlanInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.friendlyName = payload.friendly_name; + this.dataEnabled = payload.data_enabled; + this.dataMetering = payload.data_metering; + this.dataLimit = deserialize.integer(payload.data_limit); + this.messagingEnabled = payload.messaging_enabled; + this.voiceEnabled = payload.voice_enabled; + this.nationalRoamingEnabled = payload.national_roaming_enabled; + this.nationalRoamingDataLimit = deserialize.integer(payload.national_roaming_data_limit); + this.internationalRoaming = payload.international_roaming; + this.internationalRoamingDataLimit = deserialize.integer(payload.international_roaming_data_limit); + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || + new RatePlanContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a RatePlanInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed RatePlanInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + friendlyName: this.friendlyName, + dataEnabled: this.dataEnabled, + dataMetering: this.dataMetering, + dataLimit: this.dataLimit, + messagingEnabled: this.messagingEnabled, + voiceEnabled: this.voiceEnabled, + nationalRoamingEnabled: this.nationalRoamingEnabled, + nationalRoamingDataLimit: this.nationalRoamingDataLimit, + internationalRoaming: this.internationalRoaming, + internationalRoamingDataLimit: this.internationalRoamingDataLimit, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RatePlanInstance = RatePlanInstance; +function RatePlanListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new RatePlanContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/RatePlans`; + instance.create = function create(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["dataEnabled"] !== undefined) + data["DataEnabled"] = serialize.bool(params["dataEnabled"]); + if (params["dataLimit"] !== undefined) + data["DataLimit"] = params["dataLimit"]; + if (params["dataMetering"] !== undefined) + data["DataMetering"] = params["dataMetering"]; + if (params["messagingEnabled"] !== undefined) + data["MessagingEnabled"] = serialize.bool(params["messagingEnabled"]); + if (params["voiceEnabled"] !== undefined) + data["VoiceEnabled"] = serialize.bool(params["voiceEnabled"]); + if (params["nationalRoamingEnabled"] !== undefined) + data["NationalRoamingEnabled"] = serialize.bool(params["nationalRoamingEnabled"]); + if (params["internationalRoaming"] !== undefined) + data["InternationalRoaming"] = serialize.map(params["internationalRoaming"], (e) => e); + if (params["nationalRoamingDataLimit"] !== undefined) + data["NationalRoamingDataLimit"] = params["nationalRoamingDataLimit"]; + if (params["internationalRoamingDataLimit"] !== undefined) + data["InternationalRoamingDataLimit"] = + params["internationalRoamingDataLimit"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + let operationVersion = version, operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RatePlanInstance(operationVersion, payload)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new RatePlanPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new RatePlanPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.RatePlanListInstance = RatePlanListInstance; +class RatePlanPage extends Page_1.default { + /** + * Initialize the RatePlanPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of RatePlanInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new RatePlanInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.RatePlanPage = RatePlanPage; diff --git a/node_modules/twilio/lib/rest/wireless/v1/sim.d.ts b/node_modules/twilio/lib/rest/wireless/v1/sim.d.ts new file mode 100644 index 00000000..bec99794 --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/sim.d.ts @@ -0,0 +1,460 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +import { DataSessionListInstance } from "./sim/dataSession"; +import { UsageRecordListInstance } from "./sim/usageRecord"; +export type SimResetStatus = "resetting"; +export type SimStatus = "new" | "ready" | "active" | "suspended" | "deactivated" | "canceled" | "scheduled" | "updating"; +/** + * Options to pass to update a SimInstance + */ +export interface SimContextUpdateOptions { + /** An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. */ + uniqueName?: string; + /** The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. */ + callbackMethod?: string; + /** The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). */ + callbackUrl?: string; + /** A descriptive string that you create to describe the Sim resource. It does not need to be unique. */ + friendlyName?: string; + /** The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. */ + ratePlan?: string; + /** */ + status?: SimStatus; + /** The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. */ + commandsCallbackMethod?: string; + /** The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. */ + commandsCallbackUrl?: string; + /** The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. */ + smsFallbackMethod?: string; + /** The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. */ + smsFallbackUrl?: string; + /** The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. */ + smsMethod?: string; + /** The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). */ + smsUrl?: string; + /** Deprecated. */ + voiceFallbackMethod?: string; + /** Deprecated. */ + voiceFallbackUrl?: string; + /** Deprecated. */ + voiceMethod?: string; + /** Deprecated. */ + voiceUrl?: string; + /** */ + resetStatus?: SimResetStatus; + /** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource\\\'s status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). */ + accountSid?: string; +} +/** + * Options to pass to each + */ +export interface SimListInstanceEachOptions { + /** Only return Sim resources with this status. */ + status?: SimStatus; + /** Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. */ + iccid?: string; + /** The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. */ + ratePlan?: string; + /** Deprecated. */ + eId?: string; + /** Only return Sim resources with this registration code. This will return a list with a maximum size of 1. */ + simRegistrationCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: SimInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface SimListInstanceOptions { + /** Only return Sim resources with this status. */ + status?: SimStatus; + /** Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. */ + iccid?: string; + /** The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. */ + ratePlan?: string; + /** Deprecated. */ + eId?: string; + /** Only return Sim resources with this registration code. This will return a list with a maximum size of 1. */ + simRegistrationCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface SimListInstancePageOptions { + /** Only return Sim resources with this status. */ + status?: SimStatus; + /** Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. */ + iccid?: string; + /** The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. */ + ratePlan?: string; + /** Deprecated. */ + eId?: string; + /** Only return Sim resources with this registration code. This will return a list with a maximum size of 1. */ + simRegistrationCode?: string; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface SimContext { + dataSessions: DataSessionListInstance; + usageRecords: UsageRecordListInstance; + /** + * Remove a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(params: SimContextUpdateOptions, callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export interface SimContextSolution { + sid: string; +} +export declare class SimContextImpl implements SimContext { + protected _version: V1; + protected _solution: SimContextSolution; + protected _uri: string; + protected _dataSessions?: DataSessionListInstance; + protected _usageRecords?: UsageRecordListInstance; + constructor(_version: V1, sid: string); + get dataSessions(): DataSessionListInstance; + get usageRecords(): UsageRecordListInstance; + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + update(params?: SimContextUpdateOptions | ((error: Error | null, item?: SimInstance) => any), callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): SimContextSolution; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +interface SimPayload extends TwilioResponsePayload { + sims: SimResource[]; +} +interface SimResource { + sid: string; + unique_name: string; + account_sid: string; + rate_plan_sid: string; + friendly_name: string; + iccid: string; + e_id: string; + status: SimStatus; + reset_status: SimResetStatus; + commands_callback_url: string; + commands_callback_method: string; + sms_fallback_method: string; + sms_fallback_url: string; + sms_method: string; + sms_url: string; + voice_fallback_method: string; + voice_fallback_url: string; + voice_method: string; + voice_url: string; + date_created: Date; + date_updated: Date; + url: string; + links: Record; + ip_address: string; +} +export declare class SimInstance { + protected _version: V1; + protected _solution: SimContextSolution; + protected _context?: SimContext; + constructor(_version: V1, payload: SimResource, sid?: string); + /** + * The unique string that we created to identify the Sim resource. + */ + sid: string; + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource. + */ + uniqueName: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource belongs. + */ + accountSid: string; + /** + * The SID of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource is assigned. + */ + ratePlanSid: string; + /** + * The string that you assigned to describe the Sim resource. + */ + friendlyName: string; + /** + * The [ICCID](https://en.wikipedia.org/wiki/SIM_card#ICCID) associated with the SIM. + */ + iccid: string; + /** + * Deprecated. + */ + eId: string; + status: SimStatus; + resetStatus: SimResetStatus; + /** + * The URL we call using the `commands_callback_method` when the SIM originates a machine-to-machine [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + */ + commandsCallbackUrl: string; + /** + * The HTTP method we use to call `commands_callback_url`. Can be: `POST` or `GET`. Default is `POST`. + */ + commandsCallbackMethod: string; + /** + * Deprecated. + */ + smsFallbackMethod: string; + /** + * Deprecated. + */ + smsFallbackUrl: string; + /** + * Deprecated. + */ + smsMethod: string; + /** + * Deprecated. + */ + smsUrl: string; + /** + * Deprecated. The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. + */ + voiceFallbackMethod: string; + /** + * Deprecated. The URL we call using the `voice_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `voice_url`. + */ + voiceFallbackUrl: string; + /** + * Deprecated. The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`. Default is `POST`. + */ + voiceMethod: string; + /** + * Deprecated. The URL we call using the `voice_method` when the SIM-connected device makes a voice call. + */ + voiceUrl: string; + /** + * The date and time in GMT when the resource was created specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + dateCreated: Date; + /** + * The date and time in GMT when the Sim resource was last updated specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + dateUpdated: Date; + /** + * The absolute URL of the resource. + */ + url: string; + /** + * The URLs of related subresources. + */ + links: Record; + /** + * Deprecated. + */ + ipAddress: string; + private get _proxy(); + /** + * Remove a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback?: (error: Error | null, item?: boolean) => any): Promise; + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Update a SimInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + update(params: SimContextUpdateOptions, callback?: (error: Error | null, item?: SimInstance) => any): Promise; + /** + * Access the dataSessions. + */ + dataSessions(): DataSessionListInstance; + /** + * Access the usageRecords. + */ + usageRecords(): UsageRecordListInstance; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + uniqueName: string; + accountSid: string; + ratePlanSid: string; + friendlyName: string; + iccid: string; + eId: string; + status: SimStatus; + resetStatus: "resetting"; + commandsCallbackUrl: string; + commandsCallbackMethod: string; + smsFallbackMethod: string; + smsFallbackUrl: string; + smsMethod: string; + smsUrl: string; + voiceFallbackMethod: string; + voiceFallbackUrl: string; + voiceMethod: string; + voiceUrl: string; + dateCreated: Date; + dateUpdated: Date; + url: string; + links: Record; + ipAddress: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export interface SimSolution { +} +export interface SimListInstance { + _version: V1; + _solution: SimSolution; + _uri: string; + (sid: string): SimContext; + get(sid: string): SimContext; + /** + * Streams SimInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: SimInstance, done: (err?: Error) => void) => void): void; + each(params: SimListInstanceEachOptions, callback?: (item: SimInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of SimInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: SimPage) => any): Promise; + /** + * Lists SimInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: SimInstance[]) => any): Promise; + list(params: SimListInstanceOptions, callback?: (error: Error | null, items: SimInstance[]) => any): Promise; + /** + * Retrieve a single page of SimInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { SimListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: SimPage) => any): Promise; + page(params: SimListInstancePageOptions, callback?: (error: Error | null, items: SimPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function SimListInstance(version: V1): SimListInstance; +export declare class SimPage extends Page { + /** + * Initialize the SimPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: SimSolution); + /** + * Build an instance of SimInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: SimResource): SimInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/wireless/v1/sim.js b/node_modules/twilio/lib/rest/wireless/v1/sim.js new file mode 100644 index 00000000..e7912488 --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/sim.js @@ -0,0 +1,332 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Wireless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SimPage = exports.SimListInstance = exports.SimInstance = exports.SimContextImpl = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +const utility_1 = require("../../../base/utility"); +const dataSession_1 = require("./sim/dataSession"); +const usageRecord_1 = require("./sim/usageRecord"); +class SimContextImpl { + constructor(_version, sid) { + this._version = _version; + if (!(0, utility_1.isValidPathParam)(sid)) { + throw new Error("Parameter 'sid' is not valid."); + } + this._solution = { sid }; + this._uri = `/Sims/${sid}`; + } + get dataSessions() { + this._dataSessions = + this._dataSessions || + (0, dataSession_1.DataSessionListInstance)(this._version, this._solution.sid); + return this._dataSessions; + } + get usageRecords() { + this._usageRecords = + this._usageRecords || + (0, usageRecord_1.UsageRecordListInstance)(this._version, this._solution.sid); + return this._usageRecords; + } + remove(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.remove({ + uri: instance._uri, + method: "delete", + }); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + fetch(callback) { + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + operationPromise = operationPromise.then((payload) => new SimInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + update(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["uniqueName"] !== undefined) + data["UniqueName"] = params["uniqueName"]; + if (params["callbackMethod"] !== undefined) + data["CallbackMethod"] = params["callbackMethod"]; + if (params["callbackUrl"] !== undefined) + data["CallbackUrl"] = params["callbackUrl"]; + if (params["friendlyName"] !== undefined) + data["FriendlyName"] = params["friendlyName"]; + if (params["ratePlan"] !== undefined) + data["RatePlan"] = params["ratePlan"]; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["commandsCallbackMethod"] !== undefined) + data["CommandsCallbackMethod"] = params["commandsCallbackMethod"]; + if (params["commandsCallbackUrl"] !== undefined) + data["CommandsCallbackUrl"] = params["commandsCallbackUrl"]; + if (params["smsFallbackMethod"] !== undefined) + data["SmsFallbackMethod"] = params["smsFallbackMethod"]; + if (params["smsFallbackUrl"] !== undefined) + data["SmsFallbackUrl"] = params["smsFallbackUrl"]; + if (params["smsMethod"] !== undefined) + data["SmsMethod"] = params["smsMethod"]; + if (params["smsUrl"] !== undefined) + data["SmsUrl"] = params["smsUrl"]; + if (params["voiceFallbackMethod"] !== undefined) + data["VoiceFallbackMethod"] = params["voiceFallbackMethod"]; + if (params["voiceFallbackUrl"] !== undefined) + data["VoiceFallbackUrl"] = params["voiceFallbackUrl"]; + if (params["voiceMethod"] !== undefined) + data["VoiceMethod"] = params["voiceMethod"]; + if (params["voiceUrl"] !== undefined) + data["VoiceUrl"] = params["voiceUrl"]; + if (params["resetStatus"] !== undefined) + data["ResetStatus"] = params["resetStatus"]; + if (params["accountSid"] !== undefined) + data["AccountSid"] = params["accountSid"]; + const headers = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + const instance = this; + let operationVersion = instance._version, operationPromise = operationVersion.update({ + uri: instance._uri, + method: "post", + data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SimInstance(operationVersion, payload, instance._solution.sid)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimContextImpl = SimContextImpl; +class SimInstance { + constructor(_version, payload, sid) { + this._version = _version; + this.sid = payload.sid; + this.uniqueName = payload.unique_name; + this.accountSid = payload.account_sid; + this.ratePlanSid = payload.rate_plan_sid; + this.friendlyName = payload.friendly_name; + this.iccid = payload.iccid; + this.eId = payload.e_id; + this.status = payload.status; + this.resetStatus = payload.reset_status; + this.commandsCallbackUrl = payload.commands_callback_url; + this.commandsCallbackMethod = payload.commands_callback_method; + this.smsFallbackMethod = payload.sms_fallback_method; + this.smsFallbackUrl = payload.sms_fallback_url; + this.smsMethod = payload.sms_method; + this.smsUrl = payload.sms_url; + this.voiceFallbackMethod = payload.voice_fallback_method; + this.voiceFallbackUrl = payload.voice_fallback_url; + this.voiceMethod = payload.voice_method; + this.voiceUrl = payload.voice_url; + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); + this.url = payload.url; + this.links = payload.links; + this.ipAddress = payload.ip_address; + this._solution = { sid: sid || this.sid }; + } + get _proxy() { + this._context = + this._context || new SimContextImpl(this._version, this._solution.sid); + return this._context; + } + /** + * Remove a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed boolean + */ + remove(callback) { + return this._proxy.remove(callback); + } + /** + * Fetch a SimInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed SimInstance + */ + fetch(callback) { + return this._proxy.fetch(callback); + } + update(params, callback) { + return this._proxy.update(params, callback); + } + /** + * Access the dataSessions. + */ + dataSessions() { + return this._proxy.dataSessions; + } + /** + * Access the usageRecords. + */ + usageRecords() { + return this._proxy.usageRecords; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + uniqueName: this.uniqueName, + accountSid: this.accountSid, + ratePlanSid: this.ratePlanSid, + friendlyName: this.friendlyName, + iccid: this.iccid, + eId: this.eId, + status: this.status, + resetStatus: this.resetStatus, + commandsCallbackUrl: this.commandsCallbackUrl, + commandsCallbackMethod: this.commandsCallbackMethod, + smsFallbackMethod: this.smsFallbackMethod, + smsFallbackUrl: this.smsFallbackUrl, + smsMethod: this.smsMethod, + smsUrl: this.smsUrl, + voiceFallbackMethod: this.voiceFallbackMethod, + voiceFallbackUrl: this.voiceFallbackUrl, + voiceMethod: this.voiceMethod, + voiceUrl: this.voiceUrl, + dateCreated: this.dateCreated, + dateUpdated: this.dateUpdated, + url: this.url, + links: this.links, + ipAddress: this.ipAddress, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimInstance = SimInstance; +function SimListInstance(version) { + const instance = ((sid) => instance.get(sid)); + instance.get = function get(sid) { + return new SimContextImpl(version, sid); + }; + instance._version = version; + instance._solution = {}; + instance._uri = `/Sims`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["status"] !== undefined) + data["Status"] = params["status"]; + if (params["iccid"] !== undefined) + data["Iccid"] = params["iccid"]; + if (params["ratePlan"] !== undefined) + data["RatePlan"] = params["ratePlan"]; + if (params["eId"] !== undefined) + data["EId"] = params["eId"]; + if (params["simRegistrationCode"] !== undefined) + data["SimRegistrationCode"] = params["simRegistrationCode"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new SimPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new SimPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.SimListInstance = SimListInstance; +class SimPage extends Page_1.default { + /** + * Initialize the SimPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of SimInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new SimInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.SimPage = SimPage; diff --git a/node_modules/twilio/lib/rest/wireless/v1/sim/dataSession.d.ts b/node_modules/twilio/lib/rest/wireless/v1/sim/dataSession.d.ts new file mode 100644 index 00000000..b7fb6bfb --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/sim/dataSession.d.ts @@ -0,0 +1,233 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +/** + * Options to pass to each + */ +export interface DataSessionListInstanceEachOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: DataSessionInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface DataSessionListInstanceOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface DataSessionListInstancePageOptions { + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface DataSessionSolution { + simSid: string; +} +export interface DataSessionListInstance { + _version: V1; + _solution: DataSessionSolution; + _uri: string; + /** + * Streams DataSessionInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DataSessionListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: DataSessionInstance, done: (err?: Error) => void) => void): void; + each(params: DataSessionListInstanceEachOptions, callback?: (item: DataSessionInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of DataSessionInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: DataSessionPage) => any): Promise; + /** + * Lists DataSessionInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DataSessionListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: DataSessionInstance[]) => any): Promise; + list(params: DataSessionListInstanceOptions, callback?: (error: Error | null, items: DataSessionInstance[]) => any): Promise; + /** + * Retrieve a single page of DataSessionInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { DataSessionListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: DataSessionPage) => any): Promise; + page(params: DataSessionListInstancePageOptions, callback?: (error: Error | null, items: DataSessionPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function DataSessionListInstance(version: V1, simSid: string): DataSessionListInstance; +interface DataSessionPayload extends TwilioResponsePayload { + data_sessions: DataSessionResource[]; +} +interface DataSessionResource { + sid: string; + sim_sid: string; + account_sid: string; + radio_link: string; + operator_mcc: string; + operator_mnc: string; + operator_country: string; + operator_name: string; + cell_id: string; + cell_location_estimate: any; + packets_uploaded: number; + packets_downloaded: number; + last_updated: Date; + start: Date; + end: Date; + imei: string; +} +export declare class DataSessionInstance { + protected _version: V1; + constructor(_version: V1, payload: DataSessionResource, simSid: string); + /** + * The unique string that we created to identify the DataSession resource. + */ + sid: string; + /** + * The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) that the Data Session is for. + */ + simSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the DataSession resource. + */ + accountSid: string; + /** + * The generation of wireless technology that the device was using. + */ + radioLink: string; + /** + * The \'mobile country code\' is the unique ID of the home country where the Data Session took place. See: [MCC/MNC lookup](http://mcc-mnc.com/). + */ + operatorMcc: string; + /** + * The \'mobile network code\' is the unique ID specific to the mobile operator network where the Data Session took place. + */ + operatorMnc: string; + /** + * The three letter country code representing where the device\'s Data Session took place. This is determined by looking up the `operator_mcc`. + */ + operatorCountry: string; + /** + * The friendly name of the mobile operator network that the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource)-connected device is attached to. This is determined by looking up the `operator_mnc`. + */ + operatorName: string; + /** + * The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated. + */ + cellId: string; + /** + * An object that describes the estimated location in latitude and longitude where the device\'s Data Session took place. The location is derived from the `cell_id` when the Data Session was last updated. See [Cell Location Estimate Object](https://www.twilio.com/docs/iot/wireless/api/datasession-resource#cell-location-estimate-object). + */ + cellLocationEstimate: any; + /** + * The number of packets uploaded by the device between the `start` time and when the Data Session was last updated. + */ + packetsUploaded: number; + /** + * The number of packets downloaded by the device between the `start` time and when the Data Session was last updated. + */ + packetsDownloaded: number; + /** + * The date that the resource was last updated, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + lastUpdated: Date; + /** + * The date that the Data Session started, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + start: Date; + /** + * The date that the record ended, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + end: Date; + /** + * The \'international mobile equipment identity\' is the unique ID of the device using the SIM to connect. An IMEI is a 15-digit string: 14 digits for the device identifier plus a check digit calculated using the Luhn formula. + */ + imei: string; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + sid: string; + simSid: string; + accountSid: string; + radioLink: string; + operatorMcc: string; + operatorMnc: string; + operatorCountry: string; + operatorName: string; + cellId: string; + cellLocationEstimate: any; + packetsUploaded: number; + packetsDownloaded: number; + lastUpdated: Date; + start: Date; + end: Date; + imei: string; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class DataSessionPage extends Page { + /** + * Initialize the DataSessionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: DataSessionSolution); + /** + * Build an instance of DataSessionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: DataSessionResource): DataSessionInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/wireless/v1/sim/dataSession.js b/node_modules/twilio/lib/rest/wireless/v1/sim/dataSession.js new file mode 100644 index 00000000..05bed715 --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/sim/dataSession.js @@ -0,0 +1,152 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Wireless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DataSessionPage = exports.DataSessionInstance = exports.DataSessionListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function DataSessionListInstance(version, simSid) { + if (!(0, utility_1.isValidPathParam)(simSid)) { + throw new Error("Parameter 'simSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { simSid }; + instance._uri = `/Sims/${simSid}/DataSessions`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new DataSessionPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new DataSessionPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.DataSessionListInstance = DataSessionListInstance; +class DataSessionInstance { + constructor(_version, payload, simSid) { + this._version = _version; + this.sid = payload.sid; + this.simSid = payload.sim_sid; + this.accountSid = payload.account_sid; + this.radioLink = payload.radio_link; + this.operatorMcc = payload.operator_mcc; + this.operatorMnc = payload.operator_mnc; + this.operatorCountry = payload.operator_country; + this.operatorName = payload.operator_name; + this.cellId = payload.cell_id; + this.cellLocationEstimate = payload.cell_location_estimate; + this.packetsUploaded = deserialize.integer(payload.packets_uploaded); + this.packetsDownloaded = deserialize.integer(payload.packets_downloaded); + this.lastUpdated = deserialize.iso8601DateTime(payload.last_updated); + this.start = deserialize.iso8601DateTime(payload.start); + this.end = deserialize.iso8601DateTime(payload.end); + this.imei = payload.imei; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + sid: this.sid, + simSid: this.simSid, + accountSid: this.accountSid, + radioLink: this.radioLink, + operatorMcc: this.operatorMcc, + operatorMnc: this.operatorMnc, + operatorCountry: this.operatorCountry, + operatorName: this.operatorName, + cellId: this.cellId, + cellLocationEstimate: this.cellLocationEstimate, + packetsUploaded: this.packetsUploaded, + packetsDownloaded: this.packetsDownloaded, + lastUpdated: this.lastUpdated, + start: this.start, + end: this.end, + imei: this.imei, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DataSessionInstance = DataSessionInstance; +class DataSessionPage extends Page_1.default { + /** + * Initialize the DataSessionPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of DataSessionInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new DataSessionInstance(this._version, payload, this._solution.simSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.DataSessionPage = DataSessionPage; diff --git a/node_modules/twilio/lib/rest/wireless/v1/sim/usageRecord.d.ts b/node_modules/twilio/lib/rest/wireless/v1/sim/usageRecord.d.ts new file mode 100644 index 00000000..a49635df --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/sim/usageRecord.d.ts @@ -0,0 +1,186 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../../base/Page"; +import Response from "../../../../http/response"; +import V1 from "../../V1"; +export type UsageRecordGranularity = "hourly" | "daily" | "all"; +/** + * Options to pass to each + */ +export interface UsageRecordListInstanceEachOptions { + /** Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. */ + end?: Date; + /** Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. */ + start?: Date; + /** How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UsageRecordListInstanceOptions { + /** Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. */ + end?: Date; + /** Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. */ + start?: Date; + /** How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UsageRecordListInstancePageOptions { + /** Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. */ + end?: Date; + /** Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. */ + start?: Date; + /** How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UsageRecordSolution { + simSid: string; +} +export interface UsageRecordListInstance { + _version: V1; + _solution: UsageRecordSolution; + _uri: string; + /** + * Streams UsageRecordInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void): void; + each(params: UsageRecordListInstanceEachOptions, callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UsageRecordInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + /** + * Lists UsageRecordInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UsageRecordInstance[]) => any): Promise; + list(params: UsageRecordListInstanceOptions, callback?: (error: Error | null, items: UsageRecordInstance[]) => any): Promise; + /** + * Retrieve a single page of UsageRecordInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + page(params: UsageRecordListInstancePageOptions, callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UsageRecordListInstance(version: V1, simSid: string): UsageRecordListInstance; +interface UsageRecordPayload extends TwilioResponsePayload { + usage_records: UsageRecordResource[]; +} +interface UsageRecordResource { + sim_sid: string; + account_sid: string; + period: any; + commands: any; + data: any; +} +export declare class UsageRecordInstance { + protected _version: V1; + constructor(_version: V1, payload: UsageRecordResource, simSid: string); + /** + * The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) that this Usage Record is for. + */ + simSid: string; + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resource. + */ + accountSid: string; + /** + * The time period for which the usage is reported. Contains `start` and `end` datetime values given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + period: any; + /** + * An object that describes the SIM\'s usage of Commands during the specified period. See [Commands Usage Object](https://www.twilio.com/docs/iot/wireless/api/sim-usagerecord-resource#commands-usage-object). + */ + commands: any; + /** + * An object that describes the SIM\'s data usage during the specified period. See [Data Usage Object](https://www.twilio.com/docs/iot/wireless/api/sim-usagerecord-resource#data-usage-object). + */ + data: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + simSid: string; + accountSid: string; + period: any; + commands: any; + data: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class UsageRecordPage extends Page { + /** + * Initialize the UsageRecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UsageRecordSolution); + /** + * Build an instance of UsageRecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UsageRecordResource): UsageRecordInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/wireless/v1/sim/usageRecord.js b/node_modules/twilio/lib/rest/wireless/v1/sim/usageRecord.js new file mode 100644 index 00000000..5ec168d6 --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/sim/usageRecord.js @@ -0,0 +1,136 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Wireless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsageRecordPage = exports.UsageRecordInstance = exports.UsageRecordListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../../base/Page")); +const deserialize = require("../../../../base/deserialize"); +const serialize = require("../../../../base/serialize"); +const utility_1 = require("../../../../base/utility"); +function UsageRecordListInstance(version, simSid) { + if (!(0, utility_1.isValidPathParam)(simSid)) { + throw new Error("Parameter 'simSid' is not valid."); + } + const instance = {}; + instance._version = version; + instance._solution = { simSid }; + instance._uri = `/Sims/${simSid}/UsageRecords`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["end"] !== undefined) + data["End"] = serialize.iso8601DateTime(params["end"]); + if (params["start"] !== undefined) + data["Start"] = serialize.iso8601DateTime(params["start"]); + if (params["granularity"] !== undefined) + data["Granularity"] = params["granularity"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UsageRecordPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UsageRecordPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UsageRecordListInstance = UsageRecordListInstance; +class UsageRecordInstance { + constructor(_version, payload, simSid) { + this._version = _version; + this.simSid = payload.sim_sid; + this.accountSid = payload.account_sid; + this.period = payload.period; + this.commands = payload.commands; + this.data = payload.data; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + simSid: this.simSid, + accountSid: this.accountSid, + period: this.period, + commands: this.commands, + data: this.data, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsageRecordInstance = UsageRecordInstance; +class UsageRecordPage extends Page_1.default { + /** + * Initialize the UsageRecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UsageRecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UsageRecordInstance(this._version, payload, this._solution.simSid); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsageRecordPage = UsageRecordPage; diff --git a/node_modules/twilio/lib/rest/wireless/v1/usageRecord.d.ts b/node_modules/twilio/lib/rest/wireless/v1/usageRecord.d.ts new file mode 100644 index 00000000..7714b50c --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/usageRecord.d.ts @@ -0,0 +1,179 @@ +/// +import { inspect, InspectOptions } from "util"; +import Page, { TwilioResponsePayload } from "../../../base/Page"; +import Response from "../../../http/response"; +import V1 from "../V1"; +export type UsageRecordGranularity = "hourly" | "daily" | "all"; +/** + * Options to pass to each + */ +export interface UsageRecordListInstanceEachOptions { + /** Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). */ + end?: Date; + /** Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). */ + start?: Date; + /** How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Function to process each record. If this and a positional callback are passed, this one will be used */ + callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void; + /** Function to be called upon completion of streaming */ + done?: Function; + /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to list + */ +export interface UsageRecordListInstanceOptions { + /** Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). */ + end?: Date; + /** Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). */ + start?: Date; + /** How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ + limit?: number; +} +/** + * Options to pass to page + */ +export interface UsageRecordListInstancePageOptions { + /** Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). */ + end?: Date; + /** Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). */ + start?: Date; + /** How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. */ + granularity?: UsageRecordGranularity; + /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ + pageSize?: number; + /** Page Number, this value is simply for client state */ + pageNumber?: number; + /** PageToken provided by the API */ + pageToken?: string; +} +export interface UsageRecordSolution { +} +export interface UsageRecordListInstance { + _version: V1; + _solution: UsageRecordSolution; + _uri: string; + /** + * Streams UsageRecordInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory + * efficient. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstanceEachOptions } [params] - Options for request + * @param { function } [callback] - Function to process each record + */ + each(callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void): void; + each(params: UsageRecordListInstanceEachOptions, callback?: (item: UsageRecordInstance, done: (err?: Error) => void) => void): void; + /** + * Retrieve a single target page of UsageRecordInstance records from the API. + * + * The request is executed immediately. + * + * @param { string } [targetUrl] - API-generated URL for the requested results page + * @param { function } [callback] - Callback to handle list of records + */ + getPage(targetUrl: string, callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + /** + * Lists UsageRecordInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstanceOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + list(callback?: (error: Error | null, items: UsageRecordInstance[]) => any): Promise; + list(params: UsageRecordListInstanceOptions, callback?: (error: Error | null, items: UsageRecordInstance[]) => any): Promise; + /** + * Retrieve a single page of UsageRecordInstance records from the API. + * + * The request is executed immediately. + * + * If a function is passed as the first argument, it will be used as the callback + * function. + * + * @param { UsageRecordListInstancePageOptions } [params] - Options for request + * @param { function } [callback] - Callback to handle list of records + */ + page(callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + page(params: UsageRecordListInstancePageOptions, callback?: (error: Error | null, items: UsageRecordPage) => any): Promise; + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} +export declare function UsageRecordListInstance(version: V1): UsageRecordListInstance; +interface UsageRecordPayload extends TwilioResponsePayload { + usage_records: UsageRecordResource[]; +} +interface UsageRecordResource { + account_sid: string; + period: any; + commands: any; + data: any; +} +export declare class UsageRecordInstance { + protected _version: V1; + constructor(_version: V1, payload: UsageRecordResource); + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AccountUsageRecord resource. + */ + accountSid: string; + /** + * The time period for which usage is reported. Contains `start` and `end` properties that describe the period using GMT date-time values specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + */ + period: any; + /** + * An object that describes the aggregated Commands usage for all SIMs during the specified period. See [Commands Usage Object](https://www.twilio.com/docs/iot/wireless/api/account-usagerecord-resource#commands-usage-object). + */ + commands: any; + /** + * An object that describes the aggregated Data usage for all SIMs over the period. See [Data Usage Object](https://www.twilio.com/docs/iot/wireless/api/account-usagerecord-resource#data-usage-object). + */ + data: any; + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON(): { + accountSid: string; + period: any; + commands: any; + data: any; + }; + [inspect.custom](_depth: any, options: InspectOptions): string; +} +export declare class UsageRecordPage extends Page { + /** + * Initialize the UsageRecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V1, response: Response, solution: UsageRecordSolution); + /** + * Build an instance of UsageRecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: UsageRecordResource): UsageRecordInstance; + [inspect.custom](depth: any, options: InspectOptions): string; +} +export {}; diff --git a/node_modules/twilio/lib/rest/wireless/v1/usageRecord.js b/node_modules/twilio/lib/rest/wireless/v1/usageRecord.js new file mode 100644 index 00000000..e1282b0c --- /dev/null +++ b/node_modules/twilio/lib/rest/wireless/v1/usageRecord.js @@ -0,0 +1,130 @@ +"use strict"; +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Wireless + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsageRecordPage = exports.UsageRecordInstance = exports.UsageRecordListInstance = void 0; +const util_1 = require("util"); +const Page_1 = __importDefault(require("../../../base/Page")); +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +function UsageRecordListInstance(version) { + const instance = {}; + instance._version = version; + instance._solution = {}; + instance._uri = `/UsageRecords`; + instance.page = function page(params, callback) { + if (params instanceof Function) { + callback = params; + params = {}; + } + else { + params = params || {}; + } + let data = {}; + if (params["end"] !== undefined) + data["End"] = serialize.iso8601DateTime(params["end"]); + if (params["start"] !== undefined) + data["Start"] = serialize.iso8601DateTime(params["start"]); + if (params["granularity"] !== undefined) + data["Granularity"] = params["granularity"]; + if (params["pageSize"] !== undefined) + data["PageSize"] = params["pageSize"]; + if (params.pageNumber !== undefined) + data["Page"] = params.pageNumber; + if (params.pageToken !== undefined) + data["PageToken"] = params.pageToken; + const headers = {}; + let operationVersion = version, operationPromise = operationVersion.page({ + uri: instance._uri, + method: "get", + params: data, + headers, + }); + operationPromise = operationPromise.then((payload) => new UsageRecordPage(operationVersion, payload, instance._solution)); + operationPromise = instance._version.setPromiseCallback(operationPromise, callback); + return operationPromise; + }; + instance.each = instance._version.each; + instance.list = instance._version.list; + instance.getPage = function getPage(targetUrl, callback) { + const operationPromise = instance._version._domain.twilio.request({ + method: "get", + uri: targetUrl, + }); + let pagePromise = operationPromise.then((payload) => new UsageRecordPage(instance._version, payload, instance._solution)); + pagePromise = instance._version.setPromiseCallback(pagePromise, callback); + return pagePromise; + }; + instance.toJSON = function toJSON() { + return instance._solution; + }; + instance[util_1.inspect.custom] = function inspectImpl(_depth, options) { + return (0, util_1.inspect)(instance.toJSON(), options); + }; + return instance; +} +exports.UsageRecordListInstance = UsageRecordListInstance; +class UsageRecordInstance { + constructor(_version, payload) { + this._version = _version; + this.accountSid = payload.account_sid; + this.period = payload.period; + this.commands = payload.commands; + this.data = payload.data; + } + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + accountSid: this.accountSid, + period: this.period, + commands: this.commands, + data: this.data, + }; + } + [util_1.inspect.custom](_depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsageRecordInstance = UsageRecordInstance; +class UsageRecordPage extends Page_1.default { + /** + * Initialize the UsageRecordPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version, response, solution) { + super(version, response, solution); + } + /** + * Build an instance of UsageRecordInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload) { + return new UsageRecordInstance(this._version, payload); + } + [util_1.inspect.custom](depth, options) { + return (0, util_1.inspect)(this.toJSON(), options); + } +} +exports.UsageRecordPage = UsageRecordPage; diff --git a/node_modules/twilio/lib/twiml/FaxResponse.d.ts b/node_modules/twilio/lib/twiml/FaxResponse.d.ts new file mode 100644 index 00000000..483b92fb --- /dev/null +++ b/node_modules/twilio/lib/twiml/FaxResponse.d.ts @@ -0,0 +1,66 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +import { XMLElement } from "xmlbuilder"; +import TwiML from "./TwiML"; +declare class FaxResponse extends TwiML { + /** + * TwiML for Faxes + */ + constructor(); + /** + * Comments in + * + * @param comment - XML Comment + */ + comment(comment: string): XMLElement; + /** + * Comments after + * + * @param comment - XML Comment + */ + commentAfter(comment: string): XMLElement; + /** + * Comments before + * + * @param comment - XML Comment + */ + commentBefore(comment: string): XMLElement; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + receive(attributes?: FaxResponse.ReceiveAttributes): FaxResponse.Receive; +} +declare namespace FaxResponse { + type ReceiveMediaType = "application/pdf" | "image/tiff"; + type ReceivePageSize = "letter" | "legal" | "a4"; + /** + * Attributes to pass to receive + */ + export interface ReceiveAttributes { + /** action - Receive action URL */ + action?: string; + /** mediaType - The media type used to store media in the fax media store */ + mediaType?: ReceiveMediaType; + /** method - Receive action URL method */ + method?: string; + /** pageSize - What size to interpret received pages as */ + pageSize?: ReceivePageSize; + /** storeMedia - Whether or not to store received media in the fax media store */ + storeMedia?: boolean; + } + export class Receive extends TwiML { + receive: XMLElement; + /** + * TwiML Verb + */ + constructor(receive: XMLElement); + } + export {}; +} +export = FaxResponse; diff --git a/node_modules/twilio/lib/twiml/FaxResponse.js b/node_modules/twilio/lib/twiml/FaxResponse.js new file mode 100644 index 00000000..8630b400 --- /dev/null +++ b/node_modules/twilio/lib/twiml/FaxResponse.js @@ -0,0 +1,66 @@ +"use strict"; +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const TwiML_1 = __importDefault(require("./TwiML")); +class FaxResponse extends TwiML_1.default { + /** + * TwiML for Faxes + */ + constructor() { + super(); + this._propertyName = "response"; + } + /** + * Comments in + * + * @param comment - XML Comment + */ + comment(comment) { + return this.response.comment(comment); + } + /** + * Comments after + * + * @param comment - XML Comment + */ + commentAfter(comment) { + return this.response.commentAfter(comment); + } + /** + * Comments before + * + * @param comment - XML Comment + */ + commentBefore(comment) { + return this.response.commentBefore(comment); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + receive(attributes) { + return new FaxResponse.Receive(this.response.ele("Receive", attributes)); + } +} +(function (FaxResponse) { + class Receive extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(receive) { + super(); + this.receive = receive; + this._propertyName = "receive"; + } + } + FaxResponse.Receive = Receive; +})(FaxResponse || (FaxResponse = {})); +module.exports = FaxResponse; diff --git a/node_modules/twilio/lib/twiml/MessagingResponse.d.ts b/node_modules/twilio/lib/twiml/MessagingResponse.d.ts new file mode 100644 index 00000000..de2e9001 --- /dev/null +++ b/node_modules/twilio/lib/twiml/MessagingResponse.d.ts @@ -0,0 +1,117 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +import { XMLElement } from "xmlbuilder"; +import TwiML from "./TwiML"; +declare class MessagingResponse extends TwiML { + /** + * TwiML for Messages + */ + constructor(); + /** + * Comments in + * + * @param comment - XML Comment + */ + comment(comment: string): XMLElement; + /** + * Comments after + * + * @param comment - XML Comment + */ + commentAfter(comment: string): XMLElement; + /** + * Comments before + * + * @param comment - XML Comment + */ + commentBefore(comment: string): XMLElement; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param body - Message Body + */ + message(body: string): MessagingResponse.Message; + message(attributes: MessagingResponse.MessageAttributes, body: string): MessagingResponse.Message; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Redirect URL + */ + redirect(url: string): MessagingResponse.Redirect; + redirect(attributes: MessagingResponse.RedirectAttributes, url: string): MessagingResponse.Redirect; +} +declare namespace MessagingResponse { + /** + * Attributes to pass to message + */ + interface MessageAttributes { + /** action - Action URL */ + action?: string; + /** from - Phone Number to send Message from */ + from?: string; + /** method - Action URL Method */ + method?: string; + /** statusCallback - Status callback URL. Deprecated in favor of action. */ + statusCallback?: string; + /** to - Phone Number to send Message to */ + to?: string; + } + /** + * Attributes to pass to redirect + */ + interface RedirectAttributes { + /** method - Redirect URL method */ + method?: string; + } + class Body extends TwiML { + body: XMLElement; + /** + * TwiML Noun + */ + constructor(body: XMLElement); + } + class Media extends TwiML { + media: XMLElement; + /** + * TwiML Noun + */ + constructor(media: XMLElement); + } + class Message extends TwiML { + message: XMLElement; + /** + * TwiML Verb + */ + constructor(message: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param message - Message Body + */ + body(message: string): MessagingResponse.Body; + body(attributes: object, message: string): MessagingResponse.Body; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param url - Media URL + */ + media(url: string): MessagingResponse.Media; + media(attributes: object, url: string): MessagingResponse.Media; + } + class Redirect extends TwiML { + redirect: XMLElement; + /** + * TwiML Verb + */ + constructor(redirect: XMLElement); + } +} +export = MessagingResponse; diff --git a/node_modules/twilio/lib/twiml/MessagingResponse.js b/node_modules/twilio/lib/twiml/MessagingResponse.js new file mode 100644 index 00000000..e3310bcc --- /dev/null +++ b/node_modules/twilio/lib/twiml/MessagingResponse.js @@ -0,0 +1,119 @@ +"use strict"; +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const TwiML_1 = __importDefault(require("./TwiML")); +class MessagingResponse extends TwiML_1.default { + /** + * TwiML for Messages + */ + constructor() { + super(); + this._propertyName = "response"; + } + /** + * Comments in + * + * @param comment - XML Comment + */ + comment(comment) { + return this.response.comment(comment); + } + /** + * Comments after + * + * @param comment - XML Comment + */ + commentAfter(comment) { + return this.response.commentAfter(comment); + } + /** + * Comments before + * + * @param comment - XML Comment + */ + commentBefore(comment) { + return this.response.commentBefore(comment); + } + message(attributes, body) { + if (typeof attributes === "string") { + body = attributes; + attributes = {}; + } + return new MessagingResponse.Message(this.response.ele("Message", attributes, body)); + } + redirect(attributes, url) { + if (typeof attributes === "string") { + url = attributes; + attributes = {}; + } + return new MessagingResponse.Redirect(this.response.ele("Redirect", attributes, url)); + } +} +(function (MessagingResponse) { + class Body extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(body) { + super(); + this.body = body; + this._propertyName = "body"; + } + } + MessagingResponse.Body = Body; + class Media extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(media) { + super(); + this.media = media; + this._propertyName = "media"; + } + } + MessagingResponse.Media = Media; + class Message extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(message) { + super(); + this.message = message; + this._propertyName = "message"; + } + body(attributes, message) { + if (typeof attributes === "string") { + message = attributes; + attributes = {}; + } + return new MessagingResponse.Body(this.message.ele("Body", attributes, message)); + } + media(attributes, url) { + if (typeof attributes === "string") { + url = attributes; + attributes = {}; + } + return new MessagingResponse.Media(this.message.ele("Media", attributes, url)); + } + } + MessagingResponse.Message = Message; + class Redirect extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(redirect) { + super(); + this.redirect = redirect; + this._propertyName = "redirect"; + } + } + MessagingResponse.Redirect = Redirect; +})(MessagingResponse || (MessagingResponse = {})); +module.exports = MessagingResponse; diff --git a/node_modules/twilio/lib/twiml/TwiML.d.ts b/node_modules/twilio/lib/twiml/TwiML.d.ts new file mode 100644 index 00000000..4cc6b584 --- /dev/null +++ b/node_modules/twilio/lib/twiml/TwiML.d.ts @@ -0,0 +1,42 @@ +/** + * Parent TwiML object + */ +export default class TwiML { + [key: string]: any; + response: any; + _propertyName: string; + constructor(); + /** + * Because child elements have properties named after their class names, we need + * to translate that when we want to access that at the parent prototype level. + * So this will translate something like Say to 'say' and VoiceResponse to + * 'response'. + */ + _getXml(): any; + /** + * Convert to TwiML + * + * @returns TwiML XML + */ + toString(): any; + /** + * Add text under the TwiML node + * + * @param {string} content + */ + addText(content: string): void; + /** + * Add an arbitrary tag as a child. + * + * @param {string} content + */ + addChild(tagName: string, attributes: Object): GenericNode; +} +/** + * Generic node + */ +declare class GenericNode extends TwiML { + node: any; + constructor(node: any); +} +export {}; diff --git a/node_modules/twilio/lib/twiml/TwiML.js b/node_modules/twilio/lib/twiml/TwiML.js new file mode 100644 index 00000000..62a932bc --- /dev/null +++ b/node_modules/twilio/lib/twiml/TwiML.js @@ -0,0 +1,83 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const xmlbuilder_1 = __importDefault(require("xmlbuilder")); +/* jshint ignore:start */ +/** + * Parent TwiML object + */ +/* jshint ignore:end */ +class TwiML { + constructor() { + this._propertyName = ""; + this.response = xmlbuilder_1.default + .create("Response", { + stringify: { + attValue: function (value) { + if (Array.isArray(value)) { + value = value.join(" "); + } + return this.attEscape?.("" + value || "") || ""; + }, + }, + }) + .dec("1.0", "UTF-8"); + } + /* jshint ignore:start */ + /** + * Because child elements have properties named after their class names, we need + * to translate that when we want to access that at the parent prototype level. + * So this will translate something like Say to 'say' and VoiceResponse to + * 'response'. + */ + /* jshint ignore:end */ + _getXml() { + return this[this._propertyName]; + } + /* jshint ignore:start */ + /** + * Convert to TwiML + * + * @returns TwiML XML + */ + /* jshint ignore:end */ + toString() { + return this._getXml().end(); + } + /* jshint ignore:start */ + /** + * Add text under the TwiML node + * + * @param {string} content + */ + /* jshint ignore:end */ + addText(content) { + this._getXml().txt(content); + } + /* jshint ignore:start */ + /** + * Add an arbitrary tag as a child. + * + * @param {string} content + */ + /* jshint ignore:end */ + addChild(tagName, attributes) { + return new GenericNode(this._getXml().ele(tagName, attributes)); + } +} +exports.default = TwiML; +/* jshint ignore:start */ +/** + * Generic node + */ +/* jshint ignore:end */ +class GenericNode extends TwiML { + // must match variable name for _getPropertyName + constructor(node) { + super(); + this.node = node; + this._propertyName = "node"; + } +} diff --git a/node_modules/twilio/lib/twiml/VoiceResponse.d.ts b/node_modules/twilio/lib/twiml/VoiceResponse.d.ts new file mode 100644 index 00000000..a97e7349 --- /dev/null +++ b/node_modules/twilio/lib/twiml/VoiceResponse.d.ts @@ -0,0 +1,2457 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +import { XMLElement } from "xmlbuilder"; +import TwiML from "./TwiML"; +declare class VoiceResponse extends TwiML { + /** + * TwiML for Voice + */ + constructor(); + /** + * Comments in + * + * @param comment - XML Comment + */ + comment(comment: string): XMLElement; + /** + * Comments after + * + * @param comment - XML Comment + */ + commentAfter(comment: string): XMLElement; + /** + * Comments before + * + * @param comment - XML Comment + */ + commentBefore(comment: string): XMLElement; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + connect(attributes?: VoiceResponse.ConnectAttributes): VoiceResponse.Connect; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param number - Phone number to dial + */ + dial(number?: string): VoiceResponse.Dial; + dial(attributes?: VoiceResponse.DialAttributes, number?: string): VoiceResponse.Dial; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + echo(attributes?: object): VoiceResponse.Echo; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Friendly name + */ + enqueue(name?: string): VoiceResponse.Enqueue; + enqueue(attributes?: VoiceResponse.EnqueueAttributes, name?: string): VoiceResponse.Enqueue; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + gather(attributes?: VoiceResponse.GatherAttributes): VoiceResponse.Gather; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + hangup(attributes?: object): VoiceResponse.Hangup; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + leave(attributes?: object): VoiceResponse.Leave; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + pause(attributes?: VoiceResponse.PauseAttributes): VoiceResponse.Pause; + /** + * Twiml Verb + * + * @param attributes - TwiML attributes + */ + pay(attributes?: VoiceResponse.PayAttributes): VoiceResponse.Pay; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Media URL + */ + play(url?: string): VoiceResponse.Play; + play(attributes?: VoiceResponse.PlayAttributes, url?: string): VoiceResponse.Play; + /** + * Twiml Verb + * + * @param attributes - TwiML attributes + */ + prompt(attributes?: VoiceResponse.PromptAttributes): VoiceResponse.Prompt; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Queue name + */ + queue(name: string): VoiceResponse.Queue; + queue(attributes: VoiceResponse.QueueAttributes, name: string): VoiceResponse.Queue; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + record(attributes?: VoiceResponse.RecordAttributes): VoiceResponse.Record; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Redirect URL + */ + redirect(url: string): VoiceResponse.Redirect; + redirect(attributes: VoiceResponse.RedirectAttributes, url: string): VoiceResponse.Redirect; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + refer(attributes?: VoiceResponse.ReferAttributes): VoiceResponse.Refer; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + reject(attributes?: VoiceResponse.RejectAttributes): VoiceResponse.Reject; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param message - Message to say + */ + say(message: string): VoiceResponse.Say; + say(attributes: VoiceResponse.SayAttributes, message: string): VoiceResponse.Say; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param message - Message body + */ + sms(message: string): VoiceResponse.Sms; + sms(attributes: VoiceResponse.SmsAttributes, message: string): VoiceResponse.Sms; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + start(attributes?: VoiceResponse.StartAttributes): VoiceResponse.Start; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + stop(attributes?: object): VoiceResponse.Stop; +} +declare namespace VoiceResponse { + type ApplicationEvent = "initiated" | "ringing" | "answered" | "completed"; + type ClientEvent = "initiated" | "ringing" | "answered" | "completed"; + type ConferenceBeep = "true" | "false" | "onEnter" | "onExit"; + type ConferenceEvent = "start" | "end" | "join" | "leave" | "mute" | "hold" | "modify" | "speaker" | "announcement"; + type ConferenceJitterBufferSize = "large" | "medium" | "small" | "off"; + type ConferenceRecord = "do-not-record" | "record-from-start"; + type ConferenceRecordingEvent = "in-progress" | "completed" | "absent"; + type ConferenceRegion = "us1" | "ie1" | "sg1" | "br1" | "au1" | "jp1" | "de1"; + type ConferenceTrim = "trim-silence" | "do-not-trim"; + type ConversationEvent = "call-initiated" | "call-ringing" | "call-answered" | "call-completed"; + type ConversationRecord = "do-not-record" | "record-from-answer" | "record-from-ringing" | "record-from-answer-dual" | "record-from-ringing-dual" | "true" | "false"; + type ConversationRecordingEvent = "in-progress" | "completed" | "absent"; + type ConversationTrim = "trim-silence" | "do-not-trim"; + type DialRecord = "do-not-record" | "record-from-answer" | "record-from-ringing" | "record-from-answer-dual" | "record-from-ringing-dual"; + type DialRecordingEvent = "in-progress" | "completed" | "absent"; + type DialRecordingTrack = "both" | "inbound" | "outbound"; + type DialRingTone = "at" | "au" | "bg" | "br" | "be" | "ch" | "cl" | "cn" | "cz" | "de" | "dk" | "ee" | "es" | "fi" | "fr" | "gr" | "hu" | "il" | "in" | "it" | "lt" | "jp" | "mx" | "my" | "nl" | "no" | "nz" | "ph" | "pl" | "pt" | "ru" | "se" | "sg" | "th" | "uk" | "us" | "us-old" | "tw" | "ve" | "za"; + type DialTrim = "trim-silence" | "do-not-trim"; + type GatherInput = "dtmf" | "speech"; + type GatherLanguage = "af-ZA" | "am-ET" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IL" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-TN" | "az-AZ" | "bg-BG" | "bn-BD" | "bn-IN" | "ca-ES" | "cs-CZ" | "da-DK" | "de-DE" | "el-GR" | "en-AU" | "en-CA" | "en-GB" | "en-GH" | "en-IE" | "en-IN" | "en-KE" | "en-NG" | "en-NZ" | "en-PH" | "en-SG" | "en-TZ" | "en-US" | "en-ZA" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-DO" | "es-EC" | "es-ES" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PE" | "es-PR" | "es-PY" | "es-SV" | "es-US" | "es-UY" | "es-VE" | "et-EE" | "eu-ES" | "fa-IR" | "fi-FI" | "fil-PH" | "fr-CA" | "fr-FR" | "gl-ES" | "gu-IN" | "he-IL" | "hi-IN" | "hr-HR" | "hu-HU" | "hy-AM" | "id-ID" | "is-IS" | "it-IT" | "ja-JP" | "jv-ID" | "ka-GE" | "km-KH" | "kn-IN" | "ko-KR" | "lo-LA" | "lt-LT" | "lv-LV" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "my-MM" | "nar-IQ" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "pa-guru-IN" | "pl-PL" | "pt-BR" | "pt-PT" | "ro-RO" | "ru-RU" | "si-LK" | "sk-SK" | "sl-SI" | "sq-AL" | "sr-RS" | "su-ID" | "sv-SE" | "sw-KE" | "sw-TZ" | "ta-IN" | "ta-LK" | "ta-MY" | "ta-SG" | "te-IN" | "th-TH" | "tr-TR" | "uk-UA" | "ur-IN" | "ur-PK" | "uz-UZ" | "vi-VN" | "yue-Hant-HK" | "zh" | "cmn-Hans-CN" | "zh-TW" | "cmn-Hant-TW" | "zu-ZA"; + type GatherSpeechModel = "default" | "numbers_and_commands" | "phone_call" | "experimental_conversations" | "experimental_utterances"; + type NumberEvent = "initiated" | "ringing" | "answered" | "completed"; + type PayBankAccountType = "consumer-checking" | "consumer-savings" | "commercial-checking" | "commercial-savings"; + type PayInput = "dtmf"; + type PayLanguage = "de-DE" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-IE" | "en-NZ" | "en-PH" | "en-ZA" | "en-US" | "es-ES" | "es-US" | "fr-CA" | "fr-FR" | "it-IT"; + type PayPaymentMethod = "ach-debit" | "credit-card"; + type PayStatusCallbackMethod = "GET" | "POST"; + type PayTokenType = "one-time" | "reusable"; + type PayValidCardTypes = "visa" | "mastercard" | "amex" | "maestro" | "discover" | "optima" | "jcb" | "diners-club" | "enroute"; + type PromptCardType = "visa" | "mastercard" | "amex" | "maestro" | "discover" | "optima" | "jcb" | "diners-club" | "enroute"; + type PromptErrorType = "timeout" | "invalid-card-number" | "invalid-card-type" | "invalid-date" | "invalid-security-code" | "internal-error" | "input-matching-failed"; + type PromptFor = "payment-card-number" | "expiration-date" | "security-code" | "postal-code" | "payment-processing" | "bank-account-number" | "bank-routing-number"; + type RecordRecordingEvent = "in-progress" | "completed" | "absent"; + type RecordTrim = "trim-silence" | "do-not-trim"; + type RejectReason = "rejected" | "busy"; + type SayLanguage = "af-ZA" | "ar-XA" | "arb" | "bg-BG" | "bn-IN" | "ca-ES" | "cmn-CN" | "cmn-TW" | "cs-CZ" | "cy-GB" | "da-DK" | "de-AT" | "de-DE" | "el-GR" | "en-AU" | "en-CA" | "en-GB" | "en-GB-WLS" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "es-ES" | "es-MX" | "es-US" | "fi-FI" | "fil-PH" | "fr-CA" | "fr-FR" | "gu-IN" | "he-IL" | "hi-IN" | "hu-HU" | "id-ID" | "is-IS" | "it-IT" | "ja-JP" | "kn-IN" | "ko-KR" | "lv-LV" | "ml-IN" | "mr-IN" | "ms-MY" | "nb-NO" | "nl-BE" | "nl-NL" | "pa-IN" | "pl-PL" | "pt-BR" | "pt-PT" | "ro-RO" | "ru-RU" | "sk-SK" | "sr-RS" | "sv-SE" | "ta-IN" | "te-IN" | "th-TH" | "tr-TR" | "uk-UA" | "vi-VN" | "yue-HK" | "zh-CN" | "zh-HK" | "zh-TW"; + type SayVoice = "man" | "woman" | "alice" | "Google.af-ZA-Standard-A" | "Google.ar-XA-Standard-A" | "Google.ar-XA-Standard-B" | "Google.ar-XA-Standard-C" | "Google.ar-XA-Standard-D" | "Google.ar-XA-Wavenet-A" | "Google.ar-XA-Wavenet-B" | "Google.ar-XA-Wavenet-C" | "Google.ar-XA-Wavenet-D" | "Google.bg-BG-Standard-A" | "Google.ca-ES-Standard-A" | "Google.cmn-CN-Standard-A" | "Google.cmn-CN-Standard-B" | "Google.cmn-CN-Standard-C" | "Google.cmn-CN-Standard-D" | "Google.cmn-CN-Wavenet-A" | "Google.cmn-CN-Wavenet-B" | "Google.cmn-CN-Wavenet-C" | "Google.cmn-CN-Wavenet-D" | "Google.cmn-TW-Standard-A" | "Google.cmn-TW-Standard-B" | "Google.cmn-TW-Standard-C" | "Google.cmn-TW-Wavenet-A" | "Google.cmn-TW-Wavenet-B" | "Google.cmn-TW-Wavenet-C" | "Google.cs-CZ-Standard-A" | "Google.cs-CZ-Wavenet-A" | "Google.da-DK-Neural2-D" | "Google.da-DK-Neural2-F" | "Google.da-DK-Standard-A" | "Google.da-DK-Standard-C" | "Google.da-DK-Standard-D" | "Google.da-DK-Standard-E" | "Google.da-DK-Wavenet-A" | "Google.da-DK-Wavenet-C" | "Google.da-DK-Wavenet-D" | "Google.da-DK-Wavenet-E" | "Google.de-DE-Neural2-B" | "Google.de-DE-Neural2-C" | "Google.de-DE-Neural2-D" | "Google.de-DE-Neural2-F" | "Google.de-DE-Standard-A" | "Google.de-DE-Standard-B" | "Google.de-DE-Standard-C" | "Google.de-DE-Standard-D" | "Google.de-DE-Standard-E" | "Google.de-DE-Standard-F" | "Google.de-DE-Wavenet-A" | "Google.de-DE-Wavenet-B" | "Google.de-DE-Wavenet-C" | "Google.de-DE-Wavenet-D" | "Google.de-DE-Wavenet-E" | "Google.de-DE-Wavenet-F" | "Google.el-GR-Standard-A" | "Google.el-GR-Wavenet-A" | "Google.en-AU-Neural2-A" | "Google.en-AU-Neural2-B" | "Google.en-AU-Neural2-C" | "Google.en-AU-Neural2-D" | "Google.en-AU-Standard-A" | "Google.en-AU-Standard-B" | "Google.en-AU-Standard-C" | "Google.en-AU-Standard-D" | "Google.en-AU-Wavenet-A" | "Google.en-AU-Wavenet-B" | "Google.en-AU-Wavenet-C" | "Google.en-AU-Wavenet-D" | "Google.en-GB-Neural2-A" | "Google.en-GB-Neural2-B" | "Google.en-GB-Neural2-C" | "Google.en-GB-Neural2-D" | "Google.en-GB-Neural2-F" | "Google.en-GB-Standard-A" | "Google.en-GB-Standard-B" | "Google.en-GB-Standard-C" | "Google.en-GB-Standard-D" | "Google.en-GB-Standard-F" | "Google.en-GB-Wavenet-A" | "Google.en-GB-Wavenet-B" | "Google.en-GB-Wavenet-C" | "Google.en-GB-Wavenet-D" | "Google.en-GB-Wavenet-F" | "Google.en-IN-Standard-A" | "Google.en-IN-Standard-B" | "Google.en-IN-Standard-C" | "Google.en-IN-Standard-D" | "Google.en-IN-Wavenet-A" | "Google.en-IN-Wavenet-B" | "Google.en-IN-Wavenet-C" | "Google.en-IN-Wavenet-D" | "Google.en-US-Neural2-A" | "Google.en-US-Neural2-C" | "Google.en-US-Neural2-D" | "Google.en-US-Neural2-E" | "Google.en-US-Neural2-F" | "Google.en-US-Neural2-G" | "Google.en-US-Neural2-H" | "Google.en-US-Neural2-I" | "Google.en-US-Neural2-J" | "Google.en-US-Standard-A" | "Google.en-US-Standard-B" | "Google.en-US-Standard-C" | "Google.en-US-Standard-D" | "Google.en-US-Standard-E" | "Google.en-US-Standard-F" | "Google.en-US-Standard-G" | "Google.en-US-Standard-H" | "Google.en-US-Standard-I" | "Google.en-US-Standard-J" | "Google.en-US-Wavenet-A" | "Google.en-US-Wavenet-B" | "Google.en-US-Wavenet-C" | "Google.en-US-Wavenet-D" | "Google.en-US-Wavenet-E" | "Google.en-US-Wavenet-F" | "Google.en-US-Wavenet-G" | "Google.en-US-Wavenet-H" | "Google.en-US-Wavenet-I" | "Google.en-US-Wavenet-J" | "Google.es-ES-Neural2-A" | "Google.es-ES-Neural2-B" | "Google.es-ES-Neural2-C" | "Google.es-ES-Neural2-D" | "Google.es-ES-Neural2-E" | "Google.es-ES-Neural2-F" | "Google.es-ES-Standard-B" | "Google.es-ES-Standard-C" | "Google.es-ES-Standard-D" | "Google.es-ES-Wavenet-B" | "Google.es-ES-Wavenet-C" | "Google.es-ES-Wavenet-D" | "Google.es-US-Neural2-A" | "Google.es-US-Neural2-B" | "Google.es-US-Neural2-C" | "Google.es-US-Standard-A" | "Google.es-US-Standard-B" | "Google.es-US-Standard-C" | "Google.es-US-Wavenet-A" | "Google.es-US-Wavenet-B" | "Google.es-US-Wavenet-C" | "Google.eu-ES-Standard-A" | "Google.fi-FI-Standard-A" | "Google.fi-FI-Wavenet-A" | "Google.fil-PH-Standard-A" | "Google.fil-PH-Standard-B" | "Google.fil-PH-Standard-C" | "Google.fil-PH-Standard-D" | "Google.fil-PH-Wavenet-A" | "Google.fil-PH-Wavenet-B" | "Google.fil-PH-Wavenet-C" | "Google.fil-PH-Wavenet-D" | "Google.fil-ph-Neural2-A" | "Google.fil-ph-Neural2-D" | "Google.fr-CA-Neural2-A" | "Google.fr-CA-Neural2-B" | "Google.fr-CA-Neural2-C" | "Google.fr-CA-Neural2-D" | "Google.fr-CA-Standard-A" | "Google.fr-CA-Standard-B" | "Google.fr-CA-Standard-C" | "Google.fr-CA-Standard-D" | "Google.fr-CA-Wavenet-A" | "Google.fr-CA-Wavenet-B" | "Google.fr-CA-Wavenet-C" | "Google.fr-CA-Wavenet-D" | "Google.fr-FR-Neural2-A" | "Google.fr-FR-Neural2-B" | "Google.fr-FR-Neural2-C" | "Google.fr-FR-Neural2-D" | "Google.fr-FR-Neural2-E" | "Google.fr-FR-Standard-A" | "Google.fr-FR-Standard-B" | "Google.fr-FR-Standard-C" | "Google.fr-FR-Standard-D" | "Google.fr-FR-Standard-E" | "Google.fr-FR-Wavenet-A" | "Google.fr-FR-Wavenet-B" | "Google.fr-FR-Wavenet-C" | "Google.fr-FR-Wavenet-D" | "Google.fr-FR-Wavenet-E" | "Google.gl-ES-Standard-A" | "Google.he-IL-Standard-A" | "Google.he-IL-Standard-B" | "Google.he-IL-Standard-C" | "Google.he-IL-Standard-D" | "Google.he-IL-Wavenet-A" | "Google.he-IL-Wavenet-B" | "Google.he-IL-Wavenet-C" | "Google.he-IL-Wavenet-D" | "Google.hi-IN-Neural2-A" | "Google.hi-IN-Neural2-B" | "Google.hi-IN-Neural2-C" | "Google.hi-IN-Neural2-D" | "Google.hi-IN-Standard-A" | "Google.hi-IN-Standard-B" | "Google.hi-IN-Standard-C" | "Google.hi-IN-Standard-D" | "Google.hi-IN-Wavenet-A" | "Google.hi-IN-Wavenet-B" | "Google.hi-IN-Wavenet-C" | "Google.hi-IN-Wavenet-D" | "Google.hu-HU-Standard-A" | "Google.hu-HU-Wavenet-A" | "Google.id-ID-Standard-A" | "Google.id-ID-Standard-B" | "Google.id-ID-Standard-C" | "Google.id-ID-Standard-D" | "Google.id-ID-Wavenet-A" | "Google.id-ID-Wavenet-B" | "Google.id-ID-Wavenet-C" | "Google.id-ID-Wavenet-D" | "Google.is-IS-Standard-A" | "Google.it-IT-Neural2-A" | "Google.it-IT-Neural2-C" | "Google.it-IT-Standard-B" | "Google.it-IT-Standard-C" | "Google.it-IT-Standard-D" | "Google.it-IT-Wavenet-B" | "Google.it-IT-Wavenet-C" | "Google.it-IT-Wavenet-D" | "Google.ja-JP-Neural2-B" | "Google.ja-JP-Neural2-C" | "Google.ja-JP-Neural2-D" | "Google.ja-JP-Standard-A" | "Google.ja-JP-Standard-B" | "Google.ja-JP-Standard-C" | "Google.ja-JP-Standard-D" | "Google.ja-JP-Wavenet-A" | "Google.ja-JP-Wavenet-B" | "Google.ja-JP-Wavenet-C" | "Google.ja-JP-Wavenet-D" | "Google.ko-KR-Neural2-A" | "Google.ko-KR-Neural2-B" | "Google.ko-KR-Neural2-C" | "Google.ko-KR-Standard-A" | "Google.ko-KR-Standard-B" | "Google.ko-KR-Standard-C" | "Google.ko-KR-Standard-D" | "Google.ko-KR-Wavenet-A" | "Google.ko-KR-Wavenet-B" | "Google.ko-KR-Wavenet-C" | "Google.ko-KR-Wavenet-D" | "Google.lt-LT-Standard-A" | "Google.lv-LV-Standard-A" | "Google.ml-IN-Wavenet-C" | "Google.ml-IN-Wavenet-D" | "Google.mr-IN-Standard-A" | "Google.mr-IN-Standard-B" | "Google.mr-IN-Standard-C" | "Google.mr-IN-Wavenet-A" | "Google.mr-IN-Wavenet-B" | "Google.mr-IN-Wavenet-C" | "Google.ms-MY-Standard-A" | "Google.ms-MY-Standard-B" | "Google.ms-MY-Standard-C" | "Google.ms-MY-Standard-D" | "Google.ms-MY-Wavenet-A" | "Google.ms-MY-Wavenet-B" | "Google.ms-MY-Wavenet-C" | "Google.ms-MY-Wavenet-D" | "Google.nb-NO-Standard-A" | "Google.nb-NO-Standard-B" | "Google.nb-NO-Standard-C" | "Google.nb-NO-Standard-D" | "Google.nb-NO-Standard-E" | "Google.nb-NO-Wavenet-A" | "Google.nb-NO-Wavenet-B" | "Google.nb-NO-Wavenet-C" | "Google.nb-NO-Wavenet-D" | "Google.nb-NO-Wavenet-E" | "Google.nl-BE-Standard-A" | "Google.nl-BE-Standard-B" | "Google.nl-BE-Wavenet-A" | "Google.nl-BE-Wavenet-B" | "Google.nl-NL-Standard-A" | "Google.nl-NL-Standard-B" | "Google.nl-NL-Standard-C" | "Google.nl-NL-Standard-D" | "Google.nl-NL-Standard-E" | "Google.nl-NL-Wavenet-A" | "Google.nl-NL-Wavenet-B" | "Google.nl-NL-Wavenet-C" | "Google.nl-NL-Wavenet-D" | "Google.nl-NL-Wavenet-E" | "Google.pa-IN-Standard-A" | "Google.pa-IN-Standard-B" | "Google.pa-IN-Standard-C" | "Google.pa-IN-Standard-D" | "Google.pa-IN-Wavenet-A" | "Google.pa-IN-Wavenet-B" | "Google.pa-IN-Wavenet-C" | "Google.pa-IN-Wavenet-D" | "Google.pl-PL-Standard-A" | "Google.pl-PL-Standard-B" | "Google.pl-PL-Standard-C" | "Google.pl-PL-Standard-D" | "Google.pl-PL-Standard-E" | "Google.pl-PL-Wavenet-A" | "Google.pl-PL-Wavenet-B" | "Google.pl-PL-Wavenet-C" | "Google.pl-PL-Wavenet-D" | "Google.pl-PL-Wavenet-E" | "Google.pt-BR-Neural2-A" | "Google.pt-BR-Neural2-B" | "Google.pt-BR-Neural2-C" | "Google.pt-BR-Standard-A" | "Google.pt-BR-Standard-B" | "Google.pt-BR-Standard-C" | "Google.pt-BR-Wavenet-A" | "Google.pt-BR-Wavenet-B" | "Google.pt-BR-Wavenet-C" | "Google.pt-PT-Standard-A" | "Google.pt-PT-Standard-B" | "Google.pt-PT-Standard-C" | "Google.pt-PT-Standard-D" | "Google.pt-PT-Wavenet-A" | "Google.pt-PT-Wavenet-B" | "Google.pt-PT-Wavenet-C" | "Google.pt-PT-Wavenet-D" | "Google.ro-RO-Standard-A" | "Google.ro-RO-Wavenet-A" | "Google.ru-RU-Standard-A" | "Google.ru-RU-Standard-B" | "Google.ru-RU-Standard-C" | "Google.ru-RU-Standard-D" | "Google.ru-RU-Standard-E" | "Google.ru-RU-Wavenet-A" | "Google.ru-RU-Wavenet-B" | "Google.ru-RU-Wavenet-C" | "Google.ru-RU-Wavenet-D" | "Google.ru-RU-Wavenet-E" | "Google.sk-SK-Standard-A" | "Google.sk-SK-Wavenet-A" | "Google.sr-RS-Standard-A" | "Google.sv-SE-Standard-A" | "Google.sv-SE-Standard-B" | "Google.sv-SE-Standard-C" | "Google.sv-SE-Standard-D" | "Google.sv-SE-Standard-E" | "Google.sv-SE-Wavenet-A" | "Google.sv-SE-Wavenet-B" | "Google.sv-SE-Wavenet-C" | "Google.sv-SE-Wavenet-D" | "Google.sv-SE-Wavenet-E" | "Google.ta-IN-Standard-A" | "Google.ta-IN-Standard-B" | "Google.ta-IN-Standard-C" | "Google.ta-IN-Standard-D" | "Google.ta-IN-Wavenet-A" | "Google.ta-IN-Wavenet-B" | "Google.ta-IN-Wavenet-C" | "Google.ta-IN-Wavenet-D" | "Google.te-IN-Standard-A" | "Google.te-IN-Standard-B" | "Google.th-TH-Neural2-C" | "Google.th-TH-Standard-A" | "Google.tr-TR-Standard-A" | "Google.tr-TR-Standard-B" | "Google.tr-TR-Standard-C" | "Google.tr-TR-Standard-D" | "Google.tr-TR-Standard-E" | "Google.tr-TR-Wavenet-A" | "Google.tr-TR-Wavenet-B" | "Google.tr-TR-Wavenet-C" | "Google.tr-TR-Wavenet-D" | "Google.tr-TR-Wavenet-E" | "Google.uk-UA-Standard-A" | "Google.uk-UA-Wavenet-A" | "Google.vi-VN-Neural2-A" | "Google.vi-VN-Neural2-D" | "Google.vi-VN-Standard-A" | "Google.vi-VN-Standard-B" | "Google.vi-VN-Standard-C" | "Google.vi-VN-Standard-D" | "Google.vi-VN-Wavenet-A" | "Google.vi-VN-Wavenet-B" | "Google.vi-VN-Wavenet-C" | "Google.vi-VN-Wavenet-D" | "Google.yue-HK-Standard-A" | "Google.yue-HK-Standard-B" | "Google.yue-HK-Standard-C" | "Google.yue-HK-Standard-D" | "Polly.Aditi" | "Polly.Amy" | "Polly.Astrid" | "Polly.Bianca" | "Polly.Brian" | "Polly.Camila" | "Polly.Carla" | "Polly.Carmen" | "Polly.Celine" | "Polly.Chantal" | "Polly.Conchita" | "Polly.Cristiano" | "Polly.Dora" | "Polly.Emma" | "Polly.Enrique" | "Polly.Ewa" | "Polly.Filiz" | "Polly.Geraint" | "Polly.Giorgio" | "Polly.Gwyneth" | "Polly.Hans" | "Polly.Ines" | "Polly.Ivy" | "Polly.Jacek" | "Polly.Jan" | "Polly.Joanna" | "Polly.Joey" | "Polly.Justin" | "Polly.Karl" | "Polly.Kendra" | "Polly.Kimberly" | "Polly.Lea" | "Polly.Liv" | "Polly.Lotte" | "Polly.Lucia" | "Polly.Lupe" | "Polly.Mads" | "Polly.Maja" | "Polly.Marlene" | "Polly.Mathieu" | "Polly.Matthew" | "Polly.Maxim" | "Polly.Mia" | "Polly.Miguel" | "Polly.Mizuki" | "Polly.Naja" | "Polly.Nicole" | "Polly.Penelope" | "Polly.Raveena" | "Polly.Ricardo" | "Polly.Ruben" | "Polly.Russell" | "Polly.Salli" | "Polly.Seoyeon" | "Polly.Takumi" | "Polly.Tatyana" | "Polly.Vicki" | "Polly.Vitoria" | "Polly.Zeina" | "Polly.Zhiyu" | "Polly.Adriano-Neural" | "Polly.Amy-Neural" | "Polly.Andres-Neural" | "Polly.Aria-Neural" | "Polly.Arlet-Neural" | "Polly.Arthur-Neural" | "Polly.Ayanda-Neural" | "Polly.Bianca-Neural" | "Polly.Brian-Neural" | "Polly.Camila-Neural" | "Polly.Daniel-Neural" | "Polly.Elin-Neural" | "Polly.Emma-Neural" | "Polly.Gabrielle-Neural" | "Polly.Hala-Neural" | "Polly.Hannah-Neural" | "Polly.Hiujin-Neural" | "Polly.Ida-Neural" | "Polly.Ines-Neural" | "Polly.Ivy-Neural" | "Polly.Joanna-Neural" | "Polly.Joey-Neural" | "Polly.Justin-Neural" | "Polly.Kajal-Neural" | "Polly.Kazuha-Neural" | "Polly.Kendra-Neural" | "Polly.Kevin-Neural" | "Polly.Kimberly-Neural" | "Polly.Laura-Neural" | "Polly.Lea-Neural" | "Polly.Liam-Neural" | "Polly.Lucia-Neural" | "Polly.Lupe-Neural" | "Polly.Matthew-Neural" | "Polly.Mia-Neural" | "Polly.Ola-Neural" | "Polly.Olivia-Neural" | "Polly.Pedro-Neural" | "Polly.Remi-Neural" | "Polly.Ruth-Neural" | "Polly.Salli-Neural" | "Polly.Seoyeon-Neural" | "Polly.Sergio-Neural" | "Polly.Stephen-Neural" | "Polly.Suvi-Neural" | "Polly.Takumi-Neural" | "Polly.Tomoko-Neural" | "Polly.Thiago-Neural" | "Polly.Vicki-Neural" | "Polly.Vitoria-Neural" | "Polly.Zhiyu-Neural"; + type SipEvent = "initiated" | "ringing" | "answered" | "completed"; + type SiprecStatusCallbackMethod = "GET" | "POST"; + type SiprecTrack = "inbound_track" | "outbound_track" | "both_tracks"; + type SsmlBreakStrength = "none" | "x-weak" | "weak" | "medium" | "strong" | "x-strong"; + type SsmlEmphasisLevel = "strong" | "moderate" | "reduced"; + type SsmlLangXmlLang = "arb" | "ar-AE" | "ca-ES" | "cmn-CN" | "cy-GB" | "da-DK" | "de-DE" | "de-AT" | "en-AU" | "en-GB" | "en-GB-WLS" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "es-ES" | "es-MX" | "es-US" | "fi-FI" | "fr-CA" | "fr-FR" | "he-IL" | "hi-IN" | "is-IS" | "it-IT" | "ja-JP" | "ko-KR" | "nb-NO" | "nl-NL" | "pl-PL" | "pt-BR" | "pt-PT" | "ro-RO" | "ru-RU" | "sv-SE" | "tr-TR" | "yue-CN"; + type SsmlPhonemeAlphabet = "ipa" | "x-sampa" | "x-amazon-jyutping" | "x-amazon-pinyin" | "x-amazon-pron-kana" | "x-amazon-yomigana"; + type SsmlSayAsFormat = "mdy" | "dmy" | "ymd" | "md" | "dm" | "ym" | "my" | "d" | "m" | "y" | "yyyymmdd"; + type SsmlSayAsInterpretAs = "characters" | "spell-out" | "cardinal" | "number" | "ordinal" | "digits" | "fraction" | "unit" | "date" | "time" | "address" | "expletive" | "telephone"; + type StreamStatusCallbackMethod = "GET" | "POST"; + type StreamTrack = "inbound_track" | "outbound_track" | "both_tracks"; + /** + * Attributes to pass to connect + */ + export interface ConnectAttributes { + /** action - Action URL */ + action?: string; + /** method - Action URL method */ + method?: string; + } + /** + * Attributes to pass to dial + */ + export interface DialAttributes { + /** action - Action URL */ + action?: string; + /** answerOnBridge - Preserve the ringing behavior of the inbound call until the Dialed call picks up */ + answerOnBridge?: boolean; + /** callerId - Caller ID to display */ + callerId?: string; + /** hangupOnStar - Hangup call on star press */ + hangupOnStar?: boolean; + /** method - Action URL method */ + method?: string; + /** record - Record the call */ + record?: DialRecord; + /** recordingStatusCallback - Recording status callback URL */ + recordingStatusCallback?: string; + /** recordingStatusCallbackEvent - Recording status callback events */ + recordingStatusCallbackEvent?: DialRecordingEvent[]; + /** recordingStatusCallbackMethod - Recording status callback URL method */ + recordingStatusCallbackMethod?: string; + /** recordingTrack - To indicate which audio track should be recorded */ + recordingTrack?: DialRecordingTrack; + /** referMethod - The HTTP method to use for the refer Webhook */ + referMethod?: string; + /** referUrl - Webhook that will receive future SIP REFER requests */ + referUrl?: string; + /** ringTone - Ringtone allows you to override the ringback tone that Twilio will play back to the caller while executing the Dial */ + ringTone?: DialRingTone; + /** sequential - Used to determine if child TwiML nouns should be dialed in order, one after the other (sequential) or dial all at once (parallel). Default is false, parallel */ + sequential?: boolean; + /** timeLimit - Max time length */ + timeLimit?: number; + /** timeout - Time to wait for answer */ + timeout?: number; + /** trim - Trim the recording */ + trim?: DialTrim; + } + /** + * Attributes to pass to enqueue + */ + export interface EnqueueAttributes { + /** action - Action URL */ + action?: string; + /** maxQueueSize - Maximum size of queue */ + maxQueueSize?: number; + /** method - Action URL method */ + method?: string; + /** waitUrl - Wait URL */ + waitUrl?: string; + /** waitUrlMethod - Wait URL method */ + waitUrlMethod?: string; + /** workflowSid - TaskRouter Workflow SID */ + workflowSid?: string; + } + /** + * Attributes to pass to gather + */ + export interface GatherAttributes { + /** action - Action URL */ + action?: string; + /** actionOnEmptyResult - Force webhook to the action URL event if there is no input */ + actionOnEmptyResult?: boolean; + /** bargeIn - Stop playing media upon speech */ + bargeIn?: boolean; + /** debug - Allow debug for gather */ + debug?: boolean; + /** enhanced - Use enhanced speech model */ + enhanced?: boolean; + /** finishOnKey - Finish gather on key */ + finishOnKey?: string; + /** hints - Speech recognition hints */ + hints?: string; + /** input - Input type Twilio should accept */ + input?: GatherInput[]; + /** language - Language to use */ + language?: GatherLanguage; + /** maxSpeechTime - Max allowed time for speech input */ + maxSpeechTime?: number; + /** method - Action URL method */ + method?: string; + /** numDigits - Number of digits to collect */ + numDigits?: number; + /** partialResultCallback - Partial result callback URL */ + partialResultCallback?: string; + /** partialResultCallbackMethod - Partial result callback URL method */ + partialResultCallbackMethod?: string; + /** profanityFilter - Profanity Filter on speech */ + profanityFilter?: boolean; + /** speechModel - Specify the model that is best suited for your use case */ + speechModel?: GatherSpeechModel; + /** speechTimeout - Time to wait to gather speech input and it should be either auto or a positive integer. */ + speechTimeout?: string; + /** timeout - Time to wait to gather input */ + timeout?: number; + } + /** + * Attributes to pass to pause + */ + export interface PauseAttributes { + /** length - Length in seconds to pause */ + length?: number; + } + /** + * Attributes to pass to play + */ + export interface PlayAttributes { + /** digits - Play DTMF tones for digits */ + digits?: string; + /** loop - Times to loop media */ + loop?: number; + } + /** + * Attributes to pass to queue + */ + export interface QueueAttributes { + /** method - Action URL method */ + method?: string; + /** postWorkActivitySid - TaskRouter Activity SID */ + postWorkActivitySid?: string; + /** reservationSid - TaskRouter Reservation SID */ + reservationSid?: string; + /** url - Action URL */ + url?: string; + } + /** + * Attributes to pass to record + */ + export interface RecordAttributes { + /** action - Action URL */ + action?: string; + /** finishOnKey - Finish recording on key */ + finishOnKey?: string; + /** maxLength - Max time to record in seconds */ + maxLength?: number; + /** method - Action URL method */ + method?: string; + /** playBeep - Play beep */ + playBeep?: boolean; + /** recordingStatusCallback - Status callback URL */ + recordingStatusCallback?: string; + /** recordingStatusCallbackEvent - Recording status callback events */ + recordingStatusCallbackEvent?: RecordRecordingEvent[]; + /** recordingStatusCallbackMethod - Status callback URL method */ + recordingStatusCallbackMethod?: string; + /** timeout - Timeout to begin recording */ + timeout?: number; + /** transcribe - Transcribe the recording */ + transcribe?: boolean; + /** transcribeCallback - Transcribe callback URL */ + transcribeCallback?: string; + /** trim - Trim the recording */ + trim?: RecordTrim; + } + /** + * Attributes to pass to redirect + */ + export interface RedirectAttributes { + /** method - Redirect URL method */ + method?: string; + } + /** + * Attributes to pass to reject + */ + export interface RejectAttributes { + /** reason - Rejection reason */ + reason?: RejectReason; + } + /** + * Attributes to pass to say + */ + export interface SayAttributes { + /** language - Message language */ + language?: SayLanguage; + /** loop - Times to loop message */ + loop?: number; + /** voice - Voice to use */ + voice?: SayVoice; + } + /** + * Attributes to pass to sms + */ + export interface SmsAttributes { + /** action - Action URL */ + action?: string; + /** from - Number to send message from */ + from?: string; + /** method - Action URL method */ + method?: string; + /** statusCallback - Status callback URL */ + statusCallback?: string; + /** to - Number to send message to */ + to?: string; + } + /** + * Attributes to pass to pay + */ + export interface PayAttributes { + /** action - Action URL */ + action?: string; + /** bankAccountType - Bank account type for ach transactions. If set, payment method attribute must be provided and value should be set to ach-debit. defaults to consumer-checking */ + bankAccountType?: PayBankAccountType; + /** chargeAmount - Amount to process. If value is greater than 0 then make the payment else create a payment token */ + chargeAmount?: string; + /** currency - Currency of the amount attribute */ + currency?: string; + /** description - Details regarding the payment */ + description?: string; + /** input - Input type Twilio should accept */ + input?: PayInput; + /** language - Language to use */ + language?: PayLanguage; + /** maxAttempts - Maximum number of allowed retries when gathering input */ + maxAttempts?: number; + /** minPostalCodeLength - Prompt for minimum postal code length */ + minPostalCodeLength?: number; + /** paymentConnector - Unique name for payment connector */ + paymentConnector?: string; + /** paymentMethod - Payment method to be used. defaults to credit-card */ + paymentMethod?: PayPaymentMethod; + /** postalCode - Prompt for postal code and it should be true/false or default postal code */ + postalCode?: string; + /** securityCode - Prompt for security code */ + securityCode?: boolean; + /** statusCallback - Status callback URL */ + statusCallback?: string; + /** statusCallbackMethod - Status callback method */ + statusCallbackMethod?: PayStatusCallbackMethod; + /** timeout - Time to wait to gather input */ + timeout?: number; + /** tokenType - Type of token */ + tokenType?: PayTokenType; + /** validCardTypes - Comma separated accepted card types */ + validCardTypes?: PayValidCardTypes[]; + } + /** + * Attributes to pass to prompt + */ + export interface PromptAttributes { + /** attempt - Current attempt count */ + attempt?: number[]; + /** cardType - Type of the credit card */ + cardType?: PromptCardType[]; + /** errorType - Type of error */ + errorType?: PromptErrorType[]; + /** for - Name of the payment source data element */ + for?: PromptFor; + /** requireMatchingInputs - Require customer to input requested information twice and verify matching. */ + requireMatchingInputs?: boolean; + } + /** + * Attributes to pass to start + */ + export interface StartAttributes { + /** action - Action URL */ + action?: string; + /** method - Action URL method */ + method?: string; + } + /** + * Attributes to pass to refer + */ + export interface ReferAttributes { + /** action - Action URL */ + action?: string; + /** method - Action URL method */ + method?: string; + } + /** + * Attributes to pass to stream + */ + export interface StreamAttributes { + /** connectorName - Unique name for Stream Connector */ + connectorName?: string; + /** name - Friendly name given to the Stream */ + name?: string; + /** statusCallback - Status Callback URL */ + statusCallback?: string; + /** statusCallbackMethod - Status Callback URL method */ + statusCallbackMethod?: StreamStatusCallbackMethod; + /** track - Track to be streamed to remote service */ + track?: StreamTrack; + /** url - URL of the remote service where the Stream is routed */ + url?: string; + } + /** + * Attributes to pass to siprec + */ + export interface SiprecAttributes { + /** connectorName - Unique name for Connector */ + connectorName?: string; + /** name - Friendly name given to SIPREC */ + name?: string; + /** statusCallback - Status Callback URL */ + statusCallback?: string; + /** statusCallbackMethod - Status Callback URL method */ + statusCallbackMethod?: SiprecStatusCallbackMethod; + /** track - Track to be streamed to remote service */ + track?: SiprecTrack; + } + /** + * Attributes to pass to parameter + */ + export interface ParameterAttributes { + /** name - The name of the custom parameter */ + name?: string; + /** value - The value of the custom parameter */ + value?: string; + } + /** + * Attributes to pass to parameter + */ + export interface ParameterAttributes { + /** name - The name of the custom parameter */ + name?: string; + /** value - The value of the custom parameter */ + value?: string; + } + /** + * Attributes to pass to stream + */ + export interface StreamAttributes { + /** connectorName - Unique name for Stream Connector */ + connectorName?: string; + /** name - Friendly name given to the Stream */ + name?: string; + /** statusCallback - Status Callback URL */ + statusCallback?: string; + /** statusCallbackMethod - Status Callback URL method */ + statusCallbackMethod?: StreamStatusCallbackMethod; + /** track - Track to be streamed to remote service */ + track?: StreamTrack; + /** url - URL of the remote service where the Stream is routed */ + url?: string; + } + /** + * Attributes to pass to siprec + */ + export interface SiprecAttributes { + /** connectorName - Unique name for Connector */ + connectorName?: string; + /** name - Friendly name given to SIPREC */ + name?: string; + /** statusCallback - Status Callback URL */ + statusCallback?: string; + /** statusCallbackMethod - Status Callback URL method */ + statusCallbackMethod?: SiprecStatusCallbackMethod; + /** track - Track to be streamed to remote service */ + track?: SiprecTrack; + } + /** + * Attributes to pass to say + */ + export interface SayAttributes { + /** language - Message language */ + language?: SayLanguage; + /** loop - Times to loop message */ + loop?: number; + /** voice - Voice to use */ + voice?: SayVoice; + } + /** + * Attributes to pass to play + */ + export interface PlayAttributes { + /** digits - Play DTMF tones for digits */ + digits?: string; + /** loop - Times to loop media */ + loop?: number; + } + /** + * Attributes to pass to pause + */ + export interface PauseAttributes { + /** length - Length in seconds to pause */ + length?: number; + } + /** + * Attributes to pass to break + */ + export interface SsmlBreakAttributes { + /** strength - Set a pause based on strength */ + strength?: SsmlBreakStrength; + /** time - Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms */ + time?: string; + } + /** + * Attributes to pass to emphasis + */ + export interface SsmlEmphasisAttributes { + /** level - Specify the degree of emphasis */ + level?: SsmlEmphasisLevel; + } + /** + * Attributes to pass to lang + */ + export interface SsmlLangAttributes { + /** xml:lang - Specify the language */ + "xml:lang"?: SsmlLangXmlLang; + } + /** + * Attributes to pass to phoneme + */ + export interface SsmlPhonemeAttributes { + /** alphabet - Specify the phonetic alphabet */ + alphabet?: SsmlPhonemeAlphabet; + /** ph - Specifiy the phonetic symbols for pronunciation */ + ph?: string; + } + /** + * Attributes to pass to prosody + */ + export interface SsmlProsodyAttributes { + /** pitch - Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n% */ + pitch?: string; + /** rate - Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n% */ + rate?: string; + /** volume - Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ + volume?: string; + } + /** + * Attributes to pass to sayAs + */ + export interface SsmlSayAsAttributes { + /** format - Specify the format of the date when interpret-as is set to date */ + format?: SsmlSayAsFormat; + /** interpret-as - Specify the type of words are spoken */ + "interpret-as"?: SsmlSayAsInterpretAs; + } + /** + * Attributes to pass to sub + */ + export interface SsmlSubAttributes { + /** alias - Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation */ + alias?: string; + } + /** + * Attributes to pass to w + */ + export interface SsmlWAttributes { + /** role - Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning */ + role?: string; + } + /** + * Attributes to pass to break + */ + export interface SsmlBreakAttributes { + /** strength - Set a pause based on strength */ + strength?: SsmlBreakStrength; + /** time - Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms */ + time?: string; + } + /** + * Attributes to pass to emphasis + */ + export interface SsmlEmphasisAttributes { + /** level - Specify the degree of emphasis */ + level?: SsmlEmphasisLevel; + } + /** + * Attributes to pass to phoneme + */ + export interface SsmlPhonemeAttributes { + /** alphabet - Specify the phonetic alphabet */ + alphabet?: SsmlPhonemeAlphabet; + /** ph - Specifiy the phonetic symbols for pronunciation */ + ph?: string; + } + /** + * Attributes to pass to prosody + */ + export interface SsmlProsodyAttributes { + /** pitch - Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n% */ + pitch?: string; + /** rate - Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n% */ + rate?: string; + /** volume - Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ + volume?: string; + } + /** + * Attributes to pass to sayAs + */ + export interface SsmlSayAsAttributes { + /** format - Specify the format of the date when interpret-as is set to date */ + format?: SsmlSayAsFormat; + /** interpret-as - Specify the type of words are spoken */ + "interpret-as"?: SsmlSayAsInterpretAs; + } + /** + * Attributes to pass to sub + */ + export interface SsmlSubAttributes { + /** alias - Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation */ + alias?: string; + } + /** + * Attributes to pass to break + */ + export interface SsmlBreakAttributes { + /** strength - Set a pause based on strength */ + strength?: SsmlBreakStrength; + /** time - Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms */ + time?: string; + } + /** + * Attributes to pass to emphasis + */ + export interface SsmlEmphasisAttributes { + /** level - Specify the degree of emphasis */ + level?: SsmlEmphasisLevel; + } + /** + * Attributes to pass to lang + */ + export interface SsmlLangAttributes { + /** xml:lang - Specify the language */ + "xml:lang"?: SsmlLangXmlLang; + } + /** + * Attributes to pass to phoneme + */ + export interface SsmlPhonemeAttributes { + /** alphabet - Specify the phonetic alphabet */ + alphabet?: SsmlPhonemeAlphabet; + /** ph - Specifiy the phonetic symbols for pronunciation */ + ph?: string; + } + /** + * Attributes to pass to prosody + */ + export interface SsmlProsodyAttributes { + /** pitch - Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n% */ + pitch?: string; + /** rate - Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n% */ + rate?: string; + /** volume - Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ + volume?: string; + } + /** + * Attributes to pass to sayAs + */ + export interface SsmlSayAsAttributes { + /** format - Specify the format of the date when interpret-as is set to date */ + format?: SsmlSayAsFormat; + /** interpret-as - Specify the type of words are spoken */ + "interpret-as"?: SsmlSayAsInterpretAs; + } + /** + * Attributes to pass to sub + */ + export interface SsmlSubAttributes { + /** alias - Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation */ + alias?: string; + } + /** + * Attributes to pass to w + */ + export interface SsmlWAttributes { + /** role - Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning */ + role?: string; + } + /** + * Attributes to pass to break + */ + export interface SsmlBreakAttributes { + /** strength - Set a pause based on strength */ + strength?: SsmlBreakStrength; + /** time - Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms */ + time?: string; + } + /** + * Attributes to pass to emphasis + */ + export interface SsmlEmphasisAttributes { + /** level - Specify the degree of emphasis */ + level?: SsmlEmphasisLevel; + } + /** + * Attributes to pass to lang + */ + export interface SsmlLangAttributes { + /** xml:lang - Specify the language */ + "xml:lang"?: SsmlLangXmlLang; + } + /** + * Attributes to pass to phoneme + */ + export interface SsmlPhonemeAttributes { + /** alphabet - Specify the phonetic alphabet */ + alphabet?: SsmlPhonemeAlphabet; + /** ph - Specifiy the phonetic symbols for pronunciation */ + ph?: string; + } + /** + * Attributes to pass to prosody + */ + export interface SsmlProsodyAttributes { + /** pitch - Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n% */ + pitch?: string; + /** rate - Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n% */ + rate?: string; + /** volume - Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ + volume?: string; + } + /** + * Attributes to pass to sayAs + */ + export interface SsmlSayAsAttributes { + /** format - Specify the format of the date when interpret-as is set to date */ + format?: SsmlSayAsFormat; + /** interpret-as - Specify the type of words are spoken */ + "interpret-as"?: SsmlSayAsInterpretAs; + } + /** + * Attributes to pass to sub + */ + export interface SsmlSubAttributes { + /** alias - Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation */ + alias?: string; + } + /** + * Attributes to pass to w + */ + export interface SsmlWAttributes { + /** role - Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning */ + role?: string; + } + /** + * Attributes to pass to break + */ + export interface SsmlBreakAttributes { + /** strength - Set a pause based on strength */ + strength?: SsmlBreakStrength; + /** time - Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms */ + time?: string; + } + /** + * Attributes to pass to emphasis + */ + export interface SsmlEmphasisAttributes { + /** level - Specify the degree of emphasis */ + level?: SsmlEmphasisLevel; + } + /** + * Attributes to pass to lang + */ + export interface SsmlLangAttributes { + /** xml:lang - Specify the language */ + "xml:lang"?: SsmlLangXmlLang; + } + /** + * Attributes to pass to phoneme + */ + export interface SsmlPhonemeAttributes { + /** alphabet - Specify the phonetic alphabet */ + alphabet?: SsmlPhonemeAlphabet; + /** ph - Specifiy the phonetic symbols for pronunciation */ + ph?: string; + } + /** + * Attributes to pass to prosody + */ + export interface SsmlProsodyAttributes { + /** pitch - Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n% */ + pitch?: string; + /** rate - Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n% */ + rate?: string; + /** volume - Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ + volume?: string; + } + /** + * Attributes to pass to sayAs + */ + export interface SsmlSayAsAttributes { + /** format - Specify the format of the date when interpret-as is set to date */ + format?: SsmlSayAsFormat; + /** interpret-as - Specify the type of words are spoken */ + "interpret-as"?: SsmlSayAsInterpretAs; + } + /** + * Attributes to pass to sub + */ + export interface SsmlSubAttributes { + /** alias - Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation */ + alias?: string; + } + /** + * Attributes to pass to w + */ + export interface SsmlWAttributes { + /** role - Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning */ + role?: string; + } + /** + * Attributes to pass to break + */ + export interface SsmlBreakAttributes { + /** strength - Set a pause based on strength */ + strength?: SsmlBreakStrength; + /** time - Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms */ + time?: string; + } + /** + * Attributes to pass to emphasis + */ + export interface SsmlEmphasisAttributes { + /** level - Specify the degree of emphasis */ + level?: SsmlEmphasisLevel; + } + /** + * Attributes to pass to lang + */ + export interface SsmlLangAttributes { + /** xml:lang - Specify the language */ + "xml:lang"?: SsmlLangXmlLang; + } + /** + * Attributes to pass to phoneme + */ + export interface SsmlPhonemeAttributes { + /** alphabet - Specify the phonetic alphabet */ + alphabet?: SsmlPhonemeAlphabet; + /** ph - Specifiy the phonetic symbols for pronunciation */ + ph?: string; + } + /** + * Attributes to pass to prosody + */ + export interface SsmlProsodyAttributes { + /** pitch - Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n% */ + pitch?: string; + /** rate - Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n% */ + rate?: string; + /** volume - Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ + volume?: string; + } + /** + * Attributes to pass to sayAs + */ + export interface SsmlSayAsAttributes { + /** format - Specify the format of the date when interpret-as is set to date */ + format?: SsmlSayAsFormat; + /** interpret-as - Specify the type of words are spoken */ + "interpret-as"?: SsmlSayAsInterpretAs; + } + /** + * Attributes to pass to sub + */ + export interface SsmlSubAttributes { + /** alias - Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation */ + alias?: string; + } + /** + * Attributes to pass to w + */ + export interface SsmlWAttributes { + /** role - Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning */ + role?: string; + } + /** + * Attributes to pass to break + */ + export interface SsmlBreakAttributes { + /** strength - Set a pause based on strength */ + strength?: SsmlBreakStrength; + /** time - Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms */ + time?: string; + } + /** + * Attributes to pass to emphasis + */ + export interface SsmlEmphasisAttributes { + /** level - Specify the degree of emphasis */ + level?: SsmlEmphasisLevel; + } + /** + * Attributes to pass to lang + */ + export interface SsmlLangAttributes { + /** xml:lang - Specify the language */ + "xml:lang"?: SsmlLangXmlLang; + } + /** + * Attributes to pass to phoneme + */ + export interface SsmlPhonemeAttributes { + /** alphabet - Specify the phonetic alphabet */ + alphabet?: SsmlPhonemeAlphabet; + /** ph - Specifiy the phonetic symbols for pronunciation */ + ph?: string; + } + /** + * Attributes to pass to prosody + */ + export interface SsmlProsodyAttributes { + /** pitch - Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n% */ + pitch?: string; + /** rate - Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n% */ + rate?: string; + /** volume - Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ + volume?: string; + } + /** + * Attributes to pass to sayAs + */ + export interface SsmlSayAsAttributes { + /** format - Specify the format of the date when interpret-as is set to date */ + format?: SsmlSayAsFormat; + /** interpret-as - Specify the type of words are spoken */ + "interpret-as"?: SsmlSayAsInterpretAs; + } + /** + * Attributes to pass to sub + */ + export interface SsmlSubAttributes { + /** alias - Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation */ + alias?: string; + } + /** + * Attributes to pass to w + */ + export interface SsmlWAttributes { + /** role - Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning */ + role?: string; + } + /** + * Attributes to pass to prompt + */ + export interface PromptAttributes { + /** attempt - Current attempt count */ + attempt?: number[]; + /** cardType - Type of the credit card */ + cardType?: PromptCardType[]; + /** errorType - Type of error */ + errorType?: PromptErrorType[]; + /** for - Name of the payment source data element */ + for?: PromptFor; + /** requireMatchingInputs - Require customer to input requested information twice and verify matching. */ + requireMatchingInputs?: boolean; + } + /** + * Attributes to pass to parameter + */ + export interface ParameterAttributes { + /** name - The name of the custom parameter */ + name?: string; + /** value - The value of the custom parameter */ + value?: string; + } + /** + * Attributes to pass to parameter + */ + export interface ParameterAttributes { + /** name - The name of the custom parameter */ + name?: string; + /** value - The value of the custom parameter */ + value?: string; + } + /** + * Attributes to pass to parameter + */ + export interface ParameterAttributes { + /** name - The name of the custom parameter */ + name?: string; + /** value - The value of the custom parameter */ + value?: string; + } + /** + * Attributes to pass to say + */ + export interface SayAttributes { + /** language - Message language */ + language?: SayLanguage; + /** loop - Times to loop message */ + loop?: number; + /** voice - Voice to use */ + voice?: SayVoice; + } + /** + * Attributes to pass to pause + */ + export interface PauseAttributes { + /** length - Length in seconds to pause */ + length?: number; + } + /** + * Attributes to pass to play + */ + export interface PlayAttributes { + /** digits - Play DTMF tones for digits */ + digits?: string; + /** loop - Times to loop media */ + loop?: number; + } + /** + * Attributes to pass to task + */ + export interface TaskAttributes { + /** priority - Task priority */ + priority?: number; + /** timeout - Timeout associated with task */ + timeout?: number; + } + /** + * Attributes to pass to client + */ + export interface ClientAttributes { + /** method - Client URL Method */ + method?: string; + /** statusCallback - Status Callback URL */ + statusCallback?: string; + /** statusCallbackEvent - Events to trigger status callback */ + statusCallbackEvent?: ClientEvent[]; + /** statusCallbackMethod - Status Callback URL Method */ + statusCallbackMethod?: string; + /** url - Client URL */ + url?: string; + } + /** + * Attributes to pass to conference + */ + export interface ConferenceAttributes { + /** beep - Play beep when joining */ + beep?: ConferenceBeep; + /** coach - Call coach */ + coach?: string; + /** endConferenceOnExit - End the conferenceon exit */ + endConferenceOnExit?: boolean; + /** eventCallbackUrl - Event callback URL */ + eventCallbackUrl?: string; + /** jitterBufferSize - Size of jitter buffer for participant */ + jitterBufferSize?: ConferenceJitterBufferSize; + /** maxParticipants - Maximum number of participants */ + maxParticipants?: number; + /** muted - Join the conference muted */ + muted?: boolean; + /** participantLabel - A label for participant */ + participantLabel?: string; + /** record - Record the conference */ + record?: ConferenceRecord; + /** recordingStatusCallback - Recording status callback URL */ + recordingStatusCallback?: string; + /** recordingStatusCallbackEvent - Recording status callback events */ + recordingStatusCallbackEvent?: ConferenceRecordingEvent[]; + /** recordingStatusCallbackMethod - Recording status callback URL method */ + recordingStatusCallbackMethod?: string; + /** region - Conference region */ + region?: ConferenceRegion; + /** startConferenceOnEnter - Start the conference on enter */ + startConferenceOnEnter?: boolean; + /** statusCallback - Status callback URL */ + statusCallback?: string; + /** statusCallbackEvent - Events to call status callback URL */ + statusCallbackEvent?: ConferenceEvent[]; + /** statusCallbackMethod - Status callback URL method */ + statusCallbackMethod?: string; + /** trim - Trim the conference recording */ + trim?: ConferenceTrim; + /** waitMethod - Wait URL method */ + waitMethod?: string; + /** waitUrl - Wait URL */ + waitUrl?: string; + } + /** + * Attributes to pass to number + */ + export interface NumberAttributes { + /** amdStatusCallback - The URL we should call to send amd status information to your application */ + amdStatusCallback?: string; + /** amdStatusCallbackMethod - HTTP Method to use with amd_status_callback */ + amdStatusCallbackMethod?: string; + /** byoc - BYOC trunk SID (Beta) */ + byoc?: string; + /** machineDetection - Enable machine detection or end of greeting detection */ + machineDetection?: string; + /** machineDetectionSilenceTimeout - Number of milliseconds of initial silence */ + machineDetectionSilenceTimeout?: number; + /** machineDetectionSpeechEndThreshold - Number of milliseconds of silence after speech activity */ + machineDetectionSpeechEndThreshold?: number; + /** machineDetectionSpeechThreshold - Number of milliseconds for measuring stick for the length of the speech activity */ + machineDetectionSpeechThreshold?: number; + /** machineDetectionTimeout - Number of seconds to wait for machine detection */ + machineDetectionTimeout?: number; + /** method - TwiML URL method */ + method?: string; + /** sendDigits - DTMF tones to play when the call is answered */ + sendDigits?: string; + /** statusCallback - Status callback URL */ + statusCallback?: string; + /** statusCallbackEvent - Events to call status callback */ + statusCallbackEvent?: NumberEvent[]; + /** statusCallbackMethod - Status callback URL method */ + statusCallbackMethod?: string; + /** url - TwiML URL */ + url?: string; + } + /** + * Attributes to pass to queue + */ + export interface QueueAttributes { + /** method - Action URL method */ + method?: string; + /** postWorkActivitySid - TaskRouter Activity SID */ + postWorkActivitySid?: string; + /** reservationSid - TaskRouter Reservation SID */ + reservationSid?: string; + /** url - Action URL */ + url?: string; + } + /** + * Attributes to pass to sip + */ + export interface SipAttributes { + /** amdStatusCallback - The URL we should call to send amd status information to your application */ + amdStatusCallback?: string; + /** amdStatusCallbackMethod - HTTP Method to use with amd_status_callback */ + amdStatusCallbackMethod?: string; + /** machineDetection - Enable machine detection or end of greeting detection */ + machineDetection?: string; + /** machineDetectionSilenceTimeout - Number of milliseconds of initial silence */ + machineDetectionSilenceTimeout?: number; + /** machineDetectionSpeechEndThreshold - Number of milliseconds of silence after speech activity */ + machineDetectionSpeechEndThreshold?: number; + /** machineDetectionSpeechThreshold - Number of milliseconds for measuring stick for the length of the speech activity */ + machineDetectionSpeechThreshold?: number; + /** machineDetectionTimeout - Number of seconds to wait for machine detection */ + machineDetectionTimeout?: number; + /** method - Action URL method */ + method?: string; + /** password - SIP Password */ + password?: string; + /** statusCallback - Status callback URL */ + statusCallback?: string; + /** statusCallbackEvent - Status callback events */ + statusCallbackEvent?: SipEvent[]; + /** statusCallbackMethod - Status callback URL method */ + statusCallbackMethod?: string; + /** url - Action URL */ + url?: string; + /** username - SIP Username */ + username?: string; + } + /** + * Attributes to pass to application + */ + export interface ApplicationAttributes { + /** copyParentTo - Copy parent call To field to called application side, otherwise use the application sid as To field */ + copyParentTo?: boolean; + /** customerId - Identity of the customer calling application */ + customerId?: string; + /** method - TwiML URL Method */ + method?: string; + /** statusCallback - Status Callback URL */ + statusCallback?: string; + /** statusCallbackEvent - Events to trigger status callback */ + statusCallbackEvent?: ApplicationEvent[]; + /** statusCallbackMethod - Status Callback URL Method */ + statusCallbackMethod?: string; + /** url - TwiML URL */ + url?: string; + } + /** + * Attributes to pass to parameter + */ + export interface ParameterAttributes { + /** name - The name of the custom parameter */ + name?: string; + /** value - The value of the custom parameter */ + value?: string; + } + /** + * Attributes to pass to parameter + */ + export interface ParameterAttributes { + /** name - The name of the custom parameter */ + name?: string; + /** value - The value of the custom parameter */ + value?: string; + } + /** + * Attributes to pass to room + */ + export interface RoomAttributes { + /** participantIdentity - Participant identity when connecting to the Room */ + participantIdentity?: string; + } + /** + * Attributes to pass to stream + */ + export interface StreamAttributes { + /** connectorName - Unique name for Stream Connector */ + connectorName?: string; + /** name - Friendly name given to the Stream */ + name?: string; + /** statusCallback - Status Callback URL */ + statusCallback?: string; + /** statusCallbackMethod - Status Callback URL method */ + statusCallbackMethod?: StreamStatusCallbackMethod; + /** track - Track to be streamed to remote service */ + track?: StreamTrack; + /** url - URL of the remote service where the Stream is routed */ + url?: string; + } + /** + * Attributes to pass to virtualAgent + */ + export interface VirtualAgentAttributes { + /** connectorName - Defines the conversation profile Dialogflow needs to use */ + connectorName?: string; + /** language - Language to be used by Dialogflow to transcribe speech */ + language?: string; + /** sentimentAnalysis - Whether sentiment analysis needs to be enabled or not */ + sentimentAnalysis?: boolean; + /** statusCallback - URL to post status callbacks from Twilio */ + statusCallback?: string; + /** statusCallbackMethod - HTTP method to use when requesting the status callback URL */ + statusCallbackMethod?: string; + } + /** + * Attributes to pass to conversation + */ + export interface ConversationAttributes { + /** inboundAutocreation - Inbound autocreation */ + inboundAutocreation?: boolean; + /** inboundTimeout - Inbound timeout */ + inboundTimeout?: number; + /** method - TwiML URL method */ + method?: string; + /** record - Record */ + record?: ConversationRecord; + /** recordingStatusCallback - Recording status callback URL */ + recordingStatusCallback?: string; + /** recordingStatusCallbackEvent - Recording status callback events */ + recordingStatusCallbackEvent?: ConversationRecordingEvent[]; + /** recordingStatusCallbackMethod - Recording status callback URL method */ + recordingStatusCallbackMethod?: string; + /** routingAssignmentTimeout - Routing assignment timeout */ + routingAssignmentTimeout?: number; + /** serviceInstanceSid - Service instance Sid */ + serviceInstanceSid?: string; + /** statusCallback - Status callback URL */ + statusCallback?: string; + /** statusCallbackEvent - Events to call status callback URL */ + statusCallbackEvent?: ConversationEvent[]; + /** statusCallbackMethod - Status callback URL method */ + statusCallbackMethod?: string; + /** trim - Trim */ + trim?: ConversationTrim; + /** url - TwiML URL */ + url?: string; + } + /** + * Attributes to pass to config + */ + export interface ConfigAttributes { + /** name - The name of the custom config */ + name?: string; + /** value - The value of the custom config */ + value?: string; + } + /** + * Attributes to pass to parameter + */ + export interface ParameterAttributes { + /** name - The name of the custom parameter */ + name?: string; + /** value - The value of the custom parameter */ + value?: string; + } + export class Application extends TwiML { + application: XMLElement; + /** + * TwiML Noun + */ + constructor(application: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param sid - Application sid to dial + */ + applicationSid(sid: string): VoiceResponse.ApplicationSid; + applicationSid(attributes: object, sid: string): VoiceResponse.ApplicationSid; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes?: VoiceResponse.ParameterAttributes): VoiceResponse.Parameter; + } + export class ApplicationSid extends TwiML { + applicationSid: XMLElement; + /** + * TwiML Noun + */ + constructor(applicationSid: XMLElement); + } + export class Autopilot extends TwiML { + autopilot: XMLElement; + /** + * TwiML Noun + */ + constructor(autopilot: XMLElement); + } + export class Client extends TwiML { + client: XMLElement; + /** + * TwiML Noun + */ + constructor(client: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param clientIdentity - Identity of the client to dial + */ + identity(clientIdentity: string): VoiceResponse.Identity; + identity(attributes: object, clientIdentity: string): VoiceResponse.Identity; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes?: VoiceResponse.ParameterAttributes): VoiceResponse.Parameter; + } + export class Conference extends TwiML { + conference: XMLElement; + /** + * TwiML Noun + */ + constructor(conference: XMLElement); + } + export class Config extends TwiML { + config: XMLElement; + /** + * TwiML Noun + */ + constructor(config: XMLElement); + } + export class Connect extends TwiML { + connect: XMLElement; + /** + * TwiML Verb + */ + constructor(connect: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Autopilot assistant sid or unique name + */ + autopilot(name: string): VoiceResponse.Autopilot; + autopilot(attributes: object, name: string): VoiceResponse.Autopilot; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + conversation(attributes?: VoiceResponse.ConversationAttributes): VoiceResponse.Conversation; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Room name + */ + room(name: string): VoiceResponse.Room; + room(attributes: VoiceResponse.RoomAttributes, name: string): VoiceResponse.Room; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + stream(attributes?: VoiceResponse.StreamAttributes): VoiceResponse.Stream; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + virtualAgent(attributes?: VoiceResponse.VirtualAgentAttributes): VoiceResponse.VirtualAgent; + } + export class Conversation extends TwiML { + conversation: XMLElement; + /** + * TwiML Noun + */ + constructor(conversation: XMLElement); + } + export class Dial extends TwiML { + dial: XMLElement; + /** + * TwiML Verb + */ + constructor(dial: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param applicationSid - Application sid + */ + application(applicationSid?: string): VoiceResponse.Application; + application(attributes?: VoiceResponse.ApplicationAttributes, applicationSid?: string): VoiceResponse.Application; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param identity - Client identity + */ + client(identity?: string): VoiceResponse.Client; + client(attributes?: VoiceResponse.ClientAttributes, identity?: string): VoiceResponse.Client; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Conference name + */ + conference(name: string): VoiceResponse.Conference; + conference(attributes: VoiceResponse.ConferenceAttributes, name: string): VoiceResponse.Conference; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param phoneNumber - Phone Number to dial + */ + number(phoneNumber: string): VoiceResponse.Number; + number(attributes: VoiceResponse.NumberAttributes, phoneNumber: string): VoiceResponse.Number; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Queue name + */ + queue(name: string): VoiceResponse.Queue; + queue(attributes: VoiceResponse.QueueAttributes, name: string): VoiceResponse.Queue; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param simSid - SIM SID + */ + sim(simSid: string): VoiceResponse.Sim; + sim(attributes: object, simSid: string): VoiceResponse.Sim; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param sipUrl - SIP URL + */ + sip(sipUrl: string): VoiceResponse.Sip; + sip(attributes: VoiceResponse.SipAttributes, sipUrl: string): VoiceResponse.Sip; + } + export class Echo extends TwiML { + echo: XMLElement; + /** + * TwiML Verb + */ + constructor(echo: XMLElement); + } + export class Enqueue extends TwiML { + enqueue: XMLElement; + /** + * TwiML Noun + */ + constructor(enqueue: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param body - TaskRouter task attributes + */ + task(body: string): VoiceResponse.Task; + task(attributes: VoiceResponse.TaskAttributes, body: string): VoiceResponse.Task; + } + export class Gather extends TwiML { + gather: XMLElement; + /** + * TwiML Verb + */ + constructor(gather: XMLElement); + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + pause(attributes?: VoiceResponse.PauseAttributes): VoiceResponse.Pause; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Media URL + */ + play(url?: string): VoiceResponse.Play; + play(attributes?: VoiceResponse.PlayAttributes, url?: string): VoiceResponse.Play; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param message - Message to say + */ + say(message: string): VoiceResponse.Say; + say(attributes: VoiceResponse.SayAttributes, message: string): VoiceResponse.Say; + } + export class Hangup extends TwiML { + hangup: XMLElement; + /** + * TwiML Verb + */ + constructor(hangup: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes?: VoiceResponse.ParameterAttributes): VoiceResponse.Parameter; + } + export class Identity extends TwiML { + identity: XMLElement; + /** + * TwiML Noun + */ + constructor(identity: XMLElement); + } + export class Leave extends TwiML { + leave: XMLElement; + /** + * TwiML Verb + */ + constructor(leave: XMLElement); + } + export class Number extends TwiML { + number: XMLElement; + /** + * TwiML Noun + */ + constructor(number: XMLElement); + } + export class Parameter extends TwiML { + parameter: XMLElement; + /** + * TwiML Noun + */ + constructor(parameter: XMLElement); + } + export class Pause extends TwiML { + pause: XMLElement; + /** + * TwiML Verb + */ + constructor(pause: XMLElement); + } + export class Pay extends TwiML { + pay: XMLElement; + /** + * Twiml Verb + */ + constructor(pay: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes?: VoiceResponse.ParameterAttributes): VoiceResponse.Parameter; + /** + * Twiml Verb + * + * @param attributes - TwiML attributes + */ + prompt(attributes?: VoiceResponse.PromptAttributes): VoiceResponse.Prompt; + } + export class Play extends TwiML { + play: XMLElement; + /** + * TwiML Verb + */ + constructor(play: XMLElement); + } + export class Prompt extends TwiML { + prompt: XMLElement; + /** + * Twiml Verb + */ + constructor(prompt: XMLElement); + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + pause(attributes?: VoiceResponse.PauseAttributes): VoiceResponse.Pause; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Media URL + */ + play(url?: string): VoiceResponse.Play; + play(attributes?: VoiceResponse.PlayAttributes, url?: string): VoiceResponse.Play; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param message - Message to say + */ + say(message: string): VoiceResponse.Say; + say(attributes: VoiceResponse.SayAttributes, message: string): VoiceResponse.Say; + } + export class Queue extends TwiML { + queue: XMLElement; + /** + * TwiML Noun + */ + constructor(queue: XMLElement); + } + export class Record extends TwiML { + record: XMLElement; + /** + * TwiML Verb + */ + constructor(record: XMLElement); + } + export class Redirect extends TwiML { + redirect: XMLElement; + /** + * TwiML Verb + */ + constructor(redirect: XMLElement); + } + export class Refer extends TwiML { + refer: XMLElement; + /** + * TwiML Verb + */ + constructor(refer: XMLElement); + /** + * TwiML Noun used in + * + * @param attributes - TwiML attributes + * @param sipUrl - SIP URL + */ + sip(sipUrl: string): VoiceResponse.ReferSip; + sip(attributes: object, sipUrl: string): VoiceResponse.ReferSip; + } + export class ReferSip extends TwiML { + referSip: XMLElement; + /** + * TwiML Noun used in + */ + constructor(referSip: XMLElement); + } + export class Reject extends TwiML { + reject: XMLElement; + /** + * TwiML Verb + */ + constructor(reject: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes?: VoiceResponse.ParameterAttributes): VoiceResponse.Parameter; + } + export class Room extends TwiML { + room: XMLElement; + /** + * TwiML Noun + */ + constructor(room: XMLElement); + } + export class Say extends TwiML { + say: XMLElement; + /** + * TwiML Verb + */ + constructor(say: XMLElement); + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes?: VoiceResponse.SsmlBreakAttributes): VoiceResponse.SsmlBreak; + /** + * Emphasizing Words in + * + * @param attributes - TwiML attributes + * @param words - Words to emphasize + */ + emphasis(words: string): VoiceResponse.SsmlEmphasis; + emphasis(attributes: VoiceResponse.SsmlEmphasisAttributes, words: string): VoiceResponse.SsmlEmphasis; + /** + * Specifying Another Language for Specific Words in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + lang(words: string): VoiceResponse.SsmlLang; + lang(attributes: VoiceResponse.SsmlLangAttributes, words: string): VoiceResponse.SsmlLang; + /** + * Adding a Pause Between Paragraphs in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + p(words: string): VoiceResponse.SsmlP; + p(attributes: object, words: string): VoiceResponse.SsmlP; + /** + * Using Phonetic Pronunciation in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + phoneme(words: string): VoiceResponse.SsmlPhoneme; + phoneme(attributes: VoiceResponse.SsmlPhonemeAttributes, words: string): VoiceResponse.SsmlPhoneme; + /** + * Controling Volume, Speaking Rate, and Pitch in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + prosody(words: string): VoiceResponse.SsmlProsody; + prosody(attributes: VoiceResponse.SsmlProsodyAttributes, words: string): VoiceResponse.SsmlProsody; + /** + * Adding A Pause Between Sentences in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + s(words: string): VoiceResponse.SsmlS; + s(attributes: object, words: string): VoiceResponse.SsmlS; + /** + * Controlling How Special Types of Words Are Spoken in + * + * @param attributes - TwiML attributes + * @param words - Words to be interpreted + */ + sayAs(words: string): VoiceResponse.SsmlSayAs; + sayAs(attributes: VoiceResponse.SsmlSayAsAttributes, words: string): VoiceResponse.SsmlSayAs; + /** + * Pronouncing Acronyms and Abbreviations in + * + * @param attributes - TwiML attributes + * @param words - Words to be substituted + */ + sub(words: string): VoiceResponse.SsmlSub; + sub(attributes: VoiceResponse.SsmlSubAttributes, words: string): VoiceResponse.SsmlSub; + /** + * Improving Pronunciation by Specifying Parts of Speech in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + w(words: string): VoiceResponse.SsmlW; + w(attributes: VoiceResponse.SsmlWAttributes, words: string): VoiceResponse.SsmlW; + } + export class Sim extends TwiML { + sim: XMLElement; + /** + * TwiML Noun + */ + constructor(sim: XMLElement); + } + export class Sip extends TwiML { + sip: XMLElement; + /** + * TwiML Noun + */ + constructor(sip: XMLElement); + } + export class Siprec extends TwiML { + siprec: XMLElement; + /** + * TwiML Noun + */ + constructor(siprec: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes?: VoiceResponse.ParameterAttributes): VoiceResponse.Parameter; + } + export class Sms extends TwiML { + sms: XMLElement; + /** + * TwiML Noun + */ + constructor(sms: XMLElement); + } + export class SsmlBreak extends TwiML { + ssmlBreak: XMLElement; + /** + * Adding a Pause in + */ + constructor(ssmlBreak: XMLElement); + } + export class SsmlEmphasis extends TwiML { + ssmlEmphasis: XMLElement; + /** + * Emphasizing Words in + */ + constructor(ssmlEmphasis: XMLElement); + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes?: VoiceResponse.SsmlBreakAttributes): VoiceResponse.SsmlBreak; + /** + * Emphasizing Words in + * + * @param attributes - TwiML attributes + * @param words - Words to emphasize + */ + emphasis(words: string): VoiceResponse.SsmlEmphasis; + emphasis(attributes: VoiceResponse.SsmlEmphasisAttributes, words: string): VoiceResponse.SsmlEmphasis; + /** + * Specifying Another Language for Specific Words in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + lang(words: string): VoiceResponse.SsmlLang; + lang(attributes: VoiceResponse.SsmlLangAttributes, words: string): VoiceResponse.SsmlLang; + /** + * Using Phonetic Pronunciation in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + phoneme(words: string): VoiceResponse.SsmlPhoneme; + phoneme(attributes: VoiceResponse.SsmlPhonemeAttributes, words: string): VoiceResponse.SsmlPhoneme; + /** + * Controling Volume, Speaking Rate, and Pitch in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + prosody(words: string): VoiceResponse.SsmlProsody; + prosody(attributes: VoiceResponse.SsmlProsodyAttributes, words: string): VoiceResponse.SsmlProsody; + /** + * Controlling How Special Types of Words Are Spoken in + * + * @param attributes - TwiML attributes + * @param words - Words to be interpreted + */ + sayAs(words: string): VoiceResponse.SsmlSayAs; + sayAs(attributes: VoiceResponse.SsmlSayAsAttributes, words: string): VoiceResponse.SsmlSayAs; + /** + * Pronouncing Acronyms and Abbreviations in + * + * @param attributes - TwiML attributes + * @param words - Words to be substituted + */ + sub(words: string): VoiceResponse.SsmlSub; + sub(attributes: VoiceResponse.SsmlSubAttributes, words: string): VoiceResponse.SsmlSub; + /** + * Improving Pronunciation by Specifying Parts of Speech in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + w(words: string): VoiceResponse.SsmlW; + w(attributes: VoiceResponse.SsmlWAttributes, words: string): VoiceResponse.SsmlW; + } + export class SsmlLang extends TwiML { + ssmlLang: XMLElement; + /** + * Specifying Another Language for Specific Words in + */ + constructor(ssmlLang: XMLElement); + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes?: VoiceResponse.SsmlBreakAttributes): VoiceResponse.SsmlBreak; + /** + * Emphasizing Words in + * + * @param attributes - TwiML attributes + * @param words - Words to emphasize + */ + emphasis(words: string): VoiceResponse.SsmlEmphasis; + emphasis(attributes: VoiceResponse.SsmlEmphasisAttributes, words: string): VoiceResponse.SsmlEmphasis; + /** + * Specifying Another Language for Specific Words in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + lang(words: string): VoiceResponse.SsmlLang; + lang(attributes: VoiceResponse.SsmlLangAttributes, words: string): VoiceResponse.SsmlLang; + /** + * Adding a Pause Between Paragraphs in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + p(words: string): VoiceResponse.SsmlP; + p(attributes: object, words: string): VoiceResponse.SsmlP; + /** + * Using Phonetic Pronunciation in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + phoneme(words: string): VoiceResponse.SsmlPhoneme; + phoneme(attributes: VoiceResponse.SsmlPhonemeAttributes, words: string): VoiceResponse.SsmlPhoneme; + /** + * Controling Volume, Speaking Rate, and Pitch in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + prosody(words: string): VoiceResponse.SsmlProsody; + prosody(attributes: VoiceResponse.SsmlProsodyAttributes, words: string): VoiceResponse.SsmlProsody; + /** + * Adding A Pause Between Sentences in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + s(words: string): VoiceResponse.SsmlS; + s(attributes: object, words: string): VoiceResponse.SsmlS; + /** + * Controlling How Special Types of Words Are Spoken in + * + * @param attributes - TwiML attributes + * @param words - Words to be interpreted + */ + sayAs(words: string): VoiceResponse.SsmlSayAs; + sayAs(attributes: VoiceResponse.SsmlSayAsAttributes, words: string): VoiceResponse.SsmlSayAs; + /** + * Pronouncing Acronyms and Abbreviations in + * + * @param attributes - TwiML attributes + * @param words - Words to be substituted + */ + sub(words: string): VoiceResponse.SsmlSub; + sub(attributes: VoiceResponse.SsmlSubAttributes, words: string): VoiceResponse.SsmlSub; + /** + * Improving Pronunciation by Specifying Parts of Speech in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + w(words: string): VoiceResponse.SsmlW; + w(attributes: VoiceResponse.SsmlWAttributes, words: string): VoiceResponse.SsmlW; + } + export class SsmlP extends TwiML { + ssmlP: XMLElement; + /** + * Adding a Pause Between Paragraphs in + */ + constructor(ssmlP: XMLElement); + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes?: VoiceResponse.SsmlBreakAttributes): VoiceResponse.SsmlBreak; + /** + * Emphasizing Words in + * + * @param attributes - TwiML attributes + * @param words - Words to emphasize + */ + emphasis(words: string): VoiceResponse.SsmlEmphasis; + emphasis(attributes: VoiceResponse.SsmlEmphasisAttributes, words: string): VoiceResponse.SsmlEmphasis; + /** + * Specifying Another Language for Specific Words in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + lang(words: string): VoiceResponse.SsmlLang; + lang(attributes: VoiceResponse.SsmlLangAttributes, words: string): VoiceResponse.SsmlLang; + /** + * Using Phonetic Pronunciation in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + phoneme(words: string): VoiceResponse.SsmlPhoneme; + phoneme(attributes: VoiceResponse.SsmlPhonemeAttributes, words: string): VoiceResponse.SsmlPhoneme; + /** + * Controling Volume, Speaking Rate, and Pitch in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + prosody(words: string): VoiceResponse.SsmlProsody; + prosody(attributes: VoiceResponse.SsmlProsodyAttributes, words: string): VoiceResponse.SsmlProsody; + /** + * Adding A Pause Between Sentences in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + s(words: string): VoiceResponse.SsmlS; + s(attributes: object, words: string): VoiceResponse.SsmlS; + /** + * Controlling How Special Types of Words Are Spoken in + * + * @param attributes - TwiML attributes + * @param words - Words to be interpreted + */ + sayAs(words: string): VoiceResponse.SsmlSayAs; + sayAs(attributes: VoiceResponse.SsmlSayAsAttributes, words: string): VoiceResponse.SsmlSayAs; + /** + * Pronouncing Acronyms and Abbreviations in + * + * @param attributes - TwiML attributes + * @param words - Words to be substituted + */ + sub(words: string): VoiceResponse.SsmlSub; + sub(attributes: VoiceResponse.SsmlSubAttributes, words: string): VoiceResponse.SsmlSub; + /** + * Improving Pronunciation by Specifying Parts of Speech in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + w(words: string): VoiceResponse.SsmlW; + w(attributes: VoiceResponse.SsmlWAttributes, words: string): VoiceResponse.SsmlW; + } + export class SsmlPhoneme extends TwiML { + ssmlPhoneme: XMLElement; + /** + * Using Phonetic Pronunciation in + */ + constructor(ssmlPhoneme: XMLElement); + } + export class SsmlProsody extends TwiML { + ssmlProsody: XMLElement; + /** + * Controling Volume, Speaking Rate, and Pitch in + */ + constructor(ssmlProsody: XMLElement); + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes?: VoiceResponse.SsmlBreakAttributes): VoiceResponse.SsmlBreak; + /** + * Emphasizing Words in + * + * @param attributes - TwiML attributes + * @param words - Words to emphasize + */ + emphasis(words: string): VoiceResponse.SsmlEmphasis; + emphasis(attributes: VoiceResponse.SsmlEmphasisAttributes, words: string): VoiceResponse.SsmlEmphasis; + /** + * Specifying Another Language for Specific Words in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + lang(words: string): VoiceResponse.SsmlLang; + lang(attributes: VoiceResponse.SsmlLangAttributes, words: string): VoiceResponse.SsmlLang; + /** + * Adding a Pause Between Paragraphs in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + p(words: string): VoiceResponse.SsmlP; + p(attributes: object, words: string): VoiceResponse.SsmlP; + /** + * Using Phonetic Pronunciation in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + phoneme(words: string): VoiceResponse.SsmlPhoneme; + phoneme(attributes: VoiceResponse.SsmlPhonemeAttributes, words: string): VoiceResponse.SsmlPhoneme; + /** + * Controling Volume, Speaking Rate, and Pitch in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + prosody(words: string): VoiceResponse.SsmlProsody; + prosody(attributes: VoiceResponse.SsmlProsodyAttributes, words: string): VoiceResponse.SsmlProsody; + /** + * Adding A Pause Between Sentences in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + s(words: string): VoiceResponse.SsmlS; + s(attributes: object, words: string): VoiceResponse.SsmlS; + /** + * Controlling How Special Types of Words Are Spoken in + * + * @param attributes - TwiML attributes + * @param words - Words to be interpreted + */ + sayAs(words: string): VoiceResponse.SsmlSayAs; + sayAs(attributes: VoiceResponse.SsmlSayAsAttributes, words: string): VoiceResponse.SsmlSayAs; + /** + * Pronouncing Acronyms and Abbreviations in + * + * @param attributes - TwiML attributes + * @param words - Words to be substituted + */ + sub(words: string): VoiceResponse.SsmlSub; + sub(attributes: VoiceResponse.SsmlSubAttributes, words: string): VoiceResponse.SsmlSub; + /** + * Improving Pronunciation by Specifying Parts of Speech in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + w(words: string): VoiceResponse.SsmlW; + w(attributes: VoiceResponse.SsmlWAttributes, words: string): VoiceResponse.SsmlW; + } + export class SsmlS extends TwiML { + ssmlS: XMLElement; + /** + * Adding A Pause Between Sentences in + */ + constructor(ssmlS: XMLElement); + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes?: VoiceResponse.SsmlBreakAttributes): VoiceResponse.SsmlBreak; + /** + * Emphasizing Words in + * + * @param attributes - TwiML attributes + * @param words - Words to emphasize + */ + emphasis(words: string): VoiceResponse.SsmlEmphasis; + emphasis(attributes: VoiceResponse.SsmlEmphasisAttributes, words: string): VoiceResponse.SsmlEmphasis; + /** + * Specifying Another Language for Specific Words in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + lang(words: string): VoiceResponse.SsmlLang; + lang(attributes: VoiceResponse.SsmlLangAttributes, words: string): VoiceResponse.SsmlLang; + /** + * Using Phonetic Pronunciation in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + phoneme(words: string): VoiceResponse.SsmlPhoneme; + phoneme(attributes: VoiceResponse.SsmlPhonemeAttributes, words: string): VoiceResponse.SsmlPhoneme; + /** + * Controling Volume, Speaking Rate, and Pitch in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + prosody(words: string): VoiceResponse.SsmlProsody; + prosody(attributes: VoiceResponse.SsmlProsodyAttributes, words: string): VoiceResponse.SsmlProsody; + /** + * Controlling How Special Types of Words Are Spoken in + * + * @param attributes - TwiML attributes + * @param words - Words to be interpreted + */ + sayAs(words: string): VoiceResponse.SsmlSayAs; + sayAs(attributes: VoiceResponse.SsmlSayAsAttributes, words: string): VoiceResponse.SsmlSayAs; + /** + * Pronouncing Acronyms and Abbreviations in + * + * @param attributes - TwiML attributes + * @param words - Words to be substituted + */ + sub(words: string): VoiceResponse.SsmlSub; + sub(attributes: VoiceResponse.SsmlSubAttributes, words: string): VoiceResponse.SsmlSub; + /** + * Improving Pronunciation by Specifying Parts of Speech in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + w(words: string): VoiceResponse.SsmlW; + w(attributes: VoiceResponse.SsmlWAttributes, words: string): VoiceResponse.SsmlW; + } + export class SsmlSayAs extends TwiML { + ssmlSayAs: XMLElement; + /** + * Controlling How Special Types of Words Are Spoken in + */ + constructor(ssmlSayAs: XMLElement); + } + export class SsmlSub extends TwiML { + ssmlSub: XMLElement; + /** + * Pronouncing Acronyms and Abbreviations in + */ + constructor(ssmlSub: XMLElement); + } + export class SsmlW extends TwiML { + ssmlW: XMLElement; + /** + * Improving Pronunciation by Specifying Parts of Speech in + */ + constructor(ssmlW: XMLElement); + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes?: VoiceResponse.SsmlBreakAttributes): VoiceResponse.SsmlBreak; + /** + * Emphasizing Words in + * + * @param attributes - TwiML attributes + * @param words - Words to emphasize + */ + emphasis(words: string): VoiceResponse.SsmlEmphasis; + emphasis(attributes: VoiceResponse.SsmlEmphasisAttributes, words: string): VoiceResponse.SsmlEmphasis; + /** + * Using Phonetic Pronunciation in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + phoneme(words: string): VoiceResponse.SsmlPhoneme; + phoneme(attributes: VoiceResponse.SsmlPhonemeAttributes, words: string): VoiceResponse.SsmlPhoneme; + /** + * Controling Volume, Speaking Rate, and Pitch in + * + * @param attributes - TwiML attributes + * @param words - Words to speak + */ + prosody(words: string): VoiceResponse.SsmlProsody; + prosody(attributes: VoiceResponse.SsmlProsodyAttributes, words: string): VoiceResponse.SsmlProsody; + /** + * Controlling How Special Types of Words Are Spoken in + * + * @param attributes - TwiML attributes + * @param words - Words to be interpreted + */ + sayAs(words: string): VoiceResponse.SsmlSayAs; + sayAs(attributes: VoiceResponse.SsmlSayAsAttributes, words: string): VoiceResponse.SsmlSayAs; + /** + * Pronouncing Acronyms and Abbreviations in + * + * @param attributes - TwiML attributes + * @param words - Words to be substituted + */ + sub(words: string): VoiceResponse.SsmlSub; + sub(attributes: VoiceResponse.SsmlSubAttributes, words: string): VoiceResponse.SsmlSub; + } + export class Start extends TwiML { + start: XMLElement; + /** + * TwiML Verb + */ + constructor(start: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + siprec(attributes?: VoiceResponse.SiprecAttributes): VoiceResponse.Siprec; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + stream(attributes?: VoiceResponse.StreamAttributes): VoiceResponse.Stream; + } + export class Stop extends TwiML { + stop: XMLElement; + /** + * TwiML Verb + */ + constructor(stop: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + siprec(attributes?: VoiceResponse.SiprecAttributes): VoiceResponse.Siprec; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + stream(attributes?: VoiceResponse.StreamAttributes): VoiceResponse.Stream; + } + export class Stream extends TwiML { + stream: XMLElement; + /** + * TwiML Noun + */ + constructor(stream: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes?: VoiceResponse.ParameterAttributes): VoiceResponse.Parameter; + } + export class Task extends TwiML { + task: XMLElement; + /** + * TwiML Noun + */ + constructor(task: XMLElement); + } + export class VirtualAgent extends TwiML { + virtualAgent: XMLElement; + /** + * TwiML Noun + */ + constructor(virtualAgent: XMLElement); + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + config(attributes?: VoiceResponse.ConfigAttributes): VoiceResponse.Config; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes?: VoiceResponse.ParameterAttributes): VoiceResponse.Parameter; + } + export {}; +} +export = VoiceResponse; diff --git a/node_modules/twilio/lib/twiml/VoiceResponse.js b/node_modules/twilio/lib/twiml/VoiceResponse.js new file mode 100644 index 00000000..7af83813 --- /dev/null +++ b/node_modules/twilio/lib/twiml/VoiceResponse.js @@ -0,0 +1,1433 @@ +"use strict"; +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const TwiML_1 = __importDefault(require("./TwiML")); +class VoiceResponse extends TwiML_1.default { + /** + * TwiML for Voice + */ + constructor() { + super(); + this._propertyName = "response"; + } + /** + * Comments in + * + * @param comment - XML Comment + */ + comment(comment) { + return this.response.comment(comment); + } + /** + * Comments after + * + * @param comment - XML Comment + */ + commentAfter(comment) { + return this.response.commentAfter(comment); + } + /** + * Comments before + * + * @param comment - XML Comment + */ + commentBefore(comment) { + return this.response.commentBefore(comment); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + connect(attributes) { + return new VoiceResponse.Connect(this.response.ele("Connect", attributes)); + } + dial(attributes, number) { + if (typeof attributes === "string") { + number = attributes; + attributes = {}; + } + return new VoiceResponse.Dial(this.response.ele("Dial", attributes, number)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + echo(attributes) { + return new VoiceResponse.Echo(this.response.ele("Echo", attributes)); + } + enqueue(attributes, name) { + if (typeof attributes === "string") { + name = attributes; + attributes = {}; + } + return new VoiceResponse.Enqueue(this.response.ele("Enqueue", attributes, name)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + gather(attributes) { + return new VoiceResponse.Gather(this.response.ele("Gather", attributes)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + hangup(attributes) { + return new VoiceResponse.Hangup(this.response.ele("Hangup", attributes)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + leave(attributes) { + return new VoiceResponse.Leave(this.response.ele("Leave", attributes)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + pause(attributes) { + return new VoiceResponse.Pause(this.response.ele("Pause", attributes)); + } + /** + * Twiml Verb + * + * @param attributes - TwiML attributes + */ + pay(attributes) { + return new VoiceResponse.Pay(this.response.ele("Pay", attributes)); + } + play(attributes, url) { + if (typeof attributes === "string") { + url = attributes; + attributes = {}; + } + return new VoiceResponse.Play(this.response.ele("Play", attributes, url)); + } + /** + * Twiml Verb + * + * @param attributes - TwiML attributes + */ + prompt(attributes) { + return new VoiceResponse.Prompt(this.response.ele("Prompt", attributes)); + } + queue(attributes, name) { + if (typeof attributes === "string") { + name = attributes; + attributes = {}; + } + return new VoiceResponse.Queue(this.response.ele("Queue", attributes, name)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + record(attributes) { + return new VoiceResponse.Record(this.response.ele("Record", attributes)); + } + redirect(attributes, url) { + if (typeof attributes === "string") { + url = attributes; + attributes = {}; + } + return new VoiceResponse.Redirect(this.response.ele("Redirect", attributes, url)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + refer(attributes) { + return new VoiceResponse.Refer(this.response.ele("Refer", attributes)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + reject(attributes) { + return new VoiceResponse.Reject(this.response.ele("Reject", attributes)); + } + say(attributes, message) { + if (typeof attributes === "string") { + message = attributes; + attributes = {}; + } + return new VoiceResponse.Say(this.response.ele("Say", attributes, message)); + } + sms(attributes, message) { + if (typeof attributes === "string") { + message = attributes; + attributes = {}; + } + return new VoiceResponse.Sms(this.response.ele("Sms", attributes, message)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + start(attributes) { + return new VoiceResponse.Start(this.response.ele("Start", attributes)); + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + stop(attributes) { + return new VoiceResponse.Stop(this.response.ele("Stop", attributes)); + } +} +(function (VoiceResponse) { + class Application extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(application) { + super(); + this.application = application; + this._propertyName = "application"; + } + applicationSid(attributes, sid) { + if (typeof attributes === "string") { + sid = attributes; + attributes = {}; + } + return new VoiceResponse.ApplicationSid(this.application.ele("ApplicationSid", attributes, sid)); + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes) { + return new VoiceResponse.Parameter(this.application.ele("Parameter", attributes)); + } + } + VoiceResponse.Application = Application; + class ApplicationSid extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(applicationSid) { + super(); + this.applicationSid = applicationSid; + this._propertyName = "applicationSid"; + } + } + VoiceResponse.ApplicationSid = ApplicationSid; + class Autopilot extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(autopilot) { + super(); + this.autopilot = autopilot; + this._propertyName = "autopilot"; + } + } + VoiceResponse.Autopilot = Autopilot; + class Client extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(client) { + super(); + this.client = client; + this._propertyName = "client"; + } + identity(attributes, clientIdentity) { + if (typeof attributes === "string") { + clientIdentity = attributes; + attributes = {}; + } + return new VoiceResponse.Identity(this.client.ele("Identity", attributes, clientIdentity)); + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes) { + return new VoiceResponse.Parameter(this.client.ele("Parameter", attributes)); + } + } + VoiceResponse.Client = Client; + class Conference extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(conference) { + super(); + this.conference = conference; + this._propertyName = "conference"; + } + } + VoiceResponse.Conference = Conference; + class Config extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(config) { + super(); + this.config = config; + this._propertyName = "config"; + } + } + VoiceResponse.Config = Config; + class Connect extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(connect) { + super(); + this.connect = connect; + this._propertyName = "connect"; + } + autopilot(attributes, name) { + if (typeof attributes === "string") { + name = attributes; + attributes = {}; + } + return new VoiceResponse.Autopilot(this.connect.ele("Autopilot", attributes, name)); + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + conversation(attributes) { + return new VoiceResponse.Conversation(this.connect.ele("Conversation", attributes)); + } + room(attributes, name) { + if (typeof attributes === "string") { + name = attributes; + attributes = {}; + } + return new VoiceResponse.Room(this.connect.ele("Room", attributes, name)); + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + stream(attributes) { + return new VoiceResponse.Stream(this.connect.ele("Stream", attributes)); + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + virtualAgent(attributes) { + return new VoiceResponse.VirtualAgent(this.connect.ele("VirtualAgent", attributes)); + } + } + VoiceResponse.Connect = Connect; + class Conversation extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(conversation) { + super(); + this.conversation = conversation; + this._propertyName = "conversation"; + } + } + VoiceResponse.Conversation = Conversation; + class Dial extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(dial) { + super(); + this.dial = dial; + this._propertyName = "dial"; + } + application(attributes, applicationSid) { + if (typeof attributes === "string") { + applicationSid = attributes; + attributes = {}; + } + return new VoiceResponse.Application(this.dial.ele("Application", attributes, applicationSid)); + } + client(attributes, identity) { + if (typeof attributes === "string") { + identity = attributes; + attributes = {}; + } + return new VoiceResponse.Client(this.dial.ele("Client", attributes, identity)); + } + conference(attributes, name) { + if (typeof attributes === "string") { + name = attributes; + attributes = {}; + } + return new VoiceResponse.Conference(this.dial.ele("Conference", attributes, name)); + } + number(attributes, phoneNumber) { + if (typeof attributes === "string") { + phoneNumber = attributes; + attributes = {}; + } + return new VoiceResponse.Number(this.dial.ele("Number", attributes, phoneNumber)); + } + queue(attributes, name) { + if (typeof attributes === "string") { + name = attributes; + attributes = {}; + } + return new VoiceResponse.Queue(this.dial.ele("Queue", attributes, name)); + } + sim(attributes, simSid) { + if (typeof attributes === "string") { + simSid = attributes; + attributes = {}; + } + return new VoiceResponse.Sim(this.dial.ele("Sim", attributes, simSid)); + } + sip(attributes, sipUrl) { + if (typeof attributes === "string") { + sipUrl = attributes; + attributes = {}; + } + return new VoiceResponse.Sip(this.dial.ele("Sip", attributes, sipUrl)); + } + } + VoiceResponse.Dial = Dial; + class Echo extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(echo) { + super(); + this.echo = echo; + this._propertyName = "echo"; + } + } + VoiceResponse.Echo = Echo; + class Enqueue extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(enqueue) { + super(); + this.enqueue = enqueue; + this._propertyName = "enqueue"; + } + task(attributes, body) { + if (typeof attributes === "string") { + body = attributes; + attributes = {}; + } + return new VoiceResponse.Task(this.enqueue.ele("Task", attributes, body)); + } + } + VoiceResponse.Enqueue = Enqueue; + class Gather extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(gather) { + super(); + this.gather = gather; + this._propertyName = "gather"; + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + pause(attributes) { + return new VoiceResponse.Pause(this.gather.ele("Pause", attributes)); + } + play(attributes, url) { + if (typeof attributes === "string") { + url = attributes; + attributes = {}; + } + return new VoiceResponse.Play(this.gather.ele("Play", attributes, url)); + } + say(attributes, message) { + if (typeof attributes === "string") { + message = attributes; + attributes = {}; + } + return new VoiceResponse.Say(this.gather.ele("Say", attributes, message)); + } + } + VoiceResponse.Gather = Gather; + class Hangup extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(hangup) { + super(); + this.hangup = hangup; + this._propertyName = "hangup"; + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes) { + return new VoiceResponse.Parameter(this.hangup.ele("Parameter", attributes)); + } + } + VoiceResponse.Hangup = Hangup; + class Identity extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(identity) { + super(); + this.identity = identity; + this._propertyName = "identity"; + } + } + VoiceResponse.Identity = Identity; + class Leave extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(leave) { + super(); + this.leave = leave; + this._propertyName = "leave"; + } + } + VoiceResponse.Leave = Leave; + class Number extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(number) { + super(); + this.number = number; + this._propertyName = "number"; + } + } + VoiceResponse.Number = Number; + class Parameter extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(parameter) { + super(); + this.parameter = parameter; + this._propertyName = "parameter"; + } + } + VoiceResponse.Parameter = Parameter; + class Pause extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(pause) { + super(); + this.pause = pause; + this._propertyName = "pause"; + } + } + VoiceResponse.Pause = Pause; + class Pay extends TwiML_1.default { + /** + * Twiml Verb + */ + constructor(pay) { + super(); + this.pay = pay; + this._propertyName = "pay"; + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes) { + return new VoiceResponse.Parameter(this.pay.ele("Parameter", attributes)); + } + /** + * Twiml Verb + * + * @param attributes - TwiML attributes + */ + prompt(attributes) { + return new VoiceResponse.Prompt(this.pay.ele("Prompt", attributes)); + } + } + VoiceResponse.Pay = Pay; + class Play extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(play) { + super(); + this.play = play; + this._propertyName = "play"; + } + } + VoiceResponse.Play = Play; + class Prompt extends TwiML_1.default { + /** + * Twiml Verb + */ + constructor(prompt) { + super(); + this.prompt = prompt; + this._propertyName = "prompt"; + } + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + pause(attributes) { + return new VoiceResponse.Pause(this.prompt.ele("Pause", attributes)); + } + play(attributes, url) { + if (typeof attributes === "string") { + url = attributes; + attributes = {}; + } + return new VoiceResponse.Play(this.prompt.ele("Play", attributes, url)); + } + say(attributes, message) { + if (typeof attributes === "string") { + message = attributes; + attributes = {}; + } + return new VoiceResponse.Say(this.prompt.ele("Say", attributes, message)); + } + } + VoiceResponse.Prompt = Prompt; + class Queue extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(queue) { + super(); + this.queue = queue; + this._propertyName = "queue"; + } + } + VoiceResponse.Queue = Queue; + class Record extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(record) { + super(); + this.record = record; + this._propertyName = "record"; + } + } + VoiceResponse.Record = Record; + class Redirect extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(redirect) { + super(); + this.redirect = redirect; + this._propertyName = "redirect"; + } + } + VoiceResponse.Redirect = Redirect; + class Refer extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(refer) { + super(); + this.refer = refer; + this._propertyName = "refer"; + } + sip(attributes, sipUrl) { + if (typeof attributes === "string") { + sipUrl = attributes; + attributes = {}; + } + return new VoiceResponse.ReferSip(this.refer.ele("Sip", attributes, sipUrl)); + } + } + VoiceResponse.Refer = Refer; + class ReferSip extends TwiML_1.default { + /** + * TwiML Noun used in + */ + constructor(referSip) { + super(); + this.referSip = referSip; + this._propertyName = "referSip"; + } + } + VoiceResponse.ReferSip = ReferSip; + class Reject extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(reject) { + super(); + this.reject = reject; + this._propertyName = "reject"; + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes) { + return new VoiceResponse.Parameter(this.reject.ele("Parameter", attributes)); + } + } + VoiceResponse.Reject = Reject; + class Room extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(room) { + super(); + this.room = room; + this._propertyName = "room"; + } + } + VoiceResponse.Room = Room; + class Say extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(say) { + super(); + this.say = say; + this._propertyName = "say"; + } + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes) { + return new VoiceResponse.SsmlBreak(this.say.ele("break", attributes)); + } + emphasis(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlEmphasis(this.say.ele("emphasis", attributes, words)); + } + lang(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlLang(this.say.ele("lang", attributes, words)); + } + p(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlP(this.say.ele("p", attributes, words)); + } + phoneme(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlPhoneme(this.say.ele("phoneme", attributes, words)); + } + prosody(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlProsody(this.say.ele("prosody", attributes, words)); + } + s(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlS(this.say.ele("s", attributes, words)); + } + sayAs(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSayAs(this.say.ele("say-as", attributes, words)); + } + sub(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSub(this.say.ele("sub", attributes, words)); + } + w(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlW(this.say.ele("w", attributes, words)); + } + } + VoiceResponse.Say = Say; + class Sim extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(sim) { + super(); + this.sim = sim; + this._propertyName = "sim"; + } + } + VoiceResponse.Sim = Sim; + class Sip extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(sip) { + super(); + this.sip = sip; + this._propertyName = "sip"; + } + } + VoiceResponse.Sip = Sip; + class Siprec extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(siprec) { + super(); + this.siprec = siprec; + this._propertyName = "siprec"; + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes) { + return new VoiceResponse.Parameter(this.siprec.ele("Parameter", attributes)); + } + } + VoiceResponse.Siprec = Siprec; + class Sms extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(sms) { + super(); + this.sms = sms; + this._propertyName = "sms"; + } + } + VoiceResponse.Sms = Sms; + class SsmlBreak extends TwiML_1.default { + /** + * Adding a Pause in + */ + constructor(ssmlBreak) { + super(); + this.ssmlBreak = ssmlBreak; + this._propertyName = "ssmlBreak"; + } + } + VoiceResponse.SsmlBreak = SsmlBreak; + class SsmlEmphasis extends TwiML_1.default { + /** + * Emphasizing Words in + */ + constructor(ssmlEmphasis) { + super(); + this.ssmlEmphasis = ssmlEmphasis; + this._propertyName = "ssmlEmphasis"; + } + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes) { + return new VoiceResponse.SsmlBreak(this.ssmlEmphasis.ele("break", attributes)); + } + emphasis(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlEmphasis(this.ssmlEmphasis.ele("emphasis", attributes, words)); + } + lang(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlLang(this.ssmlEmphasis.ele("lang", attributes, words)); + } + phoneme(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlPhoneme(this.ssmlEmphasis.ele("phoneme", attributes, words)); + } + prosody(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlProsody(this.ssmlEmphasis.ele("prosody", attributes, words)); + } + sayAs(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSayAs(this.ssmlEmphasis.ele("say-as", attributes, words)); + } + sub(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSub(this.ssmlEmphasis.ele("sub", attributes, words)); + } + w(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlW(this.ssmlEmphasis.ele("w", attributes, words)); + } + } + VoiceResponse.SsmlEmphasis = SsmlEmphasis; + class SsmlLang extends TwiML_1.default { + /** + * Specifying Another Language for Specific Words in + */ + constructor(ssmlLang) { + super(); + this.ssmlLang = ssmlLang; + this._propertyName = "ssmlLang"; + } + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes) { + return new VoiceResponse.SsmlBreak(this.ssmlLang.ele("break", attributes)); + } + emphasis(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlEmphasis(this.ssmlLang.ele("emphasis", attributes, words)); + } + lang(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlLang(this.ssmlLang.ele("lang", attributes, words)); + } + p(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlP(this.ssmlLang.ele("p", attributes, words)); + } + phoneme(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlPhoneme(this.ssmlLang.ele("phoneme", attributes, words)); + } + prosody(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlProsody(this.ssmlLang.ele("prosody", attributes, words)); + } + s(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlS(this.ssmlLang.ele("s", attributes, words)); + } + sayAs(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSayAs(this.ssmlLang.ele("say-as", attributes, words)); + } + sub(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSub(this.ssmlLang.ele("sub", attributes, words)); + } + w(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlW(this.ssmlLang.ele("w", attributes, words)); + } + } + VoiceResponse.SsmlLang = SsmlLang; + class SsmlP extends TwiML_1.default { + /** + * Adding a Pause Between Paragraphs in + */ + constructor(ssmlP) { + super(); + this.ssmlP = ssmlP; + this._propertyName = "ssmlP"; + } + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes) { + return new VoiceResponse.SsmlBreak(this.ssmlP.ele("break", attributes)); + } + emphasis(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlEmphasis(this.ssmlP.ele("emphasis", attributes, words)); + } + lang(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlLang(this.ssmlP.ele("lang", attributes, words)); + } + phoneme(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlPhoneme(this.ssmlP.ele("phoneme", attributes, words)); + } + prosody(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlProsody(this.ssmlP.ele("prosody", attributes, words)); + } + s(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlS(this.ssmlP.ele("s", attributes, words)); + } + sayAs(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSayAs(this.ssmlP.ele("say-as", attributes, words)); + } + sub(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSub(this.ssmlP.ele("sub", attributes, words)); + } + w(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlW(this.ssmlP.ele("w", attributes, words)); + } + } + VoiceResponse.SsmlP = SsmlP; + class SsmlPhoneme extends TwiML_1.default { + /** + * Using Phonetic Pronunciation in + */ + constructor(ssmlPhoneme) { + super(); + this.ssmlPhoneme = ssmlPhoneme; + this._propertyName = "ssmlPhoneme"; + } + } + VoiceResponse.SsmlPhoneme = SsmlPhoneme; + class SsmlProsody extends TwiML_1.default { + /** + * Controling Volume, Speaking Rate, and Pitch in + */ + constructor(ssmlProsody) { + super(); + this.ssmlProsody = ssmlProsody; + this._propertyName = "ssmlProsody"; + } + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes) { + return new VoiceResponse.SsmlBreak(this.ssmlProsody.ele("break", attributes)); + } + emphasis(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlEmphasis(this.ssmlProsody.ele("emphasis", attributes, words)); + } + lang(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlLang(this.ssmlProsody.ele("lang", attributes, words)); + } + p(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlP(this.ssmlProsody.ele("p", attributes, words)); + } + phoneme(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlPhoneme(this.ssmlProsody.ele("phoneme", attributes, words)); + } + prosody(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlProsody(this.ssmlProsody.ele("prosody", attributes, words)); + } + s(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlS(this.ssmlProsody.ele("s", attributes, words)); + } + sayAs(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSayAs(this.ssmlProsody.ele("say-as", attributes, words)); + } + sub(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSub(this.ssmlProsody.ele("sub", attributes, words)); + } + w(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlW(this.ssmlProsody.ele("w", attributes, words)); + } + } + VoiceResponse.SsmlProsody = SsmlProsody; + class SsmlS extends TwiML_1.default { + /** + * Adding A Pause Between Sentences in + */ + constructor(ssmlS) { + super(); + this.ssmlS = ssmlS; + this._propertyName = "ssmlS"; + } + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes) { + return new VoiceResponse.SsmlBreak(this.ssmlS.ele("break", attributes)); + } + emphasis(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlEmphasis(this.ssmlS.ele("emphasis", attributes, words)); + } + lang(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlLang(this.ssmlS.ele("lang", attributes, words)); + } + phoneme(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlPhoneme(this.ssmlS.ele("phoneme", attributes, words)); + } + prosody(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlProsody(this.ssmlS.ele("prosody", attributes, words)); + } + sayAs(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSayAs(this.ssmlS.ele("say-as", attributes, words)); + } + sub(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSub(this.ssmlS.ele("sub", attributes, words)); + } + w(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlW(this.ssmlS.ele("w", attributes, words)); + } + } + VoiceResponse.SsmlS = SsmlS; + class SsmlSayAs extends TwiML_1.default { + /** + * Controlling How Special Types of Words Are Spoken in + */ + constructor(ssmlSayAs) { + super(); + this.ssmlSayAs = ssmlSayAs; + this._propertyName = "ssmlSayAs"; + } + } + VoiceResponse.SsmlSayAs = SsmlSayAs; + class SsmlSub extends TwiML_1.default { + /** + * Pronouncing Acronyms and Abbreviations in + */ + constructor(ssmlSub) { + super(); + this.ssmlSub = ssmlSub; + this._propertyName = "ssmlSub"; + } + } + VoiceResponse.SsmlSub = SsmlSub; + class SsmlW extends TwiML_1.default { + /** + * Improving Pronunciation by Specifying Parts of Speech in + */ + constructor(ssmlW) { + super(); + this.ssmlW = ssmlW; + this._propertyName = "ssmlW"; + } + /** + * Adding a Pause in + * + * @param attributes - TwiML attributes + */ + break(attributes) { + return new VoiceResponse.SsmlBreak(this.ssmlW.ele("break", attributes)); + } + emphasis(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlEmphasis(this.ssmlW.ele("emphasis", attributes, words)); + } + phoneme(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlPhoneme(this.ssmlW.ele("phoneme", attributes, words)); + } + prosody(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlProsody(this.ssmlW.ele("prosody", attributes, words)); + } + sayAs(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSayAs(this.ssmlW.ele("say-as", attributes, words)); + } + sub(attributes, words) { + if (typeof attributes === "string") { + words = attributes; + attributes = {}; + } + return new VoiceResponse.SsmlSub(this.ssmlW.ele("sub", attributes, words)); + } + } + VoiceResponse.SsmlW = SsmlW; + class Start extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(start) { + super(); + this.start = start; + this._propertyName = "start"; + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + siprec(attributes) { + return new VoiceResponse.Siprec(this.start.ele("Siprec", attributes)); + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + stream(attributes) { + return new VoiceResponse.Stream(this.start.ele("Stream", attributes)); + } + } + VoiceResponse.Start = Start; + class Stop extends TwiML_1.default { + /** + * TwiML Verb + */ + constructor(stop) { + super(); + this.stop = stop; + this._propertyName = "stop"; + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + siprec(attributes) { + return new VoiceResponse.Siprec(this.stop.ele("Siprec", attributes)); + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + stream(attributes) { + return new VoiceResponse.Stream(this.stop.ele("Stream", attributes)); + } + } + VoiceResponse.Stop = Stop; + class Stream extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(stream) { + super(); + this.stream = stream; + this._propertyName = "stream"; + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes) { + return new VoiceResponse.Parameter(this.stream.ele("Parameter", attributes)); + } + } + VoiceResponse.Stream = Stream; + class Task extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(task) { + super(); + this.task = task; + this._propertyName = "task"; + } + } + VoiceResponse.Task = Task; + class VirtualAgent extends TwiML_1.default { + /** + * TwiML Noun + */ + constructor(virtualAgent) { + super(); + this.virtualAgent = virtualAgent; + this._propertyName = "virtualAgent"; + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + config(attributes) { + return new VoiceResponse.Config(this.virtualAgent.ele("Config", attributes)); + } + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + */ + parameter(attributes) { + return new VoiceResponse.Parameter(this.virtualAgent.ele("Parameter", attributes)); + } + } + VoiceResponse.VirtualAgent = VirtualAgent; +})(VoiceResponse || (VoiceResponse = {})); +module.exports = VoiceResponse; diff --git a/node_modules/twilio/lib/webhooks/webhooks.d.ts b/node_modules/twilio/lib/webhooks/webhooks.d.ts new file mode 100644 index 00000000..98133aaf --- /dev/null +++ b/node_modules/twilio/lib/webhooks/webhooks.d.ts @@ -0,0 +1,136 @@ +/// +/// +import { IncomingHttpHeaders } from "http2"; +export interface Request { + protocol: string; + header(name: string): string | undefined; + headers: IncomingHttpHeaders; + originalUrl: string; + rawBody?: any; + body: any; +} +export interface RequestValidatorOptions { + /** + * The full URL (with query string) you used to configure the webhook with Twilio - overrides host/protocol options + */ + url?: string; + /** + * Manually specify the host name used by Twilio in a number's webhook config + */ + host?: string; + /** + * Manually specify the protocol used by Twilio in a number's webhook config + */ + protocol?: string; +} +export interface WebhookOptions { + /** + * Whether or not the middleware should validate the request + * came from Twilio. Default true. If the request does not originate from + * Twilio, we will return a text body and a 403. If there is no configured + * auth token and validate=true, this is an error condition, so we will return + * a 500. + */ + validate?: boolean; + /** + * Add helpers to the response object to improve support for XML (TwiML) rendering. Default true. + */ + includeHelpers?: boolean; + /** + * The full URL (with query string) you used to configure the webhook with Twilio - overrides host/protocol options + */ + url?: string; + /** + * Manually specify the host name used by Twilio in a number's webhook config + */ + host?: string; + /** + * Manually specify the protocol used by Twilio in a number's webhook config + */ + protocol?: string; + /** + * Authentication token + */ + authToken?: string; +} +/** + Utility function to get the expected signature for a given request + + @param authToken - The auth token, as seen in the Twilio portal + @param url - The full URL (with query string) you configured to handle + this request + @param params - the parameters sent with this request + @returns signature + */ +export declare function getExpectedTwilioSignature(authToken: string, url: string, params: Record): string; +/** + Utility function to get the expected body hash for a given request's body + + @param body - The plain-text body of the request + */ +export declare function getExpectedBodyHash(body: string): string; +/** + Utility function to validate an incoming request is indeed from Twilio + + @param authToken - The auth token, as seen in the Twilio portal + @param twilioHeader - The value of the X-Twilio-Signature header from the request + @param url - The full URL (with query string) you configured to handle this request + @param params - the parameters sent with this request + @returns valid + */ +export declare function validateRequest(authToken: string, twilioHeader: string, url: string, params: Record): boolean; +export declare function validateBody(body: string, bodyHash: any[] | string | Buffer): boolean; +/** + Utility function to validate an incoming request is indeed from Twilio. This also validates + the request body against the bodySHA256 post parameter. + + @param authToken - The auth token, as seen in the Twilio portal + @param twilioHeader - The value of the X-Twilio-Signature header from the request + @param url - The full URL (with query string) you configured to handle this request + @param body - The body of the request + @returns valid + */ +export declare function validateRequestWithBody(authToken: string, twilioHeader: string, url: string, body: string): boolean; +/** + Utility function to validate an incoming request is indeed from Twilio. + adapted from https://github.com/crabasa/twiliosig + + @param request - A request object (based on Express implementation http://expressjs.com/api.html#req.params) + @param authToken - The auth token, as seen in the Twilio portal + @param opts - options for request validation: + -> url: The full URL (with query string) you used to configure the webhook with Twilio - overrides host/protocol options + -> host: manually specify the host name used by Twilio in a number's webhook config + -> protocol: manually specify the protocol used by Twilio in a number's webhook config + */ +export declare function validateIncomingRequest(request: Request, authToken: string, opts?: RequestValidatorOptions): boolean; +export declare function validateExpressRequest(request: Request, authToken: string, opts?: RequestValidatorOptions): boolean; +/** +Express middleware to accompany a Twilio webhook. Provides Twilio +request validation, and makes the response a little more friendly for our +TwiML generator. Request validation requires the express.urlencoded middleware +to have been applied (e.g. app.use(express.urlencoded()); in your app config). + +Options: +- validate: {Boolean} whether or not the middleware should validate the request + came from Twilio. Default true. If the request does not originate from + Twilio, we will return a text body and a 403. If there is no configured + auth token and validate=true, this is an error condition, so we will return + a 500. +- host: manually specify the host name used by Twilio in a number's webhook config +- protocol: manually specify the protocol used by Twilio in a number's webhook config +- url: The full URL (with query string) you used to configure the webhook with Twilio - overrides host/protocol options + +Returns a middleware function. + +Examples: +var webhookMiddleware = twilio.webhook(); +var webhookMiddleware = twilio.webhook('asdha9dhjasd'); //init with auth token +var webhookMiddleware = twilio.webhook({ + validate:false // don't attempt request validation +}); +var webhookMiddleware = twilio.webhook({ + host: 'hook.twilio.com', + protocol: 'https' +}); + */ +export declare function webhook(opts?: string | WebhookOptions, authToken?: string | WebhookOptions): (req: any, res: any, next: any) => void; diff --git a/node_modules/twilio/lib/webhooks/webhooks.js b/node_modules/twilio/lib/webhooks/webhooks.js new file mode 100644 index 00000000..e8f3dcdf --- /dev/null +++ b/node_modules/twilio/lib/webhooks/webhooks.js @@ -0,0 +1,302 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webhook = exports.validateExpressRequest = exports.validateIncomingRequest = exports.validateRequestWithBody = exports.validateBody = exports.validateRequest = exports.getExpectedBodyHash = exports.getExpectedTwilioSignature = void 0; +const scmp = require("scmp"); +const crypto_1 = __importDefault(require("crypto")); +const url_1 = __importDefault(require("url")); +const url_parse_1 = __importDefault(require("url-parse")); +/** + * Utility function to construct the URL string, since Node.js url library won't include standard port numbers + * + * @param parsedUrl - The parsed url object that Twilio requested on your server + * @returns URL with standard port number included + */ +function buildUrlWithStandardPort(parsedUrl) { + let url = ""; + const port = parsedUrl.protocol === "https:" ? ":443" : ":80"; + url += parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + url += parsedUrl.username; + url += parsedUrl.password ? ":" + parsedUrl.password : ""; + url += parsedUrl.username || parsedUrl.password ? "@" : ""; + url += parsedUrl.host ? parsedUrl.host + port : ""; + url += parsedUrl.pathname + parsedUrl.query + parsedUrl.hash; + return url; +} +/** + Utility function to add a port number to a URL + + @param parsedUrl - The parsed url object that Twilio requested on your server + @returns URL with port + */ +function addPort(parsedUrl) { + if (!parsedUrl.port) { + return buildUrlWithStandardPort(parsedUrl); + } + return parsedUrl.toString(); +} +/** + Utility function to remove a port number from a URL + + @param parsedUrl - The parsed url object that Twilio requested on your server + @returns URL without port + */ +function removePort(parsedUrl) { + parsedUrl.set("port", ""); + return parsedUrl.toString(); +} +/** + Utility function to convert request parameter to a string format + + @param paramName - The request parameter name + @param paramValue - The request parameter value + @returns Formatted parameter string + */ +function toFormUrlEncodedParam(paramName, paramValue) { + if (paramValue instanceof Array) { + return Array.from(new Set(paramValue)) + .sort() + .map((val) => toFormUrlEncodedParam(paramName, val)) + .reduce((acc, val) => acc + val, ""); + } + return paramName + paramValue; +} +/** + Utility function to get the expected signature for a given request + + @param authToken - The auth token, as seen in the Twilio portal + @param url - The full URL (with query string) you configured to handle + this request + @param params - the parameters sent with this request + @returns signature + */ +function getExpectedTwilioSignature(authToken, url, params) { + if (url.indexOf("bodySHA256") !== -1 && params === null) { + params = {}; + } + var data = Object.keys(params) + .sort() + .reduce((acc, key) => acc + toFormUrlEncodedParam(key, params[key]), url); + return crypto_1.default + .createHmac("sha1", authToken) + .update(Buffer.from(data, "utf-8")) + .digest("base64"); +} +exports.getExpectedTwilioSignature = getExpectedTwilioSignature; +/** + Utility function to get the expected body hash for a given request's body + + @param body - The plain-text body of the request + */ +function getExpectedBodyHash(body) { + return crypto_1.default + .createHash("sha256") + .update(Buffer.from(body, "utf-8")) + .digest("hex"); +} +exports.getExpectedBodyHash = getExpectedBodyHash; +/** + Utility function to validate an incoming request is indeed from Twilio + + @param authToken - The auth token, as seen in the Twilio portal + @param twilioHeader - The value of the X-Twilio-Signature header from the request + @param url - The full URL (with query string) you configured to handle this request + @param params - the parameters sent with this request + @returns valid + */ +function validateRequest(authToken, twilioHeader, url, params) { + twilioHeader = twilioHeader || ""; + const urlObject = new url_parse_1.default(url); + const urlWithPort = addPort(urlObject); + const urlWithoutPort = removePort(urlObject); + /* + * Check signature of the url with and without the port number + * since signature generation on the back end is inconsistent + */ + const signatureWithPort = getExpectedTwilioSignature(authToken, urlWithPort, params); + const signatureWithoutPort = getExpectedTwilioSignature(authToken, urlWithoutPort, params); + const validSignatureWithPort = scmp(Buffer.from(twilioHeader), Buffer.from(signatureWithPort)); + const validSignatureWithoutPort = scmp(Buffer.from(twilioHeader), Buffer.from(signatureWithoutPort)); + return validSignatureWithoutPort || validSignatureWithPort; +} +exports.validateRequest = validateRequest; +function validateBody(body, bodyHash) { + var expectedHash = getExpectedBodyHash(body); + return scmp(Buffer.from(bodyHash), Buffer.from(expectedHash)); +} +exports.validateBody = validateBody; +/** + Utility function to validate an incoming request is indeed from Twilio. This also validates + the request body against the bodySHA256 post parameter. + + @param authToken - The auth token, as seen in the Twilio portal + @param twilioHeader - The value of the X-Twilio-Signature header from the request + @param url - The full URL (with query string) you configured to handle this request + @param body - The body of the request + @returns valid + */ +function validateRequestWithBody(authToken, twilioHeader, url, body) { + const urlObject = new url_parse_1.default(url, true); + return (validateRequest(authToken, twilioHeader, url, {}) && + validateBody(body, urlObject.query.bodySHA256 || "")); +} +exports.validateRequestWithBody = validateRequestWithBody; +/** + Utility function to validate an incoming request is indeed from Twilio. + adapted from https://github.com/crabasa/twiliosig + + @param request - A request object (based on Express implementation http://expressjs.com/api.html#req.params) + @param authToken - The auth token, as seen in the Twilio portal + @param opts - options for request validation: + -> url: The full URL (with query string) you used to configure the webhook with Twilio - overrides host/protocol options + -> host: manually specify the host name used by Twilio in a number's webhook config + -> protocol: manually specify the protocol used by Twilio in a number's webhook config + */ +function validateIncomingRequest(request, authToken, opts) { + var options = opts || {}; + var webhookUrl; + if (options.url) { + // Let the user specify the full URL + webhookUrl = options.url; + } + else { + // Use configured host/protocol, or infer based on request + var protocol = options.protocol || request.protocol; + var host = options.host || request.headers.host; + webhookUrl = url_1.default.format({ + protocol: protocol, + host: host, + pathname: request.originalUrl, + }); + if (request.originalUrl.search(/\?/) >= 0) { + webhookUrl = webhookUrl.replace(/%3F/g, "?"); + } + } + if (webhookUrl.indexOf("bodySHA256") > 0) { + return validateRequestWithBody(authToken, request.header("X-Twilio-Signature") || "", webhookUrl, request.rawBody || "{}"); + } + else { + return validateRequest(authToken, request.header("X-Twilio-Signature") || "", webhookUrl, request.body || {}); + } +} +exports.validateIncomingRequest = validateIncomingRequest; +function validateExpressRequest(request, authToken, opts) { + return validateIncomingRequest(request, authToken, opts); +} +exports.validateExpressRequest = validateExpressRequest; +/** +Express middleware to accompany a Twilio webhook. Provides Twilio +request validation, and makes the response a little more friendly for our +TwiML generator. Request validation requires the express.urlencoded middleware +to have been applied (e.g. app.use(express.urlencoded()); in your app config). + +Options: +- validate: {Boolean} whether or not the middleware should validate the request + came from Twilio. Default true. If the request does not originate from + Twilio, we will return a text body and a 403. If there is no configured + auth token and validate=true, this is an error condition, so we will return + a 500. +- host: manually specify the host name used by Twilio in a number's webhook config +- protocol: manually specify the protocol used by Twilio in a number's webhook config +- url: The full URL (with query string) you used to configure the webhook with Twilio - overrides host/protocol options + +Returns a middleware function. + +Examples: +var webhookMiddleware = twilio.webhook(); +var webhookMiddleware = twilio.webhook('asdha9dhjasd'); //init with auth token +var webhookMiddleware = twilio.webhook({ + validate:false // don't attempt request validation +}); +var webhookMiddleware = twilio.webhook({ + host: 'hook.twilio.com', + protocol: 'https' +}); + */ +function webhook(opts, authToken) { + let token; + let options = undefined; + // Narrowing the args + if (opts) { + if (typeof opts === "string") { + token = opts; + } + if (typeof opts === "object") { + options = opts; + } + } + if (authToken) { + if (typeof authToken === "string") { + token = authToken; + } + if (typeof authToken === "object") { + options = authToken; + } + } + if (!options) { + options = { + validate: true, + }; + } + // Process arguments + var tokenString; + for (var i = 0, l = arguments.length; i < l; i++) { + var arg = arguments[i]; + if (typeof arg === "string") { + tokenString = arg; + } + else { + options = Object.assign(options || {}, arg); + } + } + // set auth token from input or environment variable + if (options) { + options.authToken = tokenString + ? tokenString + : process.env.TWILIO_AUTH_TOKEN; + } + // Create middleware function + return function hook(request, response, next) { + // Do validation if requested + if (options?.validate) { + // Check if the 'X-Twilio-Signature' header exists or not + if (!request.header("X-Twilio-Signature")) { + return response + .type("text/plain") + .status(400) + .send("No signature header error - X-Twilio-Signature header does not exist, maybe this request is not coming from Twilio."); + } + // Check for a valid auth token + if (!options?.authToken) { + console.error("[Twilio]: Error - Twilio auth token is required for webhook request validation."); + response + .type("text/plain") + .status(500) + .send("Webhook Error - we attempted to validate this request without first configuring our auth token."); + } + else { + // Check that the request originated from Twilio + var valid = validateExpressRequest(request, options?.authToken, { + url: options?.url, + host: options?.host, + protocol: options?.protocol, + }); + if (valid) { + next(); + } + else { + return response + .type("text/plain") + .status(403) + .send("Twilio Request Validation Failed."); + } + } + } + else { + next(); + } + }; +} +exports.webhook = webhook; diff --git a/node_modules/twilio/package.json b/node_modules/twilio/package.json new file mode 100644 index 00000000..a12329b2 --- /dev/null +++ b/node_modules/twilio/package.json @@ -0,0 +1,79 @@ +{ + "name": "twilio", + "description": "A Twilio helper library", + "version": "4.22.0", + "author": "API Team ", + "contributors": [ + { + "name": "twilio-node contributors", + "url": "https://github.com/twilio/twilio-node/graphs/contributors" + } + ], + "keywords": [ + "twilio", + "sms", + "rest", + "api" + ], + "repository": { + "type": "git", + "url": "https://github.com/twilio/twilio-node.git" + }, + "dependencies": { + "axios": "^1.6.0", + "dayjs": "^1.11.9", + "https-proxy-agent": "^5.0.0", + "jsonwebtoken": "^9.0.0", + "qs": "^6.9.4", + "scmp": "^2.1.0", + "url-parse": "^1.5.9", + "xmlbuilder": "^13.0.2" + }, + "devDependencies": { + "@babel/preset-env": "^7.23.0", + "@babel/preset-typescript": "^7.18.6", + "@types/jest": "^29.5.5", + "@types/jsonwebtoken": "^9.0.0", + "@types/node": "^18.11.18", + "@types/qs": "^6.9.7", + "@types/url-parse": "^1.4.8", + "babel-plugin-replace-ts-export-assignment": "^0.0.2", + "eslint": "^8.31.0", + "express": "^4.17.1", + "jest": "^29.5.5", + "jshint": "^2.11.0", + "mock-fs": "^5.2.0", + "nock": "^13.2.9", + "node-mocks-http": "^1.8.1", + "prettier": "^2.7.1", + "ts-jest": "^29.1.1", + "typescript": "^4.7.2", + "typedoc": "^0.23.21" + }, + "scripts": { + "test": "npm run test:javascript && npm run test:typescript", + "test:javascript": "jest spec --coverage --detectOpenHandles --testPathIgnorePatterns=spec/cluster", + "test:typescript": "tsc --noEmit", + "jshint": "jshint src/rest/** src/base/** src/http/**", + "jscs": "eslint src/base/**/**.js src/http/**/**.js --fix", + "prepublish": "npm run build", + "build": "tsc", + "check": "npm run jshint && npm run jscs", + "ci": "npm run test && npm run nsp && npm run prettier-check", + "nsp": "npm audit --production", + "prettier": "prettier --write .", + "prettier-check": "prettier --check .", + "typedoc": "typedoc --entryPointStrategy expand src --out docs --logLevel Error" + }, + "files": [ + "lib", + "index.js", + "index.d.ts" + ], + "main": "./lib", + "types": "./index.d.ts", + "engines": { + "node": ">=14.0" + }, + "license": "MIT" +} diff --git a/node_modules/url-parse/LICENSE b/node_modules/url-parse/LICENSE new file mode 100644 index 00000000..6dc9316a --- /dev/null +++ b/node_modules/url-parse/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/url-parse/README.md b/node_modules/url-parse/README.md new file mode 100644 index 00000000..e5bf8d7c --- /dev/null +++ b/node_modules/url-parse/README.md @@ -0,0 +1,153 @@ +# url-parse + +[![Version npm](https://img.shields.io/npm/v/url-parse.svg?style=flat-square)](https://www.npmjs.com/package/url-parse)[![Build Status](https://img.shields.io/github/workflow/status/unshiftio/url-parse/CI/master?label=CI&style=flat-square)](https://github.com/unshiftio/url-parse/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://img.shields.io/coveralls/unshiftio/url-parse/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/url-parse?branch=master) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/url-parse.svg)](https://saucelabs.com/u/url-parse) + +**`url-parse` was created in 2014 when the WHATWG URL API was not available in +Node.js and the `URL` interface was supported only in some browsers. Today this +is no longer true. The `URL` interface is available in all supported Node.js +release lines and basically all browsers. Consider using it for better security +and accuracy.** + +The `url-parse` method exposes two different API interfaces. The +[`url`](https://nodejs.org/api/url.html) interface that you know from Node.js +and the new [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) +interface that is available in the latest browsers. + +In version `0.1` we moved from a DOM based parsing solution, using the `` +element, to a full Regular Expression solution. The main reason for this was +to make the URL parser available in different JavaScript environments as you +don't always have access to the DOM. An example of such environment is the +[`Worker`](https://developer.mozilla.org/en/docs/Web/API/Worker) interface. +The RegExp based solution didn't work well as it required a lot of lookups +causing major problems in FireFox. In version `1.0.0` we ditched the RegExp +based solution in favor of a pure string parsing solution which chops up the +URL into smaller pieces. This module still has a really small footprint as it +has been designed to be used on the client side. + +In addition to URL parsing we also expose the bundled `querystringify` module. + +## Installation + +This module is designed to be used using either browserify or Node.js it's +released in the public npm registry and can be installed using: + +``` +npm install url-parse +``` + +## Usage + +All examples assume that this library is bootstrapped using: + +```js +'use strict'; + +var Url = require('url-parse'); +``` + +To parse an URL simply call the `URL` method with the URL that needs to be +transformed into an object. + +```js +var url = new Url('https://github.com/foo/bar'); +``` + +The `new` keyword is optional but it will save you an extra function invocation. +The constructor takes the following arguments: + +- `url` (`String`): A string representing an absolute or relative URL. +- `baseURL` (`Object` | `String`): An object or string representing + the base URL to use in case `url` is a relative URL. This argument is + optional and defaults to [`location`](https://developer.mozilla.org/en-US/docs/Web/API/Location) + in the browser. +- `parser` (`Boolean` | `Function`): This argument is optional and specifies + how to parse the query string. By default it is `false` so the query string + is not parsed. If you pass `true` the query string is parsed using the + embedded `querystringify` module. If you pass a function the query string + will be parsed using this function. + +As said above we also support the Node.js interface so you can also use the +library in this way: + +```js +'use strict'; + +var parse = require('url-parse') + , url = parse('https://github.com/foo/bar', true); +``` + +The returned `url` instance contains the following properties: + +- `protocol`: The protocol scheme of the URL (e.g. `http:`). +- `slashes`: A boolean which indicates whether the `protocol` is followed by two + forward slashes (`//`). +- `auth`: Authentication information portion (e.g. `username:password`). +- `username`: Username of basic authentication. +- `password`: Password of basic authentication. +- `host`: Host name with port number. The hostname might be invalid. +- `hostname`: Host name without port number. This might be an invalid hostname. +- `port`: Optional port number. +- `pathname`: URL path. +- `query`: Parsed object containing query string, unless parsing is set to false. +- `hash`: The "fragment" portion of the URL including the pound-sign (`#`). +- `href`: The full URL. +- `origin`: The origin of the URL. + +Note that when `url-parse` is used in a browser environment, it will default to +using the browser's current window location as the base URL when parsing all +inputs. To parse an input independently of the browser's current URL (e.g. for +functionality parity with the library in a Node environment), pass an empty +location object as the second parameter: + +```js +var parse = require('url-parse'); +parse('hostname', {}); +``` + +### Url.set(key, value) + +A simple helper function to change parts of the URL and propagating it through +all properties. When you set a new `host` you want the same value to be applied +to `port` if has a different port number, `hostname` so it has a correct name +again and `href` so you have a complete URL. + +```js +var parsed = parse('http://google.com/parse-things'); + +parsed.set('hostname', 'yahoo.com'); +console.log(parsed.href); // http://yahoo.com/parse-things +``` + +It's aware of default ports so you cannot set a port 80 on an URL which has +`http` as protocol. + +### Url.toString() + +The returned `url` object comes with a custom `toString` method which will +generate a full URL again when called. The method accepts an extra function +which will stringify the query string for you. If you don't supply a function we +will use our default method. + +```js +var location = url.toString(); // http://example.com/whatever/?qs=32 +``` + +You would rarely need to use this method as the full URL is also available as +`href` property. If you are using the `URL.set` method to make changes, this +will automatically update. + +## Testing + +The testing of this module is done in 3 different ways: + +1. We have unit tests that run under Node.js. You can run these tests with the + `npm test` command. +2. Code coverage can be run manually using `npm run coverage`. +3. For browser testing we use Sauce Labs and `zuul`. You can run browser tests + using the `npm run test-browser` command. + +## License + +[MIT](LICENSE) diff --git a/node_modules/url-parse/dist/url-parse.js b/node_modules/url-parse/dist/url-parse.js new file mode 100644 index 00000000..e9891938 --- /dev/null +++ b/node_modules/url-parse/dist/url-parse.js @@ -0,0 +1,755 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.URLParse = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 2) { + rest = rest.slice(2); + } + } else if (isSpecial(protocol)) { + rest = match[4]; + } else if (protocol) { + if (forwardSlashes) { + rest = rest.slice(2); + } + } else if (slashesCount >= 2 && isSpecial(location.protocol)) { + rest = match[4]; + } + + return { + protocol: protocol, + slashes: forwardSlashes || isSpecial(protocol), + slashesCount: slashesCount, + rest: rest + }; +} + +/** + * Resolve a relative URL pathname against a base URL pathname. + * + * @param {String} relative Pathname of the relative URL. + * @param {String} base Pathname of the base URL. + * @return {String} Resolved pathname. + * @private + */ +function resolve(relative, base) { + if (relative === '') return base; + + var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/')) + , i = path.length + , last = path[i - 1] + , unshift = false + , up = 0; + + while (i--) { + if (path[i] === '.') { + path.splice(i, 1); + } else if (path[i] === '..') { + path.splice(i, 1); + up++; + } else if (up) { + if (i === 0) unshift = true; + path.splice(i, 1); + up--; + } + } + + if (unshift) path.unshift(''); + if (last === '.' || last === '..') path.push(''); + + return path.join('/'); +} + +/** + * The actual URL instance. Instead of returning an object we've opted-in to + * create an actual constructor as it's much more memory efficient and + * faster and it pleases my OCD. + * + * It is worth noting that we should not use `URL` as class name to prevent + * clashes with the global URL instance that got introduced in browsers. + * + * @constructor + * @param {String} address URL we want to parse. + * @param {Object|String} [location] Location defaults for relative paths. + * @param {Boolean|Function} [parser] Parser for the query string. + * @private + */ +function Url(address, location, parser) { + address = trimLeft(address); + address = address.replace(CRHTLF, ''); + + if (!(this instanceof Url)) { + return new Url(address, location, parser); + } + + var relative, extracted, parse, instruction, index, key + , instructions = rules.slice() + , type = typeof location + , url = this + , i = 0; + + // + // The following if statements allows this module two have compatibility with + // 2 different API: + // + // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments + // where the boolean indicates that the query string should also be parsed. + // + // 2. The `URL` interface of the browser which accepts a URL, object as + // arguments. The supplied object will be used as default values / fall-back + // for relative paths. + // + if ('object' !== type && 'string' !== type) { + parser = location; + location = null; + } + + if (parser && 'function' !== typeof parser) parser = qs.parse; + + location = lolcation(location); + + // + // Extract protocol information before running the instructions. + // + extracted = extractProtocol(address || '', location); + relative = !extracted.protocol && !extracted.slashes; + url.slashes = extracted.slashes || relative && location.slashes; + url.protocol = extracted.protocol || location.protocol || ''; + address = extracted.rest; + + // + // When the authority component is absent the URL starts with a path + // component. + // + if ( + extracted.protocol === 'file:' && ( + extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) || + (!extracted.slashes && + (extracted.protocol || + extracted.slashesCount < 2 || + !isSpecial(url.protocol))) + ) { + instructions[3] = [/(.*)/, 'pathname']; + } + + for (; i < instructions.length; i++) { + instruction = instructions[i]; + + if (typeof instruction === 'function') { + address = instruction(address, url); + continue; + } + + parse = instruction[0]; + key = instruction[1]; + + if (parse !== parse) { + url[key] = address; + } else if ('string' === typeof parse) { + index = parse === '@' + ? address.lastIndexOf(parse) + : address.indexOf(parse); + + if (~index) { + if ('number' === typeof instruction[2]) { + url[key] = address.slice(0, index); + address = address.slice(index + instruction[2]); + } else { + url[key] = address.slice(index); + address = address.slice(0, index); + } + } + } else if ((index = parse.exec(address))) { + url[key] = index[1]; + address = address.slice(0, index.index); + } + + url[key] = url[key] || ( + relative && instruction[3] ? location[key] || '' : '' + ); + + // + // Hostname, host and protocol should be lowercased so they can be used to + // create a proper `origin`. + // + if (instruction[4]) url[key] = url[key].toLowerCase(); + } + + // + // Also parse the supplied query string in to an object. If we're supplied + // with a custom parser as function use that instead of the default build-in + // parser. + // + if (parser) url.query = parser(url.query); + + // + // If the URL is relative, resolve the pathname against the base URL. + // + if ( + relative + && location.slashes + && url.pathname.charAt(0) !== '/' + && (url.pathname !== '' || location.pathname !== '') + ) { + url.pathname = resolve(url.pathname, location.pathname); + } + + // + // Default to a / for pathname if none exists. This normalizes the URL + // to always have a / + // + if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) { + url.pathname = '/' + url.pathname; + } + + // + // We should not add port numbers if they are already the default port number + // for a given protocol. As the host also contains the port number we're going + // override it with the hostname which contains no port number. + // + if (!required(url.port, url.protocol)) { + url.host = url.hostname; + url.port = ''; + } + + // + // Parse down the `auth` for the username and password. + // + url.username = url.password = ''; + + if (url.auth) { + index = url.auth.indexOf(':'); + + if (~index) { + url.username = url.auth.slice(0, index); + url.username = encodeURIComponent(decodeURIComponent(url.username)); + + url.password = url.auth.slice(index + 1); + url.password = encodeURIComponent(decodeURIComponent(url.password)) + } else { + url.username = encodeURIComponent(decodeURIComponent(url.auth)); + } + + url.auth = url.password ? url.username +':'+ url.password : url.username; + } + + url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host + ? url.protocol +'//'+ url.host + : 'null'; + + // + // The href is just the compiled result. + // + url.href = url.toString(); +} + +/** + * This is convenience method for changing properties in the URL instance to + * insure that they all propagate correctly. + * + * @param {String} part Property we need to adjust. + * @param {Mixed} value The newly assigned value. + * @param {Boolean|Function} fn When setting the query, it will be the function + * used to parse the query. + * When setting the protocol, double slash will be + * removed from the final url if it is true. + * @returns {URL} URL instance for chaining. + * @public + */ +function set(part, value, fn) { + var url = this; + + switch (part) { + case 'query': + if ('string' === typeof value && value.length) { + value = (fn || qs.parse)(value); + } + + url[part] = value; + break; + + case 'port': + url[part] = value; + + if (!required(value, url.protocol)) { + url.host = url.hostname; + url[part] = ''; + } else if (value) { + url.host = url.hostname +':'+ value; + } + + break; + + case 'hostname': + url[part] = value; + + if (url.port) value += ':'+ url.port; + url.host = value; + break; + + case 'host': + url[part] = value; + + if (port.test(value)) { + value = value.split(':'); + url.port = value.pop(); + url.hostname = value.join(':'); + } else { + url.hostname = value; + url.port = ''; + } + + break; + + case 'protocol': + url.protocol = value.toLowerCase(); + url.slashes = !fn; + break; + + case 'pathname': + case 'hash': + if (value) { + var char = part === 'pathname' ? '/' : '#'; + url[part] = value.charAt(0) !== char ? char + value : value; + } else { + url[part] = value; + } + break; + + case 'username': + case 'password': + url[part] = encodeURIComponent(value); + break; + + case 'auth': + var index = value.indexOf(':'); + + if (~index) { + url.username = value.slice(0, index); + url.username = encodeURIComponent(decodeURIComponent(url.username)); + + url.password = value.slice(index + 1); + url.password = encodeURIComponent(decodeURIComponent(url.password)); + } else { + url.username = encodeURIComponent(decodeURIComponent(value)); + } + } + + for (var i = 0; i < rules.length; i++) { + var ins = rules[i]; + + if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase(); + } + + url.auth = url.password ? url.username +':'+ url.password : url.username; + + url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host + ? url.protocol +'//'+ url.host + : 'null'; + + url.href = url.toString(); + + return url; +} + +/** + * Transform the properties back in to a valid and full URL string. + * + * @param {Function} stringify Optional query stringify function. + * @returns {String} Compiled version of the URL. + * @public + */ +function toString(stringify) { + if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify; + + var query + , url = this + , host = url.host + , protocol = url.protocol; + + if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':'; + + var result = + protocol + + ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : ''); + + if (url.username) { + result += url.username; + if (url.password) result += ':'+ url.password; + result += '@'; + } else if (url.password) { + result += ':'+ url.password; + result += '@'; + } else if ( + url.protocol !== 'file:' && + isSpecial(url.protocol) && + !host && + url.pathname !== '/' + ) { + // + // Add back the empty userinfo, otherwise the original invalid URL + // might be transformed into a valid one with `url.pathname` as host. + // + result += '@'; + } + + // + // Trailing colon is removed from `url.host` when it is parsed. If it still + // ends with a colon, then add back the trailing colon that was removed. This + // prevents an invalid URL from being transformed into a valid one. + // + if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) { + host += ':'; + } + + result += host + url.pathname; + + query = 'object' === typeof url.query ? stringify(url.query) : url.query; + if (query) result += '?' !== query.charAt(0) ? '?'+ query : query; + + if (url.hash) result += url.hash; + + return result; +} + +Url.prototype = { set: set, toString: toString }; + +// +// Expose the URL parser and some additional properties that might be useful for +// others or testing. +// +Url.extractProtocol = extractProtocol; +Url.location = lolcation; +Url.trimLeft = trimLeft; +Url.qs = qs; + +module.exports = Url; + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"querystringify":2,"requires-port":3}],2:[function(require,module,exports){ +'use strict'; + +var has = Object.prototype.hasOwnProperty + , undef; + +/** + * Decode a URI encoded string. + * + * @param {String} input The URI encoded string. + * @returns {String|Null} The decoded string. + * @api private + */ +function decode(input) { + try { + return decodeURIComponent(input.replace(/\+/g, ' ')); + } catch (e) { + return null; + } +} + +/** + * Attempts to encode a given input. + * + * @param {String} input The string that needs to be encoded. + * @returns {String|Null} The encoded string. + * @api private + */ +function encode(input) { + try { + return encodeURIComponent(input); + } catch (e) { + return null; + } +} + +/** + * Simple query string parser. + * + * @param {String} query The query string that needs to be parsed. + * @returns {Object} + * @api public + */ +function querystring(query) { + var parser = /([^=?#&]+)=?([^&]*)/g + , result = {} + , part; + + while (part = parser.exec(query)) { + var key = decode(part[1]) + , value = decode(part[2]); + + // + // Prevent overriding of existing properties. This ensures that build-in + // methods like `toString` or __proto__ are not overriden by malicious + // querystrings. + // + // In the case if failed decoding, we want to omit the key/value pairs + // from the result. + // + if (key === null || value === null || key in result) continue; + result[key] = value; + } + + return result; +} + +/** + * Transform a query string to an object. + * + * @param {Object} obj Object that should be transformed. + * @param {String} prefix Optional prefix. + * @returns {String} + * @api public + */ +function querystringify(obj, prefix) { + prefix = prefix || ''; + + var pairs = [] + , value + , key; + + // + // Optionally prefix with a '?' if needed + // + if ('string' !== typeof prefix) prefix = '?'; + + for (key in obj) { + if (has.call(obj, key)) { + value = obj[key]; + + // + // Edge cases where we actually want to encode the value to an empty + // string instead of the stringified value. + // + if (!value && (value === null || value === undef || isNaN(value))) { + value = ''; + } + + key = encode(key); + value = encode(value); + + // + // If we failed to encode the strings, we should bail out as we don't + // want to add invalid strings to the query. + // + if (key === null || value === null) continue; + pairs.push(key +'='+ value); + } + } + + return pairs.length ? prefix + pairs.join('&') : ''; +} + +// +// Expose the module. +// +exports.stringify = querystringify; +exports.parse = querystring; + +},{}],3:[function(require,module,exports){ +'use strict'; + +/** + * Check if we're required to add a port number. + * + * @see https://url.spec.whatwg.org/#default-port + * @param {Number|String} port Port number we need to check + * @param {String} protocol Protocol we need to check against. + * @returns {Boolean} Is it a default port for the given protocol + * @api private + */ +module.exports = function required(port, protocol) { + protocol = protocol.split(':')[0]; + port = +port; + + if (!port) return false; + + switch (protocol) { + case 'http': + case 'ws': + return port !== 80; + + case 'https': + case 'wss': + return port !== 443; + + case 'ftp': + return port !== 21; + + case 'gopher': + return port !== 70; + + case 'file': + return false; + } + + return port !== 0; +}; + +},{}]},{},[1])(1) +}); diff --git a/node_modules/url-parse/dist/url-parse.min.js b/node_modules/url-parse/dist/url-parse.min.js new file mode 100644 index 00000000..f0b3b4c0 --- /dev/null +++ b/node_modules/url-parse/dist/url-parse.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).URLParse=e()}(function(){return function n(r,s,a){function i(o,e){if(!s[o]){if(!r[o]){var t="function"==typeof require&&require;if(!e&&t)return t(o,!0);if(p)return p(o,!0);throw(e=new Error("Cannot find module '"+o+"'")).code="MODULE_NOT_FOUND",e}t=s[o]={exports:{}},r[o][0].call(t.exports,function(e){return i(r[o][1][e]||e)},t,t.exports,n,r,s,a)}return s[o].exports}for(var p="function"==typeof require&&require,e=0;e= 2) { + rest = rest.slice(2); + } + } else if (isSpecial(protocol)) { + rest = match[4]; + } else if (protocol) { + if (forwardSlashes) { + rest = rest.slice(2); + } + } else if (slashesCount >= 2 && isSpecial(location.protocol)) { + rest = match[4]; + } + + return { + protocol: protocol, + slashes: forwardSlashes || isSpecial(protocol), + slashesCount: slashesCount, + rest: rest + }; +} + +/** + * Resolve a relative URL pathname against a base URL pathname. + * + * @param {String} relative Pathname of the relative URL. + * @param {String} base Pathname of the base URL. + * @return {String} Resolved pathname. + * @private + */ +function resolve(relative, base) { + if (relative === '') return base; + + var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/')) + , i = path.length + , last = path[i - 1] + , unshift = false + , up = 0; + + while (i--) { + if (path[i] === '.') { + path.splice(i, 1); + } else if (path[i] === '..') { + path.splice(i, 1); + up++; + } else if (up) { + if (i === 0) unshift = true; + path.splice(i, 1); + up--; + } + } + + if (unshift) path.unshift(''); + if (last === '.' || last === '..') path.push(''); + + return path.join('/'); +} + +/** + * The actual URL instance. Instead of returning an object we've opted-in to + * create an actual constructor as it's much more memory efficient and + * faster and it pleases my OCD. + * + * It is worth noting that we should not use `URL` as class name to prevent + * clashes with the global URL instance that got introduced in browsers. + * + * @constructor + * @param {String} address URL we want to parse. + * @param {Object|String} [location] Location defaults for relative paths. + * @param {Boolean|Function} [parser] Parser for the query string. + * @private + */ +function Url(address, location, parser) { + address = trimLeft(address); + address = address.replace(CRHTLF, ''); + + if (!(this instanceof Url)) { + return new Url(address, location, parser); + } + + var relative, extracted, parse, instruction, index, key + , instructions = rules.slice() + , type = typeof location + , url = this + , i = 0; + + // + // The following if statements allows this module two have compatibility with + // 2 different API: + // + // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments + // where the boolean indicates that the query string should also be parsed. + // + // 2. The `URL` interface of the browser which accepts a URL, object as + // arguments. The supplied object will be used as default values / fall-back + // for relative paths. + // + if ('object' !== type && 'string' !== type) { + parser = location; + location = null; + } + + if (parser && 'function' !== typeof parser) parser = qs.parse; + + location = lolcation(location); + + // + // Extract protocol information before running the instructions. + // + extracted = extractProtocol(address || '', location); + relative = !extracted.protocol && !extracted.slashes; + url.slashes = extracted.slashes || relative && location.slashes; + url.protocol = extracted.protocol || location.protocol || ''; + address = extracted.rest; + + // + // When the authority component is absent the URL starts with a path + // component. + // + if ( + extracted.protocol === 'file:' && ( + extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) || + (!extracted.slashes && + (extracted.protocol || + extracted.slashesCount < 2 || + !isSpecial(url.protocol))) + ) { + instructions[3] = [/(.*)/, 'pathname']; + } + + for (; i < instructions.length; i++) { + instruction = instructions[i]; + + if (typeof instruction === 'function') { + address = instruction(address, url); + continue; + } + + parse = instruction[0]; + key = instruction[1]; + + if (parse !== parse) { + url[key] = address; + } else if ('string' === typeof parse) { + index = parse === '@' + ? address.lastIndexOf(parse) + : address.indexOf(parse); + + if (~index) { + if ('number' === typeof instruction[2]) { + url[key] = address.slice(0, index); + address = address.slice(index + instruction[2]); + } else { + url[key] = address.slice(index); + address = address.slice(0, index); + } + } + } else if ((index = parse.exec(address))) { + url[key] = index[1]; + address = address.slice(0, index.index); + } + + url[key] = url[key] || ( + relative && instruction[3] ? location[key] || '' : '' + ); + + // + // Hostname, host and protocol should be lowercased so they can be used to + // create a proper `origin`. + // + if (instruction[4]) url[key] = url[key].toLowerCase(); + } + + // + // Also parse the supplied query string in to an object. If we're supplied + // with a custom parser as function use that instead of the default build-in + // parser. + // + if (parser) url.query = parser(url.query); + + // + // If the URL is relative, resolve the pathname against the base URL. + // + if ( + relative + && location.slashes + && url.pathname.charAt(0) !== '/' + && (url.pathname !== '' || location.pathname !== '') + ) { + url.pathname = resolve(url.pathname, location.pathname); + } + + // + // Default to a / for pathname if none exists. This normalizes the URL + // to always have a / + // + if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) { + url.pathname = '/' + url.pathname; + } + + // + // We should not add port numbers if they are already the default port number + // for a given protocol. As the host also contains the port number we're going + // override it with the hostname which contains no port number. + // + if (!required(url.port, url.protocol)) { + url.host = url.hostname; + url.port = ''; + } + + // + // Parse down the `auth` for the username and password. + // + url.username = url.password = ''; + + if (url.auth) { + index = url.auth.indexOf(':'); + + if (~index) { + url.username = url.auth.slice(0, index); + url.username = encodeURIComponent(decodeURIComponent(url.username)); + + url.password = url.auth.slice(index + 1); + url.password = encodeURIComponent(decodeURIComponent(url.password)) + } else { + url.username = encodeURIComponent(decodeURIComponent(url.auth)); + } + + url.auth = url.password ? url.username +':'+ url.password : url.username; + } + + url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host + ? url.protocol +'//'+ url.host + : 'null'; + + // + // The href is just the compiled result. + // + url.href = url.toString(); +} + +/** + * This is convenience method for changing properties in the URL instance to + * insure that they all propagate correctly. + * + * @param {String} part Property we need to adjust. + * @param {Mixed} value The newly assigned value. + * @param {Boolean|Function} fn When setting the query, it will be the function + * used to parse the query. + * When setting the protocol, double slash will be + * removed from the final url if it is true. + * @returns {URL} URL instance for chaining. + * @public + */ +function set(part, value, fn) { + var url = this; + + switch (part) { + case 'query': + if ('string' === typeof value && value.length) { + value = (fn || qs.parse)(value); + } + + url[part] = value; + break; + + case 'port': + url[part] = value; + + if (!required(value, url.protocol)) { + url.host = url.hostname; + url[part] = ''; + } else if (value) { + url.host = url.hostname +':'+ value; + } + + break; + + case 'hostname': + url[part] = value; + + if (url.port) value += ':'+ url.port; + url.host = value; + break; + + case 'host': + url[part] = value; + + if (port.test(value)) { + value = value.split(':'); + url.port = value.pop(); + url.hostname = value.join(':'); + } else { + url.hostname = value; + url.port = ''; + } + + break; + + case 'protocol': + url.protocol = value.toLowerCase(); + url.slashes = !fn; + break; + + case 'pathname': + case 'hash': + if (value) { + var char = part === 'pathname' ? '/' : '#'; + url[part] = value.charAt(0) !== char ? char + value : value; + } else { + url[part] = value; + } + break; + + case 'username': + case 'password': + url[part] = encodeURIComponent(value); + break; + + case 'auth': + var index = value.indexOf(':'); + + if (~index) { + url.username = value.slice(0, index); + url.username = encodeURIComponent(decodeURIComponent(url.username)); + + url.password = value.slice(index + 1); + url.password = encodeURIComponent(decodeURIComponent(url.password)); + } else { + url.username = encodeURIComponent(decodeURIComponent(value)); + } + } + + for (var i = 0; i < rules.length; i++) { + var ins = rules[i]; + + if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase(); + } + + url.auth = url.password ? url.username +':'+ url.password : url.username; + + url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host + ? url.protocol +'//'+ url.host + : 'null'; + + url.href = url.toString(); + + return url; +} + +/** + * Transform the properties back in to a valid and full URL string. + * + * @param {Function} stringify Optional query stringify function. + * @returns {String} Compiled version of the URL. + * @public + */ +function toString(stringify) { + if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify; + + var query + , url = this + , host = url.host + , protocol = url.protocol; + + if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':'; + + var result = + protocol + + ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : ''); + + if (url.username) { + result += url.username; + if (url.password) result += ':'+ url.password; + result += '@'; + } else if (url.password) { + result += ':'+ url.password; + result += '@'; + } else if ( + url.protocol !== 'file:' && + isSpecial(url.protocol) && + !host && + url.pathname !== '/' + ) { + // + // Add back the empty userinfo, otherwise the original invalid URL + // might be transformed into a valid one with `url.pathname` as host. + // + result += '@'; + } + + // + // Trailing colon is removed from `url.host` when it is parsed. If it still + // ends with a colon, then add back the trailing colon that was removed. This + // prevents an invalid URL from being transformed into a valid one. + // + if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) { + host += ':'; + } + + result += host + url.pathname; + + query = 'object' === typeof url.query ? stringify(url.query) : url.query; + if (query) result += '?' !== query.charAt(0) ? '?'+ query : query; + + if (url.hash) result += url.hash; + + return result; +} + +Url.prototype = { set: set, toString: toString }; + +// +// Expose the URL parser and some additional properties that might be useful for +// others or testing. +// +Url.extractProtocol = extractProtocol; +Url.location = lolcation; +Url.trimLeft = trimLeft; +Url.qs = qs; + +module.exports = Url; diff --git a/node_modules/url-parse/package.json b/node_modules/url-parse/package.json new file mode 100644 index 00000000..8d1bbbe2 --- /dev/null +++ b/node_modules/url-parse/package.json @@ -0,0 +1,49 @@ +{ + "name": "url-parse", + "version": "1.5.10", + "description": "Small footprint URL parser that works seamlessly across Node.js and browser environments", + "main": "index.js", + "scripts": { + "browserify": "rm -rf dist && mkdir -p dist && browserify index.js -s URLParse -o dist/url-parse.js", + "minify": "uglifyjs dist/url-parse.js --source-map -cm -o dist/url-parse.min.js", + "test": "c8 --reporter=lcov --reporter=text mocha test/test.js", + "test-browser": "node test/browser.js", + "prepublishOnly": "npm run browserify && npm run minify", + "watch": "mocha --watch test/test.js" + }, + "files": [ + "index.js", + "dist" + ], + "repository": { + "type": "git", + "url": "https://github.com/unshiftio/url-parse.git" + }, + "keywords": [ + "URL", + "parser", + "uri", + "url", + "parse", + "query", + "string", + "querystring", + "stringify" + ], + "author": "Arnout Kazemier", + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + }, + "devDependencies": { + "assume": "^2.2.0", + "browserify": "^17.0.0", + "c8": "^7.3.1", + "mocha": "^9.0.3", + "pre-commit": "^1.2.2", + "sauce-browsers": "^2.0.0", + "sauce-test": "^1.3.3", + "uglify-js": "^3.5.7" + } +} diff --git a/node_modules/util-deprecate/History.md b/node_modules/util-deprecate/History.md new file mode 100644 index 00000000..acc86753 --- /dev/null +++ b/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/node_modules/util-deprecate/LICENSE b/node_modules/util-deprecate/LICENSE new file mode 100644 index 00000000..6a60e8c2 --- /dev/null +++ b/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/README.md b/node_modules/util-deprecate/README.md new file mode 100644 index 00000000..75622fa7 --- /dev/null +++ b/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/browser.js b/node_modules/util-deprecate/browser.js new file mode 100644 index 00000000..549ae2f0 --- /dev/null +++ b/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/node_modules/util-deprecate/node.js b/node_modules/util-deprecate/node.js new file mode 100644 index 00000000..5e6fcff5 --- /dev/null +++ b/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json new file mode 100644 index 00000000..2e79f89a --- /dev/null +++ b/node_modules/util-deprecate/package.json @@ -0,0 +1,27 @@ +{ + "name": "util-deprecate", + "version": "1.0.2", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate" +} diff --git a/node_modules/wide-align/LICENSE b/node_modules/wide-align/LICENSE new file mode 100644 index 00000000..f4be44d8 --- /dev/null +++ b/node_modules/wide-align/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/wide-align/README.md b/node_modules/wide-align/README.md new file mode 100644 index 00000000..32f1be04 --- /dev/null +++ b/node_modules/wide-align/README.md @@ -0,0 +1,47 @@ +wide-align +---------- + +A wide-character aware text alignment function for use in terminals / on the +console. + +### Usage + +``` +var align = require('wide-align') + +// Note that if you view this on a unicode console, all of the slashes are +// aligned. This is because on a console, all narrow characters are +// an en wide and all wide characters are an em. In browsers, this isn't +// held to and wide characters like "古" can be less than two narrow +// characters even with a fixed width font. + +console.log(align.center('abc', 10)) // ' abc ' +console.log(align.center('古古古', 10)) // ' 古古古 ' +console.log(align.left('abc', 10)) // 'abc ' +console.log(align.left('古古古', 10)) // '古古古 ' +console.log(align.right('abc', 10)) // ' abc' +console.log(align.right('古古古', 10)) // ' 古古古' +``` + +### Functions + +#### `align.center(str, length)` → `str` + +Returns *str* with spaces added to both sides such that that it is *length* +chars long and centered in the spaces. + +#### `align.left(str, length)` → `str` + +Returns *str* with spaces to the right such that it is *length* chars long. + +### `align.right(str, length)` → `str` + +Returns *str* with spaces to the left such that it is *length* chars long. + +### Origins + +These functions were originally taken from +[cliui](https://npmjs.com/package/cliui). Changes include switching to the +MUCH faster pad generation function from +[lodash](https://npmjs.com/package/lodash), making center alignment pad +both sides and adding left alignment. diff --git a/node_modules/wide-align/align.js b/node_modules/wide-align/align.js new file mode 100644 index 00000000..4f94ca4c --- /dev/null +++ b/node_modules/wide-align/align.js @@ -0,0 +1,65 @@ +'use strict' +var stringWidth = require('string-width') + +exports.center = alignCenter +exports.left = alignLeft +exports.right = alignRight + +// lodash's way of generating pad characters. + +function createPadding (width) { + var result = '' + var string = ' ' + var n = width + do { + if (n % 2) { + result += string; + } + n = Math.floor(n / 2); + string += string; + } while (n); + + return result; +} + +function alignLeft (str, width) { + var trimmed = str.trimRight() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return trimmed + padding +} + +function alignRight (str, width) { + var trimmed = str.trimLeft() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return padding + trimmed +} + +function alignCenter (str, width) { + var trimmed = str.trim() + if (trimmed.length === 0 && str.length >= width) return str + var padLeft = '' + var padRight = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + var padLeftBy = parseInt((width - strWidth) / 2, 10) + padLeft = createPadding(padLeftBy) + padRight = createPadding(width - (strWidth + padLeftBy)) + } + + return padLeft + trimmed + padRight +} diff --git a/node_modules/wide-align/package.json b/node_modules/wide-align/package.json new file mode 100644 index 00000000..2dd27074 --- /dev/null +++ b/node_modules/wide-align/package.json @@ -0,0 +1,33 @@ +{ + "name": "wide-align", + "version": "1.1.5", + "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", + "main": "align.js", + "scripts": { + "test": "tap --coverage test/*.js" + }, + "keywords": [ + "wide", + "double", + "unicode", + "cjkv", + "pad", + "align" + ], + "author": "Rebecca Turner (http://re-becca.org/)", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/iarna/wide-align" + }, + "//": "But not version 5 of string-width, as that's ESM only", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + }, + "devDependencies": { + "tap": "*" + }, + "files": [ + "align.js" + ] +} diff --git a/node_modules/wrappy/LICENSE b/node_modules/wrappy/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/wrappy/README.md b/node_modules/wrappy/README.md new file mode 100644 index 00000000..98eab252 --- /dev/null +++ b/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json new file mode 100644 index 00000000..13075204 --- /dev/null +++ b/node_modules/wrappy/package.json @@ -0,0 +1,29 @@ +{ + "name": "wrappy", + "version": "1.0.2", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "files": [ + "wrappy.js" + ], + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^2.3.1" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/wrappy" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy" +} diff --git a/node_modules/wrappy/wrappy.js b/node_modules/wrappy/wrappy.js new file mode 100644 index 00000000..bb7e7d6f --- /dev/null +++ b/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/node_modules/xmlbuilder/.nycrc b/node_modules/xmlbuilder/.nycrc new file mode 100644 index 00000000..0326a026 --- /dev/null +++ b/node_modules/xmlbuilder/.nycrc @@ -0,0 +1,6 @@ +{ + "reporter": ["lcov", "text"], + "extension": [".coffee"], + "sourceMap": false, + "instrument": false +} \ No newline at end of file diff --git a/node_modules/xmlbuilder/CHANGELOG.md b/node_modules/xmlbuilder/CHANGELOG.md new file mode 100644 index 00000000..4d11d2e5 --- /dev/null +++ b/node_modules/xmlbuilder/CHANGELOG.md @@ -0,0 +1,563 @@ +# Change Log + +All notable changes to this project are documented in this file. This project adheres to [Semantic Versioning](http://semver.org/#semantic-versioning-200). + +## [13.0.1] - 2019-05-10 + +- Corrected typings for doctype and character data nodes. See [#211](https://github.com/oozcitak/xmlbuilder-js/issues/211). + +## [13.0.0] - 2019-05-07 + +- Rewrote all TypeSript typings to be strictly compatible with the API. This is a breaking change for TypeScript users only. + +## [12.0.1] - 2019-04-30 + +- Added option for pretty printing attributes. + +## [12.0.0] - 2019-04-03 + +- Removed support for node.js 4.0 and 5.0\. Minimum required version is now 6.0. + +## [11.0.1] - 2019-03-22 + +- Added TypeScript typings. See [#200](https://github.com/oozcitak/xmlbuilder-js/issues/200). + +## [11.0.0] - 2019-02-18 + +- Calling `end()` with arguments no longer overwrites writer options. See [#120](https://github.com/oozcitak/xmlbuilder-js/issues/120). +- Added writer state and customizable space and endline functions to help customize writer behavior. Also added `openNode` and `closeNode` functions to writer. See [#193](https://github.com/oozcitak/xmlbuilder-js/issues/193). +- Fixed a bug where writer functions would not be called for nodes with a single child node in pretty print mode. See [#195](https://github.com/oozcitak/xmlbuilder-js/issues/195). +- Renamed `elEscape` to `textEscape` in `XMLStringifier`. +- Fixed a bug where empty arrays would produce child nodes. See [#190](https://github.com/oozcitak/xmlbuilder-js/issues/190). +- Removed the `skipNullAttributes` option. `null` attributes are now skipped by default. Added the `keepNullAttributes` option in case someone needs the old behavior. +- Removed the `skipNullNodes` option. `null` nodes are now skipped by default. Added the `keepNullNodes` option in case someone needs the old behavior. +- `undefined` values are now skipped when converting JS objects. +- Renamed stringify functions. See [#194](https://github.com/oozcitak/xmlbuilder-js/issues/194): + + - `eleName` -> `name` + - `attName` -> `name` + - `eleText` -> `text` + +- Fixed argument order for `attribute` function in the writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196). +- Added `openAttribute` and `closeAttribute` functions to writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196). +- Added node types to node objects. Node types and writer states are exported by the module with the `nodeType` and `writerState` properties. +- Fixed a bug where array items would not be correctly converted. See [#159](https://github.com/oozcitak/xmlbuilder-js/issues/159). +- Fixed a bug where mixed-content inside JS objects with `#text` decorator would not be correctly converted. See [#171](https://github.com/oozcitak/xmlbuilder-js/issues/171). +- Fixed a bug where JS objects would not be expanded in callback mode. See [#173](https://github.com/oozcitak/xmlbuilder-js/issues/173). +- Fixed a bug where character validation would not obey document's XML version. Added separate validation for XML 1.0 and XML 1.1 documents. See [#169](https://github.com/oozcitak/xmlbuilder-js/issues/169). +- Fixed a bug where names would not be validated according to the spec. See [#49](https://github.com/oozcitak/xmlbuilder-js/issues/49). +- Renamed `text` property to `value` in comment and cdata nodes to unify the API. +- Removed `doctype` function to prevent name clash with DOM implementation. Use the `dtd` function instead. +- Removed dummy nodes from the XML tree (Those were created while chain-building the tree). +- Renamed `attributes`property to `attribs` to prevent name clash with DOM property with the same name. +- Implemented the DOM standard (read-only) to support XPath lookups. XML namespaces are not currently supported. See [#122](https://github.com/oozcitak/xmlbuilder-js/issues/122). + +## [10.1.1] - 2018-10-24 + +- Fixed an edge case where a null node at root level would be printed although `skipNullNodes` was set. See [#187](https://github.com/oozcitak/xmlbuilder-js/issues/187). + +## [10.1.0] - 2018-10-10 + +- Added the `skipNullNodes` option to skip nodes with null values. See [#158](https://github.com/oozcitak/xmlbuilder-js/issues/158). + +## [10.0.0] - 2018-04-26 + +- Added current indentation level as a parameter to the onData function when in callback mode. See [#125](https://github.com/oozcitak/xmlbuilder-js/issues/125). +- Added name of the current node and parent node to error messages where possible. See [#152](https://github.com/oozcitak/xmlbuilder-js/issues/152). This has the potential to break code depending on the content of error messages. +- Fixed an issue where objects created with Object.create(null) created an error. See [#176](https://github.com/oozcitak/xmlbuilder-js/issues/176). +- Added test builds for node.js v8 and v10. + +## [9.0.7] - 2018-02-09 + +- Simplified regex used for validating encoding. + +## [9.0.4] - 2017-08-16 + +- `spacebeforeslash` writer option accepts `true` as well as space char(s). + +## [9.0.3] - 2017-08-15 + +- `spacebeforeslash` writer option can now be used with XML fragments. + +## [9.0.2] - 2017-08-15 + +- Added the `spacebeforeslash` writer option to add a space character before closing tags of empty elements. See [#157](https://github.com/oozcitak/xmlbuilder-js/issues/157). + +## [9.0.1] - 2017-06-19 + +- Fixed character validity checks to work with node.js 4.0 and 5.0\. See [#161](https://github.com/oozcitak/xmlbuilder-js/issues/161). + +## [9.0.0] - 2017-05-05 + +- Removed case conversion options. +- Removed support for node.js 4.0 and 5.0\. Minimum required version is now 6.0. +- Fixed valid char filter to use XML 1.1 instead of 1.0\. See [#147](https://github.com/oozcitak/xmlbuilder-js/issues/147). +- Added options for negative indentation and suppressing pretty printing of text nodes. See [#145](https://github.com/oozcitak/xmlbuilder-js/issues/145). + +## [8.2.2] - 2016-04-08 + +- Falsy values can now be used as a text node in callback mode. + +## [8.2.1] - 2016-04-07 + +- Falsy values can now be used as a text node. See [#117](https://github.com/oozcitak/xmlbuilder-js/issues/117). + +## [8.2.0] - 2016-04-01 + +- Removed lodash dependency to keep the library small and simple. See [#114](https://github.com/oozcitak/xmlbuilder-js/issues/114), [#53](https://github.com/oozcitak/xmlbuilder-js/issues/53), and [#43](https://github.com/oozcitak/xmlbuilder-js/issues/43). +- Added title case to name conversion options. + +## [8.1.0] - 2016-03-29 + +- Added the callback option to the `begin` export function. When used with a callback function, the XML document will be generated in chunks and each chunk will be passed to the supplied function. In this mode, `begin` uses a different code path and the builder should use much less memory since the entire XML tree is not kept. There are a few drawbacks though. For example, traversing the document tree or adding attributes to a node after it is written is not possible. It is also not possible to remove nodes or attributes. + +```javascript +var result = ''; + +builder.begin(function(chunk) { result += chunk; }) + .dec() + .ele('root') + .ele('xmlbuilder').up() + .end(); +``` + +- Replaced native `Object.assign` with `lodash.assign` to support old JS engines. See [#111](https://github.com/oozcitak/xmlbuilder-js/issues/111). + +## [8.0.0] - 2016-03-25 + +- Added the `begin` export function. See the wiki for details. +- Added the ability to add comments and processing instructions before and after the root element. Added `commentBefore`, `commentAfter`, `instructionBefore` and `instructionAfter` functions for this purpose. +- Dropped support for old node.js releases. Minimum required node.js version is now 4.0. + +## [7.0.0] - 2016-03-21 + +- Processing instructions are now created as regular nodes. This is a major breaking change if you are using processing instructions. Previously processing instructions were inserted before their parent node. After this change processing instructions are appended to the children of the parent node. Note that it is not currently possible to insert processing instructions before or after the root element. + + ```javascript + root.ele('node').ins('pi'); + // pre-v7 + + // v7 + + ``` + +## [6.0.0] - 2016-03-20 + +- Added custom XML writers. The default string conversion functions are now collected under the `XMLStringWriter` class which can be accessed by the `stringWriter(options)` function exported by the module. An `XMLStreamWriter` is also added which outputs the XML document to a writable stream. A stream writer can be created by calling the `streamWriter(stream, options)` function exported by the module. Both classes are heavily customizable and the details are added to the wiki. It is also possible to write an XML writer from scratch and use it when calling `end()` on the XML document. + +## [5.0.1] - 2016-03-08 + +- Moved require statements for text case conversion to the top of files to reduce lazy requires. + +## [5.0.0] - 2016-03-05 + +- Added text case option for element names and attribute names. Valid cases are `lower`, `upper`, `camel`, `kebab` and `snake`. +- Attribute and element values are escaped according to the [Canonical XML 1.0 specification](http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping). See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54) and [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86). +- Added the `allowEmpty` option to `end()`. When this option is set, empty elements are not self-closed. +- Added support for [nested CDATA](https://en.wikipedia.org/wiki/CDATA#Nesting). The triad `]]>` in CDATA is now automatically replaced with `]]]]>`. + +## [4.2.1] - 2016-01-15 + +- Updated lodash dependency to 4.0.0. + +## [4.2.0] - 2015-12-16 + +- Added the `noDoubleEncoding` option to `create()` to control whether existing html entities are encoded. + +## [4.1.0] - 2015-11-11 + +- Added the `separateArrayItems` option to `create()` to control how arrays are handled when converting from objects. e.g. + +```javascript +root.ele({ number: [ "one", "two" ]}); +// with separateArrayItems: true + + + + +// with separateArrayItems: false +one +two +``` + +## [4.0.0] - 2015-11-01 + +- Removed the `#list` decorator. Array items are now created as child nodes by default. +- Fixed a bug where the XML encoding string was checked partially. + +## [3.1.0] - 2015-09-19 + +- `#list` decorator ignores empty arrays. + +## [3.0.0] - 2015-09-10 + +- Allow `\r`, `\n` and `\t` in attribute values without escaping. See [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86). + +## [2.6.5] - 2015-09-09 + +- Use native `isArray` instead of lodash. +- Indentation of processing instructions are set to the parent element's. + +## [2.6.4] - 2015-05-27 + +- Updated lodash dependency to 3.5.0. + +## [2.6.3] - 2015-05-27 + +- Bumped version because previous release was not published on npm. + +## [2.6.2] - 2015-03-10 + +- Updated lodash dependency to 3.5.0. + +## [2.6.1] - 2015-02-20 + +- Updated lodash dependency to 3.3.0. + +## [2.6.0] - 2015-02-20 + +- Fixed a bug where the `XMLNode` constructor overwrote the super class parent. +- Removed document property from cloned nodes. +- Switched to mocha.js for testing. + +## [2.5.2] - 2015-02-16 + +- Updated lodash dependency to 3.2.0. + +## [2.5.1] - 2015-02-09 + +- Updated lodash dependency to 3.1.0. +- Support all node >= 0.8. + +## [2.5.0] - 2015-00-03 + +- Updated lodash dependency to 3.0.0. + +## [2.4.6] - 2015-01-26 + +- Show more information from attribute creation with null values. +- Added iojs as an engine. +- Self close elements with empty text. + +## [2.4.5] - 2014-11-15 + +- Fixed prepublish script to run on windows. +- Fixed bug in XMLStringifier where an undefined value was used while reporting an invalid encoding value. +- Moved require statements to the top of files to reduce lazy requires. See [#62](https://github.com/oozcitak/xmlbuilder-js/issues/62). + +## [2.4.4] - 2014-09-08 + +- Added the `offset` option to `toString()` for use in XML fragments. + +## [2.4.3] - 2014-08-13 + +- Corrected license in package description. + +## [2.4.2] - 2014-08-13 + +- Dropped performance test and memwatch dependency. + +## [2.4.1] - 2014-08-12 + +- Fixed a bug where empty indent string was omitted when pretty printing. See [#59](https://github.com/oozcitak/xmlbuilder-js/issues/59). + +## [2.4.0] - 2014-08-04 + +- Correct cases of pubID and sysID. +- Use single lodash instead of separate npm modules. See [#53](https://github.com/oozcitak/xmlbuilder-js/issues/53). +- Escape according to Canonical XML 1.0\. See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54). + +## [2.3.0] - 2014-07-17 + +- Convert objects to JS primitives while sanitizing user input. +- Object builder preserves items with null values. See [#44](https://github.com/oozcitak/xmlbuilder-js/issues/44). +- Use modularized lodash functions to cut down dependencies. +- Process empty objects when converting from objects so that we don't throw on empty child objects. + +## [2.2.1] - 2014-04-04 + +- Bumped version because previous release was not published on npm. + +## [2.2.0] - 2014-04-04 + +- Switch to lodash from underscore. +- Removed legacy `ext` option from `create()`. +- Drop old node versions: 0.4, 0.5, 0.6\. 0.8 is the minimum requirement from now on. + +## [2.1.0] - 2013-12-30 + +- Removed duplicate null checks from constructors. +- Fixed node count in performance test. +- Added option for skipping null attribute values. See [#26](https://github.com/oozcitak/xmlbuilder-js/issues/26). +- Allow multiple values in `att()` and `ins()`. +- Added ability to run individual performance tests. +- Added flag for ignoring decorator strings. + +## [2.0.1] - 2013-12-24 + +- Removed performance tests from npm package. + +## [2.0.0] - 2013-12-24 + +- Combined loops for speed up. +- Added support for the DTD and XML declaration. +- `clone` includes attributes. +- Added performance tests. +- Evaluate attribute value if function. +- Evaluate instruction value if function. + +## [1.1.2] - 2013-12-11 + +- Changed processing instruction decorator to `?`. + +## [1.1.1] - 2013-12-11 + +- Added processing instructions to JS object conversion. + +## [1.1.0] - 2013-12-10 + +- Added license to package. +- `create()` and `element()` accept JS object to fully build the document. +- Added `nod()` and `n()` aliases for `node()`. +- Renamed `convertAttChar` decorator to `convertAttKey`. +- Ignore empty decorator strings when converting JS objects. + +## [1.0.2] - 2013-11-27 + +- Removed temp file which was accidentally included in the package. + +## [1.0.1] - 2013-11-27 + +- Custom stringify functions affect current instance only. + +## [1.0.0] - 2013-11-27 + +- Added processing instructions. +- Added stringify functions to sanitize and convert input values. +- Added option for headless XML documents. +- Added vows tests. +- Removed Makefile. Using npm publish scripts instead. +- Removed the `begin()` function. `create()` begins the document by creating the root node. + +## [0.4.3] - 2013-11-08 + +- Added option to include surrogate pairs in XML content. See [#29](https://github.com/oozcitak/xmlbuilder-js/issues/29). +- Fixed empty value string representation in pretty mode. +- Added pre and postpublish scripts to package.json. +- Filtered out prototype properties when appending attributes. See [#31](https://github.com/oozcitak/xmlbuilder-js/issues/31). + +## [0.4.2] - 2012-09-14 + +- Removed README.md from `.npmignore`. + +## [0.4.1] - 2012-08-31 + +- Removed `begin()` calls in favor of `XMLBuilder` constructor. +- Added the `end()` function. `end()` is a convenience over `doc().toString()`. + +## [0.4.0] - 2012-08-31 + +- Added arguments to `XMLBuilder` constructor to allow the name of the root element and XML prolog to be defined in one line. +- Soft deprecated `begin()`. + +## [0.3.11] - 2012-08-13 + +- Package keywords are fixed to be an array of values. + +## [0.3.10] - 2012-08-13 + +- Brought back npm package contents which were lost due to incorrect configuration of `package.json` in previous releases. + +## [0.3.3] - 2012-07-27 + +- Implemented `importXMLBuilder()`. + +## [0.3.2] - 2012-07-20 + +- Fixed a duplicated escaping problem on `element()`. +- Fixed a problem with text node creation from empty string. +- Calling `root()` on the document element returns the root element. +- `XMLBuilder` no longer extends `XMLFragment`. + +## [0.3.1] - 2011-11-28 + +- Added guards for document element so that nodes cannot be inserted at document level. + +## [0.3.0] - 2011-11-28 + +- Added `doc()` to return the document element. + +## [0.2.2] - 2011-11-28 + +- Prevent code relying on `up()`'s older behavior to break. + +## [0.2.1] - 2011-11-28 + +- Added the `root()` function. + +## [0.2.0] - 2011-11-21 + +- Added Travis-CI integration. +- Added coffee-script dependency. +- Added insert, traversal and delete functions. + +## [0.1.7] - 2011-10-25 + +- No changes. Accidental release. + +## [0.1.6] - 2011-10-25 + +- Corrected `package.json` bugs link to `url` from `web`. + +## [0.1.5] - 2011-08-08 + +- Added missing npm package contents. + +## [0.1.4] - 2011-07-29 + +- Text-only nodes are no longer indented. +- Added documentation for multiple instances. + +## [0.1.3] - 2011-07-27 + +- Exported the `create()` function to return a new instance. This allows multiple builder instances to be constructed. +- Fixed `u()` function so that it now correctly calls `up()`. +- Fixed typo in `element()` so that `attributes` and `text` can be passed interchangeably. + +## [0.1.2] - 2011-06-03 + +- `ele()` accepts element text. +- `attributes()` now overrides existing attributes if passed the same attribute name. + +## [0.1.1] - 2011-05-19 + +- Added the raw output option. +- Removed most validity checks. + +## [0.1.0] - 2011-04-27 + +- `text()` and `cdata()` now return parent element. +- Attribute values are escaped. + +## [0.0.7] - 2011-04-23 + +- Coerced text values to string. + +## [0.0.6] - 2011-02-23 + +- Added support for XML comments. +- Text nodes are checked against CharData. + +## [0.0.5] - 2010-12-31 + +- Corrected the name of the main npm module in `package.json`. + +## [0.0.4] - 2010-12-28 + +- Added `.npmignore`. + +## [0.0.3] - 2010-12-27 + +- root element is now constructed in `begin()`. +- moved prolog to `begin()`. +- Added the ability to have CDATA in element text. +- Removed unused prolog aliases. +- Removed `builder()` function from main module. +- Added the name of the main npm module in `package.json`. + +## [0.0.2] - 2010-11-03 + +- `element()` expands nested arrays. +- Added pretty printing. +- Added the `up()`, `build()` and `prolog()` functions. +- Added readme. + +## 0.0.1 - 2010-11-02 + +- Initial release + +[0.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.1...v0.0.2 +[0.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.2...v0.0.3 +[0.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.3...v0.0.4 +[0.0.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.4...v0.0.5 +[0.0.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.5...v0.0.6 +[0.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.6...v0.0.7 +[0.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.7...v0.1.0 +[0.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.0...v0.1.1 +[0.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.1...v0.1.2 +[0.1.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.2...v0.1.3 +[0.1.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.3...v0.1.4 +[0.1.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.4...v0.1.5 +[0.1.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.5...v0.1.6 +[0.1.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.6...v0.1.7 +[0.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.7...v0.2.0 +[0.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.0...v0.2.1 +[0.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.1...v0.2.2 +[0.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.2...v0.3.0 +[0.3.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.0...v0.3.1 +[0.3.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.1...v0.3.2 +[0.3.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.2...v0.3.3 +[0.3.10]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.3...v0.3.10 +[0.3.11]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.10...v0.3.11 +[0.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.11...v0.4.0 +[0.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.0...v0.4.1 +[0.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.1...v0.4.2 +[0.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.2...v0.4.3 +[1.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.3...v1.0.0 +[1.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.0...v1.0.1 +[1.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.1...v1.0.2 +[1.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.2...v1.1.0 +[1.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.0...v1.1.1 +[1.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.1...v1.1.2 +[2.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.2...v2.0.0 +[2.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.0...v2.0.1 +[2.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.1...v2.1.0 +[2.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.1.0...v2.2.0 +[2.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.0...v2.2.1 +[2.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.1...v2.3.0 +[2.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.3.0...v2.4.0 +[2.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.0...v2.4.1 +[2.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.1...v2.4.2 +[2.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.2...v2.4.3 +[2.4.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.3...v2.4.4 +[2.4.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.4...v2.4.5 +[2.4.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.5...v2.4.6 +[2.5.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.6...v2.5.0 +[2.5.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.0...v2.5.1 +[2.5.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.1...v2.5.2 +[2.6.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.2...v2.6.0 +[2.6.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.0...v2.6.1 +[2.6.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.1...v2.6.2 +[2.6.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.2...v2.6.3 +[2.6.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.3...v2.6.4 +[2.6.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.4...v2.6.5 +[3.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.5...v3.0.0 +[3.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.0.0...v3.1.0 +[4.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.1.0...v4.0.0 +[4.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.0.0...v4.1.0 +[4.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.1.0...v4.2.0 +[4.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.0...v4.2.1 +[5.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.1...v5.0.0 +[5.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.0...v5.0.1 +[6.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.1...v6.0.0 +[7.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v6.0.0...v7.0.0 +[8.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v7.0.0...v8.0.0 +[8.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.0.0...v8.1.0 +[8.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.1.0...v8.2.0 +[8.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.0...v8.2.1 +[8.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.1...v8.2.2 +[9.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.2...v9.0.0 +[9.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.0...v9.0.1 +[9.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.1...v9.0.2 +[9.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.2...v9.0.3 +[9.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.3...v9.0.4 +[9.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.4...v9.0.7 +[10.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.7...v10.0.0 +[10.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.0.0...v10.1.0 +[10.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.0...v10.1.1 +[11.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.1...v11.0.0 +[11.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v11.0.0...v11.0.1 +[12.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v11.0.1...v12.0.0 +[12.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v12.0.0...v12.0.1 +[13.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v12.0.1...v13.0.0 +[13.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v13.0.0...v13.0.1 diff --git a/node_modules/xmlbuilder/LICENSE b/node_modules/xmlbuilder/LICENSE new file mode 100644 index 00000000..e7cbac9a --- /dev/null +++ b/node_modules/xmlbuilder/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Ozgur Ozcitak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/xmlbuilder/README.md b/node_modules/xmlbuilder/README.md new file mode 100644 index 00000000..c3061958 --- /dev/null +++ b/node_modules/xmlbuilder/README.md @@ -0,0 +1,97 @@ +# xmlbuilder-js + +An XML builder for [node.js](https://nodejs.org/) similar to +[java-xmlbuilder](https://github.com/jmurty/java-xmlbuilder). + +[![License](http://img.shields.io/npm/l/xmlbuilder.svg?style=flat-square)](http://opensource.org/licenses/MIT) +[![NPM Version](http://img.shields.io/npm/v/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder) +[![NPM Downloads](https://img.shields.io/npm/dm/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder) + +[![Travis Build Status](http://img.shields.io/travis/oozcitak/xmlbuilder-js.svg?style=flat-square)](http://travis-ci.org/oozcitak/xmlbuilder-js) +[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/bf7odb20hj77isry?svg=true)](https://ci.appveyor.com/project/oozcitak/xmlbuilder-js) +[![Dev Dependency Status](http://img.shields.io/david/dev/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://david-dm.org/oozcitak/xmlbuilder-js) +[![Code Coverage](https://img.shields.io/coveralls/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://coveralls.io/github/oozcitak/xmlbuilder-js) + +### Installation: + +``` sh +npm install --save xmlbuilder +``` + +### Usage: + +``` js +var builder = require('xmlbuilder'); + +var xml = builder.create('root') + .ele('xmlbuilder') + .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git') + .end({ pretty: true}); + +console.log(xml); +``` + +will result in: + +``` xml + + + + git://github.com/oozcitak/xmlbuilder-js.git + + +``` + +It is also possible to convert objects into nodes: + +``` js +var builder = require('xmlbuilder'); + +var obj = { + root: { + xmlbuilder: { + repo: { + '@type': 'git', // attributes start with @ + '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // text node + } + } + } +}; + +var xml = builder.create(obj).end({ pretty: true}); +console.log(xml); +``` + +If you need to do some processing: + +``` js +var builder = require('xmlbuilder'); + +var root = builder.create('squares'); +root.com('f(x) = x^2'); +for(var i = 1; i <= 5; i++) +{ + var item = root.ele('data'); + item.att('x', i); + item.att('y', i * i); +} + +var xml = root.end({ pretty: true}); +console.log(xml); +``` + +This will result in: + +``` xml + + + + + + + + + +``` + +See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details and [examples](https://github.com/oozcitak/xmlbuilder-js/wiki/Examples) for more complex examples. diff --git a/node_modules/xmlbuilder/lib/Derivation.js b/node_modules/xmlbuilder/lib/Derivation.js new file mode 100644 index 00000000..ae3d9517 --- /dev/null +++ b/node_modules/xmlbuilder/lib/Derivation.js @@ -0,0 +1,10 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + module.exports = { + Restriction: 1, + Extension: 2, + Union: 4, + List: 8 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/DocumentPosition.js b/node_modules/xmlbuilder/lib/DocumentPosition.js new file mode 100644 index 00000000..55abc5ce --- /dev/null +++ b/node_modules/xmlbuilder/lib/DocumentPosition.js @@ -0,0 +1,12 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + module.exports = { + Disconnected: 1, + Preceding: 2, + Following: 4, + Contains: 8, + ContainedBy: 16, + ImplementationSpecific: 32 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/NodeType.js b/node_modules/xmlbuilder/lib/NodeType.js new file mode 100644 index 00000000..40990ca2 --- /dev/null +++ b/node_modules/xmlbuilder/lib/NodeType.js @@ -0,0 +1,25 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + module.exports = { + Element: 1, + Attribute: 2, + Text: 3, + CData: 4, + EntityReference: 5, + EntityDeclaration: 6, + ProcessingInstruction: 7, + Comment: 8, + Document: 9, + DocType: 10, + DocumentFragment: 11, + NotationDeclaration: 12, + // Numeric codes up to 200 are reserved to W3C for possible future use. + // Following are types internal to this library: + Declaration: 201, + Raw: 202, + AttributeDeclaration: 203, + ElementDeclaration: 204, + Dummy: 205 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/OperationType.js b/node_modules/xmlbuilder/lib/OperationType.js new file mode 100644 index 00000000..47b10461 --- /dev/null +++ b/node_modules/xmlbuilder/lib/OperationType.js @@ -0,0 +1,11 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + module.exports = { + Clones: 1, + Imported: 2, + Deleted: 3, + Renamed: 4, + Adopted: 5 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/Utility.js b/node_modules/xmlbuilder/lib/Utility.js new file mode 100644 index 00000000..c3388650 --- /dev/null +++ b/node_modules/xmlbuilder/lib/Utility.js @@ -0,0 +1,88 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + // Copies all enumerable own properties from `sources` to `target` + var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, + hasProp = {}.hasOwnProperty; + + assign = function(target, ...sources) { + var i, key, len, source; + if (isFunction(Object.assign)) { + Object.assign.apply(null, arguments); + } else { + for (i = 0, len = sources.length; i < len; i++) { + source = sources[i]; + if (source != null) { + for (key in source) { + if (!hasProp.call(source, key)) continue; + target[key] = source[key]; + } + } + } + } + return target; + }; + + // Determines if `val` is a Function object + isFunction = function(val) { + return !!val && Object.prototype.toString.call(val) === '[object Function]'; + }; + + // Determines if `val` is an Object + isObject = function(val) { + var ref; + return !!val && ((ref = typeof val) === 'function' || ref === 'object'); + }; + + // Determines if `val` is an Array + isArray = function(val) { + if (isFunction(Array.isArray)) { + return Array.isArray(val); + } else { + return Object.prototype.toString.call(val) === '[object Array]'; + } + }; + + // Determines if `val` is an empty Array or an Object with no own properties + isEmpty = function(val) { + var key; + if (isArray(val)) { + return !val.length; + } else { + for (key in val) { + if (!hasProp.call(val, key)) continue; + return false; + } + return true; + } + }; + + // Determines if `val` is a plain Object + isPlainObject = function(val) { + var ctor, proto; + return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && (typeof ctor === 'function') && (ctor instanceof ctor) && (Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object)); + }; + + // Gets the primitive value of an object + getValue = function(obj) { + if (isFunction(obj.valueOf)) { + return obj.valueOf(); + } else { + return obj; + } + }; + + module.exports.assign = assign; + + module.exports.isFunction = isFunction; + + module.exports.isObject = isObject; + + module.exports.isArray = isArray; + + module.exports.isEmpty = isEmpty; + + module.exports.isPlainObject = isPlainObject; + + module.exports.getValue = getValue; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/WriterState.js b/node_modules/xmlbuilder/lib/WriterState.js new file mode 100644 index 00000000..b1cd7a4b --- /dev/null +++ b/node_modules/xmlbuilder/lib/WriterState.js @@ -0,0 +1,10 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + module.exports = { + None: 0, + OpenTag: 1, + InsideTag: 2, + CloseTag: 3 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLAttribute.js b/node_modules/xmlbuilder/lib/XMLAttribute.js new file mode 100644 index 00000000..71922b7d --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLAttribute.js @@ -0,0 +1,130 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLAttribute, XMLNode; + + NodeType = require('./NodeType'); + + XMLNode = require('./XMLNode'); + + // Represents an attribute + module.exports = XMLAttribute = (function() { + class XMLAttribute { + // Initializes a new instance of `XMLAttribute` + + // `parent` the parent node + // `name` attribute target + // `value` attribute value + constructor(parent, name, value) { + this.parent = parent; + if (this.parent) { + this.options = this.parent.options; + this.stringify = this.parent.stringify; + } + if (name == null) { + throw new Error("Missing attribute name. " + this.debugInfo(name)); + } + this.name = this.stringify.name(name); + this.value = this.stringify.attValue(value); + this.type = NodeType.Attribute; + // DOM level 3 + this.isId = false; + this.schemaTypeInfo = null; + } + + // Creates and returns a deep clone of `this` + clone() { + return Object.create(this); + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.attribute(this, this.options.writer.filterOptions(options)); + } + + + // Returns debug string for this node + debugInfo(name) { + name = name || this.name; + if (name == null) { + return "parent: <" + this.parent.name + ">"; + } else { + return "attribute: {" + name + "}, parent: <" + this.parent.name + ">"; + } + } + + isEqualNode(node) { + if (node.namespaceURI !== this.namespaceURI) { + return false; + } + if (node.prefix !== this.prefix) { + return false; + } + if (node.localName !== this.localName) { + return false; + } + if (node.value !== this.value) { + return false; + } + return true; + } + + }; + + // DOM level 1 + Object.defineProperty(XMLAttribute.prototype, 'nodeType', { + get: function() { + return this.type; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'ownerElement', { + get: function() { + return this.parent; + } + }); + + // DOM level 3 + Object.defineProperty(XMLAttribute.prototype, 'textContent', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + // DOM level 4 + Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'prefix', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'localName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'specified', { + get: function() { + return true; + } + }); + + return XMLAttribute; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLCData.js b/node_modules/xmlbuilder/lib/XMLCData.js new file mode 100644 index 00000000..91a44105 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLCData.js @@ -0,0 +1,41 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLCData, XMLCharacterData; + + NodeType = require('./NodeType'); + + XMLCharacterData = require('./XMLCharacterData'); + + // Represents a CDATA node + module.exports = XMLCData = class XMLCData extends XMLCharacterData { + // Initializes a new instance of `XMLCData` + + // `text` CDATA text + constructor(parent, text) { + super(parent); + if (text == null) { + throw new Error("Missing CDATA text. " + this.debugInfo()); + } + this.name = "#cdata-section"; + this.type = NodeType.CData; + this.value = this.stringify.cdata(text); + } + + // Creates and returns a deep clone of `this` + clone() { + return Object.create(this); + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.cdata(this, this.options.writer.filterOptions(options)); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLCharacterData.js b/node_modules/xmlbuilder/lib/XMLCharacterData.js new file mode 100644 index 00000000..13b9c003 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLCharacterData.js @@ -0,0 +1,86 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var XMLCharacterData, XMLNode; + + XMLNode = require('./XMLNode'); + + // Represents a character data node + module.exports = XMLCharacterData = (function() { + class XMLCharacterData extends XMLNode { + // Initializes a new instance of `XMLCharacterData` + + constructor(parent) { + super(parent); + this.value = ''; + } + + + // Creates and returns a deep clone of `this` + clone() { + return Object.create(this); + } + + // DOM level 1 functions to be implemented later + substringData(offset, count) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + appendData(arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + insertData(offset, arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + deleteData(offset, count) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + replaceData(offset, count, arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + isEqualNode(node) { + if (!super.isEqualNode(node)) { + return false; + } + if (node.data !== this.data) { + return false; + } + return true; + } + + }; + + // DOM level 1 + Object.defineProperty(XMLCharacterData.prototype, 'data', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + Object.defineProperty(XMLCharacterData.prototype, 'length', { + get: function() { + return this.value.length; + } + }); + + // DOM level 3 + Object.defineProperty(XMLCharacterData.prototype, 'textContent', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + return XMLCharacterData; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLComment.js b/node_modules/xmlbuilder/lib/XMLComment.js new file mode 100644 index 00000000..2254d634 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLComment.js @@ -0,0 +1,41 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLCharacterData, XMLComment; + + NodeType = require('./NodeType'); + + XMLCharacterData = require('./XMLCharacterData'); + + // Represents a comment node + module.exports = XMLComment = class XMLComment extends XMLCharacterData { + // Initializes a new instance of `XMLComment` + + // `text` comment text + constructor(parent, text) { + super(parent); + if (text == null) { + throw new Error("Missing comment text. " + this.debugInfo()); + } + this.name = "#comment"; + this.type = NodeType.Comment; + this.value = this.stringify.comment(text); + } + + // Creates and returns a deep clone of `this` + clone() { + return Object.create(this); + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.comment(this, this.options.writer.filterOptions(options)); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js b/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js new file mode 100644 index 00000000..32e896d7 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js @@ -0,0 +1,80 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList; + + XMLDOMErrorHandler = require('./XMLDOMErrorHandler'); + + XMLDOMStringList = require('./XMLDOMStringList'); + + // Implements the DOMConfiguration interface + module.exports = XMLDOMConfiguration = (function() { + class XMLDOMConfiguration { + constructor() { + var clonedSelf; + this.defaultParams = { + "canonical-form": false, + "cdata-sections": false, + "comments": false, + "datatype-normalization": false, + "element-content-whitespace": true, + "entities": true, + "error-handler": new XMLDOMErrorHandler(), + "infoset": true, + "validate-if-schema": false, + "namespaces": true, + "namespace-declarations": true, + "normalize-characters": false, + "schema-location": '', + "schema-type": '', + "split-cdata-sections": true, + "validate": false, + "well-formed": true + }; + this.params = clonedSelf = Object.create(this.defaultParams); + } + + // Gets the value of a parameter. + + // `name` name of the parameter + getParameter(name) { + if (this.params.hasOwnProperty(name)) { + return this.params[name]; + } else { + return null; + } + } + + // Checks if setting a parameter to a specific value is supported. + + // `name` name of the parameter + // `value` parameter value + canSetParameter(name, value) { + return true; + } + + // Sets the value of a parameter. + + // `name` name of the parameter + // `value` new value or null if the user wishes to unset the parameter + setParameter(name, value) { + if (value != null) { + return this.params[name] = value; + } else { + return delete this.params[name]; + } + } + + }; + + // Returns the list of parameter names + Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', { + get: function() { + return new XMLDOMStringList(Object.keys(this.defaultParams)); + } + }); + + return XMLDOMConfiguration; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js b/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js new file mode 100644 index 00000000..b546a0c7 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js @@ -0,0 +1,20 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + // Represents the error handler for DOM operations + var XMLDOMErrorHandler; + + module.exports = XMLDOMErrorHandler = class XMLDOMErrorHandler { + // Initializes a new instance of `XMLDOMErrorHandler` + + constructor() {} + + // Called on the error handler when an error occurs. + + // `error` the error message as a string + handleError(error) { + throw new Error(error); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDOMImplementation.js b/node_modules/xmlbuilder/lib/XMLDOMImplementation.js new file mode 100644 index 00000000..4b5be798 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDOMImplementation.js @@ -0,0 +1,55 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + // Implements the DOMImplementation interface + var XMLDOMImplementation; + + module.exports = XMLDOMImplementation = class XMLDOMImplementation { + // Tests if the DOM implementation implements a specific feature. + + // `feature` package name of the feature to test. In Level 1, the + // legal values are "HTML" and "XML" (case-insensitive). + // `version` version number of the package name to test. + // In Level 1, this is the string "1.0". If the version is + // not specified, supporting any version of the feature will + // cause the method to return true. + hasFeature(feature, version) { + return true; + } + + // Creates a new document type declaration. + + // `qualifiedName` qualified name of the document type to be created + // `publicId` public identifier of the external subset + // `systemId` system identifier of the external subset + createDocumentType(qualifiedName, publicId, systemId) { + throw new Error("This DOM method is not implemented."); + } + + // Creates a new document. + + // `namespaceURI` namespace URI of the document element to create + // `qualifiedName` the qualified name of the document to be created + // `doctype` the type of document to be created or null + createDocument(namespaceURI, qualifiedName, doctype) { + throw new Error("This DOM method is not implemented."); + } + + // Creates a new HTML document. + + // `title` document title + createHTMLDocument(title) { + throw new Error("This DOM method is not implemented."); + } + + // Returns a specialized object which implements the specialized APIs + // of the specified feature and version. + + // `feature` name of the feature requested. + // `version` version number of the feature to test + getFeature(feature, version) { + throw new Error("This DOM method is not implemented."); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDOMStringList.js b/node_modules/xmlbuilder/lib/XMLDOMStringList.js new file mode 100644 index 00000000..7e87e8e3 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDOMStringList.js @@ -0,0 +1,44 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + // Represents a list of string entries + var XMLDOMStringList; + + module.exports = XMLDOMStringList = (function() { + class XMLDOMStringList { + // Initializes a new instance of `XMLDOMStringList` + // This is just a wrapper around an ordinary + // JS array. + + // `arr` the array of string values + constructor(arr) { + this.arr = arr || []; + } + + // Returns the indexth item in the collection. + + // `index` index into the collection + item(index) { + return this.arr[index] || null; + } + + // Test if a string is part of this DOMStringList. + + // `str` the string to look for + contains(str) { + return this.arr.indexOf(str) !== -1; + } + + }; + + // Returns the number of strings in the list. + Object.defineProperty(XMLDOMStringList.prototype, 'length', { + get: function() { + return this.arr.length; + } + }); + + return XMLDOMStringList; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDTDAttList.js b/node_modules/xmlbuilder/lib/XMLDTDAttList.js new file mode 100644 index 00000000..8637ea25 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDTDAttList.js @@ -0,0 +1,66 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDTDAttList, XMLNode; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + // Represents an attribute list + module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode { + // Initializes a new instance of `XMLDTDAttList` + + // `parent` the parent `XMLDocType` element + // `elementName` the name of the element containing this attribute + // `attributeName` attribute name + // `attributeType` type of the attribute + // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, + // #FIXED or #DEFAULT) + // `defaultValue` default value of the attribute + // (only used for #FIXED or #DEFAULT) + constructor(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { + super(parent); + if (elementName == null) { + throw new Error("Missing DTD element name. " + this.debugInfo()); + } + if (attributeName == null) { + throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName)); + } + if (!attributeType) { + throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName)); + } + if (!defaultValueType) { + throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName)); + } + if (defaultValueType.indexOf('#') !== 0) { + defaultValueType = '#' + defaultValueType; + } + if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) { + throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName)); + } + if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) { + throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName)); + } + this.elementName = this.stringify.name(elementName); + this.type = NodeType.AttributeDeclaration; + this.attributeName = this.stringify.name(attributeName); + this.attributeType = this.stringify.dtdAttType(attributeType); + if (defaultValue) { + this.defaultValue = this.stringify.dtdAttDefault(defaultValue); + } + this.defaultValueType = defaultValueType; + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options)); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDTDElement.js b/node_modules/xmlbuilder/lib/XMLDTDElement.js new file mode 100644 index 00000000..a1546791 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDTDElement.js @@ -0,0 +1,44 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDTDElement, XMLNode; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + // Represents an attribute + module.exports = XMLDTDElement = class XMLDTDElement extends XMLNode { + // Initializes a new instance of `XMLDTDElement` + + // `parent` the parent `XMLDocType` element + // `name` element name + // `value` element content (defaults to #PCDATA) + constructor(parent, name, value) { + super(parent); + if (name == null) { + throw new Error("Missing DTD element name. " + this.debugInfo()); + } + if (!value) { + value = '(#PCDATA)'; + } + if (Array.isArray(value)) { + value = '(' + value.join(',') + ')'; + } + this.name = this.stringify.name(name); + this.type = NodeType.ElementDeclaration; + this.value = this.stringify.dtdElementValue(value); + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options)); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDTDEntity.js b/node_modules/xmlbuilder/lib/XMLDTDEntity.js new file mode 100644 index 00000000..76bf6655 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDTDEntity.js @@ -0,0 +1,115 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDTDEntity, XMLNode, isObject; + + ({isObject} = require('./Utility')); + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + // Represents an entity declaration in the DTD + module.exports = XMLDTDEntity = (function() { + class XMLDTDEntity extends XMLNode { + // Initializes a new instance of `XMLDTDEntity` + + // `parent` the parent `XMLDocType` element + // `pe` whether this is a parameter entity or a general entity + // defaults to `false` (general entity) + // `name` the name of the entity + // `value` internal entity value or an object with external entity details + // `value.pubID` public identifier + // `value.sysID` system identifier + // `value.nData` notation declaration + constructor(parent, pe, name, value) { + super(parent); + if (name == null) { + throw new Error("Missing DTD entity name. " + this.debugInfo(name)); + } + if (value == null) { + throw new Error("Missing DTD entity value. " + this.debugInfo(name)); + } + this.pe = !!pe; + this.name = this.stringify.name(name); + this.type = NodeType.EntityDeclaration; + if (!isObject(value)) { + this.value = this.stringify.dtdEntityValue(value); + this.internal = true; + } else { + if (!value.pubID && !value.sysID) { + throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name)); + } + if (value.pubID && !value.sysID) { + throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name)); + } + this.internal = false; + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + if (value.nData != null) { + this.nData = this.stringify.dtdNData(value.nData); + } + if (this.pe && this.nData) { + throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name)); + } + } + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options)); + } + + }; + + // DOM level 1 + Object.defineProperty(XMLDTDEntity.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'notationName', { + get: function() { + return this.nData || null; + } + }); + + // DOM level 3 + Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', { + get: function() { + return null; + } + }); + + return XMLDTDEntity; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDTDNotation.js b/node_modules/xmlbuilder/lib/XMLDTDNotation.js new file mode 100644 index 00000000..37a469a8 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDTDNotation.js @@ -0,0 +1,66 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDTDNotation, XMLNode; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + // Represents a NOTATION entry in the DTD + module.exports = XMLDTDNotation = (function() { + class XMLDTDNotation extends XMLNode { + // Initializes a new instance of `XMLDTDNotation` + + // `parent` the parent `XMLDocType` element + // `name` the name of the notation + // `value` an object with external entity details + // `value.pubID` public identifier + // `value.sysID` system identifier + constructor(parent, name, value) { + super(parent); + if (name == null) { + throw new Error("Missing DTD notation name. " + this.debugInfo(name)); + } + if (!value.pubID && !value.sysID) { + throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name)); + } + this.name = this.stringify.name(name); + this.type = NodeType.NotationDeclaration; + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options)); + } + + }; + + // DOM level 1 + Object.defineProperty(XMLDTDNotation.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDTDNotation.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + return XMLDTDNotation; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDeclaration.js b/node_modules/xmlbuilder/lib/XMLDeclaration.js new file mode 100644 index 00000000..90b8edc1 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDeclaration.js @@ -0,0 +1,51 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDeclaration, XMLNode, isObject; + + ({isObject} = require('./Utility')); + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + // Represents the XML declaration + module.exports = XMLDeclaration = class XMLDeclaration extends XMLNode { + // Initializes a new instance of `XMLDeclaration` + + // `parent` the document object + + // `version` A version number string, e.g. 1.0 + // `encoding` Encoding declaration, e.g. UTF-8 + // `standalone` standalone document declaration: true or false + constructor(parent, version, encoding, standalone) { + super(parent); + // arguments may also be passed as an object + if (isObject(version)) { + ({version, encoding, standalone} = version); + } + if (!version) { + version = '1.0'; + } + this.type = NodeType.Declaration; + this.version = this.stringify.xmlVersion(version); + if (encoding != null) { + this.encoding = this.stringify.xmlEncoding(encoding); + } + if (standalone != null) { + this.standalone = this.stringify.xmlStandalone(standalone); + } + } + + // Converts to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.declaration(this, this.options.writer.filterOptions(options)); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDocType.js b/node_modules/xmlbuilder/lib/XMLDocType.js new file mode 100644 index 00000000..4af825fb --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDocType.js @@ -0,0 +1,235 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject; + + ({isObject} = require('./Utility')); + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + XMLDTDAttList = require('./XMLDTDAttList'); + + XMLDTDEntity = require('./XMLDTDEntity'); + + XMLDTDElement = require('./XMLDTDElement'); + + XMLDTDNotation = require('./XMLDTDNotation'); + + XMLNamedNodeMap = require('./XMLNamedNodeMap'); + + // Represents doctype declaration + module.exports = XMLDocType = (function() { + class XMLDocType extends XMLNode { + // Initializes a new instance of `XMLDocType` + + // `parent` the document object + + // `pubID` public identifier of the external subset + // `sysID` system identifier of the external subset + constructor(parent, pubID, sysID) { + var child, i, len, ref; + super(parent); + this.type = NodeType.DocType; + // set DTD name to the name of the root node + if (parent.children) { + ref = parent.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType.Element) { + this.name = child.name; + break; + } + } + } + this.documentObject = parent; + // arguments may also be passed as an object + if (isObject(pubID)) { + ({pubID, sysID} = pubID); + } + if (sysID == null) { + [sysID, pubID] = [pubID, sysID]; + } + if (pubID != null) { + this.pubID = this.stringify.dtdPubID(pubID); + } + if (sysID != null) { + this.sysID = this.stringify.dtdSysID(sysID); + } + } + + // Creates an element type declaration + + // `name` element name + // `value` element content (defaults to #PCDATA) + element(name, value) { + var child; + child = new XMLDTDElement(this, name, value); + this.children.push(child); + return this; + } + + // Creates an attribute declaration + + // `elementName` the name of the element containing this attribute + // `attributeName` attribute name + // `attributeType` type of the attribute (defaults to CDATA) + // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, #FIXED or + // #DEFAULT) (defaults to #IMPLIED) + // `defaultValue` default value of the attribute + // (only used for #FIXED or #DEFAULT) + attList(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var child; + child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.children.push(child); + return this; + } + + // Creates a general entity declaration + + // `name` the name of the entity + // `value` internal entity value or an object with external entity details + // `value.pubID` public identifier + // `value.sysID` system identifier + // `value.nData` notation declaration + entity(name, value) { + var child; + child = new XMLDTDEntity(this, false, name, value); + this.children.push(child); + return this; + } + + // Creates a parameter entity declaration + + // `name` the name of the entity + // `value` internal entity value or an object with external entity details + // `value.pubID` public identifier + // `value.sysID` system identifier + pEntity(name, value) { + var child; + child = new XMLDTDEntity(this, true, name, value); + this.children.push(child); + return this; + } + + // Creates a NOTATION declaration + + // `name` the name of the notation + // `value` an object with external entity details + // `value.pubID` public identifier + // `value.sysID` system identifier + notation(name, value) { + var child; + child = new XMLDTDNotation(this, name, value); + this.children.push(child); + return this; + } + + // Converts to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.docType(this, this.options.writer.filterOptions(options)); + } + + // Aliases + ele(name, value) { + return this.element(name, value); + } + + att(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); + } + + ent(name, value) { + return this.entity(name, value); + } + + pent(name, value) { + return this.pEntity(name, value); + } + + not(name, value) { + return this.notation(name, value); + } + + up() { + return this.root() || this.documentObject; + } + + isEqualNode(node) { + if (!super.isEqualNode(node)) { + return false; + } + if (node.name !== this.name) { + return false; + } + if (node.publicId !== this.publicId) { + return false; + } + if (node.systemId !== this.systemId) { + return false; + } + return true; + } + + }; + + // DOM level 1 + Object.defineProperty(XMLDocType.prototype, 'entities', { + get: function() { + var child, i, len, nodes, ref; + nodes = {}; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if ((child.type === NodeType.EntityDeclaration) && !child.pe) { + nodes[child.name] = child; + } + } + return new XMLNamedNodeMap(nodes); + } + }); + + Object.defineProperty(XMLDocType.prototype, 'notations', { + get: function() { + var child, i, len, nodes, ref; + nodes = {}; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType.NotationDeclaration) { + nodes[child.name] = child; + } + } + return new XMLNamedNodeMap(nodes); + } + }); + + // DOM level 2 + Object.defineProperty(XMLDocType.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDocType.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + Object.defineProperty(XMLDocType.prototype, 'internalSubset', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + return XMLDocType; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDocument.js b/node_modules/xmlbuilder/lib/XMLDocument.js new file mode 100644 index 00000000..56ec08fd --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDocument.js @@ -0,0 +1,282 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject; + + ({isPlainObject} = require('./Utility')); + + XMLDOMImplementation = require('./XMLDOMImplementation'); + + XMLDOMConfiguration = require('./XMLDOMConfiguration'); + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + XMLStringifier = require('./XMLStringifier'); + + XMLStringWriter = require('./XMLStringWriter'); + + // Represents an XML builder + module.exports = XMLDocument = (function() { + class XMLDocument extends XMLNode { + // Initializes a new instance of `XMLDocument` + + // `options.keepNullNodes` whether nodes with null values will be kept + // or ignored: true or false + // `options.keepNullAttributes` whether attributes with null values will be + // kept or ignored: true or false + // `options.ignoreDecorators` whether decorator strings will be ignored when + // converting JS objects: true or false + // `options.separateArrayItems` whether array items are created as separate + // nodes when passed as an object value: true or false + // `options.noDoubleEncoding` whether existing html entities are encoded: + // true or false + // `options.stringify` a set of functions to use for converting values to + // strings + // `options.writer` the default XML writer to use for converting nodes to + // string. If the default writer is not set, the built-in XMLStringWriter + // will be used instead. + constructor(options) { + super(null); + this.name = "#document"; + this.type = NodeType.Document; + this.documentURI = null; + this.domConfig = new XMLDOMConfiguration(); + options || (options = {}); + if (!options.writer) { + options.writer = new XMLStringWriter(); + } + this.options = options; + this.stringify = new XMLStringifier(options); + } + + // Ends the document and passes it to the given XML writer + + // `writer` is either an XML writer or a plain object to pass to the + // constructor of the default XML writer. The default writer is assigned when + // creating the XML document. Following flags are recognized by the + // built-in XMLStringWriter: + // `writer.pretty` pretty prints the result + // `writer.indent` indentation for pretty print + // `writer.offset` how many indentations to add to every line for pretty print + // `writer.newline` newline sequence for pretty print + end(writer) { + var writerOptions; + writerOptions = {}; + if (!writer) { + writer = this.options.writer; + } else if (isPlainObject(writer)) { + writerOptions = writer; + writer = this.options.writer; + } + return writer.document(this, writer.filterOptions(writerOptions)); + } + + // Converts the XML document to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.document(this, this.options.writer.filterOptions(options)); + } + + // DOM level 1 functions to be implemented later + createElement(tagName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createDocumentFragment() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createTextNode(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createComment(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createCDATASection(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createProcessingInstruction(target, data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createAttribute(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createEntityReference(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getElementsByTagName(tagname) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + // DOM level 2 functions to be implemented later + importNode(importedNode, deep) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createElementNS(namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createAttributeNS(namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getElementsByTagNameNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getElementById(elementId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + // DOM level 3 functions to be implemented later + adoptNode(source) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + normalizeDocument() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + renameNode(node, namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + // DOM level 4 functions to be implemented later + getElementsByClassName(classNames) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createEvent(eventInterface) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createRange() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createNodeIterator(root, whatToShow, filter) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + createTreeWalker(root, whatToShow, filter) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + }; + + // DOM level 1 + Object.defineProperty(XMLDocument.prototype, 'implementation', { + value: new XMLDOMImplementation() + }); + + Object.defineProperty(XMLDocument.prototype, 'doctype', { + get: function() { + var child, i, len, ref; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType.DocType) { + return child; + } + } + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'documentElement', { + get: function() { + return this.rootObject || null; + } + }); + + // DOM level 3 + Object.defineProperty(XMLDocument.prototype, 'inputEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', { + get: function() { + return false; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) { + return this.children[0].encoding; + } else { + return null; + } + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) { + return this.children[0].standalone === 'yes'; + } else { + return false; + } + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlVersion', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) { + return this.children[0].version; + } else { + return "1.0"; + } + } + }); + + // DOM level 4 + Object.defineProperty(XMLDocument.prototype, 'URL', { + get: function() { + return this.documentURI; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'origin', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'compatMode', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'characterSet', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'contentType', { + get: function() { + return null; + } + }); + + return XMLDocument; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDocumentCB.js b/node_modules/xmlbuilder/lib/XMLDocumentCB.js new file mode 100644 index 00000000..c55a4bf3 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDocumentCB.js @@ -0,0 +1,650 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, + hasProp = {}.hasOwnProperty; + + ({isObject, isFunction, isPlainObject, getValue} = require('./Utility')); + + NodeType = require('./NodeType'); + + XMLDocument = require('./XMLDocument'); + + XMLElement = require('./XMLElement'); + + XMLCData = require('./XMLCData'); + + XMLComment = require('./XMLComment'); + + XMLRaw = require('./XMLRaw'); + + XMLText = require('./XMLText'); + + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + + XMLDeclaration = require('./XMLDeclaration'); + + XMLDocType = require('./XMLDocType'); + + XMLDTDAttList = require('./XMLDTDAttList'); + + XMLDTDEntity = require('./XMLDTDEntity'); + + XMLDTDElement = require('./XMLDTDElement'); + + XMLDTDNotation = require('./XMLDTDNotation'); + + XMLAttribute = require('./XMLAttribute'); + + XMLStringifier = require('./XMLStringifier'); + + XMLStringWriter = require('./XMLStringWriter'); + + WriterState = require('./WriterState'); + + // Represents an XML builder + module.exports = XMLDocumentCB = class XMLDocumentCB { + // Initializes a new instance of `XMLDocumentCB` + + // `options.keepNullNodes` whether nodes with null values will be kept + // or ignored: true or false + // `options.keepNullAttributes` whether attributes with null values will be + // kept or ignored: true or false + // `options.ignoreDecorators` whether decorator strings will be ignored when + // converting JS objects: true or false + // `options.separateArrayItems` whether array items are created as separate + // nodes when passed as an object value: true or false + // `options.noDoubleEncoding` whether existing html entities are encoded: + // true or false + // `options.stringify` a set of functions to use for converting values to + // strings + // `options.writer` the default XML writer to use for converting nodes to + // string. If the default writer is not set, the built-in XMLStringWriter + // will be used instead. + + // `onData` the function to be called when a new chunk of XML is output. The + // string containing the XML chunk is passed to `onData` as its first + // argument, and the current indentation level as its second argument. + // `onEnd` the function to be called when the XML document is completed with + // `end`. `onEnd` does not receive any arguments. + constructor(options, onData, onEnd) { + var writerOptions; + this.name = "?xml"; + this.type = NodeType.Document; + options || (options = {}); + writerOptions = {}; + if (!options.writer) { + options.writer = new XMLStringWriter(); + } else if (isPlainObject(options.writer)) { + writerOptions = options.writer; + options.writer = new XMLStringWriter(); + } + this.options = options; + this.writer = options.writer; + this.writerOptions = this.writer.filterOptions(writerOptions); + this.stringify = new XMLStringifier(options); + this.onDataCallback = onData || function() {}; + this.onEndCallback = onEnd || function() {}; + this.currentNode = null; + this.currentLevel = -1; + this.openTags = {}; + this.documentStarted = false; + this.documentCompleted = false; + this.root = null; + } + + // Creates a child element node from the given XMLNode + + // `node` the child node + createChildNode(node) { + var att, attName, attributes, child, i, len, ref, ref1; + switch (node.type) { + case NodeType.CData: + this.cdata(node.value); + break; + case NodeType.Comment: + this.comment(node.value); + break; + case NodeType.Element: + attributes = {}; + ref = node.attribs; + for (attName in ref) { + if (!hasProp.call(ref, attName)) continue; + att = ref[attName]; + attributes[attName] = att.value; + } + this.node(node.name, attributes); + break; + case NodeType.Dummy: + this.dummy(); + break; + case NodeType.Raw: + this.raw(node.value); + break; + case NodeType.Text: + this.text(node.value); + break; + case NodeType.ProcessingInstruction: + this.instruction(node.target, node.value); + break; + default: + throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name); + } + ref1 = node.children; + // write child nodes recursively + for (i = 0, len = ref1.length; i < len; i++) { + child = ref1[i]; + this.createChildNode(child); + if (child.type === NodeType.Element) { + this.up(); + } + } + return this; + } + + // Creates a dummy node + + dummy() { + // no-op, just return this + return this; + } + + // Creates a node + + // `name` name of the node + // `attributes` an object containing name/value pairs of attributes + // `text` element text + node(name, attributes, text) { + if (name == null) { + throw new Error("Missing node name."); + } + if (this.root && this.currentLevel === -1) { + throw new Error("Document can only have one root node. " + this.debugInfo(name)); + } + this.openCurrent(); + name = getValue(name); + if (attributes == null) { + attributes = {}; + } + attributes = getValue(attributes); + // swap argument order: text <-> attributes + if (!isObject(attributes)) { + [text, attributes] = [attributes, text]; + } + this.currentNode = new XMLElement(this, name, attributes); + this.currentNode.children = false; + this.currentLevel++; + this.openTags[this.currentLevel] = this.currentNode; + if (text != null) { + this.text(text); + } + return this; + } + + // Creates a child element node or an element type declaration when called + // inside the DTD + + // `name` name of the node + // `attributes` an object containing name/value pairs of attributes + // `text` element text + element(name, attributes, text) { + var child, i, len, oldValidationFlag, ref, root; + if (this.currentNode && this.currentNode.type === NodeType.DocType) { + this.dtdElement(...arguments); + } else { + if (Array.isArray(name) || isObject(name) || isFunction(name)) { + oldValidationFlag = this.options.noValidation; + this.options.noValidation = true; + root = new XMLDocument(this.options).element('TEMP_ROOT'); + root.element(name); + this.options.noValidation = oldValidationFlag; + ref = root.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + this.createChildNode(child); + if (child.type === NodeType.Element) { + this.up(); + } + } + } else { + this.node(name, attributes, text); + } + } + return this; + } + + // Adds or modifies an attribute + + // `name` attribute name + // `value` attribute value + attribute(name, value) { + var attName, attValue; + if (!this.currentNode || this.currentNode.children) { + throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name)); + } + if (name != null) { + name = getValue(name); + } + if (isObject(name)) { // expand if object + for (attName in name) { + if (!hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + if (this.options.keepNullAttributes && (value == null)) { + this.currentNode.attribs[name] = new XMLAttribute(this, name, ""); + } else if (value != null) { + this.currentNode.attribs[name] = new XMLAttribute(this, name, value); + } + } + return this; + } + + // Creates a text node + + // `value` element text + text(value) { + var node; + this.openCurrent(); + node = new XMLText(this, value); + this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Creates a CDATA node + + // `value` element text without CDATA delimiters + cdata(value) { + var node; + this.openCurrent(); + node = new XMLCData(this, value); + this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Creates a comment node + + // `value` comment text + comment(value) { + var node; + this.openCurrent(); + node = new XMLComment(this, value); + this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Adds unescaped raw text + + // `value` text + raw(value) { + var node; + this.openCurrent(); + node = new XMLRaw(this, value); + this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Adds a processing instruction + + // `target` instruction target + // `value` instruction value + instruction(target, value) { + var i, insTarget, insValue, len, node; + this.openCurrent(); + if (target != null) { + target = getValue(target); + } + if (value != null) { + value = getValue(value); + } + if (Array.isArray(target)) { // expand if array + for (i = 0, len = target.length; i < len; i++) { + insTarget = target[i]; + this.instruction(insTarget); + } + } else if (isObject(target)) { // expand if object + for (insTarget in target) { + if (!hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + node = new XMLProcessingInstruction(this, target, value); + this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + } + return this; + } + + // Creates the xml declaration + + // `version` A version number string, e.g. 1.0 + // `encoding` Encoding declaration, e.g. UTF-8 + // `standalone` standalone document declaration: true or false + declaration(version, encoding, standalone) { + var node; + this.openCurrent(); + if (this.documentStarted) { + throw new Error("declaration() must be the first node."); + } + node = new XMLDeclaration(this, version, encoding, standalone); + this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Creates the document type declaration + + // `root` the name of the root node + // `pubID` the public identifier of the external subset + // `sysID` the system identifier of the external subset + doctype(root, pubID, sysID) { + this.openCurrent(); + if (root == null) { + throw new Error("Missing root node name."); + } + if (this.root) { + throw new Error("dtd() must come before the root node."); + } + this.currentNode = new XMLDocType(this, pubID, sysID); + this.currentNode.rootNodeName = root; + this.currentNode.children = false; + this.currentLevel++; + this.openTags[this.currentLevel] = this.currentNode; + return this; + } + + // Creates an element type declaration + + // `name` element name + // `value` element content (defaults to #PCDATA) + dtdElement(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDElement(this, name, value); + this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Creates an attribute declaration + + // `elementName` the name of the element containing this attribute + // `attributeName` attribute name + // `attributeType` type of the attribute (defaults to CDATA) + // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, #FIXED or + // #DEFAULT) (defaults to #IMPLIED) + // `defaultValue` default value of the attribute + // (only used for #FIXED or #DEFAULT) + attList(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var node; + this.openCurrent(); + node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Creates a general entity declaration + + // `name` the name of the entity + // `value` internal entity value or an object with external entity details + // `value.pubID` public identifier + // `value.sysID` system identifier + // `value.nData` notation declaration + entity(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDEntity(this, false, name, value); + this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Creates a parameter entity declaration + + // `name` the name of the entity + // `value` internal entity value or an object with external entity details + // `value.pubID` public identifier + // `value.sysID` system identifier + pEntity(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDEntity(this, true, name, value); + this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Creates a NOTATION declaration + + // `name` the name of the notation + // `value` an object with external entity details + // `value.pubID` public identifier + // `value.sysID` system identifier + notation(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDNotation(this, name, value); + this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + } + + // Gets the parent node + up() { + if (this.currentLevel < 0) { + throw new Error("The document node has no parent."); + } + if (this.currentNode) { + if (this.currentNode.children) { + this.closeNode(this.currentNode); + } else { + this.openNode(this.currentNode); + } + this.currentNode = null; + } else { + this.closeNode(this.openTags[this.currentLevel]); + } + delete this.openTags[this.currentLevel]; + this.currentLevel--; + return this; + } + + // Ends the document + end() { + while (this.currentLevel >= 0) { + this.up(); + } + return this.onEnd(); + } + + // Opens the current parent node + openCurrent() { + if (this.currentNode) { + this.currentNode.children = true; + return this.openNode(this.currentNode); + } + } + + // Writes the opening tag of the current node or the entire node if it has + // no child nodes + openNode(node) { + var att, chunk, name, ref; + if (!node.isOpen) { + if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) { + this.root = node; + } + chunk = ''; + if (node.type === NodeType.Element) { + this.writerOptions.state = WriterState.OpenTag; + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name; + ref = node.attribs; + for (name in ref) { + if (!hasProp.call(ref, name)) continue; + att = ref[name]; + chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel); + } + chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel); + this.writerOptions.state = WriterState.InsideTag; // if node.type is NodeType.DocType + } else { + this.writerOptions.state = WriterState.OpenTag; + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ''; + } + chunk += this.writer.endline(node, this.writerOptions, this.currentLevel); + } + this.onData(chunk, this.currentLevel); + return node.isOpen = true; + } + } + + // Writes the closing tag of the current node + closeNode(node) { + var chunk; + if (!node.isClosed) { + chunk = ''; + this.writerOptions.state = WriterState.CloseTag; + if (node.type === NodeType.Element) { + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '' + this.writer.endline(node, this.writerOptions, this.currentLevel); // if node.type is NodeType.DocType + } else { + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel); + } + this.writerOptions.state = WriterState.None; + this.onData(chunk, this.currentLevel); + return node.isClosed = true; + } + } + + // Called when a new chunk of XML is output + + // `chunk` a string containing the XML chunk + // `level` current indentation level + onData(chunk, level) { + this.documentStarted = true; + return this.onDataCallback(chunk, level + 1); + } + + // Called when the XML document is completed + onEnd() { + this.documentCompleted = true; + return this.onEndCallback(); + } + + // Returns debug string + debugInfo(name) { + if (name == null) { + return ""; + } else { + return "node: <" + name + ">"; + } + } + + // Node aliases + ele() { + return this.element(...arguments); + } + + nod(name, attributes, text) { + return this.node(name, attributes, text); + } + + txt(value) { + return this.text(value); + } + + dat(value) { + return this.cdata(value); + } + + com(value) { + return this.comment(value); + } + + ins(target, value) { + return this.instruction(target, value); + } + + dec(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + } + + dtd(root, pubID, sysID) { + return this.doctype(root, pubID, sysID); + } + + e(name, attributes, text) { + return this.element(name, attributes, text); + } + + n(name, attributes, text) { + return this.node(name, attributes, text); + } + + t(value) { + return this.text(value); + } + + d(value) { + return this.cdata(value); + } + + c(value) { + return this.comment(value); + } + + r(value) { + return this.raw(value); + } + + i(target, value) { + return this.instruction(target, value); + } + + // Attribute aliases + att() { + if (this.currentNode && this.currentNode.type === NodeType.DocType) { + return this.attList(...arguments); + } else { + return this.attribute(...arguments); + } + } + + a() { + if (this.currentNode && this.currentNode.type === NodeType.DocType) { + return this.attList(...arguments); + } else { + return this.attribute(...arguments); + } + } + + // DTD aliases + // att() and ele() are defined above + ent(name, value) { + return this.entity(name, value); + } + + pent(name, value) { + return this.pEntity(name, value); + } + + not(name, value) { + return this.notation(name, value); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDocumentFragment.js b/node_modules/xmlbuilder/lib/XMLDocumentFragment.js new file mode 100644 index 00000000..fbd42bad --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDocumentFragment.js @@ -0,0 +1,21 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDocumentFragment, XMLNode; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + // Represents a CDATA node + module.exports = XMLDocumentFragment = class XMLDocumentFragment extends XMLNode { + // Initializes a new instance of `XMLDocumentFragment` + + constructor() { + super(null); + this.name = "#document-fragment"; + this.type = NodeType.DocumentFragment; + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDummy.js b/node_modules/xmlbuilder/lib/XMLDummy.js new file mode 100644 index 00000000..06ab8afa --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDummy.js @@ -0,0 +1,39 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLDummy, XMLNode; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + // Represents a raw node + module.exports = XMLDummy = class XMLDummy extends XMLNode { + // Initializes a new instance of `XMLDummy` + + // `XMLDummy` is a special node representing a node with + // a null value. Dummy nodes are created while recursively + // building the XML tree. Simply skipping null values doesn't + // work because that would break the recursive chain. + constructor(parent) { + super(parent); + this.type = NodeType.Dummy; + } + + // Creates and returns a deep clone of `this` + clone() { + return Object.create(this); + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return ''; + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLElement.js b/node_modules/xmlbuilder/lib/XMLElement.js new file mode 100644 index 00000000..3e9da573 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLElement.js @@ -0,0 +1,334 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, + hasProp = {}.hasOwnProperty; + + ({isObject, isFunction, getValue} = require('./Utility')); + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + XMLAttribute = require('./XMLAttribute'); + + XMLNamedNodeMap = require('./XMLNamedNodeMap'); + + // Represents an element of the XML document + module.exports = XMLElement = (function() { + class XMLElement extends XMLNode { + // Initializes a new instance of `XMLElement` + + // `parent` the parent node + // `name` element name + // `attributes` an object containing name/value pairs of attributes + constructor(parent, name, attributes) { + var child, j, len, ref; + super(parent); + if (name == null) { + throw new Error("Missing element name. " + this.debugInfo()); + } + this.name = this.stringify.name(name); + this.type = NodeType.Element; + this.attribs = {}; + this.schemaTypeInfo = null; + if (attributes != null) { + this.attribute(attributes); + } + // set properties if this is the root node + if (parent.type === NodeType.Document) { + this.isRoot = true; + this.documentObject = parent; + parent.rootObject = this; + // set dtd name + if (parent.children) { + ref = parent.children; + for (j = 0, len = ref.length; j < len; j++) { + child = ref[j]; + if (child.type === NodeType.DocType) { + child.name = this.name; + break; + } + } + } + } + } + + // Creates and returns a deep clone of `this` + + clone() { + var att, attName, clonedSelf, ref; + clonedSelf = Object.create(this); + // remove document element + if (clonedSelf.isRoot) { + clonedSelf.documentObject = null; + } + // clone attributes + clonedSelf.attribs = {}; + ref = this.attribs; + for (attName in ref) { + if (!hasProp.call(ref, attName)) continue; + att = ref[attName]; + clonedSelf.attribs[attName] = att.clone(); + } + // clone child nodes + clonedSelf.children = []; + this.children.forEach(function(child) { + var clonedChild; + clonedChild = child.clone(); + clonedChild.parent = clonedSelf; + return clonedSelf.children.push(clonedChild); + }); + return clonedSelf; + } + + // Adds or modifies an attribute + + // `name` attribute name + // `value` attribute value + attribute(name, value) { + var attName, attValue; + if (name != null) { + name = getValue(name); + } + if (isObject(name)) { // expand if object + for (attName in name) { + if (!hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + if (this.options.keepNullAttributes && (value == null)) { + this.attribs[name] = new XMLAttribute(this, name, ""); + } else if (value != null) { + this.attribs[name] = new XMLAttribute(this, name, value); + } + } + return this; + } + + // Removes an attribute + + // `name` attribute name + removeAttribute(name) { + var attName, j, len; + // Also defined in DOM level 1 + // removeAttribute(name) removes an attribute by name. + if (name == null) { + throw new Error("Missing attribute name. " + this.debugInfo()); + } + name = getValue(name); + if (Array.isArray(name)) { // expand if array + for (j = 0, len = name.length; j < len; j++) { + attName = name[j]; + delete this.attribs[attName]; + } + } else { + delete this.attribs[name]; + } + return this; + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + // `options.allowEmpty` do not self close empty element tags + toString(options) { + return this.options.writer.element(this, this.options.writer.filterOptions(options)); + } + + // Aliases + att(name, value) { + return this.attribute(name, value); + } + + a(name, value) { + return this.attribute(name, value); + } + + // DOM Level 1 + getAttribute(name) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name].value; + } else { + return null; + } + } + + setAttribute(name, value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getAttributeNode(name) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name]; + } else { + return null; + } + } + + setAttributeNode(newAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + removeAttributeNode(oldAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getElementsByTagName(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + // DOM Level 2 + getAttributeNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + setAttributeNS(namespaceURI, qualifiedName, value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + removeAttributeNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getAttributeNodeNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + setAttributeNodeNS(newAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getElementsByTagNameNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + hasAttribute(name) { + return this.attribs.hasOwnProperty(name); + } + + hasAttributeNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + // DOM Level 3 + setIdAttribute(name, isId) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name].isId; + } else { + return isId; + } + } + + setIdAttributeNS(namespaceURI, localName, isId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + setIdAttributeNode(idAttr, isId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + // DOM Level 4 + getElementsByTagName(tagname) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getElementsByTagNameNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getElementsByClassName(classNames) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + isEqualNode(node) { + var i, j, ref; + if (!super.isEqualNode(node)) { + return false; + } + if (node.namespaceURI !== this.namespaceURI) { + return false; + } + if (node.prefix !== this.prefix) { + return false; + } + if (node.localName !== this.localName) { + return false; + } + if (node.attribs.length !== this.attribs.length) { + return false; + } + for (i = j = 0, ref = this.attribs.length - 1; (0 <= ref ? j <= ref : j >= ref); i = 0 <= ref ? ++j : --j) { + if (!this.attribs[i].isEqualNode(node.attribs[i])) { + return false; + } + } + return true; + } + + }; + + // DOM level 1 + Object.defineProperty(XMLElement.prototype, 'tagName', { + get: function() { + return this.name; + } + }); + + // DOM level 4 + Object.defineProperty(XMLElement.prototype, 'namespaceURI', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLElement.prototype, 'prefix', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLElement.prototype, 'localName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLElement.prototype, 'id', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'className', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'classList', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'attributes', { + get: function() { + if (!this.attributeMap || !this.attributeMap.nodes) { + this.attributeMap = new XMLNamedNodeMap(this.attribs); + } + return this.attributeMap; + } + }); + + return XMLElement; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js b/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js new file mode 100644 index 00000000..8c919692 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js @@ -0,0 +1,77 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + // Represents a map of nodes accessed by a string key + var XMLNamedNodeMap; + + module.exports = XMLNamedNodeMap = (function() { + class XMLNamedNodeMap { + // Initializes a new instance of `XMLNamedNodeMap` + // This is just a wrapper around an ordinary + // JS object. + + // `nodes` the object containing nodes. + constructor(nodes) { + this.nodes = nodes; + } + + // Creates and returns a deep clone of `this` + + clone() { + // this class should not be cloned since it wraps + // around a given object. The calling function should check + // whether the wrapped object is null and supply a new object + // (from the clone). + return this.nodes = null; + } + + // DOM Level 1 + getNamedItem(name) { + return this.nodes[name]; + } + + setNamedItem(node) { + var oldNode; + oldNode = this.nodes[node.nodeName]; + this.nodes[node.nodeName] = node; + return oldNode || null; + } + + removeNamedItem(name) { + var oldNode; + oldNode = this.nodes[name]; + delete this.nodes[name]; + return oldNode || null; + } + + item(index) { + return this.nodes[Object.keys(this.nodes)[index]] || null; + } + + // DOM level 2 functions to be implemented later + getNamedItemNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented."); + } + + setNamedItemNS(node) { + throw new Error("This DOM method is not implemented."); + } + + removeNamedItemNS(namespaceURI, localName) { + throw new Error("This DOM method is not implemented."); + } + + }; + + + // DOM level 1 + Object.defineProperty(XMLNamedNodeMap.prototype, 'length', { + get: function() { + return Object.keys(this.nodes).length || 0; + } + }); + + return XMLNamedNodeMap; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLNode.js b/node_modules/xmlbuilder/lib/XMLNode.js new file mode 100644 index 00000000..0ade97ba --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLNode.js @@ -0,0 +1,999 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, + hasProp = {}.hasOwnProperty, + splice = [].splice; + + ({isObject, isFunction, isEmpty, getValue} = require('./Utility')); + + XMLElement = null; + + XMLCData = null; + + XMLComment = null; + + XMLDeclaration = null; + + XMLDocType = null; + + XMLRaw = null; + + XMLText = null; + + XMLProcessingInstruction = null; + + XMLDummy = null; + + NodeType = null; + + XMLNodeList = null; + + XMLNamedNodeMap = null; + + DocumentPosition = null; + + // Represents a generic XMl element + module.exports = XMLNode = (function() { + class XMLNode { + // Initializes a new instance of `XMLNode` + + // `parent` the parent node + constructor(parent1) { + this.parent = parent1; + if (this.parent) { + this.options = this.parent.options; + this.stringify = this.parent.stringify; + } + this.value = null; + this.children = []; + this.baseURI = null; + // first execution, load dependencies that are otherwise + // circular (so we can't load them at the top) + if (!XMLElement) { + XMLElement = require('./XMLElement'); + XMLCData = require('./XMLCData'); + XMLComment = require('./XMLComment'); + XMLDeclaration = require('./XMLDeclaration'); + XMLDocType = require('./XMLDocType'); + XMLRaw = require('./XMLRaw'); + XMLText = require('./XMLText'); + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + XMLDummy = require('./XMLDummy'); + NodeType = require('./NodeType'); + XMLNodeList = require('./XMLNodeList'); + XMLNamedNodeMap = require('./XMLNamedNodeMap'); + DocumentPosition = require('./DocumentPosition'); + } + } + + + // Sets the parent node of this node and its children recursively + + // `parent` the parent node + setParent(parent) { + var child, j, len, ref1, results; + this.parent = parent; + if (parent) { + this.options = parent.options; + this.stringify = parent.stringify; + } + ref1 = this.children; + results = []; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + results.push(child.setParent(this)); + } + return results; + } + + // Creates a child element node + + // `name` node name or an object describing the XML tree + // `attributes` an object containing name/value pairs of attributes + // `text` element text + element(name, attributes, text) { + var childNode, item, j, k, key, lastChild, len, len1, val; + lastChild = null; + if (attributes === null && (text == null)) { + [attributes, text] = [{}, null]; + } + if (attributes == null) { + attributes = {}; + } + attributes = getValue(attributes); + // swap argument order: text <-> attributes + if (!isObject(attributes)) { + [text, attributes] = [attributes, text]; + } + if (name != null) { + name = getValue(name); + } + // expand if array + if (Array.isArray(name)) { + for (j = 0, len = name.length; j < len; j++) { + item = name[j]; + lastChild = this.element(item); + } + // evaluate if function + } else if (isFunction(name)) { + lastChild = this.element(name.apply()); + // expand if object + } else if (isObject(name)) { + for (key in name) { + if (!hasProp.call(name, key)) continue; + val = name[key]; + if (isFunction(val)) { + // evaluate if function + val = val.apply(); + } + // assign attributes + if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { + lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); + // skip empty arrays + } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) { + lastChild = this.dummy(); + // empty objects produce one node + } else if (isObject(val) && isEmpty(val)) { + lastChild = this.element(key); + // skip null and undefined nodes + } else if (!this.options.keepNullNodes && (val == null)) { + lastChild = this.dummy(); + + // expand list by creating child nodes + } else if (!this.options.separateArrayItems && Array.isArray(val)) { + for (k = 0, len1 = val.length; k < len1; k++) { + item = val[k]; + childNode = {}; + childNode[key] = item; + lastChild = this.element(childNode); + } + + // expand child nodes under parent + } else if (isObject(val)) { + // if the key is #text expand child nodes under this node to support mixed content + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.element(val); + } else { + lastChild = this.element(key); + lastChild.element(val); + } + } else { + + // text node + lastChild = this.element(key, val); + } + } + // skip null nodes + } else if (!this.options.keepNullNodes && text === null) { + lastChild = this.dummy(); + } else { + // text node + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.text(text); + // cdata node + } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) { + lastChild = this.cdata(text); + // comment node + } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) { + lastChild = this.comment(text); + // raw text node + } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) { + lastChild = this.raw(text); + // processing instruction + } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) { + lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text); + } else { + // element node + lastChild = this.node(name, attributes, text); + } + } + if (lastChild == null) { + throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo()); + } + return lastChild; + } + + // Creates a child element node before the current node + + // `name` node name or an object describing the XML tree + // `attributes` an object containing name/value pairs of attributes + // `text` element text + insertBefore(name, attributes, text) { + var child, i, newChild, refChild, removed; + // DOM level 1 + // insertBefore(newChild, refChild) inserts the child node newChild before refChild + if (name != null ? name.type : void 0) { + newChild = name; + refChild = attributes; + newChild.setParent(this); + if (refChild) { + // temporarily remove children starting *with* refChild + i = children.indexOf(refChild); + removed = children.splice(i); + + // add the new child + children.push(newChild); + + // add back removed children after new child + Array.prototype.push.apply(children, removed); + } else { + children.push(newChild); + } + return newChild; + } else { + if (this.isRoot) { + throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); + } + + // temporarily remove children starting *with* this + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + + // add the new child + child = this.parent.element(name, attributes, text); + + // add back removed children after new child + Array.prototype.push.apply(this.parent.children, removed); + return child; + } + } + + // Creates a child element node after the current node + + // `name` node name or an object describing the XML tree + // `attributes` an object containing name/value pairs of attributes + // `text` element text + insertAfter(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); + } + + // temporarily remove children starting *after* this + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + + // add the new child + child = this.parent.element(name, attributes, text); + + // add back removed children after new child + Array.prototype.push.apply(this.parent.children, removed); + return child; + } + + // Deletes a child element node + + remove() { + var i, ref1; + if (this.isRoot) { + throw new Error("Cannot remove the root element. " + this.debugInfo()); + } + i = this.parent.children.indexOf(this); + splice.apply(this.parent.children, [i, i - i + 1].concat(ref1 = [])), ref1; + return this.parent; + } + + // Creates a node + + // `name` name of the node + // `attributes` an object containing name/value pairs of attributes + // `text` element text + node(name, attributes, text) { + var child; + if (name != null) { + name = getValue(name); + } + attributes || (attributes = {}); + attributes = getValue(attributes); + // swap argument order: text <-> attributes + if (!isObject(attributes)) { + [text, attributes] = [attributes, text]; + } + child = new XMLElement(this, name, attributes); + if (text != null) { + child.text(text); + } + this.children.push(child); + return child; + } + + // Creates a text node + + // `value` element text + text(value) { + var child; + if (isObject(value)) { + this.element(value); + } + child = new XMLText(this, value); + this.children.push(child); + return this; + } + + // Creates a CDATA node + + // `value` element text without CDATA delimiters + cdata(value) { + var child; + child = new XMLCData(this, value); + this.children.push(child); + return this; + } + + // Creates a comment node + + // `value` comment text + comment(value) { + var child; + child = new XMLComment(this, value); + this.children.push(child); + return this; + } + + // Creates a comment node before the current node + + // `value` comment text + commentBefore(value) { + var child, i, removed; + // temporarily remove children starting *with* this + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + // add the new child + child = this.parent.comment(value); + // add back removed children after new child + Array.prototype.push.apply(this.parent.children, removed); + return this; + } + + // Creates a comment node after the current node + + // `value` comment text + commentAfter(value) { + var child, i, removed; + // temporarily remove children starting *after* this + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + // add the new child + child = this.parent.comment(value); + // add back removed children after new child + Array.prototype.push.apply(this.parent.children, removed); + return this; + } + + // Adds unescaped raw text + + // `value` text + raw(value) { + var child; + child = new XMLRaw(this, value); + this.children.push(child); + return this; + } + + // Adds a dummy node + dummy() { + var child; + child = new XMLDummy(this); + // Normally when a new node is created it is added to the child node collection. + // However, dummy nodes are never added to the XML tree. They are created while + // converting JS objects to XML nodes in order not to break the recursive function + // chain. They can be thought of as invisible nodes. They can be traversed through + // by using prev(), next(), up(), etc. functions but they do not exists in the tree. + + // @children.push child + return child; + } + + // Adds a processing instruction + + // `target` instruction target + // `value` instruction value + instruction(target, value) { + var insTarget, insValue, instruction, j, len; + if (target != null) { + target = getValue(target); + } + if (value != null) { + value = getValue(value); + } + if (Array.isArray(target)) { // expand if array + for (j = 0, len = target.length; j < len; j++) { + insTarget = target[j]; + this.instruction(insTarget); + } + } else if (isObject(target)) { // expand if object + for (insTarget in target) { + if (!hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + instruction = new XMLProcessingInstruction(this, target, value); + this.children.push(instruction); + } + return this; + } + + // Creates a processing instruction node before the current node + + // `target` instruction target + // `value` instruction value + instructionBefore(target, value) { + var child, i, removed; + // temporarily remove children starting *with* this + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + // add the new child + child = this.parent.instruction(target, value); + // add back removed children after new child + Array.prototype.push.apply(this.parent.children, removed); + return this; + } + + // Creates a processing instruction node after the current node + + // `target` instruction target + // `value` instruction value + instructionAfter(target, value) { + var child, i, removed; + // temporarily remove children starting *after* this + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + // add the new child + child = this.parent.instruction(target, value); + // add back removed children after new child + Array.prototype.push.apply(this.parent.children, removed); + return this; + } + + // Creates the xml declaration + + // `version` A version number string, e.g. 1.0 + // `encoding` Encoding declaration, e.g. UTF-8 + // `standalone` standalone document declaration: true or false + declaration(version, encoding, standalone) { + var doc, xmldec; + doc = this.document(); + xmldec = new XMLDeclaration(doc, version, encoding, standalone); + // Replace XML declaration if exists, otherwise insert at top + if (doc.children.length === 0) { + doc.children.unshift(xmldec); + } else if (doc.children[0].type === NodeType.Declaration) { + doc.children[0] = xmldec; + } else { + doc.children.unshift(xmldec); + } + return doc.root() || doc; + } + + // Creates the document type declaration + + // `pubID` the public identifier of the external subset + // `sysID` the system identifier of the external subset + dtd(pubID, sysID) { + var child, doc, doctype, i, j, k, len, len1, ref1, ref2; + doc = this.document(); + doctype = new XMLDocType(doc, pubID, sysID); + ref1 = doc.children; + // Replace DTD if exists + for (i = j = 0, len = ref1.length; j < len; i = ++j) { + child = ref1[i]; + if (child.type === NodeType.DocType) { + doc.children[i] = doctype; + return doctype; + } + } + ref2 = doc.children; + // insert before root node if the root node exists + for (i = k = 0, len1 = ref2.length; k < len1; i = ++k) { + child = ref2[i]; + if (child.isRoot) { + doc.children.splice(i, 0, doctype); + return doctype; + } + } + // otherwise append to end + doc.children.push(doctype); + return doctype; + } + + // Gets the parent node + up() { + if (this.isRoot) { + throw new Error("The root node has no parent. Use doc() if you need to get the document object."); + } + return this.parent; + } + + // Gets the root node + root() { + var node; + node = this; + while (node) { + if (node.type === NodeType.Document) { + return node.rootObject; + } else if (node.isRoot) { + return node; + } else { + node = node.parent; + } + } + } + + // Gets the node representing the XML document + document() { + var node; + node = this; + while (node) { + if (node.type === NodeType.Document) { + return node; + } else { + node = node.parent; + } + } + } + + // Ends the document and converts string + end(options) { + return this.document().end(options); + } + + // Gets the previous node + prev() { + var i; + i = this.parent.children.indexOf(this); + if (i < 1) { + throw new Error("Already at the first node. " + this.debugInfo()); + } + return this.parent.children[i - 1]; + } + + // Gets the next node + next() { + var i; + i = this.parent.children.indexOf(this); + if (i === -1 || i === this.parent.children.length - 1) { + throw new Error("Already at the last node. " + this.debugInfo()); + } + return this.parent.children[i + 1]; + } + + // Imports cloned root from another XML document + + // `doc` the XML document to insert nodes from + importDocument(doc) { + var child, clonedRoot, j, len, ref1; + clonedRoot = doc.root().clone(); + clonedRoot.parent = this; + clonedRoot.isRoot = false; + this.children.push(clonedRoot); + // set properties if imported element becomes the root node + if (this.type === NodeType.Document) { + clonedRoot.isRoot = true; + clonedRoot.documentObject = this; + this.rootObject = clonedRoot; + // set dtd name + if (this.children) { + ref1 = this.children; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + if (child.type === NodeType.DocType) { + child.name = clonedRoot.name; + break; + } + } + } + } + return this; + } + + + // Returns debug string for this node + debugInfo(name) { + var ref1, ref2; + name = name || this.name; + if ((name == null) && !((ref1 = this.parent) != null ? ref1.name : void 0)) { + return ""; + } else if (name == null) { + return "parent: <" + this.parent.name + ">"; + } else if (!((ref2 = this.parent) != null ? ref2.name : void 0)) { + return "node: <" + name + ">"; + } else { + return "node: <" + name + ">, parent: <" + this.parent.name + ">"; + } + } + + // Aliases + ele(name, attributes, text) { + return this.element(name, attributes, text); + } + + nod(name, attributes, text) { + return this.node(name, attributes, text); + } + + txt(value) { + return this.text(value); + } + + dat(value) { + return this.cdata(value); + } + + com(value) { + return this.comment(value); + } + + ins(target, value) { + return this.instruction(target, value); + } + + doc() { + return this.document(); + } + + dec(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + } + + e(name, attributes, text) { + return this.element(name, attributes, text); + } + + n(name, attributes, text) { + return this.node(name, attributes, text); + } + + t(value) { + return this.text(value); + } + + d(value) { + return this.cdata(value); + } + + c(value) { + return this.comment(value); + } + + r(value) { + return this.raw(value); + } + + i(target, value) { + return this.instruction(target, value); + } + + u() { + return this.up(); + } + + // can be deprecated in a future release + importXMLBuilder(doc) { + return this.importDocument(doc); + } + + // Adds or modifies an attribute. + + // `name` attribute name + // `value` attribute value + attribute(name, value) { + throw new Error("attribute() applies to element nodes only."); + } + + att(name, value) { + return this.attribute(name, value); + } + + a(name, value) { + return this.attribute(name, value); + } + + // Removes an attribute + + // `name` attribute name + removeAttribute(name) { + throw new Error("attribute() applies to element nodes only."); + } + + // DOM level 1 functions to be implemented later + replaceChild(newChild, oldChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + removeChild(oldChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + appendChild(newChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + hasChildNodes() { + return this.children.length !== 0; + } + + cloneNode(deep) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + normalize() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + // DOM level 2 + isSupported(feature, version) { + return true; + } + + hasAttributes() { + return this.attribs.length !== 0; + } + + // DOM level 3 functions to be implemented later + compareDocumentPosition(other) { + var ref, res; + ref = this; + if (ref === other) { + return 0; + } else if (this.document() !== other.document()) { + res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific; + if (Math.random() < 0.5) { + res |= DocumentPosition.Preceding; + } else { + res |= DocumentPosition.Following; + } + return res; + } else if (ref.isAncestor(other)) { + return DocumentPosition.Contains | DocumentPosition.Preceding; + } else if (ref.isDescendant(other)) { + return DocumentPosition.Contains | DocumentPosition.Following; + } else if (ref.isPreceding(other)) { + return DocumentPosition.Preceding; + } else { + return DocumentPosition.Following; + } + } + + isSameNode(other) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + lookupPrefix(namespaceURI) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + isDefaultNamespace(namespaceURI) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + lookupNamespaceURI(prefix) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + isEqualNode(node) { + var i, j, ref1; + if (node.nodeType !== this.nodeType) { + return false; + } + if (node.children.length !== this.children.length) { + return false; + } + for (i = j = 0, ref1 = this.children.length - 1; (0 <= ref1 ? j <= ref1 : j >= ref1); i = 0 <= ref1 ? ++j : --j) { + if (!this.children[i].isEqualNode(node.children[i])) { + return false; + } + } + return true; + } + + getFeature(feature, version) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + setUserData(key, data, handler) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + getUserData(key) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + + // Returns true if other is an inclusive descendant of node, + // and false otherwise. + contains(other) { + if (!other) { + return false; + } + return other === this || this.isDescendant(other); + } + + // An object A is called a descendant of an object B, if either A is + // a child of B or A is a child of an object C that is a descendant of B. + isDescendant(node) { + var child, isDescendantChild, j, len, ref1; + ref1 = this.children; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + if (node === child) { + return true; + } + isDescendantChild = child.isDescendant(node); + if (isDescendantChild) { + return true; + } + } + return false; + } + + // An object A is called an ancestor of an object B if and only if + // B is a descendant of A. + isAncestor(node) { + return node.isDescendant(this); + } + + // An object A is preceding an object B if A and B are in the + // same tree and A comes before B in tree order. + isPreceding(node) { + var nodePos, thisPos; + nodePos = this.treePosition(node); + thisPos = this.treePosition(this); + if (nodePos === -1 || thisPos === -1) { + return false; + } else { + return nodePos < thisPos; + } + } + + // An object A is folllowing an object B if A and B are in the + // same tree and A comes after B in tree order. + isFollowing(node) { + var nodePos, thisPos; + nodePos = this.treePosition(node); + thisPos = this.treePosition(this); + if (nodePos === -1 || thisPos === -1) { + return false; + } else { + return nodePos > thisPos; + } + } + + // Returns the preorder position of the given node in the tree, or -1 + // if the node is not in the tree. + treePosition(node) { + var found, pos; + pos = 0; + found = false; + this.foreachTreeNode(this.document(), function(childNode) { + pos++; + if (!found && childNode === node) { + return found = true; + } + }); + if (found) { + return pos; + } else { + return -1; + } + } + + + // Depth-first preorder traversal through the XML tree + foreachTreeNode(node, func) { + var child, j, len, ref1, res; + node || (node = this.document()); + ref1 = node.children; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + if (res = func(child)) { + return res; + } else { + res = this.foreachTreeNode(child, func); + if (res) { + return res; + } + } + } + } + + }; + + // DOM level 1 + Object.defineProperty(XMLNode.prototype, 'nodeName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nodeType', { + get: function() { + return this.type; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nodeValue', { + get: function() { + return this.value; + } + }); + + Object.defineProperty(XMLNode.prototype, 'parentNode', { + get: function() { + return this.parent; + } + }); + + Object.defineProperty(XMLNode.prototype, 'childNodes', { + get: function() { + if (!this.childNodeList || !this.childNodeList.nodes) { + this.childNodeList = new XMLNodeList(this.children); + } + return this.childNodeList; + } + }); + + Object.defineProperty(XMLNode.prototype, 'firstChild', { + get: function() { + return this.children[0] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'lastChild', { + get: function() { + return this.children[this.children.length - 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'previousSibling', { + get: function() { + var i; + i = this.parent.children.indexOf(this); + return this.parent.children[i - 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nextSibling', { + get: function() { + var i; + i = this.parent.children.indexOf(this); + return this.parent.children[i + 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'ownerDocument', { + get: function() { + return this.document() || null; + } + }); + + // DOM level 3 + Object.defineProperty(XMLNode.prototype, 'textContent', { + get: function() { + var child, j, len, ref1, str; + if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) { + str = ''; + ref1 = this.children; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + if (child.textContent) { + str += child.textContent; + } + } + return str; + } else { + return null; + } + }, + set: function(value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + return XMLNode; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLNodeFilter.js b/node_modules/xmlbuilder/lib/XMLNodeFilter.js new file mode 100644 index 00000000..3f33f45f --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLNodeFilter.js @@ -0,0 +1,51 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + // Represents a node filter + var XMLNodeFilter; + + module.exports = XMLNodeFilter = (function() { + class XMLNodeFilter { + // DOM level 4 functions to be implemented later + acceptNode(node) { + throw new Error("This DOM method is not implemented."); + } + + }; + + XMLNodeFilter.prototype.FilterAccept = 1; + + XMLNodeFilter.prototype.FilterReject = 2; + + XMLNodeFilter.prototype.FilterSkip = 3; + + XMLNodeFilter.prototype.ShowAll = 0xffffffff; + + XMLNodeFilter.prototype.ShowElement = 0x1; + + XMLNodeFilter.prototype.ShowAttribute = 0x2; + + XMLNodeFilter.prototype.ShowText = 0x4; + + XMLNodeFilter.prototype.ShowCDataSection = 0x8; + + XMLNodeFilter.prototype.ShowEntityReference = 0x10; + + XMLNodeFilter.prototype.ShowEntity = 0x20; + + XMLNodeFilter.prototype.ShowProcessingInstruction = 0x40; + + XMLNodeFilter.prototype.ShowComment = 0x80; + + XMLNodeFilter.prototype.ShowDocument = 0x100; + + XMLNodeFilter.prototype.ShowDocumentType = 0x200; + + XMLNodeFilter.prototype.ShowDocumentFragment = 0x400; + + XMLNodeFilter.prototype.ShowNotation = 0x800; + + return XMLNodeFilter; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLNodeList.js b/node_modules/xmlbuilder/lib/XMLNodeList.js new file mode 100644 index 00000000..8570096f --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLNodeList.js @@ -0,0 +1,45 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + // Represents a list of nodes + var XMLNodeList; + + module.exports = XMLNodeList = (function() { + class XMLNodeList { + // Initializes a new instance of `XMLNodeList` + // This is just a wrapper around an ordinary + // JS array. + + // `nodes` the array containing nodes. + constructor(nodes) { + this.nodes = nodes; + } + + // Creates and returns a deep clone of `this` + + clone() { + // this class should not be cloned since it wraps + // around a given array. The calling function should check + // whether the wrapped array is null and supply a new array + // (from the clone). + return this.nodes = null; + } + + // DOM Level 1 + item(index) { + return this.nodes[index] || null; + } + + }; + + // DOM level 1 + Object.defineProperty(XMLNodeList.prototype, 'length', { + get: function() { + return this.nodes.length || 0; + } + }); + + return XMLNodeList; + + }).call(this); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js b/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js new file mode 100644 index 00000000..88b8fcdf --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js @@ -0,0 +1,56 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLCharacterData, XMLProcessingInstruction; + + NodeType = require('./NodeType'); + + XMLCharacterData = require('./XMLCharacterData'); + + // Represents a processing instruction + module.exports = XMLProcessingInstruction = class XMLProcessingInstruction extends XMLCharacterData { + // Initializes a new instance of `XMLProcessingInstruction` + + // `parent` the parent node + // `target` instruction target + // `value` instruction value + constructor(parent, target, value) { + super(parent); + if (target == null) { + throw new Error("Missing instruction target. " + this.debugInfo()); + } + this.type = NodeType.ProcessingInstruction; + this.target = this.stringify.insTarget(target); + this.name = this.target; + if (value) { + this.value = this.stringify.insValue(value); + } + } + + // Creates and returns a deep clone of `this` + clone() { + return Object.create(this); + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options)); + } + + isEqualNode(node) { + if (!super.isEqualNode(node)) { + return false; + } + if (node.target !== this.target) { + return false; + } + return true; + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLRaw.js b/node_modules/xmlbuilder/lib/XMLRaw.js new file mode 100644 index 00000000..4addc8b1 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLRaw.js @@ -0,0 +1,40 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, XMLNode, XMLRaw; + + NodeType = require('./NodeType'); + + XMLNode = require('./XMLNode'); + + // Represents a raw node + module.exports = XMLRaw = class XMLRaw extends XMLNode { + // Initializes a new instance of `XMLRaw` + + // `text` raw text + constructor(parent, text) { + super(parent); + if (text == null) { + throw new Error("Missing raw text. " + this.debugInfo()); + } + this.type = NodeType.Raw; + this.value = this.stringify.raw(text); + } + + // Creates and returns a deep clone of `this` + clone() { + return Object.create(this); + } + + // Converts the XML fragment to string + + // `options.pretty` pretty prints the result + // `options.indent` indentation for pretty print + // `options.offset` how many indentations to add to every line for pretty print + // `options.newline` newline sequence for pretty print + toString(options) { + return this.options.writer.raw(this, this.options.writer.filterOptions(options)); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLStreamWriter.js b/node_modules/xmlbuilder/lib/XMLStreamWriter.js new file mode 100644 index 00000000..0c749444 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLStreamWriter.js @@ -0,0 +1,209 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, WriterState, XMLStreamWriter, XMLWriterBase, + hasProp = {}.hasOwnProperty; + + NodeType = require('./NodeType'); + + XMLWriterBase = require('./XMLWriterBase'); + + WriterState = require('./WriterState'); + + // Prints XML nodes to a stream + module.exports = XMLStreamWriter = class XMLStreamWriter extends XMLWriterBase { + // Initializes a new instance of `XMLStreamWriter` + + // `stream` output stream + // `options.pretty` pretty prints the result + // `options.indent` indentation string + // `options.newline` newline sequence + // `options.offset` a fixed number of indentations to add to every line + // `options.allowEmpty` do not self close empty element tags + // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF + // `options.spaceBeforeSlash` add a space before the closing slash of empty elements + constructor(stream, options) { + super(options); + this.stream = stream; + } + + endline(node, options, level) { + if (node.isLastRootNode && options.state === WriterState.CloseTag) { + return ''; + } else { + return super.endline(node, options, level); + } + } + + document(doc, options) { + var child, i, j, k, len1, len2, ref, ref1, results; + ref = doc.children; + // set a flag so that we don't insert a newline after the last root level node + for (i = j = 0, len1 = ref.length; j < len1; i = ++j) { + child = ref[i]; + child.isLastRootNode = i === doc.children.length - 1; + } + options = this.filterOptions(options); + ref1 = doc.children; + results = []; + for (k = 0, len2 = ref1.length; k < len2; k++) { + child = ref1[k]; + results.push(this.writeChildNode(child, options, 0)); + } + return results; + } + + cdata(node, options, level) { + return this.stream.write(super.cdata(node, options, level)); + } + + comment(node, options, level) { + return this.stream.write(super.comment(node, options, level)); + } + + declaration(node, options, level) { + return this.stream.write(super.declaration(node, options, level)); + } + + docType(node, options, level) { + var child, j, len1, ref; + level || (level = 0); + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + this.stream.write(this.indent(node, options, level)); + this.stream.write(' 0) { + this.stream.write(' ['); + this.stream.write(this.endline(node, options, level)); + options.state = WriterState.InsideTag; + ref = node.children; + for (j = 0, len1 = ref.length; j < len1; j++) { + child = ref[j]; + this.writeChildNode(child, options, level + 1); + } + options.state = WriterState.CloseTag; + this.stream.write(']'); + } + // close tag + options.state = WriterState.CloseTag; + this.stream.write(options.spaceBeforeSlash + '>'); + this.stream.write(this.endline(node, options, level)); + options.state = WriterState.None; + return this.closeNode(node, options, level); + } + + element(node, options, level) { + var att, attLen, child, childNodeCount, firstChildNode, j, len, len1, name, prettySuppressed, r, ratt, ref, ref1, ref2, rline; + level || (level = 0); + // open tag + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '<' + node.name; + // attributes + if (options.pretty && options.width > 0) { + len = r.length; + ref = node.attribs; + for (name in ref) { + if (!hasProp.call(ref, name)) continue; + att = ref[name]; + ratt = this.attribute(att, options, level); + attLen = ratt.length; + if (len + attLen > options.width) { + rline = this.indent(node, options, level + 1) + ratt; + r += this.endline(node, options, level) + rline; + len = rline.length; + } else { + rline = ' ' + ratt; + r += rline; + len += rline.length; + } + } + } else { + ref1 = node.attribs; + for (name in ref1) { + if (!hasProp.call(ref1, name)) continue; + att = ref1[name]; + r += this.attribute(att, options, level); + } + } + this.stream.write(r); + childNodeCount = node.children.length; + firstChildNode = childNodeCount === 0 ? null : node.children[0]; + if (childNodeCount === 0 || node.children.every(function(e) { + return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === ''; + })) { + // empty element + if (options.allowEmpty) { + this.stream.write('>'); + options.state = WriterState.CloseTag; + this.stream.write(''); + } else { + options.state = WriterState.CloseTag; + this.stream.write(options.spaceBeforeSlash + '/>'); + } + } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) { + // do not indent text-only nodes + this.stream.write('>'); + options.state = WriterState.InsideTag; + options.suppressPrettyCount++; + prettySuppressed = true; + this.writeChildNode(firstChildNode, options, level + 1); + options.suppressPrettyCount--; + prettySuppressed = false; + options.state = WriterState.CloseTag; + this.stream.write(''); + } else { + this.stream.write('>' + this.endline(node, options, level)); + options.state = WriterState.InsideTag; + ref2 = node.children; + // inner tags + for (j = 0, len1 = ref2.length; j < len1; j++) { + child = ref2[j]; + this.writeChildNode(child, options, level + 1); + } + // close tag + options.state = WriterState.CloseTag; + this.stream.write(this.indent(node, options, level) + ''); + } + this.stream.write(this.endline(node, options, level)); + options.state = WriterState.None; + return this.closeNode(node, options, level); + } + + processingInstruction(node, options, level) { + return this.stream.write(super.processingInstruction(node, options, level)); + } + + raw(node, options, level) { + return this.stream.write(super.raw(node, options, level)); + } + + text(node, options, level) { + return this.stream.write(super.text(node, options, level)); + } + + dtdAttList(node, options, level) { + return this.stream.write(super.dtdAttList(node, options, level)); + } + + dtdElement(node, options, level) { + return this.stream.write(super.dtdElement(node, options, level)); + } + + dtdEntity(node, options, level) { + return this.stream.write(super.dtdEntity(node, options, level)); + } + + dtdNotation(node, options, level) { + return this.stream.write(super.dtdNotation(node, options, level)); + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLStringWriter.js b/node_modules/xmlbuilder/lib/XMLStringWriter.js new file mode 100644 index 00000000..969caf56 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLStringWriter.js @@ -0,0 +1,40 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var XMLStringWriter, XMLWriterBase; + + XMLWriterBase = require('./XMLWriterBase'); + + // Prints XML nodes as plain text + module.exports = XMLStringWriter = class XMLStringWriter extends XMLWriterBase { + // Initializes a new instance of `XMLStringWriter` + + // `options.pretty` pretty prints the result + // `options.indent` indentation string + // `options.newline` newline sequence + // `options.offset` a fixed number of indentations to add to every line + // `options.allowEmpty` do not self close empty element tags + // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF + // `options.spaceBeforeSlash` add a space before the closing slash of empty elements + constructor(options) { + super(options); + } + + document(doc, options) { + var child, i, len, r, ref; + options = this.filterOptions(options); + r = ''; + ref = doc.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + r += this.writeChildNode(child, options, 0); + } + // remove trailing newline + if (options.pretty && r.slice(-options.newline.length) === options.newline) { + r = r.slice(0, -options.newline.length); + } + return r; + } + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLStringifier.js b/node_modules/xmlbuilder/lib/XMLStringifier.js new file mode 100644 index 00000000..ecf2328e --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLStringifier.js @@ -0,0 +1,287 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + // Converts values to strings + var XMLStringifier, + hasProp = {}.hasOwnProperty; + + module.exports = XMLStringifier = (function() { + class XMLStringifier { + // Initializes a new instance of `XMLStringifier` + + // `options.version` The version number string of the XML spec to validate against, e.g. 1.0 + // `options.noDoubleEncoding` whether existing html entities are encoded: true or false + // `options.stringify` a set of functions to use for converting values to strings + // `options.noValidation` whether values will be validated and escaped or returned as is + constructor(options) { + var key, ref, value; + // Checks whether the given string contains legal characters + // Fails with an exception on error + + // `str` the string to check + this.assertLegalChar = this.assertLegalChar.bind(this); + // Checks whether the given string contains legal characters for a name + // Fails with an exception on error + + // `str` the string to check + this.assertLegalName = this.assertLegalName.bind(this); + options || (options = {}); + this.options = options; + if (!this.options.version) { + this.options.version = '1.0'; + } + ref = options.stringify || {}; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + value = ref[key]; + this[key] = value; + } + } + + // Defaults + name(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalName('' + val || ''); + } + + text(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar(this.textEscape('' + val || '')); + } + + cdata(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + val = val.replace(']]>', ']]]]>'); + return this.assertLegalChar(val); + } + + comment(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (val.match(/--/)) { + throw new Error("Comment text cannot contain double-hypen: " + val); + } + return this.assertLegalChar(val); + } + + raw(val) { + if (this.options.noValidation) { + return val; + } + return '' + val || ''; + } + + attValue(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar(this.attEscape(val = '' + val || '')); + } + + insTarget(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + } + + insValue(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (val.match(/\?>/)) { + throw new Error("Invalid processing instruction value: " + val); + } + return this.assertLegalChar(val); + } + + xmlVersion(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (!val.match(/1\.[0-9]+/)) { + throw new Error("Invalid version number: " + val); + } + return val; + } + + xmlEncoding(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) { + throw new Error("Invalid encoding: " + val); + } + return this.assertLegalChar(val); + } + + xmlStandalone(val) { + if (this.options.noValidation) { + return val; + } + if (val) { + return "yes"; + } else { + return "no"; + } + } + + dtdPubID(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + } + + dtdSysID(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + } + + dtdElementValue(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + } + + dtdAttType(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + } + + dtdAttDefault(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + } + + dtdEntityValue(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + } + + dtdNData(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + } + + assertLegalChar(str) { + var regex, res; + if (this.options.noValidation) { + return str; + } + regex = ''; + if (this.options.version === '1.0') { + // Valid characters from https://www.w3.org/TR/xml/#charsets + // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. + // #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + // This ES5 compatible Regexp has been generated using the "regenerate" NPM module: + // let xml_10_InvalidChars = regenerate() + // .addRange(0x0000, 0x0008) + // .add(0x000B, 0x000C) + // .addRange(0x000E, 0x001F) + // .addRange(0xD800, 0xDFFF) + // .addRange(0xFFFE, 0xFFFF) + regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + if (res = str.match(regex)) { + throw new Error(`Invalid character in string: ${str} at index ${res.index}`); + } + } else if (this.options.version === '1.1') { + // Valid characters from https://www.w3.org/TR/xml11/#charsets + // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. + // [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + // This ES5 compatible Regexp has been generated using the "regenerate" NPM module: + // let xml_11_InvalidChars = regenerate() + // .add(0x0000) + // .addRange(0xD800, 0xDFFF) + // .addRange(0xFFFE, 0xFFFF) + regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + if (res = str.match(regex)) { + throw new Error(`Invalid character in string: ${str} at index ${res.index}`); + } + } + return str; + } + + assertLegalName(str) { + var regex; + if (this.options.noValidation) { + return str; + } + this.assertLegalChar(str); + regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/; + if (!str.match(regex)) { + throw new Error("Invalid character in name"); + } + return str; + } + + // Escapes special characters in text + + // See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping + + // `str` the string to escape + textEscape(str) { + var ampregex; + if (this.options.noValidation) { + return str; + } + ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; + return str.replace(ampregex, '&').replace(//g, '>').replace(/\r/g, ' '); + } + + // Escapes special characters in attribute values + + // See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping + + // `str` the string to escape + attEscape(str) { + var ampregex; + if (this.options.noValidation) { + return str; + } + ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; + return str.replace(ampregex, '&').replace(/ 0) { + return new Array(indentLevel).join(options.indent); + } + } + return ''; + } + + // Returns the newline string + + // `node` current node + // `options` writer options + // `level` current indentation level + endline(node, options, level) { + if (!options.pretty || options.suppressPrettyCount) { + return ''; + } else { + return options.newline; + } + } + + attribute(att, options, level) { + var r; + this.openAttribute(att, options, level); + if (options.pretty && options.width > 0) { + r = att.name + '="' + att.value + '"'; + } else { + r = ' ' + att.name + '="' + att.value + '"'; + } + this.closeAttribute(att, options, level); + return r; + } + + cdata(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + comment(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + declaration(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + ''; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + docType(node, options, level) { + var child, i, len1, r, ref; + level || (level = 0); + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level); + r += ' 0) { + r += ' ['; + r += this.endline(node, options, level); + options.state = WriterState.InsideTag; + ref = node.children; + for (i = 0, len1 = ref.length; i < len1; i++) { + child = ref[i]; + r += this.writeChildNode(child, options, level + 1); + } + options.state = WriterState.CloseTag; + r += ']'; + } + // close tag + options.state = WriterState.CloseTag; + r += options.spaceBeforeSlash + '>'; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + element(node, options, level) { + var att, attLen, child, childNodeCount, firstChildNode, i, j, len, len1, len2, name, prettySuppressed, r, ratt, ref, ref1, ref2, ref3, rline; + level || (level = 0); + prettySuppressed = false; + // open tag + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '<' + node.name; + // attributes + if (options.pretty && options.width > 0) { + len = r.length; + ref = node.attribs; + for (name in ref) { + if (!hasProp.call(ref, name)) continue; + att = ref[name]; + ratt = this.attribute(att, options, level); + attLen = ratt.length; + if (len + attLen > options.width) { + rline = this.indent(node, options, level + 1) + ratt; + r += this.endline(node, options, level) + rline; + len = rline.length; + } else { + rline = ' ' + ratt; + r += rline; + len += rline.length; + } + } + } else { + ref1 = node.attribs; + for (name in ref1) { + if (!hasProp.call(ref1, name)) continue; + att = ref1[name]; + r += this.attribute(att, options, level); + } + } + childNodeCount = node.children.length; + firstChildNode = childNodeCount === 0 ? null : node.children[0]; + if (childNodeCount === 0 || node.children.every(function(e) { + return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === ''; + })) { + // empty element + if (options.allowEmpty) { + r += '>'; + options.state = WriterState.CloseTag; + r += '' + this.endline(node, options, level); + } else { + options.state = WriterState.CloseTag; + r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level); + } + } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) { + // do not indent text-only nodes + r += '>'; + options.state = WriterState.InsideTag; + options.suppressPrettyCount++; + prettySuppressed = true; + r += this.writeChildNode(firstChildNode, options, level + 1); + options.suppressPrettyCount--; + prettySuppressed = false; + options.state = WriterState.CloseTag; + r += '' + this.endline(node, options, level); + } else { + // if ANY are a text node, then suppress pretty now + if (options.dontPrettyTextNodes) { + ref2 = node.children; + for (i = 0, len1 = ref2.length; i < len1; i++) { + child = ref2[i]; + if ((child.type === NodeType.Text || child.type === NodeType.Raw) && (child.value != null)) { + options.suppressPrettyCount++; + prettySuppressed = true; + break; + } + } + } + // close the opening tag, after dealing with newline + r += '>' + this.endline(node, options, level); + options.state = WriterState.InsideTag; + ref3 = node.children; + // inner tags + for (j = 0, len2 = ref3.length; j < len2; j++) { + child = ref3[j]; + r += this.writeChildNode(child, options, level + 1); + } + // close tag + options.state = WriterState.CloseTag; + r += this.indent(node, options, level) + ''; + if (prettySuppressed) { + options.suppressPrettyCount--; + } + r += this.endline(node, options, level); + options.state = WriterState.None; + } + this.closeNode(node, options, level); + return r; + } + + writeChildNode(node, options, level) { + switch (node.type) { + case NodeType.CData: + return this.cdata(node, options, level); + case NodeType.Comment: + return this.comment(node, options, level); + case NodeType.Element: + return this.element(node, options, level); + case NodeType.Raw: + return this.raw(node, options, level); + case NodeType.Text: + return this.text(node, options, level); + case NodeType.ProcessingInstruction: + return this.processingInstruction(node, options, level); + case NodeType.Dummy: + return ''; + case NodeType.Declaration: + return this.declaration(node, options, level); + case NodeType.DocType: + return this.docType(node, options, level); + case NodeType.AttributeDeclaration: + return this.dtdAttList(node, options, level); + case NodeType.ElementDeclaration: + return this.dtdElement(node, options, level); + case NodeType.EntityDeclaration: + return this.dtdEntity(node, options, level); + case NodeType.NotationDeclaration: + return this.dtdNotation(node, options, level); + default: + throw new Error("Unknown XML node type: " + node.constructor.name); + } + } + + processingInstruction(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + ''; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + raw(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level); + options.state = WriterState.InsideTag; + r += node.value; + options.state = WriterState.CloseTag; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + text(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level); + options.state = WriterState.InsideTag; + r += node.value; + options.state = WriterState.CloseTag; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + dtdAttList(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + dtdElement(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + dtdEntity(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + dtdNotation(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + } + + openNode(node, options, level) {} + + closeNode(node, options, level) {} + + openAttribute(att, options, level) {} + + closeAttribute(att, options, level) {} + + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/index.js b/node_modules/xmlbuilder/lib/index.js new file mode 100644 index 00000000..c9ff1502 --- /dev/null +++ b/node_modules/xmlbuilder/lib/index.js @@ -0,0 +1,120 @@ +// Generated by CoffeeScript 2.4.1 +(function() { + var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction; + + ({assign, isFunction} = require('./Utility')); + + XMLDOMImplementation = require('./XMLDOMImplementation'); + + XMLDocument = require('./XMLDocument'); + + XMLDocumentCB = require('./XMLDocumentCB'); + + XMLStringWriter = require('./XMLStringWriter'); + + XMLStreamWriter = require('./XMLStreamWriter'); + + NodeType = require('./NodeType'); + + WriterState = require('./WriterState'); + + // Creates a new document and returns the root node for + // chain-building the document tree + + // `name` name of the root element + + // `xmldec.version` A version number string, e.g. 1.0 + // `xmldec.encoding` Encoding declaration, e.g. UTF-8 + // `xmldec.standalone` standalone document declaration: true or false + + // `doctype.pubID` public identifier of the external subset + // `doctype.sysID` system identifier of the external subset + + // `options.headless` whether XML declaration and doctype will be included: + // true or false + // `options.keepNullNodes` whether nodes with null values will be kept + // or ignored: true or false + // `options.keepNullAttributes` whether attributes with null values will be + // kept or ignored: true or false + // `options.ignoreDecorators` whether decorator strings will be ignored when + // converting JS objects: true or false + // `options.separateArrayItems` whether array items are created as separate + // nodes when passed as an object value: true or false + // `options.noDoubleEncoding` whether existing html entities are encoded: + // true or false + // `options.stringify` a set of functions to use for converting values to + // strings + // `options.writer` the default XML writer to use for converting nodes to + // string. If the default writer is not set, the built-in XMLStringWriter + // will be used instead. + module.exports.create = function(name, xmldec, doctype, options) { + var doc, root; + if (name == null) { + throw new Error("Root element needs a name."); + } + options = assign({}, xmldec, doctype, options); + // create the document node + doc = new XMLDocument(options); + // add the root node + root = doc.element(name); + // prolog + if (!options.headless) { + doc.declaration(options); + if ((options.pubID != null) || (options.sysID != null)) { + doc.dtd(options); + } + } + return root; + }; + + // Creates a new document and returns the document node for + // chain-building the document tree + + // `options.keepNullNodes` whether nodes with null values will be kept + // or ignored: true or false + // `options.keepNullAttributes` whether attributes with null values will be + // kept or ignored: true or false + // `options.ignoreDecorators` whether decorator strings will be ignored when + // converting JS objects: true or false + // `options.separateArrayItems` whether array items are created as separate + // nodes when passed as an object value: true or false + // `options.noDoubleEncoding` whether existing html entities are encoded: + // true or false + // `options.stringify` a set of functions to use for converting values to + // strings + // `options.writer` the default XML writer to use for converting nodes to + // string. If the default writer is not set, the built-in XMLStringWriter + // will be used instead. + + // `onData` the function to be called when a new chunk of XML is output. The + // string containing the XML chunk is passed to `onData` as its single + // argument. + // `onEnd` the function to be called when the XML document is completed with + // `end`. `onEnd` does not receive any arguments. + module.exports.begin = function(options, onData, onEnd) { + if (isFunction(options)) { + [onData, onEnd] = [options, onData]; + options = {}; + } + if (onData) { + return new XMLDocumentCB(options, onData, onEnd); + } else { + return new XMLDocument(options); + } + }; + + module.exports.stringWriter = function(options) { + return new XMLStringWriter(options); + }; + + module.exports.streamWriter = function(stream, options) { + return new XMLStreamWriter(stream, options); + }; + + module.exports.implementation = new XMLDOMImplementation(); + + module.exports.nodeType = NodeType; + + module.exports.writerState = WriterState; + +}).call(this); diff --git a/node_modules/xmlbuilder/package.json b/node_modules/xmlbuilder/package.json new file mode 100644 index 00000000..4f5ae342 --- /dev/null +++ b/node_modules/xmlbuilder/package.json @@ -0,0 +1,38 @@ +{ + "name": "xmlbuilder", + "version": "13.0.2", + "keywords": [ + "xml", + "xmlbuilder" + ], + "homepage": "http://github.com/oozcitak/xmlbuilder-js", + "description": "An XML builder for node.js", + "author": "Ozgur Ozcitak ", + "contributors": [], + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/oozcitak/xmlbuilder-js.git" + }, + "bugs": { + "url": "http://github.com/oozcitak/xmlbuilder-js/issues" + }, + "main": "./lib/index", + "typings": "./typings/index.d.ts", + "engines": { + "node": ">=6.0" + }, + "dependencies": {}, + "devDependencies": { + "coffee-coverage": "*", + "coffeescript": "*", + "coveralls": "*", + "mocha": "*", + "nyc": "*", + "xpath": "*" + }, + "scripts": { + "prepublishOnly": "coffee -co lib src", + "test": "nyc mocha \"test/**/*.coffee\"" + } +} diff --git a/node_modules/xmlbuilder/typings/index.d.ts b/node_modules/xmlbuilder/typings/index.d.ts new file mode 100644 index 00000000..70095d46 --- /dev/null +++ b/node_modules/xmlbuilder/typings/index.d.ts @@ -0,0 +1,1761 @@ + +import { Writable } from 'stream'; + +export = xmlbuilder; + +/** + * Type definitions for [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) + * + * Original definitions on [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) by: + * - Wallymathieu + * - GaikwadPratik + */ +declare namespace xmlbuilder { + /** + * Creates a new XML document and returns the root element node. + * + * @param nameOrObject - name of the root element or a JS object to be + * converted to an XML tree + * @param xmldecOrOptions - XML declaration or create options + * @param doctypeOrOptions - Doctype declaration or create options + * @param options - create options + */ + function create(nameOrObject: string | { [name: string]: Object }, + xmldecOrOptions?: CreateOptions, doctypeOrOptions?: CreateOptions, + options?: CreateOptions): XMLElement; + + /** + * Defines the options used while creating an XML document with the `create` + * function. + */ + interface CreateOptions { + /** + * A version number string, e.g. `1.0` + */ + version?: string; + /** + * Encoding declaration, e.g. `UTF-8` + */ + encoding?: string; + /** + * Standalone document declaration: `true` or `false` + */ + standalone?: boolean; + + /** + * Public identifier of the DTD + */ + pubID?: string; + /** + * System identifier of the DTD + */ + sysID?: string; + + /** + * Whether XML declaration and doctype will be included + */ + headless?: boolean; + /** + * Whether nodes with `null` values will be kept or ignored + */ + keepNullNodes?: boolean; + /** + * Whether attributes with `null` values will be kept or ignored + */ + keepNullAttributes?: boolean; + /** + * Whether decorator strings will be ignored when converting JS + * objects + */ + ignoreDecorators?: boolean; + /** + * Whether array items are created as separate nodes when passed + * as an object value + */ + separateArrayItems?: boolean; + /** + * Whether existing html entities are encoded + */ + noDoubleEncoding?: boolean; + /** + * Whether values will be validated and escaped or returned as is + */ + noValidation?: boolean; + /** + * A set of functions to use for converting values to strings + */ + stringify?: XMLStringifier; + /** + * The default XML writer to use for converting nodes to string. + * If the default writer is not set, the built-in `XMLStringWriter` + * will be used instead. + */ + writer?: XMLWriter; + } + + /** + * Defines the functions used for converting values to strings. + */ + interface XMLStringifier { + /** + * Converts an element or attribute name to string + */ + name?: (v: any) => string; + /** + * Converts the contents of a text node to string + */ + text?: (v: any) => string; + /** + * Converts the contents of a CDATA node to string + */ + cdata?: (v: any) => string; + /** + * Converts the contents of a comment node to string + */ + comment?: (v: any) => string; + /** + * Converts the contents of a raw text node to string + */ + raw?: (v: any) => string; + /** + * Converts attribute value to string + */ + attValue?: (v: any) => string; + /** + * Converts processing instruction target to string + */ + insTarget?: (v: any) => string; + /** + * Converts processing instruction value to string + */ + insValue?: (v: any) => string; + /** + * Converts XML version to string + */ + xmlVersion?: (v: any) => string; + /** + * Converts XML encoding to string + */ + xmlEncoding?: (v: any) => string; + /** + * Converts standalone document declaration to string + */ + xmlStandalone?: (v: any) => string; + /** + * Converts DocType public identifier to string + */ + dtdPubID?: (v: any) => string; + /** + * Converts DocType system identifier to string + */ + dtdSysID?: (v: any) => string; + /** + * Converts `!ELEMENT` node content inside Doctype to string + */ + dtdElementValue?: (v: any) => string; + /** + * Converts `!ATTLIST` node type inside DocType to string + */ + dtdAttType?: (v: any) => string; + /** + * Converts `!ATTLIST` node default value inside DocType to string + */ + dtdAttDefault?: (v: any) => string; + /** + * Converts `!ENTITY` node content inside Doctype to string + */ + dtdEntityValue?: (v: any) => string; + /** + * Converts `!NOTATION` node content inside Doctype to string + */ + dtdNData?: (v: any) => string; + + /** + * When prepended to a JS object key, converts the key-value pair + * to an attribute. + */ + convertAttKey?: string; + /** + * When prepended to a JS object key, converts the key-value pair + * to a processing instruction node. + */ + convertPIKey?: string; + /** + * When prepended to a JS object key, converts its value to a text node. + * + * _Note:_ Since JS objects cannot contain duplicate keys, multiple text + * nodes can be created by adding some unique text after each object + * key. For example: `{ '#text1': 'some text', '#text2': 'more text' };` + */ + convertTextKey?: string; + /** + * When prepended to a JS object key, converts its value to a CDATA + * node. + */ + convertCDataKey?: string; + /** + * When prepended to a JS object key, converts its value to a + * comment node. + */ + convertCommentKey?: string; + /** + * When prepended to a JS object key, converts its value to a raw + * text node. + */ + convertRawKey?: string; + + /** + * Escapes special characters in text. + */ + textEscape?: (v: string) => string; + + /** + * Escapes special characters in attribute values. + */ + attEscape?: (v: string) => string; + } + + /** + * Represents a writer which outputs an XML document. + */ + interface XMLWriter { + /** + * Writes the indentation string for the given level. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + indent?: (node: XMLNode, options: WriterOptions, level: number) => any + + /** + * Writes the newline string. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + endline?: (node: XMLNode, options: WriterOptions, level: number) => any + + /** + * Writes an attribute. + * + * @param att - current attribute + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + attribute?: (att: XMLAttribute, options: WriterOptions, + level: number) => any + + /** + * Writes a CDATA node. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + cdata?: (node: XMLCData, options: WriterOptions, level: number) => any + + /** + * Writes a comment node. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + comment?: (node: XMLComment, options: WriterOptions, + level: number) => any + + /** + * Writes the XML declaration (e.g. ``). + * + * @param node - XML declaration node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + declaration?: (node: XMLDeclaration, options: WriterOptions, + level: number) => any + + /** + * Writes the DocType node and its children. + * + * _Note:_ Be careful when overriding this function as this function + * is also responsible for writing the internal subset of the DTD. + * + * @param node - DOCTYPE node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + docType?: (node: XMLDocType, options: WriterOptions, + level: number) => any + + /** + * Writes an element node. + * + * _Note:_ Be careful when overriding this function as this function + * is also responsible for writing the element attributes and child + * nodes. + * + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + element?: (node: XMLElement, options: WriterOptions, + level: number) => any + + /** + * Writes a processing instruction node. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + processingInstruction?: (node: XMLProcessingInstruction, + options: WriterOptions, level: number) => any + + /** + * Writes a raw text node. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + raw?: (node: XMLRaw, options: WriterOptions, level: number) => any + + /** + * Writes a text node. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + text?: (node: XMLText, options: WriterOptions, level: number) => any + + /** + * Writes an attribute node (`!ATTLIST`) inside the DTD. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + dtdAttList?: (node: XMLDTDAttList, options: WriterOptions, + level: number) => any + + /** + * Writes an element node (`!ELEMENT`) inside the DTD. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + dtdElement?: (node: XMLDTDElement, options: WriterOptions, + level: number) => any + + /** + * Writes an entity node (`!ENTITY`) inside the DTD. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + dtdEntity?: (node: XMLDTDEntity, options: WriterOptions, + level: number) => any + + /** + * Writes a notation node (`!NOTATION`) inside the DTD. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + dtdNotation?: (node: XMLDTDNotation, options: WriterOptions, + level: number) => any + + /** + * Called right after starting writing a node. This function does not + * produce any output, but can be used to alter the state of the writer. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + openNode?: (node: XMLNode, options: WriterOptions, + level: number) => void + + /** + * Called right before completing writing a node. This function does not + * produce any output, but can be used to alter the state of the writer. + * + * @param node - current node + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + closeNode?: (node: XMLNode, options: WriterOptions, + level: number) => void + + /** + * Called right after starting writing an attribute. This function does + * not produce any output, but can be used to alter the state of the + * writer. + * + * @param node - current attribute + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + openAttribute?: (att: XMLAttribute, options: WriterOptions, + level: number) => void + + /** + * Called right before completing writing an attribute. This function + * does not produce any output, but can be used to alter the state of + * the writer. + * + * @param node - current attribute + * @param options - writer options and state information + * @param level - current depth of the XML tree + */ + closeAttribute?: (att: XMLAttribute, options: WriterOptions, + level: number) => void + } + + /** + * Defines the options passed to the XML writer. + */ + interface WriterOptions { + /** + * Pretty print the XML tree + */ + pretty?: boolean; + /** + * Indentation string for pretty printing + */ + indent?: string; + /** + * Newline string for pretty printing + */ + newline?: string; + /** + * A fixed number of indents to offset strings + */ + offset?: number; + /** + * Maximum column width + */ + width?: number; + /** + * Whether to output closing tags for empty element nodes + */ + allowEmpty?: boolean; + /** + * Whether to pretty print text nodes + */ + dontPrettyTextNodes?: boolean; + /** + * A string to insert before closing slash character + */ + spaceBeforeSlash?: string | boolean; + /** + * User state object that is saved between writer functions + */ + user?: any; + /** + * The current state of the writer + */ + state?: WriterState; + /** + * Writer function overrides + */ + writer?: XMLWriter; + } + + /** + * Defines the state of the writer. + */ + enum WriterState { + /** + * Writer state is unknown + */ + None = 0, + /** + * Writer is at an opening tag, e.g. `` + */ + OpenTag = 1, + /** + * Writer is inside an element + */ + InsideTag = 2, + /** + * Writer is at a closing tag, e.g. `` + */ + CloseTag = 3 + } + + /** + * Creates a new XML document and returns the document node. + * This function creates an empty document without the XML prolog or + * a root element. + * + * @param options - create options + */ + function begin(options?: BeginOptions): XMLDocument; + + /** + * Defines the options used while creating an XML document with the `begin` + * function. + */ + interface BeginOptions { + /** + * Whether nodes with null values will be kept or ignored + */ + keepNullNodes?: boolean; + /** + * Whether attributes with null values will be kept or ignored + */ + keepNullAttributes?: boolean; + /** + * Whether decorator strings will be ignored when converting JS + * objects + */ + ignoreDecorators?: boolean; + /** + * Whether array items are created as separate nodes when passed + * as an object value + */ + separateArrayItems?: boolean; + /** + * Whether existing html entities are encoded + */ + noDoubleEncoding?: boolean; + /** + * Whether values will be validated and escaped or returned as is + */ + noValidation?: boolean; + /** + * A set of functions to use for converting values to strings + */ + stringify?: XMLStringifier; + /** + * The default XML writer to use for converting nodes to string. + * If the default writer is not set, the built-in XMLStringWriter + * will be used instead. + */ + writer?: XMLWriter | WriterOptions; + } + + /** + * A function to be called when a chunk of XML is written. + * + * @param chunk - a chunk of string that was written + * @param level - current depth of the XML tree + */ + type OnDataCallback = (chunk: string, level: number) => void; + + /** + * A function to be called when the XML doucment is completed. + */ + type OnEndCallback = () => void; + + /** + * Creates a new XML document in callback mode and returns the document + * node. + * + * @param options - create options + * @param onData - the function to be called when a new chunk of XML is + * output. The string containing the XML chunk is passed to `onData` as + * its first argument and the current depth of the tree is passed as its + * second argument. + * @param onEnd - the function to be called when the XML document is + * completed with `end`. `onEnd` does not receive any arguments. + */ + function begin(options?: BeginOptions | OnDataCallback, + onData?: OnDataCallback | OnEndCallback, + onEnd?: OnEndCallback): XMLDocumentCB; + + /** + * Creates and returns a default string writer. + * + * @param options - writer options + */ + function stringWriter(options?: WriterOptions): XMLWriter + + /** + * Creates and returns a default stream writer. + * + * @param stream - a writeable stream + * @param options - writer options + */ + function streamWriter(stream: Writable, options?: WriterOptions): XMLWriter + + /** + * Defines the type of a node in the XML document. + */ + enum NodeType { + /** + * An element node + */ + Element = 1, + /** + * An attribute node + */ + Attribute = 2, + /** + * A text node + */ + Text = 3, + /** + * A CDATA node + */ + CData = 4, + /** + * An entity reference node inside DocType + */ + EntityReference = 5, + /** + * An entity declaration node inside DocType + */ + EntityDeclaration = 6, + /** + * A processing instruction node + */ + ProcessingInstruction = 7, + /** + * A comment node + */ + Comment = 8, + /** + * A document node + */ + Document = 9, + /** + * A Doctype node + */ + DocType = 10, + /** + * A document fragment node + */ + DocumentFragment = 11, + /** + * A notation declaration node inside DocType + */ + NotationDeclaration = 12, + /** + * An XML declaration node + */ + Declaration = 201, + /** + * A raw text node + */ + Raw = 202, + /** + * An attribute declaraiton node inside DocType + */ + AttributeDeclaration = 203, + /** + * An element declaration node inside DocType + */ + ElementDeclaration = 204 + } + + /** + * Defines the type of a node in the XML document. + */ + export import nodeType = NodeType; + + /** + * Defines the state of the writer. + */ + export import writerState = WriterState; + + /** + * Defines the settings used when converting the XML document to string. + */ + interface XMLToStringOptions { + /** + * Pretty print the XML tree + */ + pretty?: boolean; + /** + * Indentation string for pretty printing + */ + indent?: string; + /** + * Newline string for pretty printing + */ + newline?: string; + /** + * A fixed number of indents to offset strings + */ + offset?: number; + /** + * Maximum column width + */ + width?: number; + /** + * Whether to output closing tags for empty element nodes + */ + allowEmpty?: boolean; + /** + * Whether to pretty print text nodes + */ + dontPrettyTextNodes?: boolean; + /** + * A string to insert before closing slash character + */ + spaceBeforeSlash?: string | boolean; + /** + * The default XML writer to use for converting nodes to string. + * If the default writer is not set, the built-in `XMLStringWriter` + * will be used instead. + */ + writer?: XMLWriter; + } + + /** + * Represents the XML document. + */ + class XMLDocument extends XMLNode { + /** + * Converts the node to string + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + } + + /** + * Represents an XML attribute. + */ + class XMLAttribute { + /** + * Type of the node + */ + type: NodeType; + /** + * Parent element node + */ + parent: XMLElement; + /** + * Attribute name + */ + name: string; + /** + * Attribute value + */ + value: string; + + /** + * Creates a clone of this node + */ + clone(): XMLAttribute; + + /** + * Converts the node to string + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + } + + /** + * Represents the base class of XML nodes. + */ + abstract class XMLNode { + /** + * Type of the node + */ + type: NodeType; + /** + * Parent element node + */ + parent: XMLElement; + /** + * Child nodes + */ + children: XMLNode[] + + /** + * Creates a new child node and appends it to the list of child nodes. + * + * _Aliases:_ `ele` and `e` + * + * @param name - node name or a JS object defining the nodes to insert + * @param attributes - node attributes + * @param text - node text + * + * @returns the last top level node created + */ + element(name: any, attributes?: Object, text?: any): XMLElement; + ele(name: any, attributes?: Object, text?: any): XMLElement; + e(name: any, attributes?: Object, text?: any): XMLElement; + + /** + * Adds or modifies an attribute. + * + * _Aliases:_ `att`, `a` + * + * @param name - attribute name + * @param value - attribute value + * + * @returns the parent element node + */ + attribute(name: any, value?: any): XMLElement; + att(name: any, value?: any): XMLElement; + a(name: any, value?: any): XMLElement; + + /** + * Creates a new sibling node and inserts it before this node. + * + * @param name - node name or a JS object defining the nodes to insert + * @param attributes - node attributes + * @param text - node text + * + * @returns the new node + */ + insertBefore(name: any, attributes?: Object, text?: any): XMLElement; + /** + * Creates a new sibling node and inserts it after this node. + * + * @param name - node name or a JS object defining the nodes to insert + * @param attributes - node attributes + * @param text - node text + * + * @returns the new node + */ + insertAfter(name: any, attributes?: Object, text?: any): XMLElement; + /** + * Removes this node from the tree. + * + * @returns the parent node + */ + remove(): XMLElement; + + /** + * Creates a new element node and appends it to the list of child nodes. + * + * _Aliases:_ `nod` and `n` + * + * @param name - element node name + * @param attributes - node attributes + * @param text - node text + * + * @returns the node created + */ + node(name: string, attributes?: Object, text?: any): XMLElement; + nod(name: string, attributes?: Object, text?: any): XMLElement; + n(name: string, attributes?: Object, text?: any): XMLElement; + + /** + * Creates a new text node and appends it to the list of child nodes. + * + * _Aliases:_ `txt` and `t` + * + * @param value - node value + * + * @returns the parent node + */ + text(value: string): XMLElement; + txt(value: string): XMLElement; + t(value: string): XMLElement; + + /** + * Creates a new CDATA node and appends it to the list of child nodes. + * + * _Aliases:_ `dat` and `d` + * + * @param value - node value + * + * @returns the parent node + */ + cdata(value: string): XMLElement; + dat(value: string): XMLElement; + d(value: string): XMLElement; + + /** + * Creates a new comment node and appends it to the list of child nodes. + * + * _Aliases:_ `com` and `c` + * + * @param value - node value + * + * @returns the parent node + */ + comment(value: string): XMLElement; + com(value: string): XMLElement; + c(value: string): XMLElement; + + /** + * Creates a comment node before the current node + * + * @param value - node value + * + * @returns the parent node + */ + commentBefore(value: string): XMLElement; + + /** + * Creates a comment node after the current node + * + * @param value - node value + * + * @returns the parent node + */ + commentAfter(value: string): XMLElement; + + /** + * Creates a new raw text node and appends it to the list of child + * nodes. + * + * _Alias:_ `r` + * + * @param value - node value + * + * @returns the parent node + */ + raw(value: string): XMLElement; + r(value: string): XMLElement; + + /** + * Creates a new processing instruction node and appends it to the list + * of child nodes. + * + * _Aliases:_ `ins` and `i` + * + * @param target - node target + * @param value - node value + * + * @returns the parent node + */ + instruction(target: string, value: any): XMLElement; + instruction(array: Array): XMLElement; + instruction(obj: Object): XMLElement; + ins(target: string, value: any): XMLElement; + ins(array: Array): XMLElement; + ins(obj: Object): XMLElement; + i(target: string, value: any): XMLElement; + i(array: Array): XMLElement; + i(obj: Object): XMLElement; + + /** + * Creates a processing instruction node before the current node. + * + * @param target - node target + * @param value - node value + * + * @returns the parent node + */ + instructionBefore(target: string, value: any): XMLElement; + + /** + * Creates a processing instruction node after the current node. + * + * @param target - node target + * @param value - node value + * + * @returns the parent node + */ + instructionAfter(target: string, value: any): XMLElement; + + /** + * Creates the XML declaration. + * + * _Alias:_ `dec` + * + * @param version - version number string, e.g. `1.0` + * @param encoding - encoding declaration, e.g. `UTF-8` + * @param standalone - standalone document declaration: `true` or `false` + * + * @returns the root element node + */ + declaration(version?: string | + { version?: string, encoding?: string, standalone?: boolean }, + encoding?: string, standalone?: boolean): XMLElement; + dec(version?: string | + { version?: string, encoding?: string, standalone?: boolean }, + encoding?: string, standalone?: boolean): XMLElement; + + /** + * Creates the document type definition. + * + * _Alias:_ `dtd` + * + * @param pubID - public identifier of the DTD + * @param sysID - system identifier of the DTD + * + * @returns the DOCTYPE node + */ + doctype(pubID?: string | { pubID?: string, sysID?: string }, + sysID?: string): XMLDocType; + dtd(pubID?: string | { pubID?: string, sysID?: string }, + sysID?: string): XMLDocType; + + /** + * Takes the root node of the given XML document and appends it + * to child nodes. + * + * @param doc - the document whose root node to import + * + * @returns the current node + */ + importDocument(doc: XMLNode): XMLElement; + + /** + * Converts the XML document to string. + * + * @param options - conversion options + */ + end(options?: XMLWriter | XMLToStringOptions): string; + + /** + * Returns the previous sibling node. + */ + prev(): XMLNode; + /** + * Returns the next sibling node. + */ + next(): XMLNode; + /** + * Returns the parent node. + * + * _Alias:_ `u` + */ + up(): XMLElement; + u(): XMLElement; + /** + * Returns the document node. + * + * _Alias:_ `doc` + */ + document(): XMLDocument; + doc(): XMLDocument; + + /** + * Returns the root element node. + */ + root(): XMLElement; + } + + /** + * Represents the base class of character data nodes. + */ + abstract class XMLCharacterData extends XMLNode { + /** + * Node value + */ + value: string; + } + + /** + * Represents a CDATA node. + */ + class XMLCData extends XMLCharacterData { + /** + * Converts the node to string + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + + /** + * Creates a clone of this node + */ + clone(): XMLCData; + } + + /** + * Represents a comment node. + */ + class XMLComment extends XMLCharacterData { + /** + * Converts the node to string + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + + /** + * Creates a clone of this node + */ + clone(): XMLComment; + } + + /** + * Represents a processing instruction node. + */ + class XMLProcessingInstruction extends XMLCharacterData { + /** Instruction target + */ + target: string; + + /** + * Converts the node to string + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + + /** + * Creates a clone of this node + */ + clone(): XMLProcessingInstruction; + } + + /** + * Represents a raw text node. + */ + class XMLRaw extends XMLCharacterData { + /** + * Converts the node to string + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + + /** + * Creates a clone of this node + */ + clone(): XMLRaw; + } + + /** + * Represents a text node. + */ + class XMLText extends XMLCharacterData { + /** + * Converts the node to string + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + + /** + * Creates a clone of this node + */ + clone(): XMLText; + } + + /** + * Represents the XML declaration. + */ + class XMLDeclaration { + /** + * A version number string, e.g. `1.0` + */ + version: string; + /** + * Encoding declaration, e.g. `UTF-8` + */ + encoding: string; + /** + * Standalone document declaration: `true` or `false` + */ + standalone: boolean; + + /** + * Converts the node to string. + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + } + + /** + * Represents the document type definition. + */ + class XMLDocType { + /** + * Type of the node + */ + type: NodeType; + /** + * Parent element node + */ + parent: XMLElement; + /** + * Child nodes + */ + children: XMLNode[] + + /** + * Public identifier of the DTD + */ + pubID: string; + /** + * System identifier of the DTD + */ + sysID: string; + + /** + * Creates an element type declaration. + * + * _Alias:_ `ele` + * + * @param name - element name + * @param value - element content (defaults to `#PCDATA`) + * + * @returns the DOCTYPE node + */ + element(name: string, value?: Object): XMLDocType; + ele(name: string, value?: Object): XMLDocType; + + /** + * Creates an attribute declaration. + * + * _Alias:_ `att` + * + * @param elementName - the name of the element containing this attribute + * @param attributeName - attribute name + * @param attributeType - type of the attribute + * @param defaultValueType - default value type (either `#REQUIRED`, + * `#IMPLIED`, `#FIXED` or `#DEFAULT`) + * @param defaultValue - default value of the attribute (only used + * for `#FIXED` or `#DEFAULT`) + * + * @returns the DOCTYPE node + */ + attList(elementName: string, attributeName: string, attributeType: string, + defaultValueType: string, defaultValue?: any): XMLDocType; + att(elementName: string, attributeName: string, attributeType: string, + defaultValueType: string, defaultValue?: any): XMLDocType; + + /** + * Creates a general entity declaration. + * + * _Alias:_ `ent` + * + * @param name - the name of the entity + * @param value - entity parameters + * + * @returns the DOCTYPE node + */ + entity(name: string, value: string | + { pubID?: string, sysID?: string, nData?: string }): XMLDocType; + ent(name: string, value: string | + { pubID?: string, sysID?: string, nData?: string }): XMLDocType; + + /** + * Creates a parameter entity declaration. + * + * _Alias:_ `pent` + * + * @param name - the name of the entity + * @param value - entity parameters + * + * @returns the DOCTYPE node + */ + pEntity(name: string, value: string | + { pubID?: string, sysID?: string }): XMLDocType; + pent(name: string, value: string | + { pubID?: string, sysID?: string }): XMLDocType; + + /** + * Creates a notation declaration. + * + * _Alias:_ `not` + * + * @param name - the name of the entity + * @param value - entity parameters + * + * @returns the DOCTYPE node + */ + notation(name: string, + value: { pubID?: string, sysID?: string }): XMLDocType; + not(name: string, + value: { pubID?: string, sysID?: string }): XMLDocType; + + /** + * Creates a new CDATA node and appends it to the list of child nodes. + * + * _Alias:_ `dat` + * + * @param value - node value + * + * @returns the DOCTYPE node + */ + cdata(value: string): XMLDocType; + dat(value: string): XMLDocType; + + /** + * Creates a new comment child and appends it to the list of child + * nodes. + * + * _Alias:_ `com` + * + * @param value - node value + * + * @returns the DOCTYPE node + */ + comment(value: string): XMLDocType; + com(value: string): XMLDocType; + + /** + * Creates a new processing instruction node and appends it to the list + * of child nodes. + * + * _Alias:_ `ins` + * + * @param target - node target + * @param value - node value + * + * @returns the DOCTYPE node + */ + instruction(target: string, value: any): XMLDocType; + instruction(array: Array): XMLDocType; + instruction(obj: Object): XMLDocType; + ins(target: string, value: any): XMLDocType; + ins(array: Array): XMLDocType; + ins(obj: Object): XMLDocType; + + /** + * Returns the root element node. + * + * _Alias:_ `up` + */ + root(): XMLElement; + up(): XMLElement; + + /** + * Converts the node to string. + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + + /** + * Creates a clone of this node. + */ + clone(): XMLDocType; + + /** + * Returns the document node. + * + * _Alias:_ `doc` + */ + document(): XMLDocument; + doc(): XMLDocument; + + /** + * Converts the XML document to string. + * + * @param options - conversion options + */ + end(options?: XMLWriter | XMLToStringOptions): string; + } + + /** + * Represents an attribute list in the DTD. + */ + class XMLDTDAttList { + /** + * The name of the element containing this attribute + */ + elementName: string; + /** + * Attribute name + */ + attributeName: string; + /** + * Type of the attribute + */ + attributeType: string; + /** + * Default value type (either `#REQUIRED`, `#IMPLIED`, `#FIXED` + * or `#DEFAULT`) + */ + defaultValueType: string; + /** + * Default value of the attribute (only used for `#FIXED` or + * `#DEFAULT`) + */ + defaultValue: string; + + /** + * Converts the node to string. + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + } + + /** + * Represents an element in the DTD. + */ + class XMLDTDElement { + /** + * The name of the element + */ + name: string; + /** + * Element content + */ + value: string; + + /** + * Converts the node to string. + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + } + + /** + * Represents an entity in the DTD. + */ + class XMLDTDEntity { + /** + * Determines whether this is a parameter entity (`true`) or a + * general entity (`false`). + */ + pe: boolean; + /** + * The name of the entity + */ + name: string; + /** + * Public identifier + */ + pubID: string; + /** + * System identifier + */ + sysID: string; + /** + * Notation declaration + */ + nData: string; + + /** + * Converts the node to string. + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + } + + /** + * Represents a notation in the DTD. + */ + class XMLDTDNotation { + /** + * The name of the notation + */ + name: string; + /** + * Public identifier + */ + pubID: string; + /** + * System identifier + */ + sysID: string; + + /** + * Converts the node to string. + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + } + + /** + * Represents an element node. + */ + class XMLElement extends XMLNode { + /** + * Element node name + */ + name: string; + /** + * Element attributes + */ + attribs: { string: XMLAttribute }; + + /** + * Creates a clone of this node + */ + clone(): XMLElement; + + /** + * Adds or modifies an attribute. + * + * _Aliases:_ `att`, `a` + * + * @param name - attribute name + * @param value - attribute value + * + * @returns the parent element node + */ + attribute(name: any, value?: any): XMLElement; + att(name: any, value?: any): XMLElement; + a(name: any, value?: any): XMLElement; + + /** + * Removes an attribute. + * + * @param name - attribute name + * + * @returns the parent element node + */ + removeAttribute(name: string | string[]): XMLElement; + + /** + * Converts the node to string. + * + * @param options - conversion options + */ + toString(options?: XMLToStringOptions): string; + } + + /** + * Represents an XML document builder used in callback mode with the + * `begin` function. + */ + class XMLDocumentCB { + + /** + * Creates a new child node and appends it to the list of child nodes. + * + * _Aliases:_ `nod` and `n` + * + * @param name - element node name + * @param attributes - node attributes + * @param text - node text + * + * @returns the document builder object + */ + node(name: string, attributes?: Object, text?: any): XMLDocumentCB; + nod(name: string, attributes?: Object, text?: any): XMLDocumentCB; + n(name: string, attributes?: Object, text?: any): XMLDocumentCB; + + /** + * Creates a child element node. + * + * _Aliases:_ `ele` and `e` + * + * @param name - element node name or a JS object defining the nodes + * to insert + * @param attributes - node attributes + * @param text - node text + * + * @returns the document builder object + */ + element(name: any, attributes?: Object, text?: any): XMLDocumentCB; + ele(name: any, attributes?: Object, text?: any): XMLDocumentCB; + e(name: any, attributes?: Object, text?: any): XMLDocumentCB; + + /** + * Adds or modifies an attribute. + * + * _Aliases:_ `att` and `a` + * + * @param name - attribute name + * @param value - attribute value + * + * @returns the document builder object + */ + attribute(name: any, value?: any): XMLDocumentCB; + att(name: any, value?: any): XMLDocumentCB; + a(name: any, value?: any): XMLDocumentCB; + + /** + * Creates a new text node and appends it to the list of child nodes. + * + * _Aliases:_ `txt` and `t` + * + * @param value - node value + * + * @returns the document builder object + */ + text(value: string): XMLDocumentCB; + txt(value: string): XMLDocumentCB; + t(value: string): XMLDocumentCB; + + /** + * Creates a new CDATA node and appends it to the list of child nodes. + * + * _Aliases:_ `dat` and `d` + * + * @param value - node value + * + * @returns the document builder object + */ + cdata(value: string): XMLDocumentCB; + dat(value: string): XMLDocumentCB; + d(value: string): XMLDocumentCB; + + /** + * Creates a new comment node and appends it to the list of child nodes. + * + * _Aliases:_ `com` and `c` + * + * @param value - node value + * + * @returns the document builder object + */ + comment(value: string): XMLDocumentCB; + com(value: string): XMLDocumentCB; + c(value: string): XMLDocumentCB; + + /** + * Creates a new raw text node and appends it to the list of child + * nodes. + * + * _Alias:_ `r` + * + * @param value - node value + * + * @returns the document builder object + */ + raw(value: string): XMLDocumentCB; + r(value: string): XMLDocumentCB; + + /** + * Creates a new processing instruction node and appends it to the list + * of child nodes. + * + * _Aliases:_ `ins` and `i` + * + * @param target - node target + * @param value - node value + * + * @returns the document builder object + */ + instruction(target: string, value: any): XMLDocumentCB; + instruction(array: Array): XMLDocumentCB; + instruction(obj: Object): XMLDocumentCB; + ins(target: string, value: any): XMLDocumentCB; + ins(array: Array): XMLDocumentCB; + ins(obj: Object): XMLDocumentCB; + i(target: string, value: any): XMLDocumentCB; + i(array: Array): XMLDocumentCB; + i(obj: Object): XMLDocumentCB; + + /** + * Creates the XML declaration. + * + * _Alias:_ `dec` + * + * @param version - version number string, e.g. `1.0` + * @param encoding - encoding declaration, e.g. `UTF-8` + * @param standalone - standalone document declaration: `true` or `false` + * + * @returns the document builder object + */ + declaration(version?: string, encoding?: string, + standalone?: boolean): XMLDocumentCB; + dec(version?: string, encoding?: string, + standalone?: boolean): XMLDocumentCB; + + /** + * Creates the document type definition. + * + * _Alias:_ `dtd` + * + * @param root - the name of the root node + * @param pubID - public identifier of the DTD + * @param sysID - system identifier of the DTD + * + * @returns the document builder object + */ + doctype(root: string, pubID?: string, sysID?: string): XMLDocumentCB; + dtd(root: string, pubID?: string, sysID?: string): XMLDocumentCB; + + /** + * Creates an element type declaration. + * + * _Aliases:_ `element` and `ele` + * + * @param name - element name + * @param value - element content (defaults to `#PCDATA`) + * + * @returns the document builder object + */ + dtdElement(name: string, value?: Object): XMLDocumentCB; + element(name: string, value?: Object): XMLDocumentCB; + ele(name: string, value?: Object): XMLDocumentCB; + + /** + * Creates an attribute declaration. + * + * _Alias:_ `att` + * + * @param elementName - the name of the element containing this attribute + * @param attributeName - attribute name + * @param attributeType - type of the attribute (defaults to `CDATA`) + * @param defaultValueType - default value type (either `#REQUIRED`, + * `#IMPLIED`, `#FIXED` or `#DEFAULT`) (defaults to `#IMPLIED`) + * @param defaultValue - default value of the attribute (only used + * for `#FIXED` or `#DEFAULT`) + * + * @returns the document builder object + */ + attList(elementName: string, attributeName: string, + attributeType: string, defaultValueType?: + string, defaultValue?: any): XMLDocumentCB; + att(elementName: string, attributeName: string, attributeType: string, + defaultValueType?: string, defaultValue?: any): XMLDocumentCB; + a(elementName: string, attributeName: string, attributeType: string, + defaultValueType?: string, defaultValue?: any): XMLDocumentCB; + + /** + * Creates a general entity declaration. + * + * _Alias:_ `ent` + * + * @param name - the name of the entity + * @param value - entity parameters + * + * @returns the document builder object + */ + entity(name: string, value: string | + { pubID?: string, sysID?: string, nData?: string }): XMLDocumentCB; + ent(name: string, value: string | + { pubID?: string, sysID?: string, nData?: string }): XMLDocumentCB; + + /** + * Creates a parameter entity declaration. + * + * _Alias:_ `pent` + * + * @param name - the name of the entity + * @param value - entity parameters + * + * @returns the document builder object + */ + pEntity(name: string, value: string | + { pubID?: string, sysID?: string }): XMLDocumentCB; + pent(name: string, value: string | + { pubID?: string, sysID?: string }): XMLDocumentCB; + + /** + * Creates a notation declaration. + * + * _Alias:_ `not` + * + * @param name - the name of the entity + * @param value - entity parameters + * + * @returns the document builder object + */ + notation(name: string, + value: { pubID?: string, sysID?: string }): XMLDocumentCB; + not(name: string, + value: { pubID?: string, sysID?: string }): XMLDocumentCB; + + /** + * Ends the document and calls the `onEnd` callback function. + */ + end(): void; + + /** + * Moves up to the parent node. + * + * _Alias:_ `u` + * + * @returns the document builder object + */ + up(): XMLDocumentCB; + u(): XMLDocumentCB; + } + +} diff --git a/package-lock.json b/package-lock.json index ff7ce56d..dd50c325 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "ISC", "dependencies": { "bcrypt": "^5.1.1", - "bcryptjs": "^2.4.3", "date-fns": "^3.3.0", "dotenv": "^16.4.1", "express": "^4.18.2", @@ -18,6 +17,7 @@ "mongoose": "^8.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", + "twilio": "^4.22.0", "uuid": "^9.0.1" }, "devDependencies": { @@ -170,6 +170,21 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "dependencies": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -188,11 +203,6 @@ "node": ">= 10.0.0" } }, - "node_modules/bcryptjs": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", - "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -254,6 +264,11 @@ "node": ">=16.20.1" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -318,6 +333,17 @@ "color-support": "bin.js" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -369,6 +395,11 @@ "url": "https://github.com/sponsors/kossnocorp" } }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -390,6 +421,14 @@ "node": ">= 0.4" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -431,6 +470,14 @@ "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -532,6 +579,38 @@ "node": ">= 0.8" } }, + "node_modules/follow-redirects": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -872,6 +951,51 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/kareem": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", @@ -880,6 +1004,41 @@ "node": ">=12.0.0" } }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -1375,6 +1534,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -1403,6 +1567,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -1473,6 +1642,11 @@ "node": ">=8.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -1519,6 +1693,11 @@ "loose-envify": "^1.1.0" } }, + "node_modules/scmp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scmp/-/scmp-2.1.0.tgz", + "integrity": "sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==" + }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", @@ -1754,6 +1933,24 @@ "node": ">=14" } }, + "node_modules/twilio": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/twilio/-/twilio-4.22.0.tgz", + "integrity": "sha512-Dn4x9FxhuCorz2ddJ8/Z8o3G0rLmrQo0frF1MMwWqtLrOwQzhL7Ca/Fup8jqbfjD+JSG1L8DE9a3MGBDETDrNg==", + "dependencies": { + "axios": "^1.6.0", + "dayjs": "^1.11.9", + "https-proxy-agent": "^5.0.0", + "jsonwebtoken": "^9.0.0", + "qs": "^6.9.4", + "scmp": "^2.1.0", + "url-parse": "^1.5.9", + "xmlbuilder": "^13.0.2" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1780,6 +1977,15 @@ "node": ">= 0.8" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1846,6 +2052,14 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, + "node_modules/xmlbuilder": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz", + "integrity": "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ==", + "engines": { + "node": ">=6.0" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/package.json b/package.json index 365c08e9..57100e01 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "mongoose": "^8.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", + "twilio": "^4.22.0", "uuid": "^9.0.1" }, "devDependencies": { diff --git a/public/css/homePage.css b/public/css/homePage.css index d31d1d5f..d65aeee8 100644 --- a/public/css/homePage.css +++ b/public/css/homePage.css @@ -350,6 +350,8 @@ transform: scaleY(0.45); border-top: solid #fff; background-color: #1d1a39; width: 100%; + margin-left: 20%; + margin-right: -10%; } .left-footer{ width: 200px; @@ -492,8 +494,9 @@ transform: scaleY(0.45); font-size:2em ; } #X:hover{ - color: yellow; + color: #e91e63; font-size:2em ; + cursor: pointer; } .showButton{ border: none; @@ -505,4 +508,51 @@ transform: scaleY(0.45); } .showButton:hover{ text-decoration: underline; - } \ No newline at end of file + } + #notification-container { + position: fixed; + top: 0; + right: 0; + width: 400px; + z-index: 1000; + overflow: hidden; + margin-top: 25px; +} + +#notification-box { + background-color: #e91e63; + color: #ffffff; + font-family: 'Bebas Neue', sans-serif; ; + border-radius: 8px; + font-size: 1.5em; + padding: 10px; + display: none; + animation: slideDown 0.5s ease-in-out, slideUp 0.5s ease-in-out 9.5s forwards; + +} + +@keyframes slideDown { + from { + margin-top: -50px; /* Start from above the viewport */ + } + to { + margin-top: 0; /* Slide down to the top */ + } +} + +@keyframes slideUp { + from { + margin-top: 0; /* Start from the top */ + } + to { + margin-top: -50px; /* Slide up above the viewport */ + } +} + +.material-symbols-outlined { + font-variation-settings: + 'FILL' 0, + 'wght' 400, + 'GRAD' 0, + 'opsz' 24 +} \ No newline at end of file diff --git a/public/jsForPages/index.js b/public/jsForPages/index.js index 99a5f714..51b32bbe 100644 --- a/public/jsForPages/index.js +++ b/public/jsForPages/index.js @@ -63,9 +63,18 @@ function example() { // phone number validation will be here } catch(error) { console.error(error); + showNotification(error.message); // You might display these errors to the user in a more user-friendly way. } } +function showNotification(message) { + var notificationBox = document.getElementById("notification-box"); + notificationBox.textContent = message; + notificationBox.style.display = "block"; + setTimeout(function() { + notificationBox.style.display = "none"; + }, 10000); // Hide after 10 seconds +} diff --git a/public/jsForPages/shiftTracker.js b/public/jsForPages/shiftTracker.js index 6538660c..68391dd7 100644 --- a/public/jsForPages/shiftTracker.js +++ b/public/jsForPages/shiftTracker.js @@ -62,6 +62,44 @@ document.addEventListener("DOMContentLoaded", function () { } else if (!isTimeInClicked) { window.alert("You cannot punch out before you start your shift"); } + + + // twilio API for sending sms messages + + console.log('Sending confirmation message...'); + const accountSid = 'AC76be89cce69a7705839035004025d6eb'; + const authToken = '3b3743d083ccc4b19fbdf18f49473cd6'; + const twilioPhoneNumber = '+15168149425'; + const recipientPhoneNumber = '+14167311767'; + + const message = 'Your shift has ended.'; + + fetch(`https://api.twilio.com/2010-04-01/Accounts/${accountSid}/Messages`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Authorization': 'Basic ' + btoa(`${accountSid}:${authToken}`) + }, + body: new URLSearchParams({ + 'To': recipientPhoneNumber, + 'From': twilioPhoneNumber, + 'Body': message + }) + }) + .then(response => { + if (response.ok) { + console.log('Message sent successfully.'); + // Handle success + } else { + console.error('Failed to send message:', response.status, response.statusText); + response.text().then(errorMessage => console.error('Error details:', errorMessage)); + // Handle error + } + }) + .catch(error => { + console.error('Error:', error); + }); + }; // Get the break button element @@ -125,3 +163,7 @@ document.addEventListener("DOMContentLoaded", function () { } }); + + + + diff --git a/views/aboutUs.html b/views/aboutUs.html index 6525c29a..6a281c3f 100644 --- a/views/aboutUs.html +++ b/views/aboutUs.html @@ -4,8 +4,7 @@ About Us - - + @@ -34,14 +33,14 @@

- staff picture + staff picture

Henrique

Back-end Developer

- staff picture + staff picture

Evrim

Front-end Developer

diff --git a/views/index.html b/views/index.html index c002003a..dcd8879d 100644 --- a/views/index.html +++ b/views/index.html @@ -63,7 +63,9 @@

By CoffeeCollab

+
+
diff --git a/views/shiftTracker.html b/views/shiftTracker.html index 8cad8905..007dd7b5 100644 --- a/views/shiftTracker.html +++ b/views/shiftTracker.html @@ -4,17 +4,18 @@ Shift Tracker + - +
@@ -51,7 +52,7 @@ - +